@spatika/react 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -0
- package/dist/composites/ActionBar.d.ts +7 -0
- package/dist/composites/ActionBar.d.ts.map +1 -0
- package/dist/composites/ActionBar.js +5 -0
- package/dist/composites/AmountInput.d.ts +10 -0
- package/dist/composites/AmountInput.d.ts.map +1 -0
- package/dist/composites/AmountInput.js +7 -0
- package/dist/composites/AppHeader.d.ts +25 -0
- package/dist/composites/AppHeader.d.ts.map +1 -0
- package/dist/composites/AppHeader.js +13 -0
- package/dist/composites/AppSidebar.d.ts +30 -0
- package/dist/composites/AppSidebar.d.ts.map +1 -0
- package/dist/composites/AppSidebar.js +15 -0
- package/dist/composites/BottomSheet.d.ts +36 -0
- package/dist/composites/BottomSheet.d.ts.map +1 -0
- package/dist/composites/BottomSheet.js +37 -0
- package/dist/composites/Breadcrumb.d.ts +10 -0
- package/dist/composites/Breadcrumb.d.ts.map +1 -0
- package/dist/composites/Breadcrumb.js +10 -0
- package/dist/composites/Callout.d.ts +8 -0
- package/dist/composites/Callout.d.ts.map +1 -0
- package/dist/composites/Callout.js +5 -0
- package/dist/composites/Card.d.ts +31 -0
- package/dist/composites/Card.d.ts.map +1 -0
- package/dist/composites/Card.js +33 -0
- package/dist/composites/Chip.d.ts +13 -0
- package/dist/composites/Chip.d.ts.map +1 -0
- package/dist/composites/Chip.js +59 -0
- package/dist/composites/ChipGroup.d.ts +23 -0
- package/dist/composites/ChipGroup.d.ts.map +1 -0
- package/dist/composites/ChipGroup.js +27 -0
- package/dist/composites/CommandSearchField.d.ts +27 -0
- package/dist/composites/CommandSearchField.d.ts.map +1 -0
- package/dist/composites/CommandSearchField.js +17 -0
- package/dist/composites/CoverHero.d.ts +51 -0
- package/dist/composites/CoverHero.d.ts.map +1 -0
- package/dist/composites/CoverHero.js +71 -0
- package/dist/composites/CoverPattern.d.ts +12 -0
- package/dist/composites/CoverPattern.d.ts.map +1 -0
- package/dist/composites/CoverPattern.js +14 -0
- package/dist/composites/DataTableToolbar.d.ts +13 -0
- package/dist/composites/DataTableToolbar.d.ts.map +1 -0
- package/dist/composites/DataTableToolbar.js +7 -0
- package/dist/composites/DividerLabel.d.ts +5 -0
- package/dist/composites/DividerLabel.d.ts.map +1 -0
- package/dist/composites/DividerLabel.js +5 -0
- package/dist/composites/EmptyState.d.ts +16 -0
- package/dist/composites/EmptyState.d.ts.map +1 -0
- package/dist/composites/EmptyState.js +10 -0
- package/dist/composites/EntityCard.d.ts +31 -0
- package/dist/composites/EntityCard.d.ts.map +1 -0
- package/dist/composites/EntityCard.js +21 -0
- package/dist/composites/EntityMediaCard.d.ts +25 -0
- package/dist/composites/EntityMediaCard.d.ts.map +1 -0
- package/dist/composites/EntityMediaCard.js +17 -0
- package/dist/composites/FilterSheet.d.ts +34 -0
- package/dist/composites/FilterSheet.d.ts.map +1 -0
- package/dist/composites/FilterSheet.js +36 -0
- package/dist/composites/FloatingPageChrome.d.ts +90 -0
- package/dist/composites/FloatingPageChrome.d.ts.map +1 -0
- package/dist/composites/FloatingPageChrome.js +67 -0
- package/dist/composites/FormField.d.ts +15 -0
- package/dist/composites/FormField.d.ts.map +1 -0
- package/dist/composites/FormField.js +9 -0
- package/dist/composites/GlassCard.d.ts +13 -0
- package/dist/composites/GlassCard.d.ts.map +1 -0
- package/dist/composites/GlassCard.js +32 -0
- package/dist/composites/HeaderIconButton.d.ts +13 -0
- package/dist/composites/HeaderIconButton.d.ts.map +1 -0
- package/dist/composites/HeaderIconButton.js +12 -0
- package/dist/composites/ListRow.d.ts +9 -0
- package/dist/composites/ListRow.d.ts.map +1 -0
- package/dist/composites/ListRow.js +6 -0
- package/dist/composites/MediaEntryCard.d.ts +25 -0
- package/dist/composites/MediaEntryCard.d.ts.map +1 -0
- package/dist/composites/MediaEntryCard.js +10 -0
- package/dist/composites/MobileTabBar.d.ts +33 -0
- package/dist/composites/MobileTabBar.d.ts.map +1 -0
- package/dist/composites/MobileTabBar.js +19 -0
- package/dist/composites/NotificationBell.d.ts +28 -0
- package/dist/composites/NotificationBell.d.ts.map +1 -0
- package/dist/composites/NotificationBell.js +25 -0
- package/dist/composites/PageHeader.d.ts +11 -0
- package/dist/composites/PageHeader.d.ts.map +1 -0
- package/dist/composites/PageHeader.js +6 -0
- package/dist/composites/PageShell.d.ts +12 -0
- package/dist/composites/PageShell.d.ts.map +1 -0
- package/dist/composites/PageShell.js +8 -0
- package/dist/composites/PageStickyHeader.d.ts +33 -0
- package/dist/composites/PageStickyHeader.d.ts.map +1 -0
- package/dist/composites/PageStickyHeader.js +19 -0
- package/dist/composites/Pagination.d.ts +7 -0
- package/dist/composites/Pagination.d.ts.map +1 -0
- package/dist/composites/Pagination.js +6 -0
- package/dist/composites/PhotoViewer.d.ts +18 -0
- package/dist/composites/PhotoViewer.d.ts.map +1 -0
- package/dist/composites/PhotoViewer.js +37 -0
- package/dist/composites/PinPad.d.ts +29 -0
- package/dist/composites/PinPad.d.ts.map +1 -0
- package/dist/composites/PinPad.js +58 -0
- package/dist/composites/ProfileHero.d.ts +34 -0
- package/dist/composites/ProfileHero.d.ts.map +1 -0
- package/dist/composites/ProfileHero.js +21 -0
- package/dist/composites/QuickFilterRail.d.ts +25 -0
- package/dist/composites/QuickFilterRail.d.ts.map +1 -0
- package/dist/composites/QuickFilterRail.js +18 -0
- package/dist/composites/QuickSettings.d.ts +27 -0
- package/dist/composites/QuickSettings.d.ts.map +1 -0
- package/dist/composites/QuickSettings.js +18 -0
- package/dist/composites/RichTextEditor.d.ts +13 -0
- package/dist/composites/RichTextEditor.d.ts.map +1 -0
- package/dist/composites/RichTextEditor.js +23 -0
- package/dist/composites/SearchField.d.ts +8 -0
- package/dist/composites/SearchField.d.ts.map +1 -0
- package/dist/composites/SearchField.js +8 -0
- package/dist/composites/SectionPanel.d.ts +16 -0
- package/dist/composites/SectionPanel.d.ts.map +1 -0
- package/dist/composites/SectionPanel.js +8 -0
- package/dist/composites/SegmentedControl.d.ts +17 -0
- package/dist/composites/SegmentedControl.d.ts.map +1 -0
- package/dist/composites/SegmentedControl.js +11 -0
- package/dist/composites/StatCard.d.ts +11 -0
- package/dist/composites/StatCard.d.ts.map +1 -0
- package/dist/composites/StatCard.js +6 -0
- package/dist/composites/StatusDot.d.ts +11 -0
- package/dist/composites/StatusDot.d.ts.map +1 -0
- package/dist/composites/StatusDot.js +23 -0
- package/dist/composites/SurfaceCard.d.ts +12 -0
- package/dist/composites/SurfaceCard.d.ts.map +1 -0
- package/dist/composites/SurfaceCard.js +24 -0
- package/dist/composites/Timeline.d.ts +19 -0
- package/dist/composites/Timeline.d.ts.map +1 -0
- package/dist/composites/Timeline.js +12 -0
- package/dist/composites/Toast.d.ts +26 -0
- package/dist/composites/Toast.d.ts.map +1 -0
- package/dist/composites/Toast.js +49 -0
- package/dist/composites/Toolbar.d.ts +6 -0
- package/dist/composites/Toolbar.d.ts.map +1 -0
- package/dist/composites/Toolbar.js +5 -0
- package/dist/composites/ViewFiltersPanel.d.ts +21 -0
- package/dist/composites/ViewFiltersPanel.d.ts.map +1 -0
- package/dist/composites/ViewFiltersPanel.js +11 -0
- package/dist/index.d.ts +96 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +95 -0
- package/dist/lib/animations.d.ts +62 -0
- package/dist/lib/animations.d.ts.map +1 -0
- package/dist/lib/animations.js +37 -0
- package/dist/lib/avatar-utils.d.ts +10 -0
- package/dist/lib/avatar-utils.d.ts.map +1 -0
- package/dist/lib/avatar-utils.js +49 -0
- package/dist/lib/chips.d.ts +10 -0
- package/dist/lib/chips.d.ts.map +1 -0
- package/dist/lib/chips.js +30 -0
- package/dist/lib/cn.d.ts +4 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +6 -0
- package/dist/lib/compose-refs.d.ts +6 -0
- package/dist/lib/compose-refs.d.ts.map +1 -0
- package/dist/lib/compose-refs.js +17 -0
- package/dist/lib/cover-chrome.d.ts +9 -0
- package/dist/lib/cover-chrome.d.ts.map +1 -0
- package/dist/lib/cover-chrome.js +23 -0
- package/dist/lib/cover-pattern.d.ts +75 -0
- package/dist/lib/cover-pattern.d.ts.map +1 -0
- package/dist/lib/cover-pattern.js +135 -0
- package/dist/lib/overlay-stack.d.ts +23 -0
- package/dist/lib/overlay-stack.d.ts.map +1 -0
- package/dist/lib/overlay-stack.js +37 -0
- package/dist/lib/portal.d.ts +12 -0
- package/dist/lib/portal.d.ts.map +1 -0
- package/dist/lib/portal.js +12 -0
- package/dist/lib/slot.d.ts +12 -0
- package/dist/lib/slot.d.ts.map +1 -0
- package/dist/lib/slot.js +55 -0
- package/dist/lib/surfaces.d.ts +14 -0
- package/dist/lib/surfaces.d.ts.map +1 -0
- package/dist/lib/surfaces.js +18 -0
- package/dist/lib/themes.d.ts +16 -0
- package/dist/lib/themes.d.ts.map +1 -0
- package/dist/lib/themes.js +53 -0
- package/dist/lib/typography.d.ts +17 -0
- package/dist/lib/typography.d.ts.map +1 -0
- package/dist/lib/typography.js +16 -0
- package/dist/lib/use-controllable-state.d.ts +12 -0
- package/dist/lib/use-controllable-state.d.ts.map +1 -0
- package/dist/lib/use-controllable-state.js +20 -0
- package/dist/lib/use-cover-chrome-bleed.d.ts +9 -0
- package/dist/lib/use-cover-chrome-bleed.d.ts.map +1 -0
- package/dist/lib/use-cover-chrome-bleed.js +28 -0
- package/dist/lib/use-dismissable.d.ts +13 -0
- package/dist/lib/use-dismissable.d.ts.map +1 -0
- package/dist/lib/use-dismissable.js +33 -0
- package/dist/lib/use-floating-position.d.ts +27 -0
- package/dist/lib/use-floating-position.d.ts.map +1 -0
- package/dist/lib/use-floating-position.js +115 -0
- package/dist/lib/use-focus-trap.d.ts +7 -0
- package/dist/lib/use-focus-trap.d.ts.map +1 -0
- package/dist/lib/use-focus-trap.js +61 -0
- package/dist/lib/use-media-query.d.ts +5 -0
- package/dist/lib/use-media-query.d.ts.map +1 -0
- package/dist/lib/use-media-query.js +19 -0
- package/dist/primitives/Accordion.d.ts +24 -0
- package/dist/primitives/Accordion.d.ts.map +1 -0
- package/dist/primitives/Accordion.js +37 -0
- package/dist/primitives/Alert.d.ts +10 -0
- package/dist/primitives/Alert.d.ts.map +1 -0
- package/dist/primitives/Alert.js +25 -0
- package/dist/primitives/AlertDialog.d.ts +33 -0
- package/dist/primitives/AlertDialog.d.ts.map +1 -0
- package/dist/primitives/AlertDialog.js +96 -0
- package/dist/primitives/Avatar.d.ts +15 -0
- package/dist/primitives/Avatar.d.ts.map +1 -0
- package/dist/primitives/Avatar.js +52 -0
- package/dist/primitives/Badge.d.ts +12 -0
- package/dist/primitives/Badge.d.ts.map +1 -0
- package/dist/primitives/Badge.js +27 -0
- package/dist/primitives/Button.d.ts +14 -0
- package/dist/primitives/Button.d.ts.map +1 -0
- package/dist/primitives/Button.js +37 -0
- package/dist/primitives/Checkbox.d.ts +9 -0
- package/dist/primitives/Checkbox.d.ts.map +1 -0
- package/dist/primitives/Checkbox.js +22 -0
- package/dist/primitives/Command.d.ts +17 -0
- package/dist/primitives/Command.d.ts.map +1 -0
- package/dist/primitives/Command.js +33 -0
- package/dist/primitives/Dialog.d.ts +34 -0
- package/dist/primitives/Dialog.d.ts.map +1 -0
- package/dist/primitives/Dialog.js +96 -0
- package/dist/primitives/DropdownMenu.d.ts +65 -0
- package/dist/primitives/DropdownMenu.d.ts.map +1 -0
- package/dist/primitives/DropdownMenu.js +196 -0
- package/dist/primitives/Input.d.ts +4 -0
- package/dist/primitives/Input.d.ts.map +1 -0
- package/dist/primitives/Input.js +6 -0
- package/dist/primitives/Kbd.d.ts +4 -0
- package/dist/primitives/Kbd.d.ts.map +1 -0
- package/dist/primitives/Kbd.js +6 -0
- package/dist/primitives/Label.d.ts +4 -0
- package/dist/primitives/Label.d.ts.map +1 -0
- package/dist/primitives/Label.js +6 -0
- package/dist/primitives/NativeSelect.d.ts +7 -0
- package/dist/primitives/NativeSelect.d.ts.map +1 -0
- package/dist/primitives/NativeSelect.js +10 -0
- package/dist/primitives/Popover.d.ts +29 -0
- package/dist/primitives/Popover.d.ts.map +1 -0
- package/dist/primitives/Popover.js +95 -0
- package/dist/primitives/Progress.d.ts +8 -0
- package/dist/primitives/Progress.d.ts.map +1 -0
- package/dist/primitives/Progress.js +7 -0
- package/dist/primitives/RadioGroup.d.ts +13 -0
- package/dist/primitives/RadioGroup.d.ts.map +1 -0
- package/dist/primitives/RadioGroup.js +33 -0
- package/dist/primitives/Select.d.ts +33 -0
- package/dist/primitives/Select.d.ts.map +1 -0
- package/dist/primitives/Select.js +178 -0
- package/dist/primitives/Separator.d.ts +7 -0
- package/dist/primitives/Separator.d.ts.map +1 -0
- package/dist/primitives/Separator.js +6 -0
- package/dist/primitives/Sheet.d.ts +28 -0
- package/dist/primitives/Sheet.d.ts.map +1 -0
- package/dist/primitives/Sheet.js +96 -0
- package/dist/primitives/Skeleton.d.ts +4 -0
- package/dist/primitives/Skeleton.d.ts.map +1 -0
- package/dist/primitives/Skeleton.js +6 -0
- package/dist/primitives/Slider.d.ts +12 -0
- package/dist/primitives/Slider.d.ts.map +1 -0
- package/dist/primitives/Slider.js +23 -0
- package/dist/primitives/Spinner.d.ts +6 -0
- package/dist/primitives/Spinner.d.ts.map +1 -0
- package/dist/primitives/Spinner.js +7 -0
- package/dist/primitives/StarRating.d.ts +10 -0
- package/dist/primitives/StarRating.d.ts.map +1 -0
- package/dist/primitives/StarRating.js +11 -0
- package/dist/primitives/Switch.d.ts +8 -0
- package/dist/primitives/Switch.d.ts.map +1 -0
- package/dist/primitives/Switch.js +20 -0
- package/dist/primitives/Table.d.ts +13 -0
- package/dist/primitives/Table.d.ts.map +1 -0
- package/dist/primitives/Table.js +20 -0
- package/dist/primitives/Tabs.d.ts +17 -0
- package/dist/primitives/Tabs.d.ts.map +1 -0
- package/dist/primitives/Tabs.js +30 -0
- package/dist/primitives/Textarea.d.ts +4 -0
- package/dist/primitives/Textarea.d.ts.map +1 -0
- package/dist/primitives/Textarea.js +6 -0
- package/dist/primitives/Tooltip.d.ts +31 -0
- package/dist/primitives/Tooltip.d.ts.map +1 -0
- package/dist/primitives/Tooltip.js +94 -0
- package/dist/theme/OriginThemeProvider.d.ts +31 -0
- package/dist/theme/OriginThemeProvider.d.ts.map +1 -0
- package/dist/theme/OriginThemeProvider.js +37 -0
- package/dist/theme/SpatikaThemeProvider.d.ts +36 -0
- package/dist/theme/SpatikaThemeProvider.d.ts.map +1 -0
- package/dist/theme/SpatikaThemeProvider.js +38 -0
- package/package.json +58 -0
- package/src/composites/ActionBar.tsx +25 -0
- package/src/composites/AmountInput.tsx +40 -0
- package/src/composites/AppHeader.tsx +88 -0
- package/src/composites/AppSidebar.tsx +120 -0
- package/src/composites/BottomSheet.tsx +179 -0
- package/src/composites/Breadcrumb.tsx +42 -0
- package/src/composites/Callout.tsx +22 -0
- package/src/composites/Card.tsx +119 -0
- package/src/composites/Chip.tsx +87 -0
- package/src/composites/ChipGroup.component.test.tsx +31 -0
- package/src/composites/ChipGroup.test.ts +16 -0
- package/src/composites/ChipGroup.tsx +86 -0
- package/src/composites/CommandSearchField.tsx +124 -0
- package/src/composites/CoverHero.tsx +359 -0
- package/src/composites/CoverPattern.tsx +90 -0
- package/src/composites/DataTableToolbar.tsx +48 -0
- package/src/composites/DividerLabel.tsx +22 -0
- package/src/composites/EmptyState.tsx +55 -0
- package/src/composites/EntityCard.tsx +100 -0
- package/src/composites/EntityMediaCard.tsx +118 -0
- package/src/composites/FilterSheet.tsx +178 -0
- package/src/composites/FloatingPageChrome.tsx +294 -0
- package/src/composites/FormField.tsx +44 -0
- package/src/composites/GlassCard.tsx +47 -0
- package/src/composites/HeaderIconButton.tsx +49 -0
- package/src/composites/ListRow.tsx +29 -0
- package/src/composites/MediaEntryCard.tsx +95 -0
- package/src/composites/MobileTabBar.tsx +130 -0
- package/src/composites/NotificationBell.tsx +164 -0
- package/src/composites/PageHeader.tsx +27 -0
- package/src/composites/PageShell.tsx +20 -0
- package/src/composites/PageStickyHeader.tsx +157 -0
- package/src/composites/Pagination.tsx +41 -0
- package/src/composites/PhotoViewer.tsx +142 -0
- package/src/composites/PinPad.tsx +163 -0
- package/src/composites/ProfileHero.tsx +163 -0
- package/src/composites/QuickFilterRail.tsx +92 -0
- package/src/composites/QuickSettings.tsx +120 -0
- package/src/composites/RichTextEditor.tsx +103 -0
- package/src/composites/SearchField.tsx +38 -0
- package/src/composites/SectionPanel.tsx +59 -0
- package/src/composites/SegmentedControl.tsx +62 -0
- package/src/composites/StatCard.tsx +26 -0
- package/src/composites/StatusDot.tsx +40 -0
- package/src/composites/SurfaceCard.tsx +44 -0
- package/src/composites/Timeline.tsx +70 -0
- package/src/composites/Toast.tsx +135 -0
- package/src/composites/Toolbar.tsx +19 -0
- package/src/composites/ViewFiltersPanel.tsx +82 -0
- package/src/composites/chrome.test.tsx +170 -0
- package/src/composites/smoke.test.tsx +49 -0
- package/src/index.ts +355 -0
- package/src/lib/animations.ts +47 -0
- package/src/lib/avatar-utils.ts +52 -0
- package/src/lib/chips.ts +58 -0
- package/src/lib/cn.test.ts +16 -0
- package/src/lib/cn.ts +7 -0
- package/src/lib/compose-refs.ts +21 -0
- package/src/lib/cover-chrome.ts +31 -0
- package/src/lib/cover-pattern.ts +242 -0
- package/src/lib/overlay-stack.ts +44 -0
- package/src/lib/portal.tsx +21 -0
- package/src/lib/slot.tsx +69 -0
- package/src/lib/surfaces.ts +57 -0
- package/src/lib/themes.test.ts +73 -0
- package/src/lib/themes.ts +59 -0
- package/src/lib/tokens.test.ts +52 -0
- package/src/lib/typography.ts +27 -0
- package/src/lib/use-controllable-state.ts +38 -0
- package/src/lib/use-cover-chrome-bleed.ts +33 -0
- package/src/lib/use-dismissable.ts +49 -0
- package/src/lib/use-floating-position.ts +168 -0
- package/src/lib/use-focus-trap.ts +73 -0
- package/src/lib/use-media-query.ts +22 -0
- package/src/primitives/Accordion.tsx +114 -0
- package/src/primitives/Alert.tsx +57 -0
- package/src/primitives/AlertDialog.tsx +270 -0
- package/src/primitives/Avatar.tsx +140 -0
- package/src/primitives/Badge.test.tsx +15 -0
- package/src/primitives/Badge.tsx +43 -0
- package/src/primitives/Button.test.tsx +37 -0
- package/src/primitives/Button.tsx +58 -0
- package/src/primitives/Checkbox.tsx +75 -0
- package/src/primitives/Command.tsx +175 -0
- package/src/primitives/Dialog.tsx +241 -0
- package/src/primitives/DropdownMenu.tsx +552 -0
- package/src/primitives/Input.test.tsx +22 -0
- package/src/primitives/Input.tsx +22 -0
- package/src/primitives/Kbd.tsx +17 -0
- package/src/primitives/Label.tsx +20 -0
- package/src/primitives/NativeSelect.tsx +22 -0
- package/src/primitives/Popover.tsx +209 -0
- package/src/primitives/Progress.tsx +31 -0
- package/src/primitives/RadioGroup.tsx +116 -0
- package/src/primitives/Select.tsx +409 -0
- package/src/primitives/Separator.tsx +30 -0
- package/src/primitives/Sheet.tsx +265 -0
- package/src/primitives/Skeleton.tsx +16 -0
- package/src/primitives/Slider.tsx +97 -0
- package/src/primitives/Spinner.tsx +21 -0
- package/src/primitives/StarRating.tsx +53 -0
- package/src/primitives/Switch.tsx +68 -0
- package/src/primitives/Table.tsx +134 -0
- package/src/primitives/Tabs.tsx +97 -0
- package/src/primitives/Textarea.tsx +20 -0
- package/src/primitives/Tooltip.tsx +193 -0
- package/src/primitives/smoke.test.tsx +34 -0
- package/src/test/setup.ts +1 -0
- package/src/theme/SpatikaThemeProvider.test.tsx +82 -0
- package/src/theme/SpatikaThemeProvider.tsx +112 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { X } from "lucide-react";
|
|
3
|
+
import { cn } from "../lib/cn";
|
|
4
|
+
import { Button } from "../primitives/Button";
|
|
5
|
+
|
|
6
|
+
export type QuickSettingsProps = {
|
|
7
|
+
open: boolean;
|
|
8
|
+
onOpenChange: (open: boolean) => void;
|
|
9
|
+
title?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/** side sheet from right (default) or bottom drawer-like panel */
|
|
13
|
+
side?: "right" | "left";
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Sliding quick-settings panel — appearance, density, toggles, etc.
|
|
19
|
+
*/
|
|
20
|
+
export function QuickSettings({
|
|
21
|
+
open,
|
|
22
|
+
onOpenChange,
|
|
23
|
+
title = "Quick settings",
|
|
24
|
+
description,
|
|
25
|
+
children,
|
|
26
|
+
side = "right",
|
|
27
|
+
className,
|
|
28
|
+
}: QuickSettingsProps) {
|
|
29
|
+
if (!open) return null;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div data-slot="quick-settings" className="fixed inset-0 z-50">
|
|
33
|
+
<button
|
|
34
|
+
type="button"
|
|
35
|
+
aria-label="Close settings"
|
|
36
|
+
className="absolute inset-0 bg-[var(--modal-overlay-bg)] backdrop-blur-[var(--modal-overlay-blur)]"
|
|
37
|
+
onClick={() => onOpenChange(false)}
|
|
38
|
+
/>
|
|
39
|
+
<aside
|
|
40
|
+
role="dialog"
|
|
41
|
+
aria-modal="true"
|
|
42
|
+
aria-label={title}
|
|
43
|
+
className={cn(
|
|
44
|
+
"glass-menu absolute top-0 flex h-full w-full max-w-sm flex-col shadow-2xl",
|
|
45
|
+
side === "right" ? "right-0 border-l" : "left-0 border-r",
|
|
46
|
+
"border-border/40",
|
|
47
|
+
className,
|
|
48
|
+
)}
|
|
49
|
+
>
|
|
50
|
+
<div className="flex items-start justify-between gap-3 border-b border-border/40 px-4 py-4">
|
|
51
|
+
<div>
|
|
52
|
+
<h2 className="text-base font-black tracking-tight">{title}</h2>
|
|
53
|
+
{description ? (
|
|
54
|
+
<p className="mt-0.5 text-xs font-medium text-muted-foreground">{description}</p>
|
|
55
|
+
) : null}
|
|
56
|
+
</div>
|
|
57
|
+
<Button
|
|
58
|
+
type="button"
|
|
59
|
+
variant="ghost"
|
|
60
|
+
size="icon"
|
|
61
|
+
aria-label="Close"
|
|
62
|
+
onClick={() => onOpenChange(false)}
|
|
63
|
+
>
|
|
64
|
+
<X className="size-4" />
|
|
65
|
+
</Button>
|
|
66
|
+
</div>
|
|
67
|
+
<div className="flex-1 space-y-5 overflow-y-auto px-4 py-4">{children}</div>
|
|
68
|
+
</aside>
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function QuickSettingsGroup({
|
|
74
|
+
title,
|
|
75
|
+
children,
|
|
76
|
+
className,
|
|
77
|
+
}: {
|
|
78
|
+
title: string;
|
|
79
|
+
children: ReactNode;
|
|
80
|
+
className?: string;
|
|
81
|
+
}) {
|
|
82
|
+
return (
|
|
83
|
+
<div data-slot="quick-settings-group" className={cn("space-y-3", className)}>
|
|
84
|
+
<p className="text-[10px] font-black uppercase tracking-widest text-muted-foreground/70">
|
|
85
|
+
{title}
|
|
86
|
+
</p>
|
|
87
|
+
<div className="space-y-2">{children}</div>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function QuickSettingsRow({
|
|
93
|
+
label,
|
|
94
|
+
description,
|
|
95
|
+
control,
|
|
96
|
+
className,
|
|
97
|
+
}: {
|
|
98
|
+
label: string;
|
|
99
|
+
description?: string;
|
|
100
|
+
control: ReactNode;
|
|
101
|
+
className?: string;
|
|
102
|
+
}) {
|
|
103
|
+
return (
|
|
104
|
+
<div
|
|
105
|
+
data-slot="quick-settings-row"
|
|
106
|
+
className={cn(
|
|
107
|
+
"flex items-center justify-between gap-3 rounded-xl border border-border/40 bg-background/30 px-3 py-2.5",
|
|
108
|
+
className,
|
|
109
|
+
)}
|
|
110
|
+
>
|
|
111
|
+
<div className="min-w-0">
|
|
112
|
+
<p className="text-sm font-bold">{label}</p>
|
|
113
|
+
{description ? (
|
|
114
|
+
<p className="text-xs text-muted-foreground">{description}</p>
|
|
115
|
+
) : null}
|
|
116
|
+
</div>
|
|
117
|
+
<div className="shrink-0">{control}</div>
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Bold,
|
|
4
|
+
Italic,
|
|
5
|
+
List,
|
|
6
|
+
ListOrdered,
|
|
7
|
+
Underline as UnderlineIcon,
|
|
8
|
+
} from "lucide-react";
|
|
9
|
+
import { cn } from "../lib/cn";
|
|
10
|
+
import { Button } from "../primitives/Button";
|
|
11
|
+
|
|
12
|
+
export type RichTextEditorProps = {
|
|
13
|
+
value?: string;
|
|
14
|
+
onChange?: (html: string) => void;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
minHeightClassName?: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Lightweight rich-text surface (contenteditable) for notes and captions.
|
|
22
|
+
* Pair with TipTap or another full editor in your app when you need tables or advanced media.
|
|
23
|
+
*/
|
|
24
|
+
export function RichTextEditor({
|
|
25
|
+
value = "",
|
|
26
|
+
onChange,
|
|
27
|
+
placeholder = "Write something…",
|
|
28
|
+
className,
|
|
29
|
+
minHeightClassName = "min-h-40",
|
|
30
|
+
}: RichTextEditorProps) {
|
|
31
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (ref.current && value !== ref.current.innerHTML) {
|
|
35
|
+
ref.current.innerHTML = value;
|
|
36
|
+
}
|
|
37
|
+
}, [value]);
|
|
38
|
+
|
|
39
|
+
const exec = (command: string) => {
|
|
40
|
+
document.execCommand(command);
|
|
41
|
+
onChange?.(ref.current?.innerHTML ?? "");
|
|
42
|
+
ref.current?.focus();
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<div
|
|
47
|
+
data-slot="rich-text-editor"
|
|
48
|
+
className={cn(
|
|
49
|
+
"overflow-hidden rounded-[var(--radius-card)] border border-border/50 bg-input-background",
|
|
50
|
+
className,
|
|
51
|
+
)}
|
|
52
|
+
>
|
|
53
|
+
<div className="flex flex-wrap gap-1 border-b border-border/40 bg-muted/30 p-1.5">
|
|
54
|
+
<Button type="button" variant="ghost" size="icon" aria-label="Bold" onClick={() => exec("bold")}>
|
|
55
|
+
<Bold className="size-4" />
|
|
56
|
+
</Button>
|
|
57
|
+
<Button type="button" variant="ghost" size="icon" aria-label="Italic" onClick={() => exec("italic")}>
|
|
58
|
+
<Italic className="size-4" />
|
|
59
|
+
</Button>
|
|
60
|
+
<Button
|
|
61
|
+
type="button"
|
|
62
|
+
variant="ghost"
|
|
63
|
+
size="icon"
|
|
64
|
+
aria-label="Underline"
|
|
65
|
+
onClick={() => exec("underline")}
|
|
66
|
+
>
|
|
67
|
+
<UnderlineIcon className="size-4" />
|
|
68
|
+
</Button>
|
|
69
|
+
<Button
|
|
70
|
+
type="button"
|
|
71
|
+
variant="ghost"
|
|
72
|
+
size="icon"
|
|
73
|
+
aria-label="Bullet list"
|
|
74
|
+
onClick={() => exec("insertUnorderedList")}
|
|
75
|
+
>
|
|
76
|
+
<List className="size-4" />
|
|
77
|
+
</Button>
|
|
78
|
+
<Button
|
|
79
|
+
type="button"
|
|
80
|
+
variant="ghost"
|
|
81
|
+
size="icon"
|
|
82
|
+
aria-label="Numbered list"
|
|
83
|
+
onClick={() => exec("insertOrderedList")}
|
|
84
|
+
>
|
|
85
|
+
<ListOrdered className="size-4" />
|
|
86
|
+
</Button>
|
|
87
|
+
</div>
|
|
88
|
+
<div
|
|
89
|
+
ref={ref}
|
|
90
|
+
role="textbox"
|
|
91
|
+
aria-multiline="true"
|
|
92
|
+
contentEditable
|
|
93
|
+
suppressContentEditableWarning
|
|
94
|
+
data-placeholder={placeholder}
|
|
95
|
+
className={cn(
|
|
96
|
+
"px-3 py-2 text-sm outline-none empty:before:text-muted-foreground empty:before:content-[attr(data-placeholder)]",
|
|
97
|
+
minHeightClassName,
|
|
98
|
+
)}
|
|
99
|
+
onInput={() => onChange?.(ref.current?.innerHTML ?? "")}
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import { Search } from "lucide-react";
|
|
3
|
+
import { cn } from "../lib/cn";
|
|
4
|
+
import { Input } from "../primitives/Input";
|
|
5
|
+
|
|
6
|
+
export type SearchFieldProps = ComponentProps<"input"> & {
|
|
7
|
+
containerClassName?: string;
|
|
8
|
+
leading?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/** Search input with leading icon — mobile-friendly min height. */
|
|
12
|
+
export function SearchField({
|
|
13
|
+
className,
|
|
14
|
+
containerClassName,
|
|
15
|
+
leading,
|
|
16
|
+
...props
|
|
17
|
+
}: SearchFieldProps) {
|
|
18
|
+
return (
|
|
19
|
+
<div
|
|
20
|
+
data-slot="search-field"
|
|
21
|
+
className={cn("relative w-full", containerClassName)}
|
|
22
|
+
>
|
|
23
|
+
{/* inset-y + flex centers the icon without translate utilities (more reliable across app Tailwind scans) */}
|
|
24
|
+
<span className="pointer-events-none absolute inset-y-0 left-0 z-10 flex items-center pl-3 text-muted-foreground">
|
|
25
|
+
{leading ?? <Search className="h-4 w-4 shrink-0" aria-hidden />}
|
|
26
|
+
</span>
|
|
27
|
+
<Input
|
|
28
|
+
className={cn(
|
|
29
|
+
"h-11 py-0 pl-9 leading-none",
|
|
30
|
+
"[&::-webkit-search-decoration]:appearance-none [&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none",
|
|
31
|
+
className,
|
|
32
|
+
)}
|
|
33
|
+
type="search"
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { LucideIcon } from "lucide-react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import { cn } from "../lib/cn";
|
|
4
|
+
|
|
5
|
+
export type SectionPanelProps = {
|
|
6
|
+
icon: LucideIcon;
|
|
7
|
+
title: string;
|
|
8
|
+
subtitle?: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
fullWidth?: boolean;
|
|
12
|
+
trailing?: ReactNode;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Glassmorphic settings / admin section with icon tile and uppercase subtitle.
|
|
17
|
+
*/
|
|
18
|
+
export function SectionPanel({
|
|
19
|
+
icon: Icon,
|
|
20
|
+
title,
|
|
21
|
+
subtitle,
|
|
22
|
+
children,
|
|
23
|
+
className,
|
|
24
|
+
fullWidth = false,
|
|
25
|
+
trailing,
|
|
26
|
+
}: SectionPanelProps) {
|
|
27
|
+
return (
|
|
28
|
+
<section
|
|
29
|
+
data-slot="section-panel"
|
|
30
|
+
className={cn(
|
|
31
|
+
"group relative flex flex-col gap-5 overflow-hidden border border-border/30 bg-card/60 p-5 shadow-2xl backdrop-blur-md sm:gap-6 sm:p-6",
|
|
32
|
+
"rounded-[var(--radius-card)]",
|
|
33
|
+
fullWidth && "md:col-span-2",
|
|
34
|
+
className,
|
|
35
|
+
)}
|
|
36
|
+
>
|
|
37
|
+
<div className="pointer-events-none absolute -right-12 -top-12 h-48 w-48 rounded-full bg-primary/5 blur-3xl transition-colors duration-700 group-hover:bg-primary/10" />
|
|
38
|
+
|
|
39
|
+
<div className="relative flex items-start justify-between gap-3">
|
|
40
|
+
<div className="flex min-w-0 items-center gap-3">
|
|
41
|
+
<div className="shrink-0 rounded-xl border border-primary/20 bg-primary/10 p-2 shadow-inner">
|
|
42
|
+
<Icon className="h-4 w-4 text-primary" />
|
|
43
|
+
</div>
|
|
44
|
+
<div className="min-w-0">
|
|
45
|
+
<h2 className="text-lg font-black tracking-tight text-foreground">{title}</h2>
|
|
46
|
+
{subtitle ? (
|
|
47
|
+
<p className="mt-0.5 text-[10px] font-black uppercase tracking-widest text-muted-foreground/60">
|
|
48
|
+
{subtitle}
|
|
49
|
+
</p>
|
|
50
|
+
) : null}
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
{trailing ? <div className="relative shrink-0">{trailing}</div> : null}
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div className="relative">{children}</div>
|
|
57
|
+
</section>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { cn } from "../lib/cn";
|
|
3
|
+
|
|
4
|
+
export type SegmentedControlOption<T extends string = string> = {
|
|
5
|
+
value: T;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type SegmentedControlProps<T extends string = string> = {
|
|
11
|
+
options: SegmentedControlOption<T>[];
|
|
12
|
+
value: T;
|
|
13
|
+
onChange: (value: T) => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
size?: "sm" | "md";
|
|
16
|
+
"aria-label"?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** Single-select segmented toggle (income/expense, period, etc.). */
|
|
20
|
+
export function SegmentedControl<T extends string = string>({
|
|
21
|
+
options,
|
|
22
|
+
value,
|
|
23
|
+
onChange,
|
|
24
|
+
className,
|
|
25
|
+
size = "md",
|
|
26
|
+
"aria-label": ariaLabel,
|
|
27
|
+
}: SegmentedControlProps<T>) {
|
|
28
|
+
return (
|
|
29
|
+
<div
|
|
30
|
+
data-slot="segmented-control"
|
|
31
|
+
role="radiogroup"
|
|
32
|
+
aria-label={ariaLabel}
|
|
33
|
+
className={cn(
|
|
34
|
+
"inline-flex items-center rounded-xl border border-border/50 bg-muted/25 p-1",
|
|
35
|
+
className,
|
|
36
|
+
)}
|
|
37
|
+
>
|
|
38
|
+
{options.map((opt) => {
|
|
39
|
+
const active = opt.value === value;
|
|
40
|
+
return (
|
|
41
|
+
<button
|
|
42
|
+
key={opt.value}
|
|
43
|
+
type="button"
|
|
44
|
+
role="radio"
|
|
45
|
+
aria-checked={active}
|
|
46
|
+
disabled={opt.disabled}
|
|
47
|
+
onClick={() => onChange(opt.value)}
|
|
48
|
+
className={cn(
|
|
49
|
+
"rounded-lg font-bold transition-colors disabled:pointer-events-none disabled:opacity-40",
|
|
50
|
+
size === "sm" ? "px-2.5 py-1 text-xs" : "px-3.5 py-1.5 text-sm",
|
|
51
|
+
active
|
|
52
|
+
? "bg-background text-foreground shadow-sm"
|
|
53
|
+
: "text-muted-foreground hover:text-foreground",
|
|
54
|
+
)}
|
|
55
|
+
>
|
|
56
|
+
{opt.label}
|
|
57
|
+
</button>
|
|
58
|
+
);
|
|
59
|
+
})}
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { cn } from "../lib/cn";
|
|
3
|
+
|
|
4
|
+
export type StatCardProps = {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string | number;
|
|
7
|
+
hint?: string;
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/** Compact metric tile using elevated app-card surface. */
|
|
13
|
+
export function StatCard({ label, value, hint, icon, className }: StatCardProps) {
|
|
14
|
+
return (
|
|
15
|
+
<div data-slot="stat-card" className={cn("app-stat-card p-4 sm:p-5", className)}>
|
|
16
|
+
<div className="flex items-start justify-between gap-3">
|
|
17
|
+
<p className="text-[10px] font-black uppercase tracking-widest text-muted-foreground">
|
|
18
|
+
{label}
|
|
19
|
+
</p>
|
|
20
|
+
{icon ? <div className="text-primary">{icon}</div> : null}
|
|
21
|
+
</div>
|
|
22
|
+
<p className="mt-2 text-2xl font-black tracking-tight text-foreground">{value}</p>
|
|
23
|
+
{hint ? <p className="mt-1 text-xs font-medium text-muted-foreground">{hint}</p> : null}
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
import { cn } from "../lib/cn";
|
|
3
|
+
|
|
4
|
+
const statusDotVariants = cva("inline-block size-2 shrink-0 rounded-full", {
|
|
5
|
+
variants: {
|
|
6
|
+
tone: {
|
|
7
|
+
neutral: "bg-muted-foreground/50",
|
|
8
|
+
success: "bg-[var(--accent-info)]",
|
|
9
|
+
warning: "bg-[var(--accent-warm)]",
|
|
10
|
+
danger: "bg-destructive",
|
|
11
|
+
primary: "bg-primary",
|
|
12
|
+
},
|
|
13
|
+
pulse: {
|
|
14
|
+
true: "animate-pulse",
|
|
15
|
+
false: "",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: { tone: "neutral", pulse: false },
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export function StatusDot({
|
|
22
|
+
className,
|
|
23
|
+
tone,
|
|
24
|
+
pulse,
|
|
25
|
+
label,
|
|
26
|
+
}: VariantProps<typeof statusDotVariants> & {
|
|
27
|
+
className?: string;
|
|
28
|
+
label?: string;
|
|
29
|
+
}) {
|
|
30
|
+
return (
|
|
31
|
+
<span
|
|
32
|
+
data-slot="status-dot"
|
|
33
|
+
role={label ? "img" : undefined}
|
|
34
|
+
aria-label={label}
|
|
35
|
+
className={cn(statusDotVariants({ tone, pulse }), className)}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { statusDotVariants };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../lib/cn";
|
|
4
|
+
import {
|
|
5
|
+
surfaceDetailClass,
|
|
6
|
+
surfacePrimaryClass,
|
|
7
|
+
surfaceSecondaryClass,
|
|
8
|
+
surfaceTertiaryClass,
|
|
9
|
+
} from "../lib/surfaces";
|
|
10
|
+
|
|
11
|
+
const surfaceCardVariants = cva("", {
|
|
12
|
+
variants: {
|
|
13
|
+
tone: {
|
|
14
|
+
primary: surfacePrimaryClass,
|
|
15
|
+
secondary: surfaceSecondaryClass,
|
|
16
|
+
detail: surfaceDetailClass,
|
|
17
|
+
tertiary: surfaceTertiaryClass,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
tone: "primary",
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export type SurfaceCardProps = React.ComponentProps<"div"> &
|
|
26
|
+
VariantProps<typeof surfaceCardVariants>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Profile / hierarchy surface card (primary → tertiary visual weight).
|
|
30
|
+
*/
|
|
31
|
+
const SurfaceCard = React.forwardRef<HTMLDivElement, SurfaceCardProps>(
|
|
32
|
+
({ className, tone, ...props }, ref) => (
|
|
33
|
+
<div
|
|
34
|
+
ref={ref}
|
|
35
|
+
data-slot="surface-card"
|
|
36
|
+
data-tone={tone ?? "primary"}
|
|
37
|
+
className={cn(surfaceCardVariants({ tone }), className)}
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
),
|
|
41
|
+
);
|
|
42
|
+
SurfaceCard.displayName = "SurfaceCard";
|
|
43
|
+
|
|
44
|
+
export { SurfaceCard, surfaceCardVariants };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { cn } from "../lib/cn";
|
|
3
|
+
|
|
4
|
+
export type TimelineItemProps = {
|
|
5
|
+
title: string;
|
|
6
|
+
meta?: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
trailing?: ReactNode;
|
|
10
|
+
active?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** Single activity / journal row inside a Timeline. */
|
|
15
|
+
export function TimelineItem({
|
|
16
|
+
title,
|
|
17
|
+
meta,
|
|
18
|
+
description,
|
|
19
|
+
icon,
|
|
20
|
+
trailing,
|
|
21
|
+
active,
|
|
22
|
+
className,
|
|
23
|
+
}: TimelineItemProps) {
|
|
24
|
+
return (
|
|
25
|
+
<li
|
|
26
|
+
data-slot="timeline-item"
|
|
27
|
+
className={cn("relative flex gap-3 pb-5 last:pb-0", className)}
|
|
28
|
+
>
|
|
29
|
+
<div className="flex w-8 shrink-0 flex-col items-center">
|
|
30
|
+
<div
|
|
31
|
+
className={cn(
|
|
32
|
+
"flex h-8 w-8 items-center justify-center rounded-xl border text-muted-foreground",
|
|
33
|
+
active
|
|
34
|
+
? "border-primary/35 bg-primary/10 text-primary"
|
|
35
|
+
: "border-border/50 bg-muted/20",
|
|
36
|
+
)}
|
|
37
|
+
>
|
|
38
|
+
{icon ?? <span className="h-1.5 w-1.5 rounded-full bg-current" />}
|
|
39
|
+
</div>
|
|
40
|
+
<div className="mt-1 w-px flex-1 bg-border/50" aria-hidden />
|
|
41
|
+
</div>
|
|
42
|
+
<div className="min-w-0 flex-1 pt-0.5">
|
|
43
|
+
<div className="flex items-start gap-2">
|
|
44
|
+
<div className="min-w-0 flex-1">
|
|
45
|
+
<p className="text-sm font-bold text-foreground">{title}</p>
|
|
46
|
+
{meta ? <div className="mt-0.5 text-xs text-muted-foreground">{meta}</div> : null}
|
|
47
|
+
</div>
|
|
48
|
+
{trailing ? <div className="shrink-0">{trailing}</div> : null}
|
|
49
|
+
</div>
|
|
50
|
+
{description ? (
|
|
51
|
+
<div className="mt-1.5 text-sm text-muted-foreground">{description}</div>
|
|
52
|
+
) : null}
|
|
53
|
+
</div>
|
|
54
|
+
</li>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type TimelineProps = {
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
className?: string;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/** Vertical activity / journal feed. */
|
|
64
|
+
export function Timeline({ children, className }: TimelineProps) {
|
|
65
|
+
return (
|
|
66
|
+
<ul data-slot="timeline" className={cn("space-y-0", className)}>
|
|
67
|
+
{children}
|
|
68
|
+
</ul>
|
|
69
|
+
);
|
|
70
|
+
}
|