@gv-tech/ui-web 2.9.1 → 2.12.0
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.cjs.js +1 -0
- package/dist/accordion.d.ts +18 -0
- package/dist/accordion.es.js +259 -0
- package/dist/alert-dialog.cjs.js +7 -0
- package/dist/alert-dialog.d.ts +43 -0
- package/dist/alert-dialog.es.js +171 -0
- package/dist/alert.cjs.js +1 -0
- package/dist/alert.d.ts +18 -0
- package/dist/alert.es.js +32 -0
- package/dist/aspect-ratio.cjs.js +1 -0
- package/dist/aspect-ratio.d.ts +10 -0
- package/dist/aspect-ratio.es.js +43 -0
- package/dist/avatar.cjs.js +1 -0
- package/dist/avatar.d.ts +15 -0
- package/dist/avatar.es.js +205 -0
- package/dist/badge.cjs.js +1 -0
- package/dist/badge.d.ts +16 -0
- package/dist/badge.es.js +26 -0
- package/dist/breadcrumb.cjs.js +1 -0
- package/dist/breadcrumb.d.ts +35 -0
- package/dist/breadcrumb.es.js +69 -0
- package/dist/button.cjs.js +1 -0
- package/dist/button.d.ts +17 -0
- package/dist/button.es.js +40 -0
- package/dist/calendar.cjs.js +1 -0
- package/dist/calendar.d.ts +29 -0
- package/dist/calendar.es.js +2976 -0
- package/dist/card.cjs.js +1 -0
- package/dist/card.d.ts +19 -0
- package/dist/card.es.js +33 -0
- package/dist/carousel.cjs.js +1 -0
- package/dist/carousel.d.ts +50 -0
- package/dist/carousel.es.js +1403 -0
- package/dist/chart.cjs.js +16 -0
- package/dist/chart.d.ts +60 -0
- package/dist/chart.es.js +4402 -0
- package/dist/checkbox.cjs.js +1 -0
- package/dist/checkbox.d.ts +10 -0
- package/dist/checkbox.es.js +258 -0
- package/dist/collapsible.cjs.js +1 -0
- package/dist/collapsible.d.ts +20 -0
- package/dist/collapsible.es.js +7 -0
- package/dist/command.cjs.js +1 -0
- package/dist/command.d.ts +115 -0
- package/dist/command.es.js +396 -0
- package/dist/context-menu.cjs.js +1 -0
- package/dist/context-menu.d.ts +80 -0
- package/dist/context-menu.es.js +328 -0
- package/dist/dialog.cjs.js +1 -0
- package/dist/dialog.d.ts +31 -0
- package/dist/dialog.es.js +66 -0
- package/dist/drawer.cjs.js +3 -0
- package/dist/drawer.d.ts +65 -0
- package/dist/drawer.es.js +1085 -0
- package/dist/dropdown-menu.cjs.js +1 -0
- package/dist/dropdown-menu.d.ts +80 -0
- package/dist/dropdown-menu.es.js +316 -0
- package/dist/form.cjs.js +1 -0
- package/dist/form.d.ts +53 -0
- package/dist/form.es.js +355 -0
- package/dist/hover-card.cjs.js +1 -0
- package/dist/hover-card.d.ts +19 -0
- package/dist/hover-card.es.js +188 -0
- package/dist/index-0ioNhtNM.mjs +10 -0
- package/dist/index-3j-XAIXT.mjs +55 -0
- package/dist/index-B2XtpfGY.js +1 -0
- package/dist/index-B39Lzq0v.js +1 -0
- package/dist/index-B7n6fy75.js +1 -0
- package/dist/index-B8dxbSWX.js +41 -0
- package/dist/index-BGIK9FQF.js +1 -0
- package/dist/index-BZPx6jYI.mjs +8 -0
- package/dist/index-BoNjHhm4.js +1 -0
- package/dist/index-BtZvtDmp.js +1 -0
- package/dist/index-Bv7qrYW6.mjs +180 -0
- package/dist/index-ByiPJW53.js +5 -0
- package/dist/index-C0dlIQIi.js +1 -0
- package/dist/index-C1qb0595.mjs +27 -0
- package/dist/index-C7HEunrh.mjs +15 -0
- package/dist/index-C8ni3LLa.js +1 -0
- package/dist/index-CCKe-Mpx.mjs +6 -0
- package/dist/index-CD6_IrA-.mjs +10 -0
- package/dist/index-CRyCZJLa.mjs +677 -0
- package/dist/index-CVx1AgNG.mjs +615 -0
- package/dist/index-Ce5TOFAK.js +1 -0
- package/dist/index-CeSLNJ60.mjs +32 -0
- package/dist/index-CefEQe_4.js +1 -0
- package/dist/index-Cj5hzyBi.js +1 -0
- package/dist/index-Cjj_rUPu.js +1 -0
- package/dist/index-Cl3G0jzM.js +1 -0
- package/dist/index-CsjrqSSN.js +1 -0
- package/dist/index-CwfE56Ep.mjs +1545 -0
- package/dist/index-CwyAfCwY.js +1 -0
- package/dist/index-CzY-WZXL.js +1 -0
- package/dist/index-D2HnlO3y.js +1 -0
- package/dist/index-DAWHN3cH.mjs +85 -0
- package/dist/index-DFdF7K7v.mjs +50 -0
- package/dist/index-DIsg7zU7.js +1 -0
- package/dist/index-DKN_vhyX.mjs +32 -0
- package/dist/index-DLcqcWxM.mjs +29 -0
- package/dist/index-DSxf1gN6.mjs +118 -0
- package/dist/index-DYxWvftI.js +1 -0
- package/dist/index-DaILh3TV.mjs +32 -0
- package/dist/index-Dfzl8TxY.mjs +136 -0
- package/dist/index-Dko2XdTk.js +1 -0
- package/dist/index-DlY82G31.mjs +245 -0
- package/dist/index-DnFcfnA9.mjs +13 -0
- package/dist/index-IZ2gq03c.mjs +68 -0
- package/dist/index-K9FzbxYw.mjs +93 -0
- package/dist/index-Le8p9oP4.mjs +60 -0
- package/dist/index-MQ0c3ZX_.js +1 -0
- package/dist/index-_XxjJPRD.js +1 -0
- package/dist/index-_wdrnYim.js +1 -0
- package/dist/index-jv3B4mTd.js +1 -0
- package/dist/index-kaM0u2Q1.js +1 -0
- package/dist/index-p6xVFRb4.mjs +52 -0
- package/dist/index-rKs9bXHr.mjs +6 -0
- package/dist/index-vuPgkS0V.mjs +70 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.ts +1288 -0
- package/dist/index.es.js +289 -0
- package/dist/input.cjs.js +1 -0
- package/dist/input.d.ts +9 -0
- package/dist/input.es.js +19 -0
- package/dist/jsx-runtime-nZSsnGb7.js +6 -0
- package/dist/jsx-runtime-tc70JA_2.mjs +264 -0
- package/dist/label.cjs.js +1 -0
- package/dist/label.d.ts +11 -0
- package/dist/label.es.js +22 -0
- package/dist/menubar.cjs.js +1 -0
- package/dist/menubar.d.ts +79 -0
- package/dist/menubar.es.js +473 -0
- package/dist/navigation-menu.cjs.js +1 -0
- package/dist/navigation-menu.d.ts +47 -0
- package/dist/navigation-menu.es.js +673 -0
- package/dist/pagination.cjs.js +1 -0
- package/dist/pagination.d.ts +68 -0
- package/dist/pagination.es.js +68 -0
- package/dist/popover.cjs.js +1 -0
- package/dist/popover.d.ts +24 -0
- package/dist/popover.es.js +242 -0
- package/dist/progress.cjs.js +6 -0
- package/dist/progress.d.ts +9 -0
- package/dist/progress.es.js +99 -0
- package/dist/radio-group.cjs.js +1 -0
- package/dist/radio-group.d.ts +16 -0
- package/dist/radio-group.es.js +253 -0
- package/dist/resizable.cjs.js +1 -0
- package/dist/resizable.d.ts +22 -0
- package/dist/resizable.es.js +1990 -0
- package/dist/scroll-area.cjs.js +1 -0
- package/dist/scroll-area.d.ts +14 -0
- package/dist/scroll-area.es.js +546 -0
- package/dist/search.cjs.js +1 -0
- package/dist/search.d.ts +15 -0
- package/dist/search.es.js +51 -0
- package/dist/select.cjs.js +1 -0
- package/dist/select.d.ts +54 -0
- package/dist/select.es.js +908 -0
- package/dist/separator.cjs.js +1 -0
- package/dist/separator.d.ts +9 -0
- package/dist/separator.es.js +35 -0
- package/dist/sheet.cjs.js +1 -0
- package/dist/sheet.d.ts +68 -0
- package/dist/sheet.es.js +66 -0
- package/dist/skeleton.cjs.js +1 -0
- package/dist/skeleton.d.ts +9 -0
- package/dist/skeleton.es.js +8 -0
- package/dist/slider.cjs.js +1 -0
- package/dist/slider.d.ts +9 -0
- package/dist/slider.es.js +442 -0
- package/dist/sonner.cjs.js +1 -0
- package/dist/sonner.d.ts +10 -0
- package/dist/sonner.es.js +764 -0
- package/dist/switch.cjs.js +1 -0
- package/dist/switch.d.ts +9 -0
- package/dist/switch.es.js +149 -0
- package/dist/table.cjs.js +1 -0
- package/dist/table.d.ts +43 -0
- package/dist/table.es.js +57 -0
- package/dist/tabs.cjs.js +1 -0
- package/dist/tabs.d.ts +24 -0
- package/dist/tabs.es.js +195 -0
- package/dist/text.cjs.js +1 -0
- package/dist/text.d.ts +17 -0
- package/dist/text.es.js +42 -0
- package/dist/textarea.cjs.js +1 -0
- package/dist/textarea.d.ts +9 -0
- package/dist/textarea.es.js +18 -0
- package/dist/theme-provider.cjs.js +1 -0
- package/dist/theme-provider.d.ts +9 -0
- package/dist/theme-provider.es.js +8 -0
- package/dist/theme-toggle.cjs.js +1 -0
- package/dist/theme-toggle.d.ts +8 -0
- package/dist/theme-toggle.es.js +78 -0
- package/dist/toast.cjs.js +1 -0
- package/dist/toast.d.ts +26 -0
- package/dist/toast.es.js +494 -0
- package/dist/toaster-CIpfms4W.js +1 -0
- package/dist/toaster-jBYXAPRk.mjs +118 -0
- package/dist/toaster.cjs.js +1 -0
- package/dist/toaster.d.ts +6 -0
- package/dist/toaster.es.js +6 -0
- package/dist/toggle-group.cjs.js +1 -0
- package/dist/toggle-group.d.ts +18 -0
- package/dist/toggle-group.es.js +170 -0
- package/dist/toggle.cjs.js +1 -0
- package/dist/toggle.d.ts +14 -0
- package/dist/toggle.es.js +14 -0
- package/dist/tooltip.cjs.js +1 -0
- package/dist/tooltip.d.ts +25 -0
- package/dist/tooltip.es.js +342 -0
- package/dist/utils-B6yFEsav.mjs +8 -0
- package/dist/utils-IjLH3w2e.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("react"),l=require("react-dom"),f=require("./index-BtZvtDmp.js"),d=require("./index-MQ0c3ZX_.js"),p=require("./jsx-runtime-nZSsnGb7.js");function m(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const a=m(u);var P="Portal",c=a.forwardRef((e,r)=>{const{container:t,...n}=e,[s,i]=a.useState(!1);d.useLayoutEffect2(()=>i(!0),[]);const o=t||s&&globalThis?.document?.body;return o?l.createPortal(p.jsxRuntimeExports.jsx(f.Primitive.div,{...n,ref:r}),o):null});c.displayName=P;exports.Portal=c;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("react");function a(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const c in e)if(c!=="default"){const n=Object.getOwnPropertyDescriptor(e,c);Object.defineProperty(t,c,n.get?n:{enumerable:!0,get:()=>e[c]})}}return t.default=e,Object.freeze(t)}const r=a(u);function o(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...c)=>t.current?.(...c),[])}exports.useCallbackRef=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const b=require("react"),v=require("./jsx-runtime-nZSsnGb7.js");function j(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const i=j(b);function P(e,o){const t=i.createContext(o),s=c=>{const{children:n,...r}=c,u=i.useMemo(()=>r,Object.values(r));return v.jsxRuntimeExports.jsx(t.Provider,{value:u,children:n})};s.displayName=e+"Provider";function a(c){const n=i.useContext(t);if(n)return n;if(o!==void 0)return o;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[s,a]}function _(e,o=[]){let t=[];function s(c,n){const r=i.createContext(n),u=t.length;t=[...t,n];const d=p=>{const{scope:f,children:l,...x}=p,C=f?.[e]?.[u]||r,S=i.useMemo(()=>x,Object.values(x));return v.jsxRuntimeExports.jsx(C.Provider,{value:S,children:l})};d.displayName=c+"Provider";function m(p,f){const l=f?.[e]?.[u]||r,x=i.useContext(l);if(x)return x;if(n!==void 0)return n;throw new Error(`\`${p}\` must be used within \`${c}\``)}return[d,m]}const a=()=>{const c=t.map(n=>i.createContext(n));return function(r){const u=r?.[e]||c;return i.useMemo(()=>({[`__scope${e}`]:{...r,[e]:u}}),[r,u])}};return a.scopeName=e,[s,h(a,...o)]}function h(...e){const o=e[0];if(e.length===1)return o;const t=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(c){const n=s.reduce((r,{useScope:u,scopeName:d})=>{const p=u(c)[`__scope${d}`];return{...r,...p}},{});return i.useMemo(()=>({[`__scope${o.scopeName}`]:n}),[n])}};return t.scopeName=o.scopeName,t}exports.createContext2=P;exports.createContextScope=_;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as t from "react";
|
|
2
|
+
var K = (e, i, a, u, m, l, d, h) => {
|
|
3
|
+
let c = document.documentElement, v = ["light", "dark"];
|
|
4
|
+
function f(r) {
|
|
5
|
+
(Array.isArray(e) ? e : [e]).forEach((y) => {
|
|
6
|
+
let S = y === "class", k = S && l ? m.map((b) => l[b] || b) : m;
|
|
7
|
+
S ? (c.classList.remove(...k), c.classList.add(l && l[r] ? l[r] : r)) : c.setAttribute(y, r);
|
|
8
|
+
}), C(r);
|
|
9
|
+
}
|
|
10
|
+
function C(r) {
|
|
11
|
+
h && v.includes(r) && (c.style.colorScheme = r);
|
|
12
|
+
}
|
|
13
|
+
function s() {
|
|
14
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
15
|
+
}
|
|
16
|
+
if (u) f(u);
|
|
17
|
+
else try {
|
|
18
|
+
let r = localStorage.getItem(i) || a, y = d && r === "system" ? s() : r;
|
|
19
|
+
f(y);
|
|
20
|
+
} catch {
|
|
21
|
+
}
|
|
22
|
+
}, I = ["light", "dark"], P = "(prefers-color-scheme: dark)", N = typeof window > "u", A = t.createContext(void 0), V = { setTheme: (e) => {
|
|
23
|
+
}, themes: [] }, $ = () => {
|
|
24
|
+
var e;
|
|
25
|
+
return (e = t.useContext(A)) != null ? e : V;
|
|
26
|
+
}, j = (e) => t.useContext(A) ? t.createElement(t.Fragment, null, e.children) : t.createElement(_, { ...e }), W = ["light", "dark"], _ = ({ forcedTheme: e, disableTransitionOnChange: i = !1, enableSystem: a = !0, enableColorScheme: u = !0, storageKey: m = "theme", themes: l = W, defaultTheme: d = a ? "system" : "light", attribute: h = "data-theme", value: c, children: v, nonce: f, scriptProps: C }) => {
|
|
27
|
+
let [s, r] = t.useState(() => J(m, d)), [y, S] = t.useState(() => s === "system" ? L() : s), k = c ? Object.values(c) : l, b = t.useCallback((n) => {
|
|
28
|
+
let o = n;
|
|
29
|
+
if (!o) return;
|
|
30
|
+
n === "system" && a && (o = L());
|
|
31
|
+
let g = c ? c[o] : o, x = i ? R(f) : null, w = document.documentElement, M = (p) => {
|
|
32
|
+
p === "class" ? (w.classList.remove(...k), g && w.classList.add(g)) : p.startsWith("data-") && (g ? w.setAttribute(p, g) : w.removeAttribute(p));
|
|
33
|
+
};
|
|
34
|
+
if (Array.isArray(h) ? h.forEach(M) : M(h), u) {
|
|
35
|
+
let p = I.includes(d) ? d : null, H = I.includes(o) ? o : p;
|
|
36
|
+
w.style.colorScheme = H;
|
|
37
|
+
}
|
|
38
|
+
x?.();
|
|
39
|
+
}, [f]), E = t.useCallback((n) => {
|
|
40
|
+
let o = typeof n == "function" ? n(s) : n;
|
|
41
|
+
r(o);
|
|
42
|
+
try {
|
|
43
|
+
localStorage.setItem(m, o);
|
|
44
|
+
} catch {
|
|
45
|
+
}
|
|
46
|
+
}, [s]), T = t.useCallback((n) => {
|
|
47
|
+
let o = L(n);
|
|
48
|
+
S(o), s === "system" && a && !e && b("system");
|
|
49
|
+
}, [s, e]);
|
|
50
|
+
t.useEffect(() => {
|
|
51
|
+
let n = window.matchMedia(P);
|
|
52
|
+
return n.addListener(T), T(n), () => n.removeListener(T);
|
|
53
|
+
}, [T]), t.useEffect(() => {
|
|
54
|
+
let n = (o) => {
|
|
55
|
+
o.key === m && (o.newValue ? r(o.newValue) : E(d));
|
|
56
|
+
};
|
|
57
|
+
return window.addEventListener("storage", n), () => window.removeEventListener("storage", n);
|
|
58
|
+
}, [E]), t.useEffect(() => {
|
|
59
|
+
b(e ?? s);
|
|
60
|
+
}, [e, s]);
|
|
61
|
+
let O = t.useMemo(() => ({ theme: s, setTheme: E, forcedTheme: e, resolvedTheme: s === "system" ? y : s, themes: a ? [...l, "system"] : l, systemTheme: a ? y : void 0 }), [s, E, e, y, a, l]);
|
|
62
|
+
return t.createElement(A.Provider, { value: O }, t.createElement(z, { forcedTheme: e, storageKey: m, attribute: h, enableSystem: a, enableColorScheme: u, defaultTheme: d, value: c, themes: l, nonce: f, scriptProps: C }), v);
|
|
63
|
+
}, z = t.memo(({ forcedTheme: e, storageKey: i, attribute: a, enableSystem: u, enableColorScheme: m, defaultTheme: l, value: d, themes: h, nonce: c, scriptProps: v }) => {
|
|
64
|
+
let f = JSON.stringify([a, i, l, e, h, d, u, m]).slice(1, -1);
|
|
65
|
+
return t.createElement("script", { ...v, suppressHydrationWarning: !0, nonce: typeof window > "u" ? c : "", dangerouslySetInnerHTML: { __html: `(${K.toString()})(${f})` } });
|
|
66
|
+
}), J = (e, i) => {
|
|
67
|
+
if (N) return;
|
|
68
|
+
let a;
|
|
69
|
+
try {
|
|
70
|
+
a = localStorage.getItem(e) || void 0;
|
|
71
|
+
} catch {
|
|
72
|
+
}
|
|
73
|
+
return a || i;
|
|
74
|
+
}, R = (e) => {
|
|
75
|
+
let i = document.createElement("style");
|
|
76
|
+
return e && i.setAttribute("nonce", e), i.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")), document.head.appendChild(i), () => {
|
|
77
|
+
window.getComputedStyle(document.body), setTimeout(() => {
|
|
78
|
+
document.head.removeChild(i);
|
|
79
|
+
}, 1);
|
|
80
|
+
};
|
|
81
|
+
}, L = (e) => (e || (e = window.matchMedia(P)), e.matches ? "dark" : "light");
|
|
82
|
+
export {
|
|
83
|
+
j as J,
|
|
84
|
+
$ as z
|
|
85
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import r from "react";
|
|
2
|
+
import { c as y } from "./index-IZ2gq03c.mjs";
|
|
3
|
+
import { u as S } from "./index-DLcqcWxM.mjs";
|
|
4
|
+
import { a as M } from "./index-K9FzbxYw.mjs";
|
|
5
|
+
import { j as d } from "./jsx-runtime-tc70JA_2.mjs";
|
|
6
|
+
function D(s) {
|
|
7
|
+
const m = s + "CollectionProvider", [A, E] = y(m), [N, a] = A(
|
|
8
|
+
m,
|
|
9
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
10
|
+
), p = (c) => {
|
|
11
|
+
const { scope: e, children: l } = c, o = r.useRef(null), t = r.useRef(/* @__PURE__ */ new Map()).current;
|
|
12
|
+
return /* @__PURE__ */ d.jsx(N, { scope: e, itemMap: t, collectionRef: o, children: l });
|
|
13
|
+
};
|
|
14
|
+
p.displayName = m;
|
|
15
|
+
const f = s + "CollectionSlot", _ = M(f), C = r.forwardRef(
|
|
16
|
+
(c, e) => {
|
|
17
|
+
const { scope: l, children: o } = c, t = a(f, l), n = S(e, t.collectionRef);
|
|
18
|
+
return /* @__PURE__ */ d.jsx(_, { ref: n, children: o });
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
C.displayName = f;
|
|
22
|
+
const u = s + "CollectionItemSlot", R = "data-radix-collection-item", T = M(u), x = r.forwardRef(
|
|
23
|
+
(c, e) => {
|
|
24
|
+
const { scope: l, children: o, ...t } = c, n = r.useRef(null), I = S(e, n), i = a(u, l);
|
|
25
|
+
return r.useEffect(() => (i.itemMap.set(n, { ref: n, ...t }), () => {
|
|
26
|
+
i.itemMap.delete(n);
|
|
27
|
+
})), /* @__PURE__ */ d.jsx(T, { [R]: "", ref: I, children: o });
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
x.displayName = u;
|
|
31
|
+
function O(c) {
|
|
32
|
+
const e = a(s + "CollectionConsumer", c);
|
|
33
|
+
return r.useCallback(() => {
|
|
34
|
+
const o = e.collectionRef.current;
|
|
35
|
+
if (!o) return [];
|
|
36
|
+
const t = Array.from(o.querySelectorAll(`[${R}]`));
|
|
37
|
+
return Array.from(e.itemMap.values()).sort(
|
|
38
|
+
(i, v) => t.indexOf(i.ref.current) - t.indexOf(v.ref.current)
|
|
39
|
+
);
|
|
40
|
+
}, [e.collectionRef, e.itemMap]);
|
|
41
|
+
}
|
|
42
|
+
return [
|
|
43
|
+
{ Provider: p, Slot: C, ItemSlot: x },
|
|
44
|
+
O,
|
|
45
|
+
E
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
D as c
|
|
50
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const H=require("react"),d=require("./index-BtZvtDmp.js"),$=require("./index-BGIK9FQF.js"),B=require("./index-_XxjJPRD.js"),Y=require("./index-D2HnlO3y.js"),z=require("./index-CefEQe_4.js"),V=require("./index-CzY-WZXL.js"),J=require("./index-Ce5TOFAK.js"),Q=require("./index-Dko2XdTk.js"),p=require("./jsx-runtime-nZSsnGb7.js");function W(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,t.get?t:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const c=W(H);var y="rovingFocusGroup.onEntryFocus",X={bubbles:!1,cancelable:!0},b="RovingFocusGroup",[j,P,Z]=$.createCollection(b),[ee,te]=Y.createContextScope(b,[Z]),[oe,re]=ee(b),D=c.forwardRef((e,o)=>p.jsxRuntimeExports.jsx(j.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsxRuntimeExports.jsx(j.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsxRuntimeExports.jsx(ne,{...e,ref:o})})}));D.displayName=b;var ne=c.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:r,orientation:t,loop:F=!1,dir:S,currentTabStopId:v,defaultCurrentTabStopId:T,onCurrentTabStopIdChange:w,onEntryFocus:m,preventScrollOnEntryFocus:u=!1,...I}=e,R=c.useRef(null),g=B.useComposedRefs(o,R),x=Q.useDirection(S),[E,n]=J.useControllableState({prop:v,defaultProp:T??null,onChange:w,caller:b}),[a,C]=c.useState(!1),i=V.useCallbackRef(m),l=P(r),_=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]),p.jsxRuntimeExports.jsx(oe,{scope:r,orientation:t,dir:x,loop:F,currentTabStopId:E,onItemFocus:c.useCallback(s=>n(s),[n]),onItemShiftTab:c.useCallback(()=>C(!0),[]),onFocusableItemAdd:c.useCallback(()=>A(s=>s+1),[]),onFocusableItemRemove:c.useCallback(()=>A(s=>s-1),[]),children:p.jsxRuntimeExports.jsx(d.Primitive.div,{tabIndex:a||K===0?-1:0,"data-orientation":t,...I,ref:g,style:{outline:"none",...e.style},onMouseDown:d.composeEventHandlers(e.onMouseDown,()=>{_.current=!0}),onFocus:d.composeEventHandlers(e.onFocus,s=>{const M=!_.current;if(s.target===s.currentTarget&&M&&!a){const O=new CustomEvent(y,X);if(s.currentTarget.dispatchEvent(O),!O.defaultPrevented){const h=l().filter(f=>f.focusable),k=h.find(f=>f.active),L=h.find(f=>f.id===E),U=[k,L,...h].filter(Boolean).map(f=>f.ref.current);q(U,u)}}_.current=!1}),onBlur:d.composeEventHandlers(e.onBlur,()=>C(!1))})})}),G="RovingFocusGroupItem",N=c.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:r,focusable:t=!0,active:F=!1,tabStopId:S,children:v,...T}=e,w=z.useId(),m=S||w,u=re(G,r),I=u.currentTabStopId===m,R=P(r),{onFocusableItemAdd:g,onFocusableItemRemove:x,currentTabStopId:E}=u;return c.useEffect(()=>{if(t)return g(),()=>x()},[t,g,x]),p.jsxRuntimeExports.jsx(j.ItemSlot,{scope:r,id:m,focusable:t,active:F,children:p.jsxRuntimeExports.jsx(d.Primitive.span,{tabIndex:I?0:-1,"data-orientation":u.orientation,...T,ref:o,onMouseDown:d.composeEventHandlers(e.onMouseDown,n=>{t?u.onItemFocus(m):n.preventDefault()}),onFocus:d.composeEventHandlers(e.onFocus,()=>u.onItemFocus(m)),onKeyDown:d.composeEventHandlers(e.onKeyDown,n=>{if(n.key==="Tab"&&n.shiftKey){u.onItemShiftTab();return}if(n.target!==n.currentTarget)return;const a=ue(n,u.orientation,u.dir);if(a!==void 0){if(n.metaKey||n.ctrlKey||n.altKey||n.shiftKey)return;n.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(n.currentTarget);i=u.loop?ie(i,l+1):i.slice(l+1)}setTimeout(()=>q(i))}}),children:typeof v=="function"?v({isCurrentTabStop:I,hasTabStop:E!=null}):v})})});N.displayName=G;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,r){const t=ce(e.key,r);if(!(o==="vertical"&&["ArrowLeft","ArrowRight"].includes(t))&&!(o==="horizontal"&&["ArrowUp","ArrowDown"].includes(t)))return se[t]}function q(e,o=!1){const r=document.activeElement;for(const t of e)if(t===r||(t.focus({preventScroll:o}),document.activeElement!==r))return}function ie(e,o){return e.map((r,t)=>e[(o+t)%e.length])}var ae=D,le=N;exports.Item=le;exports.Root=ae;exports.createRovingFocusGroupScope=te;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { P as o } from "./index-K9FzbxYw.mjs";
|
|
3
|
+
import { j as t } from "./jsx-runtime-tc70JA_2.mjs";
|
|
4
|
+
var s = Object.freeze({
|
|
5
|
+
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
6
|
+
position: "absolute",
|
|
7
|
+
border: 0,
|
|
8
|
+
width: 1,
|
|
9
|
+
height: 1,
|
|
10
|
+
padding: 0,
|
|
11
|
+
margin: -1,
|
|
12
|
+
overflow: "hidden",
|
|
13
|
+
clip: "rect(0, 0, 0, 0)",
|
|
14
|
+
whiteSpace: "nowrap",
|
|
15
|
+
wordWrap: "normal"
|
|
16
|
+
}), d = "VisuallyHidden", a = i.forwardRef(
|
|
17
|
+
(r, e) => /* @__PURE__ */ t.jsx(
|
|
18
|
+
o.span,
|
|
19
|
+
{
|
|
20
|
+
...r,
|
|
21
|
+
ref: e,
|
|
22
|
+
style: { ...s, ...r.style }
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
);
|
|
26
|
+
a.displayName = d;
|
|
27
|
+
var n = a;
|
|
28
|
+
export {
|
|
29
|
+
n as R,
|
|
30
|
+
s as V,
|
|
31
|
+
a
|
|
32
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
function s(n, o) {
|
|
3
|
+
if (typeof n == "function")
|
|
4
|
+
return n(o);
|
|
5
|
+
n != null && (n.current = o);
|
|
6
|
+
}
|
|
7
|
+
function f(...n) {
|
|
8
|
+
return (o) => {
|
|
9
|
+
let u = !1;
|
|
10
|
+
const c = n.map((t) => {
|
|
11
|
+
const e = s(t, o);
|
|
12
|
+
return !u && typeof e == "function" && (u = !0), e;
|
|
13
|
+
});
|
|
14
|
+
if (u)
|
|
15
|
+
return () => {
|
|
16
|
+
for (let t = 0; t < c.length; t++) {
|
|
17
|
+
const e = c[t];
|
|
18
|
+
typeof e == "function" ? e() : s(n[t], null);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function i(...n) {
|
|
24
|
+
return l.useCallback(f(...n), n);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
f as c,
|
|
28
|
+
i as u
|
|
29
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
import { P as v, c as I } from "./index-K9FzbxYw.mjs";
|
|
3
|
+
import { c as O } from "./index-IZ2gq03c.mjs";
|
|
4
|
+
import { u as S } from "./index-p6xVFRb4.mjs";
|
|
5
|
+
import { u as D } from "./index-CCKe-Mpx.mjs";
|
|
6
|
+
import { u as M } from "./index-DLcqcWxM.mjs";
|
|
7
|
+
import { P as L } from "./index-vuPgkS0V.mjs";
|
|
8
|
+
import { u as k } from "./index-DnFcfnA9.mjs";
|
|
9
|
+
import { j as c } from "./jsx-runtime-tc70JA_2.mjs";
|
|
10
|
+
var f = "Collapsible", [F, V] = O(f), [B, g] = F(f), T = o.forwardRef(
|
|
11
|
+
(e, s) => {
|
|
12
|
+
const {
|
|
13
|
+
__scopeCollapsible: r,
|
|
14
|
+
open: a,
|
|
15
|
+
defaultOpen: t,
|
|
16
|
+
disabled: l,
|
|
17
|
+
onOpenChange: i,
|
|
18
|
+
...m
|
|
19
|
+
} = e, [d, p] = S({
|
|
20
|
+
prop: a,
|
|
21
|
+
defaultProp: t ?? !1,
|
|
22
|
+
onChange: i,
|
|
23
|
+
caller: f
|
|
24
|
+
});
|
|
25
|
+
return /* @__PURE__ */ c.jsx(
|
|
26
|
+
B,
|
|
27
|
+
{
|
|
28
|
+
scope: r,
|
|
29
|
+
disabled: l,
|
|
30
|
+
contentId: k(),
|
|
31
|
+
open: d,
|
|
32
|
+
onOpenToggle: o.useCallback(() => p((C) => !C), [p]),
|
|
33
|
+
children: /* @__PURE__ */ c.jsx(
|
|
34
|
+
v.div,
|
|
35
|
+
{
|
|
36
|
+
"data-state": x(d),
|
|
37
|
+
"data-disabled": l ? "" : void 0,
|
|
38
|
+
...m,
|
|
39
|
+
ref: s
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
T.displayName = f;
|
|
47
|
+
var j = "CollapsibleTrigger", w = o.forwardRef(
|
|
48
|
+
(e, s) => {
|
|
49
|
+
const { __scopeCollapsible: r, ...a } = e, t = g(j, r);
|
|
50
|
+
return /* @__PURE__ */ c.jsx(
|
|
51
|
+
v.button,
|
|
52
|
+
{
|
|
53
|
+
type: "button",
|
|
54
|
+
"aria-controls": t.contentId,
|
|
55
|
+
"aria-expanded": t.open || !1,
|
|
56
|
+
"data-state": x(t.open),
|
|
57
|
+
"data-disabled": t.disabled ? "" : void 0,
|
|
58
|
+
disabled: t.disabled,
|
|
59
|
+
...a,
|
|
60
|
+
ref: s,
|
|
61
|
+
onClick: I(e.onClick, t.onOpenToggle)
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
w.displayName = j;
|
|
67
|
+
var R = "CollapsibleContent", A = o.forwardRef(
|
|
68
|
+
(e, s) => {
|
|
69
|
+
const { forceMount: r, ...a } = e, t = g(R, e.__scopeCollapsible);
|
|
70
|
+
return /* @__PURE__ */ c.jsx(L, { present: r || t.open, children: ({ present: l }) => /* @__PURE__ */ c.jsx(G, { ...a, ref: s, present: l }) });
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
A.displayName = R;
|
|
74
|
+
var G = o.forwardRef((e, s) => {
|
|
75
|
+
const { __scopeCollapsible: r, present: a, children: t, ...l } = e, i = g(R, r), [m, d] = o.useState(a), p = o.useRef(null), C = M(s, p), h = o.useRef(0), P = h.current, y = o.useRef(0), N = y.current, b = i.open || m, _ = o.useRef(b), u = o.useRef(void 0);
|
|
76
|
+
return o.useEffect(() => {
|
|
77
|
+
const n = requestAnimationFrame(() => _.current = !1);
|
|
78
|
+
return () => cancelAnimationFrame(n);
|
|
79
|
+
}, []), D(() => {
|
|
80
|
+
const n = p.current;
|
|
81
|
+
if (n) {
|
|
82
|
+
u.current = u.current || {
|
|
83
|
+
transitionDuration: n.style.transitionDuration,
|
|
84
|
+
animationName: n.style.animationName
|
|
85
|
+
}, n.style.transitionDuration = "0s", n.style.animationName = "none";
|
|
86
|
+
const E = n.getBoundingClientRect();
|
|
87
|
+
h.current = E.height, y.current = E.width, _.current || (n.style.transitionDuration = u.current.transitionDuration, n.style.animationName = u.current.animationName), d(a);
|
|
88
|
+
}
|
|
89
|
+
}, [i.open, a]), /* @__PURE__ */ c.jsx(
|
|
90
|
+
v.div,
|
|
91
|
+
{
|
|
92
|
+
"data-state": x(i.open),
|
|
93
|
+
"data-disabled": i.disabled ? "" : void 0,
|
|
94
|
+
id: i.contentId,
|
|
95
|
+
hidden: !b,
|
|
96
|
+
...l,
|
|
97
|
+
ref: C,
|
|
98
|
+
style: {
|
|
99
|
+
"--radix-collapsible-content-height": P ? `${P}px` : void 0,
|
|
100
|
+
"--radix-collapsible-content-width": N ? `${N}px` : void 0,
|
|
101
|
+
...e.style
|
|
102
|
+
},
|
|
103
|
+
children: b && t
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
});
|
|
107
|
+
function x(e) {
|
|
108
|
+
return e ? "open" : "closed";
|
|
109
|
+
}
|
|
110
|
+
var W = T, X = w, Y = A;
|
|
111
|
+
export {
|
|
112
|
+
A as C,
|
|
113
|
+
W as R,
|
|
114
|
+
X as T,
|
|
115
|
+
w as a,
|
|
116
|
+
Y as b,
|
|
117
|
+
V as c
|
|
118
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("react");function o(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const u=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,u.get?u:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const n=o(c);function s(e){const r=n.useRef({value:e,previous:e});return n.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}exports.usePrevious=s;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as n from "react";
|
|
2
|
+
import "react-dom";
|
|
3
|
+
import { c as f } from "./index-Le8p9oP4.mjs";
|
|
4
|
+
import { j as l } from "./jsx-runtime-tc70JA_2.mjs";
|
|
5
|
+
var u = [
|
|
6
|
+
"a",
|
|
7
|
+
"button",
|
|
8
|
+
"div",
|
|
9
|
+
"form",
|
|
10
|
+
"h2",
|
|
11
|
+
"h3",
|
|
12
|
+
"img",
|
|
13
|
+
"input",
|
|
14
|
+
"label",
|
|
15
|
+
"li",
|
|
16
|
+
"nav",
|
|
17
|
+
"ol",
|
|
18
|
+
"p",
|
|
19
|
+
"select",
|
|
20
|
+
"span",
|
|
21
|
+
"svg",
|
|
22
|
+
"ul"
|
|
23
|
+
], w = u.reduce((t, i) => {
|
|
24
|
+
const o = f(`Primitive.${i}`), r = n.forwardRef((e, a) => {
|
|
25
|
+
const { asChild: m, ...s } = e, p = m ? o : i;
|
|
26
|
+
return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ l.jsx(p, { ...s, ref: a });
|
|
27
|
+
});
|
|
28
|
+
return r.displayName = `Primitive.${i}`, { ...t, [i]: r };
|
|
29
|
+
}, {});
|
|
30
|
+
export {
|
|
31
|
+
w as P
|
|
32
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { P as R, c as h, d as j } from "./index-K9FzbxYw.mjs";
|
|
3
|
+
import { u as g } from "./index-DLcqcWxM.mjs";
|
|
4
|
+
import { u as m } from "./index-0ioNhtNM.mjs";
|
|
5
|
+
import { j as x } from "./jsx-runtime-tc70JA_2.mjs";
|
|
6
|
+
function z(n, e = globalThis?.document) {
|
|
7
|
+
const t = m(n);
|
|
8
|
+
i.useEffect(() => {
|
|
9
|
+
const o = (s) => {
|
|
10
|
+
s.key === "Escape" && t(s);
|
|
11
|
+
};
|
|
12
|
+
return e.addEventListener("keydown", o, { capture: !0 }), () => e.removeEventListener("keydown", o, { capture: !0 });
|
|
13
|
+
}, [t, e]);
|
|
14
|
+
}
|
|
15
|
+
var H = "DismissableLayer", p = "dismissableLayer.update", K = "dismissableLayer.pointerDownOutside", M = "dismissableLayer.focusOutside", C, B = i.createContext({
|
|
16
|
+
layers: /* @__PURE__ */ new Set(),
|
|
17
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
18
|
+
branches: /* @__PURE__ */ new Set()
|
|
19
|
+
}), T = i.forwardRef(
|
|
20
|
+
(n, e) => {
|
|
21
|
+
const {
|
|
22
|
+
disableOutsidePointerEvents: t = !1,
|
|
23
|
+
onEscapeKeyDown: o,
|
|
24
|
+
onPointerDownOutside: s,
|
|
25
|
+
onFocusOutside: c,
|
|
26
|
+
onInteractOutside: f,
|
|
27
|
+
onDismiss: d,
|
|
28
|
+
...E
|
|
29
|
+
} = n, a = i.useContext(B), [u, S] = i.useState(null), l = u?.ownerDocument ?? globalThis?.document, [, W] = i.useState({}), k = g(e, (r) => S(r)), b = Array.from(a.layers), [A] = [...a.layersWithOutsidePointerEventsDisabled].slice(-1), N = b.indexOf(A), D = u ? b.indexOf(u) : -1, _ = a.layersWithOutsidePointerEventsDisabled.size > 0, P = D >= N, U = Y((r) => {
|
|
30
|
+
const v = r.target, L = [...a.branches].some((y) => y.contains(v));
|
|
31
|
+
!P || L || (s?.(r), f?.(r), r.defaultPrevented || d?.());
|
|
32
|
+
}, l), O = q((r) => {
|
|
33
|
+
const v = r.target;
|
|
34
|
+
[...a.branches].some((y) => y.contains(v)) || (c?.(r), f?.(r), r.defaultPrevented || d?.());
|
|
35
|
+
}, l);
|
|
36
|
+
return z((r) => {
|
|
37
|
+
D === a.layers.size - 1 && (o?.(r), !r.defaultPrevented && d && (r.preventDefault(), d()));
|
|
38
|
+
}, l), i.useEffect(() => {
|
|
39
|
+
if (u)
|
|
40
|
+
return t && (a.layersWithOutsidePointerEventsDisabled.size === 0 && (C = l.body.style.pointerEvents, l.body.style.pointerEvents = "none"), a.layersWithOutsidePointerEventsDisabled.add(u)), a.layers.add(u), w(), () => {
|
|
41
|
+
t && a.layersWithOutsidePointerEventsDisabled.size === 1 && (l.body.style.pointerEvents = C);
|
|
42
|
+
};
|
|
43
|
+
}, [u, l, t, a]), i.useEffect(() => () => {
|
|
44
|
+
u && (a.layers.delete(u), a.layersWithOutsidePointerEventsDisabled.delete(u), w());
|
|
45
|
+
}, [u, a]), i.useEffect(() => {
|
|
46
|
+
const r = () => W({});
|
|
47
|
+
return document.addEventListener(p, r), () => document.removeEventListener(p, r);
|
|
48
|
+
}, []), /* @__PURE__ */ x.jsx(
|
|
49
|
+
R.div,
|
|
50
|
+
{
|
|
51
|
+
...E,
|
|
52
|
+
ref: k,
|
|
53
|
+
style: {
|
|
54
|
+
pointerEvents: _ ? P ? "auto" : "none" : void 0,
|
|
55
|
+
...n.style
|
|
56
|
+
},
|
|
57
|
+
onFocusCapture: h(n.onFocusCapture, O.onFocusCapture),
|
|
58
|
+
onBlurCapture: h(n.onBlurCapture, O.onBlurCapture),
|
|
59
|
+
onPointerDownCapture: h(
|
|
60
|
+
n.onPointerDownCapture,
|
|
61
|
+
U.onPointerDownCapture
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
T.displayName = H;
|
|
68
|
+
var X = "DismissableLayerBranch", F = i.forwardRef((n, e) => {
|
|
69
|
+
const t = i.useContext(B), o = i.useRef(null), s = g(e, o);
|
|
70
|
+
return i.useEffect(() => {
|
|
71
|
+
const c = o.current;
|
|
72
|
+
if (c)
|
|
73
|
+
return t.branches.add(c), () => {
|
|
74
|
+
t.branches.delete(c);
|
|
75
|
+
};
|
|
76
|
+
}, [t.branches]), /* @__PURE__ */ x.jsx(R.div, { ...n, ref: s });
|
|
77
|
+
});
|
|
78
|
+
F.displayName = X;
|
|
79
|
+
function Y(n, e = globalThis?.document) {
|
|
80
|
+
const t = m(n), o = i.useRef(!1), s = i.useRef(() => {
|
|
81
|
+
});
|
|
82
|
+
return i.useEffect(() => {
|
|
83
|
+
const c = (d) => {
|
|
84
|
+
if (d.target && !o.current) {
|
|
85
|
+
let E = function() {
|
|
86
|
+
I(
|
|
87
|
+
K,
|
|
88
|
+
t,
|
|
89
|
+
a,
|
|
90
|
+
{ discrete: !0 }
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
const a = { originalEvent: d };
|
|
94
|
+
d.pointerType === "touch" ? (e.removeEventListener("click", s.current), s.current = E, e.addEventListener("click", s.current, { once: !0 })) : E();
|
|
95
|
+
} else
|
|
96
|
+
e.removeEventListener("click", s.current);
|
|
97
|
+
o.current = !1;
|
|
98
|
+
}, f = window.setTimeout(() => {
|
|
99
|
+
e.addEventListener("pointerdown", c);
|
|
100
|
+
}, 0);
|
|
101
|
+
return () => {
|
|
102
|
+
window.clearTimeout(f), e.removeEventListener("pointerdown", c), e.removeEventListener("click", s.current);
|
|
103
|
+
};
|
|
104
|
+
}, [e, t]), {
|
|
105
|
+
// ensures we check React component tree (not just DOM tree)
|
|
106
|
+
onPointerDownCapture: () => o.current = !0
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function q(n, e = globalThis?.document) {
|
|
110
|
+
const t = m(n), o = i.useRef(!1);
|
|
111
|
+
return i.useEffect(() => {
|
|
112
|
+
const s = (c) => {
|
|
113
|
+
c.target && !o.current && I(M, t, { originalEvent: c }, {
|
|
114
|
+
discrete: !1
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
return e.addEventListener("focusin", s), () => e.removeEventListener("focusin", s);
|
|
118
|
+
}, [e, t]), {
|
|
119
|
+
onFocusCapture: () => o.current = !0,
|
|
120
|
+
onBlurCapture: () => o.current = !1
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function w() {
|
|
124
|
+
const n = new CustomEvent(p);
|
|
125
|
+
document.dispatchEvent(n);
|
|
126
|
+
}
|
|
127
|
+
function I(n, e, t, { discrete: o }) {
|
|
128
|
+
const s = t.originalEvent.target, c = new CustomEvent(n, { bubbles: !1, cancelable: !0, detail: t });
|
|
129
|
+
e && s.addEventListener(n, e, { once: !0 }), o ? j(s, c) : s.dispatchEvent(c);
|
|
130
|
+
}
|
|
131
|
+
var Z = T, $ = F;
|
|
132
|
+
export {
|
|
133
|
+
$ as B,
|
|
134
|
+
T as D,
|
|
135
|
+
Z as R
|
|
136
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("react");require("./jsx-runtime-nZSsnGb7.js");function i(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const o=i(c);var u=o.createContext(void 0);function a(e){const t=o.useContext(u);return e||t||"ltr"}exports.useDirection=a;
|