@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,30 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkbox data structure
|
|
3
|
+
* Maps filter group names to arrays of selected item names
|
|
4
|
+
*/
|
|
1
5
|
export type CheckboxData = Record<string, string[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Not changed data structure
|
|
8
|
+
* Tracks checkbox states that haven't been modified
|
|
9
|
+
*/
|
|
2
10
|
export type NotChangedData = Record<string, Record<string, boolean>>;
|
|
11
|
+
/**
|
|
12
|
+
* Single filter item configuration
|
|
13
|
+
* Represents an individual checkbox option within a filter group
|
|
14
|
+
*/
|
|
3
15
|
export interface SingleItem {
|
|
16
|
+
/**
|
|
17
|
+
* Unique identifier for the item
|
|
18
|
+
*/
|
|
4
19
|
key: string;
|
|
20
|
+
/**
|
|
21
|
+
* Item name/identifier
|
|
22
|
+
*/
|
|
5
23
|
name: string;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the item is disabled
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
6
28
|
isDisabled?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Item content configuration
|
|
31
|
+
*/
|
|
7
32
|
content: {
|
|
33
|
+
/**
|
|
34
|
+
* State path for nested data structures
|
|
35
|
+
*/
|
|
8
36
|
statePath: string[];
|
|
37
|
+
/**
|
|
38
|
+
* Display text for the checkbox label
|
|
39
|
+
*/
|
|
9
40
|
text: string;
|
|
10
41
|
};
|
|
11
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Accordion group information
|
|
45
|
+
* Represents a filter group with collapsible accordion functionality
|
|
46
|
+
*/
|
|
12
47
|
export interface AccordionInfo {
|
|
48
|
+
/**
|
|
49
|
+
* Unique identifier for the accordion group
|
|
50
|
+
*/
|
|
13
51
|
id: string;
|
|
52
|
+
/**
|
|
53
|
+
* Group title displayed in accordion header
|
|
54
|
+
*/
|
|
14
55
|
title: string;
|
|
56
|
+
/**
|
|
57
|
+
* Whether the accordion is initially open
|
|
58
|
+
*/
|
|
15
59
|
isOpened: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* ARIA controls attribute for accessibility
|
|
62
|
+
*/
|
|
16
63
|
ariaControls: string;
|
|
64
|
+
/**
|
|
65
|
+
* Whether the entire group is disabled
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
17
68
|
isDisabled?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Filter items within this group
|
|
71
|
+
*/
|
|
18
72
|
items: Record<string, SingleItem>;
|
|
73
|
+
/**
|
|
74
|
+
* Currently selected items (committed state)
|
|
75
|
+
*/
|
|
19
76
|
selectedItems: string[];
|
|
77
|
+
/**
|
|
78
|
+
* Draft selected items (uncommitted changes)
|
|
79
|
+
* Used to track temporary selections before submit
|
|
80
|
+
*/
|
|
20
81
|
selectedItemsDraft?: string[];
|
|
21
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Table filter configuration
|
|
85
|
+
* Maps filter group names to their accordion information
|
|
86
|
+
*/
|
|
22
87
|
export type TableFilterConfig = Record<string, AccordionInfo>;
|
|
88
|
+
/**
|
|
89
|
+
* Props for the TableFilters component
|
|
90
|
+
*
|
|
91
|
+
* A comprehensive filter component for table data that provides grouped checkbox
|
|
92
|
+
* filters in a popover with accordion-style collapsible groups. Supports submit,
|
|
93
|
+
* reset, and clear actions with draft state management.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```tsx
|
|
97
|
+
* const filterConfig: TableFilterConfig = {
|
|
98
|
+
* status: {
|
|
99
|
+
* id: 'status',
|
|
100
|
+
* title: 'Status',
|
|
101
|
+
* isOpened: true,
|
|
102
|
+
* ariaControls: 'status-controls',
|
|
103
|
+
* items: {
|
|
104
|
+
* active: {
|
|
105
|
+
* key: 'active',
|
|
106
|
+
* name: 'active',
|
|
107
|
+
* content: { statePath: [], text: 'Active' },
|
|
108
|
+
* },
|
|
109
|
+
* inactive: {
|
|
110
|
+
* key: 'inactive',
|
|
111
|
+
* name: 'inactive',
|
|
112
|
+
* content: { statePath: [], text: 'Inactive' },
|
|
113
|
+
* },
|
|
114
|
+
* },
|
|
115
|
+
* selectedItems: [],
|
|
116
|
+
* },
|
|
117
|
+
* };
|
|
118
|
+
*
|
|
119
|
+
* <TableFilters
|
|
120
|
+
* checkboxData={filterConfig}
|
|
121
|
+
* onSubmit={() => console.log('Filters applied')}
|
|
122
|
+
* onReset={() => console.log('Filters reset')}
|
|
123
|
+
* onClear={() => console.log('Filters cleared')}
|
|
124
|
+
* />
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
23
127
|
export interface TableFiltersView {
|
|
128
|
+
/**
|
|
129
|
+
* Filter configuration data
|
|
130
|
+
* Maps group names to accordion information with checkbox items
|
|
131
|
+
*/
|
|
132
|
+
checkboxData?: TableFilterConfig;
|
|
133
|
+
/**
|
|
134
|
+
* Callback when filters are submitted/applied
|
|
135
|
+
* Called when user clicks submit button
|
|
136
|
+
*/
|
|
137
|
+
onSubmit?: () => void;
|
|
138
|
+
/**
|
|
139
|
+
* Callback when filters are reset
|
|
140
|
+
* Called when user clicks cancel button (resets to initial state)
|
|
141
|
+
*/
|
|
24
142
|
onReset?: () => void;
|
|
143
|
+
/**
|
|
144
|
+
* Callback when filters are cleared
|
|
145
|
+
* Called when user clicks clear button (removes all selections)
|
|
146
|
+
*/
|
|
25
147
|
onClear?: () => void;
|
|
26
|
-
|
|
148
|
+
/**
|
|
149
|
+
* Callback when a checkbox is toggled
|
|
150
|
+
* Provides group name and item name for the toggled checkbox
|
|
151
|
+
*/
|
|
27
152
|
onCheckboxToggle?: (groupName: string, name: string) => void;
|
|
153
|
+
/**
|
|
154
|
+
* Callback when filter button visibility changes
|
|
155
|
+
* Called when filter groups are added/removed to show/hide filter button
|
|
156
|
+
*/
|
|
28
157
|
handleMoreButtonVisibleChange?: (isVisible: boolean) => void;
|
|
29
|
-
checkboxData?: TableFilterConfig;
|
|
30
158
|
}
|
|
@@ -1,4 +1,41 @@
|
|
|
1
1
|
import { CommonProps } from '../../types/emotion';
|
|
2
|
+
/**
|
|
3
|
+
* TableHead - Header section container for table columns
|
|
4
|
+
*
|
|
5
|
+
* A styled thead element that wraps table header rows. Provides styling
|
|
6
|
+
* for the table header section including bold font weight, border styling,
|
|
7
|
+
* and rounded corners. Used with TableRow and TableCellHeader components.
|
|
8
|
+
*
|
|
9
|
+
* @category Components
|
|
10
|
+
* @subcategory Data Display
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* // Basic table head
|
|
15
|
+
* <Table>
|
|
16
|
+
* <TableHead>
|
|
17
|
+
* <TableRow>
|
|
18
|
+
* <TableCellHeader>Name</TableCellHeader>
|
|
19
|
+
* <TableCellHeader>Email</TableCellHeader>
|
|
20
|
+
* <TableCellHeader>Role</TableCellHeader>
|
|
21
|
+
* </TableRow>
|
|
22
|
+
* </TableHead>
|
|
23
|
+
* <TableBody>
|
|
24
|
+
* // data rows go here
|
|
25
|
+
* </TableBody>
|
|
26
|
+
* </Table>
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @see {@link Table} - Parent table component
|
|
30
|
+
* @see {@link TableRow} - Row component for header
|
|
31
|
+
* @see {@link TableCellHeader} - Header cell component
|
|
32
|
+
* @see {@link TableBody} - Body section component
|
|
33
|
+
*
|
|
34
|
+
* @accessibility
|
|
35
|
+
* - Semantic HTML thead element
|
|
36
|
+
* - Proper table structure for screen readers
|
|
37
|
+
* - Supports ARIA attributes via CommonProps
|
|
38
|
+
*/
|
|
2
39
|
declare const TableHead: import("@emotion/styled").StyledComponent<{
|
|
3
40
|
theme?: import("@emotion/react").Theme;
|
|
4
41
|
as?: React.ElementType;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const TableRow: import("
|
|
3
|
-
theme?: import("@emotion/react").Theme;
|
|
4
|
-
as?: React.ElementType;
|
|
5
|
-
} & CommonProps & {
|
|
6
|
-
isDisabled?: boolean;
|
|
7
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, {}>;
|
|
1
|
+
import { TableRowProps } from './types';
|
|
2
|
+
declare const TableRow: import("react").ForwardRefExoticComponent<TableRowProps & import("react").RefAttributes<HTMLTableRowElement>>;
|
|
8
3
|
export default TableRow;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { CommonProps } from '../../types/emotion';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the TableRow component
|
|
5
|
+
*
|
|
6
|
+
* A styled table row component that represents a single row in a table.
|
|
7
|
+
* Supports disabled state for non-interactive rows.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // Basic table row
|
|
12
|
+
* <TableRow>
|
|
13
|
+
* <TableCell>Data 1</TableCell>
|
|
14
|
+
* <TableCell>Data 2</TableCell>
|
|
15
|
+
* </TableRow>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* // Disabled table row (aria-disabled is automatically set)
|
|
21
|
+
* <TableRow isDisabled>
|
|
22
|
+
* <TableCell>Disabled Row</TableCell>
|
|
23
|
+
* </TableRow>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export interface TableRowProps extends CommonProps, HTMLAttributes<HTMLTableRowElement> {
|
|
27
|
+
/**
|
|
28
|
+
* Whether the row is disabled
|
|
29
|
+
* Disabled rows have reduced opacity and no pointer cursor.
|
|
30
|
+
* Automatically sets aria-disabled attribute when true.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
isDisabled?: boolean;
|
|
34
|
+
}
|
|
@@ -1,3 +1,79 @@
|
|
|
1
1
|
import { TextFieldProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* TextField - Ready-to-use text input (single- or multi-line) with label and validation UI.
|
|
4
|
+
*
|
|
5
|
+
* Purpose: one component for text inputs with built-in label, helper text, validation
|
|
6
|
+
* error/success display, and optional character counting. Renders as Input or Textarea
|
|
7
|
+
* based on the `multirow` prop. Automatically manages status (basic, error, success)
|
|
8
|
+
* from props. Use when you want a complete text field without composing Field primitives;
|
|
9
|
+
* use Field when you need custom layout or non-text controls.
|
|
10
|
+
*
|
|
11
|
+
* @category Form Controls
|
|
12
|
+
* @subcategory Input
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* // Single-line text field
|
|
17
|
+
* const { register } = useForm();
|
|
18
|
+
* <TextField
|
|
19
|
+
* name="username"
|
|
20
|
+
* label="Username"
|
|
21
|
+
* placeholder="Enter your username"
|
|
22
|
+
* register={register}
|
|
23
|
+
* helperText="Choose a unique username"
|
|
24
|
+
* />
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* // Multi-line text field with character count
|
|
30
|
+
* <TextField
|
|
31
|
+
* name="description"
|
|
32
|
+
* label="Description"
|
|
33
|
+
* multirow
|
|
34
|
+
* rows={5}
|
|
35
|
+
* maxLength={500}
|
|
36
|
+
* register={register}
|
|
37
|
+
* helperText="Tell us about yourself"
|
|
38
|
+
* />
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // Text field with validation errors
|
|
44
|
+
* <TextField
|
|
45
|
+
* name="email"
|
|
46
|
+
* label="Email Address"
|
|
47
|
+
* register={register}
|
|
48
|
+
* errors={errors.email}
|
|
49
|
+
* helperText="We'll never share your email"
|
|
50
|
+
* />
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* // Success state
|
|
56
|
+
* <TextField
|
|
57
|
+
* name="username"
|
|
58
|
+
* label="Username"
|
|
59
|
+
* register={register}
|
|
60
|
+
* success={isValid}
|
|
61
|
+
* helperText="Username is available!"
|
|
62
|
+
* />
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @see {@link Input} - For single-line input component
|
|
66
|
+
* @see {@link Textarea} - For multi-line textarea component
|
|
67
|
+
* @see {@link Field} - For more advanced field layout with Field.Root
|
|
68
|
+
*
|
|
69
|
+
* @note React Hook Form integration is optional. If `register` is not provided,
|
|
70
|
+
* the component will still work but validation features will be unavailable.
|
|
71
|
+
*
|
|
72
|
+
* @accessibility
|
|
73
|
+
* - Full keyboard navigation support
|
|
74
|
+
* - Screen reader friendly with proper labels
|
|
75
|
+
* - ARIA attributes via React Hook Form (when register is provided)
|
|
76
|
+
* - Error messages announced to screen readers
|
|
77
|
+
*/
|
|
2
78
|
declare const TextField: ({ multirow, name, label, errors, helperText, success, disabled, maxLength, ...props }: TextFieldProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
79
|
export default TextField;
|
|
@@ -1,11 +1,91 @@
|
|
|
1
1
|
import type { UseFormReturn, FieldError } from 'react-hook-form';
|
|
2
2
|
import { InputProps } from '../Input/types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the TextField component
|
|
5
|
+
*
|
|
6
|
+
* A unified text input component that can render as either a single-line Input
|
|
7
|
+
* or multi-line Textarea based on the `multirow` prop. Includes built-in label,
|
|
8
|
+
* helper text, error handling, and character counting. Automatically switches
|
|
9
|
+
* between Input and Textarea components while maintaining consistent API.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Single-line text field
|
|
14
|
+
* const { register } = useForm();
|
|
15
|
+
* <TextField
|
|
16
|
+
* name="username"
|
|
17
|
+
* label="Username"
|
|
18
|
+
* placeholder="Enter your username"
|
|
19
|
+
* register={register}
|
|
20
|
+
* helperText="Choose a unique username"
|
|
21
|
+
* />
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* // Multi-line text field
|
|
27
|
+
* <TextField
|
|
28
|
+
* name="description"
|
|
29
|
+
* label="Description"
|
|
30
|
+
* multirow
|
|
31
|
+
* rows={5}
|
|
32
|
+
* maxLength={500}
|
|
33
|
+
* register={register}
|
|
34
|
+
* helperText="Maximum 500 characters"
|
|
35
|
+
* />
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* // Text field with validation
|
|
41
|
+
* <TextField
|
|
42
|
+
* name="email"
|
|
43
|
+
* label="Email"
|
|
44
|
+
* register={register}
|
|
45
|
+
* errors={errors.email}
|
|
46
|
+
* helperText="We'll never share your email"
|
|
47
|
+
* />
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @note React Hook Form integration is optional. If `register` is not provided,
|
|
51
|
+
* the component will still work but validation features will be unavailable.
|
|
52
|
+
*/
|
|
3
53
|
export interface TextFieldProps extends InputProps, Partial<Pick<UseFormReturn, 'register'>> {
|
|
54
|
+
/**
|
|
55
|
+
* Label text displayed above the input field
|
|
56
|
+
*/
|
|
4
57
|
label?: string;
|
|
58
|
+
/**
|
|
59
|
+
* React Hook Form field error object
|
|
60
|
+
* Used to display validation error messages
|
|
61
|
+
*/
|
|
5
62
|
errors?: FieldError;
|
|
63
|
+
/**
|
|
64
|
+
* Whether to display success state styling
|
|
65
|
+
* When true, status is set to 'success'
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
6
68
|
success?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Helper text displayed below the input
|
|
71
|
+
* Shown when no errors are present
|
|
72
|
+
*/
|
|
7
73
|
helperText?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Number of rows for multi-row text fields
|
|
76
|
+
* Only applies when `multirow` is true
|
|
77
|
+
* @default undefined (uses Textarea default)
|
|
78
|
+
*/
|
|
8
79
|
rows?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Whether to render as multi-line textarea
|
|
82
|
+
* When true, uses Textarea component; when false, uses Input component
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
9
85
|
multirow?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Maximum character length
|
|
88
|
+
* When provided, displays character count (e.g., "45 / 500")
|
|
89
|
+
*/
|
|
10
90
|
maxLength?: number;
|
|
11
91
|
}
|
|
@@ -1,4 +1,85 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextareaProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Textarea - Multi-line text input component
|
|
5
|
+
*
|
|
6
|
+
* A textarea component with React Hook Form integration, validation support,
|
|
7
|
+
* character limits, and paste handling. Designed for longer text input such as
|
|
8
|
+
* comments, descriptions, messages, or any multi-line content.
|
|
9
|
+
*
|
|
10
|
+
* @category Form Controls
|
|
11
|
+
* @subcategory Input
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // Basic textarea with React Hook Form
|
|
16
|
+
* const { register } = useForm();
|
|
17
|
+
* <Textarea
|
|
18
|
+
* name="message"
|
|
19
|
+
* placeholder="Enter your message"
|
|
20
|
+
* register={register}
|
|
21
|
+
* rows={5}
|
|
22
|
+
* />
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* // Textarea with validation and character limit
|
|
28
|
+
* const { register } = useForm();
|
|
29
|
+
* const [charCount, setCharCount] = useState(0);
|
|
30
|
+
*
|
|
31
|
+
* <Textarea
|
|
32
|
+
* name="description"
|
|
33
|
+
* placeholder="Describe your project..."
|
|
34
|
+
* register={register}
|
|
35
|
+
* validationSchema={{
|
|
36
|
+
* required: 'Description is required',
|
|
37
|
+
* maxLength: { value: 500, message: 'Maximum 500 characters' }
|
|
38
|
+
* }}
|
|
39
|
+
* maxLength={500}
|
|
40
|
+
* rows={8}
|
|
41
|
+
* setCountChar={(e) => setCharCount(e.target.value.length)}
|
|
42
|
+
* />
|
|
43
|
+
* <span>{charCount} / 500 characters</span>
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* // Using with Field component
|
|
49
|
+
* <Field.Root>
|
|
50
|
+
* <Field.Label htmlFor="comments">Comments</Field.Label>
|
|
51
|
+
* <Field.Control>
|
|
52
|
+
* <Textarea
|
|
53
|
+
* id="comments"
|
|
54
|
+
* name="comments"
|
|
55
|
+
* register={register}
|
|
56
|
+
* rows={6}
|
|
57
|
+
* css={{ width: '100%', border: '0 !important' }}
|
|
58
|
+
* />
|
|
59
|
+
* </Field.Control>
|
|
60
|
+
* <Field.Description>Optional feedback or notes</Field.Description>
|
|
61
|
+
* </Field.Root>
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* // Standalone textarea without React Hook Form
|
|
67
|
+
* <Textarea
|
|
68
|
+
* name="notes"
|
|
69
|
+
* placeholder="Enter notes..."
|
|
70
|
+
* rows={5}
|
|
71
|
+
* onChange={(e) => handleChange(e.target.value)}
|
|
72
|
+
* />
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @see {@link Field} - Use Field.Root to wrap Textarea for labels and validation
|
|
76
|
+
* @see {@link Input} - For single-line text input
|
|
77
|
+
*
|
|
78
|
+
* @accessibility
|
|
79
|
+
* - Full keyboard navigation support
|
|
80
|
+
* - Screen reader friendly
|
|
81
|
+
* - ARIA attributes via React Hook Form (when register is provided)
|
|
82
|
+
* - Respects disabled and readOnly states
|
|
83
|
+
*/
|
|
3
84
|
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
4
85
|
export default Textarea;
|
|
@@ -1,16 +1,111 @@
|
|
|
1
1
|
import { ReactEventHandler } from 'react';
|
|
2
2
|
import type { UseFormReturn } from 'react-hook-form';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Textarea component
|
|
5
|
+
*
|
|
6
|
+
* A multi-line text input component with React Hook Form integration and validation.
|
|
7
|
+
* Supports character limits, paste handling, and all standard textarea features.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // Basic textarea with React Hook Form
|
|
12
|
+
* const { register } = useForm();
|
|
13
|
+
* <Textarea
|
|
14
|
+
* name="message"
|
|
15
|
+
* placeholder="Enter your message"
|
|
16
|
+
* register={register}
|
|
17
|
+
* rows={5}
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* // Textarea with validation and character limit
|
|
24
|
+
* <Textarea
|
|
25
|
+
* name="description"
|
|
26
|
+
* register={register}
|
|
27
|
+
* validationSchema={{
|
|
28
|
+
* required: 'Description is required',
|
|
29
|
+
* maxLength: { value: 500, message: 'Maximum 500 characters' }
|
|
30
|
+
* }}
|
|
31
|
+
* maxLength={500}
|
|
32
|
+
* rows={10}
|
|
33
|
+
* />
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* // Read-only textarea
|
|
39
|
+
* <Textarea
|
|
40
|
+
* name="readonly-content"
|
|
41
|
+
* register={register}
|
|
42
|
+
* readOnly
|
|
43
|
+
* rows={8}
|
|
44
|
+
* />
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @note React Hook Form integration is optional. If `register` is not provided,
|
|
48
|
+
* the component will still work but validation features will be unavailable.
|
|
49
|
+
*/
|
|
3
50
|
export interface TextareaProps extends Partial<Pick<UseFormReturn, 'register'>> {
|
|
51
|
+
/**
|
|
52
|
+
* Name attribute for the textarea, required for React Hook Form integration
|
|
53
|
+
*/
|
|
4
54
|
name: string;
|
|
55
|
+
/**
|
|
56
|
+
* Placeholder text displayed when textarea is empty
|
|
57
|
+
*/
|
|
5
58
|
placeholder?: string;
|
|
59
|
+
/**
|
|
60
|
+
* React Hook Form validation schema
|
|
61
|
+
* Object containing validation rules (required, maxLength, pattern, etc.)
|
|
62
|
+
*/
|
|
6
63
|
validationSchema?: Record<string, unknown>;
|
|
64
|
+
/**
|
|
65
|
+
* Whether the textarea is disabled
|
|
66
|
+
* Disabled textarea elements cannot be edited
|
|
67
|
+
* @default false
|
|
68
|
+
*/
|
|
7
69
|
disabled?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Whether the textarea is read-only
|
|
72
|
+
* Read-only textarea elements can be focused and scrolled but not edited
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
8
75
|
readOnly?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Number of visible text rows
|
|
78
|
+
* Determines the initial height of the textarea
|
|
79
|
+
* @default 10
|
|
80
|
+
*/
|
|
9
81
|
rows?: number;
|
|
82
|
+
/**
|
|
83
|
+
* Maximum character length for the textarea
|
|
84
|
+
* Use with setCountChar callback to track character count
|
|
85
|
+
*/
|
|
10
86
|
maxLength?: number;
|
|
87
|
+
/**
|
|
88
|
+
* Custom element type to render as (for composition)
|
|
89
|
+
*/
|
|
11
90
|
as?: React.ElementType;
|
|
91
|
+
/**
|
|
92
|
+
* Custom CSS class name
|
|
93
|
+
*/
|
|
12
94
|
className?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Title attribute for the textarea element
|
|
97
|
+
* Provides tooltip text on hover
|
|
98
|
+
*/
|
|
13
99
|
title?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Paste event handler
|
|
102
|
+
* Fired when content is pasted into the textarea
|
|
103
|
+
*/
|
|
14
104
|
onPaste?: React.ClipboardEventHandler<HTMLTextAreaElement>;
|
|
105
|
+
/**
|
|
106
|
+
* Callback function to track character count
|
|
107
|
+
* Called with the event when content changes
|
|
108
|
+
* Useful for displaying character count UI
|
|
109
|
+
*/
|
|
15
110
|
setCountChar?: ReactEventHandler;
|
|
16
111
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { LineSeries } from '@nivo/line';
|
|
1
2
|
import { SimpleChartTooltipProps } from './types';
|
|
2
|
-
export declare const SimpleChartTooltip: ({ point, size, renderValue, }: SimpleChartTooltipProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const SimpleChartTooltip: <Series extends LineSeries>({ point, size, renderValue, }: SimpleChartTooltipProps<Series>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,76 @@
|
|
|
1
1
|
import { TooltipProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Tooltip - Contextual information component
|
|
4
|
+
*
|
|
5
|
+
* A flexible tooltip system built on Floating UI that provides contextual
|
|
6
|
+
* information when users interact with trigger elements. Uses a compound
|
|
7
|
+
* component pattern with Tooltip (root), TooltipTrigger (activator), and
|
|
8
|
+
* TooltipContent (display).
|
|
9
|
+
*
|
|
10
|
+
* Supports multiple interaction modes (hover, click, follow cursor), flexible
|
|
11
|
+
* positioning with auto-adjustment, and customizable appearance with size
|
|
12
|
+
* variants and optional arrows.
|
|
13
|
+
*
|
|
14
|
+
* @category Components
|
|
15
|
+
* @subcategory Overlay
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* // Basic tooltip on hover
|
|
20
|
+
* <Tooltip>
|
|
21
|
+
* <TooltipTrigger>
|
|
22
|
+
* <Button>Hover me</Button>
|
|
23
|
+
* </TooltipTrigger>
|
|
24
|
+
* <TooltipContent>This is helpful information</TooltipContent>
|
|
25
|
+
* </Tooltip>
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* // Tooltip with custom placement
|
|
31
|
+
* <Tooltip placement="bottom" size="large">
|
|
32
|
+
* <TooltipTrigger>
|
|
33
|
+
* <Icon name="info" />
|
|
34
|
+
* </TooltipTrigger>
|
|
35
|
+
* <TooltipContent>
|
|
36
|
+
* <div>
|
|
37
|
+
* <strong>Detailed Information</strong>
|
|
38
|
+
* <p>This is a larger tooltip with more content</p>
|
|
39
|
+
* </div>
|
|
40
|
+
* </TooltipContent>
|
|
41
|
+
* </Tooltip>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* // Click-to-open tooltip
|
|
47
|
+
* <Tooltip enableClick enableHover={false}>
|
|
48
|
+
* <TooltipTrigger>
|
|
49
|
+
* <Button>Click for info</Button>
|
|
50
|
+
* </TooltipTrigger>
|
|
51
|
+
* <TooltipContent>Information that appears on click</TooltipContent>
|
|
52
|
+
* </Tooltip>
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* // Tooltip without arrow
|
|
58
|
+
* <Tooltip hasArrow={false}>
|
|
59
|
+
* <TooltipTrigger>
|
|
60
|
+
* <span>?</span>
|
|
61
|
+
* </TooltipTrigger>
|
|
62
|
+
* <TooltipContent>No arrow tooltip</TooltipContent>
|
|
63
|
+
* </Tooltip>
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @see {@link TooltipTrigger} - Trigger element component
|
|
67
|
+
* @see {@link TooltipContent} - Content display component
|
|
68
|
+
*
|
|
69
|
+
* @accessibility
|
|
70
|
+
* - Keyboard accessible (ESC to close)
|
|
71
|
+
* - Focus management for click-triggered tooltips
|
|
72
|
+
* - ARIA attributes automatically applied
|
|
73
|
+
* - Screen reader friendly
|
|
74
|
+
*/
|
|
2
75
|
declare const Tooltip: ({ children, ...props }: TooltipProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
76
|
export default Tooltip;
|