@vertz/ui-primitives 0.2.41 → 0.2.43
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-06m8prfg.js +52 -0
- package/dist/shared/chunk-0n9jj8xr.js +24 -0
- package/dist/shared/chunk-1ben27xq.js +317 -0
- package/dist/shared/chunk-1j2mj0sa.js +45 -0
- package/dist/shared/chunk-250hj18f.js +243 -0
- package/dist/shared/chunk-2h4m9c71.js +38 -0
- package/dist/shared/chunk-2sbx20hv.js +128 -0
- package/dist/shared/chunk-2ye674gr.js +70 -0
- package/dist/shared/chunk-34d8385y.js +15 -0
- package/dist/shared/chunk-4d7bm8h0.js +113 -0
- package/dist/shared/chunk-4zjgxr7x.js +157 -0
- package/dist/shared/chunk-5c150wvr.js +140 -0
- package/dist/shared/chunk-5gycdypd.js +58 -0
- package/dist/shared/chunk-6mm7fhp8.js +105 -0
- package/dist/shared/chunk-6zmnqvh6.js +109 -0
- package/dist/shared/{chunk-yy3ft5mb.js → chunk-7amn5d71.js} +2 -2
- package/dist/shared/chunk-7pbff2hg.js +118 -0
- package/dist/shared/chunk-7zpjshwz.js +194 -0
- package/dist/shared/chunk-993ff51d.js +155 -0
- package/dist/shared/chunk-9pdt5aw7.js +24 -0
- package/dist/shared/chunk-a71m4xkv.js +106 -0
- package/dist/shared/chunk-aj8m39pk.js +127 -0
- package/dist/shared/chunk-ajawpc05.js +305 -0
- package/dist/shared/chunk-b7mzwqhj.js +125 -0
- package/dist/shared/chunk-bb887de4.js +200 -0
- package/dist/shared/chunk-bfsmbrxc.js +111 -0
- package/dist/shared/chunk-c2f63m5n.js +56 -0
- package/dist/shared/chunk-c5r3s5km.js +263 -0
- package/dist/shared/chunk-caba5bhd.js +427 -0
- package/dist/shared/chunk-crym07yc.js +264 -0
- package/dist/shared/{chunk-5964gmv0.js → chunk-csjtyvam.js} +62 -88
- package/dist/shared/chunk-d6rtejz3.js +128 -0
- package/dist/shared/chunk-dvaf0bmq.js +140 -0
- package/dist/shared/chunk-dwkv9ya6.js +22 -0
- package/dist/shared/chunk-e0ckxrjg.js +41 -0
- package/dist/shared/chunk-ennxcymj.js +225 -0
- package/dist/shared/{chunk-1jd1n0dt.js → chunk-ey38de46.js} +19 -47
- package/dist/shared/chunk-f0v1gs5e.js +52 -0
- package/dist/shared/chunk-f86rsf84.js +231 -0
- package/dist/shared/{chunk-3sahbk4d.js → chunk-fdse46x5.js} +6 -1
- package/dist/shared/chunk-gj4hrssn.js +135 -0
- package/dist/shared/chunk-gyvq4gk9.js +24 -0
- package/dist/shared/chunk-hbnps9sq.js +229 -0
- package/dist/shared/{chunk-fhss32ya.js → chunk-hdmpyeq9.js} +43 -132
- package/dist/shared/chunk-hgnkd4he.js +256 -0
- package/dist/shared/chunk-hpcyffm7.js +185 -0
- package/dist/shared/chunk-hpmvwx0h.js +99 -0
- package/dist/shared/chunk-hz0e504p.js +69 -0
- package/dist/shared/chunk-hzk4wfq9.js +43 -0
- package/dist/shared/chunk-j7znzkpa.js +48 -0
- package/dist/shared/chunk-j9kxgrnn.js +167 -0
- package/dist/shared/chunk-jetwnv0w.js +130 -0
- package/dist/shared/chunk-jjdg26c1.js +155 -0
- package/dist/shared/chunk-k0m4yh86.js +123 -0
- package/dist/shared/chunk-k43q9cjr.js +82 -0
- package/dist/shared/chunk-k9k8tbr5.js +119 -0
- package/dist/shared/chunk-meaj7br1.js +232 -0
- package/dist/shared/chunk-mgj0n08k.js +34 -0
- package/dist/shared/chunk-mjz4rp6c.js +46 -0
- package/dist/shared/chunk-n4rr5gme.js +239 -0
- package/dist/shared/chunk-nk55etpp.js +65 -0
- package/dist/shared/chunk-nkh1ks3k.js +264 -0
- package/dist/shared/chunk-pgvpvbpe.js +26 -0
- package/dist/shared/chunk-pma8gnv7.js +178 -0
- package/dist/shared/chunk-q7xv6xze.js +131 -0
- package/dist/shared/chunk-qey801nq.js +22 -0
- package/dist/shared/chunk-s6b4c3tj.js +58 -0
- package/dist/shared/chunk-sq27a4h0.js +36 -0
- package/dist/shared/chunk-taa5pj15.js +103 -0
- package/dist/shared/chunk-tc5rpvyx.js +127 -0
- package/dist/shared/chunk-tescm0b3.js +192 -0
- package/dist/shared/chunk-tkftdwnq.js +71 -0
- package/dist/shared/chunk-tqhnjcfp.js +116 -0
- package/dist/shared/chunk-vfknb5ht.js +183 -0
- package/dist/shared/chunk-vsc369w3.js +185 -0
- package/dist/shared/chunk-whq9s8v5.js +301 -0
- package/dist/shared/{chunk-hze1f32t.js → chunk-wrqddgaj.js} +1 -1
- package/dist/shared/chunk-yzbmkx4r.js +155 -0
- package/dist/shared/chunk-zaen0ajc.js +347 -0
- package/dist/src/accordion/accordion-composed.js +1 -1
- package/dist/src/accordion/accordion.js +1 -1
- package/dist/src/alert/alert-composed.js +1 -1
- package/dist/src/alert-dialog/alert-dialog-composed.js +1 -1
- package/dist/src/alert-dialog/alert-dialog.js +1 -1
- package/dist/src/avatar/avatar-composed.js +1 -1
- package/dist/src/badge/badge-composed.js +1 -1
- package/dist/src/badge/badge.js +1 -1
- package/dist/src/breadcrumb/breadcrumb-composed.js +1 -1
- package/dist/src/button/button-composed.js +1 -1
- package/dist/src/button/button.js +1 -1
- package/dist/src/calendar/calendar-composed.js +1 -1
- package/dist/src/calendar/calendar.js +1 -1
- package/dist/src/card/card-composed.js +1 -1
- package/dist/src/carousel/carousel-composed.js +1 -1
- package/dist/src/carousel/carousel.js +1 -1
- package/dist/src/checkbox/checkbox-composed.js +1 -1
- package/dist/src/checkbox/checkbox.js +1 -1
- package/dist/src/collapsible/collapsible-composed.js +1 -1
- package/dist/src/collapsible/collapsible.js +1 -1
- package/dist/src/combobox/combobox-composed.js +1 -1
- package/dist/src/combobox/combobox.js +1 -1
- package/dist/src/command/command-composed.js +1 -1
- package/dist/src/command/command.js +1 -1
- package/dist/src/composed/with-styles.js +1 -1
- package/dist/src/context-menu/context-menu-composed.js +1 -1
- package/dist/src/context-menu/context-menu.js +1 -1
- package/dist/src/date-picker/date-picker-composed.js +1 -1
- package/dist/src/date-picker/date-picker.js +1 -1
- package/dist/src/dialog/dialog-composed.js +1 -1
- package/dist/src/dialog/dialog-stack-parts.js +1 -1
- package/dist/src/dialog/dialog.js +1 -1
- package/dist/src/dropdown-menu/dropdown-menu-composed.js +1 -1
- package/dist/src/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/src/empty-state/empty-state-composed.js +1 -1
- package/dist/src/form-group/form-group-composed.js +1 -1
- package/dist/src/hover-card/hover-card-composed.js +1 -1
- package/dist/src/hover-card/hover-card.js +1 -1
- package/dist/src/input/input-composed.js +1 -1
- package/dist/src/label/label-composed.js +1 -1
- package/dist/src/list/list-composed.js +1 -1
- package/dist/src/menu/menu-composed.js +1 -1
- package/dist/src/menu/menu.js +1 -1
- package/dist/src/menubar/menubar-composed.js +1 -1
- package/dist/src/menubar/menubar.js +1 -1
- package/dist/src/navigation-menu/navigation-menu-composed.js +1 -1
- package/dist/src/navigation-menu/navigation-menu.js +1 -1
- package/dist/src/pagination/pagination-composed.js +1 -1
- package/dist/src/popover/popover-composed.js +1 -1
- package/dist/src/popover/popover.js +1 -1
- package/dist/src/progress/progress-composed.js +1 -1
- package/dist/src/progress/progress.js +1 -1
- package/dist/src/radio/radio-composed.js +1 -1
- package/dist/src/radio/radio.js +1 -1
- package/dist/src/resizable-panel/resizable-panel-composed.js +1 -1
- package/dist/src/resizable-panel/resizable-panel.js +1 -1
- package/dist/src/scroll-area/scroll-area-composed.js +1 -1
- package/dist/src/scroll-area/scroll-area.js +1 -1
- package/dist/src/select/select-composed.js +1 -1
- package/dist/src/select/select.js +1 -1
- package/dist/src/separator/separator-composed.js +1 -1
- package/dist/src/sheet/sheet-composed.js +1 -1
- package/dist/src/sheet/sheet.js +1 -1
- package/dist/src/skeleton/skeleton-composed.js +1 -1
- package/dist/src/slider/slider-composed.js +1 -1
- package/dist/src/slider/slider.js +1 -1
- package/dist/src/switch/switch-composed.js +1 -1
- package/dist/src/switch/switch.js +1 -1
- package/dist/src/table/table-composed.js +1 -1
- package/dist/src/tabs/tabs-composed.js +1 -1
- package/dist/src/tabs/tabs.js +1 -1
- package/dist/src/textarea/textarea-composed.js +1 -1
- package/dist/src/toast/toast.js +1 -1
- package/dist/src/toggle/toggle-composed.js +1 -1
- package/dist/src/toggle/toggle.js +1 -1
- package/dist/src/toggle-group/toggle-group-composed.js +1 -1
- package/dist/src/toggle-group/toggle-group.js +1 -1
- package/dist/src/tooltip/tooltip-composed.js +1 -1
- package/dist/src/tooltip/tooltip.js +1 -1
- package/package.json +3 -3
- package/dist/shared/chunk-144kbnmx.js +0 -95
- package/dist/shared/chunk-1ewxfgsa.js +0 -167
- package/dist/shared/chunk-1hm0mbke.js +0 -258
- package/dist/shared/chunk-22rt6ws9.js +0 -69
- package/dist/shared/chunk-2ssqz188.js +0 -162
- package/dist/shared/chunk-33he7ay9.js +0 -218
- package/dist/shared/chunk-3jack97k.js +0 -509
- package/dist/shared/chunk-75pegjs7.js +0 -26
- package/dist/shared/chunk-862x7dja.js +0 -398
- package/dist/shared/chunk-8pk1pn5h.js +0 -215
- package/dist/shared/chunk-8t0nm721.js +0 -152
- package/dist/shared/chunk-94twh4s4.js +0 -28
- package/dist/shared/chunk-9yb26c0w.js +0 -232
- package/dist/shared/chunk-a82r2pnq.js +0 -67
- package/dist/shared/chunk-axpbdpgx.js +0 -177
- package/dist/shared/chunk-b3j6mym6.js +0 -203
- package/dist/shared/chunk-b4zzg457.js +0 -410
- package/dist/shared/chunk-b9qxfcsy.js +0 -60
- package/dist/shared/chunk-bc2qqkhr.js +0 -194
- package/dist/shared/chunk-bv12nkdm.js +0 -149
- package/dist/shared/chunk-bvxc1ww4.js +0 -164
- package/dist/shared/chunk-czv0kqj4.js +0 -107
- package/dist/shared/chunk-d83ag07h.js +0 -189
- package/dist/shared/chunk-de18ashk.js +0 -134
- package/dist/shared/chunk-dvk4h36t.js +0 -140
- package/dist/shared/chunk-dxvnerw2.js +0 -353
- package/dist/shared/chunk-e399pzdq.js +0 -241
- package/dist/shared/chunk-e4qha9as.js +0 -180
- package/dist/shared/chunk-eb2d9v6k.js +0 -68
- package/dist/shared/chunk-ect26sp5.js +0 -353
- package/dist/shared/chunk-ev367pq3.js +0 -102
- package/dist/shared/chunk-fjykbv0v.js +0 -214
- package/dist/shared/chunk-gdddk6nh.js +0 -96
- package/dist/shared/chunk-ghkw5bjq.js +0 -55
- package/dist/shared/chunk-hfjtkytb.js +0 -310
- package/dist/shared/chunk-hpvjfj0j.js +0 -31
- package/dist/shared/chunk-jpyjk616.js +0 -52
- package/dist/shared/chunk-k6d53tne.js +0 -206
- package/dist/shared/chunk-knzg86am.js +0 -168
- package/dist/shared/chunk-ktbf6xrt.js +0 -179
- package/dist/shared/chunk-m8y2p66x.js +0 -252
- package/dist/shared/chunk-metxdt5x.js +0 -28
- package/dist/shared/chunk-mgae1d93.js +0 -157
- package/dist/shared/chunk-mtx2cfbx.js +0 -175
- package/dist/shared/chunk-n436p5cb.js +0 -260
- package/dist/shared/chunk-nj420k31.js +0 -54
- package/dist/shared/chunk-nsmvdxgp.js +0 -213
- package/dist/shared/chunk-pcms04vq.js +0 -162
- package/dist/shared/chunk-pqskzq8t.js +0 -79
- package/dist/shared/chunk-pwr60kyd.js +0 -321
- package/dist/shared/chunk-pzknpa1y.js +0 -327
- package/dist/shared/chunk-q77y3rg4.js +0 -189
- package/dist/shared/chunk-qhnany7w.js +0 -179
- package/dist/shared/chunk-rdr0rtpr.js +0 -131
- package/dist/shared/chunk-rj52ty6r.js +0 -147
- package/dist/shared/chunk-rnqc7735.js +0 -125
- package/dist/shared/chunk-rtk30950.js +0 -202
- package/dist/shared/chunk-s0xgd8vg.js +0 -266
- package/dist/shared/chunk-s415735j.js +0 -357
- package/dist/shared/chunk-s62e7jf4.js +0 -30
- package/dist/shared/chunk-snd8e6r8.js +0 -418
- package/dist/shared/chunk-spng4yb9.js +0 -73
- package/dist/shared/chunk-t887wwjc.js +0 -168
- package/dist/shared/chunk-tn0m98j8.js +0 -42
- package/dist/shared/chunk-v0b5pkcq.js +0 -30
- package/dist/shared/chunk-v5tj7veh.js +0 -284
- package/dist/shared/chunk-vkscwzpr.js +0 -294
- package/dist/shared/chunk-vv187snj.js +0 -112
- package/dist/shared/chunk-xv4wd0kf.js +0 -293
- package/dist/shared/chunk-y1hpsqzy.js +0 -185
- package/dist/shared/chunk-yfzddvxc.js +0 -71
- package/dist/shared/chunk-yzgzx2dh.js +0 -311
- package/dist/shared/chunk-z5j7ztf2.js +0 -467
|
@@ -1,418 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cn
|
|
3
|
-
} from "./chunk-q7xbcj9q.js";
|
|
4
|
-
import {
|
|
5
|
-
linkedIds
|
|
6
|
-
} from "./chunk-8y1jf6xr.js";
|
|
7
|
-
import {
|
|
8
|
-
Keys,
|
|
9
|
-
isKey
|
|
10
|
-
} from "./chunk-7867pr13.js";
|
|
11
|
-
|
|
12
|
-
// src/navigation-menu/navigation-menu-composed.tsx
|
|
13
|
-
import { __append, __attr, __child, __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
|
|
14
|
-
import { createContext, ref, useContext } from "@vertz/ui";
|
|
15
|
-
var NavigationMenuContext = createContext(undefined, "@vertz/ui-primitives::NavigationMenuContext");
|
|
16
|
-
var NavigationMenuListContext = createContext(undefined, "@vertz/ui-primitives::NavigationMenuListContext");
|
|
17
|
-
var NavigationMenuItemContext = createContext(undefined, "@vertz/ui-primitives::NavigationMenuItemContext");
|
|
18
|
-
function useNavigationMenuContext(componentName) {
|
|
19
|
-
const ctx = useContext(NavigationMenuContext);
|
|
20
|
-
if (!ctx) {
|
|
21
|
-
throw new Error(`<NavigationMenu.${componentName}> must be used inside <NavigationMenu>. ` + "Ensure it is a direct or nested child of the NavigationMenu root component.");
|
|
22
|
-
}
|
|
23
|
-
return ctx;
|
|
24
|
-
}
|
|
25
|
-
function useNavigationMenuListContext(componentName) {
|
|
26
|
-
const ctx = useContext(NavigationMenuListContext);
|
|
27
|
-
if (ctx === undefined && !useContext(NavigationMenuContext)) {
|
|
28
|
-
throw new Error(`<NavigationMenu.${componentName}> must be used inside <NavigationMenu.List>. ` + "Ensure it is a direct or nested child of the NavigationMenu.List component.");
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function useNavigationMenuItemContext(componentName) {
|
|
32
|
-
const ctx = useContext(NavigationMenuItemContext);
|
|
33
|
-
if (!ctx) {
|
|
34
|
-
throw new Error(`<NavigationMenu.${componentName}> must be used inside <NavigationMenu.Item>. ` + "Ensure it is a direct or nested child of the NavigationMenu.Item component.");
|
|
35
|
-
}
|
|
36
|
-
return ctx;
|
|
37
|
-
}
|
|
38
|
-
function NavMenuList(__props) {
|
|
39
|
-
const __mfDepth = __pushMountFrame();
|
|
40
|
-
try {
|
|
41
|
-
const ctx = useNavigationMenuContext("List");
|
|
42
|
-
const __mfResult0 = (() => {
|
|
43
|
-
const __el0 = __element("div");
|
|
44
|
-
__el0.setAttribute("data-part", "nav-list");
|
|
45
|
-
__el0.setAttribute("data-navmenu-list", "");
|
|
46
|
-
__attr(__el0, "class", () => cn(ctx.classes?.list, __props.className ?? __props.class));
|
|
47
|
-
__on(__el0, "keydown", (event) => {
|
|
48
|
-
if (!isKey(event, Keys.ArrowLeft, Keys.ArrowRight, Keys.Home, Keys.End))
|
|
49
|
-
return;
|
|
50
|
-
const listEl = event.currentTarget;
|
|
51
|
-
const currentTriggers = [
|
|
52
|
-
...listEl.querySelectorAll("[data-navmenu-trigger]")
|
|
53
|
-
];
|
|
54
|
-
const focused = document.activeElement;
|
|
55
|
-
const currentIndex = currentTriggers.indexOf(focused);
|
|
56
|
-
if (currentIndex < 0)
|
|
57
|
-
return;
|
|
58
|
-
let nextIndex = -1;
|
|
59
|
-
if (isKey(event, Keys.ArrowRight)) {
|
|
60
|
-
event.preventDefault();
|
|
61
|
-
nextIndex = (currentIndex + 1) % currentTriggers.length;
|
|
62
|
-
} else if (isKey(event, Keys.ArrowLeft)) {
|
|
63
|
-
event.preventDefault();
|
|
64
|
-
nextIndex = (currentIndex - 1 + currentTriggers.length) % currentTriggers.length;
|
|
65
|
-
} else if (isKey(event, Keys.Home)) {
|
|
66
|
-
event.preventDefault();
|
|
67
|
-
nextIndex = 0;
|
|
68
|
-
} else if (isKey(event, Keys.End)) {
|
|
69
|
-
event.preventDefault();
|
|
70
|
-
nextIndex = currentTriggers.length - 1;
|
|
71
|
-
}
|
|
72
|
-
const nextTrigger = currentTriggers[nextIndex];
|
|
73
|
-
if (nextTrigger) {
|
|
74
|
-
for (let i = 0;i < currentTriggers.length; i++) {
|
|
75
|
-
currentTriggers[i]?.setAttribute("tabindex", i === nextIndex ? "0" : "-1");
|
|
76
|
-
}
|
|
77
|
-
nextTrigger.focus();
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
__enterChildren(__el0);
|
|
81
|
-
__append(__el0, __child(() => __props.children));
|
|
82
|
-
__exitChildren();
|
|
83
|
-
return __el0;
|
|
84
|
-
})();
|
|
85
|
-
__flushMountFrame();
|
|
86
|
-
return __mfResult0;
|
|
87
|
-
} catch (__mfErr) {
|
|
88
|
-
__discardMountFrame(__mfDepth);
|
|
89
|
-
throw __mfErr;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
function NavMenuItem(__props) {
|
|
93
|
-
const __mfDepth = __pushMountFrame();
|
|
94
|
-
try {
|
|
95
|
-
useNavigationMenuListContext("Item");
|
|
96
|
-
const ids = linkedIds("nav-menu");
|
|
97
|
-
const triggerRef = ref();
|
|
98
|
-
const contentRef = ref();
|
|
99
|
-
const itemCtx = {
|
|
100
|
-
value: __props.value,
|
|
101
|
-
triggerId: ids.triggerId,
|
|
102
|
-
contentId: ids.contentId,
|
|
103
|
-
triggerRef,
|
|
104
|
-
contentRef
|
|
105
|
-
};
|
|
106
|
-
const __mfResult0 = NavigationMenuItemContext.Provider({ get value() {
|
|
107
|
-
return itemCtx;
|
|
108
|
-
}, children: () => (() => {
|
|
109
|
-
const __el0 = __element("span");
|
|
110
|
-
{
|
|
111
|
-
const __v = { display: "contents" };
|
|
112
|
-
if (__v != null && __v !== false)
|
|
113
|
-
__el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
114
|
-
}
|
|
115
|
-
__el0.setAttribute("data-navmenu-item", "");
|
|
116
|
-
__attr(__el0, "data-value", () => __props.value);
|
|
117
|
-
__enterChildren(__el0);
|
|
118
|
-
__append(__el0, __child(() => __props.children));
|
|
119
|
-
__exitChildren();
|
|
120
|
-
return __el0;
|
|
121
|
-
})() });
|
|
122
|
-
__flushMountFrame();
|
|
123
|
-
return __mfResult0;
|
|
124
|
-
} catch (__mfErr) {
|
|
125
|
-
__discardMountFrame(__mfDepth);
|
|
126
|
-
throw __mfErr;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
function NavMenuTrigger(__props) {
|
|
130
|
-
const __mfDepth = __pushMountFrame();
|
|
131
|
-
try {
|
|
132
|
-
const ctx = useNavigationMenuContext("Trigger");
|
|
133
|
-
const itemCtx = useNavigationMenuItemContext("Trigger");
|
|
134
|
-
const __mfResult0 = (() => {
|
|
135
|
-
const __el0 = __element("button");
|
|
136
|
-
itemCtx.triggerRef.current = __el0;
|
|
137
|
-
__el0.setAttribute("type", "button");
|
|
138
|
-
{
|
|
139
|
-
const __v = itemCtx.triggerId;
|
|
140
|
-
if (__v != null && __v !== false)
|
|
141
|
-
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
142
|
-
}
|
|
143
|
-
{
|
|
144
|
-
const __v = itemCtx.contentId;
|
|
145
|
-
if (__v != null && __v !== false)
|
|
146
|
-
__el0.setAttribute("aria-controls", __v === true ? "" : __v);
|
|
147
|
-
}
|
|
148
|
-
__el0.setAttribute("data-navmenu-trigger", "");
|
|
149
|
-
{
|
|
150
|
-
const __v = itemCtx.value;
|
|
151
|
-
if (__v != null && __v !== false)
|
|
152
|
-
__el0.setAttribute("data-value", __v === true ? "" : __v);
|
|
153
|
-
}
|
|
154
|
-
__el0.setAttribute("aria-expanded", "false");
|
|
155
|
-
__el0.setAttribute("data-state", "closed");
|
|
156
|
-
__attr(__el0, "class", () => cn(ctx.classes?.trigger, __props.className ?? __props.class));
|
|
157
|
-
__on(__el0, "click", () => {
|
|
158
|
-
if (ctx.getActiveItem() === itemCtx.value) {
|
|
159
|
-
ctx.closeAll();
|
|
160
|
-
} else {
|
|
161
|
-
ctx.openItem(itemCtx.value);
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
__on(__el0, "mouseenter", () => {
|
|
165
|
-
ctx.cancelTimers();
|
|
166
|
-
ctx.scheduleOpen(itemCtx.value);
|
|
167
|
-
});
|
|
168
|
-
__on(__el0, "mouseleave", () => {
|
|
169
|
-
ctx.cancelTimers();
|
|
170
|
-
ctx.scheduleClose();
|
|
171
|
-
});
|
|
172
|
-
__on(__el0, "keydown", (event) => {
|
|
173
|
-
if (isKey(event, Keys.Enter, Keys.Space)) {
|
|
174
|
-
event.preventDefault();
|
|
175
|
-
ctx.openItem(itemCtx.value);
|
|
176
|
-
queueMicrotask(() => {
|
|
177
|
-
const content = itemCtx.contentRef.current;
|
|
178
|
-
if (content) {
|
|
179
|
-
const first = content.querySelector("a, button, [tabindex]");
|
|
180
|
-
if (first)
|
|
181
|
-
first.focus();
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
if (isKey(event, Keys.Escape)) {
|
|
186
|
-
event.preventDefault();
|
|
187
|
-
ctx.closeAll();
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
__enterChildren(__el0);
|
|
191
|
-
__append(__el0, __child(() => __props.children));
|
|
192
|
-
__exitChildren();
|
|
193
|
-
return __el0;
|
|
194
|
-
})();
|
|
195
|
-
__flushMountFrame();
|
|
196
|
-
return __mfResult0;
|
|
197
|
-
} catch (__mfErr) {
|
|
198
|
-
__discardMountFrame(__mfDepth);
|
|
199
|
-
throw __mfErr;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
function NavMenuContent(__props) {
|
|
203
|
-
const __mfDepth = __pushMountFrame();
|
|
204
|
-
try {
|
|
205
|
-
const ctx = useNavigationMenuContext("Content");
|
|
206
|
-
const itemCtx = useNavigationMenuItemContext("Content");
|
|
207
|
-
const __mfResult0 = (() => {
|
|
208
|
-
const __el0 = __element("div");
|
|
209
|
-
itemCtx.contentRef.current = __el0;
|
|
210
|
-
{
|
|
211
|
-
const __v = itemCtx.contentId;
|
|
212
|
-
if (__v != null && __v !== false)
|
|
213
|
-
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
214
|
-
}
|
|
215
|
-
__el0.setAttribute("data-part", "nav-content");
|
|
216
|
-
__el0.setAttribute("data-navmenu-content", "");
|
|
217
|
-
{
|
|
218
|
-
const __v = itemCtx.value;
|
|
219
|
-
if (__v != null && __v !== false)
|
|
220
|
-
__el0.setAttribute("data-value", __v === true ? "" : __v);
|
|
221
|
-
}
|
|
222
|
-
__el0.setAttribute("aria-hidden", "true");
|
|
223
|
-
__el0.setAttribute("data-state", "closed");
|
|
224
|
-
{
|
|
225
|
-
const __v = { display: "none" };
|
|
226
|
-
if (__v != null && __v !== false)
|
|
227
|
-
__el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
228
|
-
}
|
|
229
|
-
__attr(__el0, "class", () => cn(ctx.classes?.content, __props.className ?? __props.class));
|
|
230
|
-
__on(__el0, "mouseenter", () => ctx.cancelTimers());
|
|
231
|
-
__on(__el0, "mouseleave", () => {
|
|
232
|
-
ctx.cancelTimers();
|
|
233
|
-
ctx.scheduleClose();
|
|
234
|
-
});
|
|
235
|
-
__on(__el0, "keydown", (event) => {
|
|
236
|
-
if (isKey(event, Keys.Escape)) {
|
|
237
|
-
event.preventDefault();
|
|
238
|
-
event.stopPropagation();
|
|
239
|
-
ctx.closeAll();
|
|
240
|
-
const trigger = itemCtx.triggerRef.current;
|
|
241
|
-
if (trigger)
|
|
242
|
-
trigger.focus();
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
__enterChildren(__el0);
|
|
246
|
-
__append(__el0, __child(() => __props.children));
|
|
247
|
-
__exitChildren();
|
|
248
|
-
return __el0;
|
|
249
|
-
})();
|
|
250
|
-
__flushMountFrame();
|
|
251
|
-
return __mfResult0;
|
|
252
|
-
} catch (__mfErr) {
|
|
253
|
-
__discardMountFrame(__mfDepth);
|
|
254
|
-
throw __mfErr;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
function NavMenuLink(__props) {
|
|
258
|
-
const __mfDepth = __pushMountFrame();
|
|
259
|
-
try {
|
|
260
|
-
const ctx = useNavigationMenuContext("Link");
|
|
261
|
-
useNavigationMenuListContext("Link");
|
|
262
|
-
const __mfResult0 = (() => {
|
|
263
|
-
const __el0 = __element("a");
|
|
264
|
-
__attr(__el0, "href", () => __props.href);
|
|
265
|
-
__el0.setAttribute("data-navmenu-link", "");
|
|
266
|
-
__attr(__el0, "class", () => cn(ctx.classes?.link, __props.className ?? __props.class));
|
|
267
|
-
__enterChildren(__el0);
|
|
268
|
-
__append(__el0, __child(() => __props.children));
|
|
269
|
-
__exitChildren();
|
|
270
|
-
return __el0;
|
|
271
|
-
})();
|
|
272
|
-
__flushMountFrame();
|
|
273
|
-
return __mfResult0;
|
|
274
|
-
} catch (__mfErr) {
|
|
275
|
-
__discardMountFrame(__mfDepth);
|
|
276
|
-
throw __mfErr;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
function NavMenuViewport(__props) {
|
|
280
|
-
const __mfDepth = __pushMountFrame();
|
|
281
|
-
try {
|
|
282
|
-
const ctx = useNavigationMenuContext("Viewport");
|
|
283
|
-
const __mfResult0 = (() => {
|
|
284
|
-
const __el0 = __element("div");
|
|
285
|
-
__el0.setAttribute("data-part", "nav-viewport");
|
|
286
|
-
__el0.setAttribute("data-navmenu-viewport", "");
|
|
287
|
-
__attr(__el0, "class", () => cn(ctx.classes?.viewport, __props.className ?? __props.class));
|
|
288
|
-
return __el0;
|
|
289
|
-
})();
|
|
290
|
-
__flushMountFrame();
|
|
291
|
-
return __mfResult0;
|
|
292
|
-
} catch (__mfErr) {
|
|
293
|
-
__discardMountFrame(__mfDepth);
|
|
294
|
-
throw __mfErr;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
function ComposedNavigationMenuRoot(__props) {
|
|
298
|
-
const __mfDepth = __pushMountFrame();
|
|
299
|
-
try {
|
|
300
|
-
let cancelTimers = function() {
|
|
301
|
-
if (state.openTimeout) {
|
|
302
|
-
clearTimeout(state.openTimeout);
|
|
303
|
-
state.openTimeout = null;
|
|
304
|
-
}
|
|
305
|
-
if (state.closeTimeout) {
|
|
306
|
-
clearTimeout(state.closeTimeout);
|
|
307
|
-
state.closeTimeout = null;
|
|
308
|
-
}
|
|
309
|
-
}, getRootEl = function() {
|
|
310
|
-
return rootRef.current ?? null;
|
|
311
|
-
}, openItem = function(value) {
|
|
312
|
-
cancelTimers();
|
|
313
|
-
const root = getRootEl();
|
|
314
|
-
if (!root)
|
|
315
|
-
return;
|
|
316
|
-
if (state.activeItem && state.activeItem !== value) {
|
|
317
|
-
const prevTrigger = root.querySelector(`[data-navmenu-trigger][data-value="${state.activeItem}"]`);
|
|
318
|
-
const prevContent = root.querySelector(`[data-navmenu-content][data-value="${state.activeItem}"]`);
|
|
319
|
-
if (prevTrigger) {
|
|
320
|
-
prevTrigger.setAttribute("aria-expanded", "false");
|
|
321
|
-
prevTrigger.setAttribute("data-state", "closed");
|
|
322
|
-
}
|
|
323
|
-
if (prevContent) {
|
|
324
|
-
prevContent.setAttribute("data-state", "closed");
|
|
325
|
-
prevContent.setAttribute("aria-hidden", "true");
|
|
326
|
-
prevContent.style.display = "none";
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
const trigger = root.querySelector(`[data-navmenu-trigger][data-value="${value}"]`);
|
|
330
|
-
const content = root.querySelector(`[data-navmenu-content][data-value="${value}"]`);
|
|
331
|
-
if (!trigger || !content)
|
|
332
|
-
return;
|
|
333
|
-
state.activeItem = value;
|
|
334
|
-
trigger.setAttribute("aria-expanded", "true");
|
|
335
|
-
trigger.setAttribute("data-state", "open");
|
|
336
|
-
content.setAttribute("aria-hidden", "false");
|
|
337
|
-
content.setAttribute("data-state", "open");
|
|
338
|
-
content.style.display = "";
|
|
339
|
-
const viewport = root.querySelector("[data-navmenu-viewport]");
|
|
340
|
-
if (viewport && content.parentElement !== viewport) {
|
|
341
|
-
viewport.appendChild(content);
|
|
342
|
-
}
|
|
343
|
-
}, closeAll = function() {
|
|
344
|
-
cancelTimers();
|
|
345
|
-
const root = getRootEl();
|
|
346
|
-
if (!root || !state.activeItem)
|
|
347
|
-
return;
|
|
348
|
-
const trigger = root.querySelector(`[data-navmenu-trigger][data-value="${state.activeItem}"]`);
|
|
349
|
-
const content = root.querySelector(`[data-navmenu-content][data-value="${state.activeItem}"]`);
|
|
350
|
-
if (trigger) {
|
|
351
|
-
trigger.setAttribute("aria-expanded", "false");
|
|
352
|
-
trigger.setAttribute("data-state", "closed");
|
|
353
|
-
}
|
|
354
|
-
if (content) {
|
|
355
|
-
content.setAttribute("data-state", "closed");
|
|
356
|
-
content.setAttribute("aria-hidden", "true");
|
|
357
|
-
content.style.display = "none";
|
|
358
|
-
}
|
|
359
|
-
state.activeItem = null;
|
|
360
|
-
}, scheduleOpen = function(value) {
|
|
361
|
-
state.openTimeout = setTimeout(() => {
|
|
362
|
-
openItem(value);
|
|
363
|
-
state.openTimeout = null;
|
|
364
|
-
}, __props.delayOpen ?? 200);
|
|
365
|
-
}, scheduleClose = function() {
|
|
366
|
-
state.closeTimeout = setTimeout(() => {
|
|
367
|
-
closeAll();
|
|
368
|
-
state.closeTimeout = null;
|
|
369
|
-
}, __props.delayClose ?? 300);
|
|
370
|
-
};
|
|
371
|
-
const rootId = `nav-menu-${linkedIds("nav-root").triggerId}`;
|
|
372
|
-
const rootRef = ref();
|
|
373
|
-
const state = { activeItem: null, openTimeout: null, closeTimeout: null };
|
|
374
|
-
const ctx = {
|
|
375
|
-
rootId,
|
|
376
|
-
rootRef,
|
|
377
|
-
classes: __props.classes,
|
|
378
|
-
orientation: __props.orientation ?? "horizontal",
|
|
379
|
-
getActiveItem: () => state.activeItem,
|
|
380
|
-
openItem,
|
|
381
|
-
closeAll,
|
|
382
|
-
scheduleOpen,
|
|
383
|
-
scheduleClose,
|
|
384
|
-
cancelTimers
|
|
385
|
-
};
|
|
386
|
-
const __mfResult0 = NavigationMenuContext.Provider({ get value() {
|
|
387
|
-
return ctx;
|
|
388
|
-
}, children: () => (() => {
|
|
389
|
-
const __el0 = __element("nav");
|
|
390
|
-
rootRef.current = __el0;
|
|
391
|
-
{
|
|
392
|
-
const __v = rootId;
|
|
393
|
-
if (__v != null && __v !== false)
|
|
394
|
-
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
395
|
-
}
|
|
396
|
-
__attr(__el0, "class", () => cn(__props.classes?.root));
|
|
397
|
-
__enterChildren(__el0);
|
|
398
|
-
__append(__el0, __child(() => __props.children));
|
|
399
|
-
__exitChildren();
|
|
400
|
-
return __el0;
|
|
401
|
-
})() });
|
|
402
|
-
__flushMountFrame();
|
|
403
|
-
return __mfResult0;
|
|
404
|
-
} catch (__mfErr) {
|
|
405
|
-
__discardMountFrame(__mfDepth);
|
|
406
|
-
throw __mfErr;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
var ComposedNavigationMenu = Object.assign(ComposedNavigationMenuRoot, {
|
|
410
|
-
List: NavMenuList,
|
|
411
|
-
Item: NavMenuItem,
|
|
412
|
-
Trigger: NavMenuTrigger,
|
|
413
|
-
Content: NavMenuContent,
|
|
414
|
-
Link: NavMenuLink,
|
|
415
|
-
Viewport: NavMenuViewport
|
|
416
|
-
});
|
|
417
|
-
|
|
418
|
-
export { ComposedNavigationMenu };
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cn
|
|
3
|
-
} from "./chunk-q7xbcj9q.js";
|
|
4
|
-
|
|
5
|
-
// src/alert/alert-composed.tsx
|
|
6
|
-
import { __append, __attr, __child, __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __pushMountFrame } from "@vertz/ui/internals";
|
|
7
|
-
import { createContext, useContext } from "@vertz/ui";
|
|
8
|
-
var AlertContext = createContext(undefined, "@vertz/ui-primitives::AlertContext");
|
|
9
|
-
function AlertTitle(__props) {
|
|
10
|
-
const __mfDepth = __pushMountFrame();
|
|
11
|
-
try {
|
|
12
|
-
const ctx = useContext(AlertContext);
|
|
13
|
-
const __mfResult0 = (() => {
|
|
14
|
-
const __el0 = __element("h5");
|
|
15
|
-
__attr(__el0, "class", () => cn(ctx?.classes?.title, __props.className ?? __props.class));
|
|
16
|
-
__enterChildren(__el0);
|
|
17
|
-
__append(__el0, __child(() => __props.children));
|
|
18
|
-
__exitChildren();
|
|
19
|
-
return __el0;
|
|
20
|
-
})();
|
|
21
|
-
__flushMountFrame();
|
|
22
|
-
return __mfResult0;
|
|
23
|
-
} catch (__mfErr) {
|
|
24
|
-
__discardMountFrame(__mfDepth);
|
|
25
|
-
throw __mfErr;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function AlertDescription(__props) {
|
|
29
|
-
const __mfDepth = __pushMountFrame();
|
|
30
|
-
try {
|
|
31
|
-
const ctx = useContext(AlertContext);
|
|
32
|
-
const __mfResult0 = (() => {
|
|
33
|
-
const __el0 = __element("div");
|
|
34
|
-
__attr(__el0, "class", () => cn(ctx?.classes?.description, __props.className ?? __props.class));
|
|
35
|
-
__enterChildren(__el0);
|
|
36
|
-
__append(__el0, __child(() => __props.children));
|
|
37
|
-
__exitChildren();
|
|
38
|
-
return __el0;
|
|
39
|
-
})();
|
|
40
|
-
__flushMountFrame();
|
|
41
|
-
return __mfResult0;
|
|
42
|
-
} catch (__mfErr) {
|
|
43
|
-
__discardMountFrame(__mfDepth);
|
|
44
|
-
throw __mfErr;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function ComposedAlertRoot(__props) {
|
|
48
|
-
const __mfDepth = __pushMountFrame();
|
|
49
|
-
try {
|
|
50
|
-
const __mfResult0 = AlertContext.Provider({ get value() {
|
|
51
|
-
return { classes: __props.classes };
|
|
52
|
-
}, children: () => (() => {
|
|
53
|
-
const __el0 = __element("div");
|
|
54
|
-
__el0.setAttribute("role", "alert");
|
|
55
|
-
__attr(__el0, "class", () => cn(__props.classes?.root, __props.className ?? __props.class));
|
|
56
|
-
__enterChildren(__el0);
|
|
57
|
-
__append(__el0, __child(() => __props.children));
|
|
58
|
-
__exitChildren();
|
|
59
|
-
return __el0;
|
|
60
|
-
})() });
|
|
61
|
-
__flushMountFrame();
|
|
62
|
-
return __mfResult0;
|
|
63
|
-
} catch (__mfErr) {
|
|
64
|
-
__discardMountFrame(__mfDepth);
|
|
65
|
-
throw __mfErr;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
var ComposedAlert = Object.assign(ComposedAlertRoot, {
|
|
69
|
-
Title: AlertTitle,
|
|
70
|
-
Description: AlertDescription
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
export { ComposedAlert };
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
uniqueId
|
|
3
|
-
} from "./chunk-8y1jf6xr.js";
|
|
4
|
-
import {
|
|
5
|
-
Keys,
|
|
6
|
-
isKey
|
|
7
|
-
} from "./chunk-7867pr13.js";
|
|
8
|
-
import {
|
|
9
|
-
setDataState,
|
|
10
|
-
setValueRange
|
|
11
|
-
} from "./chunk-vevfhpc9.js";
|
|
12
|
-
import {
|
|
13
|
-
applyAttrs
|
|
14
|
-
} from "./chunk-2db2dnp3.js";
|
|
15
|
-
|
|
16
|
-
// src/slider/slider.tsx
|
|
17
|
-
import { __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __insert, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
|
|
18
|
-
import { signal } from "@vertz/ui";
|
|
19
|
-
function SliderRoot(options = {}) {
|
|
20
|
-
const __mfDepth = __pushMountFrame();
|
|
21
|
-
try {
|
|
22
|
-
let clamp = function(val) {
|
|
23
|
-
return Math.min(max, Math.max(min, val));
|
|
24
|
-
}, updatePosition = function(pct2) {
|
|
25
|
-
thumb.style.left = `${pct2}%`;
|
|
26
|
-
fill.style.width = `${pct2}%`;
|
|
27
|
-
}, setValue = function(val) {
|
|
28
|
-
if (state.disabled.peek())
|
|
29
|
-
return;
|
|
30
|
-
const clamped = clamp(val);
|
|
31
|
-
state.value.value = clamped;
|
|
32
|
-
setValueRange(thumb, clamped, min, max);
|
|
33
|
-
const pct2 = (clamped - min) / (max - min) * 100;
|
|
34
|
-
updatePosition(pct2);
|
|
35
|
-
setDataState(root, "active");
|
|
36
|
-
onValueChange?.(clamped);
|
|
37
|
-
}, valueFromPointer = function(event) {
|
|
38
|
-
const rect = track.getBoundingClientRect();
|
|
39
|
-
const pct2 = Math.max(0, Math.min(1, (event.clientX - rect.left) / rect.width));
|
|
40
|
-
const raw = min + pct2 * (max - min);
|
|
41
|
-
return Math.round(raw / step) * step;
|
|
42
|
-
};
|
|
43
|
-
const {
|
|
44
|
-
defaultValue = 0,
|
|
45
|
-
min = 0,
|
|
46
|
-
max = 100,
|
|
47
|
-
step = 1,
|
|
48
|
-
disabled = false,
|
|
49
|
-
onValueChange,
|
|
50
|
-
...attrs
|
|
51
|
-
} = options;
|
|
52
|
-
const state = {
|
|
53
|
-
value: signal(defaultValue),
|
|
54
|
-
disabled: signal(disabled)
|
|
55
|
-
};
|
|
56
|
-
const fill = (() => {
|
|
57
|
-
const __el0 = __element("div");
|
|
58
|
-
__el0.setAttribute("data-part", "fill");
|
|
59
|
-
{
|
|
60
|
-
const __v = { position: "absolute", height: "100%", borderRadius: "inherit" };
|
|
61
|
-
if (__v != null && __v !== false)
|
|
62
|
-
__el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
63
|
-
}
|
|
64
|
-
return __el0;
|
|
65
|
-
})();
|
|
66
|
-
const thumb = (() => {
|
|
67
|
-
const __el1 = __element("div");
|
|
68
|
-
__el1.setAttribute("role", "slider");
|
|
69
|
-
{
|
|
70
|
-
const __v = disabled ? "-1" : "0";
|
|
71
|
-
if (__v != null && __v !== false)
|
|
72
|
-
__el1.setAttribute("tabindex", __v === true ? "" : __v);
|
|
73
|
-
}
|
|
74
|
-
__el1.setAttribute("data-part", "thumb");
|
|
75
|
-
{
|
|
76
|
-
const __v = disabled ? "true" : undefined;
|
|
77
|
-
if (__v != null && __v !== false)
|
|
78
|
-
__el1.setAttribute("aria-disabled", __v === true ? "" : __v);
|
|
79
|
-
}
|
|
80
|
-
{
|
|
81
|
-
const __v = { position: "absolute", transform: "translate(-50%, -50%)" };
|
|
82
|
-
if (__v != null && __v !== false)
|
|
83
|
-
__el1.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
84
|
-
}
|
|
85
|
-
__on(__el1, "keydown", (event) => {
|
|
86
|
-
if (state.disabled.peek())
|
|
87
|
-
return;
|
|
88
|
-
const current = state.value.peek();
|
|
89
|
-
if (isKey(event, Keys.ArrowRight, Keys.ArrowUp)) {
|
|
90
|
-
event.preventDefault();
|
|
91
|
-
setValue(current + step);
|
|
92
|
-
} else if (isKey(event, Keys.ArrowLeft, Keys.ArrowDown)) {
|
|
93
|
-
event.preventDefault();
|
|
94
|
-
setValue(current - step);
|
|
95
|
-
} else if (isKey(event, Keys.Home)) {
|
|
96
|
-
event.preventDefault();
|
|
97
|
-
setValue(min);
|
|
98
|
-
} else if (isKey(event, Keys.End)) {
|
|
99
|
-
event.preventDefault();
|
|
100
|
-
setValue(max);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
return __el1;
|
|
104
|
-
})();
|
|
105
|
-
setValueRange(thumb, defaultValue, min, max);
|
|
106
|
-
const track = (() => {
|
|
107
|
-
const __el2 = __element("div");
|
|
108
|
-
__el2.setAttribute("data-part", "track");
|
|
109
|
-
{
|
|
110
|
-
const __v = { position: "relative" };
|
|
111
|
-
if (__v != null && __v !== false)
|
|
112
|
-
__el2.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
113
|
-
}
|
|
114
|
-
__enterChildren(__el2);
|
|
115
|
-
__insert(__el2, fill);
|
|
116
|
-
__insert(__el2, thumb);
|
|
117
|
-
__exitChildren();
|
|
118
|
-
return __el2;
|
|
119
|
-
})();
|
|
120
|
-
const root = (() => {
|
|
121
|
-
const __el3 = __element("div");
|
|
122
|
-
{
|
|
123
|
-
const __v = uniqueId("slider");
|
|
124
|
-
if (__v != null && __v !== false)
|
|
125
|
-
__el3.setAttribute("id", __v === true ? "" : __v);
|
|
126
|
-
}
|
|
127
|
-
{
|
|
128
|
-
const __v = disabled ? "disabled" : "active";
|
|
129
|
-
if (__v != null && __v !== false)
|
|
130
|
-
__el3.setAttribute("data-state", __v === true ? "" : __v);
|
|
131
|
-
}
|
|
132
|
-
__on(__el3, "pointerdown", (event) => {
|
|
133
|
-
if (state.disabled.peek())
|
|
134
|
-
return;
|
|
135
|
-
event.preventDefault();
|
|
136
|
-
setValue(valueFromPointer(event));
|
|
137
|
-
thumb.focus();
|
|
138
|
-
function onMove(e) {
|
|
139
|
-
setValue(valueFromPointer(e));
|
|
140
|
-
}
|
|
141
|
-
function onUp() {
|
|
142
|
-
document.removeEventListener("pointermove", onMove);
|
|
143
|
-
document.removeEventListener("pointerup", onUp);
|
|
144
|
-
}
|
|
145
|
-
document.addEventListener("pointermove", onMove);
|
|
146
|
-
document.addEventListener("pointerup", onUp);
|
|
147
|
-
});
|
|
148
|
-
__enterChildren(__el3);
|
|
149
|
-
__insert(__el3, track);
|
|
150
|
-
__exitChildren();
|
|
151
|
-
return __el3;
|
|
152
|
-
})();
|
|
153
|
-
const pct = (defaultValue - min) / (max - min) * 100;
|
|
154
|
-
updatePosition(pct);
|
|
155
|
-
applyAttrs(root, attrs);
|
|
156
|
-
const __mfResult0 = { root, thumb, track, state };
|
|
157
|
-
__flushMountFrame();
|
|
158
|
-
return __mfResult0;
|
|
159
|
-
} catch (__mfErr) {
|
|
160
|
-
__discardMountFrame(__mfDepth);
|
|
161
|
-
throw __mfErr;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
var Slider = {
|
|
165
|
-
Root: SliderRoot
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
export { Slider };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
uniqueId
|
|
3
|
-
} from "./chunk-8y1jf6xr.js";
|
|
4
|
-
import {
|
|
5
|
-
applyAttrs
|
|
6
|
-
} from "./chunk-2db2dnp3.js";
|
|
7
|
-
|
|
8
|
-
// src/badge/badge.tsx
|
|
9
|
-
import { __discardMountFrame, __element, __flushMountFrame, __pushMountFrame } from "@vertz/ui/internals";
|
|
10
|
-
function BadgeRoot(options = {}) {
|
|
11
|
-
const __mfDepth = __pushMountFrame();
|
|
12
|
-
try {
|
|
13
|
-
const { variant = "default", ...attrs } = options;
|
|
14
|
-
const badge = (() => {
|
|
15
|
-
const __el0 = __element("span");
|
|
16
|
-
{
|
|
17
|
-
const __v = uniqueId("badge");
|
|
18
|
-
if (__v != null && __v !== false)
|
|
19
|
-
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
20
|
-
}
|
|
21
|
-
__el0.setAttribute("data-slot", "badge");
|
|
22
|
-
{
|
|
23
|
-
const __v = variant;
|
|
24
|
-
if (__v != null && __v !== false)
|
|
25
|
-
__el0.setAttribute("data-variant", __v === true ? "" : __v);
|
|
26
|
-
}
|
|
27
|
-
return __el0;
|
|
28
|
-
})();
|
|
29
|
-
applyAttrs(badge, attrs);
|
|
30
|
-
const __mfResult0 = { badge };
|
|
31
|
-
__flushMountFrame();
|
|
32
|
-
return __mfResult0;
|
|
33
|
-
} catch (__mfErr) {
|
|
34
|
-
__discardMountFrame(__mfDepth);
|
|
35
|
-
throw __mfErr;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
var Badge = {
|
|
39
|
-
Root: BadgeRoot
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export { Badge };
|