@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,202 @@
|
|
|
1
|
+
import { cn } from '../../utils/cn';
|
|
2
|
+
import { Avatar } from '../Avatar';
|
|
3
|
+
import type { NavbarUserProps } from './NavbarUser.types';
|
|
4
|
+
import styles from './NavbarUser.module.css';
|
|
5
|
+
|
|
6
|
+
function BackIcon() {
|
|
7
|
+
return (
|
|
8
|
+
<svg
|
|
9
|
+
width="20"
|
|
10
|
+
height="20"
|
|
11
|
+
viewBox="0 0 20 20"
|
|
12
|
+
fill="none"
|
|
13
|
+
aria-hidden="true"
|
|
14
|
+
>
|
|
15
|
+
<path
|
|
16
|
+
d="M12.5 15L7.5 10L12.5 5"
|
|
17
|
+
stroke="currentColor"
|
|
18
|
+
strokeWidth="1.5"
|
|
19
|
+
strokeLinecap="round"
|
|
20
|
+
strokeLinejoin="round"
|
|
21
|
+
/>
|
|
22
|
+
</svg>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function HamburgerIcon() {
|
|
27
|
+
return (
|
|
28
|
+
<svg
|
|
29
|
+
width="20"
|
|
30
|
+
height="20"
|
|
31
|
+
viewBox="0 0 20 20"
|
|
32
|
+
fill="none"
|
|
33
|
+
aria-hidden="true"
|
|
34
|
+
>
|
|
35
|
+
<path
|
|
36
|
+
d="M3 5H17M3 10H17M3 15H17"
|
|
37
|
+
stroke="currentColor"
|
|
38
|
+
strokeWidth="1.5"
|
|
39
|
+
strokeLinecap="round"
|
|
40
|
+
/>
|
|
41
|
+
</svg>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function CloseIcon() {
|
|
46
|
+
return (
|
|
47
|
+
<svg
|
|
48
|
+
width="20"
|
|
49
|
+
height="20"
|
|
50
|
+
viewBox="0 0 20 20"
|
|
51
|
+
fill="none"
|
|
52
|
+
aria-hidden="true"
|
|
53
|
+
>
|
|
54
|
+
<path
|
|
55
|
+
fillRule="evenodd"
|
|
56
|
+
clipRule="evenodd"
|
|
57
|
+
d="M4.55806 4.55806C4.80214 4.31398 5.19786 4.31398 5.44194 4.55806L10.5028 9.61889L15.5636 4.55806C15.8077 4.31398 16.2034 4.31398 16.4475 4.55806C16.6916 4.80214 16.6916 5.19786 16.4475 5.44194L11.3867 10.5028L16.4475 15.5636C16.6916 15.8077 16.6916 16.2034 16.4475 16.4475C16.2034 16.6916 15.8077 16.6916 15.5636 16.4475L10.5028 11.3867L5.44194 16.4475C5.19786 16.6916 4.80214 16.6916 4.55806 16.4475C4.31398 16.2034 4.31398 15.8077 4.55806 15.5636L9.61889 10.5028L4.55806 5.44194C4.31398 5.19786 4.31398 4.80214 4.55806 4.55806Z"
|
|
58
|
+
fill="currentColor"
|
|
59
|
+
/>
|
|
60
|
+
</svg>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function VerifiedBadge() {
|
|
65
|
+
return (
|
|
66
|
+
<svg
|
|
67
|
+
width="16"
|
|
68
|
+
height="16"
|
|
69
|
+
viewBox="0 0 16 16"
|
|
70
|
+
fill="none"
|
|
71
|
+
aria-hidden="true"
|
|
72
|
+
className={styles.verifiedBadge}
|
|
73
|
+
>
|
|
74
|
+
<circle cx="8" cy="8" r="8" fill="var(--st-color-info)" />
|
|
75
|
+
<path
|
|
76
|
+
d="M5 8L7 10L11 6"
|
|
77
|
+
stroke="white"
|
|
78
|
+
strokeWidth="1.5"
|
|
79
|
+
strokeLinecap="round"
|
|
80
|
+
strokeLinejoin="round"
|
|
81
|
+
/>
|
|
82
|
+
</svg>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function ChevronDownIcon() {
|
|
87
|
+
return (
|
|
88
|
+
<svg
|
|
89
|
+
width="16"
|
|
90
|
+
height="16"
|
|
91
|
+
viewBox="0 0 16 16"
|
|
92
|
+
fill="none"
|
|
93
|
+
aria-hidden="true"
|
|
94
|
+
className={styles.userChevron}
|
|
95
|
+
>
|
|
96
|
+
<path
|
|
97
|
+
d="M4 6L8 10L12 6"
|
|
98
|
+
stroke="currentColor"
|
|
99
|
+
strokeWidth="1.5"
|
|
100
|
+
strokeLinecap="round"
|
|
101
|
+
strokeLinejoin="round"
|
|
102
|
+
/>
|
|
103
|
+
</svg>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function NavbarUser({
|
|
108
|
+
title,
|
|
109
|
+
subtitle,
|
|
110
|
+
onBack,
|
|
111
|
+
onClose,
|
|
112
|
+
actions,
|
|
113
|
+
user,
|
|
114
|
+
onUserClick,
|
|
115
|
+
logo,
|
|
116
|
+
onMenuClick,
|
|
117
|
+
className,
|
|
118
|
+
}: NavbarUserProps) {
|
|
119
|
+
const isLevel2 = !!onBack;
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<nav className={cn(styles.root, isLevel2 && styles.level2, className)}>
|
|
123
|
+
{/* Mobile-only: logo + hamburger */}
|
|
124
|
+
<span className={styles.mobileLead}>
|
|
125
|
+
{logo}
|
|
126
|
+
{onMenuClick && (
|
|
127
|
+
<button
|
|
128
|
+
type="button"
|
|
129
|
+
className={styles.menuBtn}
|
|
130
|
+
onClick={onMenuClick}
|
|
131
|
+
aria-label="Open menu"
|
|
132
|
+
>
|
|
133
|
+
<HamburgerIcon />
|
|
134
|
+
</button>
|
|
135
|
+
)}
|
|
136
|
+
</span>
|
|
137
|
+
|
|
138
|
+
{/* Back button (Level 2) */}
|
|
139
|
+
{onBack && (
|
|
140
|
+
<button
|
|
141
|
+
type="button"
|
|
142
|
+
className={styles.backBtn}
|
|
143
|
+
onClick={onBack}
|
|
144
|
+
aria-label="Go back"
|
|
145
|
+
>
|
|
146
|
+
<BackIcon />
|
|
147
|
+
</button>
|
|
148
|
+
)}
|
|
149
|
+
|
|
150
|
+
{/* Title + subtitle */}
|
|
151
|
+
<div className={styles.titleGroup}>
|
|
152
|
+
<span className={styles.title}>{title}</span>
|
|
153
|
+
{subtitle && <span className={styles.subtitle}>{subtitle}</span>}
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
{/* Action icons slot */}
|
|
157
|
+
{actions && <div className={styles.actions}>{actions}</div>}
|
|
158
|
+
|
|
159
|
+
{/* User section */}
|
|
160
|
+
{user && (
|
|
161
|
+
<button
|
|
162
|
+
type="button"
|
|
163
|
+
className={styles.userSection}
|
|
164
|
+
onClick={onUserClick}
|
|
165
|
+
>
|
|
166
|
+
<Avatar
|
|
167
|
+
src={user.avatar}
|
|
168
|
+
initials={user.name
|
|
169
|
+
.split(' ')
|
|
170
|
+
.map((w) => w[0])
|
|
171
|
+
.join('')
|
|
172
|
+
.slice(0, 2)
|
|
173
|
+
.toUpperCase()}
|
|
174
|
+
size="sm"
|
|
175
|
+
/>
|
|
176
|
+
<div className={styles.userInfo}>
|
|
177
|
+
<span className={styles.userName}>
|
|
178
|
+
{user.name}
|
|
179
|
+
{user.verified && <VerifiedBadge />}
|
|
180
|
+
</span>
|
|
181
|
+
<span className={styles.userHandle}>@{user.username}</span>
|
|
182
|
+
</div>
|
|
183
|
+
<ChevronDownIcon />
|
|
184
|
+
</button>
|
|
185
|
+
)}
|
|
186
|
+
|
|
187
|
+
{/* Close button (mobile Level 2) */}
|
|
188
|
+
{onClose && (
|
|
189
|
+
<button
|
|
190
|
+
type="button"
|
|
191
|
+
className={styles.closeBtn}
|
|
192
|
+
onClick={onClose}
|
|
193
|
+
aria-label="Close"
|
|
194
|
+
>
|
|
195
|
+
<CloseIcon />
|
|
196
|
+
</button>
|
|
197
|
+
)}
|
|
198
|
+
</nav>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
NavbarUser.displayName = 'NavbarUser';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface NavbarUserInfo {
|
|
4
|
+
name: string;
|
|
5
|
+
username: string;
|
|
6
|
+
avatar?: string;
|
|
7
|
+
verified?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface NavbarUserProps {
|
|
11
|
+
/** Page title */
|
|
12
|
+
title: string;
|
|
13
|
+
/** Description below title */
|
|
14
|
+
subtitle?: string;
|
|
15
|
+
/** Shows back arrow; presence indicates Level 2 */
|
|
16
|
+
onBack?: () => void;
|
|
17
|
+
/** Close button (mobile Level 2 only) */
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
/** Slot for action icon buttons */
|
|
20
|
+
actions?: ReactNode;
|
|
21
|
+
/** User info (avatar, name, handle) */
|
|
22
|
+
user?: NavbarUserInfo;
|
|
23
|
+
/** Dropdown trigger on user section */
|
|
24
|
+
onUserClick?: () => void;
|
|
25
|
+
/** Brand mark (mobile only) */
|
|
26
|
+
logo?: ReactNode;
|
|
27
|
+
/** Hamburger button (mobile only) */
|
|
28
|
+
onMenuClick?: () => void;
|
|
29
|
+
/** Root element class */
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type NotificationCategory =
|
|
4
|
+
| 'warning'
|
|
5
|
+
| 'success'
|
|
6
|
+
| 'intelligence'
|
|
7
|
+
| 'team';
|
|
8
|
+
|
|
9
|
+
export interface NotificationItemProps
|
|
10
|
+
extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
11
|
+
/** Determines icon & color scheme */
|
|
12
|
+
category: NotificationCategory;
|
|
13
|
+
/** Bold title text */
|
|
14
|
+
title: string;
|
|
15
|
+
/** Timestamp text e.g. "1h ago" */
|
|
16
|
+
time?: string;
|
|
17
|
+
/** Description below title */
|
|
18
|
+
description?: string;
|
|
19
|
+
/** Shows blue unread dot */
|
|
20
|
+
unread?: boolean;
|
|
21
|
+
/** Custom icon override */
|
|
22
|
+
icon?: ReactNode;
|
|
23
|
+
/** Avatar URL for `team` category */
|
|
24
|
+
avatarSrc?: string;
|
|
25
|
+
/** Avatar alt text */
|
|
26
|
+
avatarAlt?: string;
|
|
27
|
+
/** Action button slot */
|
|
28
|
+
action?: ReactNode;
|
|
29
|
+
/** Trash icon click handler (hover-visible) */
|
|
30
|
+
onDelete?: () => void;
|
|
31
|
+
/** Reply input slot */
|
|
32
|
+
replyArea?: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface NotificationReplyProps
|
|
36
|
+
extends HTMLAttributes<HTMLDivElement> {
|
|
37
|
+
/** Replying user avatar URL */
|
|
38
|
+
avatarSrc?: string;
|
|
39
|
+
/** Avatar alt text */
|
|
40
|
+
avatarAlt?: string;
|
|
41
|
+
/** Controlled input value */
|
|
42
|
+
value?: string;
|
|
43
|
+
/** Input change handler */
|
|
44
|
+
onValueChange?: (value: string) => void;
|
|
45
|
+
/** Chip(s) rendered before input */
|
|
46
|
+
mentions?: ReactNode;
|
|
47
|
+
/** Input placeholder text */
|
|
48
|
+
placeholder?: string;
|
|
49
|
+
/** Send Reply click handler */
|
|
50
|
+
onSend?: () => void;
|
|
51
|
+
/** Cancel click handler */
|
|
52
|
+
onCancel?: () => void;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface NotificationPanelProps
|
|
56
|
+
extends HTMLAttributes<HTMLDivElement> {
|
|
57
|
+
/** Header title */
|
|
58
|
+
title?: string;
|
|
59
|
+
/** Close button handler */
|
|
60
|
+
onClose?: () => void;
|
|
61
|
+
/** Footer button text */
|
|
62
|
+
footerLabel?: string;
|
|
63
|
+
/** Footer button click handler */
|
|
64
|
+
onFooterClick?: () => void;
|
|
65
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/* ═══ NotificationItem ═══ */
|
|
2
|
+
|
|
3
|
+
.root {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: flex-start;
|
|
6
|
+
gap: var(--st-space-3);
|
|
7
|
+
padding: var(--st-space-3) var(--st-space-4);
|
|
8
|
+
border-left: 3px solid transparent;
|
|
9
|
+
transition: background-color var(--st-transition-fast),
|
|
10
|
+
border-color var(--st-transition-fast);
|
|
11
|
+
cursor: default;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.root:hover {
|
|
15
|
+
background-color: var(--st-color-primary-subtle);
|
|
16
|
+
border-left-color: var(--st-color-primary);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* ─── Leading icon / avatar ─── */
|
|
20
|
+
|
|
21
|
+
.leading {
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
padding-top: var(--st-space-1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.iconCircle {
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
width: 36px;
|
|
31
|
+
height: 36px;
|
|
32
|
+
border-radius: var(--st-radius-full);
|
|
33
|
+
flex-shrink: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.warning {
|
|
37
|
+
background-color: var(--st-color-warning-subtle);
|
|
38
|
+
color: var(--st-color-warning);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.success {
|
|
42
|
+
background-color: var(--st-color-success-subtle);
|
|
43
|
+
color: var(--st-color-success);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.intelligence {
|
|
47
|
+
background-color: var(--st-color-info-subtle);
|
|
48
|
+
color: var(--st-color-info);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* ─── Body ─── */
|
|
52
|
+
|
|
53
|
+
.body {
|
|
54
|
+
flex: 1;
|
|
55
|
+
min-width: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.header {
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: baseline;
|
|
61
|
+
gap: var(--st-space-2);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.title {
|
|
65
|
+
font-size: var(--st-font-size-sm);
|
|
66
|
+
font-weight: var(--st-font-weight-semibold);
|
|
67
|
+
color: var(--st-color-foreground);
|
|
68
|
+
white-space: nowrap;
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
text-overflow: ellipsis;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.time {
|
|
74
|
+
flex-shrink: 0;
|
|
75
|
+
font-size: var(--st-font-size-xs);
|
|
76
|
+
color: var(--st-color-muted);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.description {
|
|
80
|
+
margin: var(--st-space-1) 0 0;
|
|
81
|
+
font-size: var(--st-font-size-xs);
|
|
82
|
+
color: var(--st-color-muted);
|
|
83
|
+
line-height: var(--st-line-height-normal);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.action {
|
|
87
|
+
margin-top: var(--st-space-2);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.replySlot {
|
|
91
|
+
margin-top: var(--st-space-2);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* ─── Trailing ─── */
|
|
95
|
+
|
|
96
|
+
.trailing {
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
gap: var(--st-space-2);
|
|
100
|
+
flex-shrink: 0;
|
|
101
|
+
padding-top: var(--st-space-1);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.unreadDot {
|
|
105
|
+
width: 8px;
|
|
106
|
+
height: 8px;
|
|
107
|
+
border-radius: var(--st-radius-full);
|
|
108
|
+
background-color: var(--st-color-primary);
|
|
109
|
+
flex-shrink: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.deleteBtn {
|
|
113
|
+
display: inline-flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
width: 28px;
|
|
117
|
+
height: 28px;
|
|
118
|
+
padding: 0;
|
|
119
|
+
border: none;
|
|
120
|
+
border-radius: var(--st-radius-md);
|
|
121
|
+
background: transparent;
|
|
122
|
+
color: var(--st-color-muted);
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
opacity: 0;
|
|
125
|
+
transition: opacity var(--st-transition-fast),
|
|
126
|
+
color var(--st-transition-fast),
|
|
127
|
+
background-color var(--st-transition-fast);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.root:hover .deleteBtn {
|
|
131
|
+
opacity: 1;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.deleteBtn:focus-visible {
|
|
135
|
+
opacity: 1;
|
|
136
|
+
outline: 2px solid var(--st-color-primary);
|
|
137
|
+
outline-offset: 2px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.deleteBtn:hover {
|
|
141
|
+
color: var(--st-color-error);
|
|
142
|
+
background-color: var(--st-color-error-subtle);
|
|
143
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { cn } from '../../utils/cn';
|
|
3
|
+
import { Avatar } from '../Avatar';
|
|
4
|
+
import type { NotificationCategory, NotificationItemProps } from './Notification.types';
|
|
5
|
+
import styles from './NotificationItem.module.css';
|
|
6
|
+
|
|
7
|
+
/* ═══ Inline SVGs ═══ */
|
|
8
|
+
|
|
9
|
+
function WarningIcon() {
|
|
10
|
+
return (
|
|
11
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
12
|
+
<path
|
|
13
|
+
d="M9 2L17 16H1L9 2Z"
|
|
14
|
+
stroke="currentColor"
|
|
15
|
+
strokeWidth="1.5"
|
|
16
|
+
strokeLinejoin="round"
|
|
17
|
+
/>
|
|
18
|
+
<path
|
|
19
|
+
d="M9 7V11M9 13.5V14"
|
|
20
|
+
stroke="currentColor"
|
|
21
|
+
strokeWidth="1.5"
|
|
22
|
+
strokeLinecap="round"
|
|
23
|
+
/>
|
|
24
|
+
</svg>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function CartIcon() {
|
|
29
|
+
return (
|
|
30
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
31
|
+
<path
|
|
32
|
+
d="M1 1H3L3.6 4M3.6 4H17L14 11H5L3.6 4Z"
|
|
33
|
+
stroke="currentColor"
|
|
34
|
+
strokeWidth="1.5"
|
|
35
|
+
strokeLinecap="round"
|
|
36
|
+
strokeLinejoin="round"
|
|
37
|
+
/>
|
|
38
|
+
<circle cx="6" cy="15" r="1.5" fill="currentColor" />
|
|
39
|
+
<circle cx="13" cy="15" r="1.5" fill="currentColor" />
|
|
40
|
+
</svg>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function ChartIcon() {
|
|
45
|
+
return (
|
|
46
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
47
|
+
<path
|
|
48
|
+
d="M2 14L6 9L10 11L16 4"
|
|
49
|
+
stroke="currentColor"
|
|
50
|
+
strokeWidth="1.5"
|
|
51
|
+
strokeLinecap="round"
|
|
52
|
+
strokeLinejoin="round"
|
|
53
|
+
/>
|
|
54
|
+
<path
|
|
55
|
+
d="M13 4H16V7"
|
|
56
|
+
stroke="currentColor"
|
|
57
|
+
strokeWidth="1.5"
|
|
58
|
+
strokeLinecap="round"
|
|
59
|
+
strokeLinejoin="round"
|
|
60
|
+
/>
|
|
61
|
+
</svg>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function TrashIcon() {
|
|
66
|
+
return (
|
|
67
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
68
|
+
<path
|
|
69
|
+
d="M2 4H14M5.5 4V2.5H10.5V4M6.5 7V11.5M9.5 7V11.5M3.5 4L4.5 13.5H11.5L12.5 4"
|
|
70
|
+
stroke="currentColor"
|
|
71
|
+
strokeWidth="1.5"
|
|
72
|
+
strokeLinecap="round"
|
|
73
|
+
strokeLinejoin="round"
|
|
74
|
+
/>
|
|
75
|
+
</svg>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* ═══ Default icon map ═══ */
|
|
80
|
+
|
|
81
|
+
const defaultIcons: Record<
|
|
82
|
+
Exclude<NotificationCategory, 'team'>,
|
|
83
|
+
JSX.Element
|
|
84
|
+
> = {
|
|
85
|
+
warning: <WarningIcon />,
|
|
86
|
+
success: <CartIcon />,
|
|
87
|
+
intelligence: <ChartIcon />,
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/* ═══ NotificationItem ═══ */
|
|
91
|
+
|
|
92
|
+
export const NotificationItem = forwardRef<HTMLDivElement, NotificationItemProps>(
|
|
93
|
+
(
|
|
94
|
+
{
|
|
95
|
+
category,
|
|
96
|
+
title,
|
|
97
|
+
time,
|
|
98
|
+
description,
|
|
99
|
+
unread = false,
|
|
100
|
+
icon,
|
|
101
|
+
avatarSrc,
|
|
102
|
+
avatarAlt = '',
|
|
103
|
+
action,
|
|
104
|
+
onDelete,
|
|
105
|
+
replyArea,
|
|
106
|
+
className,
|
|
107
|
+
...rest
|
|
108
|
+
},
|
|
109
|
+
ref
|
|
110
|
+
) => {
|
|
111
|
+
const isTeam = category === 'team';
|
|
112
|
+
|
|
113
|
+
const renderedLeading = isTeam ? (
|
|
114
|
+
<Avatar src={avatarSrc} alt={avatarAlt} size="md" />
|
|
115
|
+
) : (
|
|
116
|
+
<span className={cn(styles.iconCircle, styles[category])}>
|
|
117
|
+
{icon ?? defaultIcons[category]}
|
|
118
|
+
</span>
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<div
|
|
123
|
+
ref={ref}
|
|
124
|
+
className={cn(styles.root, unread && styles.unread, className)}
|
|
125
|
+
{...rest}
|
|
126
|
+
>
|
|
127
|
+
<div className={styles.leading}>{renderedLeading}</div>
|
|
128
|
+
|
|
129
|
+
<div className={styles.body}>
|
|
130
|
+
<div className={styles.header}>
|
|
131
|
+
<span className={styles.title}>{title}</span>
|
|
132
|
+
{time && <span className={styles.time}>{time}</span>}
|
|
133
|
+
</div>
|
|
134
|
+
{description && <p className={styles.description}>{description}</p>}
|
|
135
|
+
{action && <div className={styles.action}>{action}</div>}
|
|
136
|
+
{replyArea && <div className={styles.replySlot}>{replyArea}</div>}
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<div className={styles.trailing}>
|
|
140
|
+
{unread && <span className={styles.unreadDot} />}
|
|
141
|
+
{onDelete && (
|
|
142
|
+
<button
|
|
143
|
+
type="button"
|
|
144
|
+
className={styles.deleteBtn}
|
|
145
|
+
onClick={onDelete}
|
|
146
|
+
aria-label="Delete notification"
|
|
147
|
+
>
|
|
148
|
+
<TrashIcon />
|
|
149
|
+
</button>
|
|
150
|
+
)}
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
NotificationItem.displayName = 'NotificationItem';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* ═══ NotificationPanel ═══ */
|
|
2
|
+
|
|
3
|
+
.root {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
width: 380px;
|
|
7
|
+
max-height: 520px;
|
|
8
|
+
background-color: var(--st-color-surface);
|
|
9
|
+
border: 1px solid var(--st-color-border);
|
|
10
|
+
border-radius: var(--st-radius-xl);
|
|
11
|
+
box-shadow: var(--st-shadow-lg);
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* ─── Header ─── */
|
|
16
|
+
|
|
17
|
+
.header {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
flex-shrink: 0;
|
|
22
|
+
padding: var(--st-space-4);
|
|
23
|
+
border-bottom: 1px solid var(--st-color-border);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.title {
|
|
27
|
+
font-size: var(--st-font-size-md);
|
|
28
|
+
font-weight: var(--st-font-weight-semibold);
|
|
29
|
+
color: var(--st-color-foreground);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.closeBtn {
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
width: 28px;
|
|
37
|
+
height: 28px;
|
|
38
|
+
padding: 0;
|
|
39
|
+
border: none;
|
|
40
|
+
border-radius: var(--st-radius-md);
|
|
41
|
+
background: transparent;
|
|
42
|
+
color: var(--st-color-muted);
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
transition: color var(--st-transition-fast),
|
|
45
|
+
background-color var(--st-transition-fast);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.closeBtn:hover {
|
|
49
|
+
color: var(--st-color-foreground);
|
|
50
|
+
background-color: var(--st-color-neutral-100);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.closeBtn:focus-visible {
|
|
54
|
+
outline: 2px solid var(--st-color-primary);
|
|
55
|
+
outline-offset: 2px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* ─── Body ─── */
|
|
59
|
+
|
|
60
|
+
.body {
|
|
61
|
+
flex: 1;
|
|
62
|
+
overflow-y: auto;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* ─── Footer ─── */
|
|
66
|
+
|
|
67
|
+
.footer {
|
|
68
|
+
flex-shrink: 0;
|
|
69
|
+
padding: var(--st-space-3) var(--st-space-4);
|
|
70
|
+
border-top: 1px solid var(--st-color-border);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.footerBtn {
|
|
74
|
+
width: 100%;
|
|
75
|
+
}
|