@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,68 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
import { Button } from "../primitives/button";
|
|
5
|
-
import {
|
|
6
|
-
Sheet,
|
|
7
|
-
SheetClose,
|
|
8
|
-
SheetContent,
|
|
9
|
-
SheetDescription,
|
|
10
|
-
SheetFooter,
|
|
11
|
-
SheetHeader,
|
|
12
|
-
SheetTitle,
|
|
13
|
-
SheetTrigger,
|
|
14
|
-
} from "./sheet";
|
|
15
|
-
|
|
16
|
-
const meta: Meta<typeof Sheet> = {
|
|
17
|
-
title: "Overlays/Sheet",
|
|
18
|
-
component: Sheet,
|
|
19
|
-
tags: ["autodocs"],
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default meta;
|
|
23
|
-
type Story = StoryObj<typeof meta>;
|
|
24
|
-
|
|
25
|
-
const SheetDemo = () => (
|
|
26
|
-
<Sheet>
|
|
27
|
-
<SheetTrigger asChild>
|
|
28
|
-
<Button variant="outline">Open sheet</Button>
|
|
29
|
-
</SheetTrigger>
|
|
30
|
-
<SheetContent>
|
|
31
|
-
<SheetHeader>
|
|
32
|
-
<SheetTitle>Edit profile</SheetTitle>
|
|
33
|
-
<SheetDescription>
|
|
34
|
-
Make changes to your profile here. Click save when you're done.
|
|
35
|
-
</SheetDescription>
|
|
36
|
-
</SheetHeader>
|
|
37
|
-
<div className="flex flex-col gap-4 py-6">
|
|
38
|
-
<div className="flex flex-col gap-2">
|
|
39
|
-
<span className="text-sm font-medium">Name</span>
|
|
40
|
-
<input
|
|
41
|
-
className="border-input placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:ring-1 focus-visible:outline-none"
|
|
42
|
-
placeholder="Jane Doe"
|
|
43
|
-
/>
|
|
44
|
-
</div>
|
|
45
|
-
<div className="flex flex-col gap-2">
|
|
46
|
-
<span className="text-sm font-medium">Email</span>
|
|
47
|
-
<input
|
|
48
|
-
className="border-input placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:ring-1 focus-visible:outline-none"
|
|
49
|
-
placeholder="jane@example.com"
|
|
50
|
-
type="email"
|
|
51
|
-
/>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
<SheetFooter>
|
|
55
|
-
<SheetClose asChild>
|
|
56
|
-
<Button variant="outline">Cancel</Button>
|
|
57
|
-
</SheetClose>
|
|
58
|
-
<SheetClose asChild>
|
|
59
|
-
<Button>Save changes</Button>
|
|
60
|
-
</SheetClose>
|
|
61
|
-
</SheetFooter>
|
|
62
|
-
</SheetContent>
|
|
63
|
-
</Sheet>
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
export const Default: Story = {
|
|
67
|
-
render: () => <SheetDemo />,
|
|
68
|
-
};
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
|
|
4
|
-
import { X } from "lucide-react";
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
|
|
7
|
-
import { cn } from "../../lib/utils";
|
|
8
|
-
|
|
9
|
-
const Sheet = SheetPrimitive.Root;
|
|
10
|
-
|
|
11
|
-
function SheetTrigger({
|
|
12
|
-
asChild,
|
|
13
|
-
children,
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof SheetPrimitive.Trigger> & { asChild?: boolean }) {
|
|
16
|
-
return (
|
|
17
|
-
<SheetPrimitive.Trigger
|
|
18
|
-
{...(asChild && React.isValidElement(children)
|
|
19
|
-
? { render: children as React.ReactElement }
|
|
20
|
-
: {})}
|
|
21
|
-
{...props}
|
|
22
|
-
>
|
|
23
|
-
{!asChild && children}
|
|
24
|
-
</SheetPrimitive.Trigger>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function SheetClose({
|
|
29
|
-
asChild,
|
|
30
|
-
children,
|
|
31
|
-
...props
|
|
32
|
-
}: React.ComponentProps<typeof SheetPrimitive.Close> & { asChild?: boolean }) {
|
|
33
|
-
return (
|
|
34
|
-
<SheetPrimitive.Close
|
|
35
|
-
{...(asChild && React.isValidElement(children)
|
|
36
|
-
? { render: children as React.ReactElement }
|
|
37
|
-
: {})}
|
|
38
|
-
{...props}
|
|
39
|
-
>
|
|
40
|
-
{!asChild && children}
|
|
41
|
-
</SheetPrimitive.Close>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const SheetPortal = SheetPrimitive.Portal;
|
|
46
|
-
|
|
47
|
-
const SheetOverlay = React.forwardRef<
|
|
48
|
-
React.ComponentRef<typeof SheetPrimitive.Backdrop>,
|
|
49
|
-
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Backdrop>
|
|
50
|
-
>(({ className, ...props }, ref) => (
|
|
51
|
-
<SheetPrimitive.Backdrop
|
|
52
|
-
data-slot="sheet-overlay"
|
|
53
|
-
className={cn("fixed inset-0 z-50 bg-black/80", className)}
|
|
54
|
-
{...props}
|
|
55
|
-
ref={ref}
|
|
56
|
-
/>
|
|
57
|
-
));
|
|
58
|
-
SheetOverlay.displayName = "SheetOverlay";
|
|
59
|
-
|
|
60
|
-
const sheetClassName = [
|
|
61
|
-
// Appearance
|
|
62
|
-
"bg-background text-foreground rounded-xl border shadow-lg",
|
|
63
|
-
// Layout
|
|
64
|
-
"flex flex-col gap-6 p-4",
|
|
65
|
-
// Position: floats off every edge, anchored to the bottom on mobile
|
|
66
|
-
"fixed z-50 inset-x-2 bottom-[max(0.5rem,env(safe-area-inset-bottom))]",
|
|
67
|
-
// Size: mobile
|
|
68
|
-
"max-h-[calc(100dvh-2rem)] min-h-[30dvh]",
|
|
69
|
-
// Position: anchored to the right edge on desktop
|
|
70
|
-
"md:inset-y-2 md:right-2 md:left-auto md:bottom-auto",
|
|
71
|
-
// Size: desktop
|
|
72
|
-
"md:w-3/4 md:max-w-sm md:min-h-0",
|
|
73
|
-
];
|
|
74
|
-
|
|
75
|
-
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Popup> {
|
|
76
|
-
/** Applied to the built-in close button, alongside its default styling. */
|
|
77
|
-
closeClassName?: string;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const SheetContent = React.forwardRef<
|
|
81
|
-
React.ComponentRef<typeof SheetPrimitive.Popup>,
|
|
82
|
-
SheetContentProps
|
|
83
|
-
>(({ className, closeClassName, children, ...props }, ref) => (
|
|
84
|
-
<SheetPortal>
|
|
85
|
-
<SheetOverlay />
|
|
86
|
-
<SheetPrimitive.Popup
|
|
87
|
-
ref={ref}
|
|
88
|
-
data-slot="sheet-content"
|
|
89
|
-
className={cn(sheetClassName, className)}
|
|
90
|
-
{...props}
|
|
91
|
-
>
|
|
92
|
-
<SheetPrimitive.Close
|
|
93
|
-
className={cn(
|
|
94
|
-
"text-muted-foreground hover:bg-muted hover:text-muted-foreground focus-visible:outline-ring absolute top-3 right-3 inline-flex size-9 items-center justify-center rounded-md border border-transparent transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none md:top-4 md:right-4",
|
|
95
|
-
closeClassName,
|
|
96
|
-
)}
|
|
97
|
-
>
|
|
98
|
-
<X className="size-4.5" />
|
|
99
|
-
<span className="sr-only">Close</span>
|
|
100
|
-
</SheetPrimitive.Close>
|
|
101
|
-
{children}
|
|
102
|
-
</SheetPrimitive.Popup>
|
|
103
|
-
</SheetPortal>
|
|
104
|
-
));
|
|
105
|
-
SheetContent.displayName = "SheetContent";
|
|
106
|
-
|
|
107
|
-
const SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
108
|
-
<div className={cn("flex flex-col gap-2 text-left", className)} {...props} />
|
|
109
|
-
);
|
|
110
|
-
SheetHeader.displayName = "SheetHeader";
|
|
111
|
-
|
|
112
|
-
const SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
113
|
-
<div
|
|
114
|
-
className={cn("mt-auto flex flex-col-reverse gap-3 sm:flex-row sm:justify-end", className)}
|
|
115
|
-
{...props}
|
|
116
|
-
/>
|
|
117
|
-
);
|
|
118
|
-
SheetFooter.displayName = "SheetFooter";
|
|
119
|
-
|
|
120
|
-
const SheetTitle = React.forwardRef<
|
|
121
|
-
React.ComponentRef<typeof SheetPrimitive.Title>,
|
|
122
|
-
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
|
|
123
|
-
>(({ className, ...props }, ref) => (
|
|
124
|
-
<SheetPrimitive.Title
|
|
125
|
-
ref={ref}
|
|
126
|
-
className={cn("text-lg font-semibold tracking-tight", className)}
|
|
127
|
-
{...props}
|
|
128
|
-
/>
|
|
129
|
-
));
|
|
130
|
-
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
131
|
-
|
|
132
|
-
const SheetDescription = React.forwardRef<
|
|
133
|
-
React.ComponentRef<typeof SheetPrimitive.Description>,
|
|
134
|
-
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
|
|
135
|
-
>(({ className, ...props }, ref) => (
|
|
136
|
-
<SheetPrimitive.Description
|
|
137
|
-
ref={ref}
|
|
138
|
-
className={cn("text-muted-foreground max-w-prose text-sm", className)}
|
|
139
|
-
{...props}
|
|
140
|
-
/>
|
|
141
|
-
));
|
|
142
|
-
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
143
|
-
|
|
144
|
-
export {
|
|
145
|
-
Sheet,
|
|
146
|
-
SheetClose,
|
|
147
|
-
SheetContent,
|
|
148
|
-
SheetDescription,
|
|
149
|
-
SheetFooter,
|
|
150
|
-
SheetHeader,
|
|
151
|
-
SheetOverlay,
|
|
152
|
-
SheetPortal,
|
|
153
|
-
SheetTitle,
|
|
154
|
-
SheetTrigger,
|
|
155
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import { Button } from "../primitives/button";
|
|
4
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip";
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: "Overlays/Tooltip",
|
|
8
|
-
component: TooltipContent,
|
|
9
|
-
tags: ["autodocs"],
|
|
10
|
-
} satisfies Meta<typeof TooltipContent>;
|
|
11
|
-
|
|
12
|
-
export default meta;
|
|
13
|
-
type Story = StoryObj<typeof meta>;
|
|
14
|
-
|
|
15
|
-
export const Default: Story = {
|
|
16
|
-
args: { children: "Save changes" },
|
|
17
|
-
render: (args) => (
|
|
18
|
-
<Tooltip>
|
|
19
|
-
<TooltipTrigger
|
|
20
|
-
render={
|
|
21
|
-
<Button variant="outline" size="sm">
|
|
22
|
-
Hover me
|
|
23
|
-
</Button>
|
|
24
|
-
}
|
|
25
|
-
/>
|
|
26
|
-
<TooltipContent {...args} />
|
|
27
|
-
</Tooltip>
|
|
28
|
-
),
|
|
29
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
|
|
6
|
-
import { cn } from "../../lib/utils";
|
|
7
|
-
|
|
8
|
-
const TooltipProvider = TooltipPrimitive.Provider;
|
|
9
|
-
const Tooltip = TooltipPrimitive.Root;
|
|
10
|
-
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
11
|
-
const TooltipPortal = TooltipPrimitive.Portal;
|
|
12
|
-
|
|
13
|
-
function TooltipContent({
|
|
14
|
-
className,
|
|
15
|
-
sideOffset = 4,
|
|
16
|
-
children,
|
|
17
|
-
...props
|
|
18
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Popup> & { sideOffset?: number }) {
|
|
19
|
-
return (
|
|
20
|
-
<TooltipPrimitive.Portal>
|
|
21
|
-
<TooltipPrimitive.Positioner sideOffset={sideOffset}>
|
|
22
|
-
<TooltipPrimitive.Popup
|
|
23
|
-
data-slot="tooltip-content"
|
|
24
|
-
className={cn(
|
|
25
|
-
"bg-foreground text-background z-50 w-fit max-w-xs rounded-md px-2.5 py-1.5 text-xs text-balance",
|
|
26
|
-
className,
|
|
27
|
-
)}
|
|
28
|
-
{...props}
|
|
29
|
-
>
|
|
30
|
-
{children}
|
|
31
|
-
<TooltipPrimitive.Arrow
|
|
32
|
-
data-slot="tooltip-arrow"
|
|
33
|
-
className="data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px]"
|
|
34
|
-
/>
|
|
35
|
-
</TooltipPrimitive.Popup>
|
|
36
|
-
</TooltipPrimitive.Positioner>
|
|
37
|
-
</TooltipPrimitive.Portal>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export { Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" role="img" aria-labelledby="title desc">
|
|
2
|
-
<title id="title">Portrait placeholder</title>
|
|
3
|
-
<desc id="desc">An illustrated portrait with warm coral and blue tones.</desc>
|
|
4
|
-
<rect width="256" height="256" fill="#dce8f2"/>
|
|
5
|
-
<circle cx="202" cy="54" r="34" fill="#ffb36b"/>
|
|
6
|
-
<path d="M0 214c36-34 74-47 112-39 37 8 63 34 79 81H0z" fill="#185a72"/>
|
|
7
|
-
<path d="M83 256c5-49 25-78 73-78 47 0 68 29 73 78z" fill="#ff704d"/>
|
|
8
|
-
<path d="M91 111c0-43 28-73 66-73s66 30 66 73c0 42-25 72-66 72s-66-30-66-72z" fill="#c97852"/>
|
|
9
|
-
<path d="M88 111c-2-46 25-79 70-79 42 0 68 29 68 72-14-16-31-26-51-30-23 27-52 39-87 37z" fill="#243746"/>
|
|
10
|
-
<circle cx="128" cy="116" r="5" fill="#243746"/>
|
|
11
|
-
<circle cx="176" cy="116" r="5" fill="#243746"/>
|
|
12
|
-
<path d="M137 145c8 6 17 6 25 0" fill="none" stroke="#243746" stroke-linecap="round" stroke-width="5"/>
|
|
13
|
-
</svg>
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import { Avatar, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from "./avatar";
|
|
4
|
-
import avatarPlaceholder from "./avatar-placeholder.svg";
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: "Primitives/Avatar",
|
|
8
|
-
component: Avatar,
|
|
9
|
-
tags: ["autodocs"],
|
|
10
|
-
} satisfies Meta<typeof Avatar>;
|
|
11
|
-
|
|
12
|
-
export default meta;
|
|
13
|
-
type Story = StoryObj<typeof meta>;
|
|
14
|
-
|
|
15
|
-
export const WithImage: Story = {
|
|
16
|
-
render: () => (
|
|
17
|
-
<Avatar>
|
|
18
|
-
<AvatarImage src={avatarPlaceholder} alt="Illustrated portrait" />
|
|
19
|
-
<AvatarFallback>CN</AvatarFallback>
|
|
20
|
-
</Avatar>
|
|
21
|
-
),
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const WithFallback: Story = {
|
|
25
|
-
render: () => (
|
|
26
|
-
<Avatar>
|
|
27
|
-
<AvatarImage src="/broken-image.jpg" alt="Broken" />
|
|
28
|
-
<AvatarFallback>AB</AvatarFallback>
|
|
29
|
-
</Avatar>
|
|
30
|
-
),
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const Sizes: Story = {
|
|
34
|
-
render: () => (
|
|
35
|
-
<div className="flex items-center gap-4">
|
|
36
|
-
<Avatar size="sm">
|
|
37
|
-
<AvatarFallback>SM</AvatarFallback>
|
|
38
|
-
</Avatar>
|
|
39
|
-
<Avatar size="default">
|
|
40
|
-
<AvatarFallback>MD</AvatarFallback>
|
|
41
|
-
</Avatar>
|
|
42
|
-
<Avatar size="lg">
|
|
43
|
-
<AvatarFallback>LG</AvatarFallback>
|
|
44
|
-
</Avatar>
|
|
45
|
-
</div>
|
|
46
|
-
),
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const WithBadge: Story = {
|
|
50
|
-
render: () => (
|
|
51
|
-
<Avatar statusBadge>
|
|
52
|
-
<AvatarFallback>JD</AvatarFallback>
|
|
53
|
-
</Avatar>
|
|
54
|
-
),
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const Group: Story = {
|
|
58
|
-
render: () => (
|
|
59
|
-
<AvatarGroup>
|
|
60
|
-
<Avatar>
|
|
61
|
-
<AvatarFallback>AB</AvatarFallback>
|
|
62
|
-
</Avatar>
|
|
63
|
-
<Avatar>
|
|
64
|
-
<AvatarFallback>CD</AvatarFallback>
|
|
65
|
-
</Avatar>
|
|
66
|
-
<Avatar>
|
|
67
|
-
<AvatarFallback>EF</AvatarFallback>
|
|
68
|
-
</Avatar>
|
|
69
|
-
<AvatarGroupCount>+3</AvatarGroupCount>
|
|
70
|
-
</AvatarGroup>
|
|
71
|
-
),
|
|
72
|
-
};
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
|
|
2
|
-
import type { ClassValue } from "clsx";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
type AvatarSize = "sm" | "default" | "lg";
|
|
8
|
-
|
|
9
|
-
const AvatarContext = React.createContext<{ size: AvatarSize }>({ size: "default" });
|
|
10
|
-
|
|
11
|
-
const avatarSize: Record<AvatarSize, ClassValue> = {
|
|
12
|
-
sm: "size-6",
|
|
13
|
-
default: "size-6",
|
|
14
|
-
lg: "size-10",
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const badgeDotSize: Record<AvatarSize, ClassValue> = {
|
|
18
|
-
sm: "size-2",
|
|
19
|
-
default: "size-2.5",
|
|
20
|
-
lg: "size-3",
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const fallbackText: Record<AvatarSize, ClassValue> = {
|
|
24
|
-
sm: "text-xs",
|
|
25
|
-
default: "text-sm",
|
|
26
|
-
lg: "text-sm",
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const groupCountSvg: Record<AvatarSize, ClassValue> = {
|
|
30
|
-
sm: "[&>svg]:size-3",
|
|
31
|
-
default: "[&>svg]:size-4",
|
|
32
|
-
lg: "[&>svg]:size-5",
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
function Avatar({
|
|
36
|
-
className,
|
|
37
|
-
size = "default",
|
|
38
|
-
statusBadge = false,
|
|
39
|
-
children,
|
|
40
|
-
...props
|
|
41
|
-
}: React.ComponentProps<typeof AvatarPrimitive.Root> & {
|
|
42
|
-
size?: AvatarSize;
|
|
43
|
-
statusBadge?: boolean;
|
|
44
|
-
}) {
|
|
45
|
-
return (
|
|
46
|
-
<AvatarContext.Provider value={{ size }}>
|
|
47
|
-
<AvatarPrimitive.Root
|
|
48
|
-
data-slot="avatar"
|
|
49
|
-
className={cn(
|
|
50
|
-
"relative inline-flex shrink-0 rounded-full select-none",
|
|
51
|
-
avatarSize[size],
|
|
52
|
-
className,
|
|
53
|
-
)}
|
|
54
|
-
{...props}
|
|
55
|
-
>
|
|
56
|
-
{children}
|
|
57
|
-
{statusBadge ? (
|
|
58
|
-
<span
|
|
59
|
-
data-slot="avatar-badge"
|
|
60
|
-
className={cn(
|
|
61
|
-
"bg-primary ring-background absolute right-0 bottom-0 z-10 rounded-full ring-2",
|
|
62
|
-
badgeDotSize[size],
|
|
63
|
-
)}
|
|
64
|
-
/>
|
|
65
|
-
) : null}
|
|
66
|
-
</AvatarPrimitive.Root>
|
|
67
|
-
</AvatarContext.Provider>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>) {
|
|
72
|
-
return (
|
|
73
|
-
<AvatarPrimitive.Image
|
|
74
|
-
data-slot="avatar-image"
|
|
75
|
-
className={cn("absolute inset-0 size-full rounded-full object-cover", className)}
|
|
76
|
-
{...props}
|
|
77
|
-
/>
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function AvatarFallback({
|
|
82
|
-
className,
|
|
83
|
-
...props
|
|
84
|
-
}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
|
|
85
|
-
const { size } = React.useContext(AvatarContext);
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<AvatarPrimitive.Fallback
|
|
89
|
-
data-slot="avatar-fallback"
|
|
90
|
-
className={cn(
|
|
91
|
-
"bg-muted text-muted-foreground absolute inset-0 flex items-center justify-center rounded-full",
|
|
92
|
-
fallbackText[size],
|
|
93
|
-
className,
|
|
94
|
-
)}
|
|
95
|
-
{...props}
|
|
96
|
-
/>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function AvatarGroup({
|
|
101
|
-
className,
|
|
102
|
-
size = "default",
|
|
103
|
-
...props
|
|
104
|
-
}: React.ComponentProps<"div"> & { size?: AvatarSize }) {
|
|
105
|
-
return (
|
|
106
|
-
<AvatarContext.Provider value={{ size }}>
|
|
107
|
-
<div
|
|
108
|
-
data-slot="avatar-group"
|
|
109
|
-
className={cn(
|
|
110
|
-
"*:data-[slot=avatar]:ring-background flex -space-x-2 *:data-[slot=avatar]:ring-2",
|
|
111
|
-
className,
|
|
112
|
-
)}
|
|
113
|
-
{...props}
|
|
114
|
-
/>
|
|
115
|
-
</AvatarContext.Provider>
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function AvatarGroupCount({ className, ...props }: React.ComponentProps<"div">) {
|
|
120
|
-
const { size } = React.useContext(AvatarContext);
|
|
121
|
-
|
|
122
|
-
return (
|
|
123
|
-
<div
|
|
124
|
-
data-slot="avatar-group-count"
|
|
125
|
-
className={cn(
|
|
126
|
-
"bg-muted text-muted-foreground ring-background relative flex shrink-0 items-center justify-center rounded-full text-sm ring-2",
|
|
127
|
-
avatarSize[size],
|
|
128
|
-
groupCountSvg[size],
|
|
129
|
-
className,
|
|
130
|
-
)}
|
|
131
|
-
{...props}
|
|
132
|
-
/>
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export { Avatar, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
import { LucideAlertCircle, LucideDiamond, LucideNut } from "lucide-react";
|
|
4
|
-
import { Badge } from "./badge";
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: "Primitives/Badge",
|
|
8
|
-
component: Badge,
|
|
9
|
-
tags: ["autodocs"],
|
|
10
|
-
argTypes: {
|
|
11
|
-
variant: {
|
|
12
|
-
control: "select",
|
|
13
|
-
options: ["default", "secondary", "destructive", "outline"],
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
} satisfies Meta<typeof Badge>;
|
|
17
|
-
|
|
18
|
-
export default meta;
|
|
19
|
-
type Story = StoryObj<typeof meta>;
|
|
20
|
-
|
|
21
|
-
export const Default: Story = {
|
|
22
|
-
args: { children: "Badge" },
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const Variants: Story = {
|
|
26
|
-
render: () => (
|
|
27
|
-
<div className="flex flex-wrap gap-3">
|
|
28
|
-
<Badge variant="default">
|
|
29
|
-
<LucideDiamond className="size-3" />
|
|
30
|
-
Default
|
|
31
|
-
</Badge>
|
|
32
|
-
<Badge variant="secondary">
|
|
33
|
-
<LucideNut className="size-3" />
|
|
34
|
-
Secondary
|
|
35
|
-
</Badge>
|
|
36
|
-
<Badge variant="destructive">
|
|
37
|
-
<LucideAlertCircle className="size-3" />
|
|
38
|
-
Destructive
|
|
39
|
-
</Badge>
|
|
40
|
-
<Badge variant="outline">Outline</Badge>
|
|
41
|
-
</div>
|
|
42
|
-
),
|
|
43
|
-
};
|
|
@@ -1,43 +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 badgeVariants = cva(
|
|
7
|
-
"state-settle inline-flex w-fit shrink-0 items-center justify-center gap-2 overflow-hidden whitespace-nowrap rounded border border-transparent px-1.5 py-px text-xs font-medium [&>svg]:size-3 [&>svg]:pointer-events-none aria-invalid:border-destructive aria-invalid:ring-destructive/20",
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
12
|
-
secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/80",
|
|
13
|
-
destructive: "bg-destructive text-destructive-foreground [a&]:hover:bg-destructive/90",
|
|
14
|
-
outline: "border-border text-foreground [a&]:hover:bg-muted",
|
|
15
|
-
ghost: "bg-transparent text-foreground [a&]:hover:bg-muted",
|
|
16
|
-
link: "text-foreground underline-offset-4 [a&]:hover:underline",
|
|
17
|
-
/** Quiet metadata marker for real reference IDs (case/appointment/feed
|
|
18
|
-
* numbers) — never for decorative sequence markers. */
|
|
19
|
-
ref: "ref-tag border-transparent bg-transparent px-0 py-0 font-normal",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
defaultVariants: {
|
|
23
|
-
variant: "default",
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
function Badge({
|
|
29
|
-
className,
|
|
30
|
-
variant = "default",
|
|
31
|
-
...props
|
|
32
|
-
}: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants>) {
|
|
33
|
-
return (
|
|
34
|
-
<span
|
|
35
|
-
data-slot="badge"
|
|
36
|
-
data-variant={variant}
|
|
37
|
-
className={cn(badgeVariants({ variant }), className)}
|
|
38
|
-
{...props}
|
|
39
|
-
/>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { Badge, badgeVariants };
|