@gunjo/ui 0.0.1-alpha.1 → 0.0.1-alpha.2
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/LICENSE +21 -0
- package/README.ja.md +90 -0
- package/README.md +52 -91
- package/package.json +47 -6
- package/src/components/display/Accordion.tsx +185 -0
- package/src/components/display/AccordionGroup.tsx +155 -0
- package/src/components/display/ActionDataTable.tsx +413 -0
- package/src/components/display/ActivityTimelineCard.tsx +483 -0
- package/src/components/display/AnalyticsCard.tsx +167 -0
- package/src/components/display/AssetCard.tsx +242 -0
- package/src/components/display/AssetGrid.tsx +164 -0
- package/src/components/display/Avatar.tsx +127 -0
- package/src/components/display/AvatarGroup.tsx +131 -0
- package/src/components/{atoms → display}/Badge.tsx +3 -3
- package/src/components/display/BarChart.tsx +247 -0
- package/src/components/{molecules → display}/Card.tsx +1 -1
- package/src/components/display/Carousel.tsx +593 -0
- package/src/components/display/ChartLegend.tsx +124 -0
- package/src/components/display/ChatMessage.tsx +382 -0
- package/src/components/display/ChoroplethMap.tsx +613 -0
- package/src/components/display/Code.tsx +42 -0
- package/src/components/display/CodeBlock.tsx +338 -0
- package/src/components/display/ColorSwatch.tsx +71 -0
- package/src/components/display/ConcentricProgressCard.tsx +545 -0
- package/src/components/display/DataTable.tsx +522 -0
- package/src/components/display/DistributionBar.tsx +102 -0
- package/src/components/display/DocNote.tsx +36 -0
- package/src/components/display/DonutChart.tsx +257 -0
- package/src/components/display/EmptyState.tsx +44 -0
- package/src/components/display/FileTree.tsx +180 -0
- package/src/components/display/GaugeChart.tsx +219 -0
- package/src/components/display/HeatmapChart.tsx +266 -0
- package/src/components/display/Icon.tsx +66 -0
- package/src/components/display/ImagePreview.tsx +140 -0
- package/src/components/{atoms → display}/Img.tsx +46 -12
- package/src/components/display/LabeledDonutCard.tsx +475 -0
- package/src/components/display/LineChart.tsx +464 -0
- package/src/components/{molecules → display}/List.tsx +20 -13
- package/src/components/display/MarkdownRenderer.tsx +157 -0
- package/src/components/display/MetadataList.tsx +81 -0
- package/src/components/display/MiniDistributionBarCard.tsx +314 -0
- package/src/components/display/PieChart.tsx +234 -0
- package/src/components/display/QuadrantMatrix.tsx +330 -0
- package/src/components/display/RadarChart.tsx +335 -0
- package/src/components/display/RadialBarChart.tsx +264 -0
- package/src/components/display/RetentionCohortCard.tsx +350 -0
- package/src/components/display/RibbonChart.tsx +618 -0
- package/src/components/display/SearchableAccordion.tsx +270 -0
- package/src/components/display/SegmentTimelineCard.tsx +452 -0
- package/src/components/display/SegmentedGaugeCard.tsx +607 -0
- package/src/components/display/Spacer.tsx +51 -0
- package/src/components/display/SparklineChart.tsx +394 -0
- package/src/components/display/StackedBarChart.tsx +393 -0
- package/src/components/display/Statistic.tsx +70 -0
- package/src/components/{molecules → display}/Table.tsx +22 -7
- package/src/components/display/Tag.tsx +80 -0
- package/src/components/display/TagEditor.tsx +141 -0
- package/src/components/display/Timeline.tsx +121 -0
- package/src/components/{atoms → display}/ToolPill.tsx +42 -18
- package/src/components/display/TreeView.tsx +226 -0
- package/src/components/display/chart-tooltip.tsx +423 -0
- package/src/components/display/chart-utils.ts +71 -0
- package/src/components/display/circular-chart-utils.ts +147 -0
- package/src/components/display/generated/default-variant-keys.ts +90 -0
- package/src/components/display/generated/variant-keys.ts +169 -0
- package/src/components/{atoms → feedback}/Alert.tsx +12 -5
- package/src/components/feedback/Banner.tsx +90 -0
- package/src/components/{molecules → feedback}/NotificationCenter.tsx +64 -31
- package/src/components/feedback/ProgressWidget.tsx +44 -0
- package/src/components/{atoms → feedback}/Spinner.tsx +2 -2
- package/src/components/{molecules → feedback}/StatusBar.tsx +4 -4
- package/src/components/feedback/StatusScreen.tsx +148 -0
- package/src/components/{molecules → feedback}/Stepper.tsx +10 -5
- package/src/components/feedback/Toast.tsx +108 -0
- package/src/components/feedback/ToastProvider.tsx +78 -0
- package/src/components/feedback/generated/default-variant-keys.ts +16 -0
- package/src/components/feedback/generated/variant-keys.ts +21 -0
- package/src/components/generated/component-manifest.ts +1568 -454
- package/src/components/generated/component-style-hints.ts +1958 -718
- package/src/components/{atoms → inputs}/ButtonVariants.ts +13 -3
- package/src/components/inputs/Calendar.tsx +212 -0
- package/src/components/inputs/ChatComposer.tsx +75 -0
- package/src/components/inputs/ChatInput.tsx +528 -0
- package/src/components/{atoms → inputs}/Checkbox.tsx +2 -2
- package/src/components/inputs/Combobox.tsx +175 -0
- package/src/components/inputs/CopyButton.tsx +187 -0
- package/src/components/inputs/DatePicker.tsx +519 -0
- package/src/components/inputs/DateRangePicker.tsx +878 -0
- package/src/components/inputs/EditableField.tsx +182 -0
- package/src/components/{organisms → inputs}/FileUploader.tsx +24 -9
- package/src/components/inputs/FilterButton.tsx +163 -0
- package/src/components/{molecules → inputs}/Form.tsx +20 -3
- package/src/components/{atoms → inputs}/Input.tsx +2 -0
- package/src/components/inputs/InputOTP.tsx +75 -0
- package/src/components/inputs/Mention.tsx +279 -0
- package/src/components/inputs/NumberInput.tsx +109 -0
- package/src/components/inputs/PasswordGroup.tsx +138 -0
- package/src/components/inputs/PasswordInput.tsx +74 -0
- package/src/components/inputs/PasswordRequirementList.tsx +96 -0
- package/src/components/inputs/PasswordStrengthMeter.tsx +93 -0
- package/src/components/inputs/PhoneInput.tsx +99 -0
- package/src/components/inputs/PostalCodeInput.tsx +98 -0
- package/src/components/inputs/RangeSlider.tsx +129 -0
- package/src/components/inputs/SearchInput.tsx +76 -0
- package/src/components/inputs/Select.tsx +39 -0
- package/src/components/{atoms → inputs}/Slider.tsx +18 -5
- package/src/components/{molecules → inputs}/SortButton.tsx +5 -2
- package/src/components/{atoms → inputs}/Switch.tsx +15 -4
- package/src/components/inputs/TagInput.tsx +114 -0
- package/src/components/{atoms → inputs}/Textarea.tsx +1 -0
- package/src/components/inputs/TimePicker.tsx +150 -0
- package/src/components/inputs/Toggle.tsx +48 -0
- package/src/components/{atoms → inputs}/ToggleGroup.tsx +2 -2
- package/src/components/inputs/TooltipButton.tsx +148 -0
- package/src/components/inputs/VoiceInputButton.tsx +317 -0
- package/src/components/inputs/calendar-holidays.ts +56 -0
- package/src/components/inputs/generated/default-variant-keys.ts +32 -0
- package/src/components/{atoms → inputs}/generated/variant-keys.ts +19 -27
- package/src/components/layout/AspectRatio.tsx +12 -0
- package/src/components/layout/AssetInspectorPanel.tsx +416 -0
- package/src/components/layout/Cluster.tsx +56 -0
- package/src/components/layout/CollapsiblePanelToggle.tsx +94 -0
- package/src/components/layout/Container.tsx +43 -0
- package/src/components/layout/DeviceFrame.tsx +227 -0
- package/src/components/layout/Grid.tsx +65 -0
- package/src/components/layout/HStack.tsx +73 -0
- package/src/components/{organisms → layout}/InspectorPanel.tsx +6 -5
- package/src/components/layout/MarqueeFrame.tsx +158 -0
- package/src/components/layout/Resizable.tsx +94 -0
- package/src/components/layout/ScrollArea.tsx +71 -0
- package/src/components/{organisms → layout}/SpatialCanvas.tsx +12 -7
- package/src/components/layout/VStack.tsx +69 -0
- package/src/components/layout/generated/default-variant-keys.ts +16 -0
- package/src/components/layout/generated/variant-keys.ts +21 -0
- package/src/components/{molecules → navigation}/Breadcrumb.tsx +5 -4
- package/src/components/navigation/Command.tsx +266 -0
- package/src/components/navigation/CommandPalette.tsx +83 -0
- package/src/components/navigation/DocumentPager.tsx +171 -0
- package/src/components/navigation/Footer.tsx +88 -0
- package/src/components/navigation/Header.tsx +80 -0
- package/src/components/{molecules → navigation}/Menubar.tsx +45 -12
- package/src/components/navigation/NavigationMenu.tsx +128 -0
- package/src/components/navigation/PageAside.tsx +84 -0
- package/src/components/{molecules → navigation}/Pagination.tsx +60 -7
- package/src/components/{organisms → navigation}/RightRail.tsx +1 -1
- package/src/components/navigation/Sidebar.tsx +223 -0
- package/src/components/navigation/SidebarItem.tsx +160 -0
- package/src/components/{molecules → navigation}/Tabs.tsx +2 -2
- package/src/components/navigation/TextLink.tsx +71 -0
- package/src/components/navigation/generated/default-variant-keys.ts +12 -0
- package/src/components/navigation/generated/variant-keys.ts +13 -0
- package/src/components/overlay/AIChatInput.tsx +5 -0
- package/src/components/overlay/AIChatMessage.tsx +6 -0
- package/src/components/overlay/AlertDialog.tsx +145 -0
- package/src/components/overlay/ChatPanel.tsx +180 -0
- package/src/components/{molecules → overlay}/ContextMenu.tsx +65 -29
- package/src/components/{molecules → overlay}/Dialog.tsx +21 -13
- package/src/components/overlay/Drawer.tsx +131 -0
- package/src/components/{molecules → overlay}/DropdownMenu.tsx +52 -17
- package/src/components/overlay/FloatingPanel.tsx +90 -0
- package/src/components/overlay/HoverCard.tsx +36 -0
- package/src/components/overlay/MediaLightbox.tsx +403 -0
- package/src/components/overlay/MediaPickerDialog.tsx +198 -0
- package/src/components/overlay/Modal.tsx +103 -0
- package/src/components/overlay/OnboardingFlow.tsx +172 -0
- package/src/components/overlay/Popover.tsx +36 -0
- package/src/components/overlay/ShareModal.tsx +324 -0
- package/src/components/{molecules → overlay}/Sheet.tsx +76 -19
- package/src/components/overlay/Tooltip.tsx +130 -0
- package/src/components/overlay/generated/default-variant-keys.ts +14 -0
- package/src/components/overlay/generated/variant-keys.ts +17 -0
- package/src/components/patterns/BlogTemplate.tsx +46 -0
- package/src/components/{templates → patterns}/DashboardTemplate.tsx +2 -2
- package/src/components/patterns/DocsTemplate.tsx +41 -0
- package/src/components/{templates → patterns}/MediaLibraryTemplate.tsx +1 -1
- package/src/components/patterns/OnboardingTemplate.tsx +32 -0
- package/src/components/patterns/PricingTemplate.tsx +106 -0
- package/src/globals.css +173 -22
- package/src/index.ts +177 -76
- package/tailwind-theme-extend.cjs +48 -3
- package/design/atoms-metadata.json +0 -82
- package/design/molecules-metadata.json +0 -130
- package/design/organisms-metadata.json +0 -38
- package/design/templates-metadata.json +0 -38
- package/src/components/atoms/Avatar.tsx +0 -57
- package/src/components/atoms/Select.tsx +0 -28
- package/src/components/atoms/generated/default-variant-keys.ts +0 -36
- package/src/components/molecules/AIChatInput.tsx +0 -140
- package/src/components/molecules/AIChatMessage.tsx +0 -109
- package/src/components/molecules/Accordion.tsx +0 -99
- package/src/components/molecules/Calendar.tsx +0 -60
- package/src/components/molecules/Carousel.tsx +0 -261
- package/src/components/molecules/Command.tsx +0 -152
- package/src/components/molecules/FilterButton.tsx +0 -133
- package/src/components/molecules/HoverCard.tsx +0 -29
- package/src/components/molecules/Modal.tsx +0 -66
- package/src/components/molecules/Popover.tsx +0 -31
- package/src/components/molecules/ProgressWidget.tsx +0 -40
- package/src/components/molecules/Resizable.tsx +0 -47
- package/src/components/molecules/ScrollArea.tsx +0 -48
- package/src/components/molecules/SidebarItem.tsx +0 -134
- package/src/components/molecules/Toast.tsx +0 -57
- package/src/components/molecules/Tooltip.tsx +0 -30
- package/src/components/molecules/generated/default-variant-keys.ts +0 -22
- package/src/components/molecules/generated/variant-keys.ts +0 -33
- package/src/components/organisms/CommandPalette.tsx +0 -58
- package/src/components/organisms/FloatingPanel.tsx +0 -46
- package/src/components/organisms/ShareModal.tsx +0 -182
- package/src/components/organisms/ToastProvider.tsx +0 -49
- /package/src/components/{atoms → display}/Kbd.tsx +0 -0
- /package/src/components/{atoms → display}/Separator.tsx +0 -0
- /package/src/components/{atoms → display}/Skeleton.tsx +0 -0
- /package/src/components/{atoms → feedback}/Progress.tsx +0 -0
- /package/src/components/{atoms → inputs}/Button.tsx +0 -0
- /package/src/components/{atoms → inputs}/Label.tsx +0 -0
- /package/src/components/{atoms → inputs}/RadioGroup.tsx +0 -0
- /package/src/components/{organisms → navigation}/AppRail.tsx +0 -0
- /package/src/components/{templates → patterns}/AuthTemplate.tsx +0 -0
- /package/src/components/{templates → patterns}/BannalyzeTemplate.tsx +0 -0
- /package/src/components/{templates → patterns}/ChatTemplate.tsx +0 -0
- /package/src/components/{templates → patterns}/EditorTemplate.tsx +0 -0
- /package/src/components/{templates → patterns}/KanbanTemplate.tsx +0 -0
- /package/src/components/{templates → patterns}/LandingTemplate.tsx +0 -0
- /package/src/components/{templates → patterns}/SettingsTemplate.tsx +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// Generated by `npm run design:sync:components`. Do not edit manually.
|
|
3
|
+
|
|
4
|
+
import type { AccordionVariantKey, AccordionGroupVariantKey, ActionDataTableVariantKey, ActivityTimelineCardVariantKey, AnalyticsCardVariantKey, AssetCardVariantKey, AssetGridVariantKey, AvatarVariantKey, BadgeVariantKey, BarChartVariantKey, ChartLegendVariantKey, ChatMessageVariantKey, ChoroplethMapVariantKey, ConcentricProgressCardVariantKey, DocNoteVariantKey, DonutChartVariantKey, FileTreeVariantKey, GaugeChartVariantKey, HeatmapChartVariantKey, IconVariantKey, ImagePreviewVariantKey, ImgVariantKey, LabeledDonutCardVariantKey, LineChartVariantKey, ListVariantKey, MetadataListVariantKey, MiniDistributionBarCardVariantKey, PieChartVariantKey, QuadrantMatrixVariantKey, RadarChartVariantKey, RadialBarChartVariantKey, RetentionCohortCardVariantKey, RibbonChartVariantKey, SearchableAccordionVariantKey, SegmentedGaugeCardVariantKey, SegmentTimelineCardVariantKey, SeparatorVariantKey, SparklineChartVariantKey, StackedBarChartVariantKey, TagEditorVariantKey, ToolPillVariantKey } from "./variant-keys";
|
|
5
|
+
|
|
6
|
+
export const accordionDefaultVariantKey: AccordionVariantKey = "collapsed";
|
|
7
|
+
export const accordionGroupDefaultVariantKey: AccordionGroupVariantKey = "default";
|
|
8
|
+
export const actionDataTableDefaultVariantKey: ActionDataTableVariantKey = "default";
|
|
9
|
+
export const activityTimelineCardDefaultVariantKey: ActivityTimelineCardVariantKey = "default";
|
|
10
|
+
export const analyticsCardDefaultVariantKey: AnalyticsCardVariantKey = "default";
|
|
11
|
+
export const assetCardDefaultVariantKey: AssetCardVariantKey = "default";
|
|
12
|
+
export const assetGridDefaultVariantKey: AssetGridVariantKey = "default";
|
|
13
|
+
export const avatarDefaultVariantKey: AvatarVariantKey = "fallback";
|
|
14
|
+
export const badgeDefaultVariantKey: BadgeVariantKey = "default";
|
|
15
|
+
export const barChartDefaultVariantKey: BarChartVariantKey = "vertical";
|
|
16
|
+
export const chartLegendDefaultVariantKey: ChartLegendVariantKey = "horizontal";
|
|
17
|
+
export const chatMessageDefaultVariantKey: ChatMessageVariantKey = "assistant";
|
|
18
|
+
export const choroplethMapDefaultVariantKey: ChoroplethMapVariantKey = "default";
|
|
19
|
+
export const concentricProgressCardDefaultVariantKey: ConcentricProgressCardVariantKey = "default";
|
|
20
|
+
export const docNoteDefaultVariantKey: DocNoteVariantKey = "default";
|
|
21
|
+
export const donutChartDefaultVariantKey: DonutChartVariantKey = "default";
|
|
22
|
+
export const fileTreeDefaultVariantKey: FileTreeVariantKey = "single";
|
|
23
|
+
export const gaugeChartDefaultVariantKey: GaugeChartVariantKey = "default";
|
|
24
|
+
export const heatmapChartDefaultVariantKey: HeatmapChartVariantKey = "default";
|
|
25
|
+
export const iconDefaultVariantKey: IconVariantKey = "sm";
|
|
26
|
+
export const imagePreviewDefaultVariantKey: ImagePreviewVariantKey = "default";
|
|
27
|
+
export const imgDefaultVariantKey: ImgVariantKey = "loading";
|
|
28
|
+
export const labeledDonutCardDefaultVariantKey: LabeledDonutCardVariantKey = "default";
|
|
29
|
+
export const lineChartDefaultVariantKey: LineChartVariantKey = "line";
|
|
30
|
+
export const listDefaultVariantKey: ListVariantKey = "dot";
|
|
31
|
+
export const metadataListDefaultVariantKey: MetadataListVariantKey = "default";
|
|
32
|
+
export const miniDistributionBarCardDefaultVariantKey: MiniDistributionBarCardVariantKey = "default";
|
|
33
|
+
export const pieChartDefaultVariantKey: PieChartVariantKey = "default";
|
|
34
|
+
export const quadrantMatrixDefaultVariantKey: QuadrantMatrixVariantKey = "default";
|
|
35
|
+
export const radarChartDefaultVariantKey: RadarChartVariantKey = "default";
|
|
36
|
+
export const radialBarChartDefaultVariantKey: RadialBarChartVariantKey = "default";
|
|
37
|
+
export const retentionCohortCardDefaultVariantKey: RetentionCohortCardVariantKey = "default";
|
|
38
|
+
export const ribbonChartDefaultVariantKey: RibbonChartVariantKey = "flow";
|
|
39
|
+
export const searchableAccordionDefaultVariantKey: SearchableAccordionVariantKey = "default";
|
|
40
|
+
export const segmentedGaugeCardDefaultVariantKey: SegmentedGaugeCardVariantKey = "default";
|
|
41
|
+
export const segmentTimelineCardDefaultVariantKey: SegmentTimelineCardVariantKey = "default";
|
|
42
|
+
export const separatorDefaultVariantKey: SeparatorVariantKey = "horizontal";
|
|
43
|
+
export const sparklineChartDefaultVariantKey: SparklineChartVariantKey = "line";
|
|
44
|
+
export const stackedBarChartDefaultVariantKey: StackedBarChartVariantKey = "vertical";
|
|
45
|
+
export const tagEditorDefaultVariantKey: TagEditorVariantKey = "default";
|
|
46
|
+
export const toolPillDefaultVariantKey: ToolPillVariantKey = "primary";
|
|
47
|
+
|
|
48
|
+
export const displayDefaultVariantKeys = {
|
|
49
|
+
accordion: accordionDefaultVariantKey,
|
|
50
|
+
accordionGroup: accordionGroupDefaultVariantKey,
|
|
51
|
+
actionDataTable: actionDataTableDefaultVariantKey,
|
|
52
|
+
activityTimelineCard: activityTimelineCardDefaultVariantKey,
|
|
53
|
+
analyticsCard: analyticsCardDefaultVariantKey,
|
|
54
|
+
assetCard: assetCardDefaultVariantKey,
|
|
55
|
+
assetGrid: assetGridDefaultVariantKey,
|
|
56
|
+
avatar: avatarDefaultVariantKey,
|
|
57
|
+
badge: badgeDefaultVariantKey,
|
|
58
|
+
barChart: barChartDefaultVariantKey,
|
|
59
|
+
chartLegend: chartLegendDefaultVariantKey,
|
|
60
|
+
chatMessage: chatMessageDefaultVariantKey,
|
|
61
|
+
choroplethMap: choroplethMapDefaultVariantKey,
|
|
62
|
+
concentricProgressCard: concentricProgressCardDefaultVariantKey,
|
|
63
|
+
docNote: docNoteDefaultVariantKey,
|
|
64
|
+
donutChart: donutChartDefaultVariantKey,
|
|
65
|
+
fileTree: fileTreeDefaultVariantKey,
|
|
66
|
+
gaugeChart: gaugeChartDefaultVariantKey,
|
|
67
|
+
heatmapChart: heatmapChartDefaultVariantKey,
|
|
68
|
+
icon: iconDefaultVariantKey,
|
|
69
|
+
imagePreview: imagePreviewDefaultVariantKey,
|
|
70
|
+
img: imgDefaultVariantKey,
|
|
71
|
+
labeledDonutCard: labeledDonutCardDefaultVariantKey,
|
|
72
|
+
lineChart: lineChartDefaultVariantKey,
|
|
73
|
+
list: listDefaultVariantKey,
|
|
74
|
+
metadataList: metadataListDefaultVariantKey,
|
|
75
|
+
miniDistributionBarCard: miniDistributionBarCardDefaultVariantKey,
|
|
76
|
+
pieChart: pieChartDefaultVariantKey,
|
|
77
|
+
quadrantMatrix: quadrantMatrixDefaultVariantKey,
|
|
78
|
+
radarChart: radarChartDefaultVariantKey,
|
|
79
|
+
radialBarChart: radialBarChartDefaultVariantKey,
|
|
80
|
+
retentionCohortCard: retentionCohortCardDefaultVariantKey,
|
|
81
|
+
ribbonChart: ribbonChartDefaultVariantKey,
|
|
82
|
+
searchableAccordion: searchableAccordionDefaultVariantKey,
|
|
83
|
+
segmentedGaugeCard: segmentedGaugeCardDefaultVariantKey,
|
|
84
|
+
segmentTimelineCard: segmentTimelineCardDefaultVariantKey,
|
|
85
|
+
separator: separatorDefaultVariantKey,
|
|
86
|
+
sparklineChart: sparklineChartDefaultVariantKey,
|
|
87
|
+
stackedBarChart: stackedBarChartDefaultVariantKey,
|
|
88
|
+
tagEditor: tagEditorDefaultVariantKey,
|
|
89
|
+
toolPill: toolPillDefaultVariantKey,
|
|
90
|
+
} as const;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// Generated by `npm run design:sync:components`. Do not edit manually.
|
|
3
|
+
|
|
4
|
+
export const accordionVariantKeys = ["collapsed", "expanded"] as const;
|
|
5
|
+
export type AccordionVariantKey = (typeof accordionVariantKeys)[number];
|
|
6
|
+
|
|
7
|
+
export const accordionGroupVariantKeys = ["default", "withDescription", "withoutControls"] as const;
|
|
8
|
+
export type AccordionGroupVariantKey = (typeof accordionGroupVariantKeys)[number];
|
|
9
|
+
|
|
10
|
+
export const actionDataTableVariantKeys = ["default", "rowActions", "selection"] as const;
|
|
11
|
+
export type ActionDataTableVariantKey = (typeof actionDataTableVariantKeys)[number];
|
|
12
|
+
|
|
13
|
+
export const activityTimelineCardVariantKeys = ["compact", "default"] as const;
|
|
14
|
+
export type ActivityTimelineCardVariantKey = (typeof activityTimelineCardVariantKeys)[number];
|
|
15
|
+
|
|
16
|
+
export const analyticsCardVariantKeys = ["default", "flatWithFooter", "positive", "riskIncrease"] as const;
|
|
17
|
+
export type AnalyticsCardVariantKey = (typeof analyticsCardVariantKeys)[number];
|
|
18
|
+
|
|
19
|
+
export const assetCardVariantKeys = ["compact", "default"] as const;
|
|
20
|
+
export type AssetCardVariantKey = (typeof assetCardVariantKeys)[number];
|
|
21
|
+
|
|
22
|
+
export const assetGridVariantKeys = ["compact", "default"] as const;
|
|
23
|
+
export type AssetGridVariantKey = (typeof assetGridVariantKeys)[number];
|
|
24
|
+
|
|
25
|
+
export const avatarVariantKeys = ["fallback", "image"] as const;
|
|
26
|
+
export type AvatarVariantKey = (typeof avatarVariantKeys)[number];
|
|
27
|
+
|
|
28
|
+
export const badgeVariantKeys = ["default", "destructive", "outline", "secondary"] as const;
|
|
29
|
+
export type BadgeVariantKey = (typeof badgeVariantKeys)[number];
|
|
30
|
+
|
|
31
|
+
export const barChartVariantKeys = ["horizontal", "vertical"] as const;
|
|
32
|
+
export type BarChartVariantKey = (typeof barChartVariantKeys)[number];
|
|
33
|
+
|
|
34
|
+
export const chartLegendVariantKeys = ["horizontal", "vertical"] as const;
|
|
35
|
+
export type ChartLegendVariantKey = (typeof chartLegendVariantKeys)[number];
|
|
36
|
+
|
|
37
|
+
export const chatMessageVariantKeys = ["assistant", "system", "typing", "user"] as const;
|
|
38
|
+
export type ChatMessageVariantKey = (typeof chatMessageVariantKeys)[number];
|
|
39
|
+
|
|
40
|
+
export const choroplethMapVariantKeys = ["compact", "default"] as const;
|
|
41
|
+
export type ChoroplethMapVariantKey = (typeof choroplethMapVariantKeys)[number];
|
|
42
|
+
|
|
43
|
+
export const concentricProgressCardVariantKeys = ["compact", "default"] as const;
|
|
44
|
+
export type ConcentricProgressCardVariantKey = (typeof concentricProgressCardVariantKeys)[number];
|
|
45
|
+
|
|
46
|
+
export const docNoteVariantKeys = ["default", "reference"] as const;
|
|
47
|
+
export type DocNoteVariantKey = (typeof docNoteVariantKeys)[number];
|
|
48
|
+
|
|
49
|
+
export const donutChartVariantKeys = ["compact", "default"] as const;
|
|
50
|
+
export type DonutChartVariantKey = (typeof donutChartVariantKeys)[number];
|
|
51
|
+
|
|
52
|
+
export const fileTreeVariantKeys = ["actions", "multiple", "single"] as const;
|
|
53
|
+
export type FileTreeVariantKey = (typeof fileTreeVariantKeys)[number];
|
|
54
|
+
|
|
55
|
+
export const gaugeChartVariantKeys = ["compact", "default"] as const;
|
|
56
|
+
export type GaugeChartVariantKey = (typeof gaugeChartVariantKeys)[number];
|
|
57
|
+
|
|
58
|
+
export const heatmapChartVariantKeys = ["compact", "default"] as const;
|
|
59
|
+
export type HeatmapChartVariantKey = (typeof heatmapChartVariantKeys)[number];
|
|
60
|
+
|
|
61
|
+
export const iconVariantKeys = ["lg", "md", "sm", "xl", "xs"] as const;
|
|
62
|
+
export type IconVariantKey = (typeof iconVariantKeys)[number];
|
|
63
|
+
|
|
64
|
+
export const imagePreviewVariantKeys = ["contain", "default", "empty"] as const;
|
|
65
|
+
export type ImagePreviewVariantKey = (typeof imagePreviewVariantKeys)[number];
|
|
66
|
+
|
|
67
|
+
export const imgVariantKeys = ["error", "loaded", "loading"] as const;
|
|
68
|
+
export type ImgVariantKey = (typeof imgVariantKeys)[number];
|
|
69
|
+
|
|
70
|
+
export const labeledDonutCardVariantKeys = ["compact", "default"] as const;
|
|
71
|
+
export type LabeledDonutCardVariantKey = (typeof labeledDonutCardVariantKeys)[number];
|
|
72
|
+
|
|
73
|
+
export const lineChartVariantKeys = ["area", "line"] as const;
|
|
74
|
+
export type LineChartVariantKey = (typeof lineChartVariantKeys)[number];
|
|
75
|
+
|
|
76
|
+
export const listVariantKeys = ["check", "circle", "dot"] as const;
|
|
77
|
+
export type ListVariantKey = (typeof listVariantKeys)[number];
|
|
78
|
+
|
|
79
|
+
export const metadataListVariantKeys = ["compact", "default"] as const;
|
|
80
|
+
export type MetadataListVariantKey = (typeof metadataListVariantKeys)[number];
|
|
81
|
+
|
|
82
|
+
export const miniDistributionBarCardVariantKeys = ["compact", "default"] as const;
|
|
83
|
+
export type MiniDistributionBarCardVariantKey = (typeof miniDistributionBarCardVariantKeys)[number];
|
|
84
|
+
|
|
85
|
+
export const pieChartVariantKeys = ["compact", "default"] as const;
|
|
86
|
+
export type PieChartVariantKey = (typeof pieChartVariantKeys)[number];
|
|
87
|
+
|
|
88
|
+
export const quadrantMatrixVariantKeys = ["compact", "default"] as const;
|
|
89
|
+
export type QuadrantMatrixVariantKey = (typeof quadrantMatrixVariantKeys)[number];
|
|
90
|
+
|
|
91
|
+
export const radarChartVariantKeys = ["compact", "default"] as const;
|
|
92
|
+
export type RadarChartVariantKey = (typeof radarChartVariantKeys)[number];
|
|
93
|
+
|
|
94
|
+
export const radialBarChartVariantKeys = ["compact", "default"] as const;
|
|
95
|
+
export type RadialBarChartVariantKey = (typeof radialBarChartVariantKeys)[number];
|
|
96
|
+
|
|
97
|
+
export const retentionCohortCardVariantKeys = ["compact", "default"] as const;
|
|
98
|
+
export type RetentionCohortCardVariantKey = (typeof retentionCohortCardVariantKeys)[number];
|
|
99
|
+
|
|
100
|
+
export const ribbonChartVariantKeys = ["flow", "stacked"] as const;
|
|
101
|
+
export type RibbonChartVariantKey = (typeof ribbonChartVariantKeys)[number];
|
|
102
|
+
|
|
103
|
+
export const searchableAccordionVariantKeys = ["default", "empty", "withCategories"] as const;
|
|
104
|
+
export type SearchableAccordionVariantKey = (typeof searchableAccordionVariantKeys)[number];
|
|
105
|
+
|
|
106
|
+
export const segmentedGaugeCardVariantKeys = ["compact", "default"] as const;
|
|
107
|
+
export type SegmentedGaugeCardVariantKey = (typeof segmentedGaugeCardVariantKeys)[number];
|
|
108
|
+
|
|
109
|
+
export const segmentTimelineCardVariantKeys = ["compact", "default"] as const;
|
|
110
|
+
export type SegmentTimelineCardVariantKey = (typeof segmentTimelineCardVariantKeys)[number];
|
|
111
|
+
|
|
112
|
+
export const separatorVariantKeys = ["horizontal", "vertical"] as const;
|
|
113
|
+
export type SeparatorVariantKey = (typeof separatorVariantKeys)[number];
|
|
114
|
+
|
|
115
|
+
export const sparklineChartVariantKeys = ["area", "line", "step"] as const;
|
|
116
|
+
export type SparklineChartVariantKey = (typeof sparklineChartVariantKeys)[number];
|
|
117
|
+
|
|
118
|
+
export const stackedBarChartVariantKeys = ["horizontal", "vertical"] as const;
|
|
119
|
+
export type StackedBarChartVariantKey = (typeof stackedBarChartVariantKeys)[number];
|
|
120
|
+
|
|
121
|
+
export const tagEditorVariantKeys = ["compact", "default"] as const;
|
|
122
|
+
export type TagEditorVariantKey = (typeof tagEditorVariantKeys)[number];
|
|
123
|
+
|
|
124
|
+
export const toolPillVariantKeys = ["danger", "primary", "secondary"] as const;
|
|
125
|
+
export type ToolPillVariantKey = (typeof toolPillVariantKeys)[number];
|
|
126
|
+
|
|
127
|
+
export const displayVariantKeys = {
|
|
128
|
+
accordion: accordionVariantKeys,
|
|
129
|
+
accordionGroup: accordionGroupVariantKeys,
|
|
130
|
+
actionDataTable: actionDataTableVariantKeys,
|
|
131
|
+
activityTimelineCard: activityTimelineCardVariantKeys,
|
|
132
|
+
analyticsCard: analyticsCardVariantKeys,
|
|
133
|
+
assetCard: assetCardVariantKeys,
|
|
134
|
+
assetGrid: assetGridVariantKeys,
|
|
135
|
+
avatar: avatarVariantKeys,
|
|
136
|
+
badge: badgeVariantKeys,
|
|
137
|
+
barChart: barChartVariantKeys,
|
|
138
|
+
chartLegend: chartLegendVariantKeys,
|
|
139
|
+
chatMessage: chatMessageVariantKeys,
|
|
140
|
+
choroplethMap: choroplethMapVariantKeys,
|
|
141
|
+
concentricProgressCard: concentricProgressCardVariantKeys,
|
|
142
|
+
docNote: docNoteVariantKeys,
|
|
143
|
+
donutChart: donutChartVariantKeys,
|
|
144
|
+
fileTree: fileTreeVariantKeys,
|
|
145
|
+
gaugeChart: gaugeChartVariantKeys,
|
|
146
|
+
heatmapChart: heatmapChartVariantKeys,
|
|
147
|
+
icon: iconVariantKeys,
|
|
148
|
+
imagePreview: imagePreviewVariantKeys,
|
|
149
|
+
img: imgVariantKeys,
|
|
150
|
+
labeledDonutCard: labeledDonutCardVariantKeys,
|
|
151
|
+
lineChart: lineChartVariantKeys,
|
|
152
|
+
list: listVariantKeys,
|
|
153
|
+
metadataList: metadataListVariantKeys,
|
|
154
|
+
miniDistributionBarCard: miniDistributionBarCardVariantKeys,
|
|
155
|
+
pieChart: pieChartVariantKeys,
|
|
156
|
+
quadrantMatrix: quadrantMatrixVariantKeys,
|
|
157
|
+
radarChart: radarChartVariantKeys,
|
|
158
|
+
radialBarChart: radialBarChartVariantKeys,
|
|
159
|
+
retentionCohortCard: retentionCohortCardVariantKeys,
|
|
160
|
+
ribbonChart: ribbonChartVariantKeys,
|
|
161
|
+
searchableAccordion: searchableAccordionVariantKeys,
|
|
162
|
+
segmentedGaugeCard: segmentedGaugeCardVariantKeys,
|
|
163
|
+
segmentTimelineCard: segmentTimelineCardVariantKeys,
|
|
164
|
+
separator: separatorVariantKeys,
|
|
165
|
+
sparklineChart: sparklineChartVariantKeys,
|
|
166
|
+
stackedBarChart: stackedBarChartVariantKeys,
|
|
167
|
+
tagEditor: tagEditorVariantKeys,
|
|
168
|
+
toolPill: toolPillVariantKeys,
|
|
169
|
+
} as const;
|
|
@@ -6,13 +6,19 @@ import type { AlertVariantKey } from "./generated/variant-keys"
|
|
|
6
6
|
import { alertDefaultVariantKey } from "./generated/default-variant-keys"
|
|
7
7
|
|
|
8
8
|
const alertVariantClasses: Record<AlertVariantKey, string> = {
|
|
9
|
-
default: "border-border bg-background text-foreground",
|
|
9
|
+
default: "border-border bg-background text-foreground [&_[data-alert-description]]:text-muted-foreground",
|
|
10
|
+
info:
|
|
11
|
+
"border-info-border bg-info-subtle text-info-subtle-foreground [&>svg]:text-info [&_[data-alert-description]]:text-info-subtle-foreground/85",
|
|
12
|
+
success:
|
|
13
|
+
"border-success-border bg-success-subtle text-success-subtle-foreground [&>svg]:text-success [&_[data-alert-description]]:text-success-subtle-foreground/85",
|
|
14
|
+
warning:
|
|
15
|
+
"border-warning-border bg-warning-subtle text-warning-subtle-foreground [&>svg]:text-warning [&_[data-alert-description]]:text-warning-subtle-foreground/85",
|
|
10
16
|
destructive:
|
|
11
|
-
"border-destructive
|
|
17
|
+
"border-destructive-border bg-destructive-subtle text-destructive-subtle-foreground [&>svg]:text-destructive [&_[data-alert-description]]:text-destructive-subtle-foreground/85",
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
const alertVariants = cva(
|
|
15
|
-
"relative inline-flex h-fit w-[320px] max-w-full items-center gap-1 rounded-lg border px-4 py-3 text-sm [
|
|
21
|
+
"relative inline-flex h-fit w-[320px] max-w-full flex-col items-center gap-1 rounded-lg border px-4 py-3 text-sm [&>*]:self-start [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-3 [&>svg]:text-foreground [&>svg~*]:w-full [&>svg~*]:pl-7",
|
|
16
22
|
{
|
|
17
23
|
variants: {
|
|
18
24
|
variant: alertVariantClasses,
|
|
@@ -42,7 +48,7 @@ const AlertTitle = React.forwardRef<
|
|
|
42
48
|
>(({ className, ...props }, ref) => (
|
|
43
49
|
<h5
|
|
44
50
|
ref={ref}
|
|
45
|
-
className={cn("
|
|
51
|
+
className={cn("flex min-h-4 items-center font-medium font-semibold leading-none tracking-tight", className)}
|
|
46
52
|
{...props}
|
|
47
53
|
/>
|
|
48
54
|
))
|
|
@@ -54,7 +60,8 @@ const AlertDescription = React.forwardRef<
|
|
|
54
60
|
>(({ className, ...props }, ref) => (
|
|
55
61
|
<div
|
|
56
62
|
ref={ref}
|
|
57
|
-
|
|
63
|
+
data-alert-description=""
|
|
64
|
+
className={cn("text-xs leading-relaxed [&_p]:leading-relaxed", className)}
|
|
58
65
|
{...props}
|
|
59
66
|
/>
|
|
60
67
|
))
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { IconX as X } from "@tabler/icons-react";
|
|
5
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
6
|
+
|
|
7
|
+
import { cn } from "../../lib/utils"
|
|
8
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../overlay/Tooltip"
|
|
9
|
+
|
|
10
|
+
export const bannerVariants = cva(
|
|
11
|
+
"flex h-10 w-full items-center justify-between gap-3 px-4 py-0 text-sm",
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
variant: {
|
|
15
|
+
default: "bg-foreground text-background",
|
|
16
|
+
info: "border border-info-border bg-info-subtle text-info-subtle-foreground [&>div:first-child>span:first-child]:text-info",
|
|
17
|
+
success: "border border-success-border bg-success-subtle text-success-subtle-foreground [&>div:first-child>span:first-child]:text-success",
|
|
18
|
+
warning: "border border-warning-border bg-warning-subtle text-warning-subtle-foreground [&>div:first-child>span:first-child]:text-warning",
|
|
19
|
+
destructive: "border border-destructive-border bg-destructive-subtle text-destructive-subtle-foreground [&>div:first-child>span:first-child]:text-destructive",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: "default",
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
export interface BannerProps
|
|
29
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
30
|
+
VariantProps<typeof bannerVariants> {
|
|
31
|
+
icon?: React.ReactNode
|
|
32
|
+
/** Optional CTA element rendered before the close button. */
|
|
33
|
+
action?: React.ReactNode
|
|
34
|
+
/** When provided, an × button shows. Click triggers this callback. */
|
|
35
|
+
onDismiss?: () => void
|
|
36
|
+
dismissLabel?: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const Banner = React.forwardRef<HTMLDivElement, BannerProps>(
|
|
40
|
+
(
|
|
41
|
+
{
|
|
42
|
+
className,
|
|
43
|
+
variant,
|
|
44
|
+
icon,
|
|
45
|
+
action,
|
|
46
|
+
onDismiss,
|
|
47
|
+
dismissLabel = "Dismiss",
|
|
48
|
+
children,
|
|
49
|
+
...props
|
|
50
|
+
},
|
|
51
|
+
ref
|
|
52
|
+
) => (
|
|
53
|
+
<div
|
|
54
|
+
ref={ref}
|
|
55
|
+
role="status"
|
|
56
|
+
className={cn(bannerVariants({ variant }), className)}
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
59
|
+
<div className="flex min-w-0 items-center gap-2">
|
|
60
|
+
{icon ? (
|
|
61
|
+
<span className="flex shrink-0 items-center" aria-hidden>
|
|
62
|
+
{icon}
|
|
63
|
+
</span>
|
|
64
|
+
) : null}
|
|
65
|
+
<span className="min-w-0 truncate">{children}</span>
|
|
66
|
+
</div>
|
|
67
|
+
<div className="flex items-center gap-2">
|
|
68
|
+
{action}
|
|
69
|
+
{onDismiss ? (
|
|
70
|
+
<Tooltip>
|
|
71
|
+
<TooltipTrigger asChild>
|
|
72
|
+
<button
|
|
73
|
+
type="button"
|
|
74
|
+
onClick={onDismiss}
|
|
75
|
+
aria-label={dismissLabel}
|
|
76
|
+
className="inline-flex h-6 w-6 items-center justify-center rounded opacity-80 transition-colors hover:bg-foreground/10 hover:opacity-100"
|
|
77
|
+
>
|
|
78
|
+
<X className="h-4 w-4" />
|
|
79
|
+
</button>
|
|
80
|
+
</TooltipTrigger>
|
|
81
|
+
<TooltipContent>{dismissLabel}</TooltipContent>
|
|
82
|
+
</Tooltip>
|
|
83
|
+
) : null}
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
)
|
|
87
|
+
)
|
|
88
|
+
Banner.displayName = "Banner"
|
|
89
|
+
|
|
90
|
+
export { Banner }
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
-
import { Bell, Check } from "
|
|
5
|
-
import { Button } from "../
|
|
6
|
-
import { Popover, PopoverContent, PopoverTrigger } from "
|
|
7
|
-
import { ScrollArea } from "
|
|
4
|
+
import { IconBell as Bell, IconCheck as Check } from "@tabler/icons-react";
|
|
5
|
+
import { Button } from "../inputs/Button"
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../overlay/Popover"
|
|
7
|
+
import { ScrollArea } from "../layout/ScrollArea"
|
|
8
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../overlay/Tooltip"
|
|
8
9
|
import { cn } from "../../lib/utils"
|
|
9
10
|
|
|
10
11
|
export interface Notification {
|
|
@@ -15,11 +16,21 @@ export interface Notification {
|
|
|
15
16
|
read: boolean
|
|
16
17
|
}
|
|
17
18
|
|
|
19
|
+
export interface NotificationCenterLabels {
|
|
20
|
+
toggle?: string
|
|
21
|
+
title?: string
|
|
22
|
+
clearAll?: string
|
|
23
|
+
emptyTitle?: string
|
|
24
|
+
markAsRead?: string
|
|
25
|
+
viewHistory?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
18
28
|
export interface NotificationCenterProps {
|
|
19
29
|
notifications: Notification[]
|
|
20
30
|
onMarkAsRead?: (id: string) => void
|
|
21
31
|
onLinkClick?: (id: string) => void
|
|
22
32
|
onClearAll?: () => void
|
|
33
|
+
labels?: NotificationCenterLabels
|
|
23
34
|
}
|
|
24
35
|
|
|
25
36
|
const NotificationCenter = ({
|
|
@@ -27,24 +38,42 @@ const NotificationCenter = ({
|
|
|
27
38
|
onMarkAsRead,
|
|
28
39
|
onLinkClick,
|
|
29
40
|
onClearAll,
|
|
41
|
+
labels,
|
|
30
42
|
}: NotificationCenterProps) => {
|
|
31
43
|
const unreadCount = notifications.filter((n) => !n.read).length
|
|
32
44
|
const [isOpen, setIsOpen] = React.useState(false)
|
|
45
|
+
const resolvedLabels: Required<NotificationCenterLabels> = {
|
|
46
|
+
toggle: labels?.toggle ?? "Toggle notifications",
|
|
47
|
+
title: labels?.title ?? "Notifications",
|
|
48
|
+
clearAll: labels?.clearAll ?? "Clear all",
|
|
49
|
+
emptyTitle: labels?.emptyTitle ?? "No notifications",
|
|
50
|
+
markAsRead: labels?.markAsRead ?? "Mark as read",
|
|
51
|
+
viewHistory: labels?.viewHistory ?? "View all notification history",
|
|
52
|
+
}
|
|
33
53
|
|
|
34
54
|
return (
|
|
35
55
|
<Popover open={isOpen} onOpenChange={setIsOpen}>
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
56
|
+
<Tooltip>
|
|
57
|
+
<PopoverTrigger asChild>
|
|
58
|
+
<TooltipTrigger asChild>
|
|
59
|
+
<Button
|
|
60
|
+
variant="ghost"
|
|
61
|
+
size="icon"
|
|
62
|
+
className="relative text-muted-foreground hover:text-foreground"
|
|
63
|
+
aria-label={resolvedLabels.toggle}
|
|
64
|
+
>
|
|
65
|
+
<Bell className="h-5 w-5" />
|
|
66
|
+
{unreadCount > 0 && (
|
|
67
|
+
<span className="absolute top-2 right-2 h-2 w-2 rounded-full bg-destructive ring-2 ring-background" />
|
|
68
|
+
)}
|
|
69
|
+
</Button>
|
|
70
|
+
</TooltipTrigger>
|
|
71
|
+
</PopoverTrigger>
|
|
72
|
+
<TooltipContent>{resolvedLabels.toggle}</TooltipContent>
|
|
73
|
+
</Tooltip>
|
|
45
74
|
<PopoverContent align="end" className="w-[320px] w-80 p-0" sideOffset={8}>
|
|
46
75
|
<div className="flex items-center justify-between border-b px-4 py-3 bg-muted/50 backdrop-blur">
|
|
47
|
-
<h4 className="font-semibold text-sm">
|
|
76
|
+
<h4 className="font-semibold text-sm">{resolvedLabels.title}</h4>
|
|
48
77
|
{unreadCount > 0 && onClearAll && (
|
|
49
78
|
<Button
|
|
50
79
|
variant="ghost"
|
|
@@ -52,7 +81,7 @@ const NotificationCenter = ({
|
|
|
52
81
|
className="h-auto px-2 text-xs text-muted-foreground hover:text-foreground"
|
|
53
82
|
onClick={onClearAll}
|
|
54
83
|
>
|
|
55
|
-
|
|
84
|
+
{resolvedLabels.clearAll}
|
|
56
85
|
</Button>
|
|
57
86
|
)}
|
|
58
87
|
</div>
|
|
@@ -60,7 +89,7 @@ const NotificationCenter = ({
|
|
|
60
89
|
{notifications.length === 0 ? (
|
|
61
90
|
<div className="flex h-full flex-col items-center justify-center p-4 text-center text-muted-foreground">
|
|
62
91
|
<Bell className="h-8 w-8 mb-2 opacity-20" />
|
|
63
|
-
<p className="text-sm">
|
|
92
|
+
<p className="text-sm">{resolvedLabels.emptyTitle}</p>
|
|
64
93
|
</div>
|
|
65
94
|
) : (
|
|
66
95
|
<div className="grid">
|
|
@@ -69,7 +98,7 @@ const NotificationCenter = ({
|
|
|
69
98
|
key={notification.id}
|
|
70
99
|
className={cn(
|
|
71
100
|
"flex flex-col gap-1 border-b p-4 text-sm transition-colors hover:bg-muted/50",
|
|
72
|
-
!notification.read && "bg-primary
|
|
101
|
+
!notification.read && "bg-primary-subtle"
|
|
73
102
|
)}
|
|
74
103
|
onClick={() => onLinkClick?.(notification.id)}
|
|
75
104
|
>
|
|
@@ -78,19 +107,23 @@ const NotificationCenter = ({
|
|
|
78
107
|
{notification.title}
|
|
79
108
|
</p>
|
|
80
109
|
{!notification.read && onMarkAsRead && (
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
110
|
+
<Tooltip>
|
|
111
|
+
<TooltipTrigger asChild>
|
|
112
|
+
<Button
|
|
113
|
+
variant="ghost"
|
|
114
|
+
size="icon"
|
|
115
|
+
className="h-6 w-6 -mr-2 -mt-1 text-muted-foreground hover:text-primary"
|
|
116
|
+
onClick={(e) => {
|
|
117
|
+
e.stopPropagation();
|
|
118
|
+
onMarkAsRead(notification.id);
|
|
119
|
+
}}
|
|
120
|
+
aria-label={resolvedLabels.markAsRead}
|
|
121
|
+
>
|
|
122
|
+
<div className="h-1.5 w-1.5 rounded-full bg-primary" />
|
|
123
|
+
</Button>
|
|
124
|
+
</TooltipTrigger>
|
|
125
|
+
<TooltipContent>{resolvedLabels.markAsRead}</TooltipContent>
|
|
126
|
+
</Tooltip>
|
|
94
127
|
)}
|
|
95
128
|
</div>
|
|
96
129
|
<p className="text-muted-foreground line-clamp-2">
|
|
@@ -106,7 +139,7 @@ const NotificationCenter = ({
|
|
|
106
139
|
</ScrollArea>
|
|
107
140
|
<div className="border-t p-2">
|
|
108
141
|
<Button variant="ghost" className="h-8 w-full text-xs text-muted-foreground hover:text-foreground">
|
|
109
|
-
|
|
142
|
+
{resolvedLabels.viewHistory}
|
|
110
143
|
</Button>
|
|
111
144
|
</div>
|
|
112
145
|
</PopoverContent>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cn } from "../../lib/utils"
|
|
5
|
+
import { Progress } from "./Progress"
|
|
6
|
+
import { Card, CardContent, CardHeader, CardTitle } from "../display/Card"
|
|
7
|
+
|
|
8
|
+
export interface ProgressWidgetProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
title: string
|
|
10
|
+
value: number
|
|
11
|
+
max?: number
|
|
12
|
+
label?: string
|
|
13
|
+
subtext?: string
|
|
14
|
+
progressLabel?: string
|
|
15
|
+
subtextLive?: "off" | "polite" | "assertive"
|
|
16
|
+
icon?: React.ReactNode
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const ProgressWidget = React.forwardRef<HTMLDivElement, ProgressWidgetProps>(
|
|
20
|
+
({ className, title, value, max = 100, label, subtext, progressLabel, subtextLive = "off", icon, ...props }, ref) => {
|
|
21
|
+
const safeMax = max > 0 ? max : 100
|
|
22
|
+
const boundedValue = Math.min(safeMax, Math.max(0, value))
|
|
23
|
+
const percentage = Math.round((boundedValue / safeMax) * 100)
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Card ref={ref} className={cn("flex flex-col w-[320px] rounded-lg border overflow-hidden", className)} {...props}>
|
|
27
|
+
<CardHeader className="flex flex-row items-center justify-between gap-3 space-y-0 pb-2">
|
|
28
|
+
<CardTitle className="min-w-0 truncate text-sm font-medium">{title}</CardTitle>
|
|
29
|
+
{icon && <div className="shrink-0 text-muted-foreground">{icon}</div>}
|
|
30
|
+
</CardHeader>
|
|
31
|
+
<CardContent>
|
|
32
|
+
<div className="text-2xl font-bold tabular-nums">{label || `${percentage}%`}</div>
|
|
33
|
+
<Progress value={boundedValue} max={safeMax} className="mt-2 h-2" aria-label={progressLabel ?? title} />
|
|
34
|
+
{subtext && (
|
|
35
|
+
<p className="text-xs text-muted-foreground mt-2" aria-live={subtextLive}>{subtext}</p>
|
|
36
|
+
)}
|
|
37
|
+
</CardContent>
|
|
38
|
+
</Card>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
ProgressWidget.displayName = "ProgressWidget"
|
|
43
|
+
|
|
44
|
+
export { ProgressWidget }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from "react"
|
|
2
|
-
import {
|
|
2
|
+
import { IconLoader2 as Loader2 } from "@tabler/icons-react";
|
|
3
3
|
import { cn } from "../../lib/utils"
|
|
4
4
|
import type { SpinnerVariantKey } from "./generated/variant-keys"
|
|
5
5
|
import { spinnerDefaultVariantKey } from "./generated/default-variant-keys"
|
|
@@ -22,7 +22,7 @@ export interface SpinnerProps extends ComponentProps<"svg"> {
|
|
|
22
22
|
|
|
23
23
|
export function Spinner({ className, size = spinnerDefaultVariantKey, ...props }: SpinnerProps) {
|
|
24
24
|
return (
|
|
25
|
-
<
|
|
25
|
+
<Loader2
|
|
26
26
|
className={cn(
|
|
27
27
|
"animate-spin text-muted-foreground",
|
|
28
28
|
isSpinnerVariantKey(size) ? spinnerSizeClasses[size] : "h-10 w-10",
|
|
@@ -15,21 +15,21 @@ const StatusBar = React.forwardRef<HTMLDivElement, StatusBarProps>(
|
|
|
15
15
|
<div
|
|
16
16
|
ref={ref}
|
|
17
17
|
className={cn(
|
|
18
|
-
"
|
|
18
|
+
"grid w-[640px] max-w-full grid-cols-2 items-center justify-between gap-x-3 gap-y-1 overflow-hidden px-4 py-1 bg-primary text-primary-foreground text-xs z-50 shadow-md sm:flex sm:flex-col sm:flex-row sm:gap-2",
|
|
19
19
|
fixed && "fixed bottom-0 left-0 right-0",
|
|
20
20
|
className
|
|
21
21
|
)}
|
|
22
22
|
{...props}
|
|
23
23
|
>
|
|
24
|
-
<div className="flex items-center gap-4">
|
|
24
|
+
<div className="order-2 flex min-w-0 items-center justify-start gap-4 text-left sm:order-none sm:max-w-[30%] [&>*]:truncate">
|
|
25
25
|
{leftNode}
|
|
26
26
|
</div>
|
|
27
27
|
|
|
28
|
-
<div className="flex items-center gap-2">
|
|
28
|
+
<div className="order-1 col-span-2 flex min-w-0 w-full flex-1 items-center justify-center gap-2 text-center sm:order-none sm:w-auto [&>*]:truncate">
|
|
29
29
|
{children}
|
|
30
30
|
</div>
|
|
31
31
|
|
|
32
|
-
<div className="flex items-center gap-4">
|
|
32
|
+
<div className="order-3 flex min-w-0 items-center justify-end gap-4 text-right sm:order-none sm:max-w-[30%] [&>*]:truncate">
|
|
33
33
|
{rightNode}
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|