@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ponti-studios/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Shared UI component library for Ponti Studios",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,74 +12,91 @@
|
|
|
12
12
|
"create-ponti-project": "./scripts/create-project.mjs"
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
|
-
"
|
|
16
|
-
"
|
|
15
|
+
"dist",
|
|
16
|
+
"src/styles/animations.css",
|
|
17
17
|
"scripts/create-project.mjs",
|
|
18
18
|
"templates/web-vite",
|
|
19
|
-
"THIRD_PARTY_NOTICES.md"
|
|
19
|
+
"THIRD_PARTY_NOTICES.md",
|
|
20
|
+
"!dist/styles-build.js",
|
|
21
|
+
"!dist/package-index.d.ts",
|
|
22
|
+
"!dist/storybook/**",
|
|
23
|
+
"!dist/styles/build.d.ts"
|
|
20
24
|
],
|
|
21
25
|
"type": "module",
|
|
22
26
|
"sideEffects": [
|
|
27
|
+
"./dist/index.js",
|
|
23
28
|
"./dist/styles.css",
|
|
24
29
|
"./src/styles/animations.css"
|
|
25
30
|
],
|
|
26
31
|
"exports": {
|
|
27
32
|
".": {
|
|
28
|
-
"types": "./
|
|
29
|
-
"import": "./
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.js"
|
|
30
35
|
},
|
|
31
36
|
"./primitives": {
|
|
32
|
-
"types": "./
|
|
33
|
-
"import": "./
|
|
37
|
+
"types": "./dist/components/primitives/index.d.ts",
|
|
38
|
+
"import": "./dist/components/primitives/index.js"
|
|
34
39
|
},
|
|
35
40
|
"./forms": {
|
|
36
|
-
"types": "./
|
|
37
|
-
"import": "./
|
|
41
|
+
"types": "./dist/components/forms/index.d.ts",
|
|
42
|
+
"import": "./dist/components/forms/index.js"
|
|
38
43
|
},
|
|
39
44
|
"./feedback": {
|
|
40
|
-
"types": "./
|
|
41
|
-
"import": "./
|
|
45
|
+
"types": "./dist/components/feedback/index.d.ts",
|
|
46
|
+
"import": "./dist/components/feedback/index.js"
|
|
42
47
|
},
|
|
43
48
|
"./filters": {
|
|
44
|
-
"types": "./
|
|
45
|
-
"import": "./
|
|
49
|
+
"types": "./dist/components/filters/index.d.ts",
|
|
50
|
+
"import": "./dist/components/filters/index.js"
|
|
46
51
|
},
|
|
47
52
|
"./overlays": {
|
|
48
|
-
"types": "./
|
|
49
|
-
"import": "./
|
|
53
|
+
"types": "./dist/components/overlays/index.d.ts",
|
|
54
|
+
"import": "./dist/components/overlays/index.js"
|
|
50
55
|
},
|
|
51
56
|
"./navigation": {
|
|
52
|
-
"types": "./
|
|
53
|
-
"import": "./
|
|
57
|
+
"types": "./dist/components/navigation/index.d.ts",
|
|
58
|
+
"import": "./dist/components/navigation/index.js"
|
|
54
59
|
},
|
|
55
60
|
"./data-display": {
|
|
56
|
-
"types": "./
|
|
57
|
-
"import": "./
|
|
61
|
+
"types": "./dist/components/data-display/index.d.ts",
|
|
62
|
+
"import": "./dist/components/data-display/index.js"
|
|
58
63
|
},
|
|
59
64
|
"./layout": {
|
|
60
|
-
"types": "./
|
|
61
|
-
"import": "./
|
|
65
|
+
"types": "./dist/components/layout/index.d.ts",
|
|
66
|
+
"import": "./dist/components/layout/index.js"
|
|
62
67
|
},
|
|
63
68
|
"./utilities": {
|
|
64
|
-
"types": "./
|
|
65
|
-
"import": "./
|
|
69
|
+
"types": "./dist/lib/index.d.ts",
|
|
70
|
+
"import": "./dist/lib/index.js"
|
|
66
71
|
},
|
|
67
72
|
"./tokens": {
|
|
68
|
-
"types": "./
|
|
69
|
-
"import": "./
|
|
73
|
+
"types": "./dist/styles/tokens/index.d.ts",
|
|
74
|
+
"import": "./dist/styles/tokens/index.js"
|
|
70
75
|
},
|
|
71
76
|
"./tokens/css-vars": {
|
|
72
|
-
"types": "./
|
|
73
|
-
"import": "./
|
|
77
|
+
"types": "./dist/styles/tokens/css-vars.d.ts",
|
|
78
|
+
"import": "./dist/styles/tokens/css-vars.js"
|
|
74
79
|
},
|
|
75
80
|
"./native": {
|
|
76
|
-
"types": "./
|
|
77
|
-
"react-native": "./
|
|
78
|
-
"import": "./
|
|
81
|
+
"types": "./dist/native/index.d.ts",
|
|
82
|
+
"react-native": "./dist/native/index.js",
|
|
83
|
+
"import": "./dist/native/index.js"
|
|
79
84
|
},
|
|
80
85
|
"./hooks": {
|
|
81
|
-
"types": "./
|
|
82
|
-
"import": "./
|
|
86
|
+
"types": "./dist/hooks/index.d.ts",
|
|
87
|
+
"import": "./dist/hooks/index.js"
|
|
88
|
+
},
|
|
89
|
+
"./auth": {
|
|
90
|
+
"types": "./dist/auth/index.d.ts",
|
|
91
|
+
"import": "./dist/auth/index.js"
|
|
92
|
+
},
|
|
93
|
+
"./integrations/service-worker": {
|
|
94
|
+
"types": "./dist/integrations/service-worker.d.ts",
|
|
95
|
+
"import": "./dist/integrations/service-worker.js"
|
|
96
|
+
},
|
|
97
|
+
"./translations": {
|
|
98
|
+
"types": "./dist/translations/ui-provider.d.ts",
|
|
99
|
+
"import": "./dist/translations/ui-provider.js"
|
|
83
100
|
},
|
|
84
101
|
"./styles.css": "./dist/styles.css",
|
|
85
102
|
"./animations.css": "./src/styles/animations.css"
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./accordion";
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: "DataDisplay/Accordion",
|
|
7
|
-
component: Accordion,
|
|
8
|
-
tags: ["autodocs"],
|
|
9
|
-
args: {
|
|
10
|
-
type: "single",
|
|
11
|
-
},
|
|
12
|
-
} satisfies Meta<typeof Accordion>;
|
|
13
|
-
|
|
14
|
-
export default meta;
|
|
15
|
-
type Story = StoryObj<typeof meta>;
|
|
16
|
-
|
|
17
|
-
export const Default: Story = {
|
|
18
|
-
render: () => (
|
|
19
|
-
<Accordion type="single" collapsible className="w-full">
|
|
20
|
-
<AccordionItem value="item-1">
|
|
21
|
-
<AccordionTrigger>Is it accessible?</AccordionTrigger>
|
|
22
|
-
<AccordionContent>Yes. It adheres to the WAI-ARIA design pattern.</AccordionContent>
|
|
23
|
-
</AccordionItem>
|
|
24
|
-
<AccordionItem value="item-2">
|
|
25
|
-
<AccordionTrigger>Is it styled?</AccordionTrigger>
|
|
26
|
-
<AccordionContent>
|
|
27
|
-
Yes. It comes with default styles that match the other components.
|
|
28
|
-
</AccordionContent>
|
|
29
|
-
</AccordionItem>
|
|
30
|
-
<AccordionItem value="item-3">
|
|
31
|
-
<AccordionTrigger>Is it animated?</AccordionTrigger>
|
|
32
|
-
<AccordionContent>
|
|
33
|
-
Yes. It's animated by default, but you can disable it if you prefer.
|
|
34
|
-
</AccordionContent>
|
|
35
|
-
</AccordionItem>
|
|
36
|
-
</Accordion>
|
|
37
|
-
),
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const Multiple: Story = {
|
|
41
|
-
render: () => (
|
|
42
|
-
<Accordion type="multiple" className="w-full max-w-md">
|
|
43
|
-
<AccordionItem value="item-1">
|
|
44
|
-
<AccordionTrigger>First item</AccordionTrigger>
|
|
45
|
-
<AccordionContent>Content for the first item.</AccordionContent>
|
|
46
|
-
</AccordionItem>
|
|
47
|
-
<AccordionItem value="item-2">
|
|
48
|
-
<AccordionTrigger>Second item</AccordionTrigger>
|
|
49
|
-
<AccordionContent>Content for the second item.</AccordionContent>
|
|
50
|
-
</AccordionItem>
|
|
51
|
-
<AccordionItem value="item-3">
|
|
52
|
-
<AccordionTrigger>Third item</AccordionTrigger>
|
|
53
|
-
<AccordionContent>Content for the third item.</AccordionContent>
|
|
54
|
-
</AccordionItem>
|
|
55
|
-
</Accordion>
|
|
56
|
-
),
|
|
57
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion";
|
|
2
|
-
import { ChevronDown } from "lucide-react";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
function Accordion({
|
|
8
|
-
type,
|
|
9
|
-
collapsible = true,
|
|
10
|
-
className,
|
|
11
|
-
onValueChange,
|
|
12
|
-
...props
|
|
13
|
-
}: React.ComponentProps<typeof AccordionPrimitive.Root> & {
|
|
14
|
-
type?: "single" | "multiple";
|
|
15
|
-
collapsible?: boolean;
|
|
16
|
-
}) {
|
|
17
|
-
return (
|
|
18
|
-
<AccordionPrimitive.Root
|
|
19
|
-
data-slot="accordion"
|
|
20
|
-
multiple={type === "multiple"}
|
|
21
|
-
onValueChange={(value, details) => {
|
|
22
|
-
if (type !== "multiple" && !collapsible && value.length === 0) {
|
|
23
|
-
details.cancel();
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
onValueChange?.(value, details);
|
|
28
|
-
}}
|
|
29
|
-
{...props}
|
|
30
|
-
className={cn("w-full", className)}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function AccordionItem({
|
|
36
|
-
className,
|
|
37
|
-
...props
|
|
38
|
-
}: React.ComponentProps<typeof AccordionPrimitive.Item>) {
|
|
39
|
-
return (
|
|
40
|
-
<AccordionPrimitive.Item
|
|
41
|
-
data-slot="accordion-item"
|
|
42
|
-
className={cn("mb-2 overflow-hidden rounded-md border last:mb-0", className)}
|
|
43
|
-
{...props}
|
|
44
|
-
/>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function AccordionTrigger({
|
|
49
|
-
className,
|
|
50
|
-
children,
|
|
51
|
-
...props
|
|
52
|
-
}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
|
|
53
|
-
return (
|
|
54
|
-
<AccordionPrimitive.Header className="flex">
|
|
55
|
-
<AccordionPrimitive.Trigger
|
|
56
|
-
data-slot="accordion-trigger"
|
|
57
|
-
className={cn(
|
|
58
|
-
"text-muted-foreground flex w-full flex-1 items-center justify-between gap-4 px-4 py-3 text-left text-sm font-semibold disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
59
|
-
className,
|
|
60
|
-
)}
|
|
61
|
-
{...props}
|
|
62
|
-
>
|
|
63
|
-
{children}
|
|
64
|
-
<ChevronDown className="pointer-events-none size-4 shrink-0 transition-transform duration-200" />
|
|
65
|
-
</AccordionPrimitive.Trigger>
|
|
66
|
-
</AccordionPrimitive.Header>
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function AccordionContent({
|
|
71
|
-
className,
|
|
72
|
-
children,
|
|
73
|
-
...props
|
|
74
|
-
}: React.ComponentProps<typeof AccordionPrimitive.Panel>) {
|
|
75
|
-
return (
|
|
76
|
-
<AccordionPrimitive.Panel
|
|
77
|
-
data-slot="accordion-content"
|
|
78
|
-
className="animate-accordion-down overflow-hidden text-sm"
|
|
79
|
-
{...props}
|
|
80
|
-
>
|
|
81
|
-
<div className={cn("px-4 pt-2 pb-3", className)}>{children}</div>
|
|
82
|
-
</AccordionPrimitive.Panel>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import { MetricCard } from "./metric-card";
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: "DataDisplay/MetricCard",
|
|
7
|
-
component: MetricCard,
|
|
8
|
-
tags: ["autodocs"],
|
|
9
|
-
} satisfies Meta<typeof MetricCard>;
|
|
10
|
-
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof meta>;
|
|
13
|
-
|
|
14
|
-
export const Default: Story = {
|
|
15
|
-
args: {
|
|
16
|
-
label: "Net worth",
|
|
17
|
-
value: "$48,210",
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const WithChange: Story = {
|
|
22
|
-
args: {
|
|
23
|
-
label: "Monthly spend",
|
|
24
|
-
value: "$3,120",
|
|
25
|
-
change: "+4.2% vs last month",
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const Empty: Story = {
|
|
30
|
-
args: {
|
|
31
|
-
label: "Runway",
|
|
32
|
-
value: undefined,
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const Grid: Story = {
|
|
37
|
-
args: {
|
|
38
|
-
label: "Net worth",
|
|
39
|
-
value: "$48,210",
|
|
40
|
-
},
|
|
41
|
-
render: () => (
|
|
42
|
-
<div className="grid w-[520px] grid-cols-3 gap-3">
|
|
43
|
-
<MetricCard label="Net worth" value="$48,210" change="+2.1%" />
|
|
44
|
-
<MetricCard label="Income" value="$6,400" />
|
|
45
|
-
<MetricCard label="Expenses" value="$3,120" change="-1.4%" />
|
|
46
|
-
</div>
|
|
47
|
-
),
|
|
48
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
|
|
5
|
-
interface MetricCardProps extends ComponentProps<"div"> {
|
|
6
|
-
label: string;
|
|
7
|
-
value: ReactNode;
|
|
8
|
-
change?: ReactNode;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/** Label/value/change stat tile. */
|
|
12
|
-
export function MetricCard({ label, value, change, className, ...props }: MetricCardProps) {
|
|
13
|
-
return (
|
|
14
|
-
<div className={cn("ui-flat-card", className)} {...props}>
|
|
15
|
-
<p className="ui-data-label mb-2">{label}</p>
|
|
16
|
-
<p className="ui-data-value">{value ?? "—"}</p>
|
|
17
|
-
{change != null ? <p className="text-muted-foreground mt-1.5 text-xs">{change}</p> : null}
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
|
|
4
|
-
import type { SortOption } from "../../hooks/sort.types";
|
|
5
|
-
import { SortControls } from "./sort-controls";
|
|
6
|
-
|
|
7
|
-
const meta = {
|
|
8
|
-
title: "DataDisplay/SortControls",
|
|
9
|
-
component: SortControls,
|
|
10
|
-
tags: ["autodocs"],
|
|
11
|
-
} satisfies Meta<typeof SortControls>;
|
|
12
|
-
|
|
13
|
-
export default meta;
|
|
14
|
-
type Story = StoryObj<typeof meta>;
|
|
15
|
-
|
|
16
|
-
const sortableFields = ["amount", "date", "description", "category"];
|
|
17
|
-
|
|
18
|
-
function SortControlsPreview() {
|
|
19
|
-
const [sortOptions, setSortOptions] = useState<SortOption[]>([
|
|
20
|
-
{ field: "date", direction: "desc" },
|
|
21
|
-
]);
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<SortControls
|
|
25
|
-
sortOptions={sortOptions}
|
|
26
|
-
sortableFields={sortableFields}
|
|
27
|
-
addSortOption={(option) => setSortOptions((prev) => [...prev, option])}
|
|
28
|
-
updateSortOption={(index, option) =>
|
|
29
|
-
setSortOptions((prev) => prev.map((o, i) => (i === index ? option : o)))
|
|
30
|
-
}
|
|
31
|
-
removeSortOption={(index) => setSortOptions((prev) => prev.filter((_, i) => i !== index))}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export const Default: Story = {
|
|
37
|
-
args: {
|
|
38
|
-
sortOptions: [],
|
|
39
|
-
sortableFields,
|
|
40
|
-
addSortOption: () => {},
|
|
41
|
-
updateSortOption: () => {},
|
|
42
|
-
removeSortOption: () => {},
|
|
43
|
-
},
|
|
44
|
-
render: () => <SortControlsPreview />,
|
|
45
|
-
};
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { ListOrdered, PlusCircle } from "lucide-react";
|
|
2
|
-
|
|
3
|
-
import type { SortField, SortOption } from "../../hooks/sort.types";
|
|
4
|
-
import {
|
|
5
|
-
DropdownMenu,
|
|
6
|
-
DropdownMenuContent,
|
|
7
|
-
DropdownMenuGroup,
|
|
8
|
-
DropdownMenuLabel,
|
|
9
|
-
DropdownMenuSeparator,
|
|
10
|
-
DropdownMenuTrigger,
|
|
11
|
-
} from "../overlays/dropdown-menu";
|
|
12
|
-
import { Button } from "../primitives/button";
|
|
13
|
-
import { SortRow } from "./sort-row";
|
|
14
|
-
|
|
15
|
-
export interface SortControlsProps {
|
|
16
|
-
sortOptions: SortOption[];
|
|
17
|
-
sortableFields: SortField[];
|
|
18
|
-
addSortOption: (option: SortOption) => void;
|
|
19
|
-
updateSortOption: (index: number, option: SortOption) => void;
|
|
20
|
-
removeSortOption: (index: number) => void;
|
|
21
|
-
open?: boolean | undefined;
|
|
22
|
-
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
23
|
-
focusedSortIndex?: (number | null) | undefined;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/** Multi-field sort builder, driven by the `SortOption`/`SortField` shared types. */
|
|
27
|
-
export function SortControls({
|
|
28
|
-
sortOptions,
|
|
29
|
-
sortableFields,
|
|
30
|
-
addSortOption,
|
|
31
|
-
updateSortOption,
|
|
32
|
-
removeSortOption,
|
|
33
|
-
open,
|
|
34
|
-
onOpenChange,
|
|
35
|
-
focusedSortIndex,
|
|
36
|
-
}: SortControlsProps) {
|
|
37
|
-
const availableFieldsToAdd = sortableFields.filter(
|
|
38
|
-
(field) => !sortOptions.some((option) => option.field === field),
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<DropdownMenu {...(open !== undefined && { open })} {...(onOpenChange && { onOpenChange })}>
|
|
43
|
-
<DropdownMenuTrigger asChild>
|
|
44
|
-
<Button variant="outline">
|
|
45
|
-
<ListOrdered className="mr-2 size-4" />
|
|
46
|
-
Sort
|
|
47
|
-
</Button>
|
|
48
|
-
</DropdownMenuTrigger>
|
|
49
|
-
<DropdownMenuContent className="w-80 space-y-2 p-2">
|
|
50
|
-
<DropdownMenuGroup className="space-y-1">
|
|
51
|
-
<DropdownMenuLabel>Define Sort Order</DropdownMenuLabel>
|
|
52
|
-
<DropdownMenuSeparator />
|
|
53
|
-
|
|
54
|
-
{sortOptions.map((sort, index) => {
|
|
55
|
-
const usedFields = sortOptions
|
|
56
|
-
.filter((_, i) => i !== index)
|
|
57
|
-
.map((option) => option.field);
|
|
58
|
-
return (
|
|
59
|
-
<div
|
|
60
|
-
key={sort.field}
|
|
61
|
-
className={`rounded-sm ${index === focusedSortIndex ? "bg-muted" : ""}`}
|
|
62
|
-
>
|
|
63
|
-
<SortRow
|
|
64
|
-
sortOption={sort}
|
|
65
|
-
index={index}
|
|
66
|
-
sortableFields={sortableFields}
|
|
67
|
-
usedFields={usedFields}
|
|
68
|
-
updateSortOption={updateSortOption}
|
|
69
|
-
removeSortOption={removeSortOption}
|
|
70
|
-
/>
|
|
71
|
-
</div>
|
|
72
|
-
);
|
|
73
|
-
})}
|
|
74
|
-
</DropdownMenuGroup>
|
|
75
|
-
{availableFieldsToAdd.length > 0 && (
|
|
76
|
-
<>
|
|
77
|
-
<DropdownMenuSeparator />
|
|
78
|
-
<button
|
|
79
|
-
type="button"
|
|
80
|
-
onClick={() => {
|
|
81
|
-
const firstAvailable = availableFieldsToAdd[0];
|
|
82
|
-
if (firstAvailable) {
|
|
83
|
-
addSortOption({ field: firstAvailable, direction: "desc" });
|
|
84
|
-
}
|
|
85
|
-
}}
|
|
86
|
-
className="hover:bg-muted focus-visible:ring-ring mt-1 flex w-full cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none focus-visible:ring-2 focus-visible:ring-offset-2"
|
|
87
|
-
>
|
|
88
|
-
<PlusCircle className="mr-2 size-4" />
|
|
89
|
-
Add Sort Criterion
|
|
90
|
-
</button>
|
|
91
|
-
</>
|
|
92
|
-
)}
|
|
93
|
-
</DropdownMenuContent>
|
|
94
|
-
</DropdownMenu>
|
|
95
|
-
);
|
|
96
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { ArrowDownWideNarrow, ArrowUpWideNarrow, X } from "lucide-react";
|
|
2
|
-
|
|
3
|
-
import type { SortField, SortOption } from "../../hooks/sort.types";
|
|
4
|
-
import {
|
|
5
|
-
DropdownMenu,
|
|
6
|
-
DropdownMenuContent,
|
|
7
|
-
DropdownMenuItem,
|
|
8
|
-
DropdownMenuTrigger,
|
|
9
|
-
} from "../overlays/dropdown-menu";
|
|
10
|
-
import { Button } from "../primitives/button";
|
|
11
|
-
|
|
12
|
-
export interface SortRowProps {
|
|
13
|
-
sortOption: SortOption;
|
|
14
|
-
index: number;
|
|
15
|
-
sortableFields: SortField[];
|
|
16
|
-
usedFields: SortField[];
|
|
17
|
-
updateSortOption: (index: number, option: SortOption) => void;
|
|
18
|
-
removeSortOption: (index: number) => void;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function fieldLabel(field: SortField) {
|
|
22
|
-
return field.charAt(0).toUpperCase() + field.slice(1);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function SortRow({
|
|
26
|
-
sortOption,
|
|
27
|
-
index,
|
|
28
|
-
sortableFields,
|
|
29
|
-
usedFields,
|
|
30
|
-
updateSortOption,
|
|
31
|
-
removeSortOption,
|
|
32
|
-
}: SortRowProps) {
|
|
33
|
-
const availableFieldsForCurrentSelect = sortableFields.filter(
|
|
34
|
-
(field) => !usedFields.includes(field) || field === sortOption.field,
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<div className="flex w-full items-center gap-1">
|
|
39
|
-
<DropdownMenu>
|
|
40
|
-
<DropdownMenuTrigger asChild>
|
|
41
|
-
<button
|
|
42
|
-
type="button"
|
|
43
|
-
className="hover:bg-muted focus-visible:ring-ring flex-1 rounded-md px-2 py-1.5 text-left text-sm outline-none focus-visible:ring-2 focus-visible:ring-offset-2"
|
|
44
|
-
>
|
|
45
|
-
{fieldLabel(sortOption.field)}
|
|
46
|
-
</button>
|
|
47
|
-
</DropdownMenuTrigger>
|
|
48
|
-
<DropdownMenuContent>
|
|
49
|
-
{availableFieldsForCurrentSelect.map((field) => (
|
|
50
|
-
<DropdownMenuItem
|
|
51
|
-
key={field}
|
|
52
|
-
onClick={() => updateSortOption(index, { ...sortOption, field })}
|
|
53
|
-
>
|
|
54
|
-
{fieldLabel(field)}
|
|
55
|
-
</DropdownMenuItem>
|
|
56
|
-
))}
|
|
57
|
-
</DropdownMenuContent>
|
|
58
|
-
</DropdownMenu>
|
|
59
|
-
<Button
|
|
60
|
-
variant="ghost"
|
|
61
|
-
size="sm"
|
|
62
|
-
className="size-8 p-0"
|
|
63
|
-
aria-label={sortOption.direction === "asc" ? "Sorted ascending" : "Sorted descending"}
|
|
64
|
-
onClick={() =>
|
|
65
|
-
updateSortOption(index, {
|
|
66
|
-
...sortOption,
|
|
67
|
-
direction: sortOption.direction === "asc" ? "desc" : "asc",
|
|
68
|
-
})
|
|
69
|
-
}
|
|
70
|
-
>
|
|
71
|
-
{sortOption.direction === "asc" ? (
|
|
72
|
-
<ArrowUpWideNarrow className="size-4" />
|
|
73
|
-
) : (
|
|
74
|
-
<ArrowDownWideNarrow className="size-4" />
|
|
75
|
-
)}
|
|
76
|
-
</Button>
|
|
77
|
-
<Button
|
|
78
|
-
variant="ghost"
|
|
79
|
-
size="sm"
|
|
80
|
-
onClick={() => removeSortOption(index)}
|
|
81
|
-
className="size-8 p-0"
|
|
82
|
-
aria-label="Remove sort criterion"
|
|
83
|
-
>
|
|
84
|
-
<X className="text-muted-foreground size-4" />
|
|
85
|
-
</Button>
|
|
86
|
-
</div>
|
|
87
|
-
);
|
|
88
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Table,
|
|
5
|
-
TableBody,
|
|
6
|
-
TableCaption,
|
|
7
|
-
TableCell,
|
|
8
|
-
TableFooter,
|
|
9
|
-
TableHead,
|
|
10
|
-
TableHeader,
|
|
11
|
-
TableRow,
|
|
12
|
-
} from "./table";
|
|
13
|
-
|
|
14
|
-
const invoices = [
|
|
15
|
-
{
|
|
16
|
-
invoice: "INV001",
|
|
17
|
-
paymentStatus: "Paid",
|
|
18
|
-
totalAmount: "$250.00",
|
|
19
|
-
paymentMethod: "Credit Card",
|
|
20
|
-
},
|
|
21
|
-
{ invoice: "INV002", paymentStatus: "Pending", totalAmount: "$150.00", paymentMethod: "PayPal" },
|
|
22
|
-
{
|
|
23
|
-
invoice: "INV003",
|
|
24
|
-
paymentStatus: "Unpaid",
|
|
25
|
-
totalAmount: "$350.00",
|
|
26
|
-
paymentMethod: "Bank Transfer",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
invoice: "INV004",
|
|
30
|
-
paymentStatus: "Paid",
|
|
31
|
-
totalAmount: "$450.00",
|
|
32
|
-
paymentMethod: "Credit Card",
|
|
33
|
-
},
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
const meta = {
|
|
37
|
-
title: "DataDisplay/Table",
|
|
38
|
-
component: Table,
|
|
39
|
-
tags: ["autodocs"],
|
|
40
|
-
} satisfies Meta<typeof Table>;
|
|
41
|
-
|
|
42
|
-
export default meta;
|
|
43
|
-
type Story = StoryObj<typeof meta>;
|
|
44
|
-
|
|
45
|
-
export const Default: Story = {
|
|
46
|
-
render: () => (
|
|
47
|
-
<Table>
|
|
48
|
-
<TableCaption>A list of your recent invoices.</TableCaption>
|
|
49
|
-
<TableHeader>
|
|
50
|
-
<TableRow>
|
|
51
|
-
<TableHead className="w-[100px]">Invoice</TableHead>
|
|
52
|
-
<TableHead>Status</TableHead>
|
|
53
|
-
<TableHead>Method</TableHead>
|
|
54
|
-
<TableHead className="text-right">Amount</TableHead>
|
|
55
|
-
</TableRow>
|
|
56
|
-
</TableHeader>
|
|
57
|
-
<TableBody>
|
|
58
|
-
{invoices.map((invoice) => (
|
|
59
|
-
<TableRow key={invoice.invoice}>
|
|
60
|
-
<TableCell className="font-medium">{invoice.invoice}</TableCell>
|
|
61
|
-
<TableCell>{invoice.paymentStatus}</TableCell>
|
|
62
|
-
<TableCell>{invoice.paymentMethod}</TableCell>
|
|
63
|
-
<TableCell className="text-right">{invoice.totalAmount}</TableCell>
|
|
64
|
-
</TableRow>
|
|
65
|
-
))}
|
|
66
|
-
</TableBody>
|
|
67
|
-
<TableFooter>
|
|
68
|
-
<TableRow>
|
|
69
|
-
<TableCell colSpan={3}>Total</TableCell>
|
|
70
|
-
<TableCell className="text-right">$1,200.00</TableCell>
|
|
71
|
-
</TableRow>
|
|
72
|
-
</TableFooter>
|
|
73
|
-
</Table>
|
|
74
|
-
),
|
|
75
|
-
};
|