@soadtech/cli 0.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/index.js +272 -0
- package/package.json +24 -0
- package/registry/base/cn.ts +5 -0
- package/registry/base/css-modules.d.ts +4 -0
- package/registry/base/theme/reset.css +43 -0
- package/registry/base/theme/tokens.css +154 -0
- package/registry/components/Accordion/Accordion.module.css +3 -0
- package/registry/components/Accordion/Accordion.tsx +54 -0
- package/registry/components/Accordion/Accordion.types.ts +17 -0
- package/registry/components/Accordion/AccordionContext.ts +18 -0
- package/registry/components/Accordion/AccordionItem.module.css +124 -0
- package/registry/components/Accordion/AccordionItem.tsx +148 -0
- package/registry/components/Accordion/AccordionItem.types.ts +14 -0
- package/registry/components/Accordion/index.ts +8 -0
- package/registry/components/ActionBar/ActionBar.module.css +18 -0
- package/registry/components/ActionBar/ActionBar.tsx +21 -0
- package/registry/components/ActionBar/ActionBar.types.ts +8 -0
- package/registry/components/ActionBar/ActionBarLink.module.css +31 -0
- package/registry/components/ActionBar/ActionBarLink.tsx +55 -0
- package/registry/components/ActionBar/ActionBarLink.types.ts +7 -0
- package/registry/components/ActionBar/index.ts +4 -0
- package/registry/components/Alert/Alert.module.css +172 -0
- package/registry/components/Alert/Alert.tsx +146 -0
- package/registry/components/Alert/Alert.types.ts +25 -0
- package/registry/components/Alert/index.ts +7 -0
- package/registry/components/Avatar/Avatar.module.css +100 -0
- package/registry/components/Avatar/Avatar.tsx +54 -0
- package/registry/components/Avatar/Avatar.types.ts +18 -0
- package/registry/components/Avatar/AvatarGroup.module.css +64 -0
- package/registry/components/Avatar/AvatarGroup.tsx +65 -0
- package/registry/components/Avatar/AvatarGroup.types.ts +13 -0
- package/registry/components/Avatar/index.ts +8 -0
- package/registry/components/Badge/Badge.module.css +92 -0
- package/registry/components/Badge/Badge.tsx +89 -0
- package/registry/components/Badge/Badge.types.ts +20 -0
- package/registry/components/Badge/TrendBadge.module.css +47 -0
- package/registry/components/Badge/TrendBadge.tsx +65 -0
- package/registry/components/Badge/TrendBadge.types.ts +15 -0
- package/registry/components/Badge/index.ts +14 -0
- package/registry/components/Breadcrumbs/BreadcrumbItem.tsx +41 -0
- package/registry/components/Breadcrumbs/Breadcrumbs.module.css +81 -0
- package/registry/components/Breadcrumbs/Breadcrumbs.tsx +71 -0
- package/registry/components/Breadcrumbs/Breadcrumbs.types.ts +22 -0
- package/registry/components/Breadcrumbs/index.ts +7 -0
- package/registry/components/Button/Button.module.css +169 -0
- package/registry/components/Button/Button.tsx +43 -0
- package/registry/components/Button/Button.types.ts +18 -0
- package/registry/components/Button/index.ts +7 -0
- package/registry/components/ButtonLink/ButtonLink.module.css +85 -0
- package/registry/components/ButtonLink/ButtonLink.tsx +42 -0
- package/registry/components/ButtonLink/ButtonLink.types.ts +18 -0
- package/registry/components/ButtonLink/index.ts +6 -0
- package/registry/components/Calendar/Calendar.module.css +213 -0
- package/registry/components/Calendar/Calendar.tsx +370 -0
- package/registry/components/Calendar/Calendar.types.ts +28 -0
- package/registry/components/Calendar/CalendarDialog.module.css +29 -0
- package/registry/components/Calendar/CalendarDialog.tsx +173 -0
- package/registry/components/Calendar/CalendarDialog.types.ts +30 -0
- package/registry/components/Calendar/index.ts +9 -0
- package/registry/components/Card/Card.module.css +35 -0
- package/registry/components/Card/Card.tsx +36 -0
- package/registry/components/Card/Card.types.ts +37 -0
- package/registry/components/Card/CardContent.module.css +3 -0
- package/registry/components/Card/CardContent.tsx +16 -0
- package/registry/components/Card/CardFooter.module.css +31 -0
- package/registry/components/Card/CardFooter.tsx +34 -0
- package/registry/components/Card/CardHeader.module.css +61 -0
- package/registry/components/Card/CardHeader.tsx +46 -0
- package/registry/components/Card/InsightCard.module.css +106 -0
- package/registry/components/Card/InsightCard.tsx +68 -0
- package/registry/components/Card/InsightCard.types.ts +24 -0
- package/registry/components/Card/KPICard.module.css +31 -0
- package/registry/components/Card/KPICard.tsx +29 -0
- package/registry/components/Card/KPICard.types.ts +13 -0
- package/registry/components/Card/ListItemCard.module.css +59 -0
- package/registry/components/Card/ListItemCard.tsx +37 -0
- package/registry/components/Card/ListItemCard.types.ts +18 -0
- package/registry/components/Card/PlanCard.module.css +125 -0
- package/registry/components/Card/PlanCard.tsx +108 -0
- package/registry/components/Card/PlanCard.types.ts +30 -0
- package/registry/components/Card/ProductCard.module.css +118 -0
- package/registry/components/Card/ProductCard.tsx +56 -0
- package/registry/components/Card/ProductCard.types.ts +24 -0
- package/registry/components/Card/StatCard.module.css +20 -0
- package/registry/components/Card/StatCard.tsx +26 -0
- package/registry/components/Card/StatCard.types.ts +12 -0
- package/registry/components/Card/UserGroupCard.module.css +50 -0
- package/registry/components/Card/UserGroupCard.tsx +59 -0
- package/registry/components/Card/UserGroupCard.types.ts +23 -0
- package/registry/components/Card/index.ts +38 -0
- package/registry/components/Chart/BarChart.module.css +54 -0
- package/registry/components/Chart/BarChart.tsx +196 -0
- package/registry/components/Chart/BarChart.types.ts +20 -0
- package/registry/components/Chart/ChartAction.module.css +43 -0
- package/registry/components/Chart/ChartAction.tsx +35 -0
- package/registry/components/Chart/ChartAction.types.ts +17 -0
- package/registry/components/Chart/ChartAxis.module.css +47 -0
- package/registry/components/Chart/ChartAxis.tsx +79 -0
- package/registry/components/Chart/ChartAxis.types.ts +14 -0
- package/registry/components/Chart/ChartLegend.module.css +31 -0
- package/registry/components/Chart/ChartLegend.tsx +49 -0
- package/registry/components/Chart/ChartLegend.types.ts +18 -0
- package/registry/components/Chart/ChartTooltip.module.css +54 -0
- package/registry/components/Chart/ChartTooltip.tsx +44 -0
- package/registry/components/Chart/ChartTooltip.types.ts +19 -0
- package/registry/components/Chart/DonutChart.module.css +32 -0
- package/registry/components/Chart/DonutChart.tsx +107 -0
- package/registry/components/Chart/DonutChart.types.ts +20 -0
- package/registry/components/Chart/GridChart.module.css +26 -0
- package/registry/components/Chart/GridChart.tsx +61 -0
- package/registry/components/Chart/GridChart.types.ts +14 -0
- package/registry/components/Chart/HoverTooltip.module.css +16 -0
- package/registry/components/Chart/HoverTooltip.tsx +22 -0
- package/registry/components/Chart/KPIIndicator.module.css +48 -0
- package/registry/components/Chart/KPIIndicator.tsx +28 -0
- package/registry/components/Chart/KPIIndicator.types.ts +16 -0
- package/registry/components/Chart/LineChart.module.css +54 -0
- package/registry/components/Chart/LineChart.tsx +282 -0
- package/registry/components/Chart/LineChart.types.ts +22 -0
- package/registry/components/Chart/ProgressChart.module.css +54 -0
- package/registry/components/Chart/ProgressChart.tsx +64 -0
- package/registry/components/Chart/ProgressChart.types.ts +18 -0
- package/registry/components/Chart/TrendLineChart.module.css +5 -0
- package/registry/components/Chart/TrendLineChart.tsx +131 -0
- package/registry/components/Chart/TrendLineChart.types.ts +19 -0
- package/registry/components/Chart/chart.utils.ts +131 -0
- package/registry/components/Chart/index.ts +47 -0
- package/registry/components/Chart/useChartHover.ts +24 -0
- package/registry/components/Checkbox/Checkbox.module.css +101 -0
- package/registry/components/Checkbox/Checkbox.tsx +100 -0
- package/registry/components/Checkbox/Checkbox.types.ts +11 -0
- package/registry/components/Checkbox/CheckboxField.module.css +69 -0
- package/registry/components/Checkbox/CheckboxField.tsx +54 -0
- package/registry/components/Checkbox/CheckboxField.types.ts +9 -0
- package/registry/components/Checkbox/CheckboxGroup.module.css +41 -0
- package/registry/components/Checkbox/CheckboxGroup.tsx +60 -0
- package/registry/components/Checkbox/CheckboxGroup.types.ts +11 -0
- package/registry/components/Checkbox/CheckboxGroupContext.ts +13 -0
- package/registry/components/Checkbox/index.ts +11 -0
- package/registry/components/Chip/Chip.module.css +143 -0
- package/registry/components/Chip/Chip.tsx +93 -0
- package/registry/components/Chip/Chip.types.ts +19 -0
- package/registry/components/Chip/ChipGroup.module.css +5 -0
- package/registry/components/Chip/ChipGroup.tsx +16 -0
- package/registry/components/Chip/ChipGroup.types.ts +3 -0
- package/registry/components/Chip/index.ts +9 -0
- package/registry/components/Datepicker/Datepicker.module.css +133 -0
- package/registry/components/Datepicker/Datepicker.tsx +236 -0
- package/registry/components/Datepicker/Datepicker.types.ts +36 -0
- package/registry/components/Datepicker/index.ts +2 -0
- package/registry/components/Dialog/Dialog.module.css +18 -0
- package/registry/components/Dialog/Dialog.tsx +69 -0
- package/registry/components/Dialog/Dialog.types.ts +45 -0
- package/registry/components/Dialog/DialogBody.module.css +3 -0
- package/registry/components/Dialog/DialogBody.tsx +16 -0
- package/registry/components/Dialog/DialogContext.ts +11 -0
- package/registry/components/Dialog/DialogFooter.module.css +38 -0
- package/registry/components/Dialog/DialogFooter.tsx +30 -0
- package/registry/components/Dialog/DialogHeader.module.css +70 -0
- package/registry/components/Dialog/DialogHeader.tsx +72 -0
- package/registry/components/Dialog/DialogIcon.module.css +31 -0
- package/registry/components/Dialog/DialogIcon.tsx +89 -0
- package/registry/components/Dialog/index.ts +14 -0
- package/registry/components/Divider/Divider.module.css +19 -0
- package/registry/components/Divider/Divider.tsx +20 -0
- package/registry/components/Divider/Divider.types.ts +9 -0
- package/registry/components/Divider/index.ts +2 -0
- package/registry/components/DropdownMenu/DropdownMenu.module.css +9 -0
- package/registry/components/DropdownMenu/DropdownMenu.tsx +21 -0
- package/registry/components/DropdownMenu/DropdownMenu.types.ts +22 -0
- package/registry/components/DropdownMenu/DropdownMenuDivider.module.css +5 -0
- package/registry/components/DropdownMenu/DropdownMenuDivider.tsx +20 -0
- package/registry/components/DropdownMenu/DropdownMenuHeader.module.css +7 -0
- package/registry/components/DropdownMenu/DropdownMenuHeader.tsx +17 -0
- package/registry/components/DropdownMenu/DropdownMenuItem.module.css +78 -0
- package/registry/components/DropdownMenu/DropdownMenuItem.tsx +40 -0
- package/registry/components/DropdownMenu/index.ts +10 -0
- package/registry/components/FileUpload/FileUpload.module.css +122 -0
- package/registry/components/FileUpload/FileUpload.tsx +354 -0
- package/registry/components/FileUpload/FileUpload.types.ts +89 -0
- package/registry/components/FileUpload/FileUploadIcon.module.css +61 -0
- package/registry/components/FileUpload/FileUploadIcon.tsx +84 -0
- package/registry/components/FileUpload/FileUploadInput.module.css +140 -0
- package/registry/components/FileUpload/FileUploadInput.tsx +113 -0
- package/registry/components/FileUpload/FileUploadItem.module.css +41 -0
- package/registry/components/FileUpload/FileUploadItem.tsx +39 -0
- package/registry/components/FileUpload/index.ts +12 -0
- package/registry/components/InputCounter/InputCounter.module.css +146 -0
- package/registry/components/InputCounter/InputCounter.tsx +232 -0
- package/registry/components/InputCounter/InputCounter.types.ts +37 -0
- package/registry/components/InputCounter/index.ts +7 -0
- package/registry/components/InputMessage/InputMessage.module.css +148 -0
- package/registry/components/InputMessage/InputMessage.tsx +294 -0
- package/registry/components/InputMessage/InputMessage.types.ts +30 -0
- package/registry/components/InputMessage/index.ts +2 -0
- package/registry/components/InputSearch/InputSearch.module.css +168 -0
- package/registry/components/InputSearch/InputSearch.tsx +251 -0
- package/registry/components/InputSearch/InputSearch.types.ts +35 -0
- package/registry/components/InputSearch/index.ts +6 -0
- package/registry/components/InputText/InputText.module.css +183 -0
- package/registry/components/InputText/InputText.tsx +244 -0
- package/registry/components/InputText/InputText.types.ts +32 -0
- package/registry/components/InputText/index.ts +7 -0
- package/registry/components/InputTextArea/InputTextArea.module.css +141 -0
- package/registry/components/InputTextArea/InputTextArea.tsx +170 -0
- package/registry/components/InputTextArea/InputTextArea.types.ts +18 -0
- package/registry/components/InputTextArea/index.ts +6 -0
- package/registry/components/NavbarUser/NavbarUser.module.css +265 -0
- package/registry/components/NavbarUser/NavbarUser.tsx +202 -0
- package/registry/components/NavbarUser/NavbarUser.types.ts +31 -0
- package/registry/components/NavbarUser/index.ts +2 -0
- package/registry/components/Notification/Notification.types.ts +65 -0
- package/registry/components/Notification/NotificationItem.module.css +143 -0
- package/registry/components/Notification/NotificationItem.tsx +157 -0
- package/registry/components/Notification/NotificationPanel.module.css +75 -0
- package/registry/components/Notification/NotificationPanel.tsx +68 -0
- package/registry/components/Notification/NotificationReply.module.css +56 -0
- package/registry/components/Notification/NotificationReply.tsx +52 -0
- package/registry/components/Notification/index.ts +9 -0
- package/registry/components/Pagination/Pagination.module.css +123 -0
- package/registry/components/Pagination/Pagination.tsx +212 -0
- package/registry/components/Pagination/Pagination.types.ts +24 -0
- package/registry/components/Pagination/PaginationDots.module.css +60 -0
- package/registry/components/Pagination/PaginationDots.tsx +48 -0
- package/registry/components/Pagination/PaginationDots.types.ts +17 -0
- package/registry/components/Pagination/index.ts +12 -0
- package/registry/components/Persona/MessageDropdown.module.css +76 -0
- package/registry/components/Persona/MessageDropdown.tsx +68 -0
- package/registry/components/Persona/Persona.module.css +92 -0
- package/registry/components/Persona/Persona.tsx +90 -0
- package/registry/components/Persona/Persona.types.ts +71 -0
- package/registry/components/Persona/PersonaAction.module.css +80 -0
- package/registry/components/Persona/PersonaAction.tsx +49 -0
- package/registry/components/Persona/PersonaMessage.module.css +156 -0
- package/registry/components/Persona/PersonaMessage.tsx +70 -0
- package/registry/components/Persona/index.ts +11 -0
- package/registry/components/Progress/Progress.module.css +41 -0
- package/registry/components/Progress/Progress.tsx +43 -0
- package/registry/components/Progress/Progress.types.ts +10 -0
- package/registry/components/Progress/index.ts +2 -0
- package/registry/components/RadioButton/RadioButton.module.css +103 -0
- package/registry/components/RadioButton/RadioButton.tsx +59 -0
- package/registry/components/RadioButton/RadioButton.types.ts +19 -0
- package/registry/components/RadioButton/RadioField.module.css +68 -0
- package/registry/components/RadioButton/RadioField.tsx +68 -0
- package/registry/components/RadioButton/RadioGroup.module.css +41 -0
- package/registry/components/RadioButton/RadioGroup.tsx +76 -0
- package/registry/components/RadioButton/RadioGroupContext.ts +16 -0
- package/registry/components/RadioButton/index.ts +12 -0
- package/registry/components/RangeSlider/RangeSlider.module.css +133 -0
- package/registry/components/RangeSlider/RangeSlider.tsx +251 -0
- package/registry/components/RangeSlider/RangeSlider.types.ts +25 -0
- package/registry/components/RangeSlider/index.ts +2 -0
- package/registry/components/Rating/Rating.module.css +56 -0
- package/registry/components/Rating/Rating.tsx +142 -0
- package/registry/components/Rating/Rating.types.ts +14 -0
- package/registry/components/Rating/index.ts +7 -0
- package/registry/components/SegmentedControl/SegmentedControl.module.css +56 -0
- package/registry/components/SegmentedControl/SegmentedControl.tsx +46 -0
- package/registry/components/SegmentedControl/SegmentedControl.types.ts +27 -0
- package/registry/components/SegmentedControl/SegmentedControlContext.ts +20 -0
- package/registry/components/SegmentedControl/SegmentedControlItem.module.css +55 -0
- package/registry/components/SegmentedControl/SegmentedControlItem.tsx +32 -0
- package/registry/components/SegmentedControl/index.ts +8 -0
- package/registry/components/SelectDropdown/SelectDropdown.module.css +214 -0
- package/registry/components/SelectDropdown/SelectDropdown.tsx +375 -0
- package/registry/components/SelectDropdown/SelectDropdown.types.ts +50 -0
- package/registry/components/SelectDropdown/SelectDropdownOption.module.css +101 -0
- package/registry/components/SelectDropdown/SelectDropdownOption.tsx +86 -0
- package/registry/components/SelectDropdown/SelectDropdownOverlay.module.css +74 -0
- package/registry/components/SelectDropdown/SelectDropdownOverlay.tsx +202 -0
- package/registry/components/SelectDropdown/index.ts +11 -0
- package/registry/components/Sidebar/Sidebar.module.css +14 -0
- package/registry/components/Sidebar/Sidebar.tsx +41 -0
- package/registry/components/Sidebar/Sidebar.types.ts +41 -0
- package/registry/components/Sidebar/SidebarContent.module.css +5 -0
- package/registry/components/Sidebar/SidebarContent.tsx +14 -0
- package/registry/components/Sidebar/SidebarContext.ts +15 -0
- package/registry/components/Sidebar/SidebarDivider.module.css +5 -0
- package/registry/components/Sidebar/SidebarDivider.tsx +17 -0
- package/registry/components/Sidebar/SidebarFooter.module.css +5 -0
- package/registry/components/Sidebar/SidebarFooter.tsx +14 -0
- package/registry/components/Sidebar/SidebarGroup.module.css +12 -0
- package/registry/components/Sidebar/SidebarGroup.tsx +22 -0
- package/registry/components/Sidebar/SidebarHeader.module.css +5 -0
- package/registry/components/Sidebar/SidebarHeader.tsx +14 -0
- package/registry/components/Sidebar/SidebarNavItem.module.css +176 -0
- package/registry/components/Sidebar/SidebarNavItem.tsx +96 -0
- package/registry/components/Sidebar/index.ts +16 -0
- package/registry/components/Stepper/Stepper.module.css +11 -0
- package/registry/components/Stepper/Stepper.tsx +47 -0
- package/registry/components/Stepper/Stepper.types.ts +26 -0
- package/registry/components/Stepper/StepperContext.ts +17 -0
- package/registry/components/Stepper/StepperStep.module.css +183 -0
- package/registry/components/Stepper/StepperStep.tsx +204 -0
- package/registry/components/Stepper/index.ts +9 -0
- package/registry/components/Switch/Switch.module.css +145 -0
- package/registry/components/Switch/Switch.tsx +96 -0
- package/registry/components/Switch/Switch.types.ts +19 -0
- package/registry/components/Switch/SwitchField.module.css +69 -0
- package/registry/components/Switch/SwitchField.tsx +49 -0
- package/registry/components/Switch/index.ts +8 -0
- package/registry/components/Tab/Tab.module.css +20 -0
- package/registry/components/Tab/Tab.tsx +35 -0
- package/registry/components/Tab/Tab.types.ts +21 -0
- package/registry/components/Tab/TabAdd.module.css +36 -0
- package/registry/components/Tab/TabAdd.tsx +41 -0
- package/registry/components/Tab/TabContext.ts +19 -0
- package/registry/components/Tab/TabItem.module.css +145 -0
- package/registry/components/Tab/TabItem.tsx +87 -0
- package/registry/components/Tab/index.ts +9 -0
- package/registry/components/Table/Table.module.css +33 -0
- package/registry/components/Table/Table.tsx +74 -0
- package/registry/components/Table/Table.types.ts +64 -0
- package/registry/components/Table/TableBody.tsx +23 -0
- package/registry/components/Table/TableCell.module.css +21 -0
- package/registry/components/Table/TableCell.tsx +20 -0
- package/registry/components/Table/TableContext.ts +22 -0
- package/registry/components/Table/TableFooter.module.css +27 -0
- package/registry/components/Table/TableFooter.tsx +20 -0
- package/registry/components/Table/TableHeader.module.css +3 -0
- package/registry/components/Table/TableHeader.tsx +17 -0
- package/registry/components/Table/TableHeaderCell.module.css +55 -0
- package/registry/components/Table/TableHeaderCell.tsx +98 -0
- package/registry/components/Table/TableRow.module.css +53 -0
- package/registry/components/Table/TableRow.tsx +31 -0
- package/registry/components/Table/TableToolbar.module.css +7 -0
- package/registry/components/Table/TableToolbar.tsx +16 -0
- package/registry/components/Table/index.ts +22 -0
- package/registry/components/Tag/Tag.module.css +46 -0
- package/registry/components/Tag/Tag.tsx +38 -0
- package/registry/components/Tag/Tag.types.ts +37 -0
- package/registry/components/Tag/TagBrand.module.css +42 -0
- package/registry/components/Tag/TagBrand.tsx +38 -0
- package/registry/components/Tag/TagStatus.module.css +43 -0
- package/registry/components/Tag/TagStatus.tsx +119 -0
- package/registry/components/Tag/index.ts +15 -0
- package/registry/components/Tooltip/Tooltip.module.css +208 -0
- package/registry/components/Tooltip/Tooltip.tsx +81 -0
- package/registry/components/Tooltip/Tooltip.types.ts +27 -0
- package/registry/components/Tooltip/index.ts +7 -0
- package/registry/components/TreeviewList/TreeviewItem.module.css +89 -0
- package/registry/components/TreeviewList/TreeviewItem.tsx +142 -0
- package/registry/components/TreeviewList/TreeviewList.module.css +3 -0
- package/registry/components/TreeviewList/TreeviewList.tsx +19 -0
- package/registry/components/TreeviewList/TreeviewList.types.ts +18 -0
- package/registry/components/TreeviewList/TreeviewListContext.ts +13 -0
- package/registry/components/TreeviewList/index.ts +6 -0
- package/registry/components/VerificationCode/VerificationCode.module.css +49 -0
- package/registry/components/VerificationCode/VerificationCode.tsx +147 -0
- package/registry/components/VerificationCode/VerificationCode.types.ts +21 -0
- package/registry/components/VerificationCode/index.ts +2 -0
- package/registry/registry.json +746 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { cn } from '../../utils/cn';
|
|
3
|
+
import { Button } from '../Button';
|
|
4
|
+
import type { NotificationPanelProps } from './Notification.types';
|
|
5
|
+
import styles from './NotificationPanel.module.css';
|
|
6
|
+
|
|
7
|
+
function CloseIcon() {
|
|
8
|
+
return (
|
|
9
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
10
|
+
<path
|
|
11
|
+
d="M4 4L12 12M12 4L4 12"
|
|
12
|
+
stroke="currentColor"
|
|
13
|
+
strokeWidth="1.5"
|
|
14
|
+
strokeLinecap="round"
|
|
15
|
+
/>
|
|
16
|
+
</svg>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const NotificationPanel = forwardRef<HTMLDivElement, NotificationPanelProps>(
|
|
21
|
+
(
|
|
22
|
+
{
|
|
23
|
+
title = 'Notifications',
|
|
24
|
+
onClose,
|
|
25
|
+
footerLabel = 'See all notifications',
|
|
26
|
+
onFooterClick,
|
|
27
|
+
children,
|
|
28
|
+
className,
|
|
29
|
+
...rest
|
|
30
|
+
},
|
|
31
|
+
ref
|
|
32
|
+
) => {
|
|
33
|
+
return (
|
|
34
|
+
<div ref={ref} className={cn(styles.root, className)} {...rest}>
|
|
35
|
+
<div className={styles.header}>
|
|
36
|
+
<span className={styles.title}>{title}</span>
|
|
37
|
+
{onClose && (
|
|
38
|
+
<button
|
|
39
|
+
type="button"
|
|
40
|
+
className={styles.closeBtn}
|
|
41
|
+
onClick={onClose}
|
|
42
|
+
aria-label="Close notifications"
|
|
43
|
+
>
|
|
44
|
+
<CloseIcon />
|
|
45
|
+
</button>
|
|
46
|
+
)}
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div className={styles.body}>{children}</div>
|
|
50
|
+
|
|
51
|
+
{onFooterClick && (
|
|
52
|
+
<div className={styles.footer}>
|
|
53
|
+
<Button
|
|
54
|
+
variant="fill"
|
|
55
|
+
size="sm"
|
|
56
|
+
className={styles.footerBtn}
|
|
57
|
+
onClick={onFooterClick}
|
|
58
|
+
>
|
|
59
|
+
{footerLabel}
|
|
60
|
+
</Button>
|
|
61
|
+
</div>
|
|
62
|
+
)}
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
NotificationPanel.displayName = 'NotificationPanel';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* ═══ NotificationReply ═══ */
|
|
2
|
+
|
|
3
|
+
.root {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: var(--st-space-2);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.inputRow {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: var(--st-space-2);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.inputWrap {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: var(--st-space-2);
|
|
19
|
+
flex: 1;
|
|
20
|
+
min-width: 0;
|
|
21
|
+
padding: var(--st-space-1) var(--st-space-2);
|
|
22
|
+
border: 1px solid var(--st-color-border);
|
|
23
|
+
border-radius: var(--st-radius-md);
|
|
24
|
+
background-color: var(--st-color-surface);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.inputWrap:focus-within {
|
|
28
|
+
border-color: var(--st-color-primary);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.mentions {
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: var(--st-space-1);
|
|
35
|
+
flex-shrink: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.input {
|
|
39
|
+
flex: 1;
|
|
40
|
+
min-width: 0;
|
|
41
|
+
border: none;
|
|
42
|
+
outline: none;
|
|
43
|
+
background: transparent;
|
|
44
|
+
font-family: var(--st-font-family);
|
|
45
|
+
font-size: var(--st-font-size-xs);
|
|
46
|
+
color: var(--st-color-foreground);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.input::placeholder {
|
|
50
|
+
color: var(--st-color-muted);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.actions {
|
|
54
|
+
display: flex;
|
|
55
|
+
gap: var(--st-space-2);
|
|
56
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { cn } from '../../utils/cn';
|
|
3
|
+
import { Avatar } from '../Avatar';
|
|
4
|
+
import { Button } from '../Button';
|
|
5
|
+
import type { NotificationReplyProps } from './Notification.types';
|
|
6
|
+
import styles from './NotificationReply.module.css';
|
|
7
|
+
|
|
8
|
+
export const NotificationReply = forwardRef<HTMLDivElement, NotificationReplyProps>(
|
|
9
|
+
(
|
|
10
|
+
{
|
|
11
|
+
avatarSrc,
|
|
12
|
+
avatarAlt = '',
|
|
13
|
+
value = '',
|
|
14
|
+
onValueChange,
|
|
15
|
+
mentions,
|
|
16
|
+
placeholder = 'Reply to Emma...',
|
|
17
|
+
onSend,
|
|
18
|
+
onCancel,
|
|
19
|
+
className,
|
|
20
|
+
...rest
|
|
21
|
+
},
|
|
22
|
+
ref
|
|
23
|
+
) => {
|
|
24
|
+
return (
|
|
25
|
+
<div ref={ref} className={cn(styles.root, className)} {...rest}>
|
|
26
|
+
<div className={styles.inputRow}>
|
|
27
|
+
<Avatar src={avatarSrc} alt={avatarAlt} size="sm" />
|
|
28
|
+
<div className={styles.inputWrap}>
|
|
29
|
+
{mentions && <span className={styles.mentions}>{mentions}</span>}
|
|
30
|
+
<input
|
|
31
|
+
type="text"
|
|
32
|
+
className={styles.input}
|
|
33
|
+
value={value}
|
|
34
|
+
onChange={(e) => onValueChange?.(e.target.value)}
|
|
35
|
+
placeholder={placeholder}
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
<div className={styles.actions}>
|
|
40
|
+
<Button size="sm" variant="fill" onClick={onSend}>
|
|
41
|
+
Send Reply
|
|
42
|
+
</Button>
|
|
43
|
+
<Button size="sm" variant="outline" onClick={onCancel}>
|
|
44
|
+
Cancel
|
|
45
|
+
</Button>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
NotificationReply.displayName = 'NotificationReply';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { NotificationItem } from './NotificationItem';
|
|
2
|
+
export { NotificationReply } from './NotificationReply';
|
|
3
|
+
export { NotificationPanel } from './NotificationPanel';
|
|
4
|
+
export type {
|
|
5
|
+
NotificationItemProps,
|
|
6
|
+
NotificationCategory,
|
|
7
|
+
NotificationReplyProps,
|
|
8
|
+
NotificationPanelProps,
|
|
9
|
+
} from './Notification.types';
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/* ═══ Pagination ═══ */
|
|
2
|
+
|
|
3
|
+
/* ─── Root ─── */
|
|
4
|
+
.root {
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: var(--st-space-2);
|
|
8
|
+
font-family: var(--st-font-family);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* ─── Page text (text variant) ─── */
|
|
12
|
+
.pageText {
|
|
13
|
+
font-size: var(--st-font-size-sm);
|
|
14
|
+
font-weight: var(--st-font-weight-medium);
|
|
15
|
+
color: var(--st-color-foreground);
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
user-select: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* ─── Page list ─── */
|
|
21
|
+
.list {
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: var(--st-space-1);
|
|
25
|
+
list-style: none;
|
|
26
|
+
margin: 0;
|
|
27
|
+
padding: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* ─── Ellipsis ─── */
|
|
31
|
+
.ellipsis {
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
font-size: var(--st-font-size-sm);
|
|
36
|
+
color: var(--st-color-muted);
|
|
37
|
+
user-select: none;
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ellipsis.sm {
|
|
42
|
+
width: 32px;
|
|
43
|
+
height: 32px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ellipsis.md {
|
|
47
|
+
width: 40px;
|
|
48
|
+
height: 40px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* ─── Page item ─── */
|
|
52
|
+
.pageItem {
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
border: none;
|
|
57
|
+
background: transparent;
|
|
58
|
+
border-radius: var(--st-radius-full);
|
|
59
|
+
font-family: var(--st-font-family);
|
|
60
|
+
font-size: var(--st-font-size-sm);
|
|
61
|
+
font-weight: var(--st-font-weight-medium);
|
|
62
|
+
color: var(--st-color-foreground);
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
transition: background-color var(--st-transition-fast),
|
|
65
|
+
color var(--st-transition-fast);
|
|
66
|
+
user-select: none;
|
|
67
|
+
padding: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.pageItem.sm {
|
|
71
|
+
width: 32px;
|
|
72
|
+
height: 32px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.pageItem.md {
|
|
76
|
+
width: 40px;
|
|
77
|
+
height: 40px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.pageItem:hover:not(:disabled):not(.pageItemActive) {
|
|
81
|
+
background-color: var(--st-color-neutral-100);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.pageItem:focus-visible {
|
|
85
|
+
outline: 2px solid var(--st-color-primary);
|
|
86
|
+
outline-offset: 2px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.pageItem:disabled {
|
|
90
|
+
opacity: 0.5;
|
|
91
|
+
pointer-events: none;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* ─── Active page ─── */
|
|
95
|
+
.pageItemActive {
|
|
96
|
+
background-color: var(--st-color-neutral-900);
|
|
97
|
+
color: #ffffff;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.pageItemActive:hover:not(:disabled) {
|
|
101
|
+
background-color: var(--st-color-neutral-800);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* ─── Congested variant ─── */
|
|
105
|
+
.listCongested {
|
|
106
|
+
gap: 0;
|
|
107
|
+
border: 1px solid var(--st-color-border-strong);
|
|
108
|
+
border-radius: var(--st-radius-sm);
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.pageItemBordered {
|
|
113
|
+
border-radius: 0;
|
|
114
|
+
border-inline-start: 1px solid var(--st-color-border-strong);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.listCongested li:first-child .pageItemBordered {
|
|
118
|
+
border-inline-start: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.pageItemBordered.pageItemActive {
|
|
122
|
+
border-color: var(--st-color-neutral-900);
|
|
123
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { cn } from '../../utils/cn';
|
|
3
|
+
import { Button } from '../Button';
|
|
4
|
+
import type { PaginationProps } from './Pagination.types';
|
|
5
|
+
import styles from './Pagination.module.css';
|
|
6
|
+
|
|
7
|
+
/* ─── Inline SVGs ─── */
|
|
8
|
+
|
|
9
|
+
function ChevronLeft() {
|
|
10
|
+
return (
|
|
11
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
12
|
+
<path
|
|
13
|
+
d="M10 12L6 8L10 4"
|
|
14
|
+
stroke="currentColor"
|
|
15
|
+
strokeWidth="1.5"
|
|
16
|
+
strokeLinecap="round"
|
|
17
|
+
strokeLinejoin="round"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function ChevronRight() {
|
|
24
|
+
return (
|
|
25
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
26
|
+
<path
|
|
27
|
+
d="M6 4L10 8L6 12"
|
|
28
|
+
stroke="currentColor"
|
|
29
|
+
strokeWidth="1.5"
|
|
30
|
+
strokeLinecap="round"
|
|
31
|
+
strokeLinejoin="round"
|
|
32
|
+
/>
|
|
33
|
+
</svg>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* ─── Page range algorithm ─── */
|
|
38
|
+
|
|
39
|
+
type RangeItem = number | 'ellipsis';
|
|
40
|
+
|
|
41
|
+
function range(start: number, end: number): number[] {
|
|
42
|
+
const result: number[] = [];
|
|
43
|
+
for (let i = start; i <= end; i++) result.push(i);
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function buildRange(
|
|
48
|
+
page: number,
|
|
49
|
+
count: number,
|
|
50
|
+
siblingCount: number,
|
|
51
|
+
boundaryCount: number
|
|
52
|
+
): RangeItem[] {
|
|
53
|
+
// Total slots: boundaries on each side + siblings on each side + current + 2 possible ellipses
|
|
54
|
+
const totalSlots = boundaryCount * 2 + siblingCount * 2 + 3;
|
|
55
|
+
|
|
56
|
+
if (count <= totalSlots) {
|
|
57
|
+
return range(1, count);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const leftBoundary = range(1, boundaryCount);
|
|
61
|
+
const rightBoundary = range(count - boundaryCount + 1, count);
|
|
62
|
+
|
|
63
|
+
const siblingLeft = Math.max(page - siblingCount, boundaryCount + 1);
|
|
64
|
+
const siblingRight = Math.min(page + siblingCount, count - boundaryCount);
|
|
65
|
+
|
|
66
|
+
const showLeftEllipsis = siblingLeft > boundaryCount + 2;
|
|
67
|
+
const showRightEllipsis = siblingRight < count - boundaryCount - 1;
|
|
68
|
+
|
|
69
|
+
const result: RangeItem[] = [];
|
|
70
|
+
|
|
71
|
+
// Left boundary
|
|
72
|
+
result.push(...leftBoundary);
|
|
73
|
+
|
|
74
|
+
// Left ellipsis or fill
|
|
75
|
+
if (showLeftEllipsis) {
|
|
76
|
+
result.push('ellipsis');
|
|
77
|
+
} else {
|
|
78
|
+
// Fill from boundaryCount+1 to siblingLeft-1
|
|
79
|
+
for (let i = boundaryCount + 1; i < siblingLeft; i++) {
|
|
80
|
+
result.push(i);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Sibling range including current page
|
|
85
|
+
result.push(...range(siblingLeft, siblingRight));
|
|
86
|
+
|
|
87
|
+
// Right ellipsis or fill
|
|
88
|
+
if (showRightEllipsis) {
|
|
89
|
+
result.push('ellipsis');
|
|
90
|
+
} else {
|
|
91
|
+
// Fill from siblingRight+1 to count-boundaryCount
|
|
92
|
+
for (let i = siblingRight + 1; i <= count - boundaryCount; i++) {
|
|
93
|
+
result.push(i);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Right boundary
|
|
98
|
+
result.push(...rightBoundary);
|
|
99
|
+
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* ─── Component ─── */
|
|
104
|
+
|
|
105
|
+
export const Pagination = forwardRef<HTMLElement, PaginationProps>(
|
|
106
|
+
(
|
|
107
|
+
{
|
|
108
|
+
page,
|
|
109
|
+
count,
|
|
110
|
+
onPageChange,
|
|
111
|
+
size = 'md',
|
|
112
|
+
variant = 'spaced',
|
|
113
|
+
siblingCount = 1,
|
|
114
|
+
boundaryCount = 1,
|
|
115
|
+
disabled = false,
|
|
116
|
+
className,
|
|
117
|
+
...rest
|
|
118
|
+
},
|
|
119
|
+
ref
|
|
120
|
+
) => {
|
|
121
|
+
const isFirst = page <= 1;
|
|
122
|
+
const isLast = page >= count;
|
|
123
|
+
|
|
124
|
+
const pages = buildRange(page, count, siblingCount, boundaryCount);
|
|
125
|
+
|
|
126
|
+
const buttonSize = size === 'sm' ? 'sm' : 'md';
|
|
127
|
+
|
|
128
|
+
const prevButton = (
|
|
129
|
+
<Button
|
|
130
|
+
variant="outline"
|
|
131
|
+
size={buttonSize}
|
|
132
|
+
disabled={disabled || isFirst}
|
|
133
|
+
onClick={() => onPageChange(page - 1)}
|
|
134
|
+
aria-label="Previous page"
|
|
135
|
+
iconLeft={<ChevronLeft />}
|
|
136
|
+
>
|
|
137
|
+
{size === 'md' ? 'Previous' : undefined}
|
|
138
|
+
</Button>
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
const nextButton = (
|
|
142
|
+
<Button
|
|
143
|
+
variant="outline"
|
|
144
|
+
size={buttonSize}
|
|
145
|
+
disabled={disabled || isLast}
|
|
146
|
+
onClick={() => onPageChange(page + 1)}
|
|
147
|
+
aria-label="Next page"
|
|
148
|
+
iconRight={<ChevronRight />}
|
|
149
|
+
>
|
|
150
|
+
{size === 'md' ? 'Next' : undefined}
|
|
151
|
+
</Button>
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<nav
|
|
156
|
+
ref={ref}
|
|
157
|
+
aria-label="Pagination"
|
|
158
|
+
className={cn(styles.root, styles[size], styles[variant], className)}
|
|
159
|
+
{...rest}
|
|
160
|
+
>
|
|
161
|
+
{prevButton}
|
|
162
|
+
|
|
163
|
+
{variant === 'text' ? (
|
|
164
|
+
<span className={styles.pageText}>
|
|
165
|
+
Page {page} of {count}
|
|
166
|
+
</span>
|
|
167
|
+
) : (
|
|
168
|
+
<ol
|
|
169
|
+
className={cn(
|
|
170
|
+
styles.list,
|
|
171
|
+
variant === 'congested' && styles.listCongested
|
|
172
|
+
)}
|
|
173
|
+
>
|
|
174
|
+
{pages.map((item, index) =>
|
|
175
|
+
item === 'ellipsis' ? (
|
|
176
|
+
<li key={`ellipsis-${index}`}>
|
|
177
|
+
<span
|
|
178
|
+
className={cn(styles.ellipsis, styles[size])}
|
|
179
|
+
aria-hidden
|
|
180
|
+
>
|
|
181
|
+
…
|
|
182
|
+
</span>
|
|
183
|
+
</li>
|
|
184
|
+
) : (
|
|
185
|
+
<li key={item}>
|
|
186
|
+
<button
|
|
187
|
+
type="button"
|
|
188
|
+
className={cn(
|
|
189
|
+
styles.pageItem,
|
|
190
|
+
styles[size],
|
|
191
|
+
item === page && styles.pageItemActive,
|
|
192
|
+
variant === 'congested' && styles.pageItemBordered
|
|
193
|
+
)}
|
|
194
|
+
disabled={disabled}
|
|
195
|
+
aria-current={item === page ? 'page' : undefined}
|
|
196
|
+
onClick={() => onPageChange(item)}
|
|
197
|
+
>
|
|
198
|
+
{item}
|
|
199
|
+
</button>
|
|
200
|
+
</li>
|
|
201
|
+
)
|
|
202
|
+
)}
|
|
203
|
+
</ol>
|
|
204
|
+
)}
|
|
205
|
+
|
|
206
|
+
{nextButton}
|
|
207
|
+
</nav>
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
Pagination.displayName = 'Pagination';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export type PaginationSize = 'sm' | 'md';
|
|
4
|
+
export type PaginationVariant = 'text' | 'spaced' | 'congested';
|
|
5
|
+
|
|
6
|
+
export interface PaginationProps
|
|
7
|
+
extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
8
|
+
/** Current page (1-based) */
|
|
9
|
+
page: number;
|
|
10
|
+
/** Total number of pages */
|
|
11
|
+
count: number;
|
|
12
|
+
/** Callback when the page changes */
|
|
13
|
+
onPageChange: (page: number) => void;
|
|
14
|
+
/** Size — sm uses icon-only nav buttons, md uses labeled nav buttons */
|
|
15
|
+
size?: PaginationSize;
|
|
16
|
+
/** Layout variant */
|
|
17
|
+
variant?: PaginationVariant;
|
|
18
|
+
/** Number of sibling pages around the active page */
|
|
19
|
+
siblingCount?: number;
|
|
20
|
+
/** Number of pages shown at the start and end */
|
|
21
|
+
boundaryCount?: number;
|
|
22
|
+
/** Disables all interaction */
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* ═══ PaginationDots ═══ */
|
|
2
|
+
|
|
3
|
+
/* ─── Root ─── */
|
|
4
|
+
.root {
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* ─── List ─── */
|
|
10
|
+
.list {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: var(--st-space-2);
|
|
14
|
+
list-style: none;
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* ─── Indicator base ─── */
|
|
20
|
+
.indicator {
|
|
21
|
+
display: block;
|
|
22
|
+
border: none;
|
|
23
|
+
padding: 0;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
transition: background-color var(--st-transition-fast);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.indicator:focus-visible {
|
|
29
|
+
outline: 2px solid var(--st-color-primary);
|
|
30
|
+
outline-offset: 2px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.indicator:disabled {
|
|
34
|
+
opacity: 0.5;
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* ─── Dot variant ─── */
|
|
39
|
+
.dot .indicator {
|
|
40
|
+
width: 8px;
|
|
41
|
+
height: 8px;
|
|
42
|
+
border-radius: var(--st-radius-full);
|
|
43
|
+
background-color: var(--st-color-neutral-300);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.dot .indicatorActive {
|
|
47
|
+
background-color: var(--st-color-neutral-900);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* ─── Tab variant ─── */
|
|
51
|
+
.tab .indicator {
|
|
52
|
+
width: 24px;
|
|
53
|
+
height: 4px;
|
|
54
|
+
border-radius: var(--st-radius-full);
|
|
55
|
+
background-color: var(--st-color-neutral-300);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.tab .indicatorActive {
|
|
59
|
+
background-color: var(--st-color-neutral-900);
|
|
60
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { cn } from '../../utils/cn';
|
|
3
|
+
import type { PaginationDotsProps } from './PaginationDots.types';
|
|
4
|
+
import styles from './PaginationDots.module.css';
|
|
5
|
+
|
|
6
|
+
export const PaginationDots = forwardRef<HTMLElement, PaginationDotsProps>(
|
|
7
|
+
(
|
|
8
|
+
{
|
|
9
|
+
count,
|
|
10
|
+
activeIndex,
|
|
11
|
+
onIndexChange,
|
|
12
|
+
variant = 'dot',
|
|
13
|
+
disabled = false,
|
|
14
|
+
className,
|
|
15
|
+
...rest
|
|
16
|
+
},
|
|
17
|
+
ref
|
|
18
|
+
) => {
|
|
19
|
+
return (
|
|
20
|
+
<nav
|
|
21
|
+
ref={ref}
|
|
22
|
+
aria-label="Pagination indicators"
|
|
23
|
+
className={cn(styles.root, styles[variant], className)}
|
|
24
|
+
{...rest}
|
|
25
|
+
>
|
|
26
|
+
<ol className={styles.list}>
|
|
27
|
+
{Array.from({ length: count }, (_, i) => (
|
|
28
|
+
<li key={i}>
|
|
29
|
+
<button
|
|
30
|
+
type="button"
|
|
31
|
+
className={cn(
|
|
32
|
+
styles.indicator,
|
|
33
|
+
i === activeIndex && styles.indicatorActive
|
|
34
|
+
)}
|
|
35
|
+
disabled={disabled}
|
|
36
|
+
aria-label={`Go to slide ${i + 1}`}
|
|
37
|
+
aria-current={i === activeIndex ? 'step' : undefined}
|
|
38
|
+
onClick={() => onIndexChange?.(i)}
|
|
39
|
+
/>
|
|
40
|
+
</li>
|
|
41
|
+
))}
|
|
42
|
+
</ol>
|
|
43
|
+
</nav>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
PaginationDots.displayName = 'PaginationDots';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export type PaginationDotsVariant = 'dot' | 'tab';
|
|
4
|
+
|
|
5
|
+
export interface PaginationDotsProps
|
|
6
|
+
extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
7
|
+
/** Number of indicators */
|
|
8
|
+
count: number;
|
|
9
|
+
/** Active index (0-based) */
|
|
10
|
+
activeIndex: number;
|
|
11
|
+
/** Click handler for an indicator */
|
|
12
|
+
onIndexChange?: (index: number) => void;
|
|
13
|
+
/** Indicator shape */
|
|
14
|
+
variant?: PaginationDotsVariant;
|
|
15
|
+
/** Disables all interaction */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { Pagination } from './Pagination';
|
|
2
|
+
export type {
|
|
3
|
+
PaginationProps,
|
|
4
|
+
PaginationSize,
|
|
5
|
+
PaginationVariant,
|
|
6
|
+
} from './Pagination.types';
|
|
7
|
+
|
|
8
|
+
export { PaginationDots } from './PaginationDots';
|
|
9
|
+
export type {
|
|
10
|
+
PaginationDotsProps,
|
|
11
|
+
PaginationDotsVariant,
|
|
12
|
+
} from './PaginationDots.types';
|