ivt 0.2.4 → 0.2.5
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/alert-dialog/index.mjs.map +1 -1
- package/dist/avatar/index.mjs +1 -1
- package/dist/avatar/index.mjs.map +1 -1
- package/dist/badge/index.mjs +1 -1
- package/dist/base/index.d.ts +4 -0
- 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.d.ts +10 -9
- package/dist/calendar/index.mjs +1 -1
- package/dist/card/index.mjs +1 -1
- package/dist/checkbox/index.mjs +1 -1
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/chunks/accordion-BD1JRhVx.mjs +2 -0
- package/dist/chunks/{accordion-DxayPBXZ.mjs.map → accordion-BD1JRhVx.mjs.map} +1 -1
- package/dist/chunks/{badge-BIhNGnoC.mjs → badge-BlZWYqiz.mjs} +2 -2
- package/dist/chunks/{badge-BIhNGnoC.mjs.map → badge-BlZWYqiz.mjs.map} +1 -1
- package/dist/chunks/{bundle-mjs-BPxOXzif.mjs → bundle-mjs-p2tkjPN1.mjs} +1 -1
- package/dist/chunks/{bundle-mjs-BPxOXzif.mjs.map → bundle-mjs-p2tkjPN1.mjs.map} +1 -1
- package/dist/chunks/{button-kxm0Lckx.mjs → button-DrtQQeut.mjs} +2 -2
- package/dist/chunks/{button-kxm0Lckx.mjs.map → button-DrtQQeut.mjs.map} +1 -1
- package/dist/chunks/calendar-Dtopgd_k.mjs +2 -0
- package/dist/chunks/{calendar-CBJ49e3M.mjs.map → calendar-Dtopgd_k.mjs.map} +1 -1
- package/dist/chunks/check-XiDheatr.mjs +2 -0
- package/dist/chunks/{check-DlWKp3dT.mjs.map → check-XiDheatr.mjs.map} +1 -1
- package/dist/chunks/chevron-down-B1yMwors.mjs +2 -0
- package/dist/chunks/{chevron-down-CWUqY12V.mjs.map → chevron-down-B1yMwors.mjs.map} +1 -1
- package/dist/chunks/chevron-left-HipRXZQ8.mjs +2 -0
- package/dist/chunks/{chevron-left-CJfbOy3n.mjs.map → chevron-left-HipRXZQ8.mjs.map} +1 -1
- package/dist/chunks/chevron-right-BS1_kgp8.mjs +2 -0
- package/dist/chunks/{chevron-right-CepU0QYJ.mjs.map → chevron-right-BS1_kgp8.mjs.map} +1 -1
- package/dist/chunks/command-DzL_b7f4.mjs +2 -0
- package/dist/chunks/{command-DYCg8FQm.mjs.map → command-DzL_b7f4.mjs.map} +1 -1
- package/dist/chunks/{createLucideIcon-Okp8w8Ue.mjs → createLucideIcon-CsAdJd--.mjs} +1 -1
- package/dist/chunks/{createLucideIcon-Okp8w8Ue.mjs.map → createLucideIcon-CsAdJd--.mjs.map} +1 -1
- package/dist/chunks/{dialog-DTcjPj46.mjs → dialog-D8zOlPrU.mjs} +2 -2
- package/dist/chunks/{dialog-DTcjPj46.mjs.map → dialog-D8zOlPrU.mjs.map} +1 -1
- package/dist/chunks/hover-card-Cd6sPuv9.mjs +2 -0
- package/dist/chunks/{hover-card-T6QvJZH3.mjs.map → hover-card-Cd6sPuv9.mjs.map} +1 -1
- package/dist/chunks/{index-Cy8Nz9EO.mjs → index-B70-2oxO.mjs} +1 -1
- package/dist/chunks/{index-Cy8Nz9EO.mjs.map → index-B70-2oxO.mjs.map} +1 -1
- package/dist/chunks/index-B_x_ais9.mjs +2 -0
- package/dist/chunks/index-B_x_ais9.mjs.map +1 -0
- package/dist/chunks/index-C-Of5QmS.mjs +2 -0
- package/dist/chunks/{index-j5UZGMap.mjs.map → index-C-Of5QmS.mjs.map} +1 -1
- package/dist/chunks/{index-BEptPvC9.mjs → index-C2Fe0koc.mjs} +1 -1
- package/dist/chunks/{index-BEptPvC9.mjs.map → index-C2Fe0koc.mjs.map} +1 -1
- package/dist/chunks/index-C5Y3Sf57.mjs +2 -0
- package/dist/chunks/{index-Bmfh-9vj.mjs.map → index-C5Y3Sf57.mjs.map} +1 -1
- package/dist/chunks/index-CDjTdrNO.mjs +2 -0
- package/dist/chunks/{index-DzvdVz0F.mjs.map → index-CDjTdrNO.mjs.map} +1 -1
- package/dist/chunks/{index-Di_4GEUt.mjs → index-CIJFMEHT.mjs} +2 -2
- package/dist/chunks/{index-Di_4GEUt.mjs.map → index-CIJFMEHT.mjs.map} +1 -1
- package/dist/chunks/index-CQLZqpi3.mjs +2 -0
- package/dist/chunks/index-CQLZqpi3.mjs.map +1 -0
- package/dist/chunks/{index-BsSBJ3PL.mjs → index-CTsIdIko.mjs} +2 -2
- package/dist/chunks/{index-BsSBJ3PL.mjs.map → index-CTsIdIko.mjs.map} +1 -1
- package/dist/chunks/{index-BqVtEtRQ.mjs → index-CgLDADnA.mjs} +1 -1
- package/dist/chunks/{index-BqVtEtRQ.mjs.map → index-CgLDADnA.mjs.map} +1 -1
- package/dist/chunks/{index-jhOC7m1Z.mjs → index-DRqB8wXi.mjs} +2 -2
- package/dist/chunks/{index-jhOC7m1Z.mjs.map → index-DRqB8wXi.mjs.map} +1 -1
- package/dist/chunks/{index-sxa3-G-E.mjs → index-Dx9q9PhQ.mjs} +2 -2
- package/dist/chunks/{index-sxa3-G-E.mjs.map → index-Dx9q9PhQ.mjs.map} +1 -1
- package/dist/chunks/{index-g796WVS-.mjs → index-Dxh10iPI.mjs} +1 -1
- package/dist/chunks/{index-g796WVS-.mjs.map → index-Dxh10iPI.mjs.map} +1 -1
- package/dist/chunks/{index-DUhfpjqn.mjs → index-LYeASA5N.mjs} +2 -2
- package/dist/chunks/{index-DUhfpjqn.mjs.map → index-LYeASA5N.mjs.map} +1 -1
- package/dist/chunks/index-ZEFtUcMw.mjs +2 -0
- package/dist/chunks/index-ZEFtUcMw.mjs.map +1 -0
- package/dist/chunks/index-fgRlmr40.mjs +2 -0
- package/dist/chunks/index-fgRlmr40.mjs.map +1 -0
- package/dist/chunks/{index-C-gmRzgE.mjs → index-g_YR6VZJ.mjs} +1 -1
- package/dist/chunks/{index-C-gmRzgE.mjs.map → index-g_YR6VZJ.mjs.map} +1 -1
- package/dist/chunks/{input-DyBbEcZb.mjs → input-B-LMt_h_.mjs} +2 -2
- package/dist/chunks/{input-DyBbEcZb.mjs.map → input-B-LMt_h_.mjs.map} +1 -1
- package/dist/chunks/{label-7xIUYreG.mjs → label-D5csAh9b.mjs} +2 -2
- package/dist/chunks/{label-7xIUYreG.mjs.map → label-D5csAh9b.mjs.map} +1 -1
- package/dist/chunks/{pagination-BQCy5ruZ.mjs → pagination-BsXOOwtn.mjs} +2 -2
- package/dist/chunks/{pagination-BQCy5ruZ.mjs.map → pagination-BsXOOwtn.mjs.map} +1 -1
- package/dist/chunks/popover-Dov1Buds.mjs +2 -0
- package/dist/chunks/{popover-BaOty87a.mjs.map → popover-Dov1Buds.mjs.map} +1 -1
- package/dist/chunks/{progress-B01RWEwW.mjs → progress-C3Y_Swsn.mjs} +2 -2
- package/dist/chunks/{progress-B01RWEwW.mjs.map → progress-C3Y_Swsn.mjs.map} +1 -1
- package/dist/chunks/scroll-area-DW059l0P.mjs +2 -0
- package/dist/chunks/{scroll-area-DBEmK194.mjs.map → scroll-area-DW059l0P.mjs.map} +1 -1
- package/dist/chunks/{select-DluWFNkM.mjs → select-vTAesIVv.mjs} +2 -2
- package/dist/chunks/{select-DluWFNkM.mjs.map → select-vTAesIVv.mjs.map} +1 -1
- package/dist/chunks/{separator-Bj88WMYr.mjs → separator-20h7d7UI.mjs} +2 -2
- package/dist/chunks/{separator-Bj88WMYr.mjs.map → separator-20h7d7UI.mjs.map} +1 -1
- package/dist/chunks/{skeleton-BL6dx9Bm.mjs → skeleton-B4z6D5eV.mjs} +2 -2
- package/dist/chunks/{skeleton-BL6dx9Bm.mjs.map → skeleton-B4z6D5eV.mjs.map} +1 -1
- package/dist/chunks/{sortable-DrKB22S8.mjs → sortable-D7jRCUMx.mjs} +2 -2
- package/dist/chunks/{sortable-DrKB22S8.mjs.map → sortable-D7jRCUMx.mjs.map} +1 -1
- package/dist/chunks/{table-BvtQHwsd.mjs → table-CvqlUil9.mjs} +2 -2
- package/dist/chunks/{table-BvtQHwsd.mjs.map → table-CvqlUil9.mjs.map} +1 -1
- package/dist/chunks/toggle-BsT2kdMw.mjs +2 -0
- package/dist/chunks/toggle-BsT2kdMw.mjs.map +1 -0
- package/dist/chunks/{tslib.es6-1P1xnW5u.mjs → tslib.es6-CISrQAm2.mjs} +1 -1
- package/dist/chunks/{tslib.es6-1P1xnW5u.mjs.map → tslib.es6-CISrQAm2.mjs.map} +1 -1
- package/dist/chunks/{utils-BNmnOQuQ.mjs → utils-Dp2SHrBW.mjs} +2 -2
- package/dist/chunks/{utils-BNmnOQuQ.mjs.map → utils-Dp2SHrBW.mjs.map} +1 -1
- package/dist/chunks/x-CrlN9yY1.mjs +2 -0
- package/dist/chunks/{x-Dnrlrmes.mjs.map → x-CrlN9yY1.mjs.map} +1 -1
- package/dist/combobox/index.d.ts +53 -0
- package/dist/combobox/index.mjs +2 -0
- package/dist/combobox/index.mjs.map +1 -0
- package/dist/command/index.mjs +1 -1
- package/dist/data-table/index.mjs +1 -1
- package/dist/data-table/index.mjs.map +1 -1
- package/dist/dialog/index.mjs +1 -1
- package/dist/dropdown-menu/index.mjs +1 -1
- package/dist/dropdown-menu/index.mjs.map +1 -1
- package/dist/dropzone/index.mjs +1 -1
- package/dist/dropzone/index.mjs.map +1 -1
- package/dist/form/index.mjs +1 -1
- package/dist/form/index.mjs.map +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/multi-select/index.mjs +1 -1
- package/dist/multi-select/index.mjs.map +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.d.ts +2 -0
- package/dist/radio-group/index.mjs +2 -0
- package/dist/radio-group/index.mjs.map +1 -0
- 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/sheet/index.mjs.map +1 -1
- package/dist/skeleton/index.mjs +1 -1
- package/dist/sonner/index.mjs +1 -1
- package/dist/sonner/index.mjs.map +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/tabs/index.mjs.map +1 -1
- package/dist/textarea/index.d.ts +2 -0
- package/dist/textarea/index.mjs +2 -0
- package/dist/textarea/index.mjs.map +1 -0
- package/dist/toast/index.mjs +1 -1
- package/dist/toast/index.mjs.map +1 -1
- package/dist/toggle/index.d.ts +13 -0
- package/dist/toggle/index.mjs +2 -0
- package/dist/toggle/index.mjs.map +1 -0
- package/dist/toggle-group/index.d.ts +12 -0
- package/dist/toggle-group/index.mjs +2 -0
- package/dist/toggle-group/index.mjs.map +1 -0
- package/dist/tooltip/index.mjs +1 -1
- package/dist/tooltip/index.mjs.map +1 -1
- package/package.json +24 -1
- package/dist/chunks/accordion-DxayPBXZ.mjs +0 -2
- package/dist/chunks/calendar-CBJ49e3M.mjs +0 -2
- package/dist/chunks/check-DlWKp3dT.mjs +0 -2
- package/dist/chunks/chevron-down-CWUqY12V.mjs +0 -2
- package/dist/chunks/chevron-left-CJfbOy3n.mjs +0 -2
- package/dist/chunks/chevron-right-CepU0QYJ.mjs +0 -2
- package/dist/chunks/command-DYCg8FQm.mjs +0 -2
- package/dist/chunks/hover-card-T6QvJZH3.mjs +0 -2
- package/dist/chunks/index-Bmfh-9vj.mjs +0 -2
- package/dist/chunks/index-DzvdVz0F.mjs +0 -2
- package/dist/chunks/index-Gmu-glAo.mjs +0 -2
- package/dist/chunks/index-Gmu-glAo.mjs.map +0 -1
- package/dist/chunks/index-j5UZGMap.mjs +0 -2
- package/dist/chunks/index-pz7_bV3J.mjs +0 -2
- package/dist/chunks/index-pz7_bV3J.mjs.map +0 -1
- package/dist/chunks/popover-BaOty87a.mjs +0 -2
- package/dist/chunks/scroll-area-DBEmK194.mjs +0 -2
- package/dist/chunks/x-Dnrlrmes.mjs +0 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index-Bmfh-9vj.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":"+ZAaA,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,GACzBiC,EAAwBxC,EAAAuB,QAAO,IAC9BkB,EAAqBC,GAAgC1C,EAAAoC,SAAS,GAUrE,OARMpC,EAAA2C,UAAU,KACd,MAAMC,EA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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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,OAAQC,GAASA,EAAKC,WACpBM,IAAKP,GAASA,EAAK9D,IAAIkC,SAElD,GAAoB,SAAhBkD,EAAwBQ,EAAeC,eAAQ,GAC1B,SAAhBT,GAA0C,SAAhBA,EAAwB,CACrC,SAAhBA,GAAwBQ,EAAeC,UAC3C,MAAMC,EAAeF,EAAeG,QAAQ3C,EAAMG,eAClDqC,EAAiBhB,EAAQzE,MA8DP6F,EA7DYF,EAAe,GA6DvCG,EA7DQL,GA8DfvB,IAAO,CAAC6B,EAAGC,IAAUF,GAAOD,EAAaG,GAASF,EAAMG,UA7DnDR,EAAeS,MAAMP,EAAe,EAC1C,CAMAQ,WAAW,IAAMtC,EAAW4B,GAC9B,CAoDZ,IAAsBK,EAAYD,IAjDvBnG,SAAoB,mBAAbA,EACJA,EAAS,CAAEgF,mBAAkB0B,WAAgC,MAApBlG,IACzCR,QAOd2E,EAAqBvE,YAAcsE,EAKnC,IAAMgB,EAAuD,CAC3DiB,UAAW,OAAQC,QAAS,OAC5BC,WAAY,OAAQC,UAAW,OAC/BC,OAAQ,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]}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import*as e from"react";import{c as o}from"./index-CQLZqpi3.mjs";import{u as t}from"./index-fgRlmr40.mjs";import{c as n,a as r}from"./index-B70-2oxO.mjs";import{u as a}from"./index-Dx9q9PhQ.mjs";import{u as i}from"./index-CIJFMEHT.mjs";import{P as s,D as c}from"./index-C-Of5QmS.mjs";import{h as l,R as d,u,F as p}from"./index-CTsIdIko.mjs";import{P as f}from"./index-ZEFtUcMw.mjs";import{P as m}from"./index-Dxh10iPI.mjs";import{createSlot as g}from"@radix-ui/react-slot";import{jsx as D,jsxs as h,Fragment as v}from"react/jsx-runtime";var R="Dialog",[_,y]=n(R),[b,C]=_(R),I=o=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:c,modal:l=!0}=o,d=e.useRef(null),u=e.useRef(null),[p,f]=i({prop:r,defaultProp:s??!1,onChange:c,caller:R});return D(b,{scope:t,triggerRef:d,contentRef:u,contentId:a(),titleId:a(),descriptionId:a(),open:p,onOpenChange:f,onOpenToggle:e.useCallback(()=>f(e=>!e),[f]),modal:l,children:n})};I.displayName=R;var O="DialogTrigger",w=e.forwardRef((e,n)=>{const{__scopeDialog:r,...a}=e,i=C(O,r),s=t(n,i.triggerRef);return D(m.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Z(i.open),...a,ref:s,onClick:o(e.onClick,i.onOpenToggle)})});w.displayName=O;var F="DialogPortal",[x,N]=_(F,{forceMount:void 0}),P=o=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=o,i=C(F,t);return D(x,{scope:t,forceMount:n,children:e.Children.map(r,e=>D(f,{present:n||i.open,children:D(s,{asChild:!0,container:a,children:e})}))})};P.displayName=F;var E="DialogOverlay",j=e.forwardRef((e,o)=>{const t=N(E,e.__scopeDialog),{forceMount:n=t.forceMount,...r}=e,a=C(E,e.__scopeDialog);return a.modal?D(f,{present:n||a.open,children:D(M,{...r,ref:o})}):null});j.displayName=E;var A=g("DialogOverlay.RemoveScroll"),M=e.forwardRef((e,o)=>{const{__scopeDialog:t,...n}=e,r=C(E,t);return D(d,{as:A,allowPinchZoom:!0,shards:[r.contentRef],children:D(m.div,{"data-state":Z(r.open),...n,ref:o,style:{pointerEvents:"auto",...n.style}})})}),T="DialogContent",k=e.forwardRef((e,o)=>{const t=N(T,e.__scopeDialog),{forceMount:n=t.forceMount,...r}=e,a=C(T,e.__scopeDialog);return D(f,{present:n||a.open,children:a.modal?D($,{...r,ref:o}):D(W,{...r,ref:o})})});k.displayName=T;var $=e.forwardRef((n,r)=>{const a=C(T,n.__scopeDialog),i=e.useRef(null),s=t(r,a.contentRef,i);return e.useEffect(()=>{const e=i.current;if(e)return l(e)},[]),D(S,{...n,ref:s,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:o(n.onCloseAutoFocus,e=>{e.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:o(n.onPointerDownOutside,e=>{const o=e.detail.originalEvent,t=0===o.button&&!0===o.ctrlKey;(2===o.button||t)&&e.preventDefault()}),onFocusOutside:o(n.onFocusOutside,e=>e.preventDefault())})}),W=e.forwardRef((o,t)=>{const n=C(T,o.__scopeDialog),r=e.useRef(!1),a=e.useRef(!1);return D(S,{...o,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{o.onCloseAutoFocus?.(e),e.defaultPrevented||(r.current||n.triggerRef.current?.focus(),e.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:e=>{o.onInteractOutside?.(e),e.defaultPrevented||(r.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const t=e.target,i=n.triggerRef.current?.contains(t);i&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),S=e.forwardRef((o,n)=>{const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=o,d=C(T,r),f=e.useRef(null),m=t(n,f);return u(),h(v,{children:[D(p,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:D(c,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Z(d.open),...l,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),h(v,{children:[D(L,{titleId:d.titleId}),D(Q,{contentRef:f,descriptionId:d.descriptionId})]})]})}),B="DialogTitle",q=e.forwardRef((e,o)=>{const{__scopeDialog:t,...n}=e,r=C(B,t);return D(m.h2,{id:r.titleId,...n,ref:o})});q.displayName=B;var H="DialogDescription",K=e.forwardRef((e,o)=>{const{__scopeDialog:t,...n}=e,r=C(H,t);return D(m.p,{id:r.descriptionId,...n,ref:o})});K.displayName=H;var U="DialogClose",V=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=C(U,n);return D(m.button,{type:"button",...r,ref:t,onClick:o(e.onClick,()=>a.onOpenChange(!1))})});function Z(e){return e?"open":"closed"}V.displayName=U;var z="DialogTitleWarning",[G,J]=r(z,{contentName:T,titleName:B,docsSlug:"dialog"}),L=({titleId:o})=>{const t=J(z),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return e.useEffect(()=>{if(o){document.getElementById(o)}},[n,o]),null},Q=({contentRef:o,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${J("DialogDescriptionWarning").contentName}}.`;return e.useEffect(()=>{const e=o.current?.getAttribute("aria-describedby");if(t&&e){document.getElementById(t)}},[n,o,t]),null},X=I,Y=w,ee=P,oe=j,te=k,ne=q,re=K,ae=V;export{ae as C,re as D,oe as O,ee as P,X as R,ne as T,G as W,te as a,Y as b,y as c};
|
2
|
+
//# sourceMappingURL=index-CDjTdrNO.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index-DzvdVz0F.mjs","sources":["../../node_modules/@radix-ui/react-dialog/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/dialog.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContext, createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { hideOthers } from \"aria-hidden\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar DIALOG_NAME = \"Dialog\";\nvar [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\nvar [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);\nvar Dialog = (props) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const triggerRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DIALOG_NAME\n });\n return /* @__PURE__ */ jsx(\n DialogProvider,\n {\n scope: __scopeDialog,\n triggerRef,\n contentRef,\n contentId: useId(),\n titleId: useId(),\n descriptionId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children\n }\n );\n};\nDialog.displayName = DIALOG_NAME;\nvar TRIGGER_NAME = \"DialogTrigger\";\nvar DialogTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.contentId,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n }\n);\nDialogTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DialogPortal\";\nvar [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar DialogPortal = (props) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children: child }) })) });\n};\nDialogPortal.displayName = PORTAL_NAME;\nvar OVERLAY_NAME = \"DialogOverlay\";\nvar DialogOverlay = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;\n }\n);\nDialogOverlay.displayName = OVERLAY_NAME;\nvar Slot = createSlot(\"DialogOverlay.RemoveScroll\");\nvar DialogOverlayImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(context.open),\n ...overlayProps,\n ref: forwardedRef,\n style: { pointerEvents: \"auto\", ...overlayProps.style }\n }\n ) })\n );\n }\n);\nvar CONTENT_NAME = \"DialogContent\";\nvar DialogContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nDialogContent.displayName = CONTENT_NAME;\nvar DialogContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: true,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (isRightClick) event.preventDefault();\n }),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault()\n )\n }\n );\n }\n);\nvar DialogContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar DialogContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n useFocusGuards();\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n role: \"dialog\",\n id: context.contentId,\n \"aria-describedby\": context.descriptionId,\n \"aria-labelledby\": context.titleId,\n \"data-state\": getState(context.open),\n ...contentProps,\n ref: composedRefs,\n onDismiss: () => context.onOpenChange(false)\n }\n )\n }\n ),\n /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }),\n /* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })\n ] })\n ] });\n }\n);\nvar TITLE_NAME = \"DialogTitle\";\nvar DialogTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });\n }\n);\nDialogTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"DialogDescription\";\nvar DialogDescription = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });\n }\n);\nDialogDescription.displayName = DESCRIPTION_NAME;\nvar CLOSE_NAME = \"DialogClose\";\nvar DialogClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nDialogClose.displayName = CLOSE_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar TITLE_WARNING_NAME = \"DialogTitleWarning\";\nvar [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"dialog\"\n});\nvar TitleWarning = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n const MESSAGE = `\\`${titleWarningContext.contentName}\\` requires a \\`${titleWarningContext.titleName}\\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \\`${titleWarningContext.titleName}\\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) console.error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n return null;\n};\nvar DESCRIPTION_WARNING_NAME = \"DialogDescriptionWarning\";\nvar DescriptionWarning = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute(\"aria-describedby\");\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n return null;\n};\nvar Root = Dialog;\nvar Trigger = DialogTrigger;\nvar Portal = DialogPortal;\nvar Overlay = DialogOverlay;\nvar Content = DialogContent;\nvar Title = DialogTitle;\nvar Description = DialogDescription;\nvar Close = DialogClose;\nexport {\n Close,\n Content,\n Description,\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n WarningProvider,\n createDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DIALOG_NAME","createDialogContext","createDialogScope","createContextScope","DialogProvider","useDialogContext","Dialog","props","__scopeDialog","children","open","openProp","defaultOpen","onOpenChange","modal","triggerRef","React","useRef","contentRef","setOpen","useControllableState","prop","defaultProp","onChange","caller","jsx","scope","contentId","useId","titleId","descriptionId","onOpenToggle","useCallback","prevOpen","displayName","TRIGGER_NAME","DialogTrigger","forwardRef","forwardedRef","triggerProps","context","composedTriggerRef","useComposedRefs","Primitive","button","type","getState","ref","onClick","composeEventHandlers","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","DialogPortal","container","Children","map","child","Presence","present","PortalPrimitive","asChild","OVERLAY_NAME","DialogOverlay","portalContext","overlayProps","DialogOverlayImpl","Slot","createSlot","RemoveScroll","as","allowPinchZoom","shards","div","style","pointerEvents","CONTENT_NAME","DialogContent","contentProps","DialogContentModal","DialogContentNonModal","composedRefs","useEffect","content","current","hideOthers","DialogContentImpl","trapFocus","disableOutsidePointerEvents","onCloseAutoFocus","event","preventDefault","focus","onPointerDownOutside","originalEvent","detail","ctrlLeftClick","ctrlKey","onFocusOutside","hasInteractedOutsideRef","hasPointerDownOutsideRef","defaultPrevented","onInteractOutside","target","targetIsTrigger","contains","onOpenAutoFocus","useFocusGuards","jsxs","Fragment","FocusScope","loop","trapped","onMountAutoFocus","onUnmountAutoFocus","DismissableLayer","role","id","onDismiss","TitleWarning","DescriptionWarning","TITLE_NAME","DialogTitle","titleProps","h2","DESCRIPTION_NAME","DialogDescription","descriptionProps","p","CLOSE_NAME","DialogClose","closeProps","TITLE_WARNING_NAME","WarningProvider","useWarningContext","createContext","contentName","titleName","docsSlug","titleWarningContext","MESSAGE","document","getElementById","describedById","getAttribute","Root","Trigger","Portal","Overlay","Content","Title","Description","Close"],"mappings":"qdAsBA,IAAMA,EAAc,UAGbC,EAAqBC,GAAqBC,EAAmBH,IAc7DI,EAAgBC,GAAoBJ,EAAwCD,GAU7EM,EAAiCC,IACrC,MAAMC,cACJA,EAAAC,SACAA,EACAC,KAAMC,EAAAC,YACNA,EAAAC,aACAA,EAAAC,MACAA,GAAQ,GACNP,EACEQ,EAAmBC,EAAAC,OAA0B,MAC7CC,EAAmBF,EAAAC,OAA6B,OAC/CP,EAAMS,GAAWC,EAAqB,CAC3CC,KAAMV,EACNW,YAAaV,IAAe,EAC5BW,SAAUV,EACVW,OAAQxB,IAGV,OACEyB,EAACrB,EAAA,CACCsB,MAAOlB,EACPO,aACAG,aACAS,UAAWC,IACXC,QAASD,IACTE,cAAeF,IACflB,OACAG,aAAcM,EACdY,aAAoBf,EAAAgB,YAAY,IAAMb,EAASc,IAAcA,GAAW,CAACd,IACzEL,QAECL,cAKPH,EAAO4B,YAAclC,EAMrB,IAAMmC,EAAe,gBAMfC,EAAsBpB,EAAAqB,WAC1B,CAAC9B,EAAw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,QACzB,CANAyH,EAAYjG,YAAcgG,EAQ1B,IAAMG,EAAqB,sBAEpBC,EAAiBC,GAAqBC,EAAcH,EAAoB,CAC7EI,YAAa5D,EACb6D,UAAWhB,EACXiB,SAAU,WAKNnB,EAA4C,EAAG3F,cACnD,MAAM+G,EAAsBL,EAAkBF,GAExCQ,EAAU,KAAKD,EAAoBH,8BAA8BG,EAAoBF,wGAEjEE,EAAoBF,gJAE4BE,EAAoBD,WAS9F,OAPM3H,EAAAmE,UAAU,KACd,GAAItD,EAAS,CACMiH,SAASC,eAAelH,EAE3C,GACC,CAACgH,EAAShH,IAEN,MAUH4F,EAAwD,EAAGvG,aAAYY,oBAC3E,MACM+G,EAAU,6EADkBN,EARH,4BASwFE,gBAWvH,OATMzH,EAAAmE,UAAU,KACd,MAAM6D,EAAgB9H,EAAWmE,SAAS4D,aAAa,oBAEvD,GAAInH,GAAiBkH,EAAe,CACXF,SAASC,eAAejH,EAEjD,GACC,CAAC+G,EAAS3H,EAAYY,IAElB,MAGHoH,EAAO5I,EACP6I,EAAU/G,EACVgH,GAAS9F,EACT+F,GAAUrF,EACVsF,GAAUxE,EACVyE,GAAQ5B,EACR6B,GAAczB,EACd0B,GAAQtB","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index-CDjTdrNO.mjs","sources":["../../node_modules/@radix-ui/react-dialog/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/dialog.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContext, createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { hideOthers } from \"aria-hidden\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar DIALOG_NAME = \"Dialog\";\nvar [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\nvar [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);\nvar Dialog = (props) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const triggerRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DIALOG_NAME\n });\n return /* @__PURE__ */ jsx(\n DialogProvider,\n {\n scope: __scopeDialog,\n triggerRef,\n contentRef,\n contentId: useId(),\n titleId: useId(),\n descriptionId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children\n }\n );\n};\nDialog.displayName = DIALOG_NAME;\nvar TRIGGER_NAME = \"DialogTrigger\";\nvar DialogTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.contentId,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n }\n);\nDialogTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DialogPortal\";\nvar [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar DialogPortal = (props) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children: child }) })) });\n};\nDialogPortal.displayName = PORTAL_NAME;\nvar OVERLAY_NAME = \"DialogOverlay\";\nvar DialogOverlay = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;\n }\n);\nDialogOverlay.displayName = OVERLAY_NAME;\nvar Slot = createSlot(\"DialogOverlay.RemoveScroll\");\nvar DialogOverlayImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(context.open),\n ...overlayProps,\n ref: forwardedRef,\n style: { pointerEvents: \"auto\", ...overlayProps.style }\n }\n ) })\n );\n }\n);\nvar CONTENT_NAME = \"DialogContent\";\nvar DialogContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nDialogContent.displayName = CONTENT_NAME;\nvar DialogContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: true,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (isRightClick) event.preventDefault();\n }),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault()\n )\n }\n );\n }\n);\nvar DialogContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar DialogContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n useFocusGuards();\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n role: \"dialog\",\n id: context.contentId,\n \"aria-describedby\": context.descriptionId,\n \"aria-labelledby\": context.titleId,\n \"data-state\": getState(context.open),\n ...contentProps,\n ref: composedRefs,\n onDismiss: () => context.onOpenChange(false)\n }\n )\n }\n ),\n /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }),\n /* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })\n ] })\n ] });\n }\n);\nvar TITLE_NAME = \"DialogTitle\";\nvar DialogTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });\n }\n);\nDialogTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"DialogDescription\";\nvar DialogDescription = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });\n }\n);\nDialogDescription.displayName = DESCRIPTION_NAME;\nvar CLOSE_NAME = \"DialogClose\";\nvar DialogClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nDialogClose.displayName = CLOSE_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar TITLE_WARNING_NAME = \"DialogTitleWarning\";\nvar [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"dialog\"\n});\nvar TitleWarning = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n const MESSAGE = `\\`${titleWarningContext.contentName}\\` requires a \\`${titleWarningContext.titleName}\\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \\`${titleWarningContext.titleName}\\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) console.error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n return null;\n};\nvar DESCRIPTION_WARNING_NAME = \"DialogDescriptionWarning\";\nvar DescriptionWarning = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute(\"aria-describedby\");\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n return null;\n};\nvar Root = Dialog;\nvar Trigger = DialogTrigger;\nvar Portal = DialogPortal;\nvar Overlay = DialogOverlay;\nvar Content = DialogContent;\nvar Title = DialogTitle;\nvar Description = DialogDescription;\nvar Close = DialogClose;\nexport {\n Close,\n Content,\n Description,\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n WarningProvider,\n createDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DIALOG_NAME","createDialogContext","createDialogScope","createContextScope","DialogProvider","useDialogContext","Dialog","props","__scopeDialog","children","open","openProp","defaultOpen","onOpenChange","modal","triggerRef","React","useRef","contentRef","setOpen","useControllableState","prop","defaultProp","onChange","caller","jsx","scope","contentId","useId","titleId","descriptionId","onOpenToggle","useCallback","prevOpen","displayName","TRIGGER_NAME","DialogTrigger","forwardRef","forwardedRef","triggerProps","context","composedTriggerRef","useComposedRefs","Primitive","button","type","getState","ref","onClick","composeEventHandlers","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","DialogPortal","container","Children","map","child","Presence","present","PortalPrimitive","asChild","OVERLAY_NAME","DialogOverlay","portalContext","overlayProps","DialogOverlayImpl","Slot","createSlot","RemoveScroll","as","allowPinchZoom","shards","div","style","pointerEvents","CONTENT_NAME","DialogContent","contentProps","DialogContentModal","DialogContentNonModal","composedRefs","useEffect","content","current","hideOthers","DialogContentImpl","trapFocus","disableOutsidePointerEvents","onCloseAutoFocus","event","preventDefault","focus","onPointerDownOutside","originalEvent","detail","ctrlLeftClick","ctrlKey","onFocusOutside","hasInteractedOutsideRef","hasPointerDownOutsideRef","defaultPrevented","onInteractOutside","target","targetIsTrigger","contains","onOpenAutoFocus","useFocusGuards","jsxs","Fragment","FocusScope","loop","trapped","onMountAutoFocus","onUnmountAutoFocus","DismissableLayer","role","id","onDismiss","TitleWarning","DescriptionWarning","TITLE_NAME","DialogTitle","titleProps","h2","DESCRIPTION_NAME","DialogDescription","descriptionProps","p","CLOSE_NAME","DialogClose","closeProps","TITLE_WARNING_NAME","WarningProvider","useWarningContext","createContext","contentName","titleName","docsSlug","titleWarningContext","MESSAGE","document","getElementById","describedById","getAttribute","Root","Trigger","Portal","Overlay","Content","Title","Description","Close"],"mappings":"yhBAsBA,IAAMA,EAAc,UAGbC,EAAqBC,GAAqBC,EAAmBH,IAc7DI,EAAgBC,GAAoBJ,EAAwCD,GAU7EM,EAAiCC,IACrC,MAAMC,cACJA,EAAAC,SACAA,EACAC,KAAMC,EAAAC,YACNA,EAAAC,aACAA,EAAAC,MACAA,GAAQ,GACNP,EACEQ,EAAmBC,EAAAC,OAA0B,MAC7CC,EAAmBF,EAAAC,OAA6B,OAC/CP,EAAMS,GAAWC,EAAqB,CAC3CC,KAAMV,EACNW,YAAaV,IAAe,EAC5BW,SAAUV,EACVW,OAAQxB,IAGV,OACEyB,EAACrB,EAAA,CACCsB,MAAOlB,EACPO,aACAG,aACAS,UAAWC,IACXC,QAASD,IACTE,cAAeF,IACflB,OACAG,aAAcM,EACdY,aAAoBf,EAAAgB,YAAY,IAAMb,EAASc,IAAcA,GAAW,CAACd,IACzEL,QAECL,cAKPH,EAAO4B,YAAclC,EAMrB,IAAMmC,EAAe,gBAMfC,EAAsBpB,EAAAqB,WAC1B,CAAC9B,EAAwC+B,KACvC,MAAM9B,cAAEA,KAAkB+B,GAAiBhC,EACrCiC,EAAUnC,EAAiB8B,EAAc3B,GACzCiC,EAAqBC,EAAgBJ,EAAcE,EAAQzB,YACjE,OACEU,EAACkB,EAAUC,OAAV,CACCC,KAAK,SACL,gBAAc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,EAAsBL,EAAkBF,GAExCQ,EAAU,KAAKD,EAAoBH,8BAA8BG,EAAoBF,wGAEjEE,EAAoBF,gJAE4BE,EAAoBD,WAS9F,OAPM3H,EAAAmE,UAAU,KACd,GAAItD,EAAS,CACMiH,SAASC,eAAelH,EAE3C,GACC,CAACgH,EAAShH,IAEN,MAUH4F,EAAwD,EAAGvG,aAAYY,oBAC3E,MACM+G,EAAU,6EADkBN,EARH,4BASwFE,gBAWvH,OATMzH,EAAAmE,UAAU,KACd,MAAM6D,EAAgB9H,EAAWmE,SAAS4D,aAAa,oBAEvD,GAAInH,GAAiBkH,EAAe,CACXF,SAASC,eAAejH,EAEjD,GACC,CAAC+G,EAAS3H,EAAYY,IAElB,MAGHoH,EAAO5I,EACP6I,EAAU/G,EACVgH,GAAS9F,EACT+F,GAAUrF,EACVsF,GAAUxE,EACVyE,GAAQ5B,EACR6B,GAAczB,EACd0B,GAAQtB","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-g_YR6VZJ.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-CIJFMEHT.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index-
|
1
|
+
{"version":3,"file":"index-CIJFMEHT.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]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index-CQLZqpi3.mjs","sources":["../../node_modules/@radix-ui/primitive/dist/index.mjs"],"sourcesContent":["// packages/core/primitive/src/primitive.tsx\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\nexport {\n composeEventHandlers\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["composeEventHandlers","originalEventHandler","ourEventHandler","checkForDefaultPrevented","event","defaultPrevented"],"mappings":"AAAA,SAASA,EACPC,EACAC,GACAC,yBAAEA,GAA2B,GAAS,IAEtC,OAAO,SAAqBC,GAG1B,GAFAH,IAAuBG,IAEU,IAA7BD,IAAuCC,EAAMC,iBAC/C,OAAOH,IAAkBE,EAE7B,CACF","x_google_ignoreList":[0]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as e from"react";import{useState as t}from"react";import{u as n}from"./index-pz7_bV3J.mjs";import{P as r}from"./index-g796WVS-.mjs";import{u as o}from"./index-BqVtEtRQ.mjs";import{jsx as a}from"react/jsx-runtime";import{_ as c,a as u,b as i}from"./tslib.es6-1P1xnW5u.mjs";var s="focusScope.autoFocusOnMount",l="focusScope.autoFocusOnUnmount",d={bubbles:!1,cancelable:!0},f=e.forwardRef((t,c)=>{const{loop:u=!1,trapped:i=!1,onMountAutoFocus:f,onUnmountAutoFocus:p,...y}=t,[E,b]=e.useState(null),w=o(f),S=o(p),C=e.useRef(null),k=n(c,e=>b(e)),M=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(i){let e=function(e){if(M.paused||!E)return;const t=e.target;E.contains(t)?C.current=t:h(C.current,{select:!0})},t=function(e){if(M.paused||!E)return;const t=e.relatedTarget;null!==t&&(E.contains(t)||h(C.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&h(E)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return E&&r.observe(E,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[i,E,M.paused]),e.useEffect(()=>{if(E){g.add(M);const t=document.activeElement;if(!E.contains(t)){const n=new CustomEvent(s,d);E.addEventListener(s,w),E.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(h(r,{select:t}),document.activeElement!==n)return}((e=v(E),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&h(E))}return()=>{E.removeEventListener(s,w),setTimeout(()=>{const e=new CustomEvent(l,d);E.addEventListener(l,S),E.dispatchEvent(e),e.defaultPrevented||h(t??document.body,{select:!0}),E.removeEventListener(l,S),g.remove(M)},0)}}var e},[E,w,S,M]);const N=e.useCallback(e=>{if(!u&&!i)return;if(M.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,o]=function(e){const t=v(e),n=m(t,e),r=m(t.reverse(),e);return[n,r]}(t);r&&o?e.shiftKey||n!==o?e.shiftKey&&n===r&&(e.preventDefault(),u&&h(o,{select:!0})):(e.preventDefault(),u&&h(r,{select:!0})):n===t&&e.preventDefault()}},[u,i,M.paused]);return a(r.div,{tabIndex:-1,...y,ref:k,onKeyDown:N})});function v(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function m(e,t){for(const n of e)if(!p(n,{upTo:t}))return n}function p(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function h(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}f.displayName="FocusScope";var g=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=y(e,t),e.unshift(t)},remove(t){e=y(e,t),e[0]?.resume()}}}();function y(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var E=0;function b(){e.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??w()),document.body.insertAdjacentElement("beforeend",e[1]??w()),E++,()=>{1===E&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),E--}},[])}function w(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var S="right-scroll-bar-position",C="width-before-scroll-bar";function k(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var M="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,N=new WeakMap;function R(e,n){var r,o,a,c=(r=null,o=function(t){return e.forEach(function(e){return k(e,t)})},(a=t(function(){return{value:r,callback:o,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}})[0]).callback=o,a.facade);return M(function(){var t=N.get(c);if(t){var n=new Set(t),r=new Set(e),o=c.current;n.forEach(function(e){r.has(e)||k(e,null)}),r.forEach(function(e){n.has(e)||k(e,o)})}N.set(c,e)},[e]),c}function A(e){return e}var T=function(t){var n=t.sideCar,r=u(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return e.createElement(o,c({},r))};T.isSideCarExport=!0;var L=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=A);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},c=function(){return Promise.resolve().then(a)};c(),n={push:function(e){t.push(e),c()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=c({async:!0,ssr:!1},e),t}(),x=function(){},P=e.forwardRef(function(t,n){var r=e.useRef(null),o=e.useState({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:x}),a=o[0],i=o[1],s=t.forwardProps,l=t.children,d=t.className,f=t.removeScrollBar,v=t.enabled,m=t.shards,p=t.sideCar,h=t.noRelative,g=t.noIsolation,y=t.inert,E=t.allowPinchZoom,b=t.as,w=void 0===b?"div":b,S=t.gapMode,C=u(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=p,M=R([r,n]),N=c(c({},C),a);return e.createElement(e.Fragment,null,v&&e.createElement(k,{sideCar:L,removeScrollBar:f,shards:m,noRelative:h,noIsolation:g,inert:y,setCallbacks:i,allowPinchZoom:!!E,lockRef:r,gapMode:S}),s?e.cloneElement(e.Children.only(l),c(c({},N),{ref:M})):e.createElement(w,c({},N,{className:d,ref:M}),l))});P.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},P.classNames={fullWidth:C,zeroRight:S};function F(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var I=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=F())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_=function(){var t,n=(t=I(),function(n,r){e.useEffect(function(){return t.add(n),function(){t.remove()}},[n&&r])});return function(e){var t=e.styles,r=e.dynamic;return n(t,r),null}},W={left:0,top:0,right:0,gap:0},B=function(e){return parseInt(e||"",10)||0},D=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return W;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[B(n),B(r),B(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},j=_(),K="data-scroll-locked",O=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,u=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(u,"px ").concat(r,";\n }\n body[").concat(K,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(c,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(u,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(S," {\n right: ").concat(u,"px ").concat(r,";\n }\n \n .").concat(C," {\n margin-right: ").concat(u,"px ").concat(r,";\n }\n \n .").concat(S," .").concat(S," {\n right: 0 ").concat(r,";\n }\n \n .").concat(C," .").concat(C," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(K,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(u,"px;\n }\n")},X=function(){var e=parseInt(document.body.getAttribute(K)||"0",10);return isFinite(e)?e:0},Y=function(t){var n=t.noRelative,r=t.noImportant,o=t.gapMode,a=void 0===o?"margin":o;e.useEffect(function(){return document.body.setAttribute(K,(X()+1).toString()),function(){var e=X()-1;e<=0?document.body.removeAttribute(K):document.body.setAttribute(K,e.toString())}},[]);var c=e.useMemo(function(){return D(a)},[a]);return e.createElement(j,{styles:O(c,!n,a,r?"":"!important")})},H=!1;if("undefined"!=typeof window)try{var U=Object.defineProperty({},"passive",{get:function(){return H=!0,!0}});window.addEventListener("test",U,U),window.removeEventListener("test",U,U)}catch(e){H=!1}var Z=!!H&&{passive:!1},q=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},z=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),G(e,r)){var o=J(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},G=function(e,t){return"v"===e?function(e){return q(e,"overflowY")}(t):function(e){return q(e,"overflowX")}(t)},J=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},Q=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},V=function(e){return[e.deltaX,e.deltaY]},$=function(e){return e&&"current"in e?e.current:e},ee=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},te=0,ne=[];function re(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var oe,ae=(oe=function(t){var n=e.useRef([]),r=e.useRef([0,0]),o=e.useRef(),a=e.useState(te++)[0],c=e.useState(_)[0],u=e.useRef(t);e.useEffect(function(){u.current=t},[t]),e.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var e=i([t.lockRef.current],(t.shards||[]).map($),!0).filter(Boolean);return e.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),e.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[t.inert,t.lockRef.current,t.shards]);var s=e.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!u.current.allowPinchZoom;var n,a=Q(e),c=r.current,i="deltaX"in e?e.deltaX:c[0]-a[0],s="deltaY"in e?e.deltaY:c[1]-a[1],l=e.target,d=Math.abs(i)>Math.abs(s)?"h":"v";if("touches"in e&&"h"===d&&"range"===l.type)return!1;var f=z(d,l);if(!f)return!0;if(f?n=d:(n="v"===d?"h":"v",f=z(d,l)),!f)return!1;if(!o.current&&"changedTouches"in e&&(i||s)&&(o.current=n),!n)return!0;var v=o.current||n;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,u=t.contains(c),i=!1,s=a>0,l=0,d=0;do{if(!c)break;var f=J(e,c),v=f[0],m=f[1]-f[2]-o*v;(v||m)&&G(e,c)&&(l+=m,d+=v);var p=c.parentNode;c=p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE?p.host:p}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(s&&Math.abs(l)<1||!s&&Math.abs(d)<1)&&(i=!0),i}(v,t,e,"h"===v?i:s)},[]),l=e.useCallback(function(e){var t=e;if(ne.length&&ne[ne.length-1]===c){var r="deltaY"in t?V(t):Q(t),o=n.current.filter(function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(n=e.delta,o=r,n[0]===o[0]&&n[1]===o[1]);var n,o})[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var a=(u.current.shards||[]).map($).filter(Boolean).filter(function(e){return e.contains(t.target)});(a.length>0?s(t,a[0]):!u.current.noIsolation)&&t.cancelable&&t.preventDefault()}}},[]),d=e.useCallback(function(e,t,r,o){var a={name:e,delta:t,target:r,should:o,shadowParent:re(r)};n.current.push(a),setTimeout(function(){n.current=n.current.filter(function(e){return e!==a})},1)},[]),f=e.useCallback(function(e){r.current=Q(e),o.current=void 0},[]),v=e.useCallback(function(e){d(e.type,V(e),e.target,s(e,t.lockRef.current))},[]),m=e.useCallback(function(e){d(e.type,Q(e),e.target,s(e,t.lockRef.current))},[]);e.useEffect(function(){return ne.push(c),t.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Z),document.addEventListener("touchmove",l,Z),document.addEventListener("touchstart",f,Z),function(){ne=ne.filter(function(e){return e!==c}),document.removeEventListener("wheel",l,Z),document.removeEventListener("touchmove",l,Z),document.removeEventListener("touchstart",f,Z)}},[]);var p=t.removeScrollBar,h=t.inert;return e.createElement(e.Fragment,null,h?e.createElement(c,{styles:ee(a)}):null,p?e.createElement(Y,{noRelative:t.noRelative,gapMode:t.gapMode}):null)},L.useMedium(oe),T),ce=e.forwardRef(function(t,n){return e.createElement(P,c({},t,{ref:n,sideCar:ae}))});ce.classNames=P.classNames;var ue=new WeakMap,ie=new WeakMap,se={},le=0,de=function(e){return e&&(e.host||de(e.parentNode))},fe=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=de(t);return n&&e.contains(n)?n:null}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);se[n]||(se[n]=new WeakMap);var a=se[n],c=[],u=new Set,i=new Set(o),s=function(e){e&&!u.has(e)&&(u.add(e),s(e.parentNode))};o.forEach(s);var l=function(e){e&&!i.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(u.has(e))l(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,i=(ue.get(e)||0)+1,s=(a.get(e)||0)+1;ue.set(e,i),a.set(e,s),c.push(e),1===i&&o&&ie.set(e,!0),1===s&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(e){}})};return l(t),u.clear(),le++,function(){c.forEach(function(e){var t=ue.get(e)-1,o=a.get(e)-1;ue.set(e,t),a.set(e,o),t||(ie.has(e)||e.removeAttribute(r),ie.delete(e)),o||e.removeAttribute(n)}),--le||(ue=new WeakMap,ue=new WeakMap,ie=new WeakMap,se={})}},ve=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),fe(r,o,n,"aria-hidden")):function(){return null}};export{f as F,ce as R,ve as h,b as u};
|
2
|
-
//# sourceMappingURL=index-
|
1
|
+
import*as e from"react";import{useState as t}from"react";import{u as n}from"./index-fgRlmr40.mjs";import{P as r}from"./index-Dxh10iPI.mjs";import{u as o}from"./index-CgLDADnA.mjs";import{jsx as a}from"react/jsx-runtime";import{_ as c,a as u,b as i}from"./tslib.es6-CISrQAm2.mjs";var s="focusScope.autoFocusOnMount",l="focusScope.autoFocusOnUnmount",d={bubbles:!1,cancelable:!0},f=e.forwardRef((t,c)=>{const{loop:u=!1,trapped:i=!1,onMountAutoFocus:f,onUnmountAutoFocus:p,...y}=t,[E,b]=e.useState(null),w=o(f),S=o(p),C=e.useRef(null),k=n(c,e=>b(e)),M=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(i){let e=function(e){if(M.paused||!E)return;const t=e.target;E.contains(t)?C.current=t:h(C.current,{select:!0})},t=function(e){if(M.paused||!E)return;const t=e.relatedTarget;null!==t&&(E.contains(t)||h(C.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&h(E)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return E&&r.observe(E,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[i,E,M.paused]),e.useEffect(()=>{if(E){g.add(M);const t=document.activeElement;if(!E.contains(t)){const n=new CustomEvent(s,d);E.addEventListener(s,w),E.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(h(r,{select:t}),document.activeElement!==n)return}((e=v(E),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&h(E))}return()=>{E.removeEventListener(s,w),setTimeout(()=>{const e=new CustomEvent(l,d);E.addEventListener(l,S),E.dispatchEvent(e),e.defaultPrevented||h(t??document.body,{select:!0}),E.removeEventListener(l,S),g.remove(M)},0)}}var e},[E,w,S,M]);const N=e.useCallback(e=>{if(!u&&!i)return;if(M.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,o]=function(e){const t=v(e),n=m(t,e),r=m(t.reverse(),e);return[n,r]}(t);r&&o?e.shiftKey||n!==o?e.shiftKey&&n===r&&(e.preventDefault(),u&&h(o,{select:!0})):(e.preventDefault(),u&&h(r,{select:!0})):n===t&&e.preventDefault()}},[u,i,M.paused]);return a(r.div,{tabIndex:-1,...y,ref:k,onKeyDown:N})});function v(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function m(e,t){for(const n of e)if(!p(n,{upTo:t}))return n}function p(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function h(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}f.displayName="FocusScope";var g=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=y(e,t),e.unshift(t)},remove(t){e=y(e,t),e[0]?.resume()}}}();function y(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var E=0;function b(){e.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??w()),document.body.insertAdjacentElement("beforeend",e[1]??w()),E++,()=>{1===E&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),E--}},[])}function w(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var S="right-scroll-bar-position",C="width-before-scroll-bar";function k(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var M="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,N=new WeakMap;function R(e,n){var r,o,a,c=(r=null,o=function(t){return e.forEach(function(e){return k(e,t)})},(a=t(function(){return{value:r,callback:o,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}})[0]).callback=o,a.facade);return M(function(){var t=N.get(c);if(t){var n=new Set(t),r=new Set(e),o=c.current;n.forEach(function(e){r.has(e)||k(e,null)}),r.forEach(function(e){n.has(e)||k(e,o)})}N.set(c,e)},[e]),c}function A(e){return e}var T=function(t){var n=t.sideCar,r=u(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return e.createElement(o,c({},r))};T.isSideCarExport=!0;var L=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=A);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},c=function(){return Promise.resolve().then(a)};c(),n={push:function(e){t.push(e),c()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=c({async:!0,ssr:!1},e),t}(),x=function(){},P=e.forwardRef(function(t,n){var r=e.useRef(null),o=e.useState({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:x}),a=o[0],i=o[1],s=t.forwardProps,l=t.children,d=t.className,f=t.removeScrollBar,v=t.enabled,m=t.shards,p=t.sideCar,h=t.noRelative,g=t.noIsolation,y=t.inert,E=t.allowPinchZoom,b=t.as,w=void 0===b?"div":b,S=t.gapMode,C=u(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=p,M=R([r,n]),N=c(c({},C),a);return e.createElement(e.Fragment,null,v&&e.createElement(k,{sideCar:L,removeScrollBar:f,shards:m,noRelative:h,noIsolation:g,inert:y,setCallbacks:i,allowPinchZoom:!!E,lockRef:r,gapMode:S}),s?e.cloneElement(e.Children.only(l),c(c({},N),{ref:M})):e.createElement(w,c({},N,{className:d,ref:M}),l))});P.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},P.classNames={fullWidth:C,zeroRight:S};function F(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var I=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=F())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_=function(){var t,n=(t=I(),function(n,r){e.useEffect(function(){return t.add(n),function(){t.remove()}},[n&&r])});return function(e){var t=e.styles,r=e.dynamic;return n(t,r),null}},W={left:0,top:0,right:0,gap:0},B=function(e){return parseInt(e||"",10)||0},D=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return W;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[B(n),B(r),B(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},j=_(),K="data-scroll-locked",O=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,u=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(u,"px ").concat(r,";\n }\n body[").concat(K,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(c,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(u,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(S," {\n right: ").concat(u,"px ").concat(r,";\n }\n \n .").concat(C," {\n margin-right: ").concat(u,"px ").concat(r,";\n }\n \n .").concat(S," .").concat(S," {\n right: 0 ").concat(r,";\n }\n \n .").concat(C," .").concat(C," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(K,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(u,"px;\n }\n")},X=function(){var e=parseInt(document.body.getAttribute(K)||"0",10);return isFinite(e)?e:0},Y=function(t){var n=t.noRelative,r=t.noImportant,o=t.gapMode,a=void 0===o?"margin":o;e.useEffect(function(){return document.body.setAttribute(K,(X()+1).toString()),function(){var e=X()-1;e<=0?document.body.removeAttribute(K):document.body.setAttribute(K,e.toString())}},[]);var c=e.useMemo(function(){return D(a)},[a]);return e.createElement(j,{styles:O(c,!n,a,r?"":"!important")})},H=!1;if("undefined"!=typeof window)try{var U=Object.defineProperty({},"passive",{get:function(){return H=!0,!0}});window.addEventListener("test",U,U),window.removeEventListener("test",U,U)}catch(e){H=!1}var Z=!!H&&{passive:!1},q=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},z=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),G(e,r)){var o=J(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},G=function(e,t){return"v"===e?function(e){return q(e,"overflowY")}(t):function(e){return q(e,"overflowX")}(t)},J=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},Q=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},V=function(e){return[e.deltaX,e.deltaY]},$=function(e){return e&&"current"in e?e.current:e},ee=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},te=0,ne=[];function re(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var oe,ae=(oe=function(t){var n=e.useRef([]),r=e.useRef([0,0]),o=e.useRef(),a=e.useState(te++)[0],c=e.useState(_)[0],u=e.useRef(t);e.useEffect(function(){u.current=t},[t]),e.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var e=i([t.lockRef.current],(t.shards||[]).map($),!0).filter(Boolean);return e.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),e.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[t.inert,t.lockRef.current,t.shards]);var s=e.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!u.current.allowPinchZoom;var n,a=Q(e),c=r.current,i="deltaX"in e?e.deltaX:c[0]-a[0],s="deltaY"in e?e.deltaY:c[1]-a[1],l=e.target,d=Math.abs(i)>Math.abs(s)?"h":"v";if("touches"in e&&"h"===d&&"range"===l.type)return!1;var f=z(d,l);if(!f)return!0;if(f?n=d:(n="v"===d?"h":"v",f=z(d,l)),!f)return!1;if(!o.current&&"changedTouches"in e&&(i||s)&&(o.current=n),!n)return!0;var v=o.current||n;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,u=t.contains(c),i=!1,s=a>0,l=0,d=0;do{if(!c)break;var f=J(e,c),v=f[0],m=f[1]-f[2]-o*v;(v||m)&&G(e,c)&&(l+=m,d+=v);var p=c.parentNode;c=p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE?p.host:p}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(s&&Math.abs(l)<1||!s&&Math.abs(d)<1)&&(i=!0),i}(v,t,e,"h"===v?i:s)},[]),l=e.useCallback(function(e){var t=e;if(ne.length&&ne[ne.length-1]===c){var r="deltaY"in t?V(t):Q(t),o=n.current.filter(function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(n=e.delta,o=r,n[0]===o[0]&&n[1]===o[1]);var n,o})[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var a=(u.current.shards||[]).map($).filter(Boolean).filter(function(e){return e.contains(t.target)});(a.length>0?s(t,a[0]):!u.current.noIsolation)&&t.cancelable&&t.preventDefault()}}},[]),d=e.useCallback(function(e,t,r,o){var a={name:e,delta:t,target:r,should:o,shadowParent:re(r)};n.current.push(a),setTimeout(function(){n.current=n.current.filter(function(e){return e!==a})},1)},[]),f=e.useCallback(function(e){r.current=Q(e),o.current=void 0},[]),v=e.useCallback(function(e){d(e.type,V(e),e.target,s(e,t.lockRef.current))},[]),m=e.useCallback(function(e){d(e.type,Q(e),e.target,s(e,t.lockRef.current))},[]);e.useEffect(function(){return ne.push(c),t.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Z),document.addEventListener("touchmove",l,Z),document.addEventListener("touchstart",f,Z),function(){ne=ne.filter(function(e){return e!==c}),document.removeEventListener("wheel",l,Z),document.removeEventListener("touchmove",l,Z),document.removeEventListener("touchstart",f,Z)}},[]);var p=t.removeScrollBar,h=t.inert;return e.createElement(e.Fragment,null,h?e.createElement(c,{styles:ee(a)}):null,p?e.createElement(Y,{noRelative:t.noRelative,gapMode:t.gapMode}):null)},L.useMedium(oe),T),ce=e.forwardRef(function(t,n){return e.createElement(P,c({},t,{ref:n,sideCar:ae}))});ce.classNames=P.classNames;var ue=new WeakMap,ie=new WeakMap,se={},le=0,de=function(e){return e&&(e.host||de(e.parentNode))},fe=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=de(t);return n&&e.contains(n)?n:null}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);se[n]||(se[n]=new WeakMap);var a=se[n],c=[],u=new Set,i=new Set(o),s=function(e){e&&!u.has(e)&&(u.add(e),s(e.parentNode))};o.forEach(s);var l=function(e){e&&!i.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(u.has(e))l(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,i=(ue.get(e)||0)+1,s=(a.get(e)||0)+1;ue.set(e,i),a.set(e,s),c.push(e),1===i&&o&&ie.set(e,!0),1===s&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(e){}})};return l(t),u.clear(),le++,function(){c.forEach(function(e){var t=ue.get(e)-1,o=a.get(e)-1;ue.set(e,t),a.set(e,o),t||(ie.has(e)||e.removeAttribute(r),ie.delete(e)),o||e.removeAttribute(n)}),--le||(ue=new WeakMap,ue=new WeakMap,ie=new WeakMap,se={})}},ve=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),fe(r,o,n,"aria-hidden")):function(){return null}};export{f as F,ce as R,ve as h,b as u};
|
2
|
+
//# sourceMappingURL=index-CTsIdIko.mjs.map
|