@anoki/fse-ui 1.10.1-RC2 → 1.10.1-RC2.1
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/components/ui/EditorialWidget/EditorialWidget.css +1 -1
- package/dist/components/ui/Section/Description/description.css +1 -1
- package/dist/index.cjs149.js +1 -1
- package/dist/index.cjs149.js.map +1 -1
- package/dist/index.cjs179.js +1 -1
- package/dist/index.cjs179.js.map +1 -1
- package/dist/index.cjs207.js +1 -1
- package/dist/index.cjs207.js.map +1 -1
- package/dist/index.cjs229.js +1 -1
- package/dist/index.cjs236.js +1 -1
- package/dist/index.cjs275.js +1 -1
- package/dist/index.cjs288.js +1 -1
- package/dist/index.cjs29.js +1 -1
- package/dist/index.cjs29.js.map +1 -1
- package/dist/index.cjs299.js +1 -1
- package/dist/index.cjs306.js +1 -1
- package/dist/index.cjs313.js +1 -1
- package/dist/index.cjs314.js +1 -1
- package/dist/index.cjs318.js +1 -1
- package/dist/index.cjs327.js +1 -1
- package/dist/index.cjs329.js +1 -1
- package/dist/index.cjs337.js +1 -1
- package/dist/index.cjs378.js +1 -1
- package/dist/index.cjs384.js +1 -1
- package/dist/index.cjs419.js +1 -1
- package/dist/index.cjs437.js +1 -1
- package/dist/index.cjs438.js +1 -1
- package/dist/index.cjs439.js +27 -1
- package/dist/index.cjs439.js.map +1 -1
- package/dist/index.cjs440.js +1 -2
- package/dist/index.cjs440.js.map +1 -1
- package/dist/index.cjs441.js +1 -27
- package/dist/index.cjs441.js.map +1 -1
- package/dist/index.cjs442.js +1 -1
- package/dist/index.cjs443.js +1 -1
- package/dist/index.cjs444.js +1 -1
- package/dist/index.cjs444.js.map +1 -1
- package/dist/index.cjs445.js +2 -1
- package/dist/index.cjs445.js.map +1 -1
- package/dist/index.cjs453.js +1 -1
- package/dist/index.cjs453.js.map +1 -1
- package/dist/index.cjs454.js +1 -1
- package/dist/index.cjs454.js.map +1 -1
- package/dist/index.cjs455.js +1 -1
- package/dist/index.cjs455.js.map +1 -1
- package/dist/index.cjs457.js +1 -1
- package/dist/index.cjs457.js.map +1 -1
- package/dist/index.cjs458.js +1 -1
- package/dist/index.cjs458.js.map +1 -1
- package/dist/index.cjs459.js +1 -1
- package/dist/index.cjs459.js.map +1 -1
- package/dist/index.cjs460.js +1 -1
- package/dist/index.cjs460.js.map +1 -1
- package/dist/index.cjs461.js +1 -1
- package/dist/index.cjs461.js.map +1 -1
- package/dist/index.cjs462.js +1 -1
- package/dist/index.cjs462.js.map +1 -1
- package/dist/index.cjs464.js +1 -1
- package/dist/index.cjs465.js +1 -1
- package/dist/index.cjs465.js.map +1 -1
- package/dist/index.cjs466.js +1 -1
- package/dist/index.cjs466.js.map +1 -1
- package/dist/index.cjs467.js +1 -1
- package/dist/index.cjs467.js.map +1 -1
- package/dist/index.cjs468.js +1 -1
- package/dist/index.cjs468.js.map +1 -1
- package/dist/index.cjs469.js +1 -1
- package/dist/index.cjs469.js.map +1 -1
- package/dist/index.cjs470.js +1 -1
- package/dist/index.cjs470.js.map +1 -1
- package/dist/index.cjs471.js +1 -1
- package/dist/index.cjs471.js.map +1 -1
- package/dist/index.cjs472.js +1 -1
- package/dist/index.cjs472.js.map +1 -1
- package/dist/index.cjs473.js +1 -1
- package/dist/index.cjs473.js.map +1 -1
- package/dist/index.cjs474.js +1 -1
- package/dist/index.cjs474.js.map +1 -1
- package/dist/index.cjs475.js +1 -1
- package/dist/index.cjs475.js.map +1 -1
- package/dist/index.cjs476.js +2 -0
- package/dist/index.cjs476.js.map +1 -0
- package/dist/{index.cjs479.js → index.cjs483.js} +2 -2
- package/dist/{index.cjs479.js.map → index.cjs483.js.map} +1 -1
- package/dist/{index.cjs480.js → index.cjs484.js} +2 -2
- package/dist/{index.cjs480.js.map → index.cjs484.js.map} +1 -1
- package/dist/{index.cjs481.js → index.cjs485.js} +2 -2
- package/dist/{index.cjs481.js.map → index.cjs485.js.map} +1 -1
- package/dist/{index.cjs482.js → index.cjs486.js} +2 -2
- package/dist/{index.cjs482.js.map → index.cjs486.js.map} +1 -1
- package/dist/{index.cjs488.js → index.cjs493.js} +1 -1
- package/dist/{index.cjs488.js.map → index.cjs493.js.map} +1 -1
- package/dist/index.cjs494.js +1 -1
- package/dist/index.cjs494.js.map +1 -1
- package/dist/index.cjs495.js +1 -1
- package/dist/index.cjs495.js.map +1 -1
- package/dist/index.cjs502.js +1 -1
- package/dist/index.cjs502.js.map +1 -1
- package/dist/index.cjs503.js +1 -1
- package/dist/index.cjs503.js.map +1 -1
- package/dist/index.cjs504.js +1 -1
- package/dist/index.cjs504.js.map +1 -1
- package/dist/{index.cjs498.js → index.cjs505.js} +2 -2
- package/dist/{index.cjs498.js.map → index.cjs505.js.map} +1 -1
- package/dist/{index.cjs499.js → index.cjs506.js} +2 -2
- package/dist/{index.cjs499.js.map → index.cjs506.js.map} +1 -1
- package/dist/index.cjs507.js +2 -0
- package/dist/index.cjs507.js.map +1 -0
- package/dist/index.cjs508.js +2 -0
- package/dist/index.cjs508.js.map +1 -0
- package/dist/index.cjs509.js +1 -1
- package/dist/index.cjs509.js.map +1 -1
- package/dist/index.cjs510.js +1 -1
- package/dist/index.cjs514.js +2 -0
- package/dist/index.cjs514.js.map +1 -0
- package/dist/index.cjs521.js +1 -1
- package/dist/index.cjs522.js +1 -1
- package/dist/index.cjs525.js +1 -1
- package/dist/index.cjs530.js +1 -1
- package/dist/index.cjs531.js +1 -1
- package/dist/index.cjs532.js +1 -1
- package/dist/index.cjs539.js +1 -1
- package/dist/index.cjs544.js +1 -1
- package/dist/index.cjs546.js +1 -1
- package/dist/index.cjs550.js +1 -1
- package/dist/index.cjs550.js.map +1 -1
- package/dist/index.cjs551.js +1 -1
- package/dist/index.cjs551.js.map +1 -1
- package/dist/index.cjs552.js +1 -1
- package/dist/index.cjs552.js.map +1 -1
- package/dist/index.cjs553.js +1 -1
- package/dist/index.cjs553.js.map +1 -1
- package/dist/index.cjs554.js +1 -1
- package/dist/index.cjs554.js.map +1 -1
- package/dist/index.cjs560.js +1 -1
- package/dist/index.cjs560.js.map +1 -1
- package/dist/index.cjs561.js +1 -1
- package/dist/index.cjs561.js.map +1 -1
- package/dist/index.cjs562.js +1 -1
- package/dist/index.cjs562.js.map +1 -1
- package/dist/{index.cjs568.js → index.cjs564.js} +2 -2
- package/dist/{index.cjs568.js.map → index.cjs564.js.map} +1 -1
- package/dist/{index.cjs569.js → index.cjs565.js} +1 -1
- package/dist/index.cjs565.js.map +1 -0
- package/dist/index.cjs655.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.es149.js +38 -38
- package/dist/index.es149.js.map +1 -1
- package/dist/index.es179.js +6 -6
- package/dist/index.es179.js.map +1 -1
- package/dist/index.es207.js +6 -6
- package/dist/index.es207.js.map +1 -1
- package/dist/index.es229.js +1 -1
- package/dist/index.es236.js +2 -2
- package/dist/index.es275.js +6 -6
- package/dist/index.es288.js +7 -7
- package/dist/index.es29.js +12 -11
- package/dist/index.es29.js.map +1 -1
- package/dist/index.es299.js +1 -1
- package/dist/index.es306.js +12 -12
- package/dist/index.es313.js +1 -1
- package/dist/index.es314.js +1 -1
- package/dist/index.es318.js +1 -1
- package/dist/index.es327.js +1 -1
- package/dist/index.es329.js +1 -1
- package/dist/index.es337.js +6 -6
- package/dist/index.es378.js +3 -3
- package/dist/index.es384.js +1 -1
- package/dist/index.es419.js +1 -1
- package/dist/index.es437.js +1 -1
- package/dist/index.es438.js +1 -1
- package/dist/index.es439.js +3674 -5
- package/dist/index.es439.js.map +1 -1
- package/dist/index.es440.js +5 -528
- package/dist/index.es440.js.map +1 -1
- package/dist/index.es441.js +2 -3675
- package/dist/index.es441.js.map +1 -1
- package/dist/index.es442.js +2 -6
- package/dist/index.es442.js.map +1 -1
- package/dist/index.es443.js +2 -2
- package/dist/index.es444.js +6 -2
- package/dist/index.es444.js.map +1 -1
- package/dist/index.es445.js +529 -2
- package/dist/index.es445.js.map +1 -1
- package/dist/index.es453.js +25 -5
- package/dist/index.es453.js.map +1 -1
- package/dist/index.es454.js +64 -23
- package/dist/index.es454.js.map +1 -1
- package/dist/index.es455.js +5 -66
- package/dist/index.es455.js.map +1 -1
- package/dist/index.es457.js +5 -33
- package/dist/index.es457.js.map +1 -1
- package/dist/index.es458.js +24 -621
- package/dist/index.es458.js.map +1 -1
- package/dist/index.es459.js +68 -10
- package/dist/index.es459.js.map +1 -1
- package/dist/index.es460.js +33 -5
- package/dist/index.es460.js.map +1 -1
- package/dist/index.es461.js +621 -24
- package/dist/index.es461.js.map +1 -1
- package/dist/index.es462.js +10 -68
- package/dist/index.es462.js.map +1 -1
- package/dist/index.es464.js +1 -1
- package/dist/index.es465.js +13 -44
- package/dist/index.es465.js.map +1 -1
- package/dist/index.es466.js +45 -13
- package/dist/index.es466.js.map +1 -1
- package/dist/index.es467.js +13 -124
- package/dist/index.es467.js.map +1 -1
- package/dist/index.es468.js +122 -12
- package/dist/index.es468.js.map +1 -1
- package/dist/index.es469.js +14 -134
- package/dist/index.es469.js.map +1 -1
- package/dist/index.es470.js +127 -211
- package/dist/index.es470.js.map +1 -1
- package/dist/index.es471.js +218 -13
- package/dist/index.es471.js.map +1 -1
- package/dist/index.es472.js +14 -181
- package/dist/index.es472.js.map +1 -1
- package/dist/index.es473.js +180 -10
- package/dist/index.es473.js.map +1 -1
- package/dist/index.es474.js +11 -50
- package/dist/index.es474.js.map +1 -1
- package/dist/index.es475.js +50 -9
- package/dist/index.es475.js.map +1 -1
- package/dist/index.es476.js +12 -0
- package/dist/index.es476.js.map +1 -0
- package/dist/{index.es479.js → index.es483.js} +2 -2
- package/dist/{index.es479.js.map → index.es483.js.map} +1 -1
- package/dist/{index.es480.js → index.es484.js} +3 -3
- package/dist/{index.es480.js.map → index.es484.js.map} +1 -1
- package/dist/{index.es481.js → index.es485.js} +2 -2
- package/dist/{index.es481.js.map → index.es485.js.map} +1 -1
- package/dist/{index.es482.js → index.es486.js} +4 -4
- package/dist/{index.es482.js.map → index.es486.js.map} +1 -1
- package/dist/{index.es488.js → index.es493.js} +1 -1
- package/dist/{index.es488.js.map → index.es493.js.map} +1 -1
- package/dist/index.es494.js +29 -15
- package/dist/index.es494.js.map +1 -1
- package/dist/index.es495.js +5 -5
- package/dist/index.es495.js.map +1 -1
- package/dist/index.es502.js +5 -525
- package/dist/index.es502.js.map +1 -1
- package/dist/index.es503.js +3 -128
- package/dist/index.es503.js.map +1 -1
- package/dist/index.es504.js +22 -132
- package/dist/index.es504.js.map +1 -1
- package/dist/{index.es498.js → index.es505.js} +2 -2
- package/dist/{index.es498.js.map → index.es505.js.map} +1 -1
- package/dist/{index.es499.js → index.es506.js} +2 -2
- package/dist/{index.es499.js.map → index.es506.js.map} +1 -1
- package/dist/index.es507.js +528 -0
- package/dist/index.es507.js.map +1 -0
- package/dist/index.es508.js +131 -0
- package/dist/index.es508.js.map +1 -0
- package/dist/index.es509.js +130 -61
- package/dist/index.es509.js.map +1 -1
- package/dist/index.es510.js +1 -1
- package/dist/index.es514.js +68 -0
- package/dist/index.es514.js.map +1 -0
- package/dist/index.es521.js +1 -1
- package/dist/index.es522.js +2 -2
- package/dist/index.es525.js +3 -3
- package/dist/index.es530.js +2 -2
- package/dist/index.es531.js +1 -1
- package/dist/index.es532.js +13 -13
- package/dist/index.es539.js +8 -8
- package/dist/index.es544.js +7 -7
- package/dist/index.es546.js +1 -1
- package/dist/index.es550.js +6 -2
- package/dist/index.es550.js.map +1 -1
- package/dist/index.es551.js +16 -2
- package/dist/index.es551.js.map +1 -1
- package/dist/index.es552.js +2 -2
- package/dist/index.es552.js.map +1 -1
- package/dist/index.es553.js +2 -6
- package/dist/index.es553.js.map +1 -1
- package/dist/index.es554.js +2 -16
- package/dist/index.es554.js.map +1 -1
- package/dist/index.es560.js +4 -3
- package/dist/index.es560.js.map +1 -1
- package/dist/index.es561.js +3 -2
- package/dist/index.es561.js.map +1 -1
- package/dist/index.es562.js +2 -4
- package/dist/index.es562.js.map +1 -1
- package/dist/{index.es568.js → index.es564.js} +3 -3
- package/dist/{index.es568.js.map → index.es564.js.map} +1 -1
- package/dist/{index.es569.js → index.es565.js} +1 -1
- package/dist/index.es565.js.map +1 -0
- package/dist/index.es655.js +1 -1
- package/dist/sections/Slider/Slider.css +1 -1
- package/package.json +1 -1
- package/dist/index.cjs489.js +0 -2
- package/dist/index.cjs489.js.map +0 -1
- package/dist/index.cjs490.js +0 -2
- package/dist/index.cjs490.js.map +0 -1
- package/dist/index.cjs496.js +0 -2
- package/dist/index.cjs496.js.map +0 -1
- package/dist/index.cjs497.js +0 -2
- package/dist/index.cjs497.js.map +0 -1
- package/dist/index.cjs569.js.map +0 -1
- package/dist/index.es489.js +0 -32
- package/dist/index.es489.js.map +0 -1
- package/dist/index.es490.js +0 -8
- package/dist/index.es490.js.map +0 -1
- package/dist/index.es496.js +0 -6
- package/dist/index.es496.js.map +0 -1
- package/dist/index.es497.js +0 -27
- package/dist/index.es497.js.map +0 -1
- package/dist/index.es569.js.map +0 -1
- /package/dist/components/ui/{DoctorConfirmModal/DoctorConfirmModalContent/DoctorConfirmModalContent.css → ConsentModal/ConsentModalContent/ConsentModalContent.css} +0 -0
- /package/dist/components/ui/{DoctorConfirmModal/DoctorConfirmModalFooter/DoctorConfirmModalFooter.css → ConsentModal/ConsentModalFooter/ConsentModalFooter.css} +0 -0
package/dist/index.es471.js
CHANGED
@@ -1,17 +1,222 @@
|
|
1
|
-
import * as
|
2
|
-
import
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
import * as c from "react";
|
2
|
+
import { useFloating as xe, offset as Pe, shift as ye, flip as Ae, size as ve, arrow as Ce, hide as be, limitShift as Re } from "./index.es484.js";
|
3
|
+
import { Root as Se } from "./index.es485.js";
|
4
|
+
import { useComposedRefs as T } from "./index.es453.js";
|
5
|
+
import { createContextScope as Oe } from "./index.es454.js";
|
6
|
+
import { Primitive as z } from "./index.es460.js";
|
7
|
+
import { useCallbackRef as Ee } from "./index.es474.js";
|
8
|
+
import { useLayoutEffect as B } from "./index.es463.js";
|
9
|
+
import { useSize as Ne } from "./index.es458.js";
|
10
|
+
import { j as f } from "./index.es225.js";
|
11
|
+
import { autoUpdate as _e } from "./index.es486.js";
|
12
|
+
var N = "Popper", [L, Ue] = Oe(N), [$e, Z] = L(N), U = (e) => {
|
13
|
+
const { __scopePopper: s, children: a } = e, [t, i] = c.useState(null);
|
14
|
+
return /* @__PURE__ */ f.jsx($e, { scope: s, anchor: t, onAnchorChange: i, children: a });
|
15
|
+
};
|
16
|
+
U.displayName = N;
|
17
|
+
var q = "PopperAnchor", G = c.forwardRef(
|
18
|
+
(e, s) => {
|
19
|
+
const { __scopePopper: a, virtualRef: t, ...i } = e, r = Z(q, a), o = c.useRef(null), w = T(s, o), n = c.useRef(null);
|
20
|
+
return c.useEffect(() => {
|
21
|
+
const p = n.current;
|
22
|
+
n.current = (t == null ? void 0 : t.current) || o.current, p !== n.current && r.onAnchorChange(n.current);
|
23
|
+
}), t ? null : /* @__PURE__ */ f.jsx(z.div, { ...i, ref: w });
|
24
|
+
}
|
25
|
+
);
|
26
|
+
G.displayName = q;
|
27
|
+
var _ = "PopperContent", [je, He] = L(_), J = c.forwardRef(
|
28
|
+
(e, s) => {
|
29
|
+
var I, Y, M, X, D, F;
|
30
|
+
const {
|
31
|
+
__scopePopper: a,
|
32
|
+
side: t = "bottom",
|
33
|
+
sideOffset: i = 0,
|
34
|
+
align: r = "center",
|
35
|
+
alignOffset: o = 0,
|
36
|
+
arrowPadding: w = 0,
|
37
|
+
avoidCollisions: n = !0,
|
38
|
+
collisionBoundary: p = [],
|
39
|
+
collisionPadding: x = 0,
|
40
|
+
sticky: m = "partial",
|
41
|
+
hideWhenDetached: y = !1,
|
42
|
+
updatePositionStrategy: A = "optimized",
|
43
|
+
onPlaced: l,
|
44
|
+
...d
|
45
|
+
} = e, v = Z(_, a), [h, C] = c.useState(null), ee = T(s, (P) => C(P)), [E, te] = c.useState(null), u = Ne(E), re = (u == null ? void 0 : u.width) ?? 0, $ = (u == null ? void 0 : u.height) ?? 0, oe = t + (r !== "center" ? "-" + r : ""), ne = typeof x == "number" ? x : { top: 0, right: 0, bottom: 0, left: 0, ...x }, j = Array.isArray(p) ? p : [p], ae = j.length > 0, b = {
|
46
|
+
padding: ne,
|
47
|
+
boundary: j.filter(Ie),
|
48
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
49
|
+
altBoundary: ae
|
50
|
+
}, { refs: ie, floatingStyles: H, placement: se, isPositioned: R, middlewareData: g } = xe({
|
51
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
52
|
+
strategy: "fixed",
|
53
|
+
placement: oe,
|
54
|
+
whileElementsMounted: (...P) => _e(...P, {
|
55
|
+
animationFrame: A === "always"
|
56
|
+
}),
|
57
|
+
elements: {
|
58
|
+
reference: v.anchor
|
59
|
+
},
|
60
|
+
middleware: [
|
61
|
+
Pe({ mainAxis: i + $, alignmentAxis: o }),
|
62
|
+
n && ye({
|
63
|
+
mainAxis: !0,
|
64
|
+
crossAxis: !1,
|
65
|
+
limiter: m === "partial" ? Re() : void 0,
|
66
|
+
...b
|
67
|
+
}),
|
68
|
+
n && Ae({ ...b }),
|
69
|
+
ve({
|
70
|
+
...b,
|
71
|
+
apply: ({ elements: P, rects: k, availableWidth: he, availableHeight: ue }) => {
|
72
|
+
const { width: ge, height: we } = k.reference, O = P.floating.style;
|
73
|
+
O.setProperty("--radix-popper-available-width", `${he}px`), O.setProperty("--radix-popper-available-height", `${ue}px`), O.setProperty("--radix-popper-anchor-width", `${ge}px`), O.setProperty("--radix-popper-anchor-height", `${we}px`);
|
74
|
+
}
|
75
|
+
}),
|
76
|
+
E && Ce({ element: E, padding: w }),
|
77
|
+
Ye({ arrowWidth: re, arrowHeight: $ }),
|
78
|
+
y && be({ strategy: "referenceHidden", ...b })
|
79
|
+
]
|
80
|
+
}), [W, pe] = V(se), S = Ee(l);
|
81
|
+
B(() => {
|
82
|
+
R && (S == null || S());
|
83
|
+
}, [R, S]);
|
84
|
+
const ce = (I = g.arrow) == null ? void 0 : I.x, de = (Y = g.arrow) == null ? void 0 : Y.y, le = ((M = g.arrow) == null ? void 0 : M.centerOffset) !== 0, [fe, me] = c.useState();
|
85
|
+
return B(() => {
|
86
|
+
h && me(window.getComputedStyle(h).zIndex);
|
87
|
+
}, [h]), /* @__PURE__ */ f.jsx(
|
88
|
+
"div",
|
89
|
+
{
|
90
|
+
ref: ie.setFloating,
|
91
|
+
"data-radix-popper-content-wrapper": "",
|
92
|
+
style: {
|
93
|
+
...H,
|
94
|
+
transform: R ? H.transform : "translate(0, -200%)",
|
95
|
+
// keep off the page when measuring
|
96
|
+
minWidth: "max-content",
|
97
|
+
zIndex: fe,
|
98
|
+
"--radix-popper-transform-origin": [
|
99
|
+
(X = g.transformOrigin) == null ? void 0 : X.x,
|
100
|
+
(D = g.transformOrigin) == null ? void 0 : D.y
|
101
|
+
].join(" "),
|
102
|
+
// hide the content if using the hide middleware and should be hidden
|
103
|
+
// set visibility to hidden and disable pointer events so the UI behaves
|
104
|
+
// as if the PopperContent isn't there at all
|
105
|
+
...((F = g.hide) == null ? void 0 : F.referenceHidden) && {
|
106
|
+
visibility: "hidden",
|
107
|
+
pointerEvents: "none"
|
108
|
+
}
|
109
|
+
},
|
110
|
+
dir: e.dir,
|
111
|
+
children: /* @__PURE__ */ f.jsx(
|
112
|
+
je,
|
113
|
+
{
|
114
|
+
scope: a,
|
115
|
+
placedSide: W,
|
116
|
+
onArrowChange: te,
|
117
|
+
arrowX: ce,
|
118
|
+
arrowY: de,
|
119
|
+
shouldHideArrow: le,
|
120
|
+
children: /* @__PURE__ */ f.jsx(
|
121
|
+
z.div,
|
122
|
+
{
|
123
|
+
"data-side": W,
|
124
|
+
"data-align": pe,
|
125
|
+
...d,
|
126
|
+
ref: ee,
|
127
|
+
style: {
|
128
|
+
...d.style,
|
129
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
130
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
131
|
+
animation: R ? void 0 : "none"
|
132
|
+
}
|
133
|
+
}
|
134
|
+
)
|
135
|
+
}
|
136
|
+
)
|
137
|
+
}
|
138
|
+
);
|
139
|
+
}
|
140
|
+
);
|
141
|
+
J.displayName = _;
|
142
|
+
var K = "PopperArrow", We = {
|
143
|
+
top: "bottom",
|
144
|
+
right: "left",
|
145
|
+
bottom: "top",
|
146
|
+
left: "right"
|
147
|
+
}, Q = c.forwardRef(function(s, a) {
|
148
|
+
const { __scopePopper: t, ...i } = s, r = He(K, t), o = We[r.placedSide];
|
149
|
+
return (
|
150
|
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
151
|
+
// doesn't report size as we'd expect on SVG elements.
|
152
|
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
153
|
+
/* @__PURE__ */ f.jsx(
|
154
|
+
"span",
|
155
|
+
{
|
156
|
+
ref: r.onArrowChange,
|
157
|
+
style: {
|
158
|
+
position: "absolute",
|
159
|
+
left: r.arrowX,
|
160
|
+
top: r.arrowY,
|
161
|
+
[o]: 0,
|
162
|
+
transformOrigin: {
|
163
|
+
top: "",
|
164
|
+
right: "0 0",
|
165
|
+
bottom: "center 0",
|
166
|
+
left: "100% 0"
|
167
|
+
}[r.placedSide],
|
168
|
+
transform: {
|
169
|
+
top: "translateY(100%)",
|
170
|
+
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
171
|
+
bottom: "rotate(180deg)",
|
172
|
+
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
173
|
+
}[r.placedSide],
|
174
|
+
visibility: r.shouldHideArrow ? "hidden" : void 0
|
175
|
+
},
|
176
|
+
children: /* @__PURE__ */ f.jsx(
|
177
|
+
Se,
|
178
|
+
{
|
179
|
+
...i,
|
180
|
+
ref: a,
|
181
|
+
style: {
|
182
|
+
...i.style,
|
183
|
+
// ensures the element can be measured correctly (mostly for if SVG)
|
184
|
+
display: "block"
|
185
|
+
}
|
186
|
+
}
|
187
|
+
)
|
188
|
+
}
|
189
|
+
)
|
190
|
+
);
|
191
|
+
});
|
192
|
+
Q.displayName = K;
|
193
|
+
function Ie(e) {
|
194
|
+
return e !== null;
|
195
|
+
}
|
196
|
+
var Ye = (e) => ({
|
197
|
+
name: "transformOrigin",
|
198
|
+
options: e,
|
199
|
+
fn(s) {
|
200
|
+
var v, h, C;
|
201
|
+
const { placement: a, rects: t, middlewareData: i } = s, o = ((v = i.arrow) == null ? void 0 : v.centerOffset) !== 0, w = o ? 0 : e.arrowWidth, n = o ? 0 : e.arrowHeight, [p, x] = V(a), m = { start: "0%", center: "50%", end: "100%" }[x], y = (((h = i.arrow) == null ? void 0 : h.x) ?? 0) + w / 2, A = (((C = i.arrow) == null ? void 0 : C.y) ?? 0) + n / 2;
|
202
|
+
let l = "", d = "";
|
203
|
+
return p === "bottom" ? (l = o ? m : `${y}px`, d = `${-n}px`) : p === "top" ? (l = o ? m : `${y}px`, d = `${t.floating.height + n}px`) : p === "right" ? (l = `${-n}px`, d = o ? m : `${A}px`) : p === "left" && (l = `${t.floating.width + n}px`, d = o ? m : `${A}px`), { data: { x: l, y: d } };
|
204
|
+
}
|
12
205
|
});
|
13
|
-
|
206
|
+
function V(e) {
|
207
|
+
const [s, a = "center"] = e.split("-");
|
208
|
+
return [s, a];
|
209
|
+
}
|
210
|
+
var qe = U, Ge = G, Je = J, Ke = Q;
|
14
211
|
export {
|
15
|
-
|
212
|
+
Ge as Anchor,
|
213
|
+
Ke as Arrow,
|
214
|
+
Je as Content,
|
215
|
+
U as Popper,
|
216
|
+
G as PopperAnchor,
|
217
|
+
Q as PopperArrow,
|
218
|
+
J as PopperContent,
|
219
|
+
qe as Root,
|
220
|
+
Ue as createPopperScope
|
16
221
|
};
|
17
222
|
//# sourceMappingURL=index.es471.js.map
|
package/dist/index.es471.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.es471.js","sources":["../node_modules/@radix-ui/react-portal/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/portal.tsx\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { jsx } from \"react/jsx-runtime\";\nvar PORTAL_NAME = \"Portal\";\nvar Portal = React.forwardRef((props, forwardedRef) => {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || mounted && globalThis?.document?.body;\n return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;\n});\nPortal.displayName = PORTAL_NAME;\nvar Root = Portal;\nexport {\n Portal,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["PORTAL_NAME","Portal","React","props","forwardedRef","containerProp","portalProps","mounted","setMounted","useLayoutEffect","container","_a","ReactDOM","jsx","Primitive"],"mappings":";;;;;AAQA,IAAIA,IAAc,UACdC,IAASC,EAAM,WAAW,CAACC,GAAOC,MAAiB;;AACrD,QAAM,EAAE,WAAWC,GAAe,GAAGC,EAAW,IAAKH,GAC/C,CAACI,GAASC,CAAU,IAAIN,EAAM,SAAS,EAAK;AAClDO,EAAAA,EAAgB,MAAMD,EAAW,EAAI,GAAG,CAAA,CAAE;AAC1C,QAAME,IAAYL,KAAiBE,OAAWI,IAAA,yCAAY,aAAZ,gBAAAA,EAAsB;AACpE,SAAOD,IAAYE,EAAS,aAA6BC,gBAAAA,EAAAA,IAAIC,EAAU,KAAK,EAAE,GAAGR,GAAa,KAAKF,EAAY,CAAE,GAAGM,CAAS,IAAI;AACnI,CAAC;AACDT,EAAO,cAAcD;","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index.es471.js","sources":["../node_modules/@radix-ui/react-popper/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/popper.tsx\nimport * as React from \"react\";\nimport {\n useFloating,\n autoUpdate,\n offset,\n shift,\n limitShift,\n hide,\n arrow as floatingUIarrow,\n flip,\n size\n} from \"@floating-ui/react-dom\";\nimport * as ArrowPrimitive from \"@radix-ui/react-arrow\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { useSize } from \"@radix-ui/react-use-size\";\nimport { jsx } from \"react/jsx-runtime\";\nvar SIDE_OPTIONS = [\"top\", \"right\", \"bottom\", \"left\"];\nvar ALIGN_OPTIONS = [\"start\", \"center\", \"end\"];\nvar POPPER_NAME = \"Popper\";\nvar [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\nvar [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);\nvar Popper = (props) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState(null);\n return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });\n};\nPopper.displayName = POPPER_NAME;\nvar ANCHOR_NAME = \"PopperAnchor\";\nvar PopperAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const anchorRef = React.useRef(null);\n React.useEffect(() => {\n const previousAnchor = anchorRef.current;\n anchorRef.current = virtualRef?.current || ref.current;\n if (previousAnchor !== anchorRef.current) {\n context.onAnchorChange(anchorRef.current);\n }\n });\n return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });\n }\n);\nPopperAnchor.displayName = ANCHOR_NAME;\nvar CONTENT_NAME = \"PopperContent\";\nvar [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);\nvar PopperContent = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopePopper,\n side = \"bottom\",\n sideOffset = 0,\n align = \"center\",\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary = [],\n collisionPadding: collisionPaddingProp = 0,\n sticky = \"partial\",\n hideWhenDetached = false,\n updatePositionStrategy = \"optimized\",\n onPlaced,\n ...contentProps\n } = props;\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n const [content, setContent] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const [arrow, setArrow] = React.useState(null);\n const arrowSize = useSize(arrow);\n const arrowWidth = arrowSize?.width ?? 0;\n const arrowHeight = arrowSize?.height ?? 0;\n const desiredPlacement = side + (align !== \"center\" ? \"-\" + align : \"\");\n const collisionPadding = typeof collisionPaddingProp === \"number\" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };\n const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];\n const hasExplicitBoundaries = boundary.length > 0;\n const detectOverflowOptions = {\n padding: collisionPadding,\n boundary: boundary.filter(isNotNull),\n // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries\n altBoundary: hasExplicitBoundaries\n };\n const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({\n // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues\n strategy: \"fixed\",\n placement: desiredPlacement,\n whileElementsMounted: (...args) => {\n const cleanup = autoUpdate(...args, {\n animationFrame: updatePositionStrategy === \"always\"\n });\n return cleanup;\n },\n elements: {\n reference: context.anchor\n },\n middleware: [\n offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),\n avoidCollisions && shift({\n mainAxis: true,\n crossAxis: false,\n limiter: sticky === \"partial\" ? limitShift() : void 0,\n ...detectOverflowOptions\n }),\n avoidCollisions && flip({ ...detectOverflowOptions }),\n size({\n ...detectOverflowOptions,\n apply: ({ elements, rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n const contentStyle = elements.floating.style;\n contentStyle.setProperty(\"--radix-popper-available-width\", `${availableWidth}px`);\n contentStyle.setProperty(\"--radix-popper-available-height\", `${availableHeight}px`);\n contentStyle.setProperty(\"--radix-popper-anchor-width\", `${anchorWidth}px`);\n contentStyle.setProperty(\"--radix-popper-anchor-height\", `${anchorHeight}px`);\n }\n }),\n arrow && floatingUIarrow({ element: arrow, padding: arrowPadding }),\n transformOrigin({ arrowWidth, arrowHeight }),\n hideWhenDetached && hide({ strategy: \"referenceHidden\", ...detectOverflowOptions })\n ]\n });\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const handlePlaced = useCallbackRef(onPlaced);\n useLayoutEffect(() => {\n if (isPositioned) {\n handlePlaced?.();\n }\n }, [isPositioned, handlePlaced]);\n const arrowX = middlewareData.arrow?.x;\n const arrowY = middlewareData.arrow?.y;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const [contentZIndex, setContentZIndex] = React.useState();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n return /* @__PURE__ */ jsx(\n \"div\",\n {\n ref: refs.setFloating,\n \"data-radix-popper-content-wrapper\": \"\",\n style: {\n ...floatingStyles,\n transform: isPositioned ? floatingStyles.transform : \"translate(0, -200%)\",\n // keep off the page when measuring\n minWidth: \"max-content\",\n zIndex: contentZIndex,\n [\"--radix-popper-transform-origin\"]: [\n middlewareData.transformOrigin?.x,\n middlewareData.transformOrigin?.y\n ].join(\" \"),\n // hide the content if using the hide middleware and should be hidden\n // set visibility to hidden and disable pointer events so the UI behaves\n // as if the PopperContent isn't there at all\n ...middlewareData.hide?.referenceHidden && {\n visibility: \"hidden\",\n pointerEvents: \"none\"\n }\n },\n dir: props.dir,\n children: /* @__PURE__ */ jsx(\n PopperContentProvider,\n {\n scope: __scopePopper,\n placedSide,\n onArrowChange: setArrow,\n arrowX,\n arrowY,\n shouldHideArrow: cannotCenterArrow,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-side\": placedSide,\n \"data-align\": placedAlign,\n ...contentProps,\n ref: composedRefs,\n style: {\n ...contentProps.style,\n // if the PopperContent hasn't been placed yet (not all measurements done)\n // we prevent animations so that users's animation don't kick in too early referring wrong sides\n animation: !isPositioned ? \"none\" : void 0\n }\n }\n )\n }\n )\n }\n );\n }\n);\nPopperContent.displayName = CONTENT_NAME;\nvar ARROW_NAME = \"PopperArrow\";\nvar OPPOSITE_SIDE = {\n top: \"bottom\",\n right: \"left\",\n bottom: \"top\",\n left: \"right\"\n};\nvar PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {\n const { __scopePopper, ...arrowProps } = props;\n const contentContext = useContentContext(ARROW_NAME, __scopePopper);\n const baseSide = OPPOSITE_SIDE[contentContext.placedSide];\n return (\n // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)\n // doesn't report size as we'd expect on SVG elements.\n // it reports their bounding box which is effectively the largest path inside the SVG.\n /* @__PURE__ */ jsx(\n \"span\",\n {\n ref: contentContext.onArrowChange,\n style: {\n position: \"absolute\",\n left: contentContext.arrowX,\n top: contentContext.arrowY,\n [baseSide]: 0,\n transformOrigin: {\n top: \"\",\n right: \"0 0\",\n bottom: \"center 0\",\n left: \"100% 0\"\n }[contentContext.placedSide],\n transform: {\n top: \"translateY(100%)\",\n right: \"translateY(50%) rotate(90deg) translateX(-50%)\",\n bottom: `rotate(180deg)`,\n left: \"translateY(50%) rotate(-90deg) translateX(50%)\"\n }[contentContext.placedSide],\n visibility: contentContext.shouldHideArrow ? \"hidden\" : void 0\n },\n children: /* @__PURE__ */ jsx(\n ArrowPrimitive.Root,\n {\n ...arrowProps,\n ref: forwardedRef,\n style: {\n ...arrowProps.style,\n // ensures the element can be measured correctly (mostly for if SVG)\n display: \"block\"\n }\n }\n )\n }\n )\n );\n});\nPopperArrow.displayName = ARROW_NAME;\nfunction isNotNull(value) {\n return value !== null;\n}\nvar transformOrigin = (options) => ({\n name: \"transformOrigin\",\n options,\n fn(data) {\n const { placement, rects, middlewareData } = data;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const isArrowHidden = cannotCenterArrow;\n const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;\n const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const noArrowAlign = { start: \"0%\", center: \"50%\", end: \"100%\" }[placedAlign];\n const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;\n const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;\n let x = \"\";\n let y = \"\";\n if (placedSide === \"bottom\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${-arrowHeight}px`;\n } else if (placedSide === \"top\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${rects.floating.height + arrowHeight}px`;\n } else if (placedSide === \"right\") {\n x = `${-arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n } else if (placedSide === \"left\") {\n x = `${rects.floating.width + arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n return { data: { x, y } };\n }\n});\nfunction getSideAndAlignFromPlacement(placement) {\n const [side, align = \"center\"] = placement.split(\"-\");\n return [side, align];\n}\nvar Root2 = Popper;\nvar Anchor = PopperAnchor;\nvar Content = PopperContent;\nvar Arrow = PopperArrow;\nexport {\n ALIGN_OPTIONS,\n Anchor,\n Arrow,\n Content,\n Popper,\n PopperAnchor,\n PopperArrow,\n PopperContent,\n Root2 as Root,\n SIDE_OPTIONS,\n createPopperScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["POPPER_NAME","createPopperContext","createPopperScope","createContextScope","PopperProvider","usePopperContext","Popper","props","__scopePopper","children","anchor","setAnchor","React","jsx","ANCHOR_NAME","PopperAnchor","forwardedRef","virtualRef","anchorProps","context","ref","composedRefs","useComposedRefs","anchorRef","previousAnchor","Primitive","CONTENT_NAME","PopperContentProvider","useContentContext","PopperContent","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPaddingProp","sticky","hideWhenDetached","updatePositionStrategy","onPlaced","contentProps","content","setContent","node","arrow","setArrow","arrowSize","useSize","arrowWidth","arrowHeight","desiredPlacement","collisionPadding","boundary","hasExplicitBoundaries","detectOverflowOptions","isNotNull","refs","floatingStyles","placement","isPositioned","middlewareData","useFloating","args","autoUpdate","offset","shift","limitShift","flip","size","elements","rects","availableWidth","availableHeight","anchorWidth","anchorHeight","contentStyle","floatingUIarrow","transformOrigin","hide","placedSide","placedAlign","getSideAndAlignFromPlacement","handlePlaced","useCallbackRef","useLayoutEffect","arrowX","_a","arrowY","_b","cannotCenterArrow","_c","contentZIndex","setContentZIndex","_d","_e","_f","ARROW_NAME","OPPOSITE_SIDE","PopperArrow","arrowProps","contentContext","baseSide","ArrowPrimitive.Root","value","options","data","isArrowHidden","noArrowAlign","arrowXCenter","arrowYCenter","x","y","Root2","Anchor","Content","Arrow"],"mappings":";;;;;;;;;;;AAyBA,IAAIA,IAAc,UACd,CAACC,GAAqBC,EAAiB,IAAIC,GAAmBH,CAAW,GACzE,CAACI,IAAgBC,CAAgB,IAAIJ,EAAoBD,CAAW,GACpEM,IAAS,CAACC,MAAU;AACtB,QAAM,EAAE,eAAAC,GAAe,UAAAC,EAAQ,IAAKF,GAC9B,CAACG,GAAQC,CAAS,IAAIC,EAAM,SAAS,IAAI;AAC/C,SAAuBC,gBAAAA,EAAAA,IAAIT,IAAgB,EAAE,OAAOI,GAAe,QAAAE,GAAQ,gBAAgBC,GAAW,UAAAF,GAAU;AAClH;AACAH,EAAO,cAAcN;AACrB,IAAIc,IAAc,gBACdC,IAAeH,EAAM;AAAA,EACvB,CAACL,GAAOS,MAAiB;AACvB,UAAM,EAAE,eAAAR,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AgBnB,IAAA9B,EAAe,UAAf,gBAAA8B,EAAsB,MAAK,KAAKzC,IAAc;AACpE,QAAI6D,IAAI,IACJC,IAAI;AACR,WAAIhC,MAAe,YACjB+B,IAAIJ,IAAgBC,IAAe,GAAGC,CAAY,MAClDG,IAAI,GAAG,CAAC9D,CAAW,QACV8B,MAAe,SACxB+B,IAAIJ,IAAgBC,IAAe,GAAGC,CAAY,MAClDG,IAAI,GAAGzC,EAAM,SAAS,SAASrB,CAAW,QACjC8B,MAAe,WACxB+B,IAAI,GAAG,CAAC7D,CAAW,MACnB8D,IAAIL,IAAgBC,IAAe,GAAGE,CAAY,QACzC9B,MAAe,WACxB+B,IAAI,GAAGxC,EAAM,SAAS,QAAQrB,CAAW,MACzC8D,IAAIL,IAAgBC,IAAe,GAAGE,CAAY,OAE7C,EAAE,MAAM,EAAE,GAAAC,GAAG,GAAAC,EAAC,EAAE;AAAA,EACzB;AACF;AACA,SAAS9B,EAA6BvB,GAAW;AAC/C,QAAM,CAAC9B,GAAME,IAAQ,QAAQ,IAAI4B,EAAU,MAAM,GAAG;AACpD,SAAO,CAAC9B,GAAME,CAAK;AACrB;AACG,IAACkF,KAAQ5G,GACR6G,KAASpG,GACTqG,KAAUvF,GACVwF,KAAQjB;","x_google_ignoreList":[0]}
|
package/dist/index.es472.js
CHANGED
@@ -1,184 +1,17 @@
|
|
1
|
-
import * as
|
2
|
-
import
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
[Z]
|
15
|
-
), [ee, oe] = $(I), O = s.forwardRef(
|
16
|
-
(e, r) => /* @__PURE__ */ d.jsx(y.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d.jsx(y.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d.jsx(te, { ...e, ref: r }) }) })
|
17
|
-
);
|
18
|
-
O.displayName = I;
|
19
|
-
var te = s.forwardRef((e, r) => {
|
20
|
-
const {
|
21
|
-
__scopeRovingFocusGroup: c,
|
22
|
-
orientation: o,
|
23
|
-
loop: T = !1,
|
24
|
-
dir: w,
|
25
|
-
currentTabStopId: v,
|
26
|
-
defaultCurrentTabStopId: C,
|
27
|
-
onCurrentTabStopIdChange: S,
|
28
|
-
onEntryFocus: m,
|
29
|
-
preventScrollOnEntryFocus: u = !1,
|
30
|
-
...b
|
31
|
-
} = e, F = s.useRef(null), g = V(r, F), R = W(w), [E, t] = Q({
|
32
|
-
prop: v,
|
33
|
-
defaultProp: C ?? null,
|
34
|
-
onChange: S,
|
35
|
-
caller: I
|
36
|
-
}), [i, h] = s.useState(!1), a = J(m), l = N(c), x = s.useRef(!1), [k, D] = s.useState(0);
|
37
|
-
return s.useEffect(() => {
|
38
|
-
const n = F.current;
|
39
|
-
if (n)
|
40
|
-
return n.addEventListener(_, a), () => n.removeEventListener(_, a);
|
41
|
-
}, [a]), /* @__PURE__ */ d.jsx(
|
42
|
-
ee,
|
43
|
-
{
|
44
|
-
scope: c,
|
45
|
-
orientation: o,
|
46
|
-
dir: R,
|
47
|
-
loop: T,
|
48
|
-
currentTabStopId: E,
|
49
|
-
onItemFocus: s.useCallback(
|
50
|
-
(n) => t(n),
|
51
|
-
[t]
|
52
|
-
),
|
53
|
-
onItemShiftTab: s.useCallback(() => h(!0), []),
|
54
|
-
onFocusableItemAdd: s.useCallback(
|
55
|
-
() => D((n) => n + 1),
|
56
|
-
[]
|
57
|
-
),
|
58
|
-
onFocusableItemRemove: s.useCallback(
|
59
|
-
() => D((n) => n - 1),
|
60
|
-
[]
|
61
|
-
),
|
62
|
-
children: /* @__PURE__ */ d.jsx(
|
63
|
-
G.div,
|
64
|
-
{
|
65
|
-
tabIndex: i || k === 0 ? -1 : 0,
|
66
|
-
"data-orientation": o,
|
67
|
-
...b,
|
68
|
-
ref: g,
|
69
|
-
style: { outline: "none", ...e.style },
|
70
|
-
onMouseDown: p(e.onMouseDown, () => {
|
71
|
-
x.current = !0;
|
72
|
-
}),
|
73
|
-
onFocus: p(e.onFocus, (n) => {
|
74
|
-
const L = !x.current;
|
75
|
-
if (n.target === n.currentTarget && L && !i) {
|
76
|
-
const P = new CustomEvent(_, X);
|
77
|
-
if (n.currentTarget.dispatchEvent(P), !P.defaultPrevented) {
|
78
|
-
const A = l().filter((f) => f.focusable), U = A.find((f) => f.active), B = A.find((f) => f.id === E), Y = [U, B, ...A].filter(
|
79
|
-
Boolean
|
80
|
-
).map((f) => f.ref.current);
|
81
|
-
M(Y, u);
|
82
|
-
}
|
83
|
-
}
|
84
|
-
x.current = !1;
|
85
|
-
}),
|
86
|
-
onBlur: p(e.onBlur, () => h(!1))
|
87
|
-
}
|
88
|
-
)
|
89
|
-
}
|
90
|
-
);
|
91
|
-
}), K = "RovingFocusGroupItem", j = s.forwardRef(
|
92
|
-
(e, r) => {
|
93
|
-
const {
|
94
|
-
__scopeRovingFocusGroup: c,
|
95
|
-
focusable: o = !0,
|
96
|
-
active: T = !1,
|
97
|
-
tabStopId: w,
|
98
|
-
children: v,
|
99
|
-
...C
|
100
|
-
} = e, S = q(), m = w || S, u = oe(K, c), b = u.currentTabStopId === m, F = N(c), { onFocusableItemAdd: g, onFocusableItemRemove: R, currentTabStopId: E } = u;
|
101
|
-
return s.useEffect(() => {
|
102
|
-
if (o)
|
103
|
-
return g(), () => R();
|
104
|
-
}, [o, g, R]), /* @__PURE__ */ d.jsx(
|
105
|
-
y.ItemSlot,
|
106
|
-
{
|
107
|
-
scope: c,
|
108
|
-
id: m,
|
109
|
-
focusable: o,
|
110
|
-
active: T,
|
111
|
-
children: /* @__PURE__ */ d.jsx(
|
112
|
-
G.span,
|
113
|
-
{
|
114
|
-
tabIndex: b ? 0 : -1,
|
115
|
-
"data-orientation": u.orientation,
|
116
|
-
...C,
|
117
|
-
ref: r,
|
118
|
-
onMouseDown: p(e.onMouseDown, (t) => {
|
119
|
-
o ? u.onItemFocus(m) : t.preventDefault();
|
120
|
-
}),
|
121
|
-
onFocus: p(e.onFocus, () => u.onItemFocus(m)),
|
122
|
-
onKeyDown: p(e.onKeyDown, (t) => {
|
123
|
-
if (t.key === "Tab" && t.shiftKey) {
|
124
|
-
u.onItemShiftTab();
|
125
|
-
return;
|
126
|
-
}
|
127
|
-
if (t.target !== t.currentTarget) return;
|
128
|
-
const i = se(t, u.orientation, u.dir);
|
129
|
-
if (i !== void 0) {
|
130
|
-
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey) return;
|
131
|
-
t.preventDefault();
|
132
|
-
let a = F().filter((l) => l.focusable).map((l) => l.ref.current);
|
133
|
-
if (i === "last") a.reverse();
|
134
|
-
else if (i === "prev" || i === "next") {
|
135
|
-
i === "prev" && a.reverse();
|
136
|
-
const l = a.indexOf(t.currentTarget);
|
137
|
-
a = u.loop ? ce(a, l + 1) : a.slice(l + 1);
|
138
|
-
}
|
139
|
-
setTimeout(() => M(a));
|
140
|
-
}
|
141
|
-
}),
|
142
|
-
children: typeof v == "function" ? v({ isCurrentTabStop: b, hasTabStop: E != null }) : v
|
143
|
-
}
|
144
|
-
)
|
145
|
-
}
|
146
|
-
);
|
147
|
-
}
|
148
|
-
);
|
149
|
-
j.displayName = K;
|
150
|
-
var re = {
|
151
|
-
ArrowLeft: "prev",
|
152
|
-
ArrowUp: "prev",
|
153
|
-
ArrowRight: "next",
|
154
|
-
ArrowDown: "next",
|
155
|
-
PageUp: "first",
|
156
|
-
Home: "first",
|
157
|
-
PageDown: "last",
|
158
|
-
End: "last"
|
159
|
-
};
|
160
|
-
function ne(e, r) {
|
161
|
-
return r !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
162
|
-
}
|
163
|
-
function se(e, r, c) {
|
164
|
-
const o = ne(e.key, c);
|
165
|
-
if (!(r === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(r === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
|
166
|
-
return re[o];
|
167
|
-
}
|
168
|
-
function M(e, r = !1) {
|
169
|
-
const c = document.activeElement;
|
170
|
-
for (const o of e)
|
171
|
-
if (o === c || (o.focus({ preventScroll: r }), document.activeElement !== c)) return;
|
172
|
-
}
|
173
|
-
function ce(e, r) {
|
174
|
-
return e.map((c, o) => e[(r + o) % e.length]);
|
175
|
-
}
|
176
|
-
var ge = O, Re = j;
|
1
|
+
import * as r from "react";
|
2
|
+
import f from "react-dom";
|
3
|
+
import { Primitive as u } from "./index.es460.js";
|
4
|
+
import { useLayoutEffect as c } from "./index.es463.js";
|
5
|
+
import { j as l } from "./index.es225.js";
|
6
|
+
var p = "Portal", d = r.forwardRef((e, a) => {
|
7
|
+
var o;
|
8
|
+
const { container: s, ...i } = e, [m, n] = r.useState(!1);
|
9
|
+
c(() => n(!0), []);
|
10
|
+
const t = s || m && ((o = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : o.body);
|
11
|
+
return t ? f.createPortal(/* @__PURE__ */ l.jsx(u.div, { ...i, ref: a }), t) : null;
|
12
|
+
});
|
13
|
+
d.displayName = p;
|
177
14
|
export {
|
178
|
-
|
179
|
-
ge as Root,
|
180
|
-
O as RovingFocusGroup,
|
181
|
-
j as RovingFocusGroupItem,
|
182
|
-
Fe as createRovingFocusGroupScope
|
15
|
+
d as Portal
|
183
16
|
};
|
184
17
|
//# sourceMappingURL=index.es472.js.map
|
package/dist/index.es472.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.es472.js","sources":["../node_modules/@radix-ui/react-roving-focus/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/roving-focus-group.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, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId ?? null,\n onChange: onCurrentTabStopIdChange,\n caller: GROUP_NAME\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 children,\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, currentTabStopId } = 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 children: typeof children === \"function\" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children\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","children","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,GAAI,GAClDC,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,CAAE;AAE5Q;AACAH,EAAiB,cAAcV;AAC/B,IAAIe,KAAuBJ,EAAM,WAAW,CAACC,GAAOC,MAAiB;AACnE,QAAM;AAAA,IACJ,yBA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,GAAevB,GAAO9B,GAAaE,GAAK;AAC/C,QAAMwD,IAAMD,GAAqB3B,EAAM,KAAK5B,CAAG;AAC/C,MAAI,EAAAF,MAAgB,cAAc,CAAC,aAAa,YAAY,EAAE,SAAS0D,CAAG,MACtE,EAAA1D,MAAgB,gBAAgB,CAAC,WAAW,WAAW,EAAE,SAAS0D,CAAG;AACzE,WAAOF,GAAwBE,CAAG;AACpC;AACA,SAASpB,EAAWqB,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,KAAO1E,GACP2E,KAAO5B;","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index.es472.js","sources":["../node_modules/@radix-ui/react-portal/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/portal.tsx\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { jsx } from \"react/jsx-runtime\";\nvar PORTAL_NAME = \"Portal\";\nvar Portal = React.forwardRef((props, forwardedRef) => {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || mounted && globalThis?.document?.body;\n return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;\n});\nPortal.displayName = PORTAL_NAME;\nvar Root = Portal;\nexport {\n Portal,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["PORTAL_NAME","Portal","React","props","forwardedRef","containerProp","portalProps","mounted","setMounted","useLayoutEffect","container","_a","ReactDOM","jsx","Primitive"],"mappings":";;;;;AAQA,IAAIA,IAAc,UACdC,IAASC,EAAM,WAAW,CAACC,GAAOC,MAAiB;;AACrD,QAAM,EAAE,WAAWC,GAAe,GAAGC,EAAW,IAAKH,GAC/C,CAACI,GAASC,CAAU,IAAIN,EAAM,SAAS,EAAK;AAClDO,EAAAA,EAAgB,MAAMD,EAAW,EAAI,GAAG,CAAA,CAAE;AAC1C,QAAME,IAAYL,KAAiBE,OAAWI,IAAA,yCAAY,aAAZ,gBAAAA,EAAsB;AACpE,SAAOD,IAAYE,EAAS,aAA6BC,gBAAAA,EAAAA,IAAIC,EAAU,KAAK,EAAE,GAAGR,GAAa,KAAKF,EAAY,CAAE,GAAGM,CAAS,IAAI;AACnI,CAAC;AACDT,EAAO,cAAcD;","x_google_ignoreList":[0]}
|