@arolariu/components 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +57 -0
- package/EXAMPLES.md +2510 -0
- package/dist/components/ui/alert-dialog.d.ts +4 -16
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +18 -14
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/avatar.d.ts +3 -12
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +18 -15
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button-group.d.ts.map +1 -1
- package/dist/components/ui/calendar.d.ts +1 -4
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +7 -7
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +125 -59
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/checkbox-group.d.ts +2 -6
- package/dist/components/ui/checkbox-group.d.ts.map +1 -1
- package/dist/components/ui/checkbox-group.js +8 -7
- package/dist/components/ui/checkbox-group.js.map +1 -1
- package/dist/components/ui/checkbox.d.ts +3 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +4 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js.map +1 -1
- package/dist/components/ui/combobox.d.ts +335 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox.js +206 -0
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/combobox.module.js +23 -0
- package/dist/components/ui/combobox.module.js.map +1 -0
- package/dist/components/ui/combobox_module.css +142 -0
- package/dist/components/ui/combobox_module.css.map +1 -0
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +25 -16
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdrawer.d.ts +10 -16
- package/dist/components/ui/dropdrawer.d.ts.map +1 -1
- package/dist/components/ui/dropdrawer.js +28 -20
- package/dist/components/ui/dropdrawer.js.map +1 -1
- package/dist/components/ui/item.d.ts +1 -1
- package/dist/components/ui/item.d.ts.map +1 -1
- package/dist/components/ui/menubar.d.ts +11 -13
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/meter.d.ts +8 -24
- package/dist/components/ui/meter.d.ts.map +1 -1
- package/dist/components/ui/meter.js +23 -19
- package/dist/components/ui/meter.js.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts +3 -12
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +14 -11
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/number-field.d.ts +6 -12
- package/dist/components/ui/number-field.d.ts.map +1 -1
- package/dist/components/ui/number-field.js.map +1 -1
- package/dist/components/ui/progress.d.ts +1 -4
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +10 -9
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.d.ts +2 -4
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/resizable.d.ts +3 -3
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/scratcher.d.ts +1 -1
- package/dist/components/ui/scratcher.d.ts.map +1 -1
- package/dist/components/ui/scratcher.js +5 -4
- package/dist/components/ui/scratcher.js.map +1 -1
- package/dist/components/ui/scroll-area.d.ts +2 -4
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/separator.d.ts +1 -4
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/separator.js +9 -8
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/sonner.d.ts +5 -4
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/sonner.js +7 -6
- package/dist/components/ui/sonner.js.map +1 -1
- package/dist/components/ui/toggle-group.d.ts +2 -8
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +12 -10
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toolbar.d.ts +10 -30
- package/dist/components/ui/toolbar.d.ts.map +1 -1
- package/dist/components/ui/toolbar.js +28 -23
- package/dist/components/ui/toolbar.js.map +1 -1
- package/dist/hooks/useClipboard.d.ts +77 -0
- package/dist/hooks/useClipboard.d.ts.map +1 -0
- package/dist/hooks/useClipboard.js +42 -0
- package/dist/hooks/useClipboard.js.map +1 -0
- package/dist/hooks/useControllableState.d.ts +54 -0
- package/dist/hooks/useControllableState.d.ts.map +1 -0
- package/dist/hooks/useControllableState.js +29 -0
- package/dist/hooks/useControllableState.js.map +1 -0
- package/dist/hooks/useDebounce.d.ts +33 -0
- package/dist/hooks/useDebounce.d.ts.map +1 -0
- package/dist/hooks/useDebounce.js +20 -0
- package/dist/hooks/useDebounce.js.map +1 -0
- package/dist/hooks/useEventCallback.d.ts +34 -0
- package/dist/hooks/useEventCallback.d.ts.map +1 -0
- package/dist/hooks/useEventCallback.js +12 -0
- package/dist/hooks/useEventCallback.js.map +1 -0
- package/dist/hooks/useId.d.ts +30 -0
- package/dist/hooks/useId.d.ts.map +1 -0
- package/dist/hooks/useId.js +9 -0
- package/dist/hooks/useId.js.map +1 -0
- package/dist/hooks/useIntersectionObserver.d.ts +51 -0
- package/dist/hooks/useIntersectionObserver.d.ts.map +1 -0
- package/dist/hooks/useIntersectionObserver.js +25 -0
- package/dist/hooks/useIntersectionObserver.js.map +1 -0
- package/dist/hooks/useInterval.d.ts +55 -0
- package/dist/hooks/useInterval.d.ts.map +1 -0
- package/dist/hooks/useInterval.js +24 -0
- package/dist/hooks/useInterval.js.map +1 -0
- package/dist/hooks/useLocalStorage.d.ts +43 -0
- package/dist/hooks/useLocalStorage.d.ts.map +1 -0
- package/dist/hooks/useLocalStorage.js +53 -0
- package/dist/hooks/useLocalStorage.js.map +1 -0
- package/dist/hooks/useMergedRefs.d.ts +27 -0
- package/dist/hooks/useMergedRefs.d.ts.map +1 -0
- package/dist/hooks/useMergedRefs.js +11 -0
- package/dist/hooks/useMergedRefs.js.map +1 -0
- package/dist/hooks/useOnClickOutside.d.ts +32 -0
- package/dist/hooks/useOnClickOutside.d.ts.map +1 -0
- package/dist/hooks/useOnClickOutside.js +23 -0
- package/dist/hooks/useOnClickOutside.js.map +1 -0
- package/dist/hooks/usePrevious.d.ts +33 -0
- package/dist/hooks/usePrevious.d.ts.map +1 -0
- package/dist/hooks/usePrevious.js +14 -0
- package/dist/hooks/usePrevious.js.map +1 -0
- package/dist/hooks/useThrottle.d.ts +37 -0
- package/dist/hooks/useThrottle.d.ts.map +1 -0
- package/dist/hooks/useThrottle.js +34 -0
- package/dist/hooks/useThrottle.js.map +1 -0
- package/dist/hooks/useTimeout.d.ts +28 -0
- package/dist/hooks/useTimeout.d.ts.map +1 -0
- package/dist/hooks/useTimeout.js +24 -0
- package/dist/hooks/useTimeout.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/lib/utilities.d.ts +2 -3
- package/dist/lib/utilities.d.ts.map +1 -1
- package/dist/lib/utilities.js.map +1 -1
- package/dist/motion/tokens.js +5 -5
- package/dist/motion/tokens.js.map +1 -1
- package/dist/rslib-runtime.js +39 -0
- package/dist/rslib-runtime.js.map +1 -0
- package/package.json +82 -3
- package/src/components/ui/alert-dialog.tsx +15 -8
- package/src/components/ui/avatar.tsx +9 -6
- package/src/components/ui/calendar.tsx +7 -13
- package/src/components/ui/carousel.tsx +2 -0
- package/src/components/ui/chart.tsx +63 -60
- package/src/components/ui/checkbox-group.tsx +4 -5
- package/src/components/ui/checkbox.tsx +10 -2
- package/src/components/ui/collapsible.tsx +1 -0
- package/src/components/ui/combobox.module.css +158 -0
- package/src/components/ui/combobox.tsx +569 -0
- package/src/components/ui/command.tsx +31 -15
- package/src/components/ui/context-menu.tsx +3 -0
- package/src/components/ui/drawer.tsx +2 -0
- package/src/components/ui/dropdown-menu.tsx +3 -0
- package/src/components/ui/dropdrawer.tsx +80 -62
- package/src/components/ui/menubar.tsx +9 -10
- package/src/components/ui/meter.tsx +16 -17
- package/src/components/ui/navigation-menu.tsx +41 -33
- package/src/components/ui/number-field.tsx +6 -13
- package/src/components/ui/progress.tsx +3 -2
- package/src/components/ui/radio-group.tsx +2 -5
- package/src/components/ui/resizable.tsx +2 -2
- package/src/components/ui/scratcher.tsx +6 -10
- package/src/components/ui/scroll-area.tsx +2 -5
- package/src/components/ui/separator.tsx +4 -3
- package/src/components/ui/sheet.tsx +3 -0
- package/src/components/ui/sidebar.tsx +1 -0
- package/src/components/ui/sonner.tsx +20 -12
- package/src/components/ui/toggle-group.tsx +6 -4
- package/src/components/ui/toolbar.tsx +20 -21
- package/src/hooks/useClipboard.tsx +137 -0
- package/src/hooks/useControllableState.tsx +81 -0
- package/src/hooks/useDebounce.tsx +50 -0
- package/src/hooks/useEventCallback.tsx +47 -0
- package/src/hooks/useId.tsx +36 -0
- package/src/hooks/useIntersectionObserver.tsx +81 -0
- package/src/hooks/useInterval.tsx +80 -0
- package/src/hooks/useLocalStorage.tsx +111 -0
- package/src/hooks/useMergedRefs.tsx +48 -0
- package/src/hooks/useOnClickOutside.tsx +55 -0
- package/src/hooks/usePrevious.tsx +44 -0
- package/src/hooks/useThrottle.tsx +78 -0
- package/src/hooks/useTimeout.tsx +51 -0
- package/src/index.ts +23 -0
- package/src/lib/utilities.ts +4 -4
- package/src/motion/tokens.ts +4 -4
- package/src/stories/DesignPrinciples.mdx +48 -0
- package/src/stories/GettingStarted.mdx +92 -0
- package/src/stories/Welcome.mdx +44 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
function useLocalStorage(key, initialValue) {
|
|
4
|
+
const [storedValue, setStoredValue] = useState(()=>{
|
|
5
|
+
if (void 0 === globalThis.window) return initialValue;
|
|
6
|
+
try {
|
|
7
|
+
const item = globalThis.window.localStorage.getItem(key);
|
|
8
|
+
return null !== item ? JSON.parse(item) : initialValue;
|
|
9
|
+
} catch (error) {
|
|
10
|
+
console.error(`Error reading localStorage key "${key}":`, error);
|
|
11
|
+
return initialValue;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const setValue = useCallback((value)=>{
|
|
15
|
+
try {
|
|
16
|
+
setStoredValue((currentValue)=>{
|
|
17
|
+
const valueToStore = value instanceof Function ? value(currentValue) : value;
|
|
18
|
+
if (void 0 !== globalThis.window) globalThis.window.localStorage.setItem(key, JSON.stringify(valueToStore));
|
|
19
|
+
return valueToStore;
|
|
20
|
+
});
|
|
21
|
+
} catch (error) {
|
|
22
|
+
console.error(`Error setting localStorage key "${key}":`, error);
|
|
23
|
+
}
|
|
24
|
+
}, [
|
|
25
|
+
key
|
|
26
|
+
]);
|
|
27
|
+
useEffect(()=>{
|
|
28
|
+
if (void 0 === globalThis.window) return;
|
|
29
|
+
const handleStorageChange = (event)=>{
|
|
30
|
+
if (event.key !== key || event.storageArea !== globalThis.window.localStorage) return;
|
|
31
|
+
try {
|
|
32
|
+
const newValue = null !== event.newValue ? JSON.parse(event.newValue) : initialValue;
|
|
33
|
+
setStoredValue(newValue);
|
|
34
|
+
} catch (error) {
|
|
35
|
+
console.error(`Error parsing storage event for key "${key}":`, error);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
globalThis.window.addEventListener("storage", handleStorageChange);
|
|
39
|
+
return ()=>{
|
|
40
|
+
globalThis.window.removeEventListener("storage", handleStorageChange);
|
|
41
|
+
};
|
|
42
|
+
}, [
|
|
43
|
+
key,
|
|
44
|
+
initialValue
|
|
45
|
+
]);
|
|
46
|
+
return [
|
|
47
|
+
storedValue,
|
|
48
|
+
setValue
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
export { useLocalStorage };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=useLocalStorage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks/useLocalStorage.js","sources":["../../src/hooks/useLocalStorage.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Persists state to localStorage with SSR safety and JSON serialization.\r\n *\r\n * @remarks\r\n * This hook synchronizes state with localStorage, allowing data to persist\r\n * across page refreshes and browser sessions. It is SSR-safe and returns the\r\n * initial value on the server until hydration completes. The hook also syncs\r\n * state across tabs/windows via the `storage` event and handles JSON parse\r\n * errors gracefully by falling back to the initial value.\r\n *\r\n * @typeParam T - The type of the value being stored.\r\n * @param key - The localStorage key to store the value under.\r\n * @param initialValue - The default value to use if no value is found in localStorage.\r\n * @returns A tuple containing the current value and a setter function.\r\n *\r\n * @example\r\n * ```tsx\r\n * function UserSettings() {\r\n * const [theme, setTheme] = useLocalStorage(\"theme\", \"light\");\r\n *\r\n * return (\r\n * <button onClick={() => setTheme(theme === \"light\" ? \"dark\" : \"light\")}>\r\n * Toggle theme (current: {theme})\r\n * </button>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @example\r\n * ```tsx\r\n * function ShoppingCart() {\r\n * const [cart, setCart] = useLocalStorage<Product[]>(\"cart\", []);\r\n *\r\n * return (\r\n * <button onClick={() => setCart((prev) => [...prev, newProduct])}>\r\n * Add to cart ({cart.length} items)\r\n * </button>\r\n * );\r\n * }\r\n * ```\r\n */\r\nexport function useLocalStorage<T>(key: string, initialValue: T): [T, (value: T | ((prev: T) => T)) => void] {\r\n const [storedValue, setStoredValue] = React.useState<T>(() => {\r\n // SSR safety: return initial value on server\r\n if (typeof globalThis.window === \"undefined\") {\r\n return initialValue;\r\n }\r\n\r\n try {\r\n const item = globalThis.window.localStorage.getItem(key);\r\n\r\n return item !== null ? (JSON.parse(item) as T) : initialValue;\r\n } catch (error) {\r\n console.error(`Error reading localStorage key \"${key}\":`, error);\r\n\r\n return initialValue;\r\n }\r\n });\r\n\r\n const setValue = React.useCallback(\r\n (value: T | ((prev: T) => T)) => {\r\n try {\r\n setStoredValue((currentValue) => {\r\n const valueToStore = value instanceof Function ? value(currentValue) : value;\r\n\r\n if (typeof globalThis.window !== \"undefined\") {\r\n globalThis.window.localStorage.setItem(key, JSON.stringify(valueToStore));\r\n }\r\n\r\n return valueToStore;\r\n });\r\n } catch (error) {\r\n console.error(`Error setting localStorage key \"${key}\":`, error);\r\n }\r\n },\r\n [key],\r\n );\r\n\r\n React.useEffect(() => {\r\n // SSR safety: window is not available on server\r\n if (typeof globalThis.window === \"undefined\") {\r\n return;\r\n }\r\n\r\n const handleStorageChange = (event: StorageEvent) => {\r\n if (event.key !== key || event.storageArea !== globalThis.window.localStorage) {\r\n return;\r\n }\r\n\r\n try {\r\n const newValue = event.newValue !== null ? (JSON.parse(event.newValue) as T) : initialValue;\r\n\r\n setStoredValue(newValue);\r\n } catch (error) {\r\n console.error(`Error parsing storage event for key \"${key}\":`, error);\r\n }\r\n };\r\n\r\n globalThis.window.addEventListener(\"storage\", handleStorageChange);\r\n\r\n return () => {\r\n globalThis.window.removeEventListener(\"storage\", handleStorageChange);\r\n };\r\n }, [key, initialValue]);\r\n\r\n return [storedValue, setValue];\r\n}\r\n"],"names":["useLocalStorage","key","initialValue","storedValue","setStoredValue","React","globalThis","item","JSON","error","console","setValue","value","currentValue","valueToStore","Function","handleStorageChange","event","newValue"],"mappings":";;AA6CO,SAASA,gBAAmBC,GAAW,EAAEC,YAAe;IAC7D,MAAM,CAACC,aAAaC,eAAe,GAAGC,SAAkB;QAEtD,IAAI,AAA6B,WAAtBC,WAAW,MAAM,EAC1B,OAAOJ;QAGT,IAAI;YACF,MAAMK,OAAOD,WAAW,MAAM,CAAC,YAAY,CAAC,OAAO,CAACL;YAEpD,OAAOM,AAAS,SAATA,OAAiBC,KAAK,KAAK,CAACD,QAAcL;QACnD,EAAE,OAAOO,OAAO;YACdC,QAAQ,KAAK,CAAC,CAAC,gCAAgC,EAAET,IAAI,EAAE,CAAC,EAAEQ;YAE1D,OAAOP;QACT;IACF;IAEA,MAAMS,WAAWN,YACf,CAACO;QACC,IAAI;YACFR,eAAe,CAACS;gBACd,MAAMC,eAAeF,iBAAiBG,WAAWH,MAAMC,gBAAgBD;gBAEvE,IAAI,AAA6B,WAAtBN,WAAW,MAAM,EAC1BA,WAAW,MAAM,CAAC,YAAY,CAAC,OAAO,CAACL,KAAKO,KAAK,SAAS,CAACM;gBAG7D,OAAOA;YACT;QACF,EAAE,OAAOL,OAAO;YACdC,QAAQ,KAAK,CAAC,CAAC,gCAAgC,EAAET,IAAI,EAAE,CAAC,EAAEQ;QAC5D;IACF,GACA;QAACR;KAAI;IAGPI,UAAgB;QAEd,IAAI,AAA6B,WAAtBC,WAAW,MAAM,EAC1B;QAGF,MAAMU,sBAAsB,CAACC;YAC3B,IAAIA,MAAM,GAAG,KAAKhB,OAAOgB,MAAM,WAAW,KAAKX,WAAW,MAAM,CAAC,YAAY,EAC3E;YAGF,IAAI;gBACF,MAAMY,WAAWD,AAAmB,SAAnBA,MAAM,QAAQ,GAAaT,KAAK,KAAK,CAACS,MAAM,QAAQ,IAAUf;gBAE/EE,eAAec;YACjB,EAAE,OAAOT,OAAO;gBACdC,QAAQ,KAAK,CAAC,CAAC,qCAAqC,EAAET,IAAI,EAAE,CAAC,EAAEQ;YACjE;QACF;QAEAH,WAAW,MAAM,CAAC,gBAAgB,CAAC,WAAWU;QAE9C,OAAO;YACLV,WAAW,MAAM,CAAC,mBAAmB,CAAC,WAAWU;QACnD;IACF,GAAG;QAACf;QAAKC;KAAa;IAEtB,OAAO;QAACC;QAAaQ;KAAS;AAChC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Merges multiple refs into a single callback ref.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* This hook is essential when you need to attach multiple refs to the same element,
|
|
7
|
+
* such as combining a forwarded ref with an internal ref for measurements or
|
|
8
|
+
* imperative operations. All provided refs will receive the same element instance.
|
|
9
|
+
*
|
|
10
|
+
* Supports all ref types: callback refs, mutable ref objects, and `null`/`undefined`.
|
|
11
|
+
*
|
|
12
|
+
* @typeParam T - The type of the element being referenced.
|
|
13
|
+
* @param refs - An array of refs to merge. Can include callback refs, ref objects, or undefined.
|
|
14
|
+
* @returns A callback ref that updates all provided refs.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const MyComponent = React.forwardRef<HTMLDivElement, Props>((props, forwardedRef) => {
|
|
19
|
+
* const internalRef = useRef<HTMLDivElement>(null);
|
|
20
|
+
* const mergedRef = useMergedRefs(forwardedRef, internalRef);
|
|
21
|
+
*
|
|
22
|
+
* return <div ref={mergedRef}>Content</div>;
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function useMergedRefs<T>(...refs: Array<React.Ref<T> | undefined>): React.RefCallback<T>;
|
|
27
|
+
//# sourceMappingURL=useMergedRefs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMergedRefs.d.ts","sourceRoot":"","sources":["../../src/hooks/useMergedRefs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAmB/F"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
function useMergedRefs(...refs) {
|
|
4
|
+
return useCallback((element)=>{
|
|
5
|
+
for (const ref of refs)if (ref) if ("function" == typeof ref) ref(element);
|
|
6
|
+
else ref.current = element;
|
|
7
|
+
}, refs);
|
|
8
|
+
}
|
|
9
|
+
export { useMergedRefs };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=useMergedRefs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks/useMergedRefs.js","sources":["../../src/hooks/useMergedRefs.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Merges multiple refs into a single callback ref.\r\n *\r\n * @remarks\r\n * This hook is essential when you need to attach multiple refs to the same element,\r\n * such as combining a forwarded ref with an internal ref for measurements or\r\n * imperative operations. All provided refs will receive the same element instance.\r\n *\r\n * Supports all ref types: callback refs, mutable ref objects, and `null`/`undefined`.\r\n *\r\n * @typeParam T - The type of the element being referenced.\r\n * @param refs - An array of refs to merge. Can include callback refs, ref objects, or undefined.\r\n * @returns A callback ref that updates all provided refs.\r\n *\r\n * @example\r\n * ```tsx\r\n * const MyComponent = React.forwardRef<HTMLDivElement, Props>((props, forwardedRef) => {\r\n * const internalRef = useRef<HTMLDivElement>(null);\r\n * const mergedRef = useMergedRefs(forwardedRef, internalRef);\r\n *\r\n * return <div ref={mergedRef}>Content</div>;\r\n * });\r\n * ```\r\n */\r\nexport function useMergedRefs<T>(...refs: Array<React.Ref<T> | undefined>): React.RefCallback<T> {\r\n return React.useCallback(\r\n (element: T | null) => {\r\n for (const ref of refs) {\r\n if (!ref) {\r\n continue;\r\n }\r\n\r\n if (typeof ref === \"function\") {\r\n ref(element);\r\n } else {\r\n // Mutable ref object\r\n (ref as React.MutableRefObject<T | null>).current = element;\r\n }\r\n }\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n refs,\r\n );\r\n}\r\n"],"names":["useMergedRefs","refs","React","element","ref"],"mappings":";;AA4BO,SAASA,cAAiB,GAAGC,IAAqC;IACvE,OAAOC,YACL,CAACC;QACC,KAAK,MAAMC,OAAOH,KAChB,IAAKG,KAIL,IAAI,AAAe,cAAf,OAAOA,KACTA,IAAID;aAGHC,IAAyC,OAAO,GAAGD;IAG1D,GAEAF;AAEJ"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Detects clicks or touch events outside a referenced element.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* This hook is commonly used for implementing dropdown menus, modals, and popovers
|
|
7
|
+
* that should close when the user interacts outside their boundaries. It listens
|
|
8
|
+
* to both mouse and touch events to ensure broad device compatibility.
|
|
9
|
+
*
|
|
10
|
+
* The event listeners are automatically cleaned up when the component unmounts.
|
|
11
|
+
*
|
|
12
|
+
* @param ref - A ref object pointing to the element to monitor.
|
|
13
|
+
* @param handler - Callback invoked when a click or touch occurs outside the element.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* function Dropdown() {
|
|
18
|
+
* const [isOpen, setIsOpen] = useState(false);
|
|
19
|
+
* const dropdownRef = useRef<HTMLDivElement>(null);
|
|
20
|
+
*
|
|
21
|
+
* useOnClickOutside(dropdownRef, () => setIsOpen(false));
|
|
22
|
+
*
|
|
23
|
+
* return (
|
|
24
|
+
* <div ref={dropdownRef}>
|
|
25
|
+
* {isOpen && <DropdownMenu />}
|
|
26
|
+
* </div>
|
|
27
|
+
* );
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function useOnClickOutside(ref: React.RefObject<HTMLElement | null>, handler: (event: MouseEvent | TouchEvent) => void): void;
|
|
32
|
+
//# sourceMappingURL=useOnClickOutside.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOnClickOutside.d.ts","sourceRoot":"","sources":["../../src/hooks/useOnClickOutside.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,KAAK,IAAI,GAAG,IAAI,CAqBnI"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
function useOnClickOutside(ref, handler) {
|
|
4
|
+
useEffect(()=>{
|
|
5
|
+
const listener = (event)=>{
|
|
6
|
+
const element = ref.current;
|
|
7
|
+
if (!element || element.contains(event.target)) return;
|
|
8
|
+
handler(event);
|
|
9
|
+
};
|
|
10
|
+
globalThis.document.addEventListener("mousedown", listener);
|
|
11
|
+
globalThis.document.addEventListener("touchstart", listener);
|
|
12
|
+
return ()=>{
|
|
13
|
+
globalThis.document.removeEventListener("mousedown", listener);
|
|
14
|
+
globalThis.document.removeEventListener("touchstart", listener);
|
|
15
|
+
};
|
|
16
|
+
}, [
|
|
17
|
+
ref,
|
|
18
|
+
handler
|
|
19
|
+
]);
|
|
20
|
+
}
|
|
21
|
+
export { useOnClickOutside };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=useOnClickOutside.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks/useOnClickOutside.js","sources":["../../src/hooks/useOnClickOutside.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Detects clicks or touch events outside a referenced element.\r\n *\r\n * @remarks\r\n * This hook is commonly used for implementing dropdown menus, modals, and popovers\r\n * that should close when the user interacts outside their boundaries. It listens\r\n * to both mouse and touch events to ensure broad device compatibility.\r\n *\r\n * The event listeners are automatically cleaned up when the component unmounts.\r\n *\r\n * @param ref - A ref object pointing to the element to monitor.\r\n * @param handler - Callback invoked when a click or touch occurs outside the element.\r\n *\r\n * @example\r\n * ```tsx\r\n * function Dropdown() {\r\n * const [isOpen, setIsOpen] = useState(false);\r\n * const dropdownRef = useRef<HTMLDivElement>(null);\r\n *\r\n * useOnClickOutside(dropdownRef, () => setIsOpen(false));\r\n *\r\n * return (\r\n * <div ref={dropdownRef}>\r\n * {isOpen && <DropdownMenu />}\r\n * </div>\r\n * );\r\n * }\r\n * ```\r\n */\r\nexport function useOnClickOutside(ref: React.RefObject<HTMLElement | null>, handler: (event: MouseEvent | TouchEvent) => void): void {\r\n React.useEffect(() => {\r\n const listener = (event: MouseEvent | TouchEvent) => {\r\n const element = ref.current;\r\n\r\n // Do nothing if clicking ref's element or descendent elements\r\n if (!element || element.contains(event.target as Node)) {\r\n return;\r\n }\r\n\r\n handler(event);\r\n };\r\n\r\n globalThis.document.addEventListener(\"mousedown\", listener);\r\n globalThis.document.addEventListener(\"touchstart\", listener);\r\n\r\n return () => {\r\n globalThis.document.removeEventListener(\"mousedown\", listener);\r\n globalThis.document.removeEventListener(\"touchstart\", listener);\r\n };\r\n }, [ref, handler]);\r\n}\r\n"],"names":["useOnClickOutside","ref","handler","React","listener","event","element","globalThis"],"mappings":";;AAiCO,SAASA,kBAAkBC,GAAwC,EAAEC,OAAiD;IAC3HC,UAAgB;QACd,MAAMC,WAAW,CAACC;YAChB,MAAMC,UAAUL,IAAI,OAAO;YAG3B,IAAI,CAACK,WAAWA,QAAQ,QAAQ,CAACD,MAAM,MAAM,GAC3C;YAGFH,QAAQG;QACV;QAEAE,WAAW,QAAQ,CAAC,gBAAgB,CAAC,aAAaH;QAClDG,WAAW,QAAQ,CAAC,gBAAgB,CAAC,cAAcH;QAEnD,OAAO;YACLG,WAAW,QAAQ,CAAC,mBAAmB,CAAC,aAAaH;YACrDG,WAAW,QAAQ,CAAC,mBAAmB,CAAC,cAAcH;QACxD;IACF,GAAG;QAACH;QAAKC;KAAQ;AACnB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracks and returns the previous value of a state or prop.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This hook stores the value from the previous render cycle, allowing you to compare
|
|
6
|
+
* current and previous values. On the initial render, it returns `undefined` since
|
|
7
|
+
* there is no previous value yet.
|
|
8
|
+
*
|
|
9
|
+
* Useful for detecting changes, implementing undo functionality, or creating
|
|
10
|
+
* animations based on value transitions.
|
|
11
|
+
*
|
|
12
|
+
* @typeParam T - The type of the value being tracked.
|
|
13
|
+
* @param value - The current value to track.
|
|
14
|
+
* @returns The value from the previous render, or `undefined` on the first render.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* function Counter() {
|
|
19
|
+
* const [count, setCount] = useState(0);
|
|
20
|
+
* const previousCount = usePrevious(count);
|
|
21
|
+
*
|
|
22
|
+
* return (
|
|
23
|
+
* <div>
|
|
24
|
+
* <p>Current: {count}</p>
|
|
25
|
+
* <p>Previous: {previousCount ?? "N/A"}</p>
|
|
26
|
+
* <button onClick={() => setCount(count + 1)}>Increment</button>
|
|
27
|
+
* </div>
|
|
28
|
+
* );
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function usePrevious<T>(value: T): T | undefined;
|
|
33
|
+
//# sourceMappingURL=usePrevious.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePrevious.d.ts","sourceRoot":"","sources":["../../src/hooks/usePrevious.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAQtD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
function usePrevious(value) {
|
|
4
|
+
const ref = useRef(void 0);
|
|
5
|
+
useEffect(()=>{
|
|
6
|
+
ref.current = value;
|
|
7
|
+
}, [
|
|
8
|
+
value
|
|
9
|
+
]);
|
|
10
|
+
return ref.current;
|
|
11
|
+
}
|
|
12
|
+
export { usePrevious };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=usePrevious.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks/usePrevious.js","sources":["../../src/hooks/usePrevious.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Tracks and returns the previous value of a state or prop.\r\n *\r\n * @remarks\r\n * This hook stores the value from the previous render cycle, allowing you to compare\r\n * current and previous values. On the initial render, it returns `undefined` since\r\n * there is no previous value yet.\r\n *\r\n * Useful for detecting changes, implementing undo functionality, or creating\r\n * animations based on value transitions.\r\n *\r\n * @typeParam T - The type of the value being tracked.\r\n * @param value - The current value to track.\r\n * @returns The value from the previous render, or `undefined` on the first render.\r\n *\r\n * @example\r\n * ```tsx\r\n * function Counter() {\r\n * const [count, setCount] = useState(0);\r\n * const previousCount = usePrevious(count);\r\n *\r\n * return (\r\n * <div>\r\n * <p>Current: {count}</p>\r\n * <p>Previous: {previousCount ?? \"N/A\"}</p>\r\n * <button onClick={() => setCount(count + 1)}>Increment</button>\r\n * </div>\r\n * );\r\n * }\r\n * ```\r\n */\r\nexport function usePrevious<T>(value: T): T | undefined {\r\n const ref = React.useRef<T | undefined>(undefined);\r\n\r\n React.useEffect(() => {\r\n ref.current = value;\r\n }, [value]);\r\n\r\n return ref.current;\r\n}\r\n"],"names":["usePrevious","value","ref","React","undefined"],"mappings":";;AAmCO,SAASA,YAAeC,KAAQ;IACrC,MAAMC,MAAMC,OAA4BC;IAExCD,UAAgB;QACdD,IAAI,OAAO,GAAGD;IAChB,GAAG;QAACA;KAAM;IAEV,OAAOC,IAAI,OAAO;AACpB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Throttles a callback function, limiting how often it can be invoked.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This hook returns a throttled version of the provided callback that can only
|
|
6
|
+
* be executed once per specified interval. Subsequent calls within the interval
|
|
7
|
+
* are ignored. Useful for rate-limiting expensive operations triggered by high-frequency
|
|
8
|
+
* events like scrolling, resizing, or mouse movement.
|
|
9
|
+
*
|
|
10
|
+
* Unlike debouncing, throttling ensures the callback is invoked at regular intervals
|
|
11
|
+
* during continuous events, providing more predictable execution timing.
|
|
12
|
+
*
|
|
13
|
+
* @typeParam Args - The tuple type of the callback's arguments.
|
|
14
|
+
* @param callback - The function to throttle.
|
|
15
|
+
* @param delay - The minimum interval in milliseconds between invocations.
|
|
16
|
+
* @returns A throttled version of the callback.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* function ScrollTracker() {
|
|
21
|
+
* const [scrollPos, setScrollPos] = useState(0);
|
|
22
|
+
*
|
|
23
|
+
* const handleScroll = useThrottle(() => {
|
|
24
|
+
* setScrollPos(window.scrollY);
|
|
25
|
+
* }, 200);
|
|
26
|
+
*
|
|
27
|
+
* useEffect(() => {
|
|
28
|
+
* window.addEventListener("scroll", handleScroll);
|
|
29
|
+
* return () => window.removeEventListener("scroll", handleScroll);
|
|
30
|
+
* }, [handleScroll]);
|
|
31
|
+
*
|
|
32
|
+
* return <p>Scroll position: {scrollPos}</p>;
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function useThrottle<Args extends unknown[]>(callback: (...args: Args) => void, delay: number): (...args: Args) => void;
|
|
37
|
+
//# sourceMappingURL=useThrottle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useThrottle.d.ts","sourceRoot":"","sources":["../../src/hooks/useThrottle.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,WAAW,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,IAAI,CAsC7H"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
3
|
+
function useThrottle(callback, delay) {
|
|
4
|
+
const lastRunRef = useRef(0);
|
|
5
|
+
const timeoutRef = useRef(void 0);
|
|
6
|
+
const callbackRef = useRef(callback);
|
|
7
|
+
useEffect(()=>{
|
|
8
|
+
callbackRef.current = callback;
|
|
9
|
+
}, [
|
|
10
|
+
callback
|
|
11
|
+
]);
|
|
12
|
+
useEffect(()=>()=>{
|
|
13
|
+
if (timeoutRef.current) globalThis.clearTimeout(timeoutRef.current);
|
|
14
|
+
}, []);
|
|
15
|
+
return useCallback((...args)=>{
|
|
16
|
+
const now = Date.now();
|
|
17
|
+
const timeSinceLastRun = now - lastRunRef.current;
|
|
18
|
+
if (timeSinceLastRun >= delay) {
|
|
19
|
+
callbackRef.current(...args);
|
|
20
|
+
lastRunRef.current = now;
|
|
21
|
+
} else {
|
|
22
|
+
if (timeoutRef.current) globalThis.clearTimeout(timeoutRef.current);
|
|
23
|
+
timeoutRef.current = globalThis.setTimeout(()=>{
|
|
24
|
+
callbackRef.current(...args);
|
|
25
|
+
lastRunRef.current = Date.now();
|
|
26
|
+
}, delay - timeSinceLastRun);
|
|
27
|
+
}
|
|
28
|
+
}, [
|
|
29
|
+
delay
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
export { useThrottle };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=useThrottle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks/useThrottle.js","sources":["../../src/hooks/useThrottle.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Throttles a callback function, limiting how often it can be invoked.\r\n *\r\n * @remarks\r\n * This hook returns a throttled version of the provided callback that can only\r\n * be executed once per specified interval. Subsequent calls within the interval\r\n * are ignored. Useful for rate-limiting expensive operations triggered by high-frequency\r\n * events like scrolling, resizing, or mouse movement.\r\n *\r\n * Unlike debouncing, throttling ensures the callback is invoked at regular intervals\r\n * during continuous events, providing more predictable execution timing.\r\n *\r\n * @typeParam Args - The tuple type of the callback's arguments.\r\n * @param callback - The function to throttle.\r\n * @param delay - The minimum interval in milliseconds between invocations.\r\n * @returns A throttled version of the callback.\r\n *\r\n * @example\r\n * ```tsx\r\n * function ScrollTracker() {\r\n * const [scrollPos, setScrollPos] = useState(0);\r\n *\r\n * const handleScroll = useThrottle(() => {\r\n * setScrollPos(window.scrollY);\r\n * }, 200);\r\n *\r\n * useEffect(() => {\r\n * window.addEventListener(\"scroll\", handleScroll);\r\n * return () => window.removeEventListener(\"scroll\", handleScroll);\r\n * }, [handleScroll]);\r\n *\r\n * return <p>Scroll position: {scrollPos}</p>;\r\n * }\r\n * ```\r\n */\r\nexport function useThrottle<Args extends unknown[]>(callback: (...args: Args) => void, delay: number): (...args: Args) => void {\r\n const lastRunRef = React.useRef(0);\r\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\r\n const callbackRef = React.useRef(callback);\r\n\r\n React.useEffect(() => {\r\n callbackRef.current = callback;\r\n }, [callback]);\r\n\r\n React.useEffect(() => {\r\n return () => {\r\n if (timeoutRef.current) {\r\n globalThis.clearTimeout(timeoutRef.current);\r\n }\r\n };\r\n }, []);\r\n\r\n return React.useCallback(\r\n (...args: Args) => {\r\n const now = Date.now();\r\n const timeSinceLastRun = now - lastRunRef.current;\r\n\r\n if (timeSinceLastRun >= delay) {\r\n callbackRef.current(...args);\r\n lastRunRef.current = now;\r\n } else {\r\n if (timeoutRef.current) {\r\n globalThis.clearTimeout(timeoutRef.current);\r\n }\r\n\r\n timeoutRef.current = globalThis.setTimeout(() => {\r\n callbackRef.current(...args);\r\n lastRunRef.current = Date.now();\r\n }, delay - timeSinceLastRun);\r\n }\r\n },\r\n [delay],\r\n );\r\n}\r\n"],"names":["useThrottle","callback","delay","lastRunRef","React","timeoutRef","undefined","callbackRef","globalThis","args","now","Date","timeSinceLastRun"],"mappings":";;AAuCO,SAASA,YAAoCC,QAAiC,EAAEC,KAAa;IAClG,MAAMC,aAAaC,OAAa;IAChC,MAAMC,aAAaD,OAAwDE;IAC3E,MAAMC,cAAcH,OAAaH;IAEjCG,UAAgB;QACdG,YAAY,OAAO,GAAGN;IACxB,GAAG;QAACA;KAAS;IAEbG,UAAgB,IACP;YACL,IAAIC,WAAW,OAAO,EACpBG,WAAW,YAAY,CAACH,WAAW,OAAO;QAE9C,GACC,EAAE;IAEL,OAAOD,YACL,CAAC,GAAGK;QACF,MAAMC,MAAMC,KAAK,GAAG;QACpB,MAAMC,mBAAmBF,MAAMP,WAAW,OAAO;QAEjD,IAAIS,oBAAoBV,OAAO;YAC7BK,YAAY,OAAO,IAAIE;YACvBN,WAAW,OAAO,GAAGO;QACvB,OAAO;YACL,IAAIL,WAAW,OAAO,EACpBG,WAAW,YAAY,CAACH,WAAW,OAAO;YAG5CA,WAAW,OAAO,GAAGG,WAAW,UAAU,CAAC;gBACzCD,YAAY,OAAO,IAAIE;gBACvBN,WAAW,OAAO,GAAGQ,KAAK,GAAG;YAC/B,GAAGT,QAAQU;QACb;IACF,GACA;QAACV;KAAM;AAEX"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Executes a callback after a specified delay with automatic cleanup.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This hook wraps `setTimeout` and automatically clears the timeout when the component
|
|
6
|
+
* unmounts or when the delay changes. Setting `delay` to `null` disables the timeout.
|
|
7
|
+
*
|
|
8
|
+
* The timeout is reset whenever the `callback` or `delay` changes, ensuring the most
|
|
9
|
+
* recent callback is always executed.
|
|
10
|
+
*
|
|
11
|
+
* @param callback - The function to execute after the delay.
|
|
12
|
+
* @param delay - The delay in milliseconds, or `null` to disable the timeout.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* function DelayedMessage() {
|
|
17
|
+
* const [visible, setVisible] = useState(false);
|
|
18
|
+
*
|
|
19
|
+
* useTimeout(() => {
|
|
20
|
+
* setVisible(true);
|
|
21
|
+
* }, 3000);
|
|
22
|
+
*
|
|
23
|
+
* return visible ? <p>Message appeared!</p> : <p>Waiting...</p>;
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function useTimeout(callback: () => void, delay: number | null): void;
|
|
28
|
+
//# sourceMappingURL=useTimeout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTimeout.d.ts","sourceRoot":"","sources":["../../src/hooks/useTimeout.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAoB3E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useLayoutEffect, useRef } from "react";
|
|
3
|
+
function useTimeout(callback, delay) {
|
|
4
|
+
const savedCallback = useRef(callback);
|
|
5
|
+
useLayoutEffect(()=>{
|
|
6
|
+
savedCallback.current = callback;
|
|
7
|
+
}, [
|
|
8
|
+
callback
|
|
9
|
+
]);
|
|
10
|
+
useEffect(()=>{
|
|
11
|
+
if (null === delay) return;
|
|
12
|
+
const timeoutId = globalThis.setTimeout(()=>{
|
|
13
|
+
savedCallback.current();
|
|
14
|
+
}, delay);
|
|
15
|
+
return ()=>{
|
|
16
|
+
globalThis.clearTimeout(timeoutId);
|
|
17
|
+
};
|
|
18
|
+
}, [
|
|
19
|
+
delay
|
|
20
|
+
]);
|
|
21
|
+
}
|
|
22
|
+
export { useTimeout };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=useTimeout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks/useTimeout.js","sources":["../../src/hooks/useTimeout.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Executes a callback after a specified delay with automatic cleanup.\r\n *\r\n * @remarks\r\n * This hook wraps `setTimeout` and automatically clears the timeout when the component\r\n * unmounts or when the delay changes. Setting `delay` to `null` disables the timeout.\r\n *\r\n * The timeout is reset whenever the `callback` or `delay` changes, ensuring the most\r\n * recent callback is always executed.\r\n *\r\n * @param callback - The function to execute after the delay.\r\n * @param delay - The delay in milliseconds, or `null` to disable the timeout.\r\n *\r\n * @example\r\n * ```tsx\r\n * function DelayedMessage() {\r\n * const [visible, setVisible] = useState(false);\r\n *\r\n * useTimeout(() => {\r\n * setVisible(true);\r\n * }, 3000);\r\n *\r\n * return visible ? <p>Message appeared!</p> : <p>Waiting...</p>;\r\n * }\r\n * ```\r\n */\r\nexport function useTimeout(callback: () => void, delay: number | null): void {\r\n const savedCallback = React.useRef(callback);\r\n\r\n React.useLayoutEffect(() => {\r\n savedCallback.current = callback;\r\n }, [callback]);\r\n\r\n React.useEffect(() => {\r\n if (delay === null) {\r\n return;\r\n }\r\n\r\n const timeoutId = globalThis.setTimeout(() => {\r\n savedCallback.current();\r\n }, delay);\r\n\r\n return () => {\r\n globalThis.clearTimeout(timeoutId);\r\n };\r\n }, [delay]);\r\n}\r\n"],"names":["useTimeout","callback","delay","savedCallback","React","timeoutId","globalThis"],"mappings":";;AA8BO,SAASA,WAAWC,QAAoB,EAAEC,KAAoB;IACnE,MAAMC,gBAAgBC,OAAaH;IAEnCG,gBAAsB;QACpBD,cAAc,OAAO,GAAGF;IAC1B,GAAG;QAACA;KAAS;IAEbG,UAAgB;QACd,IAAIF,AAAU,SAAVA,OACF;QAGF,MAAMG,YAAYC,WAAW,UAAU,CAAC;YACtCH,cAAc,OAAO;QACvB,GAAGD;QAEH,OAAO;YACLI,WAAW,YAAY,CAACD;QAC1B;IACF,GAAG;QAACH;KAAM;AACZ"}
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export { CheckboxGroup } from "./components/ui/checkbox-group";
|
|
|
23
23
|
export { Area, AreaChart, Bar, BarChart, BarStack, Brush, CartesianGrid, Cell, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, ComposedChart, Cross, Curve, Customized, DefaultZIndexes, Dot, ErrorBar, Funnel, FunnelChart, LabelList, Line, LineChart, Pie, PieChart, PolarAngleAxis, PolarGrid, PolarRadiusAxis, Polygon, Radar, RadarChart, RadialBar, RadialBarChart, RechartsLabel, Rectangle, ReferenceArea, ReferenceDot, ReferenceLine, ResponsiveContainer, Sankey, Scatter, ScatterChart, Sector, SunburstChart, Symbols, Trapezoid, Treemap, XAxis, YAxis, ZAxis, ZIndexLayer, useActiveTooltipCoordinate, useActiveTooltipDataPoints, useActiveTooltipLabel, useChartHeight, useChartWidth, useIsTooltipActive, useMargin, useOffset, usePlotArea, useXAxisDomain, useYAxisDomain, type ChartConfig, type DefaultLegendContentProps, type DefaultTooltipContentProps, type TooltipValueType, } from "./components/ui/chart";
|
|
24
24
|
export { Checkbox } from "./components/ui/checkbox";
|
|
25
25
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/ui/collapsible";
|
|
26
|
+
export { Combobox, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxItem, ComboboxSeparator, ComboboxTrigger, } from "./components/ui/combobox";
|
|
26
27
|
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from "./components/ui/command";
|
|
27
28
|
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, } from "./components/ui/context-menu";
|
|
28
29
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from "./components/ui/dialog";
|
|
@@ -75,12 +76,25 @@ export { Stepper, type StepperProps } from "./components/ui/stepper";
|
|
|
75
76
|
export { Timeline, TimelineContent, TimelineDot, TimelineItem, type TimelineContentProps, type TimelineDotProps, type TimelineItemProps, type TimelineProps, } from "./components/ui/timeline";
|
|
76
77
|
export { VisuallyHidden, type VisuallyHiddenProps } from "./components/ui/visually-hidden";
|
|
77
78
|
export { useBreakpoint, type Breakpoint } from "./hooks/useBreakpoint";
|
|
79
|
+
export { useClipboard, type UseClipboardOptions, type UseClipboardReturn } from "./hooks/useClipboard";
|
|
78
80
|
export { useColorScheme, type ColorScheme } from "./hooks/useColorScheme";
|
|
81
|
+
export { useControllableState, type UseControllableStateOptions } from "./hooks/useControllableState";
|
|
82
|
+
export { useDebounce } from "./hooks/useDebounce";
|
|
83
|
+
export { useEventCallback } from "./hooks/useEventCallback";
|
|
79
84
|
export { useFocusVisible } from "./hooks/useFocusVisible";
|
|
85
|
+
export { useId } from "./hooks/useId";
|
|
86
|
+
export { useIntersectionObserver } from "./hooks/useIntersectionObserver";
|
|
87
|
+
export { useInterval } from "./hooks/useInterval";
|
|
80
88
|
export { useIsMobile } from "./hooks/useIsMobile";
|
|
89
|
+
export { useLocalStorage } from "./hooks/useLocalStorage";
|
|
81
90
|
export { useMediaQuery } from "./hooks/useMediaQuery";
|
|
91
|
+
export { useMergedRefs } from "./hooks/useMergedRefs";
|
|
92
|
+
export { useOnClickOutside } from "./hooks/useOnClickOutside";
|
|
82
93
|
export { usePrefersContrast } from "./hooks/usePrefersContrast";
|
|
94
|
+
export { usePrevious } from "./hooks/usePrevious";
|
|
83
95
|
export { useReducedMotion } from "./hooks/useReducedMotion";
|
|
96
|
+
export { useThrottle } from "./hooks/useThrottle";
|
|
97
|
+
export { useTimeout } from "./hooks/useTimeout";
|
|
84
98
|
export { useWindowSize } from "./hooks/useWindowSize";
|
|
85
99
|
export { adjustHexColorLightness, adjustLightness, calculateComplementaryHexColor, convertHexToHslString, convertHslToHexString, getComplementaryColor, hexToHsl, hslToHex, isValidHexColor, parseHslString, parseHslStringToComponents, validateHexColorFormat, } from "./lib/color-conversion-utilities";
|
|
86
100
|
export { cn } from "./lib/utilities";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,WAAW,EAAC,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAC,iBAAiB,EAAC,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAC,UAAU,EAAC,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAC,SAAS,EAAC,MAAM,2BAA2B,CAAC;AAMpD,OAAO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KAAK,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAGnF,OAAO,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAC,SAAS,EAAC,MAAM,2BAA2B,CAAC;AAGpD,OAAO,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAC,cAAc,EAAE,oBAAoB,EAAC,MAAM,4BAA4B,CAAC;AAGhF,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export { CheckboxGroup } from "./components/ui/checkbox-group.js";
|
|
|
18
18
|
export { Area, AreaChart, Bar, BarChart, BarStack, Brush, CartesianGrid, Cell, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, ComposedChart, Cross, Curve, Customized, DefaultZIndexes, Dot, ErrorBar, Funnel, FunnelChart, LabelList, Line, LineChart, Pie, PieChart, PolarAngleAxis, PolarGrid, PolarRadiusAxis, Polygon, Radar, RadarChart, RadialBar, RadialBarChart, RechartsLabel, Rectangle, ReferenceArea, ReferenceDot, ReferenceLine, ResponsiveContainer, Sankey, Scatter, ScatterChart, Sector, SunburstChart, Symbols, Trapezoid, Treemap, XAxis, YAxis, ZAxis, ZIndexLayer, useActiveTooltipCoordinate, useActiveTooltipDataPoints, useActiveTooltipLabel, useChartHeight, useChartWidth, useIsTooltipActive, useMargin, useOffset, usePlotArea, useXAxisDomain, useYAxisDomain } from "./components/ui/chart.js";
|
|
19
19
|
export { Checkbox } from "./components/ui/checkbox.js";
|
|
20
20
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/ui/collapsible.js";
|
|
21
|
+
export { Combobox, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxItem, ComboboxSeparator, ComboboxTrigger } from "./components/ui/combobox.js";
|
|
21
22
|
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "./components/ui/command.js";
|
|
22
23
|
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger } from "./components/ui/context-menu.js";
|
|
23
24
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/ui/dialog.js";
|
|
@@ -64,12 +65,25 @@ export { Stepper } from "./components/ui/stepper.js";
|
|
|
64
65
|
export { Timeline, TimelineContent, TimelineDot, TimelineItem } from "./components/ui/timeline.js";
|
|
65
66
|
export { VisuallyHidden } from "./components/ui/visually-hidden.js";
|
|
66
67
|
export { useBreakpoint } from "./hooks/useBreakpoint.js";
|
|
68
|
+
export { useClipboard } from "./hooks/useClipboard.js";
|
|
67
69
|
export { useColorScheme } from "./hooks/useColorScheme.js";
|
|
70
|
+
export { useControllableState } from "./hooks/useControllableState.js";
|
|
71
|
+
export { useDebounce } from "./hooks/useDebounce.js";
|
|
72
|
+
export { useEventCallback } from "./hooks/useEventCallback.js";
|
|
68
73
|
export { useFocusVisible } from "./hooks/useFocusVisible.js";
|
|
74
|
+
export { useId } from "./hooks/useId.js";
|
|
75
|
+
export { useIntersectionObserver } from "./hooks/useIntersectionObserver.js";
|
|
76
|
+
export { useInterval } from "./hooks/useInterval.js";
|
|
69
77
|
export { useIsMobile } from "./hooks/useIsMobile.js";
|
|
78
|
+
export { useLocalStorage } from "./hooks/useLocalStorage.js";
|
|
70
79
|
export { useMediaQuery } from "./hooks/useMediaQuery.js";
|
|
80
|
+
export { useMergedRefs } from "./hooks/useMergedRefs.js";
|
|
81
|
+
export { useOnClickOutside } from "./hooks/useOnClickOutside.js";
|
|
71
82
|
export { usePrefersContrast } from "./hooks/usePrefersContrast.js";
|
|
83
|
+
export { usePrevious } from "./hooks/usePrevious.js";
|
|
72
84
|
export { useReducedMotion } from "./hooks/useReducedMotion.js";
|
|
85
|
+
export { useThrottle } from "./hooks/useThrottle.js";
|
|
86
|
+
export { useTimeout } from "./hooks/useTimeout.js";
|
|
73
87
|
export { useWindowSize } from "./hooks/useWindowSize.js";
|
|
74
88
|
export { adjustHexColorLightness, adjustLightness, calculateComplementaryHexColor, convertHexToHslString, convertHslToHexString, getComplementaryColor, hexToHsl, hslToHex, isValidHexColor, parseHslString, parseHslStringToComponents, validateHexColorFormat } from "./lib/color-conversion-utilities.js";
|
|
75
89
|
export { cn } from "./lib/utilities.js";
|
package/dist/lib/utilities.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
export type { ClassValue } from "clsx";
|
|
2
2
|
/**
|
|
3
3
|
* Helper function that merges CSS class names.
|
|
4
4
|
* Uses clsx for conditional class name composition.
|
|
5
5
|
* @param inputs Array of class names
|
|
6
6
|
* @returns Merged class names string
|
|
7
7
|
*/
|
|
8
|
-
export declare function cn(...inputs: ReadonlyArray<ClassValue>): string;
|
|
9
|
-
export type { ClassValue };
|
|
8
|
+
export declare function cn(...inputs: ReadonlyArray<import("clsx").ClassValue>): string;
|
|
10
9
|
//# sourceMappingURL=utilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/lib/utilities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/lib/utilities.ts"],"names":[],"mappings":"AAEA,YAAY,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;AAErC;;;;;GAKG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,aAAa,CAAC,OAAO,MAAM,EAAE,UAAU,CAAC,GAAG,MAAM,CAE9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib/utilities.js","sources":["../../src/lib/utilities.ts"],"sourcesContent":["import {clsx
|
|
1
|
+
{"version":3,"file":"lib/utilities.js","sources":["../../src/lib/utilities.ts"],"sourcesContent":["import {clsx} from \"clsx\";\r\n\r\nexport type {ClassValue} from \"clsx\";\r\n\r\n/**\r\n * Helper function that merges CSS class names.\r\n * Uses clsx for conditional class name composition.\r\n * @param inputs Array of class names\r\n * @returns Merged class names string\r\n */\r\nexport function cn(...inputs: ReadonlyArray<import(\"clsx\").ClassValue>): string {\r\n return clsx(inputs);\r\n}\r\n"],"names":["cn","inputs","clsx"],"mappings":";AAUO,SAASA,GAAG,GAAGC,MAAgD;IACpE,OAAOC,KAAKD;AACd"}
|
package/dist/motion/tokens.js
CHANGED
|
@@ -10,25 +10,25 @@ const easings = {
|
|
|
10
10
|
0.25,
|
|
11
11
|
0.1,
|
|
12
12
|
0.25,
|
|
13
|
-
1
|
|
13
|
+
1
|
|
14
14
|
],
|
|
15
15
|
easeIn: [
|
|
16
16
|
0.42,
|
|
17
17
|
0,
|
|
18
|
-
1
|
|
19
|
-
1
|
|
18
|
+
1,
|
|
19
|
+
1
|
|
20
20
|
],
|
|
21
21
|
easeOut: [
|
|
22
22
|
0,
|
|
23
23
|
0,
|
|
24
24
|
0.58,
|
|
25
|
-
1
|
|
25
|
+
1
|
|
26
26
|
],
|
|
27
27
|
easeInOut: [
|
|
28
28
|
0.42,
|
|
29
29
|
0,
|
|
30
30
|
0.58,
|
|
31
|
-
1
|
|
31
|
+
1
|
|
32
32
|
],
|
|
33
33
|
spring: {
|
|
34
34
|
type: "spring",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motion/tokens.js","sources":["../../src/motion/tokens.ts"],"sourcesContent":["/**\r\n * Standard motion duration constants in seconds.\r\n * Aligned with `--ac-transition-*` CSS custom properties in `index.css`.\r\n *\r\n * @example\r\n * ```tsx\r\n * <motion.div animate={{opacity: 1}} transition={{duration: durations.normal}} />\r\n * ```\r\n */\r\nexport const durations = {\r\n fast: 0.1,\r\n normal: 0.15,\r\n slow: 0.2,\r\n slower: 0.3,\r\n slowest: 0.5,\r\n} as const;\r\n\r\n/**\r\n * Standard easing curves for consistent motion across the library.\r\n */\r\nexport const easings = {\r\n ease: [0.25, 0.1, 0.25, 1
|
|
1
|
+
{"version":3,"file":"motion/tokens.js","sources":["../../src/motion/tokens.ts"],"sourcesContent":["/**\r\n * Standard motion duration constants in seconds.\r\n * Aligned with `--ac-transition-*` CSS custom properties in `index.css`.\r\n *\r\n * @example\r\n * ```tsx\r\n * <motion.div animate={{opacity: 1}} transition={{duration: durations.normal}} />\r\n * ```\r\n */\r\nexport const durations = {\r\n fast: 0.1,\r\n normal: 0.15,\r\n slow: 0.2,\r\n slower: 0.3,\r\n slowest: 0.5,\r\n} as const;\r\n\r\n/**\r\n * Standard easing curves for consistent motion across the library.\r\n */\r\nexport const easings = {\r\n ease: [0.25, 0.1, 0.25, 1],\r\n easeIn: [0.42, 0, 1, 1],\r\n easeOut: [0, 0, 0.58, 1],\r\n easeInOut: [0.42, 0, 0.58, 1],\r\n spring: {type: \"spring\" as const, stiffness: 300, damping: 24},\r\n} as const;\r\n\r\n/**\r\n * Represents a named motion duration token.\r\n */\r\nexport type Duration = keyof typeof durations;\r\n\r\n/**\r\n * Represents a named motion easing token.\r\n */\r\nexport type Easing = keyof typeof easings;\r\n"],"names":["durations","easings"],"mappings":"AASO,MAAMA,YAAY;IACvB,MAAM;IACN,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,SAAS;AACX;AAKO,MAAMC,UAAU;IACrB,MAAM;QAAC;QAAM;QAAK;QAAM;KAAE;IAC1B,QAAQ;QAAC;QAAM;QAAG;QAAG;KAAE;IACvB,SAAS;QAAC;QAAG;QAAG;QAAM;KAAE;IACxB,WAAW;QAAC;QAAM;QAAG;QAAM;KAAE;IAC7B,QAAQ;QAAC,MAAM;QAAmB,WAAW;QAAK,SAAS;IAAE;AAC/D"}
|