@ponti-studios/ui 2.0.2 → 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 -34
- 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/README.md
CHANGED
|
@@ -22,6 +22,38 @@ The base package remains usable by web consumers that do not install React Nativ
|
|
|
22
22
|
import { NativeButton, NativeThemeProvider } from "@ponti-studios/ui/native";
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
## Localization
|
|
26
|
+
|
|
27
|
+
Built-in accessibility labels can be localized once with `UiTextProvider`.
|
|
28
|
+
Component props such as `loadingLabel`, `emptyLabel`, and visible labels remain
|
|
29
|
+
available and take precedence over provider defaults. Feature-specific copy stays
|
|
30
|
+
owned by the consuming application.
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { UiTextProvider } from "@ponti-studios/ui";
|
|
34
|
+
|
|
35
|
+
<UiTextProvider messages={{
|
|
36
|
+
"button.loading": "Chargement",
|
|
37
|
+
"pagination.previous": "Page précédente",
|
|
38
|
+
"pagination.next": "Page suivante",
|
|
39
|
+
}}>
|
|
40
|
+
<App />
|
|
41
|
+
</UiTextProvider>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## API client
|
|
45
|
+
|
|
46
|
+
`useApiClient` uses same-origin requests by default. Pass `baseUrl` for an API
|
|
47
|
+
origin and set `credentials` explicitly when cross-origin cookies are required;
|
|
48
|
+
it does not read build-tool environment variables.
|
|
49
|
+
|
|
50
|
+
## Component registry
|
|
51
|
+
|
|
52
|
+
The shadcn-compatible registry is a curated set of independently installable
|
|
53
|
+
components plus the compiled Ponti theme. It is generated from source and
|
|
54
|
+
validated during `pnpm run check`; use the npm package for the complete,
|
|
55
|
+
maintained component library.
|
|
56
|
+
|
|
25
57
|
## Development
|
|
26
58
|
|
|
27
59
|
Common development workflows are available through the `Makefile`:
|
|
@@ -101,6 +133,7 @@ components' built-in styles. Tailwind is only needed if the app itself wants to
|
|
|
101
133
|
write Tailwind utility classes. The `/native` entry remains platform-specific
|
|
102
134
|
and does not load the web stylesheet.
|
|
103
135
|
|
|
104
|
-
The
|
|
105
|
-
transpile
|
|
106
|
-
|
|
136
|
+
The package publishes compiled ESM and TypeScript declarations, so consumer
|
|
137
|
+
bundlers do not need to transpile the library source. The root import loads the
|
|
138
|
+
precompiled stylesheet; explicit CSS consumers can use
|
|
139
|
+
`@ponti-studios/ui/styles.css`.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Accordion({ type, collapsible, className, onValueChange, ...props }: React.ComponentProps<typeof AccordionPrimitive.Root> & {
|
|
4
|
+
type?: "single" | "multiple";
|
|
5
|
+
collapsible?: boolean;
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): React.JSX.Element;
|
|
8
|
+
declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): React.JSX.Element;
|
|
9
|
+
declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Panel>): React.JSX.Element;
|
|
10
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
5
|
+
import { ChevronDown as r } from "lucide-react";
|
|
6
|
+
import { Accordion as i } from "@base-ui/react/accordion";
|
|
7
|
+
//#region src/components/data-display/accordion.tsx
|
|
8
|
+
function a({ type: n, collapsible: r = !0, className: a, onValueChange: o, ...s }) {
|
|
9
|
+
return /* @__PURE__ */ t(i.Root, {
|
|
10
|
+
"data-slot": "accordion",
|
|
11
|
+
multiple: n === "multiple",
|
|
12
|
+
onValueChange: (e, t) => {
|
|
13
|
+
if (n !== "multiple" && !r && e.length === 0) {
|
|
14
|
+
t.cancel();
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
o?.(e, t);
|
|
18
|
+
},
|
|
19
|
+
...s,
|
|
20
|
+
className: e("w-full", a)
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function o({ className: n, ...r }) {
|
|
24
|
+
return /* @__PURE__ */ t(i.Item, {
|
|
25
|
+
"data-slot": "accordion-item",
|
|
26
|
+
className: e("mb-2 overflow-hidden rounded-md border last:mb-0", n),
|
|
27
|
+
...r
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function s({ className: a, children: o, ...s }) {
|
|
31
|
+
return /* @__PURE__ */ t(i.Header, {
|
|
32
|
+
className: "flex",
|
|
33
|
+
children: /* @__PURE__ */ n(i.Trigger, {
|
|
34
|
+
"data-slot": "accordion-trigger",
|
|
35
|
+
className: e("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", a),
|
|
36
|
+
...s,
|
|
37
|
+
children: [o, /* @__PURE__ */ t(r, { className: "pointer-events-none size-4 shrink-0 transition-transform duration-200" })]
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function c({ className: n, children: r, ...a }) {
|
|
42
|
+
return /* @__PURE__ */ t(i.Panel, {
|
|
43
|
+
"data-slot": "accordion-content",
|
|
44
|
+
className: "animate-accordion-down overflow-hidden text-sm",
|
|
45
|
+
...a,
|
|
46
|
+
children: /* @__PURE__ */ t("div", {
|
|
47
|
+
className: e("px-4 pt-2 pb-3", n),
|
|
48
|
+
children: r
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { a as Accordion, c as AccordionContent, o as AccordionItem, s as AccordionTrigger };
|
|
@@ -8,13 +8,4 @@ export { SortControls } from "./sort-controls";
|
|
|
8
8
|
export type { SortControlsProps } from "./sort-controls";
|
|
9
9
|
export { SortRow } from "./sort-row";
|
|
10
10
|
export type { SortRowProps } from "./sort-row";
|
|
11
|
-
export {
|
|
12
|
-
Table,
|
|
13
|
-
TableBody,
|
|
14
|
-
TableCaption,
|
|
15
|
-
TableCell,
|
|
16
|
-
TableFooter,
|
|
17
|
-
TableHead,
|
|
18
|
-
TableHeader,
|
|
19
|
-
TableRow,
|
|
20
|
-
} from "./table";
|
|
11
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, } from "./table";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FilterChip as e } from "../filters/filter-chip.js";
|
|
2
|
+
import { ActiveFiltersBar as t } from "../filters/active-filters-bar.js";
|
|
3
|
+
import { Accordion as n, AccordionContent as r, AccordionItem as i, AccordionTrigger as a } from "./accordion.js";
|
|
4
|
+
import { MetricCard as o } from "./metric-card.js";
|
|
5
|
+
import { SortRow as s } from "./sort-row.js";
|
|
6
|
+
import { SortControls as c } from "./sort-controls.js";
|
|
7
|
+
import { Table as l, TableBody as u, TableCaption as d, TableCell as f, TableFooter as p, TableHead as m, TableHeader as h, TableRow as g } from "./table.js";
|
|
8
|
+
export { n as Accordion, r as AccordionContent, i as AccordionItem, a as AccordionTrigger, t as ActiveFiltersBar, e as FilterChip, o as MetricCard, c as SortControls, s as SortRow, l as Table, u as TableBody, d as TableCaption, f as TableCell, p as TableFooter, m as TableHead, h as TableHeader, g as TableRow };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
interface MetricCardProps extends ComponentProps<"div"> {
|
|
3
|
+
label: string;
|
|
4
|
+
value: ReactNode;
|
|
5
|
+
change?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/** Label/value/change stat tile. */
|
|
8
|
+
export declare function MetricCard({ label, value, change, className, ...props }: MetricCardProps): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/data-display/metric-card.tsx
|
|
4
|
+
function r({ label: r, value: i, change: a, className: o, ...s }) {
|
|
5
|
+
return /* @__PURE__ */ n("div", {
|
|
6
|
+
className: e("ui-flat-card", o),
|
|
7
|
+
...s,
|
|
8
|
+
children: [
|
|
9
|
+
/* @__PURE__ */ t("p", {
|
|
10
|
+
className: "ui-data-label mb-2",
|
|
11
|
+
children: r
|
|
12
|
+
}),
|
|
13
|
+
/* @__PURE__ */ t("p", {
|
|
14
|
+
className: "ui-data-value",
|
|
15
|
+
children: i ?? "—"
|
|
16
|
+
}),
|
|
17
|
+
a == null ? null : /* @__PURE__ */ t("p", {
|
|
18
|
+
className: "text-muted-foreground mt-1.5 text-xs",
|
|
19
|
+
children: a
|
|
20
|
+
})
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { r as MetricCard };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SortField, SortOption } from "../../hooks/sort.types";
|
|
2
|
+
export interface SortControlsProps {
|
|
3
|
+
sortOptions: SortOption[];
|
|
4
|
+
sortableFields: SortField[];
|
|
5
|
+
addSortOption: (option: SortOption) => void;
|
|
6
|
+
updateSortOption: (index: number, option: SortOption) => void;
|
|
7
|
+
removeSortOption: (index: number) => void;
|
|
8
|
+
open?: boolean | undefined;
|
|
9
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
10
|
+
focusedSortIndex?: (number | null) | undefined;
|
|
11
|
+
}
|
|
12
|
+
/** Multi-field sort builder, driven by the `SortOption`/`SortField` shared types. */
|
|
13
|
+
export declare function SortControls({ sortOptions, sortableFields, addSortOption, updateSortOption, removeSortOption, open, onOpenChange, focusedSortIndex, }: SortControlsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Button as e } from "../primitives/button.js";
|
|
3
|
+
import { DropdownMenu as t, DropdownMenuContent as n, DropdownMenuGroup as r, DropdownMenuLabel as i, DropdownMenuSeparator as a, DropdownMenuTrigger as o } from "../overlays/dropdown-menu.js";
|
|
4
|
+
import { SortRow as s } from "./sort-row.js";
|
|
5
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
|
+
import { ListOrdered as d, PlusCircle as f } from "lucide-react";
|
|
7
|
+
//#region src/components/data-display/sort-controls.tsx
|
|
8
|
+
function p({ sortOptions: p, sortableFields: m, addSortOption: h, updateSortOption: g, removeSortOption: _, open: v, onOpenChange: y, focusedSortIndex: b }) {
|
|
9
|
+
let x = m.filter((e) => !p.some((t) => t.field === e));
|
|
10
|
+
return /* @__PURE__ */ u(t, {
|
|
11
|
+
...v !== void 0 && { open: v },
|
|
12
|
+
...y && { onOpenChange: y },
|
|
13
|
+
children: [/* @__PURE__ */ l(o, {
|
|
14
|
+
asChild: !0,
|
|
15
|
+
children: /* @__PURE__ */ u(e, {
|
|
16
|
+
variant: "outline",
|
|
17
|
+
children: [/* @__PURE__ */ l(d, { className: "mr-2 size-4" }), "Sort"]
|
|
18
|
+
})
|
|
19
|
+
}), /* @__PURE__ */ u(n, {
|
|
20
|
+
className: "w-80 space-y-2 p-2",
|
|
21
|
+
children: [/* @__PURE__ */ u(r, {
|
|
22
|
+
className: "space-y-1",
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ l(i, { children: "Define Sort Order" }),
|
|
25
|
+
/* @__PURE__ */ l(a, {}),
|
|
26
|
+
p.map((e, t) => {
|
|
27
|
+
let n = p.filter((e, n) => n !== t).map((e) => e.field);
|
|
28
|
+
return /* @__PURE__ */ l("div", {
|
|
29
|
+
className: `rounded-sm ${t === b ? "bg-muted" : ""}`,
|
|
30
|
+
children: /* @__PURE__ */ l(s, {
|
|
31
|
+
sortOption: e,
|
|
32
|
+
index: t,
|
|
33
|
+
sortableFields: m,
|
|
34
|
+
usedFields: n,
|
|
35
|
+
updateSortOption: g,
|
|
36
|
+
removeSortOption: _
|
|
37
|
+
})
|
|
38
|
+
}, e.field);
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
}), x.length > 0 && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(a, {}), /* @__PURE__ */ u("button", {
|
|
42
|
+
type: "button",
|
|
43
|
+
onClick: () => {
|
|
44
|
+
let e = x[0];
|
|
45
|
+
e && h({
|
|
46
|
+
field: e,
|
|
47
|
+
direction: "desc"
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
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",
|
|
51
|
+
children: [/* @__PURE__ */ l(f, { className: "mr-2 size-4" }), "Add Sort Criterion"]
|
|
52
|
+
})] })]
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { p as SortControls };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SortField, SortOption } from "../../hooks/sort.types";
|
|
2
|
+
export interface SortRowProps {
|
|
3
|
+
sortOption: SortOption;
|
|
4
|
+
index: number;
|
|
5
|
+
sortableFields: SortField[];
|
|
6
|
+
usedFields: SortField[];
|
|
7
|
+
updateSortOption: (index: number, option: SortOption) => void;
|
|
8
|
+
removeSortOption: (index: number) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function SortRow({ sortOption, index, sortableFields, usedFields, updateSortOption, removeSortOption, }: SortRowProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Button as e } from "../primitives/button.js";
|
|
3
|
+
import { DropdownMenu as t, DropdownMenuContent as n, DropdownMenuItem as r, DropdownMenuTrigger as i } from "../overlays/dropdown-menu.js";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
import { ArrowDownWideNarrow as s, ArrowUpWideNarrow as c, X as l } from "lucide-react";
|
|
6
|
+
//#region src/components/data-display/sort-row.tsx
|
|
7
|
+
function u(e) {
|
|
8
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
9
|
+
}
|
|
10
|
+
function d({ sortOption: d, index: f, sortableFields: p, usedFields: m, updateSortOption: h, removeSortOption: g }) {
|
|
11
|
+
let _ = p.filter((e) => !m.includes(e) || e === d.field);
|
|
12
|
+
return /* @__PURE__ */ o("div", {
|
|
13
|
+
className: "flex w-full items-center gap-1",
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ o(t, { children: [/* @__PURE__ */ a(i, {
|
|
16
|
+
asChild: !0,
|
|
17
|
+
children: /* @__PURE__ */ a("button", {
|
|
18
|
+
type: "button",
|
|
19
|
+
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",
|
|
20
|
+
children: u(d.field)
|
|
21
|
+
})
|
|
22
|
+
}), /* @__PURE__ */ a(n, { children: _.map((e) => /* @__PURE__ */ a(r, {
|
|
23
|
+
onClick: () => h(f, {
|
|
24
|
+
...d,
|
|
25
|
+
field: e
|
|
26
|
+
}),
|
|
27
|
+
children: u(e)
|
|
28
|
+
}, e)) })] }),
|
|
29
|
+
/* @__PURE__ */ a(e, {
|
|
30
|
+
variant: "ghost",
|
|
31
|
+
size: "sm",
|
|
32
|
+
className: "size-8 p-0",
|
|
33
|
+
"aria-label": d.direction === "asc" ? "Sorted ascending" : "Sorted descending",
|
|
34
|
+
onClick: () => h(f, {
|
|
35
|
+
...d,
|
|
36
|
+
direction: d.direction === "asc" ? "desc" : "asc"
|
|
37
|
+
}),
|
|
38
|
+
children: d.direction === "asc" ? /* @__PURE__ */ a(c, { className: "size-4" }) : /* @__PURE__ */ a(s, { className: "size-4" })
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ a(e, {
|
|
41
|
+
variant: "ghost",
|
|
42
|
+
size: "sm",
|
|
43
|
+
onClick: () => g(f),
|
|
44
|
+
className: "size-8 p-0",
|
|
45
|
+
"aria-label": "Remove sort criterion",
|
|
46
|
+
children: /* @__PURE__ */ a(l, { className: "text-muted-foreground size-4" })
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { d as SortRow };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
|
|
3
|
+
declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
4
|
+
declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
5
|
+
declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
6
|
+
declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
|
|
7
|
+
declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
8
|
+
declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
9
|
+
declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
10
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/data-display/table.tsx
|
|
5
|
+
var r = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("div", {
|
|
6
|
+
className: "w-full overflow-auto",
|
|
7
|
+
children: /* @__PURE__ */ n("table", {
|
|
8
|
+
ref: i,
|
|
9
|
+
className: e("w-full caption-bottom text-sm", t),
|
|
10
|
+
...r
|
|
11
|
+
})
|
|
12
|
+
}));
|
|
13
|
+
r.displayName = "Table";
|
|
14
|
+
var i = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("thead", {
|
|
15
|
+
ref: i,
|
|
16
|
+
className: e("[&_tr]:border-b", t),
|
|
17
|
+
...r
|
|
18
|
+
}));
|
|
19
|
+
i.displayName = "TableHeader";
|
|
20
|
+
var a = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("tbody", {
|
|
21
|
+
ref: i,
|
|
22
|
+
className: e("[&_tr:last-child]:border-0", t),
|
|
23
|
+
...r
|
|
24
|
+
}));
|
|
25
|
+
a.displayName = "TableBody";
|
|
26
|
+
var o = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("tfoot", {
|
|
27
|
+
ref: i,
|
|
28
|
+
className: e("bg-muted font-medium", t),
|
|
29
|
+
...r
|
|
30
|
+
}));
|
|
31
|
+
o.displayName = "TableFooter";
|
|
32
|
+
var s = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("tr", {
|
|
33
|
+
ref: i,
|
|
34
|
+
className: e("data-[state=selected]:bg-muted border-b", t),
|
|
35
|
+
...r
|
|
36
|
+
}));
|
|
37
|
+
s.displayName = "TableRow";
|
|
38
|
+
var c = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("th", {
|
|
39
|
+
ref: i,
|
|
40
|
+
className: e("text-muted-foreground h-9 px-3 text-left align-middle text-xs font-medium [&:has([role=checkbox])]:pr-0", t),
|
|
41
|
+
...r
|
|
42
|
+
}));
|
|
43
|
+
c.displayName = "TableHead";
|
|
44
|
+
var l = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("td", {
|
|
45
|
+
ref: i,
|
|
46
|
+
className: e("px-3 py-2.5 align-middle [&:has([role=checkbox])]:pr-0", t),
|
|
47
|
+
...r
|
|
48
|
+
}));
|
|
49
|
+
l.displayName = "TableCell";
|
|
50
|
+
var u = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("caption", {
|
|
51
|
+
ref: i,
|
|
52
|
+
className: e("text-muted-foreground mt-4 text-sm", t),
|
|
53
|
+
...r
|
|
54
|
+
}));
|
|
55
|
+
u.displayName = "TableCaption";
|
|
56
|
+
//#endregion
|
|
57
|
+
export { r as Table, a as TableBody, u as TableCaption, l as TableCell, o as TableFooter, c as TableHead, i as TableHeader, s as TableRow };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const alertVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React.JSX.Element;
|
|
7
|
+
declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import { cva as n } from "class-variance-authority";
|
|
5
|
+
//#region src/components/feedback/alert.tsx
|
|
6
|
+
var r = n("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", {
|
|
7
|
+
variants: { variant: {
|
|
8
|
+
default: "bg-card text-card-foreground",
|
|
9
|
+
destructive: "border-destructive text-destructive-text bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive-text"
|
|
10
|
+
} },
|
|
11
|
+
defaultVariants: { variant: "default" }
|
|
12
|
+
});
|
|
13
|
+
function i({ className: n, variant: i, ...a }) {
|
|
14
|
+
return /* @__PURE__ */ t("div", {
|
|
15
|
+
"data-slot": "alert",
|
|
16
|
+
role: "alert",
|
|
17
|
+
className: e(r({ variant: i }), n),
|
|
18
|
+
...a
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function a({ className: n, ...r }) {
|
|
22
|
+
return /* @__PURE__ */ t("h2", {
|
|
23
|
+
"data-slot": "alert-title",
|
|
24
|
+
className: e("col-start-2 line-clamp-1 min-h-4 text-sm font-medium", n),
|
|
25
|
+
...r,
|
|
26
|
+
children: r.children
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function o({ className: n, ...r }) {
|
|
30
|
+
return /* @__PURE__ */ t("div", {
|
|
31
|
+
"data-slot": "alert-description",
|
|
32
|
+
className: e("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed", n),
|
|
33
|
+
...r,
|
|
34
|
+
children: r.children
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { i as Alert, o as AlertDescription, a as AlertTitle };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface EmptyStateProps {
|
|
3
|
+
icon?: ReactNode;
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
action?: ReactNode;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
layout?: "centered" | "inline";
|
|
10
|
+
size?: "md" | "lg";
|
|
11
|
+
variant?: "default" | "dashed" | "quiet" | "search";
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* EmptyState communicates an absence of content and gives the host application
|
|
15
|
+
* room for an optional next action. Domain copy and recovery behavior stay with
|
|
16
|
+
* the calling feature.
|
|
17
|
+
*/
|
|
18
|
+
export declare function EmptyState({ icon, title, description, action, children, className, layout, size, variant, }: EmptyStateProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/feedback/empty-state.tsx
|
|
4
|
+
function r({ icon: r, title: i, description: a, action: o, children: s, className: c, layout: l = "centered", size: u = "md", variant: d = "default" }) {
|
|
5
|
+
let f = l === "centered", p = u === "lg";
|
|
6
|
+
return /* @__PURE__ */ n("section", {
|
|
7
|
+
className: e("rounded-lg px-5 py-8", d === "default" && "bg-card border", d === "dashed" && "bg-card border border-dashed", d === "search" && "bg-muted border border-dashed", d === "quiet" && "bg-card", f ? e("flex flex-col items-center justify-center text-center", p ? "min-h-80 px-6 py-10" : "min-h-64") : "flex flex-col gap-3", c),
|
|
8
|
+
children: [
|
|
9
|
+
r ? /* @__PURE__ */ t("div", {
|
|
10
|
+
className: "text-muted-foreground mb-3 flex size-11 items-center justify-center",
|
|
11
|
+
"aria-hidden": !0,
|
|
12
|
+
children: r
|
|
13
|
+
}) : null,
|
|
14
|
+
/* @__PURE__ */ n("div", {
|
|
15
|
+
className: e("space-y-2", f && "max-w-[34ch]"),
|
|
16
|
+
children: [/* @__PURE__ */ t("h2", {
|
|
17
|
+
className: e("text-foreground font-semibold tracking-tight", p ? "text-lg" : "text-base"),
|
|
18
|
+
children: i
|
|
19
|
+
}), a ? /* @__PURE__ */ t("p", {
|
|
20
|
+
className: "text-muted-foreground text-sm",
|
|
21
|
+
children: a
|
|
22
|
+
}) : null]
|
|
23
|
+
}),
|
|
24
|
+
s ? /* @__PURE__ */ t("div", {
|
|
25
|
+
className: "mt-3",
|
|
26
|
+
children: s
|
|
27
|
+
}) : null,
|
|
28
|
+
o ? /* @__PURE__ */ t("div", {
|
|
29
|
+
className: "mt-4",
|
|
30
|
+
children: o
|
|
31
|
+
}) : null
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { r as EmptyState };
|
|
@@ -5,5 +5,7 @@ export { Progress } from "./progress";
|
|
|
5
5
|
export { Skeleton } from "./skeleton";
|
|
6
6
|
export { Spinner } from "./spinner";
|
|
7
7
|
export type { SpinnerProps } from "./spinner";
|
|
8
|
+
/** @deprecated Import from `@ponti-studios/ui/integrations/service-worker` instead. */
|
|
8
9
|
export { UpdateGuard } from "./update-guard";
|
|
10
|
+
/** @deprecated Import from `@ponti-studios/ui/integrations/service-worker` instead. */
|
|
9
11
|
export type { UpdateGuardCopy, UpdateGuardProps } from "./update-guard";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Spinner as e } from "./spinner.js";
|
|
2
|
+
import { Progress as t } from "./progress.js";
|
|
3
|
+
import { Alert as n, AlertDescription as r, AlertTitle as i } from "./alert.js";
|
|
4
|
+
import { EmptyState as a } from "./empty-state.js";
|
|
5
|
+
import { Skeleton as o } from "./skeleton.js";
|
|
6
|
+
import { UpdateGuard as s } from "./update-guard.js";
|
|
7
|
+
export { n as Alert, r as AlertDescription, i as AlertTitle, a as EmptyState, t as Progress, o as Skeleton, e as Spinner, s as UpdateGuard };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Progress as ProgressPrimitive } from "@base-ui/react/progress";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Progress({ className, value, indicatorClassName, ...props }: React.ComponentProps<typeof ProgressPrimitive.Root> & {
|
|
4
|
+
indicatorClassName?: string;
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
export { Progress };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import { Progress as n } from "@base-ui/react/progress";
|
|
5
|
+
//#region src/components/feedback/progress.tsx
|
|
6
|
+
function r({ className: r, value: i, indicatorClassName: a, ...o }) {
|
|
7
|
+
let s = typeof i == "number" && i > 0 && i < 100;
|
|
8
|
+
return /* @__PURE__ */ t(n.Root, {
|
|
9
|
+
"data-slot": "progress",
|
|
10
|
+
className: e("bg-muted relative h-2 w-full overflow-hidden rounded-full", r),
|
|
11
|
+
value: i,
|
|
12
|
+
...o,
|
|
13
|
+
children: /* @__PURE__ */ t(n.Indicator, {
|
|
14
|
+
"data-slot": "progress-indicator",
|
|
15
|
+
className: e("bg-primary relative h-full w-full flex-1 overflow-hidden transition-transform duration-300 ease-out", a),
|
|
16
|
+
style: { transform: `translateX(-${100 - (i ?? 0)}%)` },
|
|
17
|
+
children: s && /* @__PURE__ */ t("span", {
|
|
18
|
+
"aria-hidden": !0,
|
|
19
|
+
className: "animate-progress-shimmer absolute inset-0 bg-[linear-gradient(90deg,transparent_35%,rgba(255,255,255,0.75)_50%,transparent_65%)]"
|
|
20
|
+
})
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { r as Progress };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/feedback/skeleton.tsx
|
|
4
|
+
function n({ className: n, ...r }) {
|
|
5
|
+
return /* @__PURE__ */ t("div", {
|
|
6
|
+
className: e("bg-muted animate-pulse rounded-md", n),
|
|
7
|
+
...r
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { n as Skeleton };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const sizeClasses: {
|
|
3
|
+
readonly sm: "size-4";
|
|
4
|
+
readonly md: "size-5";
|
|
5
|
+
readonly lg: "size-8";
|
|
6
|
+
readonly xl: "size-12";
|
|
7
|
+
};
|
|
8
|
+
export interface SpinnerProps extends React.ComponentProps<"output"> {
|
|
9
|
+
label?: string | false;
|
|
10
|
+
presentation?: "inline" | "centered";
|
|
11
|
+
size?: keyof typeof sizeClasses;
|
|
12
|
+
}
|
|
13
|
+
export declare function Spinner({ label, presentation, size, className, ...props }: SpinnerProps): React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/feedback/spinner.tsx
|
|
5
|
+
var r = {
|
|
6
|
+
sm: "size-4",
|
|
7
|
+
md: "size-5",
|
|
8
|
+
lg: "size-8",
|
|
9
|
+
xl: "size-12"
|
|
10
|
+
};
|
|
11
|
+
function i({ label: i = !1, presentation: a = "inline", size: o = "md", className: s, ...c }) {
|
|
12
|
+
let l = typeof i == "string" ? i : "Loading";
|
|
13
|
+
return /* @__PURE__ */ n("output", {
|
|
14
|
+
className: e("inline-flex items-center justify-center gap-2", a === "centered" && "flex w-full py-12", s),
|
|
15
|
+
"aria-label": l,
|
|
16
|
+
...c,
|
|
17
|
+
children: [/* @__PURE__ */ t("span", {
|
|
18
|
+
className: e("border-border border-t-primary rounded-full border-2 motion-safe:animate-spin", r[o]),
|
|
19
|
+
"aria-hidden": "true"
|
|
20
|
+
}), i && /* @__PURE__ */ t("span", {
|
|
21
|
+
className: "text-muted-foreground text-xs",
|
|
22
|
+
children: i
|
|
23
|
+
})]
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { i as Spinner };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface UpdateGuardCopy {
|
|
2
|
+
newContentAvailable?: string;
|
|
3
|
+
refreshButton?: string;
|
|
4
|
+
closeButton?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface UpdateGuardProps {
|
|
7
|
+
needRefresh: boolean;
|
|
8
|
+
onRefresh: () => void;
|
|
9
|
+
onDismiss?: () => void;
|
|
10
|
+
copyText?: string;
|
|
11
|
+
refreshText?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function UpdateGuard({ needRefresh, onRefresh, onDismiss, copyText, refreshText, }: UpdateGuardProps): import("react").JSX.Element | null;
|