@vertz/ui-primitives 0.2.38 → 0.2.42
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-06m8prfg.js +52 -0
- package/dist/shared/chunk-0n9jj8xr.js +24 -0
- package/dist/shared/chunk-1ben27xq.js +317 -0
- package/dist/shared/chunk-1j2mj0sa.js +45 -0
- package/dist/shared/chunk-250hj18f.js +243 -0
- package/dist/shared/chunk-2h4m9c71.js +38 -0
- package/dist/shared/chunk-2sbx20hv.js +128 -0
- package/dist/shared/chunk-2ye674gr.js +70 -0
- package/dist/shared/chunk-34d8385y.js +15 -0
- package/dist/shared/chunk-4d7bm8h0.js +113 -0
- package/dist/shared/chunk-4zjgxr7x.js +157 -0
- package/dist/shared/chunk-5c150wvr.js +140 -0
- package/dist/shared/chunk-5gycdypd.js +58 -0
- package/dist/shared/chunk-6mm7fhp8.js +105 -0
- package/dist/shared/chunk-6zmnqvh6.js +109 -0
- package/dist/shared/{chunk-yy3ft5mb.js → chunk-7amn5d71.js} +2 -2
- package/dist/shared/chunk-7pbff2hg.js +118 -0
- package/dist/shared/chunk-7zpjshwz.js +194 -0
- package/dist/shared/chunk-993ff51d.js +155 -0
- package/dist/shared/chunk-9pdt5aw7.js +24 -0
- package/dist/shared/chunk-a71m4xkv.js +106 -0
- package/dist/shared/chunk-aj8m39pk.js +127 -0
- package/dist/shared/chunk-ajawpc05.js +305 -0
- package/dist/shared/chunk-b7mzwqhj.js +125 -0
- package/dist/shared/chunk-bb887de4.js +200 -0
- package/dist/shared/chunk-bfsmbrxc.js +111 -0
- package/dist/shared/chunk-c2f63m5n.js +56 -0
- package/dist/shared/chunk-c5r3s5km.js +263 -0
- package/dist/shared/chunk-caba5bhd.js +427 -0
- package/dist/shared/chunk-crym07yc.js +264 -0
- package/dist/shared/{chunk-5964gmv0.js → chunk-csjtyvam.js} +62 -88
- package/dist/shared/chunk-d6rtejz3.js +128 -0
- package/dist/shared/chunk-dvaf0bmq.js +140 -0
- package/dist/shared/chunk-dwkv9ya6.js +22 -0
- package/dist/shared/chunk-e0ckxrjg.js +41 -0
- package/dist/shared/chunk-ennxcymj.js +225 -0
- package/dist/shared/{chunk-1jd1n0dt.js → chunk-ey38de46.js} +19 -47
- package/dist/shared/chunk-f0v1gs5e.js +52 -0
- package/dist/shared/chunk-f86rsf84.js +231 -0
- package/dist/shared/chunk-fdse46x5.js +21 -0
- package/dist/shared/chunk-gj4hrssn.js +135 -0
- package/dist/shared/chunk-gyvq4gk9.js +24 -0
- package/dist/shared/chunk-hbnps9sq.js +229 -0
- package/dist/shared/{chunk-fhss32ya.js → chunk-hdmpyeq9.js} +43 -132
- package/dist/shared/chunk-hgnkd4he.js +256 -0
- package/dist/shared/chunk-hpcyffm7.js +185 -0
- package/dist/shared/chunk-hpmvwx0h.js +99 -0
- package/dist/shared/chunk-hz0e504p.js +69 -0
- package/dist/shared/chunk-hzk4wfq9.js +43 -0
- package/dist/shared/chunk-j7znzkpa.js +48 -0
- package/dist/shared/chunk-j9kxgrnn.js +167 -0
- package/dist/shared/chunk-jetwnv0w.js +130 -0
- package/dist/shared/chunk-jjdg26c1.js +155 -0
- package/dist/shared/chunk-k0m4yh86.js +123 -0
- package/dist/shared/chunk-k43q9cjr.js +82 -0
- package/dist/shared/chunk-k9k8tbr5.js +119 -0
- package/dist/shared/chunk-meaj7br1.js +232 -0
- package/dist/shared/chunk-mgj0n08k.js +34 -0
- package/dist/shared/chunk-mjz4rp6c.js +46 -0
- package/dist/shared/chunk-n4rr5gme.js +239 -0
- package/dist/shared/chunk-nk55etpp.js +65 -0
- package/dist/shared/chunk-nkh1ks3k.js +264 -0
- package/dist/shared/chunk-pgvpvbpe.js +26 -0
- package/dist/shared/chunk-pma8gnv7.js +178 -0
- package/dist/shared/chunk-q7xv6xze.js +131 -0
- package/dist/shared/chunk-qey801nq.js +22 -0
- package/dist/shared/chunk-s6b4c3tj.js +58 -0
- package/dist/shared/chunk-sq27a4h0.js +36 -0
- package/dist/shared/chunk-taa5pj15.js +103 -0
- package/dist/shared/chunk-tc5rpvyx.js +127 -0
- package/dist/shared/chunk-tescm0b3.js +192 -0
- package/dist/shared/chunk-tkftdwnq.js +71 -0
- package/dist/shared/chunk-tqhnjcfp.js +116 -0
- package/dist/shared/chunk-vfknb5ht.js +183 -0
- package/dist/shared/chunk-vsc369w3.js +185 -0
- package/dist/shared/chunk-whq9s8v5.js +301 -0
- package/dist/shared/{chunk-hze1f32t.js → chunk-wrqddgaj.js} +1 -1
- package/dist/shared/chunk-yzbmkx4r.js +155 -0
- package/dist/shared/chunk-zaen0ajc.js +347 -0
- package/dist/src/accordion/accordion-composed.js +1 -1
- package/dist/src/accordion/accordion.js +1 -1
- package/dist/src/alert/alert-composed.js +1 -1
- package/dist/src/alert-dialog/alert-dialog-composed.js +1 -1
- package/dist/src/alert-dialog/alert-dialog.js +1 -1
- package/dist/src/avatar/avatar-composed.js +1 -1
- package/dist/src/badge/badge-composed.js +1 -1
- package/dist/src/badge/badge.js +1 -1
- package/dist/src/breadcrumb/breadcrumb-composed.js +1 -1
- package/dist/src/button/button-composed.js +1 -1
- package/dist/src/button/button.js +1 -1
- package/dist/src/calendar/calendar-composed.js +1 -1
- package/dist/src/calendar/calendar.js +1 -1
- package/dist/src/card/card-composed.js +1 -1
- package/dist/src/carousel/carousel-composed.js +1 -1
- package/dist/src/carousel/carousel.js +1 -1
- package/dist/src/checkbox/checkbox-composed.js +1 -1
- package/dist/src/checkbox/checkbox.js +1 -1
- package/dist/src/collapsible/collapsible-composed.js +1 -1
- package/dist/src/collapsible/collapsible.js +1 -1
- package/dist/src/combobox/combobox-composed.js +1 -1
- package/dist/src/combobox/combobox.js +1 -1
- package/dist/src/command/command-composed.js +1 -1
- package/dist/src/command/command.js +1 -1
- package/dist/src/composed/with-styles.js +1 -1
- package/dist/src/context-menu/context-menu-composed.js +1 -1
- package/dist/src/context-menu/context-menu.js +1 -1
- package/dist/src/date-picker/date-picker-composed.js +1 -1
- package/dist/src/date-picker/date-picker.js +1 -1
- package/dist/src/dialog/dialog-composed.js +1 -1
- package/dist/src/dialog/dialog-stack-parts.js +1 -1
- package/dist/src/dialog/dialog.js +1 -1
- package/dist/src/dropdown-menu/dropdown-menu-composed.js +1 -1
- package/dist/src/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/src/empty-state/empty-state-composed.js +1 -1
- package/dist/src/form-group/form-group-composed.js +1 -1
- package/dist/src/hover-card/hover-card-composed.js +1 -1
- package/dist/src/hover-card/hover-card.js +1 -1
- package/dist/src/input/input-composed.js +1 -1
- package/dist/src/label/label-composed.js +1 -1
- package/dist/src/list/list-composed.js +1 -1
- package/dist/src/menu/menu-composed.js +1 -1
- package/dist/src/menu/menu.js +1 -1
- package/dist/src/menubar/menubar-composed.js +1 -1
- package/dist/src/menubar/menubar.js +1 -1
- package/dist/src/navigation-menu/navigation-menu-composed.js +1 -1
- package/dist/src/navigation-menu/navigation-menu.js +1 -1
- package/dist/src/pagination/pagination-composed.js +1 -1
- package/dist/src/popover/popover-composed.js +1 -1
- package/dist/src/popover/popover.js +1 -1
- package/dist/src/progress/progress-composed.js +1 -1
- package/dist/src/progress/progress.js +1 -1
- package/dist/src/radio/radio-composed.js +1 -1
- package/dist/src/radio/radio.js +1 -1
- package/dist/src/resizable-panel/resizable-panel-composed.js +1 -1
- package/dist/src/resizable-panel/resizable-panel.js +1 -1
- package/dist/src/scroll-area/scroll-area-composed.js +1 -1
- package/dist/src/scroll-area/scroll-area.js +1 -1
- package/dist/src/select/select-composed.js +1 -1
- package/dist/src/select/select.js +1 -1
- package/dist/src/separator/separator-composed.js +1 -1
- package/dist/src/sheet/sheet-composed.js +1 -1
- package/dist/src/sheet/sheet.js +1 -1
- package/dist/src/skeleton/skeleton-composed.js +1 -1
- package/dist/src/slider/slider-composed.js +1 -1
- package/dist/src/slider/slider.js +1 -1
- package/dist/src/switch/switch-composed.js +1 -1
- package/dist/src/switch/switch.js +1 -1
- package/dist/src/table/table-composed.js +1 -1
- package/dist/src/tabs/tabs-composed.js +1 -1
- package/dist/src/tabs/tabs.js +1 -1
- package/dist/src/textarea/textarea-composed.js +1 -1
- package/dist/src/toast/toast.js +1 -1
- package/dist/src/toggle/toggle-composed.js +1 -1
- package/dist/src/toggle/toggle.js +1 -1
- package/dist/src/toggle-group/toggle-group-composed.js +1 -1
- package/dist/src/toggle-group/toggle-group.js +1 -1
- package/dist/src/tooltip/tooltip-composed.js +1 -1
- package/dist/src/tooltip/tooltip.js +1 -1
- package/package.json +3 -3
- package/dist/shared/chunk-144kbnmx.js +0 -95
- package/dist/shared/chunk-1ewxfgsa.js +0 -167
- package/dist/shared/chunk-1hm0mbke.js +0 -258
- package/dist/shared/chunk-22rt6ws9.js +0 -69
- package/dist/shared/chunk-2ssqz188.js +0 -162
- package/dist/shared/chunk-33he7ay9.js +0 -218
- package/dist/shared/chunk-3jack97k.js +0 -509
- package/dist/shared/chunk-75pegjs7.js +0 -26
- package/dist/shared/chunk-862x7dja.js +0 -398
- package/dist/shared/chunk-8pk1pn5h.js +0 -215
- package/dist/shared/chunk-8t0nm721.js +0 -152
- package/dist/shared/chunk-94twh4s4.js +0 -28
- package/dist/shared/chunk-9yb26c0w.js +0 -232
- package/dist/shared/chunk-a82r2pnq.js +0 -67
- package/dist/shared/chunk-axpbdpgx.js +0 -177
- package/dist/shared/chunk-b3j6mym6.js +0 -203
- package/dist/shared/chunk-b4zzg457.js +0 -410
- package/dist/shared/chunk-b9qxfcsy.js +0 -60
- package/dist/shared/chunk-bc2qqkhr.js +0 -194
- package/dist/shared/chunk-bv12nkdm.js +0 -149
- package/dist/shared/chunk-bvxc1ww4.js +0 -164
- package/dist/shared/chunk-czv0kqj4.js +0 -107
- package/dist/shared/chunk-d83ag07h.js +0 -189
- package/dist/shared/chunk-de18ashk.js +0 -134
- package/dist/shared/chunk-dvk4h36t.js +0 -140
- package/dist/shared/chunk-dxvnerw2.js +0 -353
- package/dist/shared/chunk-e399pzdq.js +0 -241
- package/dist/shared/chunk-e4qha9as.js +0 -180
- package/dist/shared/chunk-eb2d9v6k.js +0 -68
- package/dist/shared/chunk-ect26sp5.js +0 -353
- package/dist/shared/chunk-ev367pq3.js +0 -102
- package/dist/shared/chunk-fjykbv0v.js +0 -214
- package/dist/shared/chunk-gdddk6nh.js +0 -96
- package/dist/shared/chunk-ghkw5bjq.js +0 -55
- package/dist/shared/chunk-hfjtkytb.js +0 -310
- package/dist/shared/chunk-hpvjfj0j.js +0 -31
- package/dist/shared/chunk-jpyjk616.js +0 -52
- package/dist/shared/chunk-k6d53tne.js +0 -206
- package/dist/shared/chunk-knzg86am.js +0 -168
- package/dist/shared/chunk-ktbf6xrt.js +0 -179
- package/dist/shared/chunk-m8y2p66x.js +0 -252
- package/dist/shared/chunk-metxdt5x.js +0 -28
- package/dist/shared/chunk-mgae1d93.js +0 -157
- package/dist/shared/chunk-mtx2cfbx.js +0 -175
- package/dist/shared/chunk-n436p5cb.js +0 -260
- package/dist/shared/chunk-nj420k31.js +0 -54
- package/dist/shared/chunk-nsmvdxgp.js +0 -213
- package/dist/shared/chunk-pcms04vq.js +0 -162
- package/dist/shared/chunk-pqskzq8t.js +0 -79
- package/dist/shared/chunk-pwr60kyd.js +0 -321
- package/dist/shared/chunk-pzknpa1y.js +0 -327
- package/dist/shared/chunk-q77y3rg4.js +0 -189
- package/dist/shared/chunk-qhnany7w.js +0 -179
- package/dist/shared/chunk-r3pffzss.js +0 -13
- package/dist/shared/chunk-rdr0rtpr.js +0 -131
- package/dist/shared/chunk-rj52ty6r.js +0 -147
- package/dist/shared/chunk-rnqc7735.js +0 -125
- package/dist/shared/chunk-rtk30950.js +0 -202
- package/dist/shared/chunk-s0xgd8vg.js +0 -266
- package/dist/shared/chunk-s415735j.js +0 -357
- package/dist/shared/chunk-s62e7jf4.js +0 -30
- package/dist/shared/chunk-snd8e6r8.js +0 -418
- package/dist/shared/chunk-spng4yb9.js +0 -73
- package/dist/shared/chunk-t887wwjc.js +0 -168
- package/dist/shared/chunk-tn0m98j8.js +0 -42
- package/dist/shared/chunk-v0b5pkcq.js +0 -30
- package/dist/shared/chunk-v5tj7veh.js +0 -284
- package/dist/shared/chunk-vkscwzpr.js +0 -294
- package/dist/shared/chunk-vv187snj.js +0 -112
- package/dist/shared/chunk-xv4wd0kf.js +0 -293
- package/dist/shared/chunk-y1hpsqzy.js +0 -185
- package/dist/shared/chunk-yfzddvxc.js +0 -71
- package/dist/shared/chunk-yzgzx2dh.js +0 -311
- package/dist/shared/chunk-z5j7ztf2.js +0 -467
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cn
|
|
3
|
-
} from "./chunk-q7xbcj9q.js";
|
|
4
|
-
|
|
5
|
-
// src/scroll-area/scroll-area-composed.tsx
|
|
6
|
-
import { computed } from "@vertz/ui";
|
|
7
|
-
import { __append, __attr, __child, __conditional, __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
|
|
8
|
-
import { ref } from "@vertz/ui";
|
|
9
|
-
function ComposedScrollAreaRoot(__props) {
|
|
10
|
-
const __mfDepth = __pushMountFrame();
|
|
11
|
-
try {
|
|
12
|
-
let syncThumbY = function() {
|
|
13
|
-
const vp = viewportRef.current;
|
|
14
|
-
const thumb = thumbYRef.current;
|
|
15
|
-
if (!vp || !thumb)
|
|
16
|
-
return;
|
|
17
|
-
const { scrollTop, scrollHeight, clientHeight } = vp;
|
|
18
|
-
if (scrollHeight <= clientHeight) {
|
|
19
|
-
thumb.style.height = "0";
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
const ratio = clientHeight / scrollHeight;
|
|
23
|
-
thumb.style.height = `${ratio * 100}%`;
|
|
24
|
-
const scrollRatio = scrollTop / (scrollHeight - clientHeight);
|
|
25
|
-
thumb.style.transform = `translateY(${scrollRatio * (1 / ratio - 1) * 100}%)`;
|
|
26
|
-
}, syncThumbX = function() {
|
|
27
|
-
const vp = viewportRef.current;
|
|
28
|
-
const thumb = thumbXRef.current;
|
|
29
|
-
if (!vp || !thumb)
|
|
30
|
-
return;
|
|
31
|
-
const { scrollLeft, scrollWidth, clientWidth } = vp;
|
|
32
|
-
if (scrollWidth <= clientWidth) {
|
|
33
|
-
thumb.style.width = "0";
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const ratio = clientWidth / scrollWidth;
|
|
37
|
-
thumb.style.width = `${ratio * 100}%`;
|
|
38
|
-
const scrollRatio = scrollLeft / (scrollWidth - clientWidth);
|
|
39
|
-
thumb.style.transform = `translateX(${scrollRatio * (1 / ratio - 1) * 100}%)`;
|
|
40
|
-
}, handleViewportScroll = function() {
|
|
41
|
-
if ((__props.orientation ?? "vertical") === "vertical" || (__props.orientation ?? "vertical") === "both")
|
|
42
|
-
syncThumbY();
|
|
43
|
-
if ((__props.orientation ?? "vertical") === "horizontal" || (__props.orientation ?? "vertical") === "both")
|
|
44
|
-
syncThumbX();
|
|
45
|
-
}, handleThumbYDown = function(e) {
|
|
46
|
-
const vp = viewportRef.current;
|
|
47
|
-
const thumb = thumbYRef.current;
|
|
48
|
-
if (!vp || !thumb)
|
|
49
|
-
return;
|
|
50
|
-
isDraggingY = true;
|
|
51
|
-
startY = e.clientY;
|
|
52
|
-
startScrollTop = vp.scrollTop;
|
|
53
|
-
thumb.setPointerCapture(e.pointerId);
|
|
54
|
-
e.preventDefault();
|
|
55
|
-
}, handleThumbYMove = function(e) {
|
|
56
|
-
if (!isDraggingY)
|
|
57
|
-
return;
|
|
58
|
-
const vp = viewportRef.current;
|
|
59
|
-
const scrollbar = scrollbarYRef.current;
|
|
60
|
-
if (!vp || !scrollbar)
|
|
61
|
-
return;
|
|
62
|
-
const delta = e.clientY - startY;
|
|
63
|
-
const scrollbarHeight = scrollbar.clientHeight;
|
|
64
|
-
const scrollRange = vp.scrollHeight - vp.clientHeight;
|
|
65
|
-
if (scrollbarHeight > 0) {
|
|
66
|
-
vp.scrollTop = startScrollTop + delta / scrollbarHeight * scrollRange;
|
|
67
|
-
}
|
|
68
|
-
}, handleThumbYUp = function(e) {
|
|
69
|
-
isDraggingY = false;
|
|
70
|
-
const thumb = thumbYRef.current;
|
|
71
|
-
if (thumb)
|
|
72
|
-
thumb.releasePointerCapture(e.pointerId);
|
|
73
|
-
}, handleThumbXDown = function(e) {
|
|
74
|
-
const vp = viewportRef.current;
|
|
75
|
-
const thumb = thumbXRef.current;
|
|
76
|
-
if (!vp || !thumb)
|
|
77
|
-
return;
|
|
78
|
-
isDraggingX = true;
|
|
79
|
-
startX = e.clientX;
|
|
80
|
-
startScrollLeft = vp.scrollLeft;
|
|
81
|
-
thumb.setPointerCapture(e.pointerId);
|
|
82
|
-
e.preventDefault();
|
|
83
|
-
}, handleThumbXMove = function(e) {
|
|
84
|
-
if (!isDraggingX)
|
|
85
|
-
return;
|
|
86
|
-
const vp = viewportRef.current;
|
|
87
|
-
const scrollbar = scrollbarXRef.current;
|
|
88
|
-
if (!vp || !scrollbar)
|
|
89
|
-
return;
|
|
90
|
-
const delta = e.clientX - startX;
|
|
91
|
-
const scrollbarWidth = scrollbar.clientWidth;
|
|
92
|
-
const scrollRange = vp.scrollWidth - vp.clientWidth;
|
|
93
|
-
if (scrollbarWidth > 0) {
|
|
94
|
-
vp.scrollLeft = startScrollLeft + delta / scrollbarWidth * scrollRange;
|
|
95
|
-
}
|
|
96
|
-
}, handleThumbXUp = function(e) {
|
|
97
|
-
isDraggingX = false;
|
|
98
|
-
const thumb = thumbXRef.current;
|
|
99
|
-
if (thumb)
|
|
100
|
-
thumb.releasePointerCapture(e.pointerId);
|
|
101
|
-
};
|
|
102
|
-
const viewportRef = ref();
|
|
103
|
-
const scrollbarYRef = ref();
|
|
104
|
-
const scrollbarXRef = ref();
|
|
105
|
-
const thumbYRef = ref();
|
|
106
|
-
const thumbXRef = ref();
|
|
107
|
-
let isDraggingY = false;
|
|
108
|
-
let startY = 0;
|
|
109
|
-
let startScrollTop = 0;
|
|
110
|
-
let isDraggingX = false;
|
|
111
|
-
let startX = 0;
|
|
112
|
-
let startScrollLeft = 0;
|
|
113
|
-
const showY = computed(() => (__props.orientation ?? "vertical") === "vertical" || (__props.orientation ?? "vertical") === "both");
|
|
114
|
-
const showX = computed(() => (__props.orientation ?? "vertical") === "horizontal" || (__props.orientation ?? "vertical") === "both");
|
|
115
|
-
queueMicrotask(() => handleViewportScroll());
|
|
116
|
-
const __mfResult0 = (() => {
|
|
117
|
-
const __el0 = __element("div");
|
|
118
|
-
__el0.setAttribute("data-v-id", "ComposedScrollAreaRoot");
|
|
119
|
-
__el0.setAttribute("data-part", "scroll-area");
|
|
120
|
-
{
|
|
121
|
-
const __v = { position: "relative", overflow: "hidden" };
|
|
122
|
-
if (__v != null && __v !== false)
|
|
123
|
-
__el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
124
|
-
}
|
|
125
|
-
__attr(__el0, "class", () => cn(__props.classes?.root));
|
|
126
|
-
__enterChildren(__el0);
|
|
127
|
-
__append(__el0, (() => {
|
|
128
|
-
const __el1 = __element("div");
|
|
129
|
-
viewportRef.current = __el1;
|
|
130
|
-
__el1.setAttribute("data-part", "scroll-area-viewport");
|
|
131
|
-
{
|
|
132
|
-
const __v = { overflow: "scroll", scrollbarWidth: "none" };
|
|
133
|
-
if (__v != null && __v !== false)
|
|
134
|
-
__el1.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
135
|
-
}
|
|
136
|
-
__attr(__el1, "class", () => cn(__props.classes?.viewport));
|
|
137
|
-
__on(__el1, "scroll", handleViewportScroll);
|
|
138
|
-
__enterChildren(__el1);
|
|
139
|
-
__append(__el1, (() => {
|
|
140
|
-
const __el2 = __element("div");
|
|
141
|
-
__el2.setAttribute("data-part", "scroll-area-content");
|
|
142
|
-
__enterChildren(__el2);
|
|
143
|
-
__append(__el2, __child(() => __props.children));
|
|
144
|
-
__exitChildren();
|
|
145
|
-
return __el2;
|
|
146
|
-
})());
|
|
147
|
-
__exitChildren();
|
|
148
|
-
return __el1;
|
|
149
|
-
})());
|
|
150
|
-
__append(__el0, __conditional(() => showY.value, () => (() => {
|
|
151
|
-
const __el3 = __element("div");
|
|
152
|
-
scrollbarYRef.current = __el3;
|
|
153
|
-
__el3.setAttribute("data-part", "scroll-area-scrollbar");
|
|
154
|
-
__el3.setAttribute("aria-hidden", "true");
|
|
155
|
-
__el3.setAttribute("data-orientation", "vertical");
|
|
156
|
-
{
|
|
157
|
-
const __v = { position: "absolute", top: "0", right: "0", bottom: "0" };
|
|
158
|
-
if (__v != null && __v !== false)
|
|
159
|
-
__el3.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
160
|
-
}
|
|
161
|
-
__attr(__el3, "class", () => cn(__props.classes?.scrollbar));
|
|
162
|
-
__enterChildren(__el3);
|
|
163
|
-
__append(__el3, (() => {
|
|
164
|
-
const __el4 = __element("div");
|
|
165
|
-
thumbYRef.current = __el4;
|
|
166
|
-
__el4.setAttribute("data-part", "scroll-area-thumb");
|
|
167
|
-
__attr(__el4, "class", () => cn(__props.classes?.thumb));
|
|
168
|
-
__on(__el4, "pointerdown", handleThumbYDown);
|
|
169
|
-
__on(__el4, "pointermove", handleThumbYMove);
|
|
170
|
-
__on(__el4, "pointerup", handleThumbYUp);
|
|
171
|
-
return __el4;
|
|
172
|
-
})());
|
|
173
|
-
__exitChildren();
|
|
174
|
-
return __el3;
|
|
175
|
-
})(), () => null));
|
|
176
|
-
__append(__el0, __conditional(() => showX.value, () => (() => {
|
|
177
|
-
const __el5 = __element("div");
|
|
178
|
-
scrollbarXRef.current = __el5;
|
|
179
|
-
__el5.setAttribute("data-part", "scroll-area-scrollbar");
|
|
180
|
-
__el5.setAttribute("aria-hidden", "true");
|
|
181
|
-
__el5.setAttribute("data-orientation", "horizontal");
|
|
182
|
-
{
|
|
183
|
-
const __v = { position: "absolute", bottom: "0", left: "0", right: "0" };
|
|
184
|
-
if (__v != null && __v !== false)
|
|
185
|
-
__el5.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
186
|
-
}
|
|
187
|
-
__attr(__el5, "class", () => cn(__props.classes?.scrollbar));
|
|
188
|
-
__enterChildren(__el5);
|
|
189
|
-
__append(__el5, (() => {
|
|
190
|
-
const __el6 = __element("div");
|
|
191
|
-
thumbXRef.current = __el6;
|
|
192
|
-
__el6.setAttribute("data-part", "scroll-area-thumb");
|
|
193
|
-
__attr(__el6, "class", () => cn(__props.classes?.thumb));
|
|
194
|
-
__on(__el6, "pointerdown", handleThumbXDown);
|
|
195
|
-
__on(__el6, "pointermove", handleThumbXMove);
|
|
196
|
-
__on(__el6, "pointerup", handleThumbXUp);
|
|
197
|
-
return __el6;
|
|
198
|
-
})());
|
|
199
|
-
__exitChildren();
|
|
200
|
-
return __el5;
|
|
201
|
-
})(), () => null));
|
|
202
|
-
__exitChildren();
|
|
203
|
-
return __el0;
|
|
204
|
-
})();
|
|
205
|
-
__flushMountFrame();
|
|
206
|
-
return __mfResult0;
|
|
207
|
-
} catch (__mfErr) {
|
|
208
|
-
__discardMountFrame(__mfDepth);
|
|
209
|
-
throw __mfErr;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
var ComposedScrollArea = ComposedScrollAreaRoot;
|
|
213
|
-
|
|
214
|
-
export { ComposedScrollArea };
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
uniqueId
|
|
3
|
-
} from "./chunk-8y1jf6xr.js";
|
|
4
|
-
import {
|
|
5
|
-
setDataState
|
|
6
|
-
} from "./chunk-vevfhpc9.js";
|
|
7
|
-
import {
|
|
8
|
-
applyAttrs
|
|
9
|
-
} from "./chunk-2db2dnp3.js";
|
|
10
|
-
|
|
11
|
-
// src/progress/progress.tsx
|
|
12
|
-
import { __append, __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
|
|
13
|
-
import { ref, signal } from "@vertz/ui";
|
|
14
|
-
function dataStateFor(pct) {
|
|
15
|
-
if (pct >= 100)
|
|
16
|
-
return "complete";
|
|
17
|
-
if (pct > 0)
|
|
18
|
-
return "loading";
|
|
19
|
-
return "idle";
|
|
20
|
-
}
|
|
21
|
-
function ProgressBar(defaultValue, min, max, initialPct, indicatorRef) {
|
|
22
|
-
const __mfDepth = __pushMountFrame();
|
|
23
|
-
try {
|
|
24
|
-
const __mfResult0 = (() => {
|
|
25
|
-
const __el0 = __element("div");
|
|
26
|
-
__el0.setAttribute("role", "progressbar");
|
|
27
|
-
{
|
|
28
|
-
const __v = uniqueId("progress");
|
|
29
|
-
if (__v != null && __v !== false)
|
|
30
|
-
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
31
|
-
}
|
|
32
|
-
{
|
|
33
|
-
const __v = String(defaultValue);
|
|
34
|
-
if (__v != null && __v !== false)
|
|
35
|
-
__el0.setAttribute("aria-valuenow", __v === true ? "" : __v);
|
|
36
|
-
}
|
|
37
|
-
{
|
|
38
|
-
const __v = String(min);
|
|
39
|
-
if (__v != null && __v !== false)
|
|
40
|
-
__el0.setAttribute("aria-valuemin", __v === true ? "" : __v);
|
|
41
|
-
}
|
|
42
|
-
{
|
|
43
|
-
const __v = String(max);
|
|
44
|
-
if (__v != null && __v !== false)
|
|
45
|
-
__el0.setAttribute("aria-valuemax", __v === true ? "" : __v);
|
|
46
|
-
}
|
|
47
|
-
{
|
|
48
|
-
const __v = dataStateFor(initialPct);
|
|
49
|
-
if (__v != null && __v !== false)
|
|
50
|
-
__el0.setAttribute("data-state", __v === true ? "" : __v);
|
|
51
|
-
}
|
|
52
|
-
__enterChildren(__el0);
|
|
53
|
-
__append(__el0, (() => {
|
|
54
|
-
const __el1 = __element("div");
|
|
55
|
-
indicatorRef.current = __el1;
|
|
56
|
-
__el1.setAttribute("data-part", "indicator");
|
|
57
|
-
{
|
|
58
|
-
const __v = { width: `${initialPct}%` };
|
|
59
|
-
if (__v != null && __v !== false)
|
|
60
|
-
__el1.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
61
|
-
}
|
|
62
|
-
return __el1;
|
|
63
|
-
})());
|
|
64
|
-
__exitChildren();
|
|
65
|
-
return __el0;
|
|
66
|
-
})();
|
|
67
|
-
__flushMountFrame();
|
|
68
|
-
return __mfResult0;
|
|
69
|
-
} catch (__mfErr) {
|
|
70
|
-
__discardMountFrame(__mfDepth);
|
|
71
|
-
throw __mfErr;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function ProgressRoot(options = {}) {
|
|
75
|
-
const { defaultValue = 0, min = 0, max = 100, ...attrs } = options;
|
|
76
|
-
const state = { value: signal(defaultValue) };
|
|
77
|
-
const indicatorRef = ref();
|
|
78
|
-
const initialPct = (defaultValue - min) / (max - min) * 100;
|
|
79
|
-
const root = ProgressBar(defaultValue, min, max, initialPct, indicatorRef);
|
|
80
|
-
const indicator = indicatorRef.current;
|
|
81
|
-
applyAttrs(root, attrs);
|
|
82
|
-
function setValue(val) {
|
|
83
|
-
const clamped = Math.min(max, Math.max(min, val));
|
|
84
|
-
state.value.value = clamped;
|
|
85
|
-
root.setAttribute("aria-valuenow", String(clamped));
|
|
86
|
-
const pct = (clamped - min) / (max - min) * 100;
|
|
87
|
-
indicator.style.width = `${pct}%`;
|
|
88
|
-
setDataState(root, dataStateFor(pct));
|
|
89
|
-
}
|
|
90
|
-
return { root, indicator, state, setValue };
|
|
91
|
-
}
|
|
92
|
-
var Progress = {
|
|
93
|
-
Root: ProgressRoot
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export { Progress };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cn
|
|
3
|
-
} from "./chunk-q7xbcj9q.js";
|
|
4
|
-
import {
|
|
5
|
-
uniqueId
|
|
6
|
-
} from "./chunk-8y1jf6xr.js";
|
|
7
|
-
|
|
8
|
-
// src/progress/progress-composed.tsx
|
|
9
|
-
import { computed } from "@vertz/ui";
|
|
10
|
-
import { __append, __attr, __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __pushMountFrame } from "@vertz/ui/internals";
|
|
11
|
-
function dataStateFor(pct) {
|
|
12
|
-
if (pct >= 100)
|
|
13
|
-
return "complete";
|
|
14
|
-
if (pct > 0)
|
|
15
|
-
return "loading";
|
|
16
|
-
return "idle";
|
|
17
|
-
}
|
|
18
|
-
function ComposedProgressRoot(__props) {
|
|
19
|
-
const __mfDepth = __pushMountFrame();
|
|
20
|
-
try {
|
|
21
|
-
const pct = computed(() => ((__props.defaultValue ?? 0) - (__props.min ?? 0)) / ((__props.max ?? 100) - (__props.min ?? 0)) * 100);
|
|
22
|
-
const __mfResult0 = (() => {
|
|
23
|
-
const __el0 = __element("div");
|
|
24
|
-
__el0.setAttribute("role", "progressbar");
|
|
25
|
-
{
|
|
26
|
-
const __v = uniqueId("progress");
|
|
27
|
-
if (__v != null && __v !== false)
|
|
28
|
-
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
29
|
-
}
|
|
30
|
-
__attr(__el0, "aria-valuenow", () => String(__props.defaultValue ?? 0));
|
|
31
|
-
__attr(__el0, "aria-valuemin", () => String(__props.min ?? 0));
|
|
32
|
-
__attr(__el0, "aria-valuemax", () => String(__props.max ?? 100));
|
|
33
|
-
__attr(__el0, "data-state", () => dataStateFor(pct.value));
|
|
34
|
-
__attr(__el0, "class", () => cn(__props.classes?.root));
|
|
35
|
-
__enterChildren(__el0);
|
|
36
|
-
__append(__el0, (() => {
|
|
37
|
-
const __el1 = __element("div");
|
|
38
|
-
__el1.setAttribute("data-part", "indicator");
|
|
39
|
-
__attr(__el1, "style", () => ({ width: `${pct.value}%` }));
|
|
40
|
-
__attr(__el1, "class", () => cn(__props.classes?.indicator));
|
|
41
|
-
return __el1;
|
|
42
|
-
})());
|
|
43
|
-
__exitChildren();
|
|
44
|
-
return __el0;
|
|
45
|
-
})();
|
|
46
|
-
__flushMountFrame();
|
|
47
|
-
return __mfResult0;
|
|
48
|
-
} catch (__mfErr) {
|
|
49
|
-
__discardMountFrame(__mfDepth);
|
|
50
|
-
throw __mfErr;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
var ComposedProgress = ComposedProgressRoot;
|
|
54
|
-
|
|
55
|
-
export { ComposedProgress };
|
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cn
|
|
3
|
-
} from "./chunk-q7xbcj9q.js";
|
|
4
|
-
import {
|
|
5
|
-
linkedIds
|
|
6
|
-
} from "./chunk-8y1jf6xr.js";
|
|
7
|
-
|
|
8
|
-
// src/alert-dialog/alert-dialog-composed.tsx
|
|
9
|
-
import { signal } from "@vertz/ui";
|
|
10
|
-
import { __append, __attr, __child, __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
|
|
11
|
-
import { createContext, ref, useContext } from "@vertz/ui";
|
|
12
|
-
var AlertDialogContext = createContext(undefined, "@vertz/ui-primitives::AlertDialogContext");
|
|
13
|
-
function useAlertDialogContext(componentName) {
|
|
14
|
-
const ctx = useContext(AlertDialogContext);
|
|
15
|
-
if (!ctx) {
|
|
16
|
-
throw new Error(`<AlertDialog.${componentName}> must be used inside <AlertDialog>. ` + "Ensure it is a direct or nested child of the AlertDialog root component.");
|
|
17
|
-
}
|
|
18
|
-
return ctx;
|
|
19
|
-
}
|
|
20
|
-
function AlertDialogTrigger(__props) {
|
|
21
|
-
const __mfDepth = __pushMountFrame();
|
|
22
|
-
try {
|
|
23
|
-
const ctx = useAlertDialogContext("Trigger");
|
|
24
|
-
const __mfResult0 = (() => {
|
|
25
|
-
const __el0 = __element("span");
|
|
26
|
-
{
|
|
27
|
-
const __v = { display: "contents" };
|
|
28
|
-
if (__v != null && __v !== false)
|
|
29
|
-
__el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
30
|
-
}
|
|
31
|
-
__el0.setAttribute("data-alertdialog-trigger", "");
|
|
32
|
-
__el0.setAttribute("data-state", "closed");
|
|
33
|
-
__on(__el0, "click", () => {
|
|
34
|
-
if (!ctx.isOpen)
|
|
35
|
-
ctx.open();
|
|
36
|
-
});
|
|
37
|
-
__enterChildren(__el0);
|
|
38
|
-
__append(__el0, __child(() => __props.children));
|
|
39
|
-
__exitChildren();
|
|
40
|
-
return __el0;
|
|
41
|
-
})();
|
|
42
|
-
__flushMountFrame();
|
|
43
|
-
return __mfResult0;
|
|
44
|
-
} catch (__mfErr) {
|
|
45
|
-
__discardMountFrame(__mfDepth);
|
|
46
|
-
throw __mfErr;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function AlertDialogContent(__props) {
|
|
50
|
-
const __mfDepth = __pushMountFrame();
|
|
51
|
-
try {
|
|
52
|
-
const ctx = useAlertDialogContext("Content");
|
|
53
|
-
const __mfResult0 = (() => {
|
|
54
|
-
const __el0 = __element("dialog");
|
|
55
|
-
ctx.dialogRef.current = __el0;
|
|
56
|
-
{
|
|
57
|
-
const __v = ctx.contentId;
|
|
58
|
-
if (__v != null && __v !== false)
|
|
59
|
-
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
60
|
-
}
|
|
61
|
-
__el0.setAttribute("role", "alertdialog");
|
|
62
|
-
{
|
|
63
|
-
const __v = ctx.titleId;
|
|
64
|
-
if (__v != null && __v !== false)
|
|
65
|
-
__el0.setAttribute("aria-labelledby", __v === true ? "" : __v);
|
|
66
|
-
}
|
|
67
|
-
{
|
|
68
|
-
const __v = ctx.descriptionId;
|
|
69
|
-
if (__v != null && __v !== false)
|
|
70
|
-
__el0.setAttribute("aria-describedby", __v === true ? "" : __v);
|
|
71
|
-
}
|
|
72
|
-
__el0.setAttribute("data-state", "closed");
|
|
73
|
-
__attr(__el0, "class", () => cn(ctx.classes?.content, __props.className ?? __props.class));
|
|
74
|
-
__on(__el0, "cancel", (e) => {
|
|
75
|
-
e.preventDefault();
|
|
76
|
-
});
|
|
77
|
-
__enterChildren(__el0);
|
|
78
|
-
__append(__el0, __child(() => __props.children));
|
|
79
|
-
__exitChildren();
|
|
80
|
-
return __el0;
|
|
81
|
-
})();
|
|
82
|
-
__flushMountFrame();
|
|
83
|
-
return __mfResult0;
|
|
84
|
-
} catch (__mfErr) {
|
|
85
|
-
__discardMountFrame(__mfDepth);
|
|
86
|
-
throw __mfErr;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function AlertDialogTitle(__props) {
|
|
90
|
-
const __mfDepth = __pushMountFrame();
|
|
91
|
-
try {
|
|
92
|
-
const ctx = useAlertDialogContext("Title");
|
|
93
|
-
const __mfResult0 = (() => {
|
|
94
|
-
const __el0 = __element("h2");
|
|
95
|
-
{
|
|
96
|
-
const __v = ctx.titleId;
|
|
97
|
-
if (__v != null && __v !== false)
|
|
98
|
-
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
99
|
-
}
|
|
100
|
-
__el0.setAttribute("data-slot", "alertdialog-title");
|
|
101
|
-
__attr(__el0, "class", () => cn(ctx.classes?.title, __props.className ?? __props.class));
|
|
102
|
-
__enterChildren(__el0);
|
|
103
|
-
__append(__el0, __child(() => __props.children));
|
|
104
|
-
__exitChildren();
|
|
105
|
-
return __el0;
|
|
106
|
-
})();
|
|
107
|
-
__flushMountFrame();
|
|
108
|
-
return __mfResult0;
|
|
109
|
-
} catch (__mfErr) {
|
|
110
|
-
__discardMountFrame(__mfDepth);
|
|
111
|
-
throw __mfErr;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
function AlertDialogDescription(__props) {
|
|
115
|
-
const __mfDepth = __pushMountFrame();
|
|
116
|
-
try {
|
|
117
|
-
const ctx = useAlertDialogContext("Description");
|
|
118
|
-
const __mfResult0 = (() => {
|
|
119
|
-
const __el0 = __element("p");
|
|
120
|
-
{
|
|
121
|
-
const __v = ctx.descriptionId;
|
|
122
|
-
if (__v != null && __v !== false)
|
|
123
|
-
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
124
|
-
}
|
|
125
|
-
__el0.setAttribute("data-slot", "alertdialog-description");
|
|
126
|
-
__attr(__el0, "class", () => cn(ctx.classes?.description, __props.className ?? __props.class));
|
|
127
|
-
__enterChildren(__el0);
|
|
128
|
-
__append(__el0, __child(() => __props.children));
|
|
129
|
-
__exitChildren();
|
|
130
|
-
return __el0;
|
|
131
|
-
})();
|
|
132
|
-
__flushMountFrame();
|
|
133
|
-
return __mfResult0;
|
|
134
|
-
} catch (__mfErr) {
|
|
135
|
-
__discardMountFrame(__mfDepth);
|
|
136
|
-
throw __mfErr;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
function AlertDialogHeader(__props) {
|
|
140
|
-
const __mfDepth = __pushMountFrame();
|
|
141
|
-
try {
|
|
142
|
-
const { classes } = useAlertDialogContext("Header");
|
|
143
|
-
const __mfResult0 = (() => {
|
|
144
|
-
const __el0 = __element("div");
|
|
145
|
-
__attr(__el0, "class", () => cn(classes?.header, __props.className ?? __props.class));
|
|
146
|
-
__enterChildren(__el0);
|
|
147
|
-
__append(__el0, __child(() => __props.children));
|
|
148
|
-
__exitChildren();
|
|
149
|
-
return __el0;
|
|
150
|
-
})();
|
|
151
|
-
__flushMountFrame();
|
|
152
|
-
return __mfResult0;
|
|
153
|
-
} catch (__mfErr) {
|
|
154
|
-
__discardMountFrame(__mfDepth);
|
|
155
|
-
throw __mfErr;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
function AlertDialogFooter(__props) {
|
|
159
|
-
const __mfDepth = __pushMountFrame();
|
|
160
|
-
try {
|
|
161
|
-
const { classes } = useAlertDialogContext("Footer");
|
|
162
|
-
const __mfResult0 = (() => {
|
|
163
|
-
const __el0 = __element("div");
|
|
164
|
-
__attr(__el0, "class", () => cn(classes?.footer, __props.className ?? __props.class));
|
|
165
|
-
__enterChildren(__el0);
|
|
166
|
-
__append(__el0, __child(() => __props.children));
|
|
167
|
-
__exitChildren();
|
|
168
|
-
return __el0;
|
|
169
|
-
})();
|
|
170
|
-
__flushMountFrame();
|
|
171
|
-
return __mfResult0;
|
|
172
|
-
} catch (__mfErr) {
|
|
173
|
-
__discardMountFrame(__mfDepth);
|
|
174
|
-
throw __mfErr;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
function AlertDialogCancel(__props) {
|
|
178
|
-
const __mfDepth = __pushMountFrame();
|
|
179
|
-
try {
|
|
180
|
-
const ctx = useAlertDialogContext("Cancel");
|
|
181
|
-
const __mfResult0 = (() => {
|
|
182
|
-
const __el0 = __element("button");
|
|
183
|
-
__el0.setAttribute("type", "button");
|
|
184
|
-
__el0.setAttribute("data-slot", "alertdialog-cancel");
|
|
185
|
-
__attr(__el0, "class", () => cn(ctx.classes?.cancel, __props.className ?? __props.class));
|
|
186
|
-
__on(__el0, "click", () => {
|
|
187
|
-
__props.onClick?.();
|
|
188
|
-
ctx.close();
|
|
189
|
-
});
|
|
190
|
-
__attr(__el0, "disabled", () => __props.disabled);
|
|
191
|
-
__enterChildren(__el0);
|
|
192
|
-
__append(__el0, __child(() => __props.children));
|
|
193
|
-
__exitChildren();
|
|
194
|
-
return __el0;
|
|
195
|
-
})();
|
|
196
|
-
__flushMountFrame();
|
|
197
|
-
return __mfResult0;
|
|
198
|
-
} catch (__mfErr) {
|
|
199
|
-
__discardMountFrame(__mfDepth);
|
|
200
|
-
throw __mfErr;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
function AlertDialogAction(__props) {
|
|
204
|
-
const __mfDepth = __pushMountFrame();
|
|
205
|
-
try {
|
|
206
|
-
const ctx = useAlertDialogContext("Action");
|
|
207
|
-
const __mfResult0 = (() => {
|
|
208
|
-
const __el0 = __element("button");
|
|
209
|
-
__el0.setAttribute("type", "button");
|
|
210
|
-
__el0.setAttribute("data-slot", "alertdialog-action");
|
|
211
|
-
__attr(__el0, "class", () => cn(ctx.classes?.action, __props.className ?? __props.class));
|
|
212
|
-
__on(__el0, "click", () => {
|
|
213
|
-
__props.onClick?.();
|
|
214
|
-
ctx.onAction?.();
|
|
215
|
-
ctx.close();
|
|
216
|
-
});
|
|
217
|
-
__attr(__el0, "disabled", () => __props.disabled);
|
|
218
|
-
__enterChildren(__el0);
|
|
219
|
-
__append(__el0, __child(() => __props.children));
|
|
220
|
-
__exitChildren();
|
|
221
|
-
return __el0;
|
|
222
|
-
})();
|
|
223
|
-
__flushMountFrame();
|
|
224
|
-
return __mfResult0;
|
|
225
|
-
} catch (__mfErr) {
|
|
226
|
-
__discardMountFrame(__mfDepth);
|
|
227
|
-
throw __mfErr;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
function ComposedAlertDialogRoot(__props) {
|
|
231
|
-
const __mfDepth = __pushMountFrame();
|
|
232
|
-
try {
|
|
233
|
-
let showDialog = function() {
|
|
234
|
-
const el = dialogRef.current;
|
|
235
|
-
if (!el || el.open)
|
|
236
|
-
return;
|
|
237
|
-
el.setAttribute("data-state", "open");
|
|
238
|
-
el.showModal();
|
|
239
|
-
}, hideDialog = function() {
|
|
240
|
-
const el = dialogRef.current;
|
|
241
|
-
if (!el || !el.open)
|
|
242
|
-
return;
|
|
243
|
-
el.setAttribute("data-state", "closed");
|
|
244
|
-
el.offsetHeight;
|
|
245
|
-
const onEnd = () => {
|
|
246
|
-
el.removeEventListener("animationend", onEnd);
|
|
247
|
-
if (el.open)
|
|
248
|
-
el.close();
|
|
249
|
-
};
|
|
250
|
-
el.addEventListener("animationend", onEnd);
|
|
251
|
-
setTimeout(onEnd, 200);
|
|
252
|
-
}, open = function() {
|
|
253
|
-
isOpen.value = true;
|
|
254
|
-
showDialog();
|
|
255
|
-
__props.onOpenChange?.(true);
|
|
256
|
-
}, close = function() {
|
|
257
|
-
hideDialog();
|
|
258
|
-
isOpen.value = false;
|
|
259
|
-
__props.onOpenChange?.(false);
|
|
260
|
-
};
|
|
261
|
-
const ids = linkedIds("alertdialog");
|
|
262
|
-
const titleId = `${ids.contentId}-title`;
|
|
263
|
-
const descriptionId = `${ids.contentId}-description`;
|
|
264
|
-
const dialogRef = ref();
|
|
265
|
-
const isOpen = signal(false, "isOpen");
|
|
266
|
-
const ctx = {
|
|
267
|
-
isOpen,
|
|
268
|
-
titleId,
|
|
269
|
-
descriptionId,
|
|
270
|
-
contentId: ids.contentId,
|
|
271
|
-
dialogRef,
|
|
272
|
-
classes: __props.classes,
|
|
273
|
-
onAction: __props.onAction,
|
|
274
|
-
open,
|
|
275
|
-
close
|
|
276
|
-
};
|
|
277
|
-
const __mfResult0 = AlertDialogContext.Provider({ get value() {
|
|
278
|
-
return ctx;
|
|
279
|
-
}, children: () => (() => {
|
|
280
|
-
const __el0 = __element("span");
|
|
281
|
-
{
|
|
282
|
-
const __v = { display: "contents" };
|
|
283
|
-
if (__v != null && __v !== false)
|
|
284
|
-
__el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
285
|
-
}
|
|
286
|
-
__el0.setAttribute("data-alertdialog-root", "");
|
|
287
|
-
__enterChildren(__el0);
|
|
288
|
-
__append(__el0, __child(() => __props.children));
|
|
289
|
-
__exitChildren();
|
|
290
|
-
return __el0;
|
|
291
|
-
})() });
|
|
292
|
-
__flushMountFrame();
|
|
293
|
-
return __mfResult0;
|
|
294
|
-
} catch (__mfErr) {
|
|
295
|
-
__discardMountFrame(__mfDepth);
|
|
296
|
-
throw __mfErr;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
var ComposedAlertDialog = Object.assign(ComposedAlertDialogRoot, {
|
|
300
|
-
Trigger: AlertDialogTrigger,
|
|
301
|
-
Content: AlertDialogContent,
|
|
302
|
-
Title: AlertDialogTitle,
|
|
303
|
-
Description: AlertDialogDescription,
|
|
304
|
-
Header: AlertDialogHeader,
|
|
305
|
-
Footer: AlertDialogFooter,
|
|
306
|
-
Cancel: AlertDialogCancel,
|
|
307
|
-
Action: AlertDialogAction
|
|
308
|
-
});
|
|
309
|
-
|
|
310
|
-
export { ComposedAlertDialog };
|