@usalyt/registry 0.0.1 → 0.0.2
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/CHANGELOG.md +16 -0
- package/LICENSE +21 -674
- package/NOTICE +7 -8
- package/README.md +5 -6
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/package.json +4 -4
- package/registry.json +227 -126
- package/schema/registry.schema.json +6 -5
- package/scripts/build-registry.ts +2 -2
- package/src/registry-builder.ts +57 -7
- package/src/theme-presets.ts +1023 -0
package/registry.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./schema/registry.schema.json",
|
|
3
3
|
"name": "usalyt",
|
|
4
|
-
"version": "0.0.
|
|
5
|
-
"license": "
|
|
4
|
+
"version": "0.0.2",
|
|
5
|
+
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/Usalyt/ui.git",
|
|
9
|
-
"directory": "
|
|
9
|
+
"directory": "packages/registry"
|
|
10
10
|
},
|
|
11
11
|
"dependencyLicenses": {
|
|
12
12
|
"@base-ui/react": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"type": "registry:ui",
|
|
35
35
|
"title": "Accordion",
|
|
36
36
|
"description": "Accessible Accordion primitive component built with Base UI and Tailwind v4.",
|
|
37
|
-
"license": "
|
|
37
|
+
"license": "MIT",
|
|
38
38
|
"dependencies": [
|
|
39
39
|
"@base-ui/react",
|
|
40
40
|
"lucide-react"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
{
|
|
52
52
|
"path": "components/accordion/accordion.tsx",
|
|
53
53
|
"type": "registry:ui",
|
|
54
|
-
"content": "import * as React from \"react\";\nimport { Accordion as BaseAccordion } from \"@base-ui/react/accordion\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport const Accordion = BaseAccordion.Root;\n\nexport const AccordionItem = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseAccordion.Item>\n>(({ className, ...props }, ref) => (\n <BaseAccordion.Item\n ref={ref}\n className={cn(\"border-b border-border/70 transition-colors duration-150\", className)}\n {...props}\n />\n));\nAccordionItem.displayName = \"AccordionItem\";\n\nexport const AccordionHeader = BaseAccordion.Header;\n\nexport const AccordionTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof BaseAccordion.Trigger>\n>(({ className, children, ...props }, ref) => (\n <BaseAccordion.Header className=\"flex\">\n <BaseAccordion.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-[color,transform] duration-200 ease-out hover:underline active:scale-[0.99] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm [&[data-panel-open]>svg]:rotate-180\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronDown className=\"h-4 w-4 shrink-0 transition-transform duration-200 ease-out text-muted-foreground\" />\n </BaseAccordion.Trigger>\n </BaseAccordion.Header>\n));\nAccordionTrigger.displayName = \"AccordionTrigger\";\n\nexport const AccordionContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseAccordion.Panel>\n>(({ className, children, ...props }, ref) => (\n <BaseAccordion.Panel\n ref={ref}\n className={cn(\n \"h-(--accordion-panel-height) overflow-hidden text-sm transition-[height] duration-enter ease-out-expo data-starting-style:h-0 data-ending-style:h-0\",\n className\n )}\n {...props}\n >\n <div className=\"pb-
|
|
54
|
+
"content": "import * as React from \"react\";\nimport { Accordion as BaseAccordion } from \"@base-ui/react/accordion\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport const Accordion = BaseAccordion.Root;\n\nexport const AccordionItem = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseAccordion.Item>\n>(({ className, ...props }, ref) => (\n <BaseAccordion.Item\n ref={ref}\n className={cn(\"border-b border-border/70 transition-colors duration-150\", className)}\n {...props}\n />\n));\nAccordionItem.displayName = \"AccordionItem\";\n\nexport const AccordionHeader = BaseAccordion.Header;\n\nexport const AccordionTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof BaseAccordion.Trigger>\n>(({ className, children, ...props }, ref) => (\n <BaseAccordion.Header className=\"flex\">\n <BaseAccordion.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between gap-4 px-1 py-4.5 text-sm font-medium transition-[color,transform] duration-200 ease-out hover:underline active:scale-[0.99] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm [&[data-panel-open]>svg]:rotate-180\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronDown className=\"h-4 w-4 shrink-0 transition-transform duration-200 ease-out text-muted-foreground\" />\n </BaseAccordion.Trigger>\n </BaseAccordion.Header>\n));\nAccordionTrigger.displayName = \"AccordionTrigger\";\n\nexport const AccordionContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseAccordion.Panel>\n>(({ className, children, ...props }, ref) => (\n <BaseAccordion.Panel\n ref={ref}\n className={cn(\n \"h-(--accordion-panel-height) overflow-hidden text-sm transition-[height] duration-enter ease-out-expo data-starting-style:h-0 data-ending-style:h-0\",\n className\n )}\n {...props}\n >\n <div className=\"px-1 pb-5 pt-1 text-muted-foreground leading-relaxed text-pretty\">{children}</div>\n </BaseAccordion.Panel>\n));\nAccordionContent.displayName = \"AccordionContent\";\n"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
"path": "components/accordion/index.ts",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"type": "registry:ui",
|
|
66
66
|
"title": "Alert",
|
|
67
67
|
"description": "Accessible Alert primitive component built with Base UI and Tailwind v4.",
|
|
68
|
-
"license": "
|
|
68
|
+
"license": "MIT",
|
|
69
69
|
"dependencies": [
|
|
70
70
|
"class-variance-authority"
|
|
71
71
|
],
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
{
|
|
81
81
|
"path": "components/alert/alert.tsx",
|
|
82
82
|
"type": "registry:ui",
|
|
83
|
-
"content": "import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\n// Variant palette
|
|
83
|
+
"content": "import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\n// Variant palette: success = pulse-green, destructive = coral-red,\n// warning = amber-signal, info = signal-teal.\n// Ink pairs are theme-calibrated tokens: every text/icon pair holds\n// >= 4.5:1 in BOTH themes (see src/test/palette-contract.test.ts).\nexport const alertVariants = cva(\n \"box-border relative w-full rounded-lg border px-5 py-4 backdrop-blur-md transition-[border-color,background-color,color] duration-200 [&>svg~*]:pl-8 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-5 [&>svg]:top-4\",\n {\n variants: {\n variant: {\n default:\n \"bg-secondary/70 border-border text-foreground [&>svg]:text-foreground\",\n destructive:\n \"border-coral-red/40 bg-coral-red/10 text-coral-red-foreground [&>svg]:text-coral-red-foreground\",\n success:\n \"border-pulse-green/40 bg-pulse-green/10 text-pulse-green-foreground [&>svg]:text-pulse-green-foreground\",\n warning:\n \"border-amber-signal/40 bg-amber-signal/10 text-amber-signal-foreground [&>svg]:text-amber-signal-foreground\",\n info:\n \"border-signal-teal/40 bg-signal-teal/10 text-signal-teal-foreground [&>svg]:text-signal-teal-foreground\",\n }\n },\n defaultVariants: {\n variant: \"default\"\n }\n }\n);\n\nconst Alert = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>\n>(({ className, variant, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"alert\"\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n));\nAlert.displayName = \"Alert\";\n\nconst AlertTitle = React.forwardRef<\n HTMLHeadingElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n data-slot=\"alert-title\"\n className={cn(\"m-0 mb-1.5 text-sm font-semibold leading-none tracking-tight text-balance\", className)}\n {...props}\n />\n));\nAlertTitle.displayName = \"AlertTitle\";\n\nconst AlertDescription = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"alert-description\"\n className={cn(\"text-xs leading-relaxed opacity-90 text-pretty\", className)}\n {...props}\n />\n));\nAlertDescription.displayName = \"AlertDescription\";\n\nexport { Alert, AlertTitle, AlertDescription };\n"
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
"path": "components/alert/index.ts",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"type": "registry:ui",
|
|
95
95
|
"title": "Alert Dialog",
|
|
96
96
|
"description": "Accessible Alert Dialog primitive component built with Base UI and Tailwind v4.",
|
|
97
|
-
"license": "
|
|
97
|
+
"license": "MIT",
|
|
98
98
|
"dependencies": [
|
|
99
99
|
"@base-ui/react"
|
|
100
100
|
],
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
{
|
|
110
110
|
"path": "components/alert-dialog/alert-dialog.tsx",
|
|
111
111
|
"type": "registry:ui",
|
|
112
|
-
"content": "import * as React from \"react\";\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { cn } from \"../../lib/utils\";\n\nexport const AlertDialog = BaseAlertDialog.Root;\nexport const AlertDialogTrigger = BaseAlertDialog.Trigger;\nexport const AlertDialogPortal = BaseAlertDialog.Portal;\n\nexport const AlertDialogBackdrop = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>\n>(({ className, ...props }, ref) => (\n <BaseAlertDialog.Backdrop\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-void/80 backdrop-blur-md data-open:animate-fade-in data-closed:animate-fade-out\",\n className\n )}\n {...props}\n />\n));\nAlertDialogBackdrop.displayName = \"AlertDialogBackdrop\";\n\nexport const AlertDialogContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseAlertDialog.Popup>\n>(({ className, children, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogBackdrop />\n <BaseAlertDialog.Popup\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid max-h-[calc(100dvh-2rem)] w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-
|
|
112
|
+
"content": "import * as React from \"react\";\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { cn } from \"../../lib/utils\";\n\nexport const AlertDialog = BaseAlertDialog.Root;\nexport const AlertDialogTrigger = BaseAlertDialog.Trigger;\nexport const AlertDialogPortal = BaseAlertDialog.Portal;\n\nexport const AlertDialogBackdrop = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>\n>(({ className, ...props }, ref) => (\n <BaseAlertDialog.Backdrop\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-void/80 backdrop-blur-md data-open:animate-fade-in data-closed:animate-fade-out\",\n className\n )}\n {...props}\n />\n));\nAlertDialogBackdrop.displayName = \"AlertDialogBackdrop\";\n\nexport const AlertDialogContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseAlertDialog.Popup>\n>(({ className, children, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogBackdrop />\n <BaseAlertDialog.Popup\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid max-h-[calc(100dvh-2rem)] w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-5 overflow-y-auto overscroll-contain rounded-lg border border-border bg-popover text-popover-foreground px-7 py-6 shadow-(--shadow-xl) data-open:animate-overlay-in data-closed:animate-overlay-out\",\n className\n )}\n {...props}\n >\n {children}\n </BaseAlertDialog.Popup>\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = \"AlertDialogContent\";\n\nexport const AlertDialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col space-y-2 text-center sm:text-left\", className)}\n {...props}\n />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\nexport const AlertDialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse gap-2 pt-2 sm:flex-row sm:justify-end sm:gap-3\", className)}\n {...props}\n />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\nexport const AlertDialogTitle = React.forwardRef<\n HTMLHeadingElement,\n React.ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>\n>(({ className, ...props }, ref) => (\n <BaseAlertDialog.Title\n ref={ref}\n className={cn(\"text-lg font-semibold text-popover-foreground\", className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = \"AlertDialogTitle\";\n\nexport const AlertDialogDescription = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentPropsWithoutRef<typeof BaseAlertDialog.Description>\n>(({ className, ...props }, ref) => (\n <BaseAlertDialog.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName = \"AlertDialogDescription\";\n\nexport const AlertDialogAction = BaseAlertDialog.Close;\nexport const AlertDialogCancel = BaseAlertDialog.Close;\n"
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"path": "components/alert-dialog/index.ts",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"type": "registry:block",
|
|
124
124
|
"title": "App Shell Layout Block",
|
|
125
125
|
"description": "Composed App Shell Layout block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
126
|
-
"license": "
|
|
126
|
+
"license": "MIT",
|
|
127
127
|
"dependencies": [
|
|
128
128
|
"lucide-react"
|
|
129
129
|
],
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
{
|
|
143
143
|
"path": "blocks/app-shell-layout/app-shell-layout.tsx",
|
|
144
144
|
"type": "registry:block",
|
|
145
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Bell, Search } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n SidebarProvider,\n Sidebar,\n SidebarHeader,\n SidebarContent,\n SidebarFooter,\n SidebarTrigger,\n} from \"../../components/sidebar\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n} from \"../../components/breadcrumb\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../../components/avatar\";\nimport { Button } from \"../../components/button\";\n\nexport interface NavItem {\n title: string;\n href: string;\n icon?: React.ReactNode;\n isActive?: boolean;\n}\n\nexport interface AppShellLayoutProps\n extends React.HTMLAttributes<HTMLDivElement> {\n brandName?: string;\n brandLogo?: React.ReactNode;\n navItems?: NavItem[];\n breadcrumbs?: Array<{ label: string; href?: string }>;\n user?: {\n name: string;\n email: string;\n avatarUrl?: string;\n };\n onSearchClick?: () => void;\n onNotificationsClick?: () => void;\n children?: React.ReactNode;\n}\n\nexport function AppShellLayout({\n brandName = \"Usalyt\",\n brandLogo,\n navItems = [],\n breadcrumbs = [{ label: \"Dashboard\", href: \"/\" }, { label: \"Overview\" }],\n user = { name: \"Alex Evaluator\", email: \"alex@example.com\" },\n onSearchClick,\n onNotificationsClick,\n children,\n className,\n ...props\n}: AppShellLayoutProps) {\n return (\n <SidebarProvider defaultOpen={true}>\n <div\n className={cn(\"flex min-h-screen w-full bg-background text-foreground\", className)}\n {...props}\n >\n <Sidebar className=\"border-r border-border bg-surface-raised\">\n <SidebarHeader className=\"border-b border-border px-
|
|
145
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Bell, Search } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n SidebarProvider,\n Sidebar,\n SidebarHeader,\n SidebarContent,\n SidebarFooter,\n SidebarTrigger,\n} from \"../../components/sidebar\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n} from \"../../components/breadcrumb\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../../components/avatar\";\nimport { Button } from \"../../components/button\";\n\nexport interface NavItem {\n title: string;\n href: string;\n icon?: React.ReactNode;\n isActive?: boolean;\n}\n\nexport interface AppShellLayoutProps\n extends React.HTMLAttributes<HTMLDivElement> {\n brandName?: string;\n brandLogo?: React.ReactNode;\n navItems?: NavItem[];\n breadcrumbs?: Array<{ label: string; href?: string }>;\n user?: {\n name: string;\n email: string;\n avatarUrl?: string;\n };\n onSearchClick?: () => void;\n onNotificationsClick?: () => void;\n children?: React.ReactNode;\n}\n\nexport function AppShellLayout({\n brandName = \"Usalyt\",\n brandLogo,\n navItems = [],\n breadcrumbs = [{ label: \"Dashboard\", href: \"/\" }, { label: \"Overview\" }],\n user = { name: \"Alex Evaluator\", email: \"alex@example.com\" },\n onSearchClick,\n onNotificationsClick,\n children,\n className,\n ...props\n}: AppShellLayoutProps) {\n return (\n <SidebarProvider defaultOpen={true}>\n <div\n className={cn(\"flex min-h-screen w-full bg-background text-foreground\", className)}\n {...props}\n >\n <Sidebar className=\"border-r border-border bg-surface-raised\">\n <SidebarHeader className=\"border-b border-border px-5 py-4 bg-surface-raised\">\n <div className=\"flex items-center gap-2.5 font-bold text-foreground\">\n {brandLogo}\n <span className=\"text-base tracking-tight\">{brandName}</span>\n </div>\n </SidebarHeader>\n\n <SidebarContent className=\"px-3.5 py-4 bg-surface-raised\">\n <nav\n className=\"flex flex-col gap-1.5\"\n aria-label=\"Sidebar Navigation\"\n >\n {navItems.map((item, idx) => (\n <a\n key={idx}\n href={item.href}\n aria-current={item.isActive ? \"page\" : undefined}\n className={cn(\n \"flex items-center gap-3 rounded-md px-3.5 py-2.5 text-sm font-medium tracking-tight-linear transition-colors\",\n item.isActive\n ? \"bg-muted text-foreground border border-border\"\n : \"text-muted-foreground hover:bg-muted/60 hover:text-foreground\"\n )}\n >\n {item.icon}\n <span>{item.title}</span>\n </a>\n ))}\n </nav>\n </SidebarContent>\n\n <SidebarFooter className=\"border-t border-border px-4 py-3.5 bg-surface-raised\">\n <div className=\"flex items-center gap-3\">\n <Avatar className=\"h-8 w-8 border border-border\">\n {user.avatarUrl && (\n <AvatarImage src={user.avatarUrl} alt={user.name} />\n )}\n <AvatarFallback className=\"bg-muted text-foreground text-xs\">\n {user.name.slice(0, 2).toUpperCase()}\n </AvatarFallback>\n </Avatar>\n <div className=\"flex flex-col truncate\">\n <span className=\"text-xs font-semibold text-foreground truncate\">\n {user.name}\n </span>\n <span className=\"text-[10px] text-muted-foreground truncate\">\n {user.email}\n </span>\n </div>\n </div>\n </SidebarFooter>\n </Sidebar>\n\n <div className=\"flex flex-1 flex-col overflow-hidden bg-background\">\n <header className=\"flex h-14 items-center justify-between gap-4 border-b border-border px-6 bg-surface-raised/80 backdrop-blur-md\">\n <div className=\"flex items-center gap-3\">\n <SidebarTrigger />\n {breadcrumbs.length > 0 && (\n <Breadcrumb>\n <BreadcrumbList>\n {breadcrumbs.map((crumb, index) => {\n const isLast = index === breadcrumbs.length - 1;\n return (\n <React.Fragment key={index}>\n <BreadcrumbItem>\n {isLast ? (\n <BreadcrumbPage>{crumb.label}</BreadcrumbPage>\n ) : (\n <BreadcrumbLink href={crumb.href}>\n {crumb.label}\n </BreadcrumbLink>\n )}\n </BreadcrumbItem>\n {!isLast && <BreadcrumbSeparator />}\n </React.Fragment>\n );\n })}\n </BreadcrumbList>\n </Breadcrumb>\n )}\n </div>\n\n <div className=\"flex items-center gap-2\">\n {onSearchClick && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={onSearchClick}\n className=\"gap-2 text-xs text-muted-foreground h-8 border-border hover:border-ring\"\n >\n <Search className=\"h-3.5 w-3.5\" />\n <span>Search...</span>\n </Button>\n )}\n {onNotificationsClick && (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={onNotificationsClick}\n className=\"h-8 w-8 text-muted-foreground hover:text-foreground\"\n aria-label=\"Notifications\"\n >\n <Bell className=\"h-4 w-4\" />\n </Button>\n )}\n </div>\n </header>\n\n <main className=\"flex-1 overflow-y-auto px-6 py-7 lg:px-8 lg:py-8 bg-background\">{children}</main>\n </div>\n </div>\n </SidebarProvider>\n );\n}\n"
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
148
|
"path": "blocks/app-shell-layout/index.ts",
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"type": "registry:ui",
|
|
157
157
|
"title": "Aspect Ratio",
|
|
158
158
|
"description": "Accessible Aspect Ratio primitive component built with Base UI and Tailwind v4.",
|
|
159
|
-
"license": "
|
|
159
|
+
"license": "MIT",
|
|
160
160
|
"dependencies": [],
|
|
161
161
|
"devDependencies": [],
|
|
162
162
|
"registryDependencies": [
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
"type": "registry:block",
|
|
182
182
|
"title": "Auth Form Block",
|
|
183
183
|
"description": "Composed Auth Form block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
184
|
-
"license": "
|
|
184
|
+
"license": "MIT",
|
|
185
185
|
"dependencies": [
|
|
186
186
|
"@hookform/resolvers",
|
|
187
187
|
"react-hook-form",
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
{
|
|
205
205
|
"path": "blocks/auth-form/auth-form.tsx",
|
|
206
206
|
"type": "registry:block",
|
|
207
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport { z } from \"zod\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from \"../../components/card\";\nimport { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from \"../../components/form\";\nimport { Input } from \"../../components/input\";\n\nconst authSchema = z.object({\n email: z.string().email(\"Please enter a valid email address\"),\n password: z.string().min(6, \"Password must be at least 6 characters\")\n});\n\nexport type AuthFormValues = z.infer<typeof authSchema>;\n\nexport interface AuthFormProps {\n onSubmit?: (values: AuthFormValues) => void | Promise<void>;\n title?: string;\n description?: string;\n submitLabel?: string;\n className?: string;\n}\n\nexport function AuthForm({\n onSubmit,\n title = \"Sign In\",\n description = \"Enter your email and password to access your account\",\n submitLabel,\n className\n}: AuthFormProps) {\n const form = useForm<AuthFormValues>({\n resolver: zodResolver(authSchema),\n defaultValues: {\n email: \"\",\n password: \"\"\n }\n });\n const [pending, setPending] = React.useState(false);\n const [submitError, setSubmitError] = React.useState<string | null>(null);\n\n const handleSubmit = async (values: AuthFormValues) => {\n setSubmitError(null);\n setPending(true);\n\n try {\n await onSubmit?.(values);\n } catch (error) {\n setSubmitError(\n error instanceof Error\n ? error.message\n : \"Unable to sign in. Please try again.\"\n );\n } finally {\n setPending(false);\n }\n };\n\n return (\n <Card className={cn(\"w-full max-w-md
|
|
207
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport { z } from \"zod\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from \"../../components/card\";\nimport { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from \"../../components/form\";\nimport { Input } from \"../../components/input\";\n\nconst authSchema = z.object({\n email: z.string().email(\"Please enter a valid email address\"),\n password: z.string().min(6, \"Password must be at least 6 characters\")\n});\n\nexport type AuthFormValues = z.infer<typeof authSchema>;\n\nexport interface AuthFormProps {\n onSubmit?: (values: AuthFormValues) => void | Promise<void>;\n title?: string;\n description?: string;\n submitLabel?: string;\n className?: string;\n}\n\nexport function AuthForm({\n onSubmit,\n title = \"Sign In\",\n description = \"Enter your email and password to access your account\",\n submitLabel,\n className\n}: AuthFormProps) {\n const form = useForm<AuthFormValues>({\n resolver: zodResolver(authSchema),\n defaultValues: {\n email: \"\",\n password: \"\"\n }\n });\n const [pending, setPending] = React.useState(false);\n const [submitError, setSubmitError] = React.useState<string | null>(null);\n\n const handleSubmit = async (values: AuthFormValues) => {\n setSubmitError(null);\n setPending(true);\n\n try {\n await onSubmit?.(values);\n } catch (error) {\n setSubmitError(\n error instanceof Error\n ? error.message\n : \"Unable to sign in. Please try again.\"\n );\n } finally {\n setPending(false);\n }\n };\n\n return (\n <Card className={cn(\"w-full max-w-md\", className)}>\n <CardHeader className=\"space-y-2 px-7 pt-7 pb-5\">\n <CardTitle className=\"text-subheading font-w590 leading-tight\">\n {title}\n </CardTitle>\n <CardDescription className=\"text-body-sm text-muted-foreground\">\n {description}\n </CardDescription>\n </CardHeader>\n <Form {...form}>\n <form onSubmit={form.handleSubmit(handleSubmit)} noValidate>\n <CardContent className=\"space-y-5 px-7 pb-6 pt-0\">\n {submitError && (\n <div\n role=\"alert\"\n className=\"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs font-medium text-foreground\"\n >\n {submitError}\n </div>\n )}\n\n <FormField\n control={form.control}\n name=\"email\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Email Address</FormLabel>\n <FormControl>\n <Input\n placeholder=\"name@example.com\"\n type=\"email\"\n autoComplete=\"email\"\n spellCheck={false}\n {...field}\n />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n <FormField\n control={form.control}\n name=\"password\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Password</FormLabel>\n <FormControl>\n <Input\n placeholder=\"••••••••\"\n type=\"password\"\n autoComplete=\"current-password\"\n {...field}\n />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n </CardContent>\n <CardFooter className=\"mt-1 border-t border-border/60 px-7 py-5\">\n <Button\n type=\"submit\"\n className=\"w-full\"\n loading={pending}\n disabled={pending}\n >\n {submitLabel ?? title}\n </Button>\n </CardFooter>\n </form>\n </Form>\n </Card>\n );\n}\n"
|
|
208
208
|
},
|
|
209
209
|
{
|
|
210
210
|
"path": "blocks/auth-form/index.ts",
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
"type": "registry:ui",
|
|
219
219
|
"title": "Avatar",
|
|
220
220
|
"description": "Accessible Avatar primitive component built with Base UI and Tailwind v4.",
|
|
221
|
-
"license": "
|
|
221
|
+
"license": "MIT",
|
|
222
222
|
"dependencies": [
|
|
223
223
|
"@base-ui/react",
|
|
224
224
|
"class-variance-authority"
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
{
|
|
236
236
|
"path": "components/avatar/avatar.tsx",
|
|
237
237
|
"type": "registry:ui",
|
|
238
|
-
"content": "import * as React from \"react\";\nimport { Avatar as BaseAvatar } from \"@base-ui/react/avatar\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport const avatarVariants = cva(\n \"relative flex shrink-0 overflow-hidden rounded-full transition-
|
|
238
|
+
"content": "import * as React from \"react\";\nimport { Avatar as BaseAvatar } from \"@base-ui/react/avatar\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport const avatarVariants = cva(\n \"relative flex shrink-0 overflow-hidden rounded-full transition-[transform,opacity,box-shadow] duration-150 ring-2 ring-background\",\n {\n variants: {\n size: {\n sm: \"h-8 w-8 text-xs\",\n md: \"h-10 w-10 text-sm\",\n lg: \"h-14 w-14 text-base\",\n xl: \"h-20 w-20 text-lg\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n }\n);\n\nexport interface AvatarProps\n extends React.ComponentPropsWithoutRef<typeof BaseAvatar.Root>,\n VariantProps<typeof avatarVariants> {}\n\nexport const Avatar = React.forwardRef<HTMLDivElement, AvatarProps>(\n ({ className, size, ...props }, ref) => (\n <BaseAvatar.Root\n ref={ref}\n className={cn(avatarVariants({ size }), className)}\n {...props}\n />\n )\n);\nAvatar.displayName = \"Avatar\";\n\nexport const AvatarImage = React.forwardRef<\n HTMLImageElement,\n React.ComponentPropsWithoutRef<typeof BaseAvatar.Image>\n>(({ className, ...props }, ref) => (\n <BaseAvatar.Image\n ref={ref}\n className={cn(\"aspect-square h-full w-full object-cover\", className)}\n {...props}\n />\n));\nAvatarImage.displayName = \"AvatarImage\";\n\nexport const AvatarFallback = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseAvatar.Fallback>\n>(({ className, ...props }, ref) => (\n <BaseAvatar.Fallback\n ref={ref}\n className={cn(\n \"flex h-full w-full items-center justify-center rounded-full bg-secondary text-secondary-foreground font-semibold select-none\",\n className\n )}\n {...props}\n />\n));\nAvatarFallback.displayName = \"AvatarFallback\";\n"
|
|
239
239
|
},
|
|
240
240
|
{
|
|
241
241
|
"path": "components/avatar/index.ts",
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
"type": "registry:ui",
|
|
250
250
|
"title": "Badge",
|
|
251
251
|
"description": "Accessible Badge primitive component built with Base UI and Tailwind v4.",
|
|
252
|
-
"license": "
|
|
252
|
+
"license": "MIT",
|
|
253
253
|
"dependencies": [
|
|
254
254
|
"class-variance-authority"
|
|
255
255
|
],
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
{
|
|
265
265
|
"path": "components/badge/badge.tsx",
|
|
266
266
|
"type": "registry:ui",
|
|
267
|
-
"content": "import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport const badgeVariants = cva(\n \"inline-flex items-center gap-1.5 rounded-sm border px-2 py-0.5 text-xs font-medium tabular-nums transition-[background-color,border-color,color] duration-150 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground hover:bg-primary/80\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n destructive:\n \"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"text-foreground border-border bg-background hover:bg-accent hover:text-accent-foreground\",\n neutral:\n \"border-border bg-foreground/5 text-muted-foreground\",\n \"pulse-green\":\n \"border-pulse-green/40 bg-pulse-green/10 text-pulse-green-foreground\",\n \"coral-red\":\n \"border-coral-red/40 bg-coral-red/10 text-coral-red-foreground\",\n \"signal-teal\":\n \"border-signal-teal/40 bg-signal-teal/10 text-signal-teal-foreground\",\n \"iris-violet\":\n \"border-iris-violet/40 bg-iris-violet/10 text-iris-violet-foreground\",\n lavender:\n \"border-lavender/40 bg-lavender/10 text-lavender-foreground\",\n \"acid-lime\":\n \"border-transparent bg-acid-lime text-void font-semibold\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nexport const Badge = React.forwardRef<HTMLDivElement, BadgeProps>(\n ({ className, variant, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n );\n }\n);\nBadge.displayName = \"Badge\";\n"
|
|
267
|
+
"content": "import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport const badgeVariants = cva(\n \"inline-flex items-center gap-1.5 rounded-sm border px-2.5 py-0.5 text-xs font-medium tabular-nums transition-[background-color,border-color,color] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground hover:bg-primary/80\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n destructive:\n \"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"text-foreground border-border bg-background hover:bg-accent hover:text-accent-foreground\",\n neutral:\n \"border-border bg-foreground/5 text-muted-foreground\",\n cobalt:\n \"border-cobalt/35 bg-cobalt/10 text-cobalt-foreground\",\n \"pulse-green\":\n \"border-pulse-green/40 bg-pulse-green/10 text-pulse-green-foreground\",\n \"coral-red\":\n \"border-coral-red/40 bg-coral-red/10 text-coral-red-foreground\",\n \"signal-teal\":\n \"border-signal-teal/40 bg-signal-teal/10 text-signal-teal-foreground\",\n \"iris-violet\":\n \"border-iris-violet/40 bg-iris-violet/10 text-iris-violet-foreground\",\n lavender:\n \"border-lavender/40 bg-lavender/10 text-lavender-foreground\",\n \"acid-lime\":\n \"border-transparent bg-acid-lime text-void font-semibold\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nexport const Badge = React.forwardRef<HTMLDivElement, BadgeProps>(\n ({ className, variant, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-slot=\"badge\"\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n );\n }\n);\nBadge.displayName = \"Badge\";\n"
|
|
268
268
|
},
|
|
269
269
|
{
|
|
270
270
|
"path": "components/badge/index.ts",
|
|
@@ -278,7 +278,7 @@
|
|
|
278
278
|
"type": "registry:ui",
|
|
279
279
|
"title": "Breadcrumb",
|
|
280
280
|
"description": "Accessible Breadcrumb primitive component built with Base UI and Tailwind v4.",
|
|
281
|
-
"license": "
|
|
281
|
+
"license": "MIT",
|
|
282
282
|
"dependencies": [
|
|
283
283
|
"lucide-react"
|
|
284
284
|
],
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
"type": "registry:ui",
|
|
308
308
|
"title": "Button",
|
|
309
309
|
"description": "Accessible Button primitive component built with Base UI and Tailwind v4.",
|
|
310
|
-
"license": "
|
|
310
|
+
"license": "MIT",
|
|
311
311
|
"dependencies": [
|
|
312
312
|
"@base-ui/react",
|
|
313
313
|
"class-variance-authority",
|
|
@@ -326,7 +326,7 @@
|
|
|
326
326
|
{
|
|
327
327
|
"path": "components/button/button.tsx",
|
|
328
328
|
"type": "registry:ui",
|
|
329
|
-
"content": "import * as React from \"react\";\nimport { Button as BaseButton } from \"@base-ui/react/button\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Loader2 } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport const buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[background-color,border-color,color,fill,stroke,opacity,box-shadow,transform] duration-150 ease-out active:scale-[0.
|
|
329
|
+
"content": "import * as React from \"react\";\nimport { Button as BaseButton } from \"@base-ui/react/button\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Loader2 } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport const buttonVariants = cva(\n \"box-border inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md border border-transparent text-sm font-medium transition-[background-color,border-color,color,fill,stroke,opacity,box-shadow,transform] duration-150 ease-out active:translate-y-[1px] active:scale-[0.985] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground hover:bg-primary-hover active:bg-primary-focus tracking-[-0.011em]\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-border bg-card text-foreground shadow-(--shadow-inset-hairline) hover:bg-accent hover:text-accent-foreground hover:border-hairline-strong\",\n secondary:\n \"border border-border bg-secondary text-secondary-foreground shadow-(--shadow-inset-hairline) hover:bg-accent hover:border-hairline-strong\",\n ghost: \"bg-transparent hover:bg-accent hover:text-accent-foreground text-foreground\",\n link: \"bg-transparent text-primary underline-offset-4 hover:underline\",\n pill: \"bg-foreground text-background rounded-full hover:bg-foreground/90 font-medium\",\n },\n size: {\n sm: \"h-8 px-3 py-1.5 text-xs\",\n md: \"h-9 px-4 py-2\",\n lg: \"h-10 px-6 py-2.5 text-base\",\n icon: \"h-9 w-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n render?: React.ComponentPropsWithoutRef<typeof BaseButton>[\"render\"];\n loading?: boolean;\n loadingLabel?: string;\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n asChild = false,\n render,\n loading = false,\n loadingLabel = \"Loading...\",\n disabled,\n children,\n type = \"button\",\n ...props\n },\n ref\n ) => {\n const isDisabled = disabled || loading;\n\n if (asChild && React.isValidElement(children)) {\n const childElement = children as React.ReactElement<{\n className?: string;\n children?: React.ReactNode;\n }>;\n return React.cloneElement(childElement, {\n ...props,\n ...(childElement.props as Record<string, unknown>),\n ref,\n \"aria-disabled\": isDisabled || undefined,\n \"aria-busy\": loading || undefined,\n className: cn(\n buttonVariants({ variant, size, className }),\n childElement.props.className\n ),\n } as React.Attributes & Record<string, unknown>);\n }\n\n if (render && React.isValidElement(render) && render.type === \"a\") {\n const anchorElement = render as React.ReactElement<{\n className?: string;\n children?: React.ReactNode;\n }>;\n return React.cloneElement(\n anchorElement,\n {\n ...props,\n ...(anchorElement.props as Record<string, unknown>),\n ref,\n \"aria-disabled\": isDisabled || undefined,\n \"aria-busy\": loading || undefined,\n className: cn(\n buttonVariants({ variant, size, className }),\n anchorElement.props.className\n ),\n } as React.Attributes & Record<string, unknown>,\n anchorElement.props.children ?? children\n );\n }\n\n const customRender = render ?? <button />;\n const isNativeButton =\n !render || (React.isValidElement(render) && render.type === \"button\");\n\n return (\n <BaseButton\n ref={ref}\n data-slot=\"button\"\n type={isNativeButton ? type : undefined}\n nativeButton={isNativeButton}\n disabled={isDisabled}\n aria-busy={loading || undefined}\n render={customRender}\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n >\n {loading ? (\n <>\n <Loader2\n data-testid=\"button-spinner\"\n className=\"h-4 w-4 animate-spin shrink-0\"\n aria-hidden=\"true\"\n />\n <span className=\"sr-only\">{loadingLabel}</span>\n {children}\n </>\n ) : (\n children\n )}\n </BaseButton>\n );\n }\n);\n\nButton.displayName = \"Button\";\n"
|
|
330
330
|
},
|
|
331
331
|
{
|
|
332
332
|
"path": "components/button/index.ts",
|
|
@@ -340,7 +340,7 @@
|
|
|
340
340
|
"type": "registry:ui",
|
|
341
341
|
"title": "Calendar",
|
|
342
342
|
"description": "Accessible Calendar primitive component built with Base UI and Tailwind v4.",
|
|
343
|
-
"license": "
|
|
343
|
+
"license": "MIT",
|
|
344
344
|
"dependencies": [
|
|
345
345
|
"lucide-react"
|
|
346
346
|
],
|
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
{
|
|
357
357
|
"path": "components/calendar/calendar.tsx",
|
|
358
358
|
"type": "registry:ui",
|
|
359
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../button\";\n\nexport interface CalendarProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onSelect\"> {\n selected?: Date | null;\n onSelect?: (date: Date) => void;\n minDate?: Date;\n maxDate?: Date;\n}\n\nconst MONTH_NAMES = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nconst DAY_NAMES = [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"];\n\nexport const Calendar = React.forwardRef<HTMLDivElement, CalendarProps>(\n ({ selected, onSelect, minDate, maxDate, className, ...props }, ref) => {\n const [currentDate, setCurrentDate] = React.useState(\n selected ?? new Date()\n );\n\n const year = currentDate.getFullYear();\n const month = currentDate.getMonth();\n\n const firstDayOfMonth = new Date(year, month, 1).getDay();\n const daysInMonth = new Date(year, month + 1, 0).getDate();\n\n const handlePrevMonth = () => {\n setCurrentDate(new Date(year, month - 1, 1));\n };\n\n const handleNextMonth = () => {\n setCurrentDate(new Date(year, month + 1, 1));\n };\n\n const isSameDay = (d1: Date | null | undefined, d2: Date) => {\n if (!d1) return false;\n return (\n d1.getFullYear() === d2.getFullYear() &&\n d1.getMonth() === d2.getMonth() &&\n d1.getDate() === d2.getDate()\n );\n };\n\n const isDisabled = (date: Date) => {\n if (minDate && date < new Date(minDate.setHours(0, 0, 0, 0)))\n return true;\n if (maxDate && date > new Date(maxDate.setHours(23, 59, 59, 999)))\n return true;\n return false;\n };\n\n const days = [];\n for (let i = 0; i < firstDayOfMonth; i++) {\n days.push(null);\n }\n for (let day = 1; day <= daysInMonth; day++) {\n days.push(new Date(year, month, day));\n }\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label=\"Calendar\"\n className={cn(\n \"w-
|
|
359
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../button\";\n\nexport interface CalendarProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onSelect\"> {\n selected?: Date | null;\n onSelect?: (date: Date) => void;\n minDate?: Date;\n maxDate?: Date;\n}\n\nconst MONTH_NAMES = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nconst DAY_NAMES = [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"];\n\nexport const Calendar = React.forwardRef<HTMLDivElement, CalendarProps>(\n ({ selected, onSelect, minDate, maxDate, className, ...props }, ref) => {\n const [currentDate, setCurrentDate] = React.useState(\n selected ?? new Date()\n );\n\n const year = currentDate.getFullYear();\n const month = currentDate.getMonth();\n\n const firstDayOfMonth = new Date(year, month, 1).getDay();\n const daysInMonth = new Date(year, month + 1, 0).getDate();\n\n const handlePrevMonth = () => {\n setCurrentDate(new Date(year, month - 1, 1));\n };\n\n const handleNextMonth = () => {\n setCurrentDate(new Date(year, month + 1, 1));\n };\n\n const isSameDay = (d1: Date | null | undefined, d2: Date) => {\n if (!d1) return false;\n return (\n d1.getFullYear() === d2.getFullYear() &&\n d1.getMonth() === d2.getMonth() &&\n d1.getDate() === d2.getDate()\n );\n };\n\n const isDisabled = (date: Date) => {\n if (minDate && date < new Date(minDate.setHours(0, 0, 0, 0)))\n return true;\n if (maxDate && date > new Date(maxDate.setHours(23, 59, 59, 999)))\n return true;\n return false;\n };\n\n const days = [];\n for (let i = 0; i < firstDayOfMonth; i++) {\n days.push(null);\n }\n for (let day = 1; day <= daysInMonth; day++) {\n days.push(new Date(year, month, day));\n }\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label=\"Calendar\"\n className={cn(\n \"w-72 p-3 bg-background border border-border rounded-lg text-foreground backdrop-blur-md\",\n className\n )}\n {...props}\n >\n {/* Header with Month Navigation */}\n <div className=\"flex items-center justify-between mb-3 px-1\">\n <span className=\"text-xs font-semibold\">\n {MONTH_NAMES[month]} {year}\n </span>\n <div className=\"flex items-center space-x-1\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={handlePrevMonth}\n aria-label=\"Previous month\"\n className=\"h-8 w-8 p-0 hover:bg-muted\"\n >\n <ChevronLeft className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleNextMonth}\n aria-label=\"Next month\"\n className=\"h-8 w-8 p-0 hover:bg-muted\"\n >\n <ChevronRight className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n\n {/* Weekday headers */}\n <div className=\"grid grid-cols-7 gap-1 mb-2 text-center\">\n {DAY_NAMES.map((d) => (\n <span key={d} className=\"text-label font-medium text-muted-foreground\">\n {d}\n </span>\n ))}\n </div>\n\n {/* Day grid */}\n <div className=\"grid grid-cols-7 gap-1 text-center\" role=\"group\" aria-label=\"Calendar days\">\n {days.map((date, idx) => {\n if (!date) {\n return <div key={`empty-${idx}`} className=\"h-8 w-8\" />;\n }\n\n const isSelected = isSameDay(selected, date);\n const disabled = isDisabled(date);\n\n return (\n <button\n key={date.toISOString()}\n type=\"button\"\n disabled={disabled}\n onClick={() => !disabled && onSelect?.(date)}\n aria-label={date.toDateString()}\n aria-pressed={isSelected}\n aria-disabled={disabled}\n className={cn(\n \"h-8 w-8 rounded-md text-xs font-normal transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40 disabled:cursor-not-allowed\",\n isSelected\n ? \"bg-primary text-primary-foreground font-semibold shadow-subtle-3\"\n : \"hover:bg-accent hover:text-accent-foreground text-foreground\"\n )}\n >\n {date.getDate()}\n </button>\n );\n })}\n </div>\n </div>\n );\n }\n);\n\nCalendar.displayName = \"Calendar\";\n"
|
|
360
360
|
},
|
|
361
361
|
{
|
|
362
362
|
"path": "components/calendar/index.ts",
|
|
@@ -370,7 +370,7 @@
|
|
|
370
370
|
"type": "registry:ui",
|
|
371
371
|
"title": "Card",
|
|
372
372
|
"description": "Accessible Card primitive component built with Base UI and Tailwind v4.",
|
|
373
|
-
"license": "
|
|
373
|
+
"license": "MIT",
|
|
374
374
|
"dependencies": [
|
|
375
375
|
"class-variance-authority"
|
|
376
376
|
],
|
|
@@ -385,7 +385,7 @@
|
|
|
385
385
|
{
|
|
386
386
|
"path": "components/card/card.tsx",
|
|
387
387
|
"type": "registry:ui",
|
|
388
|
-
"content": "import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport const cardVariants = cva(\n \"border transition-[box-shadow,border-color] duration-200\",\n {\n variants: {\n variant: {\n default:\n \"rounded-lg border-border bg-card text-card-foreground\",\n subtle:\n \"rounded-md border-border/
|
|
388
|
+
"content": "import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport const cardVariants = cva(\n \"box-border border transition-[box-shadow,border-color,background-color] duration-200\",\n {\n variants: {\n variant: {\n default:\n \"rounded-lg border-border bg-card text-card-foreground\",\n subtle:\n \"rounded-md border-border/70 bg-field text-card-foreground\",\n instrument:\n \"rounded-xl border-border bg-card text-card-foreground shadow-(--shadow-inset-hairline)\",\n inverted:\n \"rounded-xl border-foreground bg-foreground text-background\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nexport interface CardProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof cardVariants> {}\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(\n ({ className, variant, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(cardVariants({ variant, className }))}\n {...props}\n />\n )\n);\nCard.displayName = \"Card\";\n\nexport const CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-2 px-6 pt-6 pb-5\", className)}\n {...props}\n />\n));\nCardHeader.displayName = \"CardHeader\";\n\nexport const CardTitle = React.forwardRef<\n HTMLHeadingElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\n \"m-0 text-xl font-semibold leading-none tracking-tight text-card-foreground text-balance\",\n className\n )}\n {...props}\n />\n));\nCardTitle.displayName = \"CardTitle\";\n\nexport const CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\"m-0 text-sm text-muted-foreground leading-relaxed text-pretty font-normal\", className)}\n {...props}\n />\n));\nCardDescription.displayName = \"CardDescription\";\n\nexport const CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"px-6 pb-6 pt-0\", className)} {...props} />\n));\nCardContent.displayName = \"CardContent\";\n\nexport const CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-center gap-3 px-6 pb-6 pt-0\", className)}\n {...props}\n />\n));\nCardFooter.displayName = \"CardFooter\";\n"
|
|
389
389
|
},
|
|
390
390
|
{
|
|
391
391
|
"path": "components/card/index.ts",
|
|
@@ -399,7 +399,7 @@
|
|
|
399
399
|
"type": "registry:ui",
|
|
400
400
|
"title": "Carousel",
|
|
401
401
|
"description": "Accessible Carousel primitive component built with Base UI and Tailwind v4.",
|
|
402
|
-
"license": "
|
|
402
|
+
"license": "MIT",
|
|
403
403
|
"dependencies": [
|
|
404
404
|
"embla-carousel-react",
|
|
405
405
|
"lucide-react"
|
|
@@ -431,7 +431,7 @@
|
|
|
431
431
|
"type": "registry:ui",
|
|
432
432
|
"title": "Chart",
|
|
433
433
|
"description": "Accessible Chart primitive component built with Base UI and Tailwind v4.",
|
|
434
|
-
"license": "
|
|
434
|
+
"license": "MIT",
|
|
435
435
|
"dependencies": [],
|
|
436
436
|
"devDependencies": [],
|
|
437
437
|
"registryDependencies": [
|
|
@@ -442,7 +442,7 @@
|
|
|
442
442
|
{
|
|
443
443
|
"path": "components/chart/chart.tsx",
|
|
444
444
|
"type": "registry:ui",
|
|
445
|
-
"content": "import * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface ChartContainerProps\n extends React.HTMLAttributes<HTMLDivElement> {\n title?: string;\n description?: string;\n}\n\nexport const ChartContainer = React.forwardRef<\n HTMLDivElement,\n ChartContainerProps\n>(({ title = \"Chart\", description, className, children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={title}\n className={cn(\n \"w-full p-4 rounded-
|
|
445
|
+
"content": "import * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface ChartContainerProps\n extends React.HTMLAttributes<HTMLDivElement> {\n title?: string;\n description?: string;\n}\n\nexport const ChartContainer = React.forwardRef<\n HTMLDivElement,\n ChartContainerProps\n>(({ title = \"Chart\", description, className, children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={title}\n className={cn(\n \"w-full p-4 rounded-lg border border-border bg-background text-foreground space-y-3 backdrop-blur-md\",\n className\n )}\n {...props}\n >\n <div className=\"flex flex-col space-y-1\">\n <h3 className=\"text-sm font-semibold text-foreground\">{title}</h3>\n {description && (\n <p className=\"text-xs text-muted-foreground\">{description}</p>\n )}\n </div>\n <div className=\"relative w-full overflow-hidden flex items-center justify-center min-h-[160px]\">\n {children}\n </div>\n </div>\n );\n});\n\nChartContainer.displayName = \"ChartContainer\";\n\nexport interface ChartLegendProps\n extends React.HTMLAttributes<HTMLDivElement> {\n items: { label: string; color: string }[];\n}\n\nexport const ChartLegend = React.forwardRef<HTMLDivElement, ChartLegendProps>(\n ({ items, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"flex flex-wrap gap-4 pt-2 text-xs text-muted-foreground\",\n className\n )}\n {...props}\n >\n {items.map((item) => (\n <div key={item.label} className=\"flex items-center space-x-1.5\">\n <span\n className=\"h-2.5 w-2.5 rounded-full shrink-0\"\n style={{ backgroundColor: item.color }}\n aria-hidden=\"true\"\n />\n <span className=\"font-medium text-foreground\">{item.label}</span>\n </div>\n ))}\n </div>\n );\n }\n);\n\nChartLegend.displayName = \"ChartLegend\";\n\nexport interface ChartEmptyStateProps\n extends React.HTMLAttributes<HTMLDivElement> {\n message?: string;\n}\n\nexport const ChartEmptyState = React.forwardRef<\n HTMLDivElement,\n ChartEmptyStateProps\n>(({ message = \"No data available\", className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"flex flex-col items-center justify-center p-8 text-center text-xs text-muted-foreground rounded-lg border border-dashed border-border w-full\",\n className\n )}\n {...props}\n >\n <span>{message}</span>\n </div>\n );\n});\n\nChartEmptyState.displayName = \"ChartEmptyState\";\n"
|
|
446
446
|
},
|
|
447
447
|
{
|
|
448
448
|
"path": "components/chart/index.ts",
|
|
@@ -456,7 +456,7 @@
|
|
|
456
456
|
"type": "registry:ui",
|
|
457
457
|
"title": "Checkbox",
|
|
458
458
|
"description": "Accessible Checkbox primitive component built with Base UI and Tailwind v4.",
|
|
459
|
-
"license": "
|
|
459
|
+
"license": "MIT",
|
|
460
460
|
"dependencies": [
|
|
461
461
|
"@base-ui/react",
|
|
462
462
|
"lucide-react"
|
|
@@ -487,7 +487,7 @@
|
|
|
487
487
|
"type": "registry:block",
|
|
488
488
|
"title": "Collaboration Chat Panel Block",
|
|
489
489
|
"description": "Composed Collaboration Chat Panel block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
490
|
-
"license": "
|
|
490
|
+
"license": "MIT",
|
|
491
491
|
"dependencies": [
|
|
492
492
|
"lucide-react"
|
|
493
493
|
],
|
|
@@ -506,7 +506,7 @@
|
|
|
506
506
|
{
|
|
507
507
|
"path": "blocks/collaboration-chat-panel/collaboration-chat-panel.tsx",
|
|
508
508
|
"type": "registry:block",
|
|
509
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Send, Paperclip, MessageSquare } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n Card,\n CardContent,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../../components/avatar\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\n\nexport interface ChatMessage {\n id: string;\n senderName: string;\n senderAvatar?: string;\n content: string;\n timestamp: string;\n isCurrentUser?: boolean;\n attachedFindingId?: string;\n}\n\nexport interface CollaborationChatPanelProps\n extends React.HTMLAttributes<HTMLDivElement> {\n projectName?: string;\n onlineCount?: number;\n messages?: ChatMessage[];\n typingUsers?: string[];\n onSendMessage?: (content: string) => void;\n onFindingClick?: (findingId: string) => void;\n}\n\nexport function CollaborationChatPanel({\n projectName = \"Checkout Flow Audit\",\n onlineCount = 3,\n messages = [],\n typingUsers = [],\n onSendMessage,\n onFindingClick,\n className,\n ...props\n}: CollaborationChatPanelProps) {\n const [text, setText] = React.useState(\"\");\n\n const handleSend = (e: React.FormEvent) => {\n e.preventDefault();\n if (!text.trim()) return;\n onSendMessage?.(text.trim());\n setText(\"\");\n };\n\n return (\n <Card\n className={cn(\n \"flex flex-col h-[520px] border border-border bg-card
|
|
509
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Send, Paperclip, MessageSquare } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n Card,\n CardContent,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../../components/avatar\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\n\nexport interface ChatMessage {\n id: string;\n senderName: string;\n senderAvatar?: string;\n content: string;\n timestamp: string;\n isCurrentUser?: boolean;\n attachedFindingId?: string;\n}\n\nexport interface CollaborationChatPanelProps\n extends React.HTMLAttributes<HTMLDivElement> {\n projectName?: string;\n onlineCount?: number;\n messages?: ChatMessage[];\n typingUsers?: string[];\n onSendMessage?: (content: string) => void;\n onFindingClick?: (findingId: string) => void;\n}\n\nexport function CollaborationChatPanel({\n projectName = \"Checkout Flow Audit\",\n onlineCount = 3,\n messages = [],\n typingUsers = [],\n onSendMessage,\n onFindingClick,\n className,\n ...props\n}: CollaborationChatPanelProps) {\n const [text, setText] = React.useState(\"\");\n\n const handleSend = (e: React.FormEvent) => {\n e.preventDefault();\n if (!text.trim()) return;\n onSendMessage?.(text.trim());\n setText(\"\");\n };\n\n return (\n <Card\n className={cn(\n \"flex flex-col h-[520px] border border-border bg-card overflow-hidden\",\n className\n )}\n {...props}\n >\n <CardHeader className=\"flex flex-row items-center justify-between gap-4 py-4 px-5 border-b border-border bg-secondary/60\">\n <div className=\"flex items-center gap-2.5\">\n <MessageSquare className=\"h-4 w-4 text-primary\" />\n <CardTitle className=\"text-sm font-semibold text-foreground\">{projectName}</CardTitle>\n </div>\n <div className=\"flex items-center gap-2 text-xs text-muted-foreground tabular-nums\">\n <span className=\"inline-block h-2 w-2 rounded-full bg-pulse-green\" />\n <span>{onlineCount} online</span>\n </div>\n </CardHeader>\n\n <CardContent\n role=\"log\"\n aria-label=\"Project chat messages\"\n aria-live=\"polite\"\n aria-relevant=\"additions\"\n className=\"flex-1 overflow-y-auto px-5 py-5 space-y-5\"\n >\n {messages.length === 0 ? (\n <div className=\"flex h-full items-center justify-center text-xs text-muted-foreground\">\n No messages yet. Start the discussion!\n </div>\n ) : (\n messages.map((msg) => (\n <div\n key={msg.id}\n className={cn(\n \"flex gap-3\",\n msg.isCurrentUser ? \"flex-row-reverse\" : \"flex-row\"\n )}\n >\n <Avatar className=\"h-7 w-7 mt-0.5\">\n {msg.senderAvatar && (\n <AvatarImage src={msg.senderAvatar} alt={msg.senderName} />\n )}\n <AvatarFallback>\n {msg.senderName.slice(0, 2).toUpperCase()}\n </AvatarFallback>\n </Avatar>\n\n <div\n className={cn(\n \"flex flex-col max-w-[75%]\",\n msg.isCurrentUser ? \"items-end\" : \"items-start\"\n )}\n >\n <div className=\"flex items-center gap-2 mb-1\">\n <span className=\"text-xs font-semibold text-foreground\">\n {msg.senderName}\n </span>\n <span className=\"text-[10px] text-muted-foreground\">\n {msg.timestamp}\n </span>\n </div>\n\n <div\n className={cn(\n \"rounded-lg px-4 py-2.5 text-sm leading-relaxed border border-border\",\n msg.isCurrentUser\n ? \"bg-secondary text-secondary-foreground rounded-tr-xs\"\n : \"bg-muted text-foreground rounded-tl-xs\"\n )}\n >\n <p>{msg.content}</p>\n\n {msg.attachedFindingId && (\n <button\n type=\"button\"\n onClick={() => onFindingClick?.(msg.attachedFindingId!)}\n className=\"mt-1.5 flex items-center gap-1 rounded-md border border-border bg-background px-2 py-0.5 text-xs font-mono font-medium text-primary transition-colors hover:bg-accent cursor-pointer\"\n >\n <Paperclip className=\"h-3 w-3\" />\n <span>{msg.attachedFindingId}</span>\n </button>\n )}\n </div>\n </div>\n </div>\n ))\n )}\n </CardContent>\n\n {typingUsers.length > 0 && (\n <div\n role=\"status\"\n aria-live=\"polite\"\n className=\"px-4 py-1 text-[11px] text-muted-foreground italic bg-muted/10 border-t border-border/20\"\n >\n {typingUsers.join(\", \")}{\" \"}\n {typingUsers.length === 1 ? \"is typing...\" : \"are typing...\"}\n </div>\n )}\n\n <CardFooter className=\"px-4 py-3.5 border-t border-border/60 bg-background\">\n <form onSubmit={handleSend} className=\"flex w-full items-center gap-2.5\">\n <Input\n value={text}\n onChange={(e) => setText(e.target.value)}\n aria-label=\"Message\"\n name=\"message\"\n placeholder=\"Type a message or mention @teammate...\"\n className=\"flex-1 text-sm h-9\"\n />\n <Button\n type=\"submit\"\n size=\"icon\"\n className=\"h-9 w-9 shrink-0\"\n aria-label=\"Send message\"\n disabled={!text.trim()}\n >\n <Send className=\"h-4 w-4\" />\n </Button>\n </form>\n </CardFooter>\n </Card>\n );\n}\n"
|
|
510
510
|
},
|
|
511
511
|
{
|
|
512
512
|
"path": "blocks/collaboration-chat-panel/index.ts",
|
|
@@ -520,7 +520,7 @@
|
|
|
520
520
|
"type": "registry:ui",
|
|
521
521
|
"title": "Collapsible",
|
|
522
522
|
"description": "Accessible Collapsible primitive component built with Base UI and Tailwind v4.",
|
|
523
|
-
"license": "
|
|
523
|
+
"license": "MIT",
|
|
524
524
|
"dependencies": [
|
|
525
525
|
"@base-ui/react"
|
|
526
526
|
],
|
|
@@ -544,12 +544,41 @@
|
|
|
544
544
|
}
|
|
545
545
|
]
|
|
546
546
|
},
|
|
547
|
+
{
|
|
548
|
+
"name": "color-palette-sheet",
|
|
549
|
+
"type": "registry:block",
|
|
550
|
+
"title": "Color Palette Sheet Block",
|
|
551
|
+
"description": "Composed Color Palette Sheet block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
552
|
+
"license": "MIT",
|
|
553
|
+
"dependencies": [
|
|
554
|
+
"lucide-react"
|
|
555
|
+
],
|
|
556
|
+
"devDependencies": [],
|
|
557
|
+
"registryDependencies": [
|
|
558
|
+
"utils"
|
|
559
|
+
],
|
|
560
|
+
"dependencyVersions": {
|
|
561
|
+
"lucide-react": "^1.25.0"
|
|
562
|
+
},
|
|
563
|
+
"files": [
|
|
564
|
+
{
|
|
565
|
+
"path": "blocks/color-palette-sheet/color-palette-sheet.tsx",
|
|
566
|
+
"type": "registry:block",
|
|
567
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Check } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface PaletteSurfaceStep {\n name: string;\n hex: string;\n}\n\nexport interface PaletteInteractionState {\n label: string;\n background: string;\n foreground: string;\n}\n\nexport interface PaletteMetric {\n label: string;\n value: string;\n}\n\nexport interface PaletteDensityOption {\n id: string;\n label: string;\n fillPercent: number;\n}\n\nexport interface PaletteSwatchItem {\n label: string;\n hex: string;\n}\n\nexport interface ColorPaletteSheetProps {\n surfaceSteps: PaletteSurfaceStep[];\n interactionStates: PaletteInteractionState[];\n metrics: PaletteMetric[];\n densityOptions: PaletteDensityOption[];\n activeDensityId: string;\n onDensityChange?: (id: string) => void;\n profileTags: string[];\n swatches: PaletteSwatchItem[];\n accentColor?: string;\n sampleRadius?: string;\n copyHint?: string;\n className?: string;\n}\n\nexport function ColorPaletteSheet({\n surfaceSteps,\n interactionStates,\n metrics,\n densityOptions,\n activeDensityId,\n onDensityChange,\n profileTags,\n swatches,\n accentColor = \"var(--color-primary)\",\n sampleRadius = \"var(--radius-md)\",\n copyHint = \"Click any swatch to copy hex\",\n className,\n}: ColorPaletteSheetProps) {\n const [copiedHex, setCopiedHex] = React.useState<string | null>(null);\n\n const handleCopyHex = async (hex: string) => {\n try {\n await navigator.clipboard.writeText(hex);\n setCopiedHex(hex);\n window.setTimeout(\n () => setCopiedHex((curr) => (curr === hex ? null : curr)),\n 1500\n );\n } catch {\n // Clipboard API unavailable in non-secure contexts.\n }\n };\n\n return (\n <section\n aria-label=\"Theme specification and color palette\"\n className={cn(\n \"@container w-full border-y border-border py-10 sm:py-12\",\n className\n )}\n >\n {/* Top 3-Column Specification Breakdown (container-responsive) */}\n <div className=\"grid grid-cols-1 gap-10 pb-10 @[52rem]:grid-cols-3 @[52rem]:gap-0 @[52rem]:divide-x @[52rem]:divide-border\">\n {/* Column 1: Surface Ladder */}\n <div className=\"flex flex-col gap-5 @[52rem]:pr-10\">\n <div className=\"text-xs font-medium text-muted-foreground\">\n Surface ladder\n </div>\n <div className=\"grid grid-cols-4 gap-3\">\n {surfaceSteps.map((step) => (\n <div key={step.name} className=\"flex flex-col gap-2.5 text-center\">\n <div\n className=\"h-12 w-full rounded-md border border-border\"\n style={{ backgroundColor: step.hex }}\n />\n <div className=\"text-xs font-medium text-foreground\">\n {step.name}\n </div>\n </div>\n ))}\n </div>\n </div>\n\n {/* Column 2: Interaction States */}\n <div className=\"flex flex-col gap-5 @[52rem]:px-10\">\n <div className=\"text-xs font-medium text-muted-foreground\">\n Interaction states\n </div>\n <div className=\"flex items-center justify-between gap-2.5 pt-1\">\n {interactionStates.map((state, idx) => (\n <React.Fragment key={state.label}>\n <div className=\"flex flex-1 flex-col items-center gap-2.5\">\n <span\n className=\"inline-flex h-10 w-full items-center justify-center border border-border/30 px-3 text-xs font-medium\"\n style={{\n backgroundColor: state.background,\n color: state.foreground,\n borderRadius: sampleRadius,\n }}\n >\n {state.label}\n </span>\n <span className=\"font-mono text-[11px] uppercase text-muted-foreground\">\n {state.background.replace(\"#\", \"\")}\n </span>\n </div>\n {idx < interactionStates.length - 1 && (\n <span\n aria-hidden=\"true\"\n className=\"pb-6 text-xs text-muted-foreground\"\n >\n →\n </span>\n )}\n </React.Fragment>\n ))}\n </div>\n </div>\n\n {/* Column 3: Token Metrics */}\n <div className=\"flex flex-col gap-5 @[52rem]:pl-10\">\n <div className=\"text-xs font-medium text-muted-foreground\">\n Token metrics\n </div>\n <div className=\"grid grid-cols-3 gap-4 pt-1 text-center\">\n {metrics.map((metric) => (\n <div key={metric.label} className=\"flex flex-col gap-1.5\">\n <div className=\"font-mono text-lg font-semibold text-foreground tabular-nums\">\n {metric.value}\n </div>\n <div className=\"text-xs text-muted-foreground\">\n {metric.label}\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n\n {/* Bottom 2-Column Row: Density Gauge + Active Profile & Circular Color Palette */}\n <div className=\"grid grid-cols-1 gap-10 border-t border-border pt-10 @[52rem]:grid-cols-12 @[52rem]:gap-0 @[52rem]:divide-x @[52rem]:divide-border\">\n {/* Left: Spacing Density Gauge */}\n <div className=\"flex flex-col gap-5 @[52rem]:col-span-5 @[52rem]:pr-10\">\n <div className=\"text-xs font-medium text-muted-foreground\">\n Spacing density gauge\n </div>\n <div className=\"flex items-center justify-between gap-3 pt-2\">\n {densityOptions.map((step, idx) => {\n const active = activeDensityId === step.id;\n return (\n <React.Fragment key={step.id}>\n <button\n type=\"button\"\n disabled={!onDensityChange}\n aria-pressed={active}\n onClick={() => onDensityChange?.(step.id)}\n className={cn(\n \"flex flex-1 flex-col items-center gap-3 rounded-lg p-2 transition-colors duration-150\",\n onDensityChange\n ? \"cursor-pointer hover:bg-accent/50\"\n : \"cursor-default\"\n )}\n >\n <div className=\"h-3.5 w-full overflow-hidden rounded-full border border-border bg-secondary\">\n <div\n className=\"h-full rounded-full transition-[width,background-color] duration-200\"\n style={{\n width: `${step.fillPercent}%`,\n backgroundColor: active\n ? accentColor\n : \"var(--color-muted-foreground)\",\n }}\n />\n </div>\n <span\n className={cn(\n \"font-mono text-xs tabular-nums\",\n active\n ? \"font-semibold text-foreground\"\n : \"text-muted-foreground\"\n )}\n >\n {step.label}\n </span>\n </button>\n {idx < densityOptions.length - 1 && (\n <span\n aria-hidden=\"true\"\n className=\"pb-6 text-xs text-muted-foreground\"\n >\n →\n </span>\n )}\n </React.Fragment>\n );\n })}\n </div>\n </div>\n\n {/* Right: Active Profile + Circular Color Palette with Hex Codes */}\n <div className=\"flex flex-col gap-8 @[52rem]:col-span-7 @[52rem]:pl-10\">\n <div className=\"flex flex-col gap-3\">\n <div className=\"text-xs font-medium text-muted-foreground\">\n Active profile\n </div>\n <div className=\"flex flex-wrap items-center gap-2.5\">\n {profileTags.map((tag) => (\n <span\n key={tag}\n className=\"inline-flex items-center rounded-full border border-border bg-card px-3.5 py-1.5 text-xs font-medium text-foreground\"\n >\n {tag}\n </span>\n ))}\n </div>\n </div>\n\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <span className=\"text-xs font-medium text-muted-foreground\">\n Color palette\n </span>\n <span className=\"text-xs text-muted-foreground\">{copyHint}</span>\n </div>\n\n <div className=\"grid grid-cols-3 gap-5 @[34rem]:grid-cols-6\">\n {swatches.map((swatch) => {\n const hexCode = swatch.hex.replace(\"#\", \"\").toUpperCase();\n const isCopied = copiedHex === swatch.hex;\n return (\n <button\n key={swatch.label}\n type=\"button\"\n onClick={() => handleCopyHex(swatch.hex)}\n title={`Copy ${swatch.label}: ${swatch.hex}`}\n className=\"group flex flex-col items-center gap-2.5 text-center cursor-pointer\"\n >\n <span\n className=\"relative flex h-14 w-14 items-center justify-center rounded-full border border-border shadow-xs transition-transform duration-150 group-hover:scale-105\"\n style={{ backgroundColor: swatch.hex }}\n >\n {isCopied && (\n <span className=\"inline-flex h-6 w-6 items-center justify-center rounded-full bg-background/90 text-foreground\">\n <Check className=\"h-3.5 w-3.5\" />\n </span>\n )}\n </span>\n <span className=\"font-mono text-xs font-medium uppercase tracking-wide text-foreground tabular-nums\">\n {isCopied ? \"COPIED\" : hexCode}\n </span>\n <span className=\"text-[11px] text-muted-foreground\">\n {swatch.label}\n </span>\n </button>\n );\n })}\n </div>\n </div>\n </div>\n </div>\n </section>\n );\n}\n"
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"path": "blocks/color-palette-sheet/index.ts",
|
|
571
|
+
"type": "registry:block",
|
|
572
|
+
"content": "export * from \"./color-palette-sheet\";\n"
|
|
573
|
+
}
|
|
574
|
+
]
|
|
575
|
+
},
|
|
547
576
|
{
|
|
548
577
|
"name": "color-swatch",
|
|
549
578
|
"type": "registry:ui",
|
|
550
579
|
"title": "Color Swatch",
|
|
551
580
|
"description": "Accessible Color Swatch primitive component built with Base UI and Tailwind v4.",
|
|
552
|
-
"license": "
|
|
581
|
+
"license": "MIT",
|
|
553
582
|
"dependencies": [
|
|
554
583
|
"class-variance-authority"
|
|
555
584
|
],
|
|
@@ -578,7 +607,7 @@
|
|
|
578
607
|
"type": "registry:ui",
|
|
579
608
|
"title": "Combobox",
|
|
580
609
|
"description": "Accessible Combobox primitive component built with Base UI and Tailwind v4.",
|
|
581
|
-
"license": "
|
|
610
|
+
"license": "MIT",
|
|
582
611
|
"dependencies": [
|
|
583
612
|
"lucide-react"
|
|
584
613
|
],
|
|
@@ -594,7 +623,7 @@
|
|
|
594
623
|
{
|
|
595
624
|
"path": "components/combobox/combobox.tsx",
|
|
596
625
|
"type": "registry:ui",
|
|
597
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Check, ChevronsUpDown, Search } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover\";\n\nexport interface ComboboxOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface ComboboxProps {\n options: ComboboxOption[];\n value?: string;\n onChange?: (value: string) => void;\n placeholder?: string;\n searchPlaceholder?: string;\n disabled?: boolean;\n className?: string;\n}\n\n/**\n * Filterable single-select. The trigger stays the ARIA combobox\n * (DESIGN.md selector surface); the popup input owns a managed highlight —\n * ArrowDown/ArrowUp/Home/End move an active index while focus stays in the\n * input, `aria-activedescendant` always points at the highlighted option,\n * Enter commits and Escape dismisses with focus restored to the trigger.\n */\nexport const Combobox = React.forwardRef<HTMLButtonElement, ComboboxProps>(\n (\n {\n options,\n value,\n onChange,\n placeholder = \"Select option...\",\n searchPlaceholder = \"Search options...\",\n disabled = false,\n className,\n },\n ref\n ) => {\n const [open, setOpen] = React.useState(false);\n const [search, setSearch] = React.useState(\"\");\n const [activeIndex, setActiveIndex] = React.useState(-1);\n\n const triggerRef = React.useRef<HTMLButtonElement | null>(null);\n const inputRef = React.useRef<HTMLInputElement | null>(null);\n const listboxId = React.useId();\n const optionId = (index: number) => `${listboxId}-option-${index}`;\n\n const setTriggerRef = React.useCallback(\n (node: HTMLButtonElement | null) => {\n triggerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n },\n [ref]\n );\n\n const filteredOptions = options.filter((o) =>\n o.label.toLowerCase().includes(search.toLowerCase())\n );\n\n const selectedOption = options.find((o) => o.value === value);\n\n React.useEffect(() => {\n if (open) inputRef.current?.focus();\n }, [open]);\n\n // Keep the highlighted row visible while arrowing through a long list.\n React.useEffect(() => {\n if (!open || activeIndex < 0) return;\n const node = document.getElementById(optionId(activeIndex));\n node?.scrollIntoView?.({ block: \"nearest\" });\n }, [open, activeIndex]);\n\n const closeCombobox = (restoreFocus: boolean) => {\n setOpen(false);\n setSearch(\"\");\n setActiveIndex(-1);\n if (restoreFocus) triggerRef.current?.focus();\n };\n\n const moveActive = (delta: 1 | -1) => {\n setActiveIndex((current) => {\n const count = filteredOptions.length;\n if (count === 0) return -1;\n let next = current;\n for (let step = 0; step < count; step++) {\n next = (next + delta + count) % count;\n if (!filteredOptions[next].disabled) return next;\n }\n return current;\n });\n };\n\n const moveActiveToEdge = (edge: \"first\" | \"last\") => {\n setActiveIndex(() => {\n const enabled = filteredOptions\n .map((option, index) => (option.disabled ? -1 : index))\n .filter((index) => index >= 0);\n if (enabled.length === 0) return -1;\n return edge === \"first\" ? enabled[0] : enabled[enabled.length - 1];\n });\n };\n\n const selectOption = (option: ComboboxOption) => {\n if (option.disabled) return;\n onChange?.(option.value);\n closeCombobox(true);\n };\n\n const handleInputKeyDown = (\n event: React.KeyboardEvent<HTMLInputElement>\n ) => {\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault();\n moveActive(1);\n break;\n case \"ArrowUp\":\n event.preventDefault();\n moveActive(-1);\n break;\n case \"Home\":\n event.preventDefault();\n moveActiveToEdge(\"first\");\n break;\n case \"End\":\n event.preventDefault();\n moveActiveToEdge(\"last\");\n break;\n case \"Enter\": {\n event.preventDefault();\n const option = filteredOptions[activeIndex];\n if (option) selectOption(option);\n break;\n }\n case \"Escape\":\n event.preventDefault();\n closeCombobox(true);\n break;\n default:\n break;\n }\n };\n\n const activeOption =\n activeIndex >= 0 ? filteredOptions[activeIndex] : undefined;\n\n return (\n <Popover\n open={open}\n onOpenChange={(next) => {\n if (next) setOpen(true);\n else closeCombobox(false);\n }}\n >\n <PopoverTrigger\n render={\n <button\n ref={setTriggerRef}\n type=\"button\"\n role=\"combobox\"\n disabled={disabled}\n aria-expanded={open}\n aria-haspopup=\"listbox\"\n aria-controls={open ? listboxId : undefined}\n aria-label={selectedOption ? selectedOption.label : placeholder}\n className={cn(\n \"flex h-9 w-full items-center justify-between rounded-md border border-input bg-field px-3 py-2 text-sm text-foreground ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring focus:border-ring disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n >\n <span className=\"line-clamp-1 text-left\">\n {selectedOption ? selectedOption.label : placeholder}\n </span>\n <ChevronsUpDown className=\"ml-2 h-4 w-4 shrink-0 text-fog\" />\n </button>\n }\n />\n <PopoverContent\n align=\"start\"\n className=\"w-[var(--anchor-width)] rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-(--shadow-xl) data-open:animate-overlay-in data-closed:animate-overlay-out\"\n >\n <span\n className=\"sr-only\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {filteredOptions.length === 0\n ? \"No options found.\"\n : `${filteredOptions.length} ${\n filteredOptions.length === 1 ? \"option\" : \"options\"\n } available.`}\n </span>\n\n <div className=\"flex items-center gap-2 border-b border-border px-2.5\">\n <Search className=\"h-3.5 w-3.5 shrink-0 text-fog\" aria-hidden=\"true\" />\n <input\n ref={inputRef}\n type=\"text\"\n role=\"combobox\"\n aria-expanded={open}\n aria-controls={listboxId}\n aria-autocomplete=\"list\"\n aria-activedescendant={\n activeOption ? optionId(activeIndex) : undefined\n }\n placeholder={searchPlaceholder}\n value={search}\n onChange={(event) => {\n setSearch(event.target.value);\n setActiveIndex(-1);\n }}\n onKeyDown={handleInputKeyDown}\n className=\"h-9 flex-1 bg-transparent text-caption text-foreground outline-none placeholder:text-fog\"\n />\n </div>\n\n <div\n id={listboxId}\n role=\"listbox\"\n aria-label={placeholder}\n className=\"max-h-64 overflow-y-auto p-1\"\n >\n {filteredOptions.length === 0 ? (\n <div className=\"py-6 text-center text-caption text-muted-foreground\">\n No options found.\n </div>\n ) : (\n filteredOptions.map((option, index) => {\n const isSelected = value === option.value;\n const isHighlighted = index === activeIndex;\n return (\n <div\n key={option.value}\n id={optionId(index)}\n role=\"option\"\n aria-selected={isSelected}\n aria-disabled={option.disabled}\n data-highlighted={isHighlighted ? \"true\" : undefined}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => selectOption(option)}\n className={cn(\n \"flex h-8 cursor-pointer select-none items-center gap-2 rounded-md px-2.5 text-caption text-muted-foreground transition-colors data-[highlighted]:bg-accent data-[highlighted]:text-foreground\",\n option.disabled\n ? \"cursor-not-allowed opacity-50\"\n : \"hover:bg-accent hover:text-foreground\"\n )}\n >\n <span className=\"flex-1 truncate\">{option.label}</span>\n {isSelected && (\n <Check\n className=\"h-3.5 w-3.5 shrink-0 text-foreground\"\n aria-hidden=\"true\"\n />\n )}\n </div>\n );\n })\n )}\n </div>\n </PopoverContent>\n </Popover>\n );\n }\n);\n\nCombobox.displayName = \"Combobox\";\n"
|
|
626
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Check, ChevronsUpDown, Search } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover\";\n\nexport interface ComboboxOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface ComboboxProps {\n options: ComboboxOption[];\n value?: string;\n onChange?: (value: string) => void;\n placeholder?: string;\n searchPlaceholder?: string;\n disabled?: boolean;\n className?: string;\n}\n\n/**\n * Filterable single-select. The trigger stays the ARIA combobox\n * (DESIGN.md selector surface); the popup input owns a managed highlight —\n * ArrowDown/ArrowUp/Home/End move an active index while focus stays in the\n * input, `aria-activedescendant` always points at the highlighted option,\n * Enter commits and Escape dismisses with focus restored to the trigger.\n */\nexport const Combobox = React.forwardRef<HTMLButtonElement, ComboboxProps>(\n (\n {\n options,\n value,\n onChange,\n placeholder = \"Select option...\",\n searchPlaceholder = \"Search options...\",\n disabled = false,\n className,\n },\n ref\n ) => {\n const [open, setOpen] = React.useState(false);\n const [search, setSearch] = React.useState(\"\");\n const [activeIndex, setActiveIndex] = React.useState(-1);\n\n const triggerRef = React.useRef<HTMLButtonElement | null>(null);\n const inputRef = React.useRef<HTMLInputElement | null>(null);\n const listboxId = React.useId();\n const optionId = (index: number) => `${listboxId}-option-${index}`;\n\n const setTriggerRef = React.useCallback(\n (node: HTMLButtonElement | null) => {\n triggerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n },\n [ref]\n );\n\n const filteredOptions = options.filter((o) =>\n o.label.toLowerCase().includes(search.toLowerCase())\n );\n\n const selectedOption = options.find((o) => o.value === value);\n\n React.useEffect(() => {\n if (open) inputRef.current?.focus();\n }, [open]);\n\n // Keep the highlighted row visible while arrowing through a long list.\n React.useEffect(() => {\n if (!open || activeIndex < 0) return;\n const node = document.getElementById(optionId(activeIndex));\n node?.scrollIntoView?.({ block: \"nearest\" });\n }, [open, activeIndex]);\n\n const closeCombobox = (restoreFocus: boolean) => {\n setOpen(false);\n setSearch(\"\");\n setActiveIndex(-1);\n if (restoreFocus) triggerRef.current?.focus();\n };\n\n const moveActive = (delta: 1 | -1) => {\n setActiveIndex((current) => {\n const count = filteredOptions.length;\n if (count === 0) return -1;\n let next = current;\n for (let step = 0; step < count; step++) {\n next = (next + delta + count) % count;\n if (!filteredOptions[next].disabled) return next;\n }\n return current;\n });\n };\n\n const moveActiveToEdge = (edge: \"first\" | \"last\") => {\n setActiveIndex(() => {\n const enabled = filteredOptions\n .map((option, index) => (option.disabled ? -1 : index))\n .filter((index) => index >= 0);\n if (enabled.length === 0) return -1;\n return edge === \"first\" ? enabled[0] : enabled[enabled.length - 1];\n });\n };\n\n const selectOption = (option: ComboboxOption) => {\n if (option.disabled) return;\n onChange?.(option.value);\n closeCombobox(true);\n };\n\n const handleInputKeyDown = (\n event: React.KeyboardEvent<HTMLInputElement>\n ) => {\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault();\n moveActive(1);\n break;\n case \"ArrowUp\":\n event.preventDefault();\n moveActive(-1);\n break;\n case \"Home\":\n event.preventDefault();\n moveActiveToEdge(\"first\");\n break;\n case \"End\":\n event.preventDefault();\n moveActiveToEdge(\"last\");\n break;\n case \"Enter\": {\n event.preventDefault();\n const option = filteredOptions[activeIndex];\n if (option) selectOption(option);\n break;\n }\n case \"Escape\":\n event.preventDefault();\n closeCombobox(true);\n break;\n default:\n break;\n }\n };\n\n const activeOption =\n activeIndex >= 0 ? filteredOptions[activeIndex] : undefined;\n\n return (\n <Popover\n open={open}\n onOpenChange={(next) => {\n if (next) setOpen(true);\n else closeCombobox(false);\n }}\n >\n <PopoverTrigger\n render={\n <button\n ref={setTriggerRef}\n type=\"button\"\n role=\"combobox\"\n disabled={disabled}\n aria-expanded={open}\n aria-haspopup=\"listbox\"\n aria-controls={open ? listboxId : undefined}\n aria-label={selectedOption ? selectedOption.label : placeholder}\n className={cn(\n \"flex h-9 w-full items-center justify-between rounded-md border border-input bg-field px-3 py-2 text-sm text-foreground ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n >\n <span className=\"line-clamp-1 text-left\">\n {selectedOption ? selectedOption.label : placeholder}\n </span>\n <ChevronsUpDown className=\"ml-2 h-4 w-4 shrink-0 text-fog\" />\n </button>\n }\n />\n <PopoverContent\n align=\"start\"\n className=\"w-[var(--anchor-width)] rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-(--shadow-xl) data-open:animate-overlay-in data-closed:animate-overlay-out\"\n >\n <span\n className=\"sr-only\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {filteredOptions.length === 0\n ? \"No options found.\"\n : `${filteredOptions.length} ${\n filteredOptions.length === 1 ? \"option\" : \"options\"\n } available.`}\n </span>\n\n <div className=\"flex items-center gap-2 border-b border-border px-2.5\">\n <Search className=\"h-3.5 w-3.5 shrink-0 text-fog\" aria-hidden=\"true\" />\n <input\n ref={inputRef}\n type=\"text\"\n role=\"combobox\"\n aria-expanded={open}\n aria-controls={listboxId}\n aria-autocomplete=\"list\"\n aria-activedescendant={\n activeOption ? optionId(activeIndex) : undefined\n }\n placeholder={searchPlaceholder}\n value={search}\n onChange={(event) => {\n setSearch(event.target.value);\n setActiveIndex(-1);\n }}\n onKeyDown={handleInputKeyDown}\n className=\"h-9 flex-1 bg-transparent text-caption text-foreground outline-none placeholder:text-fog\"\n />\n </div>\n\n <div\n id={listboxId}\n role=\"listbox\"\n aria-label={placeholder}\n className=\"max-h-64 overflow-y-auto p-1\"\n >\n {filteredOptions.length === 0 ? (\n <div className=\"py-6 text-center text-caption text-muted-foreground\">\n No options found.\n </div>\n ) : (\n filteredOptions.map((option, index) => {\n const isSelected = value === option.value;\n const isHighlighted = index === activeIndex;\n return (\n <div\n key={option.value}\n id={optionId(index)}\n role=\"option\"\n aria-selected={isSelected}\n aria-disabled={option.disabled}\n data-highlighted={isHighlighted ? \"true\" : undefined}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => selectOption(option)}\n className={cn(\n \"flex h-8 cursor-pointer select-none items-center gap-2 rounded-md px-2.5 text-caption text-muted-foreground transition-colors data-[highlighted]:bg-accent data-[highlighted]:text-foreground\",\n option.disabled\n ? \"cursor-not-allowed opacity-50\"\n : \"hover:bg-accent hover:text-foreground\"\n )}\n >\n <span className=\"flex-1 truncate\">{option.label}</span>\n {isSelected && (\n <Check\n className=\"h-3.5 w-3.5 shrink-0 text-foreground\"\n aria-hidden=\"true\"\n />\n )}\n </div>\n );\n })\n )}\n </div>\n </PopoverContent>\n </Popover>\n );\n }\n);\n\nCombobox.displayName = \"Combobox\";\n"
|
|
598
627
|
},
|
|
599
628
|
{
|
|
600
629
|
"path": "components/combobox/index.ts",
|
|
@@ -608,7 +637,7 @@
|
|
|
608
637
|
"type": "registry:ui",
|
|
609
638
|
"title": "Command",
|
|
610
639
|
"description": "Accessible Command primitive component built with Base UI and Tailwind v4.",
|
|
611
|
-
"license": "
|
|
640
|
+
"license": "MIT",
|
|
612
641
|
"dependencies": [
|
|
613
642
|
"cmdk",
|
|
614
643
|
"lucide-react"
|
|
@@ -639,7 +668,7 @@
|
|
|
639
668
|
"type": "registry:ui",
|
|
640
669
|
"title": "Context Menu",
|
|
641
670
|
"description": "Accessible Context Menu primitive component built with Base UI and Tailwind v4.",
|
|
642
|
-
"license": "
|
|
671
|
+
"license": "MIT",
|
|
643
672
|
"dependencies": [
|
|
644
673
|
"@base-ui/react",
|
|
645
674
|
"lucide-react"
|
|
@@ -656,7 +685,7 @@
|
|
|
656
685
|
{
|
|
657
686
|
"path": "components/context-menu/context-menu.tsx",
|
|
658
687
|
"type": "registry:ui",
|
|
659
|
-
"content": "import * as React from \"react\";\nimport { Menu as BaseMenu } from \"@base-ui/react/menu\";\nimport { Check, ChevronRight, Circle } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport const ContextMenu = BaseMenu.Root;\nexport const ContextMenuPortal = BaseMenu.Portal;\nexport const ContextMenuPositioner = BaseMenu.Positioner;\n\nexport const ContextMenuTrigger = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"cursor-context-menu\", className)}\n {...props}\n />\n));\nContextMenuTrigger.displayName = \"ContextMenuTrigger\";\n\nexport const ContextMenuContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseMenu.Popup>\n>(({ className, ...props }, ref) => (\n <ContextMenuPortal>\n <BaseMenu.Positioner sideOffset={4}>\n <BaseMenu.Popup\n ref={ref}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-
|
|
688
|
+
"content": "import * as React from \"react\";\nimport { Menu as BaseMenu } from \"@base-ui/react/menu\";\nimport { Check, ChevronRight, Circle } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport const ContextMenu = BaseMenu.Root;\nexport const ContextMenuPortal = BaseMenu.Portal;\nexport const ContextMenuPositioner = BaseMenu.Positioner;\n\nexport const ContextMenuTrigger = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"cursor-context-menu\", className)}\n {...props}\n />\n));\nContextMenuTrigger.displayName = \"ContextMenuTrigger\";\n\nexport const ContextMenuContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseMenu.Popup>\n>(({ className, ...props }, ref) => (\n <ContextMenuPortal>\n <BaseMenu.Positioner sideOffset={4}>\n <BaseMenu.Popup\n ref={ref}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-lg border border-border bg-popover p-1.5 text-popover-foreground shadow-(--shadow-xl) outline-none data-open:animate-overlay-in data-closed:animate-overlay-out\",\n className\n )}\n {...props}\n />\n </BaseMenu.Positioner>\n </ContextMenuPortal>\n));\nContextMenuContent.displayName = \"ContextMenuContent\";\n\nexport const ContextMenuItem = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseMenu.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <BaseMenu.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-pointer select-none items-center gap-2 rounded-md px-3 py-2 text-xs outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n));\nContextMenuItem.displayName = \"ContextMenuItem\";\n\nexport const ContextMenuSeparator = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseMenu.Separator>\n>(({ className, ...props }, ref) => (\n <BaseMenu.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n));\nContextMenuSeparator.displayName = \"ContextMenuSeparator\";\n\nexport const ContextMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground font-mono\",\n className\n )}\n {...props}\n />\n );\n};\nContextMenuShortcut.displayName = \"ContextMenuShortcut\";\n"
|
|
660
689
|
},
|
|
661
690
|
{
|
|
662
691
|
"path": "components/context-menu/index.ts",
|
|
@@ -670,7 +699,7 @@
|
|
|
670
699
|
"type": "registry:ui",
|
|
671
700
|
"title": "Copy Button",
|
|
672
701
|
"description": "Accessible Copy Button primitive component built with Base UI and Tailwind v4.",
|
|
673
|
-
"license": "
|
|
702
|
+
"license": "MIT",
|
|
674
703
|
"dependencies": [
|
|
675
704
|
"lucide-react"
|
|
676
705
|
],
|
|
@@ -700,7 +729,7 @@
|
|
|
700
729
|
"type": "registry:block",
|
|
701
730
|
"title": "Dashboard Header Block",
|
|
702
731
|
"description": "Composed Dashboard Header block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
703
|
-
"license": "
|
|
732
|
+
"license": "MIT",
|
|
704
733
|
"dependencies": [
|
|
705
734
|
"lucide-react"
|
|
706
735
|
],
|
|
@@ -720,7 +749,7 @@
|
|
|
720
749
|
{
|
|
721
750
|
"path": "blocks/dashboard-header/dashboard-header.tsx",
|
|
722
751
|
"type": "registry:block",
|
|
723
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Bell, Search } from \"lucide-react\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../../components/avatar\";\nimport { Breadcrumb, BreadcrumbItem, BreadcrumbList, BreadcrumbPage } from \"../../components/breadcrumb\";\nimport { Button } from \"../../components/button\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from \"../../components/dropdown-menu\";\nimport { Input } from \"../../components/input\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface DashboardHeaderProps {\n title?: string;\n userName?: string;\n userAvatarUrl?: string;\n onSearch?: (query: string) => void;\n actions?: React.ReactNode;\n notificationCount?: number;\n onNotificationsClick?: () => void;\n onProfileSettings?: () => void;\n onTeamManagement?: () => void;\n onLogout?: () => void;\n className?: string;\n}\n\nexport function DashboardHeader({\n title = \"Dashboard\",\n userName = \"Alex Rivera\",\n userAvatarUrl = \"https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=150\",\n onSearch,\n actions,\n notificationCount = 0,\n onNotificationsClick,\n onProfileSettings,\n onTeamManagement,\n onLogout,\n className\n}: DashboardHeaderProps) {\n return (\n <header className={cn(\"flex min-h-16 w-full flex-wrap items-center justify-between gap-
|
|
752
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Bell, Search } from \"lucide-react\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../../components/avatar\";\nimport { Breadcrumb, BreadcrumbItem, BreadcrumbList, BreadcrumbPage } from \"../../components/breadcrumb\";\nimport { Button } from \"../../components/button\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from \"../../components/dropdown-menu\";\nimport { Input } from \"../../components/input\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface DashboardHeaderProps {\n title?: string;\n userName?: string;\n userAvatarUrl?: string;\n onSearch?: (query: string) => void;\n actions?: React.ReactNode;\n notificationCount?: number;\n onNotificationsClick?: () => void;\n onProfileSettings?: () => void;\n onTeamManagement?: () => void;\n onLogout?: () => void;\n className?: string;\n}\n\nexport function DashboardHeader({\n title = \"Dashboard\",\n userName = \"Alex Rivera\",\n userAvatarUrl = \"https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=150\",\n onSearch,\n actions,\n notificationCount = 0,\n onNotificationsClick,\n onProfileSettings,\n onTeamManagement,\n onLogout,\n className\n}: DashboardHeaderProps) {\n return (\n <header className={cn(\"flex min-h-16 w-full flex-wrap items-center justify-between gap-3 border-b border-border bg-card px-5 py-3 text-foreground sm:h-16 sm:flex-nowrap sm:gap-5 sm:px-7 sm:py-0\", className)}>\n <Breadcrumb className=\"min-w-0 shrink\">\n <BreadcrumbList>\n <BreadcrumbItem>\n <BreadcrumbPage className=\"truncate\">{title}</BreadcrumbPage>\n </BreadcrumbItem>\n </BreadcrumbList>\n </Breadcrumb>\n\n <div className=\"order-2 flex shrink-0 items-center justify-end gap-2 sm:gap-4\">\n {actions && <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>}\n\n {onNotificationsClick && (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n aria-label={\n notificationCount > 0\n ? `Notifications (${notificationCount} unread)`\n : \"Notifications\"\n }\n onClick={onNotificationsClick}\n className=\"relative h-9 w-9 shrink-0 text-muted-foreground hover:text-foreground\"\n >\n <Bell className=\"h-4 w-4\" />\n {notificationCount > 0 && (\n <span\n aria-hidden=\"true\"\n className=\"absolute right-1.5 top-1.5 inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-paper px-1 text-[10px] font-w510 leading-none text-void\"\n >\n {notificationCount > 9 ? \"9+\" : notificationCount}\n </span>\n )}\n </Button>\n )}\n\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n <Button variant=\"ghost\" aria-label={`User menu for ${userName}`} className=\"h-9 w-9 shrink-0 rounded-full p-0\">\n <Avatar className=\"h-9 w-9\">\n <AvatarImage src={userAvatarUrl} alt={userName} />\n <AvatarFallback>{userName.charAt(0)}</AvatarFallback>\n </Avatar>\n </Button>\n }\n />\n <DropdownMenuContent align=\"end\" className=\"w-56\">\n <DropdownMenuGroup>\n <DropdownMenuLabel>{userName}</DropdownMenuLabel>\n {onProfileSettings && (\n <DropdownMenuItem onClick={onProfileSettings}>\n Profile Settings\n </DropdownMenuItem>\n )}\n {onTeamManagement && (\n <DropdownMenuItem onClick={onTeamManagement}>\n Team Management\n </DropdownMenuItem>\n )}\n </DropdownMenuGroup>\n {onLogout && (\n <>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={onLogout}\n className=\"text-coral-red-foreground focus:text-coral-red-foreground\"\n >\n Log out\n </DropdownMenuItem>\n </>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n\n <div className=\"relative order-3 w-full min-w-0 sm:w-64 sm:flex-none\">\n <Search className=\"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground\" />\n <Input\n type=\"search\"\n aria-label=\"Search dashboard\"\n placeholder=\"Search dashboard...\"\n onChange={(e) => onSearch?.(e.target.value)}\n className=\"h-9 pl-9 text-xs border-border placeholder:text-muted-foreground\"\n />\n </div>\n </header>\n );\n}\n"
|
|
724
753
|
},
|
|
725
754
|
{
|
|
726
755
|
"path": "blocks/dashboard-header/index.ts",
|
|
@@ -734,7 +763,7 @@
|
|
|
734
763
|
"type": "registry:ui",
|
|
735
764
|
"title": "Data Table",
|
|
736
765
|
"description": "Accessible Data Table primitive component built with Base UI and Tailwind v4.",
|
|
737
|
-
"license": "
|
|
766
|
+
"license": "MIT",
|
|
738
767
|
"dependencies": [
|
|
739
768
|
"@tanstack/react-table",
|
|
740
769
|
"lucide-react"
|
|
@@ -753,7 +782,7 @@
|
|
|
753
782
|
{
|
|
754
783
|
"path": "components/data-table/data-table.tsx",
|
|
755
784
|
"type": "registry:ui",
|
|
756
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n ColumnDef,\n ColumnFiltersState,\n SortingState,\n VisibilityState,\n flexRender,\n getCoreRowModel,\n getFilteredRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n useReactTable,\n} from \"@tanstack/react-table\";\nimport {\n ChevronLeft,\n ChevronRight,\n ChevronsLeft,\n ChevronsRight,\n ArrowUpDown,\n} from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../button\";\nimport { Input } from \"../input\";\n\nexport interface DataTableProps<TData, TValue> {\n columns: ColumnDef<TData, TValue>[];\n data: TData[];\n filterColumnKey?: string;\n filterPlaceholder?: string;\n pageSize?: number;\n className?: string;\n}\n\nexport function DataTableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n}: {\n column: any;\n title: string;\n className?: string;\n}) {\n if (!column.getCanSort()) {\n return (\n <div className={cn(\"text-xs font-semibold text-muted-foreground\", className)}>\n {title}\n </div>\n );\n }\n\n return (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => column.toggleSorting(column.getIsSorted() === \"asc\")}\n className={cn(\n \"-ml-3 h-8 text-xs font-semibold text-muted-foreground hover:text-foreground\",\n className\n )}\n >\n <span>{title}</span>\n <ArrowUpDown className=\"ml-2 h-3.5 w-3.5\" />\n </Button>\n );\n}\n\nexport function DataTable<TData, TValue>({\n columns,\n data,\n filterColumnKey,\n filterPlaceholder = \"Filter results...\",\n pageSize = 5,\n className,\n}: DataTableProps<TData, TValue>) {\n const [sorting, setSorting] = React.useState<SortingState>([]);\n const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(\n []\n );\n const [columnVisibility, setColumnVisibility] =\n React.useState<VisibilityState>({});\n const [globalFilter, setGlobalFilter] = React.useState(\"\");\n\n const table = useReactTable({\n data,\n columns,\n state: {\n sorting,\n columnFilters,\n columnVisibility,\n globalFilter,\n },\n onSortingChange: setSorting,\n onColumnFiltersChange: setColumnFilters,\n onColumnVisibilityChange: setColumnVisibility,\n onGlobalFilterChange: setGlobalFilter,\n getCoreRowModel: getCoreRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n getSortedRowModel: getSortedRowModel(),\n initialState: {\n pagination: {\n pageSize,\n },\n },\n });\n\n return (\n <div className={cn(\"w-full space-y-4\", className)}>\n {/* Toolbar / Search */}\n <div className=\"flex items-center justify-between gap-4\">\n <Input\n placeholder={filterPlaceholder}\n value={\n filterColumnKey\n ? (table.getColumn(filterColumnKey)?.getFilterValue() as string) ??\n \"\"\n : globalFilter\n }\n onChange={(event) => {\n if (filterColumnKey) {\n table\n .getColumn(filterColumnKey)\n ?.setFilterValue(event.target.value);\n } else {\n setGlobalFilter(event.target.value);\n }\n }}\n className=\"max-w-sm h-9 text-xs\"\n />\n <div\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"text-xs text-muted-foreground font-mono\"\n >\n {table.getFilteredRowModel().rows.length} row(s) total\n </div>\n </div>\n\n {/* Table grid */}\n <div className=\"rounded-
|
|
785
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n ColumnDef,\n ColumnFiltersState,\n SortingState,\n VisibilityState,\n flexRender,\n getCoreRowModel,\n getFilteredRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n useReactTable,\n} from \"@tanstack/react-table\";\nimport {\n ChevronLeft,\n ChevronRight,\n ChevronsLeft,\n ChevronsRight,\n ArrowUpDown,\n} from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../button\";\nimport { Input } from \"../input\";\n\nexport interface DataTableProps<TData, TValue> {\n columns: ColumnDef<TData, TValue>[];\n data: TData[];\n filterColumnKey?: string;\n filterPlaceholder?: string;\n pageSize?: number;\n className?: string;\n}\n\nexport function DataTableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n}: {\n column: any;\n title: string;\n className?: string;\n}) {\n if (!column.getCanSort()) {\n return (\n <div className={cn(\"text-xs font-semibold text-muted-foreground\", className)}>\n {title}\n </div>\n );\n }\n\n return (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => column.toggleSorting(column.getIsSorted() === \"asc\")}\n className={cn(\n \"-ml-3 h-8 text-xs font-semibold text-muted-foreground hover:text-foreground\",\n className\n )}\n >\n <span>{title}</span>\n <ArrowUpDown className=\"ml-2 h-3.5 w-3.5\" />\n </Button>\n );\n}\n\nexport function DataTable<TData, TValue>({\n columns,\n data,\n filterColumnKey,\n filterPlaceholder = \"Filter results...\",\n pageSize = 5,\n className,\n}: DataTableProps<TData, TValue>) {\n const [sorting, setSorting] = React.useState<SortingState>([]);\n const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(\n []\n );\n const [columnVisibility, setColumnVisibility] =\n React.useState<VisibilityState>({});\n const [globalFilter, setGlobalFilter] = React.useState(\"\");\n\n const table = useReactTable({\n data,\n columns,\n state: {\n sorting,\n columnFilters,\n columnVisibility,\n globalFilter,\n },\n onSortingChange: setSorting,\n onColumnFiltersChange: setColumnFilters,\n onColumnVisibilityChange: setColumnVisibility,\n onGlobalFilterChange: setGlobalFilter,\n getCoreRowModel: getCoreRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n getSortedRowModel: getSortedRowModel(),\n initialState: {\n pagination: {\n pageSize,\n },\n },\n });\n\n return (\n <div className={cn(\"w-full space-y-4\", className)}>\n {/* Toolbar / Search */}\n <div className=\"flex items-center justify-between gap-4\">\n <Input\n placeholder={filterPlaceholder}\n value={\n filterColumnKey\n ? (table.getColumn(filterColumnKey)?.getFilterValue() as string) ??\n \"\"\n : globalFilter\n }\n onChange={(event) => {\n if (filterColumnKey) {\n table\n .getColumn(filterColumnKey)\n ?.setFilterValue(event.target.value);\n } else {\n setGlobalFilter(event.target.value);\n }\n }}\n className=\"max-w-sm h-9 text-xs\"\n />\n <div\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"text-xs text-muted-foreground font-mono\"\n >\n {table.getFilteredRowModel().rows.length} row(s) total\n </div>\n </div>\n\n {/* Table grid */}\n <div className=\"rounded-lg border border-border bg-background overflow-x-auto\">\n <table className=\"w-full text-left text-xs text-foreground border-collapse\">\n <thead className=\"bg-muted/50 border-b border-border text-muted-foreground uppercase tracking-wider\">\n {table.getHeaderGroups().map((headerGroup) => (\n <tr key={headerGroup.id}>\n {headerGroup.headers.map((header) => (\n <th key={header.id} className=\"px-4 py-3 font-semibold\">\n {header.isPlaceholder\n ? null\n : flexRender(\n header.column.columnDef.header,\n header.getContext()\n )}\n </th>\n ))}\n </tr>\n ))}\n </thead>\n <tbody className=\"divide-y divide-border/60\">\n {table.getRowModel().rows?.length ? (\n table.getRowModel().rows.map((row) => (\n <tr\n key={row.id}\n className=\"hover:bg-muted/50 transition-colors data-[selected=true]:bg-muted\"\n >\n {row.getVisibleCells().map((cell) => (\n <td key={cell.id} className=\"px-4 py-3 text-foreground\">\n {flexRender(\n cell.column.columnDef.cell,\n cell.getContext()\n )}\n </td>\n ))}\n </tr>\n ))\n ) : (\n <tr>\n <td\n colSpan={columns.length}\n className=\"h-24 text-center text-muted-foreground\"\n >\n No results found.\n </td>\n </tr>\n )}\n </tbody>\n </table>\n </div>\n\n {/* Pagination controls */}\n <div className=\"flex items-center justify-between px-2 text-xs text-muted-foreground\">\n <div>\n Page {table.getState().pagination.pageIndex + 1} of{\" \"}\n {table.getPageCount() || 1}\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => table.setPageIndex(0)}\n disabled={!table.getCanPreviousPage()}\n aria-label=\"First page\"\n className=\"h-8 w-8 p-0\"\n >\n <ChevronsLeft className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => table.previousPage()}\n disabled={!table.getCanPreviousPage()}\n aria-label=\"Previous page\"\n className=\"h-8 w-8 p-0\"\n >\n <ChevronLeft className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => table.nextPage()}\n disabled={!table.getCanNextPage()}\n aria-label=\"Next page\"\n className=\"h-8 w-8 p-0\"\n >\n <ChevronRight className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => table.setPageIndex(table.getPageCount() - 1)}\n disabled={!table.getCanNextPage()}\n aria-label=\"Last page\"\n className=\"h-8 w-8 p-0\"\n >\n <ChevronsRight className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n </div>\n );\n}\n"
|
|
757
786
|
},
|
|
758
787
|
{
|
|
759
788
|
"path": "components/data-table/index.ts",
|
|
@@ -767,14 +796,15 @@
|
|
|
767
796
|
"type": "registry:block",
|
|
768
797
|
"title": "Data Table With Filters Block",
|
|
769
798
|
"description": "Composed Data Table With Filters block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
770
|
-
"license": "
|
|
799
|
+
"license": "MIT",
|
|
771
800
|
"dependencies": [
|
|
772
801
|
"@tanstack/react-table"
|
|
773
802
|
],
|
|
774
803
|
"devDependencies": [],
|
|
775
804
|
"registryDependencies": [
|
|
776
805
|
"combobox",
|
|
777
|
-
"data-table"
|
|
806
|
+
"data-table",
|
|
807
|
+
"utils"
|
|
778
808
|
],
|
|
779
809
|
"dependencyVersions": {
|
|
780
810
|
"@tanstack/react-table": "^8.21.2"
|
|
@@ -783,7 +813,7 @@
|
|
|
783
813
|
{
|
|
784
814
|
"path": "blocks/data-table-with-filters/data-table-with-filters.tsx",
|
|
785
815
|
"type": "registry:block",
|
|
786
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { ColumnDef } from \"@tanstack/react-table\";\nimport { Combobox } from \"../../components/combobox\";\nimport { DataTable, DataTableColumnHeader } from \"../../components/data-table\";\n\nexport interface SystemUser {\n id: string;\n name: string;\n email: string;\n role: string;\n status: string;\n}\n\nconst columns: ColumnDef<SystemUser>[] = [\n {\n accessorKey: \"name\",\n header: ({ column }) => <DataTableColumnHeader column={column} title=\"User\" />\n },\n {\n accessorKey: \"email\",\n header: \"Email\"\n },\n {\n accessorKey: \"role\",\n header: \"Role\"\n },\n {\n accessorKey: \"status\",\n header: \"Status\"\n }\n];\n\nexport interface DataTableWithFiltersProps {\n data: SystemUser[];\n title?: string;\n description?: string;\n className?: string;\n}\n\nconst roleOptions = [\n { value: \"all\", label: \"All Roles\" },\n { value: \"Admin\", label: \"Admin\" },\n { value: \"Evaluator\", label: \"Evaluator\" },\n { value: \"Viewer\", label: \"Viewer\" }\n];\n\nexport function DataTableWithFilters({\n data,\n title = \"Team directory\",\n description = \"Review project access and filter members by role.\",\n className\n}: DataTableWithFiltersProps) {\n const [selectedRole, setSelectedRole] = React.useState(\"all\");\n\n const filteredData = React.useMemo(() => {\n if (selectedRole === \"all\") return data;\n return data.filter((item) => item.role === selectedRole);\n }, [data, selectedRole]);\n\n return (\n <div className
|
|
816
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { ColumnDef } from \"@tanstack/react-table\";\nimport { Combobox } from \"../../components/combobox\";\nimport { DataTable, DataTableColumnHeader } from \"../../components/data-table\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface SystemUser {\n id: string;\n name: string;\n email: string;\n role: string;\n status: string;\n}\n\nconst columns: ColumnDef<SystemUser>[] = [\n {\n accessorKey: \"name\",\n header: ({ column }) => <DataTableColumnHeader column={column} title=\"User\" />\n },\n {\n accessorKey: \"email\",\n header: \"Email\"\n },\n {\n accessorKey: \"role\",\n header: \"Role\"\n },\n {\n accessorKey: \"status\",\n header: \"Status\"\n }\n];\n\nexport interface DataTableWithFiltersProps {\n data: SystemUser[];\n title?: string;\n description?: string;\n className?: string;\n}\n\nconst roleOptions = [\n { value: \"all\", label: \"All Roles\" },\n { value: \"Admin\", label: \"Admin\" },\n { value: \"Evaluator\", label: \"Evaluator\" },\n { value: \"Viewer\", label: \"Viewer\" }\n];\n\nexport function DataTableWithFilters({\n data,\n title = \"Team directory\",\n description = \"Review project access and filter members by role.\",\n className\n}: DataTableWithFiltersProps) {\n const [selectedRole, setSelectedRole] = React.useState(\"all\");\n\n const filteredData = React.useMemo(() => {\n if (selectedRole === \"all\") return data;\n return data.filter((item) => item.role === selectedRole);\n }, [data, selectedRole]);\n\n return (\n <div className={cn(\"w-full min-w-0 space-y-5\", className)}>\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between\">\n <div className=\"space-y-1.5\">\n <h3 className=\"text-sm font-semibold text-foreground\">{title}</h3>\n <p className=\"text-xs text-muted-foreground\">{description}</p>\n </div>\n <div className=\"w-full sm:w-56\">\n <Combobox\n options={roleOptions}\n value={selectedRole}\n onChange={setSelectedRole}\n placeholder=\"Filter by role...\"\n />\n </div>\n </div>\n\n <DataTable\n columns={columns}\n data={filteredData}\n filterPlaceholder=\"Filter users by name or email...\"\n className=\"min-w-0\"\n />\n </div>\n );\n}\n"
|
|
787
817
|
},
|
|
788
818
|
{
|
|
789
819
|
"path": "blocks/data-table-with-filters/index.ts",
|
|
@@ -797,7 +827,7 @@
|
|
|
797
827
|
"type": "registry:ui",
|
|
798
828
|
"title": "Date Picker",
|
|
799
829
|
"description": "Accessible Date Picker primitive component built with Base UI and Tailwind v4.",
|
|
800
|
-
"license": "
|
|
830
|
+
"license": "MIT",
|
|
801
831
|
"dependencies": [
|
|
802
832
|
"lucide-react"
|
|
803
833
|
],
|
|
@@ -829,7 +859,7 @@
|
|
|
829
859
|
"type": "registry:ui",
|
|
830
860
|
"title": "Dialog",
|
|
831
861
|
"description": "Accessible Dialog primitive component built with Base UI and Tailwind v4.",
|
|
832
|
-
"license": "
|
|
862
|
+
"license": "MIT",
|
|
833
863
|
"dependencies": [
|
|
834
864
|
"@base-ui/react",
|
|
835
865
|
"lucide-react"
|
|
@@ -846,7 +876,7 @@
|
|
|
846
876
|
{
|
|
847
877
|
"path": "components/dialog/dialog.tsx",
|
|
848
878
|
"type": "registry:ui",
|
|
849
|
-
"content": "import * as React from \"react\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { X } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport const Dialog = BaseDialog.Root;\nexport const DialogTrigger = BaseDialog.Trigger;\nexport const DialogPortal = BaseDialog.Portal;\nexport const DialogClose = BaseDialog.Close;\n\nexport const DialogBackdrop = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>\n>(({ className, ...props }, ref) => (\n <BaseDialog.Backdrop\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-void/80 backdrop-blur-md data-open:animate-fade-in data-closed:animate-fade-out\",\n className\n )}\n {...props}\n />\n));\nDialogBackdrop.displayName = \"DialogBackdrop\";\n\nexport const DialogContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseDialog.Popup
|
|
879
|
+
"content": "import * as React from \"react\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { X } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport const Dialog = BaseDialog.Root;\nexport const DialogTrigger = BaseDialog.Trigger;\nexport const DialogPortal = BaseDialog.Portal;\nexport const DialogClose = BaseDialog.Close;\n\nexport const DialogBackdrop = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>\n>(({ className, ...props }, ref) => (\n <BaseDialog.Backdrop\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-void/80 backdrop-blur-md data-open:animate-fade-in data-closed:animate-fade-out\",\n className\n )}\n {...props}\n />\n));\nDialogBackdrop.displayName = \"DialogBackdrop\";\n\nexport const DialogContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseDialog.Popup> & {\n closeLabel?: string;\n }\n>(({ className, children, closeLabel = \"Close\", ...props }, ref) => (\n <DialogPortal>\n <DialogBackdrop />\n <BaseDialog.Popup\n ref={ref}\n data-slot=\"dialog-content\"\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid max-h-[calc(100dvh-2rem)] w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-5 overflow-y-auto overscroll-contain rounded-lg border border-border bg-popover text-popover-foreground px-7 py-6 shadow-(--shadow-xl) data-open:animate-overlay-in data-closed:animate-overlay-out\",\n className\n )}\n {...props}\n >\n {children}\n <BaseDialog.Close aria-label={closeLabel} className=\"absolute right-3 top-3 inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground opacity-80 ring-offset-background transition-[opacity,transform,color] duration-150 hover:opacity-100 hover:text-foreground active:scale-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">{closeLabel}</span>\n </BaseDialog.Close>\n </BaseDialog.Popup>\n </DialogPortal>\n));\nDialogContent.displayName = \"DialogContent\";\n\nexport const DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col space-y-2 text-center sm:text-left\", className)}\n {...props}\n />\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nexport const DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse gap-2 pt-2 sm:flex-row sm:justify-end sm:gap-3\", className)}\n {...props}\n />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nexport const DialogTitle = React.forwardRef<\n HTMLHeadingElement,\n React.ComponentPropsWithoutRef<typeof BaseDialog.Title>\n>(({ className, ...props }, ref) => (\n <BaseDialog.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight text-popover-foreground text-balance\", className)}\n {...props}\n />\n));\nDialogTitle.displayName = \"DialogTitle\";\n\nexport const DialogDescription = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentPropsWithoutRef<typeof BaseDialog.Description>\n>(({ className, ...props }, ref) => (\n <BaseDialog.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground leading-relaxed text-pretty font-normal\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = \"DialogDescription\";\n"
|
|
850
880
|
},
|
|
851
881
|
{
|
|
852
882
|
"path": "components/dialog/index.ts",
|
|
@@ -860,7 +890,7 @@
|
|
|
860
890
|
"type": "registry:ui",
|
|
861
891
|
"title": "Drawer",
|
|
862
892
|
"description": "Accessible Drawer primitive component built with Base UI and Tailwind v4.",
|
|
863
|
-
"license": "
|
|
893
|
+
"license": "MIT",
|
|
864
894
|
"dependencies": [
|
|
865
895
|
"@base-ui/react"
|
|
866
896
|
],
|
|
@@ -875,7 +905,7 @@
|
|
|
875
905
|
{
|
|
876
906
|
"path": "components/drawer/drawer.tsx",
|
|
877
907
|
"type": "registry:ui",
|
|
878
|
-
"content": "import * as React from \"react\";\nimport { Drawer as BaseDrawer } from \"@base-ui/react/drawer\";\nimport { cn } from \"../../lib/utils\";\n\nexport const Drawer = BaseDrawer.Root;\nexport const DrawerTrigger = BaseDrawer.Trigger;\nexport const DrawerPortal = BaseDrawer.Portal;\nexport const DrawerClose = BaseDrawer.Close;\n\nexport const DrawerBackdrop = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseDrawer.Backdrop>\n>(({ className, ...props }, ref) => (\n <BaseDrawer.Backdrop\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-
|
|
908
|
+
"content": "import * as React from \"react\";\nimport { Drawer as BaseDrawer } from \"@base-ui/react/drawer\";\nimport { cn } from \"../../lib/utils\";\n\nexport const Drawer = BaseDrawer.Root;\nexport const DrawerTrigger = BaseDrawer.Trigger;\nexport const DrawerPortal = BaseDrawer.Portal;\nexport const DrawerClose = BaseDrawer.Close;\n\nexport const DrawerBackdrop = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseDrawer.Backdrop>\n>(({ className, ...props }, ref) => (\n <BaseDrawer.Backdrop\n ref={ref}\n data-slot=\"drawer-backdrop\"\n className={cn(\n \"fixed inset-0 z-50 bg-void/80 backdrop-blur-md data-open:animate-fade-in data-closed:animate-fade-out\",\n className\n )}\n {...props}\n />\n));\nDrawerBackdrop.displayName = \"DrawerBackdrop\";\n\nexport const DrawerContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseDrawer.Popup> & {\n side?: \"top\" | \"bottom\" | \"left\" | \"right\";\n }\n>(({ className, children, side = \"right\", ...props }, ref) => (\n <DrawerPortal>\n <DrawerBackdrop />\n <BaseDrawer.Viewport>\n <BaseDrawer.Popup\n ref={ref}\n data-slot=\"drawer-content\"\n className={cn(\n \"fixed z-50 gap-5 overflow-y-auto overscroll-contain bg-background px-7 py-6 shadow-(--shadow-xl) transition-[translate] duration-enter ease-out-expo data-closed:duration-exit\",\n side === \"top\" && \"inset-x-0 top-0 max-h-[calc(100dvh-2rem)] border-b data-starting-style:-translate-y-full data-ending-style:-translate-y-full\",\n side === \"bottom\" && \"inset-x-0 bottom-0 max-h-[calc(100dvh-2rem)] border-t data-starting-style:translate-y-full data-ending-style:translate-y-full\",\n side === \"left\" && \"inset-y-0 left-0 h-full w-3/4 border-r data-starting-style:-translate-x-full data-ending-style:-translate-x-full sm:max-w-sm\",\n side === \"right\" && \"inset-y-0 right-0 h-full w-3/4 border-l data-starting-style:translate-x-full data-ending-style:translate-x-full sm:max-w-sm\",\n className\n )}\n {...props}\n >\n {children}\n </BaseDrawer.Popup>\n </BaseDrawer.Viewport>\n </DrawerPortal>\n));\nDrawerContent.displayName = \"DrawerContent\";\n\nexport const DrawerHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col space-y-2 text-center sm:text-left\", className)}\n {...props}\n />\n);\nDrawerHeader.displayName = \"DrawerHeader\";\n\nexport const DrawerFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse gap-2 pt-2 sm:flex-row sm:justify-end sm:gap-3\", className)}\n {...props}\n />\n);\nDrawerFooter.displayName = \"DrawerFooter\";\n\nexport const DrawerTitle = React.forwardRef<\n HTMLHeadingElement,\n React.ComponentPropsWithoutRef<typeof BaseDrawer.Title>\n>(({ className, ...props }, ref) => (\n <BaseDrawer.Title\n ref={ref}\n className={cn(\"text-lg font-semibold text-foreground\", className)}\n {...props}\n />\n));\nDrawerTitle.displayName = \"DrawerTitle\";\n\nexport const DrawerDescription = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentPropsWithoutRef<typeof BaseDrawer.Description>\n>(({ className, ...props }, ref) => (\n <BaseDrawer.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDrawerDescription.displayName = \"DrawerDescription\";\n"
|
|
879
909
|
},
|
|
880
910
|
{
|
|
881
911
|
"path": "components/drawer/index.ts",
|
|
@@ -889,7 +919,7 @@
|
|
|
889
919
|
"type": "registry:ui",
|
|
890
920
|
"title": "Dropdown Menu",
|
|
891
921
|
"description": "Accessible Dropdown Menu primitive component built with Base UI and Tailwind v4.",
|
|
892
|
-
"license": "
|
|
922
|
+
"license": "MIT",
|
|
893
923
|
"dependencies": [
|
|
894
924
|
"@base-ui/react"
|
|
895
925
|
],
|
|
@@ -904,7 +934,7 @@
|
|
|
904
934
|
{
|
|
905
935
|
"path": "components/dropdown-menu/dropdown-menu.tsx",
|
|
906
936
|
"type": "registry:ui",
|
|
907
|
-
"content": "import * as React from \"react\";\nimport { Menu as BaseMenu } from \"@base-ui/react/menu\";\nimport { cn } from \"../../lib/utils\";\n\nexport const DropdownMenu = BaseMenu.Root;\nexport const DropdownMenuTrigger = BaseMenu.Trigger;\nexport const DropdownMenuPortal = BaseMenu.Portal;\nexport const DropdownMenuGroup = BaseMenu.Group;\n\nexport const DropdownMenuContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseMenu.Popup> & {\n align?: \"start\" | \"center\" | \"end\";\n sideOffset?: number;\n }\n>(({ className, align = \"start\", sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPortal>\n <BaseMenu.Positioner align={align} sideOffset={sideOffset}>\n <BaseMenu.Popup\n ref={ref}\n className={cn(\n \"z-50 min-w-[10rem] overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-(--shadow-xl) outline-none data-open:animate-overlay-in data-closed:animate-overlay-out\",\n className\n )}\n {...props}\n />\n </BaseMenu.Positioner>\n </DropdownMenuPortal>\n));\nDropdownMenuContent.displayName = \"DropdownMenuContent\";\n\nexport const DropdownMenuItem = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseMenu.Item>\n>(({ className, ...props }, ref) => (\n <BaseMenu.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center justify-between rounded-sm px-
|
|
937
|
+
"content": "import * as React from \"react\";\nimport { Menu as BaseMenu } from \"@base-ui/react/menu\";\nimport { cn } from \"../../lib/utils\";\n\nexport const DropdownMenu = BaseMenu.Root;\nexport const DropdownMenuTrigger = BaseMenu.Trigger;\nexport const DropdownMenuPortal = BaseMenu.Portal;\nexport const DropdownMenuGroup = BaseMenu.Group;\n\nexport const DropdownMenuContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseMenu.Popup> & {\n align?: \"start\" | \"center\" | \"end\";\n sideOffset?: number;\n }\n>(({ className, align = \"start\", sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPortal>\n <BaseMenu.Positioner align={align} sideOffset={sideOffset}>\n <BaseMenu.Popup\n ref={ref}\n className={cn(\n \"z-50 min-w-[10rem] overflow-hidden rounded-lg border border-border bg-popover p-1.5 text-popover-foreground shadow-(--shadow-xl) outline-none data-open:animate-overlay-in data-closed:animate-overlay-out\",\n className\n )}\n {...props}\n />\n </BaseMenu.Positioner>\n </DropdownMenuPortal>\n));\nDropdownMenuContent.displayName = \"DropdownMenuContent\";\n\nexport const DropdownMenuItem = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseMenu.Item>\n>(({ className, ...props }, ref) => (\n <BaseMenu.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center justify-between gap-2 rounded-sm px-3 py-2 text-sm outline-none transition-colors data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = \"DropdownMenuItem\";\n\nexport const DropdownMenuSeparator = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseMenu.Separator>\n>(({ className, ...props }, ref) => (\n <BaseMenu.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = \"DropdownMenuSeparator\";\n\nexport const DropdownMenuLabel = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseMenu.GroupLabel>\n>(({ className, ...props }, ref) => (\n <BaseMenu.GroupLabel\n ref={ref}\n className={cn(\n \"px-3 py-2 text-xs font-medium text-muted-foreground\",\n className\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = \"DropdownMenuLabel\";\n\nexport const DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground font-mono\",\n className\n )}\n {...props}\n />\n );\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n"
|
|
908
938
|
},
|
|
909
939
|
{
|
|
910
940
|
"path": "components/dropdown-menu/index.ts",
|
|
@@ -916,9 +946,9 @@
|
|
|
916
946
|
{
|
|
917
947
|
"name": "empty-state-block",
|
|
918
948
|
"type": "registry:block",
|
|
919
|
-
"title": "Empty State Block
|
|
949
|
+
"title": "Empty State Block",
|
|
920
950
|
"description": "Composed Empty State Block block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
921
|
-
"license": "
|
|
951
|
+
"license": "MIT",
|
|
922
952
|
"dependencies": [
|
|
923
953
|
"lucide-react"
|
|
924
954
|
],
|
|
@@ -934,7 +964,7 @@
|
|
|
934
964
|
{
|
|
935
965
|
"path": "blocks/empty-state-block/empty-state-block.tsx",
|
|
936
966
|
"type": "registry:block",
|
|
937
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Plus, HelpCircle } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface EmptyStateBlockProps\n extends React.HTMLAttributes<HTMLDivElement> {\n icon?: React.ReactNode;\n title?: string;\n description?: string;\n actionLabel?: string;\n secondaryActionLabel?: string;\n onAction?: () => void;\n onSecondaryAction?: () => void;\n}\n\nexport function EmptyStateBlock({\n icon,\n title = \"No
|
|
967
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Plus, HelpCircle } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface EmptyStateBlockProps\n extends React.HTMLAttributes<HTMLDivElement> {\n icon?: React.ReactNode;\n title?: string;\n description?: string;\n actionLabel?: string;\n secondaryActionLabel?: string;\n onAction?: () => void;\n onSecondaryAction?: () => void;\n}\n\nexport function EmptyStateBlock({\n icon,\n title = \"No items yet\",\n description = \"Get started by creating a new item or importing existing data.\",\n actionLabel = \"Create item\",\n secondaryActionLabel,\n onAction,\n onSecondaryAction,\n className,\n ...props\n}: EmptyStateBlockProps) {\n const titleId = React.useId();\n const descriptionId = React.useId();\n\n return (\n <div\n data-slot=\"empty-state-block\"\n aria-labelledby={titleId}\n aria-describedby={descriptionId}\n className={cn(\n \"flex flex-col items-center justify-center rounded-lg border border-dashed border-border bg-secondary/40 px-8 py-12 text-center max-w-lg mx-auto\",\n className\n )}\n {...props}\n >\n <div\n aria-hidden=\"true\"\n className=\"flex h-12 w-12 items-center justify-center rounded-full bg-secondary border border-border text-muted-foreground mb-5\"\n >\n {icon ?? <HelpCircle className=\"h-6 w-6\" />}\n </div>\n\n <h3 id={titleId} className=\"m-0 text-base font-semibold text-foreground mb-2\">{title}</h3>\n <p\n id={descriptionId}\n className=\"m-0 text-sm text-muted-foreground max-w-sm mb-7 leading-relaxed\"\n >\n {description}\n </p>\n\n <div className=\"flex w-full max-w-full flex-wrap items-center justify-center gap-3.5\">\n {secondaryActionLabel && onSecondaryAction && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={onSecondaryAction}\n className=\"h-auto min-h-8 max-w-full whitespace-normal py-2 text-center text-xs\"\n >\n {secondaryActionLabel}\n </Button>\n )}\n {actionLabel && onAction && (\n <Button\n size=\"sm\"\n onClick={onAction}\n className=\"h-auto min-h-8 max-w-full gap-1.5 whitespace-normal py-2 text-center text-xs\"\n >\n <Plus className=\"h-3.5 w-3.5 shrink-0\" />\n <span>{actionLabel}</span>\n </Button>\n )}\n </div>\n </div>\n );\n}\n"
|
|
938
968
|
},
|
|
939
969
|
{
|
|
940
970
|
"path": "blocks/empty-state-block/index.ts",
|
|
@@ -948,16 +978,14 @@
|
|
|
948
978
|
"type": "registry:block",
|
|
949
979
|
"title": "Evaluation Summary Report Block",
|
|
950
980
|
"description": "Composed Evaluation Summary Report block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
951
|
-
"license": "
|
|
981
|
+
"license": "MIT",
|
|
952
982
|
"dependencies": [
|
|
953
983
|
"lucide-react"
|
|
954
984
|
],
|
|
955
985
|
"devDependencies": [],
|
|
956
986
|
"registryDependencies": [
|
|
957
|
-
"badge",
|
|
958
987
|
"button",
|
|
959
988
|
"card",
|
|
960
|
-
"progress",
|
|
961
989
|
"utils"
|
|
962
990
|
],
|
|
963
991
|
"dependencyVersions": {
|
|
@@ -967,7 +995,7 @@
|
|
|
967
995
|
{
|
|
968
996
|
"path": "blocks/evaluation-summary-report/evaluation-summary-report.tsx",
|
|
969
997
|
"type": "registry:block",
|
|
970
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n Download,\n Share2,\n CheckCircle2,\n AlertTriangle,\n AlertOctagon,\n} from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { Badge } from \"../../components/badge\";\nimport { Button } from \"../../components/button\";\nimport { Progress } from \"../../components/progress\";\n\nexport interface HeuristicScoreItem {\n id: string;\n name: string;\n score: number;\n findingCount: number;\n}\n\nexport interface EvaluationSummaryReportProps\n extends React.HTMLAttributes<HTMLDivElement> {\n title?: string;\n projectName?: string;\n overallScore?: number;\n criticalCount?: number;\n mediumCount?: number;\n goodCount?: number;\n heuristics?: HeuristicScoreItem[];\n onExportPdf?: () => void;\n onShareReport?: () => void;\n}\n\nexport function EvaluationSummaryReport({\n title = \"Heuristic Evaluation Executive Report\",\n projectName = \"Usalyt Check Project\",\n overallScore = 82,\n criticalCount = 3,\n mediumCount = 7,\n goodCount = 14,\n heuristics = [],\n onExportPdf,\n onShareReport,\n className,\n ...props\n}: EvaluationSummaryReportProps) {\n const totalFindings = criticalCount + mediumCount + goodCount;\n\n return (\n <Card\n className={cn(\"overflow-hidden border border-border shadow-xs\", className)}\n {...props}\n >\n <CardHeader className=\"flex flex-row flex-wrap items-start justify-between gap-3 space-y-0 pb-4 border-b border-border/40\">\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <Badge variant=\"outline\" className=\"self-start text-xs\">\n Executive Summary\n </Badge>\n <CardTitle className=\"text-lg font-bold text-foreground\">\n {title}\n </CardTitle>\n <CardDescription className=\"text-xs text-muted-foreground\">\n {projectName}\n </CardDescription>\n </div>\n\n <div className=\"flex max-w-full flex-wrap items-center gap-2\">\n {onShareReport && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={onShareReport}\n className=\"gap-1.5 text-xs\"\n >\n <Share2 className=\"h-3.5 w-3.5\" />\n <span>Share</span>\n </Button>\n )}\n {onExportPdf && (\n <Button size=\"sm\" onClick={onExportPdf} className=\"gap-1.5 text-xs\">\n <Download className=\"h-3.5 w-3.5\" />\n <span>Export PDF</span>\n </Button>\n )}\n </div>\n </CardHeader>\n\n <CardContent className=\"flex flex-col gap-6 pt-6\">\n <div\n role=\"group\"\n aria-label=\"Evaluation score summary\"\n className=\"grid grid-cols-2 md:grid-cols-4 gap-4\"\n >\n <div className=\"flex flex-col gap-2 rounded-lg border border-border/60 bg-muted/20 p-4\">\n <div className=\"flex min-h-8 items-start\">\n <span className=\"text-xs font-medium text-muted-foreground\">\n Overall Usability\n </span>\n </div>\n <div className=\"flex flex-wrap items-baseline gap-2 leading-none\">\n <span className=\"text-3xl font-extrabold leading-none text-foreground\">\n {overallScore}\n </span>\n <span className=\"text-xs text-muted-foreground\">/ 100</span>\n </div>\n <Progress value={overallScore} variant=\"neutral\" aria-label=\"Overall Usability Score\" className=\"h-1.5\" />\n </div>\n\n <div className=\"flex flex-col gap-2 rounded-lg border border-destructive/30 bg-destructive/5 p-4\">\n <div className=\"flex min-h-8 items-start gap-1.5 text-xs font-medium text-coral-red-foreground\">\n <AlertOctagon className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"min-w-0\">Critical Issues</span>\n </div>\n <div className=\"flex flex-wrap items-baseline gap-2 leading-none\">\n <span className=\"text-3xl font-extrabold leading-none text-foreground\">\n {criticalCount}\n </span>\n </div>\n <span className=\"text-xs text-muted-foreground\">\n Requires immediate fix\n </span>\n </div>\n\n <div className=\"flex flex-col gap-2 rounded-lg border border-signal-teal/30 bg-signal-teal/5 p-4\">\n <div className=\"flex min-h-8 items-start gap-1.5 text-xs font-medium text-signal-teal-foreground\">\n <AlertTriangle className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"min-w-0\">Medium Issues</span>\n </div>\n <div className=\"flex flex-wrap items-baseline gap-2 leading-none\">\n <span className=\"text-3xl font-extrabold leading-none text-foreground\">\n {mediumCount}\n </span>\n </div>\n <span className=\"text-xs text-muted-foreground\">\n Impacts efficiency\n </span>\n </div>\n\n <div className=\"flex flex-col gap-2 rounded-lg border border-pulse-green/30 bg-pulse-green/5 p-4\">\n <div className=\"flex min-h-8 items-start gap-1.5 text-xs font-medium text-pulse-green-foreground\">\n <CheckCircle2 className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"min-w-0\">Positive Points</span>\n </div>\n <div className=\"flex flex-wrap items-baseline gap-2 leading-none\">\n <span className=\"text-3xl font-extrabold leading-none text-foreground\">\n {goodCount}\n </span>\n </div>\n <span className=\"text-xs text-muted-foreground\">\n Follows best practices\n </span>\n </div>\n </div>\n\n {heuristics.length > 0 && (\n <div className=\"flex flex-col gap-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wider text-muted-foreground\">\n Nielsen's 10 Heuristics Performance\n </h4>\n <div className=\"flex flex-col gap-3\">\n {heuristics.map((item) => (\n <div key={item.id} className=\"flex flex-col gap-1.5\">\n <div className=\"flex flex-wrap items-start justify-between gap-2 text-xs\">\n <div className=\"flex min-w-0 flex-1 flex-wrap items-center gap-2\">\n <Badge\n variant=\"outline\"\n className=\"font-mono text-[10px] px-1.5 py-0\"\n >\n {item.id}\n </Badge>\n <span className=\"min-w-0 break-words font-medium text-foreground\">\n {item.name}\n </span>\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n <span className=\"text-muted-foreground\">\n {item.findingCount} findings\n </span>\n <span className=\"w-10 text-right font-bold text-foreground\">\n {item.score}%\n </span>\n </div>\n </div>\n <Progress value={item.score} variant=\"neutral\" aria-label={`${item.name} score`} className=\"h-1.5\" />\n </div>\n ))}\n </div>\n </div>\n )}\n </CardContent>\n\n <CardFooter className=\"flex flex-wrap items-center justify-between gap-2 border-t border-border/40 py-3 text-xs text-muted-foreground\">\n <span>Total Findings Audited: {totalFindings}</span>\n <span>Generated with Usalyt Check</span>\n </CardFooter>\n </Card>\n );\n}\n"
|
|
998
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n Download,\n Share2,\n CheckCircle2,\n AlertTriangle,\n AlertOctagon,\n} from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { Button } from \"../../components/button\";\n\nexport interface HeuristicScoreItem {\n id: string;\n name: string;\n score: number;\n findingCount: number;\n}\n\nexport interface EvaluationSummaryReportProps\n extends React.HTMLAttributes<HTMLDivElement> {\n title?: string;\n projectName?: string;\n overallScore?: number;\n criticalCount?: number;\n mediumCount?: number;\n goodCount?: number;\n heuristics?: HeuristicScoreItem[];\n onExportPdf?: () => void;\n onShareReport?: () => void;\n}\n\nconst SCORE_SEGMENTS = 10;\n\nfunction scoreToneClass(score: number): string {\n if (score >= 80) return \"bg-pulse-green-foreground\";\n if (score >= 70) return \"bg-primary\";\n return \"bg-amber-signal-foreground\";\n}\n\nfunction scoreTextClass(score: number): string {\n if (score >= 80) return \"text-pulse-green-foreground\";\n if (score >= 70) return \"text-foreground\";\n return \"text-amber-signal-foreground\";\n}\n\nfunction SegmentedScoreMeter({\n value,\n label,\n compact = false,\n}: {\n value: number;\n label: string;\n compact?: boolean;\n}) {\n const clamped = Math.min(100, Math.max(0, Math.round(value)));\n const filledCount = Math.round((clamped / 100) * SCORE_SEGMENTS);\n const activeClass = scoreToneClass(clamped);\n\n return (\n <div\n role=\"progressbar\"\n aria-label={label}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={clamped}\n data-slot=\"score-meter\"\n className={cn(\n \"flex items-center\",\n compact ? \"gap-1\" : \"w-full gap-1.5\"\n )}\n >\n {Array.from({ length: SCORE_SEGMENTS }, (_, idx) => {\n const isFilled = idx < filledCount;\n return (\n <span\n key={idx}\n aria-hidden=\"true\"\n data-filled={isFilled ? \"true\" : \"false\"}\n className={cn(\n \"rounded-[2px] transition-colors duration-150\",\n compact ? \"h-2.5 w-2\" : \"h-1.5 flex-1\",\n isFilled ? activeClass : \"bg-secondary\"\n )}\n />\n );\n })}\n </div>\n );\n}\n\nexport function EvaluationSummaryReport({\n title = \"Heuristic Evaluation Executive Report\",\n projectName = \"Usalyt Check Project\",\n overallScore = 82,\n criticalCount = 3,\n mediumCount = 7,\n goodCount = 14,\n heuristics = [],\n onExportPdf,\n onShareReport,\n className,\n ...props\n}: EvaluationSummaryReportProps) {\n const totalFindings = criticalCount + mediumCount + goodCount;\n\n return (\n <Card\n className={cn(\"overflow-hidden border border-border\", className)}\n {...props}\n >\n <CardHeader className=\"flex flex-row flex-wrap items-start justify-between gap-x-6 gap-y-4 space-y-0 border-b border-border/60 px-7 py-6\">\n <div className=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <CardTitle className=\"text-xl font-semibold tracking-tight text-foreground\">\n {title}\n </CardTitle>\n <CardDescription className=\"text-sm text-muted-foreground\">\n {projectName}\n </CardDescription>\n </div>\n\n {(onShareReport || onExportPdf) && (\n <div className=\"flex max-w-full flex-wrap items-center gap-2.5\">\n {onShareReport && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={onShareReport}\n className=\"gap-2 text-xs\"\n >\n <Share2 className=\"h-3.5 w-3.5\" />\n <span>Share</span>\n </Button>\n )}\n {onExportPdf && (\n <Button size=\"sm\" onClick={onExportPdf} className=\"gap-2 text-xs\">\n <Download className=\"h-3.5 w-3.5\" />\n <span>Export PDF</span>\n </Button>\n )}\n </div>\n )}\n </CardHeader>\n\n <CardContent className=\"flex flex-col gap-8 px-7 py-7\">\n <div\n role=\"group\"\n aria-label=\"Evaluation score summary\"\n className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\"\n >\n <div className=\"flex flex-col justify-between gap-3 rounded-lg border border-border bg-secondary/60 px-5 py-5\">\n <span className=\"text-xs font-medium text-muted-foreground\">\n Overall Usability\n </span>\n <div className=\"flex flex-wrap items-baseline gap-2 leading-none tabular-nums\">\n <span className=\"text-3xl font-semibold leading-none tracking-tight text-foreground\">\n {overallScore}\n </span>\n <span className=\"text-xs text-muted-foreground\">/ 100</span>\n </div>\n <SegmentedScoreMeter\n value={overallScore}\n label=\"Overall Usability Score\"\n />\n </div>\n\n <div className=\"flex flex-col justify-between gap-3 rounded-lg border border-coral-red/30 bg-coral-red/5 px-5 py-5\">\n <div className=\"flex items-center gap-2 text-xs font-medium text-coral-red-foreground\">\n <AlertOctagon className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"min-w-0\">Critical Issues</span>\n </div>\n <div className=\"flex flex-wrap items-baseline gap-2 leading-none tabular-nums\">\n <span className=\"text-3xl font-semibold leading-none tracking-tight text-foreground\">\n {criticalCount}\n </span>\n </div>\n <span className=\"text-xs text-muted-foreground\">\n Requires immediate fix\n </span>\n </div>\n\n <div className=\"flex flex-col justify-between gap-3 rounded-lg border border-signal-teal/30 bg-signal-teal/5 px-5 py-5\">\n <div className=\"flex items-center gap-2 text-xs font-medium text-signal-teal-foreground\">\n <AlertTriangle className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"min-w-0\">Medium Issues</span>\n </div>\n <div className=\"flex flex-wrap items-baseline gap-2 leading-none tabular-nums\">\n <span className=\"text-3xl font-semibold leading-none tracking-tight text-foreground\">\n {mediumCount}\n </span>\n </div>\n <span className=\"text-xs text-muted-foreground\">\n Impacts efficiency\n </span>\n </div>\n\n <div className=\"flex flex-col justify-between gap-3 rounded-lg border border-pulse-green/30 bg-pulse-green/5 px-5 py-5\">\n <div className=\"flex items-center gap-2 text-xs font-medium text-pulse-green-foreground\">\n <CheckCircle2 className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"min-w-0\">Positive Points</span>\n </div>\n <div className=\"flex flex-wrap items-baseline gap-2 leading-none tabular-nums\">\n <span className=\"text-3xl font-semibold leading-none tracking-tight text-foreground\">\n {goodCount}\n </span>\n </div>\n <span className=\"text-xs text-muted-foreground\">\n Follows best practices\n </span>\n </div>\n </div>\n\n {heuristics.length > 0 && (\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex flex-wrap items-center justify-between gap-x-4 gap-y-1\">\n <h4 className=\"m-0 text-sm font-medium text-foreground\">\n Heuristics performance\n </h4>\n <span className=\"text-xs text-muted-foreground tabular-nums\">\n {heuristics.length}{\" \"}\n {heuristics.length === 1 ? \"criterion\" : \"criteria\"} evaluated\n </span>\n </div>\n\n <div className=\"divide-y divide-border/70 overflow-hidden rounded-lg border border-border bg-surface-base/40\">\n {heuristics.map((item) => {\n const findingsLabel =\n item.findingCount === 1\n ? \"1 finding\"\n : `${item.findingCount} findings`;\n\n return (\n <div\n key={item.id}\n className=\"flex flex-col gap-3 px-5 py-4 transition-colors duration-150 hover:bg-secondary/50 sm:flex-row sm:items-center sm:justify-between sm:gap-x-6\"\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-3.5\">\n <span className=\"inline-flex w-8 shrink-0 items-center justify-center rounded-sm border border-border bg-secondary px-1.5 py-0.5 font-mono text-xs font-medium text-muted-foreground tabular-nums\">\n {item.id}\n </span>\n <span className=\"min-w-0 break-words text-sm font-medium text-foreground\">\n {item.name}\n </span>\n </div>\n\n <div className=\"flex shrink-0 flex-wrap items-center justify-between gap-x-5 gap-y-2 sm:justify-end\">\n <span className=\"text-xs text-muted-foreground tabular-nums\">\n {findingsLabel}\n </span>\n <div className=\"flex items-center gap-3.5\">\n <SegmentedScoreMeter\n value={item.score}\n label={`${item.name} score`}\n compact\n />\n <span\n className={cn(\n \"w-11 text-right font-mono text-xs font-semibold tabular-nums\",\n scoreTextClass(item.score)\n )}\n >\n {item.score}%\n </span>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n )}\n </CardContent>\n\n <CardFooter className=\"flex flex-wrap items-center justify-between gap-x-6 gap-y-2 border-t border-border/60 px-7 py-4 text-xs text-muted-foreground\">\n <span className=\"tabular-nums\">\n Total Findings Audited: {totalFindings}\n </span>\n <span>Generated with Usalyt Check</span>\n </CardFooter>\n </Card>\n );\n}\n"
|
|
971
999
|
},
|
|
972
1000
|
{
|
|
973
1001
|
"path": "blocks/evaluation-summary-report/index.ts",
|
|
@@ -981,7 +1009,7 @@
|
|
|
981
1009
|
"type": "registry:ui",
|
|
982
1010
|
"title": "File Input",
|
|
983
1011
|
"description": "Accessible File Input primitive component built with Base UI and Tailwind v4.",
|
|
984
|
-
"license": "
|
|
1012
|
+
"license": "MIT",
|
|
985
1013
|
"dependencies": [
|
|
986
1014
|
"lucide-react"
|
|
987
1015
|
],
|
|
@@ -996,7 +1024,7 @@
|
|
|
996
1024
|
{
|
|
997
1025
|
"path": "components/file-input/file-input.tsx",
|
|
998
1026
|
"type": "registry:ui",
|
|
999
|
-
"content": "import * as React from \"react\";\nimport { Upload, FileText, X } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface FileInputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n label?: string;\n helperText?: string;\n error?: string;\n}\n\nconst FileInput = React.forwardRef<HTMLInputElement, FileInputProps>(\n (\n {\n className,\n label,\n helperText,\n error,\n disabled,\n onChange,\n onFocus,\n onBlur,\n ...props\n },\n ref\n ) => {\n const [fileNames, setFileNames] = React.useState<string[]>([]);\n const [focused, setFocused] = React.useState(false);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const files = e.target.files;\n if (files && files.length > 0) {\n setFileNames(Array.from(files).map((f) => f.name));\n } else {\n setFileNames([]);\n }\n onChange?.(e);\n };\n\n return (\n <div className=\"flex w-full flex-col gap-1.5\">\n <label\n data-focused={focused ? \"true\" : undefined}\n className={cn(\n \"relative flex min-h-[120px] w-full cursor-pointer flex-col items-center justify-center rounded-
|
|
1027
|
+
"content": "import * as React from \"react\";\nimport { Upload, FileText, X } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface FileInputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n label?: string;\n helperText?: string;\n error?: string;\n}\n\nconst FileInput = React.forwardRef<HTMLInputElement, FileInputProps>(\n (\n {\n className,\n label,\n helperText,\n error,\n disabled,\n onChange,\n onFocus,\n onBlur,\n ...props\n },\n ref\n ) => {\n const [fileNames, setFileNames] = React.useState<string[]>([]);\n const [focused, setFocused] = React.useState(false);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const files = e.target.files;\n if (files && files.length > 0) {\n setFileNames(Array.from(files).map((f) => f.name));\n } else {\n setFileNames([]);\n }\n onChange?.(e);\n };\n\n return (\n <div className=\"flex w-full flex-col gap-1.5\">\n <label\n data-focused={focused ? \"true\" : undefined}\n className={cn(\n \"relative flex min-h-[120px] w-full cursor-pointer flex-col items-center justify-center rounded-lg border border-dashed border-border bg-background p-4 text-center transition-colors hover:border-primary/50 hover:bg-accent/50\",\n \"data-[focused=true]:border-ring data-[focused=true]:ring-2 data-[focused=true]:ring-ring\",\n disabled && \"cursor-not-allowed opacity-50 hover:border-border hover:bg-background\",\n error && \"border-destructive hover:border-destructive\",\n className\n )}\n >\n <Upload className=\"mb-2 h-6 w-6 text-muted-foreground\" />\n <span className=\"text-sm font-medium text-foreground\">\n {fileNames.length > 0\n ? fileNames.join(\", \")\n : label || \"Click to browse files\"}\n </span>\n {helperText && !error && (\n <span className=\"mt-1 text-xs text-muted-foreground\">\n {helperText}\n </span>\n )}\n {error && (\n <span className=\"mt-1 text-xs text-destructive font-medium\">\n {error}\n </span>\n )}\n <input\n type=\"file\"\n ref={ref}\n disabled={disabled}\n className=\"sr-only\"\n onChange={handleChange}\n onFocus={(e) => {\n setFocused(true);\n onFocus?.(e);\n }}\n onBlur={(e) => {\n setFocused(false);\n onBlur?.(e);\n }}\n {...props}\n />\n </label>\n </div>\n );\n }\n);\nFileInput.displayName = \"FileInput\";\n\nexport { FileInput };\n"
|
|
1000
1028
|
},
|
|
1001
1029
|
{
|
|
1002
1030
|
"path": "components/file-input/index.ts",
|
|
@@ -1010,7 +1038,7 @@
|
|
|
1010
1038
|
"type": "registry:ui",
|
|
1011
1039
|
"title": "Form",
|
|
1012
1040
|
"description": "Accessible Form primitive component built with Base UI and Tailwind v4.",
|
|
1013
|
-
"license": "
|
|
1041
|
+
"license": "MIT",
|
|
1014
1042
|
"dependencies": [
|
|
1015
1043
|
"react-hook-form"
|
|
1016
1044
|
],
|
|
@@ -1040,7 +1068,7 @@
|
|
|
1040
1068
|
"type": "registry:block",
|
|
1041
1069
|
"title": "Form With Validation Block",
|
|
1042
1070
|
"description": "Composed Form With Validation block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
1043
|
-
"license": "
|
|
1071
|
+
"license": "MIT",
|
|
1044
1072
|
"dependencies": [
|
|
1045
1073
|
"@hookform/resolvers",
|
|
1046
1074
|
"react-hook-form",
|
|
@@ -1062,7 +1090,7 @@
|
|
|
1062
1090
|
{
|
|
1063
1091
|
"path": "blocks/form-with-validation/form-with-validation.tsx",
|
|
1064
1092
|
"type": "registry:block",
|
|
1065
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport { z } from \"zod\";\nimport {\n Form,\n FormField,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n} from \"../../components/form\";\nimport { Input } from \"../../components/input\";\nimport { Button } from \"../../components/button\";\nimport { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from \"../../components/card\";\n\nexport const profileFormSchema = z.object({\n fullName: z.string().min(2, \"Full name must be at least 2 characters.\"),\n email: z.string().email(\"Invalid email address.\"),\n organization: z.string().min(1, \"Organization is required.\"),\n});\n\nexport type ProfileFormValues = z.infer<typeof profileFormSchema>;\n\nexport interface FormWithValidationProps {\n defaultValues?: Partial<ProfileFormValues>;\n onSubmit?: (values: ProfileFormValues) => void | Promise<void>;\n submitLabel?: string;\n className?: string;\n}\n\nexport function FormWithValidation({\n defaultValues = { fullName: \"\", email: \"\", organization: \"\" },\n onSubmit,\n submitLabel = \"Save Profile\",\n className,\n}: FormWithValidationProps) {\n const form = useForm<ProfileFormValues>({\n resolver: zodResolver(profileFormSchema),\n defaultValues,\n });\n const [pending, setPending] = React.useState(false);\n const [submitError, setSubmitError] = React.useState<string | null>(null);\n\n const handleSubmit = async (values: ProfileFormValues) => {\n setSubmitError(null);\n setPending(true);\n\n try {\n await onSubmit?.(values);\n } catch (error) {\n setSubmitError(\n error instanceof Error\n ? error.message\n : \"Unable to save the profile. Please try again.\"\n );\n } finally {\n setPending(false);\n }\n };\n\n return (\n <Card className={className}>\n <CardHeader className=\"space-y-
|
|
1093
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport { z } from \"zod\";\nimport {\n Form,\n FormField,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n} from \"../../components/form\";\nimport { Input } from \"../../components/input\";\nimport { Button } from \"../../components/button\";\nimport { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from \"../../components/card\";\n\nexport const profileFormSchema = z.object({\n fullName: z.string().min(2, \"Full name must be at least 2 characters.\"),\n email: z.string().email(\"Invalid email address.\"),\n organization: z.string().min(1, \"Organization is required.\"),\n});\n\nexport type ProfileFormValues = z.infer<typeof profileFormSchema>;\n\nexport interface FormWithValidationProps {\n defaultValues?: Partial<ProfileFormValues>;\n onSubmit?: (values: ProfileFormValues) => void | Promise<void>;\n submitLabel?: string;\n className?: string;\n}\n\nexport function FormWithValidation({\n defaultValues = { fullName: \"\", email: \"\", organization: \"\" },\n onSubmit,\n submitLabel = \"Save Profile\",\n className,\n}: FormWithValidationProps) {\n const form = useForm<ProfileFormValues>({\n resolver: zodResolver(profileFormSchema),\n defaultValues,\n });\n const [pending, setPending] = React.useState(false);\n const [submitError, setSubmitError] = React.useState<string | null>(null);\n\n const handleSubmit = async (values: ProfileFormValues) => {\n setSubmitError(null);\n setPending(true);\n\n try {\n await onSubmit?.(values);\n } catch (error) {\n setSubmitError(\n error instanceof Error\n ? error.message\n : \"Unable to save the profile. Please try again.\"\n );\n } finally {\n setPending(false);\n }\n };\n\n return (\n <Card className={className}>\n <CardHeader className=\"space-y-2 px-7 pt-7 pb-5\">\n <CardTitle className=\"text-base font-semibold\">\n User Profile Settings\n </CardTitle>\n <CardDescription>\n Update your profile details for heuristic evaluation reports.\n </CardDescription>\n </CardHeader>\n <CardContent className=\"px-7 pb-6 pt-0\">\n {submitError && (\n <div\n role=\"alert\"\n className=\"mb-5 rounded-md border border-destructive/40 bg-destructive/10 px-4 py-2.5 text-xs font-medium text-foreground\"\n >\n {submitError}\n </div>\n )}\n <Form {...form}>\n <form\n id=\"profile-form\"\n onSubmit={form.handleSubmit(handleSubmit)}\n className=\"space-y-5\"\n noValidate\n >\n <FormField\n control={form.control}\n name=\"fullName\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Full Name</FormLabel>\n <FormControl>\n <Input placeholder=\"Dr. Jacob Nielsen\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n\n <FormField\n control={form.control}\n name=\"email\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Work Email</FormLabel>\n <FormControl>\n <Input placeholder=\"nielsen@example.com\" {...field} />\n </FormControl>\n <FormDescription>\n Reports will be dispatched to this email address.\n </FormDescription>\n <FormMessage />\n </FormItem>\n )}\n />\n\n <FormField\n control={form.control}\n name=\"organization\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Organization / University</FormLabel>\n <FormControl>\n <Input placeholder=\"NN/g Institute\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n </form>\n </Form>\n </CardContent>\n <CardFooter className=\"flex justify-end border-t border-border/60 px-7 py-5\">\n <Button type=\"submit\" form=\"profile-form\" loading={pending} disabled={pending}>\n {submitLabel}\n </Button>\n </CardFooter>\n </Card>\n );\n}\n"
|
|
1066
1094
|
},
|
|
1067
1095
|
{
|
|
1068
1096
|
"path": "blocks/form-with-validation/index.ts",
|
|
@@ -1076,7 +1104,7 @@
|
|
|
1076
1104
|
"type": "registry:block",
|
|
1077
1105
|
"title": "Heuristic Finding Card Block",
|
|
1078
1106
|
"description": "Composed Heuristic Finding Card block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
1079
|
-
"license": "
|
|
1107
|
+
"license": "MIT",
|
|
1080
1108
|
"dependencies": [
|
|
1081
1109
|
"lucide-react"
|
|
1082
1110
|
],
|
|
@@ -1096,7 +1124,7 @@
|
|
|
1096
1124
|
{
|
|
1097
1125
|
"path": "blocks/heuristic-finding-card/heuristic-finding-card.tsx",
|
|
1098
1126
|
"type": "registry:block",
|
|
1099
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Trash2, Edit2, ExternalLink, Image as ImageIcon } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n Card,\n CardContent,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { Badge } from \"../../components/badge\";\nimport { AspectRatio } from \"../../components/aspect-ratio\";\nimport { CopyButton } from \"../../components/copy-button\";\nimport { Button } from \"../../components/button\";\n\nexport type FindingSeverity = \"CRITICAL\" | \"MEDIUM\" | \"GOOD\";\n\nexport interface HeuristicFinding {\n id: string;\n heuristicId: string;\n heuristicTitle: string;\n severity: FindingSeverity;\n rating: number;\n selector: string;\n description: string;\n screenshotUrl?: string;\n createdAt?: string;\n evaluatorName?: string;\n}\n\nexport interface HeuristicFindingCardProps\n extends React.HTMLAttributes<HTMLDivElement> {\n finding: HeuristicFinding;\n onEdit?: (finding: HeuristicFinding) => void;\n onDelete?: (id: string) => void;\n onViewScreenshot?: (finding: HeuristicFinding) => void;\n}\n\
|
|
1127
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Trash2, Edit2, ExternalLink, Image as ImageIcon } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n Card,\n CardContent,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { Badge } from \"../../components/badge\";\nimport { AspectRatio } from \"../../components/aspect-ratio\";\nimport { CopyButton } from \"../../components/copy-button\";\nimport { Button } from \"../../components/button\";\n\nexport type FindingSeverity = \"CRITICAL\" | \"MEDIUM\" | \"GOOD\";\n\nexport interface HeuristicFinding {\n id: string;\n heuristicId: string;\n heuristicTitle: string;\n severity: FindingSeverity;\n rating: number;\n selector: string;\n description: string;\n screenshotUrl?: string;\n createdAt?: string;\n evaluatorName?: string;\n}\n\nexport interface HeuristicFindingCardProps\n extends React.HTMLAttributes<HTMLDivElement> {\n finding: HeuristicFinding;\n onEdit?: (finding: HeuristicFinding) => void;\n onDelete?: (id: string) => void;\n onViewScreenshot?: (finding: HeuristicFinding) => void;\n}\n\nconst SEVERITY_STEPS = 5;\n\nfunction getSeverityBadgeVariant(severity: FindingSeverity) {\n switch (severity) {\n case \"CRITICAL\":\n return \"coral-red\" as const;\n case \"MEDIUM\":\n return \"signal-teal\" as const;\n case \"GOOD\":\n return \"pulse-green\" as const;\n default:\n return \"neutral\" as const;\n }\n}\n\nfunction getSeverityPipClass(severity: FindingSeverity): string {\n switch (severity) {\n case \"CRITICAL\":\n return \"bg-coral-red-foreground\";\n case \"MEDIUM\":\n return \"bg-signal-teal-foreground\";\n case \"GOOD\":\n return \"bg-pulse-green-foreground\";\n default:\n return \"bg-primary\";\n }\n}\n\nexport function HeuristicFindingCard({\n finding,\n onEdit,\n onDelete,\n onViewScreenshot,\n className,\n ...props\n}: HeuristicFindingCardProps) {\n const filledSteps = Math.min(\n SEVERITY_STEPS,\n Math.max(0, Math.round(finding.rating))\n );\n const pipActiveClass = getSeverityPipClass(finding.severity);\n\n return (\n <Card\n className={cn(\n \"overflow-hidden border border-border bg-card text-card-foreground\",\n className\n )}\n {...props}\n >\n <CardHeader className=\"flex flex-row flex-wrap items-start justify-between gap-x-4 gap-y-3 space-y-0 border-b border-border/60 px-6 py-5\">\n <div className=\"flex min-w-0 flex-1 flex-col gap-2.5\">\n <CardTitle className=\"break-words text-base font-semibold tracking-tight text-card-foreground\">\n {finding.heuristicTitle}\n </CardTitle>\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"inline-flex items-center rounded-sm border border-border bg-secondary px-2 py-0.5 font-mono text-xs font-medium text-muted-foreground tabular-nums\">\n {finding.heuristicId}\n </span>\n <Badge variant={getSeverityBadgeVariant(finding.severity)}>\n {finding.severity}\n </Badge>\n </div>\n </div>\n\n {(onEdit || onDelete) && (\n <div className=\"flex shrink-0 items-center gap-1.5\">\n {onEdit && (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-8 w-8 text-muted-foreground hover:text-foreground\"\n onClick={() => onEdit(finding)}\n aria-label=\"Edit finding\"\n >\n <Edit2 className=\"h-4 w-4\" />\n </Button>\n )}\n {onDelete && (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-8 w-8 text-muted-foreground hover:text-coral-red-foreground\"\n onClick={() => onDelete(finding.id)}\n aria-label=\"Delete finding\"\n >\n <Trash2 className=\"h-4 w-4\" />\n </Button>\n )}\n </div>\n )}\n </CardHeader>\n\n <CardContent className=\"flex flex-col gap-5 px-6 py-6\">\n {finding.screenshotUrl ? (\n <div className=\"group relative overflow-hidden rounded-lg border border-border bg-secondary\">\n <AspectRatio ratio={16 / 9}>\n <img\n src={finding.screenshotUrl}\n alt={`Screenshot for finding on ${finding.selector}`}\n loading=\"lazy\"\n className=\"h-full w-full object-cover\"\n />\n </AspectRatio>\n {onViewScreenshot && (\n <Button\n variant=\"secondary\"\n size=\"sm\"\n className=\"absolute bottom-3 right-3 gap-1.5 text-xs opacity-0 transition-opacity focus-visible:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100\"\n onClick={() => onViewScreenshot(finding)}\n >\n <ExternalLink className=\"h-3.5 w-3.5\" />\n <span>Expand</span>\n </Button>\n )}\n </div>\n ) : (\n <div className=\"flex items-center justify-center gap-2.5 rounded-lg border border-dashed border-border bg-secondary/40 px-5 py-8 text-xs text-muted-foreground\">\n <ImageIcon className=\"h-4 w-4 shrink-0\" />\n <span>No screenshot captured</span>\n </div>\n )}\n\n <div className=\"flex min-w-0 items-center justify-between gap-3 rounded-md border border-border bg-secondary px-4 py-2.5 font-mono text-xs\">\n <span className=\"min-w-0 flex-1 truncate text-foreground\">\n {finding.selector}\n </span>\n <CopyButton\n value={finding.selector}\n className=\"h-8 w-8 shrink-0 text-muted-foreground\"\n />\n </div>\n\n <div className=\"flex flex-col gap-3.5 pt-1\">\n <div className=\"flex flex-wrap items-center justify-between gap-x-4 gap-y-2 text-xs text-muted-foreground\">\n <span className=\"min-w-0 font-medium text-muted-foreground\">\n Usability Severity Score\n </span>\n <div\n className=\"flex shrink-0 items-center gap-3\"\n aria-label={`Usability severity score: ${finding.rating} of ${SEVERITY_STEPS}`}\n >\n <div className=\"flex items-center gap-1\" aria-hidden=\"true\">\n {Array.from({ length: SEVERITY_STEPS }, (_, idx) => (\n <span\n key={idx}\n className={cn(\n \"h-2 w-3.5 rounded-[2px]\",\n idx < filledSteps ? pipActiveClass : \"bg-secondary\"\n )}\n />\n ))}\n </div>\n <span className=\"font-mono text-xs font-semibold text-foreground tabular-nums\">\n {finding.rating} / {SEVERITY_STEPS}\n </span>\n </div>\n </div>\n\n <p className=\"m-0 break-words text-sm leading-relaxed text-foreground\">\n {finding.description}\n </p>\n </div>\n </CardContent>\n\n <CardFooter className=\"flex flex-wrap items-center justify-between gap-x-4 gap-y-2 border-t border-border/60 px-6 py-4 text-xs text-muted-foreground\">\n <span>\n {finding.evaluatorName\n ? `Evaluated by ${finding.evaluatorName}`\n : \"Audited element\"}\n </span>\n {finding.createdAt && (\n <span className=\"tabular-nums\">{finding.createdAt}</span>\n )}\n </CardFooter>\n </Card>\n );\n}\n"
|
|
1100
1128
|
},
|
|
1101
1129
|
{
|
|
1102
1130
|
"path": "blocks/heuristic-finding-card/index.ts",
|
|
@@ -1110,7 +1138,7 @@
|
|
|
1110
1138
|
"type": "registry:ui",
|
|
1111
1139
|
"title": "Hover Card",
|
|
1112
1140
|
"description": "Accessible Hover Card primitive component built with Base UI and Tailwind v4.",
|
|
1113
|
-
"license": "
|
|
1141
|
+
"license": "MIT",
|
|
1114
1142
|
"dependencies": [
|
|
1115
1143
|
"@base-ui/react"
|
|
1116
1144
|
],
|
|
@@ -1125,7 +1153,7 @@
|
|
|
1125
1153
|
{
|
|
1126
1154
|
"path": "components/hover-card/hover-card.tsx",
|
|
1127
1155
|
"type": "registry:ui",
|
|
1128
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport { cn } from \"../../lib/utils\";\n\nexport const HoverCard = ({\n open,\n defaultOpen,\n onOpenChange,\n children,\n}: {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children: React.ReactNode;\n}) => {\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen ?? false);\n const isControlled = open !== undefined;\n const isOpen = isControlled ? open : internalOpen;\n\n const handleOpenChange = (newOpen: boolean) => {\n if (!isControlled) {\n setInternalOpen(newOpen);\n }\n onOpenChange?.(newOpen);\n };\n\n return (\n <BasePopover.Root open={isOpen} onOpenChange={handleOpenChange}>\n {children}\n </BasePopover.Root>\n );\n};\n\n/**\n * Hover-to-open trigger.\n *\n * Base UI's `Popover.Trigger` owns the hover interaction: `openOnHover` turns\n * the pointer rest over the trigger into an open (after `delay` ms), and\n * `closeDelay` keeps the card alive long enough for the pointer to travel into\n * it — Base UI's safe-polygon keeps the popup open along that path. Keyboard\n * focus and activation still work through the native button semantics the\n * trigger renders (Enter/Space open, Escape closes and restores focus).\n */\nexport const HoverCardTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Trigger> & {\n delay?: number;\n closeDelay?: number;\n }\n>(({ openOnHover = true, delay = 300, closeDelay = 100, ...props }, ref) => (\n <BasePopover.Trigger\n ref={ref}\n openOnHover={openOnHover}\n delay={delay}\n closeDelay={closeDelay}\n {...props}\n />\n));\nHoverCardTrigger.displayName = \"HoverCardTrigger\";\n\nexport const HoverCardPortal = BasePopover.Portal;\n\nexport const HoverCardContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Popup> & {\n align?: \"start\" | \"center\" | \"end\";\n sideOffset?: number;\n }\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <HoverCardPortal>\n <BasePopover.Positioner align={align} sideOffset={sideOffset}>\n <BasePopover.Popup\n ref={ref}\n className={cn(\n \"z-50 w-72 rounded-
|
|
1156
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport { cn } from \"../../lib/utils\";\n\nexport const HoverCard = ({\n open,\n defaultOpen,\n onOpenChange,\n children,\n}: {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children: React.ReactNode;\n}) => {\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen ?? false);\n const isControlled = open !== undefined;\n const isOpen = isControlled ? open : internalOpen;\n\n const handleOpenChange = (newOpen: boolean) => {\n if (!isControlled) {\n setInternalOpen(newOpen);\n }\n onOpenChange?.(newOpen);\n };\n\n return (\n <BasePopover.Root open={isOpen} onOpenChange={handleOpenChange}>\n {children}\n </BasePopover.Root>\n );\n};\n\n/**\n * Hover-to-open trigger.\n *\n * Base UI's `Popover.Trigger` owns the hover interaction: `openOnHover` turns\n * the pointer rest over the trigger into an open (after `delay` ms), and\n * `closeDelay` keeps the card alive long enough for the pointer to travel into\n * it — Base UI's safe-polygon keeps the popup open along that path. Keyboard\n * focus and activation still work through the native button semantics the\n * trigger renders (Enter/Space open, Escape closes and restores focus).\n */\nexport const HoverCardTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Trigger> & {\n delay?: number;\n closeDelay?: number;\n }\n>(({ openOnHover = true, delay = 300, closeDelay = 100, ...props }, ref) => (\n <BasePopover.Trigger\n ref={ref}\n openOnHover={openOnHover}\n delay={delay}\n closeDelay={closeDelay}\n {...props}\n />\n));\nHoverCardTrigger.displayName = \"HoverCardTrigger\";\n\nexport const HoverCardPortal = BasePopover.Portal;\n\nexport const HoverCardContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Popup> & {\n align?: \"start\" | \"center\" | \"end\";\n sideOffset?: number;\n }\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <HoverCardPortal>\n <BasePopover.Positioner align={align} sideOffset={sideOffset}>\n <BasePopover.Popup\n ref={ref}\n className={cn(\n \"z-50 w-72 rounded-lg border border-border bg-popover px-5 py-4 text-popover-foreground shadow-(--shadow-xl) outline-none data-open:animate-overlay-in data-closed:animate-overlay-out\",\n className\n )}\n {...props}\n />\n </BasePopover.Positioner>\n </HoverCardPortal>\n));\nHoverCardContent.displayName = \"HoverCardContent\";\n"
|
|
1129
1157
|
},
|
|
1130
1158
|
{
|
|
1131
1159
|
"path": "components/hover-card/index.ts",
|
|
@@ -1139,7 +1167,7 @@
|
|
|
1139
1167
|
"type": "registry:ui",
|
|
1140
1168
|
"title": "Input",
|
|
1141
1169
|
"description": "Accessible Input primitive component built with Base UI and Tailwind v4.",
|
|
1142
|
-
"license": "
|
|
1170
|
+
"license": "MIT",
|
|
1143
1171
|
"dependencies": [
|
|
1144
1172
|
"class-variance-authority"
|
|
1145
1173
|
],
|
|
@@ -1159,7 +1187,7 @@
|
|
|
1159
1187
|
{
|
|
1160
1188
|
"path": "components/input/input.tsx",
|
|
1161
1189
|
"type": "registry:ui",
|
|
1162
|
-
"content": "import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport const inputVariants = cva(\n \"flex w-full rounded-md border border-input bg-field text-foreground px-3 py-1 text-sm transition-[border-color,box-shadow,background-color] duration-150 ease-out file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-fog focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive\",\n {\n variants: {\n inputSize: {\n sm: \"h-8 px-
|
|
1190
|
+
"content": "import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport const inputVariants = cva(\n \"box-border flex w-full rounded-md border border-input bg-field text-foreground px-3 py-1 text-sm transition-[border-color,box-shadow,background-color] duration-150 ease-out file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-fog focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive\",\n {\n variants: {\n inputSize: {\n sm: \"h-8 px-3 py-1.5 text-xs rounded-md\",\n md: \"h-9 px-3.5 py-2 text-sm rounded-md\",\n lg: \"h-10 px-4 py-2 text-base rounded-md\",\n },\n },\n defaultVariants: {\n inputSize: \"md\",\n },\n }\n);\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement>,\n VariantProps<typeof inputVariants> {}\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type = \"text\", inputSize, ...props }, ref) => {\n return (\n <input\n data-slot=\"input\"\n type={type}\n className={cn(inputVariants({ inputSize, className }))}\n ref={ref}\n {...props}\n />\n );\n }\n);\n\nInput.displayName = \"Input\";\n"
|
|
1163
1191
|
}
|
|
1164
1192
|
]
|
|
1165
1193
|
},
|
|
@@ -1168,7 +1196,7 @@
|
|
|
1168
1196
|
"type": "registry:ui",
|
|
1169
1197
|
"title": "Input Otp",
|
|
1170
1198
|
"description": "Accessible Input Otp primitive component built with Base UI and Tailwind v4.",
|
|
1171
|
-
"license": "
|
|
1199
|
+
"license": "MIT",
|
|
1172
1200
|
"dependencies": [
|
|
1173
1201
|
"input-otp",
|
|
1174
1202
|
"lucide-react"
|
|
@@ -1190,7 +1218,7 @@
|
|
|
1190
1218
|
{
|
|
1191
1219
|
"path": "components/input-otp/input-otp.tsx",
|
|
1192
1220
|
"type": "registry:ui",
|
|
1193
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { OTPInput, OTPInputContext } from \"input-otp\";\nimport { Minus } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport const InputOTP = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n aria-label={props[\"aria-label\"] ?? \"One-time password\"}\n containerClassName={cn(\n \"flex items-center gap-2 has-disabled:opacity-50\",\n containerClassName\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n));\nInputOTP.displayName = \"InputOTP\";\n\nexport const InputOTPGroup = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center\", className)} {...props} />\n));\nInputOTPGroup.displayName = \"InputOTPGroup\";\n\nexport const InputOTPSlot = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<\"div\"> & { index: number }\n>(({ index, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext);\n const { char, hasFakeCaret, isActive } = inputOTPContext?.slots?.[index] ?? {};\n\n return (\n <div\n ref={ref}\n className={cn(\n \"relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm font-medium transition-
|
|
1221
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { OTPInput, OTPInputContext } from \"input-otp\";\nimport { Minus } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport const InputOTP = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n aria-label={props[\"aria-label\"] ?? \"One-time password\"}\n containerClassName={cn(\n \"flex items-center gap-2 has-disabled:opacity-50\",\n containerClassName\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n));\nInputOTP.displayName = \"InputOTP\";\n\nexport const InputOTPGroup = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center\", className)} {...props} />\n));\nInputOTPGroup.displayName = \"InputOTPGroup\";\n\nexport const InputOTPSlot = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<\"div\"> & { index: number }\n>(({ index, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext);\n const { char, hasFakeCaret, isActive } = inputOTPContext?.slots?.[index] ?? {};\n\n return (\n <div\n ref={ref}\n className={cn(\n \"relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm font-medium transition-[border-color,box-shadow,background-color] duration-150 first:rounded-l-md first:border-l last:rounded-r-md bg-background text-foreground\",\n isActive && \"z-10 ring-2 ring-ring ring-offset-background\",\n className\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"h-4 w-px animate-caret-blink bg-foreground duration-1000\" />\n </div>\n )}\n </div>\n );\n});\nInputOTPSlot.displayName = \"InputOTPSlot\";\n\nexport const InputOTPSeparator = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <Minus className=\"h-4 w-4 text-muted-foreground\" />\n </div>\n));\nInputOTPSeparator.displayName = \"InputOTPSeparator\";\n"
|
|
1194
1222
|
}
|
|
1195
1223
|
]
|
|
1196
1224
|
},
|
|
@@ -1199,7 +1227,7 @@
|
|
|
1199
1227
|
"type": "registry:block",
|
|
1200
1228
|
"title": "Inspector Split View Block",
|
|
1201
1229
|
"description": "Composed Inspector Split View block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
1202
|
-
"license": "
|
|
1230
|
+
"license": "MIT",
|
|
1203
1231
|
"dependencies": [
|
|
1204
1232
|
"lucide-react"
|
|
1205
1233
|
],
|
|
@@ -1224,7 +1252,32 @@
|
|
|
1224
1252
|
{
|
|
1225
1253
|
"path": "blocks/inspector-split-view/inspector-split-view.tsx",
|
|
1226
1254
|
"type": "registry:block",
|
|
1227
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Layers, Play } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n ResizablePanelGroup,\n ResizablePanel,\n ResizableHandle,\n} from \"../../components/resizable\";\nimport {\n TreeView,\n TreeItem,\n TreeItemTrigger,\n TreeItemContent,\n} from \"../../components/tree-view\";\nimport { Badge } from \"../../components/badge\";\nimport { Button } from \"../../components/button\";\nimport { CopyButton } from \"../../components/copy-button\";\n\nexport interface DOMNodeItem {\n id: string;\n tag: string;\n selector: string;\n classes?: string;\n role?: string;\n children?: DOMNodeItem[];\n}\n\nexport interface InspectorSplitViewProps\n extends React.HTMLAttributes<HTMLDivElement> {\n nodes?: DOMNodeItem[];\n selectedNodeId?: string;\n defaultSelectedNodeId?: string;\n onSelectNode?: (node: DOMNodeItem) => void;\n onAuditElement?: (node: DOMNodeItem) => void;\n}\n\nexport function InspectorSplitView({\n nodes = [],\n selectedNodeId,\n defaultSelectedNodeId,\n onSelectNode,\n onAuditElement,\n className,\n ...props\n}: InspectorSplitViewProps) {\n const isControlled = selectedNodeId !== undefined;\n const [internalSelectedId, setInternalSelectedId] = React.useState<\n string | null\n >(defaultSelectedNodeId ?? null);\n\n const currentId = isControlled ? selectedNodeId : internalSelectedId;\n const matchedNode = currentId ? findNodeById(nodes, currentId) : null;\n const selected = matchedNode ?? (!isControlled ? nodes[0] ?? null : null);\n\n const handleNodeClick = (node: DOMNodeItem) => {\n if (!isControlled) {\n setInternalSelectedId(node.id);\n }\n onSelectNode?.(node);\n };\n\n function renderTree(item: DOMNodeItem) {\n const hasChildren = item.children && item.children.length > 0;\n const isSelected = selected?.id === item.id;\n\n return (\n <TreeItem key={item.id} defaultExpanded>\n <TreeItemTrigger\n onClick={() => handleNodeClick(item)}\n className={cn(\n \"min-w-0\",\n isSelected && \"bg-accent text-accent-foreground font-medium\"\n )}\n >\n <span className=\"font-mono text-xs text-primary font-semibold\">\n <{item.tag}>\n </span>\n <span className=\"font-mono text-xs text-muted-foreground truncate\">\n {item.classes ? `.${item.classes.replace(/\\s+/g, \".\")}` : \"\"}\n </span>\n </TreeItemTrigger>\n {hasChildren && (\n <TreeItemContent>{item.children!.map(renderTree)}</TreeItemContent>\n )}\n </TreeItem>\n );\n }\n\n return (\n <div\n className={cn(\n \"min-w-0 w-full max-w-full overflow-hidden rounded-lg border border-border bg-background
|
|
1255
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Layers, Play } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n ResizablePanelGroup,\n ResizablePanel,\n ResizableHandle,\n} from \"../../components/resizable\";\nimport {\n TreeView,\n TreeItem,\n TreeItemTrigger,\n TreeItemContent,\n} from \"../../components/tree-view\";\nimport { Badge } from \"../../components/badge\";\nimport { Button } from \"../../components/button\";\nimport { CopyButton } from \"../../components/copy-button\";\n\nexport interface DOMNodeItem {\n id: string;\n tag: string;\n selector: string;\n classes?: string;\n role?: string;\n children?: DOMNodeItem[];\n}\n\nexport interface InspectorSplitViewProps\n extends React.HTMLAttributes<HTMLDivElement> {\n nodes?: DOMNodeItem[];\n selectedNodeId?: string;\n defaultSelectedNodeId?: string;\n onSelectNode?: (node: DOMNodeItem) => void;\n onAuditElement?: (node: DOMNodeItem) => void;\n}\n\nexport function InspectorSplitView({\n nodes = [],\n selectedNodeId,\n defaultSelectedNodeId,\n onSelectNode,\n onAuditElement,\n className,\n ...props\n}: InspectorSplitViewProps) {\n const isControlled = selectedNodeId !== undefined;\n const [internalSelectedId, setInternalSelectedId] = React.useState<\n string | null\n >(defaultSelectedNodeId ?? null);\n\n const currentId = isControlled ? selectedNodeId : internalSelectedId;\n const matchedNode = currentId ? findNodeById(nodes, currentId) : null;\n const selected = matchedNode ?? (!isControlled ? nodes[0] ?? null : null);\n\n const handleNodeClick = (node: DOMNodeItem) => {\n if (!isControlled) {\n setInternalSelectedId(node.id);\n }\n onSelectNode?.(node);\n };\n\n function renderTree(item: DOMNodeItem) {\n const hasChildren = item.children && item.children.length > 0;\n const isSelected = selected?.id === item.id;\n\n return (\n <TreeItem key={item.id} defaultExpanded>\n <TreeItemTrigger\n onClick={() => handleNodeClick(item)}\n className={cn(\n \"min-w-0\",\n isSelected && \"bg-accent text-accent-foreground font-medium\"\n )}\n >\n <span className=\"font-mono text-xs text-primary font-semibold\">\n <{item.tag}>\n </span>\n <span className=\"font-mono text-xs text-muted-foreground truncate\">\n {item.classes ? `.${item.classes.replace(/\\s+/g, \".\")}` : \"\"}\n </span>\n </TreeItemTrigger>\n {hasChildren && (\n <TreeItemContent>{item.children!.map(renderTree)}</TreeItemContent>\n )}\n </TreeItem>\n );\n }\n\n return (\n <div\n className={cn(\n \"min-w-0 w-full max-w-full overflow-hidden rounded-lg border border-border bg-background h-[500px]\",\n className\n )}\n {...props}\n >\n <ResizablePanelGroup direction=\"horizontal\">\n <ResizablePanel defaultSize={40} minSize={25}>\n <div className=\"flex h-full min-w-0 flex-col border-r border-border/60\">\n <div className=\"flex items-center gap-2.5 border-b border-border/60 px-4 py-3.5\">\n <Layers className=\"h-4 w-4 shrink-0 text-muted-foreground\" />\n <span className=\"truncate text-xs font-medium text-muted-foreground\">\n DOM Hierarchy\n </span>\n </div>\n <div className=\"min-w-0 flex-1 overflow-y-auto p-4\">\n <TreeView>{nodes.map(renderTree)}</TreeView>\n </div>\n </div>\n </ResizablePanel>\n\n <ResizableHandle withHandle />\n\n <ResizablePanel defaultSize={60} minSize={30}>\n <div className=\"flex h-full min-w-0 flex-col overflow-y-auto bg-surface-raised/50 px-6 py-5\">\n {selected ? (\n <div className=\"flex min-w-0 flex-col gap-5\">\n <div className=\"flex flex-wrap items-center justify-between gap-3 border-b border-border/60 pb-4\">\n <div className=\"flex min-w-0 items-center gap-2.5\">\n <Badge variant=\"outline\" className=\"font-mono uppercase\">\n {selected.tag}\n </Badge>\n {selected.role && (\n <Badge variant=\"secondary\">role=\"{selected.role}\"</Badge>\n )}\n </div>\n {onAuditElement && (\n <Button\n size=\"sm\"\n onClick={() => onAuditElement(selected)}\n className=\"gap-1.5 text-xs\"\n >\n <Play className=\"h-3 w-3\" />\n <span>Audit Element</span>\n </Button>\n )}\n </div>\n\n <div className=\"min-w-0 space-y-4\">\n <div className=\"space-y-1.5\">\n <span className=\"text-xs font-medium text-muted-foreground\">\n Target Selector\n </span>\n <div className=\"flex min-w-0 items-center justify-between gap-3 rounded-md border border-border bg-secondary px-3.5 py-2.5 font-mono text-xs\">\n <span className=\"min-w-0 truncate text-primary\">\n {selected.selector}\n </span>\n <CopyButton\n value={selected.selector}\n className=\"h-7 w-7 shrink-0\"\n />\n </div>\n </div>\n\n {selected.classes && (\n <div className=\"space-y-1.5\">\n <span className=\"text-xs font-medium text-muted-foreground\">\n Class List\n </span>\n <div className=\"rounded-md border border-border bg-secondary px-3.5 py-2.5 font-mono text-xs text-muted-foreground break-all\">\n {selected.classes}\n </div>\n </div>\n )}\n </div>\n </div>\n ) : (\n <div className=\"flex h-full items-center justify-center text-xs text-muted-foreground\">\n Select an element from the DOM tree to inspect.\n </div>\n )}\n </div>\n </ResizablePanel>\n </ResizablePanelGroup>\n </div>\n );\n}\n\nfunction findNodeById(nodes: DOMNodeItem[], id: string): DOMNodeItem | null {\n for (const node of nodes) {\n if (node.id === id) return node;\n if (node.children) {\n const found = findNodeById(node.children, id);\n if (found) return found;\n }\n }\n return null;\n}\n"
|
|
1256
|
+
}
|
|
1257
|
+
]
|
|
1258
|
+
},
|
|
1259
|
+
{
|
|
1260
|
+
"name": "instrument-metrics-grid",
|
|
1261
|
+
"type": "registry:block",
|
|
1262
|
+
"title": "Instrument Metrics Grid Block",
|
|
1263
|
+
"description": "Composed Instrument Metrics Grid block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
1264
|
+
"license": "MIT",
|
|
1265
|
+
"dependencies": [],
|
|
1266
|
+
"devDependencies": [],
|
|
1267
|
+
"registryDependencies": [
|
|
1268
|
+
"utils"
|
|
1269
|
+
],
|
|
1270
|
+
"dependencyVersions": {},
|
|
1271
|
+
"files": [
|
|
1272
|
+
{
|
|
1273
|
+
"path": "blocks/instrument-metrics-grid/index.ts",
|
|
1274
|
+
"type": "registry:block",
|
|
1275
|
+
"content": "export * from \"./instrument-metrics-grid\";\n"
|
|
1276
|
+
},
|
|
1277
|
+
{
|
|
1278
|
+
"path": "blocks/instrument-metrics-grid/instrument-metrics-grid.tsx",
|
|
1279
|
+
"type": "registry:block",
|
|
1280
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface InstrumentMetricsGridProps {\n /** Percentage (0–100) for the vertical barcode tick meter. */\n tickValue?: number;\n tickLabel?: string;\n tickShortcut?: string;\n /** Percentage (0–100) for the circular dot-matrix pattern meter. */\n dotValue?: number;\n dotLabel?: string;\n /** Angle (0–360) for the inverted radial repeat dial indicator. */\n dialAngle?: number;\n dialTitle?: string;\n dialSubtitle?: string;\n /** Series values (0–100) for the hatched telemetry area curve. */\n curvePoints?: number[];\n curveTitle?: string;\n curveMeta?: string;\n className?: string;\n}\n\nconst DEFAULT_CURVE = [28, 52, 42, 68, 55, 86, 62, 74];\n\n/**\n * Graphite industrial instrument showcase block featuring four tactile graphic\n * meters built purely with inline SVG and CSS custom properties:\n * 1. Vertical Barcode Tick Meter\n * 2. Circular Dot-Matrix Pattern Meter\n * 3. Inverted Radial Repeat Dial\n * 4. Diagonal-Hatched Area Telemetry Curve\n */\nexport function InstrumentMetricsGrid({\n tickValue = 71,\n tickLabel = \"Coverage index\",\n tickShortcut = \"⌘ + D\",\n dotValue = 82,\n dotLabel = \"Pattern integrity\",\n dialAngle = 140,\n dialTitle = \"Radial repeat\",\n dialSubtitle = \"Calibrated\",\n curvePoints = DEFAULT_CURVE,\n curveTitle = \"Latency curve\",\n curveMeta = \"p95 · 42ms\",\n className,\n}: InstrumentMetricsGridProps) {\n const hatchPatternId = React.useId();\n\n const clampedTick = Math.min(100, Math.max(0, tickValue));\n const clampedDot = Math.min(100, Math.max(0, dotValue));\n\n const totalTicks = 28;\n const filledTicks = Math.round((clampedTick / 100) * totalTicks);\n\n const totalDots = 24; // 3 rows x 8 columns\n const filledDots = Math.round((clampedDot / 100) * totalDots);\n\n const normalizedPoints = curvePoints.length >= 2 ? curvePoints : DEFAULT_CURVE;\n const svgW = 240;\n const svgH = 110;\n const stepX = svgW / (normalizedPoints.length - 1);\n const coords = normalizedPoints.map((val, idx) => ({\n x: idx * stepX,\n y: svgH - 12 - (Math.min(100, Math.max(0, val)) / 100) * (svgH - 26),\n }));\n\n const linePath = coords\n .map((pt, idx) => {\n if (idx === 0) return `M ${pt.x} ${pt.y}`;\n const prev = coords[idx - 1];\n const cx = (prev.x + pt.x) / 2;\n return `C ${cx} ${prev.y}, ${cx} ${pt.y}, ${pt.x} ${pt.y}`;\n })\n .join(\" \");\n const areaPath = `${linePath} L ${svgW} ${svgH} L 0 ${svgH} Z`;\n const peakPoint = coords.reduce(\n (best, pt) => (pt.y < best.y ? pt : best),\n coords[0]\n );\n\n const dialRad = ((dialAngle - 90) * Math.PI) / 180;\n const markerX = 80 + Math.cos(dialRad) * 56;\n const markerY = 80 + Math.sin(dialRad) * 56;\n\n return (\n <div className={cn(\"@container w-full\", className)}>\n <div className=\"grid w-full grid-cols-1 gap-5 @md:grid-cols-2 @4xl:grid-cols-4\">\n {/* Tile 1: Barcode Tick Meter (71% ⌘ + D) */}\n <article className=\"flex flex-col justify-between gap-6 rounded-2xl border border-border bg-card p-6 text-card-foreground\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"flex flex-col gap-1\">\n <span className=\"font-mono text-4xl font-semibold leading-none tracking-tight text-foreground tabular-nums\">\n {clampedTick}%\n </span>\n <span className=\"text-xs font-medium text-muted-foreground\">\n {tickLabel}\n </span>\n </div>\n <kbd className=\"shrink-0 whitespace-nowrap rounded-md border border-border bg-secondary px-2 py-1 font-mono text-[11px] font-medium text-foreground\">\n {tickShortcut}\n </kbd>\n </div>\n\n <div\n aria-label={`${tickLabel}: ${clampedTick}%`}\n role=\"img\"\n className=\"flex h-20 w-full items-end gap-[3px] pt-2\"\n >\n {Array.from({ length: totalTicks }).map((_, idx) => {\n const isActive = idx < filledTicks;\n return (\n <span\n key={idx}\n className={cn(\n \"flex-1 rounded-[1px] transition-colors duration-200\",\n isActive ? \"h-full bg-primary\" : \"h-3/4 bg-foreground/20\"\n )}\n />\n );\n })}\n </div>\n </article>\n\n {/* Tile 2: Dot-Matrix Pattern Meter (82% Pattern Hero) */}\n <article className=\"flex flex-col justify-between gap-6 rounded-2xl border border-border bg-card p-6 text-card-foreground\">\n <div className=\"flex flex-col gap-1\">\n <span className=\"font-mono text-4xl font-semibold leading-none tracking-tight text-foreground tabular-nums\">\n {clampedDot}%\n </span>\n <span className=\"text-xs font-medium text-muted-foreground\">\n {dotLabel}\n </span>\n </div>\n\n <div\n aria-label={`${dotLabel}: ${clampedDot}%`}\n role=\"img\"\n className=\"grid grid-cols-8 gap-2\"\n >\n {Array.from({ length: totalDots }).map((_, idx) => {\n const isActive = idx < filledDots;\n return (\n <span\n key={idx}\n className={cn(\n \"aspect-square w-full rounded-full transition-colors duration-200\",\n isActive\n ? \"bg-primary\"\n : \"border border-border bg-graphite-hatch\"\n )}\n />\n );\n })}\n </div>\n </article>\n\n {/* Tile 3: Inverted Radial Repeat Dial */}\n <article className=\"flex flex-col items-center justify-between gap-4 rounded-2xl border border-foreground bg-foreground p-6 text-background\">\n <div className=\"relative flex h-40 w-40 items-center justify-center\">\n <svg\n viewBox=\"0 0 160 160\"\n className=\"h-full w-full\"\n role=\"img\"\n aria-label={`${dialTitle} indicator at ${dialAngle} degrees`}\n >\n {Array.from({ length: 48 }).map((_, idx) => {\n const deg = (idx / 48) * 360;\n const isMajor = idx % 4 === 0;\n return (\n <line\n key={idx}\n x1=\"80\"\n y1={isMajor ? \"14\" : \"18\"}\n x2=\"80\"\n y2=\"28\"\n stroke=\"currentColor\"\n strokeOpacity={isMajor ? 0.65 : 0.25}\n strokeWidth={isMajor ? 1.5 : 1}\n transform={`rotate(${deg} 80 80)`}\n />\n );\n })}\n <circle\n cx=\"80\"\n cy=\"80\"\n r=\"56\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeOpacity=\"0.18\"\n strokeWidth=\"1\"\n />\n <circle\n cx={markerX}\n cy={markerY}\n r=\"8.5\"\n fill=\"var(--color-primary)\"\n stroke=\"var(--color-foreground)\"\n strokeWidth=\"2.5\"\n />\n </svg>\n <div className=\"pointer-events-none absolute inset-0 flex flex-col items-center justify-center text-center\">\n <span className=\"text-sm font-semibold leading-tight text-background\">\n {dialTitle}\n </span>\n <span className=\"mt-1 font-mono text-[11px] text-background/70\">\n {dialSubtitle}\n </span>\n </div>\n </div>\n </article>\n\n {/* Tile 4: Hatched Area Telemetry Curve */}\n <article className=\"flex flex-col justify-between gap-4 rounded-2xl border border-border bg-card p-6 text-card-foreground\">\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex flex-col gap-1\">\n <span className=\"text-base font-semibold tracking-tight text-foreground\">\n {curveTitle}\n </span>\n <span className=\"font-mono text-xs text-muted-foreground tabular-nums\">\n {curveMeta}\n </span>\n </div>\n <span\n aria-hidden=\"true\"\n className=\"mt-1 h-2.5 w-2.5 rounded-full bg-primary\"\n />\n </div>\n\n <svg\n viewBox={`0 0 ${svgW} ${svgH}`}\n className=\"h-28 w-full overflow-visible\"\n role=\"img\"\n aria-label={`${curveTitle} hatched telemetry chart`}\n >\n <defs>\n <pattern\n id={hatchPatternId}\n width=\"6\"\n height=\"6\"\n patternTransform=\"rotate(45 0 0)\"\n patternUnits=\"userSpaceOnUse\"\n >\n <line\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"6\"\n stroke=\"var(--color-foreground)\"\n strokeOpacity=\"0.28\"\n strokeWidth=\"1.5\"\n />\n </pattern>\n </defs>\n <path d={areaPath} fill={`url(#${hatchPatternId})`} />\n <path\n d={linePath}\n fill=\"none\"\n stroke=\"var(--color-primary)\"\n strokeWidth=\"2.25\"\n strokeLinecap=\"round\"\n />\n <circle\n cx={peakPoint.x}\n cy={peakPoint.y}\n r=\"5\"\n fill=\"var(--color-primary)\"\n stroke=\"var(--color-card)\"\n strokeWidth=\"2.5\"\n />\n </svg>\n </article>\n </div>\n </div>\n );\n}\n"
|
|
1228
1281
|
}
|
|
1229
1282
|
]
|
|
1230
1283
|
},
|
|
@@ -1233,7 +1286,7 @@
|
|
|
1233
1286
|
"type": "registry:ui",
|
|
1234
1287
|
"title": "Kbd",
|
|
1235
1288
|
"description": "Accessible Kbd primitive component built with Base UI and Tailwind v4.",
|
|
1236
|
-
"license": "
|
|
1289
|
+
"license": "MIT",
|
|
1237
1290
|
"dependencies": [
|
|
1238
1291
|
"class-variance-authority"
|
|
1239
1292
|
],
|
|
@@ -1262,7 +1315,7 @@
|
|
|
1262
1315
|
"type": "registry:ui",
|
|
1263
1316
|
"title": "Label",
|
|
1264
1317
|
"description": "Accessible Label primitive component built with Base UI and Tailwind v4.",
|
|
1265
|
-
"license": "
|
|
1318
|
+
"license": "MIT",
|
|
1266
1319
|
"dependencies": [
|
|
1267
1320
|
"class-variance-authority"
|
|
1268
1321
|
],
|
|
@@ -1291,7 +1344,7 @@
|
|
|
1291
1344
|
"type": "registry:ui",
|
|
1292
1345
|
"title": "Menubar",
|
|
1293
1346
|
"description": "Accessible Menubar primitive component built with Base UI and Tailwind v4.",
|
|
1294
|
-
"license": "
|
|
1347
|
+
"license": "MIT",
|
|
1295
1348
|
"dependencies": [
|
|
1296
1349
|
"@base-ui/react"
|
|
1297
1350
|
],
|
|
@@ -1320,7 +1373,7 @@
|
|
|
1320
1373
|
"type": "registry:ui",
|
|
1321
1374
|
"title": "Navigation Menu",
|
|
1322
1375
|
"description": "Accessible Navigation Menu primitive component built with Base UI and Tailwind v4.",
|
|
1323
|
-
"license": "
|
|
1376
|
+
"license": "MIT",
|
|
1324
1377
|
"dependencies": [
|
|
1325
1378
|
"@base-ui/react",
|
|
1326
1379
|
"lucide-react"
|
|
@@ -1342,7 +1395,7 @@
|
|
|
1342
1395
|
{
|
|
1343
1396
|
"path": "components/navigation-menu/navigation-menu.tsx",
|
|
1344
1397
|
"type": "registry:ui",
|
|
1345
|
-
"content": "import * as React from \"react\";\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nconst NavigationMenu = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\">\n>(({ className, ...props }, ref) => (\n <nav\n ref={ref}\n aria-label=\"Main Navigation\"\n className={cn(\n \"relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className\n )}\n {...props}\n />\n));\nNavigationMenu.displayName = \"NavigationMenu\";\n\nconst NavigationMenuList = React.forwardRef<\n HTMLUListElement,\n React.ComponentPropsWithoutRef<\"ul\">\n>(({ className, ...props }, ref) => (\n <ul\n ref={ref}\n className={cn(\n \"group flex flex-1 list-none items-center justify-center space-x-1\",\n className\n )}\n {...props}\n />\n));\nNavigationMenuList.displayName = \"NavigationMenuList\";\n\nconst NavigationMenuItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentPropsWithoutRef<\"li\">\n>(({ className, ...props }, ref) => (\n <li ref={ref} className={cn(\"relative\", className)} {...props} />\n));\nNavigationMenuItem.displayName = \"NavigationMenuItem\";\n\nconst NavigationMenuTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Trigger>\n>(({ className, children, ...props }, ref) => (\n <BasePopover.Trigger\n ref={ref}\n className={cn(\n // impeccable-disable-next-line border-accent-on-rounded: state-conditional open-state underline indicator on a rounded trigger, not a card border\n \"group inline-flex h-9 w-max items-center justify-center rounded-md bg-transparent px-4 py-2 text-xs font-semibold tracking-tight-linear text-muted-foreground transition-colors hover:text-foreground hover:bg-accent focus:bg-accent focus:text-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-popup-open:text-foreground data-popup-open:border-b-2 data-popup-open:border-primary\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronDown\n className=\"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-popup-open:rotate-180\"\n aria-hidden=\"true\"\n />\n </BasePopover.Trigger>\n));\nNavigationMenuTrigger.displayName = \"NavigationMenuTrigger\";\n\nconst NavigationMenuContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Popup> & {\n align?: \"start\" | \"center\" | \"end\";\n sideOffset?: number;\n }\n>(({ className, align = \"start\", sideOffset = 4, ...props }, ref) => (\n <BasePopover.Portal>\n <BasePopover.Positioner align={align} sideOffset={sideOffset}>\n <BasePopover.Popup\n ref={ref}\n className={cn(\n \"z-50 w-[400px] max-w-[var(--available-width,calc(100vw_-_2rem))] overflow-hidden rounded-
|
|
1398
|
+
"content": "import * as React from \"react\";\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nconst NavigationMenu = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\">\n>(({ className, ...props }, ref) => (\n <nav\n ref={ref}\n aria-label=\"Main Navigation\"\n className={cn(\n \"relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className\n )}\n {...props}\n />\n));\nNavigationMenu.displayName = \"NavigationMenu\";\n\nconst NavigationMenuList = React.forwardRef<\n HTMLUListElement,\n React.ComponentPropsWithoutRef<\"ul\">\n>(({ className, ...props }, ref) => (\n <ul\n ref={ref}\n className={cn(\n \"group flex flex-1 list-none items-center justify-center space-x-1\",\n className\n )}\n {...props}\n />\n));\nNavigationMenuList.displayName = \"NavigationMenuList\";\n\nconst NavigationMenuItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentPropsWithoutRef<\"li\">\n>(({ className, ...props }, ref) => (\n <li ref={ref} className={cn(\"relative\", className)} {...props} />\n));\nNavigationMenuItem.displayName = \"NavigationMenuItem\";\n\nconst NavigationMenuTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Trigger>\n>(({ className, children, ...props }, ref) => (\n <BasePopover.Trigger\n ref={ref}\n className={cn(\n // impeccable-disable-next-line border-accent-on-rounded: state-conditional open-state underline indicator on a rounded trigger, not a card border\n \"group inline-flex h-9 w-max items-center justify-center rounded-md bg-transparent px-4 py-2 text-xs font-semibold tracking-tight-linear text-muted-foreground transition-colors hover:text-foreground hover:bg-accent focus-visible:bg-accent focus-visible:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-popup-open:text-foreground data-popup-open:border-b-2 data-popup-open:border-primary\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronDown\n className=\"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-popup-open:rotate-180\"\n aria-hidden=\"true\"\n />\n </BasePopover.Trigger>\n));\nNavigationMenuTrigger.displayName = \"NavigationMenuTrigger\";\n\nconst NavigationMenuContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Popup> & {\n align?: \"start\" | \"center\" | \"end\";\n sideOffset?: number;\n }\n>(({ className, align = \"start\", sideOffset = 4, ...props }, ref) => (\n <BasePopover.Portal>\n <BasePopover.Positioner align={align} sideOffset={sideOffset}>\n <BasePopover.Popup\n ref={ref}\n className={cn(\n \"z-50 w-[400px] max-w-[var(--available-width,calc(100vw_-_2rem))] overflow-hidden rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-(--shadow-xl) outline-none data-open:animate-overlay-in data-closed:animate-overlay-out\",\n className\n )}\n {...props}\n />\n </BasePopover.Positioner>\n </BasePopover.Portal>\n));\nNavigationMenuContent.displayName = \"NavigationMenuContent\";\n\nconst NavigationMenuLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<\"a\">\n>(({ className, ...props }, ref) => (\n <a\n ref={ref}\n className={cn(\n \"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground text-xs font-medium text-foreground\",\n className\n )}\n {...props}\n />\n));\nNavigationMenuLink.displayName = \"NavigationMenuLink\";\n\nexport {\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuTrigger,\n NavigationMenuContent,\n NavigationMenuLink,\n};\n"
|
|
1346
1399
|
}
|
|
1347
1400
|
]
|
|
1348
1401
|
},
|
|
@@ -1351,7 +1404,7 @@
|
|
|
1351
1404
|
"type": "registry:ui",
|
|
1352
1405
|
"title": "Number Field",
|
|
1353
1406
|
"description": "Accessible Number Field primitive component built with Base UI and Tailwind v4.",
|
|
1354
|
-
"license": "
|
|
1407
|
+
"license": "MIT",
|
|
1355
1408
|
"dependencies": [
|
|
1356
1409
|
"@base-ui/react",
|
|
1357
1410
|
"lucide-react"
|
|
@@ -1373,7 +1426,7 @@
|
|
|
1373
1426
|
{
|
|
1374
1427
|
"path": "components/number-field/number-field.tsx",
|
|
1375
1428
|
"type": "registry:ui",
|
|
1376
|
-
"content": "import * as React from \"react\";\nimport { NumberField as BaseNumberField } from \"@base-ui/react/number-field\";\nimport { Minus, Plus } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport type NumberFieldProps = React.ComponentPropsWithoutRef<\n typeof BaseNumberField.Root\n>;\n\nexport const NumberField = React.forwardRef<HTMLDivElement, NumberFieldProps>(\n ({ className, children, \"aria-label\": ariaLabel, ...props }, ref) => (\n <BaseNumberField.Root\n ref={ref}\n aria-label={ariaLabel}\n className={cn(\n \"inline-flex items-center rounded-md border border-border bg-background\",\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n <BaseNumberField.Decrement\n className=\"flex h-9 w-9 items-center justify-center rounded-l-md border-r border-border text-foreground transition-colors hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed\"\n aria-label=\"Decrease value\"\n >\n <Minus className=\"h-4 w-4\" />\n </BaseNumberField.Decrement>\n <BaseNumberField.Input\n aria-label={ariaLabel ?? \"Value\"}\n className=\"h-9 w-16 bg-transparent text-center text-sm font-semibold text-foreground focus:outline-none disabled:opacity-40\"\n />\n <BaseNumberField.Increment\n className=\"flex h-9 w-9 items-center justify-center rounded-r-md border-l border-border text-foreground transition-colors hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed\"\n aria-label=\"Increase value\"\n >\n <Plus className=\"h-4 w-4\" />\n </BaseNumberField.Increment>\n </>\n )}\n </BaseNumberField.Root>\n )\n);\nNumberField.displayName = \"NumberField\";\n\nexport const NumberFieldInput = BaseNumberField.Input;\nexport const NumberFieldIncrement = BaseNumberField.Increment;\nexport const NumberFieldDecrement = BaseNumberField.Decrement;\n"
|
|
1429
|
+
"content": "import * as React from \"react\";\nimport { NumberField as BaseNumberField } from \"@base-ui/react/number-field\";\nimport { Minus, Plus } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport type NumberFieldProps = React.ComponentPropsWithoutRef<\n typeof BaseNumberField.Root\n>;\n\nexport const NumberField = React.forwardRef<HTMLDivElement, NumberFieldProps>(\n ({ className, children, \"aria-label\": ariaLabel, ...props }, ref) => (\n <BaseNumberField.Root\n ref={ref}\n aria-label={ariaLabel}\n className={cn(\n \"inline-flex items-center rounded-md border border-border bg-background\",\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n <BaseNumberField.Decrement\n className=\"flex h-9 w-9 items-center justify-center rounded-l-md border-r border-border text-foreground transition-colors hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed\"\n aria-label=\"Decrease value\"\n >\n <Minus className=\"h-4 w-4\" />\n </BaseNumberField.Decrement>\n <BaseNumberField.Input\n aria-label={ariaLabel ?? \"Value\"}\n className=\"h-9 w-16 bg-transparent text-center text-sm font-semibold text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-40\"\n />\n <BaseNumberField.Increment\n className=\"flex h-9 w-9 items-center justify-center rounded-r-md border-l border-border text-foreground transition-colors hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed\"\n aria-label=\"Increase value\"\n >\n <Plus className=\"h-4 w-4\" />\n </BaseNumberField.Increment>\n </>\n )}\n </BaseNumberField.Root>\n )\n);\nNumberField.displayName = \"NumberField\";\n\nexport const NumberFieldInput = BaseNumberField.Input;\nexport const NumberFieldIncrement = BaseNumberField.Increment;\nexport const NumberFieldDecrement = BaseNumberField.Decrement;\n"
|
|
1377
1430
|
}
|
|
1378
1431
|
]
|
|
1379
1432
|
},
|
|
@@ -1382,7 +1435,7 @@
|
|
|
1382
1435
|
"type": "registry:ui",
|
|
1383
1436
|
"title": "Pagination",
|
|
1384
1437
|
"description": "Accessible Pagination primitive component built with Base UI and Tailwind v4.",
|
|
1385
|
-
"license": "
|
|
1438
|
+
"license": "MIT",
|
|
1386
1439
|
"dependencies": [
|
|
1387
1440
|
"lucide-react"
|
|
1388
1441
|
],
|
|
@@ -1412,7 +1465,7 @@
|
|
|
1412
1465
|
"type": "registry:ui",
|
|
1413
1466
|
"title": "Popover",
|
|
1414
1467
|
"description": "Accessible Popover primitive component built with Base UI and Tailwind v4.",
|
|
1415
|
-
"license": "
|
|
1468
|
+
"license": "MIT",
|
|
1416
1469
|
"dependencies": [
|
|
1417
1470
|
"@base-ui/react"
|
|
1418
1471
|
],
|
|
@@ -1432,7 +1485,7 @@
|
|
|
1432
1485
|
{
|
|
1433
1486
|
"path": "components/popover/popover.tsx",
|
|
1434
1487
|
"type": "registry:ui",
|
|
1435
|
-
"content": "import * as React from \"react\";\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport { cn } from \"../../lib/utils\";\n\nexport const Popover = BasePopover.Root;\nexport const PopoverTrigger = BasePopover.Trigger;\nexport const PopoverPortal = BasePopover.Portal;\nexport const PopoverClose = BasePopover.Close;\n\nexport const PopoverContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Popup> & {\n align?: \"start\" | \"center\" | \"end\";\n sideOffset?: number;\n }\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <PopoverPortal>\n <BasePopover.Positioner align={align} sideOffset={sideOffset}>\n <BasePopover.Popup\n ref={ref}\n className={cn(\n \"z-50 w-72 rounded-
|
|
1488
|
+
"content": "import * as React from \"react\";\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport { cn } from \"../../lib/utils\";\n\nexport const Popover = BasePopover.Root;\nexport const PopoverTrigger = BasePopover.Trigger;\nexport const PopoverPortal = BasePopover.Portal;\nexport const PopoverClose = BasePopover.Close;\n\nexport const PopoverContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Popup> & {\n align?: \"start\" | \"center\" | \"end\";\n sideOffset?: number;\n }\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <PopoverPortal>\n <BasePopover.Positioner align={align} sideOffset={sideOffset}>\n <BasePopover.Popup\n ref={ref}\n className={cn(\n \"z-50 w-72 rounded-lg border border-border bg-popover px-5 py-4 text-popover-foreground shadow-(--shadow-xl) outline-none data-open:animate-overlay-in data-closed:animate-overlay-out\",\n className\n )}\n {...props}\n />\n </BasePopover.Positioner>\n </PopoverPortal>\n));\nPopoverContent.displayName = \"PopoverContent\";\n"
|
|
1436
1489
|
}
|
|
1437
1490
|
]
|
|
1438
1491
|
},
|
|
@@ -1441,7 +1494,7 @@
|
|
|
1441
1494
|
"type": "registry:ui",
|
|
1442
1495
|
"title": "Progress",
|
|
1443
1496
|
"description": "Accessible Progress primitive component built with Base UI and Tailwind v4.",
|
|
1444
|
-
"license": "
|
|
1497
|
+
"license": "MIT",
|
|
1445
1498
|
"dependencies": [
|
|
1446
1499
|
"@base-ui/react",
|
|
1447
1500
|
"class-variance-authority"
|
|
@@ -1463,7 +1516,7 @@
|
|
|
1463
1516
|
{
|
|
1464
1517
|
"path": "components/progress/progress.tsx",
|
|
1465
1518
|
"type": "registry:ui",
|
|
1466
|
-
"content": "import * as React from \"react\";\nimport { Progress as BaseProgress } from \"@base-ui/react/progress\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport const progressVariants = cva(\n \"relative w-full overflow-hidden rounded-full bg-secondary transition-
|
|
1519
|
+
"content": "import * as React from \"react\";\nimport { Progress as BaseProgress } from \"@base-ui/react/progress\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport const progressVariants = cva(\n \"relative w-full overflow-hidden rounded-full bg-secondary transition-[background-color,opacity] duration-200\",\n {\n variants: {\n size: {\n sm: \"h-1.5\",\n md: \"h-3\",\n lg: \"h-5\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n }\n);\n\nexport const indicatorVariants = cva(\n \"h-full w-full flex-1 transition-[transform,background-color] duration-300 ease-out\",\n {\n variants: {\n variant: {\n default: \"bg-primary\",\n neutral: \"bg-muted-foreground\",\n success: \"bg-pulse-green-foreground\",\n warning: \"bg-amber-signal-foreground\",\n destructive: \"bg-destructive\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nconst FILL_CLASSES: Record<NonNullable<ProgressProps[\"variant\"]>, string> = {\n default: \"bg-primary\",\n neutral: \"bg-foreground\",\n success: \"bg-pulse-green-foreground\",\n warning: \"bg-amber-signal-foreground\",\n destructive: \"bg-destructive\",\n};\n\nexport interface ProgressProps\n extends Omit<React.ComponentPropsWithoutRef<typeof BaseProgress.Root>, \"value\">,\n VariantProps<typeof progressVariants> {\n value?: number;\n variant?: \"default\" | \"neutral\" | \"success\" | \"warning\" | \"destructive\";\n /** Graphite industrial progress patterns: solid (default), hatched track, vertical barcode ticks, or circular dot matrix. */\n pattern?: \"solid\" | \"hatched\" | \"ticks\" | \"dots\";\n}\n\nexport const Progress = React.forwardRef<HTMLDivElement, ProgressProps>(\n (\n {\n className,\n value = 0,\n size = \"md\",\n variant = \"default\",\n pattern = \"solid\",\n ...props\n },\n ref\n ) => {\n const clamped = Math.min(100, Math.max(0, value));\n const fillClass = FILL_CLASSES[variant];\n\n if (pattern === \"ticks\") {\n const tickCount = 32;\n const activeTicks = Math.round((clamped / 100) * tickCount);\n const tickHeight = size === \"sm\" ? \"h-4\" : size === \"lg\" ? \"h-9\" : \"h-6\";\n return (\n <BaseProgress.Root\n ref={ref}\n data-slot=\"progress\"\n data-pattern=\"ticks\"\n value={clamped}\n className={cn(\"flex w-full items-center gap-[3px]\", tickHeight, className)}\n {...props}\n >\n {Array.from({ length: tickCount }).map((_, idx) => (\n <span\n key={idx}\n aria-hidden=\"true\"\n className={cn(\n \"h-full flex-1 rounded-[1px] transition-colors duration-200\",\n idx < activeTicks ? fillClass : \"bg-foreground/15\"\n )}\n />\n ))}\n </BaseProgress.Root>\n );\n }\n\n if (pattern === \"dots\") {\n const dotCount = 16;\n const activeDots = Math.round((clamped / 100) * dotCount);\n const dotSize = size === \"sm\" ? \"h-2.5 w-2.5\" : size === \"lg\" ? \"h-4 w-4\" : \"h-3.5 w-3.5\";\n return (\n <BaseProgress.Root\n ref={ref}\n data-slot=\"progress\"\n data-pattern=\"dots\"\n value={clamped}\n className={cn(\"flex w-full flex-wrap items-center gap-1.5\", className)}\n {...props}\n >\n {Array.from({ length: dotCount }).map((_, idx) => (\n <span\n key={idx}\n aria-hidden=\"true\"\n className={cn(\n \"rounded-full transition-colors duration-200\",\n dotSize,\n idx < activeDots\n ? fillClass\n : \"border border-border bg-graphite-hatch\"\n )}\n />\n ))}\n </BaseProgress.Root>\n );\n }\n\n return (\n <BaseProgress.Root\n ref={ref}\n data-slot=\"progress\"\n data-pattern={pattern}\n value={clamped}\n className={cn(\n progressVariants({ size }),\n pattern === \"hatched\" && \"border border-border bg-graphite-hatch\",\n className\n )}\n {...props}\n >\n <BaseProgress.Track className=\"h-full w-full\">\n <BaseProgress.Indicator\n data-slot=\"progress-indicator\"\n className={cn(\n indicatorVariants({ variant }),\n pattern === \"hatched\" && \"rounded-full\"\n )}\n style={{ transform: `translateX(-${100 - clamped}%)` }}\n />\n </BaseProgress.Track>\n </BaseProgress.Root>\n );\n }\n);\nProgress.displayName = \"Progress\";\n"
|
|
1467
1520
|
}
|
|
1468
1521
|
]
|
|
1469
1522
|
},
|
|
@@ -1472,7 +1525,7 @@
|
|
|
1472
1525
|
"type": "registry:block",
|
|
1473
1526
|
"title": "Project Kanban Board Block",
|
|
1474
1527
|
"description": "Composed Project Kanban Board block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
1475
|
-
"license": "
|
|
1528
|
+
"license": "MIT",
|
|
1476
1529
|
"dependencies": [
|
|
1477
1530
|
"lucide-react"
|
|
1478
1531
|
],
|
|
@@ -1497,7 +1550,7 @@
|
|
|
1497
1550
|
{
|
|
1498
1551
|
"path": "blocks/project-kanban-board/project-kanban-board.tsx",
|
|
1499
1552
|
"type": "registry:block",
|
|
1500
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n Plus,\n CheckCircle2,\n Clock,\n Eye,\n AlertCircle,\n MoreHorizontal,\n} from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Card } from \"../../components/card\";\nimport { Badge } from \"../../components/badge\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../../components/avatar\";\nimport { Button } from \"../../components/button\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuTrigger,\n} from \"../../components/dropdown-menu\";\n\nexport type KanbanColumnId = \"TODO\" | \"IN_PROGRESS\" | \"REVIEW\" | \"DONE\";\n\nexport interface KanbanTask {\n id: string;\n title: string;\n status: KanbanColumnId;\n heuristicTag?: string;\n severity?: \"CRITICAL\" | \"MEDIUM\" | \"GOOD\";\n assigneeName?: string;\n assigneeAvatar?: string;\n}\n\nexport interface ProjectKanbanBoardProps\n extends React.HTMLAttributes<HTMLDivElement> {\n tasks?: KanbanTask[];\n onTaskMove?: (taskId: string, targetStatus: KanbanColumnId) => void;\n onTaskClick?: (task: KanbanTask) => void;\n onAddTask?: (status: KanbanColumnId) => void;\n}\n\nconst COLUMNS: Array<{\n id: KanbanColumnId;\n title: string;\n icon: React.ReactNode;\n}> = [\n {\n id: \"TODO\",\n title: \"To Do\",\n icon: <AlertCircle className=\"h-4 w-4 text-muted-foreground\" />,\n },\n {\n id: \"IN_PROGRESS\",\n title: \"In Progress\",\n icon: <Clock className=\"h-4 w-4 text-signal-teal-foreground\" />,\n },\n {\n id: \"REVIEW\",\n title: \"In Review\",\n icon: <Eye className=\"h-4 w-4 text-iris-violet-foreground\" />,\n },\n {\n id: \"DONE\",\n title: \"Done\",\n icon: <CheckCircle2 className=\"h-4 w-4 text-pulse-green-foreground\" />,\n },\n];\n\nexport function ProjectKanbanBoard({\n tasks = [],\n onTaskMove,\n onTaskClick,\n onAddTask,\n className,\n ...props\n}: ProjectKanbanBoardProps) {\n const getTasksByStatus = (status: KanbanColumnId) =>\n tasks.filter((t) => t.status === status);\n\n return (\n <div\n className={cn(\n \"grid grid-cols-1 gap-
|
|
1553
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n Plus,\n CheckCircle2,\n Clock,\n Eye,\n AlertCircle,\n MoreHorizontal,\n} from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Card } from \"../../components/card\";\nimport { Badge } from \"../../components/badge\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../../components/avatar\";\nimport { Button } from \"../../components/button\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuTrigger,\n} from \"../../components/dropdown-menu\";\n\nexport type KanbanColumnId = \"TODO\" | \"IN_PROGRESS\" | \"REVIEW\" | \"DONE\";\n\nexport interface KanbanTask {\n id: string;\n title: string;\n status: KanbanColumnId;\n heuristicTag?: string;\n severity?: \"CRITICAL\" | \"MEDIUM\" | \"GOOD\";\n assigneeName?: string;\n assigneeAvatar?: string;\n}\n\nexport interface ProjectKanbanBoardProps\n extends React.HTMLAttributes<HTMLDivElement> {\n tasks?: KanbanTask[];\n onTaskMove?: (taskId: string, targetStatus: KanbanColumnId) => void;\n onTaskClick?: (task: KanbanTask) => void;\n onAddTask?: (status: KanbanColumnId) => void;\n}\n\nconst COLUMNS: Array<{\n id: KanbanColumnId;\n title: string;\n icon: React.ReactNode;\n}> = [\n {\n id: \"TODO\",\n title: \"To Do\",\n icon: <AlertCircle className=\"h-4 w-4 text-muted-foreground\" />,\n },\n {\n id: \"IN_PROGRESS\",\n title: \"In Progress\",\n icon: <Clock className=\"h-4 w-4 text-signal-teal-foreground\" />,\n },\n {\n id: \"REVIEW\",\n title: \"In Review\",\n icon: <Eye className=\"h-4 w-4 text-iris-violet-foreground\" />,\n },\n {\n id: \"DONE\",\n title: \"Done\",\n icon: <CheckCircle2 className=\"h-4 w-4 text-pulse-green-foreground\" />,\n },\n];\n\nexport function ProjectKanbanBoard({\n tasks = [],\n onTaskMove,\n onTaskClick,\n onAddTask,\n className,\n ...props\n}: ProjectKanbanBoardProps) {\n const getTasksByStatus = (status: KanbanColumnId) =>\n tasks.filter((t) => t.status === status);\n\n return (\n <div\n className={cn(\n \"grid grid-cols-1 gap-4 md:grid-cols-4 md:gap-5 w-full\",\n className\n )}\n {...props}\n >\n {COLUMNS.map((column) => {\n const columnTasks = getTasksByStatus(column.id);\n\n return (\n <section\n key={column.id}\n aria-label={column.title}\n className=\"flex min-h-0 flex-col rounded-lg border border-border bg-surface-raised p-4 md:h-full md:min-h-[480px]\"\n >\n <div className=\"flex items-center justify-between gap-2 pb-3.5 border-b border-border\">\n <div className=\"flex items-center gap-2.5\">\n {column.icon}\n <span className=\"text-xs font-semibold text-foreground\">\n {column.title}\n </span>\n <Badge\n variant=\"neutral\"\n className=\"h-5 px-2 text-[11px] font-mono text-muted-foreground border-border tabular-nums\"\n >\n {columnTasks.length}\n </Badge>\n </div>\n\n {onAddTask && (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-7 w-7 text-muted-foreground hover:text-foreground\"\n onClick={() => onAddTask(column.id)}\n aria-label={`Add task to ${column.title}`}\n >\n <Plus className=\"h-3.5 w-3.5\" />\n </Button>\n )}\n </div>\n\n <div className=\"flex flex-col gap-3.5 pt-4 md:flex-1 md:overflow-y-auto\">\n {columnTasks.length === 0 && (\n <p className=\"rounded-md border border-dashed border-border/70 px-4 py-8 text-center text-xs text-muted-foreground\">\n No tasks in this column.\n </p>\n )}\n\n {columnTasks.map((task) => (\n <Card\n key={task.id}\n className=\"p-4 border border-border bg-card hover:border-hairline-strong transition-colors\"\n >\n <div className=\"flex items-center justify-between gap-2 mb-3\">\n {task.heuristicTag && (\n <Badge\n variant=\"neutral\"\n className=\"font-mono text-[10px] px-1.5 py-0 border-border\"\n >\n {task.heuristicTag}\n </Badge>\n )}\n {task.severity && (\n <Badge\n variant={\n task.severity === \"CRITICAL\"\n ? \"coral-red\"\n : task.severity === \"GOOD\"\n ? \"pulse-green\"\n : \"signal-teal\"\n }\n className=\"text-[10px] px-1.5 py-0\"\n >\n {task.severity}\n </Badge>\n )}\n </div>\n\n {onTaskClick ? (\n <button\n type=\"button\"\n onClick={() => onTaskClick(task)}\n aria-label={`Open task ${task.title}`}\n className=\"block w-full rounded-sm text-left text-xs font-medium text-card-foreground leading-snug line-clamp-2 mb-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card\"\n >\n {task.title}\n </button>\n ) : (\n <p className=\"text-xs font-medium text-card-foreground leading-snug line-clamp-2 mb-3\">\n {task.title}\n </p>\n )}\n\n <div className=\"flex items-center justify-between text-xs text-muted-foreground pt-2.5 border-t border-border/50\">\n <span className=\"text-[10px] font-mono text-muted-foreground\">\n #{task.id}\n </span>\n <div className=\"flex items-center gap-1.5\">\n {task.assigneeName && (\n <>\n <span className=\"text-[10px] truncate max-w-[80px] text-muted-foreground\">\n {task.assigneeName}\n </span>\n <Avatar className=\"h-4 w-4 border border-border\">\n {task.assigneeAvatar && (\n <AvatarImage src={task.assigneeAvatar} />\n )}\n <AvatarFallback className=\"text-[8px] bg-muted text-foreground\">\n {task.assigneeName.slice(0, 2).toUpperCase()}\n </AvatarFallback>\n </Avatar>\n </>\n )}\n {onTaskMove && (\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-6 w-6 text-muted-foreground hover:text-foreground\"\n aria-label={`Move task ${task.title}`}\n >\n <MoreHorizontal className=\"h-3.5 w-3.5\" />\n </Button>\n }\n />\n <DropdownMenuContent align=\"end\">\n <DropdownMenuGroup>\n <DropdownMenuLabel>Move to</DropdownMenuLabel>\n {COLUMNS.filter(\n (target) => target.id !== task.status\n ).map((target) => (\n <DropdownMenuItem\n key={target.id}\n onClick={() =>\n onTaskMove(task.id, target.id)\n }\n >\n {target.title}\n </DropdownMenuItem>\n ))}\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n </div>\n </Card>\n ))}\n </div>\n </section>\n );\n })}\n </div>\n );\n}\n"
|
|
1501
1554
|
}
|
|
1502
1555
|
]
|
|
1503
1556
|
},
|
|
@@ -1506,7 +1559,7 @@
|
|
|
1506
1559
|
"type": "registry:ui",
|
|
1507
1560
|
"title": "Radio Group",
|
|
1508
1561
|
"description": "Accessible Radio Group primitive component built with Base UI and Tailwind v4.",
|
|
1509
|
-
"license": "
|
|
1562
|
+
"license": "MIT",
|
|
1510
1563
|
"dependencies": [
|
|
1511
1564
|
"@base-ui/react"
|
|
1512
1565
|
],
|
|
@@ -1535,7 +1588,7 @@
|
|
|
1535
1588
|
"type": "registry:ui",
|
|
1536
1589
|
"title": "Rating",
|
|
1537
1590
|
"description": "Accessible Rating primitive component built with Base UI and Tailwind v4.",
|
|
1538
|
-
"license": "
|
|
1591
|
+
"license": "MIT",
|
|
1539
1592
|
"dependencies": [
|
|
1540
1593
|
"lucide-react"
|
|
1541
1594
|
],
|
|
@@ -1564,7 +1617,7 @@
|
|
|
1564
1617
|
"type": "registry:ui",
|
|
1565
1618
|
"title": "Resizable",
|
|
1566
1619
|
"description": "Accessible Resizable primitive component built with Base UI and Tailwind v4.",
|
|
1567
|
-
"license": "
|
|
1620
|
+
"license": "MIT",
|
|
1568
1621
|
"dependencies": [
|
|
1569
1622
|
"lucide-react",
|
|
1570
1623
|
"react-resizable-panels"
|
|
@@ -1590,12 +1643,42 @@
|
|
|
1590
1643
|
}
|
|
1591
1644
|
]
|
|
1592
1645
|
},
|
|
1646
|
+
{
|
|
1647
|
+
"name": "schedule-timeline-board",
|
|
1648
|
+
"type": "registry:block",
|
|
1649
|
+
"title": "Schedule Timeline Board Block",
|
|
1650
|
+
"description": "Composed Schedule Timeline Board block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
1651
|
+
"license": "MIT",
|
|
1652
|
+
"dependencies": [
|
|
1653
|
+
"lucide-react"
|
|
1654
|
+
],
|
|
1655
|
+
"devDependencies": [],
|
|
1656
|
+
"registryDependencies": [
|
|
1657
|
+
"button",
|
|
1658
|
+
"utils"
|
|
1659
|
+
],
|
|
1660
|
+
"dependencyVersions": {
|
|
1661
|
+
"lucide-react": "^1.25.0"
|
|
1662
|
+
},
|
|
1663
|
+
"files": [
|
|
1664
|
+
{
|
|
1665
|
+
"path": "blocks/schedule-timeline-board/index.ts",
|
|
1666
|
+
"type": "registry:block",
|
|
1667
|
+
"content": "export * from \"./schedule-timeline-board\";\n"
|
|
1668
|
+
},
|
|
1669
|
+
{
|
|
1670
|
+
"path": "blocks/schedule-timeline-board/schedule-timeline-board.tsx",
|
|
1671
|
+
"type": "registry:block",
|
|
1672
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n Check,\n ChevronLeft,\n ChevronRight,\n MessageSquare,\n Plus,\n SlidersHorizontal,\n X,\n} from \"lucide-react\";\nimport { Button } from \"../../components/button\";\nimport { cn } from \"../../lib/utils\";\n\nexport type ScheduleEventStatus =\n | \"confirmed\"\n | \"in-progress\"\n | \"completed\"\n | \"attention\";\n\nexport interface ScheduleResource {\n id: string;\n name: string;\n meta: string;\n initials: string;\n}\n\nexport interface ScheduleEventItem {\n id: string;\n resourceId: string;\n title: string;\n subtitle: string;\n owner: string;\n timeRange: string;\n /** 0-based start column across the hours grid. */\n startCol: number;\n /** Number of columns the event spans. */\n spanCols: number;\n status: ScheduleEventStatus;\n verification?: string;\n note?: string;\n}\n\nexport interface ScheduleTimelineBoardProps {\n title?: string;\n subtitle?: string;\n dateLabel?: string;\n hours?: string[];\n currentTimeHour?: string;\n currentTimeLabel?: string;\n /** Horizontal offset (0..100) for the live time indicator across the hour columns. */\n currentTimePercent?: number;\n coverageNotice?: string;\n resources: ScheduleResource[];\n events: ScheduleEventItem[];\n defaultSelectedEventId?: string | null;\n primaryActionLabel?: string;\n onPrimaryAction?: () => void;\n openDetailLabel?: string;\n onOpenDetail?: (event: ScheduleEventItem) => void;\n secondaryDetailLabel?: string;\n onSecondaryDetail?: (event: ScheduleEventItem) => void;\n footerSummary?: string;\n footerHint?: string;\n className?: string;\n}\n\nconst DEFAULT_HOURS = [\n \"7 AM\",\n \"8 AM\",\n \"9 AM\",\n \"10 AM\",\n \"11 AM\",\n \"12 PM\",\n \"1 PM\",\n \"2 PM\",\n \"3 PM\",\n \"4 PM\",\n \"5 PM\",\n \"6 PM\",\n];\n\nexport function ScheduleTimelineBoard({\n title = \"Schedule\",\n subtitle = \"Monday, Oct 5 · 48 reviews · 14 coordinators active\",\n dateLabel = \"Today\",\n hours = DEFAULT_HOURS,\n currentTimeHour = \"1 PM\",\n currentTimeLabel = \"1:38\",\n currentTimePercent = 54.16,\n coverageNotice = \"All covered · 48 of 48 reviews assigned\",\n resources,\n events,\n defaultSelectedEventId,\n primaryActionLabel = \"New review\",\n onPrimaryAction,\n openDetailLabel = \"Open audit\",\n onOpenDetail,\n secondaryDetailLabel = \"Finding\",\n onSecondaryDetail,\n footerSummary,\n footerHint = \"Select any schedule block to inspect details\",\n className,\n}: ScheduleTimelineBoardProps) {\n const [rangeMode, setRangeMode] = React.useState<\"day\" | \"week\">(\"day\");\n const [groupMode, setGroupMode] = React.useState<\"reviewers\" | \"projects\">(\n \"reviewers\"\n );\n const [selectedEventId, setSelectedEventId] = React.useState<string | null>(\n defaultSelectedEventId !== undefined\n ? defaultSelectedEventId\n : (events[1]?.id ?? events[0]?.id ?? null)\n );\n\n const selectedEvent = React.useMemo(\n () => events.find((item) => item.id === selectedEventId) ?? null,\n [events, selectedEventId]\n );\n\n if (resources.length === 0) {\n return (\n <div\n className={cn(\n \"flex w-full flex-col items-center justify-center rounded-xl border border-dashed border-border bg-secondary/30 px-8 py-16 text-center\",\n className\n )}\n >\n <p className=\"m-0 text-sm font-medium text-foreground\">\n No scheduled coordinators yet\n </p>\n <p className=\"m-0 mt-2 max-w-sm text-xs text-muted-foreground\">\n Assign coordinators or review windows to populate the timeline board.\n </p>\n {onPrimaryAction && (\n <Button size=\"sm\" onClick={onPrimaryAction} className=\"mt-5 gap-1.5\">\n <Plus className=\"h-3.5 w-3.5\" />\n <span>{primaryActionLabel}</span>\n </Button>\n )}\n </div>\n );\n }\n\n const colCount = hours.length;\n\n return (\n <div className={cn(\"@container flex w-full flex-col gap-6\", className)}>\n {/* Header & Operational Controls */}\n <div className=\"flex flex-wrap items-center justify-between gap-4\">\n <div className=\"flex flex-col gap-1\">\n <h3 className=\"m-0 text-xl font-semibold tracking-tight text-foreground\">\n {title}\n </h3>\n <p className=\"m-0 text-sm text-muted-foreground tabular-nums\">\n {subtitle}\n </p>\n </div>\n\n <div className=\"flex flex-wrap items-center gap-2.5\">\n {/* Date stepper */}\n <div className=\"inline-flex items-center rounded-md border border-border bg-card text-xs\">\n <button\n type=\"button\"\n aria-label=\"Previous period\"\n className=\"px-2.5 py-2 text-muted-foreground transition-colors duration-150 hover:text-foreground cursor-pointer\"\n >\n <ChevronLeft className=\"h-3.5 w-3.5\" />\n </button>\n <span className=\"border-x border-border px-3 py-2 font-medium text-foreground\">\n {dateLabel}\n </span>\n <button\n type=\"button\"\n aria-label=\"Next period\"\n className=\"px-2.5 py-2 text-muted-foreground transition-colors duration-150 hover:text-foreground cursor-pointer\"\n >\n <ChevronRight className=\"h-3.5 w-3.5\" />\n </button>\n </div>\n\n {/* Day / Week segmented control */}\n <div\n role=\"group\"\n aria-label=\"Time range\"\n className=\"inline-flex rounded-md border border-border bg-secondary p-1 text-xs\"\n >\n {([\"day\", \"week\"] as const).map((mode) => (\n <button\n key={mode}\n type=\"button\"\n aria-pressed={rangeMode === mode}\n onClick={() => setRangeMode(mode)}\n className={cn(\n \"rounded-sm px-3 py-1 font-medium capitalize transition-colors duration-150 cursor-pointer\",\n rangeMode === mode\n ? \"bg-card text-foreground shadow-xs\"\n : \"text-muted-foreground hover:text-foreground\"\n )}\n >\n {mode}\n </button>\n ))}\n </div>\n\n {/* Reviewers / Projects segmented control */}\n <div\n role=\"group\"\n aria-label=\"Grouping\"\n className=\"hidden rounded-md border border-border bg-secondary p-1 text-xs @[48rem]:inline-flex\"\n >\n {([\"reviewers\", \"projects\"] as const).map((group) => (\n <button\n key={group}\n type=\"button\"\n aria-pressed={groupMode === group}\n onClick={() => setGroupMode(group)}\n className={cn(\n \"rounded-sm px-3 py-1 font-medium capitalize transition-colors duration-150 cursor-pointer\",\n groupMode === group\n ? \"bg-card text-foreground shadow-xs\"\n : \"text-muted-foreground hover:text-foreground\"\n )}\n >\n {group}\n </button>\n ))}\n </div>\n\n <span className=\"hidden items-center gap-2 rounded-md border border-border bg-card px-3 py-2 text-xs text-muted-foreground @[60rem]:inline-flex\">\n <SlidersHorizontal className=\"h-3.5 w-3.5\" />\n <span>All areas</span>\n </span>\n\n <Button\n size=\"sm\"\n onClick={onPrimaryAction}\n className=\"gap-1.5 px-4 text-xs\"\n >\n <Plus className=\"h-3.5 w-3.5\" />\n <span>{primaryActionLabel}</span>\n </Button>\n </div>\n </div>\n\n {/* Coverage Status Bar & Legend */}\n {coverageNotice && (\n <div className=\"flex flex-wrap items-center justify-between gap-4 rounded-lg border border-pulse-green/30 bg-pulse-green/10 px-5 py-3 text-xs\">\n <span className=\"flex items-center gap-2.5 font-medium text-pulse-green-foreground\">\n <Check className=\"h-4 w-4 shrink-0\" />\n <span>{coverageNotice}</span>\n </span>\n <div className=\"flex flex-wrap items-center gap-5 text-xs text-muted-foreground\">\n <span className=\"flex items-center gap-2\">\n <span className=\"h-2.5 w-2.5 rounded-xs border border-border bg-secondary\" />\n Confirmed\n </span>\n <span className=\"flex items-center gap-2\">\n <span className=\"h-2.5 w-2.5 rounded-xs bg-primary\" />\n In progress\n </span>\n <span className=\"flex items-center gap-2\">\n <span className=\"h-2.5 w-2.5 rounded-xs border border-coral-red/50 bg-coral-red/15\" />\n Needs attention\n </span>\n </div>\n </div>\n )}\n\n {/* Timeline Grid Canvas */}\n <div className=\"overflow-x-auto rounded-xl border border-border bg-card\">\n <div className=\"min-w-[740px]\">\n {/* Column Header */}\n <div\n className=\"grid border-b border-border bg-secondary/40 text-xs text-muted-foreground\"\n style={{\n gridTemplateColumns: `184px repeat(${colCount}, minmax(0, 1fr))`,\n }}\n >\n <div className=\"border-r border-border px-4 py-3 font-medium\">\n {groupMode === \"reviewers\" ? \"Coordinator\" : \"Project\"}\n </div>\n {hours.map((hour) => (\n <div\n key={hour}\n className=\"relative border-r border-border/40 px-1.5 py-3 text-center font-mono text-[11px] tabular-nums last:border-r-0\"\n >\n {hour === currentTimeHour ? (\n <span className=\"rounded-sm bg-primary px-1.5 py-0.5 font-semibold text-primary-foreground\">\n {currentTimeLabel}\n </span>\n ) : (\n hour\n )}\n </div>\n ))}\n </div>\n\n {/* Resource Rows */}\n <div className=\"relative divide-y divide-border/70\">\n {/* Live Time Indicator Line */}\n <div\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute bottom-0 top-0 z-10 w-px bg-primary/55\"\n style={{\n left: `calc(184px + (100% - 184px) * ${currentTimePercent / 100})`,\n }}\n />\n\n {resources.map((resource) => {\n const rowEvents = events.filter(\n (event) => event.resourceId === resource.id\n );\n\n return (\n <div\n key={resource.id}\n className=\"grid items-center\"\n style={{\n gridTemplateColumns: `184px minmax(0, 1fr)`,\n }}\n >\n {/* Coordinator Cell */}\n <div className=\"flex items-center gap-3 border-r border-border px-4 py-3.5\">\n <span className=\"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-border bg-secondary text-[11px] font-semibold text-foreground\">\n {resource.initials}\n </span>\n <div className=\"flex min-w-0 flex-col gap-0.5\">\n <div className=\"truncate text-xs font-medium text-foreground\">\n {resource.name}\n </div>\n <div className=\"truncate text-[11px] text-muted-foreground tabular-nums\">\n {resource.meta}\n </div>\n </div>\n </div>\n\n {/* Time Track */}\n <div\n className=\"relative grid px-1.5 py-2.5\"\n style={{\n gridTemplateColumns: `repeat(${colCount}, minmax(0, 1fr))`,\n }}\n >\n {rowEvents.map((event) => {\n const isSelected = selectedEvent?.id === event.id;\n const toneClasses =\n event.status === \"in-progress\"\n ? \"border-primary bg-primary text-primary-foreground\"\n : event.status === \"attention\"\n ? \"border-dashed border-coral-red/50 bg-coral-red/10 text-coral-red-foreground\"\n : event.status === \"completed\"\n ? \"border-foreground/45 bg-secondary text-foreground\"\n : \"border-border bg-secondary/75 text-foreground hover:border-hairline-strong\";\n\n return (\n <button\n key={event.id}\n type=\"button\"\n aria-pressed={isSelected}\n onClick={() =>\n setSelectedEventId((curr) =>\n curr === event.id ? null : event.id\n )\n }\n style={{\n gridColumn: `${event.startCol + 1} / span ${event.spanCols}`,\n }}\n className={cn(\n \"mx-1 flex flex-col gap-0.5 rounded-lg border px-2.5 py-2 text-left transition-colors duration-150 cursor-pointer\",\n toneClasses,\n isSelected &&\n \"ring-2 ring-ring ring-offset-2 ring-offset-card\"\n )}\n >\n <span className=\"truncate text-xs font-medium leading-snug\">\n {event.title}\n </span>\n <span className=\"truncate font-mono text-[11px] opacity-80 tabular-nums\">\n {event.timeRange.split(\" to \")[0]}\n </span>\n </button>\n );\n })}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n\n {/* Selected Block Inspector Panel (container-responsive, zero overlap at any width) */}\n {selectedEvent && (\n <div\n role=\"region\"\n aria-label={`Selected schedule item: ${selectedEvent.title}`}\n className=\"rounded-xl border border-border bg-popover p-6 text-popover-foreground shadow-(--shadow-md)\"\n >\n <div className=\"flex flex-col gap-5 @[64rem]:flex-row @[64rem]:items-center @[64rem]:justify-between\">\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"flex items-start gap-3.5\">\n <span className=\"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary text-xs font-semibold text-foreground\">\n {selectedEvent.title.slice(0, 2).toUpperCase()}\n </span>\n <div className=\"flex min-w-0 flex-col gap-1\">\n <div className=\"flex flex-wrap items-center gap-2.5\">\n <span className=\"text-sm font-semibold text-popover-foreground\">\n {selectedEvent.title}\n </span>\n <span className=\"inline-flex items-center gap-1.5 rounded-full border border-border bg-secondary px-2.5 py-0.5 text-[11px] font-medium text-foreground capitalize\">\n <span className=\"h-1.5 w-1.5 rounded-full bg-primary\" />\n {selectedEvent.status.replace(\"-\", \" \")}\n </span>\n </div>\n <p className=\"m-0 text-xs text-muted-foreground\">\n {selectedEvent.subtitle}\n </p>\n </div>\n </div>\n\n <button\n type=\"button\"\n aria-label=\"Close inspector\"\n onClick={() => setSelectedEventId(null)}\n className=\"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-border bg-card text-muted-foreground transition-colors duration-150 hover:text-foreground cursor-pointer @[64rem]:hidden\"\n >\n <X className=\"h-3.5 w-3.5\" />\n </button>\n </div>\n\n <div className=\"grid flex-1 grid-cols-1 gap-4 border-y border-border/70 py-4 text-xs @[34rem]:grid-cols-3 @[64rem]:border-y-0 @[64rem]:border-x @[64rem]:px-6 @[64rem]:py-0\">\n <div className=\"flex min-w-0 flex-col gap-1\">\n <div className=\"text-muted-foreground\">Window</div>\n <div className=\"font-medium text-popover-foreground tabular-nums\">\n {selectedEvent.timeRange}\n </div>\n </div>\n <div className=\"flex min-w-0 flex-col gap-1\">\n <div className=\"text-muted-foreground\">Owner</div>\n <div className=\"truncate font-medium text-popover-foreground\">\n {selectedEvent.owner}\n </div>\n </div>\n <div className=\"flex min-w-0 flex-col gap-1\">\n <div className=\"text-muted-foreground\">Verification</div>\n <div className=\"truncate font-medium text-pulse-green-foreground\">\n {selectedEvent.verification ?? selectedEvent.note ?? \"Synced\"}\n </div>\n </div>\n </div>\n\n <div className=\"flex shrink-0 flex-wrap items-center gap-2.5\">\n <Button\n size=\"sm\"\n onClick={() => onOpenDetail?.(selectedEvent)}\n className=\"px-4 text-xs\"\n >\n {openDetailLabel} ›\n </Button>\n {onSecondaryDetail && (\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() => onSecondaryDetail(selectedEvent)}\n className=\"gap-1.5 px-3.5 text-xs\"\n >\n <MessageSquare className=\"h-3.5 w-3.5\" />\n <span>{secondaryDetailLabel}</span>\n </Button>\n )}\n <button\n type=\"button\"\n aria-label=\"Close inspector\"\n onClick={() => setSelectedEventId(null)}\n className=\"hidden h-8 w-8 items-center justify-center rounded-md border border-border bg-card text-muted-foreground transition-colors duration-150 hover:text-foreground cursor-pointer @[64rem]:inline-flex\"\n >\n <X className=\"h-3.5 w-3.5\" />\n </button>\n </div>\n </div>\n </div>\n )}\n\n {/* Footer Meta */}\n <div className=\"flex flex-wrap items-center justify-between gap-3 text-xs text-muted-foreground\">\n <span>\n {footerSummary ??\n `Showing ${resources.length} coordinators · ${events.length} scheduled blocks`}\n </span>\n <span>{footerHint}</span>\n </div>\n </div>\n );\n}\n"
|
|
1673
|
+
}
|
|
1674
|
+
]
|
|
1675
|
+
},
|
|
1593
1676
|
{
|
|
1594
1677
|
"name": "scroll-area",
|
|
1595
1678
|
"type": "registry:ui",
|
|
1596
1679
|
"title": "Scroll Area",
|
|
1597
1680
|
"description": "Accessible Scroll Area primitive component built with Base UI and Tailwind v4.",
|
|
1598
|
-
"license": "
|
|
1681
|
+
"license": "MIT",
|
|
1599
1682
|
"dependencies": [
|
|
1600
1683
|
"@base-ui/react"
|
|
1601
1684
|
],
|
|
@@ -1624,7 +1707,7 @@
|
|
|
1624
1707
|
"type": "registry:ui",
|
|
1625
1708
|
"title": "Select",
|
|
1626
1709
|
"description": "Accessible Select primitive component built with Base UI and Tailwind v4.",
|
|
1627
|
-
"license": "
|
|
1710
|
+
"license": "MIT",
|
|
1628
1711
|
"dependencies": [
|
|
1629
1712
|
"@base-ui/react",
|
|
1630
1713
|
"lucide-react"
|
|
@@ -1646,7 +1729,7 @@
|
|
|
1646
1729
|
{
|
|
1647
1730
|
"path": "components/select/select.tsx",
|
|
1648
1731
|
"type": "registry:ui",
|
|
1649
|
-
"content": "import * as React from \"react\";\nimport { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { Check, ChevronDown } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport const Select = BaseSelect.Root;\nexport const SelectValue = BaseSelect.Value;\nexport const SelectPortal = BaseSelect.Portal;\n\nexport const SelectTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof BaseSelect.Trigger>\n>(({ className, children, ...props }, ref) => (\n <BaseSelect.Trigger\n ref={ref}\n className={cn(\n \"flex h-9 w-full items-center justify-between rounded-md border border-input bg-
|
|
1732
|
+
"content": "import * as React from \"react\";\nimport { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { Check, ChevronDown } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport const Select = BaseSelect.Root;\nexport const SelectValue = BaseSelect.Value;\nexport const SelectPortal = BaseSelect.Portal;\n\nexport const SelectTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof BaseSelect.Trigger>\n>(({ className, children, ...props }, ref) => (\n <BaseSelect.Trigger\n ref={ref}\n data-slot=\"select-trigger\"\n className={cn(\n \"box-border flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-field px-3.5 py-2 text-sm text-foreground ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1\",\n className\n )}\n {...props}\n >\n {children}\n <BaseSelect.Icon>\n <ChevronDown className=\"h-4 w-4 opacity-50 shrink-0\" />\n </BaseSelect.Icon>\n </BaseSelect.Trigger>\n));\nSelectTrigger.displayName = \"SelectTrigger\";\n\nexport const SelectContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseSelect.Popup> & {\n align?: \"start\" | \"center\" | \"end\";\n sideOffset?: number;\n }\n>(({ className, align = \"start\", sideOffset = 4, ...props }, ref) => (\n <SelectPortal>\n <BaseSelect.Positioner align={align} sideOffset={sideOffset}>\n <BaseSelect.Popup\n ref={ref}\n className={cn(\n // `w-[var(--anchor-width)]` tracks the trigger width exactly: the\n // Base UI v1.6.0 positioner writes `--anchor-width` inline on the\n // floating element (utils/useAnchorPositioning), and the popup\n // inherits it. Same mechanism Combobox uses.\n \"relative z-50 w-[var(--anchor-width)] min-w-[8rem] overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-(--shadow-xl) outline-none data-open:animate-overlay-in data-closed:animate-overlay-out p-1.5\",\n className\n )}\n {...props}\n />\n </BaseSelect.Positioner>\n </SelectPortal>\n));\nSelectContent.displayName = \"SelectContent\";\n\nexport const SelectGroup = BaseSelect.Group;\n\nexport const SelectLabel = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseSelect.GroupLabel>\n>(({ className, ...props }, ref) => (\n <BaseSelect.GroupLabel\n ref={ref}\n className={cn(\"px-3 py-2 text-xs font-medium text-muted-foreground\", className)}\n {...props}\n />\n));\nSelectLabel.displayName = \"SelectLabel\";\n\nexport const SelectItem = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseSelect.Item>\n>(({ className, children, ...props }, ref) => (\n <BaseSelect.Item\n ref={ref}\n className={cn(\n \"relative flex w-full cursor-pointer select-none items-center justify-between gap-2 rounded-sm px-3 py-2 text-xs outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[selected]:font-semibold\",\n className\n )}\n {...props}\n >\n <BaseSelect.ItemText>{children}</BaseSelect.ItemText>\n <BaseSelect.ItemIndicator>\n <Check className=\"h-3.5 w-3.5 text-primary shrink-0 ml-2\" />\n </BaseSelect.ItemIndicator>\n </BaseSelect.Item>\n));\nSelectItem.displayName = \"SelectItem\";\n"
|
|
1650
1733
|
}
|
|
1651
1734
|
]
|
|
1652
1735
|
},
|
|
@@ -1655,7 +1738,7 @@
|
|
|
1655
1738
|
"type": "registry:ui",
|
|
1656
1739
|
"title": "Separator",
|
|
1657
1740
|
"description": "Accessible Separator primitive component built with Base UI and Tailwind v4.",
|
|
1658
|
-
"license": "
|
|
1741
|
+
"license": "MIT",
|
|
1659
1742
|
"dependencies": [
|
|
1660
1743
|
"@base-ui/react"
|
|
1661
1744
|
],
|
|
@@ -1675,7 +1758,7 @@
|
|
|
1675
1758
|
{
|
|
1676
1759
|
"path": "components/separator/separator.tsx",
|
|
1677
1760
|
"type": "registry:ui",
|
|
1678
|
-
"content": "import * as React from \"react\";\nimport { Separator as BaseSeparator } from \"@base-ui/react/separator\";\nimport { cn } from \"../../lib/utils\";\n\nexport const Separator = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseSeparator>\n>(\n (\n { className, orientation = \"horizontal\", ...props },\n ref\n ) => (\n <BaseSeparator\n ref={ref}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-
|
|
1761
|
+
"content": "import * as React from \"react\";\nimport { Separator as BaseSeparator } from \"@base-ui/react/separator\";\nimport { cn } from \"../../lib/utils\";\n\nexport const Separator = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseSeparator>\n>(\n (\n { className, orientation = \"horizontal\", ...props },\n ref\n ) => (\n <BaseSeparator\n ref={ref}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className\n )}\n {...props}\n />\n )\n);\nSeparator.displayName = \"Separator\";\n"
|
|
1679
1762
|
}
|
|
1680
1763
|
]
|
|
1681
1764
|
},
|
|
@@ -1684,7 +1767,7 @@
|
|
|
1684
1767
|
"type": "registry:ui",
|
|
1685
1768
|
"title": "Sheet",
|
|
1686
1769
|
"description": "Accessible Sheet primitive component built with Base UI and Tailwind v4.",
|
|
1687
|
-
"license": "
|
|
1770
|
+
"license": "MIT",
|
|
1688
1771
|
"dependencies": [
|
|
1689
1772
|
"@base-ui/react",
|
|
1690
1773
|
"class-variance-authority",
|
|
@@ -1708,7 +1791,7 @@
|
|
|
1708
1791
|
{
|
|
1709
1792
|
"path": "components/sheet/sheet.tsx",
|
|
1710
1793
|
"type": "registry:ui",
|
|
1711
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { X } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nconst Sheet = BaseDialog.Root;\nconst SheetTrigger = BaseDialog.Trigger;\nconst SheetClose = BaseDialog.Close;\n\nconst sheetVariants = cva(\n \"fixed z-50 gap-
|
|
1794
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { X } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nconst Sheet = BaseDialog.Root;\nconst SheetTrigger = BaseDialog.Trigger;\nconst SheetClose = BaseDialog.Close;\n\nconst sheetVariants = cva(\n \"fixed z-50 gap-5 overflow-y-auto overscroll-contain bg-popover px-7 py-6 shadow-(--shadow-xl) transition ease-in-out border-border text-popover-foreground backdrop-blur-md\",\n {\n variants: {\n side: {\n top: \"inset-x-0 top-0 max-h-[calc(100dvh-2rem)] border-b\",\n bottom: \"inset-x-0 bottom-0 max-h-[calc(100dvh-2rem)] border-t rounded-t-lg\",\n left: \"inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm\",\n right: \"inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm\",\n },\n },\n defaultVariants: {\n side: \"right\",\n },\n }\n);\n\ninterface SheetContentProps\n extends React.ComponentPropsWithoutRef<typeof BaseDialog.Popup>,\n VariantProps<typeof sheetVariants> {\n closeLabel?: string;\n}\n\nconst SheetContent = React.forwardRef<\n React.ElementRef<typeof BaseDialog.Popup>,\n SheetContentProps\n>(({ side = \"right\", className, children, closeLabel = \"Close\", ...props }, ref) => (\n <BaseDialog.Portal>\n <BaseDialog.Backdrop className=\"fixed inset-0 z-50 bg-void/80 backdrop-blur-md transition-opacity duration-200\" />\n <BaseDialog.Popup\n ref={ref}\n data-slot=\"sheet-content\"\n className={cn(sheetVariants({ side }), className)}\n {...props}\n >\n {children}\n <BaseDialog.Close aria-label={closeLabel} className=\"absolute right-3 top-3 inline-flex h-8 w-8 items-center justify-center rounded-md opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 text-muted-foreground hover:text-foreground\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">{closeLabel}</span>\n </BaseDialog.Close>\n </BaseDialog.Popup>\n </BaseDialog.Portal>\n));\nSheetContent.displayName = \"SheetContent\";\n\nconst SheetHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col space-y-2 text-center sm:text-left mb-5\",\n className\n )}\n {...props}\n />\n);\nSheetHeader.displayName = \"SheetHeader\";\n\nconst SheetFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse gap-2 pt-2 sm:flex-row sm:justify-end sm:gap-3 mt-6\",\n className\n )}\n {...props}\n />\n);\nSheetFooter.displayName = \"SheetFooter\";\n\nconst SheetTitle = React.forwardRef<\n React.ElementRef<typeof BaseDialog.Title>,\n React.ComponentPropsWithoutRef<typeof BaseDialog.Title>\n>(({ className, ...props }, ref) => (\n <BaseDialog.Title\n ref={ref}\n className={cn(\"text-lg font-semibold text-popover-foreground\", className)}\n {...props}\n />\n));\nSheetTitle.displayName = \"SheetTitle\";\n\nconst SheetDescription = React.forwardRef<\n React.ElementRef<typeof BaseDialog.Description>,\n React.ComponentPropsWithoutRef<typeof BaseDialog.Description>\n>(({ className, ...props }, ref) => (\n <BaseDialog.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground leading-relaxed\", className)}\n {...props}\n />\n));\nSheetDescription.displayName = \"SheetDescription\";\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n"
|
|
1712
1795
|
}
|
|
1713
1796
|
]
|
|
1714
1797
|
},
|
|
@@ -1717,7 +1800,7 @@
|
|
|
1717
1800
|
"type": "registry:ui",
|
|
1718
1801
|
"title": "Sidebar",
|
|
1719
1802
|
"description": "Accessible Sidebar primitive component built with Base UI and Tailwind v4.",
|
|
1720
|
-
"license": "
|
|
1803
|
+
"license": "MIT",
|
|
1721
1804
|
"dependencies": [
|
|
1722
1805
|
"class-variance-authority",
|
|
1723
1806
|
"lucide-react"
|
|
@@ -1750,7 +1833,7 @@
|
|
|
1750
1833
|
"type": "registry:ui",
|
|
1751
1834
|
"title": "Skeleton",
|
|
1752
1835
|
"description": "Accessible Skeleton primitive component built with Base UI and Tailwind v4.",
|
|
1753
|
-
"license": "
|
|
1836
|
+
"license": "MIT",
|
|
1754
1837
|
"dependencies": [],
|
|
1755
1838
|
"devDependencies": [],
|
|
1756
1839
|
"registryDependencies": [
|
|
@@ -1775,7 +1858,7 @@
|
|
|
1775
1858
|
"type": "registry:ui",
|
|
1776
1859
|
"title": "Slider",
|
|
1777
1860
|
"description": "Accessible Slider primitive component built with Base UI and Tailwind v4.",
|
|
1778
|
-
"license": "
|
|
1861
|
+
"license": "MIT",
|
|
1779
1862
|
"dependencies": [
|
|
1780
1863
|
"@base-ui/react"
|
|
1781
1864
|
],
|
|
@@ -1804,7 +1887,7 @@
|
|
|
1804
1887
|
"type": "registry:ui",
|
|
1805
1888
|
"title": "Sonner",
|
|
1806
1889
|
"description": "Accessible Sonner primitive component built with Base UI and Tailwind v4.",
|
|
1807
|
-
"license": "
|
|
1890
|
+
"license": "MIT",
|
|
1808
1891
|
"dependencies": [
|
|
1809
1892
|
"sonner"
|
|
1810
1893
|
],
|
|
@@ -1831,7 +1914,7 @@
|
|
|
1831
1914
|
"type": "registry:ui",
|
|
1832
1915
|
"title": "Spinner",
|
|
1833
1916
|
"description": "Accessible Spinner primitive component built with Base UI and Tailwind v4.",
|
|
1834
|
-
"license": "
|
|
1917
|
+
"license": "MIT",
|
|
1835
1918
|
"dependencies": [
|
|
1836
1919
|
"class-variance-authority",
|
|
1837
1920
|
"lucide-react"
|
|
@@ -1862,7 +1945,7 @@
|
|
|
1862
1945
|
"type": "registry:block",
|
|
1863
1946
|
"title": "Stats Card Grid Block",
|
|
1864
1947
|
"description": "Composed Stats Card Grid block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
1865
|
-
"license": "
|
|
1948
|
+
"license": "MIT",
|
|
1866
1949
|
"dependencies": [],
|
|
1867
1950
|
"devDependencies": [],
|
|
1868
1951
|
"registryDependencies": [
|
|
@@ -1880,7 +1963,7 @@
|
|
|
1880
1963
|
{
|
|
1881
1964
|
"path": "blocks/stats-card-grid/stats-card-grid.tsx",
|
|
1882
1965
|
"type": "registry:block",
|
|
1883
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n Card,\n CardHeader,\n CardTitle,\n CardContent,\n} from \"../../components/card\";\nimport { Badge } from \"../../components/badge\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface StatItem {\n id: string;\n title: string;\n value: string | number;\n change?: string;\n trend?: \"up\" | \"down\" | \"neutral\";\n description?: string;\n icon?: React.ReactNode;\n}\n\nexport interface StatsCardGridProps {\n stats: StatItem[];\n columns?: 2 | 3 | 4;\n className?: string;\n}\n\nexport function StatsCardGrid({\n stats,\n columns = 3,\n className,\n}: StatsCardGridProps) {\n const gridColsClass =\n columns === 2\n ? \"grid-cols-1 md:grid-cols-2\"\n : columns === 4\n ? \"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4\"\n : \"grid-cols-1 md:grid-cols-3\";\n\n if (stats.length === 0) {\n return (\n <div\n className={cn(\n \"flex w-full flex-col items-center justify-center rounded-
|
|
1966
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n Card,\n CardHeader,\n CardTitle,\n CardContent,\n} from \"../../components/card\";\nimport { Badge } from \"../../components/badge\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface StatItem {\n id: string;\n title: string;\n value: string | number;\n change?: string;\n trend?: \"up\" | \"down\" | \"neutral\";\n description?: string;\n icon?: React.ReactNode;\n /** Renders the metric on an inverted high-contrast Graphite faceplate. */\n highlighted?: boolean;\n}\n\nexport interface StatsCardGridProps {\n stats: StatItem[];\n columns?: 2 | 3 | 4;\n className?: string;\n}\n\nexport function StatsCardGrid({\n stats,\n columns = 3,\n className,\n}: StatsCardGridProps) {\n const gridColsClass =\n columns === 2\n ? \"grid-cols-1 md:grid-cols-2\"\n : columns === 4\n ? \"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4\"\n : \"grid-cols-1 md:grid-cols-3\";\n\n if (stats.length === 0) {\n return (\n <div\n className={cn(\n \"flex w-full flex-col items-center justify-center rounded-lg border border-dashed border-border bg-secondary/40 px-8 py-12 text-center\",\n className\n )}\n >\n <p className=\"text-sm font-medium text-foreground\">\n No metrics available\n </p>\n <p className=\"mt-2 text-xs text-muted-foreground\">\n Stats will appear once evaluation activity is recorded.\n </p>\n </div>\n );\n }\n\n return (\n <div className={cn(\"grid gap-5 w-full\", gridColsClass, className)}>\n {stats.map((stat) => (\n <Card\n key={stat.id}\n variant={stat.highlighted ? \"inverted\" : \"default\"}\n className=\"relative overflow-hidden\"\n >\n <CardHeader className=\"flex flex-row items-center justify-between gap-3 space-y-0 px-6 pt-6 pb-3\">\n <CardTitle\n className={cn(\n \"text-xs font-medium\",\n stat.highlighted ? \"text-background/75\" : \"text-muted-foreground\"\n )}\n >\n {stat.title}\n </CardTitle>\n {stat.icon && (\n <div\n className={cn(\n \"h-4 w-4 shrink-0\",\n stat.highlighted ? \"text-background/75\" : \"text-muted-foreground\"\n )}\n >\n {stat.icon}\n </div>\n )}\n </CardHeader>\n <CardContent className=\"space-y-2.5 px-6 pb-6 pt-0\">\n <div\n className={cn(\n \"text-2xl font-semibold tracking-tight font-mono tabular-nums\",\n stat.highlighted ? \"text-background\" : \"text-foreground\"\n )}\n >\n {stat.value}\n </div>\n {(stat.change || stat.description) && (\n <div\n className={cn(\n \"flex flex-wrap items-center gap-2.5 text-xs\",\n stat.highlighted ? \"text-background/75\" : \"text-muted-foreground\"\n )}\n >\n {stat.change && (\n <Badge\n variant={\n stat.trend === \"up\"\n ? \"default\"\n : stat.trend === \"down\"\n ? \"destructive\"\n : \"secondary\"\n }\n className=\"text-label px-1.5 py-0.5 font-mono\"\n >\n {stat.change}\n </Badge>\n )}\n {stat.description && <span>{stat.description}</span>}\n </div>\n )}\n </CardContent>\n </Card>\n ))}\n </div>\n );\n}\n"
|
|
1884
1967
|
}
|
|
1885
1968
|
]
|
|
1886
1969
|
},
|
|
@@ -1889,7 +1972,7 @@
|
|
|
1889
1972
|
"type": "registry:ui",
|
|
1890
1973
|
"title": "Stepper",
|
|
1891
1974
|
"description": "Accessible Stepper primitive component built with Base UI and Tailwind v4.",
|
|
1892
|
-
"license": "
|
|
1975
|
+
"license": "MIT",
|
|
1893
1976
|
"dependencies": [
|
|
1894
1977
|
"class-variance-authority",
|
|
1895
1978
|
"lucide-react"
|
|
@@ -1920,7 +2003,7 @@
|
|
|
1920
2003
|
"type": "registry:ui",
|
|
1921
2004
|
"title": "Switch",
|
|
1922
2005
|
"description": "Accessible Switch primitive component built with Base UI and Tailwind v4.",
|
|
1923
|
-
"license": "
|
|
2006
|
+
"license": "MIT",
|
|
1924
2007
|
"dependencies": [
|
|
1925
2008
|
"@base-ui/react"
|
|
1926
2009
|
],
|
|
@@ -1940,7 +2023,7 @@
|
|
|
1940
2023
|
{
|
|
1941
2024
|
"path": "components/switch/switch.tsx",
|
|
1942
2025
|
"type": "registry:ui",
|
|
1943
|
-
"content": "import * as React from \"react\";\nimport { Switch as BaseSwitch } from \"@base-ui/react/switch\";\nimport { cn } from \"../../lib/utils\";\n\nexport type SwitchProps = React.ComponentPropsWithoutRef<typeof BaseSwitch.Root>;\n\nexport const Switch = React.forwardRef<HTMLButtonElement, SwitchProps>(\n ({ className, ...props }, ref) => (\n <BaseSwitch.Root\n className={cn(\n \"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-[background-color,border-color,box-shadow,transform] duration-200 ease-out active:scale-[0.96] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 bg-input data-[checked]:bg-primary data-[unchecked]:bg-input\",\n className\n )}\n {...props}\n ref={ref}\n >\n <BaseSwitch.Thumb\n className={cn(\n \"pointer-events-none block h-4 w-4 rounded-full bg-
|
|
2026
|
+
"content": "import * as React from \"react\";\nimport { Switch as BaseSwitch } from \"@base-ui/react/switch\";\nimport { cn } from \"../../lib/utils\";\n\nexport type SwitchProps = React.ComponentPropsWithoutRef<typeof BaseSwitch.Root>;\n\nexport const Switch = React.forwardRef<HTMLButtonElement, SwitchProps>(\n ({ className, ...props }, ref) => (\n <BaseSwitch.Root\n className={cn(\n \"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-[background-color,border-color,box-shadow,transform] duration-200 ease-out active:scale-[0.96] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 bg-input data-[checked]:bg-primary data-[unchecked]:bg-input\",\n className\n )}\n {...props}\n ref={ref}\n >\n <BaseSwitch.Thumb\n className={cn(\n \"pointer-events-none block h-4 w-4 rounded-full bg-paper shadow-sm ring-0 transition-[transform,background-color] duration-200 ease-out data-[checked]:translate-x-4 data-[unchecked]:translate-x-0\"\n )}\n />\n </BaseSwitch.Root>\n )\n);\n\nSwitch.displayName = \"Switch\";\n"
|
|
1944
2027
|
}
|
|
1945
2028
|
]
|
|
1946
2029
|
},
|
|
@@ -1949,7 +2032,7 @@
|
|
|
1949
2032
|
"type": "registry:ui",
|
|
1950
2033
|
"title": "Table",
|
|
1951
2034
|
"description": "Accessible Table primitive component built with Base UI and Tailwind v4.",
|
|
1952
|
-
"license": "
|
|
2035
|
+
"license": "MIT",
|
|
1953
2036
|
"dependencies": [],
|
|
1954
2037
|
"devDependencies": [],
|
|
1955
2038
|
"registryDependencies": [
|
|
@@ -1965,7 +2048,7 @@
|
|
|
1965
2048
|
{
|
|
1966
2049
|
"path": "components/table/table.tsx",
|
|
1967
2050
|
"type": "registry:ui",
|
|
1968
|
-
"content": "import * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nconst Table = React.forwardRef<\n HTMLTableElement,\n React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n <div className=\"relative w-full overflow-auto\">\n <table\n ref={ref}\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n </div>\n));\nTable.displayName = \"Table\";\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead ref={ref} className={cn(\"[&_tr]:border-b border-border\", className)} {...props} />\n));\nTableHeader.displayName = \"TableHeader\";\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n));\nTableBody.displayName = \"TableBody\";\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n className={cn(\n \"border-t border-border bg-muted/50 font-medium [&>tr]:last:border-b-0\",\n className\n )}\n {...props}\n />\n));\nTableFooter.displayName = \"TableFooter\";\n\nconst TableRow = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={cn(\n \"border-b border-border transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted\",\n className\n )}\n {...props}\n />\n));\nTableRow.displayName = \"TableRow\";\n\nconst TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th\n ref={ref}\n scope=\"col\"\n className={cn(\n \"h-
|
|
2051
|
+
"content": "import * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nconst Table = React.forwardRef<\n HTMLTableElement,\n React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n <div className=\"relative w-full overflow-auto\">\n <table\n ref={ref}\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n </div>\n));\nTable.displayName = \"Table\";\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead ref={ref} className={cn(\"[&_tr]:border-b border-border\", className)} {...props} />\n));\nTableHeader.displayName = \"TableHeader\";\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n));\nTableBody.displayName = \"TableBody\";\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n className={cn(\n \"border-t border-border bg-muted/50 font-medium [&>tr]:last:border-b-0\",\n className\n )}\n {...props}\n />\n));\nTableFooter.displayName = \"TableFooter\";\n\nconst TableRow = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={cn(\n \"border-b border-border transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted\",\n className\n )}\n {...props}\n />\n));\nTableRow.displayName = \"TableRow\";\n\nconst TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th\n ref={ref}\n scope=\"col\"\n className={cn(\n \"h-11 px-4 py-3 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0\",\n className\n )}\n {...props}\n />\n));\nTableHead.displayName = \"TableHead\";\n\nconst TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\n \"px-4 py-3.5 align-middle text-foreground [&:has([role=checkbox])]:pr-0\",\n className\n )}\n {...props}\n />\n));\nTableCell.displayName = \"TableCell\";\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption\n ref={ref}\n className={cn(\"mt-4 text-xs text-muted-foreground\", className)}\n {...props}\n />\n));\nTableCaption.displayName = \"TableCaption\";\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n};\n"
|
|
1969
2052
|
}
|
|
1970
2053
|
]
|
|
1971
2054
|
},
|
|
@@ -1974,7 +2057,7 @@
|
|
|
1974
2057
|
"type": "registry:ui",
|
|
1975
2058
|
"title": "Tabs",
|
|
1976
2059
|
"description": "Accessible Tabs primitive component built with Base UI and Tailwind v4.",
|
|
1977
|
-
"license": "
|
|
2060
|
+
"license": "MIT",
|
|
1978
2061
|
"dependencies": [
|
|
1979
2062
|
"@base-ui/react"
|
|
1980
2063
|
],
|
|
@@ -1994,7 +2077,7 @@
|
|
|
1994
2077
|
{
|
|
1995
2078
|
"path": "components/tabs/tabs.tsx",
|
|
1996
2079
|
"type": "registry:ui",
|
|
1997
|
-
"content": "import * as React from \"react\";\nimport { Tabs as BaseTabs } from \"@base-ui/react/tabs\";\nimport { cn } from \"../../lib/utils\";\n\nexport const Tabs = BaseTabs.Root;\n\nexport const TabsList = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseTabs.List>\n>(({ className, ...props }, ref) => (\n <BaseTabs.List\n ref={ref}\n className={cn(\n // Single underline idiom: one hairline rail the triggers sit on.\n \"flex flex-wrap items-center gap-1 border-b border-border\",\n className\n )}\n {...props}\n />\n));\nTabsList.displayName = \"TabsList\";\n\nexport const TabsTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof BaseTabs.Tab>\n>(({ className, ...props }, ref) => (\n <BaseTabs.Tab\n ref={ref}\n className={cn(\n // The selected idiom is only the 2px primary underline hanging over the\n // list rail (-mb-px); no pill fill, no shadow. The trigger carries a\n // transparent 2px bottom border at rest so the rail never shifts.\n // impeccable-disable-next-line border-accent-on-rounded: state-conditional selected-tab underline indicator, not a card border\n \"relative inline-flex h-
|
|
2080
|
+
"content": "import * as React from \"react\";\nimport { Tabs as BaseTabs } from \"@base-ui/react/tabs\";\nimport { cn } from \"../../lib/utils\";\n\nexport const Tabs = BaseTabs.Root;\n\nexport const TabsList = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseTabs.List>\n>(({ className, ...props }, ref) => (\n <BaseTabs.List\n ref={ref}\n data-slot=\"tabs-list\"\n className={cn(\n // Single underline idiom: one hairline rail the triggers sit on.\n \"flex flex-wrap items-center gap-1 sm:gap-2 border-b border-border\",\n className\n )}\n {...props}\n />\n));\nTabsList.displayName = \"TabsList\";\n\nexport const TabsTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof BaseTabs.Tab>\n>(({ className, ...props }, ref) => (\n <BaseTabs.Tab\n ref={ref}\n data-slot=\"tabs-trigger\"\n className={cn(\n // The selected idiom is only the 2px primary underline hanging over the\n // list rail (-mb-px); no pill fill, no shadow. The trigger carries a\n // transparent 2px bottom border at rest so the rail never shifts.\n // impeccable-disable-next-line border-accent-on-rounded: state-conditional selected-tab underline indicator, not a card border\n \"relative inline-flex h-9 items-center px-3.5 py-2 text-[13px] text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 border-b-2 border-transparent data-active:text-foreground data-active:border-primary -mb-px\",\n className\n )}\n {...props}\n />\n));\nTabsTrigger.displayName = \"TabsTrigger\";\n\nexport const TabsContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseTabs.Panel>\n>(({ className, ...props }, ref) => (\n <BaseTabs.Panel\n ref={ref}\n data-slot=\"tabs-content\"\n className={cn(\n \"mt-4 ring-offset-background focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\",\n className\n )}\n {...props}\n />\n));\nTabsContent.displayName = \"TabsContent\";\n"
|
|
1998
2081
|
}
|
|
1999
2082
|
]
|
|
2000
2083
|
},
|
|
@@ -2003,7 +2086,7 @@
|
|
|
2003
2086
|
"type": "registry:block",
|
|
2004
2087
|
"title": "Team Members Table Block",
|
|
2005
2088
|
"description": "Composed Team Members Table block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
2006
|
-
"license": "
|
|
2089
|
+
"license": "MIT",
|
|
2007
2090
|
"dependencies": [
|
|
2008
2091
|
"lucide-react"
|
|
2009
2092
|
],
|
|
@@ -2028,7 +2111,7 @@
|
|
|
2028
2111
|
{
|
|
2029
2112
|
"path": "blocks/team-members-table/team-members-table.tsx",
|
|
2030
2113
|
"type": "registry:block",
|
|
2031
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { UserPlus, Trash2 } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n CardDescription,\n} from \"../../components/card\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../../components/avatar\";\nimport { Badge } from \"../../components/badge\";\nimport { Button } from \"../../components/button\";\nimport {\n Table,\n TableHeader,\n TableBody,\n TableRow,\n TableHead,\n TableCell,\n} from \"../../components/table\";\n\nexport type ProjectRole = \"owner\" | \"moderator\" | \"evaluator\" | \"viewer\";\n\nexport interface TeamMember {\n id: string;\n name: string;\n email: string;\n role: ProjectRole;\n avatarUrl?: string;\n joinedAt?: string;\n}\n\nexport interface TeamMembersTableProps\n extends React.HTMLAttributes<HTMLDivElement> {\n members?: TeamMember[];\n onRoleChange?: (memberId: string, newRole: ProjectRole) => void;\n onRemoveMember?: (memberId: string) => void;\n onInviteMember?: () => void;\n}\n\nexport function TeamMembersTable({\n members = [],\n onRoleChange,\n onRemoveMember,\n onInviteMember,\n className,\n ...props\n}: TeamMembersTableProps) {\n return (\n <Card\n className={cn(\n \"w-full min-w-0 border border-border
|
|
2114
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { UserPlus, Trash2 } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n CardDescription,\n} from \"../../components/card\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../../components/avatar\";\nimport { Badge } from \"../../components/badge\";\nimport { Button } from \"../../components/button\";\nimport {\n Table,\n TableHeader,\n TableBody,\n TableRow,\n TableHead,\n TableCell,\n} from \"../../components/table\";\n\nexport type ProjectRole = \"owner\" | \"moderator\" | \"evaluator\" | \"viewer\";\n\nexport interface TeamMember {\n id: string;\n name: string;\n email: string;\n role: ProjectRole;\n avatarUrl?: string;\n joinedAt?: string;\n}\n\nexport interface TeamMembersTableProps\n extends React.HTMLAttributes<HTMLDivElement> {\n members?: TeamMember[];\n onRoleChange?: (memberId: string, newRole: ProjectRole) => void;\n onRemoveMember?: (memberId: string) => void;\n onInviteMember?: () => void;\n}\n\nexport function TeamMembersTable({\n members = [],\n onRoleChange,\n onRemoveMember,\n onInviteMember,\n className,\n ...props\n}: TeamMembersTableProps) {\n return (\n <Card\n className={cn(\n \"w-full min-w-0 border border-border overflow-hidden\",\n className\n )}\n {...props}\n >\n <CardHeader className=\"flex flex-row flex-wrap items-center justify-between gap-x-6 gap-y-3 px-6 py-5 border-b border-border/60\">\n <div className=\"min-w-0 space-y-1\">\n <CardTitle className=\"text-base font-semibold\">\n Project Team Members\n </CardTitle>\n <CardDescription className=\"text-xs text-muted-foreground\">\n Manage who has access and evaluate permissions in this project.\n </CardDescription>\n </div>\n\n {onInviteMember && (\n <Button\n size=\"sm\"\n onClick={onInviteMember}\n className=\"gap-2 text-xs\"\n >\n <UserPlus className=\"h-3.5 w-3.5\" />\n <span>Invite Member</span>\n </Button>\n )}\n </CardHeader>\n\n <CardContent className=\"p-0\">\n <Table aria-label=\"Project team members\">\n <TableHeader>\n <TableRow>\n <TableHead className=\"w-[300px]\">Member</TableHead>\n <TableHead>Role</TableHead>\n <TableHead>Joined</TableHead>\n <TableHead className=\"text-right\">Actions</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {members.length === 0 ? (\n <TableRow>\n <TableCell\n colSpan={4}\n className=\"text-center text-xs text-muted-foreground py-10\"\n >\n No members found in this project.\n </TableCell>\n </TableRow>\n ) : (\n members.map((member) => (\n <TableRow key={member.id}>\n <TableCell className=\"font-medium\">\n <div className=\"flex items-center gap-3\">\n <Avatar className=\"h-8 w-8\">\n {member.avatarUrl && (\n <AvatarImage src={member.avatarUrl} alt={member.name} />\n )}\n <AvatarFallback>\n {member.name.slice(0, 2).toUpperCase()}\n </AvatarFallback>\n </Avatar>\n <div className=\"flex flex-col\">\n <span className=\"text-xs font-semibold text-foreground\">\n {member.name}\n </span>\n <span className=\"text-[11px] text-muted-foreground font-mono\">\n {member.email}\n </span>\n </div>\n </div>\n </TableCell>\n\n <TableCell>\n {member.role === \"owner\" ? (\n <Badge\n variant=\"default\"\n className=\"text-[11px] capitalize font-medium\"\n >\n Owner\n </Badge>\n ) : (\n <select\n aria-label={`Change role for ${member.name}`}\n value={member.role}\n onChange={(e) =>\n onRoleChange?.(\n member.id,\n e.target.value as ProjectRole\n )\n }\n className=\"rounded-md border border-border bg-popover text-popover-foreground px-2.5 py-1 text-xs font-medium focus:outline-none focus:ring-1 focus:ring-ring\"\n >\n <option value=\"moderator\">Moderator</option>\n <option value=\"evaluator\">Evaluator</option>\n <option value=\"viewer\">Viewer</option>\n </select>\n )}\n </TableCell>\n\n <TableCell className=\"text-xs text-muted-foreground font-mono\">\n {member.joinedAt ?? \"Active\"}\n </TableCell>\n\n <TableCell className=\"text-right\">\n {member.role !== \"owner\" && onRemoveMember && (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => onRemoveMember(member.id)}\n className=\"h-8 w-8 text-muted-foreground hover:text-destructive\"\n aria-label={`Remove ${member.name}`}\n >\n <Trash2 className=\"h-4 w-4\" />\n </Button>\n )}\n </TableCell>\n </TableRow>\n ))\n )}\n </TableBody>\n </Table>\n </CardContent>\n </Card>\n );\n}\n"
|
|
2032
2115
|
}
|
|
2033
2116
|
]
|
|
2034
2117
|
},
|
|
@@ -2037,7 +2120,7 @@
|
|
|
2037
2120
|
"type": "registry:ui",
|
|
2038
2121
|
"title": "Textarea",
|
|
2039
2122
|
"description": "Accessible Textarea primitive component built with Base UI and Tailwind v4.",
|
|
2040
|
-
"license": "
|
|
2123
|
+
"license": "MIT",
|
|
2041
2124
|
"dependencies": [
|
|
2042
2125
|
"class-variance-authority"
|
|
2043
2126
|
],
|
|
@@ -2057,7 +2140,25 @@
|
|
|
2057
2140
|
{
|
|
2058
2141
|
"path": "components/textarea/textarea.tsx",
|
|
2059
2142
|
"type": "registry:ui",
|
|
2060
|
-
"content": "import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport const textareaVariants = cva(\n \"flex min-h-[
|
|
2143
|
+
"content": "import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport const textareaVariants = cva(\n \"box-border flex min-h-[96px] w-full rounded-md border border-input bg-field text-foreground px-3.5 py-2.5 text-sm transition-[border-color,box-shadow,background-color] duration-150 ease-out placeholder:text-fog focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive\",\n {\n variants: {\n resize: {\n none: \"resize-none\",\n vertical: \"resize-y\",\n horizontal: \"resize-x\",\n both: \"resize\",\n },\n },\n defaultVariants: {\n resize: \"vertical\",\n },\n }\n);\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n VariantProps<typeof textareaVariants> {}\n\nexport const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, resize, ...props }, ref) => {\n return (\n <textarea\n className={cn(textareaVariants({ resize, className }))}\n ref={ref}\n {...props}\n />\n );\n }\n);\n\nTextarea.displayName = \"Textarea\";\n"
|
|
2144
|
+
}
|
|
2145
|
+
]
|
|
2146
|
+
},
|
|
2147
|
+
{
|
|
2148
|
+
"name": "theme",
|
|
2149
|
+
"type": "registry:style",
|
|
2150
|
+
"title": "Theme",
|
|
2151
|
+
"description": "Usalyt Tailwind CSS v4 @theme tokens, dark/light surfaces, and motion primitives.",
|
|
2152
|
+
"license": "MIT",
|
|
2153
|
+
"dependencies": [],
|
|
2154
|
+
"devDependencies": [],
|
|
2155
|
+
"registryDependencies": [],
|
|
2156
|
+
"dependencyVersions": {},
|
|
2157
|
+
"files": [
|
|
2158
|
+
{
|
|
2159
|
+
"path": "styles/theme.css",
|
|
2160
|
+
"type": "registry:style",
|
|
2161
|
+
"content": "/* Usalyt Design System — Graphite (Anodized Chalk Light & Matte Graphite Dark).\n *\n * Dual-polarity industrial functionalism with Signal Orange functional accents\n * and WCAG AA calibrated semantic telemetry. The Linear Near-Black & Lavender-Blue\n * palette remains available via `@usalyt/cli theme apply --preset linear`.\n *\n * This file is the single source of truth for the design tokens. It is\n * imported by both public stylesheets:\n *\n * - styles/globals.css — raw Tailwind source for consumers who compile\n * their own theme (Preflight included there).\n * - styles/compiled.css — the published dist/styles.css entry, which uses\n * Tailwind theme + utilities only (no Preflight).\n */\n\n/* Berkeley Mono — Substitution Contract:\n * Berkeley Mono is a commercial typeface and is never bundled with the\n * library. The @font-face below declares it local()-only: consumers who own a\n * license get the real face; everyone else falls back to \"JetBrains Mono\"\n * (the documented substitute — install it as an OS font or self-host it),\n * then ui-monospace. No silent fallback beyond that. */\n@font-face {\n font-family: \"Berkeley Mono\";\n src: local(\"Berkeley Mono\"), local(\"Berkeley Mono Variable\");\n font-display: swap;\n}\n\n/* Class-based dark strategy: a host page's explicit `.dark` class wins over\n * the OS preference in both directions. Without this, `dark:` compiles to a\n * prefers-color-scheme media query and leaks dark palettes into light themes\n * on dark-mode machines. */\n@custom-variant dark (&:where(.dark, .dark *));\n\n@theme {\n /* Braun / Rams Canonical Anodized Chalk Light Surface Ladder (Default) */\n --color-canvas: #f4f3ef;\n --color-surface-1: #ffffff;\n --color-surface-2: #eae8e2;\n --color-surface-3: #e1dfd8;\n --color-surface-4: #ffffff;\n --color-hairline: #d8d5cd;\n --color-hairline-strong: #bfbbb1;\n --color-hairline-tertiary: #a39f94;\n\n /* Braun / Rams Ink Scale & Dark Graphite Counterpart */\n --color-ink: #121213;\n --color-ink-muted: #343330;\n --color-ink-subtle: #52514e;\n --color-ink-tertiary: #6e6c67;\n --color-inverse-canvas: #0e0e10;\n --color-inverse-surface-1: #161618;\n --color-inverse-surface-2: #1e1e21;\n --color-inverse-ink: #f2f1ed;\n\n /* Braun Signal Orange Brand & Semantic Tokens */\n --color-signal-orange: #f2541b;\n --color-primary-hover: #b03508;\n --color-primary-focus: #ea4b14;\n --color-brand-secure: #7c6f64;\n --color-semantic-success: #1e8e3e;\n\n /* Architectural Neutral Aliases (TP-7 Matte Graphite + Warm Chalk) */\n --color-void: #0e0e10;\n --color-carbon: #161618;\n --color-obsidian: #1e1e21;\n --color-graphite: #28282c;\n --color-smoke: #3a3a40;\n --color-ash: #6e6c67;\n --color-fog: #52514e;\n --color-mist: #cfcbc2;\n --color-bone: #f4f3ef;\n --color-paper: #ffffff;\n\n /* Chromatic Accent & Semantic Hue Primitives */\n --color-cobalt: #2563eb;\n --color-acid-lime: #e4f222;\n --color-amber-signal: #d97706;\n --color-pulse-green: #1e8e3e;\n --color-coral-red: #dc2626;\n --color-signal-teal: #027a9e;\n --color-iris-violet: #5e6ad2;\n --color-lavender: #7a7fad;\n\n /* Light-first Chromatic Ink Tokens — calibrated to hold >= 4.5:1 body text\n * on 10% tinted surfaces in light mode (and overridden for dark mode below).\n * Verified by WCAG calculation in packages/ui/src/test/palette-contract.test.ts. */\n --color-cobalt-foreground: color-mix(in oklab, var(--color-cobalt) 74%, var(--color-void));\n --color-amber-signal-foreground: color-mix(in oklab, var(--color-amber-signal) 50%, var(--color-void));\n --color-pulse-green-foreground: color-mix(in oklab, var(--color-pulse-green) 58%, var(--color-void));\n --color-coral-red-foreground: color-mix(in oklab, var(--color-coral-red) 66%, var(--color-void));\n --color-signal-teal-foreground: color-mix(in oklab, var(--color-signal-teal) 60%, var(--color-void));\n --color-iris-violet-foreground: color-mix(in oklab, var(--color-iris-violet) 72%, var(--color-void));\n --color-lavender-foreground: color-mix(in oklab, var(--color-lavender) 56%, var(--color-void));\n\n /* Theme-aware form field fill: subtle warm-carbon wash on light chalk,\n * overridden to a faint white lift on dark anodized graphite. */\n --color-field: rgb(18 18 19 / 0.03);\n\n /* Typography Families */\n --font-sans: \"Inter Variable\", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n --font-mono: \"Berkeley Mono\", \"JetBrains Mono\", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n --font-inter-variable: \"Inter Variable\", ui-sans-serif, system-ui, sans-serif;\n --font-berkeley-mono: \"Berkeley Mono\", \"JetBrains Mono\", ui-monospace, monospace;\n\n /* Precision Font Weight Scale (300, 400, 510, 590) */\n --font-weight-light: 300;\n --font-weight-regular: 400;\n --font-weight-w510: 510;\n --font-weight-w590: 590;\n --font-weight-medium: 510;\n --font-weight-semibold: 590;\n --font-weight-bold: 590;\n --font-weight-extrabold: 590;\n\n /* Type Scale — granular tokens */\n --leading-micro: 1.5;\n --leading-label: 1.4;\n --leading-caption: 1.2;\n --leading-body-sm: 1.6;\n --leading-body-lg: 1.33;\n --leading-subheading: 1.33;\n --leading-heading-sm: 1.13;\n --leading-heading: 1;\n --leading-heading-lg: 1;\n --leading-display: 1;\n\n --tracking-body-sm: -0.165px;\n --tracking-body-lg: -0.24px;\n --tracking-subheading: -0.288px;\n --tracking-heading-sm: -0.704px;\n --tracking-heading: -1.056px;\n --tracking-heading-lg: -1.408px;\n --tracking-display: -1.584px;\n\n /* Type Scale — composed text utilities */\n --text-micro: 10px;\n --text-micro--line-height: var(--leading-micro);\n --text-label: 12px;\n --text-label--line-height: var(--leading-label);\n --text-caption: 13px;\n --text-caption--line-height: var(--leading-caption);\n --text-body-sm: 15px;\n --text-body-sm--line-height: var(--leading-body-sm);\n --text-body-sm--letter-spacing: var(--tracking-body-sm);\n --text-body-lg: 20px;\n --text-body-lg--line-height: var(--leading-body-lg);\n --text-body-lg--letter-spacing: var(--tracking-body-lg);\n --text-subheading: 24px;\n --text-subheading--line-height: var(--leading-subheading);\n --text-subheading--letter-spacing: var(--tracking-subheading);\n --text-heading-sm: 32px;\n --text-heading-sm--line-height: var(--leading-heading-sm);\n --text-heading-sm--letter-spacing: var(--tracking-heading-sm);\n --text-heading: 48px;\n --text-heading--line-height: var(--leading-heading);\n --text-heading--letter-spacing: var(--tracking-heading);\n --text-heading-lg: 64px;\n --text-heading-lg--line-height: var(--leading-heading-lg);\n --text-heading-lg--letter-spacing: var(--tracking-heading-lg);\n --text-display: 72px;\n --text-display--line-height: var(--leading-display);\n --text-display--letter-spacing: var(--tracking-display);\n\n /* Spacing Density Anchor (Tailwind v4 base unit: 0.25rem = 100%) */\n --spacing: 0.25rem;\n\n /* Machined Braun Radii Scale — derived from --radius anchor (6px default) */\n --radius: 6px;\n --radius-xs: calc(var(--radius) * 0.5);\n --radius-sm: calc(var(--radius) * 0.75);\n --radius-md: var(--radius);\n --radius-lg: calc(var(--radius) * 1.5);\n --radius-xl: calc(var(--radius) * 2);\n --radius-xxl: calc(var(--radius) * 3);\n --radius-full: 9999px;\n\n /* Hairline-First Elevation Stack (Anodized Chalk Light Default) */\n --shadow-sm: rgba(18, 18, 19, 0.05) 0px 1px 2px 0px;\n --shadow-md: rgba(18, 18, 19, 0.07) 0px 2px 6px -1px, rgba(18, 18, 19, 0.04) 0px 1px 2px -1px;\n --shadow-subtle: rgba(18, 18, 19, 0.08) 0px 0px 0px 1px inset;\n --shadow-subtle-1: rgba(18, 18, 19, 0.08) 0px 0px 0px 1px inset;\n --shadow-subtle-2: rgba(18, 18, 19, 0.05) 0px 1px 2px 0px, rgba(18, 18, 19, 0.04) 0px 0px 0px 1px;\n --shadow-subtle-3: rgba(18, 18, 19, 0.06) 0px 1px 3px 0px, rgba(18, 18, 19, 0.04) 0px 1px 2px -1px;\n --shadow-subtle-4: rgba(255, 255, 255, 0.6) 0px 1px 0px 0px inset, rgba(18, 18, 19, 0.08) 0px 2px 6px -1px;\n --shadow-subtle-5: rgba(18, 18, 19, 0.08) 0px 0px 0px 2px;\n --shadow-inset-hairline: rgba(18, 18, 19, 0.08) 0px 0px 0px 1px inset;\n --shadow-xl: rgba(18, 18, 19, 0.12) 0px 12px 28px -4px, rgba(18, 18, 19, 0.06) 0px 2px 8px -2px;\n\n /* Semantic Color Layer — Braun Anodized Chalk Light Default */\n --color-background: var(--color-canvas);\n --color-foreground: var(--color-ink);\n --color-primary: #c83e0b;\n --color-primary-foreground: #ffffff;\n --color-secondary: var(--color-surface-2);\n --color-secondary-foreground: var(--color-ink);\n --color-muted: var(--color-surface-2);\n --color-muted-foreground: var(--color-ink-subtle);\n --color-card: var(--color-surface-1);\n --color-card-foreground: var(--color-ink);\n --color-popover: var(--color-surface-1);\n --color-popover-foreground: var(--color-ink);\n --color-accent: var(--color-surface-3);\n --color-accent-foreground: var(--color-ink);\n --color-destructive: #b91c1c;\n --color-destructive-foreground: #ffffff;\n --color-border: var(--color-hairline);\n --color-input: var(--color-hairline-strong);\n --color-ring: var(--color-primary-focus);\n\n /* Stepped Surfaces */\n --color-surface-base: var(--color-canvas);\n --color-surface-raised: var(--color-surface-1);\n --color-surface-overlay: var(--color-surface-1);\n --color-surface-inset: var(--color-surface-2);\n\n /* Sidebar Rail — Warm Matte Aluminum Tray */\n --color-sidebar: var(--color-surface-2);\n --color-sidebar-foreground: var(--color-ink);\n --color-sidebar-border: var(--color-hairline);\n --color-sidebar-ring: var(--color-primary-focus);\n --color-sidebar-accent: var(--color-surface-3);\n --color-sidebar-accent-foreground: var(--color-ink);\n}\n\n@layer base {\n :root,\n html[data-theme=\"light\"]:not(.dark) {\n --color-background: #f4f3ef;\n --color-foreground: #121213;\n --color-primary: #c83e0b;\n --color-primary-foreground: #ffffff;\n --color-primary-hover: #b03508;\n --color-primary-focus: #ea4b14;\n --color-secondary: #eae8e2;\n --color-secondary-foreground: #121213;\n --color-muted: #eae8e2;\n --color-muted-foreground: #52514e;\n --color-card: #ffffff;\n --color-card-foreground: #121213;\n --color-popover: #ffffff;\n --color-popover-foreground: #121213;\n --color-accent: #e1dfd8;\n --color-accent-foreground: #121213;\n --color-destructive: #b91c1c;\n --color-destructive-foreground: #ffffff;\n --color-border: #d8d5cd;\n --color-input: #bfbbb1;\n --color-hairline: #d8d5cd;\n --color-hairline-strong: #bfbbb1;\n --color-hairline-tertiary: #a39f94;\n --color-ring: #ea4b14;\n --color-fog: #52514e;\n\n --color-surface-base: #f4f3ef;\n --color-surface-raised: #ffffff;\n --color-surface-overlay: #ffffff;\n --color-surface-inset: #eae8e2;\n\n --color-cobalt-foreground: color-mix(in oklab, var(--color-cobalt) 74%, var(--color-void));\n --color-amber-signal-foreground: color-mix(in oklab, var(--color-amber-signal) 50%, var(--color-void));\n --color-pulse-green-foreground: color-mix(in oklab, var(--color-pulse-green) 58%, var(--color-void));\n --color-coral-red-foreground: color-mix(in oklab, var(--color-coral-red) 66%, var(--color-void));\n --color-signal-teal-foreground: color-mix(in oklab, var(--color-signal-teal) 60%, var(--color-void));\n --color-iris-violet-foreground: color-mix(in oklab, var(--color-iris-violet) 72%, var(--color-void));\n --color-lavender-foreground: color-mix(in oklab, var(--color-lavender) 56%, var(--color-void));\n\n --color-field: rgb(18 18 19 / 0.03);\n\n --color-sidebar: #eae8e2;\n --color-sidebar-foreground: #121213;\n --color-sidebar-border: #d8d5cd;\n --color-sidebar-ring: #ea4b14;\n --color-sidebar-accent: #e1dfd8;\n --color-sidebar-accent-foreground: #121213;\n\n --shadow-sm: rgba(18, 18, 19, 0.05) 0px 1px 2px 0px;\n --shadow-md: rgba(18, 18, 19, 0.07) 0px 2px 6px -1px, rgba(18, 18, 19, 0.04) 0px 1px 2px -1px;\n --shadow-subtle: rgba(18, 18, 19, 0.08) 0px 0px 0px 1px inset;\n --shadow-subtle-1: rgba(18, 18, 19, 0.08) 0px 0px 0px 1px inset;\n --shadow-subtle-2: rgba(18, 18, 19, 0.05) 0px 1px 2px 0px, rgba(18, 18, 19, 0.04) 0px 0px 0px 1px;\n --shadow-subtle-3: rgba(18, 18, 19, 0.06) 0px 1px 3px 0px, rgba(18, 18, 19, 0.04) 0px 1px 2px -1px;\n --shadow-subtle-4: rgba(255, 255, 255, 0.6) 0px 1px 0px 0px inset, rgba(18, 18, 19, 0.08) 0px 2px 6px -1px;\n --shadow-xl: rgba(18, 18, 19, 0.12) 0px 12px 28px -4px, rgba(18, 18, 19, 0.06) 0px 2px 8px -2px;\n }\n\n .dark,\n html[data-theme=\"dark\"] {\n --color-background: #0e0e10;\n --color-foreground: #f2f1ed;\n --color-primary: #f2541b;\n --color-primary-foreground: #0e0e10;\n --color-primary-hover: #ff6b35;\n --color-primary-focus: #f2541b;\n --color-secondary: #1e1e21;\n --color-secondary-foreground: #cfcbc2;\n --color-muted: #1e1e21;\n --color-muted-foreground: #96948e;\n --color-card: #161618;\n --color-card-foreground: #f2f1ed;\n --color-popover: #26262a;\n --color-popover-foreground: #f2f1ed;\n --color-accent: #26262a;\n --color-accent-foreground: #f2f1ed;\n --color-destructive: #dc2626;\n --color-destructive-foreground: #ffffff;\n --color-border: #28282c;\n --color-input: #3a3a40;\n --color-hairline: #28282c;\n --color-hairline-strong: #3a3a40;\n --color-hairline-tertiary: #4e4e56;\n --color-ring: #f2541b;\n --color-fog: #96948e;\n\n --color-surface-base: #0e0e10;\n --color-surface-raised: #161618;\n --color-surface-overlay: #26262a;\n --color-surface-inset: #1e1e21;\n\n --color-cobalt-foreground: color-mix(in oklab, var(--color-cobalt) 54%, var(--color-paper));\n --color-amber-signal-foreground: color-mix(in oklab, var(--color-amber-signal) 78%, var(--color-paper));\n --color-pulse-green-foreground: color-mix(in oklab, var(--color-pulse-green) 76%, var(--color-paper));\n --color-coral-red-foreground: color-mix(in oklab, var(--color-coral-red) 60%, var(--color-paper));\n --color-signal-teal-foreground: color-mix(in oklab, var(--color-signal-teal) 66%, var(--color-paper));\n --color-iris-violet-foreground: color-mix(in oklab, var(--color-iris-violet) 58%, var(--color-paper));\n --color-lavender-foreground: color-mix(in oklab, var(--color-lavender) 64%, var(--color-paper));\n\n --color-field: rgb(255 255 255 / 0.03);\n\n --color-sidebar: #161618;\n --color-sidebar-foreground: #f2f1ed;\n --color-sidebar-border: #28282c;\n --color-sidebar-ring: #f2541b;\n --color-sidebar-accent: #26262a;\n --color-sidebar-accent-foreground: #f2f1ed;\n\n --shadow-sm: rgba(0, 0, 0, 0.35) 0px 1px 2px 0px;\n --shadow-md: rgba(0, 0, 0, 0.45) 0px 4px 12px 0px;\n --shadow-subtle: rgba(255, 255, 255, 0.06) 0px 0px 0px 1px inset;\n --shadow-subtle-1: rgba(255, 255, 255, 0.06) 0px 0px 0px 1px inset;\n --shadow-subtle-2: rgba(0, 0, 0, 0.32) 0px 0px 0px 1px;\n --shadow-subtle-3: rgba(0, 0, 0, 0.36) 0px 2px 6px 0px;\n --shadow-subtle-4: rgba(255, 255, 255, 0.08) 0px 1px 0px 0px inset, rgba(0, 0, 0, 0.5) 0px 4px 12px 0px;\n --shadow-xl: rgba(0, 0, 0, 0.65) 0px 12px 36px 0px, rgba(255, 255, 255, 0.05) 0px 0px 0px 1px inset;\n }\n}\n\n/* Optical Tracking & Graphite Industrial Surface Patterns */\n.tracking-tight-linear {\n letter-spacing: -0.011em;\n}\n\n.tracking-display-linear {\n letter-spacing: -0.022em;\n}\n\n.bg-graphite-hatch {\n background-image: repeating-linear-gradient(\n -45deg,\n color-mix(in oklab, var(--color-foreground) 16%, transparent) 0px,\n color-mix(in oklab, var(--color-foreground) 16%, transparent) 1.5px,\n transparent 1.5px,\n transparent 5px\n );\n}\n\n.bg-graphite-dots {\n background-image: radial-gradient(\n color-mix(in oklab, var(--color-foreground) 12%, transparent) 1px,\n transparent 1px\n );\n background-size: 16px 16px;\n}\n\n/* ─── Motion Layer ─────────────────────────────────────────────────────────\n * Calibrated mechanical detent curve: 160ms enter / 120ms exit, wired to\n * Base UI data-open / data-closed and data-starting-style / data-ending-style.\n * ────────────────────────────────────────────────────────────────────────── */\n@theme {\n --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);\n --transition-duration-enter: 160ms;\n --transition-duration-exit: 120ms;\n\n --animate-overlay-in: overlay-in var(--transition-duration-enter) var(--ease-out-expo) both;\n --animate-overlay-out: overlay-out var(--transition-duration-exit) var(--ease-out-expo) both;\n\n --animate-fade-in: fade-in var(--transition-duration-enter) var(--ease-out-expo) both;\n --animate-fade-out: fade-out var(--transition-duration-exit) var(--ease-out-expo) both;\n\n @keyframes overlay-in {\n from {\n opacity: 0;\n transform: translateY(4px) scale(0.985);\n }\n }\n\n @keyframes overlay-out {\n to {\n opacity: 0;\n transform: translateY(2px) scale(0.99);\n }\n }\n\n @keyframes fade-in {\n from {\n opacity: 0;\n }\n }\n\n @keyframes fade-out {\n to {\n opacity: 0;\n }\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n :root {\n --transition-duration-enter: 0ms;\n --transition-duration-exit: 0ms;\n }\n\n *,\n *::before,\n *::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n scroll-behavior: auto !important;\n }\n}\n"
|
|
2061
2162
|
}
|
|
2062
2163
|
]
|
|
2063
2164
|
},
|
|
@@ -2066,7 +2167,7 @@
|
|
|
2066
2167
|
"type": "registry:ui",
|
|
2067
2168
|
"title": "Timeline",
|
|
2068
2169
|
"description": "Accessible Timeline primitive component built with Base UI and Tailwind v4.",
|
|
2069
|
-
"license": "
|
|
2170
|
+
"license": "MIT",
|
|
2070
2171
|
"dependencies": [],
|
|
2071
2172
|
"devDependencies": [],
|
|
2072
2173
|
"registryDependencies": [
|
|
@@ -2091,7 +2192,7 @@
|
|
|
2091
2192
|
"type": "registry:ui",
|
|
2092
2193
|
"title": "Toast",
|
|
2093
2194
|
"description": "Accessible Toast primitive component built with Base UI and Tailwind v4.",
|
|
2094
|
-
"license": "
|
|
2195
|
+
"license": "MIT",
|
|
2095
2196
|
"dependencies": [
|
|
2096
2197
|
"@base-ui/react",
|
|
2097
2198
|
"class-variance-authority",
|
|
@@ -2115,7 +2216,7 @@
|
|
|
2115
2216
|
{
|
|
2116
2217
|
"path": "components/toast/toast.tsx",
|
|
2117
2218
|
"type": "registry:ui",
|
|
2118
|
-
"content": "import * as React from \"react\";\nimport { Toast as BaseToast } from \"@base-ui/react/toast\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { X } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport const ToastProvider = BaseToast.Provider;\nexport const useToastManager = BaseToast.useToastManager;\n\nexport const ToastPortal = (props: React.ComponentProps<typeof BaseToast.Portal>) => (\n <BaseToast.Portal {...props} />\n);\nToastPortal.displayName = \"ToastPortal\";\n\nexport const ToastPositioner = BaseToast.Positioner;\n\nexport const ToastViewport = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseToast.Viewport>\n>(({ className, ...props }, ref) => (\n <BaseToast.Viewport\n ref={ref}\n className={cn(\n \"fixed right-
|
|
2219
|
+
"content": "import * as React from \"react\";\nimport { Toast as BaseToast } from \"@base-ui/react/toast\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { X } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport const ToastProvider = BaseToast.Provider;\nexport const useToastManager = BaseToast.useToastManager;\n\nexport const ToastPortal = (props: React.ComponentProps<typeof BaseToast.Portal>) => (\n <BaseToast.Portal {...props} />\n);\nToastPortal.displayName = \"ToastPortal\";\n\nexport const ToastPositioner = BaseToast.Positioner;\n\nexport const ToastViewport = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseToast.Viewport>\n>(({ className, ...props }, ref) => (\n <BaseToast.Viewport\n ref={ref}\n className={cn(\n \"fixed right-5 bottom-5 top-auto left-auto z-50 flex w-[min(calc(100vw-2rem),24rem)] flex-col items-end gap-3 outline-none\",\n className\n )}\n {...props}\n />\n));\nToastViewport.displayName = \"ToastViewport\";\n\n// Base UI retains toasts beyond `limit` as inert, promotable entries. Keep\n// them out of layout flow so retained entries cannot push the stack offscreen.\nexport const toastVariants = cva(\n \"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground px-5 py-4 shadow-subtle-2 transition-[opacity,translate,scale] duration-enter ease-out-expo data-starting-style:opacity-0 data-starting-style:translate-y-3 data-starting-style:scale-[0.97] data-ending-style:opacity-0 data-ending-style:translate-y-2 data-ending-style:scale-[0.98] data-ending-style:duration-exit data-limited:hidden\",\n {\n variants: {\n variant: {\n default: \"\",\n destructive:\n \"border-coral-red/40 bg-coral-red/10 text-coral-red-foreground\",\n success:\n \"border-pulse-green/40 bg-pulse-green/10 text-pulse-green-foreground\",\n warning:\n \"border-amber-signal/40 bg-amber-signal/10 text-amber-signal-foreground\",\n info: \"border-iris-violet/40 bg-iris-violet/10 text-iris-violet-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nexport interface ToastProps\n extends React.ComponentPropsWithoutRef<typeof BaseToast.Root>,\n VariantProps<typeof toastVariants> {}\n\nexport const Toast = React.forwardRef<HTMLDivElement, ToastProps>(\n ({ className, variant, role, \"aria-live\": ariaLive, ...props }, ref) => {\n const isDestructive = variant === \"destructive\";\n const defaultRole = isDestructive ? \"alert\" : \"status\";\n const defaultAriaLive = isDestructive ? \"assertive\" : \"polite\";\n\n return (\n <BaseToast.Root\n ref={ref}\n role={role ?? defaultRole}\n aria-live={ariaLive ?? defaultAriaLive}\n className={cn(toastVariants({ variant }), className)}\n {...props}\n />\n );\n }\n);\nToast.displayName = \"Toast\";\n\nexport const ToastContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseToast.Content>\n>(({ className, ...props }, ref) => (\n <BaseToast.Content\n ref={ref}\n className={cn(\"flex min-w-0 flex-1 flex-col gap-1.5\", className)}\n {...props}\n />\n));\nToastContent.displayName = \"ToastContent\";\n\nexport const ToastTitle = React.forwardRef<\n HTMLHeadingElement,\n React.ComponentPropsWithoutRef<typeof BaseToast.Title>\n>(({ className, ...props }, ref) => (\n <BaseToast.Title\n ref={ref}\n className={cn(\"text-sm font-semibold leading-tight\", className)}\n {...props}\n />\n));\nToastTitle.displayName = \"ToastTitle\";\n\nexport const ToastDescription = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentPropsWithoutRef<typeof BaseToast.Description>\n>(({ className, ...props }, ref) => (\n <BaseToast.Description\n ref={ref}\n className={cn(\"text-xs opacity-90 leading-relaxed\", className)}\n {...props}\n />\n));\nToastDescription.displayName = \"ToastDescription\";\n\nexport const ToastAction = BaseToast.Action;\n\nexport const ToastClose = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof BaseToast.Close> & {\n closeLabel?: string;\n }\n>(({ className, closeLabel = \"Close\", ...props }, ref) => (\n <BaseToast.Close\n ref={ref}\n data-slot=\"toast-close\"\n aria-hidden={false}\n className={cn(\n \"absolute right-2 top-2 inline-flex h-8 w-8 items-center justify-center rounded-md text-foreground/50 opacity-70 transition-opacity hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n className\n )}\n {...props}\n >\n <X className=\"h-4 w-4\" aria-hidden=\"true\" />\n <span className=\"sr-only\">{closeLabel}</span>\n </BaseToast.Close>\n));\nToastClose.displayName = \"ToastClose\";\n"
|
|
2119
2220
|
}
|
|
2120
2221
|
]
|
|
2121
2222
|
},
|
|
@@ -2124,7 +2225,7 @@
|
|
|
2124
2225
|
"type": "registry:ui",
|
|
2125
2226
|
"title": "Toggle",
|
|
2126
2227
|
"description": "Accessible Toggle primitive component built with Base UI and Tailwind v4.",
|
|
2127
|
-
"license": "
|
|
2228
|
+
"license": "MIT",
|
|
2128
2229
|
"dependencies": [
|
|
2129
2230
|
"@base-ui/react",
|
|
2130
2231
|
"class-variance-authority"
|
|
@@ -2146,7 +2247,7 @@
|
|
|
2146
2247
|
{
|
|
2147
2248
|
"path": "components/toggle/toggle.tsx",
|
|
2148
2249
|
"type": "registry:ui",
|
|
2149
|
-
"content": "import * as React from \"react\";\nimport { Toggle as BaseToggle } from \"@base-ui/react/toggle\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport const toggleVariants = cva(\n \"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-
|
|
2250
|
+
"content": "import * as React from \"react\";\nimport { Toggle as BaseToggle } from \"@base-ui/react/toggle\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport const toggleVariants = cva(\n \"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-[background-color,border-color,color,transform] duration-150 ease-out hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:scale-[0.97] data-[pressed]:bg-accent data-[pressed]:text-accent-foreground data-[pressed]:font-semibold\",\n {\n variants: {\n variant: {\n default: \"bg-transparent text-foreground/80\",\n outline: \"border border-input/80 bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground data-[pressed]:border-primary\"\n },\n size: {\n sm: \"h-8 px-2.5 min-w-8 text-xs\",\n md: \"h-9 px-3.5 min-w-9 text-sm\",\n lg: \"h-10 px-4 min-w-10 text-base\"\n }\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\"\n }\n }\n);\n\nexport interface ToggleProps\n extends React.ComponentPropsWithoutRef<typeof BaseToggle>,\n VariantProps<typeof toggleVariants> {}\n\nexport const Toggle = React.forwardRef<HTMLButtonElement, ToggleProps>(\n ({ className, variant, size, ...props }, ref) => (\n <BaseToggle\n ref={ref}\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n />\n )\n);\n\nToggle.displayName = \"Toggle\";\n"
|
|
2150
2251
|
}
|
|
2151
2252
|
]
|
|
2152
2253
|
},
|
|
@@ -2155,7 +2256,7 @@
|
|
|
2155
2256
|
"type": "registry:ui",
|
|
2156
2257
|
"title": "Toggle Group",
|
|
2157
2258
|
"description": "Accessible Toggle Group primitive component built with Base UI and Tailwind v4.",
|
|
2158
|
-
"license": "
|
|
2259
|
+
"license": "MIT",
|
|
2159
2260
|
"dependencies": [
|
|
2160
2261
|
"@base-ui/react",
|
|
2161
2262
|
"class-variance-authority"
|
|
@@ -2187,7 +2288,7 @@
|
|
|
2187
2288
|
"type": "registry:ui",
|
|
2188
2289
|
"title": "Tooltip",
|
|
2189
2290
|
"description": "Accessible Tooltip primitive component built with Base UI and Tailwind v4.",
|
|
2190
|
-
"license": "
|
|
2291
|
+
"license": "MIT",
|
|
2191
2292
|
"dependencies": [
|
|
2192
2293
|
"@base-ui/react"
|
|
2193
2294
|
],
|
|
@@ -2216,7 +2317,7 @@
|
|
|
2216
2317
|
"type": "registry:ui",
|
|
2217
2318
|
"title": "Tree View",
|
|
2218
2319
|
"description": "Accessible Tree View primitive component built with Base UI and Tailwind v4.",
|
|
2219
|
-
"license": "
|
|
2320
|
+
"license": "MIT",
|
|
2220
2321
|
"dependencies": [
|
|
2221
2322
|
"lucide-react"
|
|
2222
2323
|
],
|
|
@@ -2245,7 +2346,7 @@
|
|
|
2245
2346
|
"type": "registry:lib",
|
|
2246
2347
|
"title": "Utils",
|
|
2247
2348
|
"description": "Shared cn() class merge utility for Usalyt components.",
|
|
2248
|
-
"license": "
|
|
2349
|
+
"license": "MIT",
|
|
2249
2350
|
"dependencies": [
|
|
2250
2351
|
"clsx",
|
|
2251
2352
|
"tailwind-merge"
|