@vertz/ui-primitives 0.2.20 → 0.2.21

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 (104) hide show
  1. package/dist/shared/{chunk-ppcv3ehd.js → chunk-0gn67thm.js} +14 -11
  2. package/dist/shared/{chunk-4da5zksy.js → chunk-1dzcjmfq.js} +2 -2
  3. package/dist/shared/{chunk-avxcmmk6.js → chunk-1hv9yd28.js} +6 -6
  4. package/dist/shared/{chunk-kg27s15c.js → chunk-2d05qxdw.js} +4 -4
  5. package/dist/shared/{chunk-bew4bjgf.js → chunk-4jnweh3m.js} +4 -4
  6. package/dist/shared/{chunk-jctqs9m4.js → chunk-7867pr13.js} +36 -12
  7. package/dist/shared/{chunk-rnjm61t0.js → chunk-90hmpm0w.js} +3 -3
  8. package/dist/shared/{chunk-hr9hx58m.js → chunk-ac86qw7a.js} +4 -4
  9. package/dist/shared/{chunk-gt0wth9h.js → chunk-b02fkvts.js} +2 -2
  10. package/dist/shared/{chunk-7kpsyjd7.js → chunk-bsx59bv9.js} +4 -4
  11. package/dist/shared/{chunk-jz0s6srh.js → chunk-cm2akzrm.js} +1 -1
  12. package/dist/shared/{chunk-yr9yzpvq.js → chunk-cvms20w3.js} +82 -57
  13. package/dist/shared/{chunk-ttsyf6ma.js → chunk-d8n8mggh.js} +4 -4
  14. package/dist/shared/{chunk-34yfm2b0.js → chunk-er9625ar.js} +105 -83
  15. package/dist/shared/{chunk-tfyg0qrp.js → chunk-ewxzhtej.js} +5 -5
  16. package/dist/shared/{chunk-4085nbdq.js → chunk-ey4485fh.js} +4 -4
  17. package/dist/shared/{chunk-x2hz98qn.js → chunk-f501vw7e.js} +2 -2
  18. package/dist/shared/{chunk-9hj9p7s2.js → chunk-g67tnd19.js} +36 -30
  19. package/dist/shared/{chunk-j4cm8avr.js → chunk-gbxbkmte.js} +4 -4
  20. package/dist/shared/chunk-gzgyfhz6.js +237 -0
  21. package/dist/shared/{chunk-g9qvd20g.js → chunk-je7tqf67.js} +2 -2
  22. package/dist/shared/{chunk-sqs8kyb2.js → chunk-kr5qg80z.js} +4 -4
  23. package/dist/shared/{chunk-7krvqrwq.js → chunk-kytkmdpc.js} +35 -13
  24. package/dist/shared/{chunk-18y8gfk0.js → chunk-pvy0tcd7.js} +115 -93
  25. package/dist/shared/{chunk-n9nwx58j.js → chunk-q2q20y9a.js} +4 -4
  26. package/dist/shared/{chunk-dpsgb1xw.js → chunk-q8dm19a5.js} +7 -2
  27. package/dist/shared/{chunk-7ffg0caj.js → chunk-q9fgfgh9.js} +7 -5
  28. package/dist/shared/{chunk-m1ptgp1s.js → chunk-qfk1ycfw.js} +6 -6
  29. package/dist/shared/{chunk-x0we8gcy.js → chunk-te4pdqnh.js} +4 -4
  30. package/dist/shared/{chunk-gkddsbmh.js → chunk-v9qddmh9.js} +3 -3
  31. package/dist/shared/{chunk-t1vkvsz2.js → chunk-vm37m55w.js} +4 -4
  32. package/dist/shared/{chunk-8ak7vdk1.js → chunk-y5vdb6br.js} +4 -4
  33. package/dist/shared/{chunk-96d9nr7y.js → chunk-zf0rhm9e.js} +1 -1
  34. package/dist/shared/chunk-ztvj60xp.js +185 -0
  35. package/dist/src/accordion/accordion.d.ts +2 -0
  36. package/dist/src/accordion/accordion.js +1 -5
  37. package/dist/src/alert-dialog/alert-dialog.d.ts +7 -7
  38. package/dist/src/alert-dialog/alert-dialog.js +1 -4
  39. package/dist/src/badge/badge.d.ts +2 -0
  40. package/dist/src/badge/badge.js +1 -3
  41. package/dist/src/button/button.d.ts +2 -0
  42. package/dist/src/button/button.js +1 -3
  43. package/dist/src/calendar/calendar.d.ts +9 -6
  44. package/dist/src/calendar/calendar.js +1 -2
  45. package/dist/src/carousel/carousel.d.ts +2 -0
  46. package/dist/src/carousel/carousel.js +1 -4
  47. package/dist/src/checkbox/checkbox.d.ts +2 -0
  48. package/dist/src/checkbox/checkbox.js +1 -4
  49. package/dist/src/collapsible/collapsible.d.ts +2 -0
  50. package/dist/src/collapsible/collapsible.js +1 -4
  51. package/dist/src/combobox/combobox.d.ts +2 -0
  52. package/dist/src/combobox/combobox.js +1 -5
  53. package/dist/src/command/command.d.ts +2 -0
  54. package/dist/src/command/command.js +1 -5
  55. package/dist/src/context-menu/context-menu.d.ts +2 -0
  56. package/dist/src/context-menu/context-menu.js +1 -7
  57. package/dist/src/date-picker/date-picker.d.ts +6 -6
  58. package/dist/src/date-picker/date-picker.js +1 -10
  59. package/dist/src/dialog/dialog.d.ts +3 -0
  60. package/dist/src/dialog/dialog.js +1 -6
  61. package/dist/src/dropdown-menu/dropdown-menu.d.ts +3 -0
  62. package/dist/src/dropdown-menu/dropdown-menu.js +1 -8
  63. package/dist/src/hover-card/hover-card.d.ts +2 -0
  64. package/dist/src/hover-card/hover-card.js +1 -6
  65. package/dist/src/index.d.ts +744 -34
  66. package/dist/src/index.js +4955 -39
  67. package/dist/src/menu/menu.d.ts +3 -0
  68. package/dist/src/menu/menu.js +1 -7
  69. package/dist/src/menubar/menubar.d.ts +2 -0
  70. package/dist/src/menubar/menubar.js +1 -8
  71. package/dist/src/navigation-menu/navigation-menu.d.ts +7 -5
  72. package/dist/src/navigation-menu/navigation-menu.js +1 -6
  73. package/dist/src/popover/popover.d.ts +2 -0
  74. package/dist/src/popover/popover.js +1 -8
  75. package/dist/src/progress/progress.d.ts +4 -2
  76. package/dist/src/progress/progress.js +1 -4
  77. package/dist/src/radio/radio.d.ts +9 -3
  78. package/dist/src/radio/radio.js +1 -6
  79. package/dist/src/resizable-panel/resizable-panel.d.ts +2 -0
  80. package/dist/src/resizable-panel/resizable-panel.js +1 -4
  81. package/dist/src/scroll-area/scroll-area.d.ts +2 -0
  82. package/dist/src/scroll-area/scroll-area.js +1 -2
  83. package/dist/src/select/select.d.ts +2 -0
  84. package/dist/src/select/select.js +1 -7
  85. package/dist/src/sheet/sheet.js +1 -5
  86. package/dist/src/slider/slider.d.ts +2 -0
  87. package/dist/src/slider/slider.js +1 -5
  88. package/dist/src/switch/switch.d.ts +2 -0
  89. package/dist/src/switch/switch.js +1 -4
  90. package/dist/src/tabs/tabs.d.ts +7 -4
  91. package/dist/src/tabs/tabs.js +1 -6
  92. package/dist/src/toast/toast.d.ts +2 -0
  93. package/dist/src/toast/toast.js +1 -4
  94. package/dist/src/toggle/toggle.d.ts +2 -0
  95. package/dist/src/toggle/toggle.js +1 -4
  96. package/dist/src/toggle-group/toggle-group.d.ts +2 -0
  97. package/dist/src/toggle-group/toggle-group.js +1 -5
  98. package/dist/src/tooltip/tooltip.d.ts +3 -1
  99. package/dist/src/tooltip/tooltip.js +1 -6
  100. package/dist/src/utils.d.ts +61 -1
  101. package/dist/src/utils.js +48 -1
  102. package/package.json +4 -6
  103. package/dist/shared/chunk-8nk0ya7a.js +0 -163
  104. package/dist/shared/chunk-8tvzqry6.js +0 -218
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  Keys,
3
3
  isKey
