@anoki/fse-ui 1.0.424 → 1.0.425
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/index.cjs186.js +1 -1
- package/dist/index.cjs190.js +1 -1
- package/dist/index.cjs197.js +1 -1
- package/dist/index.cjs208.js +1 -1
- package/dist/index.cjs215.js +1 -1
- package/dist/index.cjs220.js +1 -1
- package/dist/index.cjs227.js +1 -1
- package/dist/index.cjs235.js +1 -1
- package/dist/index.cjs288.js +1 -1
- package/dist/index.cjs288.js.map +1 -1
- package/dist/index.cjs291.js +1 -1
- package/dist/index.cjs291.js.map +1 -1
- package/dist/index.cjs292.js +1 -1
- package/dist/index.cjs292.js.map +1 -1
- package/dist/index.cjs293.js +1 -1
- package/dist/index.cjs293.js.map +1 -1
- package/dist/{index.cjs290.js → index.cjs294.js} +2 -2
- package/dist/{index.cjs290.js.map → index.cjs294.js.map} +1 -1
- package/dist/index.cjs295.js +1 -1
- package/dist/index.cjs295.js.map +1 -1
- package/dist/index.cjs296.js +1 -1
- package/dist/index.cjs296.js.map +1 -1
- package/dist/index.cjs297.js +1 -1
- package/dist/index.cjs297.js.map +1 -1
- package/dist/index.cjs298.js +1 -1
- package/dist/index.cjs298.js.map +1 -1
- package/dist/index.cjs299.js +1 -1
- package/dist/index.cjs299.js.map +1 -1
- package/dist/index.cjs300.js +1 -1
- package/dist/index.cjs300.js.map +1 -1
- package/dist/index.cjs301.js +1 -1
- package/dist/index.cjs301.js.map +1 -1
- package/dist/index.cjs302.js +1 -1
- package/dist/index.cjs302.js.map +1 -1
- package/dist/index.cjs303.js +1 -1
- package/dist/index.cjs303.js.map +1 -1
- package/dist/index.cjs304.js +1 -1
- package/dist/index.cjs304.js.map +1 -1
- package/dist/index.cjs305.js +1 -1
- package/dist/index.cjs305.js.map +1 -1
- package/dist/index.cjs306.js +1 -1
- package/dist/index.cjs306.js.map +1 -1
- package/dist/index.cjs307.js +1 -1
- package/dist/index.cjs307.js.map +1 -1
- package/dist/index.cjs308.js +1 -1
- package/dist/index.cjs308.js.map +1 -1
- package/dist/index.cjs309.js +1 -1
- package/dist/index.cjs309.js.map +1 -1
- package/dist/{index.cjs317.js → index.cjs310.js} +2 -2
- package/dist/index.cjs310.js.map +1 -0
- package/dist/index.cjs311.js +2 -0
- package/dist/index.cjs311.js.map +1 -0
- package/dist/index.cjs312.js +2 -0
- package/dist/index.cjs312.js.map +1 -0
- package/dist/index.cjs313.js +2 -0
- package/dist/index.cjs313.js.map +1 -0
- package/dist/index.cjs314.js +2 -0
- package/dist/index.cjs314.js.map +1 -0
- package/dist/index.cjs315.js +1 -1
- package/dist/index.cjs315.js.map +1 -1
- package/dist/index.cjs318.js +1 -1
- package/dist/index.cjs318.js.map +1 -1
- package/dist/index.cjs319.js +1 -1
- package/dist/index.cjs319.js.map +1 -1
- package/dist/index.cjs320.js +1 -1
- package/dist/index.cjs320.js.map +1 -1
- package/dist/index.cjs321.js +1 -1
- package/dist/index.cjs321.js.map +1 -1
- package/dist/index.cjs322.js +1 -1
- package/dist/index.cjs322.js.map +1 -1
- package/dist/index.cjs329.js +2 -0
- package/dist/index.cjs329.js.map +1 -0
- package/dist/index.cjs330.js +1 -1
- package/dist/index.cjs330.js.map +1 -1
- package/dist/index.cjs331.js +1 -1
- package/dist/index.cjs331.js.map +1 -1
- package/dist/index.cjs332.js +1 -1
- package/dist/index.cjs332.js.map +1 -1
- package/dist/index.cjs339.js +1 -1
- package/dist/index.cjs339.js.map +1 -1
- package/dist/index.cjs340.js +1 -1
- package/dist/index.cjs340.js.map +1 -1
- package/dist/index.cjs341.js +1 -1
- package/dist/index.cjs341.js.map +1 -1
- package/dist/index.cjs342.js +1 -4
- package/dist/index.cjs342.js.map +1 -1
- package/dist/index.cjs343.js +1 -1
- package/dist/index.cjs343.js.map +1 -1
- package/dist/index.cjs344.js +1 -1
- package/dist/index.cjs344.js.map +1 -1
- package/dist/index.cjs345.js +2 -0
- package/dist/index.cjs345.js.map +1 -0
- package/dist/index.cjs346.js +2 -0
- package/dist/index.cjs346.js.map +1 -0
- package/dist/index.cjs347.js +5 -0
- package/dist/index.cjs347.js.map +1 -0
- package/dist/index.cjs348.js +1 -1
- package/dist/index.cjs348.js.map +1 -1
- package/dist/index.cjs349.js +1 -1
- package/dist/index.cjs349.js.map +1 -1
- package/dist/index.cjs350.js +1 -1
- package/dist/index.cjs350.js.map +1 -1
- package/dist/index.cjs351.js +1 -38
- package/dist/index.cjs351.js.map +1 -1
- package/dist/index.cjs352.js +1 -1
- package/dist/index.cjs352.js.map +1 -1
- package/dist/index.cjs353.js +38 -1
- package/dist/index.cjs353.js.map +1 -1
- package/dist/index.cjs354.js +1 -1
- package/dist/index.cjs354.js.map +1 -1
- package/dist/index.cjs355.js +1 -1
- package/dist/index.cjs355.js.map +1 -1
- package/dist/index.cjs356.js +1 -1
- package/dist/index.cjs356.js.map +1 -1
- package/dist/index.es186.js +7 -7
- package/dist/index.es190.js +1 -1
- package/dist/index.es197.js +8 -8
- package/dist/index.es208.js +14 -14
- package/dist/index.es215.js +1 -1
- package/dist/index.es220.js +1 -1
- package/dist/index.es227.js +1 -1
- package/dist/index.es235.js +7 -7
- package/dist/index.es288.js +15 -27
- package/dist/index.es288.js.map +1 -1
- package/dist/index.es291.js +6 -32
- package/dist/index.es291.js.map +1 -1
- package/dist/index.es292.js +23 -618
- package/dist/index.es292.js.map +1 -1
- package/dist/index.es293.js +66 -9
- package/dist/index.es293.js.map +1 -1
- package/dist/{index.es290.js → index.es294.js} +2 -2
- package/dist/{index.es290.js.map → index.es294.js.map} +1 -1
- package/dist/index.es295.js +32 -10
- package/dist/index.es295.js.map +1 -1
- package/dist/index.es296.js +621 -45
- package/dist/index.es296.js.map +1 -1
- package/dist/index.es297.js +10 -45
- package/dist/index.es297.js.map +1 -1
- package/dist/index.es298.js +5 -7
- package/dist/index.es298.js.map +1 -1
- package/dist/index.es299.js +23 -123
- package/dist/index.es299.js.map +1 -1
- package/dist/index.es300.js +67 -13
- package/dist/index.es300.js.map +1 -1
- package/dist/index.es301.js +28 -134
- package/dist/index.es301.js.map +1 -1
- package/dist/index.es302.js +10 -217
- package/dist/index.es302.js.map +1 -1
- package/dist/index.es303.js +45 -13
- package/dist/index.es303.js.map +1 -1
- package/dist/index.es304.js +43 -66
- package/dist/index.es304.js.map +1 -1
- package/dist/index.es305.js +7 -177
- package/dist/index.es305.js.map +1 -1
- package/dist/index.es306.js +122 -47
- package/dist/index.es306.js.map +1 -1
- package/dist/index.es307.js +14 -8
- package/dist/index.es307.js.map +1 -1
- package/dist/index.es308.js +135 -4
- package/dist/index.es308.js.map +1 -1
- package/dist/index.es309.js +217 -14
- package/dist/index.es309.js.map +1 -1
- package/dist/{index.es317.js → index.es310.js} +3 -3
- package/dist/index.es310.js.map +1 -0
- package/dist/index.es311.js +181 -0
- package/dist/index.es311.js.map +1 -0
- package/dist/index.es312.js +53 -0
- package/dist/index.es312.js.map +1 -0
- package/dist/index.es313.js +12 -0
- package/dist/index.es313.js.map +1 -0
- package/dist/index.es314.js +7 -0
- package/dist/index.es314.js.map +1 -0
- package/dist/index.es315.js +37 -120
- package/dist/index.es315.js.map +1 -1
- package/dist/index.es318.js +122 -30
- package/dist/index.es318.js.map +1 -1
- package/dist/index.es319.js +130 -37
- package/dist/index.es319.js.map +1 -1
- package/dist/index.es320.js +13 -11
- package/dist/index.es320.js.map +1 -1
- package/dist/index.es321.js +32 -204
- package/dist/index.es321.js.map +1 -1
- package/dist/index.es322.js +41 -21
- package/dist/index.es322.js.map +1 -1
- package/dist/index.es329.js +15 -0
- package/dist/index.es329.js.map +1 -0
- package/dist/index.es330.js +202 -22
- package/dist/index.es330.js.map +1 -1
- package/dist/index.es331.js +20 -27
- package/dist/index.es331.js.map +1 -1
- package/dist/index.es332.js +393 -5
- package/dist/index.es332.js.map +1 -1
- package/dist/index.es339.js +29 -5
- package/dist/index.es339.js.map +1 -1
- package/dist/index.es340.js +25 -3
- package/dist/index.es340.js.map +1 -1
- package/dist/index.es341.js +29 -24
- package/dist/index.es341.js.map +1 -1
- package/dist/index.es342.js +5 -110
- package/dist/index.es342.js.map +1 -1
- package/dist/index.es343.js +41 -15
- package/dist/index.es343.js.map +1 -1
- package/dist/index.es344.js +5 -29
- package/dist/index.es344.js.map +1 -1
- package/dist/index.es345.js +6 -0
- package/dist/index.es345.js.map +1 -0
- package/dist/index.es346.js +27 -0
- package/dist/index.es346.js.map +1 -0
- package/dist/index.es347.js +113 -0
- package/dist/index.es347.js.map +1 -0
- package/dist/index.es348.js +14 -521
- package/dist/index.es348.js.map +1 -1
- package/dist/index.es349.js +509 -113
- package/dist/index.es349.js.map +1 -1
- package/dist/index.es350.js +121 -123
- package/dist/index.es350.js.map +1 -1
- package/dist/index.es351.js +127 -67
- package/dist/index.es351.js.map +1 -1
- package/dist/index.es352.js +64 -8
- package/dist/index.es352.js.map +1 -1
- package/dist/index.es353.js +68 -13
- package/dist/index.es353.js.map +1 -1
- package/dist/index.es354.js +8 -61
- package/dist/index.es354.js.map +1 -1
- package/dist/index.es355.js +13 -64
- package/dist/index.es355.js.map +1 -1
- package/dist/index.es356.js +62 -42
- package/dist/index.es356.js.map +1 -1
- package/package.json +1 -4
- package/dist/index.cjs287.js +0 -2
- package/dist/index.cjs287.js.map +0 -1
- package/dist/index.cjs289.js +0 -2
- package/dist/index.cjs289.js.map +0 -1
- package/dist/index.cjs316.js +0 -2
- package/dist/index.cjs316.js.map +0 -1
- package/dist/index.cjs317.js.map +0 -1
- package/dist/index.cjs323.js +0 -2
- package/dist/index.cjs323.js.map +0 -1
- package/dist/index.cjs324.js +0 -2
- package/dist/index.cjs324.js.map +0 -1
- package/dist/index.cjs325.js +0 -2
- package/dist/index.cjs325.js.map +0 -1
- package/dist/index.cjs326.js +0 -2
- package/dist/index.cjs326.js.map +0 -1
- package/dist/index.cjs338.js +0 -2
- package/dist/index.cjs338.js.map +0 -1
- package/dist/index.es287.js +0 -10
- package/dist/index.es287.js.map +0 -1
- package/dist/index.es289.js +0 -71
- package/dist/index.es289.js.map +0 -1
- package/dist/index.es316.js +0 -138
- package/dist/index.es316.js.map +0 -1
- package/dist/index.es317.js.map +0 -1
- package/dist/index.es323.js +0 -28
- package/dist/index.es323.js.map +0 -1
- package/dist/index.es324.js +0 -396
- package/dist/index.es324.js.map +0 -1
- package/dist/index.es325.js +0 -9
- package/dist/index.es325.js.map +0 -1
- package/dist/index.es326.js +0 -32
- package/dist/index.es326.js.map +0 -1
- package/dist/index.es338.js +0 -45
- package/dist/index.es338.js.map +0 -1
- /package/dist/components/ui/{ConsentModal/ConsentModalFooter/ConsentModalFooter.css → DoctorModal/DoctorModalFooter/DoctorModalFooter.css} +0 -0
package/dist/index.es304.js
CHANGED
@@ -1,72 +1,49 @@
|
|
1
|
-
import
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
MOUNT: "mounted",
|
20
|
-
ANIMATION_END: "unmounted"
|
21
|
-
},
|
22
|
-
unmounted: {
|
23
|
-
MOUNT: "mounted"
|
1
|
+
import n from "react";
|
2
|
+
import { createContextScope as O } from "./index.es293.js";
|
3
|
+
import { useComposedRefs as I } from "./index.es292.js";
|
4
|
+
import { Slot as S } from "./index.es303.js";
|
5
|
+
import { j as u } from "./index.es161.js";
|
6
|
+
function L(s) {
|
7
|
+
const f = s + "CollectionProvider", [A, E] = O(f), [N, m] = A(
|
8
|
+
f,
|
9
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
10
|
+
), a = (c) => {
|
11
|
+
const { scope: e, children: l } = c, o = n.useRef(null), t = n.useRef(/* @__PURE__ */ new Map()).current;
|
12
|
+
return /* @__PURE__ */ u.jsx(N, { scope: e, itemMap: t, collectionRef: o, children: l });
|
13
|
+
};
|
14
|
+
a.displayName = f;
|
15
|
+
const d = s + "CollectionSlot", p = n.forwardRef(
|
16
|
+
(c, e) => {
|
17
|
+
const { scope: l, children: o } = c, t = m(d, l), r = I(e, t.collectionRef);
|
18
|
+
return /* @__PURE__ */ u.jsx(S, { ref: r, children: o });
|
24
19
|
}
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
c
|
29
|
-
|
30
|
-
|
31
|
-
if (m !== n) {
|
32
|
-
const f = c.current, u = l(o);
|
33
|
-
n ? s("MOUNT") : u === "none" || (o == null ? void 0 : o.display) === "none" ? s("UNMOUNT") : s(m && f !== u ? "ANIMATION_OUT" : "UNMOUNT"), i.current = n;
|
20
|
+
);
|
21
|
+
p.displayName = d;
|
22
|
+
const C = s + "CollectionItemSlot", R = "data-radix-collection-item", x = n.forwardRef(
|
23
|
+
(c, e) => {
|
24
|
+
const { scope: l, children: o, ...t } = c, r = n.useRef(null), M = I(e, r), i = m(C, l);
|
25
|
+
return n.useEffect(() => (i.itemMap.set(r, { ref: r, ...t }), () => void i.itemMap.delete(r))), /* @__PURE__ */ u.jsx(S, { [R]: "", ref: M, children: o });
|
34
26
|
}
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
s("ANIMATION_END");
|
54
|
-
}, [e, s]), {
|
55
|
-
isPresent: ["mounted", "unmountSuspended"].includes(N),
|
56
|
-
ref: a.useCallback((o) => {
|
57
|
-
o && (t.current = getComputedStyle(o)), r(o);
|
58
|
-
}, [])
|
59
|
-
};
|
60
|
-
}
|
61
|
-
function l(n) {
|
62
|
-
return (n == null ? void 0 : n.animationName) || "none";
|
63
|
-
}
|
64
|
-
function P(n) {
|
65
|
-
var t, i;
|
66
|
-
let e = (t = Object.getOwnPropertyDescriptor(n.props, "ref")) == null ? void 0 : t.get, r = e && "isReactWarning" in e && e.isReactWarning;
|
67
|
-
return r ? n.ref : (e = (i = Object.getOwnPropertyDescriptor(n, "ref")) == null ? void 0 : i.get, r = e && "isReactWarning" in e && e.isReactWarning, r ? n.props.ref : n.props.ref || n.ref);
|
27
|
+
);
|
28
|
+
x.displayName = C;
|
29
|
+
function _(c) {
|
30
|
+
const e = m(s + "CollectionConsumer", c);
|
31
|
+
return n.useCallback(() => {
|
32
|
+
const o = e.collectionRef.current;
|
33
|
+
if (!o) return [];
|
34
|
+
const t = Array.from(o.querySelectorAll(`[${R}]`));
|
35
|
+
return Array.from(e.itemMap.values()).sort(
|
36
|
+
(i, T) => t.indexOf(i.ref.current) - t.indexOf(T.ref.current)
|
37
|
+
);
|
38
|
+
}, [e.collectionRef, e.itemMap]);
|
39
|
+
}
|
40
|
+
return [
|
41
|
+
{ Provider: a, Slot: p, ItemSlot: x },
|
42
|
+
_,
|
43
|
+
E
|
44
|
+
];
|
68
45
|
}
|
69
46
|
export {
|
70
|
-
|
47
|
+
L as createCollection
|
71
48
|
};
|
72
49
|
//# sourceMappingURL=index.es304.js.map
|
package/dist/index.es304.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.es304.js","sources":["../node_modules/@radix-ui/react-
|
1
|
+
{"version":3,"file":"index.es304.js","sources":["../node_modules/@radix-ui/react-collection/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/collection/src/Collection.tsx\nimport React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createCollection(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }\n );\n const CollectionProvider = (props) => {\n const { scope, children } = props;\n const ref = React.useRef(null);\n const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;\n return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx(Slot, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...itemData });\n return () => void context.itemMap.delete(ref);\n });\n return /* @__PURE__ */ jsx(Slot, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useCollection(scope) {\n const context = useCollectionContext(name + \"CollectionConsumer\", scope);\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)\n );\n return orderedItems;\n }, [context.collectionRef, context.itemMap]);\n return getItems;\n }\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope\n ];\n}\nexport {\n createCollection\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createCollection","name","PROVIDER_NAME","createCollectionContext","createCollectionScope","createContextScope","CollectionProviderImpl","useCollectionContext","CollectionProvider","props","scope","children","ref","React","itemMap","jsx","COLLECTION_SLOT_NAME","CollectionSlot","forwardedRef","context","composedRefs","useComposedRefs","Slot","ITEM_SLOT_NAME","ITEM_DATA_ATTR","CollectionItemSlot","itemData","useCollection","collectionNode","orderedNodes","a","b"],"mappings":";;;;;AAQA,SAASA,EAAiBC,GAAM;AAC9B,QAAMC,IAAgBD,IAAO,sBACvB,CAACE,GAAyBC,CAAqB,IAAIC,EAAmBH,CAAa,GACnF,CAACI,GAAwBC,CAAoB,IAAIJ;AAAA,IACrDD;AAAA,IACA,EAAE,eAAe,EAAE,SAAS,KAAI,GAAI,SAAyB,oBAAI,IAAK,EAAA;AAAA,EACvE,GACKM,IAAqB,CAACC,MAAU;AACpC,UAAM,EAAE,OAAAC,GAAO,UAAAC,EAAQ,IAAKF,GACtBG,IAAMC,EAAM,OAAO,IAAI,GACvBC,IAAUD,EAAM,OAAuB,oBAAI,IAAG,CAAE,EAAE;AACxD,WAAuBE,gBAAAA,EAAG,IAACT,GAAwB,EAAE,OAAAI,GAAO,SAAAI,GAAS,eAAeF,GAAK,UAAAD,GAAU;AAAA,EACpG;AACD,EAAAH,EAAmB,cAAcN;AACjC,QAAMc,IAAuBf,IAAO,kBAC9BgB,IAAiBJ,EAAM;AAAA,IAC3B,CAACJ,GAAOS,MAAiB;AACvB,YAAM,EAAE,OAAAR,GAAO,UAAAC,EAAQ,IAAKF,GACtBU,IAAUZ,EAAqBS,GAAsBN,CAAK,GAC1DU,IAAeC,EAAgBH,GAAcC,EAAQ,aAAa;AACxE,aAAuBJ,gBAAAA,EAAAA,IAAIO,GAAM,EAAE,KAAKF,GAAc,UAAAT,EAAQ,CAAE;AAAA,IACtE;AAAA,EACG;AACD,EAAAM,EAAe,cAAcD;AAC7B,QA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
|
1
|
-
import * as
|
2
|
-
import
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
import { Primitive as P } from "./index.es291.js";
|
8
|
-
import { useCallbackRef as J } from "./index.es295.js";
|
9
|
-
import { useControllableState as Q } from "./index.es290.js";
|
10
|
-
import { useDirection as W } from "./index.es298.js";
|
11
|
-
import { j as d } from "./index.es161.js";
|
12
|
-
var _ = "rovingFocusGroup.onEntryFocus", X = { bubbles: !1, cancelable: !0 }, b = "RovingFocusGroup", [h, G, Z] = H(b), [$, Fe] = z(
|
13
|
-
b,
|
14
|
-
[Z]
|
15
|
-
), [ee, oe] = $(b), N = s.forwardRef(
|
16
|
-
(e, r) => /* @__PURE__ */ d.jsx(h.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d.jsx(h.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d.jsx(te, { ...e, ref: r }) }) })
|
17
|
-
);
|
18
|
-
N.displayName = b;
|
19
|
-
var te = s.forwardRef((e, r) => {
|
20
|
-
const {
|
21
|
-
__scopeRovingFocusGroup: c,
|
22
|
-
orientation: o,
|
23
|
-
loop: F = !1,
|
24
|
-
dir: g,
|
25
|
-
currentTabStopId: R,
|
26
|
-
defaultCurrentTabStopId: E,
|
27
|
-
onCurrentTabStopIdChange: m,
|
28
|
-
onEntryFocus: u,
|
29
|
-
preventScrollOnEntryFocus: w = !1,
|
30
|
-
...C
|
31
|
-
} = e, v = s.useRef(null), I = V(r, v), t = W(g), [f = null, T] = Q({
|
32
|
-
prop: R,
|
33
|
-
defaultProp: E,
|
34
|
-
onChange: m
|
35
|
-
}), [a, i] = s.useState(!1), S = J(u), M = G(c), x = s.useRef(!1), [k, y] = s.useState(0);
|
36
|
-
return s.useEffect(() => {
|
37
|
-
const n = v.current;
|
38
|
-
if (n)
|
39
|
-
return n.addEventListener(_, S), () => n.removeEventListener(_, S);
|
40
|
-
}, [S]), /* @__PURE__ */ d.jsx(
|
41
|
-
ee,
|
42
|
-
{
|
43
|
-
scope: c,
|
44
|
-
orientation: o,
|
45
|
-
dir: t,
|
46
|
-
loop: F,
|
47
|
-
currentTabStopId: f,
|
48
|
-
onItemFocus: s.useCallback(
|
49
|
-
(n) => T(n),
|
50
|
-
[T]
|
51
|
-
),
|
52
|
-
onItemShiftTab: s.useCallback(() => i(!0), []),
|
53
|
-
onFocusableItemAdd: s.useCallback(
|
54
|
-
() => y((n) => n + 1),
|
55
|
-
[]
|
56
|
-
),
|
57
|
-
onFocusableItemRemove: s.useCallback(
|
58
|
-
() => y((n) => n - 1),
|
59
|
-
[]
|
60
|
-
),
|
61
|
-
children: /* @__PURE__ */ d.jsx(
|
62
|
-
P.div,
|
63
|
-
{
|
64
|
-
tabIndex: a || k === 0 ? -1 : 0,
|
65
|
-
"data-orientation": o,
|
66
|
-
...C,
|
67
|
-
ref: I,
|
68
|
-
style: { outline: "none", ...e.style },
|
69
|
-
onMouseDown: p(e.onMouseDown, () => {
|
70
|
-
x.current = !0;
|
71
|
-
}),
|
72
|
-
onFocus: p(e.onFocus, (n) => {
|
73
|
-
const L = !x.current;
|
74
|
-
if (n.target === n.currentTarget && L && !a) {
|
75
|
-
const D = new CustomEvent(_, X);
|
76
|
-
if (n.currentTarget.dispatchEvent(D), !D.defaultPrevented) {
|
77
|
-
const A = M().filter((l) => l.focusable), U = A.find((l) => l.active), B = A.find((l) => l.id === f), Y = [U, B, ...A].filter(
|
78
|
-
Boolean
|
79
|
-
).map((l) => l.ref.current);
|
80
|
-
j(Y, w);
|
81
|
-
}
|
82
|
-
}
|
83
|
-
x.current = !1;
|
84
|
-
}),
|
85
|
-
onBlur: p(e.onBlur, () => i(!1))
|
86
|
-
}
|
87
|
-
)
|
88
|
-
}
|
89
|
-
);
|
90
|
-
}), O = "RovingFocusGroupItem", K = s.forwardRef(
|
91
|
-
(e, r) => {
|
92
|
-
const {
|
93
|
-
__scopeRovingFocusGroup: c,
|
94
|
-
focusable: o = !0,
|
95
|
-
active: F = !1,
|
96
|
-
tabStopId: g,
|
97
|
-
...R
|
98
|
-
} = e, E = q(), m = g || E, u = oe(O, c), w = u.currentTabStopId === m, C = G(c), { onFocusableItemAdd: v, onFocusableItemRemove: I } = u;
|
99
|
-
return s.useEffect(() => {
|
100
|
-
if (o)
|
101
|
-
return v(), () => I();
|
102
|
-
}, [o, v, I]), /* @__PURE__ */ d.jsx(
|
103
|
-
h.ItemSlot,
|
104
|
-
{
|
105
|
-
scope: c,
|
106
|
-
id: m,
|
107
|
-
focusable: o,
|
108
|
-
active: F,
|
109
|
-
children: /* @__PURE__ */ d.jsx(
|
110
|
-
P.span,
|
111
|
-
{
|
112
|
-
tabIndex: w ? 0 : -1,
|
113
|
-
"data-orientation": u.orientation,
|
114
|
-
...R,
|
115
|
-
ref: r,
|
116
|
-
onMouseDown: p(e.onMouseDown, (t) => {
|
117
|
-
o ? u.onItemFocus(m) : t.preventDefault();
|
118
|
-
}),
|
119
|
-
onFocus: p(e.onFocus, () => u.onItemFocus(m)),
|
120
|
-
onKeyDown: p(e.onKeyDown, (t) => {
|
121
|
-
if (t.key === "Tab" && t.shiftKey) {
|
122
|
-
u.onItemShiftTab();
|
123
|
-
return;
|
124
|
-
}
|
125
|
-
if (t.target !== t.currentTarget) return;
|
126
|
-
const f = se(t, u.orientation, u.dir);
|
127
|
-
if (f !== void 0) {
|
128
|
-
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey) return;
|
129
|
-
t.preventDefault();
|
130
|
-
let a = C().filter((i) => i.focusable).map((i) => i.ref.current);
|
131
|
-
if (f === "last") a.reverse();
|
132
|
-
else if (f === "prev" || f === "next") {
|
133
|
-
f === "prev" && a.reverse();
|
134
|
-
const i = a.indexOf(t.currentTarget);
|
135
|
-
a = u.loop ? ce(a, i + 1) : a.slice(i + 1);
|
136
|
-
}
|
137
|
-
setTimeout(() => j(a));
|
138
|
-
}
|
139
|
-
})
|
140
|
-
}
|
141
|
-
)
|
142
|
-
}
|
143
|
-
);
|
144
|
-
}
|
145
|
-
);
|
146
|
-
K.displayName = O;
|
147
|
-
var re = {
|
148
|
-
ArrowLeft: "prev",
|
149
|
-
ArrowUp: "prev",
|
150
|
-
ArrowRight: "next",
|
151
|
-
ArrowDown: "next",
|
152
|
-
PageUp: "first",
|
153
|
-
Home: "first",
|
154
|
-
PageDown: "last",
|
155
|
-
End: "last"
|
156
|
-
};
|
157
|
-
function ne(e, r) {
|
158
|
-
return r !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
159
|
-
}
|
160
|
-
function se(e, r, c) {
|
161
|
-
const o = ne(e.key, c);
|
162
|
-
if (!(r === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(r === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
|
163
|
-
return re[o];
|
164
|
-
}
|
165
|
-
function j(e, r = !1) {
|
166
|
-
const c = document.activeElement;
|
167
|
-
for (const o of e)
|
168
|
-
if (o === c || (o.focus({ preventScroll: r }), document.activeElement !== c)) return;
|
169
|
-
}
|
170
|
-
function ce(e, r) {
|
171
|
-
return e.map((c, o) => e[(r + o) % e.length]);
|
1
|
+
import * as t from "react";
|
2
|
+
import "./index.es161.js";
|
3
|
+
var r = t.createContext(void 0);
|
4
|
+
function i(e) {
|
5
|
+
const o = t.useContext(r);
|
6
|
+
return e || o || "ltr";
|
172
7
|
}
|
173
|
-
var ge = N, Re = K;
|
174
8
|
export {
|
175
|
-
|
176
|
-
ge as Root,
|
177
|
-
N as RovingFocusGroup,
|
178
|
-
K as RovingFocusGroupItem,
|
179
|
-
Fe as createRovingFocusGroupScope
|
9
|
+
i as useDirection
|
180
10
|
};
|
181
11
|
//# sourceMappingURL=index.es305.js.map
|
package/dist/index.es305.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.es305.js","sources":["../node_modules/@radix-ui/react-roving-focus/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/roving-focus/src/RovingFocusGroup.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ENTRY_FOCUS = \"rovingFocusGroup.onEntryFocus\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar GROUP_NAME = \"RovingFocusGroup\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);\nvar [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\nvar [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);\nvar RovingFocusGroup = React.forwardRef(\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });\n }\n);\nRovingFocusGroup.displayName = GROUP_NAME;\nvar RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId = null, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId,\n onChange: onCurrentTabStopIdChange\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n return /* @__PURE__ */ jsx(\n RovingFocusProvider,\n {\n scope: __scopeRovingFocusGroup,\n orientation,\n dir: direction,\n loop,\n currentTabStopId,\n onItemFocus: React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n ),\n onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),\n onFocusableItemAdd: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n ),\n onFocusableItemRemove: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n ),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,\n \"data-orientation\": orientation,\n ...groupProps,\n ref: composedRefs,\n style: { outline: \"none\", ...props.style },\n onMouseDown: composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n }),\n onFocus: composeEventHandlers(props.onFocus, (event) => {\n const isKeyboardFocus = !isClickFocusRef.current;\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n );\n const candidateNodes = candidateItems.map((item) => item.ref.current);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n isClickFocusRef.current = false;\n }),\n onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))\n }\n )\n }\n );\n});\nvar ITEM_NAME = \"RovingFocusGroupItem\";\nvar RovingFocusGroupItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n const { onFocusableItemAdd, onFocusableItemRemove } = context;\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeRovingFocusGroup,\n id,\n focusable,\n active,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n tabIndex: isCurrentTabStop ? 0 : -1,\n \"data-orientation\": context.orientation,\n ...itemProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!focusable) event.preventDefault();\n else context.onItemFocus(id);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Tab\" && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n if (event.target !== event.currentTarget) return;\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n if (focusIntent !== void 0) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current);\n if (focusIntent === \"last\") candidateNodes.reverse();\n else if (focusIntent === \"prev\" || focusIntent === \"next\") {\n if (focusIntent === \"prev\") candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n }\n })\n }\n )\n }\n );\n }\n);\nRovingFocusGroupItem.displayName = ITEM_NAME;\nvar MAP_KEY_TO_FOCUS_INTENT = {\n ArrowLeft: \"prev\",\n ArrowUp: \"prev\",\n ArrowRight: \"next\",\n ArrowDown: \"next\",\n PageUp: \"first\",\n Home: \"first\",\n PageDown: \"last\",\n End: \"last\"\n};\nfunction getDirectionAwareKey(key, dir) {\n if (dir !== \"rtl\") return key;\n return key === \"ArrowLeft\" ? \"ArrowRight\" : key === \"ArrowRight\" ? \"ArrowLeft\" : key;\n}\nfunction getFocusIntent(event, orientation, dir) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === \"vertical\" && [\"ArrowLeft\", \"ArrowRight\"].includes(key)) return void 0;\n if (orientation === \"horizontal\" && [\"ArrowUp\", \"ArrowDown\"].includes(key)) return void 0;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction focusFirst(candidates, preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root = RovingFocusGroup;\nvar Item = RovingFocusGroupItem;\nexport {\n Item,\n Root,\n RovingFocusGroup,\n RovingFocusGroupItem,\n createRovingFocusGroupScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["ENTRY_FOCUS","EVENT_OPTIONS","GROUP_NAME","Collection","useCollection","createCollectionScope","createCollection","createRovingFocusGroupContext","createRovingFocusGroupScope","createContextScope","RovingFocusProvider","useRovingFocusContext","RovingFocusGroup","React","props","forwardedRef","jsx","RovingFocusGroupImpl","__scopeRovingFocusGroup","orientation","loop","dir","currentTabStopIdProp","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus","preventScrollOnEntryFocus","groupProps","ref","composedRefs","useComposedRefs","direction","useDirection","currentTabStopId","setCurrentTabStopId","useControllableState","isTabbingBackOut","setIsTabbingBackOut","handleEntryFocus","useCallbackRef","getItems","isClickFocusRef","focusableItemsCount","setFocusableItemsCount","node","tabStopId","prevCount","Primitive","composeEventHandlers","event","isKeyboardFocus","entryFocusEvent","items","item","activeItem","currentItem","candidateNodes","focusFirst","ITEM_NAME","RovingFocusGroupItem","focusable","active","itemProps","autoId","useId","id","context","isCurrentTabStop","onFocusableItemAdd","onFocusableItemRemove","focusIntent","getFocusIntent","currentIndex","wrapArray","MAP_KEY_TO_FOCUS_INTENT","getDirectionAwareKey","key","candidates","preventScroll","PREVIOUSLY_FOCUSED_ELEMENT","candidate","array","startIndex","_","index","Root","Item"],"mappings":";;;;;;;;;;;AAcA,IAAIA,IAAc,iCACdC,IAAgB,EAAE,SAAS,IAAO,YAAY,GAAM,GACpDC,IAAa,oBACb,CAACC,GAAYC,GAAeC,CAAqB,IAAIC,EAAiBJ,CAAU,GAChF,CAACK,GAA+BC,EAA2B,IAAIC;AAAA,EACjEP;AAAA,EACA,CAACG,CAAqB;AACxB,GACI,CAACK,IAAqBC,EAAqB,IAAIJ,EAA8BL,CAAU,GACvFU,IAAmBC,EAAM;AAAA,EAC3B,CAACC,GAAOC,MACiBC,gBAAAA,MAAIb,EAAW,UAAU,EAAE,OAAOW,EAAM,yBAAyB,UAA0BE,gBAAAA,MAAIb,EAAW,MAAM,EAAE,OAAOW,EAAM,yBAAyB,UAA0BE,gBAAAA,EAAAA,IAAIC,IAAsB,EAAE,GAAGH,GAAO,KAAKC,GAAc,EAAC,CAAE,EAAC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MuD,IAAMD,GAAqB1B,EAAM,KAAK5B,CAAG;AAC/C,MAAI,EAAAF,MAAgB,cAAc,CAAC,aAAa,YAAY,EAAE,SAASyD,CAAG,MACtE,EAAAzD,MAAgB,gBAAgB,CAAC,WAAW,WAAW,EAAE,SAASyD,CAAG;AACzE,WAAOF,GAAwBE,CAAG;AACpC;AACA,SAASnB,EAAWoB,GAAYC,IAAgB,IAAO;AACrD,QAAMC,IAA6B,SAAS;AAC5C,aAAWC,KAAaH;AAGtB,QAFIG,MAAcD,MAClBC,EAAU,MAAM,EAAE,eAAAF,GAAe,GAC7B,SAAS,kBAAkBC,GAA4B;AAE/D;AACA,SAASN,GAAUQ,GAAOC,GAAY;AACpC,SAAOD,EAAM,IAAI,CAACE,GAAGC,MAAUH,GAAOC,IAAaE,KAASH,EAAM,MAAM,CAAC;AAC3E;AACG,IAACI,KAAOzE,GACP0E,KAAO3B;","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index.es305.js","sources":["../node_modules/@radix-ui/react-direction/dist/index.mjs"],"sourcesContent":["// packages/react/direction/src/Direction.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DirectionContext = React.createContext(void 0);\nvar DirectionProvider = (props) => {\n const { dir, children } = props;\n return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children });\n};\nfunction useDirection(localDir) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || \"ltr\";\n}\nvar Provider = DirectionProvider;\nexport {\n DirectionProvider,\n Provider,\n useDirection\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DirectionContext","React","useDirection","localDir","globalDir"],"mappings":";;AAGA,IAAIA,IAAmBC,EAAM,cAAc,MAAM;AAKjD,SAASC,EAAaC,GAAU;AAC9B,QAAMC,IAAYH,EAAM,WAAWD,CAAgB;AACnD,SAAOG,KAAYC,KAAa;AAClC;","x_google_ignoreList":[0]}
|
package/dist/index.es306.js
CHANGED
@@ -1,53 +1,128 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
1
|
+
import * as n from "react";
|
2
|
+
import { composeEventHandlers as m } from "./index.es291.js";
|
3
|
+
import { Primitive as R, dispatchDiscreteCustomEvent as k } from "./index.es295.js";
|
4
|
+
import { useComposedRefs as g } from "./index.es292.js";
|
5
|
+
import { useCallbackRef as w } from "./index.es302.js";
|
6
|
+
import { useEscapeKeydown as U } from "./index.es329.js";
|
7
|
+
import { j as x } from "./index.es161.js";
|
8
|
+
var j = "DismissableLayer", p = "dismissableLayer.update", z = "dismissableLayer.pointerDownOutside", H = "dismissableLayer.focusOutside", L, T = n.createContext({
|
9
|
+
layers: /* @__PURE__ */ new Set(),
|
10
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
11
|
+
branches: /* @__PURE__ */ new Set()
|
12
|
+
}), M = n.forwardRef(
|
13
|
+
(r, e) => {
|
14
|
+
const {
|
15
|
+
disableOutsidePointerEvents: i = !1,
|
16
|
+
onEscapeKeyDown: o,
|
17
|
+
onPointerDownOutside: t,
|
18
|
+
onFocusOutside: a,
|
19
|
+
onInteractOutside: l,
|
20
|
+
onDismiss: d,
|
21
|
+
...E
|
22
|
+
} = r, c = n.useContext(T), [u, S] = n.useState(null), f = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, F] = n.useState({}), W = g(e, (s) => S(s)), y = Array.from(c.layers), [A] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), N = y.indexOf(A), b = u ? y.indexOf(u) : -1, I = c.layersWithOutsidePointerEventsDisabled.size > 0, P = b >= N, _ = q((s) => {
|
23
|
+
const v = s.target, C = [...c.branches].some((h) => h.contains(v));
|
24
|
+
!P || C || (t == null || t(s), l == null || l(s), s.defaultPrevented || d == null || d());
|
25
|
+
}, f), D = G((s) => {
|
26
|
+
const v = s.target;
|
27
|
+
[...c.branches].some((h) => h.contains(v)) || (a == null || a(s), l == null || l(s), s.defaultPrevented || d == null || d());
|
28
|
+
}, f);
|
29
|
+
return U((s) => {
|
30
|
+
b === c.layers.size - 1 && (o == null || o(s), !s.defaultPrevented && d && (s.preventDefault(), d()));
|
31
|
+
}, f), n.useEffect(() => {
|
32
|
+
if (u)
|
33
|
+
return i && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (L = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(u)), c.layers.add(u), O(), () => {
|
34
|
+
i && c.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = L);
|
35
|
+
};
|
36
|
+
}, [u, f, i, c]), n.useEffect(() => () => {
|
37
|
+
u && (c.layers.delete(u), c.layersWithOutsidePointerEventsDisabled.delete(u), O());
|
38
|
+
}, [u, c]), n.useEffect(() => {
|
39
|
+
const s = () => F({});
|
40
|
+
return document.addEventListener(p, s), () => document.removeEventListener(p, s);
|
41
|
+
}, []), /* @__PURE__ */ x.jsx(
|
42
|
+
R.div,
|
43
|
+
{
|
44
|
+
...E,
|
45
|
+
ref: W,
|
46
|
+
style: {
|
47
|
+
pointerEvents: I ? P ? "auto" : "none" : void 0,
|
48
|
+
...r.style
|
49
|
+
},
|
50
|
+
onFocusCapture: m(r.onFocusCapture, D.onFocusCapture),
|
51
|
+
onBlurCapture: m(r.onBlurCapture, D.onBlurCapture),
|
52
|
+
onPointerDownCapture: m(
|
53
|
+
r.onPointerDownCapture,
|
54
|
+
_.onPointerDownCapture
|
55
|
+
)
|
56
|
+
}
|
57
|
+
);
|
58
|
+
}
|
59
|
+
);
|
60
|
+
M.displayName = j;
|
61
|
+
var X = "DismissableLayerBranch", Y = n.forwardRef((r, e) => {
|
62
|
+
const i = n.useContext(T), o = n.useRef(null), t = g(e, o);
|
63
|
+
return n.useEffect(() => {
|
64
|
+
const a = o.current;
|
65
|
+
if (a)
|
66
|
+
return i.branches.add(a), () => {
|
67
|
+
i.branches.delete(a);
|
68
|
+
};
|
69
|
+
}, [i.branches]), /* @__PURE__ */ x.jsx(R.div, { ...r, ref: t });
|
70
|
+
});
|
71
|
+
Y.displayName = X;
|
72
|
+
function q(r, e = globalThis == null ? void 0 : globalThis.document) {
|
73
|
+
const i = w(r), o = n.useRef(!1), t = n.useRef(() => {
|
16
74
|
});
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
75
|
+
return n.useEffect(() => {
|
76
|
+
const a = (d) => {
|
77
|
+
if (d.target && !o.current) {
|
78
|
+
let E = function() {
|
79
|
+
B(
|
80
|
+
z,
|
81
|
+
i,
|
82
|
+
c,
|
83
|
+
{ discrete: !0 }
|
84
|
+
);
|
85
|
+
};
|
86
|
+
const c = { originalEvent: d };
|
87
|
+
d.pointerType === "touch" ? (e.removeEventListener("click", t.current), t.current = E, e.addEventListener("click", t.current, { once: !0 })) : E();
|
88
|
+
} else
|
89
|
+
e.removeEventListener("click", t.current);
|
90
|
+
o.current = !1;
|
91
|
+
}, l = window.setTimeout(() => {
|
92
|
+
e.addEventListener("pointerdown", a);
|
93
|
+
}, 0);
|
94
|
+
return () => {
|
95
|
+
window.clearTimeout(l), e.removeEventListener("pointerdown", a), e.removeEventListener("click", t.current);
|
96
|
+
};
|
97
|
+
}, [e, i]), {
|
98
|
+
// ensures we check React component tree (not just DOM tree)
|
99
|
+
onPointerDownCapture: () => o.current = !0
|
22
100
|
};
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
101
|
+
}
|
102
|
+
function G(r, e = globalThis == null ? void 0 : globalThis.document) {
|
103
|
+
const i = w(r), o = n.useRef(!1);
|
104
|
+
return n.useEffect(() => {
|
105
|
+
const t = (a) => {
|
106
|
+
a.target && !o.current && B(H, i, { originalEvent: a }, {
|
107
|
+
discrete: !1
|
108
|
+
});
|
109
|
+
};
|
110
|
+
return e.addEventListener("focusin", t), () => e.removeEventListener("focusin", t);
|
111
|
+
}, [e, i]), {
|
112
|
+
onFocusCapture: () => o.current = !0,
|
113
|
+
onBlurCapture: () => o.current = !1
|
36
114
|
};
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
t
|
45
|
-
|
46
|
-
return i ? (n.push.apply(n, Array.from(i.querySelectorAll("[aria-live]"))), E(n, i, t, "aria-hidden")) : function() {
|
47
|
-
return null;
|
48
|
-
};
|
49
|
-
};
|
115
|
+
}
|
116
|
+
function O() {
|
117
|
+
const r = new CustomEvent(p);
|
118
|
+
document.dispatchEvent(r);
|
119
|
+
}
|
120
|
+
function B(r, e, i, { discrete: o }) {
|
121
|
+
const t = i.originalEvent.target, a = new CustomEvent(r, { bubbles: !1, cancelable: !0, detail: i });
|
122
|
+
e && t.addEventListener(r, e, { once: !0 }), o ? k(t, a) : t.dispatchEvent(a);
|
123
|
+
}
|
50
124
|
export {
|
51
|
-
|
125
|
+
M as DismissableLayer,
|
126
|
+
Y as DismissableLayerBranch
|
52
127
|
};
|
53
128
|
//# sourceMappingURL=index.es306.js.map
|