@vertz/ui-primitives 0.2.21 → 0.2.23

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.
Files changed (97) hide show
  1. package/dist/shared/{chunk-q8dm19a5.js → chunk-2db2dnp3.js} +0 -1
  2. package/dist/shared/chunk-3h1mxp95.js +148 -0
  3. package/dist/shared/chunk-3kwh27dv.js +135 -0
  4. package/dist/shared/chunk-4894pmy6.js +184 -0
  5. package/dist/shared/{chunk-v9qddmh9.js → chunk-56reyd5r.js} +20 -29
  6. package/dist/shared/chunk-67sn29eh.js +125 -0
  7. package/dist/shared/chunk-7cb3z0s8.js +287 -0
  8. package/dist/shared/chunk-8c01c8mb.js +217 -0
  9. package/dist/shared/chunk-99tk72t3.js +69 -0
  10. package/dist/shared/chunk-9gfp3ffv.js +204 -0
  11. package/dist/shared/chunk-b25npqer.js +149 -0
  12. package/dist/shared/chunk-cgb2j94g.js +141 -0
  13. package/dist/shared/chunk-e1jcf22s.js +79 -0
  14. package/dist/shared/chunk-e3h0ddmx.js +168 -0
  15. package/dist/shared/chunk-f2vx4tpw.js +168 -0
  16. package/dist/shared/chunk-h3v10x04.js +271 -0
  17. package/dist/shared/chunk-hdvdfd1c.js +96 -0
  18. package/dist/shared/{chunk-zf0rhm9e.js → chunk-j902w020.js} +1 -1
  19. package/dist/shared/chunk-jdygp28a.js +260 -0
  20. package/dist/shared/chunk-jqre4qtw.js +180 -0
  21. package/dist/shared/{chunk-pvy0tcd7.js → chunk-mgr904ap.js} +75 -35
  22. package/dist/shared/chunk-mr1tb0dp.js +167 -0
  23. package/dist/shared/chunk-nj420k31.js +54 -0
  24. package/dist/shared/chunk-p0x7hgv6.js +181 -0
  25. package/dist/shared/{chunk-gzgyfhz6.js → chunk-pn6shbcs.js} +134 -82
  26. package/dist/shared/chunk-pzx0vpq1.js +223 -0
  27. package/dist/shared/chunk-tn0m98j8.js +42 -0
  28. package/dist/shared/{chunk-g67tnd19.js → chunk-ttb2tt03.js} +49 -29
  29. package/dist/shared/{chunk-vvjyx7fe.js → chunk-vevfhpc9.js} +1 -1
  30. package/dist/shared/chunk-vy874zxe.js +68 -0
  31. package/dist/shared/chunk-ww7k2azn.js +297 -0
  32. package/dist/shared/{chunk-f501vw7e.js → chunk-xa1b96mb.js} +2 -2
  33. package/dist/shared/chunk-xs6gp369.js +245 -0
  34. package/dist/shared/chunk-y4mmmayp.js +206 -0
  35. package/dist/src/accordion/accordion.js +1 -1
  36. package/dist/src/alert-dialog/alert-dialog.js +1 -1
  37. package/dist/src/badge/badge.js +1 -1
  38. package/dist/src/button/button.js +1 -1
  39. package/dist/src/calendar/calendar.js +1 -1
  40. package/dist/src/carousel/carousel.js +1 -1
  41. package/dist/src/checkbox/checkbox.js +1 -1
  42. package/dist/src/collapsible/collapsible.js +1 -1
  43. package/dist/src/combobox/combobox.js +1 -1
  44. package/dist/src/command/command.js +1 -1
  45. package/dist/src/context-menu/context-menu.js +1 -1
  46. package/dist/src/date-picker/date-picker.js +1 -1
  47. package/dist/src/dialog/dialog.js +1 -1
  48. package/dist/src/dropdown-menu/dropdown-menu.js +1 -1
  49. package/dist/src/hover-card/hover-card.js +1 -1
  50. package/dist/src/index.d.ts +281 -106
  51. package/dist/src/index.js +5779 -4266
  52. package/dist/src/menu/menu.js +1 -1
  53. package/dist/src/menubar/menubar.js +1 -1
  54. package/dist/src/navigation-menu/navigation-menu.js +1 -1
  55. package/dist/src/popover/popover.js +1 -1
  56. package/dist/src/progress/progress.js +1 -1
  57. package/dist/src/radio/radio.js +1 -1
  58. package/dist/src/resizable-panel/resizable-panel.js +1 -1
  59. package/dist/src/scroll-area/scroll-area.js +1 -1
  60. package/dist/src/select/select.js +1 -1
  61. package/dist/src/sheet/sheet.js +1 -1
  62. package/dist/src/slider/slider.js +1 -1
  63. package/dist/src/switch/switch.js +1 -1
  64. package/dist/src/tabs/tabs.js +1 -1
  65. package/dist/src/toast/toast.js +1 -1
  66. package/dist/src/toggle/toggle.js +1 -1
  67. package/dist/src/toggle-group/toggle-group.js +1 -1
  68. package/dist/src/tooltip/tooltip.js +1 -1
  69. package/dist/src/utils.d.ts +1 -1
  70. package/dist/src/utils.js +3 -3
  71. package/package.json +3 -3
  72. package/dist/shared/chunk-0gn67thm.js +0 -88
  73. package/dist/shared/chunk-1dzcjmfq.js +0 -46
  74. package/dist/shared/chunk-1hv9yd28.js +0 -178
  75. package/dist/shared/chunk-2d05qxdw.js +0 -282
  76. package/dist/shared/chunk-4jnweh3m.js +0 -165
  77. package/dist/shared/chunk-90hmpm0w.js +0 -34
  78. package/dist/shared/chunk-ac86qw7a.js +0 -71
  79. package/dist/shared/chunk-b02fkvts.js +0 -128
  80. package/dist/shared/chunk-bsx59bv9.js +0 -61
  81. package/dist/shared/chunk-cm2akzrm.js +0 -161
  82. package/dist/shared/chunk-cvms20w3.js +0 -132
  83. package/dist/shared/chunk-d8n8mggh.js +0 -239
  84. package/dist/shared/chunk-er9625ar.js +0 -204
  85. package/dist/shared/chunk-ewxzhtej.js +0 -117
  86. package/dist/shared/chunk-ey4485fh.js +0 -196
  87. package/dist/shared/chunk-gbxbkmte.js +0 -175
  88. package/dist/shared/chunk-je7tqf67.js +0 -133
  89. package/dist/shared/chunk-kr5qg80z.js +0 -288
  90. package/dist/shared/chunk-kytkmdpc.js +0 -199
  91. package/dist/shared/chunk-q2q20y9a.js +0 -60
  92. package/dist/shared/chunk-q9fgfgh9.js +0 -267
  93. package/dist/shared/chunk-qfk1ycfw.js +0 -142
  94. package/dist/shared/chunk-te4pdqnh.js +0 -219
  95. package/dist/shared/chunk-vm37m55w.js +0 -175
  96. package/dist/shared/chunk-y5vdb6br.js +0 -151
  97. package/dist/shared/chunk-ztvj60xp.js +0 -185
