@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,167 @@
1
+ import {
2
+ createFloatingPosition
3
+ } from "./chunk-0mcr52hc.js";
4
+ import {
5
+ Keys,
6
+ isKey
7
+ } from "./chunk-7867pr13.js";
8
+ import {
9
+ setDataState,
10
+ setExpanded,
11
+ setHidden,
12
+ setHiddenAnimated
13
+ } from "./chunk-vevfhpc9.js";
14
+ import {
15
+ uniqueId
16
+ } from "./chunk-8y1jf6xr.js";
17
+ import {
18
+ applyAttrs
19
+ } from "./chunk-2db2dnp3.js";
20
+
21
+ // src/hover-card/hover-card.tsx
22
+ import { __discardMountFrame, __element, __flushMountFrame, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
23
+ import { signal } from "@vertz/ui";
24
+ function HoverCardRoot(options = {}) {
25
+ const __mfDepth = __pushMountFrame();
26
+ try {
27
+ let cancelTimers = function() {
28
+ if (openTimeout) {
29
+ clearTimeout(openTimeout);
30
+ openTimeout = null;
31
+ }
32
+ if (closeTimeout) {
33
+ clearTimeout(closeTimeout);
34
+ closeTimeout = null;
35
+ }
36
+ }, cancelCloseTimer = function() {
37
+ if (closeTimeout) {
38
+ clearTimeout(closeTimeout);
39
+ closeTimeout = null;
40
+ }
41
+ }, positionContent = function() {
42
+ if (positioning) {
43
+ floatingCleanup?.();
44
+ const effectivePlacement = positioning.placement ?? "bottom";
45
+ const result = createFloatingPosition(trigger, content, {
46
+ ...positioning,
47
+ placement: effectivePlacement
48
+ });
49
+ floatingCleanup = result.cleanup;
50
+ }
51
+ }, show = function() {
52
+ cancelTimers();
53
+ if (state.open.peek())
54
+ return;
55
+ openTimeout = setTimeout(() => {
56
+ state.open.value = true;
57
+ setExpanded(trigger, true);
58
+ setHidden(content, false);
59
+ setDataState(content, "open");
60
+ positionContent();
61
+ onOpenChange?.(true);
62
+ openTimeout = null;
63
+ }, openDelay);
64
+ }, showImmediate = function() {
65
+ cancelTimers();
66
+ state.open.value = true;
67
+ setExpanded(trigger, true);
68
+ setHidden(content, false);
69
+ setDataState(content, "open");
70
+ positionContent();
71
+ onOpenChange?.(true);
72
+ }, hide = function() {
73
+ cancelTimers();
74
+ if (!state.open.peek())
75
+ return;
76
+ closeTimeout = setTimeout(() => {
77
+ state.open.value = false;
78
+ setExpanded(trigger, false);
79
+ setDataState(content, "closed");
80
+ setHiddenAnimated(content, true);
81
+ floatingCleanup?.();
82
+ floatingCleanup = null;
83
+ onOpenChange?.(false);
84
+ closeTimeout = null;
85
+ }, closeDelay);
86
+ }, hideImmediate = function() {
87
+ cancelTimers();
88
+ state.open.value = false;
89
+ setExpanded(trigger, false);
90
+ setDataState(content, "closed");
91
+ setHiddenAnimated(content, true);
92
+ floatingCleanup?.();
93
+ floatingCleanup = null;
94
+ onOpenChange?.(false);
95
+ }, handleTriggerBlur = function(event) {
96
+ const related = event.relatedTarget;
97
+ if (related && (trigger.contains(related) || content.contains(related)))
98
+ return;
99
+ hide();
100
+ }, handleTriggerKeydown = function(event) {
101
+ if (isKey(event, Keys.Escape) && state.open.peek()) {
102
+ hideImmediate();
103
+ }
104
+ }, handleContentFocusout = function(event) {
105
+ const related = event.relatedTarget;
106
+ if (related && (trigger.contains(related) || content.contains(related)))
107
+ return;
108
+ hide();
109
+ }, handleContentKeydown = function(event) {
110
+ if (isKey(event, Keys.Escape)) {
111
+ hideImmediate();
112
+ trigger.focus();
113
+ }
114
+ };
115
+ const { openDelay = 700, closeDelay = 300, onOpenChange, positioning, ...attrs } = options;
116
+ const contentId = uniqueId("hovercard");
117
+ const state = { open: signal(false) };
118
+ let openTimeout = null;
119
+ let closeTimeout = null;
120
+ let floatingCleanup = null;
121
+ const trigger = (() => {
122
+ const __el0 = __element("span");
123
+ __el0.setAttribute("aria-haspopup", "dialog");
124
+ __el0.setAttribute("aria-expanded", "false");
125
+ __on(__el0, "mouseenter", show);
126
+ __on(__el0, "mouseleave", hide);
127
+ __on(__el0, "focus", showImmediate);
128
+ __on(__el0, "blur", handleTriggerBlur);
129
+ __on(__el0, "keydown", handleTriggerKeydown);
130
+ return __el0;
131
+ })();
132
+ const content = (() => {
133
+ const __el1 = __element("div");
134
+ __el1.setAttribute("role", "dialog");
135
+ {
136
+ const __v = contentId;
137
+ if (__v != null && __v !== false)
138
+ __el1.setAttribute("id", __v === true ? "" : __v);
139
+ }
140
+ __el1.setAttribute("aria-hidden", "true");
141
+ __el1.setAttribute("data-state", "closed");
142
+ {
143
+ const __v = { display: "none" };
144
+ if (__v != null && __v !== false)
145
+ __el1.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
146
+ }
147
+ __on(__el1, "mouseenter", cancelCloseTimer);
148
+ __on(__el1, "mouseleave", hide);
149
+ __on(__el1, "focusin", cancelCloseTimer);
150
+ __on(__el1, "focusout", handleContentFocusout);
151
+ __on(__el1, "keydown", handleContentKeydown);
152
+ return __el1;
153
+ })();
154
+ applyAttrs(trigger, attrs);
155
+ const __mfResult0 = { trigger, content, state };
156
+ __flushMountFrame();
157
+ return __mfResult0;
158
+ } catch (__mfErr) {
159
+ __discardMountFrame(__mfDepth);
160
+ throw __mfErr;
161
+ }
162
+ }
163
+ var HoverCard = {
164
+ Root: HoverCardRoot
165
+ };
166
+
167
+ export { HoverCard };
@@ -0,0 +1,54 @@
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 { __discardMountFrame, __element, __flushMountFrame, __on, __pushMountFrame } from "@vertz/ui/internals";
10
+ function ButtonRoot(options = {}) {
11
+ const __mfDepth = __pushMountFrame();
12
+ try {
13
+ const { disabled = false, onClick, ...attrs } = options;
14
+ const el = (() => {
15
+ const __el0 = __element("button");
16
+ __el0.setAttribute("type", "button");
17
+ {
18
+ const __v = disabled;
19
+ if (__v != null && __v !== false)
20
+ __el0.setAttribute("disabled", __v === true ? "" : __v);
21
+ }
22
+ {
23
+ const __v = disabled ? "true" : undefined;
24
+ if (__v != null && __v !== false)
25
+ __el0.setAttribute("aria-disabled", __v === true ? "" : __v);
26
+ }
27
+ __on(__el0, "click", () => {
28
+ if (disabled)
29
+ return;
30
+ onClick?.();
31
+ });
32
+ __on(__el0, "keydown", (event) => {
33
+ if (disabled)
34
+ return;
35
+ handleActivation(event, () => {
36
+ event.target.click();
37
+ });
38
+ });
39
+ return __el0;
40
+ })();
41
+ applyAttrs(el, attrs);
42
+ const __mfResult0 = el;
43
+ __flushMountFrame();
44
+ return __mfResult0;
45
+ } catch (__mfErr) {
46
+ __discardMountFrame(__mfDepth);
47
+ throw __mfErr;
48
+ }
49
+ }
50
+ var Button = {
51
+ Root: ButtonRoot
52
+ };
53
+
54
+ export { Button };
@@ -0,0 +1,181 @@
1
+ import {
2
+ Keys,
3
+ isKey
4
+ } from "./chunk-7867pr13.js";
5
+ import {
6
+ setDataState,
7
+ setValueRange
8
+ } from "./chunk-vevfhpc9.js";
9
+ import {
10
+ applyAttrs
11
+ } from "./chunk-2db2dnp3.js";
12
+
13
+ // src/resizable-panel/resizable-panel.tsx
14
+ import { __discardMountFrame, __element, __flushMountFrame, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
15
+ import { signal } from "@vertz/ui";
16
+ function ResizablePanelRoot(options = {}) {
17
+ const __mfDepth = __pushMountFrame();
18
+ try {
19
+ let updateSizes = function(newSizes) {
20
+ state.sizes.value = [...newSizes];
21
+ for (let i = 0;i < panels.length; i++) {
22
+ const panel = panels[i];
23
+ if (!panel)
24
+ continue;
25
+ const size = newSizes[i] ?? 0;
26
+ panel.el.style.flex = `0 0 ${size}%`;
27
+ }
28
+ for (let i = 0;i < handles.length; i++) {
29
+ const handle = handles[i];
30
+ const leftPanel = panels[i];
31
+ if (handle && leftPanel) {
32
+ const size = newSizes[i] ?? 0;
33
+ setValueRange(handle, Math.round(size), Math.round(leftPanel.minSize), Math.round(leftPanel.maxSize));
34
+ }
35
+ }
36
+ onResize?.(newSizes);
37
+ }, Panel = function(panelOptions = {}) {
38
+ const { defaultSize, minSize = 0, maxSize = 100 } = panelOptions;
39
+ const el = (() => {
40
+ const __el1 = __element("div");
41
+ __el1.setAttribute("data-panel", "");
42
+ return __el1;
43
+ })();
44
+ panels.push({ el, minSize, maxSize });
45
+ const sizes = state.sizes.peek();
46
+ if (defaultSize != null) {
47
+ sizes.push(defaultSize);
48
+ } else {
49
+ const equalSize = 100 / panels.length;
50
+ sizes.length = 0;
51
+ for (let i = 0;i < panels.length; i++) {
52
+ sizes.push(equalSize);
53
+ }
54
+ }
55
+ updateSizes(sizes);
56
+ root.appendChild(el);
57
+ return el;
58
+ }, Handle = function() {
59
+ const handleIndex = handles.length;
60
+ const handle = (() => {
61
+ const __el2 = __element("div");
62
+ __el2.setAttribute("role", "separator");
63
+ __el2.setAttribute("tabindex", "0");
64
+ {
65
+ const __v = orientation;
66
+ if (__v != null && __v !== false)
67
+ __el2.setAttribute("data-orientation", __v === true ? "" : __v);
68
+ }
69
+ __el2.setAttribute("data-state", "idle");
70
+ __on(__el2, "keydown", (event) => {
71
+ const sizes = [...state.sizes.peek()];
72
+ const leftIdx = handleIndex;
73
+ const rightIdx = handleIndex + 1;
74
+ const leftPanel = panels[leftIdx];
75
+ const rightPanel = panels[rightIdx];
76
+ if (!leftPanel || !rightPanel)
77
+ return;
78
+ let leftSize = sizes[leftIdx] ?? 0;
79
+ let rightSize = sizes[rightIdx] ?? 0;
80
+ const STEP = 5;
81
+ const growKey = orientation === "horizontal" ? Keys.ArrowRight : Keys.ArrowDown;
82
+ const shrinkKey = orientation === "horizontal" ? Keys.ArrowLeft : Keys.ArrowUp;
83
+ if (isKey(event, growKey)) {
84
+ event.preventDefault();
85
+ const delta = Math.min(STEP, rightSize - rightPanel.minSize, leftPanel.maxSize - leftSize);
86
+ leftSize += delta;
87
+ rightSize -= delta;
88
+ } else if (isKey(event, shrinkKey)) {
89
+ event.preventDefault();
90
+ const delta = Math.min(STEP, leftSize - leftPanel.minSize, rightPanel.maxSize - rightSize);
91
+ leftSize -= delta;
92
+ rightSize += delta;
93
+ } else if (isKey(event, Keys.Home)) {
94
+ event.preventDefault();
95
+ const delta = leftSize - leftPanel.minSize;
96
+ leftSize -= delta;
97
+ rightSize += delta;
98
+ } else if (isKey(event, Keys.End)) {
99
+ event.preventDefault();
100
+ const delta = rightSize - rightPanel.minSize;
101
+ leftSize += delta;
102
+ rightSize -= delta;
103
+ } else {
104
+ return;
105
+ }
106
+ sizes[leftIdx] = leftSize;
107
+ sizes[rightIdx] = rightSize;
108
+ updateSizes(sizes);
109
+ });
110
+ __on(__el2, "pointerdown", (event) => {
111
+ event.preventDefault();
112
+ handle.setPointerCapture(event.pointerId);
113
+ setDataState(handle, "dragging");
114
+ const startPos = orientation === "horizontal" ? event.clientX : event.clientY;
115
+ const rootSize = orientation === "horizontal" ? root.offsetWidth : root.offsetHeight;
116
+ const startSizes = [...state.sizes.peek()];
117
+ function onMove(e) {
118
+ const currentPos = orientation === "horizontal" ? e.clientX : e.clientY;
119
+ const delta = (currentPos - startPos) / rootSize * 100;
120
+ const sizes = [...startSizes];
121
+ const leftIdx = handleIndex;
122
+ const rightIdx = handleIndex + 1;
123
+ const leftPanel = panels[leftIdx];
124
+ const rightPanel = panels[rightIdx];
125
+ if (!leftPanel || !rightPanel)
126
+ return;
127
+ let newLeft = (startSizes[leftIdx] ?? 0) + delta;
128
+ let newRight = (startSizes[rightIdx] ?? 0) - delta;
129
+ newLeft = Math.max(leftPanel.minSize, Math.min(leftPanel.maxSize, newLeft));
130
+ newRight = Math.max(rightPanel.minSize, Math.min(rightPanel.maxSize, newRight));
131
+ sizes[leftIdx] = newLeft;
132
+ sizes[rightIdx] = newRight;
133
+ updateSizes(sizes);
134
+ }
135
+ function onUp(e) {
136
+ handle.releasePointerCapture(e.pointerId);
137
+ setDataState(handle, "idle");
138
+ handle.removeEventListener("pointermove", onMove);
139
+ handle.removeEventListener("pointerup", onUp);
140
+ }
141
+ handle.addEventListener("pointermove", onMove);
142
+ handle.addEventListener("pointerup", onUp);
143
+ });
144
+ return __el2;
145
+ })();
146
+ handles.push(handle);
147
+ root.appendChild(handle);
148
+ return handle;
149
+ };
150
+ const { orientation = "horizontal", onResize, ...attrs } = options;
151
+ const state = { sizes: signal([]) };
152
+ const panels = [];
153
+ const handles = [];
154
+ const root = (() => {
155
+ const __el0 = __element("div");
156
+ {
157
+ const __v = { display: "flex", flexDirection: orientation === "horizontal" ? "row" : "column" };
158
+ if (__v != null && __v !== false)
159
+ __el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
160
+ }
161
+ {
162
+ const __v = orientation;
163
+ if (__v != null && __v !== false)
164
+ __el0.setAttribute("data-orientation", __v === true ? "" : __v);
165
+ }
166
+ return __el0;
167
+ })();
168
+ applyAttrs(root, attrs);
169
+ const __mfResult0 = { root, state, Panel, Handle };
170
+ __flushMountFrame();
171
+ return __mfResult0;
172
+ } catch (__mfErr) {
173
+ __discardMountFrame(__mfDepth);
174
+ throw __mfErr;
175
+ }
176
+ }
177
+ var ResizablePanel = {
178
+ Root: ResizablePanelRoot
179
+ };
180
+
181
+ export { ResizablePanel };
@@ -12,107 +12,159 @@ import {
12
12
  setExpanded,
13
13
  setHidden,
14
14
  setHiddenAnimated
15
- } from "./chunk-vvjyx7fe.js";
15
+ } from "./chunk-vevfhpc9.js";
16
16
  import {
17
17
  linkedIds
18
18
  } from "./chunk-8y1jf6xr.js";
19
19
  import {
20
20
  applyAttrs
21
- } from "./chunk-q8dm19a5.js";
21
+ } from "./chunk-2db2dnp3.js";
22
22
 
