asheeui 0.6.2 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AsheeUIProvider.d.ts +34 -0
- package/dist/AsheeUIProvider.d.ts.map +1 -1
- package/dist/components/accordion/Accordion.d.ts +55 -44
- package/dist/components/accordion/Accordion.d.ts.map +1 -1
- package/dist/components/accordion/Accordion.js +27 -27
- package/dist/components/accordion/accordion-config.d.ts +41 -12
- package/dist/components/accordion/accordion-config.d.ts.map +1 -1
- package/dist/components/accordion/accordion-styles.d.ts +20 -0
- package/dist/components/accordion/accordion-styles.d.ts.map +1 -1
- package/dist/components/accordion/accordion-styles.js +1 -1
- package/dist/components/autocomplete/Autocomplete.d.ts +59 -39
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +98 -91
- package/dist/components/autocomplete/autocomplete-config.d.ts +9 -62
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-config.js +6 -21
- package/dist/components/button/Button.d.ts +50 -51
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +19 -19
- package/dist/components/button/button-config.d.ts +23 -15
- package/dist/components/button/button-config.d.ts.map +1 -1
- package/dist/components/button/button-styles.d.ts +11 -1
- package/dist/components/button/button-styles.d.ts.map +1 -1
- package/dist/components/card/Card.d.ts +85 -43
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +49 -49
- package/dist/components/card/card-config.d.ts +35 -18
- package/dist/components/card/card-config.d.ts.map +1 -1
- package/dist/components/card/card-config.js +0 -2
- package/dist/components/card/card-styles.d.ts +17 -1
- package/dist/components/card/card-styles.d.ts.map +1 -1
- package/dist/components/carousel/Carousel.d.ts +107 -12
- package/dist/components/carousel/Carousel.d.ts.map +1 -1
- package/dist/components/carousel/Carousel.js +63 -64
- package/dist/components/carousel/carousel-config.d.ts +94 -7
- package/dist/components/carousel/carousel-config.d.ts.map +1 -1
- package/dist/components/carousel/carousel-config.js +6 -4
- package/dist/components/carousel/carousel-styles.d.ts +32 -1
- package/dist/components/carousel/carousel-styles.d.ts.map +1 -1
- package/dist/components/chip/Chip.d.ts +55 -34
- package/dist/components/chip/Chip.d.ts.map +1 -1
- package/dist/components/chip/Chip.js +71 -72
- package/dist/components/chip/chip-config.d.ts +29 -15
- package/dist/components/chip/chip-config.d.ts.map +1 -1
- package/dist/components/chip/chip-config.js +5 -6
- package/dist/components/chip/chip-styles.d.ts +21 -1
- package/dist/components/chip/chip-styles.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +166 -2
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +110 -99
- package/dist/components/date-picker/date-picker-config.d.ts +31 -0
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +8 -16
- package/dist/components/date-picker/date-picker-styles.d.ts +21 -1
- package/dist/components/date-picker/date-picker-styles.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-styles.js +7 -11
- package/dist/components/drawer/Drawer.d.ts +97 -7
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +9 -9
- package/dist/components/drawer/drawer-config.d.ts +54 -1
- package/dist/components/drawer/drawer-config.d.ts.map +1 -1
- package/dist/components/drawer/drawer-styles.d.ts +21 -0
- package/dist/components/drawer/drawer-styles.d.ts.map +1 -1
- package/dist/components/field/FieldShell.d.ts +86 -0
- package/dist/components/field/FieldShell.d.ts.map +1 -1
- package/dist/components/field/field-config.d.ts +66 -3
- package/dist/components/field/field-config.d.ts.map +1 -1
- package/dist/components/field/field-config.js +2 -1
- package/dist/components/field/field-styles.d.ts +22 -0
- package/dist/components/field/field-styles.d.ts.map +1 -1
- package/dist/components/field/field-styles.js +10 -0
- package/dist/components/field/index.js +1 -0
- package/dist/components/image/Image.d.ts +35 -28
- package/dist/components/image/Image.d.ts.map +1 -1
- package/dist/components/image/Image.js +7 -7
- package/dist/components/image/image-config.d.ts +25 -7
- package/dist/components/image/image-config.d.ts.map +1 -1
- package/dist/components/image/image-styles.d.ts +9 -0
- package/dist/components/image/image-styles.d.ts.map +1 -1
- package/dist/components/input/Input.d.ts +117 -10
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/components/input/Input.js +20 -20
- package/dist/components/input/PasswordInput.d.ts +48 -0
- package/dist/components/input/PasswordInput.d.ts.map +1 -1
- package/dist/components/input/input-config.d.ts +10 -1
- package/dist/components/input/input-config.d.ts.map +1 -1
- package/dist/components/input/input-config.js +5 -8
- package/dist/components/input/input-styles.d.ts +10 -0
- package/dist/components/input/input-styles.d.ts.map +1 -1
- package/dist/components/input/input-styles.js +5 -9
- package/dist/components/keyboard/OnScreenKeyboard.d.ts +58 -8
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +49 -48
- package/dist/components/keyboard/index.js +1 -1
- package/dist/components/keyboard/keyboard-config.d.ts +88 -3
- package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
- package/dist/components/keyboard/{default-keyboard-config.js → keyboard-config.js} +7 -1
- package/dist/components/keyboard/keyboard-context.d.ts +103 -13
- package/dist/components/keyboard/keyboard-context.d.ts.map +1 -1
- package/dist/components/keyboard/keyboard-context.js +66 -68
- package/dist/components/keyboard/use-keyboard-field.d.ts +37 -0
- package/dist/components/keyboard/use-keyboard-field.d.ts.map +1 -1
- package/dist/components/link/Link.d.ts +118 -9
- package/dist/components/link/Link.d.ts.map +1 -1
- package/dist/components/link/Link.js +29 -30
- package/dist/components/link/link-config.d.ts +58 -5
- package/dist/components/link/link-config.d.ts.map +1 -1
- package/dist/components/link/link-styles.d.ts +24 -4
- package/dist/components/link/link-styles.d.ts.map +1 -1
- package/dist/components/marquee/Marquee.d.ts +77 -8
- package/dist/components/marquee/Marquee.d.ts.map +1 -1
- package/dist/components/marquee/Marquee.js +5 -5
- package/dist/components/marquee/marquee-config.d.ts +74 -0
- package/dist/components/marquee/marquee-config.d.ts.map +1 -1
- package/dist/components/marquee/marquee-styles.d.ts +12 -0
- package/dist/components/marquee/marquee-styles.d.ts.map +1 -1
- package/dist/components/modal/Modal.d.ts +113 -25
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +75 -82
- package/dist/components/modal/modal-config.d.ts +59 -1
- package/dist/components/modal/modal-config.d.ts.map +1 -1
- package/dist/components/modal/modal-styles.d.ts +8 -1
- package/dist/components/modal/modal-styles.d.ts.map +1 -1
- package/dist/components/modal/modal-styles.js +4 -11
- package/dist/components/multi-select/MultiSelect.d.ts +152 -23
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +195 -217
- package/dist/components/multi-select/multi-select-config.d.ts +61 -23
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +16 -25
- package/dist/components/multi-select/multi-select-styles.d.ts +17 -0
- package/dist/components/multi-select/multi-select-styles.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-styles.js +9 -13
- package/dist/components/radio/Radio.d.ts +137 -13
- package/dist/components/radio/Radio.d.ts.map +1 -1
- package/dist/components/radio/Radio.js +66 -141
- package/dist/components/radio/RadioGroup.d.ts +88 -23
- package/dist/components/radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/radio/RadioGroup.js +141 -66
- package/dist/components/radio/radio-config.d.ts +36 -11
- package/dist/components/radio/radio-config.d.ts.map +1 -1
- package/dist/components/radio/radio-config.js +9 -11
- package/dist/components/radio/radio-context.d.ts +44 -1
- package/dist/components/radio/radio-context.d.ts.map +1 -1
- package/dist/components/radio/radio-styles.d.ts +24 -1
- package/dist/components/radio/radio-styles.d.ts.map +1 -1
- package/dist/components/resizable-screen/ResizableScreen.d.ts +79 -32
- package/dist/components/resizable-screen/ResizableScreen.d.ts.map +1 -1
- package/dist/components/resizable-screen/ResizableScreen.js +77 -72
- package/dist/components/resizable-screen/resizable-screen-config.d.ts +62 -0
- package/dist/components/resizable-screen/resizable-screen-config.d.ts.map +1 -1
- package/dist/components/scrollbar/scrollbar-config.d.ts +44 -9
- package/dist/components/scrollbar/scrollbar-config.d.ts.map +1 -1
- package/dist/components/select/Select.d.ts +157 -17
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +141 -152
- package/dist/components/select/select-config.d.ts +26 -19
- package/dist/components/select/select-config.d.ts.map +1 -1
- package/dist/components/select/select-config.js +5 -21
- package/dist/components/select/select-styles.d.ts +10 -0
- package/dist/components/select/select-styles.d.ts.map +1 -1
- package/dist/components/select/select-styles.js +5 -9
- package/dist/components/select-menu/SelectMenu.d.ts +125 -8
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +107 -79
- package/dist/components/select-menu/index.d.ts +2 -0
- package/dist/components/select-menu/index.d.ts.map +1 -1
- package/dist/components/select-menu/index.js +1 -0
- package/dist/components/select-menu/select-menu-config.d.ts +82 -0
- package/dist/components/select-menu/select-menu-config.d.ts.map +1 -0
- package/dist/components/select-menu/select-menu-config.js +12 -0
- package/dist/components/sidebar/Sidebar.d.ts +151 -51
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.js +211 -232
- package/dist/components/sidebar/sidebar-config.d.ts +140 -21
- package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-config.js +9 -12
- package/dist/components/sidebar/sidebar-styles.d.ts +24 -0
- package/dist/components/sidebar/sidebar-styles.d.ts.map +1 -1
- package/dist/components/spinner/spinner-config.d.ts +15 -9
- package/dist/components/spinner/spinner-config.d.ts.map +1 -1
- package/dist/components/spinner/spinner-styles.d.ts +10 -3
- package/dist/components/spinner/spinner-styles.d.ts.map +1 -1
- package/dist/components/spinner/spinner.d.ts +27 -20
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/spinner/spinner.js +18 -18
- package/dist/components/switch/Switch.d.ts +109 -9
- package/dist/components/switch/Switch.d.ts.map +1 -1
- package/dist/components/switch/Switch.js +19 -19
- package/dist/components/switch/switch-config.d.ts +20 -6
- package/dist/components/switch/switch-config.d.ts.map +1 -1
- package/dist/components/switch/switch-config.js +8 -16
- package/dist/components/switch/switch-styles.d.ts +17 -0
- package/dist/components/switch/switch-styles.d.ts.map +1 -1
- package/dist/components/table/Table.d.ts +101 -28
- package/dist/components/table/Table.d.ts.map +1 -1
- package/dist/components/table/Table.js +56 -56
- package/dist/components/table/table-config.d.ts +75 -8
- package/dist/components/table/table-config.d.ts.map +1 -1
- package/dist/components/table/table-styles.d.ts +25 -6
- package/dist/components/table/table-styles.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.d.ts +84 -31
- package/dist/components/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +44 -44
- package/dist/components/tabs/tabs-config.d.ts +102 -9
- package/dist/components/tabs/tabs-config.d.ts.map +1 -1
- package/dist/components/tabs/tabs-styles.d.ts +16 -4
- package/dist/components/tabs/tabs-styles.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.d.ts +105 -11
- package/dist/components/textarea/Textarea.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.js +27 -24
- package/dist/components/textarea/textarea-config.d.ts +21 -0
- package/dist/components/textarea/textarea-config.d.ts.map +1 -1
- package/dist/components/textarea/textarea-config.js +8 -16
- package/dist/components/textarea/textarea-styles.d.ts +9 -0
- package/dist/components/textarea/textarea-styles.d.ts.map +1 -1
- package/dist/components/textarea/textarea-styles.js +5 -9
- package/dist/components/toast/ToastItem.d.ts +58 -4
- package/dist/components/toast/ToastItem.d.ts.map +1 -1
- package/dist/components/toast/ToastItem.js +18 -18
- package/dist/components/toast/toast-config.d.ts +104 -6
- package/dist/components/toast/toast-config.d.ts.map +1 -1
- package/dist/components/toast/toast-context.d.ts +123 -11
- package/dist/components/toast/toast-context.d.ts.map +1 -1
- package/dist/components/toast/toast-context.js +19 -19
- package/dist/components/toast/toast-styles.d.ts +27 -5
- package/dist/components/toast/toast-styles.d.ts.map +1 -1
- package/dist/components/toast/use-pausable-timeout.d.ts +29 -0
- package/dist/components/toast/use-pausable-timeout.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +76 -16
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.js +25 -25
- package/dist/components/tooltip/tooltip-config.d.ts +73 -3
- package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip-styles.d.ts +12 -0
- package/dist/components/tooltip/tooltip-styles.d.ts.map +1 -1
- package/dist/config/config.d.ts +50 -2
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/default-config.d.ts +5 -0
- package/dist/config/default-config.d.ts.map +1 -1
- package/dist/config/default-config.js +23 -0
- package/dist/config/define-config.d.ts +23 -0
- package/dist/config/define-config.d.ts.map +1 -1
- package/dist/config/resolve-color.d.ts +25 -0
- package/dist/config/resolve-color.d.ts.map +1 -1
- package/dist/config/resolve-config.d.ts +23 -0
- package/dist/config/resolve-config.d.ts.map +1 -1
- package/dist/index.css +43 -7
- package/dist/index.d.ts +30 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +120 -115
- package/dist/libs/context.d.ts +50 -1
- package/dist/libs/context.d.ts.map +1 -1
- package/dist/libs/registry.d.ts +61 -5
- package/dist/libs/registry.d.ts.map +1 -1
- package/dist/libs/use-isomorphic-layout-effect.d.ts +18 -0
- package/dist/libs/use-isomorphic-layout-effect.d.ts.map +1 -1
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/radius.d.ts +37 -1
- package/dist/shared/radius.d.ts.map +1 -1
- package/dist/shared/variant.d.ts +31 -0
- package/dist/shared/variant.d.ts.map +1 -1
- package/dist/shared/variant.js +132 -45
- package/dist/theme/color.d.ts +89 -1
- package/dist/theme/color.d.ts.map +1 -1
- package/dist/theme/controller.d.ts +121 -0
- package/dist/theme/controller.d.ts.map +1 -1
- package/dist/theme/controller.js +84 -0
- package/dist/theme/useTheme.d.ts +68 -0
- package/dist/theme/useTheme.d.ts.map +1 -1
- package/dist/theme/useTheme.js +23 -0
- package/dist/utils/index.d.ts +0 -7
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/resolve-token.d.ts +101 -0
- package/dist/utils/resolve-token.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/components/keyboard/default-keyboard-config.d.ts +0 -10
- package/dist/components/keyboard/default-keyboard-config.d.ts.map +0 -1
- package/dist/shared/size.d.ts +0 -2
- package/dist/shared/size.d.ts.map +0 -1
package/dist/theme/useTheme.d.ts
CHANGED
|
@@ -1,9 +1,77 @@
|
|
|
1
1
|
import { ThemeSelection } from './controller';
|
|
2
|
+
/**
|
|
3
|
+
* React hook that provides access to the current theme state and controls.
|
|
4
|
+
*
|
|
5
|
+
* This hook subscribes to the theme controller and returns the current
|
|
6
|
+
* theme selection, resolved theme name, and functions for changing the theme.
|
|
7
|
+
* Components using this hook will re-render automatically when the theme changes.
|
|
8
|
+
*
|
|
9
|
+
* The hook uses useSyncExternalStore to safely subscribe to the theme
|
|
10
|
+
* controller's state, making it compatible with React's concurrent rendering.
|
|
11
|
+
*
|
|
12
|
+
* @returns An object containing the current theme state and control functions.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* function ThemeToggle() {
|
|
17
|
+
* const { theme, setTheme, availableThemes } = useTheme();
|
|
18
|
+
*
|
|
19
|
+
* return (
|
|
20
|
+
* <select value={theme} onChange={(e) => setTheme(e.target.value as ThemeSelection)}>
|
|
21
|
+
* {availableThemes.map(t => (
|
|
22
|
+
* <option key={t} value={t}>{t}</option>
|
|
23
|
+
* ))}
|
|
24
|
+
* <option value="system">System</option>
|
|
25
|
+
* </select>
|
|
26
|
+
* );
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* function ThemedComponent() {
|
|
33
|
+
* const { resolvedTheme } = useTheme();
|
|
34
|
+
*
|
|
35
|
+
* return (
|
|
36
|
+
* <div className={resolvedTheme === 'dark' ? 'dark-styles' : 'light-styles'}>
|
|
37
|
+
* Current theme: {resolvedTheme}
|
|
38
|
+
* </div>
|
|
39
|
+
* );
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @see ThemeController - The underlying class that manages theme state.
|
|
44
|
+
* @see ThemeSelection - The type for theme selections including "system".
|
|
45
|
+
* @see ThemeName - The type for resolved theme names.
|
|
46
|
+
*/
|
|
2
47
|
export declare function useTheme(): {
|
|
48
|
+
/**
|
|
49
|
+
* The user's current theme selection.
|
|
50
|
+
* This can be either a specific theme name or "system".
|
|
51
|
+
*/
|
|
3
52
|
theme: ThemeSelection;
|
|
53
|
+
/**
|
|
54
|
+
* The resolved theme name after applying the selection.
|
|
55
|
+
* If the selection is "system", this resolves to either "light" or "dark"
|
|
56
|
+
* based on the system preference.
|
|
57
|
+
*/
|
|
4
58
|
resolvedTheme: keyof import('./color').AsheeColorRegistry;
|
|
59
|
+
/**
|
|
60
|
+
* Function to set the theme selection.
|
|
61
|
+
* This persists the selection to localStorage and applies the theme.
|
|
62
|
+
* @param selection - The theme to select, either "system" or a theme name.
|
|
63
|
+
*/
|
|
5
64
|
setTheme: (selection: ThemeSelection) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Function to cycle to the next available theme.
|
|
67
|
+
* This cycles through all available theme names, excluding "system".
|
|
68
|
+
* Loops back to the start when reaching the end of the list.
|
|
69
|
+
*/
|
|
6
70
|
toggleTheme: () => void;
|
|
71
|
+
/**
|
|
72
|
+
* The list of available theme names in the application.
|
|
73
|
+
* This does not include "system" as it is not a theme name.
|
|
74
|
+
*/
|
|
7
75
|
availableThemes: readonly string[];
|
|
8
76
|
};
|
|
9
77
|
//# sourceMappingURL=useTheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/theme/useTheme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/theme/useTheme.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,cAAc,EAAmB,MAAM,cAAc,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,QAAQ;IAcpB;;;OAGG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;;OAGG;;EAGN"}
|
package/dist/theme/useTheme.js
CHANGED
|
@@ -12,10 +12,33 @@ function r() {
|
|
|
12
12
|
() => "light"
|
|
13
13
|
);
|
|
14
14
|
return {
|
|
15
|
+
/**
|
|
16
|
+
* The user's current theme selection.
|
|
17
|
+
* This can be either a specific theme name or "system".
|
|
18
|
+
*/
|
|
15
19
|
theme: o,
|
|
20
|
+
/**
|
|
21
|
+
* The resolved theme name after applying the selection.
|
|
22
|
+
* If the selection is "system", this resolves to either "light" or "dark"
|
|
23
|
+
* based on the system preference.
|
|
24
|
+
*/
|
|
16
25
|
resolvedTheme: l,
|
|
26
|
+
/**
|
|
27
|
+
* Function to set the theme selection.
|
|
28
|
+
* This persists the selection to localStorage and applies the theme.
|
|
29
|
+
* @param selection - The theme to select, either "system" or a theme name.
|
|
30
|
+
*/
|
|
17
31
|
setTheme: e.setTheme,
|
|
32
|
+
/**
|
|
33
|
+
* Function to cycle to the next available theme.
|
|
34
|
+
* This cycles through all available theme names, excluding "system".
|
|
35
|
+
* Loops back to the start when reaching the end of the list.
|
|
36
|
+
*/
|
|
18
37
|
toggleTheme: e.toggleTheme,
|
|
38
|
+
/**
|
|
39
|
+
* The list of available theme names in the application.
|
|
40
|
+
* This does not include "system" as it is not a theme name.
|
|
41
|
+
*/
|
|
19
42
|
availableThemes: e.getAvailableThemes()
|
|
20
43
|
};
|
|
21
44
|
}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AsheeUI shared utilities.
|
|
3
|
-
*
|
|
4
|
-
* Client-safe helpers (`cn`, `mergeObject`) plus the `DeepPartial` type,
|
|
5
|
-
* migrated from the former `@asheeui/utils` package. Node-only helpers
|
|
6
|
-
* (config discovery) live under `./node`.
|
|
7
|
-
*/
|
|
8
1
|
export { cn } from './cn';
|
|
9
2
|
export { mergeObject } from './merge-object';
|
|
10
3
|
export type { DeepPartial } from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,5 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for resolving cascade values in AsheeUI.
|
|
3
|
+
* This file provides helper functions that implement the configuration
|
|
4
|
+
* precedence hierarchy: instance prop > component config > theme default > hard fallback.
|
|
5
|
+
* These utilities are used throughout the component library to resolve
|
|
6
|
+
* values like variant, color, size, and radius.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Resolves a value using the standard cascade precedence order.
|
|
10
|
+
* Follows the hierarchy: instance prop > component config > global default > hard fallback.
|
|
11
|
+
* This is the primary resolver for most component props.
|
|
12
|
+
*
|
|
13
|
+
* @param instance - The prop value passed directly to the component instance.
|
|
14
|
+
* @param section - The value from the component's configuration section.
|
|
15
|
+
* @param globalDefault - The global default value from the theme configuration.
|
|
16
|
+
* @param hardFallback - The final fallback value if all others are undefined.
|
|
17
|
+
* @returns The resolved value.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const variant = resolveCascade(
|
|
22
|
+
* props.variant, // 'ghost'
|
|
23
|
+
* config.Button.variant, // 'solid'
|
|
24
|
+
* theme.defaultVariant, // 'faded'
|
|
25
|
+
* 'solid' // hard fallback
|
|
26
|
+
* );
|
|
27
|
+
* // Returns 'ghost' because instance prop takes precedence
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
1
30
|
export declare function resolveCascade<T>(instance: T | undefined, section: T | undefined, globalDefault: T | undefined, hardFallback: T): T;
|
|
31
|
+
/**
|
|
32
|
+
* Resolves a value for animation or transition contexts.
|
|
33
|
+
* Similar to resolveCascade but without the global default tier.
|
|
34
|
+
* This is useful for values that should not inherit from theme defaults.
|
|
35
|
+
*
|
|
36
|
+
* @param instance - The prop value passed directly to the component instance.
|
|
37
|
+
* @param section - The value from the component's configuration section.
|
|
38
|
+
* @param hardFallback - The final fallback value if all others are undefined.
|
|
39
|
+
* @returns The resolved value.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* const animate = resolveAnimate(
|
|
44
|
+
* props.animate, // false
|
|
45
|
+
* config.Button.animate, // true
|
|
46
|
+
* true // hard fallback
|
|
47
|
+
* );
|
|
48
|
+
* // Returns false because instance prop takes precedence
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
2
51
|
export declare function resolveAnimate<T>(instance: T | undefined, section: T | undefined, hardFallback: T): T;
|
|
52
|
+
/**
|
|
53
|
+
* Resolves a radius value using the standard cascade precedence order.
|
|
54
|
+
* This is a specialized version of resolveCascade that provides a default
|
|
55
|
+
* hard fallback of "md" for radius values.
|
|
56
|
+
*
|
|
57
|
+
* @param instanceProp - The radius prop passed directly to the component instance.
|
|
58
|
+
* @param sectionConfig - The radius from the component's configuration section.
|
|
59
|
+
* @param globalDefaultRadius - The global default radius from the theme.
|
|
60
|
+
* @param hardFallback - Optional custom fallback, defaults to "md".
|
|
61
|
+
* @returns The resolved radius key.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* const radius = resolveRadiusKey(
|
|
66
|
+
* props.radius, // 'lg'
|
|
67
|
+
* config.Button.radius, // 'md'
|
|
68
|
+
* theme.defaultRadius, // 'sm'
|
|
69
|
+
* );
|
|
70
|
+
* // Returns 'lg' because instance prop takes precedence
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
3
73
|
export declare function resolveRadiusKey<TKey>(instanceProp: TKey | undefined, sectionConfig: TKey | undefined, globalDefaultRadius: TKey | undefined, hardFallback?: TKey): TKey;
|
|
74
|
+
/**
|
|
75
|
+
* Resolves a CSS class from a class map based on a key.
|
|
76
|
+
* Returns the class string for the given key, falling back to the
|
|
77
|
+
* fallback key's class if the key is not found. Returns an empty
|
|
78
|
+
* string if neither the key nor the fallback key exist in the map.
|
|
79
|
+
*
|
|
80
|
+
* @param key - The key to look up in the class map.
|
|
81
|
+
* @param classMap - The record mapping keys to CSS class strings.
|
|
82
|
+
* @param fallbackKey - The fallback key to use if the primary key is not found.
|
|
83
|
+
* @returns The CSS class string.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```tsx
|
|
87
|
+
* const classes = resolveClassKey(
|
|
88
|
+
* 'lg', // key
|
|
89
|
+
* { sm: 'text-sm', lg: 'text-lg' }, // classMap
|
|
90
|
+
* 'sm' // fallbackKey
|
|
91
|
+
* );
|
|
92
|
+
* // Returns 'text-lg'
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```tsx
|
|
97
|
+
* const classes = resolveClassKey(
|
|
98
|
+
* 'xl', // key not in map
|
|
99
|
+
* { sm: 'text-sm', lg: 'text-lg' }, // classMap
|
|
100
|
+
* 'sm' // fallbackKey
|
|
101
|
+
* );
|
|
102
|
+
* // Returns 'text-sm' from fallback key
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
4
105
|
export declare function resolveClassKey<TKey extends PropertyKey>(key: TKey, classMap: Record<TKey, string>, fallbackKey: TKey): string;
|
|
5
106
|
//# sourceMappingURL=resolve-token.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-token.d.ts","sourceRoot":"","sources":["../../src/utils/resolve-token.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,CAAC,EAC9B,QAAQ,EAAE,CAAC,GAAG,SAAS,EACvB,OAAO,EAAE,CAAC,GAAG,SAAS,EACtB,aAAa,EAAE,CAAC,GAAG,SAAS,EAC5B,YAAY,EAAE,CAAC,GACd,CAAC,CAEH;AAED,wBAAgB,cAAc,CAAC,CAAC,EAC9B,QAAQ,EAAE,CAAC,GAAG,SAAS,EACvB,OAAO,EAAE,CAAC,GAAG,SAAS,EACtB,YAAY,EAAE,CAAC,GACd,CAAC,CAEH;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EACnC,YAAY,EAAE,IAAI,GAAG,SAAS,EAC9B,aAAa,EAAE,IAAI,GAAG,SAAS,EAC/B,mBAAmB,EAAE,IAAI,GAAG,SAAS,EACrC,YAAY,GAAE,IAAmB,GAChC,IAAI,CAEN;AAED,wBAAgB,eAAe,CAAC,IAAI,SAAS,WAAW,EACtD,GAAG,EAAE,IAAI,EACT,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,EAC9B,WAAW,EAAE,IAAI,GAChB,MAAM,CAER"}
|
|
1
|
+
{"version":3,"file":"resolve-token.d.ts","sourceRoot":"","sources":["../../src/utils/resolve-token.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,QAAQ,EAAE,CAAC,GAAG,SAAS,EACvB,OAAO,EAAE,CAAC,GAAG,SAAS,EACtB,aAAa,EAAE,CAAC,GAAG,SAAS,EAC5B,YAAY,EAAE,CAAC,GACd,CAAC,CAEH;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,QAAQ,EAAE,CAAC,GAAG,SAAS,EACvB,OAAO,EAAE,CAAC,GAAG,SAAS,EACtB,YAAY,EAAE,CAAC,GACd,CAAC,CAEH;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EACnC,YAAY,EAAE,IAAI,GAAG,SAAS,EAC9B,aAAa,EAAE,IAAI,GAAG,SAAS,EAC/B,mBAAmB,EAAE,IAAI,GAAG,SAAS,EACrC,YAAY,GAAE,IAAmB,GAChC,IAAI,CAEN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,eAAe,CAAC,IAAI,SAAS,WAAW,EACtD,GAAG,EAAE,IAAI,EACT,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,EAC9B,WAAW,EAAE,IAAI,GAChB,MAAM,CAER"}
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { KeyboardConfig, KeyboardLayouts, KeyDisplayMap } from './keyboard-config';
|
|
2
|
-
export declare const defaultKeyboardLayouts: KeyboardLayouts;
|
|
3
|
-
export declare const defaultKeyDisplay: KeyDisplayMap;
|
|
4
|
-
export declare const defaultKeyboardConfig: KeyboardConfig;
|
|
5
|
-
declare module "../../libs/registry" {
|
|
6
|
-
interface ComponentTypeConfigRegistry {
|
|
7
|
-
keyboard: KeyboardConfig;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=default-keyboard-config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-keyboard-config.d.ts","sourceRoot":"","sources":["../../../src/components/keyboard/default-keyboard-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,aAAa,EACd,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,sBAAsB,EAAE,eAuBpC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,aAQ/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,cAMnC,CAAC;AAEF,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,QAAQ,EAAE,cAAc,CAAC;KAC1B;CACF"}
|
package/dist/shared/size.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"size.d.ts","sourceRoot":"","sources":["../../src/shared/size.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC"}
|