4
- } from "./chunk-jctqs9m4.js";
4
+ } from "./chunk-7867pr13.js";
5
5
  import {
6
6
  setDataState
7
7
  } from "./chunk-vvjyx7fe.js";
8
8
  import {
9
9
  applyAttrs
10
- } from "./chunk-dpsgb1xw.js";
10
+ } from "./chunk-q8dm19a5.js";
11
11
 
12
12
  // src/carousel/carousel.tsx
13
13
  import { __element, __enterChildren, __exitChildren, __insert, __on } from "@vertz/ui/internals";
@@ -11,19 +11,19 @@ import {
11
11
  Keys,
12
12
  handleListNavigation,
13
13
  isKey
14
- } from "./chunk-jctqs9m4.js";
14
+ } from "./chunk-7867pr13.js";
15
15
  import {
16
16
  setDataState,
17
17
  setExpanded,
18
18
  setHidden,
19
19
  setHiddenAnimated
20
20
  } from "./chunk-vvjyx7fe.js";
21
- import {
22
- applyAttrs
23
- } from "./chunk-dpsgb1xw.js";
24
21
  import {
25
22
  linkedIds
26
23
  } from "./chunk-8y1jf6xr.js";
24
+ import {
25
+ applyAttrs
26
+ } from "./chunk-q8dm19a5.js";
27
27
 