23
23
  // src/navigation-menu/navigation-menu.tsx
24
- import { __element, __enterChildren, __exitChildren, __insert, __on } from "@vertz/ui/internals";
24
+ import { __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __insert, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
25
25
  import { signal } from "@vertz/ui";
26
26
  function NavMenuList(triggers, orientation) {
27
- return (() => {
28
- const __el0 = __element("div");
29
- __on(__el0, "keydown", (event) => {
30
- if (isKey(event, Keys.ArrowLeft, Keys.ArrowRight, Keys.Home, Keys.End)) {
31
- handleListNavigation(event, triggers, {
32
- orientation: orientation === "horizontal" ? "horizontal" : "vertical"
33
- });
34
- }
35
- });
36
- return __el0;
37
- })();
27
+ const __mfDepth = __pushMountFrame();
28
+ try {
29
+ const __mfResult0 = (() => {
30
+ const __el0 = __element("div");
31
+ __on(__el0, "keydown", (event) => {
32
+ if (isKey(event, Keys.ArrowLeft, Keys.ArrowRight, Keys.Home, Keys.End)) {
33
+ handleListNavigation(event, triggers, {
34
+ orientation: orientation === "horizontal" ? "horizontal" : "vertical"
35
+ });
36
+ }
37
+ });
38
+ return __el0;
39
+ })();
40
+ __flushMountFrame();
41
+ return __mfResult0;
42
+ } catch (__mfErr) {
43
+ __discardMountFrame(__mfDepth);
44
+ throw __mfErr;
45
+ }
38
46
  }
39
47
  function NavMenuViewport() {
40
- return (() => {
41
- const __el0 = __element("div");
42
- return __el0;
43
- })();
48
+ const __mfDepth = __pushMountFrame();
49
+ try {
50
+ const __mfResult0 = (() => {
51
+ const __el0 = __element("div");
52
+ return __el0;
53
+ })();
54
+ __flushMountFrame();
55
+ return __mfResult0;
56
+ } catch (__mfErr) {
57
+ __discardMountFrame(__mfDepth);
58
+ throw __mfErr;
59
+ }
44
60
  }
45
61
  function NavMenuNav(list, viewport) {
46
- return (() => {
47
- const __el0 = __element("nav");
48
- __enterChildren(__el0);
49
- __insert(__el0, list);
50
- __insert(__el0, viewport);
51
- __exitChildren();
52
- return __el0;
53
- })();
62
+ const __mfDepth = __pushMountFrame();
63
+ try {
64
+ const __mfResult0 = (() => {
65
+ const __el0 = __element("nav");
66
+ __enterChildren(__el0);
67
+ __insert(__el0, list);
68
+ __insert(__el0, viewport);
69
+ __exitChildren();
70
+ return __el0;
71
+ })();
72
+ __flushMountFrame();
73
+ return __mfResult0;
74
+ } catch (__mfErr) {
75
+ __discardMountFrame(__mfDepth);
76
+ throw __mfErr;
77
+ }
54
78
  }
55
79
  function NavMenuItemTrigger(triggerId, contentId, value, label, onClick, onMouseenter, onMouseleave, onKeydown) {
56
- return (() => {
57
- const __el0 = __element("button");
58
- __el0.setAttribute("type", "button");
59
- {
60
- const __v = triggerId;
61
- if (__v != null && __v !== false)
62
- __el0.setAttribute("id", __v === true ? "" : __v);
63
- }
64
- {
65
- const __v = contentId;
66
- if (__v != null && __v !== false)
67
- __el0.setAttribute("aria-controls", __v === true ? "" : __v);
68
- }
69
- {
70
- const __v = value;
71
- if (__v != null && __v !== false)
72
- __el0.setAttribute("data-value", __v === true ? "" : __v);
73
- }
74
- __el0.setAttribute("aria-expanded", "false");
75
- __el0.setAttribute("data-state", "closed");
76
- __on(__el0, "click", onClick);
77
- __on(__el0, "mouseenter", onMouseenter);
78
- __on(__el0, "mouseleave", onMouseleave);
79
- __on(__el0, "keydown", onKeydown);
80
- __enterChildren(__el0);
81
- __insert(__el0, label ?? value);
82
- __exitChildren();
83
- return __el0;
84
- })();
80
+ const __mfDepth = __pushMountFrame();
81
+ try {
82
+ const __mfResult0 = (() => {
83
+ const __el0 = __element("button");
84
+ __el0.setAttribute("type", "button");
85
+ {
86
+ const __v = triggerId;
87
+ if (__v != null && __v !== false)
88
+ __el0.setAttribute("id", __v === true ? "" : __v);
89
+ }
90
+ {
91
+ const __v = contentId;
92
+ if (__v != null && __v !== false)
93
+ __el0.setAttribute("aria-controls", __v === true ? "" : __v);
94
+ }
95
+ {
96
+ const __v = value;
97
+ if (__v != null && __v !== false)
98
+ __el0.setAttribute("data-value", __v === true ? "" : __v);
99
+ }
100
+ __el0.setAttribute("aria-expanded", "false");
101
+ __el0.setAttribute("data-state", "closed");
102
+ __on(__el0, "click", onClick);
103
+ __on(__el0, "mouseenter", onMouseenter);
104
+ __on(__el0, "mouseleave", onMouseleave);
105
+ __on(__el0, "keydown", onKeydown);
106
+ __enterChildren(__el0);
107
+ __insert(__el0, label ?? value);
108
+ __exitChildren();
109
+ return __el0;
110
+ })();
111
+ __flushMountFrame();
112
+ return __mfResult0;
113
+ } catch (__mfErr) {
114
+ __discardMountFrame(__mfDepth);
115
+ throw __mfErr;
116
+ }
85
117
  }
86
118
  function NavMenuItemContent(contentId, onMouseenter, onMouseleave, onKeydown) {
87
- return (() => {
88
- const __el0 = __element("div");
89
- {
90
- const __v = contentId;
91
- if (__v != null && __v !== false)
92
- __el0.setAttribute("id", __v === true ? "" : __v);
93
- }
94
- __el0.setAttribute("aria-hidden", "true");
95
- __el0.setAttribute("data-state", "closed");
96
- __el0.setAttribute("style", "display: none");
97
- __on(__el0, "mouseenter", onMouseenter);
98
- __on(__el0, "mouseleave", onMouseleave);
99
- __on(__el0, "keydown", onKeydown);
100
- return __el0;
101
- })();
119
+ const __mfDepth = __pushMountFrame();
120
+ try {
121
+ const __mfResult0 = (() => {
122
+ const __el0 = __element("div");
123
+ {
124
+ const __v = contentId;
125
+ if (__v != null && __v !== false)
126
+ __el0.setAttribute("id", __v === true ? "" : __v);
127
+ }
128
+ __el0.setAttribute("aria-hidden", "true");
129
+ __el0.setAttribute("data-state", "closed");
130
+ {
131
+ const __v = { display: "none" };
132
+ if (__v != null && __v !== false)
133
+ __el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
134
+ }
135
+ __on(__el0, "mouseenter", onMouseenter);
136
+ __on(__el0, "mouseleave", onMouseleave);
137
+ __on(__el0, "keydown", onKeydown);
138
+ return __el0;
139
+ })();
140
+ __flushMountFrame();
141
+ return __mfResult0;
142
+ } catch (__mfErr) {
143
+ __discardMountFrame(__mfDepth);
144
+ throw __mfErr;
145
+ }
102
146
  }
103
147
  function NavMenuLink(href, label) {
104
- return (() => {
105
- const __el0 = __element("a");
106
- {
107
- const __v = href;
108
- if (__v != null && __v !== false)
109
- __el0.setAttribute("href", __v === true ? "" : __v);
110
- }
111
- __enterChildren(__el0);
112
- __insert(__el0, label);
113
- __exitChildren();
114
- return __el0;
115
- })();
148
+ const __mfDepth = __pushMountFrame();
149
+ try {
150
+ const __mfResult0 = (() => {
151
+ const __el0 = __element("a");
152
+ {
153
+ const __v = href;
154
+ if (__v != null && __v !== false)
155
+ __el0.setAttribute("href", __v === true ? "" : __v);
156
+ }
157
+ __enterChildren(__el0);
158
+ __insert(__el0, label);
159
+ __exitChildren();
160
+ return __el0;
161
+ })();
162
+ __flushMountFrame();
163
+ return __mfResult0;
164
+ } catch (__mfErr) {
165
+ __discardMountFrame(__mfDepth);
166
+ throw __mfErr;
167
+ }
116
168
  }
117
169
  function NavigationMenuRoot(options = {}) {
118
170
  const { orientation = "horizontal", delayOpen = 200, delayClose = 300, ...attrs } = options;