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,28 +1,95 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { Radius } from '../../shared
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { Color, Radius, Size } from '../../shared';
|
|
3
|
+
/**
|
|
4
|
+
* Visual style variant of the table.
|
|
5
|
+
* - `grid`: Table with grid lines between cells.
|
|
6
|
+
* - `striped`: Alternating row backgrounds.
|
|
7
|
+
* - `bordered`: Table with outer border only.
|
|
8
|
+
* - `ghost`: Minimal table without borders or backgrounds.
|
|
9
|
+
*/
|
|
6
10
|
export type TableVariant = "grid" | "striped" | "bordered" | "ghost";
|
|
11
|
+
/**
|
|
12
|
+
* Column definition for the table.
|
|
13
|
+
* Defines the header content and cell renderer for a column.
|
|
14
|
+
*/
|
|
7
15
|
export interface ColumnDef<TData> {
|
|
8
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Optional explicit key for React list rendering.
|
|
18
|
+
* Used as the key prop for the column element.
|
|
19
|
+
*/
|
|
9
20
|
id?: string;
|
|
10
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Header content or title.
|
|
23
|
+
* Rendered in the table header cell.
|
|
24
|
+
*/
|
|
11
25
|
header: ReactNode;
|
|
12
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Cell renderer function.
|
|
28
|
+
* Receives the row data and returns the cell content.
|
|
29
|
+
*/
|
|
13
30
|
cell: (row: TData) => ReactNode;
|
|
14
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Theme configuration options for the Table component.
|
|
34
|
+
*
|
|
35
|
+
* Set under `components.table` in the AsheeUI config. Values feed the
|
|
36
|
+
* component-level fallback tier of the theme cascade.
|
|
37
|
+
*/
|
|
15
38
|
export interface TableConfig {
|
|
16
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Density scale of the table.
|
|
41
|
+
* Controls the padding and font size of cells.
|
|
42
|
+
*
|
|
43
|
+
* @default "md"
|
|
44
|
+
*/
|
|
45
|
+
size?: Size;
|
|
46
|
+
/**
|
|
47
|
+
* Visual style variant.
|
|
48
|
+
* Controls the table's border and background treatment.
|
|
49
|
+
*
|
|
50
|
+
* @default "grid"
|
|
51
|
+
*/
|
|
17
52
|
variant?: TableVariant;
|
|
53
|
+
/**
|
|
54
|
+
* Theme accent color.
|
|
55
|
+
* Controls the color of selected rows and interactive states.
|
|
56
|
+
*
|
|
57
|
+
* @default "primary"
|
|
58
|
+
*/
|
|
18
59
|
color?: Color;
|
|
60
|
+
/**
|
|
61
|
+
* Corner rounding.
|
|
62
|
+
* Controls the border-radius of the table container.
|
|
63
|
+
*
|
|
64
|
+
* @default "md"
|
|
65
|
+
*/
|
|
19
66
|
radius?: Radius;
|
|
67
|
+
/**
|
|
68
|
+
* Extra classes applied to the table container.
|
|
69
|
+
*/
|
|
20
70
|
className?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Extra classes applied to the table header.
|
|
73
|
+
*/
|
|
21
74
|
headerClassName?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Extra classes applied to table rows.
|
|
77
|
+
*/
|
|
22
78
|
rowClassName?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Extra classes applied to table cells.
|
|
81
|
+
*/
|
|
23
82
|
cellClassName?: string;
|
|
24
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Default config values registered for the Table component.
|
|
86
|
+
*/
|
|
25
87
|
export declare const defaultTableConfig: TableConfig;
|
|
88
|
+
/**
|
|
89
|
+
* Hard fallback values used when no config tier provides a value.
|
|
90
|
+
* These values are used when instance props, component config,
|
|
91
|
+
* and global defaults are all undefined.
|
|
92
|
+
*/
|
|
26
93
|
export declare const FALLBACK_TABLE_CONFIG: Required<TableConfig>;
|
|
27
94
|
declare module "../../libs/registry" {
|
|
28
95
|
interface ComponentTypeConfigRegistry {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-config.d.ts","sourceRoot":"","sources":["../../../src/components/table/table-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"table-config.d.ts","sourceRoot":"","sources":["../../../src/components/table/table-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,SAAS,CAAC,KAAK;IAC9B;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,MAAM,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,IAAI,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,SAAS,CAAC;CACjC;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;;;;OAKG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAGhC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAS9C,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,KAAK,EAAE,WAAW,CAAC;KACpB;CACF"}
|
|
@@ -1,9 +1,28 @@
|
|
|
1
|
-
import { Color } from '../../shared
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const
|
|
1
|
+
import { Color, Size } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* CSS classes for table cell vertical padding.
|
|
4
|
+
* Maps size keys to Tailwind padding-y classes.
|
|
5
|
+
*/
|
|
6
|
+
export declare const TABLE_CELL_PADDING_Y_CLASS: Record<Size, string>;
|
|
7
|
+
/**
|
|
8
|
+
* CSS classes for table cell horizontal padding.
|
|
9
|
+
* Maps size keys to Tailwind padding-x classes.
|
|
10
|
+
*/
|
|
11
|
+
export declare const TABLE_CELL_PADDING_X_CLASS: Record<Size, string>;
|
|
12
|
+
/**
|
|
13
|
+
* CSS classes for table body font size.
|
|
14
|
+
* Maps size keys to Tailwind text size classes.
|
|
15
|
+
*/
|
|
16
|
+
export declare const TABLE_FONT_CLASS: Record<Size, string>;
|
|
17
|
+
/**
|
|
18
|
+
* CSS classes for table header font size.
|
|
19
|
+
* Maps size keys to Tailwind text size classes.
|
|
20
|
+
*/
|
|
21
|
+
export declare const TABLE_HEADER_FONT_CLASS: Record<Size, string>;
|
|
22
|
+
/**
|
|
23
|
+
* CSS classes for table color styles.
|
|
24
|
+
* Each color defines styles for selected, hover, and focus states.
|
|
25
|
+
*/
|
|
7
26
|
export declare const TABLE_COLOR_STYLES: Record<Color, {
|
|
8
27
|
selected: string;
|
|
9
28
|
hover: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-styles.d.ts","sourceRoot":"","sources":["../../../src/components/table/table-styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"table-styles.d.ts","sourceRoot":"","sources":["../../../src/components/table/table-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAI3D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAI3D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIjD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIxD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CACrC,KAAK,EACL;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CA2CnD,CAAC"}
|
|
@@ -1,49 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { TabItem, TabsConfig } from './tabs-config';
|
|
2
|
+
type BaseTabsProps = TabsConfig & Omit<React.HTMLAttributes<HTMLDivElement>, "color" | "onChange">;
|
|
3
|
+
/**
|
|
4
|
+
* Configuration options for the Tabs component.
|
|
5
|
+
*/
|
|
6
|
+
export interface TabsProps extends BaseTabsProps {
|
|
7
|
+
/**
|
|
8
|
+
* Array of tab items to render.
|
|
9
|
+
* Each tab must have an id and either label or name for display.
|
|
10
|
+
*/
|
|
5
11
|
tabs: TabItem[];
|
|
6
12
|
/**
|
|
7
13
|
* Controlled active tab identifier.
|
|
14
|
+
* When provided, the component becomes controlled.
|
|
8
15
|
*/
|
|
9
16
|
activeId?: string | number;
|
|
10
17
|
/**
|
|
11
18
|
* Default active tab identifier for uncontrolled state.
|
|
19
|
+
* Used as the initial active tab when not controlled.
|
|
12
20
|
*/
|
|
13
21
|
defaultActiveId?: string | number;
|
|
14
22
|
/**
|
|
15
23
|
* Callback fired when active tab changes.
|
|
24
|
+
* Receives the new active tab ID.
|
|
16
25
|
*/
|
|
17
26
|
onChange?: (id: string | number) => void;
|
|
18
|
-
/**
|
|
19
|
-
* Visual style variant for the tablist container.
|
|
20
|
-
* @default "underline"
|
|
21
|
-
*/
|
|
22
|
-
variant?: TabsVariant;
|
|
23
|
-
/**
|
|
24
|
-
* Size scale key.
|
|
25
|
-
* @default "md"
|
|
26
|
-
*/
|
|
27
|
-
size?: TabsSizeKey;
|
|
28
|
-
/**
|
|
29
|
-
* Border radius for the tablist container.
|
|
30
|
-
*/
|
|
31
|
-
radius?: Radius;
|
|
32
|
-
/**
|
|
33
|
-
* Border radius for only the active tab button.
|
|
34
|
-
*/
|
|
35
|
-
activeRadius?: Radius;
|
|
36
|
-
/**
|
|
37
|
-
* Button variant for only the active tab button.
|
|
38
|
-
*/
|
|
39
|
-
activeVariant?: Variant;
|
|
40
|
-
/**
|
|
41
|
-
* Button color for only the active tab button.
|
|
42
|
-
* @default "primary"
|
|
43
|
-
*/
|
|
44
|
-
activeColor?: Color;
|
|
45
27
|
/**
|
|
46
28
|
* Full width stretch tabs inside container.
|
|
29
|
+
* When true, tabs expand to fill the container width.
|
|
30
|
+
*
|
|
47
31
|
* @default false
|
|
48
32
|
*/
|
|
49
33
|
fullWidth?: boolean;
|
|
@@ -60,5 +44,74 @@ export interface TabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "o
|
|
|
60
44
|
*/
|
|
61
45
|
tabPanelClassName?: string;
|
|
62
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* A tabbed navigation interface with support for variants, sizes,
|
|
49
|
+
* icons, badges, and keyboard navigation.
|
|
50
|
+
*
|
|
51
|
+
* Tabs renders a horizontal list of tab triggers and a content panel
|
|
52
|
+
* that displays the content of the active tab. It supports multiple
|
|
53
|
+
* visual variants (underline, bordered, ghost), configurable sizes,
|
|
54
|
+
* and active state styling. The component handles keyboard navigation
|
|
55
|
+
* with arrow keys, Home, and End keys for accessibility.
|
|
56
|
+
*
|
|
57
|
+
* Visual tokens resolve through the standard AsheeUI cascade: prop,
|
|
58
|
+
* component config, global theme defaults, and the built-in fallback.
|
|
59
|
+
*
|
|
60
|
+
* @param props - Tabs configuration options.
|
|
61
|
+
* @param props.tabs - Array of tab items to render.
|
|
62
|
+
* @param props.activeId - Controlled active tab identifier.
|
|
63
|
+
* @param props.defaultActiveId - Default active tab for uncontrolled state.
|
|
64
|
+
* @param props.onChange - Callback fired when active tab changes.
|
|
65
|
+
* @param props.fullWidth - Whether tabs stretch to fill container. Defaults to false.
|
|
66
|
+
* @param props.variant - Visual style variant. Defaults to "underline".
|
|
67
|
+
* @param props.size - Density scale. Defaults to "md".
|
|
68
|
+
* @param props.radius - Corner rounding of the container. Defaults to "md".
|
|
69
|
+
* @param props.activeRadius - Corner rounding of the active tab. Defaults to "md".
|
|
70
|
+
* @param props.activeVariant - Visual variant for the active tab. Defaults to "solid".
|
|
71
|
+
* @param props.activeColor - Theme color for the active tab. Defaults to "primary".
|
|
72
|
+
* @param props.tabListClassName - Extra classes for the tablist.
|
|
73
|
+
* @param props.tabClassName - Extra classes for individual tabs.
|
|
74
|
+
* @param props.tabPanelClassName - Extra classes for the content panel.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```tsx
|
|
78
|
+
* import { Tabs } from "asheeui";
|
|
79
|
+
* import { useState } from "react";
|
|
80
|
+
*
|
|
81
|
+
* export function Example() {
|
|
82
|
+
* const [activeId, setActiveId] = useState("tab-1");
|
|
83
|
+
*
|
|
84
|
+
* return (
|
|
85
|
+
* <Tabs
|
|
86
|
+
* tabs={[
|
|
87
|
+
* { id: "tab-1", label: "Tab 1", content: <div>Content 1</div> },
|
|
88
|
+
* { id: "tab-2", label: "Tab 2", content: <div>Content 2</div> },
|
|
89
|
+
* { id: "tab-3", label: "Tab 3", content: <div>Content 3</div> },
|
|
90
|
+
* ]}
|
|
91
|
+
* activeId={activeId}
|
|
92
|
+
* onChange={setActiveId}
|
|
93
|
+
* variant="bordered"
|
|
94
|
+
* />
|
|
95
|
+
* );
|
|
96
|
+
* }
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```tsx
|
|
101
|
+
* // With icons and badges
|
|
102
|
+
* <Tabs
|
|
103
|
+
* tabs={[
|
|
104
|
+
* { id: "home", label: "Home", icon: <HomeIcon />, badge: 5 },
|
|
105
|
+
* { id: "settings", label: "Settings", icon: <SettingsIcon /> },
|
|
106
|
+
* ]}
|
|
107
|
+
* fullWidth
|
|
108
|
+
* />
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* @see TabsConfig - The configuration type for component defaults.
|
|
112
|
+
* @see TabItem - The tab item type.
|
|
113
|
+
* @see useAsheeConfig - Hook for accessing the global configuration.
|
|
114
|
+
*/
|
|
63
115
|
export declare const Tabs: import('react').ForwardRefExoticComponent<TabsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
116
|
+
export {};
|
|
64
117
|
//# sourceMappingURL=Tabs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/Tabs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/Tabs.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,UAAU,EAEhB,MAAM,eAAe,CAAC;AASvB,KAAK,aAAa,GAAG,UAAU,GAC7B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C;;;OAGG;IACH,IAAI,EAAE,OAAO,EAAE,CAAC;IAEhB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE3B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAEzC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,eAAO,MAAM,IAAI,sGA4QhB,CAAC"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as ae, useId as te, useRef as ne, useState as se, useCallback as de, useMemo as
|
|
2
|
+
import { jsxs as K, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as ae, useId as te, useRef as ne, useState as se, useCallback as de, useMemo as N } from "react";
|
|
4
4
|
import { useAsheeConfig as oe } from "../../libs/context.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { Button as ue } from "../button/Button.js";
|
|
5
|
+
import { resolveCascade as y, resolveRadiusKey as _, resolveClassKey as x } from "../../utils/resolve-token.js";
|
|
6
|
+
import { Button as ce } from "../button/Button.js";
|
|
8
7
|
import { FALLBACK_TABS_CONFIG as t } from "./tabs-config.js";
|
|
9
|
-
import { TABS_HEIGHT_CLASS as
|
|
8
|
+
import { TABS_HEIGHT_CLASS as ue, TABS_PADDING_X_CLASS as fe, TABS_FONT_CLASS as ve } from "./tabs-styles.js";
|
|
9
|
+
import { RADIUS_CLASS as me } from "../../shared/radius.js";
|
|
10
10
|
import { cn as g } from "../../utils/cn.js";
|
|
11
11
|
const pe = ae(
|
|
12
12
|
({
|
|
13
13
|
tabs: i = [],
|
|
14
14
|
activeId: I,
|
|
15
15
|
defaultActiveId: z,
|
|
16
|
-
onChange:
|
|
17
|
-
variant:
|
|
16
|
+
onChange: c,
|
|
17
|
+
variant: C,
|
|
18
18
|
size: V,
|
|
19
19
|
radius: $,
|
|
20
20
|
activeRadius: L,
|
|
@@ -29,64 +29,64 @@ const pe = ae(
|
|
|
29
29
|
...X
|
|
30
30
|
}, U) => {
|
|
31
31
|
var D;
|
|
32
|
-
const
|
|
32
|
+
const s = oe(), r = (D = s.components) == null ? void 0 : D.tabs, u = te(), S = ne(
|
|
33
33
|
/* @__PURE__ */ new Map()
|
|
34
34
|
), [q, J] = se(
|
|
35
35
|
() => {
|
|
36
36
|
var e;
|
|
37
37
|
return z ?? ((e = i[0]) == null ? void 0 : e.id);
|
|
38
38
|
}
|
|
39
|
-
), T = I !== void 0, w = T ? I : q, f =
|
|
39
|
+
), T = I !== void 0, w = T ? I : q, f = y(
|
|
40
40
|
V,
|
|
41
41
|
r == null ? void 0 : r.size,
|
|
42
42
|
void 0,
|
|
43
43
|
t.size
|
|
44
|
-
), v =
|
|
45
|
-
|
|
44
|
+
), v = y(
|
|
45
|
+
C,
|
|
46
46
|
r == null ? void 0 : r.variant,
|
|
47
47
|
void 0,
|
|
48
48
|
t.variant
|
|
49
|
-
), P =
|
|
49
|
+
), P = y(
|
|
50
50
|
B,
|
|
51
51
|
r == null ? void 0 : r.activeVariant,
|
|
52
|
-
|
|
52
|
+
s.defaultVariant,
|
|
53
53
|
t.activeVariant
|
|
54
|
-
), Q =
|
|
54
|
+
), Q = y(
|
|
55
55
|
H,
|
|
56
56
|
r == null ? void 0 : r.activeColor,
|
|
57
|
-
|
|
57
|
+
s.defaultColor,
|
|
58
58
|
t.activeColor
|
|
59
|
-
), R =
|
|
59
|
+
), R = _(
|
|
60
60
|
$,
|
|
61
61
|
r == null ? void 0 : r.radius,
|
|
62
|
-
|
|
62
|
+
s.defaultRadius,
|
|
63
63
|
t.radius
|
|
64
|
-
), W =
|
|
64
|
+
), W = _(
|
|
65
65
|
L,
|
|
66
66
|
r == null ? void 0 : r.activeRadius,
|
|
67
|
-
|
|
67
|
+
s.defaultRadius,
|
|
68
68
|
t.activeRadius
|
|
69
|
-
), Y =
|
|
69
|
+
), Y = x(
|
|
70
70
|
f,
|
|
71
|
-
|
|
71
|
+
ue,
|
|
72
72
|
t.size
|
|
73
|
-
), Z =
|
|
73
|
+
), Z = x(
|
|
74
74
|
f,
|
|
75
|
-
|
|
75
|
+
fe,
|
|
76
76
|
t.size
|
|
77
|
-
), ee =
|
|
77
|
+
), ee = x(
|
|
78
78
|
f,
|
|
79
|
-
|
|
79
|
+
ve,
|
|
80
80
|
t.size
|
|
81
|
-
), ie =
|
|
81
|
+
), ie = x(
|
|
82
82
|
R,
|
|
83
|
-
|
|
83
|
+
me,
|
|
84
84
|
t.radius
|
|
85
85
|
), k = de(
|
|
86
86
|
(e) => {
|
|
87
|
-
T || J(e),
|
|
87
|
+
T || J(e), c == null || c(e);
|
|
88
88
|
},
|
|
89
|
-
[T,
|
|
89
|
+
[T, c]
|
|
90
90
|
), re = (e, m) => {
|
|
91
91
|
var p, h, A, b;
|
|
92
92
|
if (i.filter((l) => !l.disabled).length === 0) return;
|
|
@@ -111,10 +111,10 @@ const pe = ae(
|
|
|
111
111
|
const l = i[a];
|
|
112
112
|
k(l.id), (b = S.current.get(l.id)) == null || b.focus();
|
|
113
113
|
}
|
|
114
|
-
},
|
|
114
|
+
}, d = N(
|
|
115
115
|
() => i.find((e) => e.id === w) ?? i[0],
|
|
116
116
|
[i, w]
|
|
117
|
-
), le =
|
|
117
|
+
), le = N(() => {
|
|
118
118
|
switch (v) {
|
|
119
119
|
case "bordered":
|
|
120
120
|
return "border border-border p-1 bg-background";
|
|
@@ -124,7 +124,7 @@ const pe = ae(
|
|
|
124
124
|
return "border-b border-border gap-2";
|
|
125
125
|
}
|
|
126
126
|
}, [v]);
|
|
127
|
-
return /* @__PURE__ */
|
|
127
|
+
return /* @__PURE__ */ K(
|
|
128
128
|
"div",
|
|
129
129
|
{
|
|
130
130
|
ref: U,
|
|
@@ -132,7 +132,7 @@ const pe = ae(
|
|
|
132
132
|
style: O,
|
|
133
133
|
...X,
|
|
134
134
|
children: [
|
|
135
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ o(
|
|
136
136
|
"div",
|
|
137
137
|
{
|
|
138
138
|
role: "tablist",
|
|
@@ -145,8 +145,8 @@ const pe = ae(
|
|
|
145
145
|
),
|
|
146
146
|
children: i.map((e, m) => {
|
|
147
147
|
const n = e.id === w, a = e.label ?? e.name, p = `${u}-tab-${e.id}`, h = `${u}-panel-${e.id}`, A = e.activeVariant ?? P, b = e.activeColor ?? Q;
|
|
148
|
-
return /* @__PURE__ */
|
|
149
|
-
|
|
148
|
+
return /* @__PURE__ */ K(
|
|
149
|
+
ce,
|
|
150
150
|
{
|
|
151
151
|
ref: (l) => {
|
|
152
152
|
l ? S.current.set(e.id, l) : S.current.delete(e.id);
|
|
@@ -174,9 +174,9 @@ const pe = ae(
|
|
|
174
174
|
G
|
|
175
175
|
),
|
|
176
176
|
children: [
|
|
177
|
-
e.icon && /* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
e.badge !== void 0 && /* @__PURE__ */
|
|
177
|
+
e.icon && /* @__PURE__ */ o("span", { className: "shrink-0", children: e.icon }),
|
|
178
|
+
/* @__PURE__ */ o("span", { children: a }),
|
|
179
|
+
e.badge !== void 0 && /* @__PURE__ */ o("span", { className: "shrink-0 text-xs px-1.5 py-0.5 rounded-full bg-secondary text-foreground/70 font-normal", children: e.badge })
|
|
180
180
|
]
|
|
181
181
|
},
|
|
182
182
|
String(e.id)
|
|
@@ -184,19 +184,19 @@ const pe = ae(
|
|
|
184
184
|
})
|
|
185
185
|
}
|
|
186
186
|
),
|
|
187
|
-
|
|
187
|
+
d && /* @__PURE__ */ o(
|
|
188
188
|
"div",
|
|
189
189
|
{
|
|
190
|
-
id: `${u}-panel-${
|
|
190
|
+
id: `${u}-panel-${d.id}`,
|
|
191
191
|
role: "tabpanel",
|
|
192
|
-
"aria-labelledby": `${u}-tab-${
|
|
192
|
+
"aria-labelledby": `${u}-tab-${d.id}`,
|
|
193
193
|
className: g(
|
|
194
194
|
"w-full h-full flex-1 outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 rounded-md transition-all duration-200 animate-in fade-in-50",
|
|
195
195
|
E
|
|
196
196
|
),
|
|
197
|
-
children:
|
|
197
|
+
children: d.content
|
|
198
198
|
},
|
|
199
|
-
String(
|
|
199
|
+
String(d.id)
|
|
200
200
|
)
|
|
201
201
|
]
|
|
202
202
|
}
|
|
@@ -1,34 +1,127 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { Radius } from '../../shared
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { Color, Radius, Size, Variant } from '../../shared';
|
|
3
|
+
/**
|
|
4
|
+
* Visual style variant of the tabs.
|
|
5
|
+
* - `underline`: Active tab highlighted with an underline.
|
|
6
|
+
* - `bordered`: Tabs with a bordered container.
|
|
7
|
+
* - `ghost`: Minimal tabs without container styling.
|
|
8
|
+
*/
|
|
5
9
|
export type TabsVariant = "underline" | "bordered" | "ghost";
|
|
6
|
-
|
|
10
|
+
/**
|
|
11
|
+
* A single tab item in the tabs list.
|
|
12
|
+
* Each tab must have an id and either label or name for display.
|
|
13
|
+
*/
|
|
7
14
|
export interface TabItem {
|
|
15
|
+
/**
|
|
16
|
+
* Unique identifier for the tab.
|
|
17
|
+
* Used for selection state and React keys.
|
|
18
|
+
*/
|
|
8
19
|
id: string | number;
|
|
9
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Primary display text.
|
|
22
|
+
* Alias for `name` for cleaner API.
|
|
23
|
+
*/
|
|
10
24
|
label?: ReactNode;
|
|
11
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Legacy display text support.
|
|
27
|
+
* Backward compatibility for `name` prop.
|
|
28
|
+
*/
|
|
12
29
|
name?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Optional icon rendered before the label.
|
|
32
|
+
*/
|
|
13
33
|
icon?: ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Optional badge rendered after the label.
|
|
36
|
+
* Typically a number or status indicator.
|
|
37
|
+
*/
|
|
14
38
|
badge?: ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* Content rendered in the tab panel when this tab is active.
|
|
41
|
+
*/
|
|
15
42
|
content?: ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the tab is disabled.
|
|
45
|
+
* Disabled tabs cannot be selected.
|
|
46
|
+
*
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
16
49
|
disabled?: boolean;
|
|
17
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Active button variant override for this specific tab.
|
|
52
|
+
* Overrides the component-level activeVariant.
|
|
53
|
+
*/
|
|
18
54
|
activeVariant?: Variant;
|
|
19
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Active button color override for this specific tab.
|
|
57
|
+
* Overrides the component-level activeColor.
|
|
58
|
+
*/
|
|
20
59
|
activeColor?: Color;
|
|
60
|
+
/**
|
|
61
|
+
* Allows arbitrary tab metadata.
|
|
62
|
+
* Additional properties are passed through.
|
|
63
|
+
*/
|
|
21
64
|
[key: string]: unknown;
|
|
22
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Theme configuration options for the Tabs component.
|
|
68
|
+
*
|
|
69
|
+
* Set under `components.tabs` in the AsheeUI config. Values feed the
|
|
70
|
+
* component-level fallback tier of the theme cascade.
|
|
71
|
+
*/
|
|
23
72
|
export interface TabsConfig {
|
|
24
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Density scale of the tabs.
|
|
75
|
+
* Controls the height, padding, and font size of tab triggers.
|
|
76
|
+
*
|
|
77
|
+
* @default "md"
|
|
78
|
+
*/
|
|
79
|
+
size?: Size;
|
|
80
|
+
/**
|
|
81
|
+
* Visual style variant.
|
|
82
|
+
* Controls the container and active indicator styling.
|
|
83
|
+
*
|
|
84
|
+
* @default "underline"
|
|
85
|
+
*/
|
|
25
86
|
variant?: TabsVariant;
|
|
87
|
+
/**
|
|
88
|
+
* Corner rounding of the tab container.
|
|
89
|
+
* Controls the border-radius of the tablist container.
|
|
90
|
+
*
|
|
91
|
+
* @default "md"
|
|
92
|
+
*/
|
|
26
93
|
radius?: Radius;
|
|
94
|
+
/**
|
|
95
|
+
* Corner rounding of the active tab button.
|
|
96
|
+
* Controls the border-radius of the selected tab trigger.
|
|
97
|
+
*
|
|
98
|
+
* @default "md"
|
|
99
|
+
*/
|
|
27
100
|
activeRadius?: Radius;
|
|
101
|
+
/**
|
|
102
|
+
* Visual variant for the active tab button.
|
|
103
|
+
* Controls the style of the selected tab trigger.
|
|
104
|
+
*
|
|
105
|
+
* @default "solid"
|
|
106
|
+
*/
|
|
28
107
|
activeVariant?: Variant;
|
|
108
|
+
/**
|
|
109
|
+
* Theme color for the active tab button.
|
|
110
|
+
* Controls the color of the selected tab trigger.
|
|
111
|
+
*
|
|
112
|
+
* @default "primary"
|
|
113
|
+
*/
|
|
29
114
|
activeColor?: Color;
|
|
30
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Default config values registered for the Tabs component.
|
|
118
|
+
*/
|
|
31
119
|
export declare const defaultTabsConfig: TabsConfig;
|
|
120
|
+
/**
|
|
121
|
+
* Hard fallback values used when no config tier provides a value.
|
|
122
|
+
* These values are used when instance props, component config,
|
|
123
|
+
* and global defaults are all undefined.
|
|
124
|
+
*/
|
|
32
125
|
export declare const FALLBACK_TABS_CONFIG: Required<TabsConfig>;
|
|
33
126
|
declare module "../../libs/registry" {
|
|
34
127
|
interface ComponentTypeConfigRegistry {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-config.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"tabs-config.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB;;;OAGG;IACH,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IAEpB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;IAEpB;;;OAGG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;;;;OAKG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAK/B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,UAAU,CAO5C,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,IAAI,EAAE,UAAU,CAAC;KAClB;CACF"}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Size } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* CSS classes for tab trigger height.
|
|
4
|
+
* Maps size keys to Tailwind height classes.
|
|
5
|
+
*/
|
|
6
|
+
export declare const TABS_HEIGHT_CLASS: Record<Size, string>;
|
|
7
|
+
/**
|
|
8
|
+
* CSS classes for tab trigger horizontal padding.
|
|
9
|
+
* Maps size keys to Tailwind padding-x classes.
|
|
10
|
+
*/
|
|
11
|
+
export declare const TABS_PADDING_X_CLASS: Record<Size, string>;
|
|
12
|
+
/**
|
|
13
|
+
* CSS classes for tab trigger font size.
|
|
14
|
+
* Maps size keys to Tailwind text size classes.
|
|
15
|
+
*/
|
|
16
|
+
export declare const TABS_FONT_CLASS: Record<Size, string>;
|
|
5
17
|
//# sourceMappingURL=tabs-styles.d.ts.map
|