@vertz/ui-primitives 0.2.20 → 0.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/{chunk-bew4bjgf.js → chunk-07yzsaaw.js} +5 -5
- package/dist/shared/{chunk-yr9yzpvq.js → chunk-279bzynx.js} +83 -58
- package/dist/shared/{chunk-sqs8kyb2.js → chunk-27xs9apd.js} +5 -5
- package/dist/shared/{chunk-dpsgb1xw.js → chunk-2db2dnp3.js} +6 -2
- package/dist/shared/{chunk-8ak7vdk1.js → chunk-2k8gxzdf.js} +5 -5
- package/dist/shared/{chunk-t1vkvsz2.js → chunk-3rp73gkd.js} +5 -5
- package/dist/shared/{chunk-7ffg0caj.js → chunk-4rf1m34c.js} +8 -6
- package/dist/shared/{chunk-gkddsbmh.js → chunk-56reyd5r.js} +22 -31
- package/dist/shared/{chunk-jctqs9m4.js → chunk-7867pr13.js} +36 -12
- package/dist/shared/{chunk-n9nwx58j.js → chunk-7bxsf80c.js} +4 -4
- package/dist/shared/{chunk-7krvqrwq.js → chunk-8qtexw5s.js} +36 -14
- package/dist/shared/{chunk-m1ptgp1s.js → chunk-9ezgd78r.js} +7 -7
- package/dist/shared/{chunk-kg27s15c.js → chunk-ajpj10z0.js} +5 -5
- package/dist/shared/{chunk-tfyg0qrp.js → chunk-c46v0fsw.js} +6 -6
- package/dist/shared/{chunk-96d9nr7y.js → chunk-dhyr0s9n.js} +1 -1
- package/dist/shared/{chunk-avxcmmk6.js → chunk-e4mm5e59.js} +7 -7
- package/dist/shared/{chunk-gt0wth9h.js → chunk-fqa5bwn1.js} +3 -3
- package/dist/shared/{chunk-x0we8gcy.js → chunk-g8hnc95b.js} +5 -5
- package/dist/shared/chunk-j2tdpxgc.js +185 -0
- package/dist/shared/{chunk-x2hz98qn.js → chunk-jda3v59q.js} +2 -2
- package/dist/shared/{chunk-18y8gfk0.js → chunk-k8nabsxm.js} +115 -93
- package/dist/shared/{chunk-j4cm8avr.js → chunk-kcnq15je.js} +5 -5
- package/dist/shared/{chunk-4da5zksy.js → chunk-mqs4qq0b.js} +2 -2
- package/dist/shared/{chunk-9hj9p7s2.js → chunk-myq79qew.js} +37 -31
- package/dist/shared/{chunk-ppcv3ehd.js → chunk-pg2yjn8f.js} +15 -12
- package/dist/shared/{chunk-hr9hx58m.js → chunk-rb53v045.js} +4 -4
- package/dist/shared/{chunk-ttsyf6ma.js → chunk-s6a2yph8.js} +5 -5
- package/dist/shared/{chunk-vvjyx7fe.js → chunk-vevfhpc9.js} +1 -1
- package/dist/shared/{chunk-4085nbdq.js → chunk-vhx3sqw6.js} +5 -5
- package/dist/shared/{chunk-34yfm2b0.js → chunk-w318par6.js} +106 -84
- package/dist/shared/chunk-w9dag6ce.js +237 -0
- package/dist/shared/{chunk-g9qvd20g.js → chunk-wcdq7bew.js} +3 -3
- package/dist/shared/{chunk-rnjm61t0.js → chunk-z0gwkzgp.js} +3 -3
- package/dist/shared/{chunk-jz0s6srh.js → chunk-z850et33.js} +1 -1
- package/dist/shared/{chunk-7kpsyjd7.js → chunk-zyfc6cx3.js} +4 -4
- package/dist/src/accordion/accordion.d.ts +2 -0
- package/dist/src/accordion/accordion.js +1 -5
- package/dist/src/alert-dialog/alert-dialog.d.ts +7 -7
- package/dist/src/alert-dialog/alert-dialog.js +1 -4
- package/dist/src/badge/badge.d.ts +2 -0
- package/dist/src/badge/badge.js +1 -3
- package/dist/src/button/button.d.ts +2 -0
- package/dist/src/button/button.js +1 -3
- package/dist/src/calendar/calendar.d.ts +9 -6
- package/dist/src/calendar/calendar.js +1 -2
- package/dist/src/carousel/carousel.d.ts +2 -0
- package/dist/src/carousel/carousel.js +1 -4
- package/dist/src/checkbox/checkbox.d.ts +2 -0
- package/dist/src/checkbox/checkbox.js +1 -4
- package/dist/src/collapsible/collapsible.d.ts +2 -0
- package/dist/src/collapsible/collapsible.js +1 -4
- package/dist/src/combobox/combobox.d.ts +2 -0
- package/dist/src/combobox/combobox.js +1 -5
- package/dist/src/command/command.d.ts +2 -0
- package/dist/src/command/command.js +1 -5
- package/dist/src/context-menu/context-menu.d.ts +2 -0
- package/dist/src/context-menu/context-menu.js +1 -7
- package/dist/src/date-picker/date-picker.d.ts +6 -6
- package/dist/src/date-picker/date-picker.js +1 -10
- package/dist/src/dialog/dialog.d.ts +3 -0
- package/dist/src/dialog/dialog.js +1 -6
- package/dist/src/dropdown-menu/dropdown-menu.d.ts +3 -0
- package/dist/src/dropdown-menu/dropdown-menu.js +1 -8
- package/dist/src/hover-card/hover-card.d.ts +2 -0
- package/dist/src/hover-card/hover-card.js +1 -6
- package/dist/src/index.d.ts +906 -34
- package/dist/src/index.js +5183 -39
- package/dist/src/menu/menu.d.ts +3 -0
- package/dist/src/menu/menu.js +1 -7
- package/dist/src/menubar/menubar.d.ts +2 -0
- package/dist/src/menubar/menubar.js +1 -8
- package/dist/src/navigation-menu/navigation-menu.d.ts +7 -5
- package/dist/src/navigation-menu/navigation-menu.js +1 -6
- package/dist/src/popover/popover.d.ts +2 -0
- package/dist/src/popover/popover.js +1 -8
- package/dist/src/progress/progress.d.ts +4 -2
- package/dist/src/progress/progress.js +1 -4
- package/dist/src/radio/radio.d.ts +9 -3
- package/dist/src/radio/radio.js +1 -6
- package/dist/src/resizable-panel/resizable-panel.d.ts +2 -0
- package/dist/src/resizable-panel/resizable-panel.js +1 -4
- package/dist/src/scroll-area/scroll-area.d.ts +2 -0
- package/dist/src/scroll-area/scroll-area.js +1 -2
- package/dist/src/select/select.d.ts +2 -0
- package/dist/src/select/select.js +1 -7
- package/dist/src/sheet/sheet.js +1 -5
- package/dist/src/slider/slider.d.ts +2 -0
- package/dist/src/slider/slider.js +1 -5
- package/dist/src/switch/switch.d.ts +2 -0
- package/dist/src/switch/switch.js +1 -4
- package/dist/src/tabs/tabs.d.ts +7 -4
- package/dist/src/tabs/tabs.js +1 -6
- package/dist/src/toast/toast.d.ts +2 -0
- package/dist/src/toast/toast.js +1 -4
- package/dist/src/toggle/toggle.d.ts +2 -0
- package/dist/src/toggle/toggle.js +1 -4
- package/dist/src/toggle-group/toggle-group.d.ts +2 -0
- package/dist/src/toggle-group/toggle-group.js +1 -5
- package/dist/src/tooltip/tooltip.d.ts +3 -1
- package/dist/src/tooltip/tooltip.js +1 -6
- package/dist/src/utils.d.ts +62 -2
- package/dist/src/utils.js +50 -3
- package/package.json +4 -6
- package/dist/shared/chunk-8nk0ya7a.js +0 -163
- package/dist/shared/chunk-8tvzqry6.js +0 -218
package/dist/src/menu/menu.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Signal } from "@vertz/ui";
|
|
2
2
|
interface ElementAttrs {
|
|
3
|
+
className?: string;
|
|
4
|
+
/** @deprecated Use `className` instead. */
|
|
3
5
|
class?: string;
|
|
4
6
|
id?: string;
|
|
5
7
|
style?: string;
|
|
@@ -26,6 +28,7 @@ interface FloatingOptions {
|
|
|
26
28
|
}
|
|
27
29
|
interface MenuOptions extends ElementAttrs {
|
|
28
30
|
onSelect?: (value: string) => void;
|
|
31
|
+
onOpenChange?: (open: boolean) => void;
|
|
29
32
|
positioning?: FloatingOptions;
|
|
30
33
|
}
|
|
31
34
|
interface MenuState {
|
package/dist/src/menu/menu.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Menu
|
|
3
|
-
} from "../../shared/chunk-
|
|
4
|
-
import"../../shared/chunk-a6wp8c32.js";
|
|
5
|
-
import"../../shared/chunk-0mcr52hc.js";
|
|
6
|
-
import"../../shared/chunk-jctqs9m4.js";
|
|
7
|
-
import"../../shared/chunk-vvjyx7fe.js";
|
|
8
|
-
import"../../shared/chunk-dpsgb1xw.js";
|
|
9
|
-
import"../../shared/chunk-8y1jf6xr.js";
|
|
3
|
+
} from "../../shared/chunk-4rf1m34c.js";
|
|
10
4
|
export {
|
|
11
5
|
Menu
|
|
12
6
|
};
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Menubar
|
|
3
|
-
} from "../../shared/chunk-
|
|
4
|
-
import"../../shared/chunk-a6wp8c32.js";
|
|
5
|
-
import"../../shared/chunk-e2v1c9ex.js";
|
|
6
|
-
import"../../shared/chunk-0mcr52hc.js";
|
|
7
|
-
import"../../shared/chunk-jctqs9m4.js";
|
|
8
|
-
import"../../shared/chunk-vvjyx7fe.js";
|
|
9
|
-
import"../../shared/chunk-dpsgb1xw.js";
|
|
10
|
-
import"../../shared/chunk-8y1jf6xr.js";
|
|
3
|
+
} from "../../shared/chunk-27xs9apd.js";
|
|
11
4
|
export {
|
|
12
5
|
Menubar
|
|
13
6
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Signal } from "@vertz/ui";
|
|
2
2
|
interface ElementAttrs {
|
|
3
|
+
className?: string;
|
|
4
|
+
/** @deprecated Use `className` instead. */
|
|
3
5
|
class?: string;
|
|
4
6
|
id?: string;
|
|
5
7
|
style?: string;
|
|
@@ -21,17 +23,17 @@ interface NavigationMenuState {
|
|
|
21
23
|
}
|
|
22
24
|
interface NavigationMenuElements {
|
|
23
25
|
root: HTMLElement;
|
|
24
|
-
list:
|
|
25
|
-
viewport:
|
|
26
|
+
list: HTMLElement;
|
|
27
|
+
viewport: HTMLElement;
|
|
26
28
|
}
|
|
27
29
|
declare const NavigationMenu: {
|
|
28
30
|
Root: (options?: NavigationMenuOptions) => NavigationMenuElements & {
|
|
29
31
|
state: NavigationMenuState;
|
|
30
32
|
Item: (value: string, label?: string) => {
|
|
31
|
-
trigger:
|
|
32
|
-
content:
|
|
33
|
+
trigger: HTMLElement;
|
|
34
|
+
content: HTMLElement;
|
|
33
35
|
};
|
|
34
|
-
Link: (href: string, label: string) =>
|
|
36
|
+
Link: (href: string, label: string) => HTMLElement;
|
|
35
37
|
};
|
|
36
38
|
};
|
|
37
39
|
export { NavigationMenuState, NavigationMenuOptions, NavigationMenuElements, NavigationMenu };
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NavigationMenu
|
|
3
|
-
} from "../../shared/chunk-
|
|
4
|
-
import"../../shared/chunk-e2v1c9ex.js";
|
|
5
|
-
import"../../shared/chunk-jctqs9m4.js";
|
|
6
|
-
import"../../shared/chunk-vvjyx7fe.js";
|
|
7
|
-
import"../../shared/chunk-dpsgb1xw.js";
|
|
8
|
-
import"../../shared/chunk-8y1jf6xr.js";
|
|
3
|
+
} from "../../shared/chunk-w9dag6ce.js";
|
|
9
4
|
export {
|
|
10
5
|
NavigationMenu
|
|
11
6
|
};
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Popover
|
|
3
|
-
} from "../../shared/chunk-
|
|
4
|
-
import"../../shared/chunk-a6wp8c32.js";
|
|
5
|
-
import"../../shared/chunk-e2v1c9ex.js";
|
|
6
|
-
import"../../shared/chunk-0mcr52hc.js";
|
|
7
|
-
import"../../shared/chunk-jctqs9m4.js";
|
|
8
|
-
import"../../shared/chunk-vvjyx7fe.js";
|
|
9
|
-
import"../../shared/chunk-dpsgb1xw.js";
|
|
10
|
-
import"../../shared/chunk-8y1jf6xr.js";
|
|
3
|
+
} from "../../shared/chunk-9ezgd78r.js";
|
|
11
4
|
export {
|
|
12
5
|
Popover
|
|
13
6
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Signal } from "@vertz/ui";
|
|
2
2
|
interface ElementAttrs {
|
|
3
|
+
className?: string;
|
|
4
|
+
/** @deprecated Use `className` instead. */
|
|
3
5
|
class?: string;
|
|
4
6
|
id?: string;
|
|
5
7
|
style?: string;
|
|
@@ -20,8 +22,8 @@ interface ProgressState {
|
|
|
20
22
|
value: Signal<number>;
|
|
21
23
|
}
|
|
22
24
|
interface ProgressElements {
|
|
23
|
-
root:
|
|
24
|
-
indicator:
|
|
25
|
+
root: HTMLElement;
|
|
26
|
+
indicator: HTMLElement;
|
|
25
27
|
}
|
|
26
28
|
declare const Progress: {
|
|
27
29
|
Root: (options?: ProgressOptions) => ProgressElements & {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Signal } from "@vertz/ui";
|
|
2
2
|
interface ElementAttrs {
|
|
3
|
+
className?: string;
|
|
4
|
+
/** @deprecated Use `className` instead. */
|
|
3
5
|
class?: string;
|
|
4
6
|
id?: string;
|
|
5
7
|
style?: string;
|
|
@@ -19,12 +21,16 @@ interface RadioState {
|
|
|
19
21
|
value: Signal<string>;
|
|
20
22
|
}
|
|
21
23
|
interface RadioElements {
|
|
22
|
-
root:
|
|
24
|
+
root: HTMLElement;
|
|
25
|
+
}
|
|
26
|
+
interface RadioItemOptions {
|
|
27
|
+
disabled?: boolean;
|
|
23
28
|
}
|
|
24
29
|
declare const Radio: {
|
|
25
30
|
Root: (options?: RadioOptions) => RadioElements & {
|
|
26
31
|
state: RadioState;
|
|
27
|
-
Item: (value: string, label?: string) =>
|
|
32
|
+
Item: (value: string, label?: string, itemOptions?: RadioItemOptions) => HTMLElement;
|
|
33
|
+
destroy: () => void;
|
|
28
34
|
};
|
|
29
35
|
};
|
|
30
|
-
export { RadioState, RadioOptions, RadioElements, Radio };
|
|
36
|
+
export { RadioState, RadioOptions, RadioItemOptions, RadioElements, Radio };
|
package/dist/src/radio/radio.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Radio
|
|
3
|
-
} from "../../shared/chunk-
|
|
4
|
-
import"../../shared/chunk-e2v1c9ex.js";
|
|
5
|
-
import"../../shared/chunk-jctqs9m4.js";
|
|
6
|
-
import"../../shared/chunk-vvjyx7fe.js";
|
|
7
|
-
import"../../shared/chunk-dpsgb1xw.js";
|
|
8
|
-
import"../../shared/chunk-8y1jf6xr.js";
|
|
3
|
+
} from "../../shared/chunk-279bzynx.js";
|
|
9
4
|
export {
|
|
10
5
|
Radio
|
|
11
6
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ResizablePanel
|
|
3
|
-
} from "../../shared/chunk-
|
|
4
|
-
import"../../shared/chunk-jctqs9m4.js";
|
|
5
|
-
import"../../shared/chunk-vvjyx7fe.js";
|
|
6
|
-
import"../../shared/chunk-dpsgb1xw.js";
|
|
3
|
+
} from "../../shared/chunk-kcnq15je.js";
|
|
7
4
|
export {
|
|
8
5
|
ResizablePanel
|
|
9
6
|
};
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Select
|
|
3
|
-
} from "../../shared/chunk-
|
|
4
|
-
import"../../shared/chunk-a6wp8c32.js";
|
|
5
|
-
import"../../shared/chunk-0mcr52hc.js";
|
|
6
|
-
import"../../shared/chunk-jctqs9m4.js";
|
|
7
|
-
import"../../shared/chunk-vvjyx7fe.js";
|
|
8
|
-
import"../../shared/chunk-dpsgb1xw.js";
|
|
9
|
-
import"../../shared/chunk-8y1jf6xr.js";
|
|
3
|
+
} from "../../shared/chunk-ajpj10z0.js";
|
|
10
4
|
export {
|
|
11
5
|
Select
|
|
12
6
|
};
|
package/dist/src/sheet/sheet.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Sheet
|
|
3
|
-
} from "../../shared/chunk-
|
|
4
|
-
import"../../shared/chunk-e2v1c9ex.js";
|
|
5
|
-
import"../../shared/chunk-jctqs9m4.js";
|
|
6
|
-
import"../../shared/chunk-vvjyx7fe.js";
|
|
7
|
-
import"../../shared/chunk-8y1jf6xr.js";
|
|
3
|
+
} from "../../shared/chunk-3rp73gkd.js";
|
|
8
4
|
export {
|
|
9
5
|
Sheet
|
|
10
6
|
};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Slider
|
|
3
|
-
} from "../../shared/chunk-
|
|
4
|
-
import"../../shared/chunk-jctqs9m4.js";
|
|
5
|
-
import"../../shared/chunk-vvjyx7fe.js";
|
|
6
|
-
import"../../shared/chunk-dpsgb1xw.js";
|
|
7
|
-
import"../../shared/chunk-8y1jf6xr.js";
|
|
3
|
+
} from "../../shared/chunk-2k8gxzdf.js";
|
|
8
4
|
export {
|
|
9
5
|
Slider
|
|
10
6
|
};
|
package/dist/src/tabs/tabs.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Signal } from "@vertz/ui";
|
|
2
2
|
interface ElementAttrs {
|
|
3
|
+
className?: string;
|
|
4
|
+
/** @deprecated Use `className` instead. */
|
|
3
5
|
class?: string;
|
|
4
6
|
id?: string;
|
|
5
7
|
style?: string;
|
|
@@ -20,16 +22,17 @@ interface TabsState {
|
|
|
20
22
|
value: Signal<string>;
|
|
21
23
|
}
|
|
22
24
|
interface TabsElements {
|
|
23
|
-
root:
|
|
24
|
-
list:
|
|
25
|
+
root: HTMLElement;
|
|
26
|
+
list: HTMLElement;
|
|
25
27
|
}
|
|
26
28
|
declare const Tabs: {
|
|
27
29
|
Root: (options?: TabsOptions) => TabsElements & {
|
|
28
30
|
state: TabsState;
|
|
29
31
|
Tab: (value: string, label?: string) => {
|
|
30
|
-
trigger:
|
|
31
|
-
panel:
|
|
32
|
+
trigger: HTMLElement;
|
|
33
|
+
panel: HTMLElement;
|
|
32
34
|
};
|
|
35
|
+
destroy: () => void;
|
|
33
36
|
};
|
|
34
37
|
};
|
|
35
38
|
export { TabsState, TabsOptions, TabsElements, Tabs };
|
package/dist/src/tabs/tabs.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Tabs
|
|
3
|
-
} from "../../shared/chunk-
|
|
4
|
-
import"../../shared/chunk-e2v1c9ex.js";
|
|
5
|
-
import"../../shared/chunk-jctqs9m4.js";
|
|
6
|
-
import"../../shared/chunk-vvjyx7fe.js";
|
|
7
|
-
import"../../shared/chunk-dpsgb1xw.js";
|
|
8
|
-
import"../../shared/chunk-8y1jf6xr.js";
|
|
3
|
+
} from "../../shared/chunk-j2tdpxgc.js";
|
|
9
4
|
export {
|
|
10
5
|
Tabs
|
|
11
6
|
};
|
package/dist/src/toast/toast.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ToggleGroup
|
|
3
|
-
} from "../../shared/chunk-
|
|
4
|
-
import"../../shared/chunk-e2v1c9ex.js";
|
|
5
|
-
import"../../shared/chunk-jctqs9m4.js";
|
|
6
|
-
import"../../shared/chunk-vvjyx7fe.js";
|
|
7
|
-
import"../../shared/chunk-dpsgb1xw.js";
|
|
3
|
+
} from "../../shared/chunk-fqa5bwn1.js";
|
|
8
4
|
export {
|
|
9
5
|
ToggleGroup
|
|
10
6
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Signal } from "@vertz/ui";
|
|
2
2
|
interface ElementAttrs {
|
|
3
|
+
className?: string;
|
|
4
|
+
/** @deprecated Use `className` instead. */
|
|
3
5
|
class?: string;
|
|
4
6
|
id?: string;
|
|
5
7
|
style?: string;
|
|
@@ -34,7 +36,7 @@ interface TooltipState {
|
|
|
34
36
|
}
|
|
35
37
|
interface TooltipElements {
|
|
36
38
|
trigger: HTMLElement;
|
|
37
|
-
content:
|
|
39
|
+
content: HTMLElement;
|
|
38
40
|
}
|
|
39
41
|
declare const Tooltip: {
|
|
40
42
|
Root: (options?: TooltipOptions) => TooltipElements & {
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Tooltip
|
|
3
|
-
} from "../../shared/chunk-
|
|
4
|
-
import"../../shared/chunk-0mcr52hc.js";
|
|
5
|
-
import"../../shared/chunk-jctqs9m4.js";
|
|
6
|
-
import"../../shared/chunk-vvjyx7fe.js";
|
|
7
|
-
import"../../shared/chunk-dpsgb1xw.js";
|
|
8
|
-
import"../../shared/chunk-8y1jf6xr.js";
|
|
3
|
+
} from "../../shared/chunk-myq79qew.js";
|
|
9
4
|
export {
|
|
10
5
|
Tooltip
|
|
11
6
|
};
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { onAnimationsComplete } from "@vertz/ui
|
|
1
|
+
import { onAnimationsComplete } from "@vertz/ui";
|
|
2
2
|
/**
|
|
3
3
|
* Set aria-expanded on an element.
|
|
4
4
|
*/
|
|
@@ -56,6 +56,21 @@ declare function setDescribedBy(el: HTMLElement, descriptionId: string): void;
|
|
|
56
56
|
* Set aria-valuenow, aria-valuemin, and aria-valuemax for range widgets.
|
|
57
57
|
*/
|
|
58
58
|
declare function setValueRange(el: HTMLElement, now: number, min: number, max: number): void;
|
|
59
|
+
interface ElementAttrs {
|
|
60
|
+
className?: string;
|
|
61
|
+
/** @deprecated Use `className` instead. */
|
|
62
|
+
class?: string;
|
|
63
|
+
id?: string;
|
|
64
|
+
style?: string;
|
|
65
|
+
title?: string;
|
|
66
|
+
role?: string;
|
|
67
|
+
tabindex?: number | string;
|
|
68
|
+
hidden?: boolean | string;
|
|
69
|
+
autofocus?: boolean;
|
|
70
|
+
[key: `data-${string}`]: string | undefined;
|
|
71
|
+
[key: `aria-${string}`]: string | undefined;
|
|
72
|
+
}
|
|
73
|
+
declare function applyAttrs(el: HTMLElement, attrs: Record<string, unknown>): void;
|
|
59
74
|
/**
|
|
60
75
|
* Shared dismiss utility for floating elements.
|
|
61
76
|
* Handles click-outside and Escape key dismissal.
|
|
@@ -71,6 +86,41 @@ interface DismissOptions {
|
|
|
71
86
|
* Returns a cleanup function that removes all listeners.
|
|
72
87
|
*/
|
|
73
88
|
declare function createDismiss(options: DismissOptions): () => void;
|
|
89
|
+
/**
|
|
90
|
+
* Typed event handler props for interactive themed components.
|
|
91
|
+
*
|
|
92
|
+
* Shared across Button, AlertDialog.Action, AlertDialog.Cancel, etc.
|
|
93
|
+
* Only explicitly listed events are accepted — no arbitrary `on*` string matching.
|
|
94
|
+
*/
|
|
95
|
+
interface ElementEventHandlers {
|
|
96
|
+
onClick?: (event: MouseEvent) => void;
|
|
97
|
+
onDblClick?: (event: MouseEvent) => void;
|
|
98
|
+
onMouseDown?: (event: MouseEvent) => void;
|
|
99
|
+
onMouseUp?: (event: MouseEvent) => void;
|
|
100
|
+
onMouseEnter?: (event: MouseEvent) => void;
|
|
101
|
+
onMouseLeave?: (event: MouseEvent) => void;
|
|
102
|
+
onFocus?: (event: FocusEvent) => void;
|
|
103
|
+
onBlur?: (event: FocusEvent) => void;
|
|
104
|
+
onKeyDown?: (event: KeyboardEvent) => void;
|
|
105
|
+
onKeyUp?: (event: KeyboardEvent) => void;
|
|
106
|
+
onPointerDown?: (event: PointerEvent) => void;
|
|
107
|
+
onPointerUp?: (event: PointerEvent) => void;
|
|
108
|
+
onInput?: (event: InputEvent) => void;
|
|
109
|
+
onChange?: (event: Event) => void;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Check if a prop key is a known event handler.
|
|
113
|
+
* Used by components that need to separate event handlers from HTML attributes.
|
|
114
|
+
*/
|
|
115
|
+
declare function isKnownEventHandler(key: string): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Wire typed event handler props onto a DOM element.
|
|
118
|
+
*
|
|
119
|
+
* Only handlers from the known {@link EVENT_HANDLER_KEYS} set are wired.
|
|
120
|
+
* Converts camelCase prop names to lowercase DOM event names
|
|
121
|
+
* (e.g. `onClick` → `click`, `onKeyDown` → `keydown`).
|
|
122
|
+
*/
|
|
123
|
+
declare function wireEventHandlers(el: HTMLElement, handlers: ElementEventHandlers): void;
|
|
74
124
|
import { Middleware, Placement, Strategy, VirtualElement } from "@floating-ui/dom";
|
|
75
125
|
interface FloatingOptions {
|
|
76
126
|
placement?: Placement;
|
|
@@ -173,4 +223,14 @@ declare function handleListNavigation(event: KeyboardEvent, items: HTMLElement[]
|
|
|
173
223
|
* Calls the handler and prevents default behavior.
|
|
174
224
|
*/
|
|
175
225
|
declare function handleActivation(event: KeyboardEvent, handler: () => void): void;
|
|
176
|
-
|
|
226
|
+
/**
|
|
227
|
+
* Apply a bag of props to a DOM element: wire on* event handlers via addEventListener,
|
|
228
|
+
* then forward remaining keys as HTML attributes (delegating to applyAttrs).
|
|
229
|
+
*
|
|
230
|
+
* Use applyAttrs directly if your props bag contains no event handlers.
|
|
231
|
+
*
|
|
232
|
+
* Designed for imperative .ts theme components. JSX .tsx components compiled by Vertz
|
|
233
|
+
* do not need this — the compiler handles event wiring automatically.
|
|
234
|
+
*/
|
|
235
|
+
declare function applyProps(el: HTMLElement, props: Record<string, unknown>): void;
|
|
236
|
+
export { wireEventHandlers, virtualElement, uniqueId, trapFocus, toggleExpanded, setValueRange, setSelected, setRovingTabindex, setLabelledBy, setHiddenAnimated, setHidden, setExpanded, setDisabled, setDescribedBy, setDataState, setControls, setChecked, saveFocus, resetIdCounter, onAnimationsComplete, linkedIds, isKnownEventHandler, isKey, handleListNavigation, handleActivation, getFocusableElements, focusFirst, createFloatingPosition, createDismiss, applyProps, applyAttrs, Keys, FloatingResult, FloatingOptions, ElementEventHandlers, ElementAttrs, DismissOptions };
|
package/dist/src/utils.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
handleActivation,
|
|
18
18
|
handleListNavigation,
|
|
19
19
|
isKey
|
|
20
|
-
} from "../shared/chunk-
|
|
20
|
+
} from "../shared/chunk-7867pr13.js";
|
|
21
21
|
import {
|
|
22
22
|
setChecked,
|
|
23
23
|
setControls,
|
|
@@ -31,16 +31,60 @@ import {
|
|
|
31
31
|
setSelected,
|
|
32
32
|
setValueRange,
|
|
33
33
|
toggleExpanded
|
|
34
|
-
} from "../shared/chunk-
|
|
34
|
+
} from "../shared/chunk-vevfhpc9.js";
|
|
35
35
|
import {
|
|
36
36
|
linkedIds,
|
|
37
37
|
resetIdCounter,
|
|
38
38
|
uniqueId
|
|
39
39
|
} from "../shared/chunk-8y1jf6xr.js";
|
|
40
|
+
import {
|
|
41
|
+
applyAttrs
|
|
42
|
+
} from "../shared/chunk-2db2dnp3.js";
|
|
40
43
|
|
|
41
44
|
// src/utils.ts
|
|
42
|
-
import { onAnimationsComplete } from "@vertz/ui
|
|
45
|
+
import { onAnimationsComplete } from "@vertz/ui";
|
|
46
|
+
|
|
47
|
+
// src/utils/event-handlers.ts
|
|
48
|
+
var EVENT_HANDLER_KEYS = new Set([
|
|
49
|
+
"onClick",
|
|
50
|
+
"onDblClick",
|
|
51
|
+
"onMouseDown",
|
|
52
|
+
"onMouseUp",
|
|
53
|
+
"onMouseEnter",
|
|
54
|
+
"onMouseLeave",
|
|
55
|
+
"onFocus",
|
|
56
|
+
"onBlur",
|
|
57
|
+
"onKeyDown",
|
|
58
|
+
"onKeyUp",
|
|
59
|
+
"onPointerDown",
|
|
60
|
+
"onPointerUp",
|
|
61
|
+
"onInput",
|
|
62
|
+
"onChange"
|
|
63
|
+
]);
|
|
64
|
+
function isKnownEventHandler(key) {
|
|
65
|
+
return EVENT_HANDLER_KEYS.has(key);
|
|
66
|
+
}
|
|
67
|
+
function wireEventHandlers(el, handlers) {
|
|
68
|
+
for (const [key, value] of Object.entries(handlers)) {
|
|
69
|
+
if (!value || !EVENT_HANDLER_KEYS.has(key))
|
|
70
|
+
continue;
|
|
71
|
+
const event = key.slice(2).toLowerCase();
|
|
72
|
+
el.addEventListener(event, value);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// src/utils/props.ts
|
|
76
|
+
function applyProps(el, props) {
|
|
77
|
+
wireEventHandlers(el, props);
|
|
78
|
+
const attrs = {};
|
|
79
|
+
for (const [key, value] of Object.entries(props)) {
|
|
80
|
+
if (isKnownEventHandler(key))
|
|
81
|
+
continue;
|
|
82
|
+
attrs[key] = value;
|
|
83
|
+
}
|
|
84
|
+
applyAttrs(el, attrs);
|
|
85
|
+
}
|
|
43
86
|
export {
|
|
87
|
+
wireEventHandlers,
|
|
44
88
|
virtualElement,
|
|
45
89
|
uniqueId,
|
|
46
90
|
trapFocus,
|
|
@@ -61,6 +105,7 @@ export {
|
|
|
61
105
|
resetIdCounter,
|
|
62
106
|
onAnimationsComplete,
|
|
63
107
|
linkedIds,
|
|
108
|
+
isKnownEventHandler,
|
|
64
109
|
isKey,
|
|
65
110
|
handleListNavigation,
|
|
66
111
|
handleActivation,
|
|
@@ -68,5 +113,7 @@ export {
|
|
|
68
113
|
focusFirst,
|
|
69
114
|
createFloatingPosition,
|
|
70
115
|
createDismiss,
|
|
116
|
+
applyProps,
|
|
117
|
+
applyAttrs,
|
|
71
118
|
Keys
|
|
72
119
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertz/ui-primitives",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Headless UI primitives for Vertz — Accordion, Dialog, Select, and more",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@floating-ui/dom": "^1.7.5",
|
|
39
|
-
"@vertz/ui": "^0.2.
|
|
39
|
+
"@vertz/ui": "^0.2.21"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@happy-dom/global-registrator": "^20.7.0",
|
|
43
|
-
"@vertz/ui-compiler": "^0.2.
|
|
43
|
+
"@vertz/ui-compiler": "^0.2.21",
|
|
44
44
|
"bunup": "^0.16.31",
|
|
45
45
|
"happy-dom": "^20.7.0",
|
|
46
46
|
"typescript": "^5.7.0"
|
|
@@ -48,7 +48,5 @@
|
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=22"
|
|
50
50
|
},
|
|
51
|
-
"sideEffects":
|
|
52
|
-
"./dist/shared/*.js"
|
|
53
|
-
]
|
|
51
|
+
"sideEffects": false
|
|
54
52
|
}
|