@ponti-studios/ui 0.1.2 → 0.3.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/LICENSE +21 -0
- package/README.md +7 -7
- package/THIRD_PARTY_NOTICES.md +17 -0
- package/dist/index.js +1028 -638
- package/dist/index.js.map +1 -1
- package/package.json +30 -32
- package/src/animations.css +16 -434
- package/src/components/data-display/accordion.tsx +10 -7
- package/src/components/data-display/filter-chip.tsx +2 -2
- package/src/components/data-display/index.ts +5 -0
- package/src/components/data-display/metric-card.stories.tsx +48 -0
- package/src/components/data-display/metric-card.tsx +20 -0
- package/src/components/data-display/sort-controls.stories.tsx +45 -0
- package/src/components/data-display/sort-controls.tsx +99 -0
- package/src/components/data-display/sort-row.tsx +74 -0
- package/src/components/data-display/table.tsx +5 -5
- package/src/components/feedback/alert.tsx +4 -4
- package/src/components/feedback/empty-state.tsx +6 -6
- package/src/components/feedback/file-upload-status-badge.stories.tsx +28 -0
- package/src/components/feedback/file-upload-status-badge.tsx +33 -0
- package/src/components/feedback/file-upload-status.stories.tsx +57 -0
- package/src/components/feedback/file-upload-status.tsx +152 -0
- package/src/components/feedback/index.ts +9 -0
- package/src/components/feedback/progress-bar.stories.tsx +39 -0
- package/src/components/feedback/progress-bar.tsx +21 -0
- package/src/components/feedback/progress.stories.tsx +8 -6
- package/src/components/feedback/progress.tsx +1 -1
- package/src/components/feedback/skeleton.stories.tsx +36 -0
- package/src/components/feedback/skeleton.tsx +7 -0
- package/src/components/feedback/spinner.tsx +2 -2
- package/src/components/feedback/update-guard.stories.tsx +32 -0
- package/src/components/feedback/update-guard.tsx +280 -0
- package/src/components/forms/calendar.tsx +11 -11
- package/src/components/forms/date-month-select.stories.tsx +26 -0
- package/src/components/forms/date-month-select.tsx +70 -0
- package/src/components/forms/date-picker.tsx +3 -3
- package/src/components/forms/drop-zone.stories.tsx +56 -0
- package/src/components/forms/drop-zone.tsx +146 -0
- package/src/components/forms/entity-select.stories.tsx +65 -0
- package/src/components/forms/entity-select.tsx +79 -0
- package/src/components/forms/field.tsx +3 -3
- package/src/components/forms/group-by-select.stories.tsx +26 -0
- package/src/components/forms/group-by-select.tsx +47 -0
- package/src/components/forms/index.ts +10 -0
- package/src/components/forms/input.stories.tsx +4 -4
- package/src/components/forms/input.tsx +1 -1
- package/src/components/forms/passkey-management.stories.tsx +81 -0
- package/src/components/forms/passkey-management.tsx +138 -0
- package/src/components/forms/radio-group.tsx +14 -13
- package/src/components/forms/select.stories.tsx +4 -4
- package/src/components/forms/select.tsx +45 -53
- package/src/components/forms/slider.stories.tsx +5 -2
- package/src/components/forms/slider.tsx +27 -17
- package/src/components/forms/stepper.tsx +4 -4
- package/src/components/forms/switch.stories.tsx +1 -1
- package/src/components/forms/switch.tsx +2 -2
- package/src/components/forms/textarea.stories.tsx +2 -2
- package/src/components/forms/textarea.tsx +1 -1
- package/src/components/layout/index.ts +3 -0
- package/src/components/layout/scroll-area.stories.tsx +4 -4
- package/src/components/layout/scroll-area.tsx +23 -21
- package/src/components/layout/section-intro.stories.tsx +29 -0
- package/src/components/layout/section-intro.tsx +31 -0
- package/src/components/layout/surface-panel.stories.tsx +32 -0
- package/src/components/layout/surface-panel.tsx +15 -0
- package/src/components/navigation/app-navigation.stories.tsx +2 -2
- package/src/components/navigation/app-navigation.tsx +13 -13
- package/src/components/navigation/index.ts +4 -0
- package/src/components/navigation/pagination-controls.stories.tsx +41 -0
- package/src/components/navigation/pagination-controls.tsx +50 -0
- package/src/components/navigation/route-link.stories.tsx +30 -0
- package/src/components/navigation/route-link.tsx +42 -0
- package/src/components/navigation/tabs.stories.tsx +5 -5
- package/src/components/navigation/tabs.tsx +7 -7
- package/src/components/overlays/alert-dialog.tsx +21 -46
- package/src/components/overlays/command.tsx +51 -82
- package/src/components/overlays/dialog.tsx +5 -5
- package/src/components/overlays/dropdown-menu.stories.tsx +0 -5
- package/src/components/overlays/dropdown-menu.tsx +44 -142
- package/src/components/overlays/popover.stories.tsx +2 -2
- package/src/components/overlays/popover.tsx +34 -16
- package/src/components/overlays/sheet.stories.tsx +2 -2
- package/src/components/overlays/sheet.tsx +35 -17
- package/src/components/primitives/avatar.tsx +3 -3
- package/src/components/primitives/badge.tsx +7 -11
- package/src/components/primitives/button.tsx +41 -13
- package/src/components/primitives/card.stories.tsx +2 -2
- package/src/components/primitives/card.tsx +2 -2
- package/src/components/primitives/index.ts +2 -0
- package/src/components/primitives/label.stories.tsx +1 -1
- package/src/components/primitives/label.tsx +5 -6
- package/src/components/primitives/status-badge.stories.tsx +52 -0
- package/src/components/primitives/status-badge.tsx +33 -0
- package/src/constants/chart-colors.ts +5 -5
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-sort.ts +20 -0
- package/src/index.ts +30 -11
- package/src/styles.css +76 -1040
- package/src/tokens/color-systems.stories.tsx +9 -119
- package/src/tokens/foundations.stories.tsx +21 -113
- package/src/tokens/generated/dark.colors.generated.ts +56 -0
- package/src/tokens/generated/dark.css +54 -0
- package/src/tokens/generated/foundations.css +148 -0
- package/src/tokens/generated/foundations.generated.ts +443 -0
- package/src/tokens/generated/light.colors.generated.ts +56 -0
- package/src/tokens/generated/light.css +54 -0
- package/src/tokens/index.ts +74 -16
- package/src/tokens/layout.stories.tsx +3 -108
- package/src/tokens/colors.ts +0 -156
- package/src/tokens/motion.ts +0 -51
- package/src/tokens/radii.ts +0 -10
- package/src/tokens/shadows.ts +0 -34
- package/src/tokens/spacing.ts +0 -30
- package/src/tokens/typography.ts +0 -42
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ElementType } from "react";
|
|
2
|
+
|
|
3
|
+
type SurfacePanelProps<T extends ElementType = "div"> = { as?: T } & Omit<
|
|
4
|
+
ComponentPropsWithoutRef<T>,
|
|
5
|
+
"as" | "className"
|
|
6
|
+
>;
|
|
7
|
+
|
|
8
|
+
/** Rounded, bordered surface panel — a generic content container. */
|
|
9
|
+
export function SurfacePanel<T extends ElementType = "div">({
|
|
10
|
+
as,
|
|
11
|
+
...props
|
|
12
|
+
}: SurfacePanelProps<T>) {
|
|
13
|
+
const Component = as ?? "div";
|
|
14
|
+
return <Component className="border-border bg-surface rounded-3xl border p-5" {...props} />;
|
|
15
|
+
}
|
|
@@ -33,8 +33,8 @@ function PageContent({
|
|
|
33
33
|
message?: string;
|
|
34
34
|
}) {
|
|
35
35
|
return (
|
|
36
|
-
<div
|
|
37
|
-
<p
|
|
36
|
+
<div className="p-8">
|
|
37
|
+
<p className="text-muted-foreground text-sm">{message}</p>
|
|
38
38
|
</div>
|
|
39
39
|
);
|
|
40
40
|
}
|
|
@@ -72,10 +72,10 @@ export function AppNavigation({
|
|
|
72
72
|
...linkProps,
|
|
73
73
|
...(linkProp === "to" ? { to: href } : { href }),
|
|
74
74
|
className: brand
|
|
75
|
-
? "
|
|
75
|
+
? "inline-flex min-h-11 shrink-0 items-center rounded-md px-3 py-2 text-sm font-medium"
|
|
76
76
|
: variant
|
|
77
|
-
? "
|
|
78
|
-
: "
|
|
77
|
+
? "inline-flex min-h-11 shrink-0 items-center justify-center rounded-md px-3 py-2 text-sm font-medium"
|
|
78
|
+
: "inline-flex min-h-11 shrink-0 items-center rounded-md px-3 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground",
|
|
79
79
|
"aria-current": active ? "page" : undefined,
|
|
80
80
|
"data-variant": variant,
|
|
81
81
|
},
|
|
@@ -83,14 +83,14 @@ export function AppNavigation({
|
|
|
83
83
|
);
|
|
84
84
|
|
|
85
85
|
return (
|
|
86
|
-
<header className="
|
|
87
|
-
<nav className="
|
|
88
|
-
<div className="
|
|
89
|
-
<div className="
|
|
86
|
+
<header className="sticky top-0 z-50 flex w-full justify-center border-b bg-background/95 px-4 backdrop-blur supports-[backdrop-filter]:bg-background/60">
|
|
87
|
+
<nav className="w-full max-w-7xl" aria-label={ariaLabel}>
|
|
88
|
+
<div className="flex min-h-14 items-center justify-between gap-6">
|
|
89
|
+
<div className="flex min-w-0 items-center">
|
|
90
90
|
{brand && createLink({ href: brandHref, children: brand, brand: true })}
|
|
91
91
|
</div>
|
|
92
92
|
|
|
93
|
-
<div className="
|
|
93
|
+
<div className="ml-auto hidden min-w-0 items-center gap-1 sm:flex">
|
|
94
94
|
{links?.map((link) => (
|
|
95
95
|
<React.Fragment key={link.href}>
|
|
96
96
|
{createLink({ href: link.href, children: link.label, active: isActive(link.href) })}
|
|
@@ -105,7 +105,7 @@ export function AppNavigation({
|
|
|
105
105
|
{endContent}
|
|
106
106
|
</div>
|
|
107
107
|
|
|
108
|
-
<div className="
|
|
108
|
+
<div className="ml-auto flex items-center sm:hidden">
|
|
109
109
|
<Sheet open={mobileOpen} onOpenChange={setMobileOpen}>
|
|
110
110
|
<SheetTrigger asChild>
|
|
111
111
|
<Button
|
|
@@ -116,10 +116,10 @@ export function AppNavigation({
|
|
|
116
116
|
<Menu className="size-4" aria-hidden="true" />
|
|
117
117
|
</Button>
|
|
118
118
|
</SheetTrigger>
|
|
119
|
-
<SheetContent
|
|
119
|
+
<SheetContent>
|
|
120
120
|
<SheetTitle className="sr-only">Navigation menu</SheetTitle>
|
|
121
121
|
|
|
122
|
-
<div className="
|
|
122
|
+
<div className="mt-8 flex flex-1 flex-col gap-1">
|
|
123
123
|
{links?.map((link) => (
|
|
124
124
|
<SheetClose asChild key={link.href}>
|
|
125
125
|
{createLink({
|
|
@@ -132,7 +132,7 @@ export function AppNavigation({
|
|
|
132
132
|
</div>
|
|
133
133
|
|
|
134
134
|
{(cta || endContent) && (
|
|
135
|
-
<div className="
|
|
135
|
+
<div className="flex flex-col gap-4 border-t pt-4">
|
|
136
136
|
{cta && (
|
|
137
137
|
<SheetClose asChild>
|
|
138
138
|
{createLink({
|
|
@@ -142,7 +142,7 @@ export function AppNavigation({
|
|
|
142
142
|
})}
|
|
143
143
|
</SheetClose>
|
|
144
144
|
)}
|
|
145
|
-
{endContent && <div className="
|
|
145
|
+
{endContent && <div className="flex items-center gap-3">{endContent}</div>}
|
|
146
146
|
</div>
|
|
147
147
|
)}
|
|
148
148
|
</SheetContent>
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export { AppNavigation } from "./app-navigation";
|
|
2
2
|
export type { AppNavigationCta, AppNavigationLink, AppNavigationProps } from "./app-navigation";
|
|
3
|
+
export { PaginationControls } from "./pagination-controls";
|
|
4
|
+
export type { PaginationControlsProps } from "./pagination-controls";
|
|
5
|
+
export { RouteLink } from "./route-link";
|
|
6
|
+
export type { RouteLinkProps } from "./route-link";
|
|
3
7
|
export { Tabs, TabsContent, TabsList, TabsTrigger } from "./tabs";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
|
|
4
|
+
import { PaginationControls } from "./pagination-controls";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Navigation/PaginationControls",
|
|
8
|
+
component: PaginationControls,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
} satisfies Meta<typeof PaginationControls>;
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
|
|
15
|
+
function PaginationPreview({ totalPages }: { totalPages: number }) {
|
|
16
|
+
const [currentPage, setCurrentPage] = useState(0);
|
|
17
|
+
return (
|
|
18
|
+
<PaginationControls
|
|
19
|
+
currentPage={currentPage}
|
|
20
|
+
totalPages={totalPages}
|
|
21
|
+
onPageChange={setCurrentPage}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const baseArgs = {
|
|
27
|
+
currentPage: 0,
|
|
28
|
+
totalPages: 5,
|
|
29
|
+
onPageChange: () => {},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const Default: Story = {
|
|
33
|
+
args: baseArgs,
|
|
34
|
+
render: () => <PaginationPreview totalPages={5} />,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const SinglePage: Story = {
|
|
38
|
+
name: "Single page (renders nothing)",
|
|
39
|
+
args: { ...baseArgs, totalPages: 1 },
|
|
40
|
+
render: () => <PaginationPreview totalPages={1} />,
|
|
41
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
2
|
+
|
|
3
|
+
import { Button } from "../primitives/button";
|
|
4
|
+
|
|
5
|
+
export interface PaginationControlsProps {
|
|
6
|
+
currentPage: number;
|
|
7
|
+
totalPages: number;
|
|
8
|
+
onPageChange: (page: number) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Zero-indexed prev/next pagination control. Renders nothing for a single page. */
|
|
12
|
+
export function PaginationControls({
|
|
13
|
+
currentPage,
|
|
14
|
+
totalPages,
|
|
15
|
+
onPageChange,
|
|
16
|
+
}: PaginationControlsProps) {
|
|
17
|
+
if (totalPages <= 1) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div className="text-sm text-muted-foreground flex items-center justify-end gap-2">
|
|
23
|
+
<Button
|
|
24
|
+
type="button"
|
|
25
|
+
variant="outline"
|
|
26
|
+
size="sm"
|
|
27
|
+
className="border-dashed"
|
|
28
|
+
onClick={() => onPageChange(currentPage - 1)}
|
|
29
|
+
disabled={currentPage === 0}
|
|
30
|
+
>
|
|
31
|
+
<ChevronLeft className="size-4" aria-hidden />
|
|
32
|
+
Previous
|
|
33
|
+
</Button>
|
|
34
|
+
<span className="text-xs text-foreground">
|
|
35
|
+
Page {currentPage + 1} of {totalPages}
|
|
36
|
+
</span>
|
|
37
|
+
<Button
|
|
38
|
+
type="button"
|
|
39
|
+
variant="outline"
|
|
40
|
+
size="sm"
|
|
41
|
+
className="border-dashed"
|
|
42
|
+
onClick={() => onPageChange(currentPage + 1)}
|
|
43
|
+
disabled={currentPage >= totalPages - 1}
|
|
44
|
+
>
|
|
45
|
+
Next
|
|
46
|
+
<ChevronRight className="size-4" aria-hidden />
|
|
47
|
+
</Button>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
import { RouteLink } from "./route-link";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Navigation/RouteLink",
|
|
7
|
+
component: RouteLink,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
} satisfies Meta<typeof RouteLink>;
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
|
|
14
|
+
export const Default: Story = {
|
|
15
|
+
args: {
|
|
16
|
+
children: "View accounts",
|
|
17
|
+
href: "#",
|
|
18
|
+
className: "text-accent underline",
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const WithOnNavigate: Story = {
|
|
23
|
+
name: "With onNavigate callback",
|
|
24
|
+
args: {
|
|
25
|
+
children: "Go to analytics",
|
|
26
|
+
href: "#",
|
|
27
|
+
className: "text-accent underline",
|
|
28
|
+
onNavigate: () => console.log("route loading started"),
|
|
29
|
+
},
|
|
30
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ElementType, MouseEvent, ReactNode } from "react";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
|
|
4
|
+
type RouteLinkOwnProps<T extends ElementType> = {
|
|
5
|
+
as?: T;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Called before the click is forwarded — e.g. to flip a route-loading store. */
|
|
8
|
+
onNavigate?: () => void;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type RouteLinkProps<T extends ElementType = "a"> = RouteLinkOwnProps<T> &
|
|
12
|
+
Omit<ComponentPropsWithoutRef<T>, keyof RouteLinkOwnProps<T>>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Polymorphic link that fires `onNavigate` before `onClick`. Pass your
|
|
16
|
+
* router's `Link` component as `as` for client-side navigation (e.g.
|
|
17
|
+
* `as={Link} to="/accounts"`); the host app owns any route-loading state via
|
|
18
|
+
* `onNavigate` instead of a hardcoded store.
|
|
19
|
+
*/
|
|
20
|
+
export function RouteLink<T extends ElementType = "a">({
|
|
21
|
+
as,
|
|
22
|
+
children,
|
|
23
|
+
onNavigate,
|
|
24
|
+
onClick,
|
|
25
|
+
...props
|
|
26
|
+
}: RouteLinkProps<T>) {
|
|
27
|
+
const Component = (as ?? "a") as ElementType;
|
|
28
|
+
|
|
29
|
+
const handleClick = useCallback(
|
|
30
|
+
(e: MouseEvent) => {
|
|
31
|
+
onNavigate?.();
|
|
32
|
+
(onClick as ((e: MouseEvent) => void) | undefined)?.(e);
|
|
33
|
+
},
|
|
34
|
+
[onNavigate, onClick],
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Component onClick={handleClick} {...props}>
|
|
39
|
+
{children}
|
|
40
|
+
</Component>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -19,12 +19,12 @@ export const Default: Story = {
|
|
|
19
19
|
<TabsTrigger value="password">Password</TabsTrigger>
|
|
20
20
|
</TabsList>
|
|
21
21
|
<TabsContent value="account">
|
|
22
|
-
<p className="text-
|
|
22
|
+
<p className="text-muted-foreground p-4 text-sm">
|
|
23
23
|
Make changes to your account here. Click save when you're done.
|
|
24
24
|
</p>
|
|
25
25
|
</TabsContent>
|
|
26
26
|
<TabsContent value="password">
|
|
27
|
-
<p className="text-
|
|
27
|
+
<p className="text-muted-foreground p-4 text-sm">
|
|
28
28
|
Change your password here. After saving, you'll be logged out.
|
|
29
29
|
</p>
|
|
30
30
|
</TabsContent>
|
|
@@ -41,13 +41,13 @@ export const LineVariant: Story = {
|
|
|
41
41
|
<TabsTrigger value="tab3">Reports</TabsTrigger>
|
|
42
42
|
</TabsList>
|
|
43
43
|
<TabsContent value="tab1">
|
|
44
|
-
<p className="text-
|
|
44
|
+
<p className="text-muted-foreground p-4 text-sm">Overview content</p>
|
|
45
45
|
</TabsContent>
|
|
46
46
|
<TabsContent value="tab2">
|
|
47
|
-
<p className="text-
|
|
47
|
+
<p className="text-muted-foreground p-4 text-sm">Analytics content</p>
|
|
48
48
|
</TabsContent>
|
|
49
49
|
<TabsContent value="tab3">
|
|
50
|
-
<p className="text-
|
|
50
|
+
<p className="text-muted-foreground p-4 text-sm">Reports content</p>
|
|
51
51
|
</TabsContent>
|
|
52
52
|
</Tabs>
|
|
53
53
|
),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
|
|
4
4
|
import { cn } from "../../lib/utils";
|
|
@@ -12,7 +12,7 @@ function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimi
|
|
|
12
12
|
<TabsPrimitive.List
|
|
13
13
|
data-slot="tabs-list"
|
|
14
14
|
className={cn(
|
|
15
|
-
"bg-
|
|
15
|
+
"bg-muted flex h-auto w-full items-center gap-1 rounded-full border p-1",
|
|
16
16
|
className,
|
|
17
17
|
)}
|
|
18
18
|
{...props}
|
|
@@ -20,12 +20,12 @@ function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimi
|
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.
|
|
23
|
+
function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Tab>) {
|
|
24
24
|
return (
|
|
25
|
-
<TabsPrimitive.
|
|
25
|
+
<TabsPrimitive.Tab
|
|
26
26
|
data-slot="tabs-trigger"
|
|
27
27
|
className={cn(
|
|
28
|
-
"text-
|
|
28
|
+
"text-foreground focus-visible:ring-ring data-active:bg-background data-active:text-foreground data-active:border-border flex flex-1 items-center justify-center gap-2 rounded-full px-3 py-2 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-active:border",
|
|
29
29
|
className,
|
|
30
30
|
)}
|
|
31
31
|
{...props}
|
|
@@ -33,9 +33,9 @@ function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPr
|
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.
|
|
36
|
+
function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Panel>) {
|
|
37
37
|
return (
|
|
38
|
-
<TabsPrimitive.
|
|
38
|
+
<TabsPrimitive.Panel
|
|
39
39
|
data-slot="tabs-content"
|
|
40
40
|
className={cn(
|
|
41
41
|
"focus-visible:bg-accent/10 mt-2 rounded-md focus-visible:border focus-visible:outline-none",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
|
|
4
4
|
import { cn } from "../../lib/utils";
|
|
@@ -7,104 +7,78 @@ import { buttonVariants } from "../primitives/button";
|
|
|
7
7
|
const AlertDialog = AlertDialogPrimitive.Root;
|
|
8
8
|
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
9
9
|
|
|
10
|
-
const AlertDialogPortal = ({ children, ...props }: AlertDialogPrimitive.
|
|
10
|
+
const AlertDialogPortal = ({ children, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) => (
|
|
11
11
|
<AlertDialogPrimitive.Portal {...props}>
|
|
12
|
-
<div className="fixed inset-0 z-50 flex items-end justify-center sm:items-center">
|
|
13
|
-
{children}
|
|
14
|
-
</div>
|
|
12
|
+
<div className="fixed inset-0 z-50 flex items-end justify-center sm:items-center">{children}</div>
|
|
15
13
|
</AlertDialogPrimitive.Portal>
|
|
16
14
|
);
|
|
17
|
-
AlertDialogPortal.displayName = AlertDialogPrimitive.Portal.displayName;
|
|
18
15
|
|
|
19
16
|
const AlertDialogOverlay = React.forwardRef<
|
|
20
|
-
React.ComponentRef<typeof AlertDialogPrimitive.
|
|
21
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.
|
|
17
|
+
React.ComponentRef<typeof AlertDialogPrimitive.Backdrop>,
|
|
18
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Backdrop>
|
|
22
19
|
>(({ className, ...props }, ref) => (
|
|
23
|
-
<AlertDialogPrimitive.
|
|
20
|
+
<AlertDialogPrimitive.Backdrop
|
|
24
21
|
ref={ref}
|
|
25
22
|
className={cn(
|
|
26
|
-
"
|
|
23
|
+
"bg-black/80 data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 fixed inset-0 z-50 transition-opacity",
|
|
27
24
|
className,
|
|
28
25
|
)}
|
|
29
26
|
{...props}
|
|
30
27
|
/>
|
|
31
28
|
));
|
|
32
|
-
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
33
29
|
|
|
34
30
|
const AlertDialogContent = React.forwardRef<
|
|
35
|
-
React.ComponentRef<typeof AlertDialogPrimitive.
|
|
36
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.
|
|
31
|
+
React.ComponentRef<typeof AlertDialogPrimitive.Popup>,
|
|
32
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Popup>
|
|
37
33
|
>(({ className, ...props }, ref) => (
|
|
38
34
|
<AlertDialogPortal>
|
|
39
35
|
<AlertDialogOverlay />
|
|
40
|
-
<AlertDialogPrimitive.
|
|
36
|
+
<AlertDialogPrimitive.Popup
|
|
41
37
|
ref={ref}
|
|
42
38
|
className={cn(
|
|
43
|
-
"bg-
|
|
39
|
+
"bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 border sm:data-open:slide-in-from-bottom-0 fixed bottom-0 z-50 grid w-full max-w-lg gap-6 rounded-t-xl p-4 outline-none sm:top-[50%] sm:right-auto sm:bottom-auto sm:left-[50%] sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-xl sm:p-6",
|
|
44
40
|
className,
|
|
45
41
|
)}
|
|
46
42
|
{...props}
|
|
47
43
|
/>
|
|
48
44
|
</AlertDialogPortal>
|
|
49
45
|
));
|
|
50
|
-
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
51
46
|
|
|
52
47
|
function AlertDialogHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
|
|
53
48
|
return <div className={cn("flex flex-col gap-2 text-left", className)} {...props} />;
|
|
54
49
|
}
|
|
55
50
|
|
|
56
51
|
function AlertDialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
|
|
57
|
-
return (
|
|
58
|
-
<div
|
|
59
|
-
className={cn("flex flex-col-reverse gap-3 sm:flex-row sm:justify-end", className)}
|
|
60
|
-
{...props}
|
|
61
|
-
/>
|
|
62
|
-
);
|
|
52
|
+
return <div className={cn("flex flex-col-reverse gap-3 sm:flex-row sm:justify-end", className)} {...props} />;
|
|
63
53
|
}
|
|
64
54
|
|
|
65
55
|
const AlertDialogTitle = React.forwardRef<
|
|
66
56
|
React.ComponentRef<typeof AlertDialogPrimitive.Title>,
|
|
67
57
|
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
68
58
|
>(({ className, ...props }, ref) => (
|
|
69
|
-
<AlertDialogPrimitive.Title
|
|
70
|
-
ref={ref}
|
|
71
|
-
className={cn("heading-2 text-primary", className)}
|
|
72
|
-
{...props}
|
|
73
|
-
/>
|
|
59
|
+
<AlertDialogPrimitive.Title ref={ref} className={cn("text-lg font-semibold tracking-tight", className)} {...props} />
|
|
74
60
|
));
|
|
75
|
-
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
76
61
|
|
|
77
62
|
const AlertDialogDescription = React.forwardRef<
|
|
78
63
|
React.ComponentRef<typeof AlertDialogPrimitive.Description>,
|
|
79
64
|
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
80
65
|
>(({ className, ...props }, ref) => (
|
|
81
|
-
<AlertDialogPrimitive.Description
|
|
82
|
-
ref={ref}
|
|
83
|
-
className={cn("body-2 text-secondary max-w-prose", className)}
|
|
84
|
-
{...props}
|
|
85
|
-
/>
|
|
66
|
+
<AlertDialogPrimitive.Description ref={ref} className={cn("max-w-prose text-sm text-muted-foreground", className)} {...props} />
|
|
86
67
|
));
|
|
87
|
-
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
88
68
|
|
|
89
69
|
const AlertDialogAction = React.forwardRef<
|
|
90
|
-
React.ComponentRef<typeof AlertDialogPrimitive.
|
|
91
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.
|
|
70
|
+
React.ComponentRef<typeof AlertDialogPrimitive.Close>,
|
|
71
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Close>
|
|
92
72
|
>(({ className, ...props }, ref) => (
|
|
93
|
-
<AlertDialogPrimitive.
|
|
73
|
+
<AlertDialogPrimitive.Close ref={ref} className={cn(buttonVariants(), className)} {...props} />
|
|
94
74
|
));
|
|
95
|
-
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
96
75
|
|
|
97
76
|
const AlertDialogCancel = React.forwardRef<
|
|
98
|
-
React.ComponentRef<typeof AlertDialogPrimitive.
|
|
99
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.
|
|
77
|
+
React.ComponentRef<typeof AlertDialogPrimitive.Close>,
|
|
78
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Close>
|
|
100
79
|
>(({ className, ...props }, ref) => (
|
|
101
|
-
<AlertDialogPrimitive.
|
|
102
|
-
ref={ref}
|
|
103
|
-
className={cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className)}
|
|
104
|
-
{...props}
|
|
105
|
-
/>
|
|
80
|
+
<AlertDialogPrimitive.Close ref={ref} className={cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className)} {...props} />
|
|
106
81
|
));
|
|
107
|
-
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
108
82
|
|
|
109
83
|
export {
|
|
110
84
|
AlertDialog,
|
|
@@ -114,6 +88,7 @@ export {
|
|
|
114
88
|
AlertDialogDescription,
|
|
115
89
|
AlertDialogFooter,
|
|
116
90
|
AlertDialogHeader,
|
|
91
|
+
AlertDialogOverlay,
|
|
117
92
|
AlertDialogTitle,
|
|
118
93
|
AlertDialogTrigger,
|
|
119
94
|
};
|