@ponti-studios/ui 2.0.1 → 3.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 +36 -3
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.js +3 -0
- package/dist/components/data-display/accordion.d.ts +10 -0
- package/dist/components/data-display/accordion.js +53 -0
- package/{src/components/data-display/index.ts → dist/components/data-display/index.d.ts} +1 -10
- package/dist/components/data-display/index.js +8 -0
- package/dist/components/data-display/metric-card.d.ts +9 -0
- package/dist/components/data-display/metric-card.js +25 -0
- package/dist/components/data-display/sort-controls.d.ts +13 -0
- package/dist/components/data-display/sort-controls.js +57 -0
- package/dist/components/data-display/sort-row.d.ts +10 -0
- package/dist/components/data-display/sort-row.js +52 -0
- package/dist/components/data-display/table.d.ts +10 -0
- package/dist/components/data-display/table.js +57 -0
- package/dist/components/feedback/alert.d.ts +9 -0
- package/dist/components/feedback/alert.js +38 -0
- package/dist/components/feedback/empty-state.d.ts +18 -0
- package/dist/components/feedback/empty-state.js +36 -0
- package/{src/components/feedback/index.ts → dist/components/feedback/index.d.ts} +2 -0
- package/dist/components/feedback/index.js +7 -0
- package/dist/components/feedback/progress.d.ts +6 -0
- package/dist/components/feedback/progress.js +25 -0
- package/dist/components/feedback/skeleton.d.ts +2 -0
- package/dist/components/feedback/skeleton.js +11 -0
- package/dist/components/feedback/spinner.d.ts +14 -0
- package/dist/components/feedback/spinner.js +27 -0
- package/dist/components/feedback/update-guard.d.ts +13 -0
- package/dist/components/feedback/update-guard.js +38 -0
- package/dist/components/filters/active-filters-bar.d.ts +14 -0
- package/dist/components/filters/active-filters-bar.js +44 -0
- package/dist/components/filters/filter-chip.d.ts +11 -0
- package/dist/components/filters/filter-chip.js +33 -0
- package/dist/components/filters/filter-select.d.ts +17 -0
- package/dist/components/filters/filter-select.js +46 -0
- package/dist/components/filters/index.js +4 -0
- package/dist/components/forms/checkbox.d.ts +4 -0
- package/dist/components/forms/checkbox.js +24 -0
- package/dist/components/forms/date-month-select.d.ts +11 -0
- package/dist/components/forms/date-month-select.js +47 -0
- package/dist/components/forms/date-picker.d.ts +60 -0
- package/dist/components/forms/date-picker.js +193 -0
- package/dist/components/forms/date-utils.d.ts +14 -0
- package/dist/components/forms/date-utils.js +18 -0
- package/dist/components/forms/drop-zone.d.ts +42 -0
- package/dist/components/forms/drop-zone.js +184 -0
- package/{src/components/forms/index.ts → dist/components/forms/index.d.ts} +3 -9
- package/dist/components/forms/index.js +17 -0
- package/dist/components/forms/input.d.ts +3 -0
- package/dist/components/forms/input.js +15 -0
- package/dist/components/forms/label.d.ts +3 -0
- package/dist/components/forms/label.js +14 -0
- package/dist/components/forms/passkey-management.d.ts +14 -0
- package/dist/components/forms/passkey-management.js +132 -0
- package/dist/components/forms/radio-group.d.ts +6 -0
- package/dist/components/forms/radio-group.js +28 -0
- package/dist/components/forms/select.d.ts +18 -0
- package/dist/components/forms/select.js +103 -0
- package/dist/components/forms/slider.d.ts +9 -0
- package/dist/components/forms/slider.js +25 -0
- package/dist/components/forms/stepper.d.ts +15 -0
- package/dist/components/forms/stepper.js +41 -0
- package/dist/components/forms/switch.d.ts +6 -0
- package/dist/components/forms/switch.js +21 -0
- package/dist/components/forms/text-field.d.ts +15 -0
- package/dist/components/forms/text-field.js +46 -0
- package/dist/components/forms/text-field.types.d.ts +8 -0
- package/dist/components/forms/textarea.d.ts +3 -0
- package/dist/components/forms/textarea.js +14 -0
- package/dist/components/layout/index.js +5 -0
- package/dist/components/layout/particle-background.d.ts +19 -0
- package/dist/components/layout/particle-background.js +171 -0
- package/dist/components/layout/scroll-area.d.ts +9 -0
- package/dist/components/layout/scroll-area.js +35 -0
- package/dist/components/layout/section-intro.d.ts +12 -0
- package/dist/components/layout/section-intro.js +28 -0
- package/dist/components/layout/surface-panel.d.ts +7 -0
- package/dist/components/layout/surface-panel.js +11 -0
- package/dist/components/navigation/app-navigation.d.ts +67 -0
- package/dist/components/navigation/app-navigation.js +106 -0
- package/{src/components/navigation/index.ts → dist/components/navigation/index.d.ts} +1 -7
- package/dist/components/navigation/index.js +4 -0
- package/dist/components/navigation/pagination-controls.d.ts +7 -0
- package/dist/components/navigation/pagination-controls.js +50 -0
- package/dist/components/navigation/tabs.d.ts +7 -0
- package/dist/components/navigation/tabs.js +35 -0
- package/dist/components/overlays/bottom-sheet.d.ts +20 -0
- package/dist/components/overlays/bottom-sheet.js +101 -0
- package/dist/components/overlays/command.d.ts +29 -0
- package/dist/components/overlays/command.js +123 -0
- package/dist/components/overlays/dialog.d.ts +30 -0
- package/dist/components/overlays/dialog.js +105 -0
- package/dist/components/overlays/dropdown-menu.d.ts +29 -0
- package/dist/components/overlays/dropdown-menu.js +128 -0
- package/dist/components/overlays/index.d.ts +7 -0
- package/dist/components/overlays/index.js +8 -0
- package/dist/components/overlays/popover.d.ts +14 -0
- package/dist/components/overlays/popover.js +56 -0
- package/dist/components/overlays/sheet.d.ts +27 -0
- package/dist/components/overlays/sheet.js +81 -0
- package/dist/components/overlays/tooltip.d.ts +10 -0
- package/dist/components/overlays/tooltip.js +23 -0
- package/dist/components/primitives/avatar.d.ts +14 -0
- package/dist/components/primitives/avatar.js +72 -0
- package/dist/components/primitives/badge.d.ts +7 -0
- package/dist/components/primitives/badge.js +27 -0
- package/dist/components/primitives/button.d.ts +13 -0
- package/dist/components/primitives/button.js +113 -0
- package/{src/components/primitives/button.types.ts → dist/components/primitives/button.types.d.ts} +4 -6
- package/dist/components/primitives/card.d.ts +9 -0
- package/dist/components/primitives/card.js +56 -0
- package/{src/components/primitives/index.ts → dist/components/primitives/index.d.ts} +1 -9
- package/dist/components/primitives/index.js +7 -0
- package/dist/components/primitives/segmented-control.d.ts +20 -0
- package/dist/components/primitives/segmented-control.js +27 -0
- package/dist/components/primitives/separator.d.ts +4 -0
- package/dist/components/primitives/separator.js +16 -0
- package/dist/constants/chart-colors.d.ts +33 -0
- package/dist/constants/chart-colors.js +31 -0
- package/dist/hooks/index.js +9 -0
- package/{src/hooks/sort.types.ts → dist/hooks/sort.types.d.ts} +2 -4
- package/dist/hooks/use-api-client.d.ts +30 -0
- package/dist/hooks/use-api-client.js +106 -0
- package/dist/hooks/use-debounced-value.d.ts +1 -0
- package/dist/hooks/use-debounced-value.js +12 -0
- package/dist/hooks/use-derived-filter-state.d.ts +20 -0
- package/dist/hooks/use-derived-filter-state.js +39 -0
- package/dist/hooks/use-filter-state.d.ts +12 -0
- package/dist/hooks/use-filter-state.js +37 -0
- package/dist/hooks/use-media-query.d.ts +6 -0
- package/dist/hooks/use-media-query.js +27 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +14 -0
- package/dist/hooks/use-sort.d.ts +11 -0
- package/dist/hooks/use-sort.js +14 -0
- package/{src/index.ts → dist/index.d.ts} +4 -32
- package/dist/index.js +15 -0
- package/dist/integrations/service-worker.d.ts +2 -0
- package/dist/integrations/service-worker.js +2 -0
- package/dist/lib/auth.d.ts +2 -0
- package/dist/lib/auth.js +7 -0
- package/dist/lib/clipboard.d.ts +1 -0
- package/dist/lib/clipboard.js +10 -0
- package/dist/lib/index.js +4 -0
- package/{src/lib/slot.tsx → dist/lib/slot.d.ts} +2 -15
- package/dist/lib/slot.js +14 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +8 -0
- package/dist/native/components.d.ts +41 -0
- package/dist/native/components.js +135 -0
- package/dist/native/index.js +3 -0
- package/dist/native/theme.d.ts +19 -0
- package/dist/native/theme.js +58 -0
- package/dist/styles/tokens/css-vars.d.ts +7 -0
- package/dist/styles/tokens/css-vars.js +5 -0
- package/dist/styles/tokens/generated/dark.colors.generated.d.ts +40 -0
- package/dist/styles/tokens/generated/dark.colors.generated.js +39 -0
- package/dist/styles/tokens/generated/foundations.generated.d.ts +323 -0
- package/dist/styles/tokens/generated/foundations.generated.js +453 -0
- package/dist/styles/tokens/generated/light.colors.generated.d.ts +40 -0
- package/dist/styles/tokens/generated/light.colors.generated.js +39 -0
- package/dist/styles/tokens/index.d.ts +317 -0
- package/dist/styles/tokens/index.js +14 -0
- package/dist/styles.css +1 -1
- package/dist/translations/en.d.ts +34 -0
- package/dist/translations/index.d.ts +39 -0
- package/dist/translations/ui-provider.d.ts +9 -0
- package/dist/translations/ui-provider.js +16 -0
- package/dist/types/upload.d.ts +36 -0
- package/package.json +50 -33
- package/src/components/data-display/accordion.stories.tsx +0 -57
- package/src/components/data-display/accordion.tsx +0 -86
- package/src/components/data-display/metric-card.stories.tsx +0 -48
- package/src/components/data-display/metric-card.tsx +0 -20
- package/src/components/data-display/sort-controls.stories.tsx +0 -45
- package/src/components/data-display/sort-controls.tsx +0 -96
- package/src/components/data-display/sort-row.tsx +0 -88
- package/src/components/data-display/table.stories.tsx +0 -75
- package/src/components/data-display/table.tsx +0 -80
- package/src/components/feedback/alert.stories.tsx +0 -51
- package/src/components/feedback/alert.tsx +0 -64
- package/src/components/feedback/empty-state.tsx +0 -76
- package/src/components/feedback/progress.stories.tsx +0 -54
- package/src/components/feedback/progress.tsx +0 -41
- package/src/components/feedback/skeleton.stories.tsx +0 -36
- package/src/components/feedback/skeleton.tsx +0 -7
- package/src/components/feedback/spinner.stories.tsx +0 -52
- package/src/components/feedback/spinner.tsx +0 -47
- package/src/components/feedback/update-guard.stories.tsx +0 -28
- package/src/components/feedback/update-guard.tsx +0 -57
- package/src/components/filters/active-filters-bar.stories.tsx +0 -114
- package/src/components/filters/active-filters-bar.tsx +0 -61
- package/src/components/filters/filter-chip.tsx +0 -57
- package/src/components/filters/filter-select.stories.tsx +0 -71
- package/src/components/filters/filter-select.tsx +0 -68
- package/src/components/forms/checkbox.stories.tsx +0 -35
- package/src/components/forms/checkbox.tsx +0 -38
- package/src/components/forms/date-month-select.stories.tsx +0 -26
- package/src/components/forms/date-month-select.tsx +0 -79
- package/src/components/forms/date-picker.stories.tsx +0 -188
- package/src/components/forms/date-picker.tsx +0 -303
- package/src/components/forms/date-utils.ts +0 -37
- package/src/components/forms/drop-zone.stories.tsx +0 -140
- package/src/components/forms/drop-zone.tsx +0 -298
- package/src/components/forms/input.stories.tsx +0 -47
- package/src/components/forms/input.tsx +0 -24
- package/src/components/forms/label.stories.tsx +0 -16
- package/src/components/forms/label.tsx +0 -25
- package/src/components/forms/passkey-management.stories.tsx +0 -85
- package/src/components/forms/passkey-management.tsx +0 -168
- package/src/components/forms/radio-group.stories.tsx +0 -46
- package/src/components/forms/radio-group.tsx +0 -44
- package/src/components/forms/select.stories.tsx +0 -207
- package/src/components/forms/select.tsx +0 -182
- package/src/components/forms/slider.stories.tsx +0 -70
- package/src/components/forms/slider.tsx +0 -50
- package/src/components/forms/stepper.stories.tsx +0 -111
- package/src/components/forms/stepper.tsx +0 -66
- package/src/components/forms/switch.stories.tsx +0 -144
- package/src/components/forms/switch.tsx +0 -39
- package/src/components/forms/text-field.stories.tsx +0 -87
- package/src/components/forms/text-field.tsx +0 -75
- package/src/components/forms/text-field.types.ts +0 -9
- package/src/components/forms/textarea.stories.tsx +0 -150
- package/src/components/forms/textarea.tsx +0 -22
- package/src/components/layout/particle-background.stories.tsx +0 -38
- package/src/components/layout/particle-background.tsx +0 -378
- package/src/components/layout/scroll-area.stories.tsx +0 -91
- package/src/components/layout/scroll-area.tsx +0 -79
- package/src/components/layout/section-intro.stories.tsx +0 -29
- package/src/components/layout/section-intro.tsx +0 -31
- package/src/components/layout/surface-panel.stories.tsx +0 -32
- package/src/components/layout/surface-panel.tsx +0 -23
- package/src/components/navigation/app-navigation.stories.tsx +0 -217
- package/src/components/navigation/app-navigation.tsx +0 -234
- package/src/components/navigation/pagination-controls.stories.tsx +0 -41
- package/src/components/navigation/pagination-controls.tsx +0 -46
- package/src/components/navigation/tabs.stories.tsx +0 -48
- package/src/components/navigation/tabs.tsx +0 -52
- package/src/components/overlays/bottom-sheet.stories.tsx +0 -52
- package/src/components/overlays/bottom-sheet.tsx +0 -179
- package/src/components/overlays/command.stories.tsx +0 -65
- package/src/components/overlays/command.tsx +0 -227
- package/src/components/overlays/dialog.stories.tsx +0 -148
- package/src/components/overlays/dialog.tsx +0 -203
- package/src/components/overlays/dropdown-menu.stories.tsx +0 -74
- package/src/components/overlays/dropdown-menu.tsx +0 -236
- package/src/components/overlays/index.ts +0 -56
- package/src/components/overlays/popover.stories.tsx +0 -51
- package/src/components/overlays/popover.tsx +0 -78
- package/src/components/overlays/sheet.stories.tsx +0 -68
- package/src/components/overlays/sheet.tsx +0 -155
- package/src/components/overlays/tooltip.stories.tsx +0 -29
- package/src/components/overlays/tooltip.tsx +0 -41
- package/src/components/primitives/avatar-placeholder.svg +0 -13
- package/src/components/primitives/avatar.stories.tsx +0 -72
- package/src/components/primitives/avatar.tsx +0 -136
- package/src/components/primitives/badge.stories.tsx +0 -43
- package/src/components/primitives/badge.tsx +0 -43
- package/src/components/primitives/button.stories.tsx +0 -113
- package/src/components/primitives/button.tsx +0 -131
- package/src/components/primitives/card.stories.tsx +0 -59
- package/src/components/primitives/card.tsx +0 -66
- package/src/components/primitives/segmented-control.stories.tsx +0 -54
- package/src/components/primitives/segmented-control.tsx +0 -73
- package/src/components/primitives/separator.stories.tsx +0 -34
- package/src/components/primitives/separator.tsx +0 -27
- package/src/constants/chart-colors.ts +0 -39
- package/src/env.d.ts +0 -9
- package/src/hooks/use-api-client.ts +0 -122
- package/src/hooks/use-debounced-value.ts +0 -12
- package/src/hooks/use-derived-filter-state.ts +0 -70
- package/src/hooks/use-filter-state.ts +0 -66
- package/src/hooks/use-media-query.ts +0 -69
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/hooks/use-sort.ts +0 -20
- package/src/lib/auth.ts +0 -5
- package/src/lib/clipboard.ts +0 -8
- package/src/lib/utils.ts +0 -6
- package/src/native/components.tsx +0 -198
- package/src/native/theme.tsx +0 -69
- package/src/storybook/controls.ts +0 -117
- package/src/storybook/options.ts +0 -52
- package/src/styles/build.ts +0 -1
- package/src/styles/index.css +0 -423
- package/src/styles/nokia.css +0 -36
- package/src/styles/package.css +0 -3
- package/src/styles/tokens/chart-colors.stories.tsx +0 -189
- package/src/styles/tokens/color-systems.stories.tsx +0 -190
- package/src/styles/tokens/css-vars.ts +0 -15
- package/src/styles/tokens/generated/dark-class.css +0 -39
- package/src/styles/tokens/generated/dark.colors.generated.ts +0 -39
- package/src/styles/tokens/generated/dark.css +0 -39
- package/src/styles/tokens/generated/foundations.css +0 -149
- package/src/styles/tokens/generated/foundations.generated.ts +0 -454
- package/src/styles/tokens/generated/light.colors.generated.ts +0 -39
- package/src/styles/tokens/generated/light.css +0 -39
- package/src/styles/tokens/index.ts +0 -70
- package/src/styles/tokens/layout.stories.tsx +0 -50
- package/src/styles/tokens/scripts/check-foundations.mjs +0 -126
- package/src/styles/tokens/scripts/check-source.mjs +0 -53
- package/src/styles/tokens/source/dark.tokens.json +0 -138
- package/src/styles/tokens/source/foundations.tokens.json +0 -344
- package/src/styles/tokens/source/light.tokens.json +0 -138
- package/src/styles/tokens/style-dictionary.dark-class.json +0 -16
- package/src/styles/tokens/style-dictionary.dark-storybook.json +0 -16
- package/src/styles/tokens/style-dictionary.dark.json +0 -21
- package/src/styles/tokens/style-dictionary.foundations.json +0 -21
- package/src/styles/tokens/style-dictionary.light-storybook.json +0 -16
- package/src/styles/tokens/style-dictionary.light.json +0 -21
- package/src/styles/tokens/typography.stories.tsx +0 -157
- package/src/translations/en.ts +0 -34
- package/src/translations/index.ts +0 -32
- package/src/types/upload.ts +0 -42
- /package/{src/components/filters/index.ts → dist/components/filters/index.d.ts} +0 -0
- /package/{src/components/layout/index.ts → dist/components/layout/index.d.ts} +0 -0
- /package/{src/hooks/index.ts → dist/hooks/index.d.ts} +0 -0
- /package/{src/lib/index.ts → dist/lib/index.d.ts} +0 -0
- /package/{src/native/index.ts → dist/native/index.d.ts} +0 -0
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
|
|
5
|
-
const Table = React.forwardRef<HTMLTableElement, React.HTMLAttributes<HTMLTableElement>>(
|
|
6
|
-
({ className, ...props }, ref) => (
|
|
7
|
-
<div className="w-full overflow-auto">
|
|
8
|
-
<table ref={ref} className={cn("w-full caption-bottom text-sm", className)} {...props} />
|
|
9
|
-
</div>
|
|
10
|
-
),
|
|
11
|
-
);
|
|
12
|
-
Table.displayName = "Table";
|
|
13
|
-
|
|
14
|
-
const TableHeader = React.forwardRef<
|
|
15
|
-
HTMLTableSectionElement,
|
|
16
|
-
React.HTMLAttributes<HTMLTableSectionElement>
|
|
17
|
-
>(({ className, ...props }, ref) => (
|
|
18
|
-
<thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
|
|
19
|
-
));
|
|
20
|
-
TableHeader.displayName = "TableHeader";
|
|
21
|
-
|
|
22
|
-
const TableBody = React.forwardRef<
|
|
23
|
-
HTMLTableSectionElement,
|
|
24
|
-
React.HTMLAttributes<HTMLTableSectionElement>
|
|
25
|
-
>(({ className, ...props }, ref) => (
|
|
26
|
-
<tbody ref={ref} className={cn("[&_tr:last-child]:border-0", className)} {...props} />
|
|
27
|
-
));
|
|
28
|
-
TableBody.displayName = "TableBody";
|
|
29
|
-
|
|
30
|
-
const TableFooter = React.forwardRef<
|
|
31
|
-
HTMLTableSectionElement,
|
|
32
|
-
React.HTMLAttributes<HTMLTableSectionElement>
|
|
33
|
-
>(({ className, ...props }, ref) => (
|
|
34
|
-
<tfoot ref={ref} className={cn("bg-muted font-medium", className)} {...props} />
|
|
35
|
-
));
|
|
36
|
-
TableFooter.displayName = "TableFooter";
|
|
37
|
-
|
|
38
|
-
const TableRow = React.forwardRef<HTMLTableRowElement, React.HTMLAttributes<HTMLTableRowElement>>(
|
|
39
|
-
({ className, ...props }, ref) => (
|
|
40
|
-
<tr ref={ref} className={cn("data-[state=selected]:bg-muted border-b", className)} {...props} />
|
|
41
|
-
),
|
|
42
|
-
);
|
|
43
|
-
TableRow.displayName = "TableRow";
|
|
44
|
-
|
|
45
|
-
const TableHead = React.forwardRef<
|
|
46
|
-
HTMLTableCellElement,
|
|
47
|
-
React.ThHTMLAttributes<HTMLTableCellElement>
|
|
48
|
-
>(({ className, ...props }, ref) => (
|
|
49
|
-
<th
|
|
50
|
-
ref={ref}
|
|
51
|
-
className={cn(
|
|
52
|
-
"text-muted-foreground h-9 px-3 text-left align-middle text-xs font-medium [&:has([role=checkbox])]:pr-0",
|
|
53
|
-
className,
|
|
54
|
-
)}
|
|
55
|
-
{...props}
|
|
56
|
-
/>
|
|
57
|
-
));
|
|
58
|
-
TableHead.displayName = "TableHead";
|
|
59
|
-
|
|
60
|
-
const TableCell = React.forwardRef<
|
|
61
|
-
HTMLTableCellElement,
|
|
62
|
-
React.TdHTMLAttributes<HTMLTableCellElement>
|
|
63
|
-
>(({ className, ...props }, ref) => (
|
|
64
|
-
<td
|
|
65
|
-
ref={ref}
|
|
66
|
-
className={cn("px-3 py-2.5 align-middle [&:has([role=checkbox])]:pr-0", className)}
|
|
67
|
-
{...props}
|
|
68
|
-
/>
|
|
69
|
-
));
|
|
70
|
-
TableCell.displayName = "TableCell";
|
|
71
|
-
|
|
72
|
-
const TableCaption = React.forwardRef<
|
|
73
|
-
HTMLTableCaptionElement,
|
|
74
|
-
React.HTMLAttributes<HTMLTableCaptionElement>
|
|
75
|
-
>(({ className, ...props }, ref) => (
|
|
76
|
-
<caption ref={ref} className={cn("text-muted-foreground mt-4 text-sm", className)} {...props} />
|
|
77
|
-
));
|
|
78
|
-
TableCaption.displayName = "TableCaption";
|
|
79
|
-
|
|
80
|
-
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { AlertCircle, Info, Terminal } from "lucide-react";
|
|
3
|
-
|
|
4
|
-
import { Alert, AlertDescription, AlertTitle } from "./alert";
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: "Feedback/Alert",
|
|
8
|
-
component: Alert,
|
|
9
|
-
tags: ["autodocs"],
|
|
10
|
-
} satisfies Meta<typeof Alert>;
|
|
11
|
-
|
|
12
|
-
export default meta;
|
|
13
|
-
type Story = StoryObj<typeof meta>;
|
|
14
|
-
|
|
15
|
-
export const Default: Story = {
|
|
16
|
-
render: () => (
|
|
17
|
-
<Alert>
|
|
18
|
-
<Terminal className="size-4" />
|
|
19
|
-
<AlertTitle>Heads up!</AlertTitle>
|
|
20
|
-
<AlertDescription>You can add components to your app using the cli.</AlertDescription>
|
|
21
|
-
</Alert>
|
|
22
|
-
),
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const Destructive: Story = {
|
|
26
|
-
render: () => (
|
|
27
|
-
<Alert variant="destructive">
|
|
28
|
-
<AlertCircle className="size-4" />
|
|
29
|
-
<AlertTitle>Error</AlertTitle>
|
|
30
|
-
<AlertDescription>Your session has expired. Please log in again.</AlertDescription>
|
|
31
|
-
</Alert>
|
|
32
|
-
),
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const WithoutIcon: Story = {
|
|
36
|
-
render: () => (
|
|
37
|
-
<Alert>
|
|
38
|
-
<AlertTitle>Note</AlertTitle>
|
|
39
|
-
<AlertDescription>This alert has no icon.</AlertDescription>
|
|
40
|
-
</Alert>
|
|
41
|
-
),
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const DescriptionOnly: Story = {
|
|
45
|
-
render: () => (
|
|
46
|
-
<Alert>
|
|
47
|
-
<Info className="size-4" />
|
|
48
|
-
<AlertDescription>A simple informational message without a title.</AlertDescription>
|
|
49
|
-
</Alert>
|
|
50
|
-
),
|
|
51
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
|
|
6
|
-
const alertVariants = cva(
|
|
7
|
-
"relative w-full rounded-md border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default: "bg-card text-card-foreground",
|
|
12
|
-
destructive:
|
|
13
|
-
"border-destructive text-destructive-text bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive-text",
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
defaultVariants: {
|
|
17
|
-
variant: "default",
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
function Alert({
|
|
23
|
-
className,
|
|
24
|
-
variant,
|
|
25
|
-
...props
|
|
26
|
-
}: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
|
|
27
|
-
return (
|
|
28
|
-
<div
|
|
29
|
-
data-slot="alert"
|
|
30
|
-
role="alert"
|
|
31
|
-
className={cn(alertVariants({ variant }), className)}
|
|
32
|
-
{...props}
|
|
33
|
-
/>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
38
|
-
return (
|
|
39
|
-
<h2
|
|
40
|
-
data-slot="alert-title"
|
|
41
|
-
className={cn("col-start-2 line-clamp-1 min-h-4 text-sm font-medium", className)}
|
|
42
|
-
{...props}
|
|
43
|
-
>
|
|
44
|
-
{props.children}
|
|
45
|
-
</h2>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function AlertDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
50
|
-
return (
|
|
51
|
-
<div
|
|
52
|
-
data-slot="alert-description"
|
|
53
|
-
className={cn(
|
|
54
|
-
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
|
55
|
-
className,
|
|
56
|
-
)}
|
|
57
|
-
{...props}
|
|
58
|
-
>
|
|
59
|
-
{props.children}
|
|
60
|
-
</div>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
|
|
5
|
-
export interface EmptyStateProps {
|
|
6
|
-
icon?: ReactNode;
|
|
7
|
-
title: ReactNode;
|
|
8
|
-
description?: ReactNode;
|
|
9
|
-
action?: ReactNode;
|
|
10
|
-
children?: ReactNode;
|
|
11
|
-
className?: string;
|
|
12
|
-
layout?: "centered" | "inline";
|
|
13
|
-
size?: "md" | "lg";
|
|
14
|
-
variant?: "default" | "dashed" | "quiet" | "search";
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* EmptyState communicates an absence of content and gives the host application
|
|
19
|
-
* room for an optional next action. Domain copy and recovery behavior stay with
|
|
20
|
-
* the calling feature.
|
|
21
|
-
*/
|
|
22
|
-
export function EmptyState({
|
|
23
|
-
icon,
|
|
24
|
-
title,
|
|
25
|
-
description,
|
|
26
|
-
action,
|
|
27
|
-
children,
|
|
28
|
-
className,
|
|
29
|
-
layout = "centered",
|
|
30
|
-
size = "md",
|
|
31
|
-
variant = "default",
|
|
32
|
-
}: EmptyStateProps) {
|
|
33
|
-
const centered = layout === "centered";
|
|
34
|
-
const large = size === "lg";
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<section
|
|
38
|
-
className={cn(
|
|
39
|
-
"rounded-lg px-5 py-8",
|
|
40
|
-
variant === "default" && "bg-card border",
|
|
41
|
-
variant === "dashed" && "bg-card border border-dashed",
|
|
42
|
-
variant === "search" && "bg-muted border border-dashed",
|
|
43
|
-
variant === "quiet" && "bg-card",
|
|
44
|
-
centered
|
|
45
|
-
? cn(
|
|
46
|
-
"flex flex-col items-center justify-center text-center",
|
|
47
|
-
large ? "min-h-80 px-6 py-10" : "min-h-64",
|
|
48
|
-
)
|
|
49
|
-
: "flex flex-col gap-3",
|
|
50
|
-
className,
|
|
51
|
-
)}
|
|
52
|
-
>
|
|
53
|
-
{icon ? (
|
|
54
|
-
<div
|
|
55
|
-
className="text-muted-foreground mb-3 flex size-11 items-center justify-center"
|
|
56
|
-
aria-hidden
|
|
57
|
-
>
|
|
58
|
-
{icon}
|
|
59
|
-
</div>
|
|
60
|
-
) : null}
|
|
61
|
-
<div className={cn("space-y-2", centered && "max-w-[34ch]")}>
|
|
62
|
-
<h2
|
|
63
|
-
className={cn(
|
|
64
|
-
"text-foreground font-semibold tracking-tight",
|
|
65
|
-
large ? "text-lg" : "text-base",
|
|
66
|
-
)}
|
|
67
|
-
>
|
|
68
|
-
{title}
|
|
69
|
-
</h2>
|
|
70
|
-
{description ? <p className="text-muted-foreground text-sm">{description}</p> : null}
|
|
71
|
-
</div>
|
|
72
|
-
{children ? <div className="mt-3">{children}</div> : null}
|
|
73
|
-
{action ? <div className="mt-4">{action}</div> : null}
|
|
74
|
-
</section>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import { Progress } from "./progress";
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: "Feedback/Progress",
|
|
7
|
-
component: Progress,
|
|
8
|
-
tags: ["autodocs"],
|
|
9
|
-
} satisfies Meta<typeof Progress>;
|
|
10
|
-
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof meta>;
|
|
13
|
-
|
|
14
|
-
export const Default: Story = {
|
|
15
|
-
args: {
|
|
16
|
-
value: 60,
|
|
17
|
-
"aria-label": "Upload progress",
|
|
18
|
-
},
|
|
19
|
-
render: (args) => (
|
|
20
|
-
<div className="w-64">
|
|
21
|
-
<Progress {...args} />
|
|
22
|
-
</div>
|
|
23
|
-
),
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const Empty: Story = {
|
|
27
|
-
args: { value: 0, "aria-label": "Upload progress" },
|
|
28
|
-
render: (args) => (
|
|
29
|
-
<div className="w-64">
|
|
30
|
-
<Progress {...args} />
|
|
31
|
-
</div>
|
|
32
|
-
),
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const Complete: Story = {
|
|
36
|
-
args: { value: 100, "aria-label": "Upload progress" },
|
|
37
|
-
render: (args) => (
|
|
38
|
-
<div className="w-64">
|
|
39
|
-
<Progress {...args} />
|
|
40
|
-
</div>
|
|
41
|
-
),
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const Partial: Story = {
|
|
45
|
-
args: { value: 60 },
|
|
46
|
-
render: () => (
|
|
47
|
-
<div className="flex w-64 flex-col gap-4">
|
|
48
|
-
<Progress value={10} aria-label="Upload progress" />
|
|
49
|
-
<Progress value={33} aria-label="Upload progress" />
|
|
50
|
-
<Progress value={66} aria-label="Upload progress" />
|
|
51
|
-
<Progress value={90} aria-label="Upload progress" />
|
|
52
|
-
</div>
|
|
53
|
-
),
|
|
54
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Progress as ProgressPrimitive } from "@base-ui/react/progress";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
|
|
6
|
-
function Progress({
|
|
7
|
-
className,
|
|
8
|
-
value,
|
|
9
|
-
indicatorClassName,
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof ProgressPrimitive.Root> & {
|
|
12
|
-
indicatorClassName?: string;
|
|
13
|
-
}) {
|
|
14
|
-
const isFilling = typeof value === "number" && value > 0 && value < 100;
|
|
15
|
-
return (
|
|
16
|
-
<ProgressPrimitive.Root
|
|
17
|
-
data-slot="progress"
|
|
18
|
-
className={cn("bg-muted relative h-2 w-full overflow-hidden rounded-full", className)}
|
|
19
|
-
value={value}
|
|
20
|
-
{...props}
|
|
21
|
-
>
|
|
22
|
-
<ProgressPrimitive.Indicator
|
|
23
|
-
data-slot="progress-indicator"
|
|
24
|
-
className={cn(
|
|
25
|
-
"bg-primary relative h-full w-full flex-1 overflow-hidden transition-transform duration-300 ease-out",
|
|
26
|
-
indicatorClassName,
|
|
27
|
-
)}
|
|
28
|
-
style={{ transform: `translateX(-${100 - (value ?? 0)}%)` }}
|
|
29
|
-
>
|
|
30
|
-
{isFilling && (
|
|
31
|
-
<span
|
|
32
|
-
aria-hidden
|
|
33
|
-
className="animate-progress-shimmer absolute inset-0 bg-[linear-gradient(90deg,transparent_35%,rgba(255,255,255,0.75)_50%,transparent_65%)]"
|
|
34
|
-
/>
|
|
35
|
-
)}
|
|
36
|
-
</ProgressPrimitive.Indicator>
|
|
37
|
-
</ProgressPrimitive.Root>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export { Progress };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import { Skeleton } from "./skeleton";
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: "Feedback/Skeleton",
|
|
7
|
-
component: Skeleton,
|
|
8
|
-
tags: ["autodocs"],
|
|
9
|
-
} satisfies Meta<typeof Skeleton>;
|
|
10
|
-
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof meta>;
|
|
13
|
-
|
|
14
|
-
export const Default: Story = {
|
|
15
|
-
render: () => <Skeleton className="h-4 w-48" />,
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const TextLines: Story = {
|
|
19
|
-
render: () => (
|
|
20
|
-
<div className="w-64 space-y-2">
|
|
21
|
-
<Skeleton className="h-4 w-full" />
|
|
22
|
-
<Skeleton className="h-4 w-5/6" />
|
|
23
|
-
<Skeleton className="h-4 w-2/3" />
|
|
24
|
-
</div>
|
|
25
|
-
),
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const CardShape: Story = {
|
|
29
|
-
render: () => (
|
|
30
|
-
<div className="w-64 space-y-3">
|
|
31
|
-
<Skeleton className="h-32 w-full" />
|
|
32
|
-
<Skeleton className="h-4 w-3/4" />
|
|
33
|
-
<Skeleton className="h-4 w-1/2" />
|
|
34
|
-
</div>
|
|
35
|
-
),
|
|
36
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import { textControl } from "../../storybook/controls";
|
|
4
|
-
import { Spinner } from "./spinner";
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: "Feedback/Spinner",
|
|
8
|
-
component: Spinner,
|
|
9
|
-
tags: ["autodocs"],
|
|
10
|
-
argTypes: {
|
|
11
|
-
label: textControl("Visible + accessible label; pass false to hide the text", "Loading"),
|
|
12
|
-
},
|
|
13
|
-
} satisfies Meta<typeof Spinner>;
|
|
14
|
-
|
|
15
|
-
export default meta;
|
|
16
|
-
type Story = StoryObj<typeof meta>;
|
|
17
|
-
|
|
18
|
-
export const Default: Story = {
|
|
19
|
-
args: {
|
|
20
|
-
label: false,
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const CustomLabel: Story = {
|
|
25
|
-
args: {
|
|
26
|
-
label: "Fetching results…",
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const NoLabel: Story = {
|
|
31
|
-
args: {
|
|
32
|
-
label: false,
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const Centered: Story = {
|
|
37
|
-
args: {
|
|
38
|
-
label: "Loading",
|
|
39
|
-
presentation: "centered",
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const Sizes: Story = {
|
|
44
|
-
render: () => (
|
|
45
|
-
<div className="flex items-center gap-4">
|
|
46
|
-
<Spinner size="sm" />
|
|
47
|
-
<Spinner size="md" />
|
|
48
|
-
<Spinner size="lg" />
|
|
49
|
-
<Spinner size="xl" />
|
|
50
|
-
</div>
|
|
51
|
-
),
|
|
52
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
|
|
5
|
-
const sizeClasses = {
|
|
6
|
-
sm: "size-4",
|
|
7
|
-
md: "size-5",
|
|
8
|
-
lg: "size-8",
|
|
9
|
-
xl: "size-12",
|
|
10
|
-
} as const;
|
|
11
|
-
|
|
12
|
-
export interface SpinnerProps extends React.ComponentProps<"output"> {
|
|
13
|
-
label?: string | false;
|
|
14
|
-
presentation?: "inline" | "centered";
|
|
15
|
-
size?: keyof typeof sizeClasses;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function Spinner({
|
|
19
|
-
label = false,
|
|
20
|
-
presentation = "inline",
|
|
21
|
-
size = "md",
|
|
22
|
-
className,
|
|
23
|
-
...props
|
|
24
|
-
}: SpinnerProps) {
|
|
25
|
-
const accessibleLabel = typeof label === "string" ? label : "Loading";
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<output
|
|
29
|
-
className={cn(
|
|
30
|
-
"inline-flex items-center justify-center gap-2",
|
|
31
|
-
presentation === "centered" && "flex w-full py-12",
|
|
32
|
-
className,
|
|
33
|
-
)}
|
|
34
|
-
aria-label={accessibleLabel}
|
|
35
|
-
{...props}
|
|
36
|
-
>
|
|
37
|
-
<span
|
|
38
|
-
className={cn(
|
|
39
|
-
"border-border border-t-primary rounded-full border-2 motion-safe:animate-spin",
|
|
40
|
-
sizeClasses[size],
|
|
41
|
-
)}
|
|
42
|
-
aria-hidden="true"
|
|
43
|
-
/>
|
|
44
|
-
{label && <span className="text-muted-foreground text-xs">{label}</span>}
|
|
45
|
-
</output>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import { UpdateGuard } from "./update-guard";
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: "Feedback/UpdateGuard",
|
|
7
|
-
component: UpdateGuard,
|
|
8
|
-
tags: ["autodocs"],
|
|
9
|
-
parameters: {
|
|
10
|
-
docs: {
|
|
11
|
-
description: {
|
|
12
|
-
component:
|
|
13
|
-
"Surfaces an update-available notification. Service-worker registration and update activation are owned by the consuming application.",
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
} satisfies Meta<typeof UpdateGuard>;
|
|
18
|
-
|
|
19
|
-
export default meta;
|
|
20
|
-
type Story = StoryObj<typeof meta>;
|
|
21
|
-
|
|
22
|
-
export const Default: Story = {
|
|
23
|
-
args: {
|
|
24
|
-
needRefresh: true,
|
|
25
|
-
onRefresh: () => undefined,
|
|
26
|
-
onDismiss: () => undefined,
|
|
27
|
-
},
|
|
28
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { LucideRefreshCcw, LucideX } from "lucide-react";
|
|
2
|
-
|
|
3
|
-
export interface UpdateGuardCopy {
|
|
4
|
-
newContentAvailable?: string;
|
|
5
|
-
refreshButton?: string;
|
|
6
|
-
closeButton?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface UpdateGuardProps {
|
|
10
|
-
needRefresh: boolean;
|
|
11
|
-
onRefresh: () => void;
|
|
12
|
-
onDismiss?: () => void;
|
|
13
|
-
copyText?: string;
|
|
14
|
-
refreshText?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function UpdateGuard({
|
|
18
|
-
needRefresh,
|
|
19
|
-
onRefresh,
|
|
20
|
-
onDismiss,
|
|
21
|
-
copyText = "New content available",
|
|
22
|
-
refreshText = "Refresh",
|
|
23
|
-
}: UpdateGuardProps) {
|
|
24
|
-
if (!needRefresh) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<output
|
|
30
|
-
aria-live="polite"
|
|
31
|
-
aria-atomic="true"
|
|
32
|
-
className="fixed inset-x-0 bottom-0 z-50 flex justify-center px-4"
|
|
33
|
-
>
|
|
34
|
-
<div className="border-border bg-card flex items-center gap-3 rounded-md border px-4 py-2">
|
|
35
|
-
<span className="text-foreground text-sm">{copyText}</span>
|
|
36
|
-
<button
|
|
37
|
-
type="button"
|
|
38
|
-
aria-label={refreshText}
|
|
39
|
-
onClick={onRefresh}
|
|
40
|
-
className="text-accent-text font-semibold border-muted-foreground rounded-md border px-2 py-1 hover:bg-accent hover:text-accent-foreground"
|
|
41
|
-
>
|
|
42
|
-
<LucideRefreshCcw className="size-4" />
|
|
43
|
-
</button>
|
|
44
|
-
{onDismiss ? (
|
|
45
|
-
<button
|
|
46
|
-
aria-label="Close"
|
|
47
|
-
type="button"
|
|
48
|
-
onClick={onDismiss}
|
|
49
|
-
className="text-accent-text font-semibold border-muted-foreground rounded-md border px-2 py-1 hover:bg-accent hover:text-accent-foreground"
|
|
50
|
-
>
|
|
51
|
-
<LucideX className="size-4" />
|
|
52
|
-
</button>
|
|
53
|
-
) : null}
|
|
54
|
-
</div>
|
|
55
|
-
</output>
|
|
56
|
-
);
|
|
57
|
-
}
|