@adamosuiteservices/ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/accordion-rounded.cjs +6 -0
- package/dist/accordion-rounded.js +85 -0
- package/dist/accordion.cjs +1 -0
- package/dist/accordion.js +65 -0
- package/dist/alert.cjs +1 -0
- package/dist/alert.js +69 -0
- package/dist/avatar.cjs +17 -0
- package/dist/avatar.js +248 -0
- package/dist/badge.cjs +1 -0
- package/dist/badge.js +54 -0
- package/dist/button-BFK0LYE1.js +58 -0
- package/dist/button-BnuVhhWO.cjs +1 -0
- package/dist/button-group.cjs +1 -0
- package/dist/button-group.js +76 -0
- package/dist/button.cjs +1 -0
- package/dist/button.js +5 -0
- package/dist/calendar.cjs +1 -0
- package/dist/calendar.js +2852 -0
- package/dist/card.cjs +1 -0
- package/dist/card.js +112 -0
- package/dist/check-CLxNVljQ.cjs +6 -0
- package/dist/check-Ci0GjV-B.js +11 -0
- package/dist/checkbox-BlfeC4MI.js +271 -0
- package/dist/checkbox-uByYIkZe.cjs +1 -0
- package/dist/checkbox.cjs +1 -0
- package/dist/checkbox.js +4 -0
- package/dist/chevron-down-BqEHzml5.cjs +6 -0
- package/dist/chevron-down-CpVS2Z7w.js +11 -0
- package/dist/chevron-left-B8QsBNvc.cjs +6 -0
- package/dist/chevron-left-Eal-WYLp.js +11 -0
- package/dist/chevron-right-BpzggHsr.cjs +6 -0
- package/dist/chevron-right-Cnc2tB4-.js +11 -0
- package/dist/circle-CX7JIirj.cjs +6 -0
- package/dist/circle-DYv-7Qb9.js +11 -0
- package/dist/collapsible.cjs +1 -0
- package/dist/collapsible.js +34 -0
- package/dist/colors.css +1 -0
- package/dist/combobox.cjs +6 -0
- package/dist/combobox.js +515 -0
- package/dist/components/layout/sidebar/index.d.ts +1 -0
- package/dist/components/layout/sidebar/sidebar.d.ts +17 -0
- package/dist/components/layout/sidebar/sidebar.stories.d.ts +6 -0
- package/dist/components/layout/toaster/index.d.ts +2 -0
- package/dist/components/layout/toaster/toaster.d.ts +26 -0
- package/dist/components/layout/toaster/toaster.stories.d.ts +15 -0
- package/dist/components/layout/toaster/use-toast.d.ts +1 -0
- package/dist/components/ui/accordion/accordion.d.ts +7 -0
- package/dist/components/ui/accordion/accordion.stories.d.ts +17 -0
- package/dist/components/ui/accordion/index.d.ts +1 -0
- package/dist/components/ui/accordion-rounded/accordion-rounded.d.ts +11 -0
- package/dist/components/ui/accordion-rounded/accordion-rounded.stories.d.ts +21 -0
- package/dist/components/ui/accordion-rounded/index.d.ts +1 -0
- package/dist/components/ui/alert/alert.d.ts +9 -0
- package/dist/components/ui/alert/alert.stories.d.ts +24 -0
- package/dist/components/ui/alert/index.d.ts +1 -0
- package/dist/components/ui/avatar/avatar.d.ts +6 -0
- package/dist/components/ui/avatar/avatar.stories.d.ts +14 -0
- package/dist/components/ui/avatar/index.d.ts +1 -0
- package/dist/components/ui/badge/badge.d.ts +10 -0
- package/dist/components/ui/badge/badge.stories.d.ts +41 -0
- package/dist/components/ui/badge/index.d.ts +1 -0
- package/dist/components/ui/button/button.d.ts +10 -0
- package/dist/components/ui/button/button.stories.d.ts +38 -0
- package/dist/components/ui/button/index.d.ts +1 -0
- package/dist/components/ui/button-group/button-group.d.ts +11 -0
- package/dist/components/ui/button-group/button-group.stories.d.ts +19 -0
- package/dist/components/ui/button-group/index.d.ts +1 -0
- package/dist/components/ui/calendar/calendar.d.ts +8 -0
- package/dist/components/ui/calendar/calendar.stories.d.ts +27 -0
- package/dist/components/ui/calendar/index.d.ts +1 -0
- package/dist/components/ui/card/card.d.ts +13 -0
- package/dist/components/ui/card/card.stories.d.ts +18 -0
- package/dist/components/ui/card/index.d.ts +1 -0
- package/dist/components/ui/checkbox/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox/checkbox.stories.d.ts +15 -0
- package/dist/components/ui/checkbox/index.d.ts +1 -0
- package/dist/components/ui/collapsible/collapsible.d.ts +5 -0
- package/dist/components/ui/collapsible/collapsible.stories.d.ts +12 -0
- package/dist/components/ui/collapsible/index.d.ts +1 -0
- package/dist/components/ui/combobox/combobox.d.ts +35 -0
- package/dist/components/ui/combobox/combobox.stories.d.ts +27 -0
- package/dist/components/ui/combobox/index.d.ts +1 -0
- package/dist/components/ui/command/command.d.ts +18 -0
- package/dist/components/ui/command/index.d.ts +1 -0
- package/dist/components/ui/context-menu/context-menu.d.ts +25 -0
- package/dist/components/ui/context-menu/context-menu.stories.d.ts +10 -0
- package/dist/components/ui/context-menu/index.d.ts +1 -0
- package/dist/components/ui/dialog/dialog.d.ts +17 -0
- package/dist/components/ui/dialog/dialog.stories.d.ts +13 -0
- package/dist/components/ui/dialog/index.d.ts +1 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +25 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.stories.d.ts +14 -0
- package/dist/components/ui/dropdown-menu/index.d.ts +1 -0
- package/dist/components/ui/field/field.d.ts +24 -0
- package/dist/components/ui/field/field.stories.d.ts +18 -0
- package/dist/components/ui/field/index.d.ts +1 -0
- package/dist/components/ui/hover-card/hover-card.d.ts +6 -0
- package/dist/components/ui/hover-card/hover-card.stories.d.ts +25 -0
- package/dist/components/ui/hover-card/index.d.ts +1 -0
- package/dist/components/ui/input/index.d.ts +1 -0
- package/dist/components/ui/input/input.d.ts +3 -0
- package/dist/components/ui/input/input.stories.d.ts +23 -0
- package/dist/components/ui/input-group/Input-group.stories.d.ts +28 -0
- package/dist/components/ui/input-group/index.d.ts +1 -0
- package/dist/components/ui/input-group/input-group.d.ts +16 -0
- package/dist/components/ui/kbd/index.d.ts +1 -0
- package/dist/components/ui/kbd/kbd.d.ts +3 -0
- package/dist/components/ui/kbd/kbd.stories.d.ts +26 -0
- package/dist/components/ui/label/index.d.ts +1 -0
- package/dist/components/ui/label/label.d.ts +4 -0
- package/dist/components/ui/label/label.stories.d.ts +24 -0
- package/dist/components/ui/pagination/index.d.ts +1 -0
- package/dist/components/ui/pagination/pagination.d.ts +13 -0
- package/dist/components/ui/pagination/pagination.stories.d.ts +28 -0
- package/dist/components/ui/popover/index.d.ts +1 -0
- package/dist/components/ui/popover/popover.d.ts +7 -0
- package/dist/components/ui/popover/popover.stories.d.ts +26 -0
- package/dist/components/ui/progress/index.d.ts +1 -0
- package/dist/components/ui/progress/progress.d.ts +9 -0
- package/dist/components/ui/progress/progress.stories.d.ts +29 -0
- package/dist/components/ui/radio-group/index.d.ts +1 -0
- package/dist/components/ui/radio-group/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group/radio-group.stories.d.ts +18 -0
- package/dist/components/ui/select/index.d.ts +1 -0
- package/dist/components/ui/select/select.d.ts +15 -0
- package/dist/components/ui/select/select.stories.d.ts +19 -0
- package/dist/components/ui/separator/index.d.ts +1 -0
- package/dist/components/ui/separator/separator.d.ts +4 -0
- package/dist/components/ui/separator/separator.stories.d.ts +18 -0
- package/dist/components/ui/sheet/index.d.ts +1 -0
- package/dist/components/ui/sheet/sheet.d.ts +14 -0
- package/dist/components/ui/sheet/sheet.stories.d.ts +17 -0
- package/dist/components/ui/skeleton/index.d.ts +1 -0
- package/dist/components/ui/skeleton/skeleton.d.ts +2 -0
- package/dist/components/ui/skeleton/skeleton.stories.d.ts +22 -0
- package/dist/components/ui/slider/index.d.ts +1 -0
- package/dist/components/ui/slider/slider.d.ts +7 -0
- package/dist/components/ui/slider/slider.stories.d.ts +21 -0
- package/dist/components/ui/spinner/index.d.ts +1 -0
- package/dist/components/ui/spinner/spinner.d.ts +2 -0
- package/dist/components/ui/spinner/spinner.stories.d.ts +20 -0
- package/dist/components/ui/switch/index.d.ts +1 -0
- package/dist/components/ui/switch/switch.d.ts +4 -0
- package/dist/components/ui/switch/switch.stories.d.ts +17 -0
- package/dist/components/ui/table/index.d.ts +1 -0
- package/dist/components/ui/table/table.d.ts +10 -0
- package/dist/components/ui/table/table.stories.d.ts +11 -0
- package/dist/components/ui/tabs/index.d.ts +1 -0
- package/dist/components/ui/tabs/tabs.d.ts +7 -0
- package/dist/components/ui/tabs/tabs.stories.d.ts +16 -0
- package/dist/components/ui/tabs-underline/index.d.ts +1 -0
- package/dist/components/ui/tabs-underline/tabs-underline.d.ts +7 -0
- package/dist/components/ui/tabs-underline/tabs-underline.stories.d.ts +16 -0
- package/dist/components/ui/textarea/index.d.ts +1 -0
- package/dist/components/ui/textarea/textarea.d.ts +3 -0
- package/dist/components/ui/textarea/textarea.stories.d.ts +21 -0
- package/dist/components/ui/toggle/index.d.ts +1 -0
- package/dist/components/ui/toggle/toggle.d.ts +9 -0
- package/dist/components/ui/toggle/toggle.stories.d.ts +21 -0
- package/dist/components/ui/tooltip/index.d.ts +1 -0
- package/dist/components/ui/tooltip/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip/tooltip.stories.d.ts +19 -0
- package/dist/components/ui/typography/index.d.ts +1 -0
- package/dist/components/ui/typography/typography.d.ts +8 -0
- package/dist/components/ui/typography/typography.stories.d.ts +33 -0
- package/dist/context-menu.cjs +1 -0
- package/dist/context-menu.js +427 -0
- package/dist/createLucideIcon-B_8CJpcQ.js +94 -0
- package/dist/createLucideIcon-CAtnV-yz.cjs +21 -0
- package/dist/custom-layered-styles.css +1 -0
- package/dist/dialog.cjs +1 -0
- package/dist/dialog.js +139 -0
- package/dist/dropdown-menu.cjs +1 -0
- package/dist/dropdown-menu.js +423 -0
- package/dist/field.cjs +1 -0
- package/dist/field.js +221 -0
- package/dist/fonts.css +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-portal-container.d.ts +31 -0
- package/dist/hover-card.cjs +1 -0
- package/dist/hover-card.js +210 -0
- package/dist/index-0ioNhtNM.js +10 -0
- package/dist/index-6oTEokEx.js +82 -0
- package/dist/index-B-NyefE0.js +243 -0
- package/dist/index-B-ZRqW0J.js +118 -0
- package/dist/index-B-cHTKrs.js +158 -0
- package/dist/index-BGQepRFJ.js +27 -0
- package/dist/index-BGiGvaq8.cjs +1 -0
- package/dist/index-BKbK2GzY.cjs +1 -0
- package/dist/index-BMitW9UR.cjs +1 -0
- package/dist/index-BRLtxFFr.cjs +1 -0
- package/dist/index-BWaO7kQK.cjs +1 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/index-BpvjJ_T6.cjs +5 -0
- package/dist/index-C0UREtMP.js +59 -0
- package/dist/index-C329e3yQ.js +134 -0
- package/dist/index-C5wjudc-.js +36 -0
- package/dist/index-C8ni3LLa.cjs +1 -0
- package/dist/index-CAOY367Y.js +1540 -0
- package/dist/index-CCKe-Mpx.js +6 -0
- package/dist/index-CQhYMnjT.js +34 -0
- package/dist/index-Ce3QBKyj.cjs +1 -0
- package/dist/index-CezwiPd_.js +615 -0
- package/dist/index-Cv867SGx.js +13 -0
- package/dist/index-CwUFT-GQ.js +228 -0
- package/dist/index-CzY-WZXL.cjs +1 -0
- package/dist/index-D02K8KOB.js +54 -0
- package/dist/index-D3S7dBDI.cjs +1 -0
- package/dist/index-D3wSWKST.cjs +1 -0
- package/dist/index-D7hQvndv.cjs +1 -0
- package/dist/index-DQvx1rG_.cjs +1 -0
- package/dist/index-DXQ-7kNJ.cjs +41 -0
- package/dist/index-DYxWvftI.cjs +1 -0
- package/dist/index-DnS_sBBe.cjs +1 -0
- package/dist/index-DulPG3F9.js +179 -0
- package/dist/index-EUea2gfp.js +70 -0
- package/dist/index-FxyLF8MY.js +68 -0
- package/dist/index-IKJMQref.cjs +1 -0
- package/dist/index-MQ0c3ZX_.cjs +1 -0
- package/dist/index-P1sVIHE3.js +32 -0
- package/dist/index-VIUqZjyP.cjs +1 -0
- package/dist/index-WIv2ndLu.cjs +1 -0
- package/dist/index-bSPhqlcX.cjs +1 -0
- package/dist/index-cwZN7ZY3.cjs +1 -0
- package/dist/index-gO_QEiaK.cjs +1 -0
- package/dist/index-iAvn1gzj.cjs +1 -0
- package/dist/index-o0sNTcKe.js +674 -0
- package/dist/index-rKs9bXHr.js +6 -0
- package/dist/index-yR-v1A4G.js +15 -0
- package/dist/input-3MDa_DYk.cjs +1 -0
- package/dist/input-Cl7xmQYQ.js +22 -0
- package/dist/input-group.cjs +1 -0
- package/dist/input-group.js +152 -0
- package/dist/input.cjs +1 -0
- package/dist/input.js +4 -0
- package/dist/jsx-runtime-BB_1_6y_.cjs +22 -0
- package/dist/jsx-runtime-BzflLqGi.js +282 -0
- package/dist/kbd.cjs +1 -0
- package/dist/kbd.js +31 -0
- package/dist/label-MxqN87DQ.cjs +1 -0
- package/dist/label-hg_jN6Y8.js +35 -0
- package/dist/label.cjs +1 -0
- package/dist/label.js +4 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/minus-C0pHPx21.cjs +6 -0
- package/dist/minus-DE-onYs2.js +11 -0
- package/dist/pagination.cjs +6 -0
- package/dist/pagination.js +134 -0
- package/dist/popover-BBXe2myL.cjs +1 -0
- package/dist/popover-DNiRNCdn.js +263 -0
- package/dist/popover.cjs +1 -0
- package/dist/popover.js +7 -0
- package/dist/progress.cjs +6 -0
- package/dist/progress.js +137 -0
- package/dist/radio-group.cjs +1 -0
- package/dist/radio-group.js +271 -0
- package/dist/radius.css +1 -0
- package/dist/select.cjs +6 -0
- package/dist/select.js +987 -0
- package/dist/separator-C9kqOQR-.js +44 -0
- package/dist/separator-Dbx-SVIs.cjs +1 -0
- package/dist/separator.cjs +1 -0
- package/dist/separator.js +4 -0
- package/dist/sheet-0jRbqkzj.cjs +1 -0
- package/dist/sheet-RAbg4M5A.js +128 -0
- package/dist/sheet.cjs +1 -0
- package/dist/sheet.js +11 -0
- package/dist/sidebar.cjs +6 -0
- package/dist/sidebar.js +139 -0
- package/dist/skeleton.cjs +1 -0
- package/dist/skeleton.js +15 -0
- package/dist/slider.cjs +1 -0
- package/dist/slider.js +486 -0
- package/dist/space.css +1 -0
- package/dist/spinner.cjs +6 -0
- package/dist/spinner.js +24 -0
- package/dist/styles.css +1 -0
- package/dist/switch.cjs +1 -0
- package/dist/switch.js +154 -0
- package/dist/table.cjs +1 -0
- package/dist/table.js +115 -0
- package/dist/tabs-underline.cjs +1 -0
- package/dist/tabs-underline.js +68 -0
- package/dist/tabs.cjs +1 -0
- package/dist/tabs.js +68 -0
- package/dist/tailwind-animations.css +1 -0
- package/dist/tailwind-colors.css +1 -0
- package/dist/tailwind-fonts.css +1 -0
- package/dist/tailwind-radius.css +1 -0
- package/dist/tailwind-spacing.css +1 -0
- package/dist/tailwind-theme.css +1 -0
- package/dist/textarea-D76719tg.js +19 -0
- package/dist/textarea-UdELO_Jn.cjs +1 -0
- package/dist/textarea.cjs +1 -0
- package/dist/textarea.js +4 -0
- package/dist/themes.css +1 -0
- package/dist/toaster.cjs +1 -0
- package/dist/toaster.js +87 -0
- package/dist/toggle.cjs +1 -0
- package/dist/toggle.js +69 -0
- package/dist/tooltip.cjs +1 -0
- package/dist/tooltip.js +375 -0
- package/dist/types/theme.type.d.ts +2 -0
- package/dist/typography.cjs +1 -0
- package/dist/typography.js +34 -0
- package/dist/use-portal-container.cjs +1 -0
- package/dist/use-portal-container.js +21 -0
- package/dist/utils-CRiPKpXj.js +2743 -0
- package/dist/utils-DoxiiusW.cjs +1 -0
- package/dist/x-CBKgg4YL.cjs +6 -0
- package/dist/x-Dl66o_vF.js +14 -0
- package/package.json +275 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import l from "react";
|
|
2
|
+
import { c as Q } from "./index-FxyLF8MY.js";
|
|
3
|
+
import { c as W, u as X } from "./index-D02K8KOB.js";
|
|
4
|
+
import { u as Z } from "./index-6oTEokEx.js";
|
|
5
|
+
import { u as D, c as $ } from "./index-C0UREtMP.js";
|
|
6
|
+
import { P as T } from "./index-C5wjudc-.js";
|
|
7
|
+
import { c as O, R as ee, T as oe, C as re } from "./index-B-ZRqW0J.js";
|
|
8
|
+
import { u as te } from "./index-Cv867SGx.js";
|
|
9
|
+
import { j as n } from "./jsx-runtime-BzflLqGi.js";
|
|
10
|
+
var d = "Accordion", ne = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"], [N, ce, ae] = W(d), [g] = Q(d, [
|
|
11
|
+
ae,
|
|
12
|
+
O
|
|
13
|
+
]), y = O(), M = l.forwardRef(
|
|
14
|
+
(o, c) => {
|
|
15
|
+
const { type: e, ...t } = o, a = t, r = t;
|
|
16
|
+
return /* @__PURE__ */ n.jsx(N.Provider, { scope: o.__scopeAccordion, children: e === "multiple" ? /* @__PURE__ */ n.jsx(de, { ...r, ref: c }) : /* @__PURE__ */ n.jsx(le, { ...a, ref: c }) });
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
M.displayName = d;
|
|
20
|
+
var [H, ie] = g(d), [V, se] = g(
|
|
21
|
+
d,
|
|
22
|
+
{ collapsible: !1 }
|
|
23
|
+
), le = l.forwardRef(
|
|
24
|
+
(o, c) => {
|
|
25
|
+
const {
|
|
26
|
+
value: e,
|
|
27
|
+
defaultValue: t,
|
|
28
|
+
onValueChange: a = () => {
|
|
29
|
+
},
|
|
30
|
+
collapsible: r = !1,
|
|
31
|
+
...s
|
|
32
|
+
} = o, [i, p] = D({
|
|
33
|
+
prop: e,
|
|
34
|
+
defaultProp: t ?? "",
|
|
35
|
+
onChange: a,
|
|
36
|
+
caller: d
|
|
37
|
+
});
|
|
38
|
+
return /* @__PURE__ */ n.jsx(
|
|
39
|
+
H,
|
|
40
|
+
{
|
|
41
|
+
scope: o.__scopeAccordion,
|
|
42
|
+
value: l.useMemo(() => i ? [i] : [], [i]),
|
|
43
|
+
onItemOpen: p,
|
|
44
|
+
onItemClose: l.useCallback(() => r && p(""), [r, p]),
|
|
45
|
+
children: /* @__PURE__ */ n.jsx(V, { scope: o.__scopeAccordion, collapsible: r, children: /* @__PURE__ */ n.jsx(K, { ...s, ref: c }) })
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
), de = l.forwardRef((o, c) => {
|
|
50
|
+
const {
|
|
51
|
+
value: e,
|
|
52
|
+
defaultValue: t,
|
|
53
|
+
onValueChange: a = () => {
|
|
54
|
+
},
|
|
55
|
+
...r
|
|
56
|
+
} = o, [s, i] = D({
|
|
57
|
+
prop: e,
|
|
58
|
+
defaultProp: t ?? [],
|
|
59
|
+
onChange: a,
|
|
60
|
+
caller: d
|
|
61
|
+
}), p = l.useCallback(
|
|
62
|
+
(v) => i((f = []) => [...f, v]),
|
|
63
|
+
[i]
|
|
64
|
+
), m = l.useCallback(
|
|
65
|
+
(v) => i((f = []) => f.filter((b) => b !== v)),
|
|
66
|
+
[i]
|
|
67
|
+
);
|
|
68
|
+
return /* @__PURE__ */ n.jsx(
|
|
69
|
+
H,
|
|
70
|
+
{
|
|
71
|
+
scope: o.__scopeAccordion,
|
|
72
|
+
value: s,
|
|
73
|
+
onItemOpen: p,
|
|
74
|
+
onItemClose: m,
|
|
75
|
+
children: /* @__PURE__ */ n.jsx(V, { scope: o.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ n.jsx(K, { ...r, ref: c }) })
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}), [pe, I] = g(d), K = l.forwardRef(
|
|
79
|
+
(o, c) => {
|
|
80
|
+
const { __scopeAccordion: e, disabled: t, dir: a, orientation: r = "vertical", ...s } = o, i = l.useRef(null), p = Z(i, c), m = ce(e), f = X(a) === "ltr", b = $(o.onKeyDown, (C) => {
|
|
81
|
+
if (!ne.includes(C.key)) return;
|
|
82
|
+
const F = C.target, h = m().filter((j) => !j.ref.current?.disabled), x = h.findIndex((j) => j.ref.current === F), k = h.length;
|
|
83
|
+
if (x === -1) return;
|
|
84
|
+
C.preventDefault();
|
|
85
|
+
let u = x;
|
|
86
|
+
const _ = 0, R = k - 1, w = () => {
|
|
87
|
+
u = x + 1, u > R && (u = _);
|
|
88
|
+
}, P = () => {
|
|
89
|
+
u = x - 1, u < _ && (u = R);
|
|
90
|
+
};
|
|
91
|
+
switch (C.key) {
|
|
92
|
+
case "Home":
|
|
93
|
+
u = _;
|
|
94
|
+
break;
|
|
95
|
+
case "End":
|
|
96
|
+
u = R;
|
|
97
|
+
break;
|
|
98
|
+
case "ArrowRight":
|
|
99
|
+
r === "horizontal" && (f ? w() : P());
|
|
100
|
+
break;
|
|
101
|
+
case "ArrowDown":
|
|
102
|
+
r === "vertical" && w();
|
|
103
|
+
break;
|
|
104
|
+
case "ArrowLeft":
|
|
105
|
+
r === "horizontal" && (f ? P() : w());
|
|
106
|
+
break;
|
|
107
|
+
case "ArrowUp":
|
|
108
|
+
r === "vertical" && P();
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
const J = u % k;
|
|
112
|
+
h[J].ref.current?.focus();
|
|
113
|
+
});
|
|
114
|
+
return /* @__PURE__ */ n.jsx(
|
|
115
|
+
pe,
|
|
116
|
+
{
|
|
117
|
+
scope: e,
|
|
118
|
+
disabled: t,
|
|
119
|
+
direction: a,
|
|
120
|
+
orientation: r,
|
|
121
|
+
children: /* @__PURE__ */ n.jsx(N.Slot, { scope: e, children: /* @__PURE__ */ n.jsx(
|
|
122
|
+
T.div,
|
|
123
|
+
{
|
|
124
|
+
...s,
|
|
125
|
+
"data-orientation": r,
|
|
126
|
+
ref: p,
|
|
127
|
+
onKeyDown: t ? void 0 : b
|
|
128
|
+
}
|
|
129
|
+
) })
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
), A = "AccordionItem", [ue, S] = g(A), L = l.forwardRef(
|
|
134
|
+
(o, c) => {
|
|
135
|
+
const { __scopeAccordion: e, value: t, ...a } = o, r = I(A, e), s = ie(A, e), i = y(e), p = te(), m = t && s.value.includes(t) || !1, v = r.disabled || o.disabled;
|
|
136
|
+
return /* @__PURE__ */ n.jsx(
|
|
137
|
+
ue,
|
|
138
|
+
{
|
|
139
|
+
scope: e,
|
|
140
|
+
open: m,
|
|
141
|
+
disabled: v,
|
|
142
|
+
triggerId: p,
|
|
143
|
+
children: /* @__PURE__ */ n.jsx(
|
|
144
|
+
ee,
|
|
145
|
+
{
|
|
146
|
+
"data-orientation": r.orientation,
|
|
147
|
+
"data-state": B(m),
|
|
148
|
+
...i,
|
|
149
|
+
...a,
|
|
150
|
+
ref: c,
|
|
151
|
+
disabled: v,
|
|
152
|
+
open: m,
|
|
153
|
+
onOpenChange: (f) => {
|
|
154
|
+
f ? s.onItemOpen(t) : s.onItemClose(t);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
L.displayName = A;
|
|
163
|
+
var z = "AccordionHeader", G = l.forwardRef(
|
|
164
|
+
(o, c) => {
|
|
165
|
+
const { __scopeAccordion: e, ...t } = o, a = I(d, e), r = S(z, e);
|
|
166
|
+
return /* @__PURE__ */ n.jsx(
|
|
167
|
+
T.h3,
|
|
168
|
+
{
|
|
169
|
+
"data-orientation": a.orientation,
|
|
170
|
+
"data-state": B(r.open),
|
|
171
|
+
"data-disabled": r.disabled ? "" : void 0,
|
|
172
|
+
...t,
|
|
173
|
+
ref: c
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
G.displayName = z;
|
|
179
|
+
var E = "AccordionTrigger", U = l.forwardRef(
|
|
180
|
+
(o, c) => {
|
|
181
|
+
const { __scopeAccordion: e, ...t } = o, a = I(d, e), r = S(E, e), s = se(E, e), i = y(e);
|
|
182
|
+
return /* @__PURE__ */ n.jsx(N.ItemSlot, { scope: e, children: /* @__PURE__ */ n.jsx(
|
|
183
|
+
oe,
|
|
184
|
+
{
|
|
185
|
+
"aria-disabled": r.open && !s.collapsible || void 0,
|
|
186
|
+
"data-orientation": a.orientation,
|
|
187
|
+
id: r.triggerId,
|
|
188
|
+
...i,
|
|
189
|
+
...t,
|
|
190
|
+
ref: c
|
|
191
|
+
}
|
|
192
|
+
) });
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
U.displayName = E;
|
|
196
|
+
var Y = "AccordionContent", q = l.forwardRef(
|
|
197
|
+
(o, c) => {
|
|
198
|
+
const { __scopeAccordion: e, ...t } = o, a = I(d, e), r = S(Y, e), s = y(e);
|
|
199
|
+
return /* @__PURE__ */ n.jsx(
|
|
200
|
+
re,
|
|
201
|
+
{
|
|
202
|
+
role: "region",
|
|
203
|
+
"aria-labelledby": r.triggerId,
|
|
204
|
+
"data-orientation": a.orientation,
|
|
205
|
+
...s,
|
|
206
|
+
...t,
|
|
207
|
+
ref: c,
|
|
208
|
+
style: {
|
|
209
|
+
"--radix-accordion-content-height": "var(--radix-collapsible-content-height)",
|
|
210
|
+
"--radix-accordion-content-width": "var(--radix-collapsible-content-width)",
|
|
211
|
+
...o.style
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
q.displayName = Y;
|
|
218
|
+
function B(o) {
|
|
219
|
+
return o ? "open" : "closed";
|
|
220
|
+
}
|
|
221
|
+
var he = M, _e = L, Re = G, we = U, Pe = q;
|
|
222
|
+
export {
|
|
223
|
+
Pe as C,
|
|
224
|
+
Re as H,
|
|
225
|
+
_e as I,
|
|
226
|
+
he as R,
|
|
227
|
+
we as T
|
|
228
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("react");function a(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const c in e)if(c!=="default"){const n=Object.getOwnPropertyDescriptor(e,c);Object.defineProperty(t,c,n.get?n:{enumerable:!0,get:()=>e[c]})}}return t.default=e,Object.freeze(t)}const r=a(u);function o(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...c)=>t.current?.(...c),[])}exports.useCallbackRef=o;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as A from "react";
|
|
2
|
+
import r from "react";
|
|
3
|
+
import { c as D } from "./index-FxyLF8MY.js";
|
|
4
|
+
import { u as S, a as M } from "./index-6oTEokEx.js";
|
|
5
|
+
import { j as d } from "./jsx-runtime-BzflLqGi.js";
|
|
6
|
+
function h(l) {
|
|
7
|
+
const i = l + "CollectionProvider", [E, N] = D(i), [_, m] = E(
|
|
8
|
+
i,
|
|
9
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
10
|
+
), p = (c) => {
|
|
11
|
+
const { scope: e, children: s } = c, t = r.useRef(null), o = r.useRef(/* @__PURE__ */ new Map()).current;
|
|
12
|
+
return /* @__PURE__ */ d.jsx(_, { scope: e, itemMap: o, collectionRef: t, children: s });
|
|
13
|
+
};
|
|
14
|
+
p.displayName = i;
|
|
15
|
+
const f = l + "CollectionSlot", v = M(f), C = r.forwardRef(
|
|
16
|
+
(c, e) => {
|
|
17
|
+
const { scope: s, children: t } = c, o = m(f, s), n = S(e, o.collectionRef);
|
|
18
|
+
return /* @__PURE__ */ d.jsx(v, { ref: n, children: t });
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
C.displayName = f;
|
|
22
|
+
const u = l + "CollectionItemSlot", R = "data-radix-collection-item", T = M(u), x = r.forwardRef(
|
|
23
|
+
(c, e) => {
|
|
24
|
+
const { scope: s, children: t, ...o } = c, n = r.useRef(null), I = S(e, n), a = m(u, s);
|
|
25
|
+
return r.useEffect(() => (a.itemMap.set(n, { ref: n, ...o }), () => void a.itemMap.delete(n))), /* @__PURE__ */ d.jsx(T, { [R]: "", ref: I, children: t });
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
x.displayName = u;
|
|
29
|
+
function O(c) {
|
|
30
|
+
const e = m(l + "CollectionConsumer", c);
|
|
31
|
+
return r.useCallback(() => {
|
|
32
|
+
const t = e.collectionRef.current;
|
|
33
|
+
if (!t) return [];
|
|
34
|
+
const o = Array.from(t.querySelectorAll(`[${R}]`));
|
|
35
|
+
return Array.from(e.itemMap.values()).sort(
|
|
36
|
+
(a, y) => o.indexOf(a.ref.current) - o.indexOf(y.ref.current)
|
|
37
|
+
);
|
|
38
|
+
}, [e.collectionRef, e.itemMap]);
|
|
39
|
+
}
|
|
40
|
+
return [
|
|
41
|
+
{ Provider: p, Slot: C, ItemSlot: x },
|
|
42
|
+
O,
|
|
43
|
+
N
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
var j = A.createContext(void 0);
|
|
47
|
+
function b(l) {
|
|
48
|
+
const i = A.useContext(j);
|
|
49
|
+
return l || i || "ltr";
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
h as c,
|
|
53
|
+
b as u
|
|
54
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("react"),Q=require("./index-cwZN7ZY3.cjs"),T=require("./index-D7hQvndv.cjs"),W=require("./index-BKbK2GzY.cjs"),N=require("./index-BWaO7kQK.cjs"),q=require("./index-DQvx1rG_.cjs"),v=require("./index-D3wSWKST.cjs"),X=require("./index-WIv2ndLu.cjs"),n=require("./jsx-runtime-BB_1_6y_.cjs");var d="Accordion",Z=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[y,ee,oe]=T.createCollection(d),[R]=Q.createContextScope(d,[oe,v.createCollapsibleScope]),k=v.createCollapsibleScope(),M=l.forwardRef((o,c)=>{const{type:e,...t}=o,i=t,r=t;return n.jsxRuntimeExports.jsx(y.Provider,{scope:o.__scopeAccordion,children:e==="multiple"?n.jsxRuntimeExports.jsx(ce,{...r,ref:c}):n.jsxRuntimeExports.jsx(ne,{...i,ref:c})})});M.displayName=d;var[H,re]=R(d),[V,te]=R(d,{collapsible:!1}),ne=l.forwardRef((o,c)=>{const{value:e,defaultValue:t,onValueChange:i=()=>{},collapsible:r=!1,...a}=o,[s,u]=N.useControllableState({prop:e,defaultProp:t??"",onChange:i,caller:d});return n.jsxRuntimeExports.jsx(H,{scope:o.__scopeAccordion,value:l.useMemo(()=>s?[s]:[],[s]),onItemOpen:u,onItemClose:l.useCallback(()=>r&&u(""),[r,u]),children:n.jsxRuntimeExports.jsx(V,{scope:o.__scopeAccordion,collapsible:r,children:n.jsxRuntimeExports.jsx($,{...a,ref:c})})})}),ce=l.forwardRef((o,c)=>{const{value:e,defaultValue:t,onValueChange:i=()=>{},...r}=o,[a,s]=N.useControllableState({prop:e,defaultProp:t??[],onChange:i,caller:d}),u=l.useCallback(f=>s((x=[])=>[...x,f]),[s]),m=l.useCallback(f=>s((x=[])=>x.filter(b=>b!==f)),[s]);return n.jsxRuntimeExports.jsx(H,{scope:o.__scopeAccordion,value:a,onItemOpen:u,onItemClose:m,children:n.jsxRuntimeExports.jsx(V,{scope:o.__scopeAccordion,collapsible:!0,children:n.jsxRuntimeExports.jsx($,{...r,ref:c})})})}),[ie,j]=R(d),$=l.forwardRef((o,c)=>{const{__scopeAccordion:e,disabled:t,dir:i,orientation:r="vertical",...a}=o,s=l.useRef(null),u=W.useComposedRefs(s,c),m=ee(e),x=T.useDirection(i)==="ltr",b=N.composeEventHandlers(o.onKeyDown,C=>{if(!Z.includes(C.key))return;const F=C.target,I=m().filter(P=>!P.ref.current?.disabled),A=I.findIndex(P=>P.ref.current===F),O=I.length;if(A===-1)return;C.preventDefault();let p=A;const h=0,E=O-1,_=()=>{p=A+1,p>E&&(p=h)},w=()=>{p=A-1,p<h&&(p=E)};switch(C.key){case"Home":p=h;break;case"End":p=E;break;case"ArrowRight":r==="horizontal"&&(x?_():w());break;case"ArrowDown":r==="vertical"&&_();break;case"ArrowLeft":r==="horizontal"&&(x?w():_());break;case"ArrowUp":r==="vertical"&&w();break}const J=p%O;I[J].ref.current?.focus()});return n.jsxRuntimeExports.jsx(ie,{scope:e,disabled:t,direction:i,orientation:r,children:n.jsxRuntimeExports.jsx(y.Slot,{scope:e,children:n.jsxRuntimeExports.jsx(q.Primitive.div,{...a,"data-orientation":r,ref:u,onKeyDown:t?void 0:b})})})}),g="AccordionItem",[se,D]=R(g),K=l.forwardRef((o,c)=>{const{__scopeAccordion:e,value:t,...i}=o,r=j(g,e),a=re(g,e),s=k(e),u=X.useId(),m=t&&a.value.includes(t)||!1,f=r.disabled||o.disabled;return n.jsxRuntimeExports.jsx(se,{scope:e,open:m,disabled:f,triggerId:u,children:n.jsxRuntimeExports.jsx(v.Root,{"data-orientation":r.orientation,"data-state":B(m),...s,...i,ref:c,disabled:f,open:m,onOpenChange:x=>{x?a.onItemOpen(t):a.onItemClose(t)}})})});K.displayName=g;var L="AccordionHeader",z=l.forwardRef((o,c)=>{const{__scopeAccordion:e,...t}=o,i=j(d,e),r=D(L,e);return n.jsxRuntimeExports.jsx(q.Primitive.h3,{"data-orientation":i.orientation,"data-state":B(r.open),"data-disabled":r.disabled?"":void 0,...t,ref:c})});z.displayName=L;var S="AccordionTrigger",G=l.forwardRef((o,c)=>{const{__scopeAccordion:e,...t}=o,i=j(d,e),r=D(S,e),a=te(S,e),s=k(e);return n.jsxRuntimeExports.jsx(y.ItemSlot,{scope:e,children:n.jsxRuntimeExports.jsx(v.Trigger,{"aria-disabled":r.open&&!a.collapsible||void 0,"data-orientation":i.orientation,id:r.triggerId,...s,...t,ref:c})})});G.displayName=S;var U="AccordionContent",Y=l.forwardRef((o,c)=>{const{__scopeAccordion:e,...t}=o,i=j(d,e),r=D(U,e),a=k(e);return n.jsxRuntimeExports.jsx(v.Content,{role:"region","aria-labelledby":r.triggerId,"data-orientation":i.orientation,...a,...t,ref:c,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...o.style}})});Y.displayName=U;function B(o){return o?"open":"closed"}var ae=M,le=K,de=z,ue=G,pe=Y;exports.Content2=pe;exports.Header=de;exports.Item=le;exports.Root2=ae;exports.Trigger2=ue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const w=require("react"),T=require("./index-BWaO7kQK.cjs"),A=require("./index-cwZN7ZY3.cjs"),I=require("./index-MQ0c3ZX_.cjs"),$=require("./index-BKbK2GzY.cjs"),m=require("./index-DQvx1rG_.cjs"),D=require("./index-IKJMQref.cjs"),M=require("./index-WIv2ndLu.cjs"),c=require("./jsx-runtime-BB_1_6y_.cjs");function k(e){const s=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(s,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return s.default=e,Object.freeze(s)}const r=k(w);var f="Collapsible",[L,F]=A.createContextScope(f),[B,g]=L(f),q=r.forwardRef((e,s)=>{const{__scopeCollapsible:t,open:n,defaultOpen:o,disabled:l,onOpenChange:a,...b}=e,[u,d]=T.useControllableState({prop:n,defaultProp:o??!1,onChange:a,caller:f});return c.jsxRuntimeExports.jsx(B,{scope:t,disabled:l,contentId:M.useId(),open:u,onOpenToggle:r.useCallback(()=>d(x=>!x),[d]),children:c.jsxRuntimeExports.jsx(m.Primitive.div,{"data-state":j(u),"data-disabled":l?"":void 0,...b,ref:s})})});q.displayName=f;var S="CollapsibleTrigger",R=r.forwardRef((e,s)=>{const{__scopeCollapsible:t,...n}=e,o=g(S,t);return c.jsxRuntimeExports.jsx(m.Primitive.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":j(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:s,onClick:T.composeEventHandlers(e.onClick,o.onOpenToggle)})});R.displayName=S;var v="CollapsibleContent",h=r.forwardRef((e,s)=>{const{forceMount:t,...n}=e,o=g(v,e.__scopeCollapsible);return c.jsxRuntimeExports.jsx(D.Presence,{present:t||o.open,children:({present:l})=>c.jsxRuntimeExports.jsx(G,{...n,ref:s,present:l})})});h.displayName=v;var G=r.forwardRef((e,s)=>{const{__scopeCollapsible:t,present:n,children:o,...l}=e,a=g(v,t),[b,u]=r.useState(n),d=r.useRef(null),x=$.useComposedRefs(s,d),y=r.useRef(0),P=y.current,E=r.useRef(0),N=E.current,C=a.open||b,_=r.useRef(C),p=r.useRef(void 0);return r.useEffect(()=>{const i=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(i)},[]),I.useLayoutEffect2(()=>{const i=d.current;if(i){p.current=p.current||{transitionDuration:i.style.transitionDuration,animationName:i.style.animationName},i.style.transitionDuration="0s",i.style.animationName="none";const O=i.getBoundingClientRect();y.current=O.height,E.current=O.width,_.current||(i.style.transitionDuration=p.current.transitionDuration,i.style.animationName=p.current.animationName),u(n)}},[a.open,n]),c.jsxRuntimeExports.jsx(m.Primitive.div,{"data-state":j(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!C,...l,ref:x,style:{"--radix-collapsible-content-height":P?`${P}px`:void 0,"--radix-collapsible-content-width":N?`${N}px`:void 0,...e.style},children:C&&o})});function j(e){return e?"open":"closed"}var z=q,H=R,J=h;exports.CollapsibleContent=h;exports.CollapsibleTrigger=R;exports.Content=J;exports.Root=z;exports.Trigger=H;exports.createCollapsibleScope=F;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("react"),A=require("./index-cwZN7ZY3.cjs"),d=require("./index-BKbK2GzY.cjs"),x=require("./jsx-runtime-BB_1_6y_.cjs");function D(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const a=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(o,i,a.get?a:{enumerable:!0,get:()=>e[i]})}}return o.default=e,Object.freeze(o)}const j=D(r);function T(e){const o=e+"CollectionProvider",[i,a]=A.createContextScope(o),[E,m]=i(o,{collectionRef:{current:null},itemMap:new Map}),R=l=>{const{scope:t,children:u}=l,n=r.useRef(null),c=r.useRef(new Map).current;return x.jsxRuntimeExports.jsx(E,{scope:t,itemMap:c,collectionRef:n,children:u})};R.displayName=o;const p=e+"CollectionSlot",N=d.createSlot(p),S=r.forwardRef((l,t)=>{const{scope:u,children:n}=l,c=m(p,u),s=d.useComposedRefs(t,c.collectionRef);return x.jsxRuntimeExports.jsx(N,{ref:s,children:n})});S.displayName=p;const C=e+"CollectionItemSlot",I="data-radix-collection-item",_=d.createSlot(C),M=r.forwardRef((l,t)=>{const{scope:u,children:n,...c}=l,s=r.useRef(null),O=d.useComposedRefs(t,s),f=m(C,u);return r.useEffect(()=>(f.itemMap.set(s,{ref:s,...c}),()=>void f.itemMap.delete(s))),x.jsxRuntimeExports.jsx(_,{[I]:"",ref:O,children:n})});M.displayName=C;function v(l){const t=m(e+"CollectionConsumer",l);return r.useCallback(()=>{const n=t.collectionRef.current;if(!n)return[];const c=Array.from(n.querySelectorAll(`[${I}]`));return Array.from(t.itemMap.values()).sort((f,y)=>c.indexOf(f.ref.current)-c.indexOf(y.ref.current))},[t.collectionRef,t.itemMap])}return[{Provider:R,Slot:S,ItemSlot:M},v,a]}var b=j.createContext(void 0);function g(e){const o=j.useContext(b);return e||o||"ltr"}exports.createCollection=T;exports.useDirection=g;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("react"),f=require("react-dom"),m=require("./index-BKbK2GzY.cjs"),p=require("./jsx-runtime-BB_1_6y_.cjs");function n(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const d=n(l),v=n(f);var b=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],O=b.reduce((e,t)=>{const i=m.createSlot(`Primitive.${t}`),r=d.forwardRef((c,o)=>{const{asChild:s,...a}=c,u=s?i:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsxRuntimeExports.jsx(u,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function h(e,t){e&&v.flushSync(()=>e.dispatchEvent(t))}exports.Primitive=O;exports.dispatchDiscreteCustomEvent=h;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";const oe=require("react"),ge=require("./index-BKbK2GzY.cjs"),ye=require("./index-DQvx1rG_.cjs"),G=require("./index-CzY-WZXL.cjs"),be=require("./jsx-runtime-BB_1_6y_.cjs");function Ee(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const u=Ee(oe);var j="focusScope.autoFocusOnMount",_="focusScope.autoFocusOnUnmount",z={bubbles:!1,cancelable:!0},Se="FocusScope",ce=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:c,onUnmountAutoFocus:i,...s}=e,[a,S]=u.useState(null),b=G.useCallbackRef(c),g=G.useCallbackRef(i),f=u.useRef(null),v=ge.useComposedRefs(t,o=>S(o)),h=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let o=function(p){if(h.paused||!a)return;const y=p.target;a.contains(y)?f.current=y:k(f.current,{select:!0})},l=function(p){if(h.paused||!a)return;const y=p.relatedTarget;y!==null&&(a.contains(y)||k(f.current,{select:!0}))},d=function(p){if(document.activeElement===document.body)for(const E of p)E.removedNodes.length>0&&k(a)};document.addEventListener("focusin",o),document.addEventListener("focusout",l);const m=new MutationObserver(d);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",o),document.removeEventListener("focusout",l),m.disconnect()}}},[r,a,h.paused]),u.useEffect(()=>{if(a){Q.add(h);const o=document.activeElement;if(!a.contains(o)){const d=new CustomEvent(j,z);a.addEventListener(j,b),a.dispatchEvent(d),d.defaultPrevented||(we(Te(ue(a)),{select:!0}),document.activeElement===o&&k(a))}return()=>{a.removeEventListener(j,b),setTimeout(()=>{const d=new CustomEvent(_,z);a.addEventListener(_,g),a.dispatchEvent(d),d.defaultPrevented||k(o??document.body,{select:!0}),a.removeEventListener(_,g),Q.remove(h)},0)}}},[a,b,g,h]);const w=u.useCallback(o=>{if(!n&&!r||h.paused)return;const l=o.key==="Tab"&&!o.altKey&&!o.ctrlKey&&!o.metaKey,d=document.activeElement;if(l&&d){const m=o.currentTarget,[p,y]=Ce(m);p&&y?!o.shiftKey&&d===y?(o.preventDefault(),n&&k(p,{select:!0})):o.shiftKey&&d===p&&(o.preventDefault(),n&&k(y,{select:!0})):d===m&&o.preventDefault()}},[n,r,h.paused]);return be.jsxRuntimeExports.jsx(ye.Primitive.div,{tabIndex:-1,...s,ref:v,onKeyDown:w})});ce.displayName=Se;function we(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(k(r,{select:t}),document.activeElement!==n)return}function Ce(e){const t=ue(e),n=Z(t,e),r=Z(t.reverse(),e);return[n,r]}function ue(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const c=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||c?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Z(e,t){for(const n of e)if(!Re(n,{upTo:t}))return n}function Re(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ke(e){return e instanceof HTMLInputElement&&"select"in e}function k(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ke(e)&&t&&e.select()}}var Q=Ae();function Ae(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=$(e,t),e.unshift(t)},remove(t){e=$(e,t),e[0]?.resume()}}}function $(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Te(e){return e.filter(t=>t.tagName!=="A")}var U=0;function Oe(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??J()),document.body.insertAdjacentElement("beforeend",e[1]??J()),U++,()=>{U===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),U--}},[])}function J(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var C=function(){return C=Object.assign||function(t){for(var n,r=1,c=arguments.length;r<c;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},C.apply(this,arguments)};function ie(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,r=Object.getOwnPropertySymbols(e);c<r.length;c++)t.indexOf(r[c])<0&&Object.prototype.propertyIsEnumerable.call(e,r[c])&&(n[r[c]]=e[r[c]]);return n}function Ne(e,t,n){if(n||arguments.length===2)for(var r=0,c=t.length,i;r<c;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var W="right-scroll-bar-position",D="width-before-scroll-bar",Me="with-scroll-bars-hidden",Fe="--removed-body-scroll-bar-size";function K(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Pe(e,t){var n=oe.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var c=n.value;c!==r&&(n.value=r,n.callback(r,c))}}}})[0];return n.callback=t,n.facade}var Le=typeof window<"u"?u.useLayoutEffect:u.useEffect,ee=new WeakMap;function xe(e,t){var n=Pe(null,function(r){return e.forEach(function(c){return K(c,r)})});return Le(function(){var r=ee.get(n);if(r){var c=new Set(r),i=new Set(e),s=n.current;c.forEach(function(a){i.has(a)||K(a,null)}),i.forEach(function(a){c.has(a)||K(a,s)})}ee.set(n,e)},[e]),n}function Ie(e){return e}function We(e,t){t===void 0&&(t=Ie);var n=[],r=!1,c={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var S=function(){var g=s;s=[],g.forEach(i)},b=function(){return Promise.resolve().then(S)};b(),n={push:function(g){s.push(g),b()},filter:function(g){return s=s.filter(g),n}}}};return c}function De(e){e===void 0&&(e={});var t=We(null);return t.options=C({async:!0,ssr:!1},e),t}var le=function(e){var t=e.sideCar,n=ie(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return u.createElement(r,C({},n))};le.isSideCarExport=!0;function Be(e,t){return e.useMedium(t),le}var se=De(),H=function(){},B=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:H,onWheelCapture:H,onTouchMoveCapture:H}),c=r[0],i=r[1],s=e.forwardProps,a=e.children,S=e.className,b=e.removeScrollBar,g=e.enabled,f=e.shards,v=e.sideCar,h=e.noRelative,w=e.noIsolation,o=e.inert,l=e.allowPinchZoom,d=e.as,m=d===void 0?"div":d,p=e.gapMode,y=ie(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=v,A=xe([n,t]),R=C(C({},y),c);return u.createElement(u.Fragment,null,g&&u.createElement(E,{sideCar:se,removeScrollBar:b,shards:f,noRelative:h,noIsolation:w,inert:o,setCallbacks:i,allowPinchZoom:!!l,lockRef:n,gapMode:p}),s?u.cloneElement(u.Children.only(a),C(C({},R),{ref:A})):u.createElement(m,C({},R,{className:S,ref:A}),a))});B.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};B.classNames={fullWidth:D,zeroRight:W};var je=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function _e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=je();return t&&e.setAttribute("nonce",t),e}function Ue(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ke(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var He=function(){var e=0,t=null;return{add:function(n){e==0&&(t=_e())&&(Ue(t,n),Ke(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ve=function(){var e=He();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},fe=function(){var e=Ve(),t=function(n){var r=n.styles,c=n.dynamic;return e(r,c),null};return t},Xe={left:0,top:0,right:0,gap:0},V=function(e){return parseInt(e||"",10)||0},Ye=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],c=t[e==="padding"?"paddingRight":"marginRight"];return[V(n),V(r),V(c)]},qe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Xe;var t=Ye(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ge=fe(),M="data-scroll-locked",ze=function(e,t,n,r){var c=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
2
|
+
.`.concat(Me,` {
|
|
3
|
+
overflow: hidden `).concat(r,`;
|
|
4
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
5
|
+
}
|
|
6
|
+
body[`).concat(M,`] {
|
|
7
|
+
overflow: hidden `).concat(r,`;
|
|
8
|
+
overscroll-behavior: contain;
|
|
9
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
10
|
+
padding-left: `.concat(c,`px;
|
|
11
|
+
padding-top: `).concat(i,`px;
|
|
12
|
+
padding-right: `).concat(s,`px;
|
|
13
|
+
margin-left:0;
|
|
14
|
+
margin-top:0;
|
|
15
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
16
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.`).concat(W,` {
|
|
20
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.`).concat(D,` {
|
|
24
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.`).concat(W," .").concat(W,` {
|
|
28
|
+
right: 0 `).concat(r,`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.`).concat(D," .").concat(D,` {
|
|
32
|
+
margin-right: 0 `).concat(r,`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[`).concat(M,`] {
|
|
36
|
+
`).concat(Fe,": ").concat(a,`px;
|
|
37
|
+
}
|
|
38
|
+
`)},te=function(){var e=parseInt(document.body.getAttribute(M)||"0",10);return isFinite(e)?e:0},Ze=function(){u.useEffect(function(){return document.body.setAttribute(M,(te()+1).toString()),function(){var e=te()-1;e<=0?document.body.removeAttribute(M):document.body.setAttribute(M,e.toString())}},[])},Qe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,c=r===void 0?"margin":r;Ze();var i=u.useMemo(function(){return qe(c)},[c]);return u.createElement(Ge,{styles:ze(i,!t,c,n?"":"!important")})},Y=!1;if(typeof window<"u")try{var P=Object.defineProperty({},"passive",{get:function(){return Y=!0,!0}});window.addEventListener("test",P,P),window.removeEventListener("test",P,P)}catch{Y=!1}var T=Y?{passive:!1}:!1,$e=function(e){return e.tagName==="TEXTAREA"},de=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!$e(e)&&n[t]==="visible")},Je=function(e){return de(e,"overflowY")},et=function(e){return de(e,"overflowX")},ne=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var c=ve(e,r);if(c){var i=he(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},tt=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},nt=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ve=function(e,t){return e==="v"?Je(t):et(t)},he=function(e,t){return e==="v"?tt(t):nt(t)},rt=function(e,t){return e==="h"&&t==="rtl"?-1:1},at=function(e,t,n,r,c){var i=rt(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,S=t.contains(a),b=!1,g=s>0,f=0,v=0;do{if(!a)break;var h=he(e,a),w=h[0],o=h[1],l=h[2],d=o-l-i*w;(w||d)&&ve(e,a)&&(f+=d,v+=w);var m=a.parentNode;a=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!S&&a!==document.body||S&&(t.contains(a)||t===a));return(g&&Math.abs(f)<1||!g&&Math.abs(v)<1)&&(b=!0),b},L=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},re=function(e){return[e.deltaX,e.deltaY]},ae=function(e){return e&&"current"in e?e.current:e},ot=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ct=function(e){return`
|
|
39
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
41
|
+
`)},ut=0,O=[];function it(e){var t=u.useRef([]),n=u.useRef([0,0]),r=u.useRef(),c=u.useState(ut++)[0],i=u.useState(fe)[0],s=u.useRef(e);u.useEffect(function(){s.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(c));var o=Ne([e.lockRef.current],(e.shards||[]).map(ae),!0).filter(Boolean);return o.forEach(function(l){return l.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),o.forEach(function(l){return l.classList.remove("allow-interactivity-".concat(c))})}}},[e.inert,e.lockRef.current,e.shards]);var a=u.useCallback(function(o,l){if("touches"in o&&o.touches.length===2||o.type==="wheel"&&o.ctrlKey)return!s.current.allowPinchZoom;var d=L(o),m=n.current,p="deltaX"in o?o.deltaX:m[0]-d[0],y="deltaY"in o?o.deltaY:m[1]-d[1],E,A=o.target,R=Math.abs(p)>Math.abs(y)?"h":"v";if("touches"in o&&R==="h"&&A.type==="range")return!1;var F=ne(R,A);if(!F)return!0;if(F?E=R:(E=R==="v"?"h":"v",F=ne(R,A)),!F)return!1;if(!r.current&&"changedTouches"in o&&(p||y)&&(r.current=E),!E)return!0;var q=r.current||E;return at(q,l,o,q==="h"?p:y)},[]),S=u.useCallback(function(o){var l=o;if(!(!O.length||O[O.length-1]!==i)){var d="deltaY"in l?re(l):L(l),m=t.current.filter(function(E){return E.name===l.type&&(E.target===l.target||l.target===E.shadowParent)&&ot(E.delta,d)})[0];if(m&&m.should){l.cancelable&&l.preventDefault();return}if(!m){var p=(s.current.shards||[]).map(ae).filter(Boolean).filter(function(E){return E.contains(l.target)}),y=p.length>0?a(l,p[0]):!s.current.noIsolation;y&&l.cancelable&&l.preventDefault()}}},[]),b=u.useCallback(function(o,l,d,m){var p={name:o,delta:l,target:d,should:m,shadowParent:lt(d)};t.current.push(p),setTimeout(function(){t.current=t.current.filter(function(y){return y!==p})},1)},[]),g=u.useCallback(function(o){n.current=L(o),r.current=void 0},[]),f=u.useCallback(function(o){b(o.type,re(o),o.target,a(o,e.lockRef.current))},[]),v=u.useCallback(function(o){b(o.type,L(o),o.target,a(o,e.lockRef.current))},[]);u.useEffect(function(){return O.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:v}),document.addEventListener("wheel",S,T),document.addEventListener("touchmove",S,T),document.addEventListener("touchstart",g,T),function(){O=O.filter(function(o){return o!==i}),document.removeEventListener("wheel",S,T),document.removeEventListener("touchmove",S,T),document.removeEventListener("touchstart",g,T)}},[]);var h=e.removeScrollBar,w=e.inert;return u.createElement(u.Fragment,null,w?u.createElement(i,{styles:ct(c)}):null,h?u.createElement(Qe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function lt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const st=Be(se,it);var me=u.forwardRef(function(e,t){return u.createElement(B,C({},e,{ref:t,sideCar:st}))});me.classNames=B.classNames;var ft=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},N=new WeakMap,x=new WeakMap,I={},X=0,pe=function(e){return e&&(e.host||pe(e.parentNode))},dt=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=pe(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},vt=function(e,t,n,r){var c=dt(t,Array.isArray(e)?e:[e]);I[n]||(I[n]=new WeakMap);var i=I[n],s=[],a=new Set,S=new Set(c),b=function(f){!f||a.has(f)||(a.add(f),b(f.parentNode))};c.forEach(b);var g=function(f){!f||S.has(f)||Array.prototype.forEach.call(f.children,function(v){if(a.has(v))g(v);else try{var h=v.getAttribute(r),w=h!==null&&h!=="false",o=(N.get(v)||0)+1,l=(i.get(v)||0)+1;N.set(v,o),i.set(v,l),s.push(v),o===1&&w&&x.set(v,!0),l===1&&v.setAttribute(n,"true"),w||v.setAttribute(r,"true")}catch(d){console.error("aria-hidden: cannot operate on ",v,d)}})};return g(t),a.clear(),X++,function(){s.forEach(function(f){var v=N.get(f)-1,h=i.get(f)-1;N.set(f,v),i.set(f,h),v||(x.has(f)||f.removeAttribute(r),x.delete(f)),h||f.removeAttribute(n)}),X--,X||(N=new WeakMap,N=new WeakMap,x=new WeakMap,I={})}},ht=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),c=ft(e);return c?(r.push.apply(r,Array.from(c.querySelectorAll("[aria-live], script"))),vt(r,c,n,"aria-hidden")):function(){return null}};exports.FocusScope=ce;exports.ReactRemoveScroll=me;exports.hideOthers=ht;exports.useFocusGuards=Oe;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("react");function o(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const u=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,u.get?u:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const n=o(c);function s(e){const r=n.useRef({value:e,previous:e});return n.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}exports.usePrevious=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const B=require("react"),f=require("./index-BWaO7kQK.cjs"),P=require("./index-D7hQvndv.cjs"),Y=require("./index-BKbK2GzY.cjs"),z=require("./index-cwZN7ZY3.cjs"),V=require("./index-WIv2ndLu.cjs"),D=require("./index-DQvx1rG_.cjs"),J=require("./index-CzY-WZXL.cjs"),p=require("./jsx-runtime-BB_1_6y_.cjs");function Q(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,t.get?t:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const c=Q(B);var y="rovingFocusGroup.onEntryFocus",W={bubbles:!1,cancelable:!0},b="RovingFocusGroup",[j,G,X]=P.createCollection(b),[Z,ee]=z.createContextScope(b,[X]),[te,oe]=Z(b),N=c.forwardRef((e,o)=>p.jsxRuntimeExports.jsx(j.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsxRuntimeExports.jsx(j.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsxRuntimeExports.jsx(re,{...e,ref:o})})}));N.displayName=b;var re=c.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:r,orientation:t,loop:F=!1,dir:S,currentTabStopId:v,defaultCurrentTabStopId:T,onCurrentTabStopIdChange:w,onEntryFocus:m,preventScrollOnEntryFocus:u=!1,...I}=e,R=c.useRef(null),g=Y.useComposedRefs(o,R),x=P.useDirection(S),[E,n]=f.useControllableState({prop:v,defaultProp:T??null,onChange:w,caller:b}),[a,C]=c.useState(!1),i=J.useCallbackRef(m),l=G(r),_=c.useRef(!1),[q,A]=c.useState(0);return c.useEffect(()=>{const s=R.current;if(s)return s.addEventListener(y,i),()=>s.removeEventListener(y,i)},[i]),p.jsxRuntimeExports.jsx(te,{scope:r,orientation:t,dir:x,loop:F,currentTabStopId:E,onItemFocus:c.useCallback(s=>n(s),[n]),onItemShiftTab:c.useCallback(()=>C(!0),[]),onFocusableItemAdd:c.useCallback(()=>A(s=>s+1),[]),onFocusableItemRemove:c.useCallback(()=>A(s=>s-1),[]),children:p.jsxRuntimeExports.jsx(D.Primitive.div,{tabIndex:a||q===0?-1:0,"data-orientation":t,...I,ref:g,style:{outline:"none",...e.style},onMouseDown:f.composeEventHandlers(e.onMouseDown,()=>{_.current=!0}),onFocus:f.composeEventHandlers(e.onFocus,s=>{const L=!_.current;if(s.target===s.currentTarget&&L&&!a){const O=new CustomEvent(y,W);if(s.currentTarget.dispatchEvent(O),!O.defaultPrevented){const h=l().filter(d=>d.focusable),U=h.find(d=>d.active),H=h.find(d=>d.id===E),$=[U,H,...h].filter(Boolean).map(d=>d.ref.current);k($,u)}}_.current=!1}),onBlur:f.composeEventHandlers(e.onBlur,()=>C(!1))})})}),K="RovingFocusGroupItem",M=c.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:r,focusable:t=!0,active:F=!1,tabStopId:S,children:v,...T}=e,w=V.useId(),m=S||w,u=oe(K,r),I=u.currentTabStopId===m,R=G(r),{onFocusableItemAdd:g,onFocusableItemRemove:x,currentTabStopId:E}=u;return c.useEffect(()=>{if(t)return g(),()=>x()},[t,g,x]),p.jsxRuntimeExports.jsx(j.ItemSlot,{scope:r,id:m,focusable:t,active:F,children:p.jsxRuntimeExports.jsx(D.Primitive.span,{tabIndex:I?0:-1,"data-orientation":u.orientation,...T,ref:o,onMouseDown:f.composeEventHandlers(e.onMouseDown,n=>{t?u.onItemFocus(m):n.preventDefault()}),onFocus:f.composeEventHandlers(e.onFocus,()=>u.onItemFocus(m)),onKeyDown:f.composeEventHandlers(e.onKeyDown,n=>{if(n.key==="Tab"&&n.shiftKey){u.onItemShiftTab();return}if(n.target!==n.currentTarget)return;const a=ce(n,u.orientation,u.dir);if(a!==void 0){if(n.metaKey||n.ctrlKey||n.altKey||n.shiftKey)return;n.preventDefault();let i=R().filter(l=>l.focusable).map(l=>l.ref.current);if(a==="last")i.reverse();else if(a==="prev"||a==="next"){a==="prev"&&i.reverse();const l=i.indexOf(n.currentTarget);i=u.loop?ue(i,l+1):i.slice(l+1)}setTimeout(()=>k(i))}}),children:typeof v=="function"?v({isCurrentTabStop:I,hasTabStop:E!=null}):v})})});M.displayName=K;var ne={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function se(e,o){return o!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ce(e,o,r){const t=se(e.key,r);if(!(o==="vertical"&&["ArrowLeft","ArrowRight"].includes(t))&&!(o==="horizontal"&&["ArrowUp","ArrowDown"].includes(t)))return ne[t]}function k(e,o=!1){const r=document.activeElement;for(const t of e)if(t===r||(t.focus({preventScroll:o}),document.activeElement!==r))return}function ue(e,o){return e.map((r,t)=>e[(o+t)%e.length])}var ie=N,ae=M;exports.Item=ae;exports.Root=ie;exports.createRovingFocusGroupScope=ee;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import * as s from "react";
|
|
2
|
+
import { c as p, u as H } from "./index-C0UREtMP.js";
|
|
3
|
+
import { c as V, u as z } from "./index-D02K8KOB.js";
|
|
4
|
+
import { u as q } from "./index-6oTEokEx.js";
|
|
5
|
+
import { c as J } from "./index-FxyLF8MY.js";
|
|
6
|
+
import { u as Q } from "./index-Cv867SGx.js";
|
|
7
|
+
import { P as G } from "./index-C5wjudc-.js";
|
|
8
|
+
import { u as W } from "./index-0ioNhtNM.js";
|
|
9
|
+
import { j as d } from "./jsx-runtime-BzflLqGi.js";
|
|
10
|
+
var _ = "rovingFocusGroup.onEntryFocus", X = { bubbles: !1, cancelable: !0 }, I = "RovingFocusGroup", [y, N, Z] = V(I), [$, Ie] = J(
|
|
11
|
+
I,
|
|
12
|
+
[Z]
|
|
13
|
+
), [ee, oe] = $(I), O = s.forwardRef(
|
|
14
|
+
(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 }) }) })
|
|
15
|
+
);
|
|
16
|
+
O.displayName = I;
|
|
17
|
+
var te = s.forwardRef((e, r) => {
|
|
18
|
+
const {
|
|
19
|
+
__scopeRovingFocusGroup: c,
|
|
20
|
+
orientation: o,
|
|
21
|
+
loop: T = !1,
|
|
22
|
+
dir: w,
|
|
23
|
+
currentTabStopId: v,
|
|
24
|
+
defaultCurrentTabStopId: C,
|
|
25
|
+
onCurrentTabStopIdChange: S,
|
|
26
|
+
onEntryFocus: m,
|
|
27
|
+
preventScrollOnEntryFocus: a = !1,
|
|
28
|
+
...b
|
|
29
|
+
} = e, F = s.useRef(null), g = q(r, F), R = z(w), [E, t] = H({
|
|
30
|
+
prop: v,
|
|
31
|
+
defaultProp: C ?? null,
|
|
32
|
+
onChange: S,
|
|
33
|
+
caller: I
|
|
34
|
+
}), [i, h] = s.useState(!1), u = W(m), l = N(c), x = s.useRef(!1), [k, P] = s.useState(0);
|
|
35
|
+
return s.useEffect(() => {
|
|
36
|
+
const n = F.current;
|
|
37
|
+
if (n)
|
|
38
|
+
return n.addEventListener(_, u), () => n.removeEventListener(_, u);
|
|
39
|
+
}, [u]), /* @__PURE__ */ d.jsx(
|
|
40
|
+
ee,
|
|
41
|
+
{
|
|
42
|
+
scope: c,
|
|
43
|
+
orientation: o,
|
|
44
|
+
dir: R,
|
|
45
|
+
loop: T,
|
|
46
|
+
currentTabStopId: E,
|
|
47
|
+
onItemFocus: s.useCallback(
|
|
48
|
+
(n) => t(n),
|
|
49
|
+
[t]
|
|
50
|
+
),
|
|
51
|
+
onItemShiftTab: s.useCallback(() => h(!0), []),
|
|
52
|
+
onFocusableItemAdd: s.useCallback(
|
|
53
|
+
() => P((n) => n + 1),
|
|
54
|
+
[]
|
|
55
|
+
),
|
|
56
|
+
onFocusableItemRemove: s.useCallback(
|
|
57
|
+
() => P((n) => n - 1),
|
|
58
|
+
[]
|
|
59
|
+
),
|
|
60
|
+
children: /* @__PURE__ */ d.jsx(
|
|
61
|
+
G.div,
|
|
62
|
+
{
|
|
63
|
+
tabIndex: i || k === 0 ? -1 : 0,
|
|
64
|
+
"data-orientation": o,
|
|
65
|
+
...b,
|
|
66
|
+
ref: g,
|
|
67
|
+
style: { outline: "none", ...e.style },
|
|
68
|
+
onMouseDown: p(e.onMouseDown, () => {
|
|
69
|
+
x.current = !0;
|
|
70
|
+
}),
|
|
71
|
+
onFocus: p(e.onFocus, (n) => {
|
|
72
|
+
const L = !x.current;
|
|
73
|
+
if (n.target === n.currentTarget && L && !i) {
|
|
74
|
+
const D = new CustomEvent(_, X);
|
|
75
|
+
if (n.currentTarget.dispatchEvent(D), !D.defaultPrevented) {
|
|
76
|
+
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(
|
|
77
|
+
Boolean
|
|
78
|
+
).map((f) => f.ref.current);
|
|
79
|
+
M(Y, a);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
x.current = !1;
|
|
83
|
+
}),
|
|
84
|
+
onBlur: p(e.onBlur, () => h(!1))
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}), K = "RovingFocusGroupItem", j = s.forwardRef(
|
|
90
|
+
(e, r) => {
|
|
91
|
+
const {
|
|
92
|
+
__scopeRovingFocusGroup: c,
|
|
93
|
+
focusable: o = !0,
|
|
94
|
+
active: T = !1,
|
|
95
|
+
tabStopId: w,
|
|
96
|
+
children: v,
|
|
97
|
+
...C
|
|
98
|
+
} = e, S = Q(), m = w || S, a = oe(K, c), b = a.currentTabStopId === m, F = N(c), { onFocusableItemAdd: g, onFocusableItemRemove: R, currentTabStopId: E } = a;
|
|
99
|
+
return s.useEffect(() => {
|
|
100
|
+
if (o)
|
|
101
|
+
return g(), () => R();
|
|
102
|
+
}, [o, g, R]), /* @__PURE__ */ d.jsx(
|
|
103
|
+
y.ItemSlot,
|
|
104
|
+
{
|
|
105
|
+
scope: c,
|
|
106
|
+
id: m,
|
|
107
|
+
focusable: o,
|
|
108
|
+
active: T,
|
|
109
|
+
children: /* @__PURE__ */ d.jsx(
|
|
110
|
+
G.span,
|
|
111
|
+
{
|
|
112
|
+
tabIndex: b ? 0 : -1,
|
|
113
|
+
"data-orientation": a.orientation,
|
|
114
|
+
...C,
|
|
115
|
+
ref: r,
|
|
116
|
+
onMouseDown: p(e.onMouseDown, (t) => {
|
|
117
|
+
o ? a.onItemFocus(m) : t.preventDefault();
|
|
118
|
+
}),
|
|
119
|
+
onFocus: p(e.onFocus, () => a.onItemFocus(m)),
|
|
120
|
+
onKeyDown: p(e.onKeyDown, (t) => {
|
|
121
|
+
if (t.key === "Tab" && t.shiftKey) {
|
|
122
|
+
a.onItemShiftTab();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (t.target !== t.currentTarget) return;
|
|
126
|
+
const i = se(t, a.orientation, a.dir);
|
|
127
|
+
if (i !== void 0) {
|
|
128
|
+
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey) return;
|
|
129
|
+
t.preventDefault();
|
|
130
|
+
let u = F().filter((l) => l.focusable).map((l) => l.ref.current);
|
|
131
|
+
if (i === "last") u.reverse();
|
|
132
|
+
else if (i === "prev" || i === "next") {
|
|
133
|
+
i === "prev" && u.reverse();
|
|
134
|
+
const l = u.indexOf(t.currentTarget);
|
|
135
|
+
u = a.loop ? ce(u, l + 1) : u.slice(l + 1);
|
|
136
|
+
}
|
|
137
|
+
setTimeout(() => M(u));
|
|
138
|
+
}
|
|
139
|
+
}),
|
|
140
|
+
children: typeof v == "function" ? v({ isCurrentTabStop: b, hasTabStop: E != null }) : v
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
j.displayName = K;
|
|
148
|
+
var re = {
|
|
149
|
+
ArrowLeft: "prev",
|
|
150
|
+
ArrowUp: "prev",
|
|
151
|
+
ArrowRight: "next",
|
|
152
|
+
ArrowDown: "next",
|
|
153
|
+
PageUp: "first",
|
|
154
|
+
Home: "first",
|
|
155
|
+
PageDown: "last",
|
|
156
|
+
End: "last"
|
|
157
|
+
};
|
|
158
|
+
function ne(e, r) {
|
|
159
|
+
return r !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
160
|
+
}
|
|
161
|
+
function se(e, r, c) {
|
|
162
|
+
const o = ne(e.key, c);
|
|
163
|
+
if (!(r === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(r === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
|
|
164
|
+
return re[o];
|
|
165
|
+
}
|
|
166
|
+
function M(e, r = !1) {
|
|
167
|
+
const c = document.activeElement;
|
|
168
|
+
for (const o of e)
|
|
169
|
+
if (o === c || (o.focus({ preventScroll: r }), document.activeElement !== c)) return;
|
|
170
|
+
}
|
|
171
|
+
function ce(e, r) {
|
|
172
|
+
return e.map((c, o) => e[(r + o) % e.length]);
|
|
173
|
+
}
|
|
174
|
+
var be = O, Fe = j;
|
|
175
|
+
export {
|
|
176
|
+
Fe as I,
|
|
177
|
+
be as R,
|
|
178
|
+
Ie as c
|
|
179
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { u as y } from "./index-6oTEokEx.js";
|
|
3
|
+
import { u as A } from "./index-CCKe-Mpx.js";
|
|
4
|
+
function T(n, e) {
|
|
5
|
+
return i.useReducer((t, r) => e[t][r] ?? t, n);
|
|
6
|
+
}
|
|
7
|
+
var E = (n) => {
|
|
8
|
+
const { present: e, children: t } = n, r = R(e), a = typeof t == "function" ? t({ present: r.isPresent }) : i.Children.only(t), c = y(r.ref, P(a));
|
|
9
|
+
return typeof t == "function" || r.isPresent ? i.cloneElement(a, { ref: c }) : null;
|
|
10
|
+
};
|
|
11
|
+
E.displayName = "Presence";
|
|
12
|
+
function R(n) {
|
|
13
|
+
const [e, t] = i.useState(), r = i.useRef(null), a = i.useRef(n), c = i.useRef("none"), p = n ? "mounted" : "unmounted", [N, s] = T(p, {
|
|
14
|
+
mounted: {
|
|
15
|
+
UNMOUNT: "unmounted",
|
|
16
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
17
|
+
},
|
|
18
|
+
unmountSuspended: {
|
|
19
|
+
MOUNT: "mounted",
|
|
20
|
+
ANIMATION_END: "unmounted"
|
|
21
|
+
},
|
|
22
|
+
unmounted: {
|
|
23
|
+
MOUNT: "mounted"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return i.useEffect(() => {
|
|
27
|
+
const o = l(r.current);
|
|
28
|
+
c.current = N === "mounted" ? o : "none";
|
|
29
|
+
}, [N]), A(() => {
|
|
30
|
+
const o = r.current, m = a.current;
|
|
31
|
+
if (m !== n) {
|
|
32
|
+
const f = c.current, u = l(o);
|
|
33
|
+
n ? s("MOUNT") : u === "none" || o?.display === "none" ? s("UNMOUNT") : s(m && f !== u ? "ANIMATION_OUT" : "UNMOUNT"), a.current = n;
|
|
34
|
+
}
|
|
35
|
+
}, [n, s]), A(() => {
|
|
36
|
+
if (e) {
|
|
37
|
+
let o;
|
|
38
|
+
const m = e.ownerDocument.defaultView ?? window, d = (u) => {
|
|
39
|
+
const g = l(r.current).includes(CSS.escape(u.animationName));
|
|
40
|
+
if (u.target === e && g && (s("ANIMATION_END"), !a.current)) {
|
|
41
|
+
const O = e.style.animationFillMode;
|
|
42
|
+
e.style.animationFillMode = "forwards", o = m.setTimeout(() => {
|
|
43
|
+
e.style.animationFillMode === "forwards" && (e.style.animationFillMode = O);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}, f = (u) => {
|
|
47
|
+
u.target === e && (c.current = l(r.current));
|
|
48
|
+
};
|
|
49
|
+
return e.addEventListener("animationstart", f), e.addEventListener("animationcancel", d), e.addEventListener("animationend", d), () => {
|
|
50
|
+
m.clearTimeout(o), e.removeEventListener("animationstart", f), e.removeEventListener("animationcancel", d), e.removeEventListener("animationend", d);
|
|
51
|
+
};
|
|
52
|
+
} else
|
|
53
|
+
s("ANIMATION_END");
|
|
54
|
+
}, [e, s]), {
|
|
55
|
+
isPresent: ["mounted", "unmountSuspended"].includes(N),
|
|
56
|
+
ref: i.useCallback((o) => {
|
|
57
|
+
r.current = o ? getComputedStyle(o) : null, t(o);
|
|
58
|
+
}, [])
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function l(n) {
|
|
62
|
+
return n?.animationName || "none";
|
|
63
|
+
}
|
|
64
|
+
function P(n) {
|
|
65
|
+
let e = Object.getOwnPropertyDescriptor(n.props, "ref")?.get, t = e && "isReactWarning" in e && e.isReactWarning;
|
|
66
|
+
return t ? n.ref : (e = Object.getOwnPropertyDescriptor(n, "ref")?.get, t = e && "isReactWarning" in e && e.isReactWarning, t ? n.props.ref : n.props.ref || n.ref);
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
E as P
|
|
70
|
+
};
|