@vertz/ui-primitives 0.2.22 → 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.
- package/dist/shared/chunk-3h1mxp95.js +148 -0
- package/dist/shared/chunk-3kwh27dv.js +135 -0
- package/dist/shared/chunk-4894pmy6.js +184 -0
- package/dist/shared/chunk-67sn29eh.js +125 -0
- package/dist/shared/chunk-7cb3z0s8.js +287 -0
- package/dist/shared/chunk-8c01c8mb.js +217 -0
- package/dist/shared/chunk-99tk72t3.js +69 -0
- package/dist/shared/chunk-9gfp3ffv.js +204 -0
- package/dist/shared/chunk-b25npqer.js +149 -0
- package/dist/shared/chunk-cgb2j94g.js +141 -0
- package/dist/shared/chunk-e1jcf22s.js +79 -0
- package/dist/shared/chunk-e3h0ddmx.js +168 -0
- package/dist/shared/chunk-f2vx4tpw.js +168 -0
- package/dist/shared/chunk-h3v10x04.js +271 -0
- package/dist/shared/chunk-hdvdfd1c.js +96 -0
- package/dist/shared/{chunk-dhyr0s9n.js → chunk-j902w020.js} +1 -1
- package/dist/shared/chunk-jdygp28a.js +260 -0
- package/dist/shared/chunk-jqre4qtw.js +180 -0
- package/dist/shared/{chunk-k8nabsxm.js → chunk-mgr904ap.js} +74 -34
- package/dist/shared/chunk-mr1tb0dp.js +167 -0
- package/dist/shared/chunk-nj420k31.js +54 -0
- package/dist/shared/chunk-p0x7hgv6.js +181 -0
- package/dist/shared/{chunk-w9dag6ce.js → chunk-pn6shbcs.js} +132 -80
- package/dist/shared/chunk-pzx0vpq1.js +223 -0
- package/dist/shared/chunk-tn0m98j8.js +42 -0
- package/dist/shared/{chunk-myq79qew.js → chunk-ttb2tt03.js} +47 -27
- package/dist/shared/chunk-vy874zxe.js +68 -0
- package/dist/shared/chunk-ww7k2azn.js +297 -0
- package/dist/shared/{chunk-jda3v59q.js → chunk-xa1b96mb.js} +2 -2
- package/dist/shared/chunk-xs6gp369.js +245 -0
- package/dist/shared/chunk-y4mmmayp.js +206 -0
- package/dist/src/accordion/accordion.js +1 -1
- package/dist/src/alert-dialog/alert-dialog.js +1 -1
- package/dist/src/badge/badge.js +1 -1
- package/dist/src/button/button.js +1 -1
- package/dist/src/calendar/calendar.js +1 -1
- package/dist/src/carousel/carousel.js +1 -1
- package/dist/src/checkbox/checkbox.js +1 -1
- package/dist/src/collapsible/collapsible.js +1 -1
- package/dist/src/combobox/combobox.js +1 -1
- package/dist/src/command/command.js +1 -1
- package/dist/src/context-menu/context-menu.js +1 -1
- package/dist/src/date-picker/date-picker.js +1 -1
- package/dist/src/dialog/dialog.js +1 -1
- package/dist/src/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/src/hover-card/hover-card.js +1 -1
- package/dist/src/index.d.ts +14 -1
- package/dist/src/index.js +5595 -4310
- package/dist/src/menu/menu.js +1 -1
- package/dist/src/menubar/menubar.js +1 -1
- package/dist/src/navigation-menu/navigation-menu.js +1 -1
- package/dist/src/popover/popover.js +1 -1
- package/dist/src/progress/progress.js +1 -1
- package/dist/src/radio/radio.js +1 -1
- package/dist/src/resizable-panel/resizable-panel.js +1 -1
- package/dist/src/scroll-area/scroll-area.js +1 -1
- package/dist/src/select/select.js +1 -1
- package/dist/src/sheet/sheet.js +1 -1
- package/dist/src/slider/slider.js +1 -1
- package/dist/src/switch/switch.js +1 -1
- package/dist/src/tabs/tabs.js +1 -1
- package/dist/src/toggle/toggle.js +1 -1
- package/dist/src/toggle-group/toggle-group.js +1 -1
- package/dist/src/tooltip/tooltip.js +1 -1
- package/package.json +3 -3
- package/dist/shared/chunk-07yzsaaw.js +0 -165
- package/dist/shared/chunk-279bzynx.js +0 -132
- package/dist/shared/chunk-27xs9apd.js +0 -288
- package/dist/shared/chunk-2k8gxzdf.js +0 -151
- package/dist/shared/chunk-3rp73gkd.js +0 -175
- package/dist/shared/chunk-4rf1m34c.js +0 -267
- package/dist/shared/chunk-7bxsf80c.js +0 -60
- package/dist/shared/chunk-8qtexw5s.js +0 -199
- package/dist/shared/chunk-9ezgd78r.js +0 -142
- package/dist/shared/chunk-ajpj10z0.js +0 -282
- package/dist/shared/chunk-c46v0fsw.js +0 -117
- package/dist/shared/chunk-e4mm5e59.js +0 -178
- package/dist/shared/chunk-fqa5bwn1.js +0 -128
- package/dist/shared/chunk-g8hnc95b.js +0 -219
- package/dist/shared/chunk-j2tdpxgc.js +0 -185
- package/dist/shared/chunk-kcnq15je.js +0 -175
- package/dist/shared/chunk-mqs4qq0b.js +0 -46
- package/dist/shared/chunk-pg2yjn8f.js +0 -88
- package/dist/shared/chunk-rb53v045.js +0 -71
- package/dist/shared/chunk-s6a2yph8.js +0 -239
- package/dist/shared/chunk-vhx3sqw6.js +0 -196
- package/dist/shared/chunk-w318par6.js +0 -204
- package/dist/shared/chunk-wcdq7bew.js +0 -133
- package/dist/shared/chunk-z0gwkzgp.js +0 -34
- package/dist/shared/chunk-z850et33.js +0 -161
- package/dist/shared/chunk-zyfc6cx3.js +0 -61
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import {
|
|
2
|
+
saveFocus,
|
|
3
|
+
trapFocus
|
|
4
|
+
} from "./chunk-e2v1c9ex.js";
|
|
5
|
+
import {
|
|
6
|
+
setDataState,
|
|
7
|
+
setExpanded,
|
|
8
|
+
setHidden,
|
|
9
|
+
setHiddenAnimated
|
|
10
|
+
} from "./chunk-vevfhpc9.js";
|
|
11
|
+
import {
|
|
12
|
+
linkedIds
|
|
13
|
+
} from "./chunk-8y1jf6xr.js";
|
|
14
|
+
|
|
15
|
+
// src/alert-dialog/alert-dialog.tsx
|
|
16
|
+
import { __discardMountFrame, __element, __flushMountFrame, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
|
|
17
|
+
import { signal } from "@vertz/ui";
|
|
18
|
+
function AlertDialogTriggerEl(triggerId, contentId, defaultOpen, onClick) {
|
|
19
|
+
const __mfDepth = __pushMountFrame();
|
|
20
|
+
try {
|
|
21
|
+
const __mfResult0 = (() => {
|
|
22
|
+
const __el0 = __element("button");
|
|
23
|
+
__el0.setAttribute("type", "button");
|
|
24
|
+
{
|
|
25
|
+
const __v = triggerId;
|
|
26
|
+
if (__v != null && __v !== false)
|
|
27
|
+
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
28
|
+
}
|
|
29
|
+
{
|
|
30
|
+
const __v = contentId;
|
|
31
|
+
if (__v != null && __v !== false)
|
|
32
|
+
__el0.setAttribute("aria-controls", __v === true ? "" : __v);
|
|
33
|
+
}
|
|
34
|
+
{
|
|
35
|
+
const __v = defaultOpen ? "true" : "false";
|
|
36
|
+
if (__v != null && __v !== false)
|
|
37
|
+
__el0.setAttribute("aria-expanded", __v === true ? "" : __v);
|
|
38
|
+
}
|
|
39
|
+
{
|
|
40
|
+
const __v = defaultOpen ? "open" : "closed";
|
|
41
|
+
if (__v != null && __v !== false)
|
|
42
|
+
__el0.setAttribute("data-state", __v === true ? "" : __v);
|
|
43
|
+
}
|
|
44
|
+
__on(__el0, "click", onClick);
|
|
45
|
+
return __el0;
|
|
46
|
+
})();
|
|
47
|
+
__flushMountFrame();
|
|
48
|
+
return __mfResult0;
|
|
49
|
+
} catch (__mfErr) {
|
|
50
|
+
__discardMountFrame(__mfDepth);
|
|
51
|
+
throw __mfErr;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function AlertDialogOverlayEl(defaultOpen) {
|
|
55
|
+
const __mfDepth = __pushMountFrame();
|
|
56
|
+
try {
|
|
57
|
+
const __mfResult0 = (() => {
|
|
58
|
+
const __el0 = __element("div");
|
|
59
|
+
__el0.setAttribute("data-alertdialog-overlay", "");
|
|
60
|
+
{
|
|
61
|
+
const __v = defaultOpen ? "false" : "true";
|
|
62
|
+
if (__v != null && __v !== false)
|
|
63
|
+
__el0.setAttribute("aria-hidden", __v === true ? "" : __v);
|
|
64
|
+
}
|
|
65
|
+
{
|
|
66
|
+
const __v = defaultOpen ? "open" : "closed";
|
|
67
|
+
if (__v != null && __v !== false)
|
|
68
|
+
__el0.setAttribute("data-state", __v === true ? "" : __v);
|
|
69
|
+
}
|
|
70
|
+
{
|
|
71
|
+
const __v = { display: defaultOpen ? "" : "none" };
|
|
72
|
+
if (__v != null && __v !== false)
|
|
73
|
+
__el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
74
|
+
}
|
|
75
|
+
return __el0;
|
|
76
|
+
})();
|
|
77
|
+
__flushMountFrame();
|
|
78
|
+
return __mfResult0;
|
|
79
|
+
} catch (__mfErr) {
|
|
80
|
+
__discardMountFrame(__mfDepth);
|
|
81
|
+
throw __mfErr;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function AlertDialogContentEl(contentId, titleId, descriptionId, defaultOpen) {
|
|
85
|
+
const __mfDepth = __pushMountFrame();
|
|
86
|
+
try {
|
|
87
|
+
const __mfResult0 = (() => {
|
|
88
|
+
const __el0 = __element("div");
|
|
89
|
+
__el0.setAttribute("role", "alertdialog");
|
|
90
|
+
{
|
|
91
|
+
const __v = contentId;
|
|
92
|
+
if (__v != null && __v !== false)
|
|
93
|
+
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
94
|
+
}
|
|
95
|
+
__el0.setAttribute("aria-modal", "true");
|
|
96
|
+
{
|
|
97
|
+
const __v = titleId;
|
|
98
|
+
if (__v != null && __v !== false)
|
|
99
|
+
__el0.setAttribute("aria-labelledby", __v === true ? "" : __v);
|
|
100
|
+
}
|
|
101
|
+
{
|
|
102
|
+
const __v = descriptionId;
|
|
103
|
+
if (__v != null && __v !== false)
|
|
104
|
+
__el0.setAttribute("aria-describedby", __v === true ? "" : __v);
|
|
105
|
+
}
|
|
106
|
+
{
|
|
107
|
+
const __v = defaultOpen ? "false" : "true";
|
|
108
|
+
if (__v != null && __v !== false)
|
|
109
|
+
__el0.setAttribute("aria-hidden", __v === true ? "" : __v);
|
|
110
|
+
}
|
|
111
|
+
{
|
|
112
|
+
const __v = defaultOpen ? "open" : "closed";
|
|
113
|
+
if (__v != null && __v !== false)
|
|
114
|
+
__el0.setAttribute("data-state", __v === true ? "" : __v);
|
|
115
|
+
}
|
|
116
|
+
{
|
|
117
|
+
const __v = { display: defaultOpen ? "" : "none" };
|
|
118
|
+
if (__v != null && __v !== false)
|
|
119
|
+
__el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
120
|
+
}
|
|
121
|
+
return __el0;
|
|
122
|
+
})();
|
|
123
|
+
__flushMountFrame();
|
|
124
|
+
return __mfResult0;
|
|
125
|
+
} catch (__mfErr) {
|
|
126
|
+
__discardMountFrame(__mfDepth);
|
|
127
|
+
throw __mfErr;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function AlertDialogTitleEl(titleId) {
|
|
131
|
+
const __mfDepth = __pushMountFrame();
|
|
132
|
+
try {
|
|
133
|
+
const __mfResult0 = (() => {
|
|
134
|
+
const __el0 = __element("h2");
|
|
135
|
+
{
|
|
136
|
+
const __v = titleId;
|
|
137
|
+
if (__v != null && __v !== false)
|
|
138
|
+
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
139
|
+
}
|
|
140
|
+
return __el0;
|
|
141
|
+
})();
|
|
142
|
+
__flushMountFrame();
|
|
143
|
+
return __mfResult0;
|
|
144
|
+
} catch (__mfErr) {
|
|
145
|
+
__discardMountFrame(__mfDepth);
|
|
146
|
+
throw __mfErr;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function AlertDialogDescriptionEl(descriptionId) {
|
|
150
|
+
const __mfDepth = __pushMountFrame();
|
|
151
|
+
try {
|
|
152
|
+
const __mfResult0 = (() => {
|
|
153
|
+
const __el0 = __element("p");
|
|
154
|
+
{
|
|
155
|
+
const __v = descriptionId;
|
|
156
|
+
if (__v != null && __v !== false)
|
|
157
|
+
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
158
|
+
}
|
|
159
|
+
return __el0;
|
|
160
|
+
})();
|
|
161
|
+
__flushMountFrame();
|
|
162
|
+
return __mfResult0;
|
|
163
|
+
} catch (__mfErr) {
|
|
164
|
+
__discardMountFrame(__mfDepth);
|
|
165
|
+
throw __mfErr;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function AlertDialogCancelBtn(onClick) {
|
|
169
|
+
const __mfDepth = __pushMountFrame();
|
|
170
|
+
try {
|
|
171
|
+
const __mfResult0 = (() => {
|
|
172
|
+
const __el0 = __element("button");
|
|
173
|
+
__el0.setAttribute("type", "button");
|
|
174
|
+
__on(__el0, "click", onClick);
|
|
175
|
+
return __el0;
|
|
176
|
+
})();
|
|
177
|
+
__flushMountFrame();
|
|
178
|
+
return __mfResult0;
|
|
179
|
+
} catch (__mfErr) {
|
|
180
|
+
__discardMountFrame(__mfDepth);
|
|
181
|
+
throw __mfErr;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function AlertDialogActionBtn(onClick) {
|
|
185
|
+
const __mfDepth = __pushMountFrame();
|
|
186
|
+
try {
|
|
187
|
+
const __mfResult0 = (() => {
|
|
188
|
+
const __el0 = __element("button");
|
|
189
|
+
__el0.setAttribute("type", "button");
|
|
190
|
+
__on(__el0, "click", onClick);
|
|
191
|
+
return __el0;
|
|
192
|
+
})();
|
|
193
|
+
__flushMountFrame();
|
|
194
|
+
return __mfResult0;
|
|
195
|
+
} catch (__mfErr) {
|
|
196
|
+
__discardMountFrame(__mfDepth);
|
|
197
|
+
throw __mfErr;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function AlertDialogRoot(options = {}) {
|
|
201
|
+
const { defaultOpen = false, onOpenChange, onAction } = options;
|
|
202
|
+
const ids = linkedIds("alertdialog");
|
|
203
|
+
const titleId = `${ids.contentId}-title`;
|
|
204
|
+
const descriptionId = `${ids.contentId}-description`;
|
|
205
|
+
const state = { open: signal(defaultOpen) };
|
|
206
|
+
let restoreFocus = null;
|
|
207
|
+
let removeTrap = null;
|
|
208
|
+
function show() {
|
|
209
|
+
if (state.open.peek())
|
|
210
|
+
return;
|
|
211
|
+
state.open.value = true;
|
|
212
|
+
setExpanded(trigger, true);
|
|
213
|
+
setHidden(overlay, false);
|
|
214
|
+
setHidden(content, false);
|
|
215
|
+
setDataState(trigger, "open");
|
|
216
|
+
setDataState(overlay, "open");
|
|
217
|
+
setDataState(content, "open");
|
|
218
|
+
restoreFocus = saveFocus();
|
|
219
|
+
removeTrap = trapFocus(content);
|
|
220
|
+
queueMicrotask(() => cancel.focus());
|
|
221
|
+
onOpenChange?.(true);
|
|
222
|
+
}
|
|
223
|
+
function hide() {
|
|
224
|
+
if (!state.open.peek())
|
|
225
|
+
return;
|
|
226
|
+
state.open.value = false;
|
|
227
|
+
setExpanded(trigger, false);
|
|
228
|
+
setDataState(trigger, "closed");
|
|
229
|
+
setDataState(overlay, "closed");
|
|
230
|
+
setDataState(content, "closed");
|
|
231
|
+
setHiddenAnimated(overlay, true);
|
|
232
|
+
setHiddenAnimated(content, true);
|
|
233
|
+
removeTrap?.();
|
|
234
|
+
removeTrap = null;
|
|
235
|
+
restoreFocus?.();
|
|
236
|
+
restoreFocus = null;
|
|
237
|
+
onOpenChange?.(false);
|
|
238
|
+
}
|
|
239
|
+
const trigger = AlertDialogTriggerEl(ids.triggerId, ids.contentId, defaultOpen, show);
|
|
240
|
+
const overlay = AlertDialogOverlayEl(defaultOpen);
|
|
241
|
+
const content = AlertDialogContentEl(ids.contentId, titleId, descriptionId, defaultOpen);
|
|
242
|
+
const title = AlertDialogTitleEl(titleId);
|
|
243
|
+
const description = AlertDialogDescriptionEl(descriptionId);
|
|
244
|
+
const cancel = AlertDialogCancelBtn(() => hide());
|
|
245
|
+
const action = AlertDialogActionBtn(() => {
|
|
246
|
+
onAction?.();
|
|
247
|
+
hide();
|
|
248
|
+
});
|
|
249
|
+
if (defaultOpen) {
|
|
250
|
+
restoreFocus = saveFocus();
|
|
251
|
+
removeTrap = trapFocus(content);
|
|
252
|
+
queueMicrotask(() => cancel.focus());
|
|
253
|
+
}
|
|
254
|
+
return { trigger, overlay, content, title, description, cancel, action, state, show, hide };
|
|
255
|
+
}
|
|
256
|
+
var AlertDialog = {
|
|
257
|
+
Root: AlertDialogRoot
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
export { AlertDialog };
|
|
@@ -0,0 +1,180 @@
|
|
|
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-vevfhpc9.js";
|
|
16
|
+
import {
|
|
17
|
+
linkedIds
|
|
18
|
+
} from "./chunk-8y1jf6xr.js";
|
|
19
|
+
|
|
20
|
+
// src/sheet/sheet.tsx
|
|
21
|
+
import { __discardMountFrame, __element, __flushMountFrame, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
|
|
22
|
+
import { signal } from "@vertz/ui";
|
|
23
|
+
function SheetRoot(options = {}) {
|
|
24
|
+
const __mfDepth = __pushMountFrame();
|
|
25
|
+
try {
|
|
26
|
+
let show = function() {
|
|
27
|
+
state.open.value = true;
|
|
28
|
+
setExpanded(trigger, true);
|
|
29
|
+
setHidden(overlay, false);
|
|
30
|
+
setHidden(content, false);
|
|
31
|
+
setDataState(trigger, "open");
|
|
32
|
+
setDataState(overlay, "open");
|
|
33
|
+
setDataState(content, "open");
|
|
34
|
+
restoreFocus = saveFocus();
|
|
35
|
+
removeTrap = trapFocus(content);
|
|
36
|
+
queueMicrotask(() => focusFirst(content));
|
|
37
|
+
onOpenChange?.(true);
|
|
38
|
+
}, hide = function() {
|
|
39
|
+
state.open.value = false;
|
|
40
|
+
setExpanded(trigger, false);
|
|
41
|
+
setDataState(trigger, "closed");
|
|
42
|
+
setDataState(overlay, "closed");
|
|
43
|
+
setDataState(content, "closed");
|
|
44
|
+
setHiddenAnimated(overlay, true);
|
|
45
|
+
setHiddenAnimated(content, true);
|
|
46
|
+
removeTrap?.();
|
|
47
|
+
removeTrap = null;
|
|
48
|
+
restoreFocus?.();
|
|
49
|
+
restoreFocus = null;
|
|
50
|
+
onOpenChange?.(false);
|
|
51
|
+
}, handlePointerDown = function(e) {
|
|
52
|
+
startX = e.clientX;
|
|
53
|
+
startY = e.clientY;
|
|
54
|
+
}, handlePointerUp = function(e) {
|
|
55
|
+
if (!state.open.peek())
|
|
56
|
+
return;
|
|
57
|
+
const deltaX = e.clientX - startX;
|
|
58
|
+
const deltaY = e.clientY - startY;
|
|
59
|
+
const shouldDismiss = side === "right" && deltaX >= SWIPE_THRESHOLD || side === "left" && deltaX <= -SWIPE_THRESHOLD || side === "bottom" && deltaY >= SWIPE_THRESHOLD || side === "top" && deltaY <= -SWIPE_THRESHOLD;
|
|
60
|
+
if (shouldDismiss) {
|
|
61
|
+
hide();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const { side = "right", defaultOpen = false, onOpenChange } = options;
|
|
65
|
+
const ids = linkedIds("sheet");
|
|
66
|
+
const state = { open: signal(defaultOpen) };
|
|
67
|
+
let restoreFocus = null;
|
|
68
|
+
let removeTrap = null;
|
|
69
|
+
const SWIPE_THRESHOLD = 50;
|
|
70
|
+
let startX = 0;
|
|
71
|
+
let startY = 0;
|
|
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
|
+
{
|
|
86
|
+
const __v = defaultOpen ? "true" : "false";
|
|
87
|
+
if (__v != null && __v !== false)
|
|
88
|
+
__el0.setAttribute("aria-expanded", __v === true ? "" : __v);
|
|
89
|
+
}
|
|
90
|
+
{
|
|
91
|
+
const __v = defaultOpen ? "open" : "closed";
|
|
92
|
+
if (__v != null && __v !== false)
|
|
93
|
+
__el0.setAttribute("data-state", __v === true ? "" : __v);
|
|
94
|
+
}
|
|
95
|
+
__on(__el0, "click", () => {
|
|
96
|
+
state.open.peek() ? hide() : show();
|
|
97
|
+
});
|
|
98
|
+
return __el0;
|
|
99
|
+
})();
|
|
100
|
+
const overlay = (() => {
|
|
101
|
+
const __el1 = __element("div");
|
|
102
|
+
__el1.setAttribute("data-sheet-overlay", "");
|
|
103
|
+
{
|
|
104
|
+
const __v = defaultOpen ? "false" : "true";
|
|
105
|
+
if (__v != null && __v !== false)
|
|
106
|
+
__el1.setAttribute("aria-hidden", __v === true ? "" : __v);
|
|
107
|
+
}
|
|
108
|
+
{
|
|
109
|
+
const __v = defaultOpen ? "open" : "closed";
|
|
110
|
+
if (__v != null && __v !== false)
|
|
111
|
+
__el1.setAttribute("data-state", __v === true ? "" : __v);
|
|
112
|
+
}
|
|
113
|
+
{
|
|
114
|
+
const __v = { display: defaultOpen ? "" : "none" };
|
|
115
|
+
if (__v != null && __v !== false)
|
|
116
|
+
__el1.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
117
|
+
}
|
|
118
|
+
__on(__el1, "click", () => hide());
|
|
119
|
+
return __el1;
|
|
120
|
+
})();
|
|
121
|
+
const content = (() => {
|
|
122
|
+
const __el2 = __element("div");
|
|
123
|
+
__el2.setAttribute("role", "dialog");
|
|
124
|
+
__el2.setAttribute("aria-modal", "true");
|
|
125
|
+
{
|
|
126
|
+
const __v = ids.contentId;
|
|
127
|
+
if (__v != null && __v !== false)
|
|
128
|
+
__el2.setAttribute("id", __v === true ? "" : __v);
|
|
129
|
+
}
|
|
130
|
+
{
|
|
131
|
+
const __v = side;
|
|
132
|
+
if (__v != null && __v !== false)
|
|
133
|
+
__el2.setAttribute("data-side", __v === true ? "" : __v);
|
|
134
|
+
}
|
|
135
|
+
{
|
|
136
|
+
const __v = defaultOpen ? "false" : "true";
|
|
137
|
+
if (__v != null && __v !== false)
|
|
138
|
+
__el2.setAttribute("aria-hidden", __v === true ? "" : __v);
|
|
139
|
+
}
|
|
140
|
+
{
|
|
141
|
+
const __v = defaultOpen ? "open" : "closed";
|
|
142
|
+
if (__v != null && __v !== false)
|
|
143
|
+
__el2.setAttribute("data-state", __v === true ? "" : __v);
|
|
144
|
+
}
|
|
145
|
+
{
|
|
146
|
+
const __v = { display: defaultOpen ? "" : "none" };
|
|
147
|
+
if (__v != null && __v !== false)
|
|
148
|
+
__el2.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
149
|
+
}
|
|
150
|
+
__on(__el2, "keydown", (event) => {
|
|
151
|
+
if (isKey(event, Keys.Escape)) {
|
|
152
|
+
event.preventDefault();
|
|
153
|
+
event.stopPropagation();
|
|
154
|
+
hide();
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
__on(__el2, "pointerdown", handlePointerDown);
|
|
158
|
+
__on(__el2, "pointerup", handlePointerUp);
|
|
159
|
+
return __el2;
|
|
160
|
+
})();
|
|
161
|
+
const close = (() => {
|
|
162
|
+
const __el3 = __element("button");
|
|
163
|
+
__el3.setAttribute("type", "button");
|
|
164
|
+
__el3.setAttribute("aria-label", "Close");
|
|
165
|
+
__on(__el3, "click", () => hide());
|
|
166
|
+
return __el3;
|
|
167
|
+
})();
|
|
168
|
+
const __mfResult0 = { trigger, overlay, content, close, state, show, hide };
|
|
169
|
+
__flushMountFrame();
|
|
170
|
+
return __mfResult0;
|
|
171
|
+
} catch (__mfErr) {
|
|
172
|
+
__discardMountFrame(__mfDepth);
|
|
173
|
+
throw __mfErr;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
var Sheet = {
|
|
177
|
+
Root: SheetRoot
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export { Sheet };
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-2db2dnp3.js";
|
|
4
4
|
|
|
5
5
|
// src/calendar/calendar.tsx
|
|
6
|
-
import { __element, __enterChildren, __exitChildren, __insert, __on } from "@vertz/ui/internals";
|
|
6
|
+
import { __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __insert, __on, __pushMountFrame } from "@vertz/ui/internals";
|
|
7
7
|
import { signal } from "@vertz/ui";
|
|
8
8
|
var MONTH_NAMES = [
|
|
9
9
|
"January",
|
|
@@ -37,47 +37,87 @@ function addMonths(date, months) {
|
|
|
37
37
|
return result;
|
|
38
38
|
}
|
|
39
39
|
function CalendarTitleEl() {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
const __mfDepth = __pushMountFrame();
|
|
41
|
+
try {
|
|
42
|
+
const __mfResult0 = (() => {
|
|
43
|
+
const __el0 = __element("div");
|
|
44
|
+
return __el0;
|
|
45
|
+
})();
|
|
46
|
+
__flushMountFrame();
|
|
47
|
+
return __mfResult0;
|
|
48
|
+
} catch (__mfErr) {
|
|
49
|
+
__discardMountFrame(__mfDepth);
|
|
50
|
+
throw __mfErr;
|
|
51
|
+
}
|
|
44
52
|
}
|
|
45
53
|
function CalendarNavButton(onClick) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
const __mfDepth = __pushMountFrame();
|
|
55
|
+
try {
|
|
56
|
+
const __mfResult0 = (() => {
|
|
57
|
+
const __el0 = __element("button");
|
|
58
|
+
__el0.setAttribute("type", "button");
|
|
59
|
+
__on(__el0, "click", onClick);
|
|
60
|
+
return __el0;
|
|
61
|
+
})();
|
|
62
|
+
__flushMountFrame();
|
|
63
|
+
return __mfResult0;
|
|
64
|
+
} catch (__mfErr) {
|
|
65
|
+
__discardMountFrame(__mfDepth);
|
|
66
|
+
throw __mfErr;
|
|
67
|
+
}
|
|
52
68
|
}
|
|
53
69
|
function CalendarHeaderEl(prevButton, title, nextButton) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
70
|
+
const __mfDepth = __pushMountFrame();
|
|
71
|
+
try {
|
|
72
|
+
const __mfResult0 = (() => {
|
|
73
|
+
const __el0 = __element("div");
|
|
74
|
+
__enterChildren(__el0);
|
|
75
|
+
__insert(__el0, prevButton);
|
|
76
|
+
__insert(__el0, title);
|
|
77
|
+
__insert(__el0, nextButton);
|
|
78
|
+
__exitChildren();
|
|
79
|
+
return __el0;
|
|
80
|
+
})();
|
|
81
|
+
__flushMountFrame();
|
|
82
|
+
return __mfResult0;
|
|
83
|
+
} catch (__mfErr) {
|
|
84
|
+
__discardMountFrame(__mfDepth);
|
|
85
|
+
throw __mfErr;
|
|
86
|
+
}
|
|
63
87
|
}
|
|
64
88
|
function CalendarGridEl(onKeydown) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
89
|
+
const __mfDepth = __pushMountFrame();
|
|
90
|
+
try {
|
|
91
|
+
const __mfResult0 = (() => {
|
|
92
|
+
const __el0 = __element("table");
|
|
93
|
+
__el0.setAttribute("role", "grid");
|
|
94
|
+
__on(__el0, "keydown", onKeydown);
|
|
95
|
+
return __el0;
|
|
96
|
+
})();
|
|
97
|
+
__flushMountFrame();
|
|
98
|
+
return __mfResult0;
|
|
99
|
+
} catch (__mfErr) {
|
|
100
|
+
__discardMountFrame(__mfDepth);
|
|
101
|
+
throw __mfErr;
|
|
102
|
+
}
|
|
71
103
|
}
|
|
72
104
|
function CalendarRootEl(header, grid) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
105
|
+
const __mfDepth = __pushMountFrame();
|
|
106
|
+
try {
|
|
107
|
+
const __mfResult0 = (() => {
|
|
108
|
+
const __el0 = __element("div");
|
|
109
|
+
__enterChildren(__el0);
|
|
110
|
+
__insert(__el0, header);
|
|
111
|
+
__insert(__el0, grid);
|
|
112
|
+
__exitChildren();
|
|
113
|
+
return __el0;
|
|
114
|
+
})();
|
|
115
|
+
__flushMountFrame();
|
|
116
|
+
return __mfResult0;
|
|
117
|
+
} catch (__mfErr) {
|
|
118
|
+
__discardMountFrame(__mfDepth);
|
|
119
|
+
throw __mfErr;
|
|
120
|
+
}
|
|
81
121
|
}
|
|
82
122
|
function CalendarRoot(options = {}) {
|
|
83
123
|
const {
|