@atelic-action/ui 0.17.2 → 1.1.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 +432 -45
- package/bin/atelic-check-base-path.ts +5 -0
- package/bin/atelic-clean-sitemap.ts +5 -0
- package/bin/atelic-contact-canary.ts +5 -0
- package/bin/atelic-print-sheets.sh +1 -1
- package/bin/atelic-seal-document.mjs +1 -1
- package/bin/atelic-serve-static.ts +1 -1
- package/dist/gate/index.d.ts +1 -1
- package/dist/gate/index.js +1 -1
- package/dist/gate/middleware.d.ts +4 -1
- package/dist/gate/middleware.js +14 -5
- package/dist/gate/wall.d.ts +25 -0
- package/dist/gate/wall.js +41 -2
- package/dist/routing/basePath.d.ts +24 -0
- package/dist/routing/basePath.js +54 -0
- package/dist/vite/index.d.ts +3 -2
- package/dist/vite/index.js +3 -2
- package/dist/vite/marketing-config.d.ts +50 -0
- package/dist/vite/marketing-config.js +83 -0
- package/package.json +164 -5
- package/src/app/AppProvider.tsx +41 -0
- package/src/app/AuthGuard.tsx +27 -0
- package/src/app/CardErrorBoundary.tsx +39 -0
- package/src/app/ErrorFallback.tsx +39 -0
- package/src/app/GoogleGlyph.tsx +22 -0
- package/src/app/config.ts +54 -0
- package/src/app/configure.ts +18 -0
- package/src/app/context/AppContext.tsx +52 -0
- package/src/app/context/SidebarContext.tsx +124 -0
- package/src/app/context/UserContext.tsx +139 -0
- package/src/app/hooks/useDebounce.ts +12 -0
- package/src/app/hooks/useIsDesktop.ts +31 -0
- package/src/app/hooks/useWakeLock.ts +49 -0
- package/src/app/index.ts +64 -0
- package/src/app/layout/ActionButton.tsx +67 -0
- package/src/app/layout/AppLayout.tsx +110 -0
- package/src/app/layout/AppPage.tsx +268 -0
- package/src/app/layout/Breadcrumbs.tsx +57 -0
- package/src/app/layout/DesktopRail.tsx +168 -0
- package/src/app/layout/FormActionButtons.tsx +69 -0
- package/src/app/layout/MobileMenu.tsx +156 -0
- package/src/app/layout/MobileTabBar.tsx +43 -0
- package/src/app/layout/PageError.tsx +30 -0
- package/src/app/layout/PageSkeleton.tsx +65 -0
- package/src/app/layout/SectionCards.tsx +33 -0
- package/src/app/layout/UserMenu.tsx +104 -0
- package/src/app/layout/identity.ts +22 -0
- package/src/app/layout/index.ts +20 -0
- package/src/app/layout/nav.ts +52 -0
- package/src/app/lib/dates.ts +57 -0
- package/src/app/lib/env.ts +37 -0
- package/src/app/lib/format.ts +61 -0
- package/src/app/lib/http.ts +205 -0
- package/src/app/lib/lastAuth.ts +45 -0
- package/src/app/lib/oauth.ts +32 -0
- package/src/app/lib/publicRoutes.ts +33 -0
- package/src/app/lib/queryClient.ts +38 -0
- package/src/app/lib/search.ts +17 -0
- package/src/app/lib/session.ts +36 -0
- package/src/app/lib/tokenRefresh.ts +137 -0
- package/src/app/lib/transformKeys.ts +60 -0
- package/src/app/lib/units.ts +228 -0
- package/src/app/lib/unwrap.ts +48 -0
- package/src/app/lib/utils.ts +10 -0
- package/src/app/stores/authStore.ts +80 -0
- package/src/app/stores/storage.ts +40 -0
- package/src/app/stores/unitsStore.ts +54 -0
- package/src/app/types/index.ts +72 -0
- package/src/app/types/query.ts +11 -0
- package/src/app/ui/accordion.tsx +54 -0
- package/src/app/ui/alert-dialog.tsx +114 -0
- package/src/app/ui/alert.tsx +49 -0
- package/src/app/ui/avatar.tsx +45 -0
- package/src/app/ui/badge-list.tsx +51 -0
- package/src/app/ui/badge.tsx +33 -0
- package/src/app/ui/button.tsx +49 -0
- package/src/app/ui/callout.tsx +22 -0
- package/src/app/ui/card.tsx +55 -0
- package/src/app/ui/checkbox.tsx +26 -0
- package/src/app/ui/clear-button.tsx +42 -0
- package/src/app/ui/command.tsx +140 -0
- package/src/app/ui/country-dropdown.tsx +184 -0
- package/src/app/ui/dialog.tsx +104 -0
- package/src/app/ui/dropdown-menu.tsx +185 -0
- package/src/app/ui/form.tsx +172 -0
- package/src/app/ui/index.ts +36 -0
- package/src/app/ui/input.tsx +22 -0
- package/src/app/ui/label.tsx +19 -0
- package/src/app/ui/option-select.tsx +56 -0
- package/src/app/ui/pagination.tsx +90 -0
- package/src/app/ui/popover.tsx +29 -0
- package/src/app/ui/progress.tsx +25 -0
- package/src/app/ui/search-input.tsx +63 -0
- package/src/app/ui/select.tsx +151 -0
- package/src/app/ui/separator.tsx +24 -0
- package/src/app/ui/sheet.tsx +119 -0
- package/src/app/ui/slider.tsx +23 -0
- package/src/app/ui/switch.tsx +27 -0
- package/src/app/ui/textarea.tsx +21 -0
- package/src/app/ui/tooltip.tsx +32 -0
- package/src/artifact/ArtifactShell.tsx +2 -2
- package/src/artifact/Gate.tsx +2 -2
- package/src/artifact/Note.tsx +9 -39
- package/src/artifact/Paragraph.tsx +65 -0
- package/src/artifact/Read.tsx +406 -0
- package/src/artifact/Writeup.tsx +7 -7
- package/src/artifact/index.ts +1 -0
- package/src/chrome/SiteShell.tsx +141 -0
- package/src/chrome/index.ts +2 -0
- package/src/components/Disclosure.tsx +80 -14
- package/src/components/GateLogin.tsx +1 -1
- package/src/components/Watermark.tsx +1 -1
- package/src/components/index.ts +6 -2
- package/src/gate/index.ts +1 -1
- package/src/gate/middleware.ts +17 -6
- package/src/gate/wall.ts +60 -2
- package/src/lib/basePathAudit.ts +96 -0
- package/src/lib/displayDate.ts +25 -0
- package/src/lib/honeypot.ts +11 -0
- package/src/lib/hours.ts +28 -0
- package/src/lib/sitemap.ts +34 -0
- package/src/lib/trackEvent.ts +26 -0
- package/src/lib/useOpenHeight.ts +28 -0
- package/src/primitives/Button.tsx +3 -1
- package/src/primitives/Chip.tsx +3 -1
- package/src/primitives/ImageFrame.tsx +48 -0
- package/src/primitives/ProseBlocks.tsx +67 -0
- package/src/primitives/QuoteCard.tsx +20 -0
- package/src/primitives/StarRow.tsx +37 -0
- package/src/primitives/TickList.tsx +24 -0
- package/src/primitives/index.ts +5 -0
- package/src/routing/BasePathProvider.tsx +47 -0
- package/src/routing/basePath.ts +57 -0
- package/src/routing/index.ts +8 -0
- package/src/scripts/check-base-path.ts +130 -0
- package/src/scripts/clean-sitemap.ts +27 -0
- package/src/scripts/contact-canary.ts +98 -0
- package/src/scripts/serve-static.ts +29 -3
- package/src/sections/BlogIndex.tsx +57 -0
- package/src/sections/BlogPost.tsx +65 -0
- package/src/sections/CTABanner.tsx +93 -0
- package/src/sections/CTASection.tsx +60 -0
- package/src/sections/ComparisonTable.tsx +114 -0
- package/src/sections/ContactForm.tsx +163 -0
- package/src/sections/ContactInfoCard.tsx +92 -0
- package/src/sections/CredentialList.tsx +28 -0
- package/src/sections/DeviceShowcase.tsx +39 -0
- package/src/sections/ExpandList.tsx +58 -0
- package/src/sections/FAQBrowser.tsx +283 -0
- package/src/sections/FeatureDetail.tsx +60 -0
- package/src/sections/FeatureGrid.tsx +83 -0
- package/src/sections/Gallery.tsx +84 -0
- package/src/sections/Hero.tsx +110 -0
- package/src/sections/HoursTable.tsx +23 -0
- package/src/sections/JumpRail.tsx +35 -0
- package/src/sections/LegalPage.tsx +43 -0
- package/src/sections/LocationSection.tsx +66 -0
- package/src/sections/Locations.tsx +71 -0
- package/src/sections/LogoMarquee.tsx +27 -0
- package/src/sections/MapEmbed.tsx +75 -0
- package/src/sections/MediaBand.tsx +20 -0
- package/src/sections/MenuList.tsx +44 -0
- package/src/sections/PageHero.tsx +25 -0
- package/src/sections/PressQuotes.tsx +51 -0
- package/src/sections/PricingBand.tsx +43 -0
- package/src/sections/PricingCard.tsx +36 -0
- package/src/sections/ProcessSteps.tsx +45 -0
- package/src/sections/ProfileCards.tsx +73 -0
- package/src/sections/RevealSlider.tsx +156 -0
- package/src/sections/ReviewCarousel.tsx +223 -0
- package/src/sections/ReviewWall.tsx +220 -0
- package/src/sections/SocialStrip.tsx +83 -0
- package/src/sections/SplitSection.tsx +56 -0
- package/src/sections/index.ts +76 -0
- package/src/sections/siteConfig.ts +201 -0
- package/src/styles/app.css +673 -0
- package/src/styles/artifact.css +759 -401
- package/src/styles/base.css +49 -47
- package/src/styles/chrome.css +71 -71
- package/src/styles/components.css +150 -140
- package/src/styles/gate.css +29 -29
- package/src/styles/primitives.css +190 -25
- package/src/styles/sections.css +2652 -0
- package/src/styles/star-rating.css +2 -2
- package/src/vite/index.ts +9 -2
- package/src/vite/marketing-config.ts +128 -0
- package/src/components/Collapsible.tsx +0 -43
- /package/src/scripts/{build-gate-payload.mjs → seal-document.mjs} +0 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
import { buttonVariants } from "./button";
|
|
5
|
+
|
|
6
|
+
const AlertDialog = AlertDialogPrimitive.Root;
|
|
7
|
+
|
|
8
|
+
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
9
|
+
|
|
10
|
+
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
11
|
+
|
|
12
|
+
const AlertDialogOverlay = React.forwardRef<
|
|
13
|
+
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
14
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
|
|
15
|
+
>(({ className, ...props }, ref) => (
|
|
16
|
+
<AlertDialogPrimitive.Overlay
|
|
17
|
+
className={cn(
|
|
18
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
19
|
+
className,
|
|
20
|
+
)}
|
|
21
|
+
{...props}
|
|
22
|
+
ref={ref}
|
|
23
|
+
/>
|
|
24
|
+
));
|
|
25
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
26
|
+
|
|
27
|
+
const AlertDialogContent = React.forwardRef<
|
|
28
|
+
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
29
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
|
|
30
|
+
>(({ className, ...props }, ref) => (
|
|
31
|
+
<AlertDialogPortal>
|
|
32
|
+
<AlertDialogOverlay />
|
|
33
|
+
<AlertDialogPrimitive.Content
|
|
34
|
+
ref={ref}
|
|
35
|
+
className={cn(
|
|
36
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
37
|
+
className,
|
|
38
|
+
)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
</AlertDialogPortal>
|
|
42
|
+
));
|
|
43
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
44
|
+
|
|
45
|
+
const AlertDialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
46
|
+
<div className={cn("flex flex-col space-y-2 text-center sm:text-left", className)} {...props} />
|
|
47
|
+
);
|
|
48
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
49
|
+
|
|
50
|
+
const AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
51
|
+
<div
|
|
52
|
+
className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)}
|
|
53
|
+
{...props}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
57
|
+
|
|
58
|
+
const AlertDialogTitle = React.forwardRef<
|
|
59
|
+
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
60
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
61
|
+
>(({ className, ...props }, ref) => (
|
|
62
|
+
<AlertDialogPrimitive.Title
|
|
63
|
+
ref={ref}
|
|
64
|
+
className={cn("text-lg font-semibold", className)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
));
|
|
68
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
69
|
+
|
|
70
|
+
const AlertDialogDescription = React.forwardRef<
|
|
71
|
+
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
72
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
73
|
+
>(({ className, ...props }, ref) => (
|
|
74
|
+
<AlertDialogPrimitive.Description
|
|
75
|
+
ref={ref}
|
|
76
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
77
|
+
{...props}
|
|
78
|
+
/>
|
|
79
|
+
));
|
|
80
|
+
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
81
|
+
|
|
82
|
+
const AlertDialogAction = React.forwardRef<
|
|
83
|
+
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
84
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
|
|
85
|
+
>(({ className, ...props }, ref) => (
|
|
86
|
+
<AlertDialogPrimitive.Action ref={ref} className={cn(buttonVariants(), className)} {...props} />
|
|
87
|
+
));
|
|
88
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
89
|
+
|
|
90
|
+
const AlertDialogCancel = React.forwardRef<
|
|
91
|
+
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
92
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
|
|
93
|
+
>(({ className, ...props }, ref) => (
|
|
94
|
+
<AlertDialogPrimitive.Cancel
|
|
95
|
+
ref={ref}
|
|
96
|
+
className={cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className)}
|
|
97
|
+
{...props}
|
|
98
|
+
/>
|
|
99
|
+
));
|
|
100
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
101
|
+
|
|
102
|
+
export {
|
|
103
|
+
AlertDialog,
|
|
104
|
+
AlertDialogAction,
|
|
105
|
+
AlertDialogCancel,
|
|
106
|
+
AlertDialogContent,
|
|
107
|
+
AlertDialogDescription,
|
|
108
|
+
AlertDialogFooter,
|
|
109
|
+
AlertDialogHeader,
|
|
110
|
+
AlertDialogOverlay,
|
|
111
|
+
AlertDialogPortal,
|
|
112
|
+
AlertDialogTitle,
|
|
113
|
+
AlertDialogTrigger,
|
|
114
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
|
|
6
|
+
const alertVariants = cva(
|
|
7
|
+
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-background text-foreground",
|
|
12
|
+
destructive:
|
|
13
|
+
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "default",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const Alert = React.forwardRef<
|
|
23
|
+
HTMLDivElement,
|
|
24
|
+
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
|
|
25
|
+
>(({ className, variant, ...props }, ref) => (
|
|
26
|
+
<div ref={ref} role="alert" className={cn(alertVariants({ variant }), className)} {...props} />
|
|
27
|
+
));
|
|
28
|
+
Alert.displayName = "Alert";
|
|
29
|
+
|
|
30
|
+
const AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(
|
|
31
|
+
({ className, ...props }, ref) => (
|
|
32
|
+
<h5
|
|
33
|
+
ref={ref}
|
|
34
|
+
className={cn("mb-1 font-medium leading-none tracking-tight", className)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
),
|
|
38
|
+
);
|
|
39
|
+
AlertTitle.displayName = "AlertTitle";
|
|
40
|
+
|
|
41
|
+
const AlertDescription = React.forwardRef<
|
|
42
|
+
HTMLParagraphElement,
|
|
43
|
+
React.HTMLAttributes<HTMLParagraphElement>
|
|
44
|
+
>(({ className, ...props }, ref) => (
|
|
45
|
+
<div ref={ref} className={cn("text-sm [&_p]:leading-relaxed", className)} {...props} />
|
|
46
|
+
));
|
|
47
|
+
AlertDescription.displayName = "AlertDescription";
|
|
48
|
+
|
|
49
|
+
export { Alert, AlertDescription, AlertTitle };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
|
|
6
|
+
const Avatar = React.forwardRef<
|
|
7
|
+
React.ElementRef<typeof AvatarPrimitive.Root>,
|
|
8
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
|
|
9
|
+
>(({ className, ...props }, ref) => (
|
|
10
|
+
<AvatarPrimitive.Root
|
|
11
|
+
ref={ref}
|
|
12
|
+
className={cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className)}
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
));
|
|
16
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
17
|
+
|
|
18
|
+
const AvatarImage = React.forwardRef<
|
|
19
|
+
React.ElementRef<typeof AvatarPrimitive.Image>,
|
|
20
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
|
21
|
+
>(({ className, ...props }, ref) => (
|
|
22
|
+
<AvatarPrimitive.Image
|
|
23
|
+
ref={ref}
|
|
24
|
+
className={cn("aspect-square h-full w-full", className)}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
));
|
|
28
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
29
|
+
|
|
30
|
+
const AvatarFallback = React.forwardRef<
|
|
31
|
+
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
|
32
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
|
33
|
+
>(({ className, ...props }, ref) => (
|
|
34
|
+
<AvatarPrimitive.Fallback
|
|
35
|
+
ref={ref}
|
|
36
|
+
className={cn(
|
|
37
|
+
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
38
|
+
className,
|
|
39
|
+
)}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
));
|
|
43
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
44
|
+
|
|
45
|
+
export { Avatar, AvatarFallback, AvatarImage };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { cn } from "../lib/utils";
|
|
3
|
+
import { Badge, type BadgeProps } from "./badge";
|
|
4
|
+
|
|
5
|
+
export interface BadgeItem {
|
|
6
|
+
label: string;
|
|
7
|
+
variant?: BadgeProps["variant"];
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface BadgeListProps {
|
|
12
|
+
items: BadgeItem[];
|
|
13
|
+
maxDisplay?: number;
|
|
14
|
+
maxWidth?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
badgeClassName?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function BadgeList({
|
|
20
|
+
items,
|
|
21
|
+
maxDisplay,
|
|
22
|
+
maxWidth = "max-w-24",
|
|
23
|
+
className,
|
|
24
|
+
badgeClassName,
|
|
25
|
+
}: BadgeListProps) {
|
|
26
|
+
if (items.length === 0) return null;
|
|
27
|
+
|
|
28
|
+
const displayItems = maxDisplay ? items.slice(0, maxDisplay) : items;
|
|
29
|
+
const remaining = maxDisplay && items.length > maxDisplay ? items.length - maxDisplay : 0;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div className={cn("flex flex-wrap items-center gap-1.5", className)}>
|
|
33
|
+
{displayItems.map((item, index) => (
|
|
34
|
+
<Badge
|
|
35
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: a label may repeat, and the list never reorders
|
|
36
|
+
key={`${item.label}-${index}`}
|
|
37
|
+
variant={item.variant ?? "outline"}
|
|
38
|
+
className={cn("shrink-0 gap-1", maxWidth, badgeClassName)}
|
|
39
|
+
>
|
|
40
|
+
{item.icon}
|
|
41
|
+
<span className="truncate">{item.label}</span>
|
|
42
|
+
</Badge>
|
|
43
|
+
))}
|
|
44
|
+
{remaining > 0 && (
|
|
45
|
+
<Badge variant="outline" className={cn("shrink-0", badgeClassName)}>
|
|
46
|
+
+{remaining}
|
|
47
|
+
</Badge>
|
|
48
|
+
)}
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
|
|
6
|
+
const badgeVariants = cva(
|
|
7
|
+
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
12
|
+
secondary:
|
|
13
|
+
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
14
|
+
destructive:
|
|
15
|
+
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
16
|
+
outline: "text-foreground",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
variant: "default",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export interface BadgeProps
|
|
26
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
27
|
+
VariantProps<typeof badgeVariants> {}
|
|
28
|
+
|
|
29
|
+
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
30
|
+
return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
|
|
7
|
+
const buttonVariants = cva(
|
|
8
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
14
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
15
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
16
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
17
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
default: "h-10 px-4 py-2",
|
|
21
|
+
sm: "h-9 rounded-md px-3",
|
|
22
|
+
lg: "h-11 rounded-md px-8",
|
|
23
|
+
icon: "h-10 w-10",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "default",
|
|
28
|
+
size: "default",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
export interface ButtonProps
|
|
34
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
35
|
+
VariantProps<typeof buttonVariants> {
|
|
36
|
+
asChild?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
40
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
41
|
+
const Comp = asChild ? Slot : "button";
|
|
42
|
+
return (
|
|
43
|
+
<Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />
|
|
44
|
+
);
|
|
45
|
+
},
|
|
46
|
+
);
|
|
47
|
+
Button.displayName = "Button";
|
|
48
|
+
|
|
49
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { cn } from "../lib/utils";
|
|
3
|
+
|
|
4
|
+
interface CalloutProps {
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function Callout({ icon, children, className }: CalloutProps) {
|
|
11
|
+
return (
|
|
12
|
+
<div
|
|
13
|
+
className={cn(
|
|
14
|
+
"flex items-start gap-3 rounded-md border bg-muted/50 px-4 py-3 text-sm text-muted-foreground",
|
|
15
|
+
className,
|
|
16
|
+
)}
|
|
17
|
+
>
|
|
18
|
+
{icon && <span className="mt-0.5 shrink-0">{icon}</span>}
|
|
19
|
+
<div className="min-w-0 flex-1">{children}</div>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
|
|
5
|
+
const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
6
|
+
({ className, ...props }, ref) => (
|
|
7
|
+
<div
|
|
8
|
+
ref={ref}
|
|
9
|
+
className={cn("rounded-lg border bg-card text-card-foreground shadow-xs", className)}
|
|
10
|
+
{...props}
|
|
11
|
+
/>
|
|
12
|
+
),
|
|
13
|
+
);
|
|
14
|
+
Card.displayName = "Card";
|
|
15
|
+
|
|
16
|
+
const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
17
|
+
({ className, ...props }, ref) => (
|
|
18
|
+
<div ref={ref} className={cn("flex flex-col space-y-1.5 p-6", className)} {...props} />
|
|
19
|
+
),
|
|
20
|
+
);
|
|
21
|
+
CardHeader.displayName = "CardHeader";
|
|
22
|
+
|
|
23
|
+
const CardTitle = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
24
|
+
({ className, ...props }, ref) => (
|
|
25
|
+
<div
|
|
26
|
+
ref={ref}
|
|
27
|
+
className={cn("text-2xl font-semibold leading-none tracking-tight", className)}
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
),
|
|
31
|
+
);
|
|
32
|
+
CardTitle.displayName = "CardTitle";
|
|
33
|
+
|
|
34
|
+
const CardDescription = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
35
|
+
({ className, ...props }, ref) => (
|
|
36
|
+
<div ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />
|
|
37
|
+
),
|
|
38
|
+
);
|
|
39
|
+
CardDescription.displayName = "CardDescription";
|
|
40
|
+
|
|
41
|
+
const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
42
|
+
({ className, ...props }, ref) => (
|
|
43
|
+
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
|
|
44
|
+
),
|
|
45
|
+
);
|
|
46
|
+
CardContent.displayName = "CardContent";
|
|
47
|
+
|
|
48
|
+
const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
49
|
+
({ className, ...props }, ref) => (
|
|
50
|
+
<div ref={ref} className={cn("flex items-center p-6 pt-0", className)} {...props} />
|
|
51
|
+
),
|
|
52
|
+
);
|
|
53
|
+
CardFooter.displayName = "CardFooter";
|
|
54
|
+
|
|
55
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
2
|
+
import { Check } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
|
|
7
|
+
const Checkbox = React.forwardRef<
|
|
8
|
+
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
|
9
|
+
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
|
|
10
|
+
>(({ className, ...props }, ref) => (
|
|
11
|
+
<CheckboxPrimitive.Root
|
|
12
|
+
ref={ref}
|
|
13
|
+
className={cn(
|
|
14
|
+
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
15
|
+
className,
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
>
|
|
19
|
+
<CheckboxPrimitive.Indicator className={cn("flex items-center justify-center text-current")}>
|
|
20
|
+
<Check className="h-4 w-4" />
|
|
21
|
+
</CheckboxPrimitive.Indicator>
|
|
22
|
+
</CheckboxPrimitive.Root>
|
|
23
|
+
));
|
|
24
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
25
|
+
|
|
26
|
+
export { Checkbox };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { X } from "lucide-react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
|
|
5
|
+
export interface ClearButtonProps {
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
stopPropagation?: boolean;
|
|
8
|
+
"aria-label"?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function ClearButton({
|
|
13
|
+
className,
|
|
14
|
+
onClick,
|
|
15
|
+
stopPropagation = false,
|
|
16
|
+
"aria-label": ariaLabel = "Clear",
|
|
17
|
+
}: ClearButtonProps) {
|
|
18
|
+
const handleClick = React.useCallback(
|
|
19
|
+
(e: React.MouseEvent) => {
|
|
20
|
+
if (stopPropagation) {
|
|
21
|
+
e.stopPropagation();
|
|
22
|
+
}
|
|
23
|
+
onClick?.();
|
|
24
|
+
},
|
|
25
|
+
[onClick, stopPropagation],
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<button
|
|
30
|
+
type="button"
|
|
31
|
+
onClick={handleClick}
|
|
32
|
+
onMouseDown={(e) => e.preventDefault()}
|
|
33
|
+
className={cn(
|
|
34
|
+
"inline-flex cursor-pointer rounded-sm text-muted-foreground transition-colors hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
|
|
35
|
+
className,
|
|
36
|
+
)}
|
|
37
|
+
aria-label={ariaLabel}
|
|
38
|
+
>
|
|
39
|
+
<X className="h-4 w-4" />
|
|
40
|
+
</button>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { DialogProps } from "@radix-ui/react-dialog";
|
|
2
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
3
|
+
import { Search } from "lucide-react";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
import { Dialog, DialogContent } from "./dialog";
|
|
7
|
+
|
|
8
|
+
const Command = React.forwardRef<
|
|
9
|
+
React.ElementRef<typeof CommandPrimitive>,
|
|
10
|
+
React.ComponentPropsWithoutRef<typeof CommandPrimitive>
|
|
11
|
+
>(({ className, ...props }, ref) => (
|
|
12
|
+
<CommandPrimitive
|
|
13
|
+
ref={ref}
|
|
14
|
+
className={cn(
|
|
15
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
16
|
+
className,
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
));
|
|
21
|
+
Command.displayName = CommandPrimitive.displayName;
|
|
22
|
+
|
|
23
|
+
const CommandDialog = ({ children, ...props }: DialogProps) => {
|
|
24
|
+
return (
|
|
25
|
+
<Dialog {...props}>
|
|
26
|
+
<DialogContent className="overflow-hidden p-0 shadow-lg">
|
|
27
|
+
<Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
|
|
28
|
+
{children}
|
|
29
|
+
</Command>
|
|
30
|
+
</DialogContent>
|
|
31
|
+
</Dialog>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const CommandInput = React.forwardRef<
|
|
36
|
+
React.ElementRef<typeof CommandPrimitive.Input>,
|
|
37
|
+
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
|
|
38
|
+
>(({ className, ...props }, ref) => (
|
|
39
|
+
<div className="flex items-center border-b px-3" cmdk-input-wrapper="">
|
|
40
|
+
<Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
|
|
41
|
+
<CommandPrimitive.Input
|
|
42
|
+
ref={ref}
|
|
43
|
+
className={cn(
|
|
44
|
+
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
45
|
+
className,
|
|
46
|
+
)}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
));
|
|
51
|
+
|
|
52
|
+
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
53
|
+
|
|
54
|
+
const CommandList = React.forwardRef<
|
|
55
|
+
React.ElementRef<typeof CommandPrimitive.List>,
|
|
56
|
+
React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
|
|
57
|
+
>(({ className, ...props }, ref) => (
|
|
58
|
+
<CommandPrimitive.List
|
|
59
|
+
ref={ref}
|
|
60
|
+
className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
));
|
|
64
|
+
|
|
65
|
+
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
66
|
+
|
|
67
|
+
const CommandEmpty = React.forwardRef<
|
|
68
|
+
React.ElementRef<typeof CommandPrimitive.Empty>,
|
|
69
|
+
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
|
|
70
|
+
>((props, ref) => (
|
|
71
|
+
<CommandPrimitive.Empty ref={ref} className="py-6 text-center text-sm" {...props} />
|
|
72
|
+
));
|
|
73
|
+
|
|
74
|
+
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
75
|
+
|
|
76
|
+
const CommandGroup = React.forwardRef<
|
|
77
|
+
React.ElementRef<typeof CommandPrimitive.Group>,
|
|
78
|
+
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
|
|
79
|
+
>(({ className, ...props }, ref) => (
|
|
80
|
+
<CommandPrimitive.Group
|
|
81
|
+
ref={ref}
|
|
82
|
+
className={cn(
|
|
83
|
+
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
84
|
+
className,
|
|
85
|
+
)}
|
|
86
|
+
{...props}
|
|
87
|
+
/>
|
|
88
|
+
));
|
|
89
|
+
|
|
90
|
+
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
91
|
+
|
|
92
|
+
const CommandSeparator = React.forwardRef<
|
|
93
|
+
React.ElementRef<typeof CommandPrimitive.Separator>,
|
|
94
|
+
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
|
|
95
|
+
>(({ className, ...props }, ref) => (
|
|
96
|
+
<CommandPrimitive.Separator
|
|
97
|
+
ref={ref}
|
|
98
|
+
className={cn("-mx-1 h-px bg-border", className)}
|
|
99
|
+
{...props}
|
|
100
|
+
/>
|
|
101
|
+
));
|
|
102
|
+
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
103
|
+
|
|
104
|
+
const CommandItem = React.forwardRef<
|
|
105
|
+
React.ElementRef<typeof CommandPrimitive.Item>,
|
|
106
|
+
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
|
|
107
|
+
>(({ className, ...props }, ref) => (
|
|
108
|
+
<CommandPrimitive.Item
|
|
109
|
+
ref={ref}
|
|
110
|
+
className={cn(
|
|
111
|
+
"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
112
|
+
className,
|
|
113
|
+
)}
|
|
114
|
+
{...props}
|
|
115
|
+
/>
|
|
116
|
+
));
|
|
117
|
+
|
|
118
|
+
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
119
|
+
|
|
120
|
+
const CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
121
|
+
return (
|
|
122
|
+
<span
|
|
123
|
+
className={cn("ml-auto text-xs tracking-widest text-muted-foreground", className)}
|
|
124
|
+
{...props}
|
|
125
|
+
/>
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
CommandShortcut.displayName = "CommandShortcut";
|
|
129
|
+
|
|
130
|
+
export {
|
|
131
|
+
Command,
|
|
132
|
+
CommandDialog,
|
|
133
|
+
CommandEmpty,
|
|
134
|
+
CommandGroup,
|
|
135
|
+
CommandInput,
|
|
136
|
+
CommandItem,
|
|
137
|
+
CommandList,
|
|
138
|
+
CommandSeparator,
|
|
139
|
+
CommandShortcut,
|
|
140
|
+
};
|