28
28
  // src/menubar/menubar.tsx
29
29
  import { __element, __enterChildren, __exitChildren, __insert, __on } from "@vertz/ui/internals";
@@ -6,28 +6,30 @@ import {
6
6
  import {
7
7
  Keys,
8
8
  isKey
9
- } from "./chunk-jctqs9m4.js";
9
+ } from "./chunk-7867pr13.js";
10
10
  import {
11
11
  setDataState,
12
+ setDescribedBy,
12
13
  setExpanded,
13
14
  setHidden,
14
15
  setHiddenAnimated,
15
16
  setLabelledBy
16
17
  } from "./chunk-vvjyx7fe.js";
17
- import {
18
- applyAttrs
19
- } from "./chunk-dpsgb1xw.js";
20
18
  import {
21
19
  linkedIds
22
20
  } from "./chunk-8y1jf6xr.js";
21
+ import {
22
+ applyAttrs
23
+ } from "./chunk-q8dm19a5.js";
23
24
 
24
25
  // src/dialog/dialog.tsx
25
- import { __element, __on } from "@vertz/ui/internals";
26
+ import { __element, __on, __styleStr } from "@vertz/ui/internals";
26
27
  import { signal } from "@vertz/ui";
27
28
  function DialogRoot(options = {}) {
28
29
  const { modal = true, defaultOpen = false, onOpenChange, ...attrs } = options;
29
30
  const ids = linkedIds("dialog");
30
31
  const titleId = `${ids.contentId}-title`;
32
+ const descriptionId = `${ids.contentId}-description`;
31
33
  const state = { open: signal(defaultOpen) };
32
34
  let restoreFocus = null;
33
35
  let removeTrap = null;
@@ -108,7 +110,7 @@ function DialogRoot(options = {}) {
108
110
  {
109
111
  const __v = defaultOpen ? "" : "display: none";
110
112
  if (__v != null && __v !== false)
111
- __el1.setAttribute("style", __v === true ? "" : __v);
113
+ __el1.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
112
114
  }
113
115
  __on(__el1, "click", () => closeDialog());
114
116
  return __el1;
@@ -139,7 +141,7 @@ function DialogRoot(options = {}) {
139
141
  {
140
142
  const __v = defaultOpen ? "" : "display: none";
141
143
  if (__v != null && __v !== false)
142
- __el2.setAttribute("style", __v === true ? "" : __v);
144
+ __el2.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
143
145
  }
144
146
  __on(__el2, "keydown", (event) => {
145
147
  if (isKey(event, Keys.Escape)) {
@@ -151,6 +153,7 @@ function DialogRoot(options = {}) {
151
153
  return __el2;
152
154
  })();
153
155
  setLabelledBy(content, titleId);
156
+ setDescribedBy(content, descriptionId);
154
157
  const title = (() => {
155
158
  const __el3 = __element("h2");
156
159
  {
@@ -160,15 +163,34 @@ function DialogRoot(options = {}) {
160
163
  }
161
164
  return __el3;
162
165
  })();
163
- const close = (() => {
164
- const __el4 = __element("button");
165
- __el4.setAttribute("type", "button");
166
- __el4.setAttribute("aria-label", "Close");
167
- __on(__el4, "click", () => closeDialog());
166
+ const description = (() => {
167
+ const __el4 = __element("p");
168
+ {
169
+ const __v = descriptionId;
170
+ if (__v != null && __v !== false)
171
+ __el4.setAttribute("id", __v === true ? "" : __v);
172
+ }
168
173
  return __el4;
169
174
  })();
175
+ const close = (() => {
176
+ const __el5 = __element("button");
177
+ __el5.setAttribute("type", "button");
178
+ __el5.setAttribute("aria-label", "Close");
179
+ __on(__el5, "click", () => closeDialog());
180
+ return __el5;
181
+ })();
170
182
  applyAttrs(content, attrs);
171
- return { trigger, overlay, content, title, close, state, show: openDialog, hide: closeDialog };
183
+ return {
184
+ trigger,
185
+ overlay,
186
+ content,
187
+ title,
188
+ description,
189
+ close,
190
+ state,
191
+ show: openDialog,
192
+ hide: closeDialog
193
+ };
172
194
  }
173
195
  var Dialog = {
174
196
  Root: DialogRoot
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  applyAttrs
3
- } from "./chunk-dpsgb1xw.js";
3
+ } from "./chunk-q8dm19a5.js";
4
4
 
5
5
  // src/calendar/calendar.tsx
6
6
  import { __element, __enterChildren, __exitChildren, __insert, __on } from "@vertz/ui/internals";
@@ -36,6 +36,49 @@ function addMonths(date, months) {
36
36
  result.setMonth(result.getMonth() + months);
37
37
  return result;
38
38
  }
39
+ function CalendarTitleEl() {
40
+ return (() => {
41
+ const __el0 = __element("div");
42
+ return __el0;
43
+ })();
44
+ }
45
+ function CalendarNavButton(onClick) {
46
+ return (() => {
47
+ const __el0 = __element("button");
48
+ __el0.setAttribute("type", "button");
49
+ __on(__el0, "click", onClick);
50
+ return __el0;
51
+ })();
52
+ }
53
+ function CalendarHeaderEl(prevButton, title, nextButton) {
54
+ return (() => {
55
+ const __el0 = __element("div");
56
+ __enterChildren(__el0);
57
+ __insert(__el0, prevButton);
58
+ __insert(__el0, title);
59
+ __insert(__el0, nextButton);
60
+ __exitChildren();
61
+ return __el0;
62
+ })();
63
+ }
64
+ function CalendarGridEl(onKeydown) {
65
+ return (() => {
66
+ const __el0 = __element("table");
67
+ __el0.setAttribute("role", "grid");
68
+ __on(__el0, "keydown", onKeydown);
69
+ return __el0;
70
+ })();
71
+ }
72
+ function CalendarRootEl(header, grid) {
73
+ return (() => {
74
+ const __el0 = __element("div");
75
+ __enterChildren(__el0);
76
+ __insert(__el0, header);
77
+ __insert(__el0, grid);
78
+ __exitChildren();
79
+ return __el0;
80
+ })();
81
+ }
39
82
  function CalendarRoot(options = {}) {
40
83
  const {
41
84
  mode: modeOpt,
@@ -122,7 +165,14 @@ function CalendarRoot(options = {}) {
122
165
  }
123
166
  onValueChange?.(state.value.peek());
124
167
  }
168
+ const gridCleanups = [];
169
+ function cleanupGridListeners() {
170
+ for (const cleanup of gridCleanups)
171
+ cleanup();
172
+ gridCleanups.length = 0;
173
+ }
125
174
  function buildGrid() {
175
+ cleanupGridListeners();
126
176
  grid.innerHTML = "";
127
177
  const display = state.displayMonth.peek();
128
178
  const year = display.getFullYear();
@@ -184,10 +234,12 @@ function CalendarRoot(options = {}) {
184
234
  }
185
235
  }
186
236
  }
187
- btn.addEventListener("click", () => {
237
+ const handleClick = () => {
188
238
  selectDate(cellDate);
189
239
  rebuildGrid();
190
- });
240
+ };
241
+ btn.addEventListener("click", handleClick);
242
+ gridCleanups.push(() => btn.removeEventListener("click", handleClick));
191
243
  td.appendChild(btn);
192
244
  tr.appendChild(td);
193
245
  currentDate = addDays(currentDate, 1);
@@ -205,101 +257,71 @@ function CalendarRoot(options = {}) {
205
257
  onMonthChange?.(state.displayMonth.peek());
206
258
  rebuildGrid();
207
259
  }
208
- const title = (() => {
209
- const __el0 = __element("div");
210
- return __el0;
211
- })();
212
- const prevButton = (() => {
213
- const __el1 = __element("button");
214
- __el1.setAttribute("type", "button");
215
- __on(__el1, "click", () => navigateMonth(-1));
216
- return __el1;
217
- })();
218
- const nextButton = (() => {
219
- const __el2 = __element("button");
220
- __el2.setAttribute("type", "button");
221
- __on(__el2, "click", () => navigateMonth(1));
222
- return __el2;
223
- })();
224
- const header = (() => {
225
- const __el3 = __element("div");
226
- __enterChildren(__el3);
227
- __insert(__el3, prevButton);
228
- __insert(__el3, title);
229
- __insert(__el3, nextButton);
230
- __exitChildren();
231
- return __el3;
232
- })();
233
- const grid = (() => {
234
- const __el4 = __element("table");
235
- __el4.setAttribute("role", "grid");
236
- __on(__el4, "keydown", (event) => {
237
- const active = document.activeElement;
238
- if (!active || active.tagName !== "BUTTON")
239
- return;
240
- const dateStr = active.getAttribute("data-date");
241
- if (!dateStr)
242
- return;
243
- const focused = new Date(`${dateStr}T00:00:00`);
244
- let next = null;
245
- if (event.key === "ArrowLeft") {
246
- event.preventDefault();
247
- next = addDays(focused, -1);
248
- } else if (event.key === "ArrowRight") {
249
- event.preventDefault();
250
- next = addDays(focused, 1);
251
- } else if (event.key === "ArrowUp") {
252
- event.preventDefault();
253
- next = addDays(focused, -7);
254
- } else if (event.key === "ArrowDown") {
255
- event.preventDefault();
256
- next = addDays(focused, 7);
257
- } else if (event.key === "Home") {
258
- event.preventDefault();
259
- const dayOfWeek = (focused.getDay() - weekStartsOn + 7) % 7;
260
- next = addDays(focused, -dayOfWeek);
261
- } else if (event.key === "End") {
262
- event.preventDefault();
263
- const dayOfWeek = (focused.getDay() - weekStartsOn + 7) % 7;
264
- next = addDays(focused, 6 - dayOfWeek);
265
- } else if (event.key === "PageUp") {
266
- event.preventDefault();
267
- next = event.shiftKey ? addMonths(focused, -12) : addMonths(focused, -1);
268
- } else if (event.key === "PageDown") {
269
- event.preventDefault();
270
- next = event.shiftKey ? addMonths(focused, 12) : addMonths(focused, 1);
271
- } else if (event.key === "Enter" || event.key === " ") {
272
- event.preventDefault();
273
- selectDate(focused);
260
+ const title = CalendarTitleEl();
261
+ const prevButton = CalendarNavButton(() => navigateMonth(-1));
262
+ const nextButton = CalendarNavButton(() => navigateMonth(1));
263
+ const header = CalendarHeaderEl(prevButton, title, nextButton);
264
+ const grid = CalendarGridEl((event) => {
265
+ const active = document.activeElement;
266
+ if (!active || active.tagName !== "BUTTON")
267
+ return;
268
+ const dateStr = active.getAttribute("data-date");
269
+ if (!dateStr)
270
+ return;
271
+ const focused = new Date(`${dateStr}T00:00:00`);
272
+ let next = null;
273
+ if (event.key === "ArrowLeft") {
274
+ event.preventDefault();
275
+ next = addDays(focused, -1);
276
+ } else if (event.key === "ArrowRight") {
277
+ event.preventDefault();
278
+ next = addDays(focused, 1);
279
+ } else if (event.key === "ArrowUp") {
280
+ event.preventDefault();
281
+ next = addDays(focused, -7);
282
+ } else if (event.key === "ArrowDown") {
283
+ event.preventDefault();
284
+ next = addDays(focused, 7);
285
+ } else if (event.key === "Home") {
286
+ event.preventDefault();
287
+ const dayOfWeek = (focused.getDay() - weekStartsOn + 7) % 7;
288
+ next = addDays(focused, -dayOfWeek);
289
+ } else if (event.key === "End") {
290
+ event.preventDefault();
291
+ const dayOfWeek = (focused.getDay() - weekStartsOn + 7) % 7;
292
+ next = addDays(focused, 6 - dayOfWeek);
293
+ } else if (event.key === "PageUp") {
294
+ event.preventDefault();
295
+ next = event.shiftKey ? addMonths(focused, -12) : addMonths(focused, -1);
296
+ } else if (event.key === "PageDown") {
297
+ event.preventDefault();
298
+ next = event.shiftKey ? addMonths(focused, 12) : addMonths(focused, 1);
299
+ } else if (event.key === "Enter" || event.key === " ") {
300
+ event.preventDefault();
301
+ selectDate(focused);
302
+ rebuildGrid();
303
+ return;
304
+ }
305
+ if (next) {
306
+ state.focusedDate.value = next;
307
+ if (next.getMonth() !== state.displayMonth.peek().getMonth() || next.getFullYear() !== state.displayMonth.peek().getFullYear()) {
308
+ state.displayMonth.value = new Date(next.getFullYear(), next.getMonth(), 1);
309
+ onMonthChange?.(state.displayMonth.peek());
274
310
  rebuildGrid();
275
- return;
276
- }
277
- if (next) {
278
- state.focusedDate.value = next;
279
- if (next.getMonth() !== state.displayMonth.peek().getMonth() || next.getFullYear() !== state.displayMonth.peek().getFullYear()) {
280
- state.displayMonth.value = new Date(next.getFullYear(), next.getMonth(), 1);
281
- onMonthChange?.(state.displayMonth.peek());
282
- rebuildGrid();
283
- }
284
- const dateKey = next.toISOString().split("T")[0];
285
- const btn = grid.querySelector(`button[data-date="${dateKey}"]`);
286
- btn?.focus();
287
311
  }
288
- });
289
- return __el4;
290
- })();
312
+ const dateKey = next.toISOString().split("T")[0];
313
+ const btn = grid.querySelector(`button[data-date="${dateKey}"]`);
314
+ btn?.focus();
315
+ }
316
+ });
291
317
  updateTitle();
292
318
  buildGrid();
293
- const root = (() => {
294
- const __el5 = __element("div");
295
- __enterChildren(__el5);
296
- __insert(__el5, header);
297
- __insert(__el5, grid);
298
- __exitChildren();
299
- return __el5;
300
- })();
319
+ const root = CalendarRootEl(header, grid);
320
+ function destroy() {
321
+ cleanupGridListeners();
322
+ }
301
323
  applyAttrs(root, attrs);
302
- return { root, header, title, prevButton, nextButton, grid, state };
324
+ return { root, header, title, prevButton, nextButton, grid, state, destroy };
303
325
  }
304
326
  var Calendar = {
305
327
  Root: CalendarRoot
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  Keys,
3
3
  isKey
4
- } from "./chunk-jctqs9m4.js";
5
- import {
6
- applyAttrs
7
- } from "./chunk-dpsgb1xw.js";
4
+ } from "./chunk-7867pr13.js";
8
5
  import {
9
6
  uniqueId
10
7
  } from "./chunk-8y1jf6xr.js";
8
+ import {
9
+ applyAttrs
10
+ } from "./chunk-q8dm19a5.js";
11
11
 
12
12
  // src/toggle/toggle.tsx
13
13
  import { computed, signal } from "@vertz/ui";
@@ -1,11 +1,16 @@
1
1
  // src/utils/attrs.ts
2
2
  function applyAttrs(el, attrs) {
3
+ const resolvedClass = attrs.className ?? attrs.class;
3
4
  for (const [key, value] of Object.entries(attrs)) {
4
5
  if (value == null)
5
6
  continue;
6
- if (key === "class") {
7
+ if (key === "className" || key === "class") {
8
+ if (key === "class" && attrs.className != null)
9
+ continue;
7
10
  const existing = el.getAttribute("class");
8
- el.setAttribute("class", existing ? `${existing} ${String(value)}` : String(value));
11
+ const classValue = String(resolvedClass);
12
+ el.setAttribute("class", existing ? `${existing} ${classValue}` : classValue);
13
+ continue;
9
14
  } else if (key === "style") {
10
15
  const existing = el.getAttribute("style");
11
16
  el.setAttribute("style", existing ? `${existing}; ${String(value)}` : String(value));
@@ -8,25 +8,25 @@ import {
8
8
  Keys,
9
9
  handleListNavigation,
10
10
  isKey
11
- } from "./chunk-jctqs9m4.js";
11
+ } from "./chunk-7867pr13.js";
12
12
  import {
13
13
  setDataState,
14
14
  setExpanded,
15
15
  setHidden,
16
16
  setHiddenAnimated
17
17
  } from "./chunk-vvjyx7fe.js";
18
- import {
19
- applyAttrs
20
- } from "./chunk-dpsgb1xw.js";
21
18
  import {
22
19
  linkedIds
23
20
  } from "./chunk-8y1jf6xr.js";
21
+ import {
22
+ applyAttrs
23
+ } from "./chunk-q8dm19a5.js";
24
24
 
25
25
  // src/menu/menu.tsx
26
26
  import { __element, __enterChildren, __exitChildren, __insert, __on } from "@vertz/ui/internals";
27
27
  import { signal } from "@vertz/ui";
28
28
  function MenuRoot(options = {}) {
29
- const { onSelect, positioning, ...attrs } = options;
29
+ const { onSelect, onOpenChange, positioning, ...attrs } = options;
30
30
  const ids = linkedIds("menu");
31
31
  const state = {
32
32
  open: signal(false),
@@ -47,6 +47,7 @@ function MenuRoot(options = {}) {
47
47
  setHidden(content, false);
48
48
  setDataState(trigger, "open");
49
49
  setDataState(content, "open");
50
+ onOpenChange?.(true);
50
51
  if (positioning) {
51
52
  const ref = positioning.referenceElement ?? trigger;
52
53
  const result = createFloatingPosition(ref, content, positioning);
@@ -75,6 +76,7 @@ function MenuRoot(options = {}) {
75
76
  setDataState(trigger, "closed");
76
77
  setDataState(content, "closed");
77
78
  setHiddenAnimated(content, true);
79
+ onOpenChange?.(false);
78
80
  if (positioning) {
79
81
  floatingCleanup?.();
80
82
  floatingCleanup = null;
@@ -11,22 +11,22 @@ import {
11
11
  import {
12
12
  Keys,
13
13
  isKey
14
- } from "./chunk-jctqs9m4.js";
14
+ } from "./chunk-7867pr13.js";
15
15
  import {
16
16
  setDataState,
17
17
  setExpanded,
18
18
  setHidden,
19
19
  setHiddenAnimated
20
20
  } from "./chunk-vvjyx7fe.js";
21
- import {
22
- applyAttrs
23
- } from "./chunk-dpsgb1xw.js";
24
21
  import {
25
22
  linkedIds
26
23
  } from "./chunk-8y1jf6xr.js";
24
+ import {
25
+ applyAttrs
26
+ } from "./chunk-q8dm19a5.js";
27
27
 
28
28
  // src/popover/popover.tsx
29
- import { __element, __on } from "@vertz/ui/internals";
29
+ import { __element, __on, __styleStr } from "@vertz/ui/internals";
30
30
  import { signal } from "@vertz/ui";
31
31
  function PopoverRoot(options = {}) {
32
32
  const { defaultOpen = false, onOpenChange, positioning, ...attrs } = options;
@@ -122,7 +122,7 @@ function PopoverRoot(options = {}) {
122
122
  {
123
123
  const __v = defaultOpen ? "" : "display: none";
124
124
  if (__v != null && __v !== false)
125
- __el1.setAttribute("style", __v === true ? "" : __v);
125
+ __el1.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
126
126
  }
127
127
  __on(__el1, "keydown", (event) => {
128
128
  if (isKey(event, Keys.Escape)) {
@@ -9,18 +9,18 @@ import {
9
9
  Keys,
10
10
  handleListNavigation,
11
11
  isKey
12
- } from "./chunk-jctqs9m4.js";
12
+ } from "./chunk-7867pr13.js";
13
13
  import {
14
14
  setDataState,
15
15
  setHidden,
16
16
  setHiddenAnimated
17
17
  } from "./chunk-vvjyx7fe.js";
18
- import {
19
- applyAttrs
20
- } from "./chunk-dpsgb1xw.js";
21
18
  import {
22
19
  uniqueId
23
20
  } from "./chunk-8y1jf6xr.js";
21
+ import {
22
+ applyAttrs
23
+ } from "./chunk-q8dm19a5.js";
24
24
 
25
25
  // src/context-menu/context-menu.tsx
26
26
  import { __element, __enterChildren, __exitChildren, __insert, __on } from "@vertz/ui/internals";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  setDataState
3
3
  } from "./chunk-vvjyx7fe.js";
4
- import {
5
- applyAttrs
6
- } from "./chunk-dpsgb1xw.js";
7
4
  import {
8
5
  uniqueId
9
6
  } from "./chunk-8y1jf6xr.js";
7
+ import {
8
+ applyAttrs
9
+ } from "./chunk-q8dm19a5.js";
10
10
 
11
11
  // src/toast/toast.tsx
12
12
  import { __element, __enterChildren, __exitChildren, __insert } from "@vertz/ui/internals";
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  Keys,
8
8
  isKey
9
- } from "./chunk-jctqs9m4.js";
9
+ } from "./chunk-7867pr13.js";
10
10
  import {
11
11
  setDataState,
12
12
  setExpanded,
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-8y1jf6xr.js";
19
19
 
20
20
  // src/sheet/sheet.tsx
21
- import { __element, __on } from "@vertz/ui/internals";
21
+ import { __element, __on, __styleStr } from "@vertz/ui/internals";
22
22
  import { signal } from "@vertz/ui";
23
23
  function SheetRoot(options = {}) {
24
24
  const { side = "right", defaultOpen = false, onOpenChange } = options;
@@ -114,7 +114,7 @@ function SheetRoot(options = {}) {
114
114
  {
115
115
  const __v = defaultOpen ? "" : "display: none";
116
116
  if (__v != null && __v !== false)
117
- __el1.setAttribute("style", __v === true ? "" : __v);
117
+ __el1.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
118
118
  }
119
119
  __on(__el1, "click", () => hide());
120
120
  return __el1;
@@ -146,7 +146,7 @@ function SheetRoot(options = {}) {
146
146
  {
147
147
  const __v = defaultOpen ? "" : "display: none";
148
148
  if (__v != null && __v !== false)
149
- __el2.setAttribute("style", __v === true ? "" : __v);
149
+ __el2.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
150
150
  }
151
151
  __on(__el2, "keydown", (event) => {
152
152
  if (isKey(event, Keys.Escape)) {
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  Keys,
3
3
  isKey
4
- } from "./chunk-jctqs9m4.js";
4
+ } from "./chunk-7867pr13.js";
5
5
  import {
6
6
  setDataState,
7
7
  setValueRange
8
8
  } from "./chunk-vvjyx7fe.js";
9
- import {
10
- applyAttrs
11
- } from "./chunk-dpsgb1xw.js";
12
9
  import {
13
10
  uniqueId
14
11
  } from "./chunk-8y1jf6xr.js";
12
+ import {
13
+ applyAttrs
14
+ } from "./chunk-q8dm19a5.js";
15
15
 
16
16
  // src/slider/slider.tsx
17
17
  import { __element, __enterChildren, __exitChildren, __insert, __on } from "@vertz/ui/internals";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Menu
3
- } from "./chunk-7ffg0caj.js";
3
+ } from "./chunk-q9fgfgh9.js";
4
4
 
5
5
  // src/dropdown-menu/dropdown-menu.ts
6
6
  var DropdownMenu = {