@ssa-ui-kit/core 2.33.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AccordionGroup/Accordion.d.ts +37 -0
- package/dist/components/AccordionGroup/AccordionContent.d.ts +48 -0
- package/dist/components/AccordionGroup/AccordionContext.d.ts +76 -2
- package/dist/components/AccordionGroup/AccordionGroup.d.ts +56 -0
- package/dist/components/AccordionGroup/AccordionTitle.d.ts +41 -0
- package/dist/components/AccordionGroup/types.d.ts +199 -1
- package/dist/components/Avatar/Avatar.d.ts +33 -0
- package/dist/components/Button/Button.d.ts +61 -0
- package/dist/components/Button/fixtures.d.ts +52 -31
- package/dist/components/Button/styles.d.ts +7 -12
- package/dist/components/Button/types.d.ts +98 -4
- package/dist/components/Charts/BarGaugeChart/components/BarGaugeChartHeader.d.ts +1 -1
- package/dist/components/Charts/BarLineComplexChart/BarLineComplexChartView.d.ts +2 -2
- package/dist/components/Charts/BarLineComplexChart/types.d.ts +2 -2
- package/dist/components/Charts/BigNumberChart/BigNumberChart.d.ts +4 -2
- package/dist/components/Charts/BigNumberChart/components/BigNumberChartHeader.d.ts +1 -1
- package/dist/components/Charts/BigNumberChart/components/TrendLine.d.ts +8 -3
- package/dist/components/Charts/BigNumberChart/components/TrendLineTooltip.d.ts +8 -5
- package/dist/components/Charts/GaugeChart/components/GaugeChartBase.d.ts +3 -1
- package/dist/components/Charts/GaugeChart/components/GaugeChartHeader.d.ts +1 -1
- package/dist/components/Charts/PieChart/PieChartLegendMarker.d.ts +1 -1
- package/dist/components/Charts/PieChart/styles.d.ts +1 -1
- package/dist/components/Charts/PieChart/types.d.ts +1 -1
- package/dist/components/Charts/RadarChart/RadarChart.d.ts +1 -1
- package/dist/components/Charts/RadarChart/components/RadarChartHeader.d.ts +1 -1
- package/dist/components/Charts/TreeMapChart/TreeMapChart.d.ts +1 -1
- package/dist/components/Charts/TreeMapChart/TreeMapChartHeader.d.ts +1 -1
- package/dist/components/Charts/index.d.ts +1 -0
- package/dist/components/Charts/utils/nivoReact19Compat.d.ts +18 -0
- package/dist/components/Checkbox/Checkbox.d.ts +84 -0
- package/dist/components/Checkbox/CheckboxBase.d.ts +1 -1
- package/dist/components/Checkbox/styles.d.ts +2 -2
- package/dist/components/Checkbox/types.d.ts +104 -3
- package/dist/components/Chip/Chip.d.ts +70 -0
- package/dist/components/Chip/constants.d.ts +1 -1
- package/dist/components/Chip/helpers.d.ts +6 -0
- package/dist/components/Chip/types.d.ts +129 -1
- package/dist/components/CollapsibleNavBar/CollapsibleNavBar.d.ts +1 -1
- package/dist/components/CollapsibleNavBar/CollapsibleNavBarContext.d.ts +2 -2
- package/dist/components/CollapsibleNavBar/components/TriggerIcon.d.ts +4 -2
- package/dist/components/CollapsibleNavBar/types.d.ts +9 -2
- package/dist/components/ColorPicker/components/CopyButton.d.ts +1 -1
- package/dist/components/DatePicker/constants.d.ts +22 -0
- package/dist/components/DatePicker/hooks/useDatePicker.d.ts +7 -5
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DatePicker/styles.d.ts +3 -2
- package/dist/components/DatePicker/types.d.ts +10 -2
- package/dist/components/DatePicker/utils/dates.d.ts +2 -2
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/components/DateRangePicker/DateRangePickerFormBridge.d.ts +46 -0
- package/dist/components/DateRangePicker/components/DatesListWrapper.d.ts +3 -2
- package/dist/components/DateRangePicker/constants.d.ts +1 -0
- package/dist/components/DateRangePicker/hooks/useDateRangePicker.d.ts +22 -17
- package/dist/components/DateRangePicker/index.d.ts +3 -0
- package/dist/components/DateRangePicker/styles.d.ts +6 -4
- package/dist/components/DateRangePicker/types.d.ts +24 -7
- package/dist/components/DateRangePicker/utils/dates.d.ts +2 -2
- package/dist/components/Drawer/index.d.ts +2 -1
- package/dist/components/Dropdown/Dropdown.d.ts +88 -0
- package/dist/components/Dropdown/types.d.ts +78 -0
- package/dist/components/DropdownOptions/DropdownOptions.d.ts +31 -0
- package/dist/components/DropdownOptions/types.d.ts +22 -0
- package/dist/components/DropdownToggle/DropdownToggle.d.ts +1 -1
- package/dist/components/Field/FieldControl.d.ts +62 -1
- package/dist/components/Field/FieldDescription.d.ts +33 -0
- package/dist/components/Field/FieldError.d.ts +36 -0
- package/dist/components/Field/FieldLabel.d.ts +37 -0
- package/dist/components/Field/FieldProvider.d.ts +19 -1
- package/dist/components/Field/FieldRoot.d.ts +90 -0
- package/dist/components/Field/FieldSuccess.d.ts +34 -0
- package/dist/components/Field/index.d.ts +4 -0
- package/dist/components/Filters/FilterBlockWrapper.d.ts +3 -2
- package/dist/components/Filters/FiltersContext.d.ts +4 -4
- package/dist/components/Filters/hooks/useVisibility.d.ts +2 -2
- package/dist/components/FullscreenModeContext.d.ts +1 -4
- package/dist/components/Icon/icons/iconsList.d.ts +1 -1
- package/dist/components/IconButton/IconButton.d.ts +39 -0
- package/dist/components/IconButton/index.d.ts +2 -0
- package/dist/components/IconButton/styles.d.ts +2 -0
- package/dist/components/IconButton/types.d.ts +41 -0
- package/dist/components/Indicator/types.d.ts +4 -2
- package/dist/components/Input/types.d.ts +157 -0
- package/dist/components/JsonSchemaForm/fields/DateRangeField.d.ts +15 -1
- package/dist/components/JsonSchemaForm/utils/dateFormats.d.ts +37 -0
- package/dist/components/JsonSchemaForm/utils/dateRangeField.d.ts +24 -0
- package/dist/components/JsonSchemaForm/utils/index.d.ts +1 -0
- package/dist/components/JsonSchemaForm/utils/selectWidget.d.ts +16 -0
- package/dist/components/Modal/Modal.d.ts +60 -0
- package/dist/components/Modal/types.d.ts +21 -1
- package/dist/components/ModalContent/ModalContent.d.ts +42 -1
- package/dist/components/ModalDialog/ModalDialog.d.ts +27 -0
- package/dist/components/ModalDialog/types.d.ts +18 -0
- package/dist/components/ModalDismissButton/ModalDismissButton.d.ts +29 -2
- package/dist/components/ModalOpenButton/ModalOpenButton.d.ts +25 -1
- package/dist/components/NavBar/types.d.ts +1 -1
- package/dist/components/NotificationMenu/types.d.ts +3 -3
- package/dist/components/Pagination/ArrowButton.d.ts +32 -0
- package/dist/components/Pagination/Pagination.d.ts +81 -0
- package/dist/components/Pagination/PaginationButtons.d.ts +35 -0
- package/dist/components/Pagination/PaginationContext.d.ts +30 -0
- package/dist/components/Pagination/WithPagination.d.ts +47 -4
- package/dist/components/Pagination/components/RowsPerPageDropdown/RowsPerPageDropdown.d.ts +41 -0
- package/dist/components/Pagination/components/RowsPerPageDropdown/types.d.ts +39 -0
- package/dist/components/Pagination/styles.d.ts +1 -1
- package/dist/components/Pagination/types.d.ts +178 -0
- package/dist/components/PersonInfo/styles.d.ts +1 -1
- package/dist/components/Popover/Popover.d.ts +120 -0
- package/dist/components/Popover/PopoverClose.d.ts +26 -0
- package/dist/components/Popover/PopoverContent.d.ts +33 -0
- package/dist/components/Popover/PopoverDescription.d.ts +22 -1
- package/dist/components/Popover/PopoverHeading.d.ts +22 -1
- package/dist/components/Popover/PopoverTrigger.d.ts +30 -0
- package/dist/components/Popover/hooks/usePopover.d.ts +21 -0
- package/dist/components/Popover/hooks/usePopoverContext.d.ts +23 -0
- package/dist/components/Popover/types.d.ts +86 -0
- package/dist/components/Radio/Radio.d.ts +69 -1
- package/dist/components/Radio/RadioBase.d.ts +1 -1
- package/dist/components/Radio/types.d.ts +109 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/index.d.ts +1 -0
- package/dist/components/RadioGroup/types.d.ts +42 -0
- package/dist/components/SearchBox/SearchBox.d.ts +60 -0
- package/dist/components/SearchBox/SearchBoxInput.d.ts +1 -1
- package/dist/components/SearchBox/types.d.ts +46 -0
- package/dist/components/Slider/Slider.d.ts +53 -0
- package/dist/components/Slider/consts.d.ts +4 -0
- package/dist/components/Slider/index.d.ts +4 -0
- package/dist/components/Slider/styles.d.ts +90 -0
- package/dist/components/Slider/types.d.ts +69 -0
- package/dist/components/Switch/Switch.d.ts +66 -1
- package/dist/components/Switch/SwitchBase.d.ts +5 -1
- package/dist/components/Switch/SwitchContext.d.ts +50 -0
- package/dist/components/Switch/types.d.ts +74 -0
- package/dist/components/Table/Table.d.ts +74 -0
- package/dist/components/TableBody/TableBody.d.ts +55 -0
- package/dist/components/TableCell/TableCell.d.ts +56 -4
- package/dist/components/TableCell/types.d.ts +33 -0
- package/dist/components/TableCellHeader/TableCellHeader.d.ts +63 -2
- package/dist/components/TableCellHeader/types.d.ts +28 -0
- package/dist/components/TableFilters/TableFilters.d.ts +72 -0
- package/dist/components/TableFilters/hooks/useTableData.d.ts +3 -3
- package/dist/components/TableFilters/types.d.ts +130 -2
- package/dist/components/TableHead/TableHead.d.ts +37 -0
- package/dist/components/TableRow/TableRow.d.ts +2 -7
- package/dist/components/TableRow/types.d.ts +34 -0
- package/dist/components/TextField/TextField.d.ts +76 -0
- package/dist/components/TextField/types.d.ts +80 -0
- package/dist/components/Textarea/Textarea.d.ts +81 -0
- package/dist/components/Textarea/types.d.ts +95 -0
- package/dist/components/Tooltip/SimpleChartTooltip.d.ts +2 -1
- package/dist/components/Tooltip/Tooltip.d.ts +73 -0
- package/dist/components/Tooltip/types.d.ts +116 -5
- package/dist/components/TooltipContent/TooltipContent.d.ts +45 -0
- package/dist/components/TooltipTrigger/TooltipTrigger.d.ts +27 -1
- package/dist/components/Typeahead/Typeahead.context.d.ts +10 -4
- package/dist/components/Typeahead/Typeahead.d.ts +173 -9
- package/dist/components/Typeahead/components/TypeaheadOption.d.ts +1 -1
- package/dist/components/Typeahead/styles.d.ts +9 -4
- package/dist/components/Typeahead/types.d.ts +191 -1
- package/dist/components/Typeahead/useTypeahead.d.ts +13 -5
- package/dist/components/Typography/Typography.d.ts +50 -0
- package/dist/components/Typography/types.d.ts +67 -0
- package/dist/components/UserProfile/UserProfile.d.ts +76 -0
- package/dist/components/UserProfile/styles.d.ts +6 -4
- package/dist/components/UserProfile/types.d.ts +85 -1
- package/dist/components/WidgetCard/Title.d.ts +1 -1
- package/dist/components/WidgetCard/WidgetCardBase.d.ts +1 -1
- package/dist/components/WithLink.d.ts +1 -1
- package/dist/components/Wrapper/Wrapper.d.ts +83 -2
- package/dist/components/Wrapper/index.d.ts +1 -0
- package/dist/components/index.d.ts +113 -85
- package/dist/index.d.ts +1 -0
- package/dist/index.js +47400 -19567
- package/dist/index.js.map +1 -1
- package/dist/types/emotion.d.ts +63 -0
- package/dist/utils/react19HocCompat.d.ts +14 -0
- package/package.json +42 -33
|
@@ -1,3 +1,63 @@
|
|
|
1
1
|
import { ModalProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Modal - Dialog overlay for focused user interaction
|
|
4
|
+
*
|
|
5
|
+
* A compound component that provides a modal dialog with built-in state management,
|
|
6
|
+
* trigger and dismiss buttons, and optional portal rendering. Use Modal (root),
|
|
7
|
+
* ModalOpenButton (activator), ModalContent (dialog body), and ModalDismissButton
|
|
8
|
+
* (close) together. ModalContent can render in a portal to document.body (usePortal)
|
|
9
|
+
* or in place for use inside other overlays (e.g. Drawer).
|
|
10
|
+
*
|
|
11
|
+
* @category Components
|
|
12
|
+
* @subcategory Overlay
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* // Basic modal
|
|
17
|
+
* <Modal>
|
|
18
|
+
* <ModalOpenButton>
|
|
19
|
+
* <Button>Open modal</Button>
|
|
20
|
+
* </ModalOpenButton>
|
|
21
|
+
* <ModalContent aria-label="Example modal">
|
|
22
|
+
* <div>
|
|
23
|
+
* <h3>Title</h3>
|
|
24
|
+
* <p>Content</p>
|
|
25
|
+
* <ModalDismissButton>
|
|
26
|
+
* <Button variant="secondary">Close</Button>
|
|
27
|
+
* </ModalDismissButton>
|
|
28
|
+
* </div>
|
|
29
|
+
* </ModalContent>
|
|
30
|
+
* </Modal>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* // Controlled from parent
|
|
36
|
+
* const [isOpen, setIsOpen] = useState(false);
|
|
37
|
+
* <Modal isOpen={isOpen}>
|
|
38
|
+
* <ModalContent aria-label="Controlled modal">
|
|
39
|
+
* <ModalDismissButton><Button onClick={() => setIsOpen(false)}>Close</Button></ModalDismissButton>
|
|
40
|
+
* </ModalContent>
|
|
41
|
+
* </Modal>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* // Modal with portal (e.g. inside Drawer) - centers on full screen
|
|
47
|
+
* <ModalContent aria-label="Modal in drawer" usePortal>
|
|
48
|
+
* ...
|
|
49
|
+
* </ModalContent>
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @see {@link ModalContent} - Dialog content and container
|
|
53
|
+
* @see {@link ModalOpenButton} - Trigger to open
|
|
54
|
+
* @see {@link ModalDismissButton} - Trigger to close
|
|
55
|
+
*
|
|
56
|
+
* @accessibility
|
|
57
|
+
* - Focus trapped within modal when open
|
|
58
|
+
* - aria-label on ModalContent for screen readers
|
|
59
|
+
* - ESC to close (when implemented in ModalDialog)
|
|
60
|
+
* - Focus management on open/close
|
|
61
|
+
*/
|
|
2
62
|
declare const Modal: ({ isOpen, ...rest }: ModalProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
63
|
export default Modal;
|
|
@@ -1,3 +1,23 @@
|
|
|
1
1
|
import type { ModalDialogProps } from '../ModalDialog';
|
|
2
|
+
/**
|
|
3
|
+
* Context value for Modal: [isOpen, setIsOpen].
|
|
4
|
+
* Provided by Modal (root) and consumed by ModalContent, ModalOpenButton, ModalDismissButton.
|
|
5
|
+
*/
|
|
2
6
|
export type ModalContextProps = [boolean, (isOpen: boolean) => void];
|
|
3
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Props for the Modal root and ModalContent components.
|
|
9
|
+
*
|
|
10
|
+
* Modal root accepts isOpen for controlled usage; ModalContent accepts
|
|
11
|
+
* ModalDialog props (aria-label, noBackground, className, children) plus usePortal.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Modal isOpen={isOpen}>
|
|
16
|
+
* <ModalContent aria-label="Dialog" usePortal>...</ModalContent>
|
|
17
|
+
* </Modal>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export type ModalProps = Partial<ModalDialogProps> & {
|
|
21
|
+
/** When true, render modal in a portal to document.body. When false (default), render in place (e.g. inside a Drawer). */
|
|
22
|
+
usePortal?: boolean;
|
|
23
|
+
};
|
|
@@ -1,3 +1,44 @@
|
|
|
1
1
|
import { ModalProps } from '../Modal/types';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* ModalContent - Dialog content and overlay container
|
|
4
|
+
*
|
|
5
|
+
* Renders the modal dialog content when the modal is open. Uses ModalContext
|
|
6
|
+
* to read open state. Can render in place (default) or in a portal to
|
|
7
|
+
* document.body when usePortal is true (e.g. for modals inside a Drawer that
|
|
8
|
+
* should center on the full screen).
|
|
9
|
+
*
|
|
10
|
+
* Only renders when modal is open. Accepts ModalDialog props (aria-label,
|
|
11
|
+
* noBackground, className) and usePortal. Must be used within Modal.
|
|
12
|
+
*
|
|
13
|
+
* @category Components
|
|
14
|
+
* @subcategory Overlay
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <Modal>
|
|
19
|
+
* <ModalOpenButton><Button>Open</Button></ModalOpenButton>
|
|
20
|
+
* <ModalContent aria-label="Example dialog">
|
|
21
|
+
* <p>Content</p>
|
|
22
|
+
* <ModalDismissButton><Button>Close</Button></ModalDismissButton>
|
|
23
|
+
* </ModalContent>
|
|
24
|
+
* </Modal>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* // With portal (e.g. inside Drawer) - centers on full screen
|
|
30
|
+
* <ModalContent aria-label="Dialog" usePortal>
|
|
31
|
+
* ...
|
|
32
|
+
* </ModalContent>
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @see {@link Modal} - Parent component that provides context
|
|
36
|
+
* @see {@link ModalOpenButton} - Trigger to open
|
|
37
|
+
* @see {@link ModalDismissButton} - Trigger to close
|
|
38
|
+
*
|
|
39
|
+
* @accessibility
|
|
40
|
+
* - aria-label should be set for screen readers
|
|
41
|
+
* - Renders in portal when usePortal for proper stacking
|
|
42
|
+
*/
|
|
43
|
+
declare function ModalContent({ children, 'aria-label': ariaLabel, usePortal, ...props }: ModalProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
3
44
|
export default ModalContent;
|
|
@@ -1,3 +1,30 @@
|
|
|
1
1
|
import { ModalDialogProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* ModalDialog - Presentational dialog container and overlay
|
|
4
|
+
*
|
|
5
|
+
* Renders the fixed full-screen overlay and centered dialog box. Used internally
|
|
6
|
+
* by ModalContent; typically not used directly. Handles visibility (display
|
|
7
|
+
* based on isOpen), optional background overlay (noBackground), and dialog
|
|
8
|
+
* ARIA attributes (role="dialog", aria-modal).
|
|
9
|
+
*
|
|
10
|
+
* @category Components
|
|
11
|
+
* @subcategory Overlay
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // Usually used via ModalContent
|
|
16
|
+
* <ModalContent aria-label="My dialog">
|
|
17
|
+
* <div>Dialog body</div>
|
|
18
|
+
* </ModalContent>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @see {@link Modal} - Root component that provides state
|
|
22
|
+
* @see {@link ModalContent} - Wraps ModalDialog and handles portal
|
|
23
|
+
*
|
|
24
|
+
* @accessibility
|
|
25
|
+
* - role="dialog", aria-modal="true"
|
|
26
|
+
* - aria-label for screen reader label
|
|
27
|
+
* - Fixed overlay for focus containment
|
|
28
|
+
*/
|
|
2
29
|
declare const ModalDialog: ({ isOpen, noBackground, children, "aria-label": ariaLabel, ...props }: ModalDialogProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
30
|
export default ModalDialog;
|
|
@@ -1,7 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the ModalDialog presentational component.
|
|
3
|
+
*
|
|
4
|
+
* Used by ModalContent when rendering the dialog. isOpen controls visibility;
|
|
5
|
+
* noBackground removes the overlay; aria-label is required for accessibility.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <ModalDialog isOpen={true} aria-label="Confirm action">
|
|
10
|
+
* <p>Are you sure?</p>
|
|
11
|
+
* </ModalDialog>
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
1
14
|
export interface ModalDialogProps {
|
|
15
|
+
/** Whether the dialog is visible. When false, content is hidden (display: none). */
|
|
2
16
|
isOpen: boolean;
|
|
17
|
+
/** When true, the overlay is transparent (no dimmed background). */
|
|
3
18
|
noBackground?: boolean;
|
|
19
|
+
/** Accessible name for the dialog (required for screen readers). */
|
|
4
20
|
'aria-label'?: string;
|
|
21
|
+
/** Dialog body content. */
|
|
5
22
|
children?: React.ReactNode;
|
|
23
|
+
/** Optional CSS class for the inner dialog element. */
|
|
6
24
|
className?: string;
|
|
7
25
|
}
|
|
@@ -1,4 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* ModalDismissButton - Trigger element that closes the modal
|
|
3
|
+
*
|
|
4
|
+
* Wraps a single React element (typically a Button) and injects an onClick
|
|
5
|
+
* handler that closes the modal via ModalContext. Preserves the child's
|
|
6
|
+
* existing onClick by calling both. Must be used within Modal.
|
|
7
|
+
*
|
|
8
|
+
* @category Components
|
|
9
|
+
* @subcategory Overlay
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Modal>
|
|
14
|
+
* <ModalOpenButton><Button>Open</Button></ModalOpenButton>
|
|
15
|
+
* <ModalContent aria-label="Dialog">
|
|
16
|
+
* <p>Content</p>
|
|
17
|
+
* <ModalDismissButton>
|
|
18
|
+
* <Button variant="secondary">Close</Button>
|
|
19
|
+
* </ModalDismissButton>
|
|
20
|
+
* </ModalContent>
|
|
21
|
+
* </Modal>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @see {@link Modal} - Parent component that provides context
|
|
25
|
+
* @see {@link ModalContent} - Content container
|
|
26
|
+
* @see {@link ModalOpenButton} - Trigger to open
|
|
27
|
+
*/
|
|
28
|
+
declare function ModalDismissButton({ children: child, }: {
|
|
29
|
+
children: React.JSX.Element;
|
|
3
30
|
}): import("react").FunctionComponentElement<any>;
|
|
4
31
|
export default ModalDismissButton;
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModalOpenButton - Trigger element that opens the modal
|
|
3
|
+
*
|
|
4
|
+
* Wraps a single React element (typically a Button) and injects an onClick
|
|
5
|
+
* handler that opens the modal via ModalContext. Preserves the child's
|
|
6
|
+
* existing onClick by calling both. Must be used within Modal.
|
|
7
|
+
*
|
|
8
|
+
* @category Components
|
|
9
|
+
* @subcategory Overlay
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Modal>
|
|
14
|
+
* <ModalOpenButton>
|
|
15
|
+
* <Button>Open modal</Button>
|
|
16
|
+
* </ModalOpenButton>
|
|
17
|
+
* <ModalContent aria-label="Dialog">...</ModalContent>
|
|
18
|
+
* </Modal>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @see {@link Modal} - Parent component that provides context
|
|
22
|
+
* @see {@link ModalContent} - Content displayed when open
|
|
23
|
+
* @see {@link ModalDismissButton} - Trigger to close
|
|
24
|
+
*/
|
|
1
25
|
declare function ModalOpenButton({ children: child }: {
|
|
2
|
-
children: JSX.Element;
|
|
26
|
+
children: React.JSX.Element;
|
|
3
27
|
}): import("react").FunctionComponentElement<any>;
|
|
4
28
|
export default ModalOpenButton;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { NotificationCardProps } from '../NotificationCard';
|
|
2
2
|
export interface NotificationMenuProps {
|
|
3
|
-
trigger: string | JSX.Element;
|
|
3
|
+
trigger: string | React.JSX.Element;
|
|
4
4
|
notifications: Array<NotificationCardProps>;
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
onClick?: () => void;
|
|
7
7
|
isLoading: boolean;
|
|
8
|
-
leftButton?: string | JSX.Element | null;
|
|
9
|
-
rightButton?: string | JSX.Element;
|
|
8
|
+
leftButton?: string | React.JSX.Element | null;
|
|
9
|
+
rightButton?: string | React.JSX.Element;
|
|
10
10
|
}
|
|
@@ -1,2 +1,34 @@
|
|
|
1
1
|
import { ArrowButtonProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* ArrowButton - Navigation arrow button for pagination
|
|
4
|
+
*
|
|
5
|
+
* Internal component used by Pagination to render previous/next navigation arrows.
|
|
6
|
+
* Displays a button with a carrot icon pointing left or right. Used for navigating
|
|
7
|
+
* between pages in the pagination component.
|
|
8
|
+
*
|
|
9
|
+
* @category Components
|
|
10
|
+
* @subcategory Navigation
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* // Used internally by Pagination component
|
|
15
|
+
* <ArrowButton
|
|
16
|
+
* direction="left"
|
|
17
|
+
* onClick={() => goToPreviousPage()}
|
|
18
|
+
* isDisabled={isFirstPage}
|
|
19
|
+
* />
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @see {@link Pagination} - Parent component that uses this component
|
|
23
|
+
* @see {@link ArrowButtonProps} - Props interface
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
* This component is not exported from the main index and is intended for
|
|
27
|
+
* internal use within the Pagination component.
|
|
28
|
+
*
|
|
29
|
+
* @accessibility
|
|
30
|
+
* - ARIA label set automatically based on direction
|
|
31
|
+
* - Keyboard navigation support via Button component
|
|
32
|
+
* - Screen reader friendly
|
|
33
|
+
*/
|
|
2
34
|
export declare const ArrowButton: ({ direction, onClick, isDisabled, className, }: ArrowButtonProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,84 @@
|
|
|
1
1
|
import { PaginationProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Pagination - Navigation controls for paginated data
|
|
4
|
+
*
|
|
5
|
+
* A comprehensive pagination component that provides navigation controls for
|
|
6
|
+
* paginated content. Supports page navigation with arrow buttons and numbered
|
|
7
|
+
* page buttons, optional manual page input, and optional rows per page selection.
|
|
8
|
+
* Uses PaginationContextProvider to manage page state and navigation.
|
|
9
|
+
*
|
|
10
|
+
* Component structure:
|
|
11
|
+
* - PaginationContextProvider (manages page state - required)
|
|
12
|
+
* - Pagination (main component)
|
|
13
|
+
* - RowsPerPageDropdown (optional)
|
|
14
|
+
* - PageNumberInput (optional)
|
|
15
|
+
* - ArrowButton (previous)
|
|
16
|
+
* - PaginationButtons (numbered pages)
|
|
17
|
+
* - ArrowButton (next)
|
|
18
|
+
*
|
|
19
|
+
* @category Components
|
|
20
|
+
* @subcategory Navigation
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* // Basic pagination
|
|
25
|
+
* <PaginationContextProvider selectedPage={1}>
|
|
26
|
+
* <Pagination pagesCount={10} />
|
|
27
|
+
* </PaginationContextProvider>
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* // With rows per page dropdown
|
|
33
|
+
* <PaginationContextProvider selectedPage={1} defaultPerPage={25}>
|
|
34
|
+
* <Pagination
|
|
35
|
+
* pagesCount={20}
|
|
36
|
+
* isRowPerPageVisible={true}
|
|
37
|
+
* rowPerPageProps={{
|
|
38
|
+
* rowsPerPageText: "Items per page",
|
|
39
|
+
* rowsPerPageList: [
|
|
40
|
+
* { id: 1, value: 10 },
|
|
41
|
+
* { id: 2, value: 25 },
|
|
42
|
+
* { id: 3, value: 50 },
|
|
43
|
+
* { id: 4, value: 100 },
|
|
44
|
+
* ],
|
|
45
|
+
* }}
|
|
46
|
+
* />
|
|
47
|
+
* </PaginationContextProvider>
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```tsx
|
|
52
|
+
* // With manual page input
|
|
53
|
+
* <PaginationContextProvider selectedPage={3}>
|
|
54
|
+
* <Pagination
|
|
55
|
+
* pagesCount={15}
|
|
56
|
+
* isPageSettingVisible={true}
|
|
57
|
+
* pageNumberPlaceholder="Go to page"
|
|
58
|
+
* errorTooltip="Please enter a valid page number"
|
|
59
|
+
* />
|
|
60
|
+
* </PaginationContextProvider>
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* // Disabled pagination
|
|
66
|
+
* <PaginationContextProvider selectedPage={5}>
|
|
67
|
+
* <Pagination pagesCount={10} isDisabled />
|
|
68
|
+
* </PaginationContextProvider>
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @see {@link PaginationContextProvider} - Required context provider for state management
|
|
72
|
+
* @see {@link RowsPerPageDropdown} - Optional component for rows per page selection
|
|
73
|
+
*
|
|
74
|
+
* @requires PaginationContextProvider - Must be wrapped in PaginationContextProvider
|
|
75
|
+
*
|
|
76
|
+
* @accessibility
|
|
77
|
+
* - ARIA navigation role and labels
|
|
78
|
+
* - Keyboard navigation support (Enter for page input)
|
|
79
|
+
* - Arrow keys navigation (via arrow buttons)
|
|
80
|
+
* - Screen reader friendly
|
|
81
|
+
* - Proper focus management
|
|
82
|
+
*/
|
|
2
83
|
declare const Pagination: ({ pagesCount, className, as, ariaLabel, isDisabled, pageNumberPlaceholder, errorTooltip, isPageSettingVisible, isPageFromCountVisible, isRowPerPageVisible, rowPerPageProps, manualPageNumberProps, }: PaginationProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
84
|
export default Pagination;
|
|
@@ -1,2 +1,37 @@
|
|
|
1
1
|
import { PaginationButtonsProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* PaginationButtons - Container component for page number buttons
|
|
4
|
+
*
|
|
5
|
+
* Internal component used by Pagination to render numbered page buttons.
|
|
6
|
+
* Displays a range of page numbers with ellipsis breaks for large page counts.
|
|
7
|
+
* Handles page selection and visual state (selected/disabled).
|
|
8
|
+
*
|
|
9
|
+
* @category Components
|
|
10
|
+
* @subcategory Navigation
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* // Used internally by Pagination component
|
|
15
|
+
* <PaginationButtons
|
|
16
|
+
* range={[1, 2, 3, -1, 10]} // -1 represents ellipsis break
|
|
17
|
+
* selectedPage={2}
|
|
18
|
+
* onClick={(page) => setPage(page)}
|
|
19
|
+
* isDisabled={false}
|
|
20
|
+
* />
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @see {@link Pagination} - Parent component that uses this component
|
|
24
|
+
* @see {@link PaginationButtonsProps} - Props interface
|
|
25
|
+
* @see {@link PageButton} - Internal component for individual buttons
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
* This component is not exported from the main index and is intended for
|
|
29
|
+
* internal use within the Pagination component.
|
|
30
|
+
*
|
|
31
|
+
* @accessibility
|
|
32
|
+
* - ARIA labels and current state via PageButton components
|
|
33
|
+
* - Keyboard navigation support via Button components
|
|
34
|
+
* - Screen reader friendly
|
|
35
|
+
* - Proper focus management
|
|
36
|
+
*/
|
|
2
37
|
export declare const PaginationButtons: ({ range, selectedPage, onClick, isDisabled, }: PaginationButtonsProps) => false | import("@emotion/react/jsx-runtime").JSX.Element[];
|
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
import { PaginationContextProps, PaginationContextProviderProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Pagination context
|
|
4
|
+
* Provides page state and navigation functions to child components
|
|
5
|
+
*/
|
|
2
6
|
export declare const PaginationContext: import("react").Context<PaginationContextProps>;
|
|
7
|
+
/**
|
|
8
|
+
* Hook to access pagination context
|
|
9
|
+
* Must be used within PaginationContextProvider
|
|
10
|
+
*
|
|
11
|
+
* @returns Pagination context value with page state and navigation functions
|
|
12
|
+
* @throws Error if used outside PaginationContextProvider
|
|
13
|
+
*/
|
|
3
14
|
export declare const usePaginationContext: () => PaginationContextProps;
|
|
15
|
+
/**
|
|
16
|
+
* PaginationContextProvider - Context provider for pagination state
|
|
17
|
+
*
|
|
18
|
+
* Provides pagination state (current page, items per page) and navigation
|
|
19
|
+
* functions to child components. Required wrapper for Pagination component.
|
|
20
|
+
*
|
|
21
|
+
* @category Components
|
|
22
|
+
* @subcategory Navigation
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <PaginationContextProvider selectedPage={1} defaultPerPage={25}>
|
|
27
|
+
* <Pagination pagesCount={10} />
|
|
28
|
+
* </PaginationContextProvider>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @see {@link Pagination} - Child component that uses this context
|
|
32
|
+
* @see {@link usePaginationContext} - Hook to access context values
|
|
33
|
+
*/
|
|
4
34
|
export declare const PaginationContextProvider: ({ selectedPage, defaultPerPage, children, }: PaginationContextProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* WithPagination - Higher-order component that wraps a component with PaginationContextProvider
|
|
4
|
+
*
|
|
5
|
+
* A higher-order component (HOC) that automatically wraps a component with
|
|
6
|
+
* PaginationContextProvider, providing pagination context to all child components.
|
|
7
|
+
* Useful for simplifying pagination setup when you want to provide context
|
|
8
|
+
* at a component level.
|
|
9
|
+
*
|
|
10
|
+
* @category Components
|
|
11
|
+
* @subcategory Navigation
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const MyComponent = () => {
|
|
16
|
+
* return <div>Content with pagination</div>;
|
|
17
|
+
* };
|
|
18
|
+
*
|
|
19
|
+
* export const MyPaginationComponent = WithPagination(MyComponent);
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* // Used in page components
|
|
25
|
+
* const BotsPageComponent = () => {
|
|
26
|
+
* return (
|
|
27
|
+
* <div>
|
|
28
|
+
* <BotsTable />
|
|
29
|
+
* <Pagination pagesCount={10} />
|
|
30
|
+
* </div>
|
|
31
|
+
* );
|
|
32
|
+
* };
|
|
33
|
+
*
|
|
34
|
+
* export const BotsPage = WithPagination(BotsPageComponent);
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @see {@link PaginationContextProvider} - Context provider used internally
|
|
38
|
+
* @see {@link Pagination} - Component that uses the pagination context
|
|
39
|
+
*
|
|
40
|
+
* @note The HOC always initializes with selectedPage={1}
|
|
41
|
+
* @note Prop types may not work correctly with emotion due to known issue
|
|
42
|
+
*
|
|
43
|
+
* @template T - Props type of the wrapped component
|
|
44
|
+
* @param Component - Component to wrap with PaginationContextProvider
|
|
45
|
+
* @returns Wrapped component with pagination context
|
|
46
|
+
*/
|
|
47
|
+
export declare const WithPagination: <T extends object>(Component: React.ComponentType<T>) => React.ComponentType<T>;
|
|
@@ -1,2 +1,43 @@
|
|
|
1
1
|
import { RowsPerPageDropdownProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* RowsPerPageDropdown - Dropdown component for selecting rows per page
|
|
4
|
+
*
|
|
5
|
+
* A dropdown component that allows users to select the number of rows
|
|
6
|
+
* displayed per page in paginated data. Used within Pagination component
|
|
7
|
+
* when isRowPerPageVisible is true. Requires PaginationContextProvider
|
|
8
|
+
* to access and update the perPage state.
|
|
9
|
+
*
|
|
10
|
+
* @category Components
|
|
11
|
+
* @subcategory Navigation
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <PaginationContextProvider selectedPage={1} defaultPerPage={25}>
|
|
16
|
+
* <Pagination
|
|
17
|
+
* pagesCount={20}
|
|
18
|
+
* isRowPerPageVisible={true}
|
|
19
|
+
* rowPerPageProps={{
|
|
20
|
+
* selectedItem: 25,
|
|
21
|
+
* rowsPerPageText: "Items per page",
|
|
22
|
+
* rowsPerPageList: [
|
|
23
|
+
* { id: 1, value: 10 },
|
|
24
|
+
* { id: 2, value: 25 },
|
|
25
|
+
* { id: 3, value: 50 },
|
|
26
|
+
* ],
|
|
27
|
+
* }}
|
|
28
|
+
* />
|
|
29
|
+
* </PaginationContextProvider>
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @see {@link Pagination} - Parent component that uses this component
|
|
33
|
+
* @see {@link PaginationContextProvider} - Required context provider
|
|
34
|
+
* @see {@link Dropdown} - Base dropdown component used internally
|
|
35
|
+
*
|
|
36
|
+
* @requires PaginationContextProvider - Must be used within PaginationContextProvider
|
|
37
|
+
*
|
|
38
|
+
* @accessibility
|
|
39
|
+
* - ARIA attributes via Dropdown component
|
|
40
|
+
* - Keyboard navigation support
|
|
41
|
+
* - Screen reader friendly
|
|
42
|
+
*/
|
|
2
43
|
export declare const RowsPerPageDropdown: ({ selectedItem, rowsPerPageList, rowsPerPageText, ...rest }: RowsPerPageDropdownProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,46 @@
|
|
|
1
1
|
import { CommonProps } from '../../../../types/emotion';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the RowsPerPageDropdown component
|
|
4
|
+
*
|
|
5
|
+
* A dropdown component that allows users to select the number of rows
|
|
6
|
+
* displayed per page in paginated data. Used within Pagination component
|
|
7
|
+
* to control items per page. Requires PaginationContextProvider.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <PaginationContextProvider selectedPage={1} defaultPerPage={25}>
|
|
12
|
+
* <Pagination
|
|
13
|
+
* pagesCount={20}
|
|
14
|
+
* isRowPerPageVisible={true}
|
|
15
|
+
* rowPerPageProps={{
|
|
16
|
+
* selectedItem: 25,
|
|
17
|
+
* rowsPerPageText: "Items per page",
|
|
18
|
+
* rowsPerPageList: [
|
|
19
|
+
* { id: 1, value: 10 },
|
|
20
|
+
* { id: 2, value: 25 },
|
|
21
|
+
* { id: 3, value: 50 },
|
|
22
|
+
* ],
|
|
23
|
+
* }}
|
|
24
|
+
* />
|
|
25
|
+
* </PaginationContextProvider>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
2
28
|
export interface RowsPerPageDropdownProps extends CommonProps {
|
|
29
|
+
/**
|
|
30
|
+
* Currently selected number of rows per page
|
|
31
|
+
* Must match a value in rowsPerPageList
|
|
32
|
+
*/
|
|
3
33
|
selectedItem?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Label text displayed before the dropdown
|
|
36
|
+
* @default 'Rows per page'
|
|
37
|
+
*/
|
|
4
38
|
rowsPerPageText?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Array of available rows per page options
|
|
41
|
+
* Each item must have id and value properties
|
|
42
|
+
* @default [{ id: 1, value: 10 }, { id: 2, value: 25 }, { id: 3, value: 50 }, { id: 4, value: 100 }]
|
|
43
|
+
*/
|
|
5
44
|
rowsPerPageList?: Array<{
|
|
6
45
|
id: number;
|
|
7
46
|
value: number;
|
|
@@ -6,6 +6,6 @@ export declare const PaginationNav: import("@emotion/styled").StyledComponent<{
|
|
|
6
6
|
theme?: Theme;
|
|
7
7
|
as?: React.ElementType;
|
|
8
8
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
9
|
-
export declare const PageNumberInput: import("@emotion/styled").StyledComponent<import("
|
|
9
|
+
export declare const PageNumberInput: import("@emotion/styled").StyledComponent<import("..").InputProps & import("react").RefAttributes<HTMLInputElement> & {
|
|
10
10
|
theme?: Theme;
|
|
11
11
|
}, {}, {}>;
|