@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,34 @@
|
|
|
1
|
+
import { a as O } from "./utils-CRiPKpXj.js";
|
|
2
|
+
const m = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, y = O, j = (e, l) => (n) => {
|
|
3
|
+
var u;
|
|
4
|
+
if (l?.variants == null) return y(e, n?.class, n?.className);
|
|
5
|
+
const { variants: r, defaultVariants: d } = l, V = Object.keys(r).map((t) => {
|
|
6
|
+
const a = n?.[t], s = d?.[t];
|
|
7
|
+
if (a === null) return null;
|
|
8
|
+
const i = m(a) || m(s);
|
|
9
|
+
return r[t][i];
|
|
10
|
+
}), v = n && Object.entries(n).reduce((t, a) => {
|
|
11
|
+
let [s, i] = a;
|
|
12
|
+
return i === void 0 || (t[s] = i), t;
|
|
13
|
+
}, {}), N = l == null || (u = l.compoundVariants) === null || u === void 0 ? void 0 : u.reduce((t, a) => {
|
|
14
|
+
let { class: s, className: i, ...f } = a;
|
|
15
|
+
return Object.entries(f).every((C) => {
|
|
16
|
+
let [c, o] = C;
|
|
17
|
+
return Array.isArray(o) ? o.includes({
|
|
18
|
+
...d,
|
|
19
|
+
...v
|
|
20
|
+
}[c]) : {
|
|
21
|
+
...d,
|
|
22
|
+
...v
|
|
23
|
+
}[c] === o;
|
|
24
|
+
}) ? [
|
|
25
|
+
...t,
|
|
26
|
+
s,
|
|
27
|
+
i
|
|
28
|
+
] : t;
|
|
29
|
+
}, []);
|
|
30
|
+
return y(e, V, N, n?.class, n?.className);
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
j as c
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("react"),l=require("react-dom"),f=require("./index-DQvx1rG_.cjs"),d=require("./index-MQ0c3ZX_.cjs"),p=require("./jsx-runtime-BB_1_6y_.cjs");function m(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const a=m(u);var P="Portal",c=a.forwardRef((e,r)=>{const{container:t,...n}=e,[s,i]=a.useState(!1);d.useLayoutEffect2(()=>i(!0),[]);const o=t||s&&globalThis?.document?.body;return o?l.createPortal(p.jsxRuntimeExports.jsx(f.Primitive.div,{...n,ref:r}),o):null});c.displayName=P;exports.Portal=c;
|
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
import { c as M } from "./index-C0UREtMP.js";
|
|
3
|
+
import { c as ze, u as Ze } from "./index-D02K8KOB.js";
|
|
4
|
+
import { u as D, c as $e, a as qe } from "./index-6oTEokEx.js";
|
|
5
|
+
import { c as Je } from "./index-FxyLF8MY.js";
|
|
6
|
+
import { D as Qe } from "./index-C329e3yQ.js";
|
|
7
|
+
import { h as et, u as tt, R as nt, F as ot } from "./index-o0sNTcKe.js";
|
|
8
|
+
import { u as de } from "./index-Cv867SGx.js";
|
|
9
|
+
import { c as pe, R as me, A as rt, C as st, a as ct } from "./index-CAOY367Y.js";
|
|
10
|
+
import { P as at } from "./index-yR-v1A4G.js";
|
|
11
|
+
import { P as Y } from "./index-EUea2gfp.js";
|
|
12
|
+
import { P as k, d as ut } from "./index-C5wjudc-.js";
|
|
13
|
+
import { c as he, I as it, R as lt } from "./index-DulPG3F9.js";
|
|
14
|
+
import { u as q } from "./index-0ioNhtNM.js";
|
|
15
|
+
import { j as a } from "./jsx-runtime-BzflLqGi.js";
|
|
16
|
+
var $ = ["Enter", " "], dt = ["ArrowDown", "PageUp", "Home"], Ce = ["ArrowUp", "PageDown", "End"], ft = [...dt, ...Ce], pt = {
|
|
17
|
+
ltr: [...$, "ArrowRight"],
|
|
18
|
+
rtl: [...$, "ArrowLeft"]
|
|
19
|
+
}, mt = {
|
|
20
|
+
ltr: ["ArrowLeft"],
|
|
21
|
+
rtl: ["ArrowRight"]
|
|
22
|
+
}, N = "Menu", [j, ht, Ct] = ze(N), [S, Jt] = Je(N, [
|
|
23
|
+
Ct,
|
|
24
|
+
pe,
|
|
25
|
+
he
|
|
26
|
+
]), F = pe(), Me = he(), [ve, _] = S(N), [Mt, L] = S(N), ge = (e) => {
|
|
27
|
+
const { __scopeMenu: n, open: t = !1, children: r, dir: u, onOpenChange: s, modal: d = !0 } = e, m = F(n), [h, p] = o.useState(null), l = o.useRef(!1), c = q(s), f = Ze(u);
|
|
28
|
+
return o.useEffect(() => {
|
|
29
|
+
const g = () => {
|
|
30
|
+
l.current = !0, document.addEventListener("pointerdown", C, { capture: !0, once: !0 }), document.addEventListener("pointermove", C, { capture: !0, once: !0 });
|
|
31
|
+
}, C = () => l.current = !1;
|
|
32
|
+
return document.addEventListener("keydown", g, { capture: !0 }), () => {
|
|
33
|
+
document.removeEventListener("keydown", g, { capture: !0 }), document.removeEventListener("pointerdown", C, { capture: !0 }), document.removeEventListener("pointermove", C, { capture: !0 });
|
|
34
|
+
};
|
|
35
|
+
}, []), /* @__PURE__ */ a.jsx(me, { ...m, children: /* @__PURE__ */ a.jsx(
|
|
36
|
+
ve,
|
|
37
|
+
{
|
|
38
|
+
scope: n,
|
|
39
|
+
open: t,
|
|
40
|
+
onOpenChange: c,
|
|
41
|
+
content: h,
|
|
42
|
+
onContentChange: p,
|
|
43
|
+
children: /* @__PURE__ */ a.jsx(
|
|
44
|
+
Mt,
|
|
45
|
+
{
|
|
46
|
+
scope: n,
|
|
47
|
+
onClose: o.useCallback(() => c(!1), [c]),
|
|
48
|
+
isUsingKeyboardRef: l,
|
|
49
|
+
dir: f,
|
|
50
|
+
modal: d,
|
|
51
|
+
children: r
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
) });
|
|
56
|
+
};
|
|
57
|
+
ge.displayName = N;
|
|
58
|
+
var vt = "MenuAnchor", J = o.forwardRef(
|
|
59
|
+
(e, n) => {
|
|
60
|
+
const { __scopeMenu: t, ...r } = e, u = F(t);
|
|
61
|
+
return /* @__PURE__ */ a.jsx(rt, { ...u, ...r, ref: n });
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
J.displayName = vt;
|
|
65
|
+
var Q = "MenuPortal", [gt, xe] = S(Q, {
|
|
66
|
+
forceMount: void 0
|
|
67
|
+
}), _e = (e) => {
|
|
68
|
+
const { __scopeMenu: n, forceMount: t, children: r, container: u } = e, s = _(Q, n);
|
|
69
|
+
return /* @__PURE__ */ a.jsx(gt, { scope: n, forceMount: t, children: /* @__PURE__ */ a.jsx(Y, { present: t || s.open, children: /* @__PURE__ */ a.jsx(at, { asChild: !0, container: u, children: r }) }) });
|
|
70
|
+
};
|
|
71
|
+
_e.displayName = Q;
|
|
72
|
+
var x = "MenuContent", [xt, ee] = S(x), Re = o.forwardRef(
|
|
73
|
+
(e, n) => {
|
|
74
|
+
const t = xe(x, e.__scopeMenu), { forceMount: r = t.forceMount, ...u } = e, s = _(x, e.__scopeMenu), d = L(x, e.__scopeMenu);
|
|
75
|
+
return /* @__PURE__ */ a.jsx(j.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ a.jsx(Y, { present: r || s.open, children: /* @__PURE__ */ a.jsx(j.Slot, { scope: e.__scopeMenu, children: d.modal ? /* @__PURE__ */ a.jsx(_t, { ...u, ref: n }) : /* @__PURE__ */ a.jsx(Rt, { ...u, ref: n }) }) }) });
|
|
76
|
+
}
|
|
77
|
+
), _t = o.forwardRef(
|
|
78
|
+
(e, n) => {
|
|
79
|
+
const t = _(x, e.__scopeMenu), r = o.useRef(null), u = D(n, r);
|
|
80
|
+
return o.useEffect(() => {
|
|
81
|
+
const s = r.current;
|
|
82
|
+
if (s) return et(s);
|
|
83
|
+
}, []), /* @__PURE__ */ a.jsx(
|
|
84
|
+
te,
|
|
85
|
+
{
|
|
86
|
+
...e,
|
|
87
|
+
ref: u,
|
|
88
|
+
trapFocus: t.open,
|
|
89
|
+
disableOutsidePointerEvents: t.open,
|
|
90
|
+
disableOutsideScroll: !0,
|
|
91
|
+
onFocusOutside: M(
|
|
92
|
+
e.onFocusOutside,
|
|
93
|
+
(s) => s.preventDefault(),
|
|
94
|
+
{ checkForDefaultPrevented: !1 }
|
|
95
|
+
),
|
|
96
|
+
onDismiss: () => t.onOpenChange(!1)
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
), Rt = o.forwardRef((e, n) => {
|
|
101
|
+
const t = _(x, e.__scopeMenu);
|
|
102
|
+
return /* @__PURE__ */ a.jsx(
|
|
103
|
+
te,
|
|
104
|
+
{
|
|
105
|
+
...e,
|
|
106
|
+
ref: n,
|
|
107
|
+
trapFocus: !1,
|
|
108
|
+
disableOutsidePointerEvents: !1,
|
|
109
|
+
disableOutsideScroll: !1,
|
|
110
|
+
onDismiss: () => t.onOpenChange(!1)
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}), St = qe("MenuContent.ScrollLock"), te = o.forwardRef(
|
|
114
|
+
(e, n) => {
|
|
115
|
+
const {
|
|
116
|
+
__scopeMenu: t,
|
|
117
|
+
loop: r = !1,
|
|
118
|
+
trapFocus: u,
|
|
119
|
+
onOpenAutoFocus: s,
|
|
120
|
+
onCloseAutoFocus: d,
|
|
121
|
+
disableOutsidePointerEvents: m,
|
|
122
|
+
onEntryFocus: h,
|
|
123
|
+
onEscapeKeyDown: p,
|
|
124
|
+
onPointerDownOutside: l,
|
|
125
|
+
onFocusOutside: c,
|
|
126
|
+
onInteractOutside: f,
|
|
127
|
+
onDismiss: g,
|
|
128
|
+
disableOutsideScroll: C,
|
|
129
|
+
...P
|
|
130
|
+
} = e, y = _(x, t), E = L(x, t), Ge = F(t), Ue = Me(t), ce = ht(t), [Be, ae] = o.useState(null), K = o.useRef(null), Ve = D(n, K, y.onContentChange), G = o.useRef(0), U = o.useRef(""), Ye = o.useRef(0), H = o.useRef(null), ue = o.useRef("right"), W = o.useRef(0), Xe = C ? nt : o.Fragment, He = C ? { as: St, allowPinchZoom: !0 } : void 0, We = (i) => {
|
|
131
|
+
const w = U.current + i, R = ce().filter((v) => !v.disabled), b = document.activeElement, z = R.find((v) => v.ref.current === b)?.textValue, Z = R.map((v) => v.textValue), ie = kt(Z, w, z), T = R.find((v) => v.textValue === ie)?.ref.current;
|
|
132
|
+
(function v(le) {
|
|
133
|
+
U.current = le, window.clearTimeout(G.current), le !== "" && (G.current = window.setTimeout(() => v(""), 1e3));
|
|
134
|
+
})(w), T && setTimeout(() => T.focus());
|
|
135
|
+
};
|
|
136
|
+
o.useEffect(() => () => window.clearTimeout(G.current), []), tt();
|
|
137
|
+
const I = o.useCallback((i) => ue.current === H.current?.side && Ft(i, H.current?.area), []);
|
|
138
|
+
return /* @__PURE__ */ a.jsx(
|
|
139
|
+
xt,
|
|
140
|
+
{
|
|
141
|
+
scope: t,
|
|
142
|
+
searchRef: U,
|
|
143
|
+
onItemEnter: o.useCallback(
|
|
144
|
+
(i) => {
|
|
145
|
+
I(i) && i.preventDefault();
|
|
146
|
+
},
|
|
147
|
+
[I]
|
|
148
|
+
),
|
|
149
|
+
onItemLeave: o.useCallback(
|
|
150
|
+
(i) => {
|
|
151
|
+
I(i) || (K.current?.focus(), ae(null));
|
|
152
|
+
},
|
|
153
|
+
[I]
|
|
154
|
+
),
|
|
155
|
+
onTriggerLeave: o.useCallback(
|
|
156
|
+
(i) => {
|
|
157
|
+
I(i) && i.preventDefault();
|
|
158
|
+
},
|
|
159
|
+
[I]
|
|
160
|
+
),
|
|
161
|
+
pointerGraceTimerRef: Ye,
|
|
162
|
+
onPointerGraceIntentChange: o.useCallback((i) => {
|
|
163
|
+
H.current = i;
|
|
164
|
+
}, []),
|
|
165
|
+
children: /* @__PURE__ */ a.jsx(Xe, { ...He, children: /* @__PURE__ */ a.jsx(
|
|
166
|
+
ot,
|
|
167
|
+
{
|
|
168
|
+
asChild: !0,
|
|
169
|
+
trapped: u,
|
|
170
|
+
onMountAutoFocus: M(s, (i) => {
|
|
171
|
+
i.preventDefault(), K.current?.focus({ preventScroll: !0 });
|
|
172
|
+
}),
|
|
173
|
+
onUnmountAutoFocus: d,
|
|
174
|
+
children: /* @__PURE__ */ a.jsx(
|
|
175
|
+
Qe,
|
|
176
|
+
{
|
|
177
|
+
asChild: !0,
|
|
178
|
+
disableOutsidePointerEvents: m,
|
|
179
|
+
onEscapeKeyDown: p,
|
|
180
|
+
onPointerDownOutside: l,
|
|
181
|
+
onFocusOutside: c,
|
|
182
|
+
onInteractOutside: f,
|
|
183
|
+
onDismiss: g,
|
|
184
|
+
children: /* @__PURE__ */ a.jsx(
|
|
185
|
+
lt,
|
|
186
|
+
{
|
|
187
|
+
asChild: !0,
|
|
188
|
+
...Ue,
|
|
189
|
+
dir: E.dir,
|
|
190
|
+
orientation: "vertical",
|
|
191
|
+
loop: r,
|
|
192
|
+
currentTabStopId: Be,
|
|
193
|
+
onCurrentTabStopIdChange: ae,
|
|
194
|
+
onEntryFocus: M(h, (i) => {
|
|
195
|
+
E.isUsingKeyboardRef.current || i.preventDefault();
|
|
196
|
+
}),
|
|
197
|
+
preventScrollOnEntryFocus: !0,
|
|
198
|
+
children: /* @__PURE__ */ a.jsx(
|
|
199
|
+
st,
|
|
200
|
+
{
|
|
201
|
+
role: "menu",
|
|
202
|
+
"aria-orientation": "vertical",
|
|
203
|
+
"data-state": Ke(y.open),
|
|
204
|
+
"data-radix-menu-content": "",
|
|
205
|
+
dir: E.dir,
|
|
206
|
+
...Ge,
|
|
207
|
+
...P,
|
|
208
|
+
ref: Ve,
|
|
209
|
+
style: { outline: "none", ...P.style },
|
|
210
|
+
onKeyDown: M(P.onKeyDown, (i) => {
|
|
211
|
+
const R = i.target.closest("[data-radix-menu-content]") === i.currentTarget, b = i.ctrlKey || i.altKey || i.metaKey, z = i.key.length === 1;
|
|
212
|
+
R && (i.key === "Tab" && i.preventDefault(), !b && z && We(i.key));
|
|
213
|
+
const Z = K.current;
|
|
214
|
+
if (i.target !== Z || !ft.includes(i.key)) return;
|
|
215
|
+
i.preventDefault();
|
|
216
|
+
const T = ce().filter((v) => !v.disabled).map((v) => v.ref.current);
|
|
217
|
+
Ce.includes(i.key) && T.reverse(), Ot(T);
|
|
218
|
+
}),
|
|
219
|
+
onBlur: M(e.onBlur, (i) => {
|
|
220
|
+
i.currentTarget.contains(i.target) || (window.clearTimeout(G.current), U.current = "");
|
|
221
|
+
}),
|
|
222
|
+
onPointerMove: M(
|
|
223
|
+
e.onPointerMove,
|
|
224
|
+
O((i) => {
|
|
225
|
+
const w = i.target, R = W.current !== i.clientX;
|
|
226
|
+
if (i.currentTarget.contains(w) && R) {
|
|
227
|
+
const b = i.clientX > W.current ? "right" : "left";
|
|
228
|
+
ue.current = b, W.current = i.clientX;
|
|
229
|
+
}
|
|
230
|
+
})
|
|
231
|
+
)
|
|
232
|
+
}
|
|
233
|
+
)
|
|
234
|
+
}
|
|
235
|
+
)
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
}
|
|
239
|
+
) })
|
|
240
|
+
}
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
);
|
|
244
|
+
Re.displayName = x;
|
|
245
|
+
var Pt = "MenuGroup", ne = o.forwardRef(
|
|
246
|
+
(e, n) => {
|
|
247
|
+
const { __scopeMenu: t, ...r } = e;
|
|
248
|
+
return /* @__PURE__ */ a.jsx(k.div, { role: "group", ...r, ref: n });
|
|
249
|
+
}
|
|
250
|
+
);
|
|
251
|
+
ne.displayName = Pt;
|
|
252
|
+
var Et = "MenuLabel", Se = o.forwardRef(
|
|
253
|
+
(e, n) => {
|
|
254
|
+
const { __scopeMenu: t, ...r } = e;
|
|
255
|
+
return /* @__PURE__ */ a.jsx(k.div, { ...r, ref: n });
|
|
256
|
+
}
|
|
257
|
+
);
|
|
258
|
+
Se.displayName = Et;
|
|
259
|
+
var B = "MenuItem", fe = "menu.itemSelect", X = o.forwardRef(
|
|
260
|
+
(e, n) => {
|
|
261
|
+
const { disabled: t = !1, onSelect: r, ...u } = e, s = o.useRef(null), d = L(B, e.__scopeMenu), m = ee(B, e.__scopeMenu), h = D(n, s), p = o.useRef(!1), l = () => {
|
|
262
|
+
const c = s.current;
|
|
263
|
+
if (!t && c) {
|
|
264
|
+
const f = new CustomEvent(fe, { bubbles: !0, cancelable: !0 });
|
|
265
|
+
c.addEventListener(fe, (g) => r?.(g), { once: !0 }), ut(c, f), f.defaultPrevented ? p.current = !1 : d.onClose();
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
return /* @__PURE__ */ a.jsx(
|
|
269
|
+
Pe,
|
|
270
|
+
{
|
|
271
|
+
...u,
|
|
272
|
+
ref: h,
|
|
273
|
+
disabled: t,
|
|
274
|
+
onClick: M(e.onClick, l),
|
|
275
|
+
onPointerDown: (c) => {
|
|
276
|
+
e.onPointerDown?.(c), p.current = !0;
|
|
277
|
+
},
|
|
278
|
+
onPointerUp: M(e.onPointerUp, (c) => {
|
|
279
|
+
p.current || c.currentTarget?.click();
|
|
280
|
+
}),
|
|
281
|
+
onKeyDown: M(e.onKeyDown, (c) => {
|
|
282
|
+
const f = m.searchRef.current !== "";
|
|
283
|
+
t || f && c.key === " " || $.includes(c.key) && (c.currentTarget.click(), c.preventDefault());
|
|
284
|
+
})
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
X.displayName = B;
|
|
290
|
+
var Pe = o.forwardRef(
|
|
291
|
+
(e, n) => {
|
|
292
|
+
const { __scopeMenu: t, disabled: r = !1, textValue: u, ...s } = e, d = ee(B, t), m = Me(t), h = o.useRef(null), p = D(n, h), [l, c] = o.useState(!1), [f, g] = o.useState("");
|
|
293
|
+
return o.useEffect(() => {
|
|
294
|
+
const C = h.current;
|
|
295
|
+
C && g((C.textContent ?? "").trim());
|
|
296
|
+
}, [s.children]), /* @__PURE__ */ a.jsx(
|
|
297
|
+
j.ItemSlot,
|
|
298
|
+
{
|
|
299
|
+
scope: t,
|
|
300
|
+
disabled: r,
|
|
301
|
+
textValue: u ?? f,
|
|
302
|
+
children: /* @__PURE__ */ a.jsx(it, { asChild: !0, ...m, focusable: !r, children: /* @__PURE__ */ a.jsx(
|
|
303
|
+
k.div,
|
|
304
|
+
{
|
|
305
|
+
role: "menuitem",
|
|
306
|
+
"data-highlighted": l ? "" : void 0,
|
|
307
|
+
"aria-disabled": r || void 0,
|
|
308
|
+
"data-disabled": r ? "" : void 0,
|
|
309
|
+
...s,
|
|
310
|
+
ref: p,
|
|
311
|
+
onPointerMove: M(
|
|
312
|
+
e.onPointerMove,
|
|
313
|
+
O((C) => {
|
|
314
|
+
r ? d.onItemLeave(C) : (d.onItemEnter(C), C.defaultPrevented || C.currentTarget.focus({ preventScroll: !0 }));
|
|
315
|
+
})
|
|
316
|
+
),
|
|
317
|
+
onPointerLeave: M(
|
|
318
|
+
e.onPointerLeave,
|
|
319
|
+
O((C) => d.onItemLeave(C))
|
|
320
|
+
),
|
|
321
|
+
onFocus: M(e.onFocus, () => c(!0)),
|
|
322
|
+
onBlur: M(e.onBlur, () => c(!1))
|
|
323
|
+
}
|
|
324
|
+
) })
|
|
325
|
+
}
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
), It = "MenuCheckboxItem", Ee = o.forwardRef(
|
|
329
|
+
(e, n) => {
|
|
330
|
+
const { checked: t = !1, onCheckedChange: r, ...u } = e;
|
|
331
|
+
return /* @__PURE__ */ a.jsx(Te, { scope: e.__scopeMenu, checked: t, children: /* @__PURE__ */ a.jsx(
|
|
332
|
+
X,
|
|
333
|
+
{
|
|
334
|
+
role: "menuitemcheckbox",
|
|
335
|
+
"aria-checked": V(t) ? "mixed" : t,
|
|
336
|
+
...u,
|
|
337
|
+
ref: n,
|
|
338
|
+
"data-state": se(t),
|
|
339
|
+
onSelect: M(
|
|
340
|
+
u.onSelect,
|
|
341
|
+
() => r?.(V(t) ? !0 : !t),
|
|
342
|
+
{ checkForDefaultPrevented: !1 }
|
|
343
|
+
)
|
|
344
|
+
}
|
|
345
|
+
) });
|
|
346
|
+
}
|
|
347
|
+
);
|
|
348
|
+
Ee.displayName = It;
|
|
349
|
+
var Ie = "MenuRadioGroup", [wt, yt] = S(
|
|
350
|
+
Ie,
|
|
351
|
+
{ value: void 0, onValueChange: () => {
|
|
352
|
+
} }
|
|
353
|
+
), we = o.forwardRef(
|
|
354
|
+
(e, n) => {
|
|
355
|
+
const { value: t, onValueChange: r, ...u } = e, s = q(r);
|
|
356
|
+
return /* @__PURE__ */ a.jsx(wt, { scope: e.__scopeMenu, value: t, onValueChange: s, children: /* @__PURE__ */ a.jsx(ne, { ...u, ref: n }) });
|
|
357
|
+
}
|
|
358
|
+
);
|
|
359
|
+
we.displayName = Ie;
|
|
360
|
+
var ye = "MenuRadioItem", be = o.forwardRef(
|
|
361
|
+
(e, n) => {
|
|
362
|
+
const { value: t, ...r } = e, u = yt(ye, e.__scopeMenu), s = t === u.value;
|
|
363
|
+
return /* @__PURE__ */ a.jsx(Te, { scope: e.__scopeMenu, checked: s, children: /* @__PURE__ */ a.jsx(
|
|
364
|
+
X,
|
|
365
|
+
{
|
|
366
|
+
role: "menuitemradio",
|
|
367
|
+
"aria-checked": s,
|
|
368
|
+
...r,
|
|
369
|
+
ref: n,
|
|
370
|
+
"data-state": se(s),
|
|
371
|
+
onSelect: M(
|
|
372
|
+
r.onSelect,
|
|
373
|
+
() => u.onValueChange?.(t),
|
|
374
|
+
{ checkForDefaultPrevented: !1 }
|
|
375
|
+
)
|
|
376
|
+
}
|
|
377
|
+
) });
|
|
378
|
+
}
|
|
379
|
+
);
|
|
380
|
+
be.displayName = ye;
|
|
381
|
+
var oe = "MenuItemIndicator", [Te, bt] = S(
|
|
382
|
+
oe,
|
|
383
|
+
{ checked: !1 }
|
|
384
|
+
), Ae = o.forwardRef(
|
|
385
|
+
(e, n) => {
|
|
386
|
+
const { __scopeMenu: t, forceMount: r, ...u } = e, s = bt(oe, t);
|
|
387
|
+
return /* @__PURE__ */ a.jsx(
|
|
388
|
+
Y,
|
|
389
|
+
{
|
|
390
|
+
present: r || V(s.checked) || s.checked === !0,
|
|
391
|
+
children: /* @__PURE__ */ a.jsx(
|
|
392
|
+
k.span,
|
|
393
|
+
{
|
|
394
|
+
...u,
|
|
395
|
+
ref: n,
|
|
396
|
+
"data-state": se(s.checked)
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
}
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
);
|
|
403
|
+
Ae.displayName = oe;
|
|
404
|
+
var Tt = "MenuSeparator", je = o.forwardRef(
|
|
405
|
+
(e, n) => {
|
|
406
|
+
const { __scopeMenu: t, ...r } = e;
|
|
407
|
+
return /* @__PURE__ */ a.jsx(
|
|
408
|
+
k.div,
|
|
409
|
+
{
|
|
410
|
+
role: "separator",
|
|
411
|
+
"aria-orientation": "horizontal",
|
|
412
|
+
...r,
|
|
413
|
+
ref: n
|
|
414
|
+
}
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
);
|
|
418
|
+
je.displayName = Tt;
|
|
419
|
+
var At = "MenuArrow", Oe = o.forwardRef(
|
|
420
|
+
(e, n) => {
|
|
421
|
+
const { __scopeMenu: t, ...r } = e, u = F(t);
|
|
422
|
+
return /* @__PURE__ */ a.jsx(ct, { ...u, ...r, ref: n });
|
|
423
|
+
}
|
|
424
|
+
);
|
|
425
|
+
Oe.displayName = At;
|
|
426
|
+
var re = "MenuSub", [jt, De] = S(re), ke = (e) => {
|
|
427
|
+
const { __scopeMenu: n, children: t, open: r = !1, onOpenChange: u } = e, s = _(re, n), d = F(n), [m, h] = o.useState(null), [p, l] = o.useState(null), c = q(u);
|
|
428
|
+
return o.useEffect(() => (s.open === !1 && c(!1), () => c(!1)), [s.open, c]), /* @__PURE__ */ a.jsx(me, { ...d, children: /* @__PURE__ */ a.jsx(
|
|
429
|
+
ve,
|
|
430
|
+
{
|
|
431
|
+
scope: n,
|
|
432
|
+
open: r,
|
|
433
|
+
onOpenChange: c,
|
|
434
|
+
content: p,
|
|
435
|
+
onContentChange: l,
|
|
436
|
+
children: /* @__PURE__ */ a.jsx(
|
|
437
|
+
jt,
|
|
438
|
+
{
|
|
439
|
+
scope: n,
|
|
440
|
+
contentId: de(),
|
|
441
|
+
triggerId: de(),
|
|
442
|
+
trigger: m,
|
|
443
|
+
onTriggerChange: h,
|
|
444
|
+
children: t
|
|
445
|
+
}
|
|
446
|
+
)
|
|
447
|
+
}
|
|
448
|
+
) });
|
|
449
|
+
};
|
|
450
|
+
ke.displayName = re;
|
|
451
|
+
var A = "MenuSubTrigger", Ne = o.forwardRef(
|
|
452
|
+
(e, n) => {
|
|
453
|
+
const t = _(A, e.__scopeMenu), r = L(A, e.__scopeMenu), u = De(A, e.__scopeMenu), s = ee(A, e.__scopeMenu), d = o.useRef(null), { pointerGraceTimerRef: m, onPointerGraceIntentChange: h } = s, p = { __scopeMenu: e.__scopeMenu }, l = o.useCallback(() => {
|
|
454
|
+
d.current && window.clearTimeout(d.current), d.current = null;
|
|
455
|
+
}, []);
|
|
456
|
+
return o.useEffect(() => l, [l]), o.useEffect(() => {
|
|
457
|
+
const c = m.current;
|
|
458
|
+
return () => {
|
|
459
|
+
window.clearTimeout(c), h(null);
|
|
460
|
+
};
|
|
461
|
+
}, [m, h]), /* @__PURE__ */ a.jsx(J, { asChild: !0, ...p, children: /* @__PURE__ */ a.jsx(
|
|
462
|
+
Pe,
|
|
463
|
+
{
|
|
464
|
+
id: u.triggerId,
|
|
465
|
+
"aria-haspopup": "menu",
|
|
466
|
+
"aria-expanded": t.open,
|
|
467
|
+
"aria-controls": u.contentId,
|
|
468
|
+
"data-state": Ke(t.open),
|
|
469
|
+
...e,
|
|
470
|
+
ref: $e(n, u.onTriggerChange),
|
|
471
|
+
onClick: (c) => {
|
|
472
|
+
e.onClick?.(c), !(e.disabled || c.defaultPrevented) && (c.currentTarget.focus(), t.open || t.onOpenChange(!0));
|
|
473
|
+
},
|
|
474
|
+
onPointerMove: M(
|
|
475
|
+
e.onPointerMove,
|
|
476
|
+
O((c) => {
|
|
477
|
+
s.onItemEnter(c), !c.defaultPrevented && !e.disabled && !t.open && !d.current && (s.onPointerGraceIntentChange(null), d.current = window.setTimeout(() => {
|
|
478
|
+
t.onOpenChange(!0), l();
|
|
479
|
+
}, 100));
|
|
480
|
+
})
|
|
481
|
+
),
|
|
482
|
+
onPointerLeave: M(
|
|
483
|
+
e.onPointerLeave,
|
|
484
|
+
O((c) => {
|
|
485
|
+
l();
|
|
486
|
+
const f = t.content?.getBoundingClientRect();
|
|
487
|
+
if (f) {
|
|
488
|
+
const g = t.content?.dataset.side, C = g === "right", P = C ? -5 : 5, y = f[C ? "left" : "right"], E = f[C ? "right" : "left"];
|
|
489
|
+
s.onPointerGraceIntentChange({
|
|
490
|
+
area: [
|
|
491
|
+
// Apply a bleed on clientX to ensure that our exit point is
|
|
492
|
+
// consistently within polygon bounds
|
|
493
|
+
{ x: c.clientX + P, y: c.clientY },
|
|
494
|
+
{ x: y, y: f.top },
|
|
495
|
+
{ x: E, y: f.top },
|
|
496
|
+
{ x: E, y: f.bottom },
|
|
497
|
+
{ x: y, y: f.bottom }
|
|
498
|
+
],
|
|
499
|
+
side: g
|
|
500
|
+
}), window.clearTimeout(m.current), m.current = window.setTimeout(
|
|
501
|
+
() => s.onPointerGraceIntentChange(null),
|
|
502
|
+
300
|
|
503
|
+
);
|
|
504
|
+
} else {
|
|
505
|
+
if (s.onTriggerLeave(c), c.defaultPrevented) return;
|
|
506
|
+
s.onPointerGraceIntentChange(null);
|
|
507
|
+
}
|
|
508
|
+
})
|
|
509
|
+
),
|
|
510
|
+
onKeyDown: M(e.onKeyDown, (c) => {
|
|
511
|
+
const f = s.searchRef.current !== "";
|
|
512
|
+
e.disabled || f && c.key === " " || pt[r.dir].includes(c.key) && (t.onOpenChange(!0), t.content?.focus(), c.preventDefault());
|
|
513
|
+
})
|
|
514
|
+
}
|
|
515
|
+
) });
|
|
516
|
+
}
|
|
517
|
+
);
|
|
518
|
+
Ne.displayName = A;
|
|
519
|
+
var Fe = "MenuSubContent", Le = o.forwardRef(
|
|
520
|
+
(e, n) => {
|
|
521
|
+
const t = xe(x, e.__scopeMenu), { forceMount: r = t.forceMount, ...u } = e, s = _(x, e.__scopeMenu), d = L(x, e.__scopeMenu), m = De(Fe, e.__scopeMenu), h = o.useRef(null), p = D(n, h);
|
|
522
|
+
return /* @__PURE__ */ a.jsx(j.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ a.jsx(Y, { present: r || s.open, children: /* @__PURE__ */ a.jsx(j.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ a.jsx(
|
|
523
|
+
te,
|
|
524
|
+
{
|
|
525
|
+
id: m.contentId,
|
|
526
|
+
"aria-labelledby": m.triggerId,
|
|
527
|
+
...u,
|
|
528
|
+
ref: p,
|
|
529
|
+
align: "start",
|
|
530
|
+
side: d.dir === "rtl" ? "left" : "right",
|
|
531
|
+
disableOutsidePointerEvents: !1,
|
|
532
|
+
disableOutsideScroll: !1,
|
|
533
|
+
trapFocus: !1,
|
|
534
|
+
onOpenAutoFocus: (l) => {
|
|
535
|
+
d.isUsingKeyboardRef.current && h.current?.focus(), l.preventDefault();
|
|
536
|
+
},
|
|
537
|
+
onCloseAutoFocus: (l) => l.preventDefault(),
|
|
538
|
+
onFocusOutside: M(e.onFocusOutside, (l) => {
|
|
539
|
+
l.target !== m.trigger && s.onOpenChange(!1);
|
|
540
|
+
}),
|
|
541
|
+
onEscapeKeyDown: M(e.onEscapeKeyDown, (l) => {
|
|
542
|
+
d.onClose(), l.preventDefault();
|
|
543
|
+
}),
|
|
544
|
+
onKeyDown: M(e.onKeyDown, (l) => {
|
|
545
|
+
const c = l.currentTarget.contains(l.target), f = mt[d.dir].includes(l.key);
|
|
546
|
+
c && f && (s.onOpenChange(!1), m.trigger?.focus(), l.preventDefault());
|
|
547
|
+
})
|
|
548
|
+
}
|
|
549
|
+
) }) }) });
|
|
550
|
+
}
|
|
551
|
+
);
|
|
552
|
+
Le.displayName = Fe;
|
|
553
|
+
function Ke(e) {
|
|
554
|
+
return e ? "open" : "closed";
|
|
555
|
+
}
|
|
556
|
+
function V(e) {
|
|
557
|
+
return e === "indeterminate";
|
|
558
|
+
}
|
|
559
|
+
function se(e) {
|
|
560
|
+
return V(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
561
|
+
}
|
|
562
|
+
function Ot(e) {
|
|
563
|
+
const n = document.activeElement;
|
|
564
|
+
for (const t of e)
|
|
565
|
+
if (t === n || (t.focus(), document.activeElement !== n)) return;
|
|
566
|
+
}
|
|
567
|
+
function Dt(e, n) {
|
|
568
|
+
return e.map((t, r) => e[(n + r) % e.length]);
|
|
569
|
+
}
|
|
570
|
+
function kt(e, n, t) {
|
|
571
|
+
const u = n.length > 1 && Array.from(n).every((p) => p === n[0]) ? n[0] : n, s = t ? e.indexOf(t) : -1;
|
|
572
|
+
let d = Dt(e, Math.max(s, 0));
|
|
573
|
+
u.length === 1 && (d = d.filter((p) => p !== t));
|
|
574
|
+
const h = d.find(
|
|
575
|
+
(p) => p.toLowerCase().startsWith(u.toLowerCase())
|
|
576
|
+
);
|
|
577
|
+
return h !== t ? h : void 0;
|
|
578
|
+
}
|
|
579
|
+
function Nt(e, n) {
|
|
580
|
+
const { x: t, y: r } = e;
|
|
581
|
+
let u = !1;
|
|
582
|
+
for (let s = 0, d = n.length - 1; s < n.length; d = s++) {
|
|
583
|
+
const m = n[s], h = n[d], p = m.x, l = m.y, c = h.x, f = h.y;
|
|
584
|
+
l > r != f > r && t < (c - p) * (r - l) / (f - l) + p && (u = !u);
|
|
585
|
+
}
|
|
586
|
+
return u;
|
|
587
|
+
}
|
|
588
|
+
function Ft(e, n) {
|
|
589
|
+
if (!n) return !1;
|
|
590
|
+
const t = { x: e.clientX, y: e.clientY };
|
|
591
|
+
return Nt(t, n);
|
|
592
|
+
}
|
|
593
|
+
function O(e) {
|
|
594
|
+
return (n) => n.pointerType === "mouse" ? e(n) : void 0;
|
|
595
|
+
}
|
|
596
|
+
var Qt = ge, en = J, tn = _e, nn = Re, on = ne, rn = Se, sn = X, cn = Ee, an = we, un = be, ln = Ae, dn = je, fn = Oe, pn = ke, mn = Ne, hn = Le;
|
|
597
|
+
export {
|
|
598
|
+
en as A,
|
|
599
|
+
nn as C,
|
|
600
|
+
on as G,
|
|
601
|
+
sn as I,
|
|
602
|
+
rn as L,
|
|
603
|
+
tn as P,
|
|
604
|
+
Qt as R,
|
|
605
|
+
dn as S,
|
|
606
|
+
cn as a,
|
|
607
|
+
ln as b,
|
|
608
|
+
Jt as c,
|
|
609
|
+
un as d,
|
|
610
|
+
pn as e,
|
|
611
|
+
hn as f,
|
|
612
|
+
mn as g,
|
|
613
|
+
an as h,
|
|
614
|
+
fn as i
|
|
615
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import { u as a } from "./index-CCKe-Mpx.js";
|
|
3
|
+
var s = r[" useId ".trim().toString()] || (() => {
|
|
4
|
+
}), i = 0;
|
|
5
|
+
function n(e) {
|
|
6
|
+
const [t, o] = r.useState(s());
|
|
7
|
+
return a(() => {
|
|
8
|
+
o((u) => u ?? String(i++));
|
|
9
|
+
}, [e]), t ? `radix-${t}` : "";
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
n as u
|
|
13
|
+
};
|