@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,44 +1,222 @@
|
|
|
1
1
|
import { CommonProps } from '../../types/emotion';
|
|
2
2
|
import { InputProps } from '../Input/types';
|
|
3
3
|
import { RowsPerPageDropdownProps } from './components/RowsPerPageDropdown/types';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the Pagination component
|
|
6
|
+
*
|
|
7
|
+
* A comprehensive pagination component that provides navigation controls for
|
|
8
|
+
* paginated data. Supports page navigation, manual page input, and rows per page
|
|
9
|
+
* selection. Requires PaginationContextProvider to manage page state.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <PaginationContextProvider selectedPage={1}>
|
|
14
|
+
* <Pagination pagesCount={10} />
|
|
15
|
+
* </PaginationContextProvider>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* // With rows per page dropdown
|
|
21
|
+
* <PaginationContextProvider selectedPage={1} defaultPerPage={25}>
|
|
22
|
+
* <Pagination
|
|
23
|
+
* pagesCount={20}
|
|
24
|
+
* isRowPerPageVisible={true}
|
|
25
|
+
* rowPerPageProps={{
|
|
26
|
+
* rowsPerPageList: [
|
|
27
|
+
* { id: 1, value: 10 },
|
|
28
|
+
* { id: 2, value: 25 },
|
|
29
|
+
* { id: 3, value: 50 },
|
|
30
|
+
* ],
|
|
31
|
+
* }}
|
|
32
|
+
* />
|
|
33
|
+
* </PaginationContextProvider>
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* // With manual page input
|
|
39
|
+
* <PaginationContextProvider selectedPage={3}>
|
|
40
|
+
* <Pagination
|
|
41
|
+
* pagesCount={15}
|
|
42
|
+
* isPageSettingVisible={true}
|
|
43
|
+
* pageNumberPlaceholder="Go to page"
|
|
44
|
+
* />
|
|
45
|
+
* </PaginationContextProvider>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
4
48
|
export interface PaginationProps extends CommonProps {
|
|
49
|
+
/**
|
|
50
|
+
* Total number of pages
|
|
51
|
+
* Required to calculate page range and navigation limits
|
|
52
|
+
*/
|
|
5
53
|
pagesCount: number;
|
|
54
|
+
/**
|
|
55
|
+
* ARIA label for the pagination navigation
|
|
56
|
+
* @default 'Pagination'
|
|
57
|
+
*/
|
|
6
58
|
ariaLabel?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Whether the pagination is disabled
|
|
61
|
+
* Disabled pagination prevents all navigation actions
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
7
64
|
isDisabled?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Placeholder text for manual page input
|
|
67
|
+
* Only shown when isPageSettingVisible is true
|
|
68
|
+
* @default 'Page №'
|
|
69
|
+
*/
|
|
8
70
|
pageNumberPlaceholder?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Whether to show manual page number input
|
|
73
|
+
* Allows users to jump directly to a specific page
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
9
76
|
isPageSettingVisible?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Whether to show rows per page dropdown
|
|
79
|
+
* Allows users to control how many items are displayed per page
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
10
82
|
isRowPerPageVisible?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Whether to show page count display (e.g., "3 / 15")
|
|
85
|
+
* Only shown when isPageSettingVisible is true
|
|
86
|
+
* @default true
|
|
87
|
+
*/
|
|
11
88
|
isPageFromCountVisible?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Props for the rows per page dropdown
|
|
91
|
+
* Only used when isRowPerPageVisible is true
|
|
92
|
+
*/
|
|
12
93
|
rowPerPageProps?: RowsPerPageDropdownProps;
|
|
94
|
+
/**
|
|
95
|
+
* Props for the manual page number input
|
|
96
|
+
* Only used when isPageSettingVisible is true
|
|
97
|
+
*/
|
|
13
98
|
manualPageNumberProps?: InputProps;
|
|
99
|
+
/**
|
|
100
|
+
* Error tooltip message for invalid page number input
|
|
101
|
+
* @default 'The value is out of range'
|
|
102
|
+
*/
|
|
14
103
|
errorTooltip?: string;
|
|
15
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Props for PaginationButtons component
|
|
107
|
+
* Internal component that renders the numbered page buttons
|
|
108
|
+
*/
|
|
16
109
|
export interface PaginationButtonsProps {
|
|
110
|
+
/**
|
|
111
|
+
* Array of page numbers to display
|
|
112
|
+
*/
|
|
17
113
|
range: number[];
|
|
114
|
+
/**
|
|
115
|
+
* Currently selected page number
|
|
116
|
+
*/
|
|
18
117
|
selectedPage?: number;
|
|
118
|
+
/**
|
|
119
|
+
* Callback function when a page button is clicked
|
|
120
|
+
*/
|
|
19
121
|
onClick: (page: number) => void;
|
|
122
|
+
/**
|
|
123
|
+
* Whether the buttons are disabled
|
|
124
|
+
* @default false
|
|
125
|
+
*/
|
|
20
126
|
isDisabled?: boolean;
|
|
21
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Props for ArrowButton component
|
|
130
|
+
* Internal component for previous/next navigation arrows
|
|
131
|
+
*/
|
|
22
132
|
export interface ArrowButtonProps {
|
|
133
|
+
/**
|
|
134
|
+
* Direction of the arrow button
|
|
135
|
+
*/
|
|
23
136
|
direction: 'left' | 'right';
|
|
137
|
+
/**
|
|
138
|
+
* Callback function when arrow button is clicked
|
|
139
|
+
*/
|
|
24
140
|
onClick: () => void;
|
|
141
|
+
/**
|
|
142
|
+
* Whether the button is disabled
|
|
143
|
+
* @default false
|
|
144
|
+
*/
|
|
25
145
|
isDisabled?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Custom CSS class name
|
|
148
|
+
*/
|
|
26
149
|
className?: string;
|
|
27
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Props for PageButton component
|
|
153
|
+
* Internal component for individual page number buttons
|
|
154
|
+
*/
|
|
28
155
|
export interface PageButtonProps {
|
|
156
|
+
/**
|
|
157
|
+
* Callback function when page button is clicked
|
|
158
|
+
*/
|
|
29
159
|
onClick: () => void;
|
|
160
|
+
/**
|
|
161
|
+
* Page number or ellipsis string to display
|
|
162
|
+
*/
|
|
30
163
|
page: number | string;
|
|
164
|
+
/**
|
|
165
|
+
* Whether this page is currently selected
|
|
166
|
+
*/
|
|
31
167
|
isSelected: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Whether the button is disabled
|
|
170
|
+
* @default false
|
|
171
|
+
*/
|
|
32
172
|
isDisabled?: boolean;
|
|
33
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Pagination context value
|
|
176
|
+
* Provides page state and navigation functions to child components
|
|
177
|
+
*/
|
|
34
178
|
export interface PaginationContextProps {
|
|
179
|
+
/**
|
|
180
|
+
* Current page number (1-indexed)
|
|
181
|
+
*/
|
|
35
182
|
page?: number;
|
|
183
|
+
/**
|
|
184
|
+
* Number of items per page
|
|
185
|
+
*/
|
|
36
186
|
perPage: number;
|
|
187
|
+
/**
|
|
188
|
+
* Function to set the current page number
|
|
189
|
+
*/
|
|
37
190
|
setPage: React.Dispatch<React.SetStateAction<number | undefined>>;
|
|
191
|
+
/**
|
|
192
|
+
* Function to set the number of items per page
|
|
193
|
+
*/
|
|
38
194
|
setPerPage: React.Dispatch<React.SetStateAction<number>>;
|
|
39
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* Props for PaginationContextProvider component
|
|
198
|
+
* Context provider that manages pagination state for child components
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```tsx
|
|
202
|
+
* <PaginationContextProvider selectedPage={1} defaultPerPage={25}>
|
|
203
|
+
* <Pagination pagesCount={10} />
|
|
204
|
+
* </PaginationContextProvider>
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
40
207
|
export interface PaginationContextProviderProps {
|
|
208
|
+
/**
|
|
209
|
+
* Initial selected page number (1-indexed)
|
|
210
|
+
*/
|
|
41
211
|
selectedPage?: number;
|
|
212
|
+
/**
|
|
213
|
+
* Default number of items per page
|
|
214
|
+
* @default 10
|
|
215
|
+
*/
|
|
42
216
|
defaultPerPage?: number;
|
|
217
|
+
/**
|
|
218
|
+
* Child components that use pagination context
|
|
219
|
+
* Must include Pagination component
|
|
220
|
+
*/
|
|
43
221
|
children: React.ReactNode;
|
|
44
222
|
}
|
|
@@ -58,7 +58,7 @@ export declare const BadgeWrapper: import("@emotion/styled").StyledComponent<{
|
|
|
58
58
|
theme?: Theme;
|
|
59
59
|
as?: React.ElementType;
|
|
60
60
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
61
|
-
export declare const StyledBadge: import("@emotion/styled").StyledComponent<Omit<Omit<import("react").HTMLProps<HTMLDivElement>, "size"> & import("
|
|
61
|
+
export declare const StyledBadge: import("@emotion/styled").StyledComponent<Omit<Omit<import("react").HTMLProps<HTMLDivElement>, "size"> & import("..").BadgeProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
|
|
62
62
|
theme?: Theme;
|
|
63
63
|
}, {}, {}>;
|
|
64
64
|
export declare const CustomBadge: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,5 +1,125 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PopoverOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Popover - Floating content container component
|
|
5
|
+
*
|
|
6
|
+
* A flexible popover system built on Floating UI that provides floating content
|
|
7
|
+
* containers relative to trigger elements. Uses a compound component pattern with
|
|
8
|
+
* Popover (root), PopoverTrigger (activator), PopoverContent (display),
|
|
9
|
+
* PopoverHeading, PopoverDescription, and PopoverClose (content helpers).
|
|
10
|
+
*
|
|
11
|
+
* Supports multiple interaction modes (click, hover, both), flexible positioning
|
|
12
|
+
* with auto-adjustment via Floating UI middleware, modal and non-modal modes,
|
|
13
|
+
* and comprehensive accessibility features including ARIA attributes and focus
|
|
14
|
+
* management.
|
|
15
|
+
*
|
|
16
|
+
* @category Components
|
|
17
|
+
* @subcategory Overlay
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* // Basic popover on click
|
|
22
|
+
* <Popover>
|
|
23
|
+
* <PopoverTrigger>
|
|
24
|
+
* <Button>Open Popover</Button>
|
|
25
|
+
* </PopoverTrigger>
|
|
26
|
+
* <PopoverContent>
|
|
27
|
+
* <PopoverHeading variant="h4">Popover Title</PopoverHeading>
|
|
28
|
+
* <PopoverDescription>
|
|
29
|
+
* This is the popover content with helpful information.
|
|
30
|
+
* </PopoverDescription>
|
|
31
|
+
* <PopoverClose>Close</PopoverClose>
|
|
32
|
+
* </PopoverContent>
|
|
33
|
+
* </Popover>
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* // Popover with hover interaction
|
|
39
|
+
* <Popover interactionsEnabled="hover">
|
|
40
|
+
* <PopoverTrigger>
|
|
41
|
+
* <Icon name="info" />
|
|
42
|
+
* </PopoverTrigger>
|
|
43
|
+
* <PopoverContent>
|
|
44
|
+
* <PopoverHeading variant="h4">Information</PopoverHeading>
|
|
45
|
+
* <PopoverDescription>
|
|
46
|
+
* This popover appears on hover.
|
|
47
|
+
* </PopoverDescription>
|
|
48
|
+
* </PopoverContent>
|
|
49
|
+
* </Popover>
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```tsx
|
|
54
|
+
* // Popover with custom placement
|
|
55
|
+
* <Popover placement="top">
|
|
56
|
+
* <PopoverTrigger>
|
|
57
|
+
* <Button>Show Above</Button>
|
|
58
|
+
* </PopoverTrigger>
|
|
59
|
+
* <PopoverContent>
|
|
60
|
+
* <PopoverDescription>
|
|
61
|
+
* This popover appears above the trigger element.
|
|
62
|
+
* </PopoverDescription>
|
|
63
|
+
* <PopoverClose>Close</PopoverClose>
|
|
64
|
+
* </PopoverContent>
|
|
65
|
+
* </Popover>
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```tsx
|
|
70
|
+
* // Advanced positioning with Floating UI middleware
|
|
71
|
+
* <Popover
|
|
72
|
+
* placement="top"
|
|
73
|
+
* floatingOptions={{
|
|
74
|
+
* middleware: [
|
|
75
|
+
* offset(10),
|
|
76
|
+
* flip(),
|
|
77
|
+
* shift({ padding: 8 }),
|
|
78
|
+
* ],
|
|
79
|
+
* }}>
|
|
80
|
+
* <PopoverTrigger>
|
|
81
|
+
* <Button>Smart Positioning</Button>
|
|
82
|
+
* </PopoverTrigger>
|
|
83
|
+
* <PopoverContent>
|
|
84
|
+
* <PopoverHeading variant="h4">Smart Positioning</PopoverHeading>
|
|
85
|
+
* <PopoverDescription>
|
|
86
|
+
* This popover automatically adjusts its position to stay in view.
|
|
87
|
+
* </PopoverDescription>
|
|
88
|
+
* <PopoverClose>Close</PopoverClose>
|
|
89
|
+
* </PopoverContent>
|
|
90
|
+
* </Popover>
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```tsx
|
|
95
|
+
* // Modal popover with controlled state
|
|
96
|
+
* <Popover modal open={isOpen} onOpenChange={setIsOpen}>
|
|
97
|
+
* <PopoverTrigger>
|
|
98
|
+
* <Button>Open Modal Popover</Button>
|
|
99
|
+
* </PopoverTrigger>
|
|
100
|
+
* <PopoverContent>
|
|
101
|
+
* <PopoverHeading variant="h4">Modal Popover</PopoverHeading>
|
|
102
|
+
* <PopoverDescription>
|
|
103
|
+
* This is a modal popover that traps focus.
|
|
104
|
+
* </PopoverDescription>
|
|
105
|
+
* <PopoverClose>Close</PopoverClose>
|
|
106
|
+
* </PopoverContent>
|
|
107
|
+
* </Popover>
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* @see {@link PopoverTrigger} - Trigger element component
|
|
111
|
+
* @see {@link PopoverContent} - Content display component
|
|
112
|
+
* @see {@link PopoverHeading} - Accessible heading component
|
|
113
|
+
* @see {@link PopoverDescription} - Accessible description component
|
|
114
|
+
* @see {@link PopoverClose} - Close button component
|
|
115
|
+
*
|
|
116
|
+
* @accessibility
|
|
117
|
+
* - Keyboard accessible (ESC to close, Enter/Space to activate)
|
|
118
|
+
* - Focus management with FloatingFocusManager for modal popovers
|
|
119
|
+
* - ARIA attributes automatically applied (role, aria-labelledby, aria-describedby)
|
|
120
|
+
* - Screen reader friendly with semantic heading and description components
|
|
121
|
+
* - Focus trap for modal popovers
|
|
122
|
+
*/
|
|
3
123
|
export declare const Popover: ({ children, modal, ...restOptions }: {
|
|
4
124
|
children: React.ReactNode;
|
|
5
125
|
} & PopoverOptions) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,28 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* PopoverClose - Close button for popover
|
|
4
|
+
*
|
|
5
|
+
* Renders a button that closes the popover when clicked. Uses Button component
|
|
6
|
+
* with secondary variant by default. Automatically handles closing the popover
|
|
7
|
+
* and supports all standard button props.
|
|
8
|
+
*
|
|
9
|
+
* @category Components
|
|
10
|
+
* @subcategory Overlay
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <PopoverClose>Close</PopoverClose>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* // Custom button text and styling
|
|
20
|
+
* <PopoverClose size="small" variant="primary">
|
|
21
|
+
* Done
|
|
22
|
+
* </PopoverClose>
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @see {@link Popover} - Root component
|
|
26
|
+
* @see {@link PopoverContent} - Content container component
|
|
27
|
+
*/
|
|
2
28
|
export declare const PopoverClose: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MountMode } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* PopoverContent - Content container for popover
|
|
5
|
+
*
|
|
6
|
+
* Renders the actual popover content that appears when the trigger is activated.
|
|
7
|
+
* Automatically positioned using Floating UI, supports portal rendering, and
|
|
8
|
+
* includes focus management for modal popovers. Can be configured to unmount
|
|
9
|
+
* or keep mounted when closed.
|
|
10
|
+
*
|
|
11
|
+
* @category Components
|
|
12
|
+
* @subcategory Overlay
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <PopoverContent>
|
|
17
|
+
* <PopoverHeading variant="h4">Title</PopoverHeading>
|
|
18
|
+
* <PopoverDescription>Content goes here</PopoverDescription>
|
|
19
|
+
* <PopoverClose>Close</PopoverClose>
|
|
20
|
+
* </PopoverContent>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* // Keep content mounted when closed
|
|
26
|
+
* <PopoverContent mountMode="keep-mounted">
|
|
27
|
+
* <div>This stays in DOM when closed</div>
|
|
28
|
+
* </PopoverContent>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @see {@link Popover} - Root component
|
|
32
|
+
* @see {@link PopoverTrigger} - Trigger element component
|
|
33
|
+
* @see {@link PopoverHeading} - Accessible heading component
|
|
34
|
+
* @see {@link PopoverDescription} - Accessible description component
|
|
35
|
+
*/
|
|
3
36
|
export declare const PopoverContent: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLDivElement> & {
|
|
4
37
|
isFocusManagerDisabled?: boolean;
|
|
5
38
|
mountMode?: MountMode;
|
|
@@ -1,2 +1,23 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* PopoverDescription - Accessible description for popover
|
|
4
|
+
*
|
|
5
|
+
* Provides an accessible description for the popover content. Automatically sets
|
|
6
|
+
* `aria-describedby` on the PopoverContent when mounted. Uses Typography component
|
|
7
|
+
* for consistent styling and supports all Typography props.
|
|
8
|
+
*
|
|
9
|
+
* @category Components
|
|
10
|
+
* @subcategory Overlay
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <PopoverDescription variant="body1">
|
|
15
|
+
* This is the description text for the popover content.
|
|
16
|
+
* </PopoverDescription>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @see {@link Popover} - Root component
|
|
20
|
+
* @see {@link PopoverContent} - Content container component
|
|
21
|
+
* @see {@link PopoverHeading} - Accessible heading component
|
|
22
|
+
*/
|
|
23
|
+
export declare const PopoverDescription: React.ForwardRefExoticComponent<Omit<Omit<import("..").TypographyProps, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
@@ -1,2 +1,23 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* PopoverHeading - Accessible heading for popover
|
|
4
|
+
*
|
|
5
|
+
* Provides an accessible heading for the popover content. Automatically sets
|
|
6
|
+
* `aria-labelledby` on the PopoverContent when mounted. Uses Typography component
|
|
7
|
+
* for consistent styling and supports all Typography props.
|
|
8
|
+
*
|
|
9
|
+
* @category Components
|
|
10
|
+
* @subcategory Overlay
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <PopoverHeading variant="h4">
|
|
15
|
+
* Popover Title
|
|
16
|
+
* </PopoverHeading>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @see {@link Popover} - Root component
|
|
20
|
+
* @see {@link PopoverContent} - Content container component
|
|
21
|
+
* @see {@link PopoverDescription} - Accessible description component
|
|
22
|
+
*/
|
|
23
|
+
export declare const PopoverHeading: React.ForwardRefExoticComponent<Omit<Omit<import("..").TypographyProps, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ButtonProps } from '../Button/types';
|
|
3
3
|
import { PopoverTriggerProps } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* PopoverTrigger - Trigger element for popover
|
|
6
|
+
*
|
|
7
|
+
* Activates the popover when interacted with. By default renders as a Button,
|
|
8
|
+
* but can be customized using the `asChild` prop to render as any React element.
|
|
9
|
+
* Automatically receives Floating UI reference props for positioning and state
|
|
10
|
+
* management.
|
|
11
|
+
*
|
|
12
|
+
* @category Components
|
|
13
|
+
* @subcategory Overlay
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* // Default Button trigger
|
|
18
|
+
* <PopoverTrigger>
|
|
19
|
+
* Open Popover
|
|
20
|
+
* </PopoverTrigger>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* // Custom element trigger
|
|
26
|
+
* <PopoverTrigger asChild>
|
|
27
|
+
* <Icon name="info" />
|
|
28
|
+
* </PopoverTrigger>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @see {@link Popover} - Root component
|
|
32
|
+
* @see {@link PopoverContent} - Content display component
|
|
33
|
+
*/
|
|
4
34
|
export declare const PopoverTrigger: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLElement> & ButtonProps & PopoverTriggerProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
@@ -1,2 +1,23 @@
|
|
|
1
1
|
import { UsePopover } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* usePopover - Hook for popover functionality
|
|
4
|
+
*
|
|
5
|
+
* Custom hook that provides popover state management, positioning, and interactions.
|
|
6
|
+
* Handles both controlled and uncontrolled modes, supports multiple interaction types
|
|
7
|
+
* (click, hover, both), and integrates with Floating UI for positioning and focus management.
|
|
8
|
+
*
|
|
9
|
+
* @param options - Popover configuration options
|
|
10
|
+
* @returns Popover context value with state, positioning, and interaction handlers
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const popover = usePopover({
|
|
15
|
+
* placement: 'top',
|
|
16
|
+
* interactionsEnabled: 'click',
|
|
17
|
+
* modal: false,
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @see {@link Popover} - Component that uses this hook
|
|
22
|
+
*/
|
|
2
23
|
export declare const usePopover: UsePopover;
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ContextType } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Context for popover components
|
|
5
|
+
*
|
|
6
|
+
* Provides popover state and functionality to child components. Created by
|
|
7
|
+
* Popover component and consumed by PopoverTrigger, PopoverContent, and other
|
|
8
|
+
* popover sub-components.
|
|
9
|
+
*/
|
|
3
10
|
export declare const PopoverContext: React.Context<ContextType>;
|
|
11
|
+
/**
|
|
12
|
+
* usePopoverContext - Hook to access popover context
|
|
13
|
+
*
|
|
14
|
+
* Returns the popover context value. Throws an error if used outside of a
|
|
15
|
+
* Popover component.
|
|
16
|
+
*
|
|
17
|
+
* @returns Popover context value with state, positioning, and interaction handlers
|
|
18
|
+
* @throws Error if used outside of Popover component
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const { open, setOpen, refs } = usePopoverContext();
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @see {@link Popover} - Component that provides this context
|
|
26
|
+
*/
|
|
4
27
|
export declare const usePopoverContext: () => ContextType;
|
|
@@ -1,23 +1,109 @@
|
|
|
1
1
|
import { Placement, useInteractions, UseFloatingReturn, UseFloatingOptions } from '@floating-ui/react';
|
|
2
|
+
/**
|
|
3
|
+
* Interaction modes for popover activation
|
|
4
|
+
* - `click`: Opens on click interaction (default)
|
|
5
|
+
* - `hover`: Opens on hover interaction
|
|
6
|
+
* - `both`: Opens on both click and hover interactions
|
|
7
|
+
*/
|
|
2
8
|
export type InteractionsEnabled = 'click' | 'hover' | 'both';
|
|
9
|
+
/**
|
|
10
|
+
* Mount mode for popover content
|
|
11
|
+
* - `unmount`: Completely unmounts content when closed (default)
|
|
12
|
+
* - `keep-mounted`: Keeps content mounted but hidden when closed
|
|
13
|
+
*/
|
|
3
14
|
export type MountMode = 'unmount' | 'keep-mounted';
|
|
15
|
+
/**
|
|
16
|
+
* Props for the Popover component
|
|
17
|
+
*
|
|
18
|
+
* Root container component for popover system using compound component pattern.
|
|
19
|
+
* Provides context and positioning configuration for PopoverTrigger, PopoverContent,
|
|
20
|
+
* PopoverHeading, PopoverDescription, and PopoverClose. Built on Floating UI for
|
|
21
|
+
* flexible positioning and interaction modes.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <Popover placement="top" interactionsEnabled="click">
|
|
26
|
+
* <PopoverTrigger>
|
|
27
|
+
* <Button>Open Popover</Button>
|
|
28
|
+
* </PopoverTrigger>
|
|
29
|
+
* <PopoverContent>
|
|
30
|
+
* <PopoverHeading variant="h4">Title</PopoverHeading>
|
|
31
|
+
* <PopoverDescription>This is a popover</PopoverDescription>
|
|
32
|
+
* <PopoverClose>Close</PopoverClose>
|
|
33
|
+
* </PopoverContent>
|
|
34
|
+
* </Popover>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
4
37
|
export interface PopoverOptions {
|
|
38
|
+
/**
|
|
39
|
+
* Initial open state for uncontrolled popover
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
5
42
|
initialOpen?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Preferred placement of the popover relative to trigger
|
|
45
|
+
* Floating UI will auto-adjust if space is insufficient
|
|
46
|
+
* @default 'bottom'
|
|
47
|
+
*/
|
|
6
48
|
placement?: Placement;
|
|
49
|
+
/**
|
|
50
|
+
* Whether popover should behave as a modal (traps focus)
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
7
53
|
modal?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Controlled open state
|
|
56
|
+
* When provided, controls popover visibility externally
|
|
57
|
+
*/
|
|
8
58
|
open?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Additional Floating UI options for advanced positioning
|
|
61
|
+
* Allows customization of middleware, strategy, and other Floating UI settings
|
|
62
|
+
*/
|
|
9
63
|
floatingOptions?: Partial<UseFloatingOptions>;
|
|
64
|
+
/**
|
|
65
|
+
* Interaction mode for popover activation
|
|
66
|
+
* @default 'click'
|
|
67
|
+
*/
|
|
10
68
|
interactionsEnabled?: InteractionsEnabled;
|
|
69
|
+
/**
|
|
70
|
+
* Enable keyboard handlers for interactions
|
|
71
|
+
* @default true
|
|
72
|
+
*/
|
|
11
73
|
keyboardHandlers?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Callback fired when open state changes
|
|
76
|
+
*/
|
|
12
77
|
onOpenChange?: (open: boolean) => void;
|
|
13
78
|
}
|
|
14
79
|
export type SetIDs = {
|
|
15
80
|
setLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
16
81
|
setDescriptionId: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
17
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* Props for PopoverTrigger component
|
|
85
|
+
*
|
|
86
|
+
* Trigger element that activates the popover. Can render as a Button (default) or
|
|
87
|
+
* as a custom element when using `asChild` prop. Automatically receives Floating UI
|
|
88
|
+
* reference props for positioning. Extends ButtonProps so you can pass Button props
|
|
89
|
+
* such as variant (default `primary`), size, css, etc.
|
|
90
|
+
*/
|
|
18
91
|
export interface PopoverTriggerProps {
|
|
92
|
+
/**
|
|
93
|
+
* Content to render as trigger
|
|
94
|
+
* When `asChild` is true, must be a single React element
|
|
95
|
+
*/
|
|
19
96
|
children?: React.ReactNode;
|
|
97
|
+
/**
|
|
98
|
+
* Render trigger as child element instead of Button
|
|
99
|
+
* When true, clones the child element and applies trigger props
|
|
100
|
+
* @default false
|
|
101
|
+
*/
|
|
20
102
|
asChild?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Test ID for the trigger element
|
|
105
|
+
* @default 'trigger-button'
|
|
106
|
+
*/
|
|
21
107
|
dataTestId?: string;
|
|
22
108
|
}
|
|
23
109
|
type UseInteractions = ReturnType<typeof useInteractions>;
|