asheeui 0.6.2 → 0.6.3
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
|
@@ -1,64 +1,183 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { Radius } from '../../shared
|
|
3
|
-
import { Size } from '../../shared/size';
|
|
4
|
-
import { Color, Variant } from '../../shared/variant';
|
|
2
|
+
import { Color, Radius, Size, Variant } from '../../shared';
|
|
5
3
|
import { TooltipPlacement } from '../tooltip/tooltip-config';
|
|
4
|
+
/**
|
|
5
|
+
* Size key for the sidebar.
|
|
6
|
+
* Controls the width of the sidebar when expanded and collapsed.
|
|
7
|
+
*/
|
|
6
8
|
export type SidebarSizeKey = Size;
|
|
9
|
+
/**
|
|
10
|
+
* Visual style variant of the sidebar.
|
|
11
|
+
* - `default`: Standard sidebar with border and background.
|
|
12
|
+
* - `bordered`: Sidebar with a thicker border.
|
|
13
|
+
* - `floating`: Sidebar with rounded corners and shadow (floating appearance).
|
|
14
|
+
* - `ghost`: Minimal sidebar with background only, no border.
|
|
15
|
+
*/
|
|
7
16
|
export type SidebarVariant = "default" | "bordered" | "floating" | "ghost";
|
|
17
|
+
/**
|
|
18
|
+
* A single navigation item in the sidebar.
|
|
19
|
+
*/
|
|
8
20
|
export interface SidebarItem<T = string> {
|
|
9
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Unique item identifier.
|
|
23
|
+
*/
|
|
10
24
|
id: T;
|
|
11
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Display label or title.
|
|
27
|
+
*/
|
|
12
28
|
label: ReactNode;
|
|
13
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* URL or path for navigation.
|
|
31
|
+
*/
|
|
14
32
|
href?: string;
|
|
15
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Leading icon element.
|
|
35
|
+
*/
|
|
16
36
|
icon?: ReactNode;
|
|
17
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Optional trailing badge element or count.
|
|
39
|
+
*/
|
|
18
40
|
badge?: ReactNode;
|
|
19
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Role string list for optional visibility filtering.
|
|
43
|
+
* When provided, the item is only shown to users with matching roles.
|
|
44
|
+
*/
|
|
20
45
|
roles?: string[];
|
|
21
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Disables click interaction.
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
22
50
|
disabled?: boolean;
|
|
23
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Target for link (e.g., "_blank").
|
|
53
|
+
*/
|
|
24
54
|
target?: string;
|
|
25
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Rel attribute for link.
|
|
57
|
+
*/
|
|
26
58
|
rel?: string;
|
|
27
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* A section containing multiple sidebar items.
|
|
62
|
+
* Used to group related navigation items under a label.
|
|
63
|
+
*/
|
|
28
64
|
export interface SidebarSection<T = string> {
|
|
29
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Unique section identifier.
|
|
67
|
+
*/
|
|
30
68
|
id: T;
|
|
31
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Display label or title.
|
|
71
|
+
* Shown as a section header when the sidebar is expanded.
|
|
72
|
+
*/
|
|
32
73
|
label?: ReactNode;
|
|
33
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* Optional array of sidebar items within the section.
|
|
76
|
+
*/
|
|
34
77
|
items?: SidebarItem<T>[];
|
|
35
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Role string list for optional visibility filtering.
|
|
80
|
+
* When provided, the section is only shown to users with matching roles.
|
|
81
|
+
*/
|
|
36
82
|
roles?: string[];
|
|
37
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* Disables click interaction for the entire section.
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
38
87
|
disabled?: boolean;
|
|
39
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Union type for sidebar content.
|
|
91
|
+
* Can be either a flat array of items or an array of sections.
|
|
92
|
+
*/
|
|
40
93
|
export type SidebarItems<T = string> = SidebarItem<T>[] | SidebarSection<T>[];
|
|
94
|
+
/**
|
|
95
|
+
* Theme configuration options for the Sidebar component.
|
|
96
|
+
*
|
|
97
|
+
* Set under `components.sidebar` in the AsheeUI config. Values feed the
|
|
98
|
+
* component-level fallback tier of the theme cascade.
|
|
99
|
+
*/
|
|
41
100
|
export interface SidebarConfig {
|
|
101
|
+
/**
|
|
102
|
+
* Size scale of the sidebar.
|
|
103
|
+
* Controls the width of the sidebar when expanded and collapsed.
|
|
104
|
+
*
|
|
105
|
+
* @default "md"
|
|
106
|
+
*/
|
|
42
107
|
size?: SidebarSizeKey;
|
|
108
|
+
/**
|
|
109
|
+
* Visual style variant.
|
|
110
|
+
* Controls the sidebar's appearance including borders and background.
|
|
111
|
+
*/
|
|
43
112
|
variant?: SidebarVariant;
|
|
113
|
+
/**
|
|
114
|
+
* Corner rounding of the sidebar container.
|
|
115
|
+
*/
|
|
44
116
|
radius?: Radius;
|
|
117
|
+
/**
|
|
118
|
+
* Corner rounding of individual navigation items.
|
|
119
|
+
*/
|
|
45
120
|
itemRadius?: Radius;
|
|
121
|
+
/**
|
|
122
|
+
* Visual variant for inactive navigation items.
|
|
123
|
+
*/
|
|
46
124
|
itemVariant?: Variant;
|
|
125
|
+
/**
|
|
126
|
+
* Visual variant for the active navigation item.
|
|
127
|
+
*/
|
|
128
|
+
activeItemVariant?: Variant;
|
|
129
|
+
/**
|
|
130
|
+
* Theme color for the active navigation item.
|
|
131
|
+
*/
|
|
47
132
|
activeItemColor?: Color;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Whether the collapse button is shown.
|
|
135
|
+
* @default true
|
|
136
|
+
*/
|
|
52
137
|
showCollapseButton?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Whether tooltips are shown for collapsed items.
|
|
140
|
+
* @default true
|
|
141
|
+
*/
|
|
53
142
|
showTooltips?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Placement of tooltips relative to the item.
|
|
145
|
+
* @default "right"
|
|
146
|
+
*/
|
|
54
147
|
tooltipPlacement?: TooltipPlacement;
|
|
148
|
+
/**
|
|
149
|
+
* Visual variant for tooltips.
|
|
150
|
+
*/
|
|
55
151
|
tooltipVariant?: Variant;
|
|
152
|
+
/**
|
|
153
|
+
* Theme color for tooltips.
|
|
154
|
+
*/
|
|
56
155
|
tooltipColor?: Color;
|
|
156
|
+
/**
|
|
157
|
+
* Whether the sidebar has animations.
|
|
158
|
+
* @default true
|
|
159
|
+
*/
|
|
57
160
|
animated?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Initial collapsed state for uncontrolled usage.
|
|
163
|
+
* @default false
|
|
164
|
+
*/
|
|
58
165
|
defaultCollapsed?: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Whether the sidebar can be collapsed.
|
|
168
|
+
* @default true
|
|
169
|
+
*/
|
|
59
170
|
collapsible?: boolean;
|
|
60
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* Default config values registered for the Sidebar component.
|
|
174
|
+
*/
|
|
61
175
|
export declare const defaultSidebarConfig: SidebarConfig;
|
|
176
|
+
/**
|
|
177
|
+
* Hard fallback values used when no config tier provides a value.
|
|
178
|
+
* These values are used when instance props, component config,
|
|
179
|
+
* and global defaults are all undefined.
|
|
180
|
+
*/
|
|
62
181
|
export declare const FALLBACK_SIDEBAR_CONFIG: Required<SidebarConfig>;
|
|
63
182
|
declare module "../../libs/registry" {
|
|
64
183
|
interface ComponentTypeConfigRegistry {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-config.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/sidebar-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"sidebar-config.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/sidebar-config.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { registerComponentDefaults as t } from "../../libs/registry.js";
|
|
3
|
-
const
|
|
3
|
+
const e = {
|
|
4
4
|
size: "md",
|
|
5
5
|
showTooltips: !0,
|
|
6
6
|
tooltipPlacement: "right",
|
|
7
7
|
animated: !0,
|
|
8
8
|
defaultCollapsed: !1,
|
|
9
|
-
// Default to expanded
|
|
10
9
|
collapsible: !0,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
showCollapseButton: !0,
|
|
11
|
+
itemVariant: "ghost",
|
|
12
|
+
activeItemVariant: "solid",
|
|
13
|
+
activeItemColor: "primary"
|
|
14
14
|
}, a = {
|
|
15
15
|
size: "md",
|
|
16
16
|
variant: "default",
|
|
17
17
|
radius: "none",
|
|
18
18
|
itemRadius: "md",
|
|
19
|
-
itemVariant: "
|
|
19
|
+
itemVariant: "ghost",
|
|
20
|
+
activeItemVariant: "solid",
|
|
20
21
|
activeItemColor: "primary",
|
|
21
|
-
backButtonVariant: "ghost",
|
|
22
|
-
backButtonColor: "secondary",
|
|
23
|
-
collapseButtonVariant: "ghost",
|
|
24
|
-
collapseButtonColor: "secondary",
|
|
25
22
|
showTooltips: !0,
|
|
26
23
|
tooltipPlacement: "right",
|
|
27
24
|
tooltipVariant: "solid",
|
|
@@ -31,8 +28,8 @@ const o = {
|
|
|
31
28
|
collapsible: !0,
|
|
32
29
|
showCollapseButton: !0
|
|
33
30
|
};
|
|
34
|
-
t("sidebar",
|
|
31
|
+
t("sidebar", e);
|
|
35
32
|
export {
|
|
36
33
|
a as FALLBACK_SIDEBAR_CONFIG,
|
|
37
|
-
|
|
34
|
+
e as defaultSidebarConfig
|
|
38
35
|
};
|
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
import { SidebarSizeKey, SidebarVariant } from './sidebar-config';
|
|
2
|
+
/**
|
|
3
|
+
* CSS classes for sidebar width when expanded.
|
|
4
|
+
* Maps size keys to Tailwind width classes.
|
|
5
|
+
*/
|
|
2
6
|
export declare const SIDEBAR_EXPANDED_WIDTH_CLASS: Record<SidebarSizeKey, string>;
|
|
7
|
+
/**
|
|
8
|
+
* CSS classes for sidebar width when collapsed.
|
|
9
|
+
* Maps size keys to Tailwind width classes.
|
|
10
|
+
*/
|
|
3
11
|
export declare const SIDEBAR_COLLAPSED_WIDTH_CLASS: Record<SidebarSizeKey, string>;
|
|
12
|
+
/**
|
|
13
|
+
* CSS classes for sidebar header height and padding.
|
|
14
|
+
* Maps size keys to Tailwind height and padding classes.
|
|
15
|
+
*/
|
|
4
16
|
export declare const SIDEBAR_HEADER_CLASS: Record<SidebarSizeKey, string>;
|
|
17
|
+
/**
|
|
18
|
+
* CSS classes for section label typography and spacing.
|
|
19
|
+
* Maps size keys to Tailwind text size and padding classes.
|
|
20
|
+
*/
|
|
5
21
|
export declare const SIDEBAR_SECTION_LABEL_CLASS: Record<SidebarSizeKey, string>;
|
|
22
|
+
/**
|
|
23
|
+
* CSS classes for individual navigation items.
|
|
24
|
+
* Maps size keys to Tailwind height, text size, and padding classes.
|
|
25
|
+
*/
|
|
6
26
|
export declare const SIDEBAR_ITEM_CLASS: Record<SidebarSizeKey, string>;
|
|
27
|
+
/**
|
|
28
|
+
* CSS classes for sidebar variants.
|
|
29
|
+
* Each variant has a distinct border, background, and shadow treatment.
|
|
30
|
+
*/
|
|
7
31
|
export declare const SIDEBAR_VARIANT_CLASS: Record<SidebarVariant, string>;
|
|
8
32
|
//# sourceMappingURL=sidebar-styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-styles.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/sidebar-styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvE,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAIvE,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAIxE,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAI/D,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAItE,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAI7D,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAMhE,CAAC"}
|
|
1
|
+
{"version":3,"file":"sidebar-styles.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/sidebar-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvE;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAIvE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAIxE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAI/D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAItE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAI7D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAMhE,CAAC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { Size } from '../../shared
|
|
2
|
-
import { Color } from '../../shared/variant';
|
|
3
|
-
/** Pixel-size scale of the spinner. */
|
|
4
|
-
export type SpinnerSizeKey = Size;
|
|
1
|
+
import { Color, Size } from '../../shared';
|
|
5
2
|
/**
|
|
6
3
|
* Theme configuration options for the Spinner component.
|
|
7
4
|
*
|
|
@@ -9,22 +6,29 @@ export type SpinnerSizeKey = Size;
|
|
|
9
6
|
* the component-level fallback tier of the theme cascade.
|
|
10
7
|
*/
|
|
11
8
|
export interface SpinnerConfig {
|
|
12
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Pixel-size scale.
|
|
11
|
+
* Controls the dimensions of the spinner.
|
|
13
12
|
*
|
|
14
13
|
* @default "md"
|
|
15
14
|
*/
|
|
16
|
-
size?:
|
|
17
|
-
/**
|
|
15
|
+
size?: Size;
|
|
16
|
+
/**
|
|
17
|
+
* Theme accent color.
|
|
18
|
+
* Controls the color of the spinner.
|
|
18
19
|
*
|
|
19
20
|
* @default "primary"
|
|
20
21
|
*/
|
|
21
22
|
color?: Color;
|
|
22
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* CSS `animation-duration` for one rotation.
|
|
25
|
+
* Controls how fast the spinner rotates.
|
|
23
26
|
*
|
|
24
27
|
* @default "0.75s"
|
|
25
28
|
*/
|
|
26
29
|
speed?: string;
|
|
27
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Extra classes applied to every spinner instance.
|
|
28
32
|
*
|
|
29
33
|
* @default ""
|
|
30
34
|
*/
|
|
@@ -39,6 +43,8 @@ export interface SpinnerConfig {
|
|
|
39
43
|
export declare const defaultSpinnerConfig: SpinnerConfig;
|
|
40
44
|
/**
|
|
41
45
|
* Hard fallback values used when no config tier provides a value.
|
|
46
|
+
* These values are used when instance props, component config,
|
|
47
|
+
* and global defaults are all undefined.
|
|
42
48
|
*/
|
|
43
49
|
export declare const FALLBACK_SPINNER_CONFIG: Required<SpinnerConfig>;
|
|
44
50
|
declare module "../../libs/registry" {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner-config.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/spinner-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spinner-config.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/spinner-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;;;;OAKG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAGlC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,aAAa,CAKlD,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,OAAO,EAAE,aAAa,CAAC;KACxB;CACF"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import { Color } from '../../shared
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Color, Size } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* CSS classes for spinner size.
|
|
4
|
+
* Maps size keys to Tailwind width and height classes.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SPINNER_SIZE_CLASS: Record<Size, string>;
|
|
7
|
+
/**
|
|
8
|
+
* CSS classes for spinner colors.
|
|
9
|
+
* Maps color keys to Tailwind text color classes.
|
|
10
|
+
*/
|
|
4
11
|
export declare const SPINNER_COLOR_CLASS: Record<Color, string>;
|
|
5
12
|
//# sourceMappingURL=spinner-styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner-styles.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/spinner-styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"spinner-styles.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/spinner-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAInD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAOrD,CAAC"}
|
|
@@ -1,27 +1,10 @@
|
|
|
1
1
|
import { SVGAttributes } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { SpinnerSizeKey } from './spinner-config';
|
|
2
|
+
import { SpinnerConfig } from './spinner-config';
|
|
4
3
|
/**
|
|
5
4
|
* Configuration options for the Spinner component.
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
* @default "md"
|
|
11
|
-
*/
|
|
12
|
-
size?: SpinnerSizeKey;
|
|
13
|
-
/** Theme accent color.
|
|
14
|
-
*
|
|
15
|
-
* @default "primary"
|
|
16
|
-
*/
|
|
17
|
-
color?: Color;
|
|
18
|
-
/** CSS `animation-duration` for one rotation.
|
|
19
|
-
*
|
|
20
|
-
* @default "0.75s"
|
|
21
|
-
*/
|
|
22
|
-
speed?: string;
|
|
23
|
-
/** Extra classes merged with internal styles. */
|
|
24
|
-
className?: string;
|
|
6
|
+
type BaseSpinnerProps = SpinnerConfig & Omit<SVGAttributes<SVGSVGElement>, "color" | "className">;
|
|
7
|
+
export interface SpinnerProps extends BaseSpinnerProps {
|
|
25
8
|
}
|
|
26
9
|
/**
|
|
27
10
|
* An animated SVG loading indicator.
|
|
@@ -32,11 +15,16 @@ export interface SpinnerProps extends SVGAttributes<SVGSVGElement> {
|
|
|
32
15
|
* technology (`aria-hidden`); pair it with a visually hidden label or
|
|
33
16
|
* text for meaningful loading feedback.
|
|
34
17
|
*
|
|
18
|
+
* The spinner uses a standard circular progress indicator design with
|
|
19
|
+
* a semi-transparent track and a solid arc that rotates. The rotation
|
|
20
|
+
* is powered by CSS animation with configurable duration.
|
|
21
|
+
*
|
|
35
22
|
* @param props - Spinner configuration options and SVG attributes.
|
|
36
23
|
* @param props.size - Pixel-size scale. Defaults to "md".
|
|
37
24
|
* @param props.color - Theme accent color. Defaults to "primary".
|
|
38
25
|
* @param props.speed - Rotation duration. Defaults to "0.75s".
|
|
39
26
|
* @param props.className - Extra classes for the SVG element.
|
|
27
|
+
* @param props.style - Inline styles for the SVG element.
|
|
40
28
|
*
|
|
41
29
|
* @example
|
|
42
30
|
* ```tsx
|
|
@@ -46,6 +34,25 @@ export interface SpinnerProps extends SVGAttributes<SVGSVGElement> {
|
|
|
46
34
|
* return <Spinner size="lg" color="primary" />;
|
|
47
35
|
* }
|
|
48
36
|
* ```
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* // Custom speed and color
|
|
41
|
+
* <Spinner size="sm" color="success" speed="1.2s" />
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* // With loading text for accessibility
|
|
47
|
+
* <div role="status">
|
|
48
|
+
* <Spinner />
|
|
49
|
+
* <span className="sr-only">Loading...</span>
|
|
50
|
+
* </div>
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @see SpinnerConfig - The configuration type for component defaults.
|
|
54
|
+
* @see useAsheeConfig - Hook for accessing the global configuration.
|
|
49
55
|
*/
|
|
50
56
|
export declare const Spinner: import('react').ForwardRefExoticComponent<SpinnerProps & import('react').RefAttributes<SVGSVGElement>>;
|
|
57
|
+
export {};
|
|
51
58
|
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAKvD,OAAO,EAA2B,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAG/E;;GAEG;AACH,KAAK,gBAAgB,GAAG,aAAa,GACnC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC,CAAC;AAE5D,MAAM,WAAW,YAAa,SAAQ,gBAAgB;CAAG;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,OAAO,wGA4EnB,CAAC"}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as
|
|
2
|
+
import { jsxs as f, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as h } from "react";
|
|
4
4
|
import { useAsheeConfig as z } from "../../libs/context.js";
|
|
5
5
|
import { resolveCascade as o, resolveClassKey as t } from "../../utils/resolve-token.js";
|
|
6
|
-
import { FALLBACK_SPINNER_CONFIG as
|
|
6
|
+
import { FALLBACK_SPINNER_CONFIG as r } from "./spinner-config.js";
|
|
7
7
|
import { SPINNER_SIZE_CLASS as _, SPINNER_COLOR_CLASS as x } from "./spinner-styles.js";
|
|
8
8
|
import { cn as A } from "../../utils/cn.js";
|
|
9
|
-
const I =
|
|
9
|
+
const I = h(
|
|
10
10
|
({ size: c, color: i, speed: m, className: p, style: n, ...d }, N) => {
|
|
11
11
|
var l;
|
|
12
|
-
const s = z(),
|
|
12
|
+
const s = z(), e = (l = s.components) == null ? void 0 : l.spinner, S = o(
|
|
13
13
|
c,
|
|
14
|
-
|
|
14
|
+
e == null ? void 0 : e.size,
|
|
15
15
|
void 0,
|
|
16
|
-
|
|
16
|
+
r.size
|
|
17
17
|
), v = o(
|
|
18
18
|
i,
|
|
19
|
-
|
|
19
|
+
e == null ? void 0 : e.color,
|
|
20
20
|
s.defaultColor,
|
|
21
|
-
|
|
21
|
+
r.color
|
|
22
22
|
), u = o(
|
|
23
23
|
m,
|
|
24
|
-
|
|
24
|
+
e == null ? void 0 : e.speed,
|
|
25
25
|
void 0,
|
|
26
|
-
|
|
27
|
-
),
|
|
26
|
+
r.speed
|
|
27
|
+
), y = t(
|
|
28
28
|
S,
|
|
29
29
|
_,
|
|
30
|
-
|
|
31
|
-
),
|
|
30
|
+
r.size
|
|
31
|
+
), C = t(
|
|
32
32
|
v,
|
|
33
33
|
x,
|
|
34
|
-
|
|
34
|
+
r.color
|
|
35
35
|
);
|
|
36
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ f(
|
|
37
37
|
"svg",
|
|
38
38
|
{
|
|
39
39
|
ref: N,
|
|
40
40
|
"aria-hidden": "true",
|
|
41
41
|
className: A(
|
|
42
42
|
"animate-spin shrink-0",
|
|
43
|
+
y,
|
|
43
44
|
C,
|
|
44
|
-
|
|
45
|
-
r == null ? void 0 : r.className,
|
|
45
|
+
e == null ? void 0 : e.className,
|
|
46
46
|
p
|
|
47
47
|
),
|
|
48
48
|
style: {
|
|
@@ -1,21 +1,121 @@
|
|
|
1
1
|
import { ChangeEvent, InputHTMLAttributes } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { SwitchConfig } from './switch-config';
|
|
3
|
+
type BaseSwitchProps = SwitchConfig & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "onChange" | "children" | "color">;
|
|
4
|
+
/**
|
|
5
|
+
* Configuration options for the Switch component.
|
|
6
|
+
*/
|
|
7
|
+
export interface SwitchProps extends BaseSwitchProps {
|
|
8
|
+
/**
|
|
9
|
+
* Label text for the switch.
|
|
10
|
+
* Displayed next to the toggle.
|
|
11
|
+
*/
|
|
10
12
|
label?: string;
|
|
11
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Description text shown below the label.
|
|
15
|
+
* Provides additional context for the switch.
|
|
16
|
+
*/
|
|
12
17
|
description?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Validation message shown below the switch.
|
|
20
|
+
* Color is determined by the status prop.
|
|
21
|
+
*/
|
|
13
22
|
message?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the field is required.
|
|
25
|
+
* Adds a required indicator to the label.
|
|
26
|
+
*
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
14
29
|
required?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the switch is in a loading state.
|
|
32
|
+
* Disables interaction and shows loading indication.
|
|
33
|
+
*
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
15
36
|
isLoading?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Controlled checked state.
|
|
39
|
+
* When provided, the component becomes controlled.
|
|
40
|
+
*/
|
|
16
41
|
checked?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Uncontrolled initial checked state.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
17
46
|
defaultChecked?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Callback fired when the switch state changes.
|
|
49
|
+
* Receives the new checked state and the change event.
|
|
50
|
+
*/
|
|
18
51
|
onChange?: (checked: boolean, event: ChangeEvent<HTMLInputElement>) => void;
|
|
19
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* A toggle switch with label, description, and validation support.
|
|
55
|
+
*
|
|
56
|
+
* Switch renders a toggle input that can be checked or unchecked. It
|
|
57
|
+
* supports controlled and uncontrolled usage, validation states, and
|
|
58
|
+
* the standard AsheeUI cascade for visual tokens. The component
|
|
59
|
+
* integrates with FieldShell for label, description, and message
|
|
60
|
+
* handling.
|
|
61
|
+
*
|
|
62
|
+
* The component automatically handles accessibility attributes including
|
|
63
|
+
* role="switch", aria-checked, aria-invalid, and aria-busy for loading
|
|
64
|
+
* states. It also supports proper focus management through the native
|
|
65
|
+
* input element.
|
|
66
|
+
*
|
|
67
|
+
* @param props - Switch configuration options.
|
|
68
|
+
* @param props.label - Label text for the switch.
|
|
69
|
+
* @param props.description - Description text.
|
|
70
|
+
* @param props.message - Validation message.
|
|
71
|
+
* @param props.required - Whether the field is required. Defaults to false.
|
|
72
|
+
* @param props.isLoading - Loading state. Defaults to false.
|
|
73
|
+
* @param props.checked - Controlled checked state.
|
|
74
|
+
* @param props.defaultChecked - Uncontrolled initial checked state. Defaults to false.
|
|
75
|
+
* @param props.onChange - Callback fired when the switch state changes.
|
|
76
|
+
* @param props.size - Size scale. Defaults to "md".
|
|
77
|
+
* @param props.color - Theme accent color. Defaults to "primary".
|
|
78
|
+
* @param props.radius - Corner rounding. Defaults to "full".
|
|
79
|
+
* @param props.status - Validation status. Defaults to "default".
|
|
80
|
+
* @param props.labelAlign - Alignment of the label. Defaults to "left".
|
|
81
|
+
* @param props.disabled - Whether the switch is disabled.
|
|
82
|
+
* @param props.className - Extra CSS classes for the switch.
|
|
83
|
+
* @param props.id - Optional ID for the switch.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```tsx
|
|
87
|
+
* import { Switch } from "asheeui";
|
|
88
|
+
* import { useState } from "react";
|
|
89
|
+
*
|
|
90
|
+
* export function Example() {
|
|
91
|
+
* const [checked, setChecked] = useState(false);
|
|
92
|
+
*
|
|
93
|
+
* return (
|
|
94
|
+
* <Switch
|
|
95
|
+
* label="Enable notifications"
|
|
96
|
+
* description="Receive email notifications for updates"
|
|
97
|
+
* checked={checked}
|
|
98
|
+
* onChange={(checked) => setChecked(checked)}
|
|
99
|
+
* />
|
|
100
|
+
* );
|
|
101
|
+
* }
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```tsx
|
|
106
|
+
* // With validation
|
|
107
|
+
* <Switch
|
|
108
|
+
* label="Terms accepted"
|
|
109
|
+
* status="error"
|
|
110
|
+
* message="You must accept the terms to continue"
|
|
111
|
+
* required
|
|
112
|
+
* />
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* @see SwitchConfig - The configuration type for component defaults.
|
|
116
|
+
* @see FieldShell - The wrapper component for label and validation.
|
|
117
|
+
* @see useAsheeConfig - Hook for accessing the global configuration.
|
|
118
|
+
*/
|
|
20
119
|
export declare const Switch: import('react').ForwardRefExoticComponent<SwitchProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
120
|
+
export {};
|
|
21
121
|
//# sourceMappingURL=Switch.d.ts.map
|