@@ -0,0 +1,204 @@
1
+ import {
2
+ Keys,
3
+ isKey
4
+ } from "./chunk-7867pr13.js";
5
+ import {
6
+ setDataState,
7
+ setExpanded,
8
+ setHidden,
9
+ setHiddenAnimated,
10
+ setSelected
11
+ } from "./chunk-vevfhpc9.js";
12
+ import {
13
+ linkedIds
14
+ } from "./chunk-8y1jf6xr.js";
15
+ import {
16
+ applyAttrs
17
+ } from "./chunk-2db2dnp3.js";
18
+
19
+ // src/combobox/combobox.tsx
20
+ import { __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __insert, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
21
+ import { signal } from "@vertz/ui";
22
+ function ComboboxRoot(options = {}) {
23
+ const __mfDepth = __pushMountFrame();
24
+ try {
25
+ let open = function() {
26
+ state.open.value = true;
27
+ setExpanded(input, true);
28
+ setHidden(listbox, false);
29
+ setDataState(listbox, "open");
30
+ }, close = function() {
31
+ state.open.value = false;
32
+ state.activeIndex.value = -1;
33
+ setExpanded(input, false);
34
+ setDataState(listbox, "closed");
35
+ setHiddenAnimated(listbox, true);
36
+ updateActiveDescendant(-1);
37
+ }, selectOption = function(value) {
38
+ state.value.value = value;
39
+ state.inputValue.value = value;
40
+ input.value = value;
41
+ for (const opt of optionElements) {
42
+ const isActive = opt.getAttribute("data-value") === value;
43
+ setSelected(opt, isActive);
44
+ setDataState(opt, isActive ? "active" : "inactive");
45
+ }
46
+ onValueChange?.(value);
47
+ close();
48
+ input.focus();
49
+ }, updateActiveDescendant = function(index) {
50
+ const opt = optionElements[index];
51
+ if (index >= 0 && opt) {
52
+ input.setAttribute("aria-activedescendant", opt.id);
53
+ for (let i = 0;i < optionElements.length; i++) {
54
+ const el = optionElements[i];
55
+ if (el)
56
+ setDataState(el, i === index ? "active" : "inactive");
57
+ }
58
+ } else {
59
+ input.removeAttribute("aria-activedescendant");
60
+ }
61
+ }, Option = function(value, label) {
62
+ const optId = `${ids.contentId}-opt-${optionElements.length}`;
63
+ const isSelectedOpt = value === defaultValue;
64
+ const opt = (() => {
65
+ const __el2 = __element("div");
66
+ __el2.setAttribute("role", "option");
67
+ {
68
+ const __v = optId;
69
+ if (__v != null && __v !== false)
70
+ __el2.setAttribute("id", __v === true ? "" : __v);
71
+ }
72
+ {
73
+ const __v = value;
74
+ if (__v != null && __v !== false)
75
+ __el2.setAttribute("data-value", __v === true ? "" : __v);
76
+ }
77
+ {
78
+ const __v = isSelectedOpt ? "true" : "false";
79
+ if (__v != null && __v !== false)
80
+ __el2.setAttribute("aria-selected", __v === true ? "" : __v);
81
+ }
82
+ {
83
+ const __v = isSelectedOpt ? "active" : "inactive";
84
+ if (__v != null && __v !== false)
85
+ __el2.setAttribute("data-state", __v === true ? "" : __v);
86
+ }
87
+ __on(__el2, "click", () => selectOption(value));
88
+ __enterChildren(__el2);
89
+ __insert(__el2, label ?? value);
90
+ __exitChildren();
91
+ return __el2;
92
+ })();
93
+ optionElements.push(opt);
94
+ listbox.appendChild(opt);
95
+ return opt;
96
+ };
97
+ const { defaultValue = "", onValueChange, onInputChange, ...attrs } = options;
98
+ const ids = linkedIds("combobox");
99
+ const state = {
100
+ open: signal(false),
101
+ value: signal(defaultValue),
102
+ inputValue: signal(defaultValue),
103
+ activeIndex: signal(-1)
104
+ };
105
+ const optionElements = [];
106
+ const input = (() => {
107
+ const __el0 = __element("input");
108
+ __el0.setAttribute("type", "text");
109
+ __el0.setAttribute("role", "combobox");
110
+ __el0.setAttribute("aria-autocomplete", "list");
111
+ {
112
+ const __v = ids.contentId;
113
+ if (__v != null && __v !== false)
114
+ __el0.setAttribute("aria-controls", __v === true ? "" : __v);
115
+ }
116
+ __el0.setAttribute("aria-haspopup", "listbox");
117
+ {
118
+ const __v = ids.triggerId;
119
+ if (__v != null && __v !== false)
120
+ __el0.setAttribute("id", __v === true ? "" : __v);
121
+ }
122
+ {
123
+ const __v = defaultValue;
124
+ if (__v != null)
125
+ __el0.value = __v;
126
+ }
127
+ __el0.setAttribute("aria-expanded", "false");
128
+ __on(__el0, "input", () => {
129
+ state.inputValue.value = input.value;
130
+ onInputChange?.(input.value);
131
+ if (!state.open.peek())
132
+ open();
133
+ });
134
+ __on(__el0, "focus", () => {
135
+ if (!state.open.peek() && input.value.length > 0)
136
+ open();
137
+ });
138
+ __on(__el0, "keydown", (event) => {
139
+ if (isKey(event, Keys.Escape)) {
140
+ event.preventDefault();
141
+ close();
142
+ return;
143
+ }
144
+ if (isKey(event, Keys.ArrowDown)) {
145
+ event.preventDefault();
146
+ if (!state.open.peek()) {
147
+ open();
148
+ }
149
+ const next = Math.min(state.activeIndex.peek() + 1, optionElements.length - 1);
150
+ state.activeIndex.value = next;
151
+ updateActiveDescendant(next);
152
+ return;
153
+ }
154
+ if (isKey(event, Keys.ArrowUp)) {
155
+ event.preventDefault();
156
+ const prev = Math.max(state.activeIndex.peek() - 1, 0);
157
+ state.activeIndex.value = prev;
158
+ updateActiveDescendant(prev);
159
+ return;
160
+ }
161
+ if (isKey(event, Keys.Enter)) {
162
+ event.preventDefault();
163
+ const idx = state.activeIndex.peek();
164
+ if (idx >= 0 && idx < optionElements.length) {
165
+ const val = optionElements[idx]?.getAttribute("data-value");
166
+ if (val != null)
167
+ selectOption(val);
168
+ }
169
+ return;
170
+ }
171
+ });
172
+ return __el0;
173
+ })();
174
+ const listbox = (() => {
175
+ const __el1 = __element("div");
176
+ __el1.setAttribute("role", "listbox");
177
+ {
178
+ const __v = ids.contentId;
179
+ if (__v != null && __v !== false)
180
+ __el1.setAttribute("id", __v === true ? "" : __v);
181
+ }
182
+ __el1.setAttribute("aria-hidden", "true");
183
+ __el1.setAttribute("data-state", "closed");
184
+ {
185
+ const __v = { display: "none" };
186
+ if (__v != null && __v !== false)
187
+ __el1.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
188
+ }
189
+ return __el1;
190
+ })();
191
+ applyAttrs(input, attrs);
192
+ const __mfResult0 = { input, listbox, state, Option };
193
+ __flushMountFrame();
194
+ return __mfResult0;
195
+ } catch (__mfErr) {
196
+ __discardMountFrame(__mfDepth);
197
+ throw __mfErr;
198
+ }
199
+ }
200
+ var Combobox = {
201
+ Root: ComboboxRoot
202
+ };
203
+
204
+ export { Combobox };
@@ -0,0 +1,149 @@
1
+ import {
2
+ createDismiss
3
+ } from "./chunk-a6wp8c32.js";
4
+ import {
5
+ focusFirst,
6
+ saveFocus
7
+ } from "./chunk-e2v1c9ex.js";
8
+ import {
9
+ createFloatingPosition
10
+ } from "./chunk-0mcr52hc.js";
11
+ import {
12
+ Keys,
13
+ isKey
14
+ } from "./chunk-7867pr13.js";
15
+ import {
16
+ setDataState,
17
+ setExpanded,
18
+ setHidden,
19
+ setHiddenAnimated
20
+ } from "./chunk-vevfhpc9.js";
21
+ import {
22
+ linkedIds
23
+ } from "./chunk-8y1jf6xr.js";
24
+ import {
25
+ applyAttrs
26
+ } from "./chunk-2db2dnp3.js";
27
+
28
+ // src/popover/popover.tsx
29
+ import { __discardMountFrame, __element, __flushMountFrame, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
30
+ import { signal } from "@vertz/ui";
31
+ function PopoverRoot(options = {}) {
32
+ const __mfDepth = __pushMountFrame();
33
+ try {
34
+ let open = function() {
35
+ state.open.value = true;
36
+ setExpanded(trigger, true);
37
+ setHidden(content, false);
38
+ setDataState(trigger, "open");
39
+ setDataState(content, "open");
40
+ restoreFocus = saveFocus();
41
+ queueMicrotask(() => focusFirst(content));
42
+ if (positioning) {
43
+ const result = createFloatingPosition(trigger, content, positioning);
44
+ floatingCleanup = result.cleanup;
45
+ dismissCleanup = createDismiss({
46
+ onDismiss: close,
47
+ insideElements: [trigger, content],
48
+ escapeKey: false
49
+ });
50
+ }
51
+ onOpenChange?.(true);
52
+ }, close = function() {
53
+ state.open.value = false;
54
+ setExpanded(trigger, false);
55
+ setDataState(trigger, "closed");
56
+ setDataState(content, "closed");
57
+ setHiddenAnimated(content, true);
58
+ floatingCleanup?.();
59
+ floatingCleanup = null;
60
+ dismissCleanup?.();
61
+ dismissCleanup = null;
62
+ restoreFocus?.();
63
+ restoreFocus = null;
64
+ onOpenChange?.(false);
65
+ };
66
+ const { defaultOpen = false, onOpenChange, positioning, ...attrs } = options;
67
+ const ids = linkedIds("popover");
68
+ const state = { open: signal(defaultOpen) };
69
+ let restoreFocus = null;
70
+ let floatingCleanup = null;
71
+ let dismissCleanup = null;
72
+ const trigger = (() => {
73
+ const __el0 = __element("button");
74
+ __el0.setAttribute("type", "button");
75
+ {
76
+ const __v = ids.triggerId;
77
+ if (__v != null && __v !== false)
78
+ __el0.setAttribute("id", __v === true ? "" : __v);
79
+ }
80
+ {
81
+ const __v = ids.contentId;
82
+ if (__v != null && __v !== false)
83
+ __el0.setAttribute("aria-controls", __v === true ? "" : __v);
84
+ }
85
+ __el0.setAttribute("aria-haspopup", "dialog");
86
+ {
87
+ const __v = defaultOpen ? "true" : "false";
88
+ if (__v != null && __v !== false)
89
+ __el0.setAttribute("aria-expanded", __v === true ? "" : __v);
90
+ }
91
+ {
92
+ const __v = defaultOpen ? "open" : "closed";
93
+ if (__v != null && __v !== false)
94
+ __el0.setAttribute("data-state", __v === true ? "" : __v);
95
+ }
96
+ __on(__el0, "click", () => {
97
+ if (state.open.peek()) {
98
+ close();
99
+ } else {
100
+ open();
101
+ }
102
+ });
103
+ return __el0;
104
+ })();
105
+ const content = (() => {
106
+ const __el1 = __element("div");
107
+ __el1.setAttribute("role", "dialog");
108
+ {
109
+ const __v = ids.contentId;
110
+ if (__v != null && __v !== false)
111
+ __el1.setAttribute("id", __v === true ? "" : __v);
112
+ }
113
+ {
114
+ const __v = defaultOpen ? "false" : "true";
115
+ if (__v != null && __v !== false)
116
+ __el1.setAttribute("aria-hidden", __v === true ? "" : __v);
117
+ }
118
+ {
119
+ const __v = defaultOpen ? "open" : "closed";
120
+ if (__v != null && __v !== false)
121
+ __el1.setAttribute("data-state", __v === true ? "" : __v);
122
+ }
123
+ {
124
+ const __v = { display: defaultOpen ? "" : "none" };
125
+ if (__v != null && __v !== false)
126
+ __el1.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
127
+ }
128
+ __on(__el1, "keydown", (event) => {
129
+ if (isKey(event, Keys.Escape)) {
130
+ event.preventDefault();
131
+ close();
132
+ }
133
+ });
134
+ return __el1;
135
+ })();
136
+ applyAttrs(trigger, attrs);
137
+ const __mfResult0 = { trigger, content, state };
138
+ __flushMountFrame();
139
+ return __mfResult0;
140
+ } catch (__mfErr) {
141
+ __discardMountFrame(__mfDepth);
142
+ throw __mfErr;
143
+ }
144
+ }
145
+ var Popover = {
146
+ Root: PopoverRoot
147
+ };
148
+
149
+ export { Popover };
@@ -0,0 +1,141 @@
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 { __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __insert, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
14
+ import { signal } from "@vertz/ui";
15
+ function CarouselRoot(options = {}) {
16
+ const __mfDepth = __pushMountFrame();
17
+ try {
18
+ let updateSlideVisibility = function() {
19
+ const current = state.currentIndex.peek();
20
+ for (let i = 0;i < slides.length; i++) {
21
+ const slide = slides[i];
22
+ if (!slide)
23
+ continue;
24
+ slide.setAttribute("aria-hidden", String(i !== current));
25
+ slide.setAttribute("aria-label", `Slide ${i + 1} of ${slides.length}`);
26
+ setDataState(slide, i === current ? "active" : "inactive");
27
+ }
28
+ if (!loop) {
29
+ prevButton.disabled = current <= 0;
30
+ nextButton.disabled = current >= slides.length - 1;
31
+ }
32
+ const translateProp = orientation === "horizontal" ? "translateX" : "translateY";
33
+ viewport.style.transform = `${translateProp}(-${current * 100}%)`;
34
+ }, goTo = function(index) {
35
+ const total = slides.length;
36
+ if (total === 0)
37
+ return;
38
+ let next = index;
39
+ if (loop) {
40
+ next = (index % total + total) % total;
41
+ } else {
42
+ next = Math.max(0, Math.min(total - 1, index));
43
+ }
44
+ if (next === state.currentIndex.peek())
45
+ return;
46
+ state.currentIndex.value = next;
47
+ updateSlideVisibility();
48
+ onSlideChange?.(next);
49
+ }, goNext = function() {
50
+ goTo(state.currentIndex.peek() + 1);
51
+ }, goPrev = function() {
52
+ goTo(state.currentIndex.peek() - 1);
53
+ }, Slide = function() {
54
+ const slide = (() => {
55
+ const __el4 = __element("div");
56
+ __el4.setAttribute("role", "group");
57
+ __el4.setAttribute("aria-roledescription", "slide");
58
+ return __el4;
59
+ })();
60
+ slides.push(slide);
61
+ state.slideCount.value = slides.length;
62
+ viewport.appendChild(slide);
63
+ updateSlideVisibility();
64
+ return slide;
65
+ };
66
+ const {
67
+ orientation = "horizontal",
68
+ loop = false,
69
+ defaultIndex = 0,
70
+ onSlideChange,
71
+ ...attrs
72
+ } = options;
73
+ const state = {
74
+ currentIndex: signal(defaultIndex),
75
+ slideCount: signal(0)
76
+ };
77
+ const slides = [];
78
+ const viewport = (() => {
79
+ const __el0 = __element("div");
80
+ {
81
+ const __v = { overflow: "hidden" };
82
+ if (__v != null && __v !== false)
83
+ __el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
84
+ }
85
+ return __el0;
86
+ })();
87
+ const prevButton = (() => {
88
+ const __el1 = __element("button");
89
+ __el1.setAttribute("type", "button");
90
+ __el1.setAttribute("aria-label", "Previous slide");
91
+ __on(__el1, "click", goPrev);
92
+ return __el1;
93
+ })();
94
+ const nextButton = (() => {
95
+ const __el2 = __element("button");
96
+ __el2.setAttribute("type", "button");
97
+ __el2.setAttribute("aria-label", "Next slide");
98
+ __on(__el2, "click", goNext);
99
+ return __el2;
100
+ })();
101
+ const root = (() => {
102
+ const __el3 = __element("div");
103
+ __el3.setAttribute("role", "region");
104
+ __el3.setAttribute("aria-roledescription", "carousel");
105
+ {
106
+ const __v = orientation;
107
+ if (__v != null && __v !== false)
108
+ __el3.setAttribute("data-orientation", __v === true ? "" : __v);
109
+ }
110
+ __on(__el3, "keydown", (event) => {
111
+ const prevKey = orientation === "horizontal" ? Keys.ArrowLeft : Keys.ArrowUp;
112
+ const nextKey = orientation === "horizontal" ? Keys.ArrowRight : Keys.ArrowDown;
113
+ if (isKey(event, prevKey)) {
114
+ event.preventDefault();
115
+ goPrev();
116
+ }
117
+ if (isKey(event, nextKey)) {
118
+ event.preventDefault();
119
+ goNext();
120
+ }
121
+ });
122
+ __enterChildren(__el3);
123
+ __insert(__el3, viewport);
124
+ __exitChildren();
125
+ return __el3;
126
+ })();
127
+ updateSlideVisibility();
128
+ applyAttrs(root, attrs);
129
+ const __mfResult0 = { root, viewport, prevButton, nextButton, state, Slide, goTo, goNext, goPrev };
130
+ __flushMountFrame();
131
+ return __mfResult0;
132
+ } catch (__mfErr) {
133
+ __discardMountFrame(__mfDepth);
134
+ throw __mfErr;
135
+ }
136
+ }
137
+ var Carousel = {
138
+ Root: CarouselRoot
139
+ };
140
+
141
+ export { Carousel };
@@ -0,0 +1,79 @@
1
+ import {
2
+ Keys,
3
+ isKey
4
+ } from "./chunk-7867pr13.js";
5
+ import {
6
+ uniqueId
7
+ } from "./chunk-8y1jf6xr.js";
8
+ import {
9
+ applyAttrs
10
+ } from "./chunk-2db2dnp3.js";
11
+
12
+ // src/checkbox/checkbox.tsx
13
+ import { computed, signal } from "@vertz/ui";
14
+ import { __attr, __discardMountFrame, __element, __flushMountFrame, __on, __pushMountFrame } from "@vertz/ui/internals";
15
+ function dataStateFor(checked) {
16
+ if (checked === "mixed")
17
+ return "indeterminate";
18
+ return checked ? "checked" : "unchecked";
19
+ }
20
+ function ariaCheckedFor(checked) {
21
+ if (checked === "mixed")
22
+ return "mixed";
23
+ return String(checked);
24
+ }
25
+ function CheckboxRoot(options = {}) {
26
+ const __mfDepth = __pushMountFrame();
27
+ try {
28
+ let toggle = function() {
29
+ if (disabled)
30
+ return;
31
+ checked.value = checked.value === "mixed" ? true : !checked.value;
32
+ onCheckedChange?.(checked.value);
33
+ };
34
+ const { defaultChecked = false, disabled = false, onCheckedChange, ...attrs } = options;
35
+ const checked = signal(defaultChecked, "checked");
36
+ const el = computed(() => (() => {
37
+ const __el0 = __element("button");
38
+ __el0.setAttribute("type", "button");
39
+ __el0.setAttribute("role", "checkbox");
40
+ {
41
+ const __v = uniqueId("checkbox");
42
+ if (__v != null && __v !== false)
43
+ __el0.setAttribute("id", __v === true ? "" : __v);
44
+ }
45
+ __attr(__el0, "aria-checked", () => ariaCheckedFor(checked.value));
46
+ __attr(__el0, "data-state", () => dataStateFor(checked.value));
47
+ {
48
+ const __v = disabled;
49
+ if (__v != null && __v !== false)
50
+ __el0.setAttribute("disabled", __v === true ? "" : __v);
51
+ }
52
+ {
53
+ const __v = disabled ? "true" : undefined;
54
+ if (__v != null && __v !== false)
55
+ __el0.setAttribute("aria-disabled", __v === true ? "" : __v);
56
+ }
57
+ __on(__el0, "click", toggle);
58
+ __on(__el0, "keydown", (e) => {
59
+ if (isKey(e, Keys.Space)) {
60
+ e.preventDefault();
61
+ toggle();
62
+ }
63
+ });
64
+ return __el0;
65
+ })());
66
+ applyAttrs(el.value, attrs);
67
+ const __mfResult0 = el.value;
68
+ __flushMountFrame();
69
+ return __mfResult0;
70
+ } catch (__mfErr) {
71
+ __discardMountFrame(__mfDepth);
72
+ throw __mfErr;
73
+ }
74
+ }
75
+ var Checkbox = {
76
+ Root: CheckboxRoot
77
+ };
78
+
79
+ export { Checkbox };