@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
@@ -1,175 +0,0 @@
1
- import {
2
- focusFirst,
3
- saveFocus,
4
- trapFocus
5
- } from "./chunk-e2v1c9ex.js";
6
- import {
7
- Keys,
8
- isKey
9
- } from "./chunk-7867pr13.js";
10
- import {
11
- setDataState,
12
- setExpanded,
13
- setHidden,
14
- setHiddenAnimated
15
- } from "./chunk-vvjyx7fe.js";
16
- import {
17
- linkedIds
18
- } from "./chunk-8y1jf6xr.js";
19
-
20
- // src/sheet/sheet.tsx
21
- import { __element, __on, __styleStr } from "@vertz/ui/internals";
22
- import { signal } from "@vertz/ui";
23
- function SheetRoot(options = {}) {
24
- const { side = "right", defaultOpen = false, onOpenChange } = options;
25
- const ids = linkedIds("sheet");
26
- const state = { open: signal(defaultOpen) };
27
- let restoreFocus = null;
28
- let removeTrap = null;
29
- function show() {
30
- state.open.value = true;
31
- setExpanded(trigger, true);
32
- setHidden(overlay, false);
33
- setHidden(content, false);
34
- setDataState(trigger, "open");
35
- setDataState(overlay, "open");
36
- setDataState(content, "open");
37
- restoreFocus = saveFocus();
38
- removeTrap = trapFocus(content);
39
- queueMicrotask(() => focusFirst(content));
40
- onOpenChange?.(true);
41
- }
42
- function hide() {
43
- state.open.value = false;
44
- setExpanded(trigger, false);
45
- setDataState(trigger, "closed");
46
- setDataState(overlay, "closed");
47
- setDataState(content, "closed");
48
- setHiddenAnimated(overlay, true);
49
- setHiddenAnimated(content, true);
50
- removeTrap?.();
51
- removeTrap = null;
52
- restoreFocus?.();
53
- restoreFocus = null;
54
- onOpenChange?.(false);
55
- }
56
- const SWIPE_THRESHOLD = 50;
57
- let startX = 0;
58
- let startY = 0;
59
- function handlePointerDown(e) {
60
- startX = e.clientX;
61
- startY = e.clientY;
62
- }
63
- function handlePointerUp(e) {
64
- if (!state.open.peek())
65
- return;
66
- const deltaX = e.clientX - startX;
67
- const deltaY = e.clientY - startY;
68
- const shouldDismiss = side === "right" && deltaX >= SWIPE_THRESHOLD || side === "left" && deltaX <= -SWIPE_THRESHOLD || side === "bottom" && deltaY >= SWIPE_THRESHOLD || side === "top" && deltaY <= -SWIPE_THRESHOLD;
69
- if (shouldDismiss) {
70
- hide();
71
- }
72
- }
73
- const trigger = (() => {
74
- const __el0 = __element("button");
75
- __el0.setAttribute("type", "button");
76
- {
77
- const __v = ids.triggerId;
78
- if (__v != null && __v !== false)
79
- __el0.setAttribute("id", __v === true ? "" : __v);
80
- }
81
- {
82
- const __v = ids.contentId;
83
- if (__v != null && __v !== false)
84
- __el0.setAttribute("aria-controls", __v === true ? "" : __v);
85
- }
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
- state.open.peek() ? hide() : show();
98
- });
99
- return __el0;
100
- })();
101
- const overlay = (() => {
102
- const __el1 = __element("div");
103
- __el1.setAttribute("data-sheet-overlay", "");
104
- {
105
- const __v = defaultOpen ? "false" : "true";
106
- if (__v != null && __v !== false)
107
- __el1.setAttribute("aria-hidden", __v === true ? "" : __v);
108
- }
109
- {
110
- const __v = defaultOpen ? "open" : "closed";
111
- if (__v != null && __v !== false)
112
- __el1.setAttribute("data-state", __v === true ? "" : __v);
113
- }
114
- {
115
- const __v = defaultOpen ? "" : "display: none";
116
- if (__v != null && __v !== false)
117
- __el1.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
118
- }
119
- __on(__el1, "click", () => hide());
120
- return __el1;
121
- })();
122
- const content = (() => {
123
- const __el2 = __element("div");
124
- __el2.setAttribute("role", "dialog");
125
- __el2.setAttribute("aria-modal", "true");
126
- {
127
- const __v = ids.contentId;
128
- if (__v != null && __v !== false)
129
- __el2.setAttribute("id", __v === true ? "" : __v);
130
- }
131
- {
132
- const __v = side;
133
- if (__v != null && __v !== false)
134
- __el2.setAttribute("data-side", __v === true ? "" : __v);
135
- }
136
- {
137
- const __v = defaultOpen ? "false" : "true";
138
- if (__v != null && __v !== false)
139
- __el2.setAttribute("aria-hidden", __v === true ? "" : __v);
140
- }
141
- {
142
- const __v = defaultOpen ? "open" : "closed";
143
- if (__v != null && __v !== false)
144
- __el2.setAttribute("data-state", __v === true ? "" : __v);
145
- }
146
- {
147
- const __v = defaultOpen ? "" : "display: none";
148
- if (__v != null && __v !== false)
149
- __el2.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
150
- }
151
- __on(__el2, "keydown", (event) => {
152
- if (isKey(event, Keys.Escape)) {
153
- event.preventDefault();
154
- event.stopPropagation();
155
- hide();
156
- }
157
- });
158
- __on(__el2, "pointerdown", handlePointerDown);
159
- __on(__el2, "pointerup", handlePointerUp);
160
- return __el2;
161
- })();
162
- const close = (() => {
163
- const __el3 = __element("button");
164
- __el3.setAttribute("type", "button");
165
- __el3.setAttribute("aria-label", "Close");
166
- __on(__el3, "click", () => hide());
167
- return __el3;
168
- })();
169
- return { trigger, overlay, content, close, state, show, hide };
170
- }
171
- var Sheet = {
172
- Root: SheetRoot
173
- };
174
-
175
- export { Sheet };
@@ -1,151 +0,0 @@
1
- import {
2
- Keys,
3
- isKey
4
- } from "./chunk-7867pr13.js";
5
- import {
6
- setDataState,
7
- setValueRange
8
- } from "./chunk-vvjyx7fe.js";
9
- import {
10
- uniqueId
11
- } from "./chunk-8y1jf6xr.js";
12
- import {
13
- applyAttrs
14
- } from "./chunk-q8dm19a5.js";
15
-
16
- // src/slider/slider.tsx
17
- import { __element, __enterChildren, __exitChildren, __insert, __on } from "@vertz/ui/internals";
18
- import { signal } from "@vertz/ui";
19
- function SliderRoot(options = {}) {
20
- const {
21
- defaultValue = 0,
22
- min = 0,
23
- max = 100,
24
- step = 1,
25
- disabled = false,
26
- onValueChange,
27
- ...attrs
28
- } = options;
29
- const state = {
30
- value: signal(defaultValue),
31
- disabled: signal(disabled)
32
- };
33
- function clamp(val) {
34
- return Math.min(max, Math.max(min, val));
35
- }
36
- function updatePosition(pct2) {
37
- thumb.style.left = `${pct2}%`;
38
- fill.style.width = `${pct2}%`;
39
- }
40
- function setValue(val) {
41
- if (state.disabled.peek())
42
- return;
43
- const clamped = clamp(val);
44
- state.value.value = clamped;
45
- setValueRange(thumb, clamped, min, max);
46
- const pct2 = (clamped - min) / (max - min) * 100;
47
- updatePosition(pct2);
48
- setDataState(root, "active");
49
- onValueChange?.(clamped);
50
- }
51
- function valueFromPointer(event) {
52
- const rect = track.getBoundingClientRect();
53
- const pct2 = Math.max(0, Math.min(1, (event.clientX - rect.left) / rect.width));
54
- const raw = min + pct2 * (max - min);
55
- return Math.round(raw / step) * step;
56
- }
57
- const fill = (() => {
58
- const __el0 = __element("div");
59
- __el0.setAttribute("data-part", "fill");
60
- __el0.setAttribute("style", "position: absolute; height: 100%; border-radius: inherit;");
61
- return __el0;
62
- })();
63
- const thumb = (() => {
64
- const __el1 = __element("div");
65
- __el1.setAttribute("role", "slider");
66
- {
67
- const __v = disabled ? "-1" : "0";
68
- if (__v != null && __v !== false)
69
- __el1.setAttribute("tabindex", __v === true ? "" : __v);
70
- }
71
- __el1.setAttribute("data-part", "thumb");
72
- {
73
- const __v = disabled ? "true" : undefined;
74
- if (__v != null && __v !== false)
75
- __el1.setAttribute("aria-disabled", __v === true ? "" : __v);
76
- }
77
- __el1.setAttribute("style", "position: absolute; transform: translate(-50%, -50%);");
78
- __on(__el1, "keydown", (event) => {
79
- if (state.disabled.peek())
80
- return;
81
- const current = state.value.peek();
82
- if (isKey(event, Keys.ArrowRight, Keys.ArrowUp)) {
83
- event.preventDefault();
84
- setValue(current + step);
85
- } else if (isKey(event, Keys.ArrowLeft, Keys.ArrowDown)) {
86
- event.preventDefault();
87
- setValue(current - step);
88
- } else if (isKey(event, Keys.Home)) {
89
- event.preventDefault();
90
- setValue(min);
91
- } else if (isKey(event, Keys.End)) {
92
- event.preventDefault();
93
- setValue(max);
94
- }
95
- });
96
- return __el1;
97
- })();
98
- setValueRange(thumb, defaultValue, min, max);
99
- const track = (() => {
100
- const __el2 = __element("div");
101
- __el2.setAttribute("data-part", "track");
102
- __el2.setAttribute("style", "position: relative;");
103
- __enterChildren(__el2);
104
- __insert(__el2, fill);
105
- __insert(__el2, thumb);
106
- __exitChildren();
107
- return __el2;
108
- })();
109
- const root = (() => {
110
- const __el3 = __element("div");
111
- {
112
- const __v = uniqueId("slider");
113
- if (__v != null && __v !== false)
114
- __el3.setAttribute("id", __v === true ? "" : __v);
115
- }
116
- {
117
- const __v = disabled ? "disabled" : "active";
118
- if (__v != null && __v !== false)
119
- __el3.setAttribute("data-state", __v === true ? "" : __v);
120
- }
121
- __on(__el3, "pointerdown", (event) => {
122
- if (state.disabled.peek())
123
- return;
124
- event.preventDefault();
125
- setValue(valueFromPointer(event));
126
- thumb.focus();
127
- function onMove(e) {
128
- setValue(valueFromPointer(e));
129
- }
130
- function onUp() {
131
- document.removeEventListener("pointermove", onMove);
132
- document.removeEventListener("pointerup", onUp);
133
- }
134
- document.addEventListener("pointermove", onMove);
135
- document.addEventListener("pointerup", onUp);
136
- });
137
- __enterChildren(__el3);
138
- __insert(__el3, track);
139
- __exitChildren();
140
- return __el3;
141
- })();
142
- const pct = (defaultValue - min) / (max - min) * 100;
143
- updatePosition(pct);
144
- applyAttrs(root, attrs);
145
- return { root, thumb, track, state };
146
- }
147
- var Slider = {
148
- Root: SliderRoot
149
- };
150
-
151
- export { Slider };
@@ -1,185 +0,0 @@
1
- import {
2
- setRovingTabindex
3
- } from "./chunk-e2v1c9ex.js";
4
- import {
5
- handleListNavigation
6
- } from "./chunk-7867pr13.js";
7
- import {
8
- setDataState,
9
- setHidden,
10
- setSelected
11
- } from "./chunk-vvjyx7fe.js";
12
- import {
13
- uniqueId
14
- } from "./chunk-8y1jf6xr.js";
15
- import {
16
- applyAttrs
17
- } from "./chunk-q8dm19a5.js";
18
-
19
- // src/tabs/tabs.tsx
20
- import { __element, __enterChildren, __exitChildren, __insert, __on, __styleStr } from "@vertz/ui/internals";
21
- import { signal } from "@vertz/ui";
22
- function TabList(orientation, triggers, tabValues, selectTab) {
23
- return (() => {
24
- const __el0 = __element("div");
25
- __el0.setAttribute("role", "tablist");
26
- {
27
- const __v = orientation === "vertical" ? "vertical" : undefined;
28
- if (__v != null && __v !== false)
29
- __el0.setAttribute("aria-orientation", __v === true ? "" : __v);
30
- }
31
- __on(__el0, "keydown", (event) => {
32
- const result = handleListNavigation(event, triggers, {
33
- orientation
34
- });
35
- if (result) {
36
- const idx = triggers.indexOf(result);
37
- if (idx >= 0) {
38
- const val = tabValues[idx];
39
- if (val !== undefined)
40
- selectTab(val);
41
- }
42
- }
43
- });
44
- return __el0;
45
- })();
46
- }
47
- function TabTrigger(triggerId, panelId, value, label, isActive, selectTab) {
48
- return (() => {
49
- const __el0 = __element("button");
50
- __el0.setAttribute("type", "button");
51
- __el0.setAttribute("role", "tab");
52
- {
53
- const __v = triggerId;
54
- if (__v != null && __v !== false)
55
- __el0.setAttribute("id", __v === true ? "" : __v);
56
- }
57
- {
58
- const __v = panelId;
59
- if (__v != null && __v !== false)
60
- __el0.setAttribute("aria-controls", __v === true ? "" : __v);
61
- }
62
- {
63
- const __v = value;
64
- if (__v != null && __v !== false)
65
- __el0.setAttribute("data-value", __v === true ? "" : __v);
66
- }
67
- {
68
- const __v = isActive ? "true" : "false";
69
- if (__v != null && __v !== false)
70
- __el0.setAttribute("aria-selected", __v === true ? "" : __v);
71
- }
72
- {
73
- const __v = isActive ? "active" : "inactive";
74
- if (__v != null && __v !== false)
75
- __el0.setAttribute("data-state", __v === true ? "" : __v);
76
- }
77
- __on(__el0, "click", () => {
78
- selectTab(value);
79
- });
80
- __enterChildren(__el0);
81
- __insert(__el0, label ?? value);
82
- __exitChildren();
83
- return __el0;
84
- })();
85
- }
86
- function TabsContainer(list) {
87
- return (() => {
88
- const __el0 = __element("div");
89
- __enterChildren(__el0);
90
- __insert(__el0, list);
91
- __exitChildren();
92
- return __el0;
93
- })();
94
- }
95
- function TabPanel(panelId, triggerId, isActive) {
96
- return (() => {
97
- const __el0 = __element("div");
98
- __el0.setAttribute("role", "tabpanel");
99
- {
100
- const __v = panelId;
101
- if (__v != null && __v !== false)
102
- __el0.setAttribute("id", __v === true ? "" : __v);
103
- }
104
- {
105
- const __v = triggerId;
106
- if (__v != null && __v !== false)
107
- __el0.setAttribute("aria-labelledby", __v === true ? "" : __v);
108
- }
109
- __el0.setAttribute("tabindex", "0");
110
- {
111
- const __v = isActive ? "false" : "true";
112
- if (__v != null && __v !== false)
113
- __el0.setAttribute("aria-hidden", __v === true ? "" : __v);
114
- }
115
- {
116
- const __v = isActive ? "active" : "inactive";
117
- if (__v != null && __v !== false)
118
- __el0.setAttribute("data-state", __v === true ? "" : __v);
119
- }
120
- {
121
- const __v = isActive ? "" : "display: none";
122
- if (__v != null && __v !== false)
123
- __el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
124
- }
125
- return __el0;
126
- })();
127
- }
128
- function TabsRoot(options = {}) {
129
- const { defaultValue = "", orientation = "horizontal", onValueChange, ...attrs } = options;
130
- const state = { value: signal(defaultValue) };
131
- const triggers = [];
132
- const panels = [];
133
- const tabValues = [];
134
- function selectTab(value) {
135
- state.value.value = value;
136
- for (let i = 0;i < tabValues.length; i++) {
137
- const isActive = tabValues[i] === value;
138
- const trig = triggers[i];
139
- const panel = panels[i];
140
- if (!trig || !panel)
141
- continue;
142
- setSelected(trig, isActive);
143
- setDataState(trig, isActive ? "active" : "inactive");
144
- trig.setAttribute("tabindex", isActive ? "0" : "-1");
145
- setHidden(panel, !isActive);
146
- setDataState(panel, isActive ? "active" : "inactive");
147
- }
148
- onValueChange?.(value);
149
- }
150
- const list = TabList(orientation, triggers, tabValues, selectTab);
151
- const root = TabsContainer(list);
152
- const cleanups = [];
153
- function Tab(value, label) {
154
- const baseId = uniqueId("tab");
155
- const triggerId = `${baseId}-trigger`;
156
- const panelId = `${baseId}-panel`;
157
- const isActive = value === state.value.peek();
158
- const trig = TabTrigger(triggerId, panelId, value, label, isActive, selectTab);
159
- const handleClick = () => {
160
- trig.focus();
161
- };
162
- trig.addEventListener("click", handleClick);
163
- cleanups.push(() => trig.removeEventListener("click", handleClick));
164
- const panel = TabPanel(panelId, triggerId, isActive);
165
- triggers.push(trig);
166
- panels.push(panel);
167
- tabValues.push(value);
168
- list.appendChild(trig);
169
- root.appendChild(panel);
170
- setRovingTabindex(triggers, triggers.findIndex((t) => tabValues[triggers.indexOf(t)] === state.value.peek()));
171
- return { trigger: trig, panel };
172
- }
173
- function destroy() {
174
- for (const cleanup of cleanups)
175
- cleanup();
176
- cleanups.length = 0;
177
- }
178
- applyAttrs(root, attrs);
179
- return { root, list, state, Tab, destroy };
180
- }
181
- var Tabs = {
182
- Root: TabsRoot
183
- };
184
-
185
- export { Tabs };