Skip to content

Commit 8a241cd

Browse files
committed
Close #9 and close #8 - bump version
1 parent d5e02c9 commit 8a241cd

File tree

7 files changed

+26
-9
lines changed

7 files changed

+26
-9
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A collection of unstyled, headless custom elements designed to make building ric
55
## Overview
66

77
**Hyperkit**
8-
Version: 0.0.4
8+
Version: 0.0.5
99
[Github](https://github.com/hyperlaunch/hyperkit)
1010

1111
**Headless Elements, Supercharged UIs**
@@ -19,6 +19,8 @@ The monorepo includes the following elements:
1919
- **Popover**: A simple popover element for showing contextual information or interactive content in an overlay.
2020
- **Detail & Accordion**: Expandable content elements, with optional accordion functionality and smooth transitions.
2121
- **Select**: A flexible select element that integrates with inputs and fires change events on selection.
22+
- **Form**: Submit forms with Ajax, handle redirections, and display server responses.
23+
- **Link**: Fetch pages via Ajax, manage navigation, and enhance perceived speed.
2224
- **Fieldset Repeater**: A dynamic form component allowing users to add and remove repeated sets of input fields.
2325
- **Masked Input**: An input element for applying custom masks to user input.
2426
- **Sortable List**: A drag-and-drop sortable list with optional position tracking.

packages/docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hyperkitxyz/docs",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"dependencies": {
55
"@fontsource/poppins": "^5.1.0",
66
"@hyperkitxyz/elements": "workspace:*",

packages/docs/src/astro-components/Layout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const pageTitle = [title, name].filter(Boolean).join(" — ");
7373
<span
7474
class="px-2 py-1 text-xs font-medium shadow-sm rounded-full bg-zinc-300 dark:bg-zinc-700 text-zinc-800 dark:text-zinc-200"
7575
>
76-
0.0.4
76+
0.0.5
7777
</span>
7878
</h1>
7979

packages/elements/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@hyperkitxyz/elements",
33
"main": "./src/index.ts",
4-
"version": "0.0.4",
4+
"version": "0.0.5",
55
"repository": {
66
"type": "git",
77
"url": "git+https://github.com/hyperlaunch/hyperkit.git"

packages/elements/src/form.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ class HyperkitForm extends HyperkitViewTransitioner {
2525
}
2626

2727
get action() {
28-
return this.form?.action || document.location.href;
28+
return String(this.form?.action);
2929
}
3030

3131
async handleGet() {
32-
const queryString = new URLSearchParams(this.formData).toString();
32+
const formData = this.formData;
33+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
34+
const queryString = new URLSearchParams(formData as any).toString();
3335

34-
const url = `${this.action}?${queryString}`;
36+
const url = `${this.action?.split("?")[0]}?${queryString}`;
3537

3638
await this.startViewTransition();
3739
const html = await this.getPotentiallyCachedContent({ url, bust: true });

packages/elements/src/link.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,20 @@ class HyperkitLink extends HyperkitViewTransitioner {
2525
return String(this.anchor?.getAttribute("href"));
2626
}
2727

28-
async handleNavigation(event: Event) {
28+
opensOutsideTab(event: MouseEvent) {
29+
const isMiddleClick = event.button === 1;
30+
31+
const isCtrlOrMetaClick =
32+
(event.ctrlKey || event.metaKey) && event.button === 0;
33+
34+
const isShiftClick = event.shiftKey && event.button === 0;
35+
36+
return isMiddleClick || isCtrlOrMetaClick || isShiftClick;
37+
}
38+
39+
async handleNavigation(event: MouseEvent | TouchEvent) {
40+
if (event instanceof MouseEvent && this.opensOutsideTab(event)) return;
41+
2942
event.preventDefault();
3043

3144
try {

packages/elements/src/select.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class HyperkitSelect extends HyperkitDisclosureContent<{
114114

115115
this.value = current || undefined;
116116

117-
if (this.connectedInput) this.connectedInput.value = String(current);
117+
if (this.connectedInput) this.connectedInput.value = current;
118118

119119
this.fire("change", { detail: { previous, current } });
120120

0 commit comments

Comments
 (0)