@anoki/fse-ui 1.0.760 → 1.0.762
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/index.cjs121.js.map +1 -1
- package/dist/index.cjs197.js +1 -1
- package/dist/index.cjs197.js.map +1 -1
- package/dist/index.cjs198.js +1 -1
- package/dist/index.cjs198.js.map +1 -1
- package/dist/index.cjs202.js +1 -1
- package/dist/index.cjs202.js.map +1 -1
- package/dist/index.cjs211.js +1 -1
- package/dist/index.cjs211.js.map +1 -1
- package/dist/index.cjs215.js +1 -1
- package/dist/index.cjs215.js.map +1 -1
- package/dist/index.cjs220.js +1 -1
- package/dist/index.cjs227.js +1 -1
- package/dist/index.cjs23.js +1 -1
- package/dist/index.cjs23.js.map +1 -1
- package/dist/index.cjs270.js +1 -1
- package/dist/index.cjs276.js +1 -1
- package/dist/index.cjs283.js +1 -1
- package/dist/index.cjs288.js +1 -1
- package/dist/index.cjs295.js +1 -1
- package/dist/index.cjs342.js +1 -1
- package/dist/index.cjs381.js +1 -1
- package/dist/index.cjs389.js +1 -1
- package/dist/index.cjs390.js +3 -12
- package/dist/index.cjs390.js.map +1 -1
- package/dist/index.cjs391.js +27 -1
- package/dist/index.cjs391.js.map +1 -1
- package/dist/index.cjs392.js +1 -2
- package/dist/index.cjs392.js.map +1 -1
- package/dist/index.cjs393.js +1 -27
- package/dist/index.cjs393.js.map +1 -1
- package/dist/index.cjs394.js +1 -1
- package/dist/index.cjs394.js.map +1 -1
- package/dist/index.cjs395.js +2 -1
- package/dist/index.cjs395.js.map +1 -1
- package/dist/index.cjs399.js +1 -1
- package/dist/index.cjs400.js +1 -1
- package/dist/index.cjs401.js +1 -1
- package/dist/index.cjs402.js +1 -1
- package/dist/index.cjs408.js +1 -1
- package/dist/index.cjs409.js +1 -1
- package/dist/index.cjs410.js +1 -1
- package/dist/index.cjs410.js.map +1 -1
- package/dist/index.cjs412.js +1 -1
- package/dist/index.cjs412.js.map +1 -1
- package/dist/index.cjs416.js +2 -0
- package/dist/index.cjs416.js.map +1 -0
- package/dist/index.cjs417.js +2 -0
- package/dist/index.cjs417.js.map +1 -0
- package/dist/index.cjs418.js +1 -1
- package/dist/index.cjs418.js.map +1 -1
- package/dist/index.cjs419.js +1 -1
- package/dist/index.cjs419.js.map +1 -1
- package/dist/index.cjs420.js +1 -1
- package/dist/index.cjs420.js.map +1 -1
- package/dist/index.cjs421.js +1 -1
- package/dist/index.cjs421.js.map +1 -1
- package/dist/index.cjs422.js +1 -1
- package/dist/index.cjs422.js.map +1 -1
- package/dist/index.cjs431.js +1 -1
- package/dist/index.cjs431.js.map +1 -1
- package/dist/index.cjs432.js +1 -1
- package/dist/index.cjs432.js.map +1 -1
- package/dist/index.cjs433.js +1 -1
- package/dist/index.cjs433.js.map +1 -1
- package/dist/index.cjs434.js +2 -0
- package/dist/index.cjs434.js.map +1 -0
- package/dist/index.cjs435.js +2 -0
- package/dist/index.cjs435.js.map +1 -0
- package/dist/index.cjs436.js +2 -0
- package/dist/index.cjs436.js.map +1 -0
- package/dist/index.cjs441.js +1 -1
- package/dist/index.cjs472.js +1 -1
- package/dist/index.cjs479.js +1 -1
- package/dist/index.cjs496.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.es121.js.map +1 -1
- package/dist/index.es197.js +76 -71
- package/dist/index.es197.js.map +1 -1
- package/dist/index.es198.js +11 -1
- package/dist/index.es198.js.map +1 -1
- package/dist/index.es202.js +63 -58
- package/dist/index.es202.js.map +1 -1
- package/dist/index.es211.js +29 -26
- package/dist/index.es211.js.map +1 -1
- package/dist/index.es215.js +18 -15
- package/dist/index.es215.js.map +1 -1
- package/dist/index.es220.js +1 -1
- package/dist/index.es227.js +2 -2
- package/dist/index.es23.js +25 -15
- package/dist/index.es23.js.map +1 -1
- package/dist/index.es270.js +1 -1
- package/dist/index.es276.js +7 -7
- package/dist/index.es283.js +1 -1
- package/dist/index.es288.js +1 -1
- package/dist/index.es295.js +1 -1
- package/dist/index.es342.js +1 -1
- package/dist/index.es381.js +1 -1
- package/dist/index.es389.js +1 -1
- package/dist/index.es390.js +146 -307
- package/dist/index.es390.js.map +1 -1
- package/dist/index.es391.js +3674 -5
- package/dist/index.es391.js.map +1 -1
- package/dist/index.es392.js +5 -520
- package/dist/index.es392.js.map +1 -1
- package/dist/index.es393.js +2 -3675
- package/dist/index.es393.js.map +1 -1
- package/dist/index.es394.js +5 -5
- package/dist/index.es394.js.map +1 -1
- package/dist/index.es395.js +521 -2
- package/dist/index.es395.js.map +1 -1
- package/dist/index.es399.js +1 -1
- package/dist/index.es400.js +1 -1
- package/dist/index.es401.js +12 -12
- package/dist/index.es402.js +1 -1
- package/dist/index.es408.js +1 -1
- package/dist/index.es409.js +1 -1
- package/dist/index.es410.js +2 -15
- package/dist/index.es410.js.map +1 -1
- package/dist/index.es411.js +2 -2
- package/dist/index.es412.js +15 -2
- package/dist/index.es412.js.map +1 -1
- package/dist/index.es416.js +128 -0
- package/dist/index.es416.js.map +1 -0
- package/dist/index.es417.js +138 -0
- package/dist/index.es417.js.map +1 -0
- package/dist/index.es418.js +13 -124
- package/dist/index.es418.js.map +1 -1
- package/dist/index.es419.js +14 -134
- package/dist/index.es419.js.map +1 -1
- package/dist/index.es420.js +7 -12
- package/dist/index.es420.js.map +1 -1
- package/dist/index.es421.js +50 -15
- package/dist/index.es421.js.map +1 -1
- package/dist/index.es422.js +53 -9
- package/dist/index.es422.js.map +1 -1
- package/dist/index.es431.js +10 -217
- package/dist/index.es431.js.map +1 -1
- package/dist/index.es432.js +41 -173
- package/dist/index.es432.js.map +1 -1
- package/dist/index.es433.js +7 -3
- package/dist/index.es433.js.map +1 -1
- package/dist/index.es434.js +221 -0
- package/dist/index.es434.js.map +1 -0
- package/dist/index.es435.js +181 -0
- package/dist/index.es435.js.map +1 -0
- package/dist/index.es436.js +7 -0
- package/dist/index.es436.js.map +1 -0
- package/dist/index.es441.js +1 -1
- package/dist/index.es472.js +1 -1
- package/dist/index.es479.js +3 -3
- package/dist/index.es496.js +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles/typography.css +1 -1
- package/package.json +1 -1
- package/dist/index.cjs423.js +0 -2
- package/dist/index.cjs423.js.map +0 -1
- package/dist/index.cjs424.js +0 -2
- package/dist/index.cjs424.js.map +0 -1
- package/dist/index.cjs428.js +0 -2
- package/dist/index.cjs428.js.map +0 -1
- package/dist/index.cjs429.js +0 -2
- package/dist/index.cjs429.js.map +0 -1
- package/dist/index.cjs430.js +0 -2
- package/dist/index.cjs430.js.map +0 -1
- package/dist/index.es423.js +0 -53
- package/dist/index.es423.js.map +0 -1
- package/dist/index.es424.js +0 -56
- package/dist/index.es424.js.map +0 -1
- package/dist/index.es428.js +0 -14
- package/dist/index.es428.js.map +0 -1
- package/dist/index.es429.js +0 -49
- package/dist/index.es429.js.map +0 -1
- package/dist/index.es430.js +0 -11
- package/dist/index.es430.js.map +0 -1
- /package/dist/components/ui/{ConsentModal/ConsentModalFooter/ConsentModalFooter.css → DoctorModal/DoctorModalFooter/DoctorModalFooter.css} +0 -0
package/dist/index.cjs412.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs412.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
1
|
+
{"version":3,"file":"index.cjs412.js","sources":["../node_modules/usehooks-ts/dist/index.js"],"sourcesContent":["import { useState, useCallback, useLayoutEffect, useEffect, useRef, useMemo } from 'react';\nimport debounce from 'lodash.debounce';\n\n// src/useBoolean/useBoolean.ts\nfunction useBoolean(defaultValue = false) {\n if (typeof defaultValue !== \"boolean\") {\n throw new Error(\"defaultValue must be `true` or `false`\");\n }\n const [value, setValue] = useState(defaultValue);\n const setTrue = useCallback(() => {\n setValue(true);\n }, []);\n const setFalse = useCallback(() => {\n setValue(false);\n }, []);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return { value, setValue, setTrue, setFalse, toggle };\n}\nvar useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// src/useEventListener/useEventListener.ts\nfunction useEventListener(eventName, handler, element, options) {\n const savedHandler = useRef(handler);\n useIsomorphicLayoutEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n useEffect(() => {\n const targetElement = (element == null ? void 0 : element.current) ?? window;\n if (!(targetElement && targetElement.addEventListener))\n return;\n const listener = (event) => {\n savedHandler.current(event);\n };\n targetElement.addEventListener(eventName, listener, options);\n return () => {\n targetElement.removeEventListener(eventName, listener, options);\n };\n }, [eventName, element, options]);\n}\n\n// src/useClickAnyWhere/useClickAnyWhere.ts\nfunction useClickAnyWhere(handler) {\n useEventListener(\"click\", (event) => {\n handler(event);\n });\n}\nfunction useCopyToClipboard() {\n const [copiedText, setCopiedText] = useState(null);\n const copy = useCallback(async (text) => {\n if (!(navigator == null ? void 0 : navigator.clipboard)) {\n console.warn(\"Clipboard not supported\");\n return false;\n }\n try {\n await navigator.clipboard.writeText(text);\n setCopiedText(text);\n return true;\n } catch (error) {\n console.warn(\"Copy failed\", error);\n setCopiedText(null);\n return false;\n }\n }, []);\n return [copiedText, copy];\n}\nfunction useCounter(initialValue) {\n const [count, setCount] = useState(initialValue ?? 0);\n const increment = useCallback(() => {\n setCount((x) => x + 1);\n }, []);\n const decrement = useCallback(() => {\n setCount((x) => x - 1);\n }, []);\n const reset = useCallback(() => {\n setCount(initialValue ?? 0);\n }, [initialValue]);\n return {\n count,\n increment,\n decrement,\n reset,\n setCount\n };\n}\nfunction useInterval(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (delay === null) {\n return;\n }\n const id = setInterval(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearInterval(id);\n };\n }, [delay]);\n}\n\n// src/useCountdown/useCountdown.ts\nfunction useCountdown({\n countStart,\n countStop = 0,\n intervalMs = 1e3,\n isIncrement = false\n}) {\n const {\n count,\n increment,\n decrement,\n reset: resetCounter\n } = useCounter(countStart);\n const {\n value: isCountdownRunning,\n setTrue: startCountdown,\n setFalse: stopCountdown\n } = useBoolean(false);\n const resetCountdown = useCallback(() => {\n stopCountdown();\n resetCounter();\n }, [stopCountdown, resetCounter]);\n const countdownCallback = useCallback(() => {\n if (count === countStop) {\n stopCountdown();\n return;\n }\n if (isIncrement) {\n increment();\n } else {\n decrement();\n }\n }, [count, countStop, decrement, increment, isIncrement, stopCountdown]);\n useInterval(countdownCallback, isCountdownRunning ? intervalMs : null);\n return [count, { startCountdown, stopCountdown, resetCountdown }];\n}\nfunction useEventCallback(fn) {\n const ref = useRef(() => {\n throw new Error(\"Cannot call an event handler while rendering.\");\n });\n useIsomorphicLayoutEffect(() => {\n ref.current = fn;\n }, [fn]);\n return useCallback((...args) => {\n var _a;\n return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);\n }, [ref]);\n}\n\n// src/useLocalStorage/useLocalStorage.ts\nvar IS_SERVER = typeof window === \"undefined\";\nfunction useLocalStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER) {\n return initialValueToUse;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER) {\n console.warn(\n `Tried setting localStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.localStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"local-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting localStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n const removeValue = useEventCallback(() => {\n if (IS_SERVER) {\n console.warn(\n `Tried removing localStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n window.localStorage.removeItem(key);\n setStoredValue(defaultValue);\n window.dispatchEvent(new StorageEvent(\"local-storage\", { key }));\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return [storedValue, setValue, removeValue];\n}\nvar IS_SERVER2 = typeof window === \"undefined\";\nfunction useMediaQuery(query, {\n defaultValue = false,\n initializeWithValue = true\n} = {}) {\n const getMatches = (query2) => {\n if (IS_SERVER2) {\n return defaultValue;\n }\n return window.matchMedia(query2).matches;\n };\n const [matches, setMatches] = useState(() => {\n if (initializeWithValue) {\n return getMatches(query);\n }\n return defaultValue;\n });\n function handleChange() {\n setMatches(getMatches(query));\n }\n useIsomorphicLayoutEffect(() => {\n const matchMedia = window.matchMedia(query);\n handleChange();\n if (matchMedia.addListener) {\n matchMedia.addListener(handleChange);\n } else {\n matchMedia.addEventListener(\"change\", handleChange);\n }\n return () => {\n if (matchMedia.removeListener) {\n matchMedia.removeListener(handleChange);\n } else {\n matchMedia.removeEventListener(\"change\", handleChange);\n }\n };\n }, [query]);\n return matches;\n}\n\n// src/useDarkMode/useDarkMode.ts\nvar COLOR_SCHEME_QUERY = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY = \"usehooks-ts-dark-mode\";\nfunction useDarkMode(options = {}) {\n const {\n defaultValue,\n localStorageKey = LOCAL_STORAGE_KEY,\n initializeWithValue = true\n } = options;\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY, {\n initializeWithValue,\n defaultValue\n });\n const [isDarkMode, setDarkMode] = useLocalStorage(\n localStorageKey,\n defaultValue ?? isDarkOS ?? false,\n { initializeWithValue }\n );\n useIsomorphicLayoutEffect(() => {\n if (isDarkOS !== isDarkMode) {\n setDarkMode(isDarkOS);\n }\n }, [isDarkOS]);\n return {\n isDarkMode,\n toggle: () => {\n setDarkMode((prev) => !prev);\n },\n enable: () => {\n setDarkMode(true);\n },\n disable: () => {\n setDarkMode(false);\n },\n set: (value) => {\n setDarkMode(value);\n }\n };\n}\nfunction useUnmount(func) {\n const funcRef = useRef(func);\n funcRef.current = func;\n useEffect(\n () => () => {\n funcRef.current();\n },\n []\n );\n}\n\n// src/useDebounceCallback/useDebounceCallback.ts\nfunction useDebounceCallback(func, delay = 500, options) {\n const debouncedFunc = useRef();\n useUnmount(() => {\n if (debouncedFunc.current) {\n debouncedFunc.current.cancel();\n }\n });\n const debounced = useMemo(() => {\n const debouncedFuncInstance = debounce(func, delay, options);\n const wrappedFunc = (...args) => {\n return debouncedFuncInstance(...args);\n };\n wrappedFunc.cancel = () => {\n debouncedFuncInstance.cancel();\n };\n wrappedFunc.isPending = () => {\n return !!debouncedFunc.current;\n };\n wrappedFunc.flush = () => {\n return debouncedFuncInstance.flush();\n };\n return wrappedFunc;\n }, [func, delay, options]);\n useEffect(() => {\n debouncedFunc.current = debounce(func, delay, options);\n }, [func, delay, options]);\n return debounced;\n}\nfunction useDebounceValue(initialValue, delay, options) {\n const eq = (options == null ? void 0 : options.equalityFn) ?? ((left, right) => left === right);\n const unwrappedInitialValue = initialValue instanceof Function ? initialValue() : initialValue;\n const [debouncedValue, setDebouncedValue] = useState(unwrappedInitialValue);\n const previousValueRef = useRef(unwrappedInitialValue);\n const updateDebouncedValue = useDebounceCallback(\n setDebouncedValue,\n delay,\n options\n );\n if (!eq(previousValueRef.current, unwrappedInitialValue)) {\n updateDebouncedValue(unwrappedInitialValue);\n previousValueRef.current = unwrappedInitialValue;\n }\n return [debouncedValue, updateDebouncedValue];\n}\nfunction useDocumentTitle(title, options = {}) {\n const { preserveTitleOnUnmount = true } = options;\n const defaultTitle = useRef(null);\n useIsomorphicLayoutEffect(() => {\n defaultTitle.current = window.document.title;\n }, []);\n useIsomorphicLayoutEffect(() => {\n window.document.title = title;\n }, [title]);\n useUnmount(() => {\n if (!preserveTitleOnUnmount && defaultTitle.current) {\n window.document.title = defaultTitle.current;\n }\n });\n}\nfunction useHover(elementRef) {\n const [value, setValue] = useState(false);\n const handleMouseEnter = () => {\n setValue(true);\n };\n const handleMouseLeave = () => {\n setValue(false);\n };\n useEventListener(\"mouseenter\", handleMouseEnter, elementRef);\n useEventListener(\"mouseleave\", handleMouseLeave, elementRef);\n return value;\n}\nfunction useIntersectionObserver({\n threshold = 0,\n root = null,\n rootMargin = \"0%\",\n freezeOnceVisible = false,\n initialIsIntersecting = false,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = useState(null);\n const [state, setState] = useState(() => ({\n isIntersecting: initialIsIntersecting,\n entry: void 0\n }));\n const callbackRef = useRef();\n callbackRef.current = onChange;\n const frozen = ((_a = state.entry) == null ? void 0 : _a.isIntersecting) && freezeOnceVisible;\n useEffect(() => {\n if (!ref)\n return;\n if (!(\"IntersectionObserver\" in window))\n return;\n if (frozen)\n return;\n let unobserve;\n const observer = new IntersectionObserver(\n (entries) => {\n const thresholds = Array.isArray(observer.thresholds) ? observer.thresholds : [observer.thresholds];\n entries.forEach((entry) => {\n const isIntersecting = entry.isIntersecting && thresholds.some((threshold2) => entry.intersectionRatio >= threshold2);\n setState({ isIntersecting, entry });\n if (callbackRef.current) {\n callbackRef.current(isIntersecting, entry);\n }\n if (isIntersecting && freezeOnceVisible && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n });\n },\n { threshold, root, rootMargin }\n );\n observer.observe(ref);\n return () => {\n observer.disconnect();\n };\n }, [\n ref,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n JSON.stringify(threshold),\n root,\n rootMargin,\n frozen,\n freezeOnceVisible\n ]);\n const prevRef = useRef(null);\n useEffect(() => {\n var _a2;\n if (!ref && ((_a2 = state.entry) == null ? void 0 : _a2.target) && !freezeOnceVisible && !frozen && prevRef.current !== state.entry.target) {\n prevRef.current = state.entry.target;\n setState({ isIntersecting: initialIsIntersecting, entry: void 0 });\n }\n }, [ref, state.entry, freezeOnceVisible, frozen, initialIsIntersecting]);\n const result = [\n setRef,\n !!state.isIntersecting,\n state.entry\n ];\n result.ref = result[0];\n result.isIntersecting = result[1];\n result.entry = result[2];\n return result;\n}\nfunction useIsClient() {\n const [isClient, setClient] = useState(false);\n useEffect(() => {\n setClient(true);\n }, []);\n return isClient;\n}\nfunction useIsMounted() {\n const isMounted = useRef(false);\n useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n return useCallback(() => isMounted.current, []);\n}\nfunction useMap(initialState = /* @__PURE__ */ new Map()) {\n const [map, setMap] = useState(new Map(initialState));\n const actions = {\n set: useCallback((key, value) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.set(key, value);\n return copy;\n });\n }, []),\n setAll: useCallback((entries) => {\n setMap(() => new Map(entries));\n }, []),\n remove: useCallback((key) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.delete(key);\n return copy;\n });\n }, []),\n reset: useCallback(() => {\n setMap(() => /* @__PURE__ */ new Map());\n }, [])\n };\n return [map, actions];\n}\n\n// src/useOnClickOutside/useOnClickOutside.ts\nfunction useOnClickOutside(ref, handler, eventType = \"mousedown\", eventListenerOptions = {}) {\n useEventListener(\n eventType,\n (event) => {\n const target = event.target;\n if (!target || !target.isConnected) {\n return;\n }\n const isOutside = Array.isArray(ref) ? ref.filter((r) => Boolean(r.current)).every((r) => r.current && !r.current.contains(target)) : ref.current && !ref.current.contains(target);\n if (isOutside) {\n handler(event);\n }\n },\n void 0,\n eventListenerOptions\n );\n}\nvar IS_SERVER3 = typeof window === \"undefined\";\nfunction useReadLocalStorage(key, options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER3) {\n initializeWithValue = false;\n }\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return null;\n }\n return parsed;\n },\n [options]\n );\n const readValue = useCallback(() => {\n if (IS_SERVER3) {\n return null;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : null;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return null;\n }\n }, [key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return void 0;\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return storedValue;\n}\nvar initialSize = {\n width: void 0,\n height: void 0\n};\nfunction useResizeObserver(options) {\n const { ref, box = \"content-box\" } = options;\n const [{ width, height }, setSize] = useState(initialSize);\n const isMounted = useIsMounted();\n const previousSize = useRef({ ...initialSize });\n const onResize = useRef(void 0);\n onResize.current = options.onResize;\n useEffect(() => {\n if (!ref.current)\n return;\n if (typeof window === \"undefined\" || !(\"ResizeObserver\" in window))\n return;\n const observer = new ResizeObserver(([entry]) => {\n const boxProp = box === \"border-box\" ? \"borderBoxSize\" : box === \"device-pixel-content-box\" ? \"devicePixelContentBoxSize\" : \"contentBoxSize\";\n const newWidth = extractSize(entry, boxProp, \"inlineSize\");\n const newHeight = extractSize(entry, boxProp, \"blockSize\");\n const hasChanged = previousSize.current.width !== newWidth || previousSize.current.height !== newHeight;\n if (hasChanged) {\n const newSize = { width: newWidth, height: newHeight };\n previousSize.current.width = newWidth;\n previousSize.current.height = newHeight;\n if (onResize.current) {\n onResize.current(newSize);\n } else {\n if (isMounted()) {\n setSize(newSize);\n }\n }\n }\n });\n observer.observe(ref.current, { box });\n return () => {\n observer.disconnect();\n };\n }, [box, ref, isMounted]);\n return { width, height };\n}\nfunction extractSize(entry, box, sizeType) {\n if (!entry[box]) {\n if (box === \"contentBoxSize\") {\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"];\n }\n return void 0;\n }\n return Array.isArray(entry[box]) ? entry[box][0][sizeType] : (\n // @ts-ignore Support Firefox's non-standard behavior\n entry[box][sizeType]\n );\n}\nvar IS_SERVER4 = typeof window === \"undefined\";\nfunction useScreen(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER4) {\n initializeWithValue = false;\n }\n const readScreen = () => {\n if (IS_SERVER4) {\n return void 0;\n }\n return window.screen;\n };\n const [screen, setScreen] = useState(() => {\n if (initializeWithValue) {\n return readScreen();\n }\n return void 0;\n });\n const debouncedSetScreen = useDebounceCallback(\n setScreen,\n options.debounceDelay\n );\n function handleSize() {\n const newScreen = readScreen();\n const setSize = options.debounceDelay ? debouncedSetScreen : setScreen;\n if (newScreen) {\n const {\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n } = newScreen;\n setSize({\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n });\n }\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return screen;\n}\nvar cachedScriptStatuses = /* @__PURE__ */ new Map();\nfunction getScriptNode(src) {\n const node = document.querySelector(\n `script[src=\"${src}\"]`\n );\n const status = node == null ? void 0 : node.getAttribute(\"data-status\");\n return {\n node,\n status\n };\n}\nfunction useScript(src, options) {\n const [status, setStatus] = useState(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return \"idle\";\n }\n if (typeof window === \"undefined\") {\n return \"loading\";\n }\n return cachedScriptStatuses.get(src) ?? \"loading\";\n });\n useEffect(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return;\n }\n const cachedScriptStatus = cachedScriptStatuses.get(src);\n if (cachedScriptStatus === \"ready\" || cachedScriptStatus === \"error\") {\n setStatus(cachedScriptStatus);\n return;\n }\n const script = getScriptNode(src);\n let scriptNode = script.node;\n if (!scriptNode) {\n scriptNode = document.createElement(\"script\");\n scriptNode.src = src;\n scriptNode.async = true;\n if (options == null ? void 0 : options.id) {\n scriptNode.id = options.id;\n }\n scriptNode.setAttribute(\"data-status\", \"loading\");\n document.body.appendChild(scriptNode);\n const setAttributeFromEvent = (event) => {\n const scriptStatus = event.type === \"load\" ? \"ready\" : \"error\";\n scriptNode == null ? void 0 : scriptNode.setAttribute(\"data-status\", scriptStatus);\n };\n scriptNode.addEventListener(\"load\", setAttributeFromEvent);\n scriptNode.addEventListener(\"error\", setAttributeFromEvent);\n } else {\n setStatus(script.status ?? cachedScriptStatus ?? \"loading\");\n }\n const setStateFromEvent = (event) => {\n const newStatus = event.type === \"load\" ? \"ready\" : \"error\";\n setStatus(newStatus);\n cachedScriptStatuses.set(src, newStatus);\n };\n scriptNode.addEventListener(\"load\", setStateFromEvent);\n scriptNode.addEventListener(\"error\", setStateFromEvent);\n return () => {\n if (scriptNode) {\n scriptNode.removeEventListener(\"load\", setStateFromEvent);\n scriptNode.removeEventListener(\"error\", setStateFromEvent);\n }\n if (scriptNode && (options == null ? void 0 : options.removeOnUnmount)) {\n scriptNode.remove();\n cachedScriptStatuses.delete(src);\n }\n };\n }, [src, options == null ? void 0 : options.shouldPreventLoad, options == null ? void 0 : options.removeOnUnmount, options == null ? void 0 : options.id]);\n return status;\n}\nvar IS_SERVER5 = typeof window === \"undefined\";\nfunction useScrollLock(options = {}) {\n const { autoLock = true, lockTarget, widthReflow = true } = options;\n const [isLocked, setIsLocked] = useState(false);\n const target = useRef(null);\n const originalStyle = useRef(null);\n const lock = () => {\n if (target.current) {\n const { overflow, paddingRight } = target.current.style;\n originalStyle.current = { overflow, paddingRight };\n if (widthReflow) {\n const offsetWidth = target.current === document.body ? window.innerWidth : target.current.offsetWidth;\n const currentPaddingRight = parseInt(window.getComputedStyle(target.current).paddingRight, 10) || 0;\n const scrollbarWidth = offsetWidth - target.current.scrollWidth;\n target.current.style.paddingRight = `${scrollbarWidth + currentPaddingRight}px`;\n }\n target.current.style.overflow = \"hidden\";\n setIsLocked(true);\n }\n };\n const unlock = () => {\n if (target.current && originalStyle.current) {\n target.current.style.overflow = originalStyle.current.overflow;\n if (widthReflow) {\n target.current.style.paddingRight = originalStyle.current.paddingRight;\n }\n }\n setIsLocked(false);\n };\n useIsomorphicLayoutEffect(() => {\n if (IS_SERVER5)\n return;\n if (lockTarget) {\n target.current = typeof lockTarget === \"string\" ? document.querySelector(lockTarget) : lockTarget;\n }\n if (!target.current) {\n target.current = document.body;\n }\n if (autoLock) {\n lock();\n }\n return () => {\n unlock();\n };\n }, [autoLock, lockTarget, widthReflow]);\n return { isLocked, lock, unlock };\n}\nvar IS_SERVER6 = typeof window === \"undefined\";\nfunction useSessionStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER6) {\n return initialValueToUse;\n }\n try {\n const raw = window.sessionStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading sessionStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER6) {\n console.warn(\n `Tried setting sessionStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.sessionStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"session-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting sessionStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n const removeValue = useEventCallback(() => {\n if (IS_SERVER6) {\n console.warn(\n `Tried removing sessionStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n window.sessionStorage.removeItem(key);\n setStoredValue(defaultValue);\n window.dispatchEvent(new StorageEvent(\"session-storage\", { key }));\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"session-storage\", handleStorageChange);\n return [storedValue, setValue, removeValue];\n}\nfunction useStep(maxStep) {\n const [currentStep, setCurrentStep] = useState(1);\n const canGoToNextStep = currentStep + 1 <= maxStep;\n const canGoToPrevStep = currentStep - 1 > 0;\n const setStep = useCallback(\n (step) => {\n const newStep = step instanceof Function ? step(currentStep) : step;\n if (newStep >= 1 && newStep <= maxStep) {\n setCurrentStep(newStep);\n return;\n }\n throw new Error(\"Step not valid\");\n },\n [maxStep, currentStep]\n );\n const goToNextStep = useCallback(() => {\n if (canGoToNextStep) {\n setCurrentStep((step) => step + 1);\n }\n }, [canGoToNextStep]);\n const goToPrevStep = useCallback(() => {\n if (canGoToPrevStep) {\n setCurrentStep((step) => step - 1);\n }\n }, [canGoToPrevStep]);\n const reset = useCallback(() => {\n setCurrentStep(1);\n }, []);\n return [\n currentStep,\n {\n goToNextStep,\n goToPrevStep,\n canGoToNextStep,\n canGoToPrevStep,\n setStep,\n reset\n }\n ];\n}\n\n// src/useTernaryDarkMode/useTernaryDarkMode.ts\nvar COLOR_SCHEME_QUERY2 = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY2 = \"usehooks-ts-ternary-dark-mode\";\nfunction useTernaryDarkMode({\n defaultValue = \"system\",\n localStorageKey = LOCAL_STORAGE_KEY2,\n initializeWithValue = true\n} = {}) {\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY2, { initializeWithValue });\n const [mode, setMode] = useLocalStorage(localStorageKey, defaultValue, {\n initializeWithValue\n });\n const isDarkMode = mode === \"dark\" || mode === \"system\" && isDarkOS;\n const toggleTernaryDarkMode = () => {\n const modes = [\"light\", \"system\", \"dark\"];\n setMode((prevMode) => {\n const nextIndex = (modes.indexOf(prevMode) + 1) % modes.length;\n return modes[nextIndex];\n });\n };\n return {\n isDarkMode,\n ternaryDarkMode: mode,\n setTernaryDarkMode: setMode,\n toggleTernaryDarkMode\n };\n}\nfunction useTimeout(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (!delay && delay !== 0) {\n return;\n }\n const id = setTimeout(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearTimeout(id);\n };\n }, [delay]);\n}\nfunction useToggle(defaultValue) {\n const [value, setValue] = useState(!!defaultValue);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return [value, toggle, setValue];\n}\nvar IS_SERVER7 = typeof window === \"undefined\";\nfunction useWindowSize(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER7) {\n initializeWithValue = false;\n }\n const [windowSize, setWindowSize] = useState(() => {\n if (initializeWithValue) {\n return {\n width: window.innerWidth,\n height: window.innerHeight\n };\n }\n return {\n width: void 0,\n height: void 0\n };\n });\n const debouncedSetWindowSize = useDebounceCallback(\n setWindowSize,\n options.debounceDelay\n );\n function handleSize() {\n const setSize = options.debounceDelay ? debouncedSetWindowSize : setWindowSize;\n setSize({\n width: window.innerWidth,\n height: window.innerHeight\n });\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return windowSize;\n}\n\nexport { useBoolean, useClickAnyWhere, useCopyToClipboard, useCountdown, useCounter, useDarkMode, useDebounceCallback, useDebounceValue, useDocumentTitle, useEventCallback, useEventListener, useHover, useIntersectionObserver, useInterval, useIsClient, useIsMounted, useIsomorphicLayoutEffect, useLocalStorage, useMap, useMediaQuery, useOnClickOutside, useReadLocalStorage, useResizeObserver, useScreen, useScript, useScrollLock, useSessionStorage, useStep, useTernaryDarkMode, useTimeout, useToggle, useUnmount, useWindowSize };\n"],"names":["useCopyToClipboard","copiedText","setCopiedText","useState","copy","useCallback","text","error"],"mappings":"sIAgDA,SAASA,GAAqB,CAC5B,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAAA,SAAS,IAAI,EAC3CC,EAAOC,cAAY,MAAOC,GAAS,CACvC,GAAI,EAAE,WAAa,MAAgB,UAAU,WAC3C,eAAQ,KAAK,yBAAyB,EAC/B,GAET,GAAI,CACF,aAAM,UAAU,UAAU,UAAUA,CAAI,EACxCJ,EAAcI,CAAI,EACX,EACR,OAAQC,EAAO,CACd,eAAQ,KAAK,cAAeA,CAAK,EACjCL,EAAc,IAAI,EACX,EACb,CACG,EAAE,EAAE,EACL,MAAO,CAACD,EAAYG,CAAI,CAC1B","x_google_ignoreList":[0]}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react"),y=require("./index.cjs396.js"),p=require("./index.cjs400.js"),R=require("./index.cjs397.js"),x=require("./index.cjs431.js"),H=require("./index.cjs441.js"),w=require("./index.cjs216.js");function U(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const o=U(q);var z="DismissableLayer",h="dismissableLayer.update",M="dismissableLayer.pointerDownOutside",$="dismissableLayer.focusOutside",L,T=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),S=o.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:l,onDismiss:d,...v}=e,c=o.useContext(T),[u,F]=o.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,N]=o.useState({}),W=R.useComposedRefs(t,i=>F(i)),m=Array.from(c.layers),[_]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),A=m.indexOf(_),P=u?m.indexOf(u):-1,k=c.layersWithOutsidePointerEventsDisabled.size>0,D=P>=A,I=Y(i=>{const E=i.target,C=[...c.branches].some(b=>b.contains(E));!D||C||(r==null||r(i),l==null||l(i),i.defaultPrevented||d==null||d())},f),O=G(i=>{const E=i.target;[...c.branches].some(b=>b.contains(E))||(a==null||a(i),l==null||l(i),i.defaultPrevented||d==null||d())},f);return H.useEscapeKeydown(i=>{P===c.layers.size-1&&(s==null||s(i),!i.defaultPrevented&&d&&(i.preventDefault(),d()))},f),o.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(L=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),g(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=L)}},[u,f,n,c]),o.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),g())},[u,c]),o.useEffect(()=>{const i=()=>N({});return document.addEventListener(h,i),()=>document.removeEventListener(h,i)},[]),w.jsxRuntimeExports.jsx(p.Primitive.div,{...v,ref:W,style:{pointerEvents:k?D?"auto":"none":void 0,...e.style},onFocusCapture:y.composeEventHandlers(e.onFocusCapture,O.onFocusCapture),onBlurCapture:y.composeEventHandlers(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:y.composeEventHandlers(e.onPointerDownCapture,I.onPointerDownCapture)})});S.displayName=z;var X="DismissableLayerBranch",B=o.forwardRef((e,t)=>{const n=o.useContext(T),s=o.useRef(null),r=R.useComposedRefs(t,s);return o.useEffect(()=>{const a=s.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),w.jsxRuntimeExports.jsx(p.Primitive.div,{...e,ref:r})});B.displayName=X;function Y(e,t=globalThis==null?void 0:globalThis.document){const n=x.useCallbackRef(e),s=o.useRef(!1),r=o.useRef(()=>{});return o.useEffect(()=>{const a=d=>{if(d.target&&!s.current){let v=function(){j(M,n,c,{discrete:!0})};const c={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=v,t.addEventListener("click",r.current,{once:!0})):v()}else t.removeEventListener("click",r.current);s.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function G(e,t=globalThis==null?void 0:globalThis.document){const n=x.useCallbackRef(e),s=o.useRef(!1);return o.useEffect(()=>{const r=a=>{a.target&&!s.current&&j($,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function g(){const e=new CustomEvent(h);document.dispatchEvent(e)}function j(e,t,n,{discrete:s}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),s?p.dispatchDiscreteCustomEvent(r,a):r.dispatchEvent(a)}exports.DismissableLayer=S;exports.DismissableLayerBranch=B;
|
2
|
+
//# sourceMappingURL=index.cjs416.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.cjs416.js","sources":["../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/dismissable-layer/src/dismissable-layer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DISMISSABLE_LAYER_NAME = \"DismissableLayer\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const focusOutside = useFocusOutside((event) => {\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }\n);\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\nvar BRANCH_NAME = \"DismissableLayerBranch\";\nvar DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n});\nDismissableLayerBranch.displayName = BRANCH_NAME;\nfunction usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n const handlePointerDown = (event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n const eventDetail = { originalEvent: event };\n if (event.pointerType === \"touch\") {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent2();\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true\n };\n}\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = (event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n };\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: () => isFocusInsideReactTreeRef.current = true,\n onBlurCapture: () => isFocusInsideReactTreeRef.current = false\n };\n}\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\nvar Root = DismissableLayer;\nvar Branch = DismissableLayerBranch;\nexport {\n Branch,\n DismissableLayer,\n DismissableLayerBranch,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DISMISSABLE_LAYER_NAME","CONTEXT_UPDATE","POINTER_DOWN_OUTSIDE","FOCUS_OUTSIDE","originalBodyPointerEvents","DismissableLayerContext","React","DismissableLayer","props","forwardedRef","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","layerProps","context","node","setNode","ownerDocument","force","composedRefs","useComposedRefs","node2","layers","highestLayerWithOutsidePointerEventsDisabled","highestLayerWithOutsidePointerEventsDisabledIndex","index","isBodyPointerEventsDisabled","isPointerEventsEnabled","pointerDownOutside","usePointerDownOutside","event","target","isPointerDownOnBranch","branch","focusOutside","useFocusOutside","useEscapeKeydown","dispatchUpdate","handleUpdate","jsx","Primitive","composeEventHandlers","BRANCH_NAME","DismissableLayerBranch","ref","handlePointerDownOutside","useCallbackRef","isPointerInsideReactTreeRef","handleClickRef","handlePointerDown","handleAndDispatchPointerDownOutsideEvent2","handleAndDispatchCustomEvent","eventDetail","timerId","handleFocusOutside","isFocusInsideReactTreeRef","handleFocus","name","handler","detail","discrete","dispatchDiscreteCustomEvent"],"mappings":"6jBAUA,IAAIA,EAAyB,mBACzBC,EAAiB,0BACjBC,EAAuB,sCACvBC,EAAgB,gCAChBC,EACAC,EAA0BC,EAAM,cAAc,CAChD,OAAwB,IAAI,IAC5B,uCAAwD,IAAI,IAC5D,SAA0B,IAAI,GAChC,CAAC,EACGC,EAAmBD,EAAM,WAC3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1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("react"),x=require("./index.cjs397.js"),A=require("./index.cjs400.js"),O=require("./index.cjs431.js"),k=require("./index.cjs216.js");function w(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const f=w(U);var F="focusScope.autoFocusOnMount",y="focusScope.autoFocusOnUnmount",S={bubbles:!1,cancelable:!0},K="FocusScope",C=f.forwardRef((e,n)=>{const{loop:t=!1,trapped:o=!1,onMountAutoFocus:p,onUnmountAutoFocus:I,...L}=e,[s,P]=f.useState(null),E=O.useCallbackRef(p),v=O.useCallbackRef(I),b=f.useRef(null),_=x.useComposedRefs(n,u=>P(u)),a=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(o){let u=function(i){if(a.paused||!s)return;const c=i.target;s.contains(c)?b.current=c:d(b.current,{select:!0})},l=function(i){if(a.paused||!s)return;const c=i.relatedTarget;c!==null&&(s.contains(c)||d(b.current,{select:!0}))},r=function(i){if(document.activeElement===document.body)for(const T of i)T.removedNodes.length>0&&d(s)};document.addEventListener("focusin",u),document.addEventListener("focusout",l);const m=new MutationObserver(r);return s&&m.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",l),m.disconnect()}}},[o,s,a.paused]),f.useEffect(()=>{if(s){N.add(a);const u=document.activeElement;if(!s.contains(u)){const r=new CustomEvent(F,S);s.addEventListener(F,E),s.dispatchEvent(r),r.defaultPrevented||(j(W(R(s)),{select:!0}),document.activeElement===u&&d(s))}return()=>{s.removeEventListener(F,E),setTimeout(()=>{const r=new CustomEvent(y,S);s.addEventListener(y,v),s.dispatchEvent(r),r.defaultPrevented||d(u??document.body,{select:!0}),s.removeEventListener(y,v),N.remove(a)},0)}}},[s,E,v,a]);const M=f.useCallback(u=>{if(!t&&!o||a.paused)return;const l=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,r=document.activeElement;if(l&&r){const m=u.currentTarget,[i,c]=D(m);i&&c?!u.shiftKey&&r===c?(u.preventDefault(),t&&d(i,{select:!0})):u.shiftKey&&r===i&&(u.preventDefault(),t&&d(c,{select:!0})):r===m&&u.preventDefault()}},[t,o,a.paused]);return k.jsxRuntimeExports.jsx(A.Primitive.div,{tabIndex:-1,...L,ref:_,onKeyDown:M})});C.displayName=K;function j(e,{select:n=!1}={}){const t=document.activeElement;for(const o of e)if(d(o,{select:n}),document.activeElement!==t)return}function D(e){const n=R(e),t=h(n,e),o=h(n.reverse(),e);return[t,o]}function R(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const p=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||p?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function h(e,n){for(const t of e)if(!q(t,{upTo:n}))return t}function q(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function H(e){return e instanceof HTMLInputElement&&"select"in e}function d(e,{select:n=!1}={}){if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&H(e)&&n&&e.select()}}var N=V();function V(){let e=[];return{add(n){const t=e[0];n!==t&&(t==null||t.pause()),e=g(e,n),e.unshift(n)},remove(n){var t;e=g(e,n),(t=e[0])==null||t.resume()}}}function g(e,n){const t=[...e],o=t.indexOf(n);return o!==-1&&t.splice(o,1),t}function W(e){return e.filter(n=>n.tagName!=="A")}exports.FocusScope=C;
|
2
|
+
//# sourceMappingURL=index.cjs417.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.cjs417.js","sources":["../node_modules/@radix-ui/react-focus-scope/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/focus-scope/src/focus-scope.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { jsx } from \"react/jsx-runtime\";\nvar AUTOFOCUS_ON_MOUNT = \"focusScope.autoFocusOnMount\";\nvar AUTOFOCUS_ON_UNMOUNT = \"focusScope.autoFocusOnUnmount\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar FOCUS_SCOPE_NAME = \"FocusScope\";\nvar FocusScope = React.forwardRef((props, forwardedRef) => {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n }\n }).current;\n React.useEffect(() => {\n if (trapped) {\n let handleFocusIn2 = function(event) {\n if (focusScope.paused || !container) return;\n const target = event.target;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleFocusOut2 = function(event) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget;\n if (relatedTarget === null) return;\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleMutations2 = function(mutations) {\n const focusedElement = document.activeElement;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n };\n var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;\n document.addEventListener(\"focusin\", handleFocusIn2);\n document.addEventListener(\"focusout\", handleFocusOut2);\n const mutationObserver = new MutationObserver(handleMutations2);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n return () => {\n document.removeEventListener(\"focusin\", handleFocusIn2);\n document.removeEventListener(\"focusout\", handleFocusOut2);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused]);\n React.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n setTimeout(() => {\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? document.body, { select: true });\n }\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n const handleKeyDown = React.useCallback(\n (event) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n const isTabKey = event.key === \"Tab\" && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement;\n if (isTabKey && focusedElement) {\n const container2 = event.currentTarget;\n const [first, last] = getTabbableEdges(container2);\n const hasTabbableElementsInside = first && last;\n if (!hasTabbableElementsInside) {\n if (focusedElement === container2) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused]\n );\n return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });\n});\nFocusScope.displayName = FOCUS_SCOPE_NAME;\nfunction focusFirst(candidates, { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\nfunction getTabbableEdges(container) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last];\n}\nfunction getTabbableCandidates(container) {\n const nodes = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n while (walker.nextNode()) nodes.push(walker.currentNode);\n return nodes;\n}\nfunction findVisible(elements, container) {\n for (const element of elements) {\n if (!isHidden(element, { upTo: container })) return element;\n }\n}\nfunction isHidden(node, { upTo }) {\n if (getComputedStyle(node).visibility === \"hidden\") return true;\n while (node) {\n if (upTo !== void 0 && node === upTo) return false;\n if (getComputedStyle(node).display === \"none\") return true;\n node = node.parentElement;\n }\n return false;\n}\nfunction isSelectableInput(element) {\n return element instanceof HTMLInputElement && \"select\" in element;\n}\nfunction focus(element, { select = false } = {}) {\n if (element && element.focus) {\n const previouslyFocusedElement = document.activeElement;\n element.focus({ preventScroll: true });\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\nvar focusScopesStack = createFocusScopesStack();\nfunction createFocusScopesStack() {\n let stack = [];\n return {\n add(focusScope) {\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n remove(focusScope) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n }\n };\n}\nfunction arrayRemove(array, item) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\nfunction removeLinks(items) {\n return items.filter((item) => item.tagName !== \"A\");\n}\nvar Root = FocusScope;\nexport {\n FocusScope,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["AUTOFOCUS_ON_MOUNT","AUTOFOCUS_ON_UNMOUNT","EVENT_OPTIONS","FOCUS_SCOPE_NAME","FocusScope","React","props","forwardedRef","loop","trapped","onMountAutoFocusProp","onUnmountAutoFocusProp","scopeProps","container","setContainer","onMountAutoFocus","useCallbackRef","onUnmountAutoFocus","lastFocusedElementRef","composedRefs","useComposedRefs","node","focusScope","handleFocusIn2","event","target","focus","handleFocusOut2","relatedTarget","handleMutations2","mutations","mutation","mutationObserver","focusScopesStack","previouslyFocusedElement","mountEvent","focusFirst","removeLinks","getTabbableCandidates","unmountEvent","handleKeyDown","isTabKey","focusedElement","container2","first","last","getTabbableEdges","jsx","Primitive","candidates","select","candidate","findVisible","nodes","walker","isHiddenInput","elements","element","isHidden","upTo","isSelectableInput","createFocusScopesStack","stack","activeFocusScope","arrayRemove","_a","array","item","updatedArray","index","items"],"mappings":"+fAQA,IAAIA,EAAqB,8BACrBC,EAAuB,gCACvBC,EAAgB,CAAE,QAAS,GAAO,WAAY,EAAM,EACpDC,EAAmB,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,GAAGF,CAAK,EACxBG,EAAQD,EAAa,QAAQD,CAAI,EACvC,OAAIE,IAAU,IACZD,EAAa,OAAOC,EAAO,CAAC,EAEvBD,CACT,CACA,SAAS/B,EAAYiC,EAAO,CAC1B,OAAOA,EAAM,OAAQH,GAASA,EAAK,UAAY,GAAG,CACpD","x_google_ignoreList":[0]}
|
package/dist/index.cjs418.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),d=require("react-dom"),f=require("./index.cjs400.js"),p=require("./index.cjs436.js"),m=require("./index.cjs216.js");function P(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const c=P(l);var b="Portal",i=c.forwardRef((e,r)=>{var a;const{container:t,...o}=e,[u,s]=c.useState(!1);p.useLayoutEffect(()=>s(!0),[]);const n=t||u&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return n?d.createPortal(m.jsxRuntimeExports.jsx(f.Primitive.div,{...o,ref:r}),n):null});i.displayName=b;exports.Portal=i;
|
2
2
|
//# sourceMappingURL=index.cjs418.js.map
|
package/dist/index.cjs418.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs418.js","sources":["../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/dismissable-layer/src/dismissable-layer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DISMISSABLE_LAYER_NAME = \"DismissableLayer\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const focusOutside = useFocusOutside((event) => {\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }\n);\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\nvar BRANCH_NAME = \"DismissableLayerBranch\";\nvar DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n});\nDismissableLayerBranch.displayName = BRANCH_NAME;\nfunction usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n const handlePointerDown = (event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n const eventDetail = { originalEvent: event };\n if (event.pointerType === \"touch\") {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent2();\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true\n };\n}\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = (event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n };\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: () => isFocusInsideReactTreeRef.current = true,\n onBlurCapture: () => isFocusInsideReactTreeRef.current = false\n };\n}\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\nvar Root = DismissableLayer;\nvar Branch = DismissableLayerBranch;\nexport {\n Branch,\n DismissableLayer,\n DismissableLayerBranch,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DISMISSABLE_LAYER_NAME","CONTEXT_UPDATE","POINTER_DOWN_OUTSIDE","FOCUS_OUTSIDE","originalBodyPointerEvents","DismissableLayerContext","React","DismissableLayer","props","forwardedRef","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","layerProps","context","node","setNode","ownerDocument","force","composedRefs","useComposedRefs","node2","layers","highestLayerWithOutsidePointerEventsDisabled","highestLayerWithOutsidePointerEventsDisabledIndex","index","isBodyPointerEventsDisabled","isPointerEventsEnabled","pointerDownOutside","usePointerDownOutside","event","target","isPointerDownOnBranch","branch","focusOutside","useFocusOutside","useEscapeKeydown","dispatchUpdate","handleUpdate","jsx","Primitive","composeEventHandlers","BRANCH_NAME","DismissableLayerBranch","ref","handlePointerDownOutside","useCallbackRef","isPointerInsideReactTreeRef","handleClickRef","handlePointerDown","handleAndDispatchPointerDownOutsideEvent2","handleAndDispatchCustomEvent","eventDetail","timerId","handleFocusOutside","isFocusInsideReactTreeRef","handleFocus","name","handler","detail","discrete","dispatchDiscreteCustomEvent"],"mappings":"6jBAUA,IAAIA,EAAyB,mBACzBC,EAAiB,0BACjBC,EAAuB,sCACvBC,EAAgB,gCAChBC,EACAC,EAA0BC,EAAM,cAAc,CAChD,OAAwB,IAAI,IAC5B,uCAAwD,IAAI,IAC5D,SAA0B,IAAI,GAChC,CAAC,EACGC,EAAmBD,EAAM,WAC3B,CAACE,EAAOC,IAAiB,CACvB,KAAM,CACJ,4BAAAC,EAA8B,GAC9B,gBAAAC,EACA,qBAAAC,EACA,eAAAC,EACA,kBAAAC,EACA,UAAAC,EACA,GAAGC,CACT,EAAQR,EACES,EAAUX,EAAM,WAAWD,CAAuB,EAClD,CAACa,EAAMC,CAAO,EAAIb,EAAM,SAAS,IAAI,EACrCc,GAAgBF,GAAA,YAAAA,EAAM,iBAAiB,mCAAY,UACnD,CAAG,CAAAG,CAAK,EAAIf,EAAM,SAAS,CAAA,CAAE,EAC7BgB,EAAeC,EAAAA,gBAAgBd,EAAee,GAAUL,EAAQK,CAAK,CAAC,EACtEC,EAAS,MAAM,KAAKR,EAAQ,MAAM,EAClC,CAACS,CAA4C,EAAI,CAAC,GAAGT,EAAQ,sCAAsC,EAAE,MAAM,EAAE,EAC7GU,EAAoDF,EAAO,QAAQC,CAA4C,EAC/GE,EAAQV,EAAOO,EAAO,QAAQP,CAAI,EAAI,GACtCW,EAA8BZ,EAAQ,uCAAuC,KAAO,EACpFa,EAAyBF,GAASD,EAClCI,EAAqBC,EAAuBC,GAAU,CAC1D,MAAMC,EAASD,EAAM,OACfE,EAAwB,CA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AAMA,EAA0B,QAAU,EAC1D,CACH,CACA,SAASlB,GAAiB,CACxB,MAAMP,EAAQ,IAAI,YAAYhC,CAAc,EAC5C,SAAS,cAAcgC,CAAK,CAC9B,CACA,SAASqB,EAA6BM,EAAMC,EAASC,EAAQ,CAAE,SAAAC,CAAQ,EAAI,CACzE,MAAM7B,EAAS4B,EAAO,cAAc,OAC9B7B,EAAQ,IAAI,YAAY2B,EAAM,CAAE,QAAS,GAAO,WAAY,GAAM,OAAAE,EAAQ,EAC5ED,GAAS3B,EAAO,iBAAiB0B,EAAMC,EAAS,CAAE,KAAM,GAAM,EAC9DE,EACFC,EAA2B,4BAAC9B,EAAQD,CAAK,EAEzCC,EAAO,cAAcD,CAAK,CAE9B","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index.cjs418.js","sources":["../node_modules/@radix-ui/react-portal/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/portal/src/portal.tsx\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { jsx } from \"react/jsx-runtime\";\nvar PORTAL_NAME = \"Portal\";\nvar Portal = React.forwardRef((props, forwardedRef) => {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || mounted && globalThis?.document?.body;\n return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;\n});\nPortal.displayName = PORTAL_NAME;\nvar Root = Portal;\nexport {\n Portal,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["PORTAL_NAME","Portal","React","props","forwardedRef","containerProp","portalProps","mounted","setMounted","useLayoutEffect","container","_a","ReactDOM","jsx","Primitive"],"mappings":"ufAQA,IAAIA,EAAc,SACdC,EAASC,EAAM,WAAW,CAACC,EAAOC,IAAiB,OACrD,KAAM,CAAE,UAAWC,EAAe,GAAGC,CAAa,EAAGH,EAC/C,CAACI,EAASC,CAAU,EAAIN,EAAM,SAAS,EAAK,EAClDO,EAAAA,gBAAgB,IAAMD,EAAW,EAAI,EAAG,CAAA,CAAE,EAC1C,MAAME,EAAYL,GAAiBE,KAAWI,EAAA,mCAAY,WAAZ,YAAAA,EAAsB,MACpE,OAAOD,EAAYE,EAAS,aAA6BC,EAAG,kBAAA,IAACC,EAAS,UAAC,IAAK,CAAE,GAAGR,EAAa,IAAKF,CAAc,CAAA,EAAGM,CAAS,EAAI,IACnI,CAAC,EACDT,EAAO,YAAcD","x_google_ignoreList":[0]}
|
package/dist/index.cjs419.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react");function a(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const s=a(c);var r=0;function d(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??u()),document.body.insertAdjacentElement("beforeend",e[1]??u()),r++,()=>{r===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),r--}},[])}function u(){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}exports.useFocusGuards=d;
|
2
2
|
//# sourceMappingURL=index.cjs419.js.map
|
package/dist/index.cjs419.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs419.js","sources":["../node_modules/@radix-ui/react-focus-scope/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/focus-scope/src/focus-scope.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { jsx } from \"react/jsx-runtime\";\nvar AUTOFOCUS_ON_MOUNT = \"focusScope.autoFocusOnMount\";\nvar AUTOFOCUS_ON_UNMOUNT = \"focusScope.autoFocusOnUnmount\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar FOCUS_SCOPE_NAME = \"FocusScope\";\nvar FocusScope = React.forwardRef((props, forwardedRef) => {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n }\n }).current;\n React.useEffect(() => {\n if (trapped) {\n let handleFocusIn2 = function(event) {\n if (focusScope.paused || !container) return;\n const target = event.target;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleFocusOut2 = function(event) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget;\n if (relatedTarget === null) return;\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleMutations2 = function(mutations) {\n const focusedElement = document.activeElement;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n };\n var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;\n document.addEventListener(\"focusin\", handleFocusIn2);\n document.addEventListener(\"focusout\", handleFocusOut2);\n const mutationObserver = new MutationObserver(handleMutations2);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n return () => {\n document.removeEventListener(\"focusin\", handleFocusIn2);\n document.removeEventListener(\"focusout\", handleFocusOut2);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused]);\n React.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n setTimeout(() => {\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? document.body, { select: true });\n }\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n const handleKeyDown = React.useCallback(\n (event) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n const isTabKey = event.key === \"Tab\" && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement;\n if (isTabKey && focusedElement) {\n const container2 = event.currentTarget;\n const [first, last] = getTabbableEdges(container2);\n const hasTabbableElementsInside = first && last;\n if (!hasTabbableElementsInside) {\n if (focusedElement === container2) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused]\n );\n return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });\n});\nFocusScope.displayName = FOCUS_SCOPE_NAME;\nfunction focusFirst(candidates, { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\nfunction getTabbableEdges(container) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last];\n}\nfunction getTabbableCandidates(container) {\n const nodes = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n while (walker.nextNode()) nodes.push(walker.currentNode);\n return nodes;\n}\nfunction findVisible(elements, container) {\n for (const element of elements) {\n if (!isHidden(element, { upTo: container })) return element;\n }\n}\nfunction isHidden(node, { upTo }) {\n if (getComputedStyle(node).visibility === \"hidden\") return true;\n while (node) {\n if (upTo !== void 0 && node === upTo) return false;\n if (getComputedStyle(node).display === \"none\") return true;\n node = node.parentElement;\n }\n return false;\n}\nfunction isSelectableInput(element) {\n return element instanceof HTMLInputElement && \"select\" in element;\n}\nfunction focus(element, { select = false } = {}) {\n if (element && element.focus) {\n const previouslyFocusedElement = document.activeElement;\n element.focus({ preventScroll: true });\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\nvar focusScopesStack = createFocusScopesStack();\nfunction createFocusScopesStack() {\n let stack = [];\n return {\n add(focusScope) {\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n remove(focusScope) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n }\n };\n}\nfunction arrayRemove(array, item) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\nfunction removeLinks(items) {\n return items.filter((item) => item.tagName !== \"A\");\n}\nvar Root = FocusScope;\nexport {\n FocusScope,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["AUTOFOCUS_ON_MOUNT","AUTOFOCUS_ON_UNMOUNT","EVENT_OPTIONS","FOCUS_SCOPE_NAME","FocusScope","React","props","forwardedRef","loop","trapped","onMountAutoFocusProp","onUnmountAutoFocusProp","scopeProps","container","setContainer","onMountAutoFocus","useCallbackRef","onUnmountAutoFocus","lastFocusedElementRef","composedRefs","useComposedRefs","node","focusScope","handleFocusIn2","event","target","focus","handleFocusOut2","relatedTarget","handleMutations2","mutations","mutation","mutationObserver","focusScopesStack","previouslyFocusedElement","mountEvent","focusFirst","removeLinks","getTabbableCandidates","unmountEvent","handleKeyDown","isTabKey","focusedElement","container2","first","last","getTabbableEdges","jsx","Primitive","candidates","select","candidate","findVisible","nodes","walker","isHiddenInput","elements","element","isHidden","upTo","isSelectableInput","createFocusScopesStack","stack","activeFocusScope","arrayRemove","_a","array","item","updatedArray","index","items"],"mappings":"+fAQA,IAAIA,EAAqB,8BACrBC,EAAuB,gCACvBC,EAAgB,CAAE,QAAS,GAAO,WAAY,EAAM,EACpDC,EAAmB,aACnBC,EAAaC,EAAM,WAAW,CAACC,EAAOC,IAAiB,CACzD,KAAM,CACJ,KAAAC,EAAO,GACP,QAAAC,EAAU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AC,EAEvBD,CACT,CACA,SAAS/B,EAAYiC,EAAO,CAC1B,OAAOA,EAAM,OAAQH,GAASA,EAAK,UAAY,GAAG,CACpD","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index.cjs419.js","sources":["../node_modules/@radix-ui/react-focus-guards/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/focus-guards/src/focus-guards.tsx\nimport * as React from \"react\";\nvar count = 0;\nfunction FocusGuards(props) {\n useFocusGuards();\n return props.children;\n}\nfunction useFocusGuards() {\n React.useEffect(() => {\n const edgeGuards = document.querySelectorAll(\"[data-radix-focus-guard]\");\n document.body.insertAdjacentElement(\"afterbegin\", edgeGuards[0] ?? createFocusGuard());\n document.body.insertAdjacentElement(\"beforeend\", edgeGuards[1] ?? createFocusGuard());\n count++;\n return () => {\n if (count === 1) {\n document.querySelectorAll(\"[data-radix-focus-guard]\").forEach((node) => node.remove());\n }\n count--;\n };\n }, []);\n}\nfunction createFocusGuard() {\n const element = document.createElement(\"span\");\n element.setAttribute(\"data-radix-focus-guard\", \"\");\n element.tabIndex = 0;\n element.style.outline = \"none\";\n element.style.opacity = \"0\";\n element.style.position = \"fixed\";\n element.style.pointerEvents = \"none\";\n return element;\n}\nvar Root = FocusGuards;\nexport {\n FocusGuards,\n Root,\n useFocusGuards\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["count","useFocusGuards","React","edgeGuards","createFocusGuard","node","element"],"mappings":"mYAIA,IAAIA,EAAQ,EAKZ,SAASC,GAAiB,CACxBC,EAAM,UAAU,IAAM,CACpB,MAAMC,EAAa,SAAS,iBAAiB,0BAA0B,EACvE,gBAAS,KAAK,sBAAsB,aAAcA,EAAW,CAAC,GAAKC,GAAkB,EACrF,SAAS,KAAK,sBAAsB,YAAaD,EAAW,CAAC,GAAKC,GAAkB,EACpFJ,IACO,IAAM,CACPA,IAAU,GACZ,SAAS,iBAAiB,0BAA0B,EAAE,QAASK,GAASA,EAAK,QAAQ,EAEvFL,GACD,CACF,EAAE,EAAE,CACP,CACA,SAASI,GAAmB,CAC1B,MAAME,EAAU,SAAS,cAAc,MAAM,EAC7C,OAAAA,EAAQ,aAAa,yBAA0B,EAAE,EACjDA,EAAQ,SAAW,EACnBA,EAAQ,MAAM,QAAU,OACxBA,EAAQ,MAAM,QAAU,IACxBA,EAAQ,MAAM,SAAW,QACzBA,EAAQ,MAAM,cAAgB,OACvBA,CACT","x_google_ignoreList":[0]}
|
package/dist/index.cjs420.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";
|
1
|
+
"use strict";const a=require("./index.cjs445.js"),l=require("react"),s=require("./index.cjs446.js"),i=require("./index.cjs447.js");function u(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const c=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,c.get?c:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const o=u(l);var n=o.forwardRef(function(e,t){return o.createElement(s.RemoveScroll,a.__assign({},e,{ref:t,sideCar:i}))});n.classNames=s.RemoveScroll.classNames;module.exports=n;
|
2
2
|
//# sourceMappingURL=index.cjs420.js.map
|
package/dist/index.cjs420.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs420.js","sources":["../node_modules
|
1
|
+
{"version":3,"file":"index.cjs420.js","sources":["../node_modules/react-remove-scroll/dist/es2015/Combination.js"],"sourcesContent":["import { __assign } from \"tslib\";\nimport * as React from 'react';\nimport { RemoveScroll } from './UI';\nimport SideCar from './sidecar';\nvar ReactRemoveScroll = React.forwardRef(function (props, ref) { return (React.createElement(RemoveScroll, __assign({}, props, { ref: ref, sideCar: SideCar }))); });\nReactRemoveScroll.classNames = RemoveScroll.classNames;\nexport default ReactRemoveScroll;\n"],"names":["ReactRemoveScroll","React","props","ref","RemoveScroll","__assign","SideCar"],"mappings":"6ZAIG,IAACA,EAAoBC,EAAM,WAAW,SAAUC,EAAOC,EAAK,CAAE,OAAQF,EAAM,cAAcG,EAAAA,aAAcC,EAAAA,SAAS,CAAE,EAAEH,EAAO,CAAE,IAAKC,EAAK,QAASG,EAAS,CAAC,CAAK,CAAA,EACnKN,EAAkB,WAAaI,EAAAA,aAAa","x_google_ignoreList":[0]}
|
package/dist/index.cjs421.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var k=function(r){if(typeof document>"u")return null;var u=Array.isArray(r)?r[0]:r;return u.ownerDocument.body},f=new WeakMap,v=new WeakMap,p={},h=0,b=function(r){return r&&(r.host||b(r.parentNode))},O=function(r,u){return u.map(function(t){if(r.contains(t))return t;var n=b(t);return n&&r.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",r,". Doing nothing"),null)}).filter(function(t){return!!t})},D=function(r,u,t,n){var i=O(u,Array.isArray(r)?r:[r]);p[t]||(p[t]=new WeakMap);var o=p[t],l=[],s=new Set,S=new Set(i),y=function(e){!e||s.has(e)||(s.add(e),y(e.parentNode))};i.forEach(y);var A=function(e){!e||S.has(e)||Array.prototype.forEach.call(e.children,function(a){if(s.has(a))A(a);else try{var c=a.getAttribute(n),d=c!==null&&c!=="false",w=(f.get(a)||0)+1,M=(o.get(a)||0)+1;f.set(a,w),o.set(a,M),l.push(a),w===1&&d&&v.set(a,!0),M===1&&a.setAttribute(t,"true"),d||a.setAttribute(n,"true")}catch(W){console.error("aria-hidden: cannot operate on ",a,W)}})};return A(u),s.clear(),h++,function(){l.forEach(function(e){var a=f.get(e)-1,c=o.get(e)-1;f.set(e,a),o.set(e,c),a||(v.has(e)||e.removeAttribute(n),v.delete(e)),c||e.removeAttribute(t)}),h--,h||(f=new WeakMap,f=new WeakMap,v=new WeakMap,p={})}},E=function(r,u,t){t===void 0&&(t="data-aria-hidden");var n=Array.from(Array.isArray(r)?r:[r]),i=k(r);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),D(n,i,t,"aria-hidden")):function(){return null}};exports.hideOthers=E;
|
2
2
|
//# sourceMappingURL=index.cjs421.js.map
|
package/dist/index.cjs421.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs421.js","sources":["../node_modules
|
1
|
+
{"version":3,"file":"index.cjs421.js","sources":["../node_modules/aria-hidden/dist/es2015/index.js"],"sourcesContent":["var getDefaultParent = function (originalTarget) {\n if (typeof document === 'undefined') {\n return null;\n }\n var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;\n return sampleTarget.ownerDocument.body;\n};\nvar counterMap = new WeakMap();\nvar uncontrolledNodes = new WeakMap();\nvar markerMap = {};\nvar lockCount = 0;\nvar unwrapHost = function (node) {\n return node && (node.host || unwrapHost(node.parentNode));\n};\nvar correctTargets = function (parent, targets) {\n return targets\n .map(function (target) {\n if (parent.contains(target)) {\n return target;\n }\n var correctedTarget = unwrapHost(target);\n if (correctedTarget && parent.contains(correctedTarget)) {\n return correctedTarget;\n }\n console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing');\n return null;\n })\n .filter(function (x) { return Boolean(x); });\n};\n/**\n * Marks everything except given node(or nodes) as aria-hidden\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @param {String} [controlAttribute] - html Attribute to control\n * @return {Undo} undo command\n */\nvar applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) {\n var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);\n if (!markerMap[markerName]) {\n markerMap[markerName] = new WeakMap();\n }\n var markerCounter = markerMap[markerName];\n var hiddenNodes = [];\n var elementsToKeep = new Set();\n var elementsToStop = new Set(targets);\n var keep = function (el) {\n if (!el || elementsToKeep.has(el)) {\n return;\n }\n elementsToKeep.add(el);\n keep(el.parentNode);\n };\n targets.forEach(keep);\n var deep = function (parent) {\n if (!parent || elementsToStop.has(parent)) {\n return;\n }\n Array.prototype.forEach.call(parent.children, function (node) {\n if (elementsToKeep.has(node)) {\n deep(node);\n }\n else {\n try {\n var attr = node.getAttribute(controlAttribute);\n var alreadyHidden = attr !== null && attr !== 'false';\n var counterValue = (counterMap.get(node) || 0) + 1;\n var markerValue = (markerCounter.get(node) || 0) + 1;\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n hiddenNodes.push(node);\n if (counterValue === 1 && alreadyHidden) {\n uncontrolledNodes.set(node, true);\n }\n if (markerValue === 1) {\n node.setAttribute(markerName, 'true');\n }\n if (!alreadyHidden) {\n node.setAttribute(controlAttribute, 'true');\n }\n }\n catch (e) {\n console.error('aria-hidden: cannot operate on ', node, e);\n }\n }\n });\n };\n deep(parentNode);\n elementsToKeep.clear();\n lockCount++;\n return function () {\n hiddenNodes.forEach(function (node) {\n var counterValue = counterMap.get(node) - 1;\n var markerValue = markerCounter.get(node) - 1;\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n if (!counterValue) {\n if (!uncontrolledNodes.has(node)) {\n node.removeAttribute(controlAttribute);\n }\n uncontrolledNodes.delete(node);\n }\n if (!markerValue) {\n node.removeAttribute(markerName);\n }\n });\n lockCount--;\n if (!lockCount) {\n // clear\n counterMap = new WeakMap();\n counterMap = new WeakMap();\n uncontrolledNodes = new WeakMap();\n markerMap = {};\n }\n };\n};\n/**\n * Marks everything except given node(or nodes) as aria-hidden\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @return {Undo} undo command\n */\nexport var hideOthers = function (originalTarget, parentNode, markerName) {\n if (markerName === void 0) { markerName = 'data-aria-hidden'; }\n var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);\n var activeParentNode = parentNode || getDefaultParent(originalTarget);\n if (!activeParentNode) {\n return function () { return null; };\n }\n // we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10\n targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]')));\n return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden');\n};\n/**\n * Marks everything except given node(or nodes) as inert\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @return {Undo} undo command\n */\nexport var inertOthers = function (originalTarget, parentNode, markerName) {\n if (markerName === void 0) { markerName = 'data-inert-ed'; }\n var activeParentNode = parentNode || getDefaultParent(originalTarget);\n if (!activeParentNode) {\n return function () { return null; };\n }\n return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert');\n};\n/**\n * @returns if current browser supports inert\n */\nexport var supportsInert = function () {\n return typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert');\n};\n/**\n * Automatic function to \"suppress\" DOM elements - _hide_ or _inert_ in the best possible way\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @return {Undo} undo command\n */\nexport var suppressOthers = function (originalTarget, parentNode, markerName) {\n if (markerName === void 0) { markerName = 'data-suppressed'; }\n return (supportsInert() ? inertOthers : hideOthers)(originalTarget, parentNode, markerName);\n};\n"],"names":["getDefaultParent","originalTarget","sampleTarget","counterMap","uncontrolledNodes","markerMap","lockCount","unwrapHost","node","correctTargets","parent","targets","target","correctedTarget","x","applyAttributeToOthers","parentNode","markerName","controlAttribute","markerCounter","hiddenNodes","elementsToKeep","elementsToStop","keep","el","deep","attr","alreadyHidden","counterValue","markerValue","e","hideOthers","activeParentNode"],"mappings":"gFAAA,IAAIA,EAAmB,SAAUC,EAAgB,CAC7C,GAAI,OAAO,SAAa,IACpB,OAAO,KAEX,IAAIC,EAAe,MAAM,QAAQD,CAAc,EAAIA,EAAe,CAAC,EAAIA,EACvE,OAAOC,EAAa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,EAASqB,EAAkBf,EAAY,aAAa,GAJvE,UAAY,CAAE,OAAO,IAAO,CAK3C","x_google_ignoreList":[0]}
|
package/dist/index.cjs422.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),g=require("./index.cjs397.js"),u=require("./index.cjs216.js");function S(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const l=S(y);function b(e){const t=x(e),n=l.forwardRef((r,o)=>{const{children:i,...c}=r,s=l.Children.toArray(i),f=s.find(E);if(f){const a=f.props.children,m=s.map(p=>p===f?l.Children.count(a)>1?l.Children.only(null):l.isValidElement(a)?a.props.children:null:p);return u.jsxRuntimeExports.jsx(t,{...c,ref:o,children:l.isValidElement(a)?l.cloneElement(a,void 0,m):null})}return u.jsxRuntimeExports.jsx(t,{...c,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function x(e){const t=l.forwardRef((n,r)=>{const{children:o,...i}=n;if(l.isValidElement(o)){const c=O(o),s=R(i,o.props);return o.type!==l.Fragment&&(s.ref=r?g.composeRefs(r,c):c),l.cloneElement(o,s)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var d=Symbol("radix.slottable");function j(e){const t=({children:n})=>u.jsxRuntimeExports.jsx(u.jsxRuntimeExports.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=d,t}function E(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===d}function R(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function O(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}exports.createSlot=b;exports.createSlottable=j;
|
2
2
|
//# sourceMappingURL=index.cjs422.js.map
|
package/dist/index.cjs422.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs422.js","sources":["../node_modules/react-
|
1
|
+
{"version":3,"file":"index.cjs422.js","sources":["../node_modules/@radix-ui/react-slot/dist/index.mjs"],"sourcesContent":["// packages/react/slot/src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n childPropValue(...args);\n slotPropValue(...args);\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createSlot","ownerName","SlotClone","createSlotClone","Slot2","React","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","childrenRef","getElementRef","props2","mergeProps","composeRefs","SLOTTABLE_IDENTIFIER","createSlottable","Slottable2","Fragment2","childProps","overrideProps","propName","slotPropValue","childPropValue","args","element","getter","_a","mayWarn","_b"],"mappings":"icAKA,SAASA,EAAWC,EAAW,CAC7B,MAAMC,EAA4BC,EAAgBF,CAAS,EACrDG,EAAQC,EAAM,WAAW,CAACC,EAAOC,IAAiB,CACtD,KAAM,CAAE,SAAAC,EAAU,GAAGC,CAAS,EAAKH,EAC7BI,EAAgBL,EAAM,SAAS,QAAQG,CAAQ,EAC/CG,EAAYD,EAAc,KAAKE,CAAW,EAChD,GAAID,EAAW,CACb,MAAME,EAAaF,EAAU,MAAM,SAC7BG,EAAcJ,EAAc,IAAKK,GACjCA,IAAUJ,EACRN,EAAM,SAAS,MAAMQ,CAAU,EAAI,EAAUR,EAAM,SAAS,KAAK,IAAI,EAClEA,EAAM,eAAeQ,CAAU,EAAIA,EAAW,MAAM,SAAW,KAE/DE,CAEV,EACD,OAAuBC,EAAAA,kBAAAA,IAAId,EAAW,CAAE,GAAGO,EAAW,IAAKF,EAAc,SAAUF,EAAM,eAAeQ,CAAU,EAAIR,EAAM,aAAaQ,EAAY,OAAQC,CAAW,EAAI,KAAM,CACxL,CACI,OAAuBE,EAAAA,kBAAAA,IAAId,EAAW,CAAE,GAAGO,EAAW,IAAKF,EAAc,SAAAC,EAAU,CACvF,CAAG,EACD,OAAAJ,EAAM,YAAc,GAAGH,CAAS,QACzBG,CACT,CAGA,SAASD,EAAgBF,EA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,IAAa,QACtBD,EAAcC,CAAQ,EAAI,CAAE,GAAGC,EAAe,GAAGC,CAAgB,EACxDF,IAAa,cACtBD,EAAcC,CAAQ,EAAI,CAACC,EAAeC,CAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAExF,CACE,MAAO,CAAE,GAAGrB,EAAW,GAAGkB,CAAe,CAC3C,CACA,SAAST,EAAcc,EAAS,SAC9B,IAAIC,GAASC,EAAA,OAAO,yBAAyBF,EAAQ,MAAO,KAAK,IAApD,YAAAE,EAAuD,IAChEC,EAAUF,GAAU,mBAAoBA,GAAUA,EAAO,eAC7D,OAAIE,EACKH,EAAQ,KAEjBC,GAASG,EAAA,OAAO,yBAAyBJ,EAAS,KAAK,IAA9C,YAAAI,EAAiD,IAC1DD,EAAUF,GAAU,mBAAoBA,GAAUA,EAAO,eACrDE,EACKH,EAAQ,MAAM,IAEhBA,EAAQ,MAAM,KAAOA,EAAQ,IACtC","x_google_ignoreList":[0]}
|
package/dist/index.cjs431.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react");function o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const u=o(c);function s(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}exports.useCallbackRef=s;
|
2
2
|
//# sourceMappingURL=index.cjs431.js.map
|
package/dist/index.cjs431.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs431.js","sources":["../node_modules/@radix-ui/react-popper/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/popper/src/popper.tsx\nimport * as React from \"react\";\nimport {\n useFloating,\n autoUpdate,\n offset,\n shift,\n limitShift,\n hide,\n arrow as floatingUIarrow,\n flip,\n size\n} from \"@floating-ui/react-dom\";\nimport * as ArrowPrimitive from \"@radix-ui/react-arrow\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { useSize } from \"@radix-ui/react-use-size\";\nimport { jsx } from \"react/jsx-runtime\";\nvar SIDE_OPTIONS = [\"top\", \"right\", \"bottom\", \"left\"];\nvar ALIGN_OPTIONS = [\"start\", \"center\", \"end\"];\nvar POPPER_NAME = \"Popper\";\nvar [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\nvar [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);\nvar Popper = (props) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState(null);\n return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });\n};\nPopper.displayName = POPPER_NAME;\nvar ANCHOR_NAME = \"PopperAnchor\";\nvar PopperAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n context.onAnchorChange(virtualRef?.current || ref.current);\n });\n return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });\n }\n);\nPopperAnchor.displayName = ANCHOR_NAME;\nvar CONTENT_NAME = \"PopperContent\";\nvar [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);\nvar PopperContent = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopePopper,\n side = \"bottom\",\n sideOffset = 0,\n align = \"center\",\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary = [],\n collisionPadding: collisionPaddingProp = 0,\n sticky = \"partial\",\n hideWhenDetached = false,\n updatePositionStrategy = \"optimized\",\n onPlaced,\n ...contentProps\n } = props;\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n const [content, setContent] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const [arrow, setArrow] = React.useState(null);\n const arrowSize = useSize(arrow);\n const arrowWidth = arrowSize?.width ?? 0;\n const arrowHeight = arrowSize?.height ?? 0;\n const desiredPlacement = side + (align !== \"center\" ? \"-\" + align : \"\");\n const collisionPadding = typeof collisionPaddingProp === \"number\" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };\n const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];\n const hasExplicitBoundaries = boundary.length > 0;\n const detectOverflowOptions = {\n padding: collisionPadding,\n boundary: boundary.filter(isNotNull),\n // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries\n altBoundary: hasExplicitBoundaries\n };\n const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({\n // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues\n strategy: \"fixed\",\n placement: desiredPlacement,\n whileElementsMounted: (...args) => {\n const cleanup = autoUpdate(...args, {\n animationFrame: updatePositionStrategy === \"always\"\n });\n return cleanup;\n },\n elements: {\n reference: context.anchor\n },\n middleware: [\n offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),\n avoidCollisions && shift({\n mainAxis: true,\n crossAxis: false,\n limiter: sticky === \"partial\" ? limitShift() : void 0,\n ...detectOverflowOptions\n }),\n avoidCollisions && flip({ ...detectOverflowOptions }),\n size({\n ...detectOverflowOptions,\n apply: ({ elements, rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n const contentStyle = elements.floating.style;\n contentStyle.setProperty(\"--radix-popper-available-width\", `${availableWidth}px`);\n contentStyle.setProperty(\"--radix-popper-available-height\", `${availableHeight}px`);\n contentStyle.setProperty(\"--radix-popper-anchor-width\", `${anchorWidth}px`);\n contentStyle.setProperty(\"--radix-popper-anchor-height\", `${anchorHeight}px`);\n }\n }),\n arrow && floatingUIarrow({ element: arrow, padding: arrowPadding }),\n transformOrigin({ arrowWidth, arrowHeight }),\n hideWhenDetached && hide({ strategy: \"referenceHidden\", ...detectOverflowOptions })\n ]\n });\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const handlePlaced = useCallbackRef(onPlaced);\n useLayoutEffect(() => {\n if (isPositioned) {\n handlePlaced?.();\n }\n }, [isPositioned, handlePlaced]);\n const arrowX = middlewareData.arrow?.x;\n const arrowY = middlewareData.arrow?.y;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const [contentZIndex, setContentZIndex] = React.useState();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n return /* @__PURE__ */ jsx(\n \"div\",\n {\n ref: refs.setFloating,\n \"data-radix-popper-content-wrapper\": \"\",\n style: {\n ...floatingStyles,\n transform: isPositioned ? floatingStyles.transform : \"translate(0, -200%)\",\n // keep off the page when measuring\n minWidth: \"max-content\",\n zIndex: contentZIndex,\n [\"--radix-popper-transform-origin\"]: [\n middlewareData.transformOrigin?.x,\n middlewareData.transformOrigin?.y\n ].join(\" \"),\n // hide the content if using the hide middleware and should be hidden\n // set visibility to hidden and disable pointer events so the UI behaves\n // as if the PopperContent isn't there at all\n ...middlewareData.hide?.referenceHidden && {\n visibility: \"hidden\",\n pointerEvents: \"none\"\n }\n },\n dir: props.dir,\n children: /* @__PURE__ */ jsx(\n PopperContentProvider,\n {\n scope: __scopePopper,\n placedSide,\n onArrowChange: setArrow,\n arrowX,\n arrowY,\n shouldHideArrow: cannotCenterArrow,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-side\": placedSide,\n \"data-align\": placedAlign,\n ...contentProps,\n ref: composedRefs,\n style: {\n ...contentProps.style,\n // if the PopperContent hasn't been placed yet (not all measurements done)\n // we prevent animations so that users's animation don't kick in too early referring wrong sides\n animation: !isPositioned ? \"none\" : void 0\n }\n }\n )\n }\n )\n }\n );\n }\n);\nPopperContent.displayName = CONTENT_NAME;\nvar ARROW_NAME = \"PopperArrow\";\nvar OPPOSITE_SIDE = {\n top: \"bottom\",\n right: \"left\",\n bottom: \"top\",\n left: \"right\"\n};\nvar PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {\n const { __scopePopper, ...arrowProps } = props;\n const contentContext = useContentContext(ARROW_NAME, __scopePopper);\n const baseSide = OPPOSITE_SIDE[contentContext.placedSide];\n return (\n // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)\n // doesn't report size as we'd expect on SVG elements.\n // it reports their bounding box which is effectively the largest path inside the SVG.\n /* @__PURE__ */ jsx(\n \"span\",\n {\n ref: contentContext.onArrowChange,\n style: {\n position: \"absolute\",\n left: contentContext.arrowX,\n top: contentContext.arrowY,\n [baseSide]: 0,\n transformOrigin: {\n top: \"\",\n right: \"0 0\",\n bottom: \"center 0\",\n left: \"100% 0\"\n }[contentContext.placedSide],\n transform: {\n top: \"translateY(100%)\",\n right: \"translateY(50%) rotate(90deg) translateX(-50%)\",\n bottom: `rotate(180deg)`,\n left: \"translateY(50%) rotate(-90deg) translateX(50%)\"\n }[contentContext.placedSide],\n visibility: contentContext.shouldHideArrow ? \"hidden\" : void 0\n },\n children: /* @__PURE__ */ jsx(\n ArrowPrimitive.Root,\n {\n ...arrowProps,\n ref: forwardedRef,\n style: {\n ...arrowProps.style,\n // ensures the element can be measured correctly (mostly for if SVG)\n display: \"block\"\n }\n }\n )\n }\n )\n );\n});\nPopperArrow.displayName = ARROW_NAME;\nfunction isNotNull(value) {\n return value !== null;\n}\nvar transformOrigin = (options) => ({\n name: \"transformOrigin\",\n options,\n fn(data) {\n const { placement, rects, middlewareData } = data;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const isArrowHidden = cannotCenterArrow;\n const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;\n const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const noArrowAlign = { start: \"0%\", center: \"50%\", end: \"100%\" }[placedAlign];\n const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;\n const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;\n let x = \"\";\n let y = \"\";\n if (placedSide === \"bottom\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${-arrowHeight}px`;\n } else if (placedSide === \"top\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${rects.floating.height + arrowHeight}px`;\n } else if (placedSide === \"right\") {\n x = `${-arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n } else if (placedSide === \"left\") {\n x = `${rects.floating.width + arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n return { data: { x, y } };\n }\n});\nfunction getSideAndAlignFromPlacement(placement) {\n const [side, align = \"center\"] = placement.split(\"-\");\n return [side, align];\n}\nvar Root2 = Popper;\nvar Anchor = PopperAnchor;\nvar Content = PopperContent;\nvar Arrow = PopperArrow;\nexport {\n ALIGN_OPTIONS,\n Anchor,\n Arrow,\n Content,\n Popper,\n PopperAnchor,\n PopperArrow,\n PopperContent,\n Root2 as Root,\n SIDE_OPTIONS,\n createPopperScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["POPPER_NAME","createPopperContext","createPopperScope","createContextScope","PopperProvider","usePopperContext","Popper","props","__scopePopper","children","anchor","setAnchor","React","jsx","ANCHOR_NAME","PopperAnchor","forwardedRef","virtualRef","anchorProps","context","ref","composedRefs","useComposedRefs","Primitive","CONTENT_NAME","PopperContentProvider","useContentContext","PopperContent","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPaddingProp","sticky","hideWhenDetached","updatePositionStrategy","onPlaced","contentProps","content","setContent","node","arrow","setArrow","arrowSize","useSize","arrowWidth","arrowHeight","desiredPlacement","collisionPadding","boundary","hasExplicitBoundaries","detectOverflowOptions","isNotNull","refs","floatingStyles","placement","isPositioned","middlewareData","useFloating","args","autoUpdate","offset","shift","limitShift","flip","size","elements","rects","availableWidth","availableHeight","anchorWidth","anchorHeight","contentStyle","floatingUIarrow","transformOrigin","hide","placedSide","placedAlign","getSideAndAlignFromPlacement","handlePlaced","useCallbackRef","useLayoutEffect","arrowX","_a","arrowY","_b","cannotCenterArrow","_c","contentZIndex","setContentZIndex","_d","_e","_f","ARROW_NAME","OPPOSITE_SIDE","PopperArrow","arrowProps","contentContext","baseSide","ArrowPrimitive.Root","value","options","data","isArrowHidden","noArrowAlign","arrowXCenter","arrowYCenter","x","y","Root2","Anchor","Content","Arrow"],"mappings":"ksBAyBA,IAAIA,EAAc,SACd,CAACC,EAAqBC,EAAiB,EAAIC,GAAAA,mBAAmBH,CAAW,EACzE,CAACI,GAAgBC,CAAgB,EAAIJ,EAAoBD,CAAW,EACpEM,EAAUC,GAAU,CACtB,KAAM,CAAE,cAAAC,EAAe,SAAAC,CAAQ,EAAKF,EAC9B,CAACG,EAAQC,CAAS,EAAIC,EAAM,SAAS,IAAI,EAC/C,OAAuBC,EAAG,kBAAA,IAACT,GAAgB,CAAE,MAAOI,EAAe,OAAAE,EAAQ,eAAgBC,EAAW,SAAAF,EAAU,CAClH,EACAH,EAAO,YAAcN,EACrB,IAAIc,EAAc,eACdC,EAAeH,EAAM,WACvB,CAACL,EAAOS,IAAiB,CACvB,KAAM,CAAE,cAAAR,EAAe,WAAAS,EAAY,GAAGC,CAAa,EAAGX,EAChDY,EAAUd,EAAiBS,EAAaN,CAAa,EACrDY,EAAMR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AM,OAAQ,MAAO,IAAK,MAAQ,EAAC3B,CAAW,EACtE4B,KAAgBpB,EAAA5B,EAAe,QAAf,YAAA4B,EAAsB,IAAK,GAAKxC,EAAa,EAC7D6D,KAAgBnB,EAAA9B,EAAe,QAAf,YAAA8B,EAAsB,IAAK,GAAKzC,EAAc,EACpE,IAAI6D,EAAI,GACJC,EAAI,GACR,OAAIhC,IAAe,UACjB+B,EAAIJ,EAAgBC,EAAe,GAAGC,CAAY,KAClDG,EAAI,GAAG,CAAC9D,CAAW,MACV8B,IAAe,OACxB+B,EAAIJ,EAAgBC,EAAe,GAAGC,CAAY,KAClDG,EAAI,GAAGzC,EAAM,SAAS,OAASrB,CAAW,MACjC8B,IAAe,SACxB+B,EAAI,GAAG,CAAC7D,CAAW,KACnB8D,EAAIL,EAAgBC,EAAe,GAAGE,CAAY,MACzC9B,IAAe,SACxB+B,EAAI,GAAGxC,EAAM,SAAS,MAAQrB,CAAW,KACzC8D,EAAIL,EAAgBC,EAAe,GAAGE,CAAY,MAE7C,CAAE,KAAM,CAAE,EAAAC,EAAG,EAAAC,CAAC,CAAI,CAC7B,CACA,GACA,SAAS9B,GAA6BvB,EAAW,CAC/C,KAAM,CAAC9B,EAAME,EAAQ,QAAQ,EAAI4B,EAAU,MAAM,GAAG,EACpD,MAAO,CAAC9B,EAAME,CAAK,CACrB,CACG,IAACkF,GAAQ1G,EACR2G,GAASlG,EACTmG,GAAUvF,EACVwF,GAAQjB","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index.cjs431.js","sources":["../node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs"],"sourcesContent":["// packages/react/use-callback-ref/src/use-callback-ref.tsx\nimport * as React from \"react\";\nfunction useCallbackRef(callback) {\n const callbackRef = React.useRef(callback);\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);\n}\nexport {\n useCallbackRef\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useCallbackRef","callback","callbackRef","React","args","_a"],"mappings":"mYAEA,SAASA,EAAeC,EAAU,CAChC,MAAMC,EAAcC,EAAM,OAAOF,CAAQ,EACzCE,OAAAA,EAAM,UAAU,IAAM,CACpBD,EAAY,QAAUD,CAC1B,CAAG,EACME,EAAM,QAAQ,IAAM,IAAIC,WAAS,OAAAC,EAAAH,EAAY,UAAZ,YAAAG,EAAA,KAAAH,EAAsB,GAAGE,IAAO,EAAE,CAC5E","x_google_ignoreList":[0]}
|
package/dist/index.cjs432.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),v=require("./index.cjs398.js"),I=require("./index.cjs397.js"),M=require("./index.cjs422.js"),f=require("./index.cjs216.js");function _(s){const u=s+"CollectionProvider",[E,A]=v.createContextScope(u),[N,d]=E(u,{collectionRef:{current:null},itemMap:new Map}),p=c=>{const{scope:e,children:l}=c,t=r.useRef(null),o=r.useRef(new Map).current;return f.jsxRuntimeExports.jsx(N,{scope:e,itemMap:o,collectionRef:t,children:l})};p.displayName=u;const a=s+"CollectionSlot",T=M.createSlot(a),C=r.forwardRef((c,e)=>{const{scope:l,children:t}=c,o=d(a,l),n=I.useComposedRefs(e,o.collectionRef);return f.jsxRuntimeExports.jsx(T,{ref:n,children:t})});C.displayName=a;const m=s+"CollectionItemSlot",x="data-radix-collection-item",j=M.createSlot(m),R=r.forwardRef((c,e)=>{const{scope:l,children:t,...o}=c,n=r.useRef(null),S=I.useComposedRefs(e,n),i=d(m,l);return r.useEffect(()=>(i.itemMap.set(n,{ref:n,...o}),()=>void i.itemMap.delete(n))),f.jsxRuntimeExports.jsx(j,{[x]:"",ref:S,children:t})});R.displayName=m;function y(c){const e=d(s+"CollectionConsumer",c);return r.useCallback(()=>{const t=e.collectionRef.current;if(!t)return[];const o=Array.from(t.querySelectorAll(`[${x}]`));return Array.from(e.itemMap.values()).sort((i,O)=>o.indexOf(i.ref.current)-o.indexOf(O.ref.current))},[e.collectionRef,e.itemMap])}return[{Provider:p,Slot:C,ItemSlot:R},y,A]}exports.createCollection=_;
|
2
2
|
//# sourceMappingURL=index.cjs432.js.map
|