@ssa-ui-kit/core 2.33.0 → 3.1.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 +102 -1
- package/dist/components/DropdownOption/DropdownOption.d.ts +2 -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 +3 -2
- package/dist/components/DropdownToggle/types.d.ts +5 -3
- 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/Assessment.d.ts +1 -1
- package/dist/components/Icon/icons/Award.d.ts +3 -0
- package/dist/components/Icon/icons/Bench.d.ts +3 -0
- package/dist/components/Icon/icons/Briefcase.d.ts +3 -0
- package/dist/components/Icon/icons/Building.d.ts +3 -0
- package/dist/components/Icon/icons/CalendarSchedule.d.ts +3 -0
- package/dist/components/Icon/icons/Camera.d.ts +3 -0
- package/dist/components/Icon/icons/CardText.d.ts +3 -0
- package/dist/components/Icon/icons/Case.d.ts +3 -0
- package/dist/components/Icon/icons/Comments.d.ts +3 -0
- package/dist/components/Icon/icons/Compensation.d.ts +3 -0
- package/dist/components/Icon/icons/Contacts.d.ts +3 -0
- package/dist/components/Icon/icons/CopyLink.d.ts +3 -0
- package/dist/components/Icon/icons/Delete.d.ts +3 -0
- package/dist/components/Icon/icons/DiamondRing.d.ts +3 -0
- package/dist/components/Icon/icons/Document.d.ts +3 -0
- package/dist/components/Icon/icons/Documents.d.ts +3 -0
- package/dist/components/Icon/icons/Education.d.ts +3 -0
- package/dist/components/Icon/icons/EmployeeProfile.d.ts +3 -0
- package/dist/components/Icon/icons/Export.d.ts +3 -0
- package/dist/components/Icon/icons/FollowLink.d.ts +3 -0
- package/dist/components/Icon/icons/Form.d.ts +3 -0
- package/dist/components/Icon/icons/Gender.d.ts +3 -0
- package/dist/components/Icon/icons/Gift.d.ts +3 -0
- package/dist/components/Icon/icons/Inventory.d.ts +3 -0
- package/dist/components/Icon/icons/Link.d.ts +3 -0
- package/dist/components/Icon/icons/OfficeChair.d.ts +3 -0
- package/dist/components/Icon/icons/OpenBook.d.ts +3 -0
- package/dist/components/Icon/icons/Report.d.ts +1 -1
- package/dist/components/Icon/icons/Results.d.ts +3 -0
- package/dist/components/Icon/icons/Signature.d.ts +3 -0
- package/dist/components/Icon/icons/Summery.d.ts +3 -0
- package/dist/components/Icon/icons/Team.d.ts +3 -0
- package/dist/components/Icon/icons/TechnicalReview.d.ts +3 -0
- package/dist/components/Icon/icons/TennisBall.d.ts +3 -0
- package/dist/components/Icon/icons/Timeline.d.ts +3 -0
- package/dist/components/Icon/icons/UnionCircle.d.ts +3 -0
- package/dist/components/Icon/icons/Url.d.ts +3 -0
- package/dist/components/Icon/icons/all.d.ts +36 -1
- 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/MultipleDropdown/index.d.ts +1 -0
- package/dist/components/MultipleDropdown/types.d.ts +74 -0
- 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/TextareaBase.d.ts +6 -1
- package/dist/components/Textarea/types.d.ts +109 -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 +10 -5
- 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 +48942 -19624
- package/dist/index.js.map +1 -1
- package/dist/types/emotion.d.ts +65 -0
- package/dist/utils/react19HocCompat.d.ts +14 -0
- package/package.json +42 -33
- package/dist/components/Icon/icons/Company.d.ts +0 -3
|
@@ -1,18 +1,92 @@
|
|
|
1
1
|
import { DropdownOptionProps } from '../DropdownOptions/types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the MultipleDropdown component
|
|
4
|
+
*
|
|
5
|
+
* A dropdown that supports selecting one or more options from a list.
|
|
6
|
+
* In multi-select mode (`isMultiple=true`) options toggle independently and
|
|
7
|
+
* a `+N` badge is shown for overflow. In single-select mode the menu closes
|
|
8
|
+
* after a pick. Forwards its ref to the root container div.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <MultipleDropdown
|
|
13
|
+
* label="Fruits"
|
|
14
|
+
* selectedItems={[{ value: 'apple' }]}
|
|
15
|
+
* onChange={(value, isSelected) => handleChange(value, isSelected)}
|
|
16
|
+
* >
|
|
17
|
+
* <DropdownOption value="apple">Apple</DropdownOption>
|
|
18
|
+
* <DropdownOption value="banana">Banana</DropdownOption>
|
|
19
|
+
* </MultipleDropdown>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
2
22
|
export type DropdownProps<P extends DropdownOptionProps> = {
|
|
23
|
+
/**
|
|
24
|
+
* List of currently selected items
|
|
25
|
+
* Each entry must match one of the DropdownOption values
|
|
26
|
+
* @default []
|
|
27
|
+
*/
|
|
3
28
|
selectedItems?: P[];
|
|
29
|
+
/**
|
|
30
|
+
* Enables multi-select mode — each option toggles independently.
|
|
31
|
+
* When `false` the dropdown behaves like a single-select and closes on pick.
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
4
34
|
isMultiple?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Disables the dropdown, preventing any user interaction
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
5
39
|
isDisabled?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Placeholder shown in the toggle button when no item is selected
|
|
42
|
+
* @default 'Select something'
|
|
43
|
+
*/
|
|
6
44
|
placeholder?: string;
|
|
45
|
+
/**
|
|
46
|
+
* When `true` the placeholder value is included in the displayed list.
|
|
47
|
+
* Set to `false` to hide it and show only the badge count.
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
7
50
|
showPlaceholder?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* DropdownOption components to render as selectable items
|
|
53
|
+
*/
|
|
8
54
|
children?: React.ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* Custom CSS class name forwarded to the toggle button.
|
|
57
|
+
* Useful for styling via `styled(MultipleDropdown)`.
|
|
58
|
+
*/
|
|
9
59
|
className?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Controlled open state — when provided, overrides internal open/close logic
|
|
62
|
+
*/
|
|
10
63
|
isOpen?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Label prefix shown in the toggle button before the selected value(s)
|
|
66
|
+
* e.g. `label="Strategy"` renders "Strategy: Value"
|
|
67
|
+
*/
|
|
11
68
|
label?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Callback fired when an option is toggled
|
|
71
|
+
* @param selectedItem - The value of the toggled option
|
|
72
|
+
* @param isSelected - `true` if the option was just selected, `false` if deselected
|
|
73
|
+
*/
|
|
12
74
|
onChange?: (selectedItem: string | number, isSelected: boolean) => void;
|
|
13
75
|
};
|
|
76
|
+
/**
|
|
77
|
+
* Context value shared with child DropdownOption components via MultipleDropdownContext
|
|
78
|
+
*/
|
|
14
79
|
export interface DropdownContextType<T extends DropdownOptionProps> {
|
|
80
|
+
/**
|
|
81
|
+
* Function called when an option is clicked
|
|
82
|
+
*/
|
|
15
83
|
onChange: (item: T) => void;
|
|
84
|
+
/**
|
|
85
|
+
* Whether multi-select mode is active
|
|
86
|
+
*/
|
|
16
87
|
isMultiple?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Map of all option values to their current state (including `isSelected`)
|
|
90
|
+
*/
|
|
17
91
|
allItems: Record<string | number, T>;
|
|
18
92
|
}
|
|
@@ -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
|
}, {}, {}>;
|
|
@@ -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
|
}
|