@adamosuiteservices/ui 2.20.1 → 2.20.3
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/accordion-rounded.cjs +1 -1
- package/dist/accordion-rounded.js +1 -1
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +1 -1
- package/dist/checkbox-BHStM029.cjs +24 -0
- package/dist/{checkbox-DPlUjwLi.js → checkbox-DX8b_6kG.js} +4 -3
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/collapsible.cjs +1 -1
- package/dist/collapsible.js +1 -1
- package/dist/{combobox-DylTjGrw.cjs → combobox-BURhN76t.cjs} +1 -1
- package/dist/{combobox-DG9u4g84.js → combobox-BrHVXnf2.js} +3 -3
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +1 -1
- package/dist/context-menu.cjs +8 -8
- package/dist/context-menu.js +56 -55
- package/dist/date-picker-selector.cjs +1 -1
- package/dist/date-picker-selector.js +2 -2
- package/dist/dialog.cjs +3 -3
- package/dist/dialog.js +3 -3
- package/dist/dropdown-menu.cjs +9 -9
- package/dist/dropdown-menu.js +33 -32
- package/dist/full-screen-loader.cjs +4 -4
- package/dist/full-screen-loader.js +27 -24
- package/dist/hover-card.cjs +2 -2
- package/dist/hover-card.js +12 -11
- package/dist/index-1Io41IIt.cjs +1 -0
- package/dist/index-437EL2iq.js +52 -0
- package/dist/index-B695uy69.js +9 -0
- package/dist/index-BE-HFcQ8.cjs +1 -0
- package/dist/{index-BPOsnOxS.js → index-BM2A-WRV.js} +1 -1
- package/dist/index-BOnhen57.cjs +1 -0
- package/dist/{index-D_hmhfRp.js → index-BPnOqaWN.js} +9 -8
- package/dist/index-BqyOu62e.cjs +1 -0
- package/dist/index-C8aODXfJ.cjs +1 -0
- package/dist/index-CFB4VzSW.js +542 -0
- package/dist/index-CgAmFB15.cjs +1 -0
- package/dist/{index-B76LQ4E5.js → index-CinpJ0oP.js} +24 -23
- package/dist/{index-wujanfX3.js → index-Cpaqurwq.js} +191 -190
- package/dist/{index-B6gxHWt9.js → index-CwrPuu3I.js} +15 -14
- package/dist/index-D3xJARPa.cjs +1 -0
- package/dist/index-DSj2iNTW.js +137 -0
- package/dist/{index-Ce7JfyIP.js → index-DWrql5dh.js} +11 -10
- package/dist/{index-BIydBVaH.js → index-E5ek046p.js} +78 -76
- package/dist/{index-BaCYnOIG.cjs → index-L8BhH23Y.cjs} +1 -1
- package/dist/index-ZzRl2Lfu.cjs +5 -0
- package/dist/index-_TfuLupy.cjs +41 -0
- package/dist/index-cBJ7G45l.cjs +1 -0
- package/dist/popover-Dod16CM1.cjs +15 -0
- package/dist/{popover-DcQ18EVl.js → popover-tP2NoMYx.js} +84 -82
- package/dist/popover.cjs +1 -1
- package/dist/popover.js +1 -1
- package/dist/radio-group.cjs +3 -3
- package/dist/radio-group.js +10 -9
- package/dist/select.cjs +8 -8
- package/dist/select.js +21 -19
- package/dist/{sheet-Cp6JGhWC.cjs → sheet-DR1nAs9U.cjs} +1 -1
- package/dist/{sheet-hWerE8S1.js → sheet-UNggtdu3.js} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.cjs +1 -1
- package/dist/sidebar.js +1 -1
- package/dist/slider.cjs +5 -5
- package/dist/slider.js +7 -6
- package/dist/styles.css +1 -1
- package/dist/switch.cjs +3 -3
- package/dist/switch.js +8 -7
- package/dist/tabs-underline.cjs +1 -1
- package/dist/tabs-underline.js +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/toggle.cjs +2 -2
- package/dist/toggle.js +6 -5
- package/dist/tooltip.cjs +3 -3
- package/dist/tooltip.js +23 -22
- package/docs/components/layout/full-screen-loader.md +19 -1
- package/docs/components/ui/dialog.md +28 -3
- package/package.json +4 -2
- package/dist/checkbox-CIzBdqN7.cjs +0 -24
- package/dist/index-8iwAKZIp.cjs +0 -1
- package/dist/index-BWaO7kQK.cjs +0 -1
- package/dist/index-BnkHpTJs.cjs +0 -1
- package/dist/index-C0UREtMP.js +0 -59
- package/dist/index-C2P2kXMc.cjs +0 -41
- package/dist/index-CC6DBo2g.cjs +0 -1
- package/dist/index-CRWn-2fF.cjs +0 -1
- package/dist/index-Ca99LLZF.cjs +0 -5
- package/dist/index-e0gNU5O1.js +0 -675
- package/dist/index-i5lLg35-.cjs +0 -1
- package/dist/popover-cGp_rNLg.cjs +0 -15
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import { c as p
|
|
4
|
-
import { c as
|
|
5
|
-
import { u as
|
|
6
|
-
import { c as
|
|
7
|
-
import { u as
|
|
3
|
+
import { c as p } from "./index-B695uy69.js";
|
|
4
|
+
import { c as H, u as V } from "./index-CmWhhuj7.js";
|
|
5
|
+
import { u as z } from "./index-DLcqcWxM.js";
|
|
6
|
+
import { c as q } from "./index-FxyLF8MY.js";
|
|
7
|
+
import { u as J } from "./index-Cv867SGx.js";
|
|
8
8
|
import { P as G } from "./index-BMWt1NBG.js";
|
|
9
|
-
import { u as
|
|
9
|
+
import { u as Q } from "./index-0ioNhtNM.js";
|
|
10
|
+
import { u as W } from "./index-437EL2iq.js";
|
|
10
11
|
import { j as d } from "./jsx-runtime-BzflLqGi.js";
|
|
11
|
-
var _ = "rovingFocusGroup.onEntryFocus", X = { bubbles: !1, cancelable: !0 }, I = "RovingFocusGroup", [y, N, Z] =
|
|
12
|
+
var _ = "rovingFocusGroup.onEntryFocus", X = { bubbles: !1, cancelable: !0 }, I = "RovingFocusGroup", [y, N, Z] = H(I), [$, be] = q(
|
|
12
13
|
I,
|
|
13
14
|
[Z]
|
|
14
15
|
), [ee, oe] = $(I), O = s.forwardRef(
|
|
@@ -27,12 +28,12 @@ var te = s.forwardRef((e, r) => {
|
|
|
27
28
|
onEntryFocus: m,
|
|
28
29
|
preventScrollOnEntryFocus: a = !1,
|
|
29
30
|
...b
|
|
30
|
-
} = e, F = s.useRef(null), g =
|
|
31
|
+
} = e, F = s.useRef(null), g = z(r, F), R = V(w), [E, t] = W({
|
|
31
32
|
prop: v,
|
|
32
33
|
defaultProp: C ?? null,
|
|
33
34
|
onChange: S,
|
|
34
35
|
caller: I
|
|
35
|
-
}), [i, h] = s.useState(!1), u =
|
|
36
|
+
}), [i, h] = s.useState(!1), u = Q(m), l = N(c), x = s.useRef(!1), [k, P] = s.useState(0);
|
|
36
37
|
return s.useEffect(() => {
|
|
37
38
|
const n = F.current;
|
|
38
39
|
if (n)
|
|
@@ -96,7 +97,7 @@ var te = s.forwardRef((e, r) => {
|
|
|
96
97
|
tabStopId: w,
|
|
97
98
|
children: v,
|
|
98
99
|
...C
|
|
99
|
-
} = e, S =
|
|
100
|
+
} = e, S = J(), m = w || S, a = oe(K, c), b = a.currentTabStopId === m, F = N(c), { onFocusableItemAdd: g, onFocusableItemRemove: R, currentTabStopId: E } = a;
|
|
100
101
|
return s.useEffect(() => {
|
|
101
102
|
if (o)
|
|
102
103
|
return g(), () => R();
|
|
@@ -172,9 +173,9 @@ function M(e, r = !1) {
|
|
|
172
173
|
function ce(e, r) {
|
|
173
174
|
return e.map((c, o) => e[(r + o) % e.length]);
|
|
174
175
|
}
|
|
175
|
-
var
|
|
176
|
+
var Fe = O, ge = j;
|
|
176
177
|
export {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
ge as I,
|
|
179
|
+
Fe as R,
|
|
180
|
+
be as c
|
|
180
181
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";const B=require("react"),m=require("./index-BqyOu62e.cjs"),P=require("./index-Da298sEl.cjs"),Y=require("./index-_XxjJPRD.cjs"),z=require("./index-cwZN7ZY3.cjs"),V=require("./index-WIv2ndLu.cjs"),D=require("./index-CocSS1YK.cjs"),J=require("./index-CzY-WZXL.cjs"),Q=require("./index-C8aODXfJ.cjs"),f=require("./jsx-runtime-BB_1_6y_.cjs");function W(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(o,n,t.get?t:{enumerable:!0,get:()=>e[n]})}}return o.default=e,Object.freeze(o)}const c=W(B);var y="rovingFocusGroup.onEntryFocus",X={bubbles:!1,cancelable:!0},b="RovingFocusGroup",[j,G,Z]=P.createCollection(b),[ee,te]=z.createContextScope(b,[Z]),[oe,ne]=ee(b),N=c.forwardRef((e,o)=>f.jsxRuntimeExports.jsx(j.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsxRuntimeExports.jsx(j.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsxRuntimeExports.jsx(re,{...e,ref:o})})}));N.displayName=b;var re=c.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:n,orientation:t,loop:F=!1,dir:S,currentTabStopId:v,defaultCurrentTabStopId:T,onCurrentTabStopIdChange:w,onEntryFocus:p,preventScrollOnEntryFocus:u=!1,...I}=e,R=c.useRef(null),g=Y.useComposedRefs(o,R),x=P.useDirection(S),[E,r]=Q.useControllableState({prop:v,defaultProp:T??null,onChange:w,caller:b}),[a,C]=c.useState(!1),i=J.useCallbackRef(p),l=G(n),_=c.useRef(!1),[k,A]=c.useState(0);return c.useEffect(()=>{const s=R.current;if(s)return s.addEventListener(y,i),()=>s.removeEventListener(y,i)},[i]),f.jsxRuntimeExports.jsx(oe,{scope:n,orientation:t,dir:x,loop:F,currentTabStopId:E,onItemFocus:c.useCallback(s=>r(s),[r]),onItemShiftTab:c.useCallback(()=>C(!0),[]),onFocusableItemAdd:c.useCallback(()=>A(s=>s+1),[]),onFocusableItemRemove:c.useCallback(()=>A(s=>s-1),[]),children:f.jsxRuntimeExports.jsx(D.Primitive.div,{tabIndex:a||k===0?-1:0,"data-orientation":t,...I,ref:g,style:{outline:"none",...e.style},onMouseDown:m.composeEventHandlers(e.onMouseDown,()=>{_.current=!0}),onFocus:m.composeEventHandlers(e.onFocus,s=>{const L=!_.current;if(s.target===s.currentTarget&&L&&!a){const O=new CustomEvent(y,X);if(s.currentTarget.dispatchEvent(O),!O.defaultPrevented){const h=l().filter(d=>d.focusable),U=h.find(d=>d.active),H=h.find(d=>d.id===E),$=[U,H,...h].filter(Boolean).map(d=>d.ref.current);M($,u)}}_.current=!1}),onBlur:m.composeEventHandlers(e.onBlur,()=>C(!1))})})}),q="RovingFocusGroupItem",K=c.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:n,focusable:t=!0,active:F=!1,tabStopId:S,children:v,...T}=e,w=V.useId(),p=S||w,u=ne(q,n),I=u.currentTabStopId===p,R=G(n),{onFocusableItemAdd:g,onFocusableItemRemove:x,currentTabStopId:E}=u;return c.useEffect(()=>{if(t)return g(),()=>x()},[t,g,x]),f.jsxRuntimeExports.jsx(j.ItemSlot,{scope:n,id:p,focusable:t,active:F,children:f.jsxRuntimeExports.jsx(D.Primitive.span,{tabIndex:I?0:-1,"data-orientation":u.orientation,...T,ref:o,onMouseDown:m.composeEventHandlers(e.onMouseDown,r=>{t?u.onItemFocus(p):r.preventDefault()}),onFocus:m.composeEventHandlers(e.onFocus,()=>u.onItemFocus(p)),onKeyDown:m.composeEventHandlers(e.onKeyDown,r=>{if(r.key==="Tab"&&r.shiftKey){u.onItemShiftTab();return}if(r.target!==r.currentTarget)return;const a=ue(r,u.orientation,u.dir);if(a!==void 0){if(r.metaKey||r.ctrlKey||r.altKey||r.shiftKey)return;r.preventDefault();let i=R().filter(l=>l.focusable).map(l=>l.ref.current);if(a==="last")i.reverse();else if(a==="prev"||a==="next"){a==="prev"&&i.reverse();const l=i.indexOf(r.currentTarget);i=u.loop?ie(i,l+1):i.slice(l+1)}setTimeout(()=>M(i))}}),children:typeof v=="function"?v({isCurrentTabStop:I,hasTabStop:E!=null}):v})})});K.displayName=q;var se={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ce(e,o){return o!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ue(e,o,n){const t=ce(e.key,n);if(!(o==="vertical"&&["ArrowLeft","ArrowRight"].includes(t))&&!(o==="horizontal"&&["ArrowUp","ArrowDown"].includes(t)))return se[t]}function M(e,o=!1){const n=document.activeElement;for(const t of e)if(t===n||(t.focus({preventScroll:o}),document.activeElement!==n))return}function ie(e,o){return e.map((n,t)=>e[(o+t)%e.length])}var ae=N,le=K;exports.Item=le;exports.Root=ae;exports.createRovingFocusGroupScope=te;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { u as A } from "./index-DLcqcWxM.js";
|
|
4
|
+
import { P as M } from "./index-BMWt1NBG.js";
|
|
5
|
+
import { u as y } from "./index-0ioNhtNM.js";
|
|
6
|
+
import { j as _ } from "./jsx-runtime-BzflLqGi.js";
|
|
7
|
+
var F = "focusScope.autoFocusOnMount", T = "focusScope.autoFocusOnUnmount", N = { bubbles: !1, cancelable: !0 }, K = "FocusScope", k = d.forwardRef((e, t) => {
|
|
8
|
+
const {
|
|
9
|
+
loop: n = !1,
|
|
10
|
+
trapped: u = !1,
|
|
11
|
+
onMountAutoFocus: p,
|
|
12
|
+
onUnmountAutoFocus: L,
|
|
13
|
+
...g
|
|
14
|
+
} = e, [s, P] = d.useState(null), E = y(p), v = y(L), b = d.useRef(null), R = A(t, (o) => P(o)), a = d.useRef({
|
|
15
|
+
paused: !1,
|
|
16
|
+
pause() {
|
|
17
|
+
this.paused = !0;
|
|
18
|
+
},
|
|
19
|
+
resume() {
|
|
20
|
+
this.paused = !1;
|
|
21
|
+
}
|
|
22
|
+
}).current;
|
|
23
|
+
d.useEffect(() => {
|
|
24
|
+
if (u) {
|
|
25
|
+
let o = function(i) {
|
|
26
|
+
if (a.paused || !s) return;
|
|
27
|
+
const c = i.target;
|
|
28
|
+
s.contains(c) ? b.current = c : f(b.current, { select: !0 });
|
|
29
|
+
}, l = function(i) {
|
|
30
|
+
if (a.paused || !s) return;
|
|
31
|
+
const c = i.relatedTarget;
|
|
32
|
+
c !== null && (s.contains(c) || f(b.current, { select: !0 }));
|
|
33
|
+
}, r = function(i) {
|
|
34
|
+
if (document.activeElement === document.body)
|
|
35
|
+
for (const h of i)
|
|
36
|
+
h.removedNodes.length > 0 && f(s);
|
|
37
|
+
};
|
|
38
|
+
document.addEventListener("focusin", o), document.addEventListener("focusout", l);
|
|
39
|
+
const m = new MutationObserver(r);
|
|
40
|
+
return s && m.observe(s, { childList: !0, subtree: !0 }), () => {
|
|
41
|
+
document.removeEventListener("focusin", o), document.removeEventListener("focusout", l), m.disconnect();
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}, [u, s, a.paused]), d.useEffect(() => {
|
|
45
|
+
if (s) {
|
|
46
|
+
O.add(a);
|
|
47
|
+
const o = document.activeElement;
|
|
48
|
+
if (!s.contains(o)) {
|
|
49
|
+
const r = new CustomEvent(F, N);
|
|
50
|
+
s.addEventListener(F, E), s.dispatchEvent(r), r.defaultPrevented || (w(V(I(s)), { select: !0 }), document.activeElement === o && f(s));
|
|
51
|
+
}
|
|
52
|
+
return () => {
|
|
53
|
+
s.removeEventListener(F, E), setTimeout(() => {
|
|
54
|
+
const r = new CustomEvent(T, N);
|
|
55
|
+
s.addEventListener(T, v), s.dispatchEvent(r), r.defaultPrevented || f(o ?? document.body, { select: !0 }), s.removeEventListener(T, v), O.remove(a);
|
|
56
|
+
}, 0);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}, [s, E, v, a]);
|
|
60
|
+
const U = d.useCallback(
|
|
61
|
+
(o) => {
|
|
62
|
+
if (!n && !u || a.paused) return;
|
|
63
|
+
const l = o.key === "Tab" && !o.altKey && !o.ctrlKey && !o.metaKey, r = document.activeElement;
|
|
64
|
+
if (l && r) {
|
|
65
|
+
const m = o.currentTarget, [i, c] = x(m);
|
|
66
|
+
i && c ? !o.shiftKey && r === c ? (o.preventDefault(), n && f(i, { select: !0 })) : o.shiftKey && r === i && (o.preventDefault(), n && f(c, { select: !0 })) : r === m && o.preventDefault();
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
[n, u, a.paused]
|
|
70
|
+
);
|
|
71
|
+
return /* @__PURE__ */ _.jsx(M.div, { tabIndex: -1, ...g, ref: R, onKeyDown: U });
|
|
72
|
+
});
|
|
73
|
+
k.displayName = K;
|
|
74
|
+
function w(e, { select: t = !1 } = {}) {
|
|
75
|
+
const n = document.activeElement;
|
|
76
|
+
for (const u of e)
|
|
77
|
+
if (f(u, { select: t }), document.activeElement !== n) return;
|
|
78
|
+
}
|
|
79
|
+
function x(e) {
|
|
80
|
+
const t = I(e), n = S(t, e), u = S(t.reverse(), e);
|
|
81
|
+
return [n, u];
|
|
82
|
+
}
|
|
83
|
+
function I(e) {
|
|
84
|
+
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
85
|
+
acceptNode: (u) => {
|
|
86
|
+
const p = u.tagName === "INPUT" && u.type === "hidden";
|
|
87
|
+
return u.disabled || u.hidden || p ? NodeFilter.FILTER_SKIP : u.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
for (; n.nextNode(); ) t.push(n.currentNode);
|
|
91
|
+
return t;
|
|
92
|
+
}
|
|
93
|
+
function S(e, t) {
|
|
94
|
+
for (const n of e)
|
|
95
|
+
if (!D(n, { upTo: t })) return n;
|
|
96
|
+
}
|
|
97
|
+
function D(e, { upTo: t }) {
|
|
98
|
+
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
99
|
+
for (; e; ) {
|
|
100
|
+
if (t !== void 0 && e === t) return !1;
|
|
101
|
+
if (getComputedStyle(e).display === "none") return !0;
|
|
102
|
+
e = e.parentElement;
|
|
103
|
+
}
|
|
104
|
+
return !1;
|
|
105
|
+
}
|
|
106
|
+
function H(e) {
|
|
107
|
+
return e instanceof HTMLInputElement && "select" in e;
|
|
108
|
+
}
|
|
109
|
+
function f(e, { select: t = !1 } = {}) {
|
|
110
|
+
if (e && e.focus) {
|
|
111
|
+
const n = document.activeElement;
|
|
112
|
+
e.focus({ preventScroll: !0 }), e !== n && H(e) && t && e.select();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
var O = j();
|
|
116
|
+
function j() {
|
|
117
|
+
let e = [];
|
|
118
|
+
return {
|
|
119
|
+
add(t) {
|
|
120
|
+
const n = e[0];
|
|
121
|
+
t !== n && n?.pause(), e = C(e, t), e.unshift(t);
|
|
122
|
+
},
|
|
123
|
+
remove(t) {
|
|
124
|
+
e = C(e, t), e[0]?.resume();
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function C(e, t) {
|
|
129
|
+
const n = [...e], u = n.indexOf(t);
|
|
130
|
+
return u !== -1 && n.splice(u, 1), n;
|
|
131
|
+
}
|
|
132
|
+
function V(e) {
|
|
133
|
+
return e.filter((t) => t.tagName !== "A");
|
|
134
|
+
}
|
|
135
|
+
export {
|
|
136
|
+
k as F
|
|
137
|
+
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as o from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { c as
|
|
3
|
+
import { c as I } from "./index-B695uy69.js";
|
|
4
|
+
import { c as O } from "./index-FxyLF8MY.js";
|
|
5
|
+
import { u as S } from "./index-437EL2iq.js";
|
|
5
6
|
import { u as D } from "./index-CCKe-Mpx.js";
|
|
6
7
|
import { u as M } from "./index-DLcqcWxM.js";
|
|
7
8
|
import { P as v } from "./index-BMWt1NBG.js";
|
|
8
9
|
import { P as L } from "./index-CSFEzRxy.js";
|
|
9
10
|
import { u as k } from "./index-Cv867SGx.js";
|
|
10
11
|
import { j as c } from "./jsx-runtime-BzflLqGi.js";
|
|
11
|
-
var f = "Collapsible", [F,
|
|
12
|
+
var f = "Collapsible", [F, W] = O(f), [B, g] = F(f), T = o.forwardRef(
|
|
12
13
|
(e, s) => {
|
|
13
14
|
const {
|
|
14
15
|
__scopeCollapsible: r,
|
|
@@ -17,7 +18,7 @@ var f = "Collapsible", [F, V] = S(f), [B, g] = F(f), T = o.forwardRef(
|
|
|
17
18
|
disabled: l,
|
|
18
19
|
onOpenChange: i,
|
|
19
20
|
...m
|
|
20
|
-
} = e, [d, p] =
|
|
21
|
+
} = e, [d, p] = S({
|
|
21
22
|
prop: a,
|
|
22
23
|
defaultProp: t ?? !1,
|
|
23
24
|
onChange: i,
|
|
@@ -59,7 +60,7 @@ var j = "CollapsibleTrigger", w = o.forwardRef(
|
|
|
59
60
|
disabled: t.disabled,
|
|
60
61
|
...a,
|
|
61
62
|
ref: s,
|
|
62
|
-
onClick:
|
|
63
|
+
onClick: I(e.onClick, t.onOpenToggle)
|
|
63
64
|
}
|
|
64
65
|
);
|
|
65
66
|
}
|
|
@@ -108,12 +109,12 @@ var G = o.forwardRef((e, s) => {
|
|
|
108
109
|
function x(e) {
|
|
109
110
|
return e ? "open" : "closed";
|
|
110
111
|
}
|
|
111
|
-
var
|
|
112
|
+
var X = T, Y = w, Z = A;
|
|
112
113
|
export {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
Z as C,
|
|
115
|
+
X as R,
|
|
116
|
+
Y as T,
|
|
116
117
|
w as a,
|
|
117
118
|
A as b,
|
|
118
|
-
|
|
119
|
+
W as c
|
|
119
120
|
};
|
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as a from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { c as
|
|
5
|
-
import { c as
|
|
3
|
+
import { c as m } from "./index-B695uy69.js";
|
|
4
|
+
import { c as $, u as y } from "./index-DLcqcWxM.js";
|
|
5
|
+
import { c as B, a as H } from "./index-FxyLF8MY.js";
|
|
6
6
|
import { u as x } from "./index-Cv867SGx.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { u as Z } from "./index-437EL2iq.js";
|
|
8
|
+
import { D as q } from "./index-BM2A-WRV.js";
|
|
9
|
+
import { F as K } from "./index-DSj2iNTW.js";
|
|
10
|
+
import { P as U } from "./index-CZWDxvEo.js";
|
|
10
11
|
import { P as h } from "./index-CSFEzRxy.js";
|
|
11
12
|
import { P as D } from "./index-BMWt1NBG.js";
|
|
13
|
+
import { h as Y, R as z, u as J } from "./index-CFB4VzSW.js";
|
|
12
14
|
import { j as i } from "./jsx-runtime-BzflLqGi.js";
|
|
13
15
|
// @__NO_SIDE_EFFECTS__
|
|
14
16
|
function Q(e) {
|
|
15
|
-
const t = /* @__PURE__ */ X(e),
|
|
16
|
-
const { children: s, ...c } =
|
|
17
|
+
const t = /* @__PURE__ */ X(e), r = a.forwardRef((n, o) => {
|
|
18
|
+
const { children: s, ...c } = n, l = a.Children.toArray(s), u = l.find(te);
|
|
17
19
|
if (u) {
|
|
18
20
|
const d = u.props.children, g = l.map((v) => v === u ? a.Children.count(d) > 1 ? a.Children.only(null) : a.isValidElement(d) ? d.props.children : null : v);
|
|
19
21
|
return /* @__PURE__ */ i.jsx(t, { ...c, ref: o, children: a.isValidElement(d) ? a.cloneElement(d, void 0, g) : null });
|
|
20
22
|
}
|
|
21
23
|
return /* @__PURE__ */ i.jsx(t, { ...c, ref: o, children: s });
|
|
22
24
|
});
|
|
23
|
-
return
|
|
25
|
+
return r.displayName = `${e}.Slot`, r;
|
|
24
26
|
}
|
|
25
27
|
// @__NO_SIDE_EFFECTS__
|
|
26
28
|
function X(e) {
|
|
27
|
-
const t = a.forwardRef((
|
|
28
|
-
const { children: o, ...s } =
|
|
29
|
+
const t = a.forwardRef((r, n) => {
|
|
30
|
+
const { children: o, ...s } = r;
|
|
29
31
|
if (a.isValidElement(o)) {
|
|
30
|
-
const c =
|
|
31
|
-
return o.type !== a.Fragment && (l.ref =
|
|
32
|
+
const c = re(o), l = oe(s, o.props);
|
|
33
|
+
return o.type !== a.Fragment && (l.ref = n ? $(n, c) : c), a.cloneElement(o, l);
|
|
32
34
|
}
|
|
33
35
|
return a.Children.count(o) > 1 ? a.Children.only(null) : null;
|
|
34
36
|
});
|
|
@@ -39,36 +41,36 @@ function te(e) {
|
|
|
39
41
|
return a.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === ee;
|
|
40
42
|
}
|
|
41
43
|
function oe(e, t) {
|
|
42
|
-
const
|
|
43
|
-
for (const
|
|
44
|
-
const o = e[
|
|
45
|
-
/^on[A-Z]/.test(
|
|
44
|
+
const r = { ...t };
|
|
45
|
+
for (const n in t) {
|
|
46
|
+
const o = e[n], s = t[n];
|
|
47
|
+
/^on[A-Z]/.test(n) ? o && s ? r[n] = (...l) => {
|
|
46
48
|
const u = s(...l);
|
|
47
49
|
return o(...l), u;
|
|
48
|
-
} : o && (n
|
|
50
|
+
} : o && (r[n] = o) : n === "style" ? r[n] = { ...o, ...s } : n === "className" && (r[n] = [o, s].filter(Boolean).join(" "));
|
|
49
51
|
}
|
|
50
|
-
return { ...e, ...
|
|
52
|
+
return { ...e, ...r };
|
|
51
53
|
}
|
|
52
|
-
function
|
|
53
|
-
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get,
|
|
54
|
-
return
|
|
54
|
+
function re(e) {
|
|
55
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning;
|
|
56
|
+
return r ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
55
57
|
}
|
|
56
|
-
var R = "Dialog", [O] =
|
|
58
|
+
var R = "Dialog", [O] = B(R), [ne, f] = O(R), N = (e) => {
|
|
57
59
|
const {
|
|
58
60
|
__scopeDialog: t,
|
|
59
|
-
children:
|
|
60
|
-
open:
|
|
61
|
+
children: r,
|
|
62
|
+
open: n,
|
|
61
63
|
defaultOpen: o,
|
|
62
64
|
onOpenChange: s,
|
|
63
65
|
modal: c = !0
|
|
64
|
-
} = e, l = a.useRef(null), u = a.useRef(null), [d, g] =
|
|
65
|
-
prop:
|
|
66
|
+
} = e, l = a.useRef(null), u = a.useRef(null), [d, g] = Z({
|
|
67
|
+
prop: n,
|
|
66
68
|
defaultProp: o ?? !1,
|
|
67
69
|
onChange: s,
|
|
68
70
|
caller: R
|
|
69
71
|
});
|
|
70
72
|
return /* @__PURE__ */ i.jsx(
|
|
71
|
-
|
|
73
|
+
ne,
|
|
72
74
|
{
|
|
73
75
|
scope: t,
|
|
74
76
|
triggerRef: l,
|
|
@@ -80,14 +82,14 @@ var R = "Dialog", [O] = H(R), [re, f] = O(R), N = (e) => {
|
|
|
80
82
|
onOpenChange: g,
|
|
81
83
|
onOpenToggle: a.useCallback(() => g((v) => !v), [g]),
|
|
82
84
|
modal: c,
|
|
83
|
-
children:
|
|
85
|
+
children: r
|
|
84
86
|
}
|
|
85
87
|
);
|
|
86
88
|
};
|
|
87
89
|
N.displayName = R;
|
|
88
90
|
var I = "DialogTrigger", b = a.forwardRef(
|
|
89
91
|
(e, t) => {
|
|
90
|
-
const { __scopeDialog:
|
|
92
|
+
const { __scopeDialog: r, ...n } = e, o = f(I, r), s = y(t, o.triggerRef);
|
|
91
93
|
return /* @__PURE__ */ i.jsx(
|
|
92
94
|
D.button,
|
|
93
95
|
{
|
|
@@ -96,7 +98,7 @@ var I = "DialogTrigger", b = a.forwardRef(
|
|
|
96
98
|
"aria-expanded": o.open,
|
|
97
99
|
"aria-controls": o.contentId,
|
|
98
100
|
"data-state": P(o.open),
|
|
99
|
-
...
|
|
101
|
+
...n,
|
|
100
102
|
ref: s,
|
|
101
103
|
onClick: m(e.onClick, o.onOpenToggle)
|
|
102
104
|
}
|
|
@@ -107,56 +109,56 @@ b.displayName = I;
|
|
|
107
109
|
var E = "DialogPortal", [se, j] = O(E, {
|
|
108
110
|
forceMount: void 0
|
|
109
111
|
}), A = (e) => {
|
|
110
|
-
const { __scopeDialog: t, forceMount:
|
|
111
|
-
return /* @__PURE__ */ i.jsx(se, { scope: t, forceMount:
|
|
112
|
+
const { __scopeDialog: t, forceMount: r, children: n, container: o } = e, s = f(E, t);
|
|
113
|
+
return /* @__PURE__ */ i.jsx(se, { scope: t, forceMount: r, children: a.Children.map(n, (c) => /* @__PURE__ */ i.jsx(h, { present: r || s.open, children: /* @__PURE__ */ i.jsx(U, { asChild: !0, container: o, children: c }) })) });
|
|
112
114
|
};
|
|
113
115
|
A.displayName = E;
|
|
114
116
|
var C = "DialogOverlay", T = a.forwardRef(
|
|
115
117
|
(e, t) => {
|
|
116
|
-
const
|
|
117
|
-
return s.modal ? /* @__PURE__ */ i.jsx(h, { present:
|
|
118
|
+
const r = j(C, e.__scopeDialog), { forceMount: n = r.forceMount, ...o } = e, s = f(C, e.__scopeDialog);
|
|
119
|
+
return s.modal ? /* @__PURE__ */ i.jsx(h, { present: n || s.open, children: /* @__PURE__ */ i.jsx(ie, { ...o, ref: t }) }) : null;
|
|
118
120
|
}
|
|
119
121
|
);
|
|
120
122
|
T.displayName = C;
|
|
121
123
|
var ae = /* @__PURE__ */ Q("DialogOverlay.RemoveScroll"), ie = a.forwardRef(
|
|
122
124
|
(e, t) => {
|
|
123
|
-
const { __scopeDialog:
|
|
125
|
+
const { __scopeDialog: r, ...n } = e, o = f(C, r);
|
|
124
126
|
return (
|
|
125
127
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
126
128
|
// ie. when `Overlay` and `Content` are siblings
|
|
127
|
-
/* @__PURE__ */ i.jsx(
|
|
129
|
+
/* @__PURE__ */ i.jsx(z, { as: ae, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ i.jsx(
|
|
128
130
|
D.div,
|
|
129
131
|
{
|
|
130
132
|
"data-state": P(o.open),
|
|
131
|
-
...
|
|
133
|
+
...n,
|
|
132
134
|
ref: t,
|
|
133
|
-
style: { pointerEvents: "auto", ...
|
|
135
|
+
style: { pointerEvents: "auto", ...n.style }
|
|
134
136
|
}
|
|
135
137
|
) })
|
|
136
138
|
);
|
|
137
139
|
}
|
|
138
140
|
), p = "DialogContent", S = a.forwardRef(
|
|
139
141
|
(e, t) => {
|
|
140
|
-
const
|
|
141
|
-
return /* @__PURE__ */ i.jsx(h, { present:
|
|
142
|
+
const r = j(p, e.__scopeDialog), { forceMount: n = r.forceMount, ...o } = e, s = f(p, e.__scopeDialog);
|
|
143
|
+
return /* @__PURE__ */ i.jsx(h, { present: n || s.open, children: s.modal ? /* @__PURE__ */ i.jsx(le, { ...o, ref: t }) : /* @__PURE__ */ i.jsx(ce, { ...o, ref: t }) });
|
|
142
144
|
}
|
|
143
145
|
);
|
|
144
146
|
S.displayName = p;
|
|
145
147
|
var le = a.forwardRef(
|
|
146
148
|
(e, t) => {
|
|
147
|
-
const
|
|
149
|
+
const r = f(p, e.__scopeDialog), n = a.useRef(null), o = y(t, r.contentRef, n);
|
|
148
150
|
return a.useEffect(() => {
|
|
149
|
-
const s =
|
|
150
|
-
if (s) return
|
|
151
|
+
const s = n.current;
|
|
152
|
+
if (s) return Y(s);
|
|
151
153
|
}, []), /* @__PURE__ */ i.jsx(
|
|
152
154
|
M,
|
|
153
155
|
{
|
|
154
156
|
...e,
|
|
155
157
|
ref: o,
|
|
156
|
-
trapFocus:
|
|
158
|
+
trapFocus: r.open,
|
|
157
159
|
disableOutsidePointerEvents: !0,
|
|
158
160
|
onCloseAutoFocus: m(e.onCloseAutoFocus, (s) => {
|
|
159
|
-
s.preventDefault(),
|
|
161
|
+
s.preventDefault(), r.triggerRef.current?.focus();
|
|
160
162
|
}),
|
|
161
163
|
onPointerDownOutside: m(e.onPointerDownOutside, (s) => {
|
|
162
164
|
const c = s.detail.originalEvent, l = c.button === 0 && c.ctrlKey === !0;
|
|
@@ -171,7 +173,7 @@ var le = a.forwardRef(
|
|
|
171
173
|
}
|
|
172
174
|
), ce = a.forwardRef(
|
|
173
175
|
(e, t) => {
|
|
174
|
-
const
|
|
176
|
+
const r = f(p, e.__scopeDialog), n = a.useRef(!1), o = a.useRef(!1);
|
|
175
177
|
return /* @__PURE__ */ i.jsx(
|
|
176
178
|
M,
|
|
177
179
|
{
|
|
@@ -180,26 +182,26 @@ var le = a.forwardRef(
|
|
|
180
182
|
trapFocus: !1,
|
|
181
183
|
disableOutsidePointerEvents: !1,
|
|
182
184
|
onCloseAutoFocus: (s) => {
|
|
183
|
-
e.onCloseAutoFocus?.(s), s.defaultPrevented || (
|
|
185
|
+
e.onCloseAutoFocus?.(s), s.defaultPrevented || (n.current || r.triggerRef.current?.focus(), s.preventDefault()), n.current = !1, o.current = !1;
|
|
184
186
|
},
|
|
185
187
|
onInteractOutside: (s) => {
|
|
186
|
-
e.onInteractOutside?.(s), s.defaultPrevented || (
|
|
188
|
+
e.onInteractOutside?.(s), s.defaultPrevented || (n.current = !0, s.detail.originalEvent.type === "pointerdown" && (o.current = !0));
|
|
187
189
|
const c = s.target;
|
|
188
|
-
|
|
190
|
+
r.triggerRef.current?.contains(c) && s.preventDefault(), s.detail.originalEvent.type === "focusin" && o.current && s.preventDefault();
|
|
189
191
|
}
|
|
190
192
|
}
|
|
191
193
|
);
|
|
192
194
|
}
|
|
193
195
|
), M = a.forwardRef(
|
|
194
196
|
(e, t) => {
|
|
195
|
-
const { __scopeDialog:
|
|
196
|
-
return
|
|
197
|
+
const { __scopeDialog: r, trapFocus: n, onOpenAutoFocus: o, onCloseAutoFocus: s, ...c } = e, l = f(p, r), u = a.useRef(null), d = y(t, u);
|
|
198
|
+
return J(), /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
197
199
|
/* @__PURE__ */ i.jsx(
|
|
198
|
-
|
|
200
|
+
K,
|
|
199
201
|
{
|
|
200
202
|
asChild: !0,
|
|
201
203
|
loop: !0,
|
|
202
|
-
trapped:
|
|
204
|
+
trapped: n,
|
|
203
205
|
onMountAutoFocus: o,
|
|
204
206
|
onUnmountAutoFocus: s,
|
|
205
207
|
children: /* @__PURE__ */ i.jsx(
|
|
@@ -225,26 +227,26 @@ var le = a.forwardRef(
|
|
|
225
227
|
}
|
|
226
228
|
), _ = "DialogTitle", w = a.forwardRef(
|
|
227
229
|
(e, t) => {
|
|
228
|
-
const { __scopeDialog:
|
|
229
|
-
return /* @__PURE__ */ i.jsx(D.h2, { id: o.titleId, ...
|
|
230
|
+
const { __scopeDialog: r, ...n } = e, o = f(_, r);
|
|
231
|
+
return /* @__PURE__ */ i.jsx(D.h2, { id: o.titleId, ...n, ref: t });
|
|
230
232
|
}
|
|
231
233
|
);
|
|
232
234
|
w.displayName = _;
|
|
233
235
|
var F = "DialogDescription", W = a.forwardRef(
|
|
234
236
|
(e, t) => {
|
|
235
|
-
const { __scopeDialog:
|
|
236
|
-
return /* @__PURE__ */ i.jsx(D.p, { id: o.descriptionId, ...
|
|
237
|
+
const { __scopeDialog: r, ...n } = e, o = f(F, r);
|
|
238
|
+
return /* @__PURE__ */ i.jsx(D.p, { id: o.descriptionId, ...n, ref: t });
|
|
237
239
|
}
|
|
238
240
|
);
|
|
239
241
|
W.displayName = F;
|
|
240
242
|
var L = "DialogClose", k = a.forwardRef(
|
|
241
243
|
(e, t) => {
|
|
242
|
-
const { __scopeDialog:
|
|
244
|
+
const { __scopeDialog: r, ...n } = e, o = f(L, r);
|
|
243
245
|
return /* @__PURE__ */ i.jsx(
|
|
244
246
|
D.button,
|
|
245
247
|
{
|
|
246
248
|
type: "button",
|
|
247
|
-
...
|
|
249
|
+
...n,
|
|
248
250
|
ref: t,
|
|
249
251
|
onClick: m(e.onClick, () => o.onOpenChange(!1))
|
|
250
252
|
}
|
|
@@ -255,33 +257,33 @@ k.displayName = L;
|
|
|
255
257
|
function P(e) {
|
|
256
258
|
return e ? "open" : "closed";
|
|
257
259
|
}
|
|
258
|
-
var G = "DialogTitleWarning", [
|
|
260
|
+
var G = "DialogTitleWarning", [Pe, V] = H(G, {
|
|
259
261
|
contentName: p,
|
|
260
262
|
titleName: _,
|
|
261
263
|
docsSlug: "dialog"
|
|
262
264
|
}), ue = ({ titleId: e }) => {
|
|
263
|
-
const t = V(G),
|
|
265
|
+
const t = V(G), r = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
264
266
|
|
|
265
267
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
266
268
|
|
|
267
269
|
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
|
|
268
270
|
return a.useEffect(() => {
|
|
269
|
-
e && (document.getElementById(e) || console.error(
|
|
270
|
-
}, [
|
|
271
|
+
e && (document.getElementById(e) || console.error(r));
|
|
272
|
+
}, [r, e]), null;
|
|
271
273
|
}, fe = "DialogDescriptionWarning", de = ({ contentRef: e, descriptionId: t }) => {
|
|
272
|
-
const
|
|
274
|
+
const n = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${V(fe).contentName}}.`;
|
|
273
275
|
return a.useEffect(() => {
|
|
274
276
|
const o = e.current?.getAttribute("aria-describedby");
|
|
275
|
-
t && o && (document.getElementById(t) || console.warn(
|
|
276
|
-
}, [
|
|
277
|
-
},
|
|
277
|
+
t && o && (document.getElementById(t) || console.warn(n));
|
|
278
|
+
}, [n, e, t]), null;
|
|
279
|
+
}, Oe = N, Ne = b, Ie = A, be = T, je = S, Ae = w, Te = W, Se = k;
|
|
278
280
|
export {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
281
|
+
Se as C,
|
|
282
|
+
Te as D,
|
|
283
|
+
be as O,
|
|
284
|
+
Ie as P,
|
|
285
|
+
Oe as R,
|
|
286
|
+
Ne as T,
|
|
287
|
+
je as a,
|
|
288
|
+
Ae as b
|
|
287
289
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const A=require("react"),p=require("./index-
|
|
1
|
+
"use client";"use strict";const A=require("react"),p=require("./index-BqyOu62e.cjs"),h=require("./index-CocSS1YK.cjs"),w=require("./index-_XxjJPRD.cjs"),m=require("./index-CzY-WZXL.cjs"),x=require("./jsx-runtime-BB_1_6y_.cjs");function q(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const o=q(A);function H(t,e=globalThis?.document){const n=m.useCallbackRef(t);o.useEffect(()=>{const s=r=>{r.key==="Escape"&&n(r)};return e.addEventListener("keydown",s,{capture:!0}),()=>e.removeEventListener("keydown",s,{capture:!0})},[n,e])}var U="DismissableLayer",b="dismissableLayer.update",z="dismissableLayer.pointerDownOutside",K="dismissableLayer.focusOutside",R,T=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),B=o.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:f,onDismiss:d,...E}=t,a=o.useContext(T),[u,k]=o.useState(null),l=u?.ownerDocument??globalThis?.document,[,F]=o.useState({}),I=w.useComposedRefs(e,i=>k(i)),D=Array.from(a.layers),[N]=[...a.layersWithOutsidePointerEventsDisabled].slice(-1),W=D.indexOf(N),O=u?D.indexOf(u):-1,_=a.layersWithOutsidePointerEventsDisabled.size>0,P=O>=W,j=X(i=>{const v=i.target,L=[...a.branches].some(y=>y.contains(v));!P||L||(r?.(i),f?.(i),i.defaultPrevented||d?.())},l),C=Y(i=>{const v=i.target;[...a.branches].some(y=>y.contains(v))||(c?.(i),f?.(i),i.defaultPrevented||d?.())},l);return H(i=>{O===a.layers.size-1&&(s?.(i),!i.defaultPrevented&&d&&(i.preventDefault(),d()))},l),o.useEffect(()=>{if(u)return n&&(a.layersWithOutsidePointerEventsDisabled.size===0&&(R=l.body.style.pointerEvents,l.body.style.pointerEvents="none"),a.layersWithOutsidePointerEventsDisabled.add(u)),a.layers.add(u),g(),()=>{n&&a.layersWithOutsidePointerEventsDisabled.size===1&&(l.body.style.pointerEvents=R)}},[u,l,n,a]),o.useEffect(()=>()=>{u&&(a.layers.delete(u),a.layersWithOutsidePointerEventsDisabled.delete(u),g())},[u,a]),o.useEffect(()=>{const i=()=>F({});return document.addEventListener(b,i),()=>document.removeEventListener(b,i)},[]),x.jsxRuntimeExports.jsx(h.Primitive.div,{...E,ref:I,style:{pointerEvents:_?P?"auto":"none":void 0,...t.style},onFocusCapture:p.composeEventHandlers(t.onFocusCapture,C.onFocusCapture),onBlurCapture:p.composeEventHandlers(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:p.composeEventHandlers(t.onPointerDownCapture,j.onPointerDownCapture)})});B.displayName=U;var M="DismissableLayerBranch",$=o.forwardRef((t,e)=>{const n=o.useContext(T),s=o.useRef(null),r=w.useComposedRefs(e,s);return o.useEffect(()=>{const c=s.current;if(c)return n.branches.add(c),()=>{n.branches.delete(c)}},[n.branches]),x.jsxRuntimeExports.jsx(h.Primitive.div,{...t,ref:r})});$.displayName=M;function X(t,e=globalThis?.document){const n=m.useCallbackRef(t),s=o.useRef(!1),r=o.useRef(()=>{});return o.useEffect(()=>{const c=d=>{if(d.target&&!s.current){let E=function(){S(z,n,a,{discrete:!0})};const a={originalEvent:d};d.pointerType==="touch"?(e.removeEventListener("click",r.current),r.current=E,e.addEventListener("click",r.current,{once:!0})):E()}else e.removeEventListener("click",r.current);s.current=!1},f=window.setTimeout(()=>{e.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(f),e.removeEventListener("pointerdown",c),e.removeEventListener("click",r.current)}},[e,n]),{onPointerDownCapture:()=>s.current=!0}}function Y(t,e=globalThis?.document){const n=m.useCallbackRef(t),s=o.useRef(!1);return o.useEffect(()=>{const r=c=>{c.target&&!s.current&&S(K,n,{originalEvent:c},{discrete:!1})};return e.addEventListener("focusin",r),()=>e.removeEventListener("focusin",r)},[e,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function g(){const t=new CustomEvent(b);document.dispatchEvent(t)}function S(t,e,n,{discrete:s}){const r=n.originalEvent.target,c=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&r.addEventListener(t,e,{once:!0}),s?h.dispatchDiscreteCustomEvent(r,c):r.dispatchEvent(c)}exports.DismissableLayer=B;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use client";"use strict";const V=require("react"),x=require("./index-BqyOu62e.cjs"),v=require("./index-_XxjJPRD.cjs"),O=require("./index-cwZN7ZY3.cjs"),C=require("./index-WIv2ndLu.cjs"),B=require("./index-C8aODXfJ.cjs"),Z=require("./index-L8BhH23Y.cjs"),z=require("./index-CgAmFB15.cjs"),K=require("./index-CBuLZ39k.cjs"),j=require("./index-DE3jjVoC.cjs"),m=require("./index-CocSS1YK.cjs"),y=require("./index-_TfuLupy.cjs"),a=require("./jsx-runtime-BB_1_6y_.cjs");function U(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const i=U(V);function Y(e){const t=J(e),o=i.forwardRef((r,n)=>{const{children:s,...c}=r,l=i.Children.toArray(s),u=l.find(X);if(u){const p=u.props.children,g=l.map(R=>R===u?i.Children.count(p)>1?i.Children.only(null):i.isValidElement(p)?p.props.children:null:R);return a.jsxRuntimeExports.jsx(t,{...c,ref:n,children:i.isValidElement(p)?i.cloneElement(p,void 0,g):null})}return a.jsxRuntimeExports.jsx(t,{...c,ref:n,children:s})});return o.displayName=`${e}.Slot`,o}function J(e){const t=i.forwardRef((o,r)=>{const{children:n,...s}=o;if(i.isValidElement(n)){const c=te(n),l=ee(s,n.props);return n.type!==i.Fragment&&(l.ref=r?v.composeRefs(r,c):c),i.cloneElement(n,l)}return i.Children.count(n)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Q=Symbol("radix.slottable");function X(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Q}function ee(e,t){const o={...t};for(const r in t){const n=e[r],s=t[r];/^on[A-Z]/.test(r)?n&&s?o[r]=(...l)=>{const u=s(...l);return n(...l),u}:n&&(o[r]=n):r==="style"?o[r]={...n,...s}:r==="className"&&(o[r]=[n,s].filter(Boolean).join(" "))}return{...e,...o}}function te(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var D="Dialog",[I]=O.createContextScope(D),[oe,d]=I(D),N=e=>{const{__scopeDialog:t,children:o,open:r,defaultOpen:n,onOpenChange:s,modal:c=!0}=e,l=i.useRef(null),u=i.useRef(null),[p,g]=B.useControllableState({prop:r,defaultProp:n??!1,onChange:s,caller:D});return a.jsxRuntimeExports.jsx(oe,{scope:t,triggerRef:l,contentRef:u,contentId:C.useId(),titleId:C.useId(),descriptionId:C.useId(),open:p,onOpenChange:g,onOpenToggle:i.useCallback(()=>g(R=>!R),[g]),modal:c,children:o})};N.displayName=D;var b="DialogTrigger",T=i.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,n=d(b,o),s=v.useComposedRefs(t,n.triggerRef);return a.jsxRuntimeExports.jsx(m.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":P(n.open),...r,ref:s,onClick:x.composeEventHandlers(e.onClick,n.onOpenToggle)})});T.displayName=b;var _="DialogPortal",[ne,A]=I(_,{forceMount:void 0}),S=e=>{const{__scopeDialog:t,forceMount:o,children:r,container:n}=e,s=d(_,t);return a.jsxRuntimeExports.jsx(ne,{scope:t,forceMount:o,children:i.Children.map(r,c=>a.jsxRuntimeExports.jsx(j.Presence,{present:o||s.open,children:a.jsxRuntimeExports.jsx(K.Portal,{asChild:!0,container:n,children:c})}))})};S.displayName=_;var E="DialogOverlay",M=i.forwardRef((e,t)=>{const o=A(E,e.__scopeDialog),{forceMount:r=o.forceMount,...n}=e,s=d(E,e.__scopeDialog);return s.modal?a.jsxRuntimeExports.jsx(j.Presence,{present:r||s.open,children:a.jsxRuntimeExports.jsx(se,{...n,ref:t})}):null});M.displayName=E;var re=Y("DialogOverlay.RemoveScroll"),se=i.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,n=d(E,o);return a.jsxRuntimeExports.jsx(y.ReactRemoveScroll,{as:re,allowPinchZoom:!0,shards:[n.contentRef],children:a.jsxRuntimeExports.jsx(m.Primitive.div,{"data-state":P(n.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),f="DialogContent",w=i.forwardRef((e,t)=>{const o=A(f,e.__scopeDialog),{forceMount:r=o.forceMount,...n}=e,s=d(f,e.__scopeDialog);return a.jsxRuntimeExports.jsx(j.Presence,{present:r||s.open,children:s.modal?a.jsxRuntimeExports.jsx(ie,{...n,ref:t}):a.jsxRuntimeExports.jsx(ae,{...n,ref:t})})});w.displayName=f;var ie=i.forwardRef((e,t)=>{const o=d(f,e.__scopeDialog),r=i.useRef(null),n=v.useComposedRefs(t,o.contentRef,r);return i.useEffect(()=>{const s=r.current;if(s)return y.hideOthers(s)},[]),a.jsxRuntimeExports.jsx(F,{...e,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x.composeEventHandlers(e.onCloseAutoFocus,s=>{s.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:x.composeEventHandlers(e.onPointerDownOutside,s=>{const c=s.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0;(c.button===2||l)&&s.preventDefault()}),onFocusOutside:x.composeEventHandlers(e.onFocusOutside,s=>s.preventDefault())})}),ae=i.forwardRef((e,t)=>{const o=d(f,e.__scopeDialog),r=i.useRef(!1),n=i.useRef(!1);return a.jsxRuntimeExports.jsx(F,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||o.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const c=s.target;o.triggerRef.current?.contains(c)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),F=i.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:s,...c}=e,l=d(f,o),u=i.useRef(null),p=v.useComposedRefs(t,u);return y.useFocusGuards(),a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[a.jsxRuntimeExports.jsx(z.FocusScope,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:a.jsxRuntimeExports.jsx(Z.DismissableLayer,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":P(l.open),...c,ref:p,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[a.jsxRuntimeExports.jsx(le,{titleId:l.titleId}),a.jsxRuntimeExports.jsx(ue,{contentRef:u,descriptionId:l.descriptionId})]})]})}),h="DialogTitle",W=i.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,n=d(h,o);return a.jsxRuntimeExports.jsx(m.Primitive.h2,{id:n.titleId,...r,ref:t})});W.displayName=h;var $="DialogDescription",q=i.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,n=d($,o);return a.jsxRuntimeExports.jsx(m.Primitive.p,{id:n.descriptionId,...r,ref:t})});q.displayName=$;var L="DialogClose",k=i.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,n=d(L,o);return a.jsxRuntimeExports.jsx(m.Primitive.button,{type:"button",...r,ref:t,onClick:x.composeEventHandlers(e.onClick,()=>n.onOpenChange(!1))})});k.displayName=L;function P(e){return e?"open":"closed"}var G="DialogTitleWarning",[ve,H]=O.createContext2(G,{contentName:f,titleName:h,docsSlug:"dialog"}),le=({titleId:e})=>{const t=H(G),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2
|
+
|
|
3
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
|
+
|
|
5
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},ce="DialogDescriptionWarning",ue=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${H(ce).contentName}}.`;return i.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");t&&n&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},de=N,pe=T,fe=S,ge=M,xe=w,me=W,Re=q,Ee=k;exports.Close=Ee;exports.Content=xe;exports.Description=Re;exports.Overlay=ge;exports.Portal=fe;exports.Root=de;exports.Title=me;exports.Trigger=pe;
|