asheeui 0.7.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AsheeUIProvider.d.ts.map +1 -1
- package/dist/AsheeUIProvider.js +22 -15
- package/dist/components/accordion/Accordion.d.ts.map +1 -1
- package/dist/components/accordion/Accordion.js +9 -7
- package/dist/components/alert/Alert.d.ts +88 -0
- package/dist/components/alert/Alert.d.ts.map +1 -0
- package/dist/components/alert/Alert.js +61 -0
- package/dist/components/alert/alert-config.d.ts +56 -0
- package/dist/components/alert/alert-config.d.ts.map +1 -0
- package/dist/components/alert/alert-config.js +14 -0
- package/dist/components/alert/alert-styles.d.ts +32 -0
- package/dist/components/alert/alert-styles.d.ts.map +1 -0
- package/dist/components/alert/alert-styles.js +20 -0
- package/dist/components/alert/index.d.ts +3 -0
- package/dist/components/alert/index.d.ts.map +1 -0
- package/dist/components/alert/index.js +3 -0
- package/dist/components/autocomplete/Autocomplete.d.ts +6 -6
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +94 -58
- package/dist/components/autocomplete/autocomplete-config.d.ts +1 -1
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.d.ts +87 -0
- package/dist/components/avatar/Avatar.d.ts.map +1 -0
- package/dist/components/avatar/Avatar.js +43 -0
- package/dist/components/avatar/avatar-config.d.ts +48 -0
- package/dist/components/avatar/avatar-config.d.ts.map +1 -0
- package/dist/components/avatar/avatar-config.js +14 -0
- package/dist/components/avatar/avatar-styles.d.ts +21 -0
- package/dist/components/avatar/avatar-styles.d.ts.map +1 -0
- package/dist/components/avatar/avatar-styles.js +13 -0
- package/dist/components/avatar/avatar.helpers.d.ts +19 -0
- package/dist/components/avatar/avatar.helpers.d.ts.map +1 -0
- package/dist/components/avatar/avatar.helpers.js +11 -0
- package/dist/components/avatar/index.d.ts +3 -0
- package/dist/components/avatar/index.d.ts.map +1 -0
- package/dist/components/avatar/index.js +4 -0
- package/dist/components/badge/Badge.d.ts +69 -0
- package/dist/components/badge/Badge.d.ts.map +1 -0
- package/dist/components/badge/Badge.js +39 -0
- package/dist/components/badge/badge-config.d.ts +63 -0
- package/dist/components/badge/badge-config.d.ts.map +1 -0
- package/dist/components/badge/badge-config.js +15 -0
- package/dist/components/badge/badge-styles.d.ts +27 -0
- package/dist/components/badge/badge-styles.d.ts.map +1 -0
- package/dist/components/badge/badge-styles.js +25 -0
- package/dist/components/badge/index.d.ts +3 -0
- package/dist/components/badge/index.d.ts.map +1 -0
- package/dist/components/badge/index.js +3 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +106 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb/Breadcrumb.js +52 -0
- package/dist/components/breadcrumb/breadcrumb-config.d.ts +41 -0
- package/dist/components/breadcrumb/breadcrumb-config.d.ts.map +1 -0
- package/dist/components/breadcrumb/breadcrumb-config.js +10 -0
- package/dist/components/breadcrumb/breadcrumb-styles.d.ts +28 -0
- package/dist/components/breadcrumb/breadcrumb-styles.d.ts.map +1 -0
- package/dist/components/breadcrumb/breadcrumb-styles.js +17 -0
- package/dist/components/breadcrumb/index.d.ts +3 -0
- package/dist/components/breadcrumb/index.d.ts.map +1 -0
- package/dist/components/breadcrumb/index.js +3 -0
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +10 -7
- package/dist/components/{date-picker/DatePicker.d.ts → calendar/Calendar.d.ts} +21 -21
- package/dist/components/calendar/Calendar.d.ts.map +1 -0
- package/dist/components/{date-picker/DatePicker.js → calendar/Calendar.js} +11 -11
- package/dist/components/{date-picker/Calendar.d.ts → calendar/DateGrid.d.ts} +7 -7
- package/dist/components/calendar/DateGrid.d.ts.map +1 -0
- package/dist/components/calendar/DateGrid.js +194 -0
- package/dist/components/calendar/TimeSpinner.d.ts.map +1 -0
- package/dist/components/{date-picker → calendar}/TimeSpinner.js +3 -3
- package/dist/components/{date-picker/date-picker-config.d.ts → calendar/calendar-config.d.ts} +17 -17
- package/dist/components/calendar/calendar-config.d.ts.map +1 -0
- package/dist/components/{date-picker/date-picker-config.js → calendar/calendar-config.js} +3 -3
- package/dist/components/{date-picker/date-picker-styles.d.ts → calendar/calendar-styles.d.ts} +1 -1
- package/dist/components/calendar/calendar-styles.d.ts.map +1 -0
- package/dist/components/{date-picker/date-picker-styles.js → calendar/calendar-styles.js} +1 -1
- package/dist/components/{date-picker/date-picker.helpers.d.ts → calendar/calendar.helpers.d.ts} +9 -9
- package/dist/components/calendar/calendar.helpers.d.ts.map +1 -0
- package/dist/components/{date-picker/date-picker.helpers.js → calendar/calendar.helpers.js} +4 -4
- package/dist/components/calendar/index.d.ts +3 -0
- package/dist/components/calendar/index.d.ts.map +1 -0
- package/dist/components/calendar/index.js +6 -0
- package/dist/components/card/Card.d.ts +6 -6
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +8 -8
- package/dist/components/carousel/Carousel.d.ts.map +1 -1
- package/dist/components/carousel/Carousel.js +85 -83
- package/dist/components/carousel/carousel-styles.d.ts +1 -20
- package/dist/components/carousel/carousel-styles.d.ts.map +1 -1
- package/dist/components/chip/Chip.js +5 -5
- package/dist/components/drawer/Drawer.d.ts +8 -4
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +54 -38
- package/dist/components/{select/Select.d.ts → dropmenu/Dropmenu.d.ts} +21 -21
- package/dist/components/{select/Select.d.ts.map → dropmenu/Dropmenu.d.ts.map} +1 -1
- package/dist/components/dropmenu/Dropmenu.js +102 -0
- package/dist/components/{select/select-config.d.ts → dropmenu/dropmenu-config.d.ts} +8 -8
- package/dist/components/dropmenu/dropmenu-config.d.ts.map +1 -0
- package/dist/components/{select/select-config.js → dropmenu/dropmenu-config.js} +3 -3
- package/dist/components/{select/select-styles.d.ts → dropmenu/dropmenu-styles.d.ts} +1 -1
- package/dist/components/dropmenu/dropmenu-styles.d.ts.map +1 -0
- package/dist/components/{select/select-styles.js → dropmenu/dropmenu-styles.js} +1 -1
- package/dist/components/dropmenu/index.d.ts +3 -0
- package/dist/components/dropmenu/index.d.ts.map +1 -0
- package/dist/components/dropmenu/index.js +3 -0
- package/dist/components/field/FieldShell.d.ts +13 -1
- package/dist/components/field/FieldShell.d.ts.map +1 -1
- package/dist/components/field/FieldShell.js +16 -15
- package/dist/components/form/Form.d.ts +109 -0
- package/dist/components/form/Form.d.ts.map +1 -0
- package/dist/components/form/Form.js +42 -0
- package/dist/components/form/form-config.d.ts +57 -0
- package/dist/components/form/form-config.d.ts.map +1 -0
- package/dist/components/form/form-config.js +12 -0
- package/dist/components/form/form-styles.d.ts +27 -0
- package/dist/components/form/form-styles.d.ts.map +1 -0
- package/dist/components/form/form-styles.js +5 -0
- package/dist/components/form/index.d.ts +3 -0
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/form/index.js +3 -0
- package/dist/components/image/Image.d.ts +4 -5
- package/dist/components/image/Image.d.ts.map +1 -1
- package/dist/components/image/Image.js +5 -5
- package/dist/components/input/Input.js +5 -5
- package/dist/components/link/Link.d.ts +12 -10
- package/dist/components/link/Link.d.ts.map +1 -1
- package/dist/components/link/Link.js +1 -1
- package/dist/components/marquee/Marquee.d.ts.map +1 -1
- package/dist/components/marquee/Marquee.js +36 -33
- package/dist/components/{select-menu/SelectMenu.d.ts → menu/Menu.d.ts} +52 -19
- package/dist/components/menu/Menu.d.ts.map +1 -0
- package/dist/components/menu/Menu.js +161 -0
- package/dist/components/menu/index.d.ts +5 -0
- package/dist/components/menu/index.d.ts.map +1 -0
- package/dist/components/menu/index.js +4 -0
- package/dist/components/{select-menu/select-menu-config.d.ts → menu/menu-config.d.ts} +5 -5
- package/dist/components/menu/menu-config.d.ts.map +1 -0
- package/dist/components/{select-menu/select-menu-config.js → menu/menu-config.js} +2 -2
- package/dist/components/menu/menu-navigation.d.ts +38 -0
- package/dist/components/menu/menu-navigation.d.ts.map +1 -0
- package/dist/components/menu/menu-navigation.js +20 -0
- package/dist/components/{select-menu/use-select-floating.d.ts → menu/use-menu-floating.d.ts} +10 -10
- package/dist/components/menu/use-menu-floating.d.ts.map +1 -0
- package/dist/components/{select-menu/use-select-floating.js → menu/use-menu-floating.js} +2 -2
- package/dist/components/modal/Modal.d.ts +6 -1
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +62 -45
- package/dist/components/multi-select/MultiSelect.d.ts +11 -10
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +99 -86
- package/dist/components/multi-select/multi-select-config.d.ts +1 -1
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/pagination/Pagination.d.ts +91 -0
- package/dist/components/pagination/Pagination.d.ts.map +1 -0
- package/dist/components/pagination/Pagination.js +66 -0
- package/dist/components/pagination/index.d.ts +3 -0
- package/dist/components/pagination/index.d.ts.map +1 -0
- package/dist/components/pagination/index.js +4 -0
- package/dist/components/pagination/pagination-config.d.ts +66 -0
- package/dist/components/pagination/pagination-config.d.ts.map +1 -0
- package/dist/components/pagination/pagination-config.js +19 -0
- package/dist/components/pagination/pagination-styles.d.ts +19 -0
- package/dist/components/pagination/pagination-styles.d.ts.map +1 -0
- package/dist/components/pagination/pagination-styles.js +5 -0
- package/dist/components/pagination/pagination.helpers.d.ts +26 -0
- package/dist/components/pagination/pagination.helpers.d.ts.map +1 -0
- package/dist/components/pagination/pagination.helpers.js +12 -0
- package/dist/components/radio/Radio.d.ts +53 -107
- package/dist/components/radio/Radio.d.ts.map +1 -1
- package/dist/components/radio/Radio.js +50 -36
- package/dist/components/radio/RadioGroup.d.ts +107 -53
- package/dist/components/radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/radio/RadioGroup.js +43 -49
- package/dist/components/radio/index.d.ts +0 -1
- package/dist/components/radio/index.d.ts.map +1 -1
- package/dist/components/resizable-screen/ResizableScreen.d.ts +4 -4
- package/dist/components/scrollbar/index.js +1 -0
- package/dist/components/scrollbar/scrollbar-config.js +13 -0
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.js +92 -90
- package/dist/components/skeleton/Skeleton.d.ts +65 -0
- package/dist/components/skeleton/Skeleton.d.ts.map +1 -0
- package/dist/components/skeleton/Skeleton.js +29 -0
- package/dist/components/skeleton/index.d.ts +3 -0
- package/dist/components/skeleton/index.d.ts.map +1 -0
- package/dist/components/skeleton/index.js +3 -0
- package/dist/components/skeleton/skeleton-config.d.ts +40 -0
- package/dist/components/skeleton/skeleton-config.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton-config.js +13 -0
- package/dist/components/skeleton/skeleton-styles.d.ts +19 -0
- package/dist/components/skeleton/skeleton-styles.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton-styles.js +5 -0
- package/dist/components/switch/Switch.d.ts.map +1 -1
- package/dist/components/switch/Switch.js +7 -5
- package/dist/components/table/Table.js +3 -3
- package/dist/components/tabs/Tabs.js +3 -3
- package/dist/components/textarea/Textarea.d.ts +10 -10
- package/dist/components/textarea/Textarea.js +7 -7
- package/dist/components/textarea/textarea-config.d.ts +2 -2
- package/dist/components/toast/ToastItem.d.ts.map +1 -1
- package/dist/components/toast/ToastItem.js +8 -7
- package/dist/components/tooltip/Tooltip.js +5 -5
- package/dist/components/typography/Typography.d.ts +60 -0
- package/dist/components/typography/Typography.d.ts.map +1 -0
- package/dist/components/typography/Typography.js +28 -0
- package/dist/components/typography/index.d.ts +3 -0
- package/dist/components/typography/index.d.ts.map +1 -0
- package/dist/components/typography/index.js +3 -0
- package/dist/components/typography/typography-config.d.ts +54 -0
- package/dist/components/typography/typography-config.d.ts.map +1 -0
- package/dist/components/typography/typography-config.js +12 -0
- package/dist/components/typography/typography-styles.d.ts +21 -0
- package/dist/components/typography/typography-styles.d.ts.map +1 -0
- package/dist/components/typography/typography-styles.js +19 -0
- package/dist/config/default-config.d.ts.map +1 -1
- package/dist/config/default-config.js +2 -2
- package/dist/config/index.js +1 -0
- package/dist/config/validate-config.d.ts +34 -0
- package/dist/config/validate-config.d.ts.map +1 -0
- package/dist/config/validate-config.js +190 -0
- package/dist/index.d.ts +15 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +61 -47
- package/dist/libs/index.js +3 -0
- package/dist/libs/use-body-scroll-lock.d.ts +21 -0
- package/dist/libs/use-body-scroll-lock.d.ts.map +1 -0
- package/dist/libs/use-body-scroll-lock.js +27 -0
- package/dist/libs/use-dialog-overlay.d.ts +21 -0
- package/dist/libs/use-dialog-overlay.d.ts.map +1 -0
- package/dist/libs/use-dialog-overlay.js +21 -0
- package/dist/libs/use-prefers-reduced-motion.d.ts +23 -0
- package/dist/libs/use-prefers-reduced-motion.d.ts.map +1 -0
- package/dist/libs/use-prefers-reduced-motion.js +19 -0
- package/dist/scripts/AsheeThemeScript.js +43 -8
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/typography.d.ts +81 -0
- package/dist/shared/typography.d.ts.map +1 -0
- package/dist/shared/typography.js +137 -0
- package/dist/utils/stacking.d.ts +2 -2
- package/dist/utils/stacking.d.ts.map +1 -1
- package/package.json +13 -6
- package/dist/components/date-picker/Calendar.d.ts.map +0 -1
- package/dist/components/date-picker/Calendar.js +0 -143
- package/dist/components/date-picker/DatePicker.d.ts.map +0 -1
- package/dist/components/date-picker/TimeSpinner.d.ts.map +0 -1
- package/dist/components/date-picker/date-picker-config.d.ts.map +0 -1
- package/dist/components/date-picker/date-picker-styles.d.ts.map +0 -1
- package/dist/components/date-picker/date-picker.helpers.d.ts.map +0 -1
- package/dist/components/date-picker/index.d.ts +0 -3
- package/dist/components/date-picker/index.d.ts.map +0 -1
- package/dist/components/date-picker/index.js +0 -6
- package/dist/components/select/Select.js +0 -98
- package/dist/components/select/index.d.ts +0 -3
- package/dist/components/select/index.d.ts.map +0 -1
- package/dist/components/select/index.js +0 -3
- package/dist/components/select/select-config.d.ts.map +0 -1
- package/dist/components/select/select-styles.d.ts.map +0 -1
- package/dist/components/select-menu/SelectMenu.d.ts.map +0 -1
- package/dist/components/select-menu/SelectMenu.js +0 -104
- package/dist/components/select-menu/index.d.ts +0 -4
- package/dist/components/select-menu/index.d.ts.map +0 -1
- package/dist/components/select-menu/index.js +0 -3
- package/dist/components/select-menu/select-menu-config.d.ts.map +0 -1
- package/dist/components/select-menu/use-select-floating.d.ts.map +0 -1
- /package/dist/components/{date-picker → calendar}/TimeSpinner.d.ts +0 -0
|
@@ -1,144 +1,90 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { RadioVariant } from './radio-config';
|
|
1
|
+
import { ChangeEvent, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { RadioConfig } from './radio-config';
|
|
3
|
+
type BaseRadioProps = RadioConfig & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "onChange" | "children" | "color">;
|
|
5
4
|
/**
|
|
6
|
-
* Configuration options for the
|
|
5
|
+
* Configuration options for the Radio component.
|
|
7
6
|
*/
|
|
8
|
-
export interface
|
|
7
|
+
export interface RadioProps extends BaseRadioProps {
|
|
9
8
|
/**
|
|
10
|
-
*
|
|
9
|
+
* The value of the radio button.
|
|
10
|
+
* Used to identify which radio is selected in a group.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
value: string;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* Label text for the radio.
|
|
15
|
+
* Displayed next to the radio button.
|
|
16
16
|
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Controlled selected value.
|
|
20
|
-
*/
|
|
21
|
-
value?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Uncontrolled initial selected value.
|
|
24
|
-
*/
|
|
25
|
-
defaultValue?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Callback fired when the selection changes.
|
|
28
|
-
* Receives the new selected value.
|
|
29
|
-
*/
|
|
30
|
-
onChange?: (value: string) => void;
|
|
31
|
-
/**
|
|
32
|
-
* Size scale for all radios in the group.
|
|
33
|
-
* @default "md"
|
|
34
|
-
*/
|
|
35
|
-
size?: FieldSizeKey;
|
|
36
|
-
/**
|
|
37
|
-
* Theme accent color for all radios in the group.
|
|
38
|
-
* @default "primary"
|
|
39
|
-
*/
|
|
40
|
-
color?: Color;
|
|
41
|
-
/**
|
|
42
|
-
* Visual style variant for all radios in the group.
|
|
43
|
-
* @default "default"
|
|
44
|
-
*/
|
|
45
|
-
variant?: RadioVariant;
|
|
46
|
-
/**
|
|
47
|
-
* Layout orientation of the radio group.
|
|
48
|
-
* - `horizontal`: Radios are laid out in a row.
|
|
49
|
-
* - `vertical`: Radios are laid out in a column.
|
|
50
|
-
* @default "vertical"
|
|
51
|
-
*/
|
|
52
|
-
orientation?: "horizontal" | "vertical";
|
|
53
|
-
/**
|
|
54
|
-
* Validation status for the group.
|
|
55
|
-
* @default "default"
|
|
56
|
-
*/
|
|
57
|
-
status?: FieldStatus;
|
|
58
|
-
/**
|
|
59
|
-
* Label text for the group.
|
|
60
|
-
*/
|
|
61
|
-
label?: string;
|
|
62
|
-
/**
|
|
63
|
-
* Alignment of the label relative to the group.
|
|
64
|
-
* @default "left"
|
|
65
|
-
*/
|
|
66
|
-
labelAlign?: LabelAlign;
|
|
17
|
+
label?: ReactNode;
|
|
67
18
|
/**
|
|
68
19
|
* Description text shown below the label.
|
|
20
|
+
* Provides additional context for the option.
|
|
69
21
|
*/
|
|
70
|
-
description?:
|
|
71
|
-
/**
|
|
72
|
-
* Validation message shown below the group.
|
|
73
|
-
*/
|
|
74
|
-
message?: string;
|
|
22
|
+
description?: ReactNode;
|
|
75
23
|
/**
|
|
76
|
-
* Whether the
|
|
77
|
-
*
|
|
24
|
+
* Whether the radio is checked.
|
|
25
|
+
* For controlled usage.
|
|
78
26
|
*/
|
|
79
|
-
|
|
27
|
+
checked?: boolean;
|
|
80
28
|
/**
|
|
81
|
-
* Whether
|
|
29
|
+
* Whether the radio is initially checked.
|
|
30
|
+
* For uncontrolled usage.
|
|
82
31
|
* @default false
|
|
83
32
|
*/
|
|
84
|
-
|
|
33
|
+
defaultChecked?: boolean;
|
|
85
34
|
/**
|
|
86
|
-
*
|
|
35
|
+
* Callback fired when the radio state changes.
|
|
36
|
+
* Receives the checked state, value, and the change event.
|
|
87
37
|
*/
|
|
88
|
-
|
|
38
|
+
onChange?: (checked: boolean, value: string, event: ChangeEvent<HTMLInputElement>) => void;
|
|
89
39
|
}
|
|
90
40
|
/**
|
|
91
|
-
* A
|
|
41
|
+
* A single radio button with label and description.
|
|
42
|
+
*
|
|
43
|
+
* Radio renders a circular radio button with an optional label and
|
|
44
|
+
* description. It supports controlled and uncontrolled usage, validation
|
|
45
|
+
* states, and the standard AsheeUI cascade for visual tokens. When used
|
|
46
|
+
* within a RadioGroup, it inherits shared props from the group context.
|
|
92
47
|
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* state. It also handles labeling, validation, and layout through the
|
|
96
|
-
* FieldShell component.
|
|
48
|
+
* The component automatically handles accessibility attributes including
|
|
49
|
+
* proper role, aria-checked, and focus management.
|
|
97
50
|
*
|
|
98
|
-
* @param props -
|
|
99
|
-
* @param props.
|
|
100
|
-
* @param props.
|
|
101
|
-
* @param props.
|
|
102
|
-
* @param props.
|
|
103
|
-
* @param props.
|
|
104
|
-
* @param props.
|
|
51
|
+
* @param props - Radio configuration options.
|
|
52
|
+
* @param props.value - The value of the radio button.
|
|
53
|
+
* @param props.label - Label text for the radio.
|
|
54
|
+
* @param props.description - Description text shown below the label.
|
|
55
|
+
* @param props.checked - Whether the radio is checked (controlled).
|
|
56
|
+
* @param props.defaultChecked - Whether the radio is initially checked (uncontrolled).
|
|
57
|
+
* @param props.onChange - Callback fired when the radio state changes.
|
|
58
|
+
* @param props.size - Size scale. Defaults to "md".
|
|
105
59
|
* @param props.color - Theme accent color. Defaults to "primary".
|
|
106
60
|
* @param props.variant - Visual style variant. Defaults to "default".
|
|
107
|
-
* @param props.
|
|
108
|
-
* @param props.status - Validation status.
|
|
109
|
-
* @param props.
|
|
110
|
-
* @param props.labelAlign - Alignment of the label. Defaults to "left".
|
|
111
|
-
* @param props.description - Description text.
|
|
112
|
-
* @param props.message - Validation message.
|
|
113
|
-
* @param props.required - Whether the field is required.
|
|
114
|
-
* @param props.disabled - Whether all radios are disabled.
|
|
115
|
-
* @param props.className - Extra CSS classes.
|
|
61
|
+
* @param props.radius - Corner rounding. Defaults to "full".
|
|
62
|
+
* @param props.status - Validation status.
|
|
63
|
+
* @param props.disabled - Whether the radio is disabled.
|
|
116
64
|
*
|
|
117
65
|
* @example
|
|
118
66
|
* ```tsx
|
|
119
|
-
* import { Radio
|
|
67
|
+
* import { Radio } from "asheeui";
|
|
120
68
|
* import { useState } from "react";
|
|
121
69
|
*
|
|
122
70
|
* export function Example() {
|
|
123
|
-
* const [
|
|
71
|
+
* const [checked, setChecked] = useState(false);
|
|
124
72
|
*
|
|
125
73
|
* return (
|
|
126
|
-
* <
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* <Radio value="option-2" label="Option 2" />
|
|
134
|
-
* <Radio value="option-3" label="Option 3" disabled />
|
|
135
|
-
* </RadioGroup>
|
|
74
|
+
* <Radio
|
|
75
|
+
* value="option-1"
|
|
76
|
+
* label="Option 1"
|
|
77
|
+
* description="This is the first option"
|
|
78
|
+
* checked={checked}
|
|
79
|
+
* onChange={(checked) => setChecked(checked)}
|
|
80
|
+
* />
|
|
136
81
|
* );
|
|
137
82
|
* }
|
|
138
83
|
* ```
|
|
139
84
|
*
|
|
140
|
-
* @see
|
|
85
|
+
* @see RadioGroup - The parent component that manages radio groups.
|
|
141
86
|
* @see RadioConfig - The configuration type for component defaults.
|
|
142
87
|
*/
|
|
143
|
-
export declare const
|
|
88
|
+
export declare const Radio: import('react').ForwardRefExoticComponent<RadioProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
89
|
+
export {};
|
|
144
90
|
//# sourceMappingURL=Radio.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../src/components/radio/Radio.tsx"],"names":[],"mappings":"AAQA,OAAO,
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../src/components/radio/Radio.tsx"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAWf,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,gBAAgB,CAAC;AAaxB,KAAK,cAAc,GAAG,WAAW,GAC/B,IAAI,CACF,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAC3C,CAAC;AAEJ;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CACT,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KACjC,IAAI,CAAC;CACX;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,eAAO,MAAM,KAAK,yGAoNjB,CAAC"}
|
|
@@ -1,44 +1,58 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
3
|
import { cn as e } from "../../utils/cn.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { FALLBACK_RADIO_CONFIG as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
4
|
+
import { RADIUS_CLASS as t } from "../../shared/radius.js";
|
|
5
|
+
import { useAsheeConfig as n } from "../../libs/context.js";
|
|
6
|
+
import { resolveCascade as r, resolveClassKey as i, resolveRadiusKey as ee } from "../../utils/resolve-token.js";
|
|
7
|
+
import { FALLBACK_RADIO_CONFIG as a } from "./radio-config.js";
|
|
8
|
+
import { useRadioGroupContext as o } from "./radio-context.js";
|
|
9
|
+
import { RADIO_COLOR_CLASS as s, RADIO_FONT_SIZE_CLASS as c, RADIO_GAP_CLASS as l, RADIO_INNER_SIZE_CLASS as te, RADIO_OUTER_SIZE_CLASS as ne, RADIO_STATUS_BORDER_CLASS as u } from "./radio-styles.js";
|
|
10
|
+
import { forwardRef as d, useCallback as f, useId as p, useState as m } from "react";
|
|
11
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
11
12
|
//#region src/components/radio/Radio.tsx
|
|
12
|
-
var
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
13
|
+
var _ = d(({ value: d, size: _, color: v, radius: y, variant: b, status: re, label: x, description: S, id: C, name: w, className: T, style: E, disabled: D, checked: O, defaultChecked: k = !1, onChange: A, ...j }, M) => {
|
|
14
|
+
let N = n(), P = o(), F = N.components?.radio, I = p(), L = C ?? I, R = w ?? P?.name, z = D ?? P?.disabled ?? !1, [B, V] = m(k), H = P ? P.value === d : O ?? B, U = r(_ ?? P?.size, F?.size, void 0, a.size), W = r(b ?? P?.variant, F?.variant, void 0, a.variant), G = r(v ?? P?.color, F?.color, N.defaultColor, a.color), K = re ?? P?.status ?? a.status, q = W === "card", J = ee(y, F?.radius, void 0, a.radius), Y = q && J === "full" ? "xl" : J, X = i(U, ne, a.size), ie = i(U, te, a.size), ae = i(U, c, a.size), oe = i(U, l, a.size), Z = i(J, t, a.radius), se = i(Y, t, "xl"), Q = s[G] ?? s.primary, $ = u[K] ?? u.default, ce = f((e) => {
|
|
15
|
+
z || (P ? P.onChange?.(d) : O === void 0 && V(!0), A?.(e.target.checked, d, e));
|
|
16
|
+
}, [
|
|
17
|
+
O,
|
|
18
|
+
P,
|
|
19
|
+
z,
|
|
20
|
+
A,
|
|
21
|
+
d
|
|
22
|
+
]);
|
|
23
|
+
return /* @__PURE__ */ g("label", {
|
|
24
|
+
className: e("relative inline-flex items-start select-none cursor-pointer transition-all duration-150 shrink-0", oe, q ? e("p-3 border bg-background", se) : "", q && (H ? `${Q.border} ${Q.cardBg}` : $), z && "opacity-50 pointer-events-none cursor-not-allowed", T),
|
|
25
|
+
style: E,
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ h("input", {
|
|
28
|
+
ref: M,
|
|
29
|
+
id: L,
|
|
30
|
+
type: "radio",
|
|
31
|
+
name: R,
|
|
32
|
+
value: d,
|
|
33
|
+
checked: H,
|
|
34
|
+
disabled: z,
|
|
35
|
+
onChange: ce,
|
|
36
|
+
className: "sr-only peer",
|
|
37
|
+
...j
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ h("div", {
|
|
40
|
+
className: e("shrink-0 flex items-center justify-center border-2 transition-all duration-150 mt-0.5", "peer-focus-visible:ring-2 peer-focus-visible:ring-primary peer-focus-visible:ring-offset-2", X, Z, H ? Q.border : $),
|
|
41
|
+
children: /* @__PURE__ */ h("span", { className: e(ie, Z, Q.bg, "transition-all duration-200 ease-in-out transform-gpu", H ? "scale-100 opacity-100" : "scale-0 opacity-0") })
|
|
42
|
+
}),
|
|
43
|
+
(x || S) && /* @__PURE__ */ g("div", {
|
|
44
|
+
className: "flex flex-col min-w-0",
|
|
45
|
+
children: [x && /* @__PURE__ */ h("span", {
|
|
46
|
+
className: e("font-medium text-foreground leading-snug", ae),
|
|
47
|
+
children: x
|
|
48
|
+
}), S && /* @__PURE__ */ h("span", {
|
|
49
|
+
className: "text-xs sm:text-sm text-foreground/70 leading-snug mt-0.5",
|
|
50
|
+
children: S
|
|
51
|
+
})]
|
|
38
52
|
})
|
|
39
|
-
|
|
53
|
+
]
|
|
40
54
|
});
|
|
41
55
|
});
|
|
42
|
-
|
|
56
|
+
_.displayName = "Radio";
|
|
43
57
|
//#endregion
|
|
44
|
-
export {
|
|
58
|
+
export { _ as Radio };
|
|
@@ -1,90 +1,144 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Color } from '../../shared';
|
|
3
|
+
import { FieldSizeKey, FieldStatus, LabelAlign } from '../field/field-config';
|
|
4
|
+
import { RadioVariant } from './radio-config';
|
|
4
5
|
/**
|
|
5
|
-
* Configuration options for the
|
|
6
|
+
* Configuration options for the RadioGroup component.
|
|
6
7
|
*/
|
|
7
|
-
export interface
|
|
8
|
+
export interface RadioGroupProps {
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
-
* Used to identify which radio is selected in a group.
|
|
10
|
+
* Radio components to render inside the group.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
children: ReactNode;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* Name attribute for all radio inputs in the group.
|
|
15
|
+
* Auto-generated if not provided.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
name?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Controlled selected value.
|
|
20
|
+
*/
|
|
21
|
+
value?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Uncontrolled initial selected value.
|
|
24
|
+
*/
|
|
25
|
+
defaultValue?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Callback fired when the selection changes.
|
|
28
|
+
* Receives the new selected value.
|
|
29
|
+
*/
|
|
30
|
+
onChange?: (value: string) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Size scale for all radios in the group.
|
|
33
|
+
* @default "md"
|
|
34
|
+
*/
|
|
35
|
+
size?: FieldSizeKey;
|
|
36
|
+
/**
|
|
37
|
+
* Theme accent color for all radios in the group.
|
|
38
|
+
* @default "primary"
|
|
39
|
+
*/
|
|
40
|
+
color?: Color;
|
|
41
|
+
/**
|
|
42
|
+
* Visual style variant for all radios in the group.
|
|
43
|
+
* @default "default"
|
|
44
|
+
*/
|
|
45
|
+
variant?: RadioVariant;
|
|
46
|
+
/**
|
|
47
|
+
* Layout orientation of the radio group.
|
|
48
|
+
* - `horizontal`: Radios are laid out in a row.
|
|
49
|
+
* - `vertical`: Radios are laid out in a column.
|
|
50
|
+
* @default "vertical"
|
|
51
|
+
*/
|
|
52
|
+
orientation?: "horizontal" | "vertical";
|
|
53
|
+
/**
|
|
54
|
+
* Validation status for the group.
|
|
55
|
+
* @default "default"
|
|
56
|
+
*/
|
|
57
|
+
status?: FieldStatus;
|
|
58
|
+
/**
|
|
59
|
+
* Label text for the group.
|
|
60
|
+
*/
|
|
61
|
+
label?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Alignment of the label relative to the group.
|
|
64
|
+
* @default "left"
|
|
65
|
+
*/
|
|
66
|
+
labelAlign?: LabelAlign;
|
|
18
67
|
/**
|
|
19
68
|
* Description text shown below the label.
|
|
20
|
-
* Provides additional context for the option.
|
|
21
69
|
*/
|
|
22
|
-
description?:
|
|
70
|
+
description?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Validation message shown below the group.
|
|
73
|
+
*/
|
|
74
|
+
message?: string;
|
|
23
75
|
/**
|
|
24
|
-
* Whether the
|
|
25
|
-
*
|
|
76
|
+
* Whether the field is required.
|
|
77
|
+
* @default false
|
|
26
78
|
*/
|
|
27
|
-
|
|
79
|
+
required?: boolean;
|
|
28
80
|
/**
|
|
29
|
-
* Whether the
|
|
30
|
-
* For uncontrolled usage.
|
|
81
|
+
* Whether all radios in the group are disabled.
|
|
31
82
|
* @default false
|
|
32
83
|
*/
|
|
33
|
-
|
|
84
|
+
disabled?: boolean;
|
|
34
85
|
/**
|
|
35
|
-
*
|
|
36
|
-
* Receives the checked state, value, and the change event.
|
|
86
|
+
* Extra CSS classes for the group container.
|
|
37
87
|
*/
|
|
38
|
-
|
|
88
|
+
className?: string;
|
|
39
89
|
}
|
|
40
90
|
/**
|
|
41
|
-
* A
|
|
42
|
-
*
|
|
43
|
-
* Radio renders a circular radio button with an optional label and
|
|
44
|
-
* description. It supports controlled and uncontrolled usage, validation
|
|
45
|
-
* states, and the standard AsheeUI cascade for visual tokens. When used
|
|
46
|
-
* within a RadioGroup, it inherits shared props from the group context.
|
|
91
|
+
* A group of radio buttons that manages shared state and layout.
|
|
47
92
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
93
|
+
* RadioGroup wraps multiple Radio components and provides a consistent
|
|
94
|
+
* context for shared props like name, value, size, color, and disabled
|
|
95
|
+
* state. It also handles labeling, validation, and layout through the
|
|
96
|
+
* FieldShell component.
|
|
50
97
|
*
|
|
51
|
-
* @param props -
|
|
52
|
-
* @param props.
|
|
53
|
-
* @param props.
|
|
54
|
-
* @param props.
|
|
55
|
-
* @param props.
|
|
56
|
-
* @param props.
|
|
57
|
-
* @param props.
|
|
58
|
-
* @param props.size - Size scale. Defaults to "md".
|
|
98
|
+
* @param props - RadioGroup configuration options.
|
|
99
|
+
* @param props.children - Radio components to render.
|
|
100
|
+
* @param props.name - Name attribute for all radios.
|
|
101
|
+
* @param props.value - Controlled selected value.
|
|
102
|
+
* @param props.defaultValue - Uncontrolled initial selected value.
|
|
103
|
+
* @param props.onChange - Callback fired when selection changes.
|
|
104
|
+
* @param props.size - Size scale for all radios. Defaults to "md".
|
|
59
105
|
* @param props.color - Theme accent color. Defaults to "primary".
|
|
60
106
|
* @param props.variant - Visual style variant. Defaults to "default".
|
|
61
|
-
* @param props.
|
|
62
|
-
* @param props.status - Validation status.
|
|
63
|
-
* @param props.
|
|
107
|
+
* @param props.orientation - Layout orientation. Defaults to "vertical".
|
|
108
|
+
* @param props.status - Validation status. Defaults to "default".
|
|
109
|
+
* @param props.label - Label text for the group.
|
|
110
|
+
* @param props.labelAlign - Alignment of the label. Defaults to "left".
|
|
111
|
+
* @param props.description - Description text.
|
|
112
|
+
* @param props.message - Validation message.
|
|
113
|
+
* @param props.required - Whether the field is required.
|
|
114
|
+
* @param props.disabled - Whether all radios are disabled.
|
|
115
|
+
* @param props.className - Extra CSS classes.
|
|
64
116
|
*
|
|
65
117
|
* @example
|
|
66
118
|
* ```tsx
|
|
67
|
-
* import { Radio } from "asheeui";
|
|
119
|
+
* import { Radio, RadioGroup } from "asheeui";
|
|
68
120
|
* import { useState } from "react";
|
|
69
121
|
*
|
|
70
122
|
* export function Example() {
|
|
71
|
-
* const [
|
|
123
|
+
* const [value, setValue] = useState("option-1");
|
|
72
124
|
*
|
|
73
125
|
* return (
|
|
74
|
-
* <
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
126
|
+
* <RadioGroup
|
|
127
|
+
* label="Choose an option"
|
|
128
|
+
* value={value}
|
|
129
|
+
* onChange={setValue}
|
|
130
|
+
* orientation="horizontal"
|
|
131
|
+
* >
|
|
132
|
+
* <Radio value="option-1" label="Option 1" />
|
|
133
|
+
* <Radio value="option-2" label="Option 2" />
|
|
134
|
+
* <Radio value="option-3" label="Option 3" disabled />
|
|
135
|
+
* </RadioGroup>
|
|
81
136
|
* );
|
|
82
137
|
* }
|
|
83
138
|
* ```
|
|
84
139
|
*
|
|
85
|
-
* @see
|
|
140
|
+
* @see Radio - The individual radio component.
|
|
86
141
|
* @see RadioConfig - The configuration type for component defaults.
|
|
87
142
|
*/
|
|
88
|
-
export declare const
|
|
89
|
-
export {};
|
|
143
|
+
export declare const RadioGroup: import('react').ForwardRefExoticComponent<RadioGroupProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
90
144
|
//# sourceMappingURL=RadioGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/components/radio/RadioGroup.tsx"],"names":[],"mappings":"AAQA,OAAO,
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/components/radio/RadioGroup.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAc,KAAK,SAAS,EAAgC,MAAM,OAAO,CAAC;AAEjF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AAKxB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAEnC;;;OAGG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IAExC;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,eAAO,MAAM,UAAU,4GAuGtB,CAAC"}
|
|
@@ -2,57 +2,51 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { cn as e } from "../../utils/cn.js";
|
|
4
4
|
import { useAsheeConfig as t } from "../../libs/context.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { FALLBACK_RADIO_CONFIG as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
5
|
+
import { resolveCascade as n } from "../../utils/resolve-token.js";
|
|
6
|
+
import { FieldShell as r } from "../field/FieldShell.js";
|
|
7
|
+
import { FALLBACK_RADIO_CONFIG as i } from "./radio-config.js";
|
|
8
|
+
import { RadioContext as a } from "./radio-context.js";
|
|
9
|
+
import { forwardRef as o, useCallback as s, useId as c, useState as l } from "react";
|
|
10
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
12
11
|
//#region src/components/radio/RadioGroup.tsx
|
|
13
|
-
var
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
}, [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
name:
|
|
32
|
-
value:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
children: S
|
|
48
|
-
}), C && /* @__PURE__ */ h("span", {
|
|
49
|
-
className: "text-xs sm:text-sm text-foreground/70 leading-snug mt-0.5",
|
|
50
|
-
children: C
|
|
51
|
-
})]
|
|
12
|
+
var d = o(({ children: o, name: d, value: f, defaultValue: p, onChange: m, size: h, color: g, variant: _, orientation: v = "vertical", status: y, label: b, labelAlign: x, description: S, message: C, required: w, disabled: T, className: E }, D) => {
|
|
13
|
+
let O = t().components?.radio, k = c(), A = d ?? k, [j, M] = l(p), N = f !== void 0, P = N ? f : j, F = s((e) => {
|
|
14
|
+
N || M(e), m?.(e);
|
|
15
|
+
}, [N, m]), I = b ? `${k}-label` : void 0, L = S ? `${k}-description` : void 0, R = C ? `${k}-message` : void 0, z = [L, R].filter(Boolean).join(" ") || void 0, B = y ?? i.status, V = n(x, O?.labelAlign, void 0, i.labelAlign);
|
|
16
|
+
return /* @__PURE__ */ u(r, {
|
|
17
|
+
id: k,
|
|
18
|
+
htmlFor: null,
|
|
19
|
+
labelId: I,
|
|
20
|
+
label: b,
|
|
21
|
+
labelAlign: V,
|
|
22
|
+
description: S,
|
|
23
|
+
descriptionId: L,
|
|
24
|
+
message: C,
|
|
25
|
+
messageId: R,
|
|
26
|
+
status: B,
|
|
27
|
+
required: w,
|
|
28
|
+
children: /* @__PURE__ */ u(a.Provider, {
|
|
29
|
+
value: {
|
|
30
|
+
name: A,
|
|
31
|
+
value: P,
|
|
32
|
+
onChange: F,
|
|
33
|
+
size: h,
|
|
34
|
+
color: g,
|
|
35
|
+
variant: _,
|
|
36
|
+
disabled: T,
|
|
37
|
+
status: B
|
|
38
|
+
},
|
|
39
|
+
children: /* @__PURE__ */ u("div", {
|
|
40
|
+
ref: D,
|
|
41
|
+
role: "radiogroup",
|
|
42
|
+
"aria-labelledby": I,
|
|
43
|
+
"aria-describedby": z,
|
|
44
|
+
className: e("flex", v === "vertical" ? "flex-col gap-2" : "flex-row flex-wrap gap-4", E),
|
|
45
|
+
children: o
|
|
52
46
|
})
|
|
53
|
-
|
|
47
|
+
})
|
|
54
48
|
});
|
|
55
49
|
});
|
|
56
|
-
|
|
50
|
+
d.displayName = "RadioGroup";
|
|
57
51
|
//#endregion
|
|
58
|
-
export {
|
|
52
|
+
export { d as RadioGroup };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/radio/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/radio/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|