@sqlrooms/ui 0.29.0-rc.0 → 0.29.0-rc.10
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/LICENSE.md +2 -1
- package/README.md +98 -4
- package/dist/components/accordion.d.ts +2 -2
- package/dist/components/accordion.d.ts.map +1 -1
- package/dist/components/accordion.js +3 -3
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/alert.js.map +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/card.js.map +1 -1
- package/dist/components/combobox.d.ts +67 -1
- package/dist/components/combobox.d.ts.map +1 -1
- package/dist/components/combobox.js +58 -32
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/editable-text.d.ts +2 -1
- package/dist/components/editable-text.d.ts.map +1 -1
- package/dist/components/editable-text.js +38 -11
- package/dist/components/editable-text.js.map +1 -1
- package/dist/components/error-pane.d.ts.map +1 -1
- package/dist/components/error-pane.js +2 -2
- package/dist/components/error-pane.js.map +1 -1
- package/dist/components/hover-card.d.ts +7 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +15 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/modifier-scroll-overlay.d.ts +16 -0
- package/dist/components/modifier-scroll-overlay.d.ts.map +1 -0
- package/dist/components/modifier-scroll-overlay.js +31 -0
- package/dist/components/modifier-scroll-overlay.js.map +1 -0
- package/dist/components/progress-modal.d.ts +2 -0
- package/dist/components/progress-modal.d.ts.map +1 -1
- package/dist/components/progress-modal.js +2 -2
- package/dist/components/progress-modal.js.map +1 -1
- package/dist/components/progress.d.ts.map +1 -1
- package/dist/components/progress.js.map +1 -1
- package/dist/components/resizable.d.ts +302 -20
- package/dist/components/resizable.d.ts.map +1 -1
- package/dist/components/resizable.js +12 -5
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/run-button.d.ts +19 -0
- package/dist/components/run-button.d.ts.map +1 -0
- package/dist/components/run-button.js +17 -0
- package/dist/components/run-button.js.map +1 -0
- package/dist/components/settings-panel-header.d.ts +16 -0
- package/dist/components/settings-panel-header.d.ts.map +1 -0
- package/dist/components/settings-panel-header.js +9 -0
- package/dist/components/settings-panel-header.js.map +1 -0
- package/dist/components/sidebar.d.ts +3 -2
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar.js +16 -12
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/sonner.d.ts +4 -0
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +37 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/switch.d.ts +5 -1
- package/dist/components/switch.d.ts.map +1 -1
- package/dist/components/switch.js +7 -2
- package/dist/components/switch.js.map +1 -1
- package/dist/components/tab-strip.d.ts +27 -7
- package/dist/components/tab-strip.d.ts.map +1 -1
- package/dist/components/tab-strip.js +165 -26
- package/dist/components/tab-strip.js.map +1 -1
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/textarea.d.ts.map +1 -1
- package/dist/components/textarea.js +87 -11
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/theme-switch.d.ts.map +1 -1
- package/dist/components/theme-switch.js +3 -3
- package/dist/components/theme-switch.js.map +1 -1
- package/dist/components/tree.d.ts.map +1 -1
- package/dist/components/tree.js +4 -3
- package/dist/components/tree.js.map +1 -1
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +1 -0
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/hooks/useCombobox.d.ts +33 -0
- package/dist/hooks/useCombobox.d.ts.map +1 -0
- package/dist/hooks/useCombobox.js +30 -0
- package/dist/hooks/useCombobox.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 +45 -0
- package/dist/hooks/useDebounce.js.map +1 -0
- package/dist/hooks/useDebouncedCallback.d.ts +45 -0
- package/dist/hooks/useDebouncedCallback.d.ts.map +1 -0
- package/dist/hooks/useDebouncedCallback.js +70 -0
- package/dist/hooks/useDebouncedCallback.js.map +1 -0
- package/dist/hooks/useDebouncedValue.d.ts +23 -0
- package/dist/hooks/useDebouncedValue.d.ts.map +1 -0
- package/dist/hooks/useDebouncedValue.js +41 -0
- package/dist/hooks/useDebouncedValue.js.map +1 -0
- package/dist/index.d.ts +36 -29
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -28
- package/dist/index.js.map +1 -1
- package/dist/theme/theme-provider.d.ts +22 -1
- package/dist/theme/theme-provider.d.ts.map +1 -1
- package/dist/theme/theme-provider.js +59 -20
- package/dist/theme/theme-provider.js.map +1 -1
- package/package.json +16 -16
- package/tailwind-preset.css +78 -0
- package/dist/components/toast.d.ts +0 -16
- package/dist/components/toast.d.ts.map +0 -1
- package/dist/components/toast.js +0 -35
- package/dist/components/toast.js.map +0 -1
- package/dist/components/toaster.d.ts +0 -3
- package/dist/components/toaster.d.ts.map +0 -1
- package/dist/components/toaster.js +0 -24
- package/dist/components/toaster.js.map +0 -1
- package/dist/hooks/use-toast.d.ts +0 -45
- package/dist/hooks/use-toast.d.ts.map +0 -1
- package/dist/hooks/use-toast.js +0 -129
- package/dist/hooks/use-toast.js.map +0 -1
package/dist/hooks/use-mobile.js
CHANGED
|
@@ -8,6 +8,7 @@ export function useIsMobile() {
|
|
|
8
8
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
9
9
|
};
|
|
10
10
|
mediaQueryList.addEventListener('change', onChange);
|
|
11
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
11
12
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
12
13
|
return () => mediaQueryList.removeEventListener('change', onChange);
|
|
13
14
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-mobile.js","sourceRoot":"","sources":["../../src/hooks/use-mobile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,MAAM,UAAU,WAAW;IACzB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"use-mobile.js","sourceRoot":"","sources":["../../src/hooks/use-mobile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,MAAM,UAAU,WAAW;IACzB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAC5C,SAAS,CACV,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CACtC,eAAe,iBAAiB,GAAG,CAAC,KAAK,CAC1C,CAAC;QACF,MAAM,QAAQ,GAAG,GAAG,EAAE;YACpB,WAAW,CAAC,MAAM,CAAC,UAAU,GAAG,iBAAiB,CAAC,CAAC;QACrD,CAAC,CAAC;QAEF,cAAc,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACpD,2DAA2D;QAC3D,WAAW,CAAC,MAAM,CAAC,UAAU,GAAG,iBAAiB,CAAC,CAAC;QACnD,OAAO,GAAG,EAAE,CAAC,cAAc,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CAAC,CAAC,QAAQ,CAAC;AACpB,CAAC","sourcesContent":["import * as React from 'react';\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(\n undefined,\n );\n\n React.useEffect(() => {\n const mediaQueryList = window.matchMedia(\n `(max-width: ${MOBILE_BREAKPOINT - 1}px)`,\n );\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n };\n\n mediaQueryList.addEventListener('change', onChange);\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n return () => mediaQueryList.removeEventListener('change', onChange);\n }, []);\n\n return !!isMobile;\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for the shared combobox state hook.
|
|
3
|
+
*/
|
|
4
|
+
export interface UseComboboxOptions<T extends string = string> {
|
|
5
|
+
value: T;
|
|
6
|
+
onChange: (value: T) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Prevent opening the popover and committing selections.
|
|
9
|
+
*/
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* State and prop helpers returned by useCombobox.
|
|
14
|
+
*/
|
|
15
|
+
export interface UseComboboxReturn {
|
|
16
|
+
open: boolean;
|
|
17
|
+
setOpen: (open: boolean) => void;
|
|
18
|
+
handleSelect: (value: string) => void;
|
|
19
|
+
popoverProps: {
|
|
20
|
+
open: boolean;
|
|
21
|
+
onOpenChange: (open: boolean) => void;
|
|
22
|
+
};
|
|
23
|
+
triggerProps: {
|
|
24
|
+
role: 'combobox';
|
|
25
|
+
'aria-expanded': boolean;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Shared combobox state and behavior for Popover-based selectors.
|
|
30
|
+
* Handles open/close state and selection with auto-close.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useCombobox<T extends string = string>(options: UseComboboxOptions<T>): UseComboboxReturn;
|
|
33
|
+
//# sourceMappingURL=useCombobox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCombobox.d.ts","sourceRoot":"","sources":["../../src/hooks/useCombobox.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC3D,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,YAAY,EAAE;QACZ,IAAI,EAAE,OAAO,CAAC;QACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;KACvC,CAAC;IACF,YAAY,EAAE;QACZ,IAAI,EAAE,UAAU,CAAC;QACjB,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;CACH;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EACnD,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC7B,iBAAiB,CA4BnB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Shared combobox state and behavior for Popover-based selectors.
|
|
4
|
+
* Handles open/close state and selection with auto-close.
|
|
5
|
+
*/
|
|
6
|
+
export function useCombobox(options) {
|
|
7
|
+
const { disabled = false, onChange } = options;
|
|
8
|
+
const [open, setOpen] = useState(false);
|
|
9
|
+
const effectiveOpen = disabled ? false : open;
|
|
10
|
+
const handleSelect = useCallback((value) => {
|
|
11
|
+
if (disabled)
|
|
12
|
+
return;
|
|
13
|
+
onChange(value);
|
|
14
|
+
setOpen(false);
|
|
15
|
+
}, [disabled, onChange]);
|
|
16
|
+
return {
|
|
17
|
+
open: effectiveOpen,
|
|
18
|
+
setOpen,
|
|
19
|
+
handleSelect,
|
|
20
|
+
popoverProps: {
|
|
21
|
+
open: effectiveOpen,
|
|
22
|
+
onOpenChange: disabled ? () => { } : setOpen,
|
|
23
|
+
},
|
|
24
|
+
triggerProps: {
|
|
25
|
+
role: 'combobox',
|
|
26
|
+
'aria-expanded': effectiveOpen,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=useCombobox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCombobox.js","sourceRoot":"","sources":["../../src/hooks/useCombobox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AA+B5C;;;GAGG;AACH,MAAM,UAAU,WAAW,CACzB,OAA8B;IAE9B,MAAM,EAAC,QAAQ,GAAG,KAAK,EAAE,QAAQ,EAAC,GAAG,OAAO,CAAC;IAC7C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAE9C,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,KAAa,EAAE,EAAE;QAChB,IAAI,QAAQ;YAAE,OAAO;QAErB,QAAQ,CAAC,KAAU,CAAC,CAAC;QACrB,OAAO,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC,EACD,CAAC,QAAQ,EAAE,QAAQ,CAAC,CACrB,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,OAAO;QACP,YAAY;QACZ,YAAY,EAAE;YACZ,IAAI,EAAE,aAAa;YACnB,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC,OAAO;SAC5C;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,UAAmB;YACzB,eAAe,EAAE,aAAa;SAC/B;KACF,CAAC;AACJ,CAAC","sourcesContent":["import {useCallback, useState} from 'react';\n\n/**\n * Options for the shared combobox state hook.\n */\nexport interface UseComboboxOptions<T extends string = string> {\n value: T;\n onChange: (value: T) => void;\n /**\n * Prevent opening the popover and committing selections.\n */\n disabled?: boolean;\n}\n\n/**\n * State and prop helpers returned by useCombobox.\n */\nexport interface UseComboboxReturn {\n open: boolean;\n setOpen: (open: boolean) => void;\n handleSelect: (value: string) => void;\n popoverProps: {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n };\n triggerProps: {\n role: 'combobox';\n 'aria-expanded': boolean;\n };\n}\n\n/**\n * Shared combobox state and behavior for Popover-based selectors.\n * Handles open/close state and selection with auto-close.\n */\nexport function useCombobox<T extends string = string>(\n options: UseComboboxOptions<T>,\n): UseComboboxReturn {\n const {disabled = false, onChange} = options;\n const [open, setOpen] = useState(false);\n const effectiveOpen = disabled ? false : open;\n\n const handleSelect = useCallback(\n (value: string) => {\n if (disabled) return;\n\n onChange(value as T);\n setOpen(false);\n },\n [disabled, onChange],\n );\n\n return {\n open: effectiveOpen,\n setOpen,\n handleSelect,\n popoverProps: {\n open: effectiveOpen,\n onOpenChange: disabled ? () => {} : setOpen,\n },\n triggerProps: {\n role: 'combobox' as const,\n 'aria-expanded': effectiveOpen,\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A custom hook for debouncing a value.
|
|
3
|
+
*
|
|
4
|
+
* @param value - The value to debounce
|
|
5
|
+
* @param delay - The delay in milliseconds (default: 500)
|
|
6
|
+
* @returns The debounced value
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* import { useDebounce } from '@sqlrooms/ui';
|
|
11
|
+
*
|
|
12
|
+
* function SearchInput() {
|
|
13
|
+
* const [searchTerm, setSearchTerm] = useState('');
|
|
14
|
+
* const debouncedSearchTerm = useDebounce(searchTerm, 300);
|
|
15
|
+
*
|
|
16
|
+
* useEffect(() => {
|
|
17
|
+
* // This will only run when the user stops typing for 300ms
|
|
18
|
+
* if (debouncedSearchTerm) {
|
|
19
|
+
* performSearch(debouncedSearchTerm);
|
|
20
|
+
* }
|
|
21
|
+
* }, [debouncedSearchTerm]);
|
|
22
|
+
*
|
|
23
|
+
* return (
|
|
24
|
+
* <input
|
|
25
|
+
* value={searchTerm}
|
|
26
|
+
* onChange={(e) => setSearchTerm(e.target.value)}
|
|
27
|
+
* />
|
|
28
|
+
* );
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function useDebounce<T>(value: T, delay?: number): T;
|
|
33
|
+
//# sourceMappingURL=useDebounce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebounce.d.ts","sourceRoot":"","sources":["../../src/hooks/useDebounce.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,SAAM,GAAG,CAAC,CAcvD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A custom hook for debouncing a value.
|
|
4
|
+
*
|
|
5
|
+
* @param value - The value to debounce
|
|
6
|
+
* @param delay - The delay in milliseconds (default: 500)
|
|
7
|
+
* @returns The debounced value
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { useDebounce } from '@sqlrooms/ui';
|
|
12
|
+
*
|
|
13
|
+
* function SearchInput() {
|
|
14
|
+
* const [searchTerm, setSearchTerm] = useState('');
|
|
15
|
+
* const debouncedSearchTerm = useDebounce(searchTerm, 300);
|
|
16
|
+
*
|
|
17
|
+
* useEffect(() => {
|
|
18
|
+
* // This will only run when the user stops typing for 300ms
|
|
19
|
+
* if (debouncedSearchTerm) {
|
|
20
|
+
* performSearch(debouncedSearchTerm);
|
|
21
|
+
* }
|
|
22
|
+
* }, [debouncedSearchTerm]);
|
|
23
|
+
*
|
|
24
|
+
* return (
|
|
25
|
+
* <input
|
|
26
|
+
* value={searchTerm}
|
|
27
|
+
* onChange={(e) => setSearchTerm(e.target.value)}
|
|
28
|
+
* />
|
|
29
|
+
* );
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export function useDebounce(value, delay = 500) {
|
|
34
|
+
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const timer = setTimeout(() => {
|
|
37
|
+
setDebouncedValue(value);
|
|
38
|
+
}, delay);
|
|
39
|
+
return () => {
|
|
40
|
+
clearTimeout(timer);
|
|
41
|
+
};
|
|
42
|
+
}, [value, delay]);
|
|
43
|
+
return debouncedValue;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=useDebounce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebounce.js","sourceRoot":"","sources":["../../src/hooks/useDebounce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,UAAU,WAAW,CAAI,KAAQ,EAAE,KAAK,GAAG,GAAG;IAClD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAI,KAAK,CAAC,CAAC;IAE/D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC,EAAE,KAAK,CAAC,CAAC;QAEV,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAEnB,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["import {useEffect, useState} from 'react';\n\n/**\n * A custom hook for debouncing a value.\n *\n * @param value - The value to debounce\n * @param delay - The delay in milliseconds (default: 500)\n * @returns The debounced value\n *\n * @example\n * ```tsx\n * import { useDebounce } from '@sqlrooms/ui';\n *\n * function SearchInput() {\n * const [searchTerm, setSearchTerm] = useState('');\n * const debouncedSearchTerm = useDebounce(searchTerm, 300);\n *\n * useEffect(() => {\n * // This will only run when the user stops typing for 300ms\n * if (debouncedSearchTerm) {\n * performSearch(debouncedSearchTerm);\n * }\n * }, [debouncedSearchTerm]);\n *\n * return (\n * <input\n * value={searchTerm}\n * onChange={(e) => setSearchTerm(e.target.value)}\n * />\n * );\n * }\n * ```\n */\nexport function useDebounce<T>(value: T, delay = 500): T {\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return () => {\n clearTimeout(timer);\n };\n }, [value, delay]);\n\n return debouncedValue;\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A custom hook for debouncing function calls.
|
|
3
|
+
*
|
|
4
|
+
* @param callback - The function to debounce
|
|
5
|
+
* @param delay - The delay in milliseconds (default: 300)
|
|
6
|
+
* @returns The debounced callback function
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* import { useDebouncedCallback } from '@sqlrooms/ui';
|
|
11
|
+
*
|
|
12
|
+
* function AutoSaveForm() {
|
|
13
|
+
* const [formData, setFormData] = useState({ name: '', email: '' });
|
|
14
|
+
*
|
|
15
|
+
* const debouncedSave = useDebouncedCallback(
|
|
16
|
+
* (data: typeof formData) => {
|
|
17
|
+
* // This will only run 300ms after the user stops typing
|
|
18
|
+
* saveToServer(data);
|
|
19
|
+
* },
|
|
20
|
+
* 300
|
|
21
|
+
* );
|
|
22
|
+
*
|
|
23
|
+
* const handleChange = (field: string, value: string) => {
|
|
24
|
+
* const newData = { ...formData, [field]: value };
|
|
25
|
+
* setFormData(newData);
|
|
26
|
+
* debouncedSave(newData);
|
|
27
|
+
* };
|
|
28
|
+
*
|
|
29
|
+
* return (
|
|
30
|
+
* <form>
|
|
31
|
+
* <input
|
|
32
|
+
* value={formData.name}
|
|
33
|
+
* onChange={(e) => handleChange('name', e.target.value)}
|
|
34
|
+
* />
|
|
35
|
+
* <input
|
|
36
|
+
* value={formData.email}
|
|
37
|
+
* onChange={(e) => handleChange('email', e.target.value)}
|
|
38
|
+
* />
|
|
39
|
+
* </form>
|
|
40
|
+
* );
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function useDebouncedCallback<T extends (...args: any[]) => void>(callback: T, delay?: number): T;
|
|
45
|
+
//# sourceMappingURL=useDebouncedCallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebouncedCallback.d.ts","sourceRoot":"","sources":["../../src/hooks/useDebouncedCallback.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EACrE,QAAQ,EAAE,CAAC,EACX,KAAK,SAAM,GACV,CAAC,CA+BH"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A custom hook for debouncing function calls.
|
|
4
|
+
*
|
|
5
|
+
* @param callback - The function to debounce
|
|
6
|
+
* @param delay - The delay in milliseconds (default: 300)
|
|
7
|
+
* @returns The debounced callback function
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { useDebouncedCallback } from '@sqlrooms/ui';
|
|
12
|
+
*
|
|
13
|
+
* function AutoSaveForm() {
|
|
14
|
+
* const [formData, setFormData] = useState({ name: '', email: '' });
|
|
15
|
+
*
|
|
16
|
+
* const debouncedSave = useDebouncedCallback(
|
|
17
|
+
* (data: typeof formData) => {
|
|
18
|
+
* // This will only run 300ms after the user stops typing
|
|
19
|
+
* saveToServer(data);
|
|
20
|
+
* },
|
|
21
|
+
* 300
|
|
22
|
+
* );
|
|
23
|
+
*
|
|
24
|
+
* const handleChange = (field: string, value: string) => {
|
|
25
|
+
* const newData = { ...formData, [field]: value };
|
|
26
|
+
* setFormData(newData);
|
|
27
|
+
* debouncedSave(newData);
|
|
28
|
+
* };
|
|
29
|
+
*
|
|
30
|
+
* return (
|
|
31
|
+
* <form>
|
|
32
|
+
* <input
|
|
33
|
+
* value={formData.name}
|
|
34
|
+
* onChange={(e) => handleChange('name', e.target.value)}
|
|
35
|
+
* />
|
|
36
|
+
* <input
|
|
37
|
+
* value={formData.email}
|
|
38
|
+
* onChange={(e) => handleChange('email', e.target.value)}
|
|
39
|
+
* />
|
|
40
|
+
* </form>
|
|
41
|
+
* );
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export function useDebouncedCallback(callback, delay = 300) {
|
|
46
|
+
const timeoutRef = useRef(null);
|
|
47
|
+
const callbackRef = useRef(callback);
|
|
48
|
+
// Keep callback ref up to date
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
callbackRef.current = callback;
|
|
51
|
+
}, [callback]);
|
|
52
|
+
// Cleanup on unmount
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
return () => {
|
|
55
|
+
if (timeoutRef.current) {
|
|
56
|
+
clearTimeout(timeoutRef.current);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}, []);
|
|
60
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
|
+
return useCallback((...args) => {
|
|
62
|
+
if (timeoutRef.current) {
|
|
63
|
+
clearTimeout(timeoutRef.current);
|
|
64
|
+
}
|
|
65
|
+
timeoutRef.current = setTimeout(() => {
|
|
66
|
+
callbackRef.current(...args);
|
|
67
|
+
}, delay);
|
|
68
|
+
}, [delay]);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=useDebouncedCallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebouncedCallback.js","sourceRoot":"","sources":["../../src/hooks/useDebouncedCallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,UAAU,oBAAoB,CAClC,QAAW,EACX,KAAK,GAAG,GAAG;IAEX,MAAM,UAAU,GAAG,MAAM,CAAuC,IAAI,CAAC,CAAC;IACtE,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAErC,+BAA+B;IAC/B,SAAS,CAAC,GAAG,EAAE;QACb,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;IACjC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,qBAAqB;IACrB,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,GAAG,EAAE;YACV,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;gBACvB,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACnC,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,uDAAuD;IACvD,OAAO,WAAW,CAChB,CAAC,GAAG,IAAmB,EAAE,EAAE;QACzB,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;YACvB,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;QAED,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YACnC,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;QAC/B,CAAC,EAAE,KAAK,CAAC,CAAC;IACZ,CAAC,EACD,CAAC,KAAK,CAAC,CACH,CAAC;AACT,CAAC","sourcesContent":["import {useCallback, useEffect, useRef} from 'react';\n\n/**\n * A custom hook for debouncing function calls.\n *\n * @param callback - The function to debounce\n * @param delay - The delay in milliseconds (default: 300)\n * @returns The debounced callback function\n *\n * @example\n * ```tsx\n * import { useDebouncedCallback } from '@sqlrooms/ui';\n *\n * function AutoSaveForm() {\n * const [formData, setFormData] = useState({ name: '', email: '' });\n *\n * const debouncedSave = useDebouncedCallback(\n * (data: typeof formData) => {\n * // This will only run 300ms after the user stops typing\n * saveToServer(data);\n * },\n * 300\n * );\n *\n * const handleChange = (field: string, value: string) => {\n * const newData = { ...formData, [field]: value };\n * setFormData(newData);\n * debouncedSave(newData);\n * };\n *\n * return (\n * <form>\n * <input\n * value={formData.name}\n * onChange={(e) => handleChange('name', e.target.value)}\n * />\n * <input\n * value={formData.email}\n * onChange={(e) => handleChange('email', e.target.value)}\n * />\n * </form>\n * );\n * }\n * ```\n */\nexport function useDebouncedCallback<T extends (...args: any[]) => void>(\n callback: T,\n delay = 300,\n): T {\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const callbackRef = useRef(callback);\n\n // Keep callback ref up to date\n useEffect(() => {\n callbackRef.current = callback;\n }, [callback]);\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, []);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useCallback(\n (...args: Parameters<T>) => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n\n timeoutRef.current = setTimeout(() => {\n callbackRef.current(...args);\n }, delay);\n },\n [delay],\n ) as T;\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook for managing local state with debounced persistence.
|
|
3
|
+
*
|
|
4
|
+
* Provides immediate local state updates for responsive UI while
|
|
5
|
+
* debouncing expensive persistence operations (e.g., store updates, API calls).
|
|
6
|
+
*
|
|
7
|
+
* @param externalValue - Value from external source (store, props, etc.)
|
|
8
|
+
* @param onPersist - Callback to persist value (will be debounced)
|
|
9
|
+
* @param debounceMs - Debounce delay in milliseconds (default: 300)
|
|
10
|
+
*
|
|
11
|
+
* @returns [localValue, setValue] - Current local value and setter function
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const [localSpec, setSpec] = useDebouncedValue(
|
|
16
|
+
* cell.data.vegaSpec,
|
|
17
|
+
* (spec) => updateCell(id, draft => { draft.data.vegaSpec = spec }),
|
|
18
|
+
* 300
|
|
19
|
+
* );
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useDebouncedValue<T>(externalValue: T, onPersist: (value: T) => void, debounceMs?: number): [T, (value: T) => void];
|
|
23
|
+
//# sourceMappingURL=useDebouncedValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebouncedValue.d.ts","sourceRoot":"","sources":["../../src/hooks/useDebouncedValue.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,aAAa,EAAE,CAAC,EAChB,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAC7B,UAAU,SAAM,GACf,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAuBzB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { useDebouncedCallback } from './useDebouncedCallback';
|
|
3
|
+
/**
|
|
4
|
+
* Hook for managing local state with debounced persistence.
|
|
5
|
+
*
|
|
6
|
+
* Provides immediate local state updates for responsive UI while
|
|
7
|
+
* debouncing expensive persistence operations (e.g., store updates, API calls).
|
|
8
|
+
*
|
|
9
|
+
* @param externalValue - Value from external source (store, props, etc.)
|
|
10
|
+
* @param onPersist - Callback to persist value (will be debounced)
|
|
11
|
+
* @param debounceMs - Debounce delay in milliseconds (default: 300)
|
|
12
|
+
*
|
|
13
|
+
* @returns [localValue, setValue] - Current local value and setter function
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* const [localSpec, setSpec] = useDebouncedValue(
|
|
18
|
+
* cell.data.vegaSpec,
|
|
19
|
+
* (spec) => updateCell(id, draft => { draft.data.vegaSpec = spec }),
|
|
20
|
+
* 300
|
|
21
|
+
* );
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function useDebouncedValue(externalValue, onPersist, debounceMs = 300) {
|
|
25
|
+
// Local state for immediate UI updates
|
|
26
|
+
const [localValue, setLocalValue] = useState(externalValue);
|
|
27
|
+
// Sync local state when external value changes
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
30
|
+
setLocalValue(externalValue);
|
|
31
|
+
}, [externalValue]);
|
|
32
|
+
// Debounced persistence
|
|
33
|
+
const debouncedPersist = useDebouncedCallback(onPersist, debounceMs);
|
|
34
|
+
// Combined setter: immediate local update + debounced persist
|
|
35
|
+
const setValue = useCallback((value) => {
|
|
36
|
+
setLocalValue(value);
|
|
37
|
+
debouncedPersist(value);
|
|
38
|
+
}, [debouncedPersist]);
|
|
39
|
+
return [localValue, setValue];
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=useDebouncedValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebouncedValue.js","sourceRoot":"","sources":["../../src/hooks/useDebouncedValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACvD,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,iBAAiB,CAC/B,aAAgB,EAChB,SAA6B,EAC7B,UAAU,GAAG,GAAG;IAEhB,uCAAuC;IACvC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAI,aAAa,CAAC,CAAC;IAE/D,+CAA+C;IAC/C,SAAS,CAAC,GAAG,EAAE;QACb,2DAA2D;QAC3D,aAAa,CAAC,aAAa,CAAC,CAAC;IAC/B,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,wBAAwB;IACxB,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAErE,8DAA8D;IAC9D,MAAM,QAAQ,GAAG,WAAW,CAC1B,CAAC,KAAQ,EAAE,EAAE;QACX,aAAa,CAAC,KAAK,CAAC,CAAC;QACrB,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,EACD,CAAC,gBAAgB,CAAC,CACnB,CAAC;IAEF,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAChC,CAAC","sourcesContent":["import {useCallback, useEffect, useState} from 'react';\nimport {useDebouncedCallback} from './useDebouncedCallback';\n\n/**\n * Hook for managing local state with debounced persistence.\n *\n * Provides immediate local state updates for responsive UI while\n * debouncing expensive persistence operations (e.g., store updates, API calls).\n *\n * @param externalValue - Value from external source (store, props, etc.)\n * @param onPersist - Callback to persist value (will be debounced)\n * @param debounceMs - Debounce delay in milliseconds (default: 300)\n *\n * @returns [localValue, setValue] - Current local value and setter function\n *\n * @example\n * ```tsx\n * const [localSpec, setSpec] = useDebouncedValue(\n * cell.data.vegaSpec,\n * (spec) => updateCell(id, draft => { draft.data.vegaSpec = spec }),\n * 300\n * );\n * ```\n */\nexport function useDebouncedValue<T>(\n externalValue: T,\n onPersist: (value: T) => void,\n debounceMs = 300,\n): [T, (value: T) => void] {\n // Local state for immediate UI updates\n const [localValue, setLocalValue] = useState<T>(externalValue);\n\n // Sync local state when external value changes\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setLocalValue(externalValue);\n }, [externalValue]);\n\n // Debounced persistence\n const debouncedPersist = useDebouncedCallback(onPersist, debounceMs);\n\n // Combined setter: immediate local update + debounced persist\n const setValue = useCallback(\n (value: T) => {\n setLocalValue(value);\n debouncedPersist(value);\n },\n [debouncedPersist],\n );\n\n return [localValue, setValue];\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,67 +2,74 @@
|
|
|
2
2
|
* {@include ../README.md}
|
|
3
3
|
* @packageDocumentation
|
|
4
4
|
*/
|
|
5
|
-
export { Accordion, AccordionItem, AccordionTrigger,
|
|
6
|
-
export { Alert,
|
|
5
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from './components/accordion';
|
|
6
|
+
export { Alert, AlertDescription, AlertTitle } from './components/alert';
|
|
7
7
|
export { AspectRatio } from './components/aspect-ratio';
|
|
8
8
|
export { Badge, badgeVariants, type BadgeProps } from './components/badge';
|
|
9
|
-
export { Breadcrumb,
|
|
9
|
+
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from './components/breadcrumb';
|
|
10
10
|
export { Button, buttonVariants, type ButtonProps } from './components/button';
|
|
11
11
|
export { Calendar, type CalendarProps } from './components/calendar';
|
|
12
|
-
export { Card,
|
|
12
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from './components/card';
|
|
13
13
|
export { Checkbox } from './components/checkbox';
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
14
|
+
export { Combobox, type ComboboxContentProps, type ComboboxItemProps, type ComboboxRootProps, type ComboboxTriggerProps, } from './components/combobox';
|
|
15
|
+
export { useCombobox, type UseComboboxOptions, type UseComboboxReturn, } from './hooks/useCombobox';
|
|
16
|
+
export { Collapsible, CollapsibleContent, CollapsibleTrigger, } from './components/collapsible';
|
|
17
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from './components/command';
|
|
18
|
+
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, } from './components/context-menu';
|
|
19
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from './components/dialog';
|
|
20
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHandle, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, } from './components/drawer';
|
|
21
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from './components/dropdown-menu';
|
|
21
22
|
export { EditableText } from './components/editable-text';
|
|
22
23
|
export { ErrorBoundary } from './components/error-boundary';
|
|
23
24
|
export { ErrorPane } from './components/error-pane';
|
|
24
|
-
export {
|
|
25
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField, } from './components/form';
|
|
25
26
|
export { Input } from './components/input';
|
|
27
|
+
export { SettingsPanelHeader, type SettingsPanelHeaderProps, } from './components/settings-panel-header';
|
|
26
28
|
export { Label } from './components/label';
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
29
|
+
export { ModifierScrollOverlay, type ModifierScrollOverlayProps, } from './components/modifier-scroll-overlay';
|
|
30
|
+
export { Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, } from './components/menu-bar';
|
|
31
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, } from './components/pagination';
|
|
32
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger, } from './components/popover';
|
|
30
33
|
export { ProgressModal } from './components/progress-modal';
|
|
31
34
|
export { Progress } from './components/progress';
|
|
32
35
|
export { RadioGroup, RadioGroupItem } from './components/radio-group';
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
36
|
+
export { ResizableHandle, ResizablePanel, ResizablePanelGroup, } from './components/resizable';
|
|
37
|
+
export type { ResizablePanelOrientation, ResizablePanelHandle, } from './components/resizable';
|
|
38
|
+
export { RunButton, type RunButtonProps } from './components/run-button';
|
|
39
|
+
export { TabStrip, type TabDescriptor, type TabStripDndMode, type TabStripDragData, type TabStripProps, } from './components/tab-strip';
|
|
35
40
|
export { ScrollableRow } from './components/scrollable-row';
|
|
36
|
-
export { Select,
|
|
41
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, } from './components/select';
|
|
37
42
|
export { ScrollArea, ScrollBar } from './components/scroll-area';
|
|
38
43
|
export { Separator } from './components/separator';
|
|
39
|
-
export { Sheet,
|
|
40
|
-
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader,
|
|
44
|
+
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, } from './components/sheet';
|
|
45
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, } from './components/sidebar';
|
|
41
46
|
export { SkeletonPane } from './components/skeleton-pane';
|
|
42
47
|
export { Skeleton } from './components/skeleton';
|
|
43
48
|
export { Slider } from './components/slider';
|
|
44
49
|
export { SpinnerPane } from './components/spinner-pane';
|
|
45
50
|
export { Spinner } from './components/spinner';
|
|
46
51
|
export { Switch } from './components/switch';
|
|
47
|
-
export { Table,
|
|
48
|
-
export { Tabs, TabsList, TabsTrigger
|
|
52
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, } from './components/table';
|
|
53
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger } from './components/tabs';
|
|
49
54
|
export { Textarea } from './components/textarea';
|
|
50
55
|
export { ThemeSwitch } from './components/theme-switch';
|
|
51
|
-
export { type ToastProps, type ToastActionElement, ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction, } from './components/toast';
|
|
52
|
-
export { Toaster } from './components/toaster';
|
|
53
56
|
export { ToggleGroup, ToggleGroupItem } from './components/toggle-group';
|
|
54
57
|
export { Toggle, toggleVariants } from './components/toggle';
|
|
55
58
|
export { CopyButton, type CopyButtonProps } from './components/copy-button';
|
|
56
|
-
export { Tooltip,
|
|
59
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from './components/tooltip';
|
|
57
60
|
export { Tree, type TreeNodeData } from './components/tree';
|
|
58
|
-
export { useToast, toast as legacyToast, reducer } from './hooks/use-toast';
|
|
59
61
|
export { toast, type ExternalToast } from 'sonner';
|
|
60
62
|
export { useAspectRatioDimensions, type Dimensions, type UseAspectRatioDimensionsProps, } from './hooks/useAspectRatioDimensions';
|
|
61
63
|
export { useDisclosure, type UseDisclosureReturnValue, } from './hooks/useDisclosure';
|
|
62
|
-
export {
|
|
64
|
+
export { useDebounce } from './hooks/useDebounce';
|
|
65
|
+
export { useDebouncedCallback } from './hooks/useDebouncedCallback';
|
|
66
|
+
export { useDebouncedValue } from './hooks/useDebouncedValue';
|
|
63
67
|
export { useIsMobile } from './hooks/use-mobile';
|
|
64
|
-
export {
|
|
68
|
+
export { useRelativeCoordinates } from './hooks/useRelativeCoordinates';
|
|
65
69
|
export { resolveFontSizeClass, type FontSizeToken } from './lib/fontSize';
|
|
66
|
-
export {
|
|
70
|
+
export { cn } from './lib/utils';
|
|
71
|
+
export { DEFAULT_THEME, DEFAULT_THEME_STORAGE_KEY, getResolvedTheme, getTheme, getThemePreference, ThemeProvider, useTheme, type ResolvedTheme, type Theme, } from './theme/theme-provider';
|
|
67
72
|
export { Slot } from '@radix-ui/react-slot';
|
|
73
|
+
export { Toaster } from './components/sonner';
|
|
74
|
+
export { HoverCard, HoverCardContent, HoverCardTrigger, } from './components/hover-card';
|
|
68
75
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,SAAS,EACT,aAAa,EACb,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAC,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAEvE,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;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