@vtx-ui/react 0.0.1-beta.1 → 0.0.1-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/types/components/AdminHeader/AdminHeader.d.ts +179 -0
- package/dist/types/components/AdminHeader/AdminHeader.examples.d.ts +44 -0
- package/dist/types/components/AdminHeader/AdminHeader.stories.d.ts +53 -0
- package/dist/types/components/AdminHeader/AdminHeader.widgets.stories.d.ts +86 -0
- package/dist/types/components/AdminHeader/index.d.ts +2 -0
- package/dist/types/components/Alert/Alert.d.ts +7 -54
- package/dist/types/components/Avatar/Avatar.d.ts +5 -2
- package/dist/types/components/Badge/Badge.d.ts +8 -34
- package/dist/types/components/Button/Button.d.ts +7 -43
- package/dist/types/components/Card/Card.d.ts +7 -64
- package/dist/types/components/Checkbox/Checkbox.d.ts +5 -59
- package/dist/types/components/CheckboxGroup/CheckboxGroup.d.ts +5 -53
- package/dist/types/components/Chip/Chip.d.ts +7 -33
- package/dist/types/components/DataGrid/DataGrid.d.ts +97 -0
- package/dist/types/components/DataGrid/index.d.ts +2 -0
- package/dist/types/components/Divider/Divider.d.ts +5 -72
- package/dist/types/components/Flex/Flex.d.ts +5 -26
- package/dist/types/components/Grid/Grid.d.ts +5 -77
- package/dist/types/components/Header/Header.d.ts +5 -33
- package/dist/types/components/Input/Input.d.ts +8 -54
- package/dist/types/components/Menu/Menu.d.ts +5 -32
- package/dist/types/components/Modal/Modal.d.ts +7 -73
- package/dist/types/components/MultiSelect/MultiSelect.d.ts +5 -41
- package/dist/types/components/Radio/Radio.d.ts +8 -57
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +8 -59
- package/dist/types/components/Select/Select.d.ts +8 -60
- package/dist/types/components/SideMenu/SideMenu.d.ts +15 -34
- package/dist/types/components/SideMenu/SideMenu.examples.d.ts +18 -0
- package/dist/types/components/SideMenu/index.d.ts +1 -3
- package/dist/types/components/Table/Table.d.ts +108 -60
- package/dist/types/components/Text/Text.d.ts +5 -51
- package/dist/types/components/Timeline/Timeline.d.ts +34 -0
- package/dist/types/components/Timeline/index.d.ts +2 -0
- package/dist/types/components/Toast/Toast.d.ts +5 -51
- package/dist/types/hoc/withParsedClasses.d.ts +7 -0
- package/dist/types/hooks/useTheme.d.ts +1 -244
- package/dist/types/icons/IconComponents.d.ts +55 -0
- package/dist/types/icons/index.d.ts +1 -0
- package/dist/types/index.d.ts +28 -5
- package/dist/types/stories/components/Accordion.stories.d.ts +11 -0
- package/dist/types/stories/components/Alert.stories.d.ts +9 -0
- package/dist/types/stories/components/Avatar.stories.d.ts +13 -0
- package/dist/types/stories/components/Badge.stories.d.ts +8 -0
- package/dist/types/stories/components/Button.stories.d.ts +9 -0
- package/dist/types/stories/components/Card.stories.d.ts +8 -0
- package/dist/types/stories/components/Checkbox.stories.d.ts +17 -0
- package/dist/types/stories/components/CheckboxGroup.stories.d.ts +13 -0
- package/dist/types/stories/components/Chip.stories.d.ts +22 -0
- package/dist/types/stories/components/DataGrid.stories.d.ts +20 -0
- package/dist/types/stories/components/Divider.stories.d.ts +15 -0
- package/dist/types/stories/components/Flex.stories.d.ts +14 -0
- package/dist/types/stories/components/Grid.stories.d.ts +11 -0
- package/dist/types/stories/components/Header.stories.d.ts +14 -0
- package/dist/types/stories/components/Input.stories.d.ts +9 -0
- package/dist/types/stories/components/Menu.stories.d.ts +13 -0
- package/dist/types/stories/components/Modal.stories.d.ts +12 -0
- package/dist/types/stories/components/MultiSelect.stories.d.ts +19 -0
- package/dist/types/stories/components/Radio.stories.d.ts +16 -0
- package/dist/types/stories/components/RadioGroup.stories.d.ts +15 -0
- package/dist/types/stories/components/Select.stories.d.ts +17 -0
- package/dist/types/stories/components/SideMenu.stories.d.ts +62 -0
- package/dist/types/stories/components/Table.stories.d.ts +25 -0
- package/dist/types/stories/components/Text.stories.d.ts +18 -0
- package/dist/types/stories/components/Timeline.stories.d.ts +20 -0
- package/dist/types/stories/components/Toast.stories.d.ts +17 -0
- package/dist/types/stories/components/Tooltip.stories.d.ts +20 -0
- package/dist/types/stories/widgets/InfoCard.stories.d.ts +12 -0
- package/dist/types/stories/widgets/InfoListCard.stories.d.ts +19 -0
- package/dist/types/stories/widgets/InfoText.stories.d.ts +30 -0
- package/dist/types/stories/widgets/OrderCard.stories.d.ts +13 -0
- package/dist/types/stories/widgets/OrderConfirmation.stories.d.ts +36 -0
- package/dist/types/stories/widgets/OrderDetails.stories.d.ts +11 -0
- package/dist/types/stories/widgets/ProductCard.stories.d.ts +25 -0
- package/dist/types/theme/ThemeProvider.d.ts +2 -2
- package/dist/types/theme/cssVariables.d.ts +5 -2
- package/dist/types/theme/index.d.ts +3 -3
- package/dist/types/theme/tokens.d.ts +271 -216
- package/dist/types/utils/parseClass.d.ts +1 -0
- package/dist/types/widgets/Header/Header.d.ts +252 -0
- package/dist/types/widgets/Header/Header.stories.d.ts +30 -0
- package/dist/types/widgets/Header/index.d.ts +2 -0
- package/dist/types/widgets/InfoCard/InfoCard.d.ts +40 -0
- package/dist/types/widgets/InfoCard/index.d.ts +1 -0
- package/dist/types/widgets/InfoListCard/InfoListCard.d.ts +43 -0
- package/dist/types/widgets/InfoListCard/index.d.ts +2 -0
- package/dist/types/widgets/InfoText/InfoText.d.ts +144 -0
- package/dist/types/widgets/InfoText/InfoText.examples.d.ts +33 -0
- package/dist/types/widgets/InfoText/index.d.ts +1 -0
- package/dist/types/widgets/OrderCard/OrderCard.d.ts +71 -0
- package/dist/types/widgets/OrderCard/index.d.ts +2 -0
- package/dist/types/widgets/OrderConfirmation/OrderConfirmation.d.ts +85 -0
- package/dist/types/widgets/OrderConfirmation/index.d.ts +3 -0
- package/dist/types/widgets/OrderDetails/OrderDetails.d.ts +91 -0
- package/dist/types/widgets/OrderDetails/index.d.ts +3 -0
- package/dist/types/widgets/ProductCard/ProductCard.d.ts +42 -0
- package/dist/types/widgets/ProductCard/index.d.ts +1 -0
- package/package.json +113 -59
- package/dist/components/Accordion/Accordion.d.ts +0 -31
- package/dist/components/Accordion/Accordion.examples.d.ts +0 -3
- package/dist/components/Accordion/AccordionItem.d.ts +0 -5
- package/dist/components/Accordion/index.d.ts +0 -4
- package/dist/components/Accordion/types.d.ts +0 -98
- package/dist/components/Alert/Alert.d.ts +0 -119
- package/dist/components/Alert/index.d.ts +0 -3
- package/dist/components/Avatar/Avatar.d.ts +0 -63
- package/dist/components/Avatar/index.d.ts +0 -3
- package/dist/components/Badge/Badge.d.ts +0 -81
- package/dist/components/Badge/index.d.ts +0 -3
- package/dist/components/Button/Button.d.ts +0 -117
- package/dist/components/Button/index.d.ts +0 -3
- package/dist/components/Card/Card.d.ts +0 -120
- package/dist/components/Card/index.d.ts +0 -3
- package/dist/components/Checkbox/Checkbox.d.ts +0 -114
- package/dist/components/Checkbox/index.d.ts +0 -3
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +0 -121
- package/dist/components/CheckboxGroup/index.d.ts +0 -3
- package/dist/components/Chip/Chip.d.ts +0 -91
- package/dist/components/Chip/index.d.ts +0 -3
- package/dist/components/Divider/Divider.d.ts +0 -118
- package/dist/components/Divider/index.d.ts +0 -3
- package/dist/components/Flex/Flex.d.ts +0 -66
- package/dist/components/Flex/index.d.ts +0 -3
- package/dist/components/Grid/Grid.d.ts +0 -156
- package/dist/components/Grid/index.d.ts +0 -3
- package/dist/components/Header/Header.d.ts +0 -138
- package/dist/components/Header/index.d.ts +0 -3
- package/dist/components/Input/Input.d.ts +0 -129
- package/dist/components/Input/index.d.ts +0 -3
- package/dist/components/Menu/Menu.d.ts +0 -114
- package/dist/components/Menu/index.d.ts +0 -4
- package/dist/components/Modal/Modal.d.ts +0 -201
- package/dist/components/Modal/index.d.ts +0 -3
- package/dist/components/MultiSelect/MultiSelect.d.ts +0 -190
- package/dist/components/MultiSelect/index.d.ts +0 -3
- package/dist/components/Radio/Radio.d.ts +0 -105
- package/dist/components/Radio/index.d.ts +0 -3
- package/dist/components/RadioGroup/RadioGroup.d.ts +0 -134
- package/dist/components/RadioGroup/index.d.ts +0 -3
- package/dist/components/Select/Select.d.ts +0 -169
- package/dist/components/Select/index.d.ts +0 -3
- package/dist/components/SideMenu/SideMenu.d.ts +0 -118
- package/dist/components/SideMenu/index.d.ts +0 -4
- package/dist/components/Table/Table.d.ts +0 -211
- package/dist/components/Table/index.d.ts +0 -3
- package/dist/components/Text/Text.d.ts +0 -160
- package/dist/components/Text/index.d.ts +0 -3
- package/dist/components/Toast/Toast.d.ts +0 -56
- package/dist/components/Toast/ToastContainer.d.ts +0 -6
- package/dist/components/Toast/index.d.ts +0 -5
- package/dist/components/Toast/types.d.ts +0 -148
- package/dist/components/Toast/useToast.d.ts +0 -34
- package/dist/components/Tooltip/Tooltip.d.ts +0 -108
- package/dist/components/Tooltip/index.d.ts +0 -3
- package/dist/hooks/index.d.ts +0 -85
- package/dist/hooks/useTheme.d.ts +0 -268
- package/dist/index.d.ts +0 -55
- package/dist/theme/ThemeProvider.d.ts +0 -39
- package/dist/theme/cssVariables.d.ts +0 -9
- package/dist/theme/index.d.ts +0 -6
- package/dist/theme/tokens.d.ts +0 -258
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './Radio.css';
|
|
3
|
-
export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {
|
|
4
|
-
/**
|
|
5
|
-
* If true, the radio is checked
|
|
6
|
-
*/
|
|
7
|
-
checked?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* If true, the radio is disabled
|
|
10
|
-
* @default false
|
|
11
|
-
*/
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* The label for the radio
|
|
15
|
-
*/
|
|
16
|
-
label?: React.ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* The size of the radio
|
|
19
|
-
* @default 'medium'
|
|
20
|
-
*/
|
|
21
|
-
size?: 'small' | 'medium' | 'large';
|
|
22
|
-
/**
|
|
23
|
-
* The variant of the radio
|
|
24
|
-
* @default 'primary'
|
|
25
|
-
*/
|
|
26
|
-
variant?: 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info';
|
|
27
|
-
/**
|
|
28
|
-
* If true, displays error styling
|
|
29
|
-
* @default false
|
|
30
|
-
*/
|
|
31
|
-
error?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Helper text displayed below the radio
|
|
34
|
-
*/
|
|
35
|
-
helperText?: React.ReactNode;
|
|
36
|
-
/**
|
|
37
|
-
* Callback fired when the state is changed
|
|
38
|
-
*/
|
|
39
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
40
|
-
/**
|
|
41
|
-
* Additional CSS class name for the container
|
|
42
|
-
*/
|
|
43
|
-
className?: string;
|
|
44
|
-
/**
|
|
45
|
-
* Additional CSS class name for the input element
|
|
46
|
-
*/
|
|
47
|
-
inputClassName?: string;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Radio component - Allows users to select a single option from a set
|
|
51
|
-
*
|
|
52
|
-
* The Radio component provides a customizable radio input with support
|
|
53
|
-
* for labels, error states, variants, and three sizes.
|
|
54
|
-
*
|
|
55
|
-
* ## CSS Customization
|
|
56
|
-
*
|
|
57
|
-
* You can customize the radio appearance using CSS custom properties:
|
|
58
|
-
*
|
|
59
|
-
* ```css
|
|
60
|
-
* :root {
|
|
61
|
-
* --vtx-radio-color: #1976d2;
|
|
62
|
-
* --vtx-radio-size: 20px;
|
|
63
|
-
* --vtx-radio-border-width: 2px;
|
|
64
|
-
* }
|
|
65
|
-
* ```
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* Basic radio
|
|
69
|
-
* ```tsx
|
|
70
|
-
* <Radio label="Option 1" name="options" value="1" />
|
|
71
|
-
* ```
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* Controlled radio
|
|
75
|
-
* ```tsx
|
|
76
|
-
* const [selected, setSelected] = useState('1');
|
|
77
|
-
* <Radio
|
|
78
|
-
* checked={selected === '1'}
|
|
79
|
-
* onChange={(e) => setSelected(e.target.value)}
|
|
80
|
-
* label="Option 1"
|
|
81
|
-
* value="1"
|
|
82
|
-
* />
|
|
83
|
-
* ```
|
|
84
|
-
*
|
|
85
|
-
* @example
|
|
86
|
-
* With error state
|
|
87
|
-
* ```tsx
|
|
88
|
-
* <Radio
|
|
89
|
-
* label="Required option"
|
|
90
|
-
* error
|
|
91
|
-
* helperText="Please select an option"
|
|
92
|
-
* />
|
|
93
|
-
* ```
|
|
94
|
-
*
|
|
95
|
-
* @example
|
|
96
|
-
* Different variants
|
|
97
|
-
* ```tsx
|
|
98
|
-
* <Radio label="Primary" variant="primary" />
|
|
99
|
-
* <Radio label="Success" variant="success" />
|
|
100
|
-
* <Radio label="Error" variant="error" />
|
|
101
|
-
* ```
|
|
102
|
-
*/
|
|
103
|
-
export declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
|
|
104
|
-
declare const _default: React.FC<RadioProps & React.RefAttributes<HTMLInputElement>>;
|
|
105
|
-
export default _default;
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './RadioGroup.css';
|
|
3
|
-
export interface RadioOption {
|
|
4
|
-
/**
|
|
5
|
-
* The value of the radio
|
|
6
|
-
*/
|
|
7
|
-
value: string;
|
|
8
|
-
/**
|
|
9
|
-
* The label for the radio
|
|
10
|
-
*/
|
|
11
|
-
label: React.ReactNode;
|
|
12
|
-
/**
|
|
13
|
-
* If true, the radio is disabled
|
|
14
|
-
*/
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
18
|
-
/**
|
|
19
|
-
* The name for the radio group (all radios will share this name)
|
|
20
|
-
*/
|
|
21
|
-
name: string;
|
|
22
|
-
/**
|
|
23
|
-
* The label for the radio group
|
|
24
|
-
*/
|
|
25
|
-
label?: React.ReactNode;
|
|
26
|
-
/**
|
|
27
|
-
* Array of radio options
|
|
28
|
-
*/
|
|
29
|
-
options: RadioOption[];
|
|
30
|
-
/**
|
|
31
|
-
* The selected value
|
|
32
|
-
*/
|
|
33
|
-
value?: string;
|
|
34
|
-
/**
|
|
35
|
-
* Default selected value for uncontrolled mode
|
|
36
|
-
*/
|
|
37
|
-
defaultValue?: string;
|
|
38
|
-
/**
|
|
39
|
-
* Callback fired when the selection changes
|
|
40
|
-
*/
|
|
41
|
-
onChange?: (value: string) => void;
|
|
42
|
-
/**
|
|
43
|
-
* If true, all radios are disabled
|
|
44
|
-
* @default false
|
|
45
|
-
*/
|
|
46
|
-
disabled?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* If true, displays error styling
|
|
49
|
-
* @default false
|
|
50
|
-
*/
|
|
51
|
-
error?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Helper text displayed below the group
|
|
54
|
-
*/
|
|
55
|
-
helperText?: React.ReactNode;
|
|
56
|
-
/**
|
|
57
|
-
* The layout orientation of the radios
|
|
58
|
-
* @default 'vertical'
|
|
59
|
-
*/
|
|
60
|
-
orientation?: 'horizontal' | 'vertical';
|
|
61
|
-
/**
|
|
62
|
-
* The size of the radios
|
|
63
|
-
* @default 'medium'
|
|
64
|
-
*/
|
|
65
|
-
size?: 'small' | 'medium' | 'large';
|
|
66
|
-
/**
|
|
67
|
-
* The variant of the radios
|
|
68
|
-
* @default 'primary'
|
|
69
|
-
*/
|
|
70
|
-
variant?: 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info';
|
|
71
|
-
/**
|
|
72
|
-
* Additional CSS class name
|
|
73
|
-
*/
|
|
74
|
-
className?: string;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* RadioGroup component - Manages a group of related radio buttons
|
|
78
|
-
*
|
|
79
|
-
* The RadioGroup component provides a convenient way to manage multiple
|
|
80
|
-
* radio buttons with shared state, labels, and error handling.
|
|
81
|
-
*
|
|
82
|
-
* @example
|
|
83
|
-
* Basic usage
|
|
84
|
-
* ```tsx
|
|
85
|
-
* <RadioGroup
|
|
86
|
-
* name="plan"
|
|
87
|
-
* label="Select your plan"
|
|
88
|
-
* options={[
|
|
89
|
-
* { value: 'basic', label: 'Basic' },
|
|
90
|
-
* { value: 'pro', label: 'Pro' },
|
|
91
|
-
* { value: 'enterprise', label: 'Enterprise' },
|
|
92
|
-
* ]}
|
|
93
|
-
* />
|
|
94
|
-
* ```
|
|
95
|
-
*
|
|
96
|
-
* @example
|
|
97
|
-
* Controlled mode
|
|
98
|
-
* ```tsx
|
|
99
|
-
* const [selected, setSelected] = useState('basic');
|
|
100
|
-
* <RadioGroup
|
|
101
|
-
* name="plan"
|
|
102
|
-
* label="Plan"
|
|
103
|
-
* options={options}
|
|
104
|
-
* value={selected}
|
|
105
|
-
* onChange={setSelected}
|
|
106
|
-
* />
|
|
107
|
-
* ```
|
|
108
|
-
*
|
|
109
|
-
* @example
|
|
110
|
-
* Horizontal layout
|
|
111
|
-
* ```tsx
|
|
112
|
-
* <RadioGroup
|
|
113
|
-
* name="answer"
|
|
114
|
-
* label="Your answer"
|
|
115
|
-
* options={options}
|
|
116
|
-
* orientation="horizontal"
|
|
117
|
-
* />
|
|
118
|
-
* ```
|
|
119
|
-
*
|
|
120
|
-
* @example
|
|
121
|
-
* With error state
|
|
122
|
-
* ```tsx
|
|
123
|
-
* <RadioGroup
|
|
124
|
-
* name="required"
|
|
125
|
-
* label="Required selection"
|
|
126
|
-
* options={options}
|
|
127
|
-
* error
|
|
128
|
-
* helperText="Please select an option"
|
|
129
|
-
* />
|
|
130
|
-
* ```
|
|
131
|
-
*/
|
|
132
|
-
export declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
133
|
-
declare const _default: React.FC<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
134
|
-
export default _default;
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import React, { SelectHTMLAttributes } from 'react';
|
|
2
|
-
import './Select.css';
|
|
3
|
-
export interface SelectOption {
|
|
4
|
-
/**
|
|
5
|
-
* Value of the option
|
|
6
|
-
*/
|
|
7
|
-
value: string;
|
|
8
|
-
/**
|
|
9
|
-
* Display label for the option
|
|
10
|
-
*/
|
|
11
|
-
label: string;
|
|
12
|
-
/**
|
|
13
|
-
* If true, option cannot be selected
|
|
14
|
-
* @default false
|
|
15
|
-
*/
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Optional group this option belongs to
|
|
19
|
-
*/
|
|
20
|
-
group?: string;
|
|
21
|
-
}
|
|
22
|
-
export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
|
|
23
|
-
/**
|
|
24
|
-
* Label text displayed above the select
|
|
25
|
-
*/
|
|
26
|
-
label?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Helper text displayed below the select
|
|
29
|
-
* Provides additional context or instructions
|
|
30
|
-
*/
|
|
31
|
-
helperText?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Error message - when provided, select is shown in error state
|
|
34
|
-
*/
|
|
35
|
-
error?: string;
|
|
36
|
-
/**
|
|
37
|
-
* Success message - when provided, select is shown in success state
|
|
38
|
-
*/
|
|
39
|
-
success?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Size of the select
|
|
42
|
-
* @default 'medium'
|
|
43
|
-
*/
|
|
44
|
-
size?: 'small' | 'medium' | 'large';
|
|
45
|
-
/**
|
|
46
|
-
* If true, select will take full width of its container
|
|
47
|
-
* @default false
|
|
48
|
-
*/
|
|
49
|
-
fullWidth?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Options to display in the select dropdown
|
|
52
|
-
*/
|
|
53
|
-
options: SelectOption[];
|
|
54
|
-
/**
|
|
55
|
-
* Placeholder text shown when no option is selected
|
|
56
|
-
*/
|
|
57
|
-
placeholder?: string;
|
|
58
|
-
/**
|
|
59
|
-
* Custom class name for the wrapper element
|
|
60
|
-
*/
|
|
61
|
-
wrapperClassName?: string;
|
|
62
|
-
/**
|
|
63
|
-
* If true, groups options by their group property
|
|
64
|
-
* @default false
|
|
65
|
-
*/
|
|
66
|
-
grouped?: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Property name or function to extract the display label from each option
|
|
69
|
-
* @default 'label'
|
|
70
|
-
* @example
|
|
71
|
-
* getOptionLabel="productName" // uses option.productName
|
|
72
|
-
* getOptionLabel={(option) => option.firstName + ' ' + option.lastName}
|
|
73
|
-
*/
|
|
74
|
-
getOptionLabel?: string | ((option: any) => string);
|
|
75
|
-
/**
|
|
76
|
-
* Property name or function to extract the value from each option
|
|
77
|
-
* @default 'value'
|
|
78
|
-
* @example
|
|
79
|
-
* getOptionValue="id" // uses option.id
|
|
80
|
-
* getOptionValue={(option) => option.uuid}
|
|
81
|
-
*/
|
|
82
|
-
getOptionValue?: string | ((option: any) => string | number);
|
|
83
|
-
/**
|
|
84
|
-
* Property name or function to determine if an option is disabled
|
|
85
|
-
* @default 'disabled'
|
|
86
|
-
* @example
|
|
87
|
-
* getOptionDisabled="isInactive" // uses option.isInactive
|
|
88
|
-
* getOptionDisabled={(option) => option.stock === 0}
|
|
89
|
-
*/
|
|
90
|
-
getOptionDisabled?: string | ((option: any) => boolean);
|
|
91
|
-
/**
|
|
92
|
-
* Property name or function to extract the group from each option
|
|
93
|
-
* @default 'group'
|
|
94
|
-
* @example
|
|
95
|
-
* getOptionGroup="category" // uses option.category
|
|
96
|
-
* getOptionGroup={(option) => option.department}
|
|
97
|
-
*/
|
|
98
|
-
getOptionGroup?: string | ((option: any) => string);
|
|
99
|
-
/**
|
|
100
|
-
* Callback fired when selection changes
|
|
101
|
-
* Provides both event and selected option
|
|
102
|
-
*/
|
|
103
|
-
onSelectChange?: (value: string, option: SelectOption | undefined) => void;
|
|
104
|
-
/**
|
|
105
|
-
* If true, shows a loading spinner in place of the dropdown icon
|
|
106
|
-
* @default false
|
|
107
|
-
*/
|
|
108
|
-
loading?: boolean;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Select component - Dropdown selection control with label, validation states, and grouping support
|
|
112
|
-
*
|
|
113
|
-
* A comprehensive select component with support for grouped options, validation states,
|
|
114
|
-
* and enhanced accessibility features.
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* Basic usage
|
|
118
|
-
* ```tsx
|
|
119
|
-
* <Select
|
|
120
|
-
* label="Country"
|
|
121
|
-
* placeholder="Select a country"
|
|
122
|
-
* options={[
|
|
123
|
-
* { value: 'us', label: 'United States' },
|
|
124
|
-
* { value: 'uk', label: 'United Kingdom' },
|
|
125
|
-
* ]}
|
|
126
|
-
* />
|
|
127
|
-
* ```
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* With grouped options
|
|
131
|
-
* ```tsx
|
|
132
|
-
* <Select
|
|
133
|
-
* label="Framework"
|
|
134
|
-
* grouped
|
|
135
|
-
* options={[
|
|
136
|
-
* { value: 'react', label: 'React', group: 'Frontend' },
|
|
137
|
-
* { value: 'vue', label: 'Vue', group: 'Frontend' },
|
|
138
|
-
* { value: 'node', label: 'Node.js', group: 'Backend' },
|
|
139
|
-
* { value: 'django', label: 'Django', group: 'Backend' },
|
|
140
|
-
* ]}
|
|
141
|
-
* />
|
|
142
|
-
* ```
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* With change callback
|
|
146
|
-
* ```tsx
|
|
147
|
-
* <Select
|
|
148
|
-
* label="Status"
|
|
149
|
-
* options={statusOptions}
|
|
150
|
-
* onSelectChange={(value, option) => {
|
|
151
|
-
* console.log('Selected:', value, option);
|
|
152
|
-
* }}
|
|
153
|
-
* />
|
|
154
|
-
* ```
|
|
155
|
-
*
|
|
156
|
-
* @example
|
|
157
|
-
* Customize loading spinner via CSS
|
|
158
|
-
* ```css
|
|
159
|
-
* .vtx-select-icon-spinner {
|
|
160
|
-
* --vtx-select-loader-color: #10b981;
|
|
161
|
-
* --vtx-select-loader-speed: 1.2s;
|
|
162
|
-
* --vtx-select-loader-track-opacity: 0.15;
|
|
163
|
-
* --vtx-select-loader-path-opacity: 0.85;
|
|
164
|
-
* }
|
|
165
|
-
* ```
|
|
166
|
-
*/
|
|
167
|
-
export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
168
|
-
declare const _default: React.FC<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
169
|
-
export default _default;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './SideMenu.css';
|
|
3
|
-
export interface SideMenuItemProps {
|
|
4
|
-
/**
|
|
5
|
-
* Menu item label
|
|
6
|
-
*/
|
|
7
|
-
label: string;
|
|
8
|
-
/**
|
|
9
|
-
* Click handler
|
|
10
|
-
*/
|
|
11
|
-
onClick?: () => void;
|
|
12
|
-
/**
|
|
13
|
-
* Icon to display before label
|
|
14
|
-
*/
|
|
15
|
-
icon?: React.ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* Whether the item is disabled
|
|
18
|
-
* @default false
|
|
19
|
-
*/
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Whether the item is active/selected
|
|
23
|
-
* @default false
|
|
24
|
-
*/
|
|
25
|
-
active?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Submenu items for nested navigation
|
|
28
|
-
*/
|
|
29
|
-
items?: SideMenuItemProps[];
|
|
30
|
-
/**
|
|
31
|
-
* Badge content (number or text)
|
|
32
|
-
*/
|
|
33
|
-
badge?: string | number;
|
|
34
|
-
/**
|
|
35
|
-
* Custom href for links
|
|
36
|
-
*/
|
|
37
|
-
href?: string;
|
|
38
|
-
}
|
|
39
|
-
export interface SideMenuProps {
|
|
40
|
-
/**
|
|
41
|
-
* Menu items configuration
|
|
42
|
-
*/
|
|
43
|
-
items: SideMenuItemProps[];
|
|
44
|
-
/**
|
|
45
|
-
* Whether the sidebar is collapsed
|
|
46
|
-
* @default false
|
|
47
|
-
*/
|
|
48
|
-
collapsed?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Collapse toggle handler
|
|
51
|
-
*/
|
|
52
|
-
onCollapseToggle?: (collapsed: boolean) => void;
|
|
53
|
-
/**
|
|
54
|
-
* Custom className
|
|
55
|
-
*/
|
|
56
|
-
className?: string;
|
|
57
|
-
/**
|
|
58
|
-
* Sidebar width when expanded
|
|
59
|
-
* @default '260px'
|
|
60
|
-
*/
|
|
61
|
-
width?: string | number;
|
|
62
|
-
/**
|
|
63
|
-
* Sidebar width when collapsed
|
|
64
|
-
* @default '80px'
|
|
65
|
-
*/
|
|
66
|
-
collapsedWidth?: string | number;
|
|
67
|
-
/**
|
|
68
|
-
* Header content (logo, title)
|
|
69
|
-
*/
|
|
70
|
-
header?: React.ReactNode;
|
|
71
|
-
/**
|
|
72
|
-
* Footer content
|
|
73
|
-
*/
|
|
74
|
-
footer?: React.ReactNode;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* SideMenuItem component - Individual sidebar menu item with submenu support
|
|
78
|
-
*/
|
|
79
|
-
export declare const SideMenuItem: React.ForwardRefExoticComponent<SideMenuItemProps & {
|
|
80
|
-
collapsed?: boolean;
|
|
81
|
-
level?: number;
|
|
82
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
83
|
-
/**
|
|
84
|
-
* SideMenu component - Professional sidebar navigation for admin panels
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
87
|
-
* Basic sidebar menu
|
|
88
|
-
* ```tsx
|
|
89
|
-
* <SideMenu
|
|
90
|
-
* items={[
|
|
91
|
-
* { label: 'Dashboard', icon: <DashboardIcon />, active: true },
|
|
92
|
-
* {
|
|
93
|
-
* label: 'Products',
|
|
94
|
-
* icon: <ProductIcon />,
|
|
95
|
-
* items: [
|
|
96
|
-
* { label: 'All Products', onClick: () => {} },
|
|
97
|
-
* { label: 'Categories', onClick: () => {} }
|
|
98
|
-
* ]
|
|
99
|
-
* },
|
|
100
|
-
* { label: 'Settings', icon: <SettingsIcon />, onClick: () => {} }
|
|
101
|
-
* ]}
|
|
102
|
-
* />
|
|
103
|
-
* ```
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* Collapsible sidebar with header
|
|
107
|
-
* ```tsx
|
|
108
|
-
* <SideMenu
|
|
109
|
-
* collapsed={isCollapsed}
|
|
110
|
-
* onCollapseToggle={setIsCollapsed}
|
|
111
|
-
* header={<Logo />}
|
|
112
|
-
* items={menuItems}
|
|
113
|
-
* />
|
|
114
|
-
* ```
|
|
115
|
-
*/
|
|
116
|
-
export declare const SideMenu: React.ForwardRefExoticComponent<SideMenuProps & React.RefAttributes<HTMLDivElement>>;
|
|
117
|
-
declare const _default: React.FC<SideMenuProps & React.RefAttributes<HTMLDivElement>>;
|
|
118
|
-
export default _default;
|