ivt 0.2.8 → 0.3.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/dist/accordion/index.mjs +1 -1
- package/dist/alert/index.mjs +1 -1
- package/dist/alert-dialog/index.mjs +1 -1
- package/dist/avatar/index.mjs +1 -1
- package/dist/badge/index.d.ts +1 -1
- package/dist/badge/index.mjs +1 -1
- package/dist/base/index.mjs +1 -1
- package/dist/base/index.mjs.map +1 -1
- package/dist/button/index.mjs +1 -1
- package/dist/calendar/index.mjs +1 -1
- package/dist/card/index.mjs +1 -1
- package/dist/chart/index.mjs +1 -1
- package/dist/checkbox/index.mjs +1 -1
- package/dist/chunks/{_commonjsHelpers-Bjj-JKBe.mjs → _commonjsHelpers-CGOCqDTk.mjs} +1 -1
- package/dist/chunks/_commonjsHelpers-CGOCqDTk.mjs.map +1 -0
- package/dist/chunks/{accordion-Dl9OR3bi.mjs → accordion-DN_eyopq.mjs} +2 -2
- package/dist/chunks/{accordion-Dl9OR3bi.mjs.map → accordion-DN_eyopq.mjs.map} +1 -1
- package/dist/chunks/badge-Dk_-nk4S.mjs +2 -0
- package/dist/chunks/badge-Dk_-nk4S.mjs.map +1 -0
- package/dist/chunks/{bundle-mjs-DRUwh-0R.mjs → bundle-mjs-DHbvkKp4.mjs} +1 -1
- package/dist/chunks/{bundle-mjs-DRUwh-0R.mjs.map → bundle-mjs-DHbvkKp4.mjs.map} +1 -1
- package/dist/chunks/{button-Dhe5fFAk.mjs → button-CWf6NSDH.mjs} +2 -2
- package/dist/chunks/{button-Dhe5fFAk.mjs.map → button-CWf6NSDH.mjs.map} +1 -1
- package/dist/chunks/{calendar-CvUHWFGI.mjs → calendar-BYf_WZdn.mjs} +2 -2
- package/dist/chunks/{calendar-CvUHWFGI.mjs.map → calendar-BYf_WZdn.mjs.map} +1 -1
- package/dist/chunks/check-PTeDoR8O.mjs +2 -0
- package/dist/chunks/{check-CTdDPXjk.mjs.map → check-PTeDoR8O.mjs.map} +1 -1
- package/dist/chunks/chevron-down-CxCeX9iY.mjs +2 -0
- package/dist/chunks/{chevron-down-DDHw_qmV.mjs.map → chevron-down-CxCeX9iY.mjs.map} +1 -1
- package/dist/chunks/chevron-left-uN3-P_oe.mjs +2 -0
- package/dist/chunks/{chevron-left-CjUEKmgQ.mjs.map → chevron-left-uN3-P_oe.mjs.map} +1 -1
- package/dist/chunks/chevron-right-2gS0EXq0.mjs +2 -0
- package/dist/chunks/{chevron-right-BaRUY2Lm.mjs.map → chevron-right-2gS0EXq0.mjs.map} +1 -1
- package/dist/chunks/circle-Dt7_dwrq.mjs +2 -0
- package/dist/chunks/{circle-B6AT9LZB.mjs.map → circle-Dt7_dwrq.mjs.map} +1 -1
- package/dist/chunks/{command-B20MmNTS.mjs → command-uwBExuyh.mjs} +2 -2
- package/dist/chunks/{command-B20MmNTS.mjs.map → command-uwBExuyh.mjs.map} +1 -1
- package/dist/chunks/{createLucideIcon-Bub0IDlo.mjs → createLucideIcon-D1jKv6AP.mjs} +1 -1
- package/dist/chunks/{createLucideIcon-Bub0IDlo.mjs.map → createLucideIcon-D1jKv6AP.mjs.map} +1 -1
- package/dist/chunks/{dialog-DvFOk-pv.mjs → dialog-Dxotsves.mjs} +2 -2
- package/dist/chunks/{dialog-DvFOk-pv.mjs.map → dialog-Dxotsves.mjs.map} +1 -1
- package/dist/chunks/{hover-card-D8uFTCNm.mjs → hover-card-Bxo5Wv81.mjs} +2 -2
- package/dist/chunks/{hover-card-D8uFTCNm.mjs.map → hover-card-Bxo5Wv81.mjs.map} +1 -1
- package/dist/chunks/{index-DZgHf-gI.mjs → index-0-u0cdz8.mjs} +1 -1
- package/dist/chunks/{index-DZgHf-gI.mjs.map → index-0-u0cdz8.mjs.map} +1 -1
- package/dist/chunks/{index-B7nzlBcT.mjs → index-1xuBLrml.mjs} +2 -2
- package/dist/chunks/{index-B7nzlBcT.mjs.map → index-1xuBLrml.mjs.map} +1 -1
- package/dist/chunks/{index-0ahJ1Q21.mjs → index-9IZ9Aw1I.mjs} +2 -2
- package/dist/chunks/{index-0ahJ1Q21.mjs.map → index-9IZ9Aw1I.mjs.map} +1 -1
- package/dist/chunks/{index-VuwFoF4R.mjs → index-BOUg6o32.mjs} +2 -2
- package/dist/chunks/{index-VuwFoF4R.mjs.map → index-BOUg6o32.mjs.map} +1 -1
- package/dist/chunks/{index-czDftnY4.mjs → index-BekjHCXg.mjs} +2 -2
- package/dist/chunks/{index-czDftnY4.mjs.map → index-BekjHCXg.mjs.map} +1 -1
- package/dist/chunks/{index-DmBXPUeL.mjs → index-C-j8pU3U.mjs} +1 -1
- package/dist/chunks/{index-DmBXPUeL.mjs.map → index-C-j8pU3U.mjs.map} +1 -1
- package/dist/chunks/{index-C4C3l5WF.mjs → index-CKqioLrK.mjs} +2 -2
- package/dist/chunks/{index-C4C3l5WF.mjs.map → index-CKqioLrK.mjs.map} +1 -1
- package/dist/chunks/{index-GOFmxCuq.mjs → index-C_Mk3Jfk.mjs} +2 -2
- package/dist/chunks/{index-GOFmxCuq.mjs.map → index-C_Mk3Jfk.mjs.map} +1 -1
- package/dist/chunks/{index-DheYAHt3.mjs → index-CmQIO6_E.mjs} +1 -1
- package/dist/chunks/{index-DheYAHt3.mjs.map → index-CmQIO6_E.mjs.map} +1 -1
- package/dist/chunks/{index-gfwlB8lL.mjs → index-CnLJ482V.mjs} +2 -2
- package/dist/chunks/{index-gfwlB8lL.mjs.map → index-CnLJ482V.mjs.map} +1 -1
- package/dist/chunks/{index-BOWDavn2.mjs → index-D1EuiH1M.mjs} +2 -2
- package/dist/chunks/{index-BOWDavn2.mjs.map → index-D1EuiH1M.mjs.map} +1 -1
- package/dist/chunks/{index-Bt73Afz2.mjs → index-DBjm5RwN.mjs} +1 -1
- package/dist/chunks/{index-Bt73Afz2.mjs.map → index-DBjm5RwN.mjs.map} +1 -1
- package/dist/chunks/{index-Cu6LwID6.mjs → index-DSUHCtxx.mjs} +1 -1
- package/dist/chunks/{index-Cu6LwID6.mjs.map → index-DSUHCtxx.mjs.map} +1 -1
- package/dist/chunks/{index-CaYe_hNP.mjs → index-DVnblQ-a.mjs} +1 -1
- package/dist/chunks/{index-CaYe_hNP.mjs.map → index-DVnblQ-a.mjs.map} +1 -1
- package/dist/chunks/{index-DuDVR7ID.mjs → index-DiPp8h7C.mjs} +1 -1
- package/dist/chunks/{index-DuDVR7ID.mjs.map → index-DiPp8h7C.mjs.map} +1 -1
- package/dist/chunks/{index-DBp_Gx1M.mjs → index-Dr5ObK3L.mjs} +1 -1
- package/dist/chunks/{index-DBp_Gx1M.mjs.map → index-Dr5ObK3L.mjs.map} +1 -1
- package/dist/chunks/{index-Bo9g9ZHj.mjs → index-DtZD7YmJ.mjs} +2 -2
- package/dist/chunks/{index-Bo9g9ZHj.mjs.map → index-DtZD7YmJ.mjs.map} +1 -1
- package/dist/chunks/{index-Bv09gbbz.mjs → index-DzFekr2h.mjs} +1 -1
- package/dist/chunks/{index-Bv09gbbz.mjs.map → index-DzFekr2h.mjs.map} +1 -1
- package/dist/chunks/{index-ZCQr-O7f.mjs → index-UQBMY2z8.mjs} +2 -2
- package/dist/chunks/{index-ZCQr-O7f.mjs.map → index-UQBMY2z8.mjs.map} +1 -1
- package/dist/chunks/{index-CzTsDkbO.mjs → index-lVEpnR8T.mjs} +2 -2
- package/dist/chunks/{index-CzTsDkbO.mjs.map → index-lVEpnR8T.mjs.map} +1 -1
- package/dist/chunks/{input-DnILT0JB.mjs → input-DEBRXIRa.mjs} +2 -2
- package/dist/chunks/{input-DnILT0JB.mjs.map → input-DEBRXIRa.mjs.map} +1 -1
- package/dist/chunks/{label-C4MbS7O2.mjs → label-DvclHXFl.mjs} +2 -2
- package/dist/chunks/{label-C4MbS7O2.mjs.map → label-DvclHXFl.mjs.map} +1 -1
- package/dist/chunks/{pagination-BvnQsAX6.mjs → pagination-BaeImhHS.mjs} +2 -2
- package/dist/chunks/{pagination-BvnQsAX6.mjs.map → pagination-BaeImhHS.mjs.map} +1 -1
- package/dist/chunks/{popover-CLYjD1Mz.mjs → popover-DLVlIkos.mjs} +2 -2
- package/dist/chunks/{popover-CLYjD1Mz.mjs.map → popover-DLVlIkos.mjs.map} +1 -1
- package/dist/chunks/{progress-B7e979vj.mjs → progress-BnhpFugV.mjs} +2 -2
- package/dist/chunks/{progress-B7e979vj.mjs.map → progress-BnhpFugV.mjs.map} +1 -1
- package/dist/chunks/{scroll-area-DeP5Jei7.mjs → scroll-area-B0imXKzn.mjs} +2 -2
- package/dist/chunks/{scroll-area-DeP5Jei7.mjs.map → scroll-area-B0imXKzn.mjs.map} +1 -1
- package/dist/chunks/{select-BdrpNh7G.mjs → select-BKDPXdmT.mjs} +2 -2
- package/dist/chunks/{select-BdrpNh7G.mjs.map → select-BKDPXdmT.mjs.map} +1 -1
- package/dist/chunks/{separator-DbIrm4r-.mjs → separator-BvKHt1fs.mjs} +2 -2
- package/dist/chunks/{separator-DbIrm4r-.mjs.map → separator-BvKHt1fs.mjs.map} +1 -1
- package/dist/chunks/{skeleton-j85jApz0.mjs → skeleton-CkxzXYw_.mjs} +2 -2
- package/dist/chunks/{skeleton-j85jApz0.mjs.map → skeleton-CkxzXYw_.mjs.map} +1 -1
- package/dist/chunks/{sortable-D6tXnjgL.mjs → sortable-DQWkBD0j.mjs} +2 -2
- package/dist/chunks/{sortable-D6tXnjgL.mjs.map → sortable-DQWkBD0j.mjs.map} +1 -1
- package/dist/chunks/{table-BsrKQPpM.mjs → table-70kXrlUN.mjs} +2 -2
- package/dist/chunks/{table-BsrKQPpM.mjs.map → table-70kXrlUN.mjs.map} +1 -1
- package/dist/chunks/{toggle-DFi2H45K.mjs → toggle-zGLA0JZ_.mjs} +2 -2
- package/dist/chunks/{toggle-DFi2H45K.mjs.map → toggle-zGLA0JZ_.mjs.map} +1 -1
- package/dist/chunks/{tslib.es6-mR5Ag05r.mjs → tslib.es6-Bvey-QDo.mjs} +1 -1
- package/dist/chunks/{tslib.es6-mR5Ag05r.mjs.map → tslib.es6-Bvey-QDo.mjs.map} +1 -1
- package/dist/chunks/{utils-C1EKaz-p.mjs → utils-C-nkZ_Ir.mjs} +2 -2
- package/dist/chunks/{utils-C1EKaz-p.mjs.map → utils-C-nkZ_Ir.mjs.map} +1 -1
- package/dist/chunks/x-COocN1ks.mjs +2 -0
- package/dist/chunks/{x-B1PdcxpA.mjs.map → x-COocN1ks.mjs.map} +1 -1
- package/dist/combobox/index.mjs +1 -1
- package/dist/command/index.mjs +1 -1
- package/dist/data-table/index.mjs +1 -1
- package/dist/dialog/index.mjs +1 -1
- package/dist/dropdown-menu/index.mjs +1 -1
- package/dist/dropzone/index.mjs +1 -1
- package/dist/form/index.mjs +1 -1
- package/dist/hover-card/index.mjs +1 -1
- package/dist/icon/index.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/input/index.mjs +1 -1
- package/dist/ivt.css +1 -1
- package/dist/label/index.mjs +1 -1
- package/dist/menubar/index.mjs +1 -1
- package/dist/multi-select/index.mjs +1 -1
- package/dist/pagination/index.mjs +1 -1
- package/dist/popover/index.mjs +1 -1
- package/dist/progress/index.mjs +1 -1
- package/dist/radio-group/index.mjs +1 -1
- package/dist/scroll-area/index.mjs +1 -1
- package/dist/select/index.mjs +1 -1
- package/dist/separator/index.mjs +1 -1
- package/dist/sheet/index.mjs +1 -1
- package/dist/skeleton/index.mjs +1 -1
- package/dist/sortable/index.mjs +1 -1
- package/dist/table/index.mjs +1 -1
- package/dist/tabs/index.mjs +1 -1
- package/dist/textarea/index.mjs +1 -1
- package/dist/toast/index.mjs +1 -1
- package/dist/toggle/index.mjs +1 -1
- package/dist/toggle-group/index.mjs +1 -1
- package/dist/tooltip/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunks/_commonjsHelpers-Bjj-JKBe.mjs.map +0 -1
- package/dist/chunks/badge-DQMrqIyu.mjs +0 -2
- package/dist/chunks/badge-DQMrqIyu.mjs.map +0 -1
- package/dist/chunks/check-CTdDPXjk.mjs +0 -2
- package/dist/chunks/chevron-down-DDHw_qmV.mjs +0 -2
- package/dist/chunks/chevron-left-CjUEKmgQ.mjs +0 -2
- package/dist/chunks/chevron-right-BaRUY2Lm.mjs +0 -2
- package/dist/chunks/circle-B6AT9LZB.mjs +0 -2
- package/dist/chunks/x-B1PdcxpA.mjs +0 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index-
|
1
|
+
{"version":3,"file":"index-0-u0cdz8.mjs","sources":["../../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs"],"sourcesContent":["// packages/react/use-layout-effect/src/use-layout-effect.tsx\nimport * as React from \"react\";\nvar useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {\n};\nexport {\n useLayoutEffect2 as useLayoutEffect\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useLayoutEffect","globalThis","document","React"],"mappings":"wBASA,IAAMA,EAAkBC,YAAYC,SAAiBC,EAAAH,gBAAkB","x_google_ignoreList":[0]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as e from"react";import{u as n}from"./index-
|
2
|
-
//# sourceMappingURL=index-
|
1
|
+
import*as e from"react";import{u as n}from"./index-C-j8pU3U.mjs";import{u as t}from"./index-0-u0cdz8.mjs";var r=r=>{const{present:o,children:u}=r,s=function(n){const[r,o]=e.useState(),u=e.useRef(null),s=e.useRef(n),a=e.useRef("none"),c=n?"mounted":"unmounted",[m,d]=function(n,t){return e.useReducer((e,n)=>t[e][n]??e,n)}(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=i(u.current);a.current="mounted"===m?e:"none"},[m]),t(()=>{const e=u.current,t=s.current;if(t!==n){const r=a.current,o=i(e);if(n)d("MOUNT");else if("none"===o||"none"===e?.display)d("UNMOUNT");else{d(t&&r!==o?"ANIMATION_OUT":"UNMOUNT")}s.current=n}},[n,d]),t(()=>{if(r){let e;const n=r.ownerDocument.defaultView??window,t=t=>{const o=i(u.current).includes(t.animationName);if(t.target===r&&o&&(d("ANIMATION_END"),!s.current)){const t=r.style.animationFillMode;r.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=t)})}},o=e=>{e.target===r&&(a.current=i(u.current))};return r.addEventListener("animationstart",o),r.addEventListener("animationcancel",t),r.addEventListener("animationend",t),()=>{n.clearTimeout(e),r.removeEventListener("animationstart",o),r.removeEventListener("animationcancel",t),r.removeEventListener("animationend",t)}}d("ANIMATION_END")},[r,d]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:e.useCallback(e=>{u.current=e?getComputedStyle(e):null,o(e)},[])}}(o),a="function"==typeof u?u({present:s.isPresent}):e.Children.only(u),c=n(s.ref,function(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning;if(t)return e.ref;if(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof u||s.isPresent?e.cloneElement(a,{ref:c}):null};function i(e){return e?.animationName||"none"}r.displayName="Presence";export{r as P};
|
2
|
+
//# sourceMappingURL=index-1xuBLrml.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index-
|
1
|
+
{"version":3,"file":"index-1xuBLrml.mjs","sources":["../../node_modules/@radix-ui/react-presence/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/presence.tsx\nimport * as React2 from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\n\n// src/use-state-machine.tsx\nimport * as React from \"react\";\nfunction useStateMachine(initialState, machine) {\n return React.useReducer((state, event) => {\n const nextState = machine[state][event];\n return nextState ?? state;\n }, initialState);\n}\n\n// src/presence.tsx\nvar Presence = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n const child = typeof children === \"function\" ? children({ present: presence.isPresent }) : React2.Children.only(children);\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === \"function\";\n return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;\n};\nPresence.displayName = \"Presence\";\nfunction usePresence(present) {\n const [node, setNode] = React2.useState();\n const stylesRef = React2.useRef(null);\n const prevPresentRef = React2.useRef(present);\n const prevAnimationNameRef = React2.useRef(\"none\");\n const initialState = present ? \"mounted\" : \"unmounted\";\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: \"unmounted\",\n ANIMATION_OUT: \"unmountSuspended\"\n },\n unmountSuspended: {\n MOUNT: \"mounted\",\n ANIMATION_END: \"unmounted\"\n },\n unmounted: {\n MOUNT: \"mounted\"\n }\n });\n React2.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === \"mounted\" ? currentAnimationName : \"none\";\n }, [state]);\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n if (present) {\n send(\"MOUNT\");\n } else if (currentAnimationName === \"none\" || styles?.display === \"none\") {\n send(\"UNMOUNT\");\n } else {\n const isAnimating = prevAnimationName !== currentAnimationName;\n if (wasPresent && isAnimating) {\n send(\"ANIMATION_OUT\");\n } else {\n send(\"UNMOUNT\");\n }\n }\n prevPresentRef.current = present;\n }\n }, [present, send]);\n useLayoutEffect(() => {\n if (node) {\n let timeoutId;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n const handleAnimationEnd = (event) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(event.animationName);\n if (event.target === node && isCurrentAnimation) {\n send(\"ANIMATION_END\");\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = \"forwards\";\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === \"forwards\") {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event) => {\n if (event.target === node) {\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener(\"animationstart\", handleAnimationStart);\n node.addEventListener(\"animationcancel\", handleAnimationEnd);\n node.addEventListener(\"animationend\", handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener(\"animationstart\", handleAnimationStart);\n node.removeEventListener(\"animationcancel\", handleAnimationEnd);\n node.removeEventListener(\"animationend\", handleAnimationEnd);\n };\n } else {\n send(\"ANIMATION_END\");\n }\n }, [node, send]);\n return {\n isPresent: [\"mounted\", \"unmountSuspended\"].includes(state),\n ref: React2.useCallback((node2) => {\n stylesRef.current = node2 ? getComputedStyle(node2) : null;\n setNode(node2);\n }, [])\n };\n}\nfunction getAnimationName(styles) {\n return styles?.animationName || \"none\";\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nvar Root = Presence;\nexport {\n Presence,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["Presence","props","present","children","presence","node","setNode","React2","useState","stylesRef","useRef","prevPresentRef","prevAnimationNameRef","initialState","state","send","useStateMachine","mounted","UNMOUNT","ANIMATION_OUT","unmountSuspended","MOUNT","ANIMATION_END","unmounted","useEffect","currentAnimationName","getAnimationName","current","useLayoutEffect","styles","wasPresent","prevAnimationName","display","timeoutId","ownerWindow","ownerDocument","defaultView","window","handleAnimationEnd","event","isCurrentAnimation","includes","animationName","target","currentFillMode","style","animationFillMode","setTimeout","handleAnimationStart","addEventListener","clearTimeout","removeEventListener","isPresent","ref","useCallback","getComputedStyle","usePresence","child","Children","only","useComposedRefs","element","getter","Object","getOwnPropertyDescriptor","get","mayWarn","isReactWarning","getElementRef","cloneElement","displayName"],"mappings":"0GAUA,IAAMA,EAAqCC,IACzC,MAAMC,QAAEA,EAAAC,SAASA,GAAaF,EACxBG,EAmBR,SAAqBF,GACnB,MAAOG,EAAMC,GAAiBC,EAAAC,WACxBC,EAAkBF,EAAAG,OAAmC,MACrDC,EAAuBJ,EAAAG,OAAOR,GAC9BU,EAA6BL,EAAAG,OAAe,QAC5CG,EAAeX,EAAU,UAAY,aACpCY,EAAOC,0DAAQC,CAAgBH,EAAc,CAClDI,QAAS,CACPC,QAAS,YACTC,cAAe,oBAEjBC,iBAAkB,CAChBC,MAAO,UACPC,cAAe,aAEjBC,UAAW,CACTF,MAAO,aAyGX,OArGMd,EAAAiB,UAAU,KACd,MAAMC,EAAuBC,EAAiBjB,EAAUkB,SACxDf,EAAqBe,QAAoB,YAAVb,EAAsBW,EAAuB,QAC3E,CAACX,IAEJc,EAAgB,KACd,MAAMC,EAASpB,EAAUkB,QACnBG,EAAanB,EAAegB,QAGlC,GAF0BG,IAAe5B,EAElB,CACrB,MAAM6B,EAAoBnB,EAAqBe,QACzCF,EAAuBC,EAAiBG,GAE9C,GAAI3B,EACFa,EAAK,cACP,GAAoC,SAAzBU,GAAuD,SAApBI,GAAQG,QAGpDjB,EAAK,eACA,CAUHA,EADEe,GAFgBC,IAAsBN,EAGnC,gBAEA,UAET,CAEAd,EAAegB,QAAUzB,CAC3B,GACC,CAACA,EAASa,IAEba,EAAgB,KACd,GAAIvB,EAAM,CACR,IAAI4B,EACJ,MAAMC,EAAc7B,EAAK8B,cAAcC,aAAeC,OAMhDC,EAAsBC,IAC1B,MACMC,EADuBd,EAAiBjB,EAAUkB,SACRc,SAASF,EAAMG,eAC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,MAAMoD,KAAQQ,EAAgBR,GAC/C,CAzK4Ce,CAAcX,IAExD,MADuC,mBAAbtD,GACLC,EAASgD,UAAkB7C,EAAA8D,aAAaZ,EAAO,CAAEJ,QAAS,MA6IjF,SAAS3B,EAAiBG,GACxB,OAAOA,GAAQa,eAAiB,MAClC,CA5IA1C,EAASsE,YAAc","x_google_ignoreList":[0]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as e from"react";import{c as o}from"./index-
|
2
|
-
//# sourceMappingURL=index-
|
1
|
+
import*as e from"react";import{c as o}from"./index-DVnblQ-a.mjs";import{createCollection as r}from"@radix-ui/react-collection";import{u as t}from"./index-C-j8pU3U.mjs";import{c as n}from"./index-Dr5ObK3L.mjs";import{u as a}from"./index-UQBMY2z8.mjs";import{P as i}from"./index-DiPp8h7C.mjs";import{u as s}from"./index-DSUHCtxx.mjs";import{u}from"./index-BOUg6o32.mjs";import{u as c}from"./index-DBjm5RwN.mjs";import{jsx as l}from"react/jsx-runtime";var f="rovingFocusGroup.onEntryFocus",p={bubbles:!1,cancelable:!0},d="RovingFocusGroup",[m,v,b]=r(d),[w,g]=n(d,[b]),[F,I]=w(d),h=e.forwardRef((e,o)=>l(m.Provider,{scope:e.__scopeRovingFocusGroup,children:l(m.Slot,{scope:e.__scopeRovingFocusGroup,children:l(R,{...e,ref:o})})}));h.displayName=d;var R=e.forwardRef((r,n)=>{const{__scopeRovingFocusGroup:a,orientation:m,loop:b=!1,dir:w,currentTabStopId:g,defaultCurrentTabStopId:I,onCurrentTabStopIdChange:h,onEntryFocus:R,preventScrollOnEntryFocus:x=!1,...y}=r,S=e.useRef(null),A=t(n,S),E=c(w),[D,C]=u({prop:g,defaultProp:I??null,onChange:h,caller:d}),[j,_]=e.useState(!1),G=s(R),K=v(a),k=e.useRef(!1),[L,P]=e.useState(0);return e.useEffect(()=>{const e=S.current;if(e)return e.addEventListener(f,G),()=>e.removeEventListener(f,G)},[G]),l(F,{scope:a,orientation:m,dir:E,loop:b,currentTabStopId:D,onItemFocus:e.useCallback(e=>C(e),[C]),onItemShiftTab:e.useCallback(()=>_(!0),[]),onFocusableItemAdd:e.useCallback(()=>P(e=>e+1),[]),onFocusableItemRemove:e.useCallback(()=>P(e=>e-1),[]),children:l(i.div,{tabIndex:j||0===L?-1:0,"data-orientation":m,...y,ref:A,style:{outline:"none",...r.style},onMouseDown:o(r.onMouseDown,()=>{k.current=!0}),onFocus:o(r.onFocus,e=>{const o=!k.current;if(e.target===e.currentTarget&&o&&!j){const o=new CustomEvent(f,p);if(e.currentTarget.dispatchEvent(o),!o.defaultPrevented){const e=K().filter(e=>e.focusable);T([e.find(e=>e.active),e.find(e=>e.id===D),...e].filter(Boolean).map(e=>e.ref.current),x)}}k.current=!1}),onBlur:o(r.onBlur,()=>_(!1))})})}),x="RovingFocusGroupItem",y=e.forwardRef((r,t)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:u=!1,tabStopId:c,children:f,...p}=r,d=a(),b=c||d,w=I(x,n),g=w.currentTabStopId===b,F=v(n),{onFocusableItemAdd:h,onFocusableItemRemove:R,currentTabStopId:y}=w;return e.useEffect(()=>{if(s)return h(),()=>R()},[s,h,R]),l(m.ItemSlot,{scope:n,id:b,focusable:s,active:u,children:l(i.span,{tabIndex:g?0:-1,"data-orientation":w.orientation,...p,ref:t,onMouseDown:o(r.onMouseDown,e=>{s?w.onItemFocus(b):e.preventDefault()}),onFocus:o(r.onFocus,()=>w.onItemFocus(b)),onKeyDown:o(r.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void w.onItemShiftTab();if(e.target!==e.currentTarget)return;const o=function(e,o,r){const t=function(e,o){return"rtl"!==o?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===o&&["ArrowLeft","ArrowRight"].includes(t)||"horizontal"===o&&["ArrowUp","ArrowDown"].includes(t)?void 0:S[t]}(e,w.orientation,w.dir);if(void 0!==o){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=F().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===o)n.reverse();else if("prev"===o||"next"===o){"prev"===o&&n.reverse();const a=n.indexOf(e.currentTarget);n=w.loop?(t=a+1,(r=n).map((e,o)=>r[(t+o)%r.length])):n.slice(a+1)}setTimeout(()=>T(n))}var r,t}),children:"function"==typeof f?f({isCurrentTabStop:g,hasTabStop:null!=y}):f})})});y.displayName=x;var S={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function T(e,o=!1){const r=document.activeElement;for(const t of e){if(t===r)return;if(t.focus({preventScroll:o}),document.activeElement!==r)return}}var A=h,E=y;export{E as I,A as R,g as c};
|
2
|
+
//# sourceMappingURL=index-9IZ9Aw1I.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index-0ahJ1Q21.mjs","sources":["../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/roving-focus-group.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ENTRY_FOCUS = \"rovingFocusGroup.onEntryFocus\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar GROUP_NAME = \"RovingFocusGroup\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);\nvar [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\nvar [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);\nvar RovingFocusGroup = React.forwardRef(\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });\n }\n);\nRovingFocusGroup.displayName = GROUP_NAME;\nvar RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId ?? null,\n onChange: onCurrentTabStopIdChange,\n caller: GROUP_NAME\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n return /* @__PURE__ */ jsx(\n RovingFocusProvider,\n {\n scope: __scopeRovingFocusGroup,\n orientation,\n dir: direction,\n loop,\n currentTabStopId,\n onItemFocus: React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n ),\n onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),\n onFocusableItemAdd: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n ),\n onFocusableItemRemove: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n ),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,\n \"data-orientation\": orientation,\n ...groupProps,\n ref: composedRefs,\n style: { outline: \"none\", ...props.style },\n onMouseDown: composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n }),\n onFocus: composeEventHandlers(props.onFocus, (event) => {\n const isKeyboardFocus = !isClickFocusRef.current;\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n );\n const candidateNodes = candidateItems.map((item) => item.ref.current);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n isClickFocusRef.current = false;\n }),\n onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))\n }\n )\n }\n );\n});\nvar ITEM_NAME = \"RovingFocusGroupItem\";\nvar RovingFocusGroupItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n children,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeRovingFocusGroup,\n id,\n focusable,\n active,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n tabIndex: isCurrentTabStop ? 0 : -1,\n \"data-orientation\": context.orientation,\n ...itemProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!focusable) event.preventDefault();\n else context.onItemFocus(id);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Tab\" && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n if (event.target !== event.currentTarget) return;\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n if (focusIntent !== void 0) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current);\n if (focusIntent === \"last\") candidateNodes.reverse();\n else if (focusIntent === \"prev\" || focusIntent === \"next\") {\n if (focusIntent === \"prev\") candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n }\n }),\n children: typeof children === \"function\" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children\n }\n )\n }\n );\n }\n);\nRovingFocusGroupItem.displayName = ITEM_NAME;\nvar MAP_KEY_TO_FOCUS_INTENT = {\n ArrowLeft: \"prev\",\n ArrowUp: \"prev\",\n ArrowRight: \"next\",\n ArrowDown: \"next\",\n PageUp: \"first\",\n Home: \"first\",\n PageDown: \"last\",\n End: \"last\"\n};\nfunction getDirectionAwareKey(key, dir) {\n if (dir !== \"rtl\") return key;\n return key === \"ArrowLeft\" ? \"ArrowRight\" : key === \"ArrowRight\" ? \"ArrowLeft\" : key;\n}\nfunction getFocusIntent(event, orientation, dir) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === \"vertical\" && [\"ArrowLeft\", \"ArrowRight\"].includes(key)) return void 0;\n if (orientation === \"horizontal\" && [\"ArrowUp\", \"ArrowDown\"].includes(key)) return void 0;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction focusFirst(candidates, preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root = RovingFocusGroup;\nvar Item = RovingFocusGroupItem;\nexport {\n Item,\n Root,\n RovingFocusGroup,\n RovingFocusGroupItem,\n createRovingFocusGroupScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["ENTRY_FOCUS","EVENT_OPTIONS","bubbles","cancelable","GROUP_NAME","Collection","useCollection","createCollectionScope","createCollection","createRovingFocusGroupContext","createRovingFocusGroupScope","createContextScope","RovingFocusProvider","useRovingFocusContext","RovingFocusGroup","React","forwardRef","props","forwardedRef","jsx","Provider","scope","__scopeRovingFocusGroup","children","Slot","RovingFocusGroupImpl","ref","displayName","orientation","loop","dir","currentTabStopId","currentTabStopIdProp","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus","preventScrollOnEntryFocus","groupProps","useRef","composedRefs","useComposedRefs","direction","useDirection","setCurrentTabStopId","useControllableState","prop","defaultProp","onChange","caller","isTabbingBackOut","setIsTabbingBackOut","useState","handleEntryFocus","useCallbackRef","getItems","isClickFocusRef","focusableItemsCount","setFocusableItemsCount","useEffect","node","current","addEventListener","removeEventListener","onItemFocus","useCallback","tabStopId","onItemShiftTab","onFocusableItemAdd","prevCount","onFocusableItemRemove","Primitive","div","tabIndex","style","outline","onMouseDown","composeEventHandlers","onFocus","event","isKeyboardFocus","target","currentTarget","entryFocusEvent","CustomEvent","dispatchEvent","defaultPrevented","items","filter","item","focusable","focusFirst","find","active","id","Boolean","map","onBlur","ITEM_NAME","RovingFocusGroupItem","itemProps","autoId","useId","context","isCurrentTabStop","ItemSlot","span","preventDefault","onKeyDown","key","shiftKey","focusIntent","getDirectionAwareKey","includes","MAP_KEY_TO_FOCUS_INTENT","getFocusIntent","metaKey","ctrlKey","altKey","candidateNodes","reverse","currentIndex","indexOf","startIndex","array","_","index","length","slice","setTimeout","hasTabStop","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","PageUp","Home","PageDown","End","candidates","preventScroll","PREVIOUSLY_FOCUSED_ELEMENT","document","activeElement","candidate","focus","Root","Item"],"mappings":"icAaA,IAAMA,EAAc,gCACdC,EAAgB,CAAEC,SAAS,EAAOC,YAAY,GAM9CC,EAAa,oBAGZC,EAAYC,EAAeC,GAAyBC,EAGzDJ,IAGKK,EAA+BC,GAA+BC,EACnEP,EACA,CAACG,KA+BIK,EAAqBC,GAC1BJ,EAAkDL,GAK9CU,EAAyBC,EAAAC,WAC7B,CAACC,EAA2CC,IAExCC,EAACd,EAAWe,SAAX,CAAoBC,MAAOJ,EAAMK,wBAChCC,SAAAJ,EAACd,EAAWmB,KAAX,CAAgBH,MAAOJ,EAAMK,wBAC5BC,SAAAJ,EAACM,EAAA,IAAyBR,EAAOS,IAAKR,SAOhDJ,EAAiBa,YAAcvB,EAgB/B,IAAMqB,EAA6BV,EAAAC,WAGjC,CAACC,EAA+CC,KAChD,MAAMI,wBACJA,EAAAM,YACAA,EAAAC,KACAA,GAAO,EAAAC,IACPA,EACAC,iBAAkBC,EAAAC,wBAClBA,EAAAC,yBACAA,EAAAC,aACAA,EAAAC,0BACAA,GAA4B,KACzBC,GACDpB,EACES,EAAYX,EAAAuB,OAAoC,MAChDC,EAAe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AAQ,QAASC,KAAM,QACvBC,SAAU,OAAQC,IAAK,QAiBzB,SAAS/C,EAAWgD,EAA2BC,GAAgB,GAC7D,MAAMC,EAA6BC,SAASC,cAC5C,IAAA,MAAWC,KAAaL,EAAY,CAElC,GAAIK,IAAcH,EAA4B,OAE9C,GADAG,EAAUC,MAAM,CAAEL,kBACdE,SAASC,gBAAkBF,EAA4B,MAC7D,CACF,CAUA,IAAMK,EAAOnI,EACPoI,EAAOhD","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index-9IZ9Aw1I.mjs","sources":["../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/roving-focus-group.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ENTRY_FOCUS = \"rovingFocusGroup.onEntryFocus\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar GROUP_NAME = \"RovingFocusGroup\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);\nvar [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\nvar [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);\nvar RovingFocusGroup = React.forwardRef(\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });\n }\n);\nRovingFocusGroup.displayName = GROUP_NAME;\nvar RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId ?? null,\n onChange: onCurrentTabStopIdChange,\n caller: GROUP_NAME\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n return /* @__PURE__ */ jsx(\n RovingFocusProvider,\n {\n scope: __scopeRovingFocusGroup,\n orientation,\n dir: direction,\n loop,\n currentTabStopId,\n onItemFocus: React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n ),\n onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),\n onFocusableItemAdd: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n ),\n onFocusableItemRemove: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n ),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,\n \"data-orientation\": orientation,\n ...groupProps,\n ref: composedRefs,\n style: { outline: \"none\", ...props.style },\n onMouseDown: composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n }),\n onFocus: composeEventHandlers(props.onFocus, (event) => {\n const isKeyboardFocus = !isClickFocusRef.current;\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n );\n const candidateNodes = candidateItems.map((item) => item.ref.current);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n isClickFocusRef.current = false;\n }),\n onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))\n }\n )\n }\n );\n});\nvar ITEM_NAME = \"RovingFocusGroupItem\";\nvar RovingFocusGroupItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n children,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeRovingFocusGroup,\n id,\n focusable,\n active,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n tabIndex: isCurrentTabStop ? 0 : -1,\n \"data-orientation\": context.orientation,\n ...itemProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!focusable) event.preventDefault();\n else context.onItemFocus(id);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Tab\" && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n if (event.target !== event.currentTarget) return;\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n if (focusIntent !== void 0) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current);\n if (focusIntent === \"last\") candidateNodes.reverse();\n else if (focusIntent === \"prev\" || focusIntent === \"next\") {\n if (focusIntent === \"prev\") candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n }\n }),\n children: typeof children === \"function\" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children\n }\n )\n }\n );\n }\n);\nRovingFocusGroupItem.displayName = ITEM_NAME;\nvar MAP_KEY_TO_FOCUS_INTENT = {\n ArrowLeft: \"prev\",\n ArrowUp: \"prev\",\n ArrowRight: \"next\",\n ArrowDown: \"next\",\n PageUp: \"first\",\n Home: \"first\",\n PageDown: \"last\",\n End: \"last\"\n};\nfunction getDirectionAwareKey(key, dir) {\n if (dir !== \"rtl\") return key;\n return key === \"ArrowLeft\" ? \"ArrowRight\" : key === \"ArrowRight\" ? \"ArrowLeft\" : key;\n}\nfunction getFocusIntent(event, orientation, dir) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === \"vertical\" && [\"ArrowLeft\", \"ArrowRight\"].includes(key)) return void 0;\n if (orientation === \"horizontal\" && [\"ArrowUp\", \"ArrowDown\"].includes(key)) return void 0;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction focusFirst(candidates, preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root = RovingFocusGroup;\nvar Item = RovingFocusGroupItem;\nexport {\n Item,\n Root,\n RovingFocusGroup,\n RovingFocusGroupItem,\n createRovingFocusGroupScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["ENTRY_FOCUS","EVENT_OPTIONS","bubbles","cancelable","GROUP_NAME","Collection","useCollection","createCollectionScope","createCollection","createRovingFocusGroupContext","createRovingFocusGroupScope","createContextScope","RovingFocusProvider","useRovingFocusContext","RovingFocusGroup","React","forwardRef","props","forwardedRef","jsx","Provider","scope","__scopeRovingFocusGroup","children","Slot","RovingFocusGroupImpl","ref","displayName","orientation","loop","dir","currentTabStopId","currentTabStopIdProp","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus","preventScrollOnEntryFocus","groupProps","useRef","composedRefs","useComposedRefs","direction","useDirection","setCurrentTabStopId","useControllableState","prop","defaultProp","onChange","caller","isTabbingBackOut","setIsTabbingBackOut","useState","handleEntryFocus","useCallbackRef","getItems","isClickFocusRef","focusableItemsCount","setFocusableItemsCount","useEffect","node","current","addEventListener","removeEventListener","onItemFocus","useCallback","tabStopId","onItemShiftTab","onFocusableItemAdd","prevCount","onFocusableItemRemove","Primitive","div","tabIndex","style","outline","onMouseDown","composeEventHandlers","onFocus","event","isKeyboardFocus","target","currentTarget","entryFocusEvent","CustomEvent","dispatchEvent","defaultPrevented","items","filter","item","focusable","focusFirst","find","active","id","Boolean","map","onBlur","ITEM_NAME","RovingFocusGroupItem","itemProps","autoId","useId","context","isCurrentTabStop","ItemSlot","span","preventDefault","onKeyDown","key","shiftKey","focusIntent","getDirectionAwareKey","includes","MAP_KEY_TO_FOCUS_INTENT","getFocusIntent","metaKey","ctrlKey","altKey","candidateNodes","reverse","currentIndex","indexOf","startIndex","array","_","index","length","slice","setTimeout","hasTabStop","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","PageUp","Home","PageDown","End","candidates","preventScroll","PREVIOUSLY_FOCUSED_ELEMENT","document","activeElement","candidate","focus","Root","Item"],"mappings":"icAaA,IAAMA,EAAc,gCACdC,EAAgB,CAAEC,SAAS,EAAOC,YAAY,GAM9CC,EAAa,oBAGZC,EAAYC,EAAeC,GAAyBC,EAGzDJ,IAGKK,EAA+BC,GAA+BC,EACnEP,EACA,CAACG,KA+BIK,EAAqBC,GAC1BJ,EAAkDL,GAK9CU,EAAyBC,EAAAC,WAC7B,CAACC,EAA2CC,IAExCC,EAACd,EAAWe,SAAX,CAAoBC,MAAOJ,EAAMK,wBAChCC,SAAAJ,EAACd,EAAWmB,KAAX,CAAgBH,MAAOJ,EAAMK,wBAC5BC,SAAAJ,EAACM,EAAA,IAAyBR,EAAOS,IAAKR,SAOhDJ,EAAiBa,YAAcvB,EAgB/B,IAAMqB,EAA6BV,EAAAC,WAGjC,CAACC,EAA+CC,KAChD,MAAMI,wBACJA,EAAAM,YACAA,EAAAC,KACAA,GAAO,EAAAC,IACPA,EACAC,iBAAkBC,EAAAC,wBAClBA,EAAAC,yBACAA,EAAAC,aACAA,EAAAC,0BACAA,GAA4B,KACzBC,GACDpB,EACES,EAAYX,EAAAuB,OAAoC,MAChDC,EAAeC,EAAgBtB,EAAcQ,GAC7Ce,EAAYC,EAAaZ,IACxBC,EAAkBY,GAAuBC,EAAqB,CACnEC,KAAMb,EACNc,YAAab,GAA2B,KACxCc,SAAUb,EACVc,OAAQ5C,KAEH6C,EAAkBC,GAA6BnC,EAAAoC,UAAS,GACzDC,EAAmBC,EAAelB,GAClCmB,EAAWhD,EAAcgB,G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,EAA4B,MAC7D,CACF,CAUA,IAAMK,EAAOnI,EACPoI,EAAOhD","x_google_ignoreList":[0]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as e from"react";import{u as t}from"./index-
|
2
|
-
//# sourceMappingURL=index-
|
1
|
+
import*as e from"react";import{u as t}from"./index-0-u0cdz8.mjs";var r=e[" useInsertionEffect ".trim().toString()]||t;function n({prop:t,defaultProp:n,onChange:o=()=>{},caller:u}){const[c,f,s]=function({defaultProp:t,onChange:n}){const[o,u]=e.useState(t),c=e.useRef(o),f=e.useRef(n);return r(()=>{f.current=n},[n]),e.useEffect(()=>{c.current!==o&&(f.current?.(o),c.current=o)},[o,c]),[o,u,f]}({defaultProp:n,onChange:o}),a=void 0!==t,i=a?t:c;{const r=e.useRef(void 0!==t);e.useEffect(()=>{const e=r.current;if(e!==a){}r.current=a},[a,u])}const p=e.useCallback(e=>{if(a){const r=function(e){return"function"==typeof e}(e)?e(t):e;r!==t&&s.current?.(r)}else f(e)},[a,t,f,s]);return[i,p]}export{n as u};
|
2
|
+
//# sourceMappingURL=index-BOUg6o32.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index-
|
1
|
+
{"version":3,"file":"index-BOUg6o32.mjs","sources":["../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs"],"sourcesContent":["// src/use-controllable-state.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nvar useInsertionEffect = React[\" useInsertionEffect \".trim().toString()] || useLayoutEffect;\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = () => {\n },\n caller\n}) {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange\n });\n const isControlled = prop !== void 0;\n const value = isControlled ? prop : uncontrolledProp;\n if (true) {\n const isControlledRef = React.useRef(prop !== void 0);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const setValue = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value2 !== prop) {\n onChangeRef.current?.(value2);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n return [value, setValue];\n}\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}) {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n return [value, setValue, onChangeRef];\n}\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n\n// src/use-controllable-state-reducer.tsx\nimport * as React2 from \"react\";\nimport { useEffectEvent } from \"@radix-ui/react-use-effect-event\";\nvar SYNC_STATE = Symbol(\"RADIX:SYNC_STATE\");\nfunction useControllableStateReducer(reducer, userArgs, initialArg, init) {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== void 0;\n const onChange = useEffectEvent(onChangeProp);\n if (true) {\n const isControlledRef = React2.useRef(controlledState !== void 0);\n React2.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const args = [{ ...initialArg, state: defaultProp }];\n if (init) {\n args.push(init);\n }\n const [internalState, dispatch] = React2.useReducer(\n (state2, action) => {\n if (action.type === SYNC_STATE) {\n return { ...state2, state: action.state };\n }\n const next = reducer(state2, action);\n if (isControlled && !Object.is(next.state, state2.state)) {\n onChange(next.state);\n }\n return next;\n },\n ...args\n );\n const uncontrolledState = internalState.state;\n const prevValueRef = React2.useRef(uncontrolledState);\n React2.useEffect(() => {\n if (prevValueRef.current !== uncontrolledState) {\n prevValueRef.current = uncontrolledState;\n if (!isControlled) {\n onChange(uncontrolledState);\n }\n }\n }, [onChange, uncontrolledState, prevValueRef, isControlled]);\n const state = React2.useMemo(() => {\n const isControlled2 = controlledState !== void 0;\n if (isControlled2) {\n return { ...internalState, state: controlledState };\n }\n return internalState;\n }, [internalState, controlledState]);\n React2.useEffect(() => {\n if (isControlled && !Object.is(controlledState, internalState.state)) {\n dispatch({ type: SYNC_STATE, state: controlledState });\n }\n }, [controlledState, internalState.state, isControlled]);\n return [state, dispatch];\n}\nexport {\n useControllableState,\n useControllableStateReducer\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useInsertionEffect","React","trim","toString","useLayoutEffect","useControllableState","prop","defaultProp","onChange","caller","uncontrolledProp","setUncontrolledProp","onChangeRef","value","setValue","useState","prevValueRef","useRef","current","useEffect","useUncontrolledState","isControlled","isControlledRef","wasControlled","useCallback","nextValue","isFunction"],"mappings":"iEAIA,IAAMA,EACHC,EAAc,uBAAuBC,OAAOC,aAAeC,EAYvD,SAASC,GAAwBC,KACtCA,EAAAC,YACAA,EAAAC,SACAA,EAAW,OAAMC,OACjBA,IAEA,MAAOC,EAAkBC,EAAqBC,GA4ChD,UAAiCL,YAC/BA,EAAAC,SACAA,IAMA,MAAOK,EAAOC,GAAkBb,EAAAc,SAASR,GACnCS,EAAqBf,EAAAgB,OAAOJ,GAE5BD,EAAoBX,EAAAgB,OAAOT,GAYjC,OAXAR,EAAmB,KACjBY,EAAYM,QAAUV,GACrB,CAACA,IAEEP,EAAAkB,UAAU,KACVH,EAAaE,UAAYL,IAC3BD,EAAYM,UAAUL,GACtBG,EAAaE,QAAUL,IAExB,CAACA,EAAOG,IAEJ,CAACH,EAAOC,EAAUF,EAC3B,CApE+DQ,CAAqB,CAChFb,cACAC,aAEIa,OAAwB,IAATf,EACfO,EAAQQ,EAAef,EAAOI,EAMO,CACzC,MAAMY,EAAwBrB,EAAAgB,YAAgB,IAATX,GAC/BL,EAAAkB,UAAU,KACd,MAAMI,EAAgBD,EAAgBJ,QACtC,GAAIK,IAAkBF,EAAc,CAMpC,CACAC,EAAgBJ,QAAUG,GACzB,CAACA,EAAcZ,GACpB,CAGA,MAAMK,EAAiBb,EAAAuB,YACpBC,IACC,GAAIJ,EAAc,CAChB,MAAMR,EAwCd,SAAoBA,GAClB,MAAwB,mBAAVA,CAChB,CA1CsBa,CAAWD,GAAaA,EAAUnB,GAAQmB,EACpDZ,IAAUP,GACZM,EAAYM,UAAUL,EAE1B,MACEF,EAAoBc,IAGxB,CAACJ,EAAcf,EAAMK,EAAqBC,IAG5C,MAAO,CAACC,EAAOC,EACjB","x_google_ignoreList":[0]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as e from"react";import{c as n}from"./index-CaYe_hNP.mjs";import{createCollection as t}from"@radix-ui/react-collection";import{u as r,c as o}from"./index-DmBXPUeL.mjs";import{c as a}from"./index-DBp_Gx1M.mjs";import{u as c}from"./index-Bt73Afz2.mjs";import{P as s,D as u}from"./index-GOFmxCuq.mjs";import{h as i,u as l,R as d,F as f}from"./index-CzTsDkbO.mjs";import{u as p}from"./index-ZCQr-O7f.mjs";import{c as m,R as h,A as v,C as g,a as _}from"./index-Bo9g9ZHj.mjs";import{P as w}from"./index-B7nzlBcT.mjs";import{P as M,d as C}from"./index-DuDVR7ID.mjs";import{c as y,I as b,R}from"./index-0ahJ1Q21.mjs";import{createSlot as P}from"@radix-ui/react-slot";import{u as k}from"./index-Cu6LwID6.mjs";import{jsx as x}from"react/jsx-runtime";var D=["Enter"," "],E=["ArrowUp","PageDown","End"],O=["ArrowDown","PageUp","Home",...E],I={ltr:[...D,"ArrowRight"],rtl:[...D,"ArrowLeft"]},S={ltr:["ArrowLeft"],rtl:["ArrowRight"]},T="Menu",[F,L,K]=t(T),[A,N]=a(T,[K,m,y]),j=m(),G=y(),[V,U]=A(T),[B,X]=A(T),Y=n=>{const{__scopeMenu:t,open:r=!1,children:o,dir:a,onOpenChange:s,modal:u=!0}=n,i=j(t),[l,d]=e.useState(null),f=e.useRef(!1),p=k(s),m=c(a);return e.useEffect(()=>{const e=()=>{f.current=!0,document.addEventListener("pointerdown",n,{capture:!0,once:!0}),document.addEventListener("pointermove",n,{capture:!0,once:!0})},n=()=>f.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",n,{capture:!0}),document.removeEventListener("pointermove",n,{capture:!0})}},[]),x(h,{...i,children:x(V,{scope:t,open:r,onOpenChange:p,content:l,onContentChange:d,children:x(B,{scope:t,onClose:e.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:u,children:o})})})};Y.displayName=T;var z=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e,o=j(t);return x(v,{...o,...r,ref:n})});z.displayName="MenuAnchor";var H="MenuPortal",[W,Z]=A(H,{forceMount:void 0}),q=e=>{const{__scopeMenu:n,forceMount:t,children:r,container:o}=e,a=U(H,n);return x(W,{scope:n,forceMount:t,children:x(w,{present:t||a.open,children:x(s,{asChild:!0,container:o,children:r})})})};q.displayName=H;var J="MenuContent",[Q,$]=A(J),ee=e.forwardRef((e,n)=>{const t=Z(J,e.__scopeMenu),{forceMount:r=t.forceMount,...o}=e,a=U(J,e.__scopeMenu),c=X(J,e.__scopeMenu);return x(F.Provider,{scope:e.__scopeMenu,children:x(w,{present:r||a.open,children:x(F.Slot,{scope:e.__scopeMenu,children:c.modal?x(ne,{...o,ref:n}):x(te,{...o,ref:n})})})})}),ne=e.forwardRef((t,o)=>{const a=U(J,t.__scopeMenu),c=e.useRef(null),s=r(o,c);return e.useEffect(()=>{const e=c.current;if(e)return i(e)},[]),x(oe,{...t,ref:s,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:n(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})}),te=e.forwardRef((e,n)=>{const t=U(J,e.__scopeMenu);return x(oe,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),re=P("MenuContent.ScrollLock"),oe=e.forwardRef((t,o)=>{const{__scopeMenu:a,loop:c=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:p,disableOutsidePointerEvents:m,onEntryFocus:h,onEscapeKeyDown:v,onPointerDownOutside:_,onFocusOutside:w,onInteractOutside:M,onDismiss:C,disableOutsideScroll:y,...b}=t,P=U(J,a),k=X(J,a),D=j(a),I=G(a),S=L(a),[T,F]=e.useState(null),K=e.useRef(null),A=r(o,K,P.onContentChange),N=e.useRef(0),V=e.useRef(""),B=e.useRef(0),Y=e.useRef(null),z=e.useRef("right"),H=e.useRef(0),W=y?d:e.Fragment,Z=y?{as:re,allowPinchZoom:!0}:void 0,q=e=>{const n=V.current+e,t=S().filter(e=>!e.disabled),r=document.activeElement,o=t.find(e=>e.ref.current===r)?.textValue,a=function(e,n,t){const r=n.length>1&&Array.from(n).every(e=>e===n[0]),o=r?n[0]:n,a=t?e.indexOf(t):-1;let c=(s=e,u=Math.max(a,0),s.map((e,n)=>s[(u+n)%s.length]));var s,u;1===o.length&&(c=c.filter(e=>e!==t));const i=c.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return i!==t?i:void 0}(t.map(e=>e.textValue),n,o),c=t.find(e=>e.textValue===a)?.ref.current;!function e(n){V.current=n,window.clearTimeout(N.current),""!==n&&(N.current=window.setTimeout(()=>e(""),1e3))}(n),c&&setTimeout(()=>c.focus())};e.useEffect(()=>()=>window.clearTimeout(N.current),[]),l();const $=e.useCallback(e=>z.current===Y.current?.side&&function(e,n){if(!n)return!1;const t={x:e.clientX,y:e.clientY};return function(e,n){const{x:t,y:r}=e;let o=!1;for(let e=0,a=n.length-1;e<n.length;a=e++){const c=n[e],s=n[a],u=c.x,i=c.y,l=s.x,d=s.y;i>r!=d>r&&t<(l-u)*(r-i)/(d-i)+u&&(o=!o)}return o}(t,n)}(e,Y.current?.area),[]);return x(Q,{scope:a,searchRef:V,onItemEnter:e.useCallback(e=>{$(e)&&e.preventDefault()},[$]),onItemLeave:e.useCallback(e=>{$(e)||(K.current?.focus(),F(null))},[$]),onTriggerLeave:e.useCallback(e=>{$(e)&&e.preventDefault()},[$]),pointerGraceTimerRef:B,onPointerGraceIntentChange:e.useCallback(e=>{Y.current=e},[]),children:x(W,{...Z,children:x(f,{asChild:!0,trapped:s,onMountAutoFocus:n(i,e=>{e.preventDefault(),K.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:x(u,{asChild:!0,disableOutsidePointerEvents:m,onEscapeKeyDown:v,onPointerDownOutside:_,onFocusOutside:w,onInteractOutside:M,onDismiss:C,children:x(R,{asChild:!0,...I,dir:k.dir,orientation:"vertical",loop:c,currentTabStopId:T,onCurrentTabStopIdChange:F,onEntryFocus:n(h,e=>{k.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:x(g,{role:"menu","aria-orientation":"vertical","data-state":Se(P.open),"data-radix-menu-content":"",dir:k.dir,...D,...b,ref:A,style:{outline:"none",...b.style},onKeyDown:n(b.onKeyDown,e=>{const n=e.target.closest("[data-radix-menu-content]")===e.currentTarget,t=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;n&&("Tab"===e.key&&e.preventDefault(),!t&&r&&q(e.key));const o=K.current;if(e.target!==o)return;if(!O.includes(e.key))return;e.preventDefault();const a=S().filter(e=>!e.disabled).map(e=>e.ref.current);E.includes(e.key)&&a.reverse(),function(e){const n=document.activeElement;for(const t of e){if(t===n)return;if(t.focus(),document.activeElement!==n)return}}(a)}),onBlur:n(t.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),V.current="")}),onPointerMove:n(t.onPointerMove,Le(e=>{const n=e.target,t=H.current!==e.clientX;if(e.currentTarget.contains(n)&&t){const n=e.clientX>H.current?"right":"left";z.current=n,H.current=e.clientX}}))})})})})})})});ee.displayName=J;var ae=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e;return x(M.div,{role:"group",...r,ref:n})});ae.displayName="MenuGroup";var ce=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e;return x(M.div,{...r,ref:n})});ce.displayName="MenuLabel";var se="MenuItem",ue="menu.itemSelect",ie=e.forwardRef((t,o)=>{const{disabled:a=!1,onSelect:c,...s}=t,u=e.useRef(null),i=X(se,t.__scopeMenu),l=$(se,t.__scopeMenu),d=r(o,u),f=e.useRef(!1);return x(le,{...s,ref:d,disabled:a,onClick:n(t.onClick,()=>{const e=u.current;if(!a&&e){const n=new CustomEvent(ue,{bubbles:!0,cancelable:!0});e.addEventListener(ue,e=>c?.(e),{once:!0}),C(e,n),n.defaultPrevented?f.current=!1:i.onClose()}}),onPointerDown:e=>{t.onPointerDown?.(e),f.current=!0},onPointerUp:n(t.onPointerUp,e=>{f.current||e.currentTarget?.click()}),onKeyDown:n(t.onKeyDown,e=>{const n=""!==l.searchRef.current;a||n&&" "===e.key||D.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});ie.displayName=se;var le=e.forwardRef((t,o)=>{const{__scopeMenu:a,disabled:c=!1,textValue:s,...u}=t,i=$(se,a),l=G(a),d=e.useRef(null),f=r(o,d),[p,m]=e.useState(!1),[h,v]=e.useState("");return e.useEffect(()=>{const e=d.current;e&&v((e.textContent??"").trim())},[u.children]),x(F.ItemSlot,{scope:a,disabled:c,textValue:s??h,children:x(b,{asChild:!0,...l,focusable:!c,children:x(M.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...u,ref:f,onPointerMove:n(t.onPointerMove,Le(e=>{if(c)i.onItemLeave(e);else if(i.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:n(t.onPointerLeave,Le(e=>i.onItemLeave(e))),onFocus:n(t.onFocus,()=>m(!0)),onBlur:n(t.onBlur,()=>m(!1))})})})}),de=e.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:o,...a}=e;return x(we,{scope:e.__scopeMenu,checked:r,children:x(ie,{role:"menuitemcheckbox","aria-checked":Te(r)?"mixed":r,...a,ref:t,"data-state":Fe(r),onSelect:n(a.onSelect,()=>o?.(!!Te(r)||!r),{checkForDefaultPrevented:!1})})})});de.displayName="MenuCheckboxItem";var fe="MenuRadioGroup",[pe,me]=A(fe,{value:void 0,onValueChange:()=>{}}),he=e.forwardRef((e,n)=>{const{value:t,onValueChange:r,...o}=e,a=k(r);return x(pe,{scope:e.__scopeMenu,value:t,onValueChange:a,children:x(ae,{...o,ref:n})})});he.displayName=fe;var ve="MenuRadioItem",ge=e.forwardRef((e,t)=>{const{value:r,...o}=e,a=me(ve,e.__scopeMenu),c=r===a.value;return x(we,{scope:e.__scopeMenu,checked:c,children:x(ie,{role:"menuitemradio","aria-checked":c,...o,ref:t,"data-state":Fe(c),onSelect:n(o.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});ge.displayName=ve;var _e="MenuItemIndicator",[we,Me]=A(_e,{checked:!1}),Ce=e.forwardRef((e,n)=>{const{__scopeMenu:t,forceMount:r,...o}=e,a=Me(_e,t);return x(w,{present:r||Te(a.checked)||!0===a.checked,children:x(M.span,{...o,ref:n,"data-state":Fe(a.checked)})})});Ce.displayName=_e;var ye=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e;return x(M.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})});ye.displayName="MenuSeparator";var be=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e,o=j(t);return x(_,{...o,...r,ref:n})});be.displayName="MenuArrow";var Re="MenuSub",[Pe,ke]=A(Re),xe=n=>{const{__scopeMenu:t,children:r,open:o=!1,onOpenChange:a}=n,c=U(Re,t),s=j(t),[u,i]=e.useState(null),[l,d]=e.useState(null),f=k(a);return e.useEffect(()=>(!1===c.open&&f(!1),()=>f(!1)),[c.open,f]),x(h,{...s,children:x(V,{scope:t,open:o,onOpenChange:f,content:l,onContentChange:d,children:x(Pe,{scope:t,contentId:p(),triggerId:p(),trigger:u,onTriggerChange:i,children:r})})})};xe.displayName=Re;var De="MenuSubTrigger",Ee=e.forwardRef((t,r)=>{const a=U(De,t.__scopeMenu),c=X(De,t.__scopeMenu),s=ke(De,t.__scopeMenu),u=$(De,t.__scopeMenu),i=e.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:d}=u,f={__scopeMenu:t.__scopeMenu},p=e.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return e.useEffect(()=>p,[p]),e.useEffect(()=>{const e=l.current;return()=>{window.clearTimeout(e),d(null)}},[l,d]),x(z,{asChild:!0,...f,children:x(le,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":s.contentId,"data-state":Se(a.open),...t,ref:o(r,s.onTriggerChange),onClick:e=>{t.onClick?.(e),t.disabled||e.defaultPrevented||(e.currentTarget.focus(),a.open||a.onOpenChange(!0))},onPointerMove:n(t.onPointerMove,Le(e=>{u.onItemEnter(e),e.defaultPrevented||t.disabled||a.open||i.current||(u.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{a.onOpenChange(!0),p()},100))})),onPointerLeave:n(t.onPointerLeave,Le(e=>{p();const n=a.content?.getBoundingClientRect();if(n){const t=a.content?.dataset.side,r="right"===t,o=r?-5:5,c=n[r?"left":"right"],s=n[r?"right":"left"];u.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:n.top},{x:s,y:n.top},{x:s,y:n.bottom},{x:c,y:n.bottom}],side:t}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(e),e.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:n(t.onKeyDown,e=>{const n=""!==u.searchRef.current;t.disabled||n&&" "===e.key||I[c.dir].includes(e.key)&&(a.onOpenChange(!0),a.content?.focus(),e.preventDefault())})})})});Ee.displayName=De;var Oe="MenuSubContent",Ie=e.forwardRef((t,o)=>{const a=Z(J,t.__scopeMenu),{forceMount:c=a.forceMount,...s}=t,u=U(J,t.__scopeMenu),i=X(J,t.__scopeMenu),l=ke(Oe,t.__scopeMenu),d=e.useRef(null),f=r(o,d);return x(F.Provider,{scope:t.__scopeMenu,children:x(w,{present:c||u.open,children:x(F.Slot,{scope:t.__scopeMenu,children:x(oe,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:f,align:"start",side:"rtl"===i.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{i.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:n(t.onFocusOutside,e=>{e.target!==l.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:n(t.onEscapeKeyDown,e=>{i.onClose(),e.preventDefault()}),onKeyDown:n(t.onKeyDown,e=>{const n=e.currentTarget.contains(e.target),t=S[i.dir].includes(e.key);n&&t&&(u.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});function Se(e){return e?"open":"closed"}function Te(e){return"indeterminate"===e}function Fe(e){return Te(e)?"indeterminate":e?"checked":"unchecked"}function Le(e){return n=>"mouse"===n.pointerType?e(n):void 0}Ie.displayName=Oe;var Ke=Y,Ae=z,Ne=q,je=ee,Ge=ae,Ve=ce,Ue=ie,Be=de,Xe=he,Ye=ge,ze=Ce,He=ye,We=be,Ze=xe,qe=Ee,Je=Ie;export{Ae as A,je as C,Ge as G,Ue as I,Ve as L,Ne as P,Ke as R,He as S,Be as a,ze as b,N as c,Xe as d,Ye as e,Ze as f,qe as g,Je as h,We as i};
|
2
|
-
//# sourceMappingURL=index-
|
1
|
+
import*as e from"react";import{c as n}from"./index-DVnblQ-a.mjs";import{createCollection as t}from"@radix-ui/react-collection";import{u as r,c as o}from"./index-C-j8pU3U.mjs";import{c as a}from"./index-Dr5ObK3L.mjs";import{u as c}from"./index-DBjm5RwN.mjs";import{P as s,D as u}from"./index-C_Mk3Jfk.mjs";import{h as i,u as l,R as d,F as f}from"./index-lVEpnR8T.mjs";import{u as p}from"./index-UQBMY2z8.mjs";import{c as m,R as h,A as v,C as g,a as _}from"./index-DtZD7YmJ.mjs";import{P as w}from"./index-1xuBLrml.mjs";import{P as M,d as C}from"./index-DiPp8h7C.mjs";import{c as y,I as b,R}from"./index-9IZ9Aw1I.mjs";import{createSlot as P}from"@radix-ui/react-slot";import{u as k}from"./index-DSUHCtxx.mjs";import{jsx as x}from"react/jsx-runtime";var D=["Enter"," "],E=["ArrowUp","PageDown","End"],O=["ArrowDown","PageUp","Home",...E],I={ltr:[...D,"ArrowRight"],rtl:[...D,"ArrowLeft"]},S={ltr:["ArrowLeft"],rtl:["ArrowRight"]},T="Menu",[F,L,K]=t(T),[A,N]=a(T,[K,m,y]),j=m(),G=y(),[V,U]=A(T),[B,X]=A(T),Y=n=>{const{__scopeMenu:t,open:r=!1,children:o,dir:a,onOpenChange:s,modal:u=!0}=n,i=j(t),[l,d]=e.useState(null),f=e.useRef(!1),p=k(s),m=c(a);return e.useEffect(()=>{const e=()=>{f.current=!0,document.addEventListener("pointerdown",n,{capture:!0,once:!0}),document.addEventListener("pointermove",n,{capture:!0,once:!0})},n=()=>f.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",n,{capture:!0}),document.removeEventListener("pointermove",n,{capture:!0})}},[]),x(h,{...i,children:x(V,{scope:t,open:r,onOpenChange:p,content:l,onContentChange:d,children:x(B,{scope:t,onClose:e.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:u,children:o})})})};Y.displayName=T;var z=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e,o=j(t);return x(v,{...o,...r,ref:n})});z.displayName="MenuAnchor";var H="MenuPortal",[W,Z]=A(H,{forceMount:void 0}),q=e=>{const{__scopeMenu:n,forceMount:t,children:r,container:o}=e,a=U(H,n);return x(W,{scope:n,forceMount:t,children:x(w,{present:t||a.open,children:x(s,{asChild:!0,container:o,children:r})})})};q.displayName=H;var J="MenuContent",[Q,$]=A(J),ee=e.forwardRef((e,n)=>{const t=Z(J,e.__scopeMenu),{forceMount:r=t.forceMount,...o}=e,a=U(J,e.__scopeMenu),c=X(J,e.__scopeMenu);return x(F.Provider,{scope:e.__scopeMenu,children:x(w,{present:r||a.open,children:x(F.Slot,{scope:e.__scopeMenu,children:c.modal?x(ne,{...o,ref:n}):x(te,{...o,ref:n})})})})}),ne=e.forwardRef((t,o)=>{const a=U(J,t.__scopeMenu),c=e.useRef(null),s=r(o,c);return e.useEffect(()=>{const e=c.current;if(e)return i(e)},[]),x(oe,{...t,ref:s,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:n(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})}),te=e.forwardRef((e,n)=>{const t=U(J,e.__scopeMenu);return x(oe,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),re=P("MenuContent.ScrollLock"),oe=e.forwardRef((t,o)=>{const{__scopeMenu:a,loop:c=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:p,disableOutsidePointerEvents:m,onEntryFocus:h,onEscapeKeyDown:v,onPointerDownOutside:_,onFocusOutside:w,onInteractOutside:M,onDismiss:C,disableOutsideScroll:y,...b}=t,P=U(J,a),k=X(J,a),D=j(a),I=G(a),S=L(a),[T,F]=e.useState(null),K=e.useRef(null),A=r(o,K,P.onContentChange),N=e.useRef(0),V=e.useRef(""),B=e.useRef(0),Y=e.useRef(null),z=e.useRef("right"),H=e.useRef(0),W=y?d:e.Fragment,Z=y?{as:re,allowPinchZoom:!0}:void 0,q=e=>{const n=V.current+e,t=S().filter(e=>!e.disabled),r=document.activeElement,o=t.find(e=>e.ref.current===r)?.textValue,a=function(e,n,t){const r=n.length>1&&Array.from(n).every(e=>e===n[0]),o=r?n[0]:n,a=t?e.indexOf(t):-1;let c=(s=e,u=Math.max(a,0),s.map((e,n)=>s[(u+n)%s.length]));var s,u;1===o.length&&(c=c.filter(e=>e!==t));const i=c.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return i!==t?i:void 0}(t.map(e=>e.textValue),n,o),c=t.find(e=>e.textValue===a)?.ref.current;!function e(n){V.current=n,window.clearTimeout(N.current),""!==n&&(N.current=window.setTimeout(()=>e(""),1e3))}(n),c&&setTimeout(()=>c.focus())};e.useEffect(()=>()=>window.clearTimeout(N.current),[]),l();const $=e.useCallback(e=>z.current===Y.current?.side&&function(e,n){if(!n)return!1;const t={x:e.clientX,y:e.clientY};return function(e,n){const{x:t,y:r}=e;let o=!1;for(let e=0,a=n.length-1;e<n.length;a=e++){const c=n[e],s=n[a],u=c.x,i=c.y,l=s.x,d=s.y;i>r!=d>r&&t<(l-u)*(r-i)/(d-i)+u&&(o=!o)}return o}(t,n)}(e,Y.current?.area),[]);return x(Q,{scope:a,searchRef:V,onItemEnter:e.useCallback(e=>{$(e)&&e.preventDefault()},[$]),onItemLeave:e.useCallback(e=>{$(e)||(K.current?.focus(),F(null))},[$]),onTriggerLeave:e.useCallback(e=>{$(e)&&e.preventDefault()},[$]),pointerGraceTimerRef:B,onPointerGraceIntentChange:e.useCallback(e=>{Y.current=e},[]),children:x(W,{...Z,children:x(f,{asChild:!0,trapped:s,onMountAutoFocus:n(i,e=>{e.preventDefault(),K.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:x(u,{asChild:!0,disableOutsidePointerEvents:m,onEscapeKeyDown:v,onPointerDownOutside:_,onFocusOutside:w,onInteractOutside:M,onDismiss:C,children:x(R,{asChild:!0,...I,dir:k.dir,orientation:"vertical",loop:c,currentTabStopId:T,onCurrentTabStopIdChange:F,onEntryFocus:n(h,e=>{k.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:x(g,{role:"menu","aria-orientation":"vertical","data-state":Se(P.open),"data-radix-menu-content":"",dir:k.dir,...D,...b,ref:A,style:{outline:"none",...b.style},onKeyDown:n(b.onKeyDown,e=>{const n=e.target.closest("[data-radix-menu-content]")===e.currentTarget,t=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;n&&("Tab"===e.key&&e.preventDefault(),!t&&r&&q(e.key));const o=K.current;if(e.target!==o)return;if(!O.includes(e.key))return;e.preventDefault();const a=S().filter(e=>!e.disabled).map(e=>e.ref.current);E.includes(e.key)&&a.reverse(),function(e){const n=document.activeElement;for(const t of e){if(t===n)return;if(t.focus(),document.activeElement!==n)return}}(a)}),onBlur:n(t.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),V.current="")}),onPointerMove:n(t.onPointerMove,Le(e=>{const n=e.target,t=H.current!==e.clientX;if(e.currentTarget.contains(n)&&t){const n=e.clientX>H.current?"right":"left";z.current=n,H.current=e.clientX}}))})})})})})})});ee.displayName=J;var ae=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e;return x(M.div,{role:"group",...r,ref:n})});ae.displayName="MenuGroup";var ce=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e;return x(M.div,{...r,ref:n})});ce.displayName="MenuLabel";var se="MenuItem",ue="menu.itemSelect",ie=e.forwardRef((t,o)=>{const{disabled:a=!1,onSelect:c,...s}=t,u=e.useRef(null),i=X(se,t.__scopeMenu),l=$(se,t.__scopeMenu),d=r(o,u),f=e.useRef(!1);return x(le,{...s,ref:d,disabled:a,onClick:n(t.onClick,()=>{const e=u.current;if(!a&&e){const n=new CustomEvent(ue,{bubbles:!0,cancelable:!0});e.addEventListener(ue,e=>c?.(e),{once:!0}),C(e,n),n.defaultPrevented?f.current=!1:i.onClose()}}),onPointerDown:e=>{t.onPointerDown?.(e),f.current=!0},onPointerUp:n(t.onPointerUp,e=>{f.current||e.currentTarget?.click()}),onKeyDown:n(t.onKeyDown,e=>{const n=""!==l.searchRef.current;a||n&&" "===e.key||D.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});ie.displayName=se;var le=e.forwardRef((t,o)=>{const{__scopeMenu:a,disabled:c=!1,textValue:s,...u}=t,i=$(se,a),l=G(a),d=e.useRef(null),f=r(o,d),[p,m]=e.useState(!1),[h,v]=e.useState("");return e.useEffect(()=>{const e=d.current;e&&v((e.textContent??"").trim())},[u.children]),x(F.ItemSlot,{scope:a,disabled:c,textValue:s??h,children:x(b,{asChild:!0,...l,focusable:!c,children:x(M.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...u,ref:f,onPointerMove:n(t.onPointerMove,Le(e=>{if(c)i.onItemLeave(e);else if(i.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:n(t.onPointerLeave,Le(e=>i.onItemLeave(e))),onFocus:n(t.onFocus,()=>m(!0)),onBlur:n(t.onBlur,()=>m(!1))})})})}),de=e.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:o,...a}=e;return x(we,{scope:e.__scopeMenu,checked:r,children:x(ie,{role:"menuitemcheckbox","aria-checked":Te(r)?"mixed":r,...a,ref:t,"data-state":Fe(r),onSelect:n(a.onSelect,()=>o?.(!!Te(r)||!r),{checkForDefaultPrevented:!1})})})});de.displayName="MenuCheckboxItem";var fe="MenuRadioGroup",[pe,me]=A(fe,{value:void 0,onValueChange:()=>{}}),he=e.forwardRef((e,n)=>{const{value:t,onValueChange:r,...o}=e,a=k(r);return x(pe,{scope:e.__scopeMenu,value:t,onValueChange:a,children:x(ae,{...o,ref:n})})});he.displayName=fe;var ve="MenuRadioItem",ge=e.forwardRef((e,t)=>{const{value:r,...o}=e,a=me(ve,e.__scopeMenu),c=r===a.value;return x(we,{scope:e.__scopeMenu,checked:c,children:x(ie,{role:"menuitemradio","aria-checked":c,...o,ref:t,"data-state":Fe(c),onSelect:n(o.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});ge.displayName=ve;var _e="MenuItemIndicator",[we,Me]=A(_e,{checked:!1}),Ce=e.forwardRef((e,n)=>{const{__scopeMenu:t,forceMount:r,...o}=e,a=Me(_e,t);return x(w,{present:r||Te(a.checked)||!0===a.checked,children:x(M.span,{...o,ref:n,"data-state":Fe(a.checked)})})});Ce.displayName=_e;var ye=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e;return x(M.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})});ye.displayName="MenuSeparator";var be=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e,o=j(t);return x(_,{...o,...r,ref:n})});be.displayName="MenuArrow";var Re="MenuSub",[Pe,ke]=A(Re),xe=n=>{const{__scopeMenu:t,children:r,open:o=!1,onOpenChange:a}=n,c=U(Re,t),s=j(t),[u,i]=e.useState(null),[l,d]=e.useState(null),f=k(a);return e.useEffect(()=>(!1===c.open&&f(!1),()=>f(!1)),[c.open,f]),x(h,{...s,children:x(V,{scope:t,open:o,onOpenChange:f,content:l,onContentChange:d,children:x(Pe,{scope:t,contentId:p(),triggerId:p(),trigger:u,onTriggerChange:i,children:r})})})};xe.displayName=Re;var De="MenuSubTrigger",Ee=e.forwardRef((t,r)=>{const a=U(De,t.__scopeMenu),c=X(De,t.__scopeMenu),s=ke(De,t.__scopeMenu),u=$(De,t.__scopeMenu),i=e.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:d}=u,f={__scopeMenu:t.__scopeMenu},p=e.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return e.useEffect(()=>p,[p]),e.useEffect(()=>{const e=l.current;return()=>{window.clearTimeout(e),d(null)}},[l,d]),x(z,{asChild:!0,...f,children:x(le,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":s.contentId,"data-state":Se(a.open),...t,ref:o(r,s.onTriggerChange),onClick:e=>{t.onClick?.(e),t.disabled||e.defaultPrevented||(e.currentTarget.focus(),a.open||a.onOpenChange(!0))},onPointerMove:n(t.onPointerMove,Le(e=>{u.onItemEnter(e),e.defaultPrevented||t.disabled||a.open||i.current||(u.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{a.onOpenChange(!0),p()},100))})),onPointerLeave:n(t.onPointerLeave,Le(e=>{p();const n=a.content?.getBoundingClientRect();if(n){const t=a.content?.dataset.side,r="right"===t,o=r?-5:5,c=n[r?"left":"right"],s=n[r?"right":"left"];u.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:n.top},{x:s,y:n.top},{x:s,y:n.bottom},{x:c,y:n.bottom}],side:t}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(e),e.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:n(t.onKeyDown,e=>{const n=""!==u.searchRef.current;t.disabled||n&&" "===e.key||I[c.dir].includes(e.key)&&(a.onOpenChange(!0),a.content?.focus(),e.preventDefault())})})})});Ee.displayName=De;var Oe="MenuSubContent",Ie=e.forwardRef((t,o)=>{const a=Z(J,t.__scopeMenu),{forceMount:c=a.forceMount,...s}=t,u=U(J,t.__scopeMenu),i=X(J,t.__scopeMenu),l=ke(Oe,t.__scopeMenu),d=e.useRef(null),f=r(o,d);return x(F.Provider,{scope:t.__scopeMenu,children:x(w,{present:c||u.open,children:x(F.Slot,{scope:t.__scopeMenu,children:x(oe,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:f,align:"start",side:"rtl"===i.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{i.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:n(t.onFocusOutside,e=>{e.target!==l.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:n(t.onEscapeKeyDown,e=>{i.onClose(),e.preventDefault()}),onKeyDown:n(t.onKeyDown,e=>{const n=e.currentTarget.contains(e.target),t=S[i.dir].includes(e.key);n&&t&&(u.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});function Se(e){return e?"open":"closed"}function Te(e){return"indeterminate"===e}function Fe(e){return Te(e)?"indeterminate":e?"checked":"unchecked"}function Le(e){return n=>"mouse"===n.pointerType?e(n):void 0}Ie.displayName=Oe;var Ke=Y,Ae=z,Ne=q,je=ee,Ge=ae,Ve=ce,Ue=ie,Be=de,Xe=he,Ye=ge,ze=Ce,He=ye,We=be,Ze=xe,qe=Ee,Je=Ie;export{Ae as A,je as C,Ge as G,Ue as I,Ve as L,Ne as P,Ke as R,He as S,Be as a,ze as b,N as c,Xe as d,Ye as e,Ze as f,qe as g,Je as h,We as i};
|
2
|
+
//# sourceMappingURL=index-BekjHCXg.mjs.map
|