@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,53 +1,243 @@
|
|
|
1
1
|
import { CommonProps } from '../../types/emotion';
|
|
2
2
|
import { FieldError } from 'react-hook-form';
|
|
3
|
+
/**
|
|
4
|
+
* Allowed value types for Typeahead options
|
|
5
|
+
*/
|
|
3
6
|
export type TypeaheadValue = string | number;
|
|
7
|
+
/**
|
|
8
|
+
* Props for TypeaheadOption component
|
|
9
|
+
* Record type that allows any string or number properties.
|
|
10
|
+
* Common properties include: value, label, children, avatar, etc.
|
|
11
|
+
*/
|
|
4
12
|
export type TypeaheadOptionProps = Record<string, TypeaheadValue>;
|
|
13
|
+
/**
|
|
14
|
+
* Props for the Typeahead component
|
|
15
|
+
*
|
|
16
|
+
* An advanced autocomplete component with search-as-you-type functionality.
|
|
17
|
+
* Supports single and multiple selection, filtering, custom rendering, and
|
|
18
|
+
* React Hook Form integration for validation.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <Typeahead
|
|
23
|
+
* name="language"
|
|
24
|
+
* label="Language"
|
|
25
|
+
* placeholder="Select language"
|
|
26
|
+
* validationSchema={{ required: 'Required' }}>
|
|
27
|
+
* {options.map(opt => (
|
|
28
|
+
* <TypeaheadOption key={opt.id} value={opt.id} label={opt.name}>
|
|
29
|
+
* {opt.name}
|
|
30
|
+
* </TypeaheadOption>
|
|
31
|
+
* ))}
|
|
32
|
+
* </Typeahead>
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
5
35
|
export interface TypeaheadProps {
|
|
36
|
+
/**
|
|
37
|
+
* Controlled selected items (array of values)
|
|
38
|
+
* When provided, controls the selected items externally
|
|
39
|
+
*/
|
|
6
40
|
selectedItems?: Array<TypeaheadValue>;
|
|
41
|
+
/**
|
|
42
|
+
* Default selected items for uncontrolled mode
|
|
43
|
+
*/
|
|
7
44
|
defaultSelectedItems?: Array<TypeaheadValue>;
|
|
45
|
+
/**
|
|
46
|
+
* Enable multiple selection mode
|
|
47
|
+
* When true, allows selecting multiple options
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
8
50
|
isMultiple?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the component is disabled
|
|
53
|
+
* Disabled typeahead cannot be interacted with
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
9
56
|
isDisabled?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* TypeaheadOption components as children
|
|
59
|
+
* Each child should be a TypeaheadOption component
|
|
60
|
+
*/
|
|
10
61
|
children?: React.ReactNode;
|
|
62
|
+
/**
|
|
63
|
+
* Custom CSS class name for the trigger input
|
|
64
|
+
*/
|
|
11
65
|
className?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Custom CSS class name for the popover container
|
|
68
|
+
*/
|
|
12
69
|
popoverClassName?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Custom CSS class name for the options list
|
|
72
|
+
*/
|
|
13
73
|
optionsClassName?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Custom CSS class name for the wrapper container
|
|
76
|
+
*/
|
|
14
77
|
wrapperClassName?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Width of the component
|
|
80
|
+
* Can be a number (pixels) or string (CSS value)
|
|
81
|
+
* @default 300
|
|
82
|
+
*/
|
|
15
83
|
width?: string | number;
|
|
84
|
+
/**
|
|
85
|
+
* Controlled open state
|
|
86
|
+
* When provided, controls dropdown open/closed state externally
|
|
87
|
+
*/
|
|
16
88
|
isOpen?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Icon or element to display at the start of the input
|
|
91
|
+
*/
|
|
17
92
|
startIcon?: React.ReactNode;
|
|
93
|
+
/**
|
|
94
|
+
* Icon or element to display at the end of the input
|
|
95
|
+
*/
|
|
18
96
|
endIcon?: React.ReactNode;
|
|
97
|
+
/**
|
|
98
|
+
* Custom CSS class name for the start icon
|
|
99
|
+
*/
|
|
19
100
|
startIconClassName?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Custom CSS class name for the end icon
|
|
103
|
+
*/
|
|
20
104
|
endIconClassName?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Form field name (required for React Hook Form integration)
|
|
107
|
+
* @default 'typeahead-search'
|
|
108
|
+
*/
|
|
21
109
|
name?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Label text displayed above the input
|
|
112
|
+
*/
|
|
22
113
|
label?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Helper text displayed below the input
|
|
116
|
+
*/
|
|
23
117
|
helperText?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Field error from React Hook Form
|
|
120
|
+
*/
|
|
24
121
|
error?: FieldError;
|
|
122
|
+
/**
|
|
123
|
+
* Whether to show success state
|
|
124
|
+
* @default false
|
|
125
|
+
*/
|
|
25
126
|
success?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Validation schema for React Hook Form
|
|
129
|
+
* Used for form validation rules
|
|
130
|
+
*/
|
|
26
131
|
validationSchema?: Record<string, unknown>;
|
|
132
|
+
/**
|
|
133
|
+
* Placeholder text for the input
|
|
134
|
+
* @default 'Select something'
|
|
135
|
+
*/
|
|
27
136
|
placeholder?: string | null;
|
|
137
|
+
/**
|
|
138
|
+
* Whether to filter options based on input
|
|
139
|
+
* When false, all options are always shown
|
|
140
|
+
* @default true
|
|
141
|
+
*/
|
|
28
142
|
filterOptions?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Whether to automatically select the first option on filter
|
|
145
|
+
* @default true
|
|
146
|
+
*/
|
|
29
147
|
autoSelect?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Allow adding custom values not in the options list.
|
|
150
|
+
* When true, the current input is shown as the first dropdown option (highlighted)
|
|
151
|
+
* and can be selected or added with Enter.
|
|
152
|
+
* @default true
|
|
153
|
+
*/
|
|
154
|
+
allowCustomValues?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Callback fired when an option is selected/deselected
|
|
157
|
+
* Receives the selected item value and whether it's selected
|
|
158
|
+
*/
|
|
30
159
|
onChange?: (selectedItem: TypeaheadValue, isSelected: boolean) => void;
|
|
160
|
+
/**
|
|
161
|
+
* Callback fired when "Clear All" is clicked (multiple mode)
|
|
162
|
+
*/
|
|
31
163
|
onClearAll?: () => void;
|
|
164
|
+
/**
|
|
165
|
+
* Callback fired when a selected item's remove button is clicked
|
|
166
|
+
* Receives the item value to be removed
|
|
167
|
+
*/
|
|
32
168
|
onRemoveSelectedClick?: (selectedItem: TypeaheadValue) => void;
|
|
169
|
+
/**
|
|
170
|
+
* Callback fired when the selection becomes empty or non-empty
|
|
171
|
+
* Receives a boolean indicating if selection is empty
|
|
172
|
+
*/
|
|
33
173
|
onEmptyChange?: (isEmpty?: boolean) => void;
|
|
174
|
+
/**
|
|
175
|
+
* Custom render function for options
|
|
176
|
+
* Allows customizing the appearance of each option
|
|
177
|
+
* Receives value, input text, and label
|
|
178
|
+
*/
|
|
34
179
|
renderOption?: (data: {
|
|
35
180
|
value: string | number;
|
|
36
181
|
input: string;
|
|
37
182
|
label: string;
|
|
38
183
|
}) => React.ReactNode;
|
|
39
184
|
}
|
|
40
|
-
|
|
185
|
+
/**
|
|
186
|
+
* Props used by the useTypeahead hook
|
|
187
|
+
* Internal type that picks specific props from TypeaheadProps
|
|
188
|
+
*/
|
|
189
|
+
export type UseTypeaheadProps = Pick<TypeaheadProps, 'selectedItems' | 'defaultSelectedItems' | 'isDisabled' | 'children' | 'isMultiple' | 'onChange' | 'onClearAll' | 'onRemoveSelectedClick' | 'onEmptyChange' | 'renderOption' | 'isOpen' | 'className' | 'startIcon' | 'endIcon' | 'startIconClassName' | 'endIconClassName' | 'name' | 'validationSchema' | 'error' | 'success' | 'placeholder' | 'filterOptions' | 'autoSelect' | 'allowCustomValues'>;
|
|
190
|
+
/**
|
|
191
|
+
* Props for TypeaheadOptions container component
|
|
192
|
+
*/
|
|
41
193
|
export interface TypeaheadItemsListProps extends CommonProps {
|
|
42
194
|
children?: React.ReactNode;
|
|
43
195
|
noItemsMessage?: string;
|
|
44
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Props for TypeaheadOption component
|
|
199
|
+
*/
|
|
45
200
|
export interface TypeaheadItemProps extends CommonProps {
|
|
201
|
+
/**
|
|
202
|
+
* Whether this option is currently selected
|
|
203
|
+
*/
|
|
46
204
|
isActive?: boolean;
|
|
205
|
+
/**
|
|
206
|
+
* Whether this option is disabled
|
|
207
|
+
*/
|
|
47
208
|
isDisabled?: boolean;
|
|
209
|
+
/**
|
|
210
|
+
* Value of the option (must be unique)
|
|
211
|
+
*/
|
|
48
212
|
value?: string | number;
|
|
213
|
+
/**
|
|
214
|
+
* Label text for the option
|
|
215
|
+
* Used for filtering and display
|
|
216
|
+
*/
|
|
49
217
|
label?: string | number;
|
|
218
|
+
/**
|
|
219
|
+
* Content to display in the option
|
|
220
|
+
* Can be custom React nodes
|
|
221
|
+
*/
|
|
50
222
|
children?: React.ReactNode;
|
|
223
|
+
/**
|
|
224
|
+
* Avatar or icon to display before the option content
|
|
225
|
+
*/
|
|
51
226
|
avatar?: React.ReactNode;
|
|
227
|
+
/**
|
|
228
|
+
* Click handler for the option
|
|
229
|
+
*/
|
|
52
230
|
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
231
|
+
/**
|
|
232
|
+
* When true, option is a user-typed custom value (shown first, highlighted in blue)
|
|
233
|
+
*/
|
|
234
|
+
isCustomValue?: boolean;
|
|
235
|
+
/**
|
|
236
|
+
* ARIA role for the option (e.g. 'option')
|
|
237
|
+
*/
|
|
238
|
+
role?: string;
|
|
239
|
+
/**
|
|
240
|
+
* ARIA selected state
|
|
241
|
+
*/
|
|
242
|
+
'aria-selected'?: boolean;
|
|
53
243
|
}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { OpenChangeReason } from '@floating-ui/react';
|
|
3
3
|
import { TypeaheadOptionProps, TypeaheadValue, UseTypeaheadProps } from './types';
|
|
4
|
-
|
|
4
|
+
type HandleChangeParams = {
|
|
5
|
+
value?: string | number;
|
|
6
|
+
shouldClose?: boolean;
|
|
7
|
+
resetInput?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const useTypeahead: ({ name, isOpen: isInitOpen, selectedItems: providedSelectedItems, defaultSelectedItems, isDisabled, isMultiple, children, className, startIcon, endIcon, startIconClassName, endIconClassName, validationSchema, error, success, placeholder, filterOptions, autoSelect, allowCustomValues, onChange, onClearAll, onRemoveSelectedClick, onEmptyChange, renderOption, }: UseTypeaheadProps) => {
|
|
5
10
|
isOpen: boolean;
|
|
6
11
|
isDisabled: boolean | undefined;
|
|
7
12
|
optionsWithKey: Record<string | number, TypeaheadOptionProps>;
|
|
8
13
|
selectedItems: TypeaheadValue[];
|
|
9
|
-
inputRef: React.RefObject<HTMLInputElement>;
|
|
14
|
+
inputRef: React.RefObject<HTMLInputElement | null>;
|
|
10
15
|
firstSuggestion: string;
|
|
11
16
|
isMultiple: boolean | undefined;
|
|
12
17
|
typeaheadId: string;
|
|
13
|
-
triggerRef: React.RefObject<HTMLDivElement>;
|
|
18
|
+
triggerRef: React.RefObject<HTMLDivElement | null>;
|
|
14
19
|
className: string | undefined;
|
|
15
20
|
startIcon: React.ReactNode;
|
|
16
21
|
endIcon: React.ReactNode;
|
|
@@ -23,8 +28,10 @@ export declare const useTypeahead: ({ name, isOpen: isInitOpen, selectedItems: p
|
|
|
23
28
|
status: "error" | "success" | "basic";
|
|
24
29
|
error: import("react-hook-form").FieldError | import("react-hook-form").Merge<import("react-hook-form").FieldError, import("react-hook-form").FieldErrorsImpl<any>> | undefined;
|
|
25
30
|
placeholder: string | null | undefined;
|
|
26
|
-
options: (React.ReactElement<
|
|
27
|
-
|
|
31
|
+
options: (React.ReactElement<any, string | React.JSXElementConstructor<any>> | null)[];
|
|
32
|
+
customOptionValue: string | null;
|
|
33
|
+
handleChange: ({ value, shouldClose, resetInput, }: HandleChangeParams) => void;
|
|
34
|
+
useFormResult: import("react-hook-form").UseFormReturn<import("react-hook-form").FieldValues, any, import("react-hook-form").FieldValues>;
|
|
28
35
|
register: import("react-hook-form").UseFormRegister<import("react-hook-form").FieldValues>;
|
|
29
36
|
setValue: import("react-hook-form").UseFormSetValue<import("react-hook-form").FieldValues>;
|
|
30
37
|
onChange: ((selectedItem: TypeaheadValue, isSelected: boolean) => void) | undefined;
|
|
@@ -36,3 +43,4 @@ export declare const useTypeahead: ({ name, isOpen: isInitOpen, selectedItems: p
|
|
|
36
43
|
handleRemoveSelectedClick: (value: string | number) => (e: React.MouseEvent) => void;
|
|
37
44
|
};
|
|
38
45
|
export type UseTypeaheadResult = ReturnType<typeof useTypeahead>;
|
|
46
|
+
export {};
|
|
@@ -1,3 +1,53 @@
|
|
|
1
1
|
import { TypographyProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Typography - Text typography component with semantic variants
|
|
4
|
+
*
|
|
5
|
+
* A flexible typography component that provides consistent text styling across
|
|
6
|
+
* the application. Supports semantic HTML variants (headings, body text, captions)
|
|
7
|
+
* with customizable font weights, colors, and spacing. Automatically renders
|
|
8
|
+
* appropriate HTML elements based on variant while allowing semantic override.
|
|
9
|
+
*
|
|
10
|
+
* @category Components
|
|
11
|
+
* @subcategory Display
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // Heading
|
|
16
|
+
* <Typography variant="h1">Main Title</Typography>
|
|
17
|
+
* <Typography variant="h2">Section Title</Typography>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* // Body text
|
|
23
|
+
* <Typography variant="body1">
|
|
24
|
+
* This is regular body text
|
|
25
|
+
* </Typography>
|
|
26
|
+
* <Typography variant="body2" weight="bold" color="#333">
|
|
27
|
+
* This is bold, darker body text
|
|
28
|
+
* </Typography>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* // Semantic override
|
|
34
|
+
* <Typography variant="h2" as="h1">
|
|
35
|
+
* Looks like h2 but semantically is h1
|
|
36
|
+
* </Typography>
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* // With gutter for spacing
|
|
42
|
+
* <Typography variant="body1" gutter>
|
|
43
|
+
* This text has bottom margin
|
|
44
|
+
* </Typography>
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @accessibility
|
|
48
|
+
* - Uses semantic HTML elements by default
|
|
49
|
+
* - Supports proper heading hierarchy
|
|
50
|
+
* - Respects user font size preferences
|
|
51
|
+
*/
|
|
2
52
|
declare const Typography: import("react").ForwardRefExoticComponent<Omit<TypographyProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
3
53
|
export default Typography;
|
|
@@ -1,11 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the Typography component
|
|
3
|
+
*
|
|
4
|
+
* Text typography component with semantic variants, font weights, and customizable
|
|
5
|
+
* styling. Renders appropriate HTML elements based on variant while allowing
|
|
6
|
+
* custom element override via `as` prop. Supports all standard typography variants
|
|
7
|
+
* from headings to body text and captions.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // Heading variant
|
|
12
|
+
* <Typography variant="h1">Main Title</Typography>
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* // Body text with custom styling
|
|
18
|
+
* <Typography variant="body1" weight="bold" color="#333">
|
|
19
|
+
* Important text
|
|
20
|
+
* </Typography>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* // Semantic override
|
|
26
|
+
* <Typography variant="h2" as="h1">
|
|
27
|
+
* Looks like h2, but renders as h1
|
|
28
|
+
* </Typography>
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
1
31
|
export interface TypographyProps {
|
|
32
|
+
/**
|
|
33
|
+
* Typography variant determining size, line-height, and semantic HTML element
|
|
34
|
+
* - `h1`-`h6`: Heading variants (renders as h1-h6)
|
|
35
|
+
* - `subtitle`: Subtitle text (renders as h6)
|
|
36
|
+
* - `body1`-`body3`: Body text variants (renders as p)
|
|
37
|
+
* - `caption`: Caption/small text (renders as span)
|
|
38
|
+
* @default 'body1'
|
|
39
|
+
*/
|
|
2
40
|
variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'subtitle' | 'body1' | 'body2' | 'body3' | 'caption';
|
|
41
|
+
/**
|
|
42
|
+
* Font weight variant
|
|
43
|
+
* @default 'regular'
|
|
44
|
+
*/
|
|
3
45
|
weight?: 'lighter' | 'regular' | 'medium' | 'bold';
|
|
46
|
+
/**
|
|
47
|
+
* Whether to add bottom margin (gutter)
|
|
48
|
+
* Useful for spacing between typography elements
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
4
51
|
gutter?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Text color (CSS color value)
|
|
54
|
+
* @default 'rgba(43, 45, 49, 1)'
|
|
55
|
+
*/
|
|
5
56
|
color?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Text content to display
|
|
59
|
+
*/
|
|
6
60
|
children: React.ReactNode;
|
|
61
|
+
/**
|
|
62
|
+
* Override the HTML element type
|
|
63
|
+
* Allows semantic HTML override (e.g., h2 variant as h1 element)
|
|
64
|
+
*/
|
|
7
65
|
as?: React.ElementType;
|
|
66
|
+
/**
|
|
67
|
+
* Custom CSS class name
|
|
68
|
+
*/
|
|
8
69
|
className?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Ref to the rendered element
|
|
72
|
+
*/
|
|
9
73
|
ref?: React.Ref<HTMLElement>;
|
|
74
|
+
/**
|
|
75
|
+
* HTML id attribute
|
|
76
|
+
*/
|
|
10
77
|
id?: string;
|
|
11
78
|
}
|
|
@@ -1,2 +1,78 @@
|
|
|
1
1
|
import { UserProfileProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* UserProfile - User profile dropdown with logout functionality
|
|
4
|
+
*
|
|
5
|
+
* A user profile component that displays user information (name, email) and a
|
|
6
|
+
* logout button in a popover dropdown. Supports custom trigger elements, additional
|
|
7
|
+
* information display, and custom content sections. Uses Popover component for
|
|
8
|
+
* positioning and interactions.
|
|
9
|
+
*
|
|
10
|
+
* Component structure:
|
|
11
|
+
* - UserProfile (main component)
|
|
12
|
+
* - Popover (wrapper with positioning)
|
|
13
|
+
* - PopoverTrigger (custom trigger element)
|
|
14
|
+
* - PopoverContent (profile content)
|
|
15
|
+
* - UserInfo (name, email, additional info)
|
|
16
|
+
* - CustomContent (optional custom section)
|
|
17
|
+
* - LogoutButton (logout action)
|
|
18
|
+
*
|
|
19
|
+
* @category Components
|
|
20
|
+
* @subcategory Navigation
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* // Basic user profile with icon trigger
|
|
25
|
+
* <UserProfile
|
|
26
|
+
* name="John Doe"
|
|
27
|
+
* email="john.doe@example.com"
|
|
28
|
+
* trigger={<Icon name="user" size={32} />}
|
|
29
|
+
* onClick={() => handleLogout()}
|
|
30
|
+
* />
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* // With avatar trigger and additional info
|
|
36
|
+
* <UserProfile
|
|
37
|
+
* name="Jane Smith"
|
|
38
|
+
* email="jane@example.com"
|
|
39
|
+
* trigger={<Avatar src="/avatar.jpg" size={40} />}
|
|
40
|
+
* onClick={handleLogout}
|
|
41
|
+
* additionalInfo={[
|
|
42
|
+
* <Typography key="role">Administrator</Typography>,
|
|
43
|
+
* <Typography key="department">Engineering</Typography>,
|
|
44
|
+
* ]}
|
|
45
|
+
* />
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* // With custom content section
|
|
51
|
+
* <UserProfile
|
|
52
|
+
* name="Bob Johnson"
|
|
53
|
+
* email="bob@example.com"
|
|
54
|
+
* trigger={<Button variant="secondary">Profile</Button>}
|
|
55
|
+
* onClick={handleLogout}
|
|
56
|
+
* customContent={
|
|
57
|
+
* <div css={{ padding: '12px', borderTop: '1px solid #eee' }}>
|
|
58
|
+
* <Button onClick={handleSettings} variant="secondary">
|
|
59
|
+
* Settings
|
|
60
|
+
* </Button>
|
|
61
|
+
* </div>
|
|
62
|
+
* }
|
|
63
|
+
* logOutText="Sign Out"
|
|
64
|
+
* />
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @see {@link Popover} - Used for dropdown positioning and interactions
|
|
68
|
+
* @see {@link Icon} - Common trigger element
|
|
69
|
+
* @see {@link Avatar} - Common trigger element
|
|
70
|
+
*
|
|
71
|
+
* @accessibility
|
|
72
|
+
* - ARIA attributes via Popover component
|
|
73
|
+
* - Keyboard navigation support
|
|
74
|
+
* - Screen reader friendly
|
|
75
|
+
* - Proper focus management
|
|
76
|
+
* - Semantic heading structure
|
|
77
|
+
*/
|
|
2
78
|
export declare const UserProfile: ({ name, email, trigger, onClick, logOutText, className, additionalInfo, customContent, }: UserProfileProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -8,8 +8,9 @@ export declare const AdditionalInfoWrapper: import("@emotion/styled").StyledComp
|
|
|
8
8
|
theme?: Theme;
|
|
9
9
|
as?: React.ElementType;
|
|
10
10
|
} & {
|
|
11
|
-
direction?:
|
|
12
|
-
alignItems?:
|
|
11
|
+
direction?: import("../Wrapper").WrapperDirection;
|
|
12
|
+
alignItems?: import("../Wrapper").WrapperAlignItems;
|
|
13
|
+
justifyContent?: import("../Wrapper").WrapperJustifyContent;
|
|
13
14
|
fade?: boolean;
|
|
14
15
|
fadeDelay?: number;
|
|
15
16
|
isVisible?: boolean;
|
|
@@ -20,8 +21,9 @@ export declare const CustomContentWrapper: import("@emotion/styled").StyledCompo
|
|
|
20
21
|
theme?: Theme;
|
|
21
22
|
as?: React.ElementType;
|
|
22
23
|
} & {
|
|
23
|
-
direction?:
|
|
24
|
-
alignItems?:
|
|
24
|
+
direction?: import("../Wrapper").WrapperDirection;
|
|
25
|
+
alignItems?: import("../Wrapper").WrapperAlignItems;
|
|
26
|
+
justifyContent?: import("../Wrapper").WrapperJustifyContent;
|
|
25
27
|
fade?: boolean;
|
|
26
28
|
fadeDelay?: number;
|
|
27
29
|
isVisible?: boolean;
|
|
@@ -1,11 +1,95 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the UserProfile component
|
|
4
|
+
*
|
|
5
|
+
* A user profile dropdown component that displays user information and a logout
|
|
6
|
+
* button in a popover. Supports custom trigger elements, additional info, and
|
|
7
|
+
* custom content sections.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // Basic user profile
|
|
12
|
+
* <UserProfile
|
|
13
|
+
* name="John Doe"
|
|
14
|
+
* email="john.doe@example.com"
|
|
15
|
+
* trigger={<Icon name="user" size={32} />}
|
|
16
|
+
* onClick={() => handleLogout()}
|
|
17
|
+
* />
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* // With additional info
|
|
23
|
+
* <UserProfile
|
|
24
|
+
* name="Jane Smith"
|
|
25
|
+
* email="jane@example.com"
|
|
26
|
+
* trigger={<Avatar src="/avatar.jpg" />}
|
|
27
|
+
* onClick={handleLogout}
|
|
28
|
+
* additionalInfo={[
|
|
29
|
+
* <Typography key="role">Administrator</Typography>,
|
|
30
|
+
* <Typography key="org">Acme Corp</Typography>,
|
|
31
|
+
* ]}
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* // With custom content
|
|
38
|
+
* <UserProfile
|
|
39
|
+
* name="Bob Johnson"
|
|
40
|
+
* email="bob@example.com"
|
|
41
|
+
* trigger={<Button>Profile</Button>}
|
|
42
|
+
* onClick={handleLogout}
|
|
43
|
+
* customContent={
|
|
44
|
+
* <div>
|
|
45
|
+
* <Button onClick={handleSettings}>Settings</Button>
|
|
46
|
+
* <Button onClick={handlePreferences}>Preferences</Button>
|
|
47
|
+
* </div>
|
|
48
|
+
* }
|
|
49
|
+
* logOutText="Sign Out"
|
|
50
|
+
* />
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
2
53
|
export interface UserProfileProps {
|
|
54
|
+
/**
|
|
55
|
+
* User's full name
|
|
56
|
+
* Displayed as heading in the profile popover
|
|
57
|
+
*/
|
|
3
58
|
name: string;
|
|
59
|
+
/**
|
|
60
|
+
* User's email address
|
|
61
|
+
* Displayed as description text in the profile popover
|
|
62
|
+
*/
|
|
4
63
|
email: string;
|
|
5
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Trigger element that opens the profile popover
|
|
66
|
+
* Can be a string, icon, avatar, button, or any React element
|
|
67
|
+
*/
|
|
68
|
+
trigger: string | React.JSX.Element;
|
|
69
|
+
/**
|
|
70
|
+
* Callback function when logout button is clicked
|
|
71
|
+
* Typically handles user logout logic
|
|
72
|
+
*/
|
|
6
73
|
onClick: () => void;
|
|
74
|
+
/**
|
|
75
|
+
* Text for the logout button
|
|
76
|
+
* @default 'Log Out'
|
|
77
|
+
*/
|
|
7
78
|
logOutText?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Custom CSS class name for the popover content
|
|
81
|
+
*/
|
|
8
82
|
className?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Array of additional information elements
|
|
85
|
+
* Displayed between email and custom content sections
|
|
86
|
+
* Each element is rendered in a wrapper div
|
|
87
|
+
*/
|
|
9
88
|
additionalInfo?: ReactNode[];
|
|
89
|
+
/**
|
|
90
|
+
* Custom content section
|
|
91
|
+
* Displayed between user info and logout button
|
|
92
|
+
* Useful for additional actions or information
|
|
93
|
+
*/
|
|
10
94
|
customContent?: ReactNode;
|
|
11
95
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const WidgetCardTitle: import("@emotion/styled").StyledComponent<Omit<import("
|
|
1
|
+
export declare const WidgetCardTitle: import("@emotion/styled").StyledComponent<Omit<import("..").TypographyProps, "ref"> & import("react").RefAttributes<HTMLElement> & {
|
|
2
2
|
theme?: import("@emotion/react").Theme;
|
|
3
3
|
}, {}, {}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const WidgetCardBase: import("@emotion/styled").StyledComponent<import("
|
|
1
|
+
export declare const WidgetCardBase: import("@emotion/styled").StyledComponent<import("..").CardProps & {
|
|
2
2
|
theme?: import("@emotion/react").Theme;
|
|
3
3
|
} & {
|
|
4
4
|
isFullscreenMode?: boolean;
|
|
@@ -4,4 +4,4 @@ export declare const WithLink: ({ link, onClick, children, className, }: {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
onClick?: () => void;
|
|
6
6
|
link?: To;
|
|
7
|
-
}) => string | number | boolean | Iterable<import("react").ReactNode> | import("@emotion/react/jsx-runtime").JSX.Element | null | undefined;
|
|
7
|
+
}) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("@emotion/react/jsx-runtime").JSX.Element | null | undefined;
|