@anoki/fse-ui 1.0.425 → 1.0.426
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/navigations/Footer/Footer.css +1 -1
- package/dist/index.cjs16.js +1 -1
- package/dist/index.cjs16.js.map +1 -1
- package/dist/index.cjs18.js +1 -1
- package/dist/index.cjs186.js +1 -1
- package/dist/index.cjs186.js.map +1 -1
- package/dist/index.cjs190.js +1 -1
- package/dist/index.cjs191.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.cjs237.js +2 -2
- package/dist/index.cjs237.js.map +1 -1
- package/dist/index.cjs24.js +1 -1
- package/dist/index.cjs25.js +1 -1
- package/dist/index.cjs26.js +1 -1
- package/dist/index.cjs27.js +1 -1
- package/dist/index.cjs280.js +2 -2
- package/dist/index.cjs281.js +9 -9
- package/dist/index.cjs287.js +2 -0
- package/dist/index.cjs287.js.map +1 -0
- package/dist/index.cjs288.js +1 -1
- package/dist/index.cjs288.js.map +1 -1
- package/dist/index.cjs289.js +2 -0
- package/dist/index.cjs289.js.map +1 -0
- package/dist/{index.cjs294.js → index.cjs290.js} +2 -2
- package/dist/{index.cjs294.js.map → index.cjs290.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.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.cjs30.js +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.cjs310.js +1 -1
- package/dist/index.cjs310.js.map +1 -1
- package/dist/index.cjs311.js +1 -1
- package/dist/index.cjs311.js.map +1 -1
- package/dist/index.cjs312.js +1 -1
- package/dist/index.cjs312.js.map +1 -1
- package/dist/index.cjs313.js +1 -1
- package/dist/index.cjs313.js.map +1 -1
- package/dist/index.cjs314.js +1 -1
- package/dist/index.cjs314.js.map +1 -1
- package/dist/index.cjs315.js +1 -1
- package/dist/index.cjs315.js.map +1 -1
- package/dist/index.cjs316.js +2 -0
- package/dist/index.cjs316.js.map +1 -0
- package/dist/index.cjs32.js +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.cjs347.js → index.cjs323.js} +2 -2
- package/dist/{index.cjs347.js.map → index.cjs323.js.map} +1 -1
- package/dist/{index.cjs348.js → index.cjs324.js} +2 -2
- package/dist/{index.cjs348.js.map → index.cjs324.js.map} +1 -1
- package/dist/index.cjs325.js +2 -0
- package/dist/{index.cjs349.js.map → index.cjs325.js.map} +1 -1
- package/dist/{index.cjs350.js → index.cjs326.js} +1 -1
- package/dist/{index.cjs350.js.map → index.cjs326.js.map} +1 -1
- package/dist/{index.cjs351.js → index.cjs327.js} +2 -2
- package/dist/{index.cjs351.js.map → index.cjs327.js.map} +1 -1
- package/dist/index.cjs328.js +2 -0
- package/dist/index.cjs328.js.map +1 -0
- package/dist/index.cjs329.js +38 -1
- package/dist/index.cjs329.js.map +1 -1
- 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.cjs333.js +2 -0
- package/dist/{index.cjs352.js.map → index.cjs333.js.map} +1 -1
- package/dist/index.cjs334.js +2 -0
- package/dist/index.cjs334.js.map +1 -0
- 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 -1
- 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 +1 -1
- package/dist/index.cjs345.js.map +1 -1
- package/dist/index.cjs35.js +1 -1
- package/dist/index.cjs37.js +1 -1
- package/dist/index.cjs47.js +1 -1
- package/dist/index.cjs68.js +1 -1
- package/dist/index.cjs69.js +1 -1
- package/dist/index.cjs93.js +1 -1
- package/dist/index.es142.js +1 -1
- package/dist/index.es144.js +2 -2
- package/dist/index.es145.js +24 -24
- package/dist/index.es152.js +1 -1
- package/dist/index.es16.js +13 -13
- package/dist/index.es16.js.map +1 -1
- package/dist/index.es18.js +22 -22
- package/dist/index.es186.js +22 -22
- package/dist/index.es186.js.map +1 -1
- package/dist/index.es190.js +25 -25
- package/dist/index.es191.js +10 -10
- package/dist/index.es197.js +8 -8
- package/dist/index.es208.js +57 -57
- 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 +32 -32
- package/dist/index.es237.js +22 -22
- package/dist/index.es237.js.map +1 -1
- package/dist/index.es24.js +4 -4
- package/dist/index.es25.js +38 -38
- package/dist/index.es26.js +21 -21
- package/dist/index.es27.js +2 -2
- package/dist/index.es280.js +20 -20
- package/dist/index.es281.js +91 -91
- package/dist/index.es287.js +10 -0
- package/dist/index.es287.js.map +1 -0
- package/dist/index.es288.js +27 -15
- package/dist/index.es288.js.map +1 -1
- package/dist/index.es289.js +71 -0
- package/dist/index.es289.js.map +1 -0
- package/dist/index.es290.js +33 -0
- package/dist/{index.es294.js.map → index.es290.js.map} +1 -1
- package/dist/index.es291.js +32 -6
- package/dist/index.es291.js.map +1 -1
- package/dist/index.es292.js +618 -23
- package/dist/index.es292.js.map +1 -1
- package/dist/index.es293.js +10 -67
- package/dist/index.es293.js.map +1 -1
- package/dist/index.es295.js +10 -32
- package/dist/index.es295.js.map +1 -1
- package/dist/index.es296.js +41 -621
- package/dist/index.es296.js.map +1 -1
- package/dist/index.es297.js +45 -10
- package/dist/index.es297.js.map +1 -1
- package/dist/index.es298.js +7 -5
- package/dist/index.es298.js.map +1 -1
- package/dist/index.es299.js +123 -23
- package/dist/index.es299.js.map +1 -1
- package/dist/index.es300.js +13 -67
- package/dist/index.es300.js.map +1 -1
- package/dist/index.es301.js +134 -28
- package/dist/index.es301.js.map +1 -1
- package/dist/index.es302.js +217 -10
- package/dist/index.es302.js.map +1 -1
- package/dist/index.es303.js +13 -45
- package/dist/index.es303.js.map +1 -1
- package/dist/index.es304.js +66 -43
- package/dist/index.es304.js.map +1 -1
- package/dist/index.es305.js +177 -7
- package/dist/index.es305.js.map +1 -1
- package/dist/index.es306.js +47 -122
- package/dist/index.es306.js.map +1 -1
- package/dist/index.es307.js +8 -14
- package/dist/index.es307.js.map +1 -1
- package/dist/index.es308.js +4 -135
- package/dist/index.es308.js.map +1 -1
- package/dist/index.es309.js +11 -217
- package/dist/index.es309.js.map +1 -1
- package/dist/index.es310.js +204 -13
- package/dist/index.es310.js.map +1 -1
- package/dist/index.es311.js +19 -175
- package/dist/index.es311.js.map +1 -1
- package/dist/index.es312.js +25 -50
- package/dist/index.es312.js.map +1 -1
- package/dist/index.es313.js +393 -9
- package/dist/index.es313.js.map +1 -1
- package/dist/index.es314.js +24 -3
- package/dist/index.es314.js.map +1 -1
- package/dist/index.es315.js +28 -41
- package/dist/index.es315.js.map +1 -1
- package/dist/index.es316.js +8 -0
- package/dist/index.es316.js.map +1 -0
- package/dist/index.es32.js +4 -4
- package/dist/index.es320.js +5 -14
- package/dist/index.es320.js.map +1 -1
- package/dist/index.es321.js +3 -33
- package/dist/index.es321.js.map +1 -1
- package/dist/index.es322.js +23 -41
- package/dist/index.es322.js.map +1 -1
- package/dist/{index.es347.js → index.es323.js} +6 -6
- package/dist/{index.es347.js.map → index.es323.js.map} +1 -1
- package/dist/{index.es348.js → index.es324.js} +2 -2
- package/dist/{index.es348.js.map → index.es324.js.map} +1 -1
- package/dist/{index.es349.js → index.es325.js} +98 -98
- package/dist/{index.es349.js.map → index.es325.js.map} +1 -1
- package/dist/{index.es350.js → index.es326.js} +7 -7
- package/dist/{index.es350.js.map → index.es326.js.map} +1 -1
- package/dist/{index.es351.js → index.es327.js} +43 -43
- package/dist/{index.es351.js.map → index.es327.js.map} +1 -1
- package/dist/index.es328.js +9 -0
- package/dist/index.es328.js.map +1 -0
- package/dist/index.es329.js +68 -11
- package/dist/index.es329.js.map +1 -1
- package/dist/index.es330.js +8 -204
- package/dist/index.es330.js.map +1 -1
- package/dist/index.es331.js +14 -22
- package/dist/index.es331.js.map +1 -1
- package/dist/index.es332.js +60 -391
- package/dist/index.es332.js.map +1 -1
- package/dist/{index.es352.js → index.es333.js} +2 -2
- package/dist/{index.es352.js.map → index.es333.js.map} +1 -1
- package/dist/index.es334.js +18 -0
- package/dist/index.es334.js.map +1 -0
- package/dist/index.es340.js +3 -24
- package/dist/index.es340.js.map +1 -1
- package/dist/index.es341.js +23 -29
- package/dist/index.es341.js.map +1 -1
- package/dist/index.es342.js +23 -5
- package/dist/index.es342.js.map +1 -1
- package/dist/index.es343.js +13 -42
- package/dist/index.es343.js.map +1 -1
- package/dist/index.es344.js +28 -5
- package/dist/index.es344.js.map +1 -1
- package/dist/index.es345.js +5 -3
- package/dist/index.es345.js.map +1 -1
- package/dist/index.es35.js +14 -14
- package/dist/index.es37.js +6 -6
- package/dist/index.es47.js +2 -2
- package/dist/index.es5.js +4 -4
- package/dist/index.es65.js +44 -44
- package/dist/index.es68.js +25 -25
- package/dist/index.es69.js +23 -23
- package/dist/index.es93.js +17 -17
- package/package.json +2 -2
- package/dist/index.cjs318.js +0 -2
- package/dist/index.cjs318.js.map +0 -1
- package/dist/index.cjs319.js +0 -2
- package/dist/index.cjs319.js.map +0 -1
- package/dist/index.cjs339.js +0 -2
- package/dist/index.cjs339.js.map +0 -1
- package/dist/index.cjs346.js +0 -2
- package/dist/index.cjs346.js.map +0 -1
- package/dist/index.cjs349.js +0 -2
- package/dist/index.cjs352.js +0 -2
- package/dist/index.cjs353.js +0 -39
- package/dist/index.cjs353.js.map +0 -1
- package/dist/index.cjs354.js +0 -2
- package/dist/index.cjs354.js.map +0 -1
- package/dist/index.cjs355.js +0 -2
- package/dist/index.cjs355.js.map +0 -1
- package/dist/index.cjs356.js +0 -2
- package/dist/index.cjs356.js.map +0 -1
- package/dist/index.cjs357.js +0 -2
- package/dist/index.cjs357.js.map +0 -1
- package/dist/index.cjs358.js +0 -2
- package/dist/index.cjs358.js.map +0 -1
- package/dist/index.cjs359.js +0 -2
- package/dist/index.cjs359.js.map +0 -1
- package/dist/index.cjs360.js +0 -2
- package/dist/index.cjs360.js.map +0 -1
- package/dist/index.cjs361.js +0 -2
- package/dist/index.cjs361.js.map +0 -1
- package/dist/index.cjs362.js +0 -2
- package/dist/index.cjs362.js.map +0 -1
- package/dist/index.es294.js +0 -33
- package/dist/index.es318.js +0 -128
- package/dist/index.es318.js.map +0 -1
- package/dist/index.es319.js +0 -138
- package/dist/index.es319.js.map +0 -1
- package/dist/index.es339.js +0 -32
- package/dist/index.es339.js.map +0 -1
- package/dist/index.es346.js +0 -27
- package/dist/index.es346.js.map +0 -1
- package/dist/index.es353.js +0 -72
- package/dist/index.es353.js.map +0 -1
- package/dist/index.es354.js +0 -12
- package/dist/index.es354.js.map +0 -1
- package/dist/index.es355.js +0 -17
- package/dist/index.es355.js.map +0 -1
- package/dist/index.es356.js +0 -65
- package/dist/index.es356.js.map +0 -1
- package/dist/index.es357.js +0 -7
- package/dist/index.es357.js.map +0 -1
- package/dist/index.es358.js +0 -26
- package/dist/index.es358.js.map +0 -1
- package/dist/index.es359.js +0 -16
- package/dist/index.es359.js.map +0 -1
- package/dist/index.es360.js +0 -31
- package/dist/index.es360.js.map +0 -1
- package/dist/index.es361.js +0 -8
- package/dist/index.es361.js.map +0 -1
- package/dist/index.es362.js +0 -26
- package/dist/index.es362.js.map +0 -1
- /package/dist/components/ui/{DoctorModal/DoctorModalFooter/DoctorModalFooter.css → ConsentModal/ConsentModalFooter/ConsentModalFooter.css} +0 -0
package/dist/index.es65.js
CHANGED
@@ -13,35 +13,35 @@ const X = _.forwardRef(
|
|
13
13
|
columns: t,
|
14
14
|
data: s,
|
15
15
|
pagination: i,
|
16
|
-
initialCurrentPage:
|
16
|
+
initialCurrentPage: f = 1,
|
17
17
|
resultsPerPage: m = 10,
|
18
|
-
defaultSortDirection:
|
18
|
+
defaultSortDirection: n = "desc",
|
19
19
|
...p
|
20
20
|
}, g) => {
|
21
|
-
const [d,
|
21
|
+
const [d, u] = _.useState({
|
22
22
|
key: t[0].key || t[0].label,
|
23
|
-
direction:
|
24
|
-
}), [k, $] = _.useState(
|
25
|
-
const r = o[d.key],
|
26
|
-
(
|
23
|
+
direction: n
|
24
|
+
}), [k, $] = _.useState(f), N = _.useMemo(() => [...s].sort((o, x) => {
|
25
|
+
const r = o[d.key], l = x[d.key], b = t.find(
|
26
|
+
(j) => (j.key || j.label) === d.key
|
27
27
|
);
|
28
|
-
if (typeof r == "string" && typeof
|
28
|
+
if (typeof r == "string" && typeof l == "string") {
|
29
29
|
if ((b == null ? void 0 : b.type) === "date") {
|
30
|
-
const
|
30
|
+
const j = (M) => {
|
31
31
|
const [F, H] = M.split(" - "), [V, z, E] = F.split("/").map(Number), [O, U] = H.split(":").map(Number);
|
32
32
|
return new Date(E, z - 1, V, O, U);
|
33
|
-
},
|
34
|
-
return d.direction === "asc" ?
|
33
|
+
}, h = j(r), v = j(l);
|
34
|
+
return d.direction === "asc" ? h.getTime() - v.getTime() : v.getTime() - h.getTime();
|
35
35
|
}
|
36
36
|
if ((b == null ? void 0 : b.type) === "number") {
|
37
|
-
const
|
38
|
-
return d.direction === "asc" ?
|
37
|
+
const j = parseFloat(r), h = parseFloat(l);
|
38
|
+
return d.direction === "asc" ? j - h : h - j;
|
39
39
|
}
|
40
|
-
return d.direction === "asc" ? r.localeCompare(
|
40
|
+
return d.direction === "asc" ? r.localeCompare(l) : l.localeCompare(r);
|
41
41
|
}
|
42
|
-
return y(r) && y(
|
42
|
+
return y(r) && y(l) ? d.direction === "asc" ? r.firstLine.localeCompare(l.firstLine) : l.firstLine.localeCompare(r.firstLine) : 0;
|
43
43
|
}), [s, d, t]), S = (o) => {
|
44
|
-
|
44
|
+
u((x) => ({
|
45
45
|
key: o,
|
46
46
|
direction: x.key === o && x.direction === "asc" ? "desc" : "asc"
|
47
47
|
}));
|
@@ -55,7 +55,7 @@ const X = _.forwardRef(
|
|
55
55
|
role: "table",
|
56
56
|
...p,
|
57
57
|
children: [
|
58
|
-
/* @__PURE__ */ a.jsx(
|
58
|
+
/* @__PURE__ */ a.jsx(C, { className: "table__header", children: /* @__PURE__ */ a.jsx(w, { children: t.map((o, x) => /* @__PURE__ */ a.jsx(
|
59
59
|
R,
|
60
60
|
{
|
61
61
|
config: o,
|
@@ -64,21 +64,21 @@ const X = _.forwardRef(
|
|
64
64
|
},
|
65
65
|
`${o.label}-${x}`
|
66
66
|
)) }) }),
|
67
|
-
/* @__PURE__ */ a.jsx(D, { className: "table__body", children: I.map((o, x) => /* @__PURE__ */ a.jsx(w, { className: "table__row", children: Object.entries(o).map(([r,
|
67
|
+
/* @__PURE__ */ a.jsx(D, { className: "table__body", children: I.map((o, x) => /* @__PURE__ */ a.jsx(w, { className: "table__row", children: Object.entries(o).map(([r, l], b) => l ? r === "actionData" && A(l) ? /* @__PURE__ */ a.jsx(
|
68
68
|
T,
|
69
69
|
{
|
70
|
-
content:
|
70
|
+
content: l,
|
71
71
|
type: "action"
|
72
72
|
},
|
73
73
|
`${r}-${b}`
|
74
|
-
) : y(
|
74
|
+
) : y(l) ? /* @__PURE__ */ a.jsx(
|
75
75
|
T,
|
76
76
|
{
|
77
|
-
content:
|
77
|
+
content: l,
|
78
78
|
type: "double-line"
|
79
79
|
},
|
80
80
|
`${r}-${b}`
|
81
|
-
) : typeof
|
81
|
+
) : typeof l == "string" ? /* @__PURE__ */ a.jsx(T, { content: l }, `${r}-${b}`) : null : null) }, x)) })
|
82
82
|
]
|
83
83
|
}
|
84
84
|
),
|
@@ -95,7 +95,7 @@ const X = _.forwardRef(
|
|
95
95
|
}
|
96
96
|
);
|
97
97
|
X.displayName = "Table";
|
98
|
-
const
|
98
|
+
const C = _.forwardRef(
|
99
99
|
({ className: e, children: t, ...s }, i) => /* @__PURE__ */ a.jsx(
|
100
100
|
"thead",
|
101
101
|
{
|
@@ -106,7 +106,7 @@ const v = _.forwardRef(
|
|
106
106
|
}
|
107
107
|
)
|
108
108
|
);
|
109
|
-
|
109
|
+
C.displayName = "TableHeader";
|
110
110
|
const D = _.forwardRef(
|
111
111
|
({ className: e, children: t, ...s }, i) => /* @__PURE__ */ a.jsx(
|
112
112
|
"tbody",
|
@@ -134,15 +134,15 @@ const w = _.forwardRef(
|
|
134
134
|
)
|
135
135
|
);
|
136
136
|
w.displayName = "TableRow";
|
137
|
-
const R = _.forwardRef(({ className: e, config: t, sortConfig: s, onSort: i, ...
|
138
|
-
const
|
139
|
-
switch (
|
137
|
+
const R = _.forwardRef(({ className: e, config: t, sortConfig: s, onSort: i, ...f }, m) => {
|
138
|
+
const n = s.key === (t.key || t.label), p = n ? s.direction : null, g = () => p === "asc" ? "ascending" : "descending", d = (u) => {
|
139
|
+
switch (u) {
|
140
140
|
case "info":
|
141
141
|
return /* @__PURE__ */ a.jsx(W, {});
|
142
142
|
case "download":
|
143
143
|
return /* @__PURE__ */ a.jsx(Q, {});
|
144
144
|
default:
|
145
|
-
return
|
145
|
+
return u;
|
146
146
|
}
|
147
147
|
};
|
148
148
|
return /* @__PURE__ */ a.jsx(
|
@@ -159,8 +159,8 @@ const R = _.forwardRef(({ className: e, config: t, sortConfig: s, onSort: i, ...
|
|
159
159
|
),
|
160
160
|
onClick: t.sortable ? i : t.action,
|
161
161
|
"aria-label": t.ariaLabel,
|
162
|
-
"aria-sort":
|
163
|
-
...
|
162
|
+
"aria-sort": n ? g() : void 0,
|
163
|
+
...f,
|
164
164
|
children: /* @__PURE__ */ a.jsxs("div", { className: "table__cell--header--content", children: [
|
165
165
|
/* @__PURE__ */ a.jsx("div", { children: /* @__PURE__ */ a.jsx(
|
166
166
|
q,
|
@@ -178,18 +178,18 @@ const R = _.forwardRef(({ className: e, config: t, sortConfig: s, onSort: i, ...
|
|
178
178
|
/* @__PURE__ */ a.jsx(
|
179
179
|
G,
|
180
180
|
{
|
181
|
-
filled:
|
181
|
+
filled: n && p === "desc",
|
182
182
|
className: c("sort-indicator__triangle", {
|
183
|
-
active:
|
183
|
+
active: n && p === "desc"
|
184
184
|
})
|
185
185
|
}
|
186
186
|
),
|
187
187
|
/* @__PURE__ */ a.jsx(
|
188
188
|
J,
|
189
189
|
{
|
190
|
-
filled:
|
190
|
+
filled: n && p === "asc",
|
191
191
|
className: c("sort-indicator__triangle", {
|
192
|
-
active:
|
192
|
+
active: n && p === "asc"
|
193
193
|
})
|
194
194
|
}
|
195
195
|
)
|
@@ -205,10 +205,10 @@ const Y = ({ data: e }) => /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
205
205
|
] }), Z = ({ data: e }) => e.type === "link" && e.link ? /* @__PURE__ */ a.jsx("a", { href: e.link, "aria-label": e.ariaLabel, children: e.label }) : /* @__PURE__ */ a.jsx("button", { onClick: e.action, "aria-label": e.ariaLabel, children: e.label }), y = (e) => typeof e == "object" && e !== null && "firstLine" in e && "secondLine" in e, A = (e) => typeof e == "object" && e !== null && "label" in e && "type" in e, K = ({
|
206
206
|
content: e
|
207
207
|
}) => typeof e == "string" ? /* @__PURE__ */ a.jsx(a.Fragment, { children: e }) : y(e) ? /* @__PURE__ */ a.jsx(Y, { data: e }) : A(e) ? /* @__PURE__ */ a.jsx(Z, { data: e }) : null, T = _.forwardRef(
|
208
|
-
({ className: e, content: t, type: s, ...i },
|
208
|
+
({ className: e, content: t, type: s, ...i }, f) => /* @__PURE__ */ a.jsx(
|
209
209
|
"td",
|
210
210
|
{
|
211
|
-
ref:
|
211
|
+
ref: f,
|
212
212
|
className: c(
|
213
213
|
"table__cell",
|
214
214
|
{
|
@@ -228,10 +228,10 @@ const P = ({
|
|
228
228
|
totalResults: t,
|
229
229
|
resultsPerPage: s,
|
230
230
|
setCurrentPage: i,
|
231
|
-
className:
|
231
|
+
className: f
|
232
232
|
}) => {
|
233
233
|
const m = Math.ceil(t / s);
|
234
|
-
return /* @__PURE__ */ a.jsxs("div", { className: c("pagination",
|
234
|
+
return /* @__PURE__ */ a.jsxs("div", { className: c("pagination", f), children: [
|
235
235
|
/* @__PURE__ */ a.jsxs("div", { className: "pagination__info", children: [
|
236
236
|
"Stai visualizzando",
|
237
237
|
" ",
|
@@ -255,17 +255,17 @@ const P = ({
|
|
255
255
|
children: /* @__PURE__ */ a.jsx("svg", { className: "pagination__button-arrow", viewBox: "0 0 24 24", children: /* @__PURE__ */ a.jsx("path", { d: "M15 18l-6-6 6-6" }) })
|
256
256
|
}
|
257
257
|
),
|
258
|
-
Array.from({ length: m }, (
|
258
|
+
Array.from({ length: m }, (n, p) => p + 1).map((n) => /* @__PURE__ */ a.jsx(
|
259
259
|
"button",
|
260
260
|
{
|
261
261
|
className: c(
|
262
262
|
"pagination__button",
|
263
|
-
e ===
|
263
|
+
e === n && "pagination__button--active"
|
264
264
|
),
|
265
|
-
onClick: () => i(
|
266
|
-
children:
|
265
|
+
onClick: () => i(n),
|
266
|
+
children: n
|
267
267
|
},
|
268
|
-
|
268
|
+
n
|
269
269
|
)),
|
270
270
|
/* @__PURE__ */ a.jsx(
|
271
271
|
"button",
|
@@ -289,7 +289,7 @@ export {
|
|
289
289
|
D as TableBody,
|
290
290
|
T as TableCell,
|
291
291
|
R as TableHead,
|
292
|
-
|
292
|
+
C as TableHeader,
|
293
293
|
w as TableRow
|
294
294
|
};
|
295
295
|
//# sourceMappingURL=index.es65.js.map
|
package/dist/index.es68.js
CHANGED
@@ -1,33 +1,33 @@
|
|
1
1
|
import { j as i } from "./index.es161.js";
|
2
|
-
import
|
2
|
+
import n from "./index.es142.js";
|
3
3
|
import "./index.es3.js";
|
4
4
|
import './components/ui/DatePicker/DatePicker.css';/* empty css */
|
5
|
-
import { clsx as
|
6
|
-
import { useRef as
|
5
|
+
import { clsx as D } from "./index.es163.js";
|
6
|
+
import { useRef as h, useEffect as j } from "react";
|
7
7
|
const F = ({
|
8
|
-
label:
|
8
|
+
label: s,
|
9
9
|
value: m,
|
10
10
|
maxValue: c,
|
11
11
|
minValue: l,
|
12
|
-
className:
|
13
|
-
disabled:
|
12
|
+
className: f,
|
13
|
+
disabled: d,
|
14
14
|
onClick: a,
|
15
15
|
onChange: y,
|
16
16
|
error: r,
|
17
|
-
required:
|
17
|
+
required: p = !1,
|
18
18
|
id: b
|
19
19
|
}) => {
|
20
|
-
const t =
|
20
|
+
const t = h(null), e = b || `datepicker-${s.toLowerCase().replace(/\s+/g, "-")}`;
|
21
21
|
j(() => {
|
22
22
|
r && t.current ? (t.current.setAttribute("aria-invalid", "true"), t.current.setAttribute("aria-describedby", `${e}-error`)) : t.current && (t.current.setAttribute("aria-invalid", "false"), t.current.removeAttribute("aria-describedby"));
|
23
23
|
}, [r, e]);
|
24
|
-
const
|
25
|
-
|
26
|
-
},
|
24
|
+
const v = (o) => {
|
25
|
+
o.key === "Enter" && !d && (a == null || a());
|
26
|
+
}, x = m ? n.fromJSDate(m).toFormat("yyyy-MM-dd") : "";
|
27
27
|
return /* @__PURE__ */ i.jsxs(
|
28
28
|
"div",
|
29
29
|
{
|
30
|
-
className:
|
30
|
+
className: D("datepicker-container", f),
|
31
31
|
role: "group",
|
32
32
|
"aria-labelledby": `${e}-label`,
|
33
33
|
"aria-describedby": r ? `${e}-error` : void 0,
|
@@ -39,8 +39,8 @@ const F = ({
|
|
39
39
|
htmlFor: e,
|
40
40
|
className: "datepicker-label fs-7",
|
41
41
|
children: [
|
42
|
-
|
43
|
-
|
42
|
+
s,
|
43
|
+
p && /* @__PURE__ */ i.jsx("span", { className: "text-error ml-1", "aria-hidden": "true", children: "*" })
|
44
44
|
]
|
45
45
|
}
|
46
46
|
),
|
@@ -51,19 +51,19 @@ const F = ({
|
|
51
51
|
id: e,
|
52
52
|
type: "date",
|
53
53
|
className: "datepicker-input fs-6",
|
54
|
-
disabled:
|
55
|
-
value:
|
56
|
-
max: c ?
|
57
|
-
min: l ?
|
54
|
+
disabled: d,
|
55
|
+
value: x,
|
56
|
+
max: c ? n.fromJSDate(c).toFormat("yyyy-MM-dd") : void 0,
|
57
|
+
min: l ? n.fromJSDate(l).toFormat("yyyy-MM-dd") : void 0,
|
58
58
|
onClick: () => a == null ? void 0 : a(),
|
59
|
-
onChange: (
|
60
|
-
const
|
61
|
-
isNaN(
|
59
|
+
onChange: (o) => {
|
60
|
+
const u = new Date(o.target.value);
|
61
|
+
isNaN(u.getTime()) || y(u);
|
62
62
|
},
|
63
|
-
onKeyDown:
|
64
|
-
"aria-required":
|
65
|
-
"aria-disabled":
|
66
|
-
"aria-label":
|
63
|
+
onKeyDown: v,
|
64
|
+
"aria-required": p,
|
65
|
+
"aria-disabled": d,
|
66
|
+
"aria-label": s,
|
67
67
|
"aria-invalid": !!r,
|
68
68
|
"aria-describedby": r ? `${e}-error` : void 0
|
69
69
|
}
|
package/dist/index.es69.js
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
import { j as i } from "./index.es161.js";
|
2
|
-
import { clsx as
|
2
|
+
import { clsx as h } from "./index.es163.js";
|
3
3
|
import { useRef as k, useEffect as N } from "react";
|
4
|
-
import { DatePicker as
|
4
|
+
import { DatePicker as x } from "./index.es68.js";
|
5
5
|
import { Row as $ } from "./index.es9.js";
|
6
6
|
const E = ({
|
7
7
|
label: l,
|
8
|
-
startDateLabel:
|
9
|
-
endDateLabel:
|
8
|
+
startDateLabel: f = "Start Date",
|
9
|
+
endDateLabel: p = "End Date",
|
10
10
|
startDate: t,
|
11
11
|
endDate: c,
|
12
|
-
className:
|
12
|
+
className: d,
|
13
13
|
disabled: u = !1,
|
14
|
-
required:
|
14
|
+
required: o = !1,
|
15
15
|
error: a,
|
16
|
-
onStartDateChange:
|
16
|
+
onStartDateChange: n,
|
17
17
|
onEndDateChange: m,
|
18
18
|
onStartDateClick: b,
|
19
|
-
onEndDateClick:
|
19
|
+
onEndDateClick: v
|
20
20
|
}) => {
|
21
21
|
const r = k(null), s = l ? `datepicker-range-${l.toLowerCase().replace(/\s+/g, "-")}` : "datepicker-range";
|
22
22
|
N(() => {
|
@@ -25,48 +25,48 @@ const E = ({
|
|
25
25
|
`${s}-error`
|
26
26
|
)) : r.current && (r.current.setAttribute("aria-invalid", "false"), r.current.removeAttribute("aria-describedby"));
|
27
27
|
}, [a, s]);
|
28
|
-
const
|
29
|
-
c && e > c ? (
|
30
|
-
},
|
31
|
-
t && e < t &&
|
28
|
+
const j = (e) => {
|
29
|
+
c && e > c ? (n(e), m(e)) : n(e);
|
30
|
+
}, g = (e) => {
|
31
|
+
t && e < t && n(e), m(e);
|
32
32
|
};
|
33
33
|
return /* @__PURE__ */ i.jsxs(
|
34
34
|
"div",
|
35
35
|
{
|
36
36
|
ref: r,
|
37
|
-
className:
|
37
|
+
className: h("base-col gap-x8", d),
|
38
38
|
role: "group",
|
39
39
|
"aria-labelledby": l ? `${s}-label` : void 0,
|
40
40
|
"aria-describedby": a ? `${s}-error` : void 0,
|
41
41
|
children: [
|
42
42
|
l && /* @__PURE__ */ i.jsxs("label", { id: `${s}-label`, className: "text-sm text-dark", children: [
|
43
43
|
l,
|
44
|
-
|
44
|
+
o && /* @__PURE__ */ i.jsx("span", { className: "text-error ml-1", "aria-hidden": "true", children: "*" })
|
45
45
|
] }),
|
46
46
|
/* @__PURE__ */ i.jsxs($, { gap: "x16", role: "group", children: [
|
47
47
|
/* @__PURE__ */ i.jsx(
|
48
|
-
|
48
|
+
x,
|
49
49
|
{
|
50
|
-
label:
|
50
|
+
label: f,
|
51
51
|
value: t,
|
52
52
|
maxValue: c,
|
53
53
|
disabled: u,
|
54
|
-
required:
|
55
|
-
onChange:
|
54
|
+
required: o,
|
55
|
+
onChange: j,
|
56
56
|
onClick: b,
|
57
57
|
className: "flex-1"
|
58
58
|
}
|
59
59
|
),
|
60
60
|
/* @__PURE__ */ i.jsx(
|
61
|
-
|
61
|
+
x,
|
62
62
|
{
|
63
|
-
label:
|
63
|
+
label: p,
|
64
64
|
value: c,
|
65
65
|
minValue: t,
|
66
66
|
disabled: u,
|
67
|
-
required:
|
68
|
-
onChange:
|
69
|
-
onClick:
|
67
|
+
required: o,
|
68
|
+
onChange: g,
|
69
|
+
onClick: v,
|
70
70
|
className: "flex-1"
|
71
71
|
}
|
72
72
|
)
|
package/dist/index.es93.js
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
import { j as e } from "./index.es161.js";
|
2
2
|
import './sections/WhatDoYouNeed/WhatDoYouNeed.css';/* empty css */
|
3
|
-
import { Section as
|
3
|
+
import { Section as r } from "./index.es46.js";
|
4
4
|
import { Col as c } from "./index.es10.js";
|
5
5
|
import { Button as m } from "./index.es25.js";
|
6
|
-
const
|
6
|
+
const f = ({
|
7
7
|
title: t,
|
8
|
-
description:
|
9
|
-
links:
|
10
|
-
asLink:
|
11
|
-
}) => /* @__PURE__ */ e.jsxs(
|
8
|
+
description: i,
|
9
|
+
links: o,
|
10
|
+
asLink: n = "a"
|
11
|
+
}) => /* @__PURE__ */ e.jsxs(r, { className: "base-col ui-what-do-you-need-section", children: [
|
12
12
|
/* @__PURE__ */ e.jsxs(c, { className: "ui-what-do-you-need-content", children: [
|
13
|
-
/* @__PURE__ */ e.jsx(
|
14
|
-
|
13
|
+
/* @__PURE__ */ e.jsx(r.Title, { fs: "2", children: t }),
|
14
|
+
i && /* @__PURE__ */ e.jsx(r.Description, { children: i })
|
15
15
|
] }),
|
16
16
|
/* @__PURE__ */ e.jsx(
|
17
17
|
"ul",
|
@@ -19,22 +19,22 @@ const j = ({
|
|
19
19
|
role: "list",
|
20
20
|
"aria-label": `Lista di ${t}`,
|
21
21
|
className: "list-style-none ui-what-do-you-need-links",
|
22
|
-
children:
|
22
|
+
children: o == null ? void 0 : o.map(({ link: s, title: l, isNewTab: a }, d) => /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
|
23
23
|
m,
|
24
24
|
{
|
25
|
-
asLink:
|
26
|
-
href:
|
25
|
+
asLink: n,
|
26
|
+
href: s,
|
27
27
|
size: "2",
|
28
|
-
variant:
|
29
|
-
target:
|
30
|
-
rel:
|
31
|
-
children:
|
28
|
+
variant: d > 0 ? "secondary" : "primary",
|
29
|
+
target: a ? "_blank" : void 0,
|
30
|
+
rel: a ? "noopener noreferrer" : void 0,
|
31
|
+
children: l
|
32
32
|
}
|
33
|
-
) },
|
33
|
+
) }, s))
|
34
34
|
}
|
35
35
|
)
|
36
36
|
] });
|
37
37
|
export {
|
38
|
-
|
38
|
+
f as WhatDoYouNeed
|
39
39
|
};
|
40
40
|
//# sourceMappingURL=index.es93.js.map
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@anoki/fse-ui",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.426",
|
4
4
|
"description": "FSE UI components library",
|
5
5
|
"type": "module",
|
6
6
|
"main": "dist/index.cjs.js",
|
@@ -17,7 +17,7 @@
|
|
17
17
|
"test-watch": "vitest",
|
18
18
|
"test:ui": "vitest --ui",
|
19
19
|
"sb": "storybook dev -p 6006",
|
20
|
-
"release
|
20
|
+
"release": "npm run build && npm publish --access public",
|
21
21
|
"build-storybook": "storybook build",
|
22
22
|
"prepare": "husky",
|
23
23
|
"patch": "npm version patch"
|
package/dist/index.cjs318.js
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react"),y=require("./index.cjs291.js"),p=require("./index.cjs321.js"),R=require("./index.cjs292.js"),x=require("./index.cjs302.js"),H=require("./index.cjs329.js"),w=require("./index.cjs161.js");function U(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const o=U(q);var z="DismissableLayer",h="dismissableLayer.update",M="dismissableLayer.pointerDownOutside",$="dismissableLayer.focusOutside",L,T=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),S=o.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:l,onDismiss:d,...v}=e,c=o.useContext(T),[u,F]=o.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,N]=o.useState({}),W=R.useComposedRefs(t,i=>F(i)),m=Array.from(c.layers),[_]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),A=m.indexOf(_),P=u?m.indexOf(u):-1,k=c.layersWithOutsidePointerEventsDisabled.size>0,D=P>=A,I=Y(i=>{const E=i.target,C=[...c.branches].some(b=>b.contains(E));!D||C||(r==null||r(i),l==null||l(i),i.defaultPrevented||d==null||d())},f),O=G(i=>{const E=i.target;[...c.branches].some(b=>b.contains(E))||(a==null||a(i),l==null||l(i),i.defaultPrevented||d==null||d())},f);return H.useEscapeKeydown(i=>{P===c.layers.size-1&&(s==null||s(i),!i.defaultPrevented&&d&&(i.preventDefault(),d()))},f),o.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(L=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),g(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=L)}},[u,f,n,c]),o.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),g())},[u,c]),o.useEffect(()=>{const i=()=>N({});return document.addEventListener(h,i),()=>document.removeEventListener(h,i)},[]),w.jsxRuntimeExports.jsx(p.Primitive.div,{...v,ref:W,style:{pointerEvents:k?D?"auto":"none":void 0,...e.style},onFocusCapture:y.composeEventHandlers(e.onFocusCapture,O.onFocusCapture),onBlurCapture:y.composeEventHandlers(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:y.composeEventHandlers(e.onPointerDownCapture,I.onPointerDownCapture)})});S.displayName=z;var X="DismissableLayerBranch",B=o.forwardRef((e,t)=>{const n=o.useContext(T),s=o.useRef(null),r=R.useComposedRefs(t,s);return o.useEffect(()=>{const a=s.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),w.jsxRuntimeExports.jsx(p.Primitive.div,{...e,ref:r})});B.displayName=X;function Y(e,t=globalThis==null?void 0:globalThis.document){const n=x.useCallbackRef(e),s=o.useRef(!1),r=o.useRef(()=>{});return o.useEffect(()=>{const a=d=>{if(d.target&&!s.current){let v=function(){j(M,n,c,{discrete:!0})};const c={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=v,t.addEventListener("click",r.current,{once:!0})):v()}else t.removeEventListener("click",r.current);s.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function G(e,t=globalThis==null?void 0:globalThis.document){const n=x.useCallbackRef(e),s=o.useRef(!1);return o.useEffect(()=>{const r=a=>{a.target&&!s.current&&j($,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function g(){const e=new CustomEvent(h);document.dispatchEvent(e)}function j(e,t,n,{discrete:s}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),s?p.dispatchDiscreteCustomEvent(r,a):r.dispatchEvent(a)}exports.DismissableLayer=S;exports.DismissableLayerBranch=B;
|
2
|
-
//# sourceMappingURL=index.cjs318.js.map
|
package/dist/index.cjs318.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.cjs318.js","sources":["../node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/dismissable-layer/src/dismissable-layer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DISMISSABLE_LAYER_NAME = \"DismissableLayer\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const focusOutside = useFocusOutside((event) => {\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }\n);\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\nvar BRANCH_NAME = \"DismissableLayerBranch\";\nvar DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n});\nDismissableLayerBranch.displayName = BRANCH_NAME;\nfunction usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n const handlePointerDown = (event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n const eventDetail = { originalEvent: event };\n if (event.pointerType === \"touch\") {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent2();\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true\n };\n}\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = (event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n };\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: () => isFocusInsideReactTreeRef.current = true,\n onBlurCapture: () => isFocusInsideReactTreeRef.current = false\n };\n}\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\nvar Root = DismissableLayer;\nvar Branch = DismissableLayerBranch;\nexport {\n Branch,\n DismissableLayer,\n DismissableLayerBranch,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DISMISSABLE_LAYER_NAME","CONTEXT_UPDATE","POINTER_DOWN_OUTSIDE","FOCUS_OUTSIDE","originalBodyPointerEvents","DismissableLayerContext","React","DismissableLayer","props","forwardedRef","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","layerProps","context","node","setNode","ownerDocument","force","composedRefs","useComposedRefs","node2","layers","highestLayerWithOutsidePointerEventsDisabled","highestLayerWithOutsidePointerEventsDisabledIndex","index","isBodyPointerEventsDisabled","isPointerEventsEnabled","pointerDownOutside","usePointerDownOutside","event","target","isPointerDownOnBranch","branch","focusOutside","useFocusOutside","useEscapeKeydown","dispatchUpdate","handleUpdate","jsx","Primitive","composeEventHandlers","BRANCH_NAME","DismissableLayerBranch","ref","handlePointerDownOutside","useCallbackRef","isPointerInsideReactTreeRef","handleClickRef","handlePointerDown","handleAndDispatchPointerDownOutsideEvent2","handleAndDispatchCustomEvent","eventDetail","timerId","handleFocusOutside","isFocusInsideReactTreeRef","handleFocus","name","handler","detail","discrete","dispatchDiscreteCustomEvent"],"mappings":"6jBAUA,IAAIA,EAAyB,mBACzBC,EAAiB,0BACjBC,EAAuB,sCACvBC,EAAgB,gCAChBC,EACAC,EAA0BC,EAAM,cAAc,CAChD,OAAwB,IAAI,IAC5B,uCAAwD,IAAI,IAC5D,SAA0B,IAAI,GAChC,CAAC,EACGC,EAAmBD,EAAM,WAC3B,CAACE,EAAOC,IAAiB,CACvB,KAAM,CACJ,4BAAAC,EAA8B,GAC9B,gBAAAC,EACA,qBAAAC,EACA,eAAAC,EACA,kBAAAC,EACA,UAAAC,EACA,GAAGC,CACT,EAAQR,EACES,EAAUX,EAAM,WAAWD,CAAuB,EAClD,CAACa,EAAMC,CAAO,EAAIb,EAAM,SAAS,IAAI,EACrCc,GAAgBF,GAAA,YAAAA,EAAM,iBAAiB,mCAAY,UACnD,CAAG,CAAAG,CAAK,EAAIf,EAAM,SAAS,CAAA,CAAE,EAC7BgB,EAAeC,EAAAA,gBAAgBd,EAAee,GAAUL,EAAQK,CAAK,CAAC,EACtEC,EAAS,MAAM,KAAKR,EAAQ,MAAM,EAClC,CAACS,CAA4C,EAAI,CAAC,GAAGT,EAAQ,sCAAsC,EAAE,MAAM,EAAE,EAC7GU,EAAoDF,EAAO,QAAQC,CAA4C,EAC/GE,EAAQV,EAAOO,EAAO,QAAQP,CAAI,EAAI,GACtCW,EAA8BZ,EAAQ,uCAAuC,KAAO,EACpFa,EAAyBF,GAASD,EAClCI,EAAqBC,EAAuBC,GAAU,CAC1D,MAAMC,EAASD,EAAM,OACfE,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D,cAAe,IAAMA,EAA0B,QAAU,EAC1D,CACH,CACA,SAASlB,GAAiB,CACxB,MAAMP,EAAQ,IAAI,YAAYhC,CAAc,EAC5C,SAAS,cAAcgC,CAAK,CAC9B,CACA,SAASqB,EAA6BM,EAAMC,EAASC,EAAQ,CAAE,SAAAC,CAAQ,EAAI,CACzE,MAAM7B,EAAS4B,EAAO,cAAc,OAC9B7B,EAAQ,IAAI,YAAY2B,EAAM,CAAE,QAAS,GAAO,WAAY,GAAM,OAAAE,EAAQ,EAC5ED,GAAS3B,EAAO,iBAAiB0B,EAAMC,EAAS,CAAE,KAAM,GAAM,EAC9DE,EACFC,EAA2B,4BAAC9B,EAAQD,CAAK,EAEzCC,EAAO,cAAcD,CAAK,CAE9B","x_google_ignoreList":[0]}
|
package/dist/index.cjs319.js
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("react"),x=require("./index.cjs292.js"),A=require("./index.cjs321.js"),O=require("./index.cjs302.js"),k=require("./index.cjs161.js");function w(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const f=w(U);var F="focusScope.autoFocusOnMount",y="focusScope.autoFocusOnUnmount",S={bubbles:!1,cancelable:!0},K="FocusScope",C=f.forwardRef((e,n)=>{const{loop:t=!1,trapped:s=!1,onMountAutoFocus:p,onUnmountAutoFocus:I,...L}=e,[o,P]=f.useState(null),E=O.useCallbackRef(p),v=O.useCallbackRef(I),b=f.useRef(null),_=x.useComposedRefs(n,u=>P(u)),a=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(s){let u=function(i){if(a.paused||!o)return;const c=i.target;o.contains(c)?b.current=c:d(b.current,{select:!0})},l=function(i){if(a.paused||!o)return;const c=i.relatedTarget;c!==null&&(o.contains(c)||d(b.current,{select:!0}))},r=function(i){if(document.activeElement===document.body)for(const T of i)T.removedNodes.length>0&&d(o)};document.addEventListener("focusin",u),document.addEventListener("focusout",l);const m=new MutationObserver(r);return o&&m.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",l),m.disconnect()}}},[s,o,a.paused]),f.useEffect(()=>{if(o){N.add(a);const u=document.activeElement;if(!o.contains(u)){const r=new CustomEvent(F,S);o.addEventListener(F,E),o.dispatchEvent(r),r.defaultPrevented||(j(W(R(o)),{select:!0}),document.activeElement===u&&d(o))}return()=>{o.removeEventListener(F,E),setTimeout(()=>{const r=new CustomEvent(y,S);o.addEventListener(y,v),o.dispatchEvent(r),r.defaultPrevented||d(u??document.body,{select:!0}),o.removeEventListener(y,v),N.remove(a)},0)}}},[o,E,v,a]);const M=f.useCallback(u=>{if(!t&&!s||a.paused)return;const l=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,r=document.activeElement;if(l&&r){const m=u.currentTarget,[i,c]=D(m);i&&c?!u.shiftKey&&r===c?(u.preventDefault(),t&&d(i,{select:!0})):u.shiftKey&&r===i&&(u.preventDefault(),t&&d(c,{select:!0})):r===m&&u.preventDefault()}},[t,s,a.paused]);return k.jsxRuntimeExports.jsx(A.Primitive.div,{tabIndex:-1,...L,ref:_,onKeyDown:M})});C.displayName=K;function j(e,{select:n=!1}={}){const t=document.activeElement;for(const s of e)if(d(s,{select:n}),document.activeElement!==t)return}function D(e){const n=R(e),t=h(n,e),s=h(n.reverse(),e);return[t,s]}function R(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const p=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||p?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function h(e,n){for(const t of e)if(!q(t,{upTo:n}))return t}function q(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function H(e){return e instanceof HTMLInputElement&&"select"in e}function d(e,{select:n=!1}={}){if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&H(e)&&n&&e.select()}}var N=V();function V(){let e=[];return{add(n){const t=e[0];n!==t&&(t==null||t.pause()),e=g(e,n),e.unshift(n)},remove(n){var t;e=g(e,n),(t=e[0])==null||t.resume()}}}function g(e,n){const t=[...e],s=t.indexOf(n);return s!==-1&&t.splice(s,1),t}function W(e){return e.filter(n=>n.tagName!=="A")}exports.FocusScope=C;
|
2
|
-
//# sourceMappingURL=index.cjs319.js.map
|
package/dist/index.cjs319.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.cjs319.js","sources":["../node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-scope/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/focus-scope/src/focus-scope.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { jsx } from \"react/jsx-runtime\";\nvar AUTOFOCUS_ON_MOUNT = \"focusScope.autoFocusOnMount\";\nvar AUTOFOCUS_ON_UNMOUNT = \"focusScope.autoFocusOnUnmount\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar FOCUS_SCOPE_NAME = \"FocusScope\";\nvar FocusScope = React.forwardRef((props, forwardedRef) => {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n }\n }).current;\n React.useEffect(() => {\n if (trapped) {\n let handleFocusIn2 = function(event) {\n if (focusScope.paused || !container) return;\n const target = event.target;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleFocusOut2 = function(event) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget;\n if (relatedTarget === null) return;\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleMutations2 = function(mutations) {\n const focusedElement = document.activeElement;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n };\n var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;\n document.addEventListener(\"focusin\", handleFocusIn2);\n document.addEventListener(\"focusout\", handleFocusOut2);\n const mutationObserver = new MutationObserver(handleMutations2);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n return () => {\n document.removeEventListener(\"focusin\", handleFocusIn2);\n document.removeEventListener(\"focusout\", handleFocusOut2);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused]);\n React.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n setTimeout(() => {\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? document.body, { select: true });\n }\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n const handleKeyDown = React.useCallback(\n (event) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n const isTabKey = event.key === \"Tab\" && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement;\n if (isTabKey && focusedElement) {\n const container2 = event.currentTarget;\n const [first, last] = getTabbableEdges(container2);\n const hasTabbableElementsInside = first && last;\n if (!hasTabbableElementsInside) {\n if (focusedElement === container2) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused]\n );\n return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });\n});\nFocusScope.displayName = FOCUS_SCOPE_NAME;\nfunction focusFirst(candidates, { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\nfunction getTabbableEdges(container) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last];\n}\nfunction getTabbableCandidates(container) {\n const nodes = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n while (walker.nextNode()) nodes.push(walker.currentNode);\n return nodes;\n}\nfunction findVisible(elements, container) {\n for (const element of elements) {\n if (!isHidden(element, { upTo: container })) return element;\n }\n}\nfunction isHidden(node, { upTo }) {\n if (getComputedStyle(node).visibility === \"hidden\") return true;\n while (node) {\n if (upTo !== void 0 && node === upTo) return false;\n if (getComputedStyle(node).display === \"none\") return true;\n node = node.parentElement;\n }\n return false;\n}\nfunction isSelectableInput(element) {\n return element instanceof HTMLInputElement && \"select\" in element;\n}\nfunction focus(element, { select = false } = {}) {\n if (element && element.focus) {\n const previouslyFocusedElement = document.activeElement;\n element.focus({ preventScroll: true });\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\nvar focusScopesStack = createFocusScopesStack();\nfunction createFocusScopesStack() {\n let stack = [];\n return {\n add(focusScope) {\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n remove(focusScope) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n }\n };\n}\nfunction arrayRemove(array, item) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\nfunction removeLinks(items) {\n return items.filter((item) => item.tagName !== \"A\");\n}\nvar Root = FocusScope;\nexport {\n FocusScope,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["AUTOFOCUS_ON_MOUNT","AUTOFOCUS_ON_UNMOUNT","EVENT_OPTIONS","FOCUS_SCOPE_NAME","FocusScope","React","props","forwardedRef","loop","trapped","onMountAutoFocusProp","onUnmountAutoFocusProp","scopeProps","container","setContainer","onMountAutoFocus","useCallbackRef","onUnmountAutoFocus","lastFocusedElementRef","composedRefs","useComposedRefs","node","focusScope","handleFocusIn2","event","target","focus","handleFocusOut2","relatedTarget","handleMutations2","mutations","mutation","mutationObserver","focusScopesStack","previouslyFocusedElement","mountEvent","focusFirst","removeLinks","getTabbableCandidates","unmountEvent","handleKeyDown","isTabKey","focusedElement","container2","first","last","getTabbableEdges","jsx","Primitive","candidates","select","candidate","findVisible","nodes","walker","isHiddenInput","elements","element","isHidden","upTo","isSelectableInput","createFocusScopesStack","stack","activeFocusScope","arrayRemove","_a","array","item","updatedArray","index","items"],"mappings":"+fAQA,IAAIA,EAAqB,8BACrBC,EAAuB,gCACvBC,EAAgB,CAAE,QAAS,GAAO,WAAY,EAAM,EACpDC,EAAmB,aACnBC,EAAaC,EAAM,WAAW,CAACC,EAAOC,IAAiB,CACzD,KAAM,CACJ,KAAAC,EAAO,GACP,QAAAC,EAAU,GACV,iBAAkBC,EAClB,mBAAoBC,EACpB,GAAGC,CACP,EAAMN,EACE,CAACO,EAAWC,CAAY,EAAIT,EAAM,SAAS,IAAI,EAC/CU,EAAmBC,EAAc,eAACN,CAAoB,EACtDO,EAAqBD,EAAc,eAACL,CAAsB,EAC1DO,EAAwBb,EAAM,OAAO,IAAI,EACzCc,EAAeC,EAAAA,gBAAgBb,EAAec,GAASP,EAAaO,CAAI,CAAC,EACzEC,EAAajB,EAAM,OAAO,CAC9B,OAAQ,GACR,OAAQ,CACN,KAAK,OAAS,EACf,EACD,QAAS,CACP,KAAK,OAAS,EACpB,CACG,CAAA,EAAE,QACHA,EAAM,UAAU,IAAM,CACpB,GAAII,EAAS,CACX,IAAIc,EAAiB,SAASC,EAAO,CACnC,GAAIF,EAAW,QAAU,CAACT,EAAW,OACrC,MAAMY,EAASD,EAAM,OACjBX,EAAU,SAASY,CAA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AAMvB,EAA2B,SAAS,cAC1CuB,EAAQ,MAAM,CAAE,cAAe,EAAI,CAAE,EACjCA,IAAYvB,GAA4B0B,EAAkBH,CAAO,GAAKP,GACxEO,EAAQ,OAAQ,CACtB,CACA,CACA,IAAIxB,EAAmB4B,EAAwB,EAC/C,SAASA,GAAyB,CAChC,IAAIC,EAAQ,CAAE,EACd,MAAO,CACL,IAAIxC,EAAY,CACd,MAAMyC,EAAmBD,EAAM,CAAC,EAC5BxC,IAAeyC,IACjBA,GAAA,MAAAA,EAAkB,SAEpBD,EAAQE,EAAYF,EAAOxC,CAAU,EACrCwC,EAAM,QAAQxC,CAAU,CACzB,EACD,OAAOA,EAAY,OACjBwC,EAAQE,EAAYF,EAAOxC,CAAU,GACrC2C,EAAAH,EAAM,CAAC,IAAP,MAAAG,EAAU,QAChB,CACG,CACH,CACA,SAASD,EAAYE,EAAOC,EAAM,CAChC,MAAMC,EAAe,CAAC,GAAGF,CAAK,EACxBG,EAAQD,EAAa,QAAQD,CAAI,EACvC,OAAIE,IAAU,IACZD,EAAa,OAAOC,EAAO,CAAC,EAEvBD,CACT,CACA,SAAS/B,EAAYiC,EAAO,CAC1B,OAAOA,EAAM,OAAQH,GAASA,EAAK,UAAY,GAAG,CACpD","x_google_ignoreList":[0]}
|
package/dist/index.cjs339.js
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react");require("react-dom");const s=require("./index.cjs343.js"),l=require("./index.cjs161.js");function f(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const d=f(c);var m=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],p=m.reduce((e,t)=>{const r=d.forwardRef((i,n)=>{const{asChild:o,...u}=i,a=o?s.Slot:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsxRuntimeExports.jsx(a,{...u,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});exports.Primitive=p;
|
2
|
-
//# sourceMappingURL=index.cjs339.js.map
|
package/dist/index.cjs339.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.cjs339.js","sources":["../node_modules/@radix-ui/react-switch/node_modules/@radix-ui/react-primitive/dist/index.mjs"],"sourcesContent":["// packages/react/primitive/src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["NODES","Primitive","primitive","node","Node","React","props","forwardedRef","asChild","primitiveProps","Comp","Slot","jsx"],"mappings":"4dAKA,IAAIA,EAAQ,CACV,IACA,SACA,MACA,OACA,KACA,KACA,MACA,QACA,QACA,KACA,MACA,KACA,IACA,OACA,MACA,IACF,EACIC,EAAYD,EAAM,OAAO,CAACE,EAAWC,IAAS,CAChD,MAAMC,EAAOC,EAAM,WAAW,CAACC,EAAOC,IAAiB,CACrD,KAAM,CAAE,QAAAC,EAAS,GAAGC,CAAc,EAAKH,EACjCI,EAAOF,EAAUG,EAAAA,KAAOR,EAC9B,OAAI,OAAO,OAAW,MACpB,OAAO,OAAO,IAAI,UAAU,CAAC,EAAI,IAEZS,EAAAA,kBAAAA,IAAIF,EAAM,CAAE,GAAGD,EAAgB,IAAKF,EAAc,CAC7E,CAAG,EACD,OAAAH,EAAK,YAAc,aAAaD,CAAI,GAC7B,CAAE,GAAGD,EAAW,CAACC,CAAI,EAAGC,CAAM,CACvC,EAAG,CAAE,CAAA","x_google_ignoreList":[0]}
|
package/dist/index.cjs346.js
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),c=require("./index.cjs357.js"),g=require("./index.cjs358.js");function d(e){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(u,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return u.default=e,Object.freeze(u)}const f=d(l);var b=typeof window<"u"?f.useLayoutEffect:f.useEffect,i=new WeakMap;function p(e,u){var t=g.useCallbackRef(null,function(n){return e.forEach(function(r){return c.assignRef(r,n)})});return b(function(){var n=i.get(t);if(n){var r=new Set(n),o=new Set(e),s=t.current;r.forEach(function(a){o.has(a)||c.assignRef(a,null)}),o.forEach(function(a){r.has(a)||c.assignRef(a,s)})}i.set(t,e)},[e]),t}exports.useMergeRefs=p;
|
2
|
-
//# sourceMappingURL=index.cjs346.js.map
|
package/dist/index.cjs346.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.cjs346.js","sources":["../node_modules/use-callback-ref/dist/es2015/useMergeRef.js"],"sourcesContent":["import * as React from 'react';\nimport { assignRef } from './assignRef';\nimport { useCallbackRef } from './useRef';\nvar useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nvar currentValues = new WeakMap();\n/**\n * Merges two or more refs together providing a single interface to set their value\n * @param {RefObject|Ref} refs\n * @returns {MutableRefObject} - a new ref, which translates all changes to {refs}\n *\n * @see {@link mergeRefs} a version without buit-in memoization\n * @see https://github.com/theKashey/use-callback-ref#usemergerefs\n * @example\n * const Component = React.forwardRef((props, ref) => {\n * const ownRef = useRef();\n * const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together\n * return <div ref={domRef}>...</div>\n * }\n */\nexport function useMergeRefs(refs, defaultValue) {\n var callbackRef = useCallbackRef(defaultValue || null, function (newValue) {\n return refs.forEach(function (ref) { return assignRef(ref, newValue); });\n });\n // handle refs changes - added or removed\n useIsomorphicLayoutEffect(function () {\n var oldValue = currentValues.get(callbackRef);\n if (oldValue) {\n var prevRefs_1 = new Set(oldValue);\n var nextRefs_1 = new Set(refs);\n var current_1 = callbackRef.current;\n prevRefs_1.forEach(function (ref) {\n if (!nextRefs_1.has(ref)) {\n assignRef(ref, null);\n }\n });\n nextRefs_1.forEach(function (ref) {\n if (!prevRefs_1.has(ref)) {\n assignRef(ref, current_1);\n }\n });\n }\n currentValues.set(callbackRef, refs);\n }, [refs]);\n return callbackRef;\n}\n"],"names":["useIsomorphicLayoutEffect","React","currentValues","useMergeRefs","refs","defaultValue","callbackRef","useCallbackRef","newValue","ref","assignRef","oldValue","prevRefs_1","nextRefs_1","current_1"],"mappings":"icAGA,IAAIA,EAA4B,OAAO,OAAW,IAAcC,EAAM,gBAAkBA,EAAM,UAC1FC,EAAgB,IAAI,QAejB,SAASC,EAAaC,EAAMC,EAAc,CAC7C,IAAIC,EAAcC,EAAAA,eAA+B,KAAM,SAAUC,EAAU,CACvE,OAAOJ,EAAK,QAAQ,SAAUK,EAAK,CAAE,OAAOC,EAAAA,UAAUD,EAAKD,CAAQ,EAAI,CAC/E,CAAK,EAED,OAAAR,EAA0B,UAAY,CAClC,IAAIW,EAAWT,EAAc,IAAII,CAAW,EAC5C,GAAIK,EAAU,CACV,IAAIC,EAAa,IAAI,IAAID,CAAQ,EAC7BE,EAAa,IAAI,IAAIT,CAAI,EACzBU,EAAYR,EAAY,QAC5BM,EAAW,QAAQ,SAAUH,EAAK,CACzBI,EAAW,IAAIJ,CAAG,GACnBC,EAAS,UAACD,EAAK,IAAI,CAEvC,CAAa,EACDI,EAAW,QAAQ,SAAUJ,EAAK,CACzBG,EAAW,IAAIH,CAAG,GACnBC,EAAS,UAACD,EAAKK,CAAS,CAE5C,CAAa,CACb,CACQZ,EAAc,IAAII,EAAaF,CAAI,CAC3C,EAAO,CAACA,CAAI,CAAC,EACFE,CACX","x_google_ignoreList":[0]}
|