@ssa-ui-kit/core 2.33.0 → 3.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/components/AccordionGroup/Accordion.d.ts +37 -0
- package/dist/components/AccordionGroup/AccordionContent.d.ts +48 -0
- package/dist/components/AccordionGroup/AccordionContext.d.ts +76 -2
- package/dist/components/AccordionGroup/AccordionGroup.d.ts +56 -0
- package/dist/components/AccordionGroup/AccordionTitle.d.ts +41 -0
- package/dist/components/AccordionGroup/types.d.ts +199 -1
- package/dist/components/Avatar/Avatar.d.ts +33 -0
- package/dist/components/Button/Button.d.ts +61 -0
- package/dist/components/Button/fixtures.d.ts +52 -31
- package/dist/components/Button/styles.d.ts +7 -12
- package/dist/components/Button/types.d.ts +98 -4
- package/dist/components/Charts/BarGaugeChart/components/BarGaugeChartHeader.d.ts +1 -1
- package/dist/components/Charts/BarLineComplexChart/BarLineComplexChartView.d.ts +2 -2
- package/dist/components/Charts/BarLineComplexChart/types.d.ts +2 -2
- package/dist/components/Charts/BigNumberChart/BigNumberChart.d.ts +4 -2
- package/dist/components/Charts/BigNumberChart/components/BigNumberChartHeader.d.ts +1 -1
- package/dist/components/Charts/BigNumberChart/components/TrendLine.d.ts +8 -3
- package/dist/components/Charts/BigNumberChart/components/TrendLineTooltip.d.ts +8 -5
- package/dist/components/Charts/GaugeChart/components/GaugeChartBase.d.ts +3 -1
- package/dist/components/Charts/GaugeChart/components/GaugeChartHeader.d.ts +1 -1
- package/dist/components/Charts/PieChart/PieChartLegendMarker.d.ts +1 -1
- package/dist/components/Charts/PieChart/styles.d.ts +1 -1
- package/dist/components/Charts/PieChart/types.d.ts +1 -1
- package/dist/components/Charts/RadarChart/RadarChart.d.ts +1 -1
- package/dist/components/Charts/RadarChart/components/RadarChartHeader.d.ts +1 -1
- package/dist/components/Charts/TreeMapChart/TreeMapChart.d.ts +1 -1
- package/dist/components/Charts/TreeMapChart/TreeMapChartHeader.d.ts +1 -1
- package/dist/components/Charts/index.d.ts +1 -0
- package/dist/components/Charts/utils/nivoReact19Compat.d.ts +18 -0
- package/dist/components/Checkbox/Checkbox.d.ts +84 -0
- package/dist/components/Checkbox/CheckboxBase.d.ts +1 -1
- package/dist/components/Checkbox/styles.d.ts +2 -2
- package/dist/components/Checkbox/types.d.ts +104 -3
- package/dist/components/Chip/Chip.d.ts +70 -0
- package/dist/components/Chip/constants.d.ts +1 -1
- package/dist/components/Chip/helpers.d.ts +6 -0
- package/dist/components/Chip/types.d.ts +129 -1
- package/dist/components/CollapsibleNavBar/CollapsibleNavBar.d.ts +1 -1
- package/dist/components/CollapsibleNavBar/CollapsibleNavBarContext.d.ts +2 -2
- package/dist/components/CollapsibleNavBar/components/TriggerIcon.d.ts +4 -2
- package/dist/components/CollapsibleNavBar/types.d.ts +9 -2
- package/dist/components/ColorPicker/components/CopyButton.d.ts +1 -1
- package/dist/components/DatePicker/constants.d.ts +22 -0
- package/dist/components/DatePicker/hooks/useDatePicker.d.ts +7 -5
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DatePicker/styles.d.ts +3 -2
- package/dist/components/DatePicker/types.d.ts +10 -2
- package/dist/components/DatePicker/utils/dates.d.ts +2 -2
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/components/DateRangePicker/DateRangePickerFormBridge.d.ts +46 -0
- package/dist/components/DateRangePicker/components/DatesListWrapper.d.ts +3 -2
- package/dist/components/DateRangePicker/constants.d.ts +1 -0
- package/dist/components/DateRangePicker/hooks/useDateRangePicker.d.ts +22 -17
- package/dist/components/DateRangePicker/index.d.ts +3 -0
- package/dist/components/DateRangePicker/styles.d.ts +6 -4
- package/dist/components/DateRangePicker/types.d.ts +24 -7
- package/dist/components/DateRangePicker/utils/dates.d.ts +2 -2
- package/dist/components/Drawer/index.d.ts +2 -1
- package/dist/components/Dropdown/Dropdown.d.ts +88 -0
- package/dist/components/Dropdown/types.d.ts +78 -0
- package/dist/components/DropdownOptions/DropdownOptions.d.ts +31 -0
- package/dist/components/DropdownOptions/types.d.ts +22 -0
- package/dist/components/DropdownToggle/DropdownToggle.d.ts +1 -1
- package/dist/components/Field/FieldControl.d.ts +62 -1
- package/dist/components/Field/FieldDescription.d.ts +33 -0
- package/dist/components/Field/FieldError.d.ts +36 -0
- package/dist/components/Field/FieldLabel.d.ts +37 -0
- package/dist/components/Field/FieldProvider.d.ts +19 -1
- package/dist/components/Field/FieldRoot.d.ts +90 -0
- package/dist/components/Field/FieldSuccess.d.ts +34 -0
- package/dist/components/Field/index.d.ts +4 -0
- package/dist/components/Filters/FilterBlockWrapper.d.ts +3 -2
- package/dist/components/Filters/FiltersContext.d.ts +4 -4
- package/dist/components/Filters/hooks/useVisibility.d.ts +2 -2
- package/dist/components/FullscreenModeContext.d.ts +1 -4
- package/dist/components/Icon/icons/iconsList.d.ts +1 -1
- package/dist/components/IconButton/IconButton.d.ts +39 -0
- package/dist/components/IconButton/index.d.ts +2 -0
- package/dist/components/IconButton/styles.d.ts +2 -0
- package/dist/components/IconButton/types.d.ts +41 -0
- package/dist/components/Indicator/types.d.ts +4 -2
- package/dist/components/Input/types.d.ts +157 -0
- package/dist/components/JsonSchemaForm/fields/DateRangeField.d.ts +15 -1
- package/dist/components/JsonSchemaForm/utils/dateFormats.d.ts +37 -0
- package/dist/components/JsonSchemaForm/utils/dateRangeField.d.ts +24 -0
- package/dist/components/JsonSchemaForm/utils/index.d.ts +1 -0
- package/dist/components/JsonSchemaForm/utils/selectWidget.d.ts +16 -0
- package/dist/components/Modal/Modal.d.ts +60 -0
- package/dist/components/Modal/types.d.ts +21 -1
- package/dist/components/ModalContent/ModalContent.d.ts +42 -1
- package/dist/components/ModalDialog/ModalDialog.d.ts +27 -0
- package/dist/components/ModalDialog/types.d.ts +18 -0
- package/dist/components/ModalDismissButton/ModalDismissButton.d.ts +29 -2
- package/dist/components/ModalOpenButton/ModalOpenButton.d.ts +25 -1
- package/dist/components/NavBar/types.d.ts +1 -1
- package/dist/components/NotificationMenu/types.d.ts +3 -3
- package/dist/components/Pagination/ArrowButton.d.ts +32 -0
- package/dist/components/Pagination/Pagination.d.ts +81 -0
- package/dist/components/Pagination/PaginationButtons.d.ts +35 -0
- package/dist/components/Pagination/PaginationContext.d.ts +30 -0
- package/dist/components/Pagination/WithPagination.d.ts +47 -4
- package/dist/components/Pagination/components/RowsPerPageDropdown/RowsPerPageDropdown.d.ts +41 -0
- package/dist/components/Pagination/components/RowsPerPageDropdown/types.d.ts +39 -0
- package/dist/components/Pagination/styles.d.ts +1 -1
- package/dist/components/Pagination/types.d.ts +178 -0
- package/dist/components/PersonInfo/styles.d.ts +1 -1
- package/dist/components/Popover/Popover.d.ts +120 -0
- package/dist/components/Popover/PopoverClose.d.ts +26 -0
- package/dist/components/Popover/PopoverContent.d.ts +33 -0
- package/dist/components/Popover/PopoverDescription.d.ts +22 -1
- package/dist/components/Popover/PopoverHeading.d.ts +22 -1
- package/dist/components/Popover/PopoverTrigger.d.ts +30 -0
- package/dist/components/Popover/hooks/usePopover.d.ts +21 -0
- package/dist/components/Popover/hooks/usePopoverContext.d.ts +23 -0
- package/dist/components/Popover/types.d.ts +86 -0
- package/dist/components/Radio/Radio.d.ts +69 -1
- package/dist/components/Radio/RadioBase.d.ts +1 -1
- package/dist/components/Radio/types.d.ts +109 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/index.d.ts +1 -0
- package/dist/components/RadioGroup/types.d.ts +42 -0
- package/dist/components/SearchBox/SearchBox.d.ts +60 -0
- package/dist/components/SearchBox/SearchBoxInput.d.ts +1 -1
- package/dist/components/SearchBox/types.d.ts +46 -0
- package/dist/components/Slider/Slider.d.ts +53 -0
- package/dist/components/Slider/consts.d.ts +4 -0
- package/dist/components/Slider/index.d.ts +4 -0
- package/dist/components/Slider/styles.d.ts +90 -0
- package/dist/components/Slider/types.d.ts +69 -0
- package/dist/components/Switch/Switch.d.ts +66 -1
- package/dist/components/Switch/SwitchBase.d.ts +5 -1
- package/dist/components/Switch/SwitchContext.d.ts +50 -0
- package/dist/components/Switch/types.d.ts +74 -0
- package/dist/components/Table/Table.d.ts +74 -0
- package/dist/components/TableBody/TableBody.d.ts +55 -0
- package/dist/components/TableCell/TableCell.d.ts +56 -4
- package/dist/components/TableCell/types.d.ts +33 -0
- package/dist/components/TableCellHeader/TableCellHeader.d.ts +63 -2
- package/dist/components/TableCellHeader/types.d.ts +28 -0
- package/dist/components/TableFilters/TableFilters.d.ts +72 -0
- package/dist/components/TableFilters/hooks/useTableData.d.ts +3 -3
- package/dist/components/TableFilters/types.d.ts +130 -2
- package/dist/components/TableHead/TableHead.d.ts +37 -0
- package/dist/components/TableRow/TableRow.d.ts +2 -7
- package/dist/components/TableRow/types.d.ts +34 -0
- package/dist/components/TextField/TextField.d.ts +76 -0
- package/dist/components/TextField/types.d.ts +80 -0
- package/dist/components/Textarea/Textarea.d.ts +81 -0
- package/dist/components/Textarea/types.d.ts +95 -0
- package/dist/components/Tooltip/SimpleChartTooltip.d.ts +2 -1
- package/dist/components/Tooltip/Tooltip.d.ts +73 -0
- package/dist/components/Tooltip/types.d.ts +116 -5
- package/dist/components/TooltipContent/TooltipContent.d.ts +45 -0
- package/dist/components/TooltipTrigger/TooltipTrigger.d.ts +27 -1
- package/dist/components/Typeahead/Typeahead.context.d.ts +10 -4
- package/dist/components/Typeahead/Typeahead.d.ts +173 -9
- package/dist/components/Typeahead/components/TypeaheadOption.d.ts +1 -1
- package/dist/components/Typeahead/styles.d.ts +9 -4
- package/dist/components/Typeahead/types.d.ts +191 -1
- package/dist/components/Typeahead/useTypeahead.d.ts +13 -5
- package/dist/components/Typography/Typography.d.ts +50 -0
- package/dist/components/Typography/types.d.ts +67 -0
- package/dist/components/UserProfile/UserProfile.d.ts +76 -0
- package/dist/components/UserProfile/styles.d.ts +6 -4
- package/dist/components/UserProfile/types.d.ts +85 -1
- package/dist/components/WidgetCard/Title.d.ts +1 -1
- package/dist/components/WidgetCard/WidgetCardBase.d.ts +1 -1
- package/dist/components/WithLink.d.ts +1 -1
- package/dist/components/Wrapper/Wrapper.d.ts +83 -2
- package/dist/components/Wrapper/index.d.ts +1 -0
- package/dist/components/index.d.ts +113 -85
- package/dist/index.d.ts +1 -0
- package/dist/index.js +47400 -19567
- package/dist/index.js.map +1 -1
- package/dist/types/emotion.d.ts +63 -0
- package/dist/utils/react19HocCompat.d.ts +14 -0
- package/package.json +42 -33
|
@@ -1,3 +1,71 @@
|
|
|
1
1
|
import { RadioProps } from './types';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Radio - Radio button component for single selection
|
|
4
|
+
*
|
|
5
|
+
* A radio button component for selecting a single option from a group.
|
|
6
|
+
* Supports controlled and uncontrolled states, palette-based color variants,
|
|
7
|
+
* and full accessibility. Displays a radio icon that changes appearance based
|
|
8
|
+
* on checked state and hover interactions.
|
|
9
|
+
*
|
|
10
|
+
* Colors are sourced from `theme.palette` for consistency with Button and
|
|
11
|
+
* Checkbox. Pass `color="custom"` together with the `colors` object to supply
|
|
12
|
+
* arbitrary CSS color values.
|
|
13
|
+
*
|
|
14
|
+
* Typically used within RadioGroup for managing selection state across
|
|
15
|
+
* multiple radio buttons, but can also be used standalone.
|
|
16
|
+
*
|
|
17
|
+
* @category Form Controls
|
|
18
|
+
* @subcategory Input
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* // Default (primary / blue)
|
|
23
|
+
* <Radio
|
|
24
|
+
* id="option1"
|
|
25
|
+
* name="choice"
|
|
26
|
+
* value="option1"
|
|
27
|
+
* text="Option 1"
|
|
28
|
+
* onChange={(value) => console.log(value)}
|
|
29
|
+
* />
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* // Success (green) variant
|
|
35
|
+
* <Radio
|
|
36
|
+
* name="status"
|
|
37
|
+
* value="active"
|
|
38
|
+
* text="Active"
|
|
39
|
+
* color="success"
|
|
40
|
+
* onChange={handleChange}
|
|
41
|
+
* />
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* // Custom color escape hatch
|
|
47
|
+
* <Radio
|
|
48
|
+
* name="priority"
|
|
49
|
+
* value="high"
|
|
50
|
+
* text="High Priority"
|
|
51
|
+
* color="custom"
|
|
52
|
+
* colors={{
|
|
53
|
+
* default: '#ff0000',
|
|
54
|
+
* hovered: '#cc0000',
|
|
55
|
+
* disabled: '#cccccc',
|
|
56
|
+
* focusShadow: 'rgba(255,0,0,0.25)',
|
|
57
|
+
* }}
|
|
58
|
+
* onChange={handleChange}
|
|
59
|
+
* />
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @see {@link RadioGroup} - For managing groups of radio buttons
|
|
63
|
+
*
|
|
64
|
+
* @accessibility
|
|
65
|
+
* - Full keyboard navigation (Arrow keys to navigate group, Space to select)
|
|
66
|
+
* - Proper ARIA attributes (role="radio", aria-checked)
|
|
67
|
+
* - Screen reader friendly
|
|
68
|
+
* - Focus management with visible focus indicators
|
|
69
|
+
*/
|
|
70
|
+
declare const Radio: ({ id, name, value, isChecked, isDisabled, isRequired, text, color, colors, className, onChange, }: RadioProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
71
|
export default Radio;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const RadioBase: import("@emotion/styled").StyledComponent<import("
|
|
1
|
+
export declare const RadioBase: import("@emotion/styled").StyledComponent<import("..").LabelProps & {
|
|
2
2
|
theme?: import("@emotion/react").Theme;
|
|
3
3
|
} & {
|
|
4
4
|
focusShadowColor?: string;
|
|
@@ -1,17 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the Radio component
|
|
3
|
+
*
|
|
4
|
+
* Radio button component for single selection from a group of options.
|
|
5
|
+
* Supports controlled and uncontrolled states, palette-based color variants,
|
|
6
|
+
* and full accessibility. Typically used within RadioGroup for managing
|
|
7
|
+
* selection state.
|
|
8
|
+
*
|
|
9
|
+
* Colors are driven by `theme.palette`:
|
|
10
|
+
* - `primary` (default) — blue; uses `palette.primary.main` for resting/checked,
|
|
11
|
+
* `palette.primary.dark` for hover.
|
|
12
|
+
* - `success` — green; uses `palette.success.main` for resting/checked,
|
|
13
|
+
* `palette.success.dark` for hover.
|
|
14
|
+
* - `custom` — no built-in color; provide exact values via the `colors` object.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* // Basic radio button (primary / blue by default)
|
|
19
|
+
* <Radio
|
|
20
|
+
* id="option1"
|
|
21
|
+
* name="choice"
|
|
22
|
+
* value="option1"
|
|
23
|
+
* text="Option 1"
|
|
24
|
+
* onChange={(value) => handleChange(value)}
|
|
25
|
+
* />
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* // Success (green) variant
|
|
31
|
+
* <Radio
|
|
32
|
+
* name="status"
|
|
33
|
+
* value="active"
|
|
34
|
+
* text="Active"
|
|
35
|
+
* color="success"
|
|
36
|
+
* onChange={(value) => handleChange(value)}
|
|
37
|
+
* />
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* // Custom color via escape hatch
|
|
43
|
+
* <Radio
|
|
44
|
+
* name="priority"
|
|
45
|
+
* value="high"
|
|
46
|
+
* text="High Priority"
|
|
47
|
+
* color="custom"
|
|
48
|
+
* colors={{
|
|
49
|
+
* default: '#ff0000',
|
|
50
|
+
* hovered: '#cc0000',
|
|
51
|
+
* disabled: '#cccccc',
|
|
52
|
+
* focusShadow: 'rgba(255, 0, 0, 0.25)',
|
|
53
|
+
* }}
|
|
54
|
+
* onChange={(value) => handleChange(value)}
|
|
55
|
+
* />
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
1
58
|
export interface RadioProps {
|
|
59
|
+
/**
|
|
60
|
+
* Unique identifier for the radio input
|
|
61
|
+
* If not provided, a unique ID will be auto-generated
|
|
62
|
+
*/
|
|
2
63
|
id?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Value of the radio button
|
|
66
|
+
* Passed to onChange callback when selected
|
|
67
|
+
*/
|
|
3
68
|
value: string;
|
|
69
|
+
/**
|
|
70
|
+
* Name attribute for grouping radio buttons
|
|
71
|
+
* Radio buttons with the same name form a group
|
|
72
|
+
* @default ''
|
|
73
|
+
*/
|
|
4
74
|
name?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Whether the radio button is checked
|
|
77
|
+
* Use for controlled component pattern
|
|
78
|
+
*/
|
|
5
79
|
isChecked?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Whether the radio button is disabled
|
|
82
|
+
* Disabled radios cannot be selected
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
6
85
|
isDisabled?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Whether the radio button is required for form validation
|
|
88
|
+
* @default false
|
|
89
|
+
*/
|
|
7
90
|
isRequired?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Callback function called when radio is selected
|
|
93
|
+
* Receives the radio's value as parameter
|
|
94
|
+
*/
|
|
8
95
|
onChange?: (value: string) => void;
|
|
96
|
+
/**
|
|
97
|
+
* Label text displayed next to the radio button
|
|
98
|
+
*/
|
|
9
99
|
text?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Custom CSS class name
|
|
102
|
+
*/
|
|
10
103
|
className?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Palette-based color variant.
|
|
106
|
+
* - `primary` — blue (uses `palette.primary`)
|
|
107
|
+
* - `success` — green (uses `palette.success`)
|
|
108
|
+
* - `custom` — unstyled; supply exact colors via the `colors` prop
|
|
109
|
+
* @default 'primary'
|
|
110
|
+
*/
|
|
111
|
+
color?: 'primary' | 'success' | 'custom';
|
|
112
|
+
/**
|
|
113
|
+
* Fine-grained color overrides — only applied when `color="custom"`.
|
|
114
|
+
* Allows overriding every interactive state independently.
|
|
115
|
+
*/
|
|
11
116
|
colors?: {
|
|
117
|
+
/** Resting (and checked) icon color */
|
|
12
118
|
default?: string;
|
|
119
|
+
/** Hover icon color */
|
|
13
120
|
hovered?: string;
|
|
121
|
+
/** Disabled state icon color */
|
|
14
122
|
disabled?: string;
|
|
123
|
+
/** Focus ring drop-shadow color */
|
|
15
124
|
focusShadow?: string;
|
|
16
125
|
};
|
|
17
126
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { RadioGroupProps } from './types';
|
|
2
|
-
declare const RadioGroup: ({ name, isRequired, externalState, onChange, children, className, }: RadioGroupProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const RadioGroup: ({ name, isRequired, externalState, onChange, children, className, color, }: RadioGroupProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default RadioGroup;
|
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
import { RadioProps } from '../Radio/types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the RadioGroup component
|
|
4
|
+
*
|
|
5
|
+
* Orchestrates a set of Radio buttons so only one can be selected at a time.
|
|
6
|
+
* The group manages the active value in internal state, syncs with `externalState`,
|
|
7
|
+
* and injects `name`, `isChecked`, and `onChange` into every Radio child via
|
|
8
|
+
* `cloneElement`. Individual Radio components can still override the group's
|
|
9
|
+
* `color` prop with their own `color` prop.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Basic radio group
|
|
14
|
+
* <RadioGroup name="fruit" onChange={(value) => console.log(value)}>
|
|
15
|
+
* <Radio id="r1" value="apple" text="Apple" />
|
|
16
|
+
* <Radio id="r2" value="orange" text="Orange" />
|
|
17
|
+
* <Radio id="r3" value="banana" text="Banana" isDisabled />
|
|
18
|
+
* </RadioGroup>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* // Controlled with external state and success color
|
|
24
|
+
* const [selected, setSelected] = useState('apple');
|
|
25
|
+
* <RadioGroup
|
|
26
|
+
* name="fruit"
|
|
27
|
+
* color="success"
|
|
28
|
+
* externalState={selected}
|
|
29
|
+
* onChange={setSelected}>
|
|
30
|
+
* <Radio id="r1" value="apple" text="Apple" />
|
|
31
|
+
* <Radio id="r2" value="orange" text="Orange" />
|
|
32
|
+
* </RadioGroup>
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
2
35
|
export interface RadioGroupProps {
|
|
3
36
|
name: string;
|
|
4
37
|
isRequired?: boolean;
|
|
@@ -6,4 +39,13 @@ export interface RadioGroupProps {
|
|
|
6
39
|
className?: string;
|
|
7
40
|
onChange: (value: string | number) => void;
|
|
8
41
|
children?: React.ReactElement<RadioProps>[] | React.ReactElement<RadioProps>;
|
|
42
|
+
/**
|
|
43
|
+
* Palette-based color variant applied to every Radio child.
|
|
44
|
+
* Individual Radio components can still override this with their own `color` prop.
|
|
45
|
+
* - `primary` — blue (uses `palette.primary`)
|
|
46
|
+
* - `success` — green (uses `palette.success`)
|
|
47
|
+
* - `custom` — pass `colors` to each Radio individually
|
|
48
|
+
* @default 'primary'
|
|
49
|
+
*/
|
|
50
|
+
color?: RadioProps['color'];
|
|
9
51
|
}
|
|
@@ -1,2 +1,62 @@
|
|
|
1
1
|
import { SearchBoxProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* SearchBox - Search input component with debounced callbacks
|
|
4
|
+
*
|
|
5
|
+
* A specialized search input component that combines Input functionality with
|
|
6
|
+
* search-specific features like debounced callbacks, clear button, and search
|
|
7
|
+
* icon. Automatically triggers search callbacks as the user types (with debounce)
|
|
8
|
+
* or immediately when Enter key is pressed.
|
|
9
|
+
*
|
|
10
|
+
* Features:
|
|
11
|
+
* - Debounced search callbacks to reduce API calls
|
|
12
|
+
* - Visual feedback: search icon when empty, clear icon when has value
|
|
13
|
+
* - Enter key for immediate search execution
|
|
14
|
+
* - Configurable auto-search trigger
|
|
15
|
+
* - React Hook Form integration for form state management
|
|
16
|
+
*
|
|
17
|
+
* @category Form Controls
|
|
18
|
+
* @subcategory Input
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const { control, register, resetField } = useForm();
|
|
23
|
+
*
|
|
24
|
+
* <SearchBox
|
|
25
|
+
* name="search"
|
|
26
|
+
* placeholder="Search products..."
|
|
27
|
+
* control={control}
|
|
28
|
+
* register={register}
|
|
29
|
+
* resetField={resetField}
|
|
30
|
+
* callback={(term) => {
|
|
31
|
+
* console.log('Searching for:', term);
|
|
32
|
+
* // Perform search API call
|
|
33
|
+
* }}
|
|
34
|
+
* callbackDelay={500}
|
|
35
|
+
* />
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* // Manual search only (no auto-trigger)
|
|
41
|
+
* <SearchBox
|
|
42
|
+
* name="query"
|
|
43
|
+
* control={control}
|
|
44
|
+
* register={register}
|
|
45
|
+
* resetField={resetField}
|
|
46
|
+
* callback={handleSearch}
|
|
47
|
+
* autoSearchTrigger={false}
|
|
48
|
+
* placeholder="Press Enter to search"
|
|
49
|
+
* />
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @see {@link Input} - Base input component used internally
|
|
53
|
+
*
|
|
54
|
+
* @requires React Hook Form - Must be used within FormProvider context
|
|
55
|
+
*
|
|
56
|
+
* @accessibility
|
|
57
|
+
* - Full keyboard navigation support
|
|
58
|
+
* - Enter key triggers search
|
|
59
|
+
* - Clear button accessible via keyboard
|
|
60
|
+
* - Screen reader friendly
|
|
61
|
+
*/
|
|
2
62
|
export declare const SearchBox: ({ name, placeholder, control, callbackDelay, autoSearchTrigger, register, resetField, callback, ...rest }: SearchBoxProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const SearchBoxInput: import("@emotion/styled").StyledComponent<import("
|
|
1
|
+
export declare const SearchBoxInput: import("@emotion/styled").StyledComponent<import("..").InputProps & import("react").RefAttributes<HTMLInputElement> & {
|
|
2
2
|
theme?: import("@emotion/react").Theme;
|
|
3
3
|
}, {}, {}>;
|
|
@@ -1,7 +1,53 @@
|
|
|
1
1
|
import { InputProps } from '../Input/types';
|
|
2
2
|
import { UseFormReturn } from 'react-hook-form';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the SearchBox component
|
|
5
|
+
*
|
|
6
|
+
* A specialized search input component with debounced search callback, clear
|
|
7
|
+
* functionality, and React Hook Form integration. Automatically triggers search
|
|
8
|
+
* callbacks with configurable debounce delay and supports manual search via
|
|
9
|
+
* Enter key.
|
|
10
|
+
*
|
|
11
|
+
* Features:
|
|
12
|
+
* - Debounced search callbacks (reduces API calls)
|
|
13
|
+
* - Clear button that appears when input has value
|
|
14
|
+
* - Search icon when input is empty
|
|
15
|
+
* - Enter key to trigger immediate search
|
|
16
|
+
* - Auto-search trigger on input change (configurable)
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* const { control, register, resetField } = useForm();
|
|
21
|
+
* <SearchBox
|
|
22
|
+
* name="search"
|
|
23
|
+
* placeholder="Search products..."
|
|
24
|
+
* control={control}
|
|
25
|
+
* register={register}
|
|
26
|
+
* resetField={resetField}
|
|
27
|
+
* callback={(term) => handleSearch(term)}
|
|
28
|
+
* callbackDelay={500}
|
|
29
|
+
* />
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @requires React Hook Form - Must be used within FormProvider context
|
|
33
|
+
*/
|
|
3
34
|
export type SearchBoxProps = InputProps & Pick<UseFormReturn, 'control' | 'resetField'> & {
|
|
35
|
+
/**
|
|
36
|
+
* Callback function called when search is triggered
|
|
37
|
+
* Receives the current search term as parameter
|
|
38
|
+
* Triggered either by debounced input changes or Enter key press
|
|
39
|
+
*/
|
|
4
40
|
callback: (searchTerm: string) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Debounce delay in milliseconds for search callback
|
|
43
|
+
* Prevents excessive API calls while user is typing
|
|
44
|
+
* @default 500
|
|
45
|
+
*/
|
|
5
46
|
callbackDelay?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Whether to automatically trigger search on input change
|
|
49
|
+
* When false, search only triggers on Enter key press
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
6
52
|
autoSearchTrigger?: boolean;
|
|
7
53
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { SliderProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Slider — a dual-thumb range slider component.
|
|
4
|
+
*
|
|
5
|
+
* ## Variants
|
|
6
|
+
* - **Default** — floating value labels appear above each thumb
|
|
7
|
+
* (`valueLabelDisplay`).
|
|
8
|
+
* - **With inputs** (`withInputs`) — two editable number fields above the
|
|
9
|
+
* track; floating labels are hidden.
|
|
10
|
+
*
|
|
11
|
+
* ## Thumb-crossing behavior
|
|
12
|
+
* - **Default** (`disableSwap` omitted) — thumbs cross freely; values are
|
|
13
|
+
* re-sorted automatically so the fill always sits between them.
|
|
14
|
+
* - **`disableSwap`** — the active thumb stops at the other thumb (or
|
|
15
|
+
* `minDistance` away). Use with `minDistance` to enforce a minimum gap.
|
|
16
|
+
*
|
|
17
|
+
* ## Customization
|
|
18
|
+
* All inner styled sub-elements are exported from `@ssa-ui-kit/core` as
|
|
19
|
+
* `Slider*` components. Pass them as selectors inside the `css` prop or
|
|
20
|
+
* target them by their generated class names via `className`.
|
|
21
|
+
*
|
|
22
|
+
* ```tsx
|
|
23
|
+
* import { css } from '@emotion/react';
|
|
24
|
+
* import { Slider, SliderTrackFill, SliderRangeInput } from '@ssa-ui-kit/core';
|
|
25
|
+
*
|
|
26
|
+
* // Override fill color via the css prop
|
|
27
|
+
* <Slider
|
|
28
|
+
* css={css`
|
|
29
|
+
* ${SliderTrackFill} { background: #52c587; }
|
|
30
|
+
* ${SliderRangeInput}::-webkit-slider-thumb { background: #52c587; }
|
|
31
|
+
* `}
|
|
32
|
+
* defaultValue={[20, 80]}
|
|
33
|
+
* />
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* // Basic range slider (thumbs swap when they cross)
|
|
39
|
+
* <Slider label="Price" min={0} max={1000} defaultValue={[200, 800]} />
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* // Prevent crossing + enforce a gap of at least 50
|
|
45
|
+
* <Slider
|
|
46
|
+
* label="Budget"
|
|
47
|
+
* min={0} max={1000}
|
|
48
|
+
* disableSwap minDistance={50}
|
|
49
|
+
* defaultValue={[100, 900]}
|
|
50
|
+
* />
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare const Slider: ({ label, min, max, step, value: valueProp, defaultValue, onChange, size, withInputs, valueLabelDisplay, disableSwap, minDistance, marks, disabled, className, css: customCss, }: SliderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Slider } from './Slider';
|
|
2
|
+
export { SliderRoot, SliderLabel, SliderInputsRow, SliderNumberInput, SliderTrackWrapper, SliderValueLabelsContainer, SliderValueLabel, SliderTrackRow, SliderTrackBg, SliderTrackFill, SliderRangeInput, SliderMarksRow, SliderMarkItem, SliderMarkTick, SliderMarkLabel, } from './styles';
|
|
3
|
+
export { SLIDER_THUMB_SIZES } from './consts';
|
|
4
|
+
export type { SliderProps, SliderMark, SliderSize, ValueLabelDisplay, } from './types';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { SliderSize } from './types';
|
|
2
|
+
export declare const SliderRoot: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme;
|
|
4
|
+
as?: React.ElementType;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const SliderLabel: import("@emotion/styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme;
|
|
8
|
+
as?: React.ElementType;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, {}>;
|
|
10
|
+
export declare const SliderInputsRow: import("@emotion/styled").StyledComponent<{
|
|
11
|
+
theme?: import("@emotion/react").Theme;
|
|
12
|
+
as?: React.ElementType;
|
|
13
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
14
|
+
export declare const SliderNumberInput: import("@emotion/styled").StyledComponent<{
|
|
15
|
+
theme?: import("@emotion/react").Theme;
|
|
16
|
+
as?: React.ElementType;
|
|
17
|
+
}, import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {}>;
|
|
18
|
+
export declare const SliderTrackWrapper: import("@emotion/styled").StyledComponent<{
|
|
19
|
+
theme?: import("@emotion/react").Theme;
|
|
20
|
+
as?: React.ElementType;
|
|
21
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
22
|
+
export declare const SliderValueLabelsContainer: import("@emotion/styled").StyledComponent<{
|
|
23
|
+
theme?: import("@emotion/react").Theme;
|
|
24
|
+
as?: React.ElementType;
|
|
25
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
26
|
+
/**
|
|
27
|
+
* `leftCalc` is a CSS `calc()` string that aligns the label center precisely
|
|
28
|
+
* over the thumb, accounting for the thumb half-size offset at track edges.
|
|
29
|
+
*/
|
|
30
|
+
export declare const SliderValueLabel: import("@emotion/styled").StyledComponent<{
|
|
31
|
+
theme?: import("@emotion/react").Theme;
|
|
32
|
+
as?: React.ElementType;
|
|
33
|
+
} & {
|
|
34
|
+
leftCalc: string;
|
|
35
|
+
isVisible: boolean;
|
|
36
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
37
|
+
export declare const SliderTrackRow: import("@emotion/styled").StyledComponent<{
|
|
38
|
+
theme?: import("@emotion/react").Theme;
|
|
39
|
+
as?: React.ElementType;
|
|
40
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
41
|
+
export declare const SliderTrackBg: import("@emotion/styled").StyledComponent<{
|
|
42
|
+
theme?: import("@emotion/react").Theme;
|
|
43
|
+
as?: React.ElementType;
|
|
44
|
+
} & {
|
|
45
|
+
size: SliderSize;
|
|
46
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
47
|
+
export declare const SliderTrackFill: import("@emotion/styled").StyledComponent<{
|
|
48
|
+
theme?: import("@emotion/react").Theme;
|
|
49
|
+
as?: React.ElementType;
|
|
50
|
+
} & {
|
|
51
|
+
left: number;
|
|
52
|
+
width: number;
|
|
53
|
+
isDisabled: boolean;
|
|
54
|
+
size: SliderSize;
|
|
55
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
56
|
+
/**
|
|
57
|
+
* `sliderSize` is used instead of `size` because `<input size>` is a built-in
|
|
58
|
+
* HTML attribute typed as `number`, which would conflict with our `SliderSize`
|
|
59
|
+
* string union and collapse the whole props intersection to `never`.
|
|
60
|
+
* `shouldForwardProp` prevents both custom props from reaching the DOM.
|
|
61
|
+
*/
|
|
62
|
+
export declare const SliderRangeInput: import("@emotion/styled").StyledComponent<{
|
|
63
|
+
theme?: import("@emotion/react").Theme;
|
|
64
|
+
as?: React.ElementType;
|
|
65
|
+
} & {
|
|
66
|
+
sliderSize: SliderSize;
|
|
67
|
+
zIndex?: number;
|
|
68
|
+
}, import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {}>;
|
|
69
|
+
export declare const SliderMarksRow: import("@emotion/styled").StyledComponent<{
|
|
70
|
+
theme?: import("@emotion/react").Theme;
|
|
71
|
+
as?: React.ElementType;
|
|
72
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
73
|
+
/**
|
|
74
|
+
* `leftCalc` uses the same calc() formula as `SliderValueLabel` so ticks are
|
|
75
|
+
* pixel-perfect under each thumb position.
|
|
76
|
+
*/
|
|
77
|
+
export declare const SliderMarkItem: import("@emotion/styled").StyledComponent<{
|
|
78
|
+
theme?: import("@emotion/react").Theme;
|
|
79
|
+
as?: React.ElementType;
|
|
80
|
+
} & {
|
|
81
|
+
leftCalc: string;
|
|
82
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
83
|
+
export declare const SliderMarkTick: import("@emotion/styled").StyledComponent<{
|
|
84
|
+
theme?: import("@emotion/react").Theme;
|
|
85
|
+
as?: React.ElementType;
|
|
86
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
87
|
+
export declare const SliderMarkLabel: import("@emotion/styled").StyledComponent<{
|
|
88
|
+
theme?: import("@emotion/react").Theme;
|
|
89
|
+
as?: React.ElementType;
|
|
90
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Interpolation, Theme } from '@emotion/react';
|
|
2
|
+
import { MainSizes } from '../../types/global';
|
|
3
|
+
export type SliderSize = keyof MainSizes;
|
|
4
|
+
export type ValueLabelDisplay = 'auto' | 'on' | 'off';
|
|
5
|
+
export interface SliderMark {
|
|
6
|
+
value: number;
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SliderProps {
|
|
10
|
+
/** Optional label shown above the slider */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Minimum value of the range */
|
|
13
|
+
min?: number;
|
|
14
|
+
/** Maximum value of the range */
|
|
15
|
+
max?: number;
|
|
16
|
+
/** Granularity of each step */
|
|
17
|
+
step?: number;
|
|
18
|
+
/** Controlled [min, max] value pair */
|
|
19
|
+
value?: [number, number];
|
|
20
|
+
/** Uncontrolled initial [min, max] value pair */
|
|
21
|
+
defaultValue?: [number, number];
|
|
22
|
+
/** Called whenever either thumb changes */
|
|
23
|
+
onChange?: (value: [number, number]) => void;
|
|
24
|
+
/** Track / thumb size */
|
|
25
|
+
size?: SliderSize;
|
|
26
|
+
/**
|
|
27
|
+
* Render two number inputs above the slider instead of floating value labels.
|
|
28
|
+
*/
|
|
29
|
+
withInputs?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Control visibility of the floating value labels above the thumbs.
|
|
32
|
+
* - `'auto'` (default) — show on hover/focus
|
|
33
|
+
* - `'on'` — always visible
|
|
34
|
+
* - `'off'` — never shown
|
|
35
|
+
* Ignored when `withInputs` is `true`.
|
|
36
|
+
*/
|
|
37
|
+
valueLabelDisplay?: ValueLabelDisplay;
|
|
38
|
+
/**
|
|
39
|
+
* Prevent the two thumbs from crossing each other — the moving thumb
|
|
40
|
+
* stops when it would reach the other thumb (or `minDistance` away from it).
|
|
41
|
+
* Default is `false` (thumbs can cross; values swap automatically).
|
|
42
|
+
*/
|
|
43
|
+
disableSwap?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Minimum gap enforced between the two thumb values.
|
|
46
|
+
* Only takes effect when `disableSwap` is `true`.
|
|
47
|
+
* @example `minDistance={10}` — thumbs can get no closer than 10 units apart.
|
|
48
|
+
*/
|
|
49
|
+
minDistance?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Tick marks rendered below the track — like a speedometer scale.
|
|
52
|
+
* Each mark has a required `value` (must be within `min`–`max`) and an
|
|
53
|
+
* optional `label` string shown beneath the tick.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* marks={[
|
|
58
|
+
* { value: 0, label: '0' },
|
|
59
|
+
* { value: 50, label: '50' },
|
|
60
|
+
* { value: 100, label: '100' },
|
|
61
|
+
* ]}
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
marks?: SliderMark[];
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
className?: string;
|
|
67
|
+
/** Emotion `css` override — applied to the outermost wrapper element. */
|
|
68
|
+
css?: Interpolation<Theme>;
|
|
69
|
+
}
|