@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
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-q7xbcj9q.js";
|
|
4
|
+
|
|
5
|
+
// src/empty-state/empty-state-composed.tsx
|
|
6
|
+
import { jsxDEV as jsxDEV_7x81h0kn } from "@vertz/ui/jsx-dev-runtime";
|
|
7
|
+
import { createContext, useContext } from "@vertz/ui";
|
|
8
|
+
var EmptyStateContext = createContext(undefined, "@vertz/ui-primitives::EmptyStateContext");
|
|
9
|
+
function EmptyStateIcon({ children, className, class: classProp }) {
|
|
10
|
+
const ctx = useContext(EmptyStateContext);
|
|
11
|
+
return jsxDEV_7x81h0kn("div", {
|
|
12
|
+
class: cn(ctx?.classes?.icon, className ?? classProp),
|
|
13
|
+
children
|
|
14
|
+
}, undefined, false, undefined, this);
|
|
15
|
+
}
|
|
16
|
+
function EmptyStateTitle({ children, className, class: classProp }) {
|
|
17
|
+
const ctx = useContext(EmptyStateContext);
|
|
18
|
+
return jsxDEV_7x81h0kn("h3", {
|
|
19
|
+
class: cn(ctx?.classes?.title, className ?? classProp),
|
|
20
|
+
children
|
|
21
|
+
}, undefined, false, undefined, this);
|
|
22
|
+
}
|
|
23
|
+
function EmptyStateDescription({ children, className, class: classProp }) {
|
|
24
|
+
const ctx = useContext(EmptyStateContext);
|
|
25
|
+
return jsxDEV_7x81h0kn("p", {
|
|
26
|
+
class: cn(ctx?.classes?.description, className ?? classProp),
|
|
27
|
+
children
|
|
28
|
+
}, undefined, false, undefined, this);
|
|
29
|
+
}
|
|
30
|
+
function EmptyStateAction({ children, className, class: classProp }) {
|
|
31
|
+
const ctx = useContext(EmptyStateContext);
|
|
32
|
+
return jsxDEV_7x81h0kn("div", {
|
|
33
|
+
class: cn(ctx?.classes?.action, className ?? classProp),
|
|
34
|
+
children
|
|
35
|
+
}, undefined, false, undefined, this);
|
|
36
|
+
}
|
|
37
|
+
function ComposedEmptyStateRoot({
|
|
38
|
+
children,
|
|
39
|
+
classes,
|
|
40
|
+
className,
|
|
41
|
+
class: classProp
|
|
42
|
+
}) {
|
|
43
|
+
return jsxDEV_7x81h0kn(EmptyStateContext.Provider, {
|
|
44
|
+
value: { classes },
|
|
45
|
+
children: jsxDEV_7x81h0kn("div", {
|
|
46
|
+
class: cn(classes?.root, className ?? classProp),
|
|
47
|
+
children
|
|
48
|
+
}, undefined, false, undefined, this)
|
|
49
|
+
}, undefined, false, undefined, this);
|
|
50
|
+
}
|
|
51
|
+
var ComposedEmptyState = Object.assign(ComposedEmptyStateRoot, {
|
|
52
|
+
Icon: EmptyStateIcon,
|
|
53
|
+
Title: EmptyStateTitle,
|
|
54
|
+
Description: EmptyStateDescription,
|
|
55
|
+
Action: EmptyStateAction
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export { ComposedEmptyState };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
handleActivation
|
|
3
|
+
} from "./chunk-7867pr13.js";
|
|
4
|
+
import {
|
|
5
|
+
applyAttrs
|
|
6
|
+
} from "./chunk-2db2dnp3.js";
|
|
7
|
+
|
|
8
|
+
// src/button/button.tsx
|
|
9
|
+
import { jsxDEV as jsxDEV_7x81h0kn } from "@vertz/ui/jsx-dev-runtime";
|
|
10
|
+
function ButtonRoot(options = {}) {
|
|
11
|
+
const { disabled = false, onClick, ...attrs } = options;
|
|
12
|
+
const el = jsxDEV_7x81h0kn("button", {
|
|
13
|
+
type: "button",
|
|
14
|
+
disabled,
|
|
15
|
+
"aria-disabled": disabled ? "true" : undefined,
|
|
16
|
+
onClick: () => {
|
|
17
|
+
if (disabled)
|
|
18
|
+
return;
|
|
19
|
+
onClick?.();
|
|
20
|
+
},
|
|
21
|
+
onKeydown: (event) => {
|
|
22
|
+
if (disabled)
|
|
23
|
+
return;
|
|
24
|
+
handleActivation(event, () => {
|
|
25
|
+
event.target.click();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}, undefined, false, undefined, this);
|
|
29
|
+
applyAttrs(el, attrs);
|
|
30
|
+
return el;
|
|
31
|
+
}
|
|
32
|
+
var Button = {
|
|
33
|
+
Root: ButtonRoot
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { Button };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-q7xbcj9q.js";
|
|
4
|
+
import {
|
|
5
|
+
uniqueId
|
|
6
|
+
} from "./chunk-8y1jf6xr.js";
|
|
7
|
+
import {
|
|
8
|
+
Keys,
|
|
9
|
+
isKey
|
|
10
|
+
} from "./chunk-7867pr13.js";
|
|
11
|
+
|
|
12
|
+
// src/checkbox/checkbox-composed.tsx
|
|
13
|
+
import { jsxDEV as jsxDEV_7x81h0kn } from "@vertz/ui/jsx-dev-runtime";
|
|
14
|
+
function dataStateFor(checked) {
|
|
15
|
+
if (checked === "mixed")
|
|
16
|
+
return "indeterminate";
|
|
17
|
+
return checked ? "checked" : "unchecked";
|
|
18
|
+
}
|
|
19
|
+
function ariaCheckedFor(checked) {
|
|
20
|
+
if (checked === "mixed")
|
|
21
|
+
return "mixed";
|
|
22
|
+
return String(checked);
|
|
23
|
+
}
|
|
24
|
+
function ComposedCheckboxRoot({
|
|
25
|
+
children,
|
|
26
|
+
classes,
|
|
27
|
+
defaultChecked = false,
|
|
28
|
+
disabled = false,
|
|
29
|
+
onCheckedChange
|
|
30
|
+
}) {
|
|
31
|
+
let checked = defaultChecked;
|
|
32
|
+
function toggle() {
|
|
33
|
+
if (disabled)
|
|
34
|
+
return;
|
|
35
|
+
checked = checked === "mixed" ? true : !checked;
|
|
36
|
+
onCheckedChange?.(checked);
|
|
37
|
+
}
|
|
38
|
+
return jsxDEV_7x81h0kn("button", {
|
|
39
|
+
type: "button",
|
|
40
|
+
role: "checkbox",
|
|
41
|
+
id: uniqueId("checkbox"),
|
|
42
|
+
"aria-checked": ariaCheckedFor(checked),
|
|
43
|
+
"data-state": dataStateFor(checked),
|
|
44
|
+
disabled,
|
|
45
|
+
"aria-disabled": disabled ? "true" : undefined,
|
|
46
|
+
class: cn(classes?.root),
|
|
47
|
+
onClick: toggle,
|
|
48
|
+
onKeydown: (e) => {
|
|
49
|
+
if (isKey(e, Keys.Space)) {
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
toggle();
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
children: [
|
|
55
|
+
jsxDEV_7x81h0kn("span", {
|
|
56
|
+
"data-part": "indicator",
|
|
57
|
+
"data-state": dataStateFor(checked),
|
|
58
|
+
class: cn(classes?.indicator),
|
|
59
|
+
style: { width: "100%", height: "100%", pointerEvents: "none" },
|
|
60
|
+
children: [
|
|
61
|
+
jsxDEV_7x81h0kn("svg", {
|
|
62
|
+
"aria-hidden": "true",
|
|
63
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
64
|
+
viewBox: "0 0 24 24",
|
|
65
|
+
fill: "none",
|
|
66
|
+
stroke: "currentColor",
|
|
67
|
+
"stroke-width": "3",
|
|
68
|
+
"stroke-linecap": "round",
|
|
69
|
+
"stroke-linejoin": "round",
|
|
70
|
+
"data-part": "indicator-icon",
|
|
71
|
+
"data-icon": "check",
|
|
72
|
+
width: "100%",
|
|
73
|
+
height: "100%",
|
|
74
|
+
children: jsxDEV_7x81h0kn("path", {
|
|
75
|
+
d: "M4 12 9 17 20 6"
|
|
76
|
+
}, undefined, false, undefined, this)
|
|
77
|
+
}, undefined, false, undefined, this),
|
|
78
|
+
jsxDEV_7x81h0kn("svg", {
|
|
79
|
+
"aria-hidden": "true",
|
|
80
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
81
|
+
viewBox: "0 0 24 24",
|
|
82
|
+
fill: "none",
|
|
83
|
+
stroke: "currentColor",
|
|
84
|
+
"stroke-width": "3",
|
|
85
|
+
"stroke-linecap": "round",
|
|
86
|
+
"stroke-linejoin": "round",
|
|
87
|
+
"data-part": "indicator-icon",
|
|
88
|
+
"data-icon": "minus",
|
|
89
|
+
width: "100%",
|
|
90
|
+
height: "100%",
|
|
91
|
+
children: jsxDEV_7x81h0kn("path", {
|
|
92
|
+
d: "M5 12h14"
|
|
93
|
+
}, undefined, false, undefined, this)
|
|
94
|
+
}, undefined, false, undefined, this)
|
|
95
|
+
]
|
|
96
|
+
}, undefined, true, undefined, this),
|
|
97
|
+
children
|
|
98
|
+
]
|
|
99
|
+
}, undefined, true, undefined, this);
|
|
100
|
+
}
|
|
101
|
+
var ComposedCheckbox = ComposedCheckboxRoot;
|
|
102
|
+
|
|
103
|
+
export { ComposedCheckbox };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import {
|
|
2
|
+
uniqueId
|
|
3
|
+
} from "./chunk-8y1jf6xr.js";
|
|
4
|
+
import {
|
|
5
|
+
Keys,
|
|
6
|
+
handleListNavigation,
|
|
7
|
+
isKey
|
|
8
|
+
} from "./chunk-7867pr13.js";
|
|
9
|
+
import {
|
|
10
|
+
setDataState,
|
|
11
|
+
setExpanded,
|
|
12
|
+
setHidden,
|
|
13
|
+
setHiddenAnimated
|
|
14
|
+
} from "./chunk-vevfhpc9.js";
|
|
15
|
+
import {
|
|
16
|
+
applyAttrs
|
|
17
|
+
} from "./chunk-2db2dnp3.js";
|
|
18
|
+
|
|
19
|
+
// src/accordion/accordion.tsx
|
|
20
|
+
import { jsxDEV as jsxDEV_7x81h0kn } from "@vertz/ui/jsx-dev-runtime";
|
|
21
|
+
import { signal } from "@vertz/ui";
|
|
22
|
+
function AccordionRoot(options = {}) {
|
|
23
|
+
const { multiple = false, defaultValue = [], onValueChange, ...attrs } = options;
|
|
24
|
+
const state = { value: signal([...defaultValue]) };
|
|
25
|
+
const triggers = [];
|
|
26
|
+
const itemMap = new Map;
|
|
27
|
+
function updateItemState(val, open) {
|
|
28
|
+
const entry = itemMap.get(val);
|
|
29
|
+
if (!entry)
|
|
30
|
+
return;
|
|
31
|
+
const { trigger: t, content: c } = entry;
|
|
32
|
+
c.removeAttribute("data-initial");
|
|
33
|
+
if (open) {
|
|
34
|
+
setHidden(c, false);
|
|
35
|
+
}
|
|
36
|
+
const height = c.scrollHeight;
|
|
37
|
+
c.style.setProperty("--accordion-content-height", `${height}px`);
|
|
38
|
+
setExpanded(t, open);
|
|
39
|
+
setDataState(t, open ? "open" : "closed");
|
|
40
|
+
setDataState(c, open ? "open" : "closed");
|
|
41
|
+
if (!open) {
|
|
42
|
+
setHiddenAnimated(c, true);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function toggleItem(value) {
|
|
46
|
+
const prev = [...state.value.peek()];
|
|
47
|
+
const current = [...prev];
|
|
48
|
+
const idx = current.indexOf(value);
|
|
49
|
+
if (idx >= 0) {
|
|
50
|
+
current.splice(idx, 1);
|
|
51
|
+
} else {
|
|
52
|
+
if (multiple) {
|
|
53
|
+
current.push(value);
|
|
54
|
+
} else {
|
|
55
|
+
current.length = 0;
|
|
56
|
+
current.push(value);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
state.value.value = current;
|
|
60
|
+
onValueChange?.(current);
|
|
61
|
+
for (const v of prev) {
|
|
62
|
+
if (!current.includes(v)) {
|
|
63
|
+
updateItemState(v, false);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
for (const v of current) {
|
|
67
|
+
if (!prev.includes(v)) {
|
|
68
|
+
updateItemState(v, true);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const root = jsxDEV_7x81h0kn("div", {
|
|
73
|
+
"data-orientation": "vertical",
|
|
74
|
+
onKeydown: (event) => {
|
|
75
|
+
if (isKey(event, Keys.ArrowUp, Keys.ArrowDown, Keys.Home, Keys.End)) {
|
|
76
|
+
handleListNavigation(event, triggers, { orientation: "vertical" });
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}, undefined, false, undefined, this);
|
|
80
|
+
function Item(value) {
|
|
81
|
+
const baseId = uniqueId("accordion");
|
|
82
|
+
const triggerId = `${baseId}-trigger`;
|
|
83
|
+
const contentId = `${baseId}-content`;
|
|
84
|
+
const isOpen = state.value.peek().includes(value);
|
|
85
|
+
const trigger = jsxDEV_7x81h0kn("button", {
|
|
86
|
+
type: "button",
|
|
87
|
+
id: triggerId,
|
|
88
|
+
"aria-controls": contentId,
|
|
89
|
+
"data-value": value,
|
|
90
|
+
"aria-expanded": isOpen ? "true" : "false",
|
|
91
|
+
"data-state": isOpen ? "open" : "closed",
|
|
92
|
+
onClick: () => toggleItem(value)
|
|
93
|
+
}, undefined, false, undefined, this);
|
|
94
|
+
const content = jsxDEV_7x81h0kn("div", {
|
|
95
|
+
role: "region",
|
|
96
|
+
id: contentId,
|
|
97
|
+
"aria-labelledby": triggerId,
|
|
98
|
+
"aria-hidden": isOpen ? "false" : "true",
|
|
99
|
+
"data-state": isOpen ? "open" : "closed",
|
|
100
|
+
"data-initial": isOpen ? "" : undefined,
|
|
101
|
+
style: { display: isOpen ? "" : "none" }
|
|
102
|
+
}, undefined, false, undefined, this);
|
|
103
|
+
const item = jsxDEV_7x81h0kn("div", {
|
|
104
|
+
"data-value": value,
|
|
105
|
+
children: [
|
|
106
|
+
trigger,
|
|
107
|
+
content
|
|
108
|
+
]
|
|
109
|
+
}, undefined, true, undefined, this);
|
|
110
|
+
itemMap.set(value, { trigger, content });
|
|
111
|
+
triggers.push(trigger);
|
|
112
|
+
if (isOpen) {
|
|
113
|
+
requestAnimationFrame(() => {
|
|
114
|
+
const height = content.scrollHeight;
|
|
115
|
+
content.style.setProperty("--accordion-content-height", `${height}px`);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
return { item, trigger, content };
|
|
119
|
+
}
|
|
120
|
+
applyAttrs(root, attrs);
|
|
121
|
+
return { root, state, Item };
|
|
122
|
+
}
|
|
123
|
+
var Accordion = {
|
|
124
|
+
Root: AccordionRoot
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export { Accordion };
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-q7xbcj9q.js";
|
|
4
|
+
import {
|
|
5
|
+
linkedIds
|
|
6
|
+
} from "./chunk-8y1jf6xr.js";
|
|
7
|
+
|
|
8
|
+
// src/sheet/sheet-composed.tsx
|
|
9
|
+
import { jsxDEV as jsxDEV_7x81h0kn } from "@vertz/ui/jsx-dev-runtime";
|
|
10
|
+
import { createContext, ref, useContext } from "@vertz/ui";
|
|
11
|
+
var SheetContext = createContext(undefined, "@vertz/ui-primitives::SheetContext");
|
|
12
|
+
function useSheetContext(componentName) {
|
|
13
|
+
const ctx = useContext(SheetContext);
|
|
14
|
+
if (!ctx) {
|
|
15
|
+
throw new Error(`<Sheet.${componentName}> must be used inside <Sheet>. ` + "Ensure it is a direct or nested child of the Sheet root component.");
|
|
16
|
+
}
|
|
17
|
+
return ctx;
|
|
18
|
+
}
|
|
19
|
+
function SheetTrigger({ children }) {
|
|
20
|
+
const ctx = useSheetContext("Trigger");
|
|
21
|
+
return jsxDEV_7x81h0kn("span", {
|
|
22
|
+
style: { display: "contents" },
|
|
23
|
+
"data-sheet-trigger": "",
|
|
24
|
+
"data-state": "closed",
|
|
25
|
+
onClick: () => ctx.toggle(),
|
|
26
|
+
children
|
|
27
|
+
}, undefined, false, undefined, this);
|
|
28
|
+
}
|
|
29
|
+
function SheetContent({
|
|
30
|
+
children,
|
|
31
|
+
className: cls,
|
|
32
|
+
class: classProp,
|
|
33
|
+
showClose = true
|
|
34
|
+
}) {
|
|
35
|
+
const ctx = useSheetContext("Content");
|
|
36
|
+
const el = jsxDEV_7x81h0kn("dialog", {
|
|
37
|
+
ref: ctx.dialogRef,
|
|
38
|
+
id: ctx.contentId,
|
|
39
|
+
role: "dialog",
|
|
40
|
+
"aria-modal": "true",
|
|
41
|
+
"aria-labelledby": ctx.titleId,
|
|
42
|
+
"aria-describedby": ctx.descriptionId,
|
|
43
|
+
"data-side": ctx.side,
|
|
44
|
+
"data-state": "closed",
|
|
45
|
+
class: cn(ctx.classes?.content, cls ?? classProp),
|
|
46
|
+
onCancel: (e) => {
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
ctx.close();
|
|
49
|
+
},
|
|
50
|
+
onClick: (e) => {
|
|
51
|
+
if (e.target === ctx.dialogRef.current)
|
|
52
|
+
ctx.close();
|
|
53
|
+
},
|
|
54
|
+
children: [
|
|
55
|
+
showClose && jsxDEV_7x81h0kn("button", {
|
|
56
|
+
type: "button",
|
|
57
|
+
"data-slot": "sheet-close",
|
|
58
|
+
class: cn(ctx.classes?.close),
|
|
59
|
+
"aria-label": "Close",
|
|
60
|
+
onClick: () => ctx.close(),
|
|
61
|
+
children: jsxDEV_7x81h0kn("svg", {
|
|
62
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
63
|
+
"aria-hidden": "true",
|
|
64
|
+
focusable: "false",
|
|
65
|
+
width: "16",
|
|
66
|
+
height: "16",
|
|
67
|
+
viewBox: "0 0 24 24",
|
|
68
|
+
fill: "none",
|
|
69
|
+
stroke: "currentColor",
|
|
70
|
+
"stroke-width": "2",
|
|
71
|
+
"stroke-linecap": "round",
|
|
72
|
+
"stroke-linejoin": "round",
|
|
73
|
+
children: [
|
|
74
|
+
jsxDEV_7x81h0kn("path", {
|
|
75
|
+
d: "M18 6 6 18"
|
|
76
|
+
}, undefined, false, undefined, this),
|
|
77
|
+
jsxDEV_7x81h0kn("path", {
|
|
78
|
+
d: "m6 6 12 12"
|
|
79
|
+
}, undefined, false, undefined, this)
|
|
80
|
+
]
|
|
81
|
+
}, undefined, true, undefined, this)
|
|
82
|
+
}, undefined, false, undefined, this),
|
|
83
|
+
children
|
|
84
|
+
]
|
|
85
|
+
}, undefined, true, undefined, this);
|
|
86
|
+
return el;
|
|
87
|
+
}
|
|
88
|
+
function SheetTitle({ children, className: cls, class: classProp }) {
|
|
89
|
+
const ctx = useSheetContext("Title");
|
|
90
|
+
return jsxDEV_7x81h0kn("h2", {
|
|
91
|
+
id: ctx.titleId,
|
|
92
|
+
class: cn(ctx.classes?.title, cls ?? classProp),
|
|
93
|
+
children
|
|
94
|
+
}, undefined, false, undefined, this);
|
|
95
|
+
}
|
|
96
|
+
function SheetDescription({ children, className: cls, class: classProp }) {
|
|
97
|
+
const ctx = useSheetContext("Description");
|
|
98
|
+
return jsxDEV_7x81h0kn("p", {
|
|
99
|
+
id: ctx.descriptionId,
|
|
100
|
+
class: cn(ctx.classes?.description, cls ?? classProp),
|
|
101
|
+
children
|
|
102
|
+
}, undefined, false, undefined, this);
|
|
103
|
+
}
|
|
104
|
+
function SheetClose({ children, className: cls, class: classProp }) {
|
|
105
|
+
const ctx = useSheetContext("Close");
|
|
106
|
+
return jsxDEV_7x81h0kn("button", {
|
|
107
|
+
type: "button",
|
|
108
|
+
"data-slot": "sheet-close",
|
|
109
|
+
class: cn(ctx.classes?.close, cls ?? classProp),
|
|
110
|
+
"aria-label": children ? undefined : "Close",
|
|
111
|
+
onClick: () => ctx.close(),
|
|
112
|
+
children: children ?? "×"
|
|
113
|
+
}, undefined, false, undefined, this);
|
|
114
|
+
}
|
|
115
|
+
function ComposedSheetRoot({
|
|
116
|
+
children,
|
|
117
|
+
classes,
|
|
118
|
+
side = "right",
|
|
119
|
+
onOpenChange
|
|
120
|
+
}) {
|
|
121
|
+
const ids = linkedIds("sheet");
|
|
122
|
+
const titleId = `${ids.contentId}-title`;
|
|
123
|
+
const descriptionId = `${ids.contentId}-description`;
|
|
124
|
+
const dialogRef = ref();
|
|
125
|
+
let isOpen = false;
|
|
126
|
+
function showDialog() {
|
|
127
|
+
const el = dialogRef.current;
|
|
128
|
+
if (!el || el.open)
|
|
129
|
+
return;
|
|
130
|
+
el.setAttribute("data-state", "open");
|
|
131
|
+
el.showModal();
|
|
132
|
+
}
|
|
133
|
+
function hideDialog() {
|
|
134
|
+
const el = dialogRef.current;
|
|
135
|
+
if (!el || !el.open)
|
|
136
|
+
return;
|
|
137
|
+
el.setAttribute("data-state", "closed");
|
|
138
|
+
el.offsetHeight;
|
|
139
|
+
const onEnd = () => {
|
|
140
|
+
el.removeEventListener("animationend", onEnd);
|
|
141
|
+
if (el.open)
|
|
142
|
+
el.close();
|
|
143
|
+
};
|
|
144
|
+
el.addEventListener("animationend", onEnd);
|
|
145
|
+
setTimeout(onEnd, 350);
|
|
146
|
+
}
|
|
147
|
+
function open() {
|
|
148
|
+
isOpen = true;
|
|
149
|
+
showDialog();
|
|
150
|
+
onOpenChange?.(true);
|
|
151
|
+
}
|
|
152
|
+
function close() {
|
|
153
|
+
hideDialog();
|
|
154
|
+
isOpen = false;
|
|
155
|
+
onOpenChange?.(false);
|
|
156
|
+
}
|
|
157
|
+
function toggle() {
|
|
158
|
+
if (isOpen)
|
|
159
|
+
close();
|
|
160
|
+
else
|
|
161
|
+
open();
|
|
162
|
+
}
|
|
163
|
+
const ctx = {
|
|
164
|
+
isOpen,
|
|
165
|
+
titleId,
|
|
166
|
+
descriptionId,
|
|
167
|
+
contentId: ids.contentId,
|
|
168
|
+
dialogRef,
|
|
169
|
+
side,
|
|
170
|
+
classes,
|
|
171
|
+
open,
|
|
172
|
+
close,
|
|
173
|
+
toggle
|
|
174
|
+
};
|
|
175
|
+
return jsxDEV_7x81h0kn(SheetContext.Provider, {
|
|
176
|
+
value: ctx,
|
|
177
|
+
children: jsxDEV_7x81h0kn("span", {
|
|
178
|
+
style: { display: "contents" },
|
|
179
|
+
"data-sheet-root": "",
|
|
180
|
+
children
|
|
181
|
+
}, undefined, false, undefined, this)
|
|
182
|
+
}, undefined, false, undefined, this);
|
|
183
|
+
}
|
|
184
|
+
var ComposedSheet = Object.assign(ComposedSheetRoot, {
|
|
185
|
+
Trigger: SheetTrigger,
|
|
186
|
+
Content: SheetContent,
|
|
187
|
+
Title: SheetTitle,
|
|
188
|
+
Description: SheetDescription,
|
|
189
|
+
Close: SheetClose
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
export { ComposedSheet };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {
|
|
2
|
+
linkedIds
|
|
3
|
+
} from "./chunk-8y1jf6xr.js";
|
|
4
|
+
import {
|
|
5
|
+
setDataState,
|
|
6
|
+
setExpanded,
|
|
7
|
+
setHidden,
|
|
8
|
+
setHiddenAnimated
|
|
9
|
+
} from "./chunk-vevfhpc9.js";
|
|
10
|
+
import {
|
|
11
|
+
applyAttrs
|
|
12
|
+
} from "./chunk-2db2dnp3.js";
|
|
13
|
+
|
|
14
|
+
// src/collapsible/collapsible.tsx
|
|
15
|
+
import { jsxDEV as jsxDEV_7x81h0kn } from "@vertz/ui/jsx-dev-runtime";
|
|
16
|
+
import { signal } from "@vertz/ui";
|
|
17
|
+
function CollapsibleRoot(options = {}) {
|
|
18
|
+
const { defaultOpen = false, disabled = false, onOpenChange, ...attrs } = options;
|
|
19
|
+
const ids = linkedIds("collapsible");
|
|
20
|
+
const state = {
|
|
21
|
+
open: signal(defaultOpen),
|
|
22
|
+
disabled: signal(disabled)
|
|
23
|
+
};
|
|
24
|
+
function toggle() {
|
|
25
|
+
if (state.disabled.peek())
|
|
26
|
+
return;
|
|
27
|
+
const next = !state.open.peek();
|
|
28
|
+
state.open.value = next;
|
|
29
|
+
if (next) {
|
|
30
|
+
setHidden(content, false);
|
|
31
|
+
}
|
|
32
|
+
const height = content.scrollHeight;
|
|
33
|
+
content.style.setProperty("--collapsible-content-height", `${height}px`);
|
|
34
|
+
setExpanded(trigger, next);
|
|
35
|
+
setDataState(trigger, next ? "open" : "closed");
|
|
36
|
+
setDataState(content, next ? "open" : "closed");
|
|
37
|
+
if (!next) {
|
|
38
|
+
setHiddenAnimated(content, true);
|
|
39
|
+
}
|
|
40
|
+
onOpenChange?.(next);
|
|
41
|
+
}
|
|
42
|
+
const trigger = jsxDEV_7x81h0kn("button", {
|
|
43
|
+
type: "button",
|
|
44
|
+
id: ids.triggerId,
|
|
45
|
+
"aria-controls": ids.contentId,
|
|
46
|
+
"aria-expanded": defaultOpen ? "true" : "false",
|
|
47
|
+
"data-state": defaultOpen ? "open" : "closed",
|
|
48
|
+
disabled,
|
|
49
|
+
"aria-disabled": disabled ? "true" : undefined,
|
|
50
|
+
onClick: toggle
|
|
51
|
+
}, undefined, false, undefined, this);
|
|
52
|
+
const content = jsxDEV_7x81h0kn("div", {
|
|
53
|
+
id: ids.contentId,
|
|
54
|
+
"aria-hidden": defaultOpen ? "false" : "true",
|
|
55
|
+
"data-state": defaultOpen ? "open" : "closed",
|
|
56
|
+
style: { display: defaultOpen ? "" : "none" }
|
|
57
|
+
}, undefined, false, undefined, this);
|
|
58
|
+
const root = jsxDEV_7x81h0kn("div", {
|
|
59
|
+
children: [
|
|
60
|
+
trigger,
|
|
61
|
+
content
|
|
62
|
+
]
|
|
63
|
+
}, undefined, true, undefined, this);
|
|
64
|
+
applyAttrs(root, attrs);
|
|
65
|
+
return { root, trigger, content, state };
|
|
66
|
+
}
|
|
67
|
+
var Collapsible = {
|
|
68
|
+
Root: CollapsibleRoot
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export { Collapsible };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Keys,
|
|
3
|
+
isKey
|
|
4
|
+
} from "./chunk-7867pr13.js";
|
|
5
|
+
import {
|
|
6
|
+
setDataState
|
|
7
|
+
} from "./chunk-vevfhpc9.js";
|
|
8
|
+
import {
|
|
9
|
+
applyAttrs
|
|
10
|
+
} from "./chunk-2db2dnp3.js";
|
|
11
|
+
|
|
12
|
+
// src/carousel/carousel.tsx
|
|
13
|
+
import { jsxDEV as jsxDEV_7x81h0kn } from "@vertz/ui/jsx-dev-runtime";
|
|
14
|
+
import { signal } from "@vertz/ui";
|
|
15
|
+
function CarouselRoot(options = {}) {
|
|
16
|
+
const {
|
|
17
|
+
orientation = "horizontal",
|
|
18
|
+
loop = false,
|
|
19
|
+
defaultIndex = 0,
|
|
20
|
+
onSlideChange,
|
|
21
|
+
...attrs
|
|
22
|
+
} = options;
|
|
23
|
+
const state = {
|
|
24
|
+
currentIndex: signal(defaultIndex),
|
|
25
|
+
slideCount: signal(0)
|
|
26
|
+
};
|
|
27
|
+
const slides = [];
|
|
28
|
+
function updateSlideVisibility() {
|
|
29
|
+
const current = state.currentIndex.peek();
|
|
30
|
+
for (let i = 0;i < slides.length; i++) {
|
|
31
|
+
const slide = slides[i];
|
|
32
|
+
if (!slide)
|
|
33
|
+
continue;
|
|
34
|
+
slide.setAttribute("aria-hidden", String(i !== current));
|
|
35
|
+
slide.setAttribute("aria-label", `Slide ${i + 1} of ${slides.length}`);
|
|
36
|
+
setDataState(slide, i === current ? "active" : "inactive");
|
|
37
|
+
}
|
|
38
|
+
if (!loop) {
|
|
39
|
+
prevButton.disabled = current <= 0;
|
|
40
|
+
nextButton.disabled = current >= slides.length - 1;
|
|
41
|
+
}
|
|
42
|
+
const translateProp = orientation === "horizontal" ? "translateX" : "translateY";
|
|
43
|
+
viewport.style.transform = `${translateProp}(-${current * 100}%)`;
|
|
44
|
+
}
|
|
45
|
+
function goTo(index) {
|
|
46
|
+
const total = slides.length;
|
|
47
|
+
if (total === 0)
|
|
48
|
+
return;
|
|
49
|
+
let next = index;
|
|
50
|
+
if (loop) {
|
|
51
|
+
next = (index % total + total) % total;
|
|
52
|
+
} else {
|
|
53
|
+
next = Math.max(0, Math.min(total - 1, index));
|
|
54
|
+
}
|
|
55
|
+
if (next === state.currentIndex.peek())
|
|
56
|
+
return;
|
|
57
|
+
state.currentIndex.value = next;
|
|
58
|
+
updateSlideVisibility();
|
|
59
|
+
onSlideChange?.(next);
|
|
60
|
+
}
|
|
61
|
+
function goNext() {
|
|
62
|
+
goTo(state.currentIndex.peek() + 1);
|
|
63
|
+
}
|
|
64
|
+
function goPrev() {
|
|
65
|
+
goTo(state.currentIndex.peek() - 1);
|
|
66
|
+
}
|
|
67
|
+
const viewport = jsxDEV_7x81h0kn("div", {
|
|
68
|
+
style: { overflow: "hidden" }
|
|
69
|
+
}, undefined, false, undefined, this);
|
|
70
|
+
const prevButton = jsxDEV_7x81h0kn("button", {
|
|
71
|
+
type: "button",
|
|
72
|
+
"aria-label": "Previous slide",
|
|
73
|
+
onClick: goPrev
|
|
74
|
+
}, undefined, false, undefined, this);
|
|
75
|
+
const nextButton = jsxDEV_7x81h0kn("button", {
|
|
76
|
+
type: "button",
|
|
77
|
+
"aria-label": "Next slide",
|
|
78
|
+
onClick: goNext
|
|
79
|
+
}, undefined, false, undefined, this);
|
|
80
|
+
const root = jsxDEV_7x81h0kn("div", {
|
|
81
|
+
role: "region",
|
|
82
|
+
"aria-roledescription": "carousel",
|
|
83
|
+
"data-orientation": orientation,
|
|
84
|
+
onKeydown: (event) => {
|
|
85
|
+
const prevKey = orientation === "horizontal" ? Keys.ArrowLeft : Keys.ArrowUp;
|
|
86
|
+
const nextKey = orientation === "horizontal" ? Keys.ArrowRight : Keys.ArrowDown;
|
|
87
|
+
if (isKey(event, prevKey)) {
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
goPrev();
|
|
90
|
+
}
|
|
91
|
+
if (isKey(event, nextKey)) {
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
goNext();
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
children: viewport
|
|
97
|
+
}, undefined, false, undefined, this);
|
|
98
|
+
function Slide() {
|
|
99
|
+
const slide = jsxDEV_7x81h0kn("div", {
|
|
100
|
+
role: "group",
|
|
101
|
+
"aria-roledescription": "slide"
|
|
102
|
+
}, undefined, false, undefined, this);
|
|
103
|
+
slides.push(slide);
|
|
104
|
+
state.slideCount.value = slides.length;
|
|
105
|
+
updateSlideVisibility();
|
|
106
|
+
return slide;
|
|
107
|
+
}
|
|
108
|
+
updateSlideVisibility();
|
|
109
|
+
applyAttrs(root, attrs);
|
|
110
|
+
return { root, viewport, prevButton, nextButton, state, Slide, goTo, goNext, goPrev };
|
|
111
|
+
}
|
|
112
|
+
var Carousel = {
|
|
113
|
+
Root: CarouselRoot
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export { Carousel };
|