@usalyt/registry 0.0.0-stage → 0.0.1
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 +15 -0
- package/LICENSE +674 -0
- package/NOTICE +32 -0
- package/README.md +183 -2
- package/THIRD_PARTY_NOTICES.md +446 -0
- package/package.json +46 -3
- package/registry.json +2268 -0
- package/schema/registry.schema.json +172 -0
- package/scripts/build-registry.ts +177 -0
- package/src/registry-builder.ts +442 -0
package/registry.json
ADDED
|
@@ -0,0 +1,2268 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./schema/registry.schema.json",
|
|
3
|
+
"name": "usalyt",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"license": "GPL-3.0-only",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/Usalyt/ui.git",
|
|
9
|
+
"directory": "usalyt/packages/registry"
|
|
10
|
+
},
|
|
11
|
+
"dependencyLicenses": {
|
|
12
|
+
"@base-ui/react": "MIT",
|
|
13
|
+
"@fontsource-variable/inter": "OFL-1.1",
|
|
14
|
+
"@hookform/resolvers": "MIT",
|
|
15
|
+
"@tanstack/react-table": "MIT",
|
|
16
|
+
"class-variance-authority": "Apache-2.0",
|
|
17
|
+
"clsx": "MIT",
|
|
18
|
+
"cmdk": "MIT",
|
|
19
|
+
"embla-carousel-react": "MIT",
|
|
20
|
+
"input-otp": "MIT",
|
|
21
|
+
"lucide-react": "ISC",
|
|
22
|
+
"react": "MIT",
|
|
23
|
+
"react-dom": "MIT",
|
|
24
|
+
"react-hook-form": "MIT",
|
|
25
|
+
"react-resizable-panels": "MIT",
|
|
26
|
+
"sonner": "MIT",
|
|
27
|
+
"tailwind-merge": "MIT",
|
|
28
|
+
"tailwindcss": "MIT",
|
|
29
|
+
"zod": "MIT"
|
|
30
|
+
},
|
|
31
|
+
"items": [
|
|
32
|
+
{
|
|
33
|
+
"name": "accordion",
|
|
34
|
+
"type": "registry:ui",
|
|
35
|
+
"title": "Accordion",
|
|
36
|
+
"description": "Accessible Accordion primitive component built with Base UI and Tailwind v4.",
|
|
37
|
+
"license": "GPL-3.0-only",
|
|
38
|
+
"dependencies": [
|
|
39
|
+
"@base-ui/react",
|
|
40
|
+
"lucide-react"
|
|
41
|
+
],
|
|
42
|
+
"devDependencies": [],
|
|
43
|
+
"registryDependencies": [
|
|
44
|
+
"utils"
|
|
45
|
+
],
|
|
46
|
+
"dependencyVersions": {
|
|
47
|
+
"@base-ui/react": "^1.6.0",
|
|
48
|
+
"lucide-react": "^1.25.0"
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
{
|
|
52
|
+
"path": "components/accordion/accordion.tsx",
|
|
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-4 pt-0 text-muted-foreground leading-relaxed text-pretty\">{children}</div>\n </BaseAccordion.Panel>\n));\nAccordionContent.displayName = \"AccordionContent\";\n"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"path": "components/accordion/index.ts",
|
|
58
|
+
"type": "registry:ui",
|
|
59
|
+
"content": "export * from \"./accordion\";\n"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "alert",
|
|
65
|
+
"type": "registry:ui",
|
|
66
|
+
"title": "Alert",
|
|
67
|
+
"description": "Accessible Alert primitive component built with Base UI and Tailwind v4.",
|
|
68
|
+
"license": "GPL-3.0-only",
|
|
69
|
+
"dependencies": [
|
|
70
|
+
"class-variance-authority"
|
|
71
|
+
],
|
|
72
|
+
"devDependencies": [],
|
|
73
|
+
"registryDependencies": [
|
|
74
|
+
"utils"
|
|
75
|
+
],
|
|
76
|
+
"dependencyVersions": {
|
|
77
|
+
"class-variance-authority": "^0.7.1"
|
|
78
|
+
},
|
|
79
|
+
"files": [
|
|
80
|
+
{
|
|
81
|
+
"path": "components/alert/alert.tsx",
|
|
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 (DESIGN.md chromatics): success = pulse-green,\n// destructive = coral-red, warning = signal-teal — signal-teal is the\n// palette's non-danger attention hue (no amber exists in DESIGN.md).\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 \"relative w-full rounded-xl border p-4 backdrop-blur-md transition-[border-color,background-color,color] duration-200 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>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-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 role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n));\nAlert.displayName = \"Alert\";\n\nconst AlertTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\"mb-1 font-semibold leading-none tracking-tight text-balance\", className)}\n {...props}\n />\n));\nAlertTitle.displayName = \"AlertTitle\";\n\nconst AlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\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
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"path": "components/alert/index.ts",
|
|
87
|
+
"type": "registry:ui",
|
|
88
|
+
"content": "export * from \"./alert\";\n"
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "alert-dialog",
|
|
94
|
+
"type": "registry:ui",
|
|
95
|
+
"title": "Alert Dialog",
|
|
96
|
+
"description": "Accessible Alert Dialog primitive component built with Base UI and Tailwind v4.",
|
|
97
|
+
"license": "GPL-3.0-only",
|
|
98
|
+
"dependencies": [
|
|
99
|
+
"@base-ui/react"
|
|
100
|
+
],
|
|
101
|
+
"devDependencies": [],
|
|
102
|
+
"registryDependencies": [
|
|
103
|
+
"utils"
|
|
104
|
+
],
|
|
105
|
+
"dependencyVersions": {
|
|
106
|
+
"@base-ui/react": "^1.6.0"
|
|
107
|
+
},
|
|
108
|
+
"files": [
|
|
109
|
+
{
|
|
110
|
+
"path": "components/alert-dialog/alert-dialog.tsx",
|
|
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-4 overflow-y-auto overscroll-contain rounded-lg border border-border bg-popover text-popover-foreground p-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 sm:flex-row sm:justify-end\", 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
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"path": "components/alert-dialog/index.ts",
|
|
116
|
+
"type": "registry:ui",
|
|
117
|
+
"content": "export * from \"./alert-dialog\";\n"
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "app-shell-layout",
|
|
123
|
+
"type": "registry:block",
|
|
124
|
+
"title": "App Shell Layout Block",
|
|
125
|
+
"description": "Composed App Shell Layout block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
126
|
+
"license": "GPL-3.0-only",
|
|
127
|
+
"dependencies": [
|
|
128
|
+
"lucide-react"
|
|
129
|
+
],
|
|
130
|
+
"devDependencies": [],
|
|
131
|
+
"registryDependencies": [
|
|
132
|
+
"avatar",
|
|
133
|
+
"breadcrumb",
|
|
134
|
+
"button",
|
|
135
|
+
"sidebar",
|
|
136
|
+
"utils"
|
|
137
|
+
],
|
|
138
|
+
"dependencyVersions": {
|
|
139
|
+
"lucide-react": "^1.25.0"
|
|
140
|
+
},
|
|
141
|
+
"files": [
|
|
142
|
+
{
|
|
143
|
+
"path": "blocks/app-shell-layout/app-shell-layout.tsx",
|
|
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-4 py-3 bg-surface-raised\">\n <div className=\"flex items-center gap-2 font-bold text-foreground\">\n {brandLogo}\n <span className=\"text-base tracking-tight\">{brandName}</span>\n </div>\n </SidebarHeader>\n\n <SidebarContent className=\"p-3 bg-surface-raised\">\n <nav\n className=\"flex flex-col gap-1\"\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 py-2 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 p-3 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 border-b border-border px-4 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 p-6 bg-background\">{children}</main>\n </div>\n </div>\n </SidebarProvider>\n );\n}\n"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"path": "blocks/app-shell-layout/index.ts",
|
|
149
|
+
"type": "registry:block",
|
|
150
|
+
"content": "export {\n AppShellLayout,\n type AppShellLayoutProps,\n type NavItem,\n} from \"./app-shell-layout\";\n"
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "aspect-ratio",
|
|
156
|
+
"type": "registry:ui",
|
|
157
|
+
"title": "Aspect Ratio",
|
|
158
|
+
"description": "Accessible Aspect Ratio primitive component built with Base UI and Tailwind v4.",
|
|
159
|
+
"license": "GPL-3.0-only",
|
|
160
|
+
"dependencies": [],
|
|
161
|
+
"devDependencies": [],
|
|
162
|
+
"registryDependencies": [
|
|
163
|
+
"utils"
|
|
164
|
+
],
|
|
165
|
+
"dependencyVersions": {},
|
|
166
|
+
"files": [
|
|
167
|
+
{
|
|
168
|
+
"path": "components/aspect-ratio/aspect-ratio.tsx",
|
|
169
|
+
"type": "registry:ui",
|
|
170
|
+
"content": "import * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface AspectRatioProps extends React.HTMLAttributes<HTMLDivElement> {\n ratio?: number;\n asChild?: boolean;\n}\n\nexport const AspectRatio = React.forwardRef<HTMLDivElement, AspectRatioProps>(\n ({ className, ratio = 16 / 9, style, children, asChild = false, ...props }, ref) => {\n if (asChild && React.isValidElement(children)) {\n return React.cloneElement(children as React.ReactElement<any>, {\n ref,\n style: {\n aspectRatio: `${ratio}`,\n ...(children.props as any).style,\n ...style,\n },\n className: cn(\"relative w-full\", (children.props as any).className, className),\n ...props,\n });\n }\n\n return (\n <div\n ref={ref}\n style={{\n aspectRatio: `${ratio}`,\n ...style,\n }}\n className={cn(\"relative w-full overflow-hidden\", className)}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\nAspectRatio.displayName = \"AspectRatio\";\n"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"path": "components/aspect-ratio/index.ts",
|
|
174
|
+
"type": "registry:ui",
|
|
175
|
+
"content": "export { AspectRatio, type AspectRatioProps } from \"./aspect-ratio\";\n"
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "auth-form",
|
|
181
|
+
"type": "registry:block",
|
|
182
|
+
"title": "Auth Form Block",
|
|
183
|
+
"description": "Composed Auth Form block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
184
|
+
"license": "GPL-3.0-only",
|
|
185
|
+
"dependencies": [
|
|
186
|
+
"@hookform/resolvers",
|
|
187
|
+
"react-hook-form",
|
|
188
|
+
"zod"
|
|
189
|
+
],
|
|
190
|
+
"devDependencies": [],
|
|
191
|
+
"registryDependencies": [
|
|
192
|
+
"button",
|
|
193
|
+
"card",
|
|
194
|
+
"form",
|
|
195
|
+
"input",
|
|
196
|
+
"utils"
|
|
197
|
+
],
|
|
198
|
+
"dependencyVersions": {
|
|
199
|
+
"@hookform/resolvers": "^5.0.0",
|
|
200
|
+
"react-hook-form": "^7.54.2",
|
|
201
|
+
"zod": "^3.24.2"
|
|
202
|
+
},
|
|
203
|
+
"files": [
|
|
204
|
+
{
|
|
205
|
+
"path": "blocks/auth-form/auth-form.tsx",
|
|
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 shadow-xs\", className)}>\n <CardHeader className=\"space-y-1.5 pb-4\">\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-4 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-2 border-t border-border/60 pt-4\">\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
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"path": "blocks/auth-form/index.ts",
|
|
211
|
+
"type": "registry:block",
|
|
212
|
+
"content": "export * from \"./auth-form\";\n"
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"name": "avatar",
|
|
218
|
+
"type": "registry:ui",
|
|
219
|
+
"title": "Avatar",
|
|
220
|
+
"description": "Accessible Avatar primitive component built with Base UI and Tailwind v4.",
|
|
221
|
+
"license": "GPL-3.0-only",
|
|
222
|
+
"dependencies": [
|
|
223
|
+
"@base-ui/react",
|
|
224
|
+
"class-variance-authority"
|
|
225
|
+
],
|
|
226
|
+
"devDependencies": [],
|
|
227
|
+
"registryDependencies": [
|
|
228
|
+
"utils"
|
|
229
|
+
],
|
|
230
|
+
"dependencyVersions": {
|
|
231
|
+
"@base-ui/react": "^1.6.0",
|
|
232
|
+
"class-variance-authority": "^0.7.1"
|
|
233
|
+
},
|
|
234
|
+
"files": [
|
|
235
|
+
{
|
|
236
|
+
"path": "components/avatar/avatar.tsx",
|
|
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-all 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
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"path": "components/avatar/index.ts",
|
|
242
|
+
"type": "registry:ui",
|
|
243
|
+
"content": "export * from \"./avatar\";\n"
|
|
244
|
+
}
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"name": "badge",
|
|
249
|
+
"type": "registry:ui",
|
|
250
|
+
"title": "Badge",
|
|
251
|
+
"description": "Accessible Badge primitive component built with Base UI and Tailwind v4.",
|
|
252
|
+
"license": "GPL-3.0-only",
|
|
253
|
+
"dependencies": [
|
|
254
|
+
"class-variance-authority"
|
|
255
|
+
],
|
|
256
|
+
"devDependencies": [],
|
|
257
|
+
"registryDependencies": [
|
|
258
|
+
"utils"
|
|
259
|
+
],
|
|
260
|
+
"dependencyVersions": {
|
|
261
|
+
"class-variance-authority": "^0.7.1"
|
|
262
|
+
},
|
|
263
|
+
"files": [
|
|
264
|
+
{
|
|
265
|
+
"path": "components/badge/badge.tsx",
|
|
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"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"path": "components/badge/index.ts",
|
|
271
|
+
"type": "registry:ui",
|
|
272
|
+
"content": "export * from \"./badge\";\n"
|
|
273
|
+
}
|
|
274
|
+
]
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"name": "breadcrumb",
|
|
278
|
+
"type": "registry:ui",
|
|
279
|
+
"title": "Breadcrumb",
|
|
280
|
+
"description": "Accessible Breadcrumb primitive component built with Base UI and Tailwind v4.",
|
|
281
|
+
"license": "GPL-3.0-only",
|
|
282
|
+
"dependencies": [
|
|
283
|
+
"lucide-react"
|
|
284
|
+
],
|
|
285
|
+
"devDependencies": [],
|
|
286
|
+
"registryDependencies": [
|
|
287
|
+
"utils"
|
|
288
|
+
],
|
|
289
|
+
"dependencyVersions": {
|
|
290
|
+
"lucide-react": "^1.25.0"
|
|
291
|
+
},
|
|
292
|
+
"files": [
|
|
293
|
+
{
|
|
294
|
+
"path": "components/breadcrumb/breadcrumb.tsx",
|
|
295
|
+
"type": "registry:ui",
|
|
296
|
+
"content": "import * as React from \"react\";\nimport { ChevronRight, MoreHorizontal } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nconst Breadcrumb = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\">\n>(({ className, ...props }, ref) => (\n <nav\n ref={ref}\n aria-label=\"Breadcrumb\"\n className={cn(\n \"flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground tracking-tight-linear\",\n className\n )}\n {...props}\n />\n));\nBreadcrumb.displayName = \"Breadcrumb\";\n\nconst BreadcrumbList = React.forwardRef<\n HTMLOListElement,\n React.ComponentPropsWithoutRef<\"ol\">\n>(({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\"flex flex-wrap items-center gap-1.5 break-words\", className)}\n {...props}\n />\n));\nBreadcrumbList.displayName = \"BreadcrumbList\";\n\nconst BreadcrumbItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentPropsWithoutRef<\"li\">\n>(({ className, ...props }, ref) => (\n <li\n ref={ref}\n className={cn(\"inline-flex items-center gap-1.5\", className)}\n {...props}\n />\n));\nBreadcrumbItem.displayName = \"BreadcrumbItem\";\n\nconst BreadcrumbLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<\"a\">\n>(({ className, ...props }, ref) => (\n <a\n ref={ref}\n className={cn(\n \"transition-colors hover:text-foreground text-muted-foreground underline-offset-4 hover:underline\",\n className\n )}\n {...props}\n />\n));\nBreadcrumbLink.displayName = \"BreadcrumbLink\";\n\nconst BreadcrumbPage = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<\"span\">\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"font-semibold text-foreground\", className)}\n {...props}\n />\n));\nBreadcrumbPage.displayName = \"BreadcrumbPage\";\n\nconst BreadcrumbSeparator = ({\n children,\n className,\n ...props\n}: React.ComponentProps<\"li\">) => (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:w-3.5 [&>svg]:h-3.5 text-muted-foreground/60\", className)}\n {...props}\n >\n {children ?? <ChevronRight />}\n </li>\n);\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\";\n\nconst BreadcrumbEllipsis = ({\n className,\n ...props\n}: React.ComponentProps<\"span\">) => (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex h-9 w-9 items-center justify-center text-muted-foreground\", className)}\n {...props}\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n);\nBreadcrumbEllipsis.displayName = \"BreadcrumbEllipsis\";\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n};\n"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"path": "components/breadcrumb/index.ts",
|
|
300
|
+
"type": "registry:ui",
|
|
301
|
+
"content": "export * from \"./breadcrumb\";\n"
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"name": "button",
|
|
307
|
+
"type": "registry:ui",
|
|
308
|
+
"title": "Button",
|
|
309
|
+
"description": "Accessible Button primitive component built with Base UI and Tailwind v4.",
|
|
310
|
+
"license": "GPL-3.0-only",
|
|
311
|
+
"dependencies": [
|
|
312
|
+
"@base-ui/react",
|
|
313
|
+
"class-variance-authority",
|
|
314
|
+
"lucide-react"
|
|
315
|
+
],
|
|
316
|
+
"devDependencies": [],
|
|
317
|
+
"registryDependencies": [
|
|
318
|
+
"utils"
|
|
319
|
+
],
|
|
320
|
+
"dependencyVersions": {
|
|
321
|
+
"@base-ui/react": "^1.6.0",
|
|
322
|
+
"class-variance-authority": "^0.7.1",
|
|
323
|
+
"lucide-react": "^1.25.0"
|
|
324
|
+
},
|
|
325
|
+
"files": [
|
|
326
|
+
{
|
|
327
|
+
"path": "components/button/button.tsx",
|
|
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.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 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 shadow-subtle-3 hover:bg-primary/90 hover:shadow-subtle-4 tracking-[-0.011em]\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-border bg-background text-secondary-foreground hover:bg-accent hover:text-accent-foreground hover:border-ring\",\n secondary:\n \"border border-border bg-secondary text-secondary-foreground hover:bg-accent hover:border-border\",\n ghost: \"hover:bg-accent hover:text-accent-foreground text-secondary-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n pill: \"bg-paper text-void rounded-full shadow-subtle-3 hover:bg-bone font-medium\",\n },\n size: {\n sm: \"h-8 px-3 text-xs\",\n md: \"h-9 px-4\",\n lg: \"h-10 px-6 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 loading?: boolean;\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n asChild = false,\n loading = false,\n disabled,\n children,\n type = \"button\",\n ...props\n },\n ref\n ) => {\n const isDisabled = disabled || loading;\n\n return (\n <BaseButton\n ref={ref}\n type={type}\n disabled={isDisabled}\n aria-busy={loading || undefined}\n render={asChild ? undefined : <button />}\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\">Loading...</span>\n {children}\n </>\n ) : (\n children\n )}\n </BaseButton>\n );\n }\n);\n\nButton.displayName = \"Button\";\n"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"path": "components/button/index.ts",
|
|
333
|
+
"type": "registry:ui",
|
|
334
|
+
"content": "export * from \"./button\";\n"
|
|
335
|
+
}
|
|
336
|
+
]
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"name": "calendar",
|
|
340
|
+
"type": "registry:ui",
|
|
341
|
+
"title": "Calendar",
|
|
342
|
+
"description": "Accessible Calendar primitive component built with Base UI and Tailwind v4.",
|
|
343
|
+
"license": "GPL-3.0-only",
|
|
344
|
+
"dependencies": [
|
|
345
|
+
"lucide-react"
|
|
346
|
+
],
|
|
347
|
+
"devDependencies": [],
|
|
348
|
+
"registryDependencies": [
|
|
349
|
+
"button",
|
|
350
|
+
"utils"
|
|
351
|
+
],
|
|
352
|
+
"dependencyVersions": {
|
|
353
|
+
"lucide-react": "^1.25.0"
|
|
354
|
+
},
|
|
355
|
+
"files": [
|
|
356
|
+
{
|
|
357
|
+
"path": "components/calendar/calendar.tsx",
|
|
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-64 p-3 bg-background border border-border rounded-xl 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-7 w-7 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-7 w-7 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-7 w-7\" />;\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-7 w-7 rounded-md text-xs font-normal transition-colors focus:outline-none focus:ring-2 focus: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
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"path": "components/calendar/index.ts",
|
|
363
|
+
"type": "registry:ui",
|
|
364
|
+
"content": "export * from \"./calendar\";\n"
|
|
365
|
+
}
|
|
366
|
+
]
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"name": "card",
|
|
370
|
+
"type": "registry:ui",
|
|
371
|
+
"title": "Card",
|
|
372
|
+
"description": "Accessible Card primitive component built with Base UI and Tailwind v4.",
|
|
373
|
+
"license": "GPL-3.0-only",
|
|
374
|
+
"dependencies": [
|
|
375
|
+
"class-variance-authority"
|
|
376
|
+
],
|
|
377
|
+
"devDependencies": [],
|
|
378
|
+
"registryDependencies": [
|
|
379
|
+
"utils"
|
|
380
|
+
],
|
|
381
|
+
"dependencyVersions": {
|
|
382
|
+
"class-variance-authority": "^0.7.1"
|
|
383
|
+
},
|
|
384
|
+
"files": [
|
|
385
|
+
{
|
|
386
|
+
"path": "components/card/card.tsx",
|
|
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/60 bg-field text-card-foreground\",\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-1.5 p-6\", 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 \"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(\"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(\"p-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 p-6 pt-0\", className)}\n {...props}\n />\n));\nCardFooter.displayName = \"CardFooter\";\n"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"path": "components/card/index.ts",
|
|
392
|
+
"type": "registry:ui",
|
|
393
|
+
"content": "export * from \"./card\";\n"
|
|
394
|
+
}
|
|
395
|
+
]
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"name": "carousel",
|
|
399
|
+
"type": "registry:ui",
|
|
400
|
+
"title": "Carousel",
|
|
401
|
+
"description": "Accessible Carousel primitive component built with Base UI and Tailwind v4.",
|
|
402
|
+
"license": "GPL-3.0-only",
|
|
403
|
+
"dependencies": [
|
|
404
|
+
"embla-carousel-react",
|
|
405
|
+
"lucide-react"
|
|
406
|
+
],
|
|
407
|
+
"devDependencies": [],
|
|
408
|
+
"registryDependencies": [
|
|
409
|
+
"button",
|
|
410
|
+
"utils"
|
|
411
|
+
],
|
|
412
|
+
"dependencyVersions": {
|
|
413
|
+
"embla-carousel-react": "^8.5.2",
|
|
414
|
+
"lucide-react": "^1.25.0"
|
|
415
|
+
},
|
|
416
|
+
"files": [
|
|
417
|
+
{
|
|
418
|
+
"path": "components/carousel/carousel.tsx",
|
|
419
|
+
"type": "registry:ui",
|
|
420
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport useEmblaCarousel, {\n type UseEmblaCarouselType,\n} from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../button\";\n\nexport type CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\nexport type CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: \"horizontal\" | \"vertical\";\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nexport function useCarousel() {\n const context = React.useContext(CarouselContext);\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n return context;\n}\n\nexport const Carousel = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & CarouselProps\n>(\n (\n {\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n },\n ref\n ) => {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n plugins\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((emblaApi: CarouselApi) => {\n if (!emblaApi) return;\n setCanScrollPrev(emblaApi.canScrollPrev());\n setCanScrollNext(emblaApi.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext]\n );\n\n React.useEffect(() => {\n if (!api || !setApi) return;\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) return;\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api,\n opts,\n orientation:\n orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n ref={ref}\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n }\n);\nCarousel.displayName = \"Carousel\";\n\nexport const CarouselContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className\n )}\n {...props}\n />\n </div>\n );\n});\nCarouselContent.displayName = \"CarouselContent\";\n\nexport const CarouselItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { orientation } = useCarousel();\n\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className\n )}\n {...props}\n />\n );\n});\nCarouselItem.displayName = \"CarouselItem\";\n\nexport const CarouselPrevious = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof Button>\n>(({ className, variant = \"outline\", size = \"icon\", ...props }, ref) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-left-12 top-1/2 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ArrowLeft className=\"h-4 w-4\" />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n});\nCarouselPrevious.displayName = \"CarouselPrevious\";\n\nexport const CarouselNext = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof Button>\n>(({ className, variant = \"outline\", size = \"icon\", ...props }, ref) => {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-right-12 top-1/2 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ArrowRight className=\"h-4 w-4\" />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n});\nCarouselNext.displayName = \"CarouselNext\";\n"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"path": "components/carousel/index.ts",
|
|
424
|
+
"type": "registry:ui",
|
|
425
|
+
"content": "export {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n useCarousel,\n type CarouselApi,\n type CarouselProps,\n} from \"./carousel\";\n"
|
|
426
|
+
}
|
|
427
|
+
]
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"name": "chart",
|
|
431
|
+
"type": "registry:ui",
|
|
432
|
+
"title": "Chart",
|
|
433
|
+
"description": "Accessible Chart primitive component built with Base UI and Tailwind v4.",
|
|
434
|
+
"license": "GPL-3.0-only",
|
|
435
|
+
"dependencies": [],
|
|
436
|
+
"devDependencies": [],
|
|
437
|
+
"registryDependencies": [
|
|
438
|
+
"utils"
|
|
439
|
+
],
|
|
440
|
+
"dependencyVersions": {},
|
|
441
|
+
"files": [
|
|
442
|
+
{
|
|
443
|
+
"path": "components/chart/chart.tsx",
|
|
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-xl 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
|
+
},
|
|
447
|
+
{
|
|
448
|
+
"path": "components/chart/index.ts",
|
|
449
|
+
"type": "registry:ui",
|
|
450
|
+
"content": "export * from \"./chart\";\n"
|
|
451
|
+
}
|
|
452
|
+
]
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"name": "checkbox",
|
|
456
|
+
"type": "registry:ui",
|
|
457
|
+
"title": "Checkbox",
|
|
458
|
+
"description": "Accessible Checkbox primitive component built with Base UI and Tailwind v4.",
|
|
459
|
+
"license": "GPL-3.0-only",
|
|
460
|
+
"dependencies": [
|
|
461
|
+
"@base-ui/react",
|
|
462
|
+
"lucide-react"
|
|
463
|
+
],
|
|
464
|
+
"devDependencies": [],
|
|
465
|
+
"registryDependencies": [
|
|
466
|
+
"utils"
|
|
467
|
+
],
|
|
468
|
+
"dependencyVersions": {
|
|
469
|
+
"@base-ui/react": "^1.6.0",
|
|
470
|
+
"lucide-react": "^1.25.0"
|
|
471
|
+
},
|
|
472
|
+
"files": [
|
|
473
|
+
{
|
|
474
|
+
"path": "components/checkbox/checkbox.tsx",
|
|
475
|
+
"type": "registry:ui",
|
|
476
|
+
"content": "import * as React from \"react\";\nimport { Checkbox as BaseCheckbox } from \"@base-ui/react/checkbox\";\nimport { Check, Minus } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface CheckboxProps\n extends React.ComponentPropsWithoutRef<typeof BaseCheckbox.Root> {\n indeterminate?: boolean;\n}\n\nexport const Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(\n ({ className, checked, indeterminate, ...props }, ref) => {\n // `checked` doubles as the indeterminate sentinel (\"indeterminate\") in the\n // public API, but it must never force itself onto the uncontrolled\n // (defaultChecked) path: forcing a computed `checked` on the root makes\n // Base UI treat the checkbox as controlled and silently resets\n // defaultChecked to false — the docs \"Checked Option\" preview rendered\n // unchecked (owner report). Only pass a controlled `checked` when the\n // caller actually supplied one.\n const isIndeterminate = Boolean(\n indeterminate || (checked as unknown) === \"indeterminate\"\n );\n const isChecked =\n checked === undefined ? undefined : Boolean(checked === true || isIndeterminate);\n\n return (\n <BaseCheckbox.Root\n ref={ref}\n {...(isChecked === undefined ? {} : { checked: isChecked })}\n indeterminate={isIndeterminate || undefined}\n {...props}\n className={cn(\n // In-system paints: neutral hairline at rest (radio-group accent\n // discipline), token fill when checked/indeterminate, no native\n // input chrome; disabled = 50%.\n \"peer h-4 w-4 shrink-0 rounded-sm border border-smoke bg-transparent text-foreground outline-none transition-colors duration-150 hover:border-fog 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 data-[checked]:bg-primary data-[checked]:border-primary data-[checked]:text-primary-foreground data-[indeterminate]:bg-primary data-[indeterminate]:border-primary data-[indeterminate]:text-primary-foreground\",\n className\n )}\n >\n <BaseCheckbox.Indicator className=\"flex items-center justify-center text-current\">\n {isIndeterminate ? (\n <Minus\n data-testid=\"checkbox-minus-icon\"\n className=\"h-3 w-3 stroke-[3]\"\n />\n ) : (\n <Check\n data-testid=\"checkbox-check-icon\"\n className=\"h-3.5 w-3.5 stroke-[3]\"\n />\n )}\n </BaseCheckbox.Indicator>\n </BaseCheckbox.Root>\n );\n }\n);\n\nCheckbox.displayName = \"Checkbox\";\n"
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"path": "components/checkbox/index.ts",
|
|
480
|
+
"type": "registry:ui",
|
|
481
|
+
"content": "export * from \"./checkbox\";\n"
|
|
482
|
+
}
|
|
483
|
+
]
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"name": "collaboration-chat-panel",
|
|
487
|
+
"type": "registry:block",
|
|
488
|
+
"title": "Collaboration Chat Panel Block",
|
|
489
|
+
"description": "Composed Collaboration Chat Panel block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
490
|
+
"license": "GPL-3.0-only",
|
|
491
|
+
"dependencies": [
|
|
492
|
+
"lucide-react"
|
|
493
|
+
],
|
|
494
|
+
"devDependencies": [],
|
|
495
|
+
"registryDependencies": [
|
|
496
|
+
"avatar",
|
|
497
|
+
"button",
|
|
498
|
+
"card",
|
|
499
|
+
"input",
|
|
500
|
+
"utils"
|
|
501
|
+
],
|
|
502
|
+
"dependencyVersions": {
|
|
503
|
+
"lucide-react": "^1.25.0"
|
|
504
|
+
},
|
|
505
|
+
"files": [
|
|
506
|
+
{
|
|
507
|
+
"path": "blocks/collaboration-chat-panel/collaboration-chat-panel.tsx",
|
|
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 shadow-xs overflow-hidden\",\n className\n )}\n {...props}\n >\n <CardHeader className=\"flex flex-row items-center justify-between py-3 px-4 border-b border-border bg-muted/40\">\n <div className=\"flex items-center gap-2\">\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-1.5 text-xs text-muted-foreground\">\n <span className=\"inline-block h-2 w-2 rounded-full bg-pulse-green animate-pulse\" />\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 p-4 space-y-4\"\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-xl px-3 py-2 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=\"p-3 border-t border-border/40 bg-background\">\n <form onSubmit={handleSend} className=\"flex w-full items-center gap-2\">\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
|
+
},
|
|
511
|
+
{
|
|
512
|
+
"path": "blocks/collaboration-chat-panel/index.ts",
|
|
513
|
+
"type": "registry:block",
|
|
514
|
+
"content": "export {\n CollaborationChatPanel,\n type CollaborationChatPanelProps,\n type ChatMessage,\n} from \"./collaboration-chat-panel\";\n"
|
|
515
|
+
}
|
|
516
|
+
]
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"name": "collapsible",
|
|
520
|
+
"type": "registry:ui",
|
|
521
|
+
"title": "Collapsible",
|
|
522
|
+
"description": "Accessible Collapsible primitive component built with Base UI and Tailwind v4.",
|
|
523
|
+
"license": "GPL-3.0-only",
|
|
524
|
+
"dependencies": [
|
|
525
|
+
"@base-ui/react"
|
|
526
|
+
],
|
|
527
|
+
"devDependencies": [],
|
|
528
|
+
"registryDependencies": [
|
|
529
|
+
"utils"
|
|
530
|
+
],
|
|
531
|
+
"dependencyVersions": {
|
|
532
|
+
"@base-ui/react": "^1.6.0"
|
|
533
|
+
},
|
|
534
|
+
"files": [
|
|
535
|
+
{
|
|
536
|
+
"path": "components/collapsible/collapsible.tsx",
|
|
537
|
+
"type": "registry:ui",
|
|
538
|
+
"content": "import * as React from \"react\";\nimport { Collapsible as BaseCollapsible } from \"@base-ui/react/collapsible\";\nimport { cn } from \"../../lib/utils\";\n\nexport const Collapsible = BaseCollapsible.Root;\nexport const CollapsibleTrigger = BaseCollapsible.Trigger;\n\nexport const CollapsibleContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseCollapsible.Panel>\n>(({ className, children, ...props }, ref) => (\n <BaseCollapsible.Panel\n ref={ref}\n className={cn(\n \"h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-enter ease-out-expo data-starting-style:h-0 data-ending-style:h-0\",\n className\n )}\n {...props}\n >\n {children}\n </BaseCollapsible.Panel>\n));\nCollapsibleContent.displayName = \"CollapsibleContent\";\n"
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
"path": "components/collapsible/index.ts",
|
|
542
|
+
"type": "registry:ui",
|
|
543
|
+
"content": "export * from \"./collapsible\";\n"
|
|
544
|
+
}
|
|
545
|
+
]
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
"name": "color-swatch",
|
|
549
|
+
"type": "registry:ui",
|
|
550
|
+
"title": "Color Swatch",
|
|
551
|
+
"description": "Accessible Color Swatch primitive component built with Base UI and Tailwind v4.",
|
|
552
|
+
"license": "GPL-3.0-only",
|
|
553
|
+
"dependencies": [
|
|
554
|
+
"class-variance-authority"
|
|
555
|
+
],
|
|
556
|
+
"devDependencies": [],
|
|
557
|
+
"registryDependencies": [
|
|
558
|
+
"utils"
|
|
559
|
+
],
|
|
560
|
+
"dependencyVersions": {
|
|
561
|
+
"class-variance-authority": "^0.7.1"
|
|
562
|
+
},
|
|
563
|
+
"files": [
|
|
564
|
+
{
|
|
565
|
+
"path": "components/color-swatch/color-swatch.tsx",
|
|
566
|
+
"type": "registry:ui",
|
|
567
|
+
"content": "import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\n/**\n * Display-only color reference: a chip painted with `color` plus the supplied\n * CSS color string as readable text. Intentionally noninteractive — no picker,\n * no copy control, no fake role and no tab stop. The adjacent value carries\n * the non-color-only information, so the chip itself is hidden from assistive\n * technology to avoid a redundant announcement.\n */\nexport const colorSwatchVariants = cva(\n \"inline-flex min-w-0 items-center align-middle\",\n {\n variants: {\n size: {\n sm: \"gap-1.5 text-[11px]\",\n md: \"gap-2 text-xs\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n }\n);\n\nconst colorSwatchChipVariants = cva(\n \"shrink-0 rounded-[3px] border border-border ring-1 ring-inset ring-foreground/10\",\n {\n variants: {\n size: {\n sm: \"size-3\",\n md: \"size-4\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n }\n);\n\nexport interface ColorSwatchProps\n extends Omit<React.HTMLAttributes<HTMLSpanElement>, \"color\">,\n VariantProps<typeof colorSwatchVariants> {\n /** Any valid CSS color string; rendered verbatim as the visible value. */\n color: string;\n}\n\nexport const ColorSwatch = React.forwardRef<HTMLSpanElement, ColorSwatchProps>(\n ({ color, size, className, ...props }, ref) => {\n const resolvedSize = size ?? \"md\";\n\n return (\n <span\n ref={ref}\n className={cn(colorSwatchVariants({ size: resolvedSize }), className)}\n {...props}\n >\n <span\n aria-hidden=\"true\"\n className={colorSwatchChipVariants({ size: resolvedSize })}\n style={{ backgroundColor: color }}\n />\n <span className=\"whitespace-nowrap font-mono text-foreground\">\n {color}\n </span>\n </span>\n );\n }\n);\n\nColorSwatch.displayName = \"ColorSwatch\";\n"
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"path": "components/color-swatch/index.ts",
|
|
571
|
+
"type": "registry:ui",
|
|
572
|
+
"content": "export {\n ColorSwatch,\n colorSwatchVariants,\n type ColorSwatchProps,\n} from \"./color-swatch\";\n"
|
|
573
|
+
}
|
|
574
|
+
]
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
"name": "combobox",
|
|
578
|
+
"type": "registry:ui",
|
|
579
|
+
"title": "Combobox",
|
|
580
|
+
"description": "Accessible Combobox primitive component built with Base UI and Tailwind v4.",
|
|
581
|
+
"license": "GPL-3.0-only",
|
|
582
|
+
"dependencies": [
|
|
583
|
+
"lucide-react"
|
|
584
|
+
],
|
|
585
|
+
"devDependencies": [],
|
|
586
|
+
"registryDependencies": [
|
|
587
|
+
"popover",
|
|
588
|
+
"utils"
|
|
589
|
+
],
|
|
590
|
+
"dependencyVersions": {
|
|
591
|
+
"lucide-react": "^1.25.0"
|
|
592
|
+
},
|
|
593
|
+
"files": [
|
|
594
|
+
{
|
|
595
|
+
"path": "components/combobox/combobox.tsx",
|
|
596
|
+
"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"
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"path": "components/combobox/index.ts",
|
|
601
|
+
"type": "registry:ui",
|
|
602
|
+
"content": "export * from \"./combobox\";\n"
|
|
603
|
+
}
|
|
604
|
+
]
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
"name": "command",
|
|
608
|
+
"type": "registry:ui",
|
|
609
|
+
"title": "Command",
|
|
610
|
+
"description": "Accessible Command primitive component built with Base UI and Tailwind v4.",
|
|
611
|
+
"license": "GPL-3.0-only",
|
|
612
|
+
"dependencies": [
|
|
613
|
+
"cmdk",
|
|
614
|
+
"lucide-react"
|
|
615
|
+
],
|
|
616
|
+
"devDependencies": [],
|
|
617
|
+
"registryDependencies": [
|
|
618
|
+
"utils"
|
|
619
|
+
],
|
|
620
|
+
"dependencyVersions": {
|
|
621
|
+
"cmdk": "^1.0.4",
|
|
622
|
+
"lucide-react": "^1.25.0"
|
|
623
|
+
},
|
|
624
|
+
"files": [
|
|
625
|
+
{
|
|
626
|
+
"path": "components/command/command.tsx",
|
|
627
|
+
"type": "registry:ui",
|
|
628
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { Search } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-(--shadow-xl)\",\n className\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex h-10 items-center gap-2 border-b border-border px-3\">\n <Search className=\"h-4 w-4 shrink-0 text-fog\" aria-hidden=\"true\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"h-10 w-full bg-transparent text-sm text-foreground outline-none placeholder:text-fog disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n />\n </div>\n));\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\n \"max-h-[320px] overflow-y-auto overflow-x-hidden p-1\",\n className\n )}\n {...props}\n />\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-caption text-muted-foreground\"\n {...props}\n />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-label [&_[cmdk-group-heading]]:font-w510 [&_[cmdk-group-heading]]:text-muted-foreground\",\n className\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex h-8 cursor-pointer select-none items-center gap-2.5 rounded-md px-2.5 text-caption text-muted-foreground outline-none transition-colors data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-foreground\",\n className\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"ml-auto font-mono text-label text-muted-foreground tracking-normal\",\n className\n )}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n\n/** Real keyboard behaviors shipped by the cmdk palette. */\nconst COMMAND_KEY_HINTS = [\n { keys: \"↑↓\", label: \"Navigate\" },\n { keys: \"↵\", label: \"Select\" },\n { keys: \"esc\", label: \"Close\" },\n] as const;\n\nconst CommandFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"flex h-8 items-center justify-end gap-3 border-t border-border px-2.5 text-[11px] text-muted-foreground\",\n className\n )}\n {...props}\n >\n {COMMAND_KEY_HINTS.map(({ keys, label }) => (\n <span key={label} className=\"flex items-center gap-1\">\n <span className=\"font-mono\">{keys}</span>\n <span>{label}</span>\n </span>\n ))}\n </div>\n));\nCommandFooter.displayName = \"CommandFooter\";\n\nexport {\n Command,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandFooter,\n};\n"
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
"path": "components/command/index.ts",
|
|
632
|
+
"type": "registry:ui",
|
|
633
|
+
"content": "export * from \"./command\";\n"
|
|
634
|
+
}
|
|
635
|
+
]
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"name": "context-menu",
|
|
639
|
+
"type": "registry:ui",
|
|
640
|
+
"title": "Context Menu",
|
|
641
|
+
"description": "Accessible Context Menu primitive component built with Base UI and Tailwind v4.",
|
|
642
|
+
"license": "GPL-3.0-only",
|
|
643
|
+
"dependencies": [
|
|
644
|
+
"@base-ui/react",
|
|
645
|
+
"lucide-react"
|
|
646
|
+
],
|
|
647
|
+
"devDependencies": [],
|
|
648
|
+
"registryDependencies": [
|
|
649
|
+
"utils"
|
|
650
|
+
],
|
|
651
|
+
"dependencyVersions": {
|
|
652
|
+
"@base-ui/react": "^1.6.0",
|
|
653
|
+
"lucide-react": "^1.25.0"
|
|
654
|
+
},
|
|
655
|
+
"files": [
|
|
656
|
+
{
|
|
657
|
+
"path": "components/context-menu/context-menu.tsx",
|
|
658
|
+
"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-xl 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 </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 rounded-lg px-2.5 py-1.5 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
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"path": "components/context-menu/index.ts",
|
|
663
|
+
"type": "registry:ui",
|
|
664
|
+
"content": "export * from \"./context-menu\";\n"
|
|
665
|
+
}
|
|
666
|
+
]
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
"name": "copy-button",
|
|
670
|
+
"type": "registry:ui",
|
|
671
|
+
"title": "Copy Button",
|
|
672
|
+
"description": "Accessible Copy Button primitive component built with Base UI and Tailwind v4.",
|
|
673
|
+
"license": "GPL-3.0-only",
|
|
674
|
+
"dependencies": [
|
|
675
|
+
"lucide-react"
|
|
676
|
+
],
|
|
677
|
+
"devDependencies": [],
|
|
678
|
+
"registryDependencies": [
|
|
679
|
+
"button",
|
|
680
|
+
"utils"
|
|
681
|
+
],
|
|
682
|
+
"dependencyVersions": {
|
|
683
|
+
"lucide-react": "^1.25.0"
|
|
684
|
+
},
|
|
685
|
+
"files": [
|
|
686
|
+
{
|
|
687
|
+
"path": "components/copy-button/copy-button.tsx",
|
|
688
|
+
"type": "registry:ui",
|
|
689
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Check, Copy } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button, type ButtonProps } from \"../button\";\n\nexport interface CopyButtonProps extends Omit<ButtonProps, \"onClick\"> {\n value: string;\n onCopy?: () => void;\n timeout?: number;\n}\n\nexport const CopyButton = React.forwardRef<HTMLButtonElement, CopyButtonProps>(\n (\n {\n value,\n onCopy,\n timeout = 2000,\n className,\n variant = \"ghost\",\n size = \"icon\",\n children,\n ...props\n },\n ref\n ) => {\n const [hasCopied, setHasCopied] = React.useState(false);\n\n const copyToClipboard = React.useCallback(async () => {\n try {\n if (typeof navigator !== \"undefined\" && navigator.clipboard) {\n await navigator.clipboard.writeText(value);\n }\n setHasCopied(true);\n onCopy?.();\n } catch (err) {\n console.error(\"Failed to copy text: \", err);\n }\n }, [value, onCopy]);\n\n React.useEffect(() => {\n if (!hasCopied) return;\n const timer = setTimeout(() => {\n setHasCopied(false);\n }, timeout);\n\n return () => clearTimeout(timer);\n }, [hasCopied, timeout]);\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n onClick={copyToClipboard}\n aria-label={hasCopied ? \"Copied to clipboard\" : \"Copy to clipboard\"}\n className={cn(\"h-8 w-8 transition-colors\", className)}\n {...props}\n >\n {children ??\n (hasCopied ? (\n <Check className=\"h-4 w-4 text-pulse-green-foreground\" />\n ) : (\n <Copy className=\"h-4 w-4 text-muted-foreground\" />\n ))}\n </Button>\n );\n }\n);\nCopyButton.displayName = \"CopyButton\";\n"
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
"path": "components/copy-button/index.ts",
|
|
693
|
+
"type": "registry:ui",
|
|
694
|
+
"content": "export { CopyButton, type CopyButtonProps } from \"./copy-button\";\n"
|
|
695
|
+
}
|
|
696
|
+
]
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
"name": "dashboard-header",
|
|
700
|
+
"type": "registry:block",
|
|
701
|
+
"title": "Dashboard Header Block",
|
|
702
|
+
"description": "Composed Dashboard Header block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
703
|
+
"license": "GPL-3.0-only",
|
|
704
|
+
"dependencies": [
|
|
705
|
+
"lucide-react"
|
|
706
|
+
],
|
|
707
|
+
"devDependencies": [],
|
|
708
|
+
"registryDependencies": [
|
|
709
|
+
"avatar",
|
|
710
|
+
"breadcrumb",
|
|
711
|
+
"button",
|
|
712
|
+
"dropdown-menu",
|
|
713
|
+
"input",
|
|
714
|
+
"utils"
|
|
715
|
+
],
|
|
716
|
+
"dependencyVersions": {
|
|
717
|
+
"lucide-react": "^1.25.0"
|
|
718
|
+
},
|
|
719
|
+
"files": [
|
|
720
|
+
{
|
|
721
|
+
"path": "blocks/dashboard-header/dashboard-header.tsx",
|
|
722
|
+
"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-2 border-b border-border bg-card px-4 py-2 text-foreground sm:h-16 sm:flex-nowrap sm:gap-4 sm:px-6 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
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"path": "blocks/dashboard-header/index.ts",
|
|
727
|
+
"type": "registry:block",
|
|
728
|
+
"content": "export * from \"./dashboard-header\";\n"
|
|
729
|
+
}
|
|
730
|
+
]
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
"name": "data-table",
|
|
734
|
+
"type": "registry:ui",
|
|
735
|
+
"title": "Data Table",
|
|
736
|
+
"description": "Accessible Data Table primitive component built with Base UI and Tailwind v4.",
|
|
737
|
+
"license": "GPL-3.0-only",
|
|
738
|
+
"dependencies": [
|
|
739
|
+
"@tanstack/react-table",
|
|
740
|
+
"lucide-react"
|
|
741
|
+
],
|
|
742
|
+
"devDependencies": [],
|
|
743
|
+
"registryDependencies": [
|
|
744
|
+
"button",
|
|
745
|
+
"input",
|
|
746
|
+
"utils"
|
|
747
|
+
],
|
|
748
|
+
"dependencyVersions": {
|
|
749
|
+
"@tanstack/react-table": "^8.21.2",
|
|
750
|
+
"lucide-react": "^1.25.0"
|
|
751
|
+
},
|
|
752
|
+
"files": [
|
|
753
|
+
{
|
|
754
|
+
"path": "components/data-table/data-table.tsx",
|
|
755
|
+
"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-xl 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
|
+
},
|
|
758
|
+
{
|
|
759
|
+
"path": "components/data-table/index.ts",
|
|
760
|
+
"type": "registry:ui",
|
|
761
|
+
"content": "export * from \"./data-table\";\n"
|
|
762
|
+
}
|
|
763
|
+
]
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
"name": "data-table-with-filters",
|
|
767
|
+
"type": "registry:block",
|
|
768
|
+
"title": "Data Table With Filters Block",
|
|
769
|
+
"description": "Composed Data Table With Filters block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
770
|
+
"license": "GPL-3.0-only",
|
|
771
|
+
"dependencies": [
|
|
772
|
+
"@tanstack/react-table"
|
|
773
|
+
],
|
|
774
|
+
"devDependencies": [],
|
|
775
|
+
"registryDependencies": [
|
|
776
|
+
"combobox",
|
|
777
|
+
"data-table"
|
|
778
|
+
],
|
|
779
|
+
"dependencyVersions": {
|
|
780
|
+
"@tanstack/react-table": "^8.21.2"
|
|
781
|
+
},
|
|
782
|
+
"files": [
|
|
783
|
+
{
|
|
784
|
+
"path": "blocks/data-table-with-filters/data-table-with-filters.tsx",
|
|
785
|
+
"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=\"w-full min-w-0 space-y-4\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between\">\n <div className=\"space-y-1\">\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
|
+
},
|
|
788
|
+
{
|
|
789
|
+
"path": "blocks/data-table-with-filters/index.ts",
|
|
790
|
+
"type": "registry:block",
|
|
791
|
+
"content": "export * from \"./data-table-with-filters\";\n"
|
|
792
|
+
}
|
|
793
|
+
]
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"name": "date-picker",
|
|
797
|
+
"type": "registry:ui",
|
|
798
|
+
"title": "Date Picker",
|
|
799
|
+
"description": "Accessible Date Picker primitive component built with Base UI and Tailwind v4.",
|
|
800
|
+
"license": "GPL-3.0-only",
|
|
801
|
+
"dependencies": [
|
|
802
|
+
"lucide-react"
|
|
803
|
+
],
|
|
804
|
+
"devDependencies": [],
|
|
805
|
+
"registryDependencies": [
|
|
806
|
+
"button",
|
|
807
|
+
"calendar",
|
|
808
|
+
"popover",
|
|
809
|
+
"utils"
|
|
810
|
+
],
|
|
811
|
+
"dependencyVersions": {
|
|
812
|
+
"lucide-react": "^1.25.0"
|
|
813
|
+
},
|
|
814
|
+
"files": [
|
|
815
|
+
{
|
|
816
|
+
"path": "components/date-picker/date-picker.tsx",
|
|
817
|
+
"type": "registry:ui",
|
|
818
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Calendar as CalendarIcon } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../button\";\nimport { Calendar } from \"../calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover\";\n\nexport interface DatePickerProps {\n value?: Date;\n onChange?: (date: Date) => void;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport const DatePicker = React.forwardRef<\n HTMLButtonElement,\n DatePickerProps\n>(\n (\n {\n value,\n onChange,\n placeholder = \"Pick a date\",\n disabled = false,\n className,\n },\n ref\n ) => {\n const [open, setOpen] = React.useState(false);\n\n const formattedDate = value\n ? value.toLocaleDateString(\"en-US\", {\n month: \"short\",\n day: \"numeric\",\n year: \"numeric\",\n })\n : null;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n render={\n <Button\n ref={ref}\n variant=\"outline\"\n disabled={disabled}\n aria-expanded={open}\n aria-label={formattedDate ?? placeholder}\n className={cn(\n \"w-full justify-between font-normal text-xs h-9\",\n className\n )}\n >\n <span className={cn(!value && \"text-muted-foreground\")}>\n {formattedDate ?? placeholder}\n </span>\n <CalendarIcon className=\"ml-2 h-4 w-4 shrink-0 opacity-50\" />\n </Button>\n }\n />\n <PopoverContent className=\"w-auto p-0 border-0 bg-transparent shadow-none\">\n <Calendar\n selected={value}\n onSelect={(date) => {\n onChange?.(date);\n setOpen(false);\n }}\n />\n </PopoverContent>\n </Popover>\n );\n }\n);\n\nDatePicker.displayName = \"DatePicker\";\n"
|
|
819
|
+
},
|
|
820
|
+
{
|
|
821
|
+
"path": "components/date-picker/index.ts",
|
|
822
|
+
"type": "registry:ui",
|
|
823
|
+
"content": "export * from \"./date-picker\";\n"
|
|
824
|
+
}
|
|
825
|
+
]
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
"name": "dialog",
|
|
829
|
+
"type": "registry:ui",
|
|
830
|
+
"title": "Dialog",
|
|
831
|
+
"description": "Accessible Dialog primitive component built with Base UI and Tailwind v4.",
|
|
832
|
+
"license": "GPL-3.0-only",
|
|
833
|
+
"dependencies": [
|
|
834
|
+
"@base-ui/react",
|
|
835
|
+
"lucide-react"
|
|
836
|
+
],
|
|
837
|
+
"devDependencies": [],
|
|
838
|
+
"registryDependencies": [
|
|
839
|
+
"utils"
|
|
840
|
+
],
|
|
841
|
+
"dependencyVersions": {
|
|
842
|
+
"@base-ui/react": "^1.6.0",
|
|
843
|
+
"lucide-react": "^1.25.0"
|
|
844
|
+
},
|
|
845
|
+
"files": [
|
|
846
|
+
{
|
|
847
|
+
"path": "components/dialog/dialog.tsx",
|
|
848
|
+
"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>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogBackdrop />\n <BaseDialog.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-4 overflow-y-auto overscroll-contain rounded-lg border border-border bg-popover text-popover-foreground p-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=\"Close\" className=\"absolute right-4 top-4 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:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</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-1.5 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 sm:flex-row sm:justify-end\", 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
|
+
},
|
|
851
|
+
{
|
|
852
|
+
"path": "components/dialog/index.ts",
|
|
853
|
+
"type": "registry:ui",
|
|
854
|
+
"content": "export * from \"./dialog\";\n"
|
|
855
|
+
}
|
|
856
|
+
]
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
"name": "drawer",
|
|
860
|
+
"type": "registry:ui",
|
|
861
|
+
"title": "Drawer",
|
|
862
|
+
"description": "Accessible Drawer primitive component built with Base UI and Tailwind v4.",
|
|
863
|
+
"license": "GPL-3.0-only",
|
|
864
|
+
"dependencies": [
|
|
865
|
+
"@base-ui/react"
|
|
866
|
+
],
|
|
867
|
+
"devDependencies": [],
|
|
868
|
+
"registryDependencies": [
|
|
869
|
+
"utils"
|
|
870
|
+
],
|
|
871
|
+
"dependencyVersions": {
|
|
872
|
+
"@base-ui/react": "^1.6.0"
|
|
873
|
+
},
|
|
874
|
+
"files": [
|
|
875
|
+
{
|
|
876
|
+
"path": "components/drawer/drawer.tsx",
|
|
877
|
+
"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-black/80 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 className={cn(\n \"fixed z-50 gap-4 overflow-y-auto overscroll-contain bg-background p-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 sm:flex-row sm:justify-end\", 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
|
+
},
|
|
880
|
+
{
|
|
881
|
+
"path": "components/drawer/index.ts",
|
|
882
|
+
"type": "registry:ui",
|
|
883
|
+
"content": "export * from \"./drawer\";\n"
|
|
884
|
+
}
|
|
885
|
+
]
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
"name": "dropdown-menu",
|
|
889
|
+
"type": "registry:ui",
|
|
890
|
+
"title": "Dropdown Menu",
|
|
891
|
+
"description": "Accessible Dropdown Menu primitive component built with Base UI and Tailwind v4.",
|
|
892
|
+
"license": "GPL-3.0-only",
|
|
893
|
+
"dependencies": [
|
|
894
|
+
"@base-ui/react"
|
|
895
|
+
],
|
|
896
|
+
"devDependencies": [],
|
|
897
|
+
"registryDependencies": [
|
|
898
|
+
"utils"
|
|
899
|
+
],
|
|
900
|
+
"dependencyVersions": {
|
|
901
|
+
"@base-ui/react": "^1.6.0"
|
|
902
|
+
},
|
|
903
|
+
"files": [
|
|
904
|
+
{
|
|
905
|
+
"path": "components/dropdown-menu/dropdown-menu.tsx",
|
|
906
|
+
"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-2 py-1.5 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-2 py-1.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider\",\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
|
+
},
|
|
909
|
+
{
|
|
910
|
+
"path": "components/dropdown-menu/index.ts",
|
|
911
|
+
"type": "registry:ui",
|
|
912
|
+
"content": "export * from \"./dropdown-menu\";\n"
|
|
913
|
+
}
|
|
914
|
+
]
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
"name": "empty-state-block",
|
|
918
|
+
"type": "registry:block",
|
|
919
|
+
"title": "Empty State Block Block",
|
|
920
|
+
"description": "Composed Empty State Block block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
921
|
+
"license": "GPL-3.0-only",
|
|
922
|
+
"dependencies": [
|
|
923
|
+
"lucide-react"
|
|
924
|
+
],
|
|
925
|
+
"devDependencies": [],
|
|
926
|
+
"registryDependencies": [
|
|
927
|
+
"button",
|
|
928
|
+
"utils"
|
|
929
|
+
],
|
|
930
|
+
"dependencyVersions": {
|
|
931
|
+
"lucide-react": "^1.25.0"
|
|
932
|
+
},
|
|
933
|
+
"files": [
|
|
934
|
+
{
|
|
935
|
+
"path": "blocks/empty-state-block/empty-state-block.tsx",
|
|
936
|
+
"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 evaluations recorded\",\n description = \"Get started by selecting an element on the host page or importing an existing audit.\",\n actionLabel = \"New Evaluation\",\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 aria-labelledby={titleId}\n aria-describedby={descriptionId}\n className={cn(\n \"flex flex-col items-center justify-center rounded-xl border border-dashed border-border bg-muted/10 p-8 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-muted border border-border/80 text-muted-foreground mb-4\"\n >\n {icon ?? <HelpCircle className=\"h-6 w-6\" />}\n </div>\n\n <h3 id={titleId} className=\"text-base font-semibold text-foreground mb-1\">{title}</h3>\n <p\n id={descriptionId}\n className=\"text-xs text-muted-foreground max-w-sm mb-6 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\">\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
|
+
},
|
|
939
|
+
{
|
|
940
|
+
"path": "blocks/empty-state-block/index.ts",
|
|
941
|
+
"type": "registry:block",
|
|
942
|
+
"content": "export {\n EmptyStateBlock,\n type EmptyStateBlockProps,\n} from \"./empty-state-block\";\n"
|
|
943
|
+
}
|
|
944
|
+
]
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
"name": "evaluation-summary-report",
|
|
948
|
+
"type": "registry:block",
|
|
949
|
+
"title": "Evaluation Summary Report Block",
|
|
950
|
+
"description": "Composed Evaluation Summary Report block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
951
|
+
"license": "GPL-3.0-only",
|
|
952
|
+
"dependencies": [
|
|
953
|
+
"lucide-react"
|
|
954
|
+
],
|
|
955
|
+
"devDependencies": [],
|
|
956
|
+
"registryDependencies": [
|
|
957
|
+
"badge",
|
|
958
|
+
"button",
|
|
959
|
+
"card",
|
|
960
|
+
"progress",
|
|
961
|
+
"utils"
|
|
962
|
+
],
|
|
963
|
+
"dependencyVersions": {
|
|
964
|
+
"lucide-react": "^1.25.0"
|
|
965
|
+
},
|
|
966
|
+
"files": [
|
|
967
|
+
{
|
|
968
|
+
"path": "blocks/evaluation-summary-report/evaluation-summary-report.tsx",
|
|
969
|
+
"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"
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
"path": "blocks/evaluation-summary-report/index.ts",
|
|
974
|
+
"type": "registry:block",
|
|
975
|
+
"content": "export {\n EvaluationSummaryReport,\n type EvaluationSummaryReportProps,\n type HeuristicScoreItem,\n} from \"./evaluation-summary-report\";\n"
|
|
976
|
+
}
|
|
977
|
+
]
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
"name": "file-input",
|
|
981
|
+
"type": "registry:ui",
|
|
982
|
+
"title": "File Input",
|
|
983
|
+
"description": "Accessible File Input primitive component built with Base UI and Tailwind v4.",
|
|
984
|
+
"license": "GPL-3.0-only",
|
|
985
|
+
"dependencies": [
|
|
986
|
+
"lucide-react"
|
|
987
|
+
],
|
|
988
|
+
"devDependencies": [],
|
|
989
|
+
"registryDependencies": [
|
|
990
|
+
"utils"
|
|
991
|
+
],
|
|
992
|
+
"dependencyVersions": {
|
|
993
|
+
"lucide-react": "^1.25.0"
|
|
994
|
+
},
|
|
995
|
+
"files": [
|
|
996
|
+
{
|
|
997
|
+
"path": "components/file-input/file-input.tsx",
|
|
998
|
+
"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-xl 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
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
"path": "components/file-input/index.ts",
|
|
1003
|
+
"type": "registry:ui",
|
|
1004
|
+
"content": "export * from \"./file-input\";\n"
|
|
1005
|
+
}
|
|
1006
|
+
]
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
"name": "form",
|
|
1010
|
+
"type": "registry:ui",
|
|
1011
|
+
"title": "Form",
|
|
1012
|
+
"description": "Accessible Form primitive component built with Base UI and Tailwind v4.",
|
|
1013
|
+
"license": "GPL-3.0-only",
|
|
1014
|
+
"dependencies": [
|
|
1015
|
+
"react-hook-form"
|
|
1016
|
+
],
|
|
1017
|
+
"devDependencies": [],
|
|
1018
|
+
"registryDependencies": [
|
|
1019
|
+
"label",
|
|
1020
|
+
"utils"
|
|
1021
|
+
],
|
|
1022
|
+
"dependencyVersions": {
|
|
1023
|
+
"react-hook-form": "^7.54.2"
|
|
1024
|
+
},
|
|
1025
|
+
"files": [
|
|
1026
|
+
{
|
|
1027
|
+
"path": "components/form/form.tsx",
|
|
1028
|
+
"type": "registry:ui",
|
|
1029
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n Controller,\n ControllerProps,\n FieldPath,\n FieldValues,\n FormProvider,\n useFormContext,\n} from \"react-hook-form\";\nimport { Label } from \"../label\";\nimport { cn } from \"../../lib/utils\";\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue\n);\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const itemContext = React.useContext(FormItemContext);\n const { name } = React.useContext(FormFieldContext);\n const { getFieldState, formState } = useFormContext();\n\n const fieldState = getFieldState(name, formState);\n\n if (!name) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue\n);\n\nconst FormItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n );\n});\nFormItem.displayName = \"FormItem\";\n\nconst FormLabel = React.forwardRef<\n HTMLLabelElement,\n React.ComponentPropsWithoutRef<typeof Label>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive font-medium\", className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n});\nFormLabel.displayName = \"FormLabel\";\n\nfunction assignRef<T>(ref: React.Ref<T> | undefined, value: T | null) {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref) {\n (ref as React.MutableRefObject<T | null>).current = value;\n }\n}\n\nfunction composeRefs<T>(\n ...refs: Array<React.Ref<T> | undefined>\n): React.RefCallback<T> {\n return (node) => {\n refs.forEach((ref) => assignRef(ref, node));\n };\n}\n\nconst FormControl = React.forwardRef<\n HTMLElement,\n React.HTMLAttributes<HTMLElement>\n>(({ children, ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } =\n useFormField();\n\n const ariaDescribedBy = !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`;\n\n if (React.isValidElement(children)) {\n const childRef =\n (children.props as { ref?: React.Ref<HTMLElement> }).ref ??\n (React.version.startsWith(\"19\")\n ? undefined\n : (children as unknown as { ref?: React.Ref<HTMLElement> }).ref);\n\n return React.cloneElement(children as React.ReactElement<any>, {\n ref: composeRefs(ref, childRef),\n id: formItemId,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": !!error,\n ...props,\n });\n }\n\n return (\n <div\n ref={ref as any}\n id={formItemId}\n aria-describedby={ariaDescribedBy}\n aria-invalid={!!error}\n {...props}\n >\n {children}\n </div>\n );\n});\nFormControl.displayName = \"FormControl\";\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-xs text-muted-foreground\", className)}\n {...props}\n />\n );\n});\nFormDescription.displayName = \"FormDescription\";\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-xs font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n );\n});\nFormMessage.displayName = \"FormMessage\";\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n};\n"
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
"path": "components/form/index.ts",
|
|
1033
|
+
"type": "registry:ui",
|
|
1034
|
+
"content": "export * from \"./form\";\n"
|
|
1035
|
+
}
|
|
1036
|
+
]
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
"name": "form-with-validation",
|
|
1040
|
+
"type": "registry:block",
|
|
1041
|
+
"title": "Form With Validation Block",
|
|
1042
|
+
"description": "Composed Form With Validation block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
1043
|
+
"license": "GPL-3.0-only",
|
|
1044
|
+
"dependencies": [
|
|
1045
|
+
"@hookform/resolvers",
|
|
1046
|
+
"react-hook-form",
|
|
1047
|
+
"zod"
|
|
1048
|
+
],
|
|
1049
|
+
"devDependencies": [],
|
|
1050
|
+
"registryDependencies": [
|
|
1051
|
+
"button",
|
|
1052
|
+
"card",
|
|
1053
|
+
"form",
|
|
1054
|
+
"input"
|
|
1055
|
+
],
|
|
1056
|
+
"dependencyVersions": {
|
|
1057
|
+
"@hookform/resolvers": "^5.0.0",
|
|
1058
|
+
"react-hook-form": "^7.54.2",
|
|
1059
|
+
"zod": "^3.24.2"
|
|
1060
|
+
},
|
|
1061
|
+
"files": [
|
|
1062
|
+
{
|
|
1063
|
+
"path": "blocks/form-with-validation/form-with-validation.tsx",
|
|
1064
|
+
"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-1.5 pb-4\">\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>\n {submitError && (\n <div\n role=\"alert\"\n className=\"mb-4 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 <Form {...form}>\n <form\n id=\"profile-form\"\n onSubmit={form.handleSubmit(handleSubmit)}\n className=\"space-y-4\"\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 pt-4\">\n <Button type=\"submit\" form=\"profile-form\" loading={pending} disabled={pending}>\n {submitLabel}\n </Button>\n </CardFooter>\n </Card>\n );\n}\n"
|
|
1066
|
+
},
|
|
1067
|
+
{
|
|
1068
|
+
"path": "blocks/form-with-validation/index.ts",
|
|
1069
|
+
"type": "registry:block",
|
|
1070
|
+
"content": "export * from \"./form-with-validation\";\n"
|
|
1071
|
+
}
|
|
1072
|
+
]
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
"name": "heuristic-finding-card",
|
|
1076
|
+
"type": "registry:block",
|
|
1077
|
+
"title": "Heuristic Finding Card Block",
|
|
1078
|
+
"description": "Composed Heuristic Finding Card block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
1079
|
+
"license": "GPL-3.0-only",
|
|
1080
|
+
"dependencies": [
|
|
1081
|
+
"lucide-react"
|
|
1082
|
+
],
|
|
1083
|
+
"devDependencies": [],
|
|
1084
|
+
"registryDependencies": [
|
|
1085
|
+
"aspect-ratio",
|
|
1086
|
+
"badge",
|
|
1087
|
+
"button",
|
|
1088
|
+
"card",
|
|
1089
|
+
"copy-button",
|
|
1090
|
+
"utils"
|
|
1091
|
+
],
|
|
1092
|
+
"dependencyVersions": {
|
|
1093
|
+
"lucide-react": "^1.25.0"
|
|
1094
|
+
},
|
|
1095
|
+
"files": [
|
|
1096
|
+
{
|
|
1097
|
+
"path": "blocks/heuristic-finding-card/heuristic-finding-card.tsx",
|
|
1098
|
+
"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\nexport function HeuristicFindingCard({\n finding,\n onEdit,\n onDelete,\n onViewScreenshot,\n className,\n ...props\n}: HeuristicFindingCardProps) {\n const getSeverityBadgeVariant = (severity: FindingSeverity) => {\n switch (severity) {\n case \"CRITICAL\":\n return \"coral-red\";\n case \"MEDIUM\":\n return \"signal-teal\";\n case \"GOOD\":\n return \"pulse-green\";\n default:\n return \"neutral\";\n }\n };\n\n return (\n <Card\n className={cn(\"overflow-hidden border border-border bg-card text-card-foreground shadow-xs\", className)}\n {...props}\n >\n <CardHeader className=\"flex flex-row flex-wrap items-start justify-between gap-3 space-y-0 pb-3\">\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <Badge variant=\"neutral\" className=\"font-mono text-xs font-bold border-border\">\n {finding.heuristicId}\n </Badge>\n <Badge variant={getSeverityBadgeVariant(finding.severity)}>\n {finding.severity}\n </Badge>\n </div>\n <CardTitle className=\"break-words text-base font-semibold text-card-foreground\">\n {finding.heuristicTitle}\n </CardTitle>\n </div>\n\n <div className=\"flex shrink-0 items-center gap-1\">\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\"\n onClick={() => onDelete(finding.id)}\n aria-label=\"Delete finding\"\n >\n <Trash2 className=\"h-4 w-4\" />\n </Button>\n )}\n </div>\n </CardHeader>\n\n <CardContent className=\"flex flex-col gap-4\">\n {finding.screenshotUrl ? (\n <div className=\"overflow-hidden rounded-md border border-border bg-muted/40 relative group\">\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-2 right-2 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 transition-opacity gap-1 text-xs\"\n onClick={() => onViewScreenshot(finding)}\n >\n <ExternalLink className=\"h-3 w-3\" />\n <span>Expand</span>\n </Button>\n )}\n </div>\n ) : (\n <div className=\"flex items-center justify-center rounded-md border border-dashed border-border bg-muted/30 py-6 text-muted-foreground text-xs gap-2\">\n <ImageIcon className=\"h-4 w-4\" />\n <span>No screenshot captured</span>\n </div>\n )}\n\n <div className=\"flex min-w-0 items-center justify-between gap-2 rounded-md border border-border bg-muted/40 px-3 py-1.5 font-mono text-xs\">\n <span className=\"min-w-0 flex-1 truncate text-foreground\">\n {finding.selector}\n </span>\n <CopyButton value={finding.selector} className=\"h-6 w-6 text-muted-foreground\" />\n </div>\n\n <div className=\"flex flex-col gap-1\">\n <div className=\"flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground\">\n <span className=\"min-w-0\">Usability Severity Score</span>\n <Badge\n variant={getSeverityBadgeVariant(finding.severity)}\n className=\"shrink-0 font-mono font-semibold tabular-nums\"\n aria-label={`Usability severity score: ${finding.rating} of 5`}\n >\n {finding.rating} / 5\n </Badge>\n </div>\n <p className=\"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-2 border-t border-border pt-3 text-xs text-muted-foreground\">\n <span>\n {finding.evaluatorName\n ? `Evaluated by ${finding.evaluatorName}`\n : \"Audited element\"}\n </span>\n {finding.createdAt && <span>{finding.createdAt}</span>}\n </CardFooter>\n </Card>\n );\n}\n"
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
"path": "blocks/heuristic-finding-card/index.ts",
|
|
1103
|
+
"type": "registry:block",
|
|
1104
|
+
"content": "export {\n HeuristicFindingCard,\n type HeuristicFinding,\n type HeuristicFindingCardProps,\n type FindingSeverity,\n} from \"./heuristic-finding-card\";\n"
|
|
1105
|
+
}
|
|
1106
|
+
]
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
"name": "hover-card",
|
|
1110
|
+
"type": "registry:ui",
|
|
1111
|
+
"title": "Hover Card",
|
|
1112
|
+
"description": "Accessible Hover Card primitive component built with Base UI and Tailwind v4.",
|
|
1113
|
+
"license": "GPL-3.0-only",
|
|
1114
|
+
"dependencies": [
|
|
1115
|
+
"@base-ui/react"
|
|
1116
|
+
],
|
|
1117
|
+
"devDependencies": [],
|
|
1118
|
+
"registryDependencies": [
|
|
1119
|
+
"utils"
|
|
1120
|
+
],
|
|
1121
|
+
"dependencyVersions": {
|
|
1122
|
+
"@base-ui/react": "^1.6.0"
|
|
1123
|
+
},
|
|
1124
|
+
"files": [
|
|
1125
|
+
{
|
|
1126
|
+
"path": "components/hover-card/hover-card.tsx",
|
|
1127
|
+
"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-xl 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 </HoverCardPortal>\n));\nHoverCardContent.displayName = \"HoverCardContent\";\n"
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
"path": "components/hover-card/index.ts",
|
|
1132
|
+
"type": "registry:ui",
|
|
1133
|
+
"content": "export * from \"./hover-card\";\n"
|
|
1134
|
+
}
|
|
1135
|
+
]
|
|
1136
|
+
},
|
|
1137
|
+
{
|
|
1138
|
+
"name": "input",
|
|
1139
|
+
"type": "registry:ui",
|
|
1140
|
+
"title": "Input",
|
|
1141
|
+
"description": "Accessible Input primitive component built with Base UI and Tailwind v4.",
|
|
1142
|
+
"license": "GPL-3.0-only",
|
|
1143
|
+
"dependencies": [
|
|
1144
|
+
"class-variance-authority"
|
|
1145
|
+
],
|
|
1146
|
+
"devDependencies": [],
|
|
1147
|
+
"registryDependencies": [
|
|
1148
|
+
"utils"
|
|
1149
|
+
],
|
|
1150
|
+
"dependencyVersions": {
|
|
1151
|
+
"class-variance-authority": "^0.7.1"
|
|
1152
|
+
},
|
|
1153
|
+
"files": [
|
|
1154
|
+
{
|
|
1155
|
+
"path": "components/input/index.ts",
|
|
1156
|
+
"type": "registry:ui",
|
|
1157
|
+
"content": "export * from \"./input\";\n"
|
|
1158
|
+
},
|
|
1159
|
+
{
|
|
1160
|
+
"path": "components/input/input.tsx",
|
|
1161
|
+
"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-2 text-xs rounded-md\",\n md: \"h-9 px-3 text-sm rounded-md\",\n lg: \"h-10 px-4 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 type={type}\n className={cn(inputVariants({ inputSize, className }))}\n ref={ref}\n {...props}\n />\n );\n }\n);\n\nInput.displayName = \"Input\";\n"
|
|
1163
|
+
}
|
|
1164
|
+
]
|
|
1165
|
+
},
|
|
1166
|
+
{
|
|
1167
|
+
"name": "input-otp",
|
|
1168
|
+
"type": "registry:ui",
|
|
1169
|
+
"title": "Input Otp",
|
|
1170
|
+
"description": "Accessible Input Otp primitive component built with Base UI and Tailwind v4.",
|
|
1171
|
+
"license": "GPL-3.0-only",
|
|
1172
|
+
"dependencies": [
|
|
1173
|
+
"input-otp",
|
|
1174
|
+
"lucide-react"
|
|
1175
|
+
],
|
|
1176
|
+
"devDependencies": [],
|
|
1177
|
+
"registryDependencies": [
|
|
1178
|
+
"utils"
|
|
1179
|
+
],
|
|
1180
|
+
"dependencyVersions": {
|
|
1181
|
+
"input-otp": "^1.4.2",
|
|
1182
|
+
"lucide-react": "^1.25.0"
|
|
1183
|
+
},
|
|
1184
|
+
"files": [
|
|
1185
|
+
{
|
|
1186
|
+
"path": "components/input-otp/index.ts",
|
|
1187
|
+
"type": "registry:ui",
|
|
1188
|
+
"content": "export {\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n InputOTPSeparator,\n} from \"./input-otp\";\n"
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
"path": "components/input-otp/input-otp.tsx",
|
|
1192
|
+
"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-all 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
|
+
}
|
|
1195
|
+
]
|
|
1196
|
+
},
|
|
1197
|
+
{
|
|
1198
|
+
"name": "inspector-split-view",
|
|
1199
|
+
"type": "registry:block",
|
|
1200
|
+
"title": "Inspector Split View Block",
|
|
1201
|
+
"description": "Composed Inspector Split View block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
1202
|
+
"license": "GPL-3.0-only",
|
|
1203
|
+
"dependencies": [
|
|
1204
|
+
"lucide-react"
|
|
1205
|
+
],
|
|
1206
|
+
"devDependencies": [],
|
|
1207
|
+
"registryDependencies": [
|
|
1208
|
+
"badge",
|
|
1209
|
+
"button",
|
|
1210
|
+
"copy-button",
|
|
1211
|
+
"resizable",
|
|
1212
|
+
"tree-view",
|
|
1213
|
+
"utils"
|
|
1214
|
+
],
|
|
1215
|
+
"dependencyVersions": {
|
|
1216
|
+
"lucide-react": "^1.25.0"
|
|
1217
|
+
},
|
|
1218
|
+
"files": [
|
|
1219
|
+
{
|
|
1220
|
+
"path": "blocks/inspector-split-view/index.ts",
|
|
1221
|
+
"type": "registry:block",
|
|
1222
|
+
"content": "export {\n InspectorSplitView,\n type InspectorSplitViewProps,\n type DOMNodeItem,\n} from \"./inspector-split-view\";\n"
|
|
1223
|
+
},
|
|
1224
|
+
{
|
|
1225
|
+
"path": "blocks/inspector-split-view/inspector-split-view.tsx",
|
|
1226
|
+
"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 shadow-xs 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 border-b border-border/60 p-3\">\n <Layers className=\"h-4 w-4 shrink-0 text-muted-foreground\" />\n <span className=\"truncate text-xs font-semibold uppercase tracking-wider text-muted-foreground\">\n DOM Hierarchy\n </span>\n </div>\n <div className=\"min-w-0 flex-1 overflow-y-auto p-3\">\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-muted/10 p-4\">\n {selected ? (\n <div className=\"flex min-w-0 flex-col gap-4\">\n <div className=\"flex flex-wrap items-center justify-between gap-2 border-b border-border/60 pb-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\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 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-3\">\n <div>\n <span className=\"text-xs font-medium text-muted-foreground\">\n Target Selector\n </span>\n <div className=\"mt-1 flex min-w-0 items-center justify-between gap-2 rounded-md border border-border bg-background p-2 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-6 w-6 shrink-0\"\n />\n </div>\n </div>\n\n {selected.classes && (\n <div>\n <span className=\"text-xs font-medium text-muted-foreground\">\n Class List\n </span>\n <div className=\"mt-1 rounded-md border border-border bg-background p-2 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"
|
|
1228
|
+
}
|
|
1229
|
+
]
|
|
1230
|
+
},
|
|
1231
|
+
{
|
|
1232
|
+
"name": "kbd",
|
|
1233
|
+
"type": "registry:ui",
|
|
1234
|
+
"title": "Kbd",
|
|
1235
|
+
"description": "Accessible Kbd primitive component built with Base UI and Tailwind v4.",
|
|
1236
|
+
"license": "GPL-3.0-only",
|
|
1237
|
+
"dependencies": [
|
|
1238
|
+
"class-variance-authority"
|
|
1239
|
+
],
|
|
1240
|
+
"devDependencies": [],
|
|
1241
|
+
"registryDependencies": [
|
|
1242
|
+
"utils"
|
|
1243
|
+
],
|
|
1244
|
+
"dependencyVersions": {
|
|
1245
|
+
"class-variance-authority": "^0.7.1"
|
|
1246
|
+
},
|
|
1247
|
+
"files": [
|
|
1248
|
+
{
|
|
1249
|
+
"path": "components/kbd/index.ts",
|
|
1250
|
+
"type": "registry:ui",
|
|
1251
|
+
"content": "export { Kbd, kbdVariants, type KbdProps } from \"./kbd\";\n"
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
"path": "components/kbd/kbd.tsx",
|
|
1255
|
+
"type": "registry:ui",
|
|
1256
|
+
"content": "import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport const kbdVariants = cva(\n \"inline-flex items-center justify-center select-none font-mono font-medium rounded-sm border border-border bg-card text-foreground\",\n {\n variants: {\n variant: {\n default: \"bg-card text-foreground border-border\",\n outline: \"bg-background text-foreground border-border\",\n secondary: \"bg-secondary text-secondary-foreground border-transparent\",\n ghost: \"border-transparent bg-transparent text-muted-foreground\",\n },\n size: {\n sm: \"h-5 min-w-5 px-1 text-[10px]\",\n md: \"h-6 min-w-6 px-1.5 text-xs\",\n lg: \"h-7 min-w-7 px-2 text-sm\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n }\n);\n\nexport interface KbdProps\n extends React.HTMLAttributes<HTMLElement>,\n VariantProps<typeof kbdVariants> {}\n\nexport const Kbd = React.forwardRef<HTMLElement, KbdProps>(\n ({ className, variant, size, ...props }, ref) => (\n <kbd\n ref={ref}\n className={cn(kbdVariants({ variant, size }), className)}\n {...props}\n />\n )\n);\nKbd.displayName = \"Kbd\";\n"
|
|
1257
|
+
}
|
|
1258
|
+
]
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
"name": "label",
|
|
1262
|
+
"type": "registry:ui",
|
|
1263
|
+
"title": "Label",
|
|
1264
|
+
"description": "Accessible Label primitive component built with Base UI and Tailwind v4.",
|
|
1265
|
+
"license": "GPL-3.0-only",
|
|
1266
|
+
"dependencies": [
|
|
1267
|
+
"class-variance-authority"
|
|
1268
|
+
],
|
|
1269
|
+
"devDependencies": [],
|
|
1270
|
+
"registryDependencies": [
|
|
1271
|
+
"utils"
|
|
1272
|
+
],
|
|
1273
|
+
"dependencyVersions": {
|
|
1274
|
+
"class-variance-authority": "^0.7.1"
|
|
1275
|
+
},
|
|
1276
|
+
"files": [
|
|
1277
|
+
{
|
|
1278
|
+
"path": "components/label/index.ts",
|
|
1279
|
+
"type": "registry:ui",
|
|
1280
|
+
"content": "export * from \"./label\";\n"
|
|
1281
|
+
},
|
|
1282
|
+
{
|
|
1283
|
+
"path": "components/label/label.tsx",
|
|
1284
|
+
"type": "registry:ui",
|
|
1285
|
+
"content": "import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport const labelVariants = cva(\n \"text-sm font-medium leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70 select-none\"\n);\n\nexport interface LabelProps\n extends React.LabelHTMLAttributes<HTMLLabelElement>,\n VariantProps<typeof labelVariants> {\n required?: boolean;\n}\n\nexport const Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, required, children, ...props }, ref) => (\n <label ref={ref} className={cn(labelVariants(), className)} {...props}>\n {children}\n {required && (\n <span\n className=\"ml-1 text-destructive font-semibold\"\n aria-hidden=\"true\"\n >\n *\n </span>\n )}\n </label>\n )\n);\n\nLabel.displayName = \"Label\";\n"
|
|
1286
|
+
}
|
|
1287
|
+
]
|
|
1288
|
+
},
|
|
1289
|
+
{
|
|
1290
|
+
"name": "menubar",
|
|
1291
|
+
"type": "registry:ui",
|
|
1292
|
+
"title": "Menubar",
|
|
1293
|
+
"description": "Accessible Menubar primitive component built with Base UI and Tailwind v4.",
|
|
1294
|
+
"license": "GPL-3.0-only",
|
|
1295
|
+
"dependencies": [
|
|
1296
|
+
"@base-ui/react"
|
|
1297
|
+
],
|
|
1298
|
+
"devDependencies": [],
|
|
1299
|
+
"registryDependencies": [
|
|
1300
|
+
"utils"
|
|
1301
|
+
],
|
|
1302
|
+
"dependencyVersions": {
|
|
1303
|
+
"@base-ui/react": "^1.6.0"
|
|
1304
|
+
},
|
|
1305
|
+
"files": [
|
|
1306
|
+
{
|
|
1307
|
+
"path": "components/menubar/index.ts",
|
|
1308
|
+
"type": "registry:ui",
|
|
1309
|
+
"content": "export * from \"./menubar\";\n"
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
"path": "components/menubar/menubar.tsx",
|
|
1313
|
+
"type": "registry:ui",
|
|
1314
|
+
"content": "import * as React from \"react\";\nimport { Menu as BaseMenu } from \"@base-ui/react/menu\";\nimport { cn } from \"../../lib/utils\";\n\nexport const Menubar = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n role=\"menubar\"\n className={cn(\n \"flex h-10 items-center space-x-1 rounded-lg border border-border bg-background p-1 text-foreground\",\n className\n )}\n {...props}\n />\n));\nMenubar.displayName = \"Menubar\";\n\nexport const MenubarMenu = BaseMenu.Root;\nexport const MenubarPortal = BaseMenu.Portal;\n\nexport const MenubarTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof BaseMenu.Trigger>\n>(({ className, role = \"menuitem\", ...props }, ref) => (\n <BaseMenu.Trigger\n ref={ref}\n role={role}\n className={cn(\n \"flex cursor-pointer select-none items-center rounded-md px-3 py-1.5 text-xs font-semibold outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-popup-open:bg-accent data-popup-open:text-accent-foreground\",\n className\n )}\n {...props}\n />\n));\nMenubarTrigger.displayName = \"MenubarTrigger\";\n\nexport const MenubarContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseMenu.Popup>\n>(({ className, ...props }, ref) => (\n <MenubarPortal>\n <BaseMenu.Positioner align=\"start\" sideOffset={4}>\n <BaseMenu.Popup\n ref={ref}\n className={cn(\n \"z-50 min-w-[12rem] 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 </MenubarPortal>\n));\nMenubarContent.displayName = \"MenubarContent\";\n\nexport const MenubarItem = 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 rounded-md px-2.5 py-1.5 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));\nMenubarItem.displayName = \"MenubarItem\";\n\nexport const MenubarSeparator = 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));\nMenubarSeparator.displayName = \"MenubarSeparator\";\n\nexport const MenubarShortcut = ({\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};\nMenubarShortcut.displayName = \"MenubarShortcut\";\n"
|
|
1315
|
+
}
|
|
1316
|
+
]
|
|
1317
|
+
},
|
|
1318
|
+
{
|
|
1319
|
+
"name": "navigation-menu",
|
|
1320
|
+
"type": "registry:ui",
|
|
1321
|
+
"title": "Navigation Menu",
|
|
1322
|
+
"description": "Accessible Navigation Menu primitive component built with Base UI and Tailwind v4.",
|
|
1323
|
+
"license": "GPL-3.0-only",
|
|
1324
|
+
"dependencies": [
|
|
1325
|
+
"@base-ui/react",
|
|
1326
|
+
"lucide-react"
|
|
1327
|
+
],
|
|
1328
|
+
"devDependencies": [],
|
|
1329
|
+
"registryDependencies": [
|
|
1330
|
+
"utils"
|
|
1331
|
+
],
|
|
1332
|
+
"dependencyVersions": {
|
|
1333
|
+
"@base-ui/react": "^1.6.0",
|
|
1334
|
+
"lucide-react": "^1.25.0"
|
|
1335
|
+
},
|
|
1336
|
+
"files": [
|
|
1337
|
+
{
|
|
1338
|
+
"path": "components/navigation-menu/index.ts",
|
|
1339
|
+
"type": "registry:ui",
|
|
1340
|
+
"content": "export * from \"./navigation-menu\";\n"
|
|
1341
|
+
},
|
|
1342
|
+
{
|
|
1343
|
+
"path": "components/navigation-menu/navigation-menu.tsx",
|
|
1344
|
+
"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-xl 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
|
+
}
|
|
1347
|
+
]
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
"name": "number-field",
|
|
1351
|
+
"type": "registry:ui",
|
|
1352
|
+
"title": "Number Field",
|
|
1353
|
+
"description": "Accessible Number Field primitive component built with Base UI and Tailwind v4.",
|
|
1354
|
+
"license": "GPL-3.0-only",
|
|
1355
|
+
"dependencies": [
|
|
1356
|
+
"@base-ui/react",
|
|
1357
|
+
"lucide-react"
|
|
1358
|
+
],
|
|
1359
|
+
"devDependencies": [],
|
|
1360
|
+
"registryDependencies": [
|
|
1361
|
+
"utils"
|
|
1362
|
+
],
|
|
1363
|
+
"dependencyVersions": {
|
|
1364
|
+
"@base-ui/react": "^1.6.0",
|
|
1365
|
+
"lucide-react": "^1.25.0"
|
|
1366
|
+
},
|
|
1367
|
+
"files": [
|
|
1368
|
+
{
|
|
1369
|
+
"path": "components/number-field/index.ts",
|
|
1370
|
+
"type": "registry:ui",
|
|
1371
|
+
"content": "export * from \"./number-field\";\n"
|
|
1372
|
+
},
|
|
1373
|
+
{
|
|
1374
|
+
"path": "components/number-field/number-field.tsx",
|
|
1375
|
+
"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"
|
|
1377
|
+
}
|
|
1378
|
+
]
|
|
1379
|
+
},
|
|
1380
|
+
{
|
|
1381
|
+
"name": "pagination",
|
|
1382
|
+
"type": "registry:ui",
|
|
1383
|
+
"title": "Pagination",
|
|
1384
|
+
"description": "Accessible Pagination primitive component built with Base UI and Tailwind v4.",
|
|
1385
|
+
"license": "GPL-3.0-only",
|
|
1386
|
+
"dependencies": [
|
|
1387
|
+
"lucide-react"
|
|
1388
|
+
],
|
|
1389
|
+
"devDependencies": [],
|
|
1390
|
+
"registryDependencies": [
|
|
1391
|
+
"button",
|
|
1392
|
+
"utils"
|
|
1393
|
+
],
|
|
1394
|
+
"dependencyVersions": {
|
|
1395
|
+
"lucide-react": "^1.25.0"
|
|
1396
|
+
},
|
|
1397
|
+
"files": [
|
|
1398
|
+
{
|
|
1399
|
+
"path": "components/pagination/index.ts",
|
|
1400
|
+
"type": "registry:ui",
|
|
1401
|
+
"content": "export {\n Pagination,\n PaginationContent,\n PaginationItem,\n PaginationLink,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n type PaginationLinkProps,\n} from \"./pagination\";\n"
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
"path": "components/pagination/pagination.tsx",
|
|
1405
|
+
"type": "registry:ui",
|
|
1406
|
+
"content": "import * as React from \"react\";\nimport { ChevronLeft, ChevronRight, MoreHorizontal } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { buttonVariants, type ButtonProps } from \"../button\";\n\nexport const Pagination = ({ className, ...props }: React.ComponentProps<\"nav\">) => (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n className={cn(\"mx-auto flex w-full justify-center\", className)}\n {...props}\n />\n);\nPagination.displayName = \"Pagination\";\n\nexport const PaginationContent = React.forwardRef<\n HTMLUListElement,\n React.ComponentProps<\"ul\">\n>(({ className, ...props }, ref) => (\n <ul\n ref={ref}\n className={cn(\"flex flex-row items-center gap-1\", className)}\n {...props}\n />\n));\nPaginationContent.displayName = \"PaginationContent\";\n\nexport const PaginationItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentProps<\"li\">\n>(({ className, ...props }, ref) => (\n <li ref={ref} className={cn(\"\", className)} {...props} />\n));\nPaginationItem.displayName = \"PaginationItem\";\n\nexport type PaginationLinkProps = {\n isActive?: boolean;\n} & Pick<ButtonProps, \"size\"> &\n React.ComponentProps<\"a\">;\n\nexport const PaginationLink = ({\n className,\n isActive,\n size = \"icon\",\n ...props\n}: PaginationLinkProps) => (\n <a\n aria-current={isActive ? \"page\" : undefined}\n className={cn(\n buttonVariants({\n variant: isActive ? \"outline\" : \"ghost\",\n size,\n }),\n className\n )}\n {...props}\n />\n);\nPaginationLink.displayName = \"PaginationLink\";\n\nexport const PaginationPrevious = ({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) => (\n <PaginationLink\n aria-label=\"Go to previous page\"\n size=\"md\"\n className={cn(\"gap-1 pl-2.5\", className)}\n {...props}\n >\n <ChevronLeft className=\"h-4 w-4\" />\n <span>Previous</span>\n </PaginationLink>\n);\nPaginationPrevious.displayName = \"PaginationPrevious\";\n\nexport const PaginationNext = ({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) => (\n <PaginationLink\n aria-label=\"Go to next page\"\n size=\"md\"\n className={cn(\"gap-1 pr-2.5\", className)}\n {...props}\n >\n <span>Next</span>\n <ChevronRight className=\"h-4 w-4\" />\n </PaginationLink>\n);\nPaginationNext.displayName = \"PaginationNext\";\n\nexport const PaginationEllipsis = ({\n className,\n ...props\n}: React.ComponentProps<\"span\">) => (\n <span\n aria-hidden\n className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n);\nPaginationEllipsis.displayName = \"PaginationEllipsis\";\n"
|
|
1407
|
+
}
|
|
1408
|
+
]
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
"name": "popover",
|
|
1412
|
+
"type": "registry:ui",
|
|
1413
|
+
"title": "Popover",
|
|
1414
|
+
"description": "Accessible Popover primitive component built with Base UI and Tailwind v4.",
|
|
1415
|
+
"license": "GPL-3.0-only",
|
|
1416
|
+
"dependencies": [
|
|
1417
|
+
"@base-ui/react"
|
|
1418
|
+
],
|
|
1419
|
+
"devDependencies": [],
|
|
1420
|
+
"registryDependencies": [
|
|
1421
|
+
"utils"
|
|
1422
|
+
],
|
|
1423
|
+
"dependencyVersions": {
|
|
1424
|
+
"@base-ui/react": "^1.6.0"
|
|
1425
|
+
},
|
|
1426
|
+
"files": [
|
|
1427
|
+
{
|
|
1428
|
+
"path": "components/popover/index.ts",
|
|
1429
|
+
"type": "registry:ui",
|
|
1430
|
+
"content": "export * from \"./popover\";\n"
|
|
1431
|
+
},
|
|
1432
|
+
{
|
|
1433
|
+
"path": "components/popover/popover.tsx",
|
|
1434
|
+
"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-md border border-border bg-background p-4 text-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
|
+
}
|
|
1437
|
+
]
|
|
1438
|
+
},
|
|
1439
|
+
{
|
|
1440
|
+
"name": "progress",
|
|
1441
|
+
"type": "registry:ui",
|
|
1442
|
+
"title": "Progress",
|
|
1443
|
+
"description": "Accessible Progress primitive component built with Base UI and Tailwind v4.",
|
|
1444
|
+
"license": "GPL-3.0-only",
|
|
1445
|
+
"dependencies": [
|
|
1446
|
+
"@base-ui/react",
|
|
1447
|
+
"class-variance-authority"
|
|
1448
|
+
],
|
|
1449
|
+
"devDependencies": [],
|
|
1450
|
+
"registryDependencies": [
|
|
1451
|
+
"utils"
|
|
1452
|
+
],
|
|
1453
|
+
"dependencyVersions": {
|
|
1454
|
+
"@base-ui/react": "^1.6.0",
|
|
1455
|
+
"class-variance-authority": "^0.7.1"
|
|
1456
|
+
},
|
|
1457
|
+
"files": [
|
|
1458
|
+
{
|
|
1459
|
+
"path": "components/progress/index.ts",
|
|
1460
|
+
"type": "registry:ui",
|
|
1461
|
+
"content": "export * from \"./progress\";\n"
|
|
1462
|
+
},
|
|
1463
|
+
{
|
|
1464
|
+
"path": "components/progress/progress.tsx",
|
|
1465
|
+
"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-all 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-all duration-300 ease-in-out\",\n {\n variants: {\n variant: {\n default: \"bg-primary\",\n neutral: \"bg-muted-foreground\",\n success: \"bg-pulse-green-foreground\",\n warning: \"bg-signal-teal-foreground\",\n destructive: \"bg-destructive\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\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}\n\nexport const Progress = React.forwardRef<HTMLDivElement, ProgressProps>(\n ({ className, value = 0, size, variant = \"default\", ...props }, ref) => (\n <BaseProgress.Root\n ref={ref}\n value={value}\n className={cn(progressVariants({ size }), className)}\n {...props}\n >\n <BaseProgress.Track className=\"h-full w-full\">\n <BaseProgress.Indicator\n className={cn(indicatorVariants({ variant }))}\n style={{ transform: `translateX(-${100 - Math.min(100, Math.max(0, value))})%` }}\n />\n </BaseProgress.Track>\n </BaseProgress.Root>\n )\n);\nProgress.displayName = \"Progress\";\n"
|
|
1467
|
+
}
|
|
1468
|
+
]
|
|
1469
|
+
},
|
|
1470
|
+
{
|
|
1471
|
+
"name": "project-kanban-board",
|
|
1472
|
+
"type": "registry:block",
|
|
1473
|
+
"title": "Project Kanban Board Block",
|
|
1474
|
+
"description": "Composed Project Kanban Board block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
1475
|
+
"license": "GPL-3.0-only",
|
|
1476
|
+
"dependencies": [
|
|
1477
|
+
"lucide-react"
|
|
1478
|
+
],
|
|
1479
|
+
"devDependencies": [],
|
|
1480
|
+
"registryDependencies": [
|
|
1481
|
+
"avatar",
|
|
1482
|
+
"badge",
|
|
1483
|
+
"button",
|
|
1484
|
+
"card",
|
|
1485
|
+
"dropdown-menu",
|
|
1486
|
+
"utils"
|
|
1487
|
+
],
|
|
1488
|
+
"dependencyVersions": {
|
|
1489
|
+
"lucide-react": "^1.25.0"
|
|
1490
|
+
},
|
|
1491
|
+
"files": [
|
|
1492
|
+
{
|
|
1493
|
+
"path": "blocks/project-kanban-board/index.ts",
|
|
1494
|
+
"type": "registry:block",
|
|
1495
|
+
"content": "export {\n ProjectKanbanBoard,\n type ProjectKanbanBoardProps,\n type KanbanTask,\n type KanbanColumnId,\n} from \"./project-kanban-board\";\n"
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
"path": "blocks/project-kanban-board/project-kanban-board.tsx",
|
|
1499
|
+
"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-3 md:grid-cols-4 md:gap-4 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-3 md:h-full md:min-h-[480px]\"\n >\n <div className=\"flex items-center justify-between pb-3 border-b border-border\">\n <div className=\"flex items-center gap-2\">\n {column.icon}\n <span className=\"text-xs font-semibold text-foreground uppercase tracking-wider\">\n {column.title}\n </span>\n <Badge\n variant=\"neutral\"\n className=\"h-5 px-1.5 text-[10px] font-mono text-muted-foreground border-border\"\n >\n {columnTasks.length}\n </Badge>\n </div>\n\n {onAddTask && (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-6 w-6 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-2.5 pt-3 md:flex-1 md:overflow-y-auto\">\n {columnTasks.length === 0 && (\n <p className=\"rounded-md border border-dashed border-border/70 px-3 py-6 text-center text-[11px] 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-3 border border-border bg-card shadow-2xs hover:border-primary/50 transition-colors\"\n >\n <div className=\"flex items-center justify-between gap-1 mb-2\">\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-1 border-t border-border/40\">\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
|
+
}
|
|
1502
|
+
]
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
"name": "radio-group",
|
|
1506
|
+
"type": "registry:ui",
|
|
1507
|
+
"title": "Radio Group",
|
|
1508
|
+
"description": "Accessible Radio Group primitive component built with Base UI and Tailwind v4.",
|
|
1509
|
+
"license": "GPL-3.0-only",
|
|
1510
|
+
"dependencies": [
|
|
1511
|
+
"@base-ui/react"
|
|
1512
|
+
],
|
|
1513
|
+
"devDependencies": [],
|
|
1514
|
+
"registryDependencies": [
|
|
1515
|
+
"utils"
|
|
1516
|
+
],
|
|
1517
|
+
"dependencyVersions": {
|
|
1518
|
+
"@base-ui/react": "^1.6.0"
|
|
1519
|
+
},
|
|
1520
|
+
"files": [
|
|
1521
|
+
{
|
|
1522
|
+
"path": "components/radio-group/index.ts",
|
|
1523
|
+
"type": "registry:ui",
|
|
1524
|
+
"content": "export * from \"./radio-group\";\n"
|
|
1525
|
+
},
|
|
1526
|
+
{
|
|
1527
|
+
"path": "components/radio-group/radio-group.tsx",
|
|
1528
|
+
"type": "registry:ui",
|
|
1529
|
+
"content": "import * as React from \"react\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport { Radio as BaseRadio } from \"@base-ui/react/radio\";\nimport { cn } from \"../../lib/utils\";\n\nexport type RadioGroupProps = React.ComponentPropsWithoutRef<\n typeof BaseRadioGroup\n>;\n\nexport const RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>(\n ({ className, ...props }, ref) => {\n return (\n <BaseRadioGroup\n className={cn(\"grid gap-2.5\", className)}\n {...props}\n ref={ref}\n />\n );\n }\n);\nRadioGroup.displayName = \"RadioGroup\";\n\nexport type RadioGroupItemProps = React.ComponentPropsWithoutRef<\n typeof BaseRadio.Root\n>;\n\n/**\n * Unchecked radios are neutral hairlines (`border-smoke` on transparent, fog\n * on hover); the checked state takes the semantic `primary` fill with a\n * foreground dot. The lime/void flip between themes therefore stays a token\n * decision instead of a hardcoded hue.\n */\nexport const RadioGroupItem = React.forwardRef<\n HTMLButtonElement,\n RadioGroupItemProps\n>(({ className, ...props }, ref) => {\n return (\n <BaseRadio.Root\n ref={ref}\n className={cn(\n \"peer aspect-square h-4 w-4 shrink-0 cursor-pointer rounded-full border border-smoke bg-transparent text-foreground outline-none transition-colors duration-150 hover:border-fog 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 data-checked:border-primary data-checked:bg-primary\",\n className\n )}\n {...props}\n >\n <BaseRadio.Indicator className=\"flex h-full w-full items-center justify-center\">\n <span\n data-testid=\"radio-dot\"\n aria-hidden=\"true\"\n className=\"h-1.5 w-1.5 rounded-full bg-primary-foreground\"\n />\n </BaseRadio.Indicator>\n </BaseRadio.Root>\n );\n});\nRadioGroupItem.displayName = \"RadioGroupItem\";\n"
|
|
1530
|
+
}
|
|
1531
|
+
]
|
|
1532
|
+
},
|
|
1533
|
+
{
|
|
1534
|
+
"name": "rating",
|
|
1535
|
+
"type": "registry:ui",
|
|
1536
|
+
"title": "Rating",
|
|
1537
|
+
"description": "Accessible Rating primitive component built with Base UI and Tailwind v4.",
|
|
1538
|
+
"license": "GPL-3.0-only",
|
|
1539
|
+
"dependencies": [
|
|
1540
|
+
"lucide-react"
|
|
1541
|
+
],
|
|
1542
|
+
"devDependencies": [],
|
|
1543
|
+
"registryDependencies": [
|
|
1544
|
+
"utils"
|
|
1545
|
+
],
|
|
1546
|
+
"dependencyVersions": {
|
|
1547
|
+
"lucide-react": "^1.25.0"
|
|
1548
|
+
},
|
|
1549
|
+
"files": [
|
|
1550
|
+
{
|
|
1551
|
+
"path": "components/rating/index.ts",
|
|
1552
|
+
"type": "registry:ui",
|
|
1553
|
+
"content": "export { Rating, type RatingProps } from \"./rating\";\n"
|
|
1554
|
+
},
|
|
1555
|
+
{
|
|
1556
|
+
"path": "components/rating/rating.tsx",
|
|
1557
|
+
"type": "registry:ui",
|
|
1558
|
+
"content": "import * as React from \"react\";\nimport { Star } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface RatingProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n value?: number;\n defaultValue?: number;\n max?: number;\n readOnly?: boolean;\n onChange?: (value: number) => void;\n}\n\nexport const Rating = React.forwardRef<HTMLDivElement, RatingProps>(\n (\n {\n value: valueProp,\n defaultValue = 0,\n max = 5,\n readOnly = false,\n onChange,\n className,\n onKeyDown,\n ...props\n },\n ref\n ) => {\n const [hoverValue, setHoverValue] = React.useState<number | null>(null);\n const [internalValue, setInternalValue] = React.useState(defaultValue);\n const radioRefs = React.useRef<Array<HTMLButtonElement | null>>([]);\n\n const isControlled = valueProp !== undefined;\n const value = isControlled ? valueProp : internalValue;\n\n const handleSelect = (val: number) => {\n if (readOnly) return;\n if (!isControlled) {\n setInternalValue(val);\n }\n onChange?.(val);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(e);\n\n if (readOnly) return;\n\n const { key } = e;\n if (\n key !== \"ArrowRight\" &&\n key !== \"ArrowUp\" &&\n key !== \"ArrowLeft\" &&\n key !== \"ArrowDown\" &&\n key !== \"Home\" &&\n key !== \"End\"\n ) {\n return;\n }\n\n e.preventDefault();\n\n const current = value >= 1 ? value : 1;\n let next = current;\n\n if (key === \"ArrowRight\" || key === \"ArrowUp\") {\n next = Math.min(max, current + 1);\n } else if (key === \"ArrowLeft\" || key === \"ArrowDown\") {\n next = Math.max(1, current - 1);\n } else if (key === \"Home\") {\n next = 1;\n } else if (key === \"End\") {\n next = max;\n }\n\n if (next !== value) {\n handleSelect(next);\n }\n radioRefs.current[next - 1]?.focus();\n };\n\n const tabbableValue = value >= 1 && value <= max ? value : 1;\n\n return (\n <div\n ref={ref}\n role=\"radiogroup\"\n aria-label=\"Rating\"\n data-valuenow={value}\n className={cn(\"inline-flex items-center gap-1\", className)}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {Array.from({ length: max }, (_, index) => {\n const starNumber = index + 1;\n const isFilled = (hoverValue ?? value) >= starNumber;\n\n return (\n <button\n key={starNumber}\n ref={(node) => {\n radioRefs.current[index] = node;\n }}\n type=\"button\"\n disabled={readOnly}\n aria-label={`${starNumber} of ${max} stars`}\n aria-checked={value === starNumber}\n role=\"radio\"\n tabIndex={readOnly || starNumber !== tabbableValue ? -1 : 0}\n onMouseEnter={() => !readOnly && setHoverValue(starNumber)}\n onMouseLeave={() => !readOnly && setHoverValue(null)}\n onClick={() => handleSelect(starNumber)}\n className={cn(\n \"rounded-xs p-0.5 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\",\n readOnly\n ? \"cursor-default pointer-events-none\"\n : \"cursor-pointer hover:scale-110 transition-transform\"\n )}\n >\n <Star\n className={cn(\n \"h-4 w-4 transition-colors\",\n isFilled\n ? \"fill-pulse-green-foreground text-pulse-green-foreground\"\n : \"fill-transparent text-muted-foreground/40\"\n )}\n />\n </button>\n );\n })}\n </div>\n );\n }\n);\nRating.displayName = \"Rating\";\n"
|
|
1559
|
+
}
|
|
1560
|
+
]
|
|
1561
|
+
},
|
|
1562
|
+
{
|
|
1563
|
+
"name": "resizable",
|
|
1564
|
+
"type": "registry:ui",
|
|
1565
|
+
"title": "Resizable",
|
|
1566
|
+
"description": "Accessible Resizable primitive component built with Base UI and Tailwind v4.",
|
|
1567
|
+
"license": "GPL-3.0-only",
|
|
1568
|
+
"dependencies": [
|
|
1569
|
+
"lucide-react",
|
|
1570
|
+
"react-resizable-panels"
|
|
1571
|
+
],
|
|
1572
|
+
"devDependencies": [],
|
|
1573
|
+
"registryDependencies": [
|
|
1574
|
+
"utils"
|
|
1575
|
+
],
|
|
1576
|
+
"dependencyVersions": {
|
|
1577
|
+
"lucide-react": "^1.25.0",
|
|
1578
|
+
"react-resizable-panels": "^2.1.7"
|
|
1579
|
+
},
|
|
1580
|
+
"files": [
|
|
1581
|
+
{
|
|
1582
|
+
"path": "components/resizable/index.ts",
|
|
1583
|
+
"type": "registry:ui",
|
|
1584
|
+
"content": "export {\n ResizablePanelGroup,\n ResizablePanel,\n ResizableHandle,\n} from \"./resizable\";\n"
|
|
1585
|
+
},
|
|
1586
|
+
{
|
|
1587
|
+
"path": "components/resizable/resizable.tsx",
|
|
1588
|
+
"type": "registry:ui",
|
|
1589
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { GripVertical } from \"lucide-react\";\nimport * as ResizablePrimitive from \"react-resizable-panels\";\nimport { cn } from \"../../lib/utils\";\n\nexport const ResizablePanelGroup = ({\n className,\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (\n <ResizablePrimitive.PanelGroup\n className={cn(\n \"flex h-full w-full data-[panel-group-direction=vertical]:flex-col\",\n className\n )}\n {...props}\n />\n);\n\nexport const ResizablePanel = ResizablePrimitive.Panel;\n\nexport const ResizableHandle = ({\n withHandle,\n className,\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {\n withHandle?: boolean;\n}) => (\n <ResizablePrimitive.PanelResizeHandle\n className={cn(\n \"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90\",\n className\n )}\n {...props}\n >\n {withHandle && (\n <div className=\"z-10 flex h-4 w-3 items-center justify-center rounded-sm border border-border bg-background\">\n <GripVertical className=\"h-2.5 w-2.5 text-muted-foreground\" />\n </div>\n )}\n </ResizablePrimitive.PanelResizeHandle>\n);\n"
|
|
1590
|
+
}
|
|
1591
|
+
]
|
|
1592
|
+
},
|
|
1593
|
+
{
|
|
1594
|
+
"name": "scroll-area",
|
|
1595
|
+
"type": "registry:ui",
|
|
1596
|
+
"title": "Scroll Area",
|
|
1597
|
+
"description": "Accessible Scroll Area primitive component built with Base UI and Tailwind v4.",
|
|
1598
|
+
"license": "GPL-3.0-only",
|
|
1599
|
+
"dependencies": [
|
|
1600
|
+
"@base-ui/react"
|
|
1601
|
+
],
|
|
1602
|
+
"devDependencies": [],
|
|
1603
|
+
"registryDependencies": [
|
|
1604
|
+
"utils"
|
|
1605
|
+
],
|
|
1606
|
+
"dependencyVersions": {
|
|
1607
|
+
"@base-ui/react": "^1.6.0"
|
|
1608
|
+
},
|
|
1609
|
+
"files": [
|
|
1610
|
+
{
|
|
1611
|
+
"path": "components/scroll-area/index.ts",
|
|
1612
|
+
"type": "registry:ui",
|
|
1613
|
+
"content": "export * from \"./scroll-area\";\n"
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
"path": "components/scroll-area/scroll-area.tsx",
|
|
1617
|
+
"type": "registry:ui",
|
|
1618
|
+
"content": "import * as React from \"react\";\nimport { ScrollArea as BaseScrollArea } from \"@base-ui/react/scroll-area\";\nimport { cn } from \"../../lib/utils\";\n\nexport const ScrollArea = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseScrollArea.Root>\n>(({ className, children, ...props }, ref) => (\n <BaseScrollArea.Root\n ref={ref}\n className={cn(\"relative overflow-hidden\", className)}\n {...props}\n >\n <BaseScrollArea.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </BaseScrollArea.Viewport>\n <ScrollBar />\n <BaseScrollArea.Corner />\n </BaseScrollArea.Root>\n));\nScrollArea.displayName = \"ScrollArea\";\n\nexport const ScrollBar = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseScrollArea.Scrollbar> & {\n orientation?: \"vertical\" | \"horizontal\";\n }\n>(({ className, orientation = \"vertical\", keepMounted = true, ...props }, ref) => (\n <BaseScrollArea.Scrollbar\n ref={ref}\n orientation={orientation}\n keepMounted={keepMounted}\n className={cn(\n \"flex select-none touch-none transition-colors duration-150 p-0.5 bg-transparent hover:bg-muted/50\",\n orientation === \"vertical\" &&\n \"h-full w-2.5 border-l border-l-transparent\",\n orientation === \"horizontal\" &&\n \"h-2.5 w-full flex-col border-t border-t-transparent\",\n className\n )}\n {...props}\n >\n <BaseScrollArea.Thumb className=\"relative flex-1 rounded-full bg-border hover:bg-muted-foreground/60 transition-colors\" />\n </BaseScrollArea.Scrollbar>\n));\nScrollBar.displayName = \"ScrollBar\";\n"
|
|
1619
|
+
}
|
|
1620
|
+
]
|
|
1621
|
+
},
|
|
1622
|
+
{
|
|
1623
|
+
"name": "select",
|
|
1624
|
+
"type": "registry:ui",
|
|
1625
|
+
"title": "Select",
|
|
1626
|
+
"description": "Accessible Select primitive component built with Base UI and Tailwind v4.",
|
|
1627
|
+
"license": "GPL-3.0-only",
|
|
1628
|
+
"dependencies": [
|
|
1629
|
+
"@base-ui/react",
|
|
1630
|
+
"lucide-react"
|
|
1631
|
+
],
|
|
1632
|
+
"devDependencies": [],
|
|
1633
|
+
"registryDependencies": [
|
|
1634
|
+
"utils"
|
|
1635
|
+
],
|
|
1636
|
+
"dependencyVersions": {
|
|
1637
|
+
"@base-ui/react": "^1.6.0",
|
|
1638
|
+
"lucide-react": "^1.25.0"
|
|
1639
|
+
},
|
|
1640
|
+
"files": [
|
|
1641
|
+
{
|
|
1642
|
+
"path": "components/select/index.ts",
|
|
1643
|
+
"type": "registry:ui",
|
|
1644
|
+
"content": "export * from \"./select\";\n"
|
|
1645
|
+
},
|
|
1646
|
+
{
|
|
1647
|
+
"path": "components/select/select.tsx",
|
|
1648
|
+
"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-card 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 [&>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\",\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-2 py-1.5 text-xs font-semibold 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 rounded-sm px-2.5 py-1.5 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
|
+
}
|
|
1651
|
+
]
|
|
1652
|
+
},
|
|
1653
|
+
{
|
|
1654
|
+
"name": "separator",
|
|
1655
|
+
"type": "registry:ui",
|
|
1656
|
+
"title": "Separator",
|
|
1657
|
+
"description": "Accessible Separator primitive component built with Base UI and Tailwind v4.",
|
|
1658
|
+
"license": "GPL-3.0-only",
|
|
1659
|
+
"dependencies": [
|
|
1660
|
+
"@base-ui/react"
|
|
1661
|
+
],
|
|
1662
|
+
"devDependencies": [],
|
|
1663
|
+
"registryDependencies": [
|
|
1664
|
+
"utils"
|
|
1665
|
+
],
|
|
1666
|
+
"dependencyVersions": {
|
|
1667
|
+
"@base-ui/react": "^1.6.0"
|
|
1668
|
+
},
|
|
1669
|
+
"files": [
|
|
1670
|
+
{
|
|
1671
|
+
"path": "components/separator/index.ts",
|
|
1672
|
+
"type": "registry:ui",
|
|
1673
|
+
"content": "export * from \"./separator\";\n"
|
|
1674
|
+
},
|
|
1675
|
+
{
|
|
1676
|
+
"path": "components/separator/separator.tsx",
|
|
1677
|
+
"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-graphite\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className\n )}\n {...props}\n />\n )\n);\nSeparator.displayName = \"Separator\";\n"
|
|
1679
|
+
}
|
|
1680
|
+
]
|
|
1681
|
+
},
|
|
1682
|
+
{
|
|
1683
|
+
"name": "sheet",
|
|
1684
|
+
"type": "registry:ui",
|
|
1685
|
+
"title": "Sheet",
|
|
1686
|
+
"description": "Accessible Sheet primitive component built with Base UI and Tailwind v4.",
|
|
1687
|
+
"license": "GPL-3.0-only",
|
|
1688
|
+
"dependencies": [
|
|
1689
|
+
"@base-ui/react",
|
|
1690
|
+
"class-variance-authority",
|
|
1691
|
+
"lucide-react"
|
|
1692
|
+
],
|
|
1693
|
+
"devDependencies": [],
|
|
1694
|
+
"registryDependencies": [
|
|
1695
|
+
"utils"
|
|
1696
|
+
],
|
|
1697
|
+
"dependencyVersions": {
|
|
1698
|
+
"@base-ui/react": "^1.6.0",
|
|
1699
|
+
"class-variance-authority": "^0.7.1",
|
|
1700
|
+
"lucide-react": "^1.25.0"
|
|
1701
|
+
},
|
|
1702
|
+
"files": [
|
|
1703
|
+
{
|
|
1704
|
+
"path": "components/sheet/index.ts",
|
|
1705
|
+
"type": "registry:ui",
|
|
1706
|
+
"content": "export * from \"./sheet\";\n"
|
|
1707
|
+
},
|
|
1708
|
+
{
|
|
1709
|
+
"path": "components/sheet/sheet.tsx",
|
|
1710
|
+
"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-4 overflow-y-auto overscroll-contain bg-popover p-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\nconst SheetContent = React.forwardRef<\n React.ElementRef<typeof BaseDialog.Popup>,\n SheetContentProps\n>(({ side = \"right\", className, children, ...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 className={cn(sheetVariants({ side }), className)}\n {...props}\n >\n {children}\n <BaseDialog.Close className=\"absolute right-4 top-4 rounded-md p-1 opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-muted-foreground hover:text-foreground\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</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-4\",\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 sm:flex-row sm:justify-end 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
|
+
}
|
|
1713
|
+
]
|
|
1714
|
+
},
|
|
1715
|
+
{
|
|
1716
|
+
"name": "sidebar",
|
|
1717
|
+
"type": "registry:ui",
|
|
1718
|
+
"title": "Sidebar",
|
|
1719
|
+
"description": "Accessible Sidebar primitive component built with Base UI and Tailwind v4.",
|
|
1720
|
+
"license": "GPL-3.0-only",
|
|
1721
|
+
"dependencies": [
|
|
1722
|
+
"class-variance-authority",
|
|
1723
|
+
"lucide-react"
|
|
1724
|
+
],
|
|
1725
|
+
"devDependencies": [],
|
|
1726
|
+
"registryDependencies": [
|
|
1727
|
+
"button",
|
|
1728
|
+
"sheet",
|
|
1729
|
+
"utils"
|
|
1730
|
+
],
|
|
1731
|
+
"dependencyVersions": {
|
|
1732
|
+
"class-variance-authority": "^0.7.1",
|
|
1733
|
+
"lucide-react": "^1.25.0"
|
|
1734
|
+
},
|
|
1735
|
+
"files": [
|
|
1736
|
+
{
|
|
1737
|
+
"path": "components/sidebar/index.ts",
|
|
1738
|
+
"type": "registry:ui",
|
|
1739
|
+
"content": "export {\n Sidebar,\n SidebarProvider,\n SidebarTrigger,\n SidebarHeader,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupLabel,\n SidebarMenu,\n SidebarMenuItem,\n SidebarMenuButton,\n SidebarInset,\n useSidebar,\n type SidebarProps,\n type SidebarProviderProps,\n type SidebarMenuButtonProps,\n} from \"./sidebar\";\n"
|
|
1740
|
+
},
|
|
1741
|
+
{
|
|
1742
|
+
"path": "components/sidebar/sidebar.tsx",
|
|
1743
|
+
"type": "registry:ui",
|
|
1744
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { PanelLeft } from \"lucide-react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../button\";\nimport { Sheet, SheetContent } from \"../sheet\";\n\nconst SIDEBAR_WIDTH = \"16rem\";\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\";\nconst SIDEBAR_WIDTH_ICON = \"3rem\";\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\n\ntype SidebarContextType = {\n state: \"expanded\" | \"collapsed\";\n open: boolean;\n setOpen: (open: boolean | ((value: boolean) => boolean)) => void;\n openMobile: boolean;\n setOpenMobile: (open: boolean | ((value: boolean) => boolean)) => void;\n isMobile: boolean;\n toggleSidebar: () => void;\n};\n\nconst SidebarContext = React.createContext<SidebarContextType | null>(null);\n\nexport function useSidebar() {\n const context = React.useContext(SidebarContext);\n if (!context) {\n throw new Error(\"useSidebar must be used within a SidebarProvider.\");\n }\n return context;\n}\n\nexport interface SidebarProviderProps extends React.ComponentProps<\"div\"> {\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\nexport const SidebarProvider = React.forwardRef<\n HTMLDivElement,\n SidebarProviderProps\n>(\n (\n {\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n className,\n style,\n children,\n ...props\n },\n ref\n ) => {\n const [isMobile, setIsMobile] = React.useState(false);\n const [openMobile, setOpenMobile] = React.useState(false);\n const [_open, _setOpen] = React.useState(defaultOpen);\n\n const open = openProp !== undefined ? openProp : _open;\n const setOpen = React.useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === \"function\" ? value(open) : value;\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n _setOpen(openState);\n }\n },\n [setOpenProp, open]\n );\n\n React.useEffect(() => {\n const checkMobile = () => {\n setIsMobile(window.innerWidth < 768);\n };\n checkMobile();\n window.addEventListener(\"resize\", checkMobile);\n return () => window.removeEventListener(\"resize\", checkMobile);\n }, []);\n\n const toggleSidebar = React.useCallback(() => {\n if (isMobile) {\n setOpenMobile((prev) => !prev);\n } else {\n setOpen((prev) => !prev);\n }\n }, [isMobile, setOpen]);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (\n event.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => window.removeEventListener(\"keydown\", handleKeyDown);\n }, [toggleSidebar]);\n\n const state = open ? \"expanded\" : \"collapsed\";\n\n const contextValue = React.useMemo<SidebarContextType>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]\n );\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <div\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH,\n \"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n \"group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar\",\n className\n )}\n ref={ref}\n {...props}\n >\n {children}\n </div>\n </SidebarContext.Provider>\n );\n }\n);\nSidebarProvider.displayName = \"SidebarProvider\";\n\nexport interface SidebarProps extends React.ComponentProps<\"div\"> {\n side?: \"left\" | \"right\";\n variant?: \"sidebar\" | \"floating\" | \"inset\";\n collapsible?: \"offcanvas\" | \"icon\" | \"none\";\n}\n\nexport const Sidebar = React.forwardRef<HTMLDivElement, SidebarProps>(\n (\n {\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"offcanvas\",\n className,\n children,\n ...props\n },\n ref\n ) => {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n if (collapsible === \"none\") {\n return (\n <div\n className={cn(\n \"flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground border-r border-border\",\n className\n )}\n ref={ref}\n {...props}\n >\n {children}\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <Sheet open={openMobile} onOpenChange={setOpenMobile}>\n <SheetContent\n side={side}\n className=\"w-(--sidebar-width-mobile) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden\"\n style={\n {\n \"--sidebar-width-mobile\": SIDEBAR_WIDTH_MOBILE,\n } as React.CSSProperties\n }\n >\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SheetContent>\n </Sheet>\n );\n }\n\n return (\n <div\n ref={ref}\n className=\"group peer hidden md:block text-sidebar-foreground\"\n data-state={state}\n data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\n data-variant={variant}\n data-side={side}\n >\n <div\n className={cn(\n \"duration-200 relative h-svh w-(--sidebar-width) bg-transparent transition-[width] ease-linear\",\n \"group-data-[collapsible=offcanvas]:w-0\",\n \"group-data-[side=right]:rotate-180\",\n variant === \"floating\" || variant === \"inset\"\n ? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+calc(var(--spacing)*4))]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon)\"\n )}\n />\n <div\n className={cn(\n \"duration-200 fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] ease-linear md:flex flex-col border-r border-border bg-background\",\n side === \"left\"\n ? \"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]\"\n : \"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]\",\n variant === \"floating\" || variant === \"inset\"\n ? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+calc(var(--spacing)*4)+2px)]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l\",\n className\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n className=\"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-xl\"\n >\n {children}\n </div>\n </div>\n </div>\n );\n }\n);\nSidebar.displayName = \"Sidebar\";\n\nexport const SidebarTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof Button>\n>(({ className, onClick, ...props }, ref) => {\n const { toggleSidebar } = useSidebar();\n\n return (\n <Button\n ref={ref}\n data-sidebar=\"trigger\"\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-7 w-7\", className)}\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n {...props}\n >\n <PanelLeft className=\"h-4 w-4\" />\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n );\n});\nSidebarTrigger.displayName = \"SidebarTrigger\";\n\nexport const SidebarHeader = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-sidebar=\"header\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n));\nSidebarHeader.displayName = \"SidebarHeader\";\n\nexport const SidebarContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-sidebar=\"content\"\n className={cn(\n \"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden p-2\",\n className\n )}\n {...props}\n />\n));\nSidebarContent.displayName = \"SidebarContent\";\n\nexport const SidebarFooter = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-sidebar=\"footer\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n));\nSidebarFooter.displayName = \"SidebarFooter\";\n\nexport const SidebarGroup = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-sidebar=\"group\"\n className={cn(\n \"relative flex w-full min-w-0 flex-col p-2 group-data-[collapsible=icon]:p-0\",\n className\n )}\n {...props}\n />\n));\nSidebarGroup.displayName = \"SidebarGroup\";\n\nexport const SidebarGroupLabel = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-sidebar=\"group-label\"\n className={cn(\n \"duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-muted-foreground outline-none transition-[margin,opa] ease-linear\",\n \"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0\",\n className\n )}\n {...props}\n />\n));\nSidebarGroupLabel.displayName = \"SidebarGroupLabel\";\n\nexport const SidebarMenu = React.forwardRef<\n HTMLUListElement,\n React.ComponentProps<\"ul\">\n>(({ className, ...props }, ref) => (\n <ul\n ref={ref}\n data-sidebar=\"menu\"\n className={cn(\"flex w-full min-w-0 flex-col gap-1\", className)}\n {...props}\n />\n));\nSidebarMenu.displayName = \"SidebarMenu\";\n\nexport const SidebarMenuItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentProps<\"li\">\n>(({ className, ...props }, ref) => (\n <li\n ref={ref}\n data-sidebar=\"menu-item\"\n className={cn(\"group/menu-item relative\", className)}\n {...props}\n />\n));\nSidebarMenuItem.displayName = \"SidebarMenuItem\";\n\nconst sidebarMenuButtonVariants = cva(\n \"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0 [&>span:last-child]:truncate group-data-[collapsible=icon]:size-8 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:p-0 group-data-[collapsible=icon]:[&>span:last-child]:hidden\",\n {\n variants: {\n variant: {\n default: \"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground\",\n outline:\n \"bg-background shadow-[0_0_0_1px_var(--color-sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--color-sidebar-accent)]\",\n },\n size: {\n default: \"h-8 text-sm\",\n sm: \"h-7 text-xs\",\n lg: \"h-12 text-sm\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nexport interface SidebarMenuButtonProps\n extends React.ComponentProps<\"button\">,\n VariantProps<typeof sidebarMenuButtonVariants> {\n isActive?: boolean;\n}\n\nexport const SidebarMenuButton = React.forwardRef<\n HTMLButtonElement,\n SidebarMenuButtonProps\n>(({ className, variant, size, isActive = false, ...props }, ref) => (\n <button\n ref={ref}\n data-sidebar=\"menu-button\"\n data-size={size}\n data-active={isActive}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n {...props}\n />\n));\nSidebarMenuButton.displayName = \"SidebarMenuButton\";\n\nexport const SidebarInset = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"main\">\n>(({ className, ...props }, ref) => (\n <main\n ref={ref}\n className={cn(\n \"relative flex min-h-svh flex-1 flex-col bg-background\",\n \"peer-data-[variant=inset]:min-h-[calc(100svh-calc(var(--spacing)*4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-xl\",\n className\n )}\n {...props}\n />\n));\nSidebarInset.displayName = \"SidebarInset\";\n"
|
|
1745
|
+
}
|
|
1746
|
+
]
|
|
1747
|
+
},
|
|
1748
|
+
{
|
|
1749
|
+
"name": "skeleton",
|
|
1750
|
+
"type": "registry:ui",
|
|
1751
|
+
"title": "Skeleton",
|
|
1752
|
+
"description": "Accessible Skeleton primitive component built with Base UI and Tailwind v4.",
|
|
1753
|
+
"license": "GPL-3.0-only",
|
|
1754
|
+
"dependencies": [],
|
|
1755
|
+
"devDependencies": [],
|
|
1756
|
+
"registryDependencies": [
|
|
1757
|
+
"utils"
|
|
1758
|
+
],
|
|
1759
|
+
"dependencyVersions": {},
|
|
1760
|
+
"files": [
|
|
1761
|
+
{
|
|
1762
|
+
"path": "components/skeleton/index.ts",
|
|
1763
|
+
"type": "registry:ui",
|
|
1764
|
+
"content": "export * from \"./skeleton\";\n"
|
|
1765
|
+
},
|
|
1766
|
+
{
|
|
1767
|
+
"path": "components/skeleton/skeleton.tsx",
|
|
1768
|
+
"type": "registry:ui",
|
|
1769
|
+
"content": "import * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nexport const Skeleton = React.forwardRef<HTMLDivElement, SkeletonProps>(\n ({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n aria-hidden=\"true\"\n className={cn(\n \"animate-pulse rounded-md bg-muted/80 border border-border/30 backdrop-blur-xs\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nSkeleton.displayName = \"Skeleton\";\n"
|
|
1770
|
+
}
|
|
1771
|
+
]
|
|
1772
|
+
},
|
|
1773
|
+
{
|
|
1774
|
+
"name": "slider",
|
|
1775
|
+
"type": "registry:ui",
|
|
1776
|
+
"title": "Slider",
|
|
1777
|
+
"description": "Accessible Slider primitive component built with Base UI and Tailwind v4.",
|
|
1778
|
+
"license": "GPL-3.0-only",
|
|
1779
|
+
"dependencies": [
|
|
1780
|
+
"@base-ui/react"
|
|
1781
|
+
],
|
|
1782
|
+
"devDependencies": [],
|
|
1783
|
+
"registryDependencies": [
|
|
1784
|
+
"utils"
|
|
1785
|
+
],
|
|
1786
|
+
"dependencyVersions": {
|
|
1787
|
+
"@base-ui/react": "^1.6.0"
|
|
1788
|
+
},
|
|
1789
|
+
"files": [
|
|
1790
|
+
{
|
|
1791
|
+
"path": "components/slider/index.ts",
|
|
1792
|
+
"type": "registry:ui",
|
|
1793
|
+
"content": "export * from \"./slider\";\n"
|
|
1794
|
+
},
|
|
1795
|
+
{
|
|
1796
|
+
"path": "components/slider/slider.tsx",
|
|
1797
|
+
"type": "registry:ui",
|
|
1798
|
+
"content": "import * as React from \"react\";\nimport { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport { cn } from \"../../lib/utils\";\n\nexport type SliderProps = React.ComponentPropsWithoutRef<typeof BaseSlider.Root>;\n\nexport const Slider = React.forwardRef<\n HTMLDivElement,\n SliderProps\n>(({ className, \"aria-label\": ariaLabel, \"aria-labelledby\": ariaLabelledBy, ...props }, ref) => (\n <BaseSlider.Root\n ref={ref}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={cn(\n \"relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col\",\n className\n )}\n {...props}\n >\n <BaseSlider.Control className=\"relative flex w-full items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:w-5 data-[orientation=vertical]:justify-center\">\n <BaseSlider.Track className=\"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary data-[orientation=vertical]:h-full data-[orientation=vertical]:w-2 data-[orientation=vertical]:grow-0\">\n <BaseSlider.Indicator className=\"absolute h-full bg-primary\" />\n </BaseSlider.Track>\n <BaseSlider.Thumb\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className=\"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\"\n />\n </BaseSlider.Control>\n </BaseSlider.Root>\n));\n\nSlider.displayName = \"Slider\";\n"
|
|
1799
|
+
}
|
|
1800
|
+
]
|
|
1801
|
+
},
|
|
1802
|
+
{
|
|
1803
|
+
"name": "sonner",
|
|
1804
|
+
"type": "registry:ui",
|
|
1805
|
+
"title": "Sonner",
|
|
1806
|
+
"description": "Accessible Sonner primitive component built with Base UI and Tailwind v4.",
|
|
1807
|
+
"license": "GPL-3.0-only",
|
|
1808
|
+
"dependencies": [
|
|
1809
|
+
"sonner"
|
|
1810
|
+
],
|
|
1811
|
+
"devDependencies": [],
|
|
1812
|
+
"registryDependencies": [],
|
|
1813
|
+
"dependencyVersions": {
|
|
1814
|
+
"sonner": "^2.0.1"
|
|
1815
|
+
},
|
|
1816
|
+
"files": [
|
|
1817
|
+
{
|
|
1818
|
+
"path": "components/sonner/index.ts",
|
|
1819
|
+
"type": "registry:ui",
|
|
1820
|
+
"content": "export { Toaster, toast, type ToasterProps } from \"./sonner\";\n"
|
|
1821
|
+
},
|
|
1822
|
+
{
|
|
1823
|
+
"path": "components/sonner/sonner.tsx",
|
|
1824
|
+
"type": "registry:ui",
|
|
1825
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Toaster as Sonner, toast } from \"sonner\";\n\nexport type ToasterProps = React.ComponentProps<typeof Sonner>;\n\nexport const Toaster = ({ ...props }: ToasterProps) => {\n return (\n <Sonner\n className=\"toaster group\"\n toastOptions={{\n classNames: {\n toast:\n \"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-subtle-2 group-[.toaster]:rounded-lg\",\n description: \"group-[.toast]:text-muted-foreground\",\n actionButton:\n \"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground font-medium\",\n cancelButton:\n \"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground font-medium\",\n },\n }}\n {...props}\n />\n );\n};\n\nexport { toast };\n"
|
|
1826
|
+
}
|
|
1827
|
+
]
|
|
1828
|
+
},
|
|
1829
|
+
{
|
|
1830
|
+
"name": "spinner",
|
|
1831
|
+
"type": "registry:ui",
|
|
1832
|
+
"title": "Spinner",
|
|
1833
|
+
"description": "Accessible Spinner primitive component built with Base UI and Tailwind v4.",
|
|
1834
|
+
"license": "GPL-3.0-only",
|
|
1835
|
+
"dependencies": [
|
|
1836
|
+
"class-variance-authority",
|
|
1837
|
+
"lucide-react"
|
|
1838
|
+
],
|
|
1839
|
+
"devDependencies": [],
|
|
1840
|
+
"registryDependencies": [
|
|
1841
|
+
"utils"
|
|
1842
|
+
],
|
|
1843
|
+
"dependencyVersions": {
|
|
1844
|
+
"class-variance-authority": "^0.7.1",
|
|
1845
|
+
"lucide-react": "^1.25.0"
|
|
1846
|
+
},
|
|
1847
|
+
"files": [
|
|
1848
|
+
{
|
|
1849
|
+
"path": "components/spinner/index.ts",
|
|
1850
|
+
"type": "registry:ui",
|
|
1851
|
+
"content": "export * from \"./spinner\";\n"
|
|
1852
|
+
},
|
|
1853
|
+
{
|
|
1854
|
+
"path": "components/spinner/spinner.tsx",
|
|
1855
|
+
"type": "registry:ui",
|
|
1856
|
+
"content": "import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Loader2 } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport const spinnerVariants = cva(\n \"inline-flex items-center justify-center text-foreground/80 shrink-0\",\n {\n variants: {\n size: {\n sm: \"h-4 w-4\",\n md: \"h-6 w-6\",\n lg: \"h-8 w-8\",\n xl: \"h-12 w-12\",\n },\n variant: {\n default: \"text-foreground/80\",\n primary: \"text-primary\",\n secondary: \"text-secondary-foreground\",\n destructive: \"text-destructive\",\n },\n },\n defaultVariants: {\n size: \"md\",\n variant: \"default\",\n },\n }\n);\n\nexport interface SpinnerProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof spinnerVariants> {\n label?: string;\n}\n\nexport const Spinner = React.forwardRef<HTMLDivElement, SpinnerProps>(\n (\n {\n size = \"md\",\n variant = \"default\",\n label = \"Loading...\",\n className,\n ...props\n },\n ref\n ) => {\n return (\n <div\n ref={ref}\n role=\"status\"\n aria-label={label}\n className={cn(\"inline-flex items-center justify-center\", className)}\n {...props}\n >\n <Loader2\n data-testid=\"spinner-icon\"\n className={cn(\"animate-spin\", spinnerVariants({ size, variant }))}\n />\n <span className=\"sr-only\">{label}</span>\n </div>\n );\n }\n);\n\nSpinner.displayName = \"Spinner\";\n"
|
|
1857
|
+
}
|
|
1858
|
+
]
|
|
1859
|
+
},
|
|
1860
|
+
{
|
|
1861
|
+
"name": "stats-card-grid",
|
|
1862
|
+
"type": "registry:block",
|
|
1863
|
+
"title": "Stats Card Grid Block",
|
|
1864
|
+
"description": "Composed Stats Card Grid block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
1865
|
+
"license": "GPL-3.0-only",
|
|
1866
|
+
"dependencies": [],
|
|
1867
|
+
"devDependencies": [],
|
|
1868
|
+
"registryDependencies": [
|
|
1869
|
+
"badge",
|
|
1870
|
+
"card",
|
|
1871
|
+
"utils"
|
|
1872
|
+
],
|
|
1873
|
+
"dependencyVersions": {},
|
|
1874
|
+
"files": [
|
|
1875
|
+
{
|
|
1876
|
+
"path": "blocks/stats-card-grid/index.ts",
|
|
1877
|
+
"type": "registry:block",
|
|
1878
|
+
"content": "export * from \"./stats-card-grid\";\n"
|
|
1879
|
+
},
|
|
1880
|
+
{
|
|
1881
|
+
"path": "blocks/stats-card-grid/stats-card-grid.tsx",
|
|
1882
|
+
"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-xl border border-dashed border-border bg-muted/10 p-8 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-1 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-4 w-full\", gridColsClass, className)}>\n {stats.map((stat) => (\n <Card key={stat.id} className=\"relative overflow-hidden border-border shadow-xs\">\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-xs font-semibold text-muted-foreground\">\n {stat.title}\n </CardTitle>\n {stat.icon && (\n <div className=\"text-muted-foreground h-4 w-4 shrink-0\">\n {stat.icon}\n </div>\n )}\n </CardHeader>\n <CardContent className=\"space-y-1\">\n <div className=\"text-2xl font-bold tracking-tight text-foreground font-mono\">\n {stat.value}\n </div>\n {(stat.change || stat.description) && (\n <div className=\"flex items-center space-x-2 text-xs text-muted-foreground\">\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
|
+
}
|
|
1885
|
+
]
|
|
1886
|
+
},
|
|
1887
|
+
{
|
|
1888
|
+
"name": "stepper",
|
|
1889
|
+
"type": "registry:ui",
|
|
1890
|
+
"title": "Stepper",
|
|
1891
|
+
"description": "Accessible Stepper primitive component built with Base UI and Tailwind v4.",
|
|
1892
|
+
"license": "GPL-3.0-only",
|
|
1893
|
+
"dependencies": [
|
|
1894
|
+
"class-variance-authority",
|
|
1895
|
+
"lucide-react"
|
|
1896
|
+
],
|
|
1897
|
+
"devDependencies": [],
|
|
1898
|
+
"registryDependencies": [
|
|
1899
|
+
"utils"
|
|
1900
|
+
],
|
|
1901
|
+
"dependencyVersions": {
|
|
1902
|
+
"class-variance-authority": "^0.7.1",
|
|
1903
|
+
"lucide-react": "^1.25.0"
|
|
1904
|
+
},
|
|
1905
|
+
"files": [
|
|
1906
|
+
{
|
|
1907
|
+
"path": "components/stepper/index.ts",
|
|
1908
|
+
"type": "registry:ui",
|
|
1909
|
+
"content": "export {\n Stepper,\n Step,\n StepIndicator,\n StepTitle,\n StepDescription,\n StepSeparator,\n type StepperProps,\n type StepProps,\n type StepIndicatorProps,\n} from \"./stepper\";\n"
|
|
1910
|
+
},
|
|
1911
|
+
{
|
|
1912
|
+
"path": "components/stepper/stepper.tsx",
|
|
1913
|
+
"type": "registry:ui",
|
|
1914
|
+
"content": "import * as React from \"react\";\nimport { Check, AlertCircle } from \"lucide-react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n orientation?: \"horizontal\" | \"vertical\";\n}\n\nexport const Stepper = React.forwardRef<HTMLDivElement, StepperProps>(\n ({ className, orientation = \"horizontal\", ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"flex w-full\",\n orientation === \"horizontal\"\n ? \"flex-row items-center justify-between\"\n : \"flex-col items-start gap-4\",\n className\n )}\n {...props}\n />\n )\n);\nStepper.displayName = \"Stepper\";\n\nexport interface StepProps extends React.HTMLAttributes<HTMLDivElement> {\n status?: \"active\" | \"completed\" | \"inactive\" | \"error\" | \"disabled\";\n stepNumber?: number;\n}\n\nexport const Step = React.forwardRef<HTMLDivElement, StepProps>(\n ({ className, status = \"inactive\", stepNumber, children, ...props }, ref) => (\n <div\n ref={ref}\n aria-current={status === \"active\" ? \"step\" : undefined}\n className={cn(\n \"flex items-center gap-3\",\n status === \"disabled\" && \"opacity-50 pointer-events-none\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n )\n);\nStep.displayName = \"Step\";\n\nconst stepIndicatorVariants = cva(\n \"flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors\",\n {\n variants: {\n status: {\n active: \"bg-primary text-primary-foreground ring-2 ring-primary ring-offset-2\",\n completed: \"bg-primary text-primary-foreground\",\n inactive: \"border border-border bg-muted text-muted-foreground\",\n error: \"bg-destructive text-destructive-foreground\",\n disabled: \"border border-border bg-muted text-muted-foreground\",\n },\n },\n defaultVariants: {\n status: \"inactive\",\n },\n }\n);\n\nexport interface StepIndicatorProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof stepIndicatorVariants> {\n stepNumber?: number;\n}\n\nexport const StepIndicator = React.forwardRef<HTMLDivElement, StepIndicatorProps>(\n ({ className, status = \"inactive\", stepNumber, children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(stepIndicatorVariants({ status }), className)}\n {...props}\n >\n {status === \"completed\" ? (\n <Check className=\"h-4 w-4\" />\n ) : status === \"error\" ? (\n <AlertCircle className=\"h-4 w-4\" />\n ) : (\n children ?? stepNumber\n )}\n </div>\n );\n }\n);\nStepIndicator.displayName = \"StepIndicator\";\n\nexport const StepTitle = React.forwardRef<\n HTMLHeadingElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h4\n ref={ref}\n className={cn(\"text-sm font-medium text-foreground\", className)}\n {...props}\n />\n));\nStepTitle.displayName = \"StepTitle\";\n\nexport const StepDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\"text-xs text-muted-foreground\", className)}\n {...props}\n />\n));\nStepDescription.displayName = \"StepDescription\";\n\nexport const StepSeparator = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"h-[2px] flex-1 bg-border mx-2 min-w-4\", className)}\n {...props}\n />\n));\nStepSeparator.displayName = \"StepSeparator\";\n"
|
|
1915
|
+
}
|
|
1916
|
+
]
|
|
1917
|
+
},
|
|
1918
|
+
{
|
|
1919
|
+
"name": "switch",
|
|
1920
|
+
"type": "registry:ui",
|
|
1921
|
+
"title": "Switch",
|
|
1922
|
+
"description": "Accessible Switch primitive component built with Base UI and Tailwind v4.",
|
|
1923
|
+
"license": "GPL-3.0-only",
|
|
1924
|
+
"dependencies": [
|
|
1925
|
+
"@base-ui/react"
|
|
1926
|
+
],
|
|
1927
|
+
"devDependencies": [],
|
|
1928
|
+
"registryDependencies": [
|
|
1929
|
+
"utils"
|
|
1930
|
+
],
|
|
1931
|
+
"dependencyVersions": {
|
|
1932
|
+
"@base-ui/react": "^1.6.0"
|
|
1933
|
+
},
|
|
1934
|
+
"files": [
|
|
1935
|
+
{
|
|
1936
|
+
"path": "components/switch/index.ts",
|
|
1937
|
+
"type": "registry:ui",
|
|
1938
|
+
"content": "export * from \"./switch\";\n"
|
|
1939
|
+
},
|
|
1940
|
+
{
|
|
1941
|
+
"path": "components/switch/switch.tsx",
|
|
1942
|
+
"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-background dark:bg-mist shadow-md ring-0 transition-[transform,background-color] duration-200 ease-out data-[checked]:translate-x-4 data-[unchecked]:translate-x-0 data-[checked]:bg-primary-foreground\"\n )}\n />\n </BaseSwitch.Root>\n )\n);\n\nSwitch.displayName = \"Switch\";\n"
|
|
1944
|
+
}
|
|
1945
|
+
]
|
|
1946
|
+
},
|
|
1947
|
+
{
|
|
1948
|
+
"name": "table",
|
|
1949
|
+
"type": "registry:ui",
|
|
1950
|
+
"title": "Table",
|
|
1951
|
+
"description": "Accessible Table primitive component built with Base UI and Tailwind v4.",
|
|
1952
|
+
"license": "GPL-3.0-only",
|
|
1953
|
+
"dependencies": [],
|
|
1954
|
+
"devDependencies": [],
|
|
1955
|
+
"registryDependencies": [
|
|
1956
|
+
"utils"
|
|
1957
|
+
],
|
|
1958
|
+
"dependencyVersions": {},
|
|
1959
|
+
"files": [
|
|
1960
|
+
{
|
|
1961
|
+
"path": "components/table/index.ts",
|
|
1962
|
+
"type": "registry:ui",
|
|
1963
|
+
"content": "export * from \"./table\";\n"
|
|
1964
|
+
},
|
|
1965
|
+
{
|
|
1966
|
+
"path": "components/table/table.tsx",
|
|
1967
|
+
"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-10 px-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 \"p-3 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
|
+
}
|
|
1970
|
+
]
|
|
1971
|
+
},
|
|
1972
|
+
{
|
|
1973
|
+
"name": "tabs",
|
|
1974
|
+
"type": "registry:ui",
|
|
1975
|
+
"title": "Tabs",
|
|
1976
|
+
"description": "Accessible Tabs primitive component built with Base UI and Tailwind v4.",
|
|
1977
|
+
"license": "GPL-3.0-only",
|
|
1978
|
+
"dependencies": [
|
|
1979
|
+
"@base-ui/react"
|
|
1980
|
+
],
|
|
1981
|
+
"devDependencies": [],
|
|
1982
|
+
"registryDependencies": [
|
|
1983
|
+
"utils"
|
|
1984
|
+
],
|
|
1985
|
+
"dependencyVersions": {
|
|
1986
|
+
"@base-ui/react": "^1.6.0"
|
|
1987
|
+
},
|
|
1988
|
+
"files": [
|
|
1989
|
+
{
|
|
1990
|
+
"path": "components/tabs/index.ts",
|
|
1991
|
+
"type": "registry:ui",
|
|
1992
|
+
"content": "export * from \"./tabs\";\n"
|
|
1993
|
+
},
|
|
1994
|
+
{
|
|
1995
|
+
"path": "components/tabs/tabs.tsx",
|
|
1996
|
+
"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-8 items-center px-3 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 className={cn(\n \"mt-2 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
|
+
}
|
|
1999
|
+
]
|
|
2000
|
+
},
|
|
2001
|
+
{
|
|
2002
|
+
"name": "team-members-table",
|
|
2003
|
+
"type": "registry:block",
|
|
2004
|
+
"title": "Team Members Table Block",
|
|
2005
|
+
"description": "Composed Team Members Table block built from Usalyt primitives, Base UI and Tailwind v4.",
|
|
2006
|
+
"license": "GPL-3.0-only",
|
|
2007
|
+
"dependencies": [
|
|
2008
|
+
"lucide-react"
|
|
2009
|
+
],
|
|
2010
|
+
"devDependencies": [],
|
|
2011
|
+
"registryDependencies": [
|
|
2012
|
+
"avatar",
|
|
2013
|
+
"badge",
|
|
2014
|
+
"button",
|
|
2015
|
+
"card",
|
|
2016
|
+
"table",
|
|
2017
|
+
"utils"
|
|
2018
|
+
],
|
|
2019
|
+
"dependencyVersions": {
|
|
2020
|
+
"lucide-react": "^1.25.0"
|
|
2021
|
+
},
|
|
2022
|
+
"files": [
|
|
2023
|
+
{
|
|
2024
|
+
"path": "blocks/team-members-table/index.ts",
|
|
2025
|
+
"type": "registry:block",
|
|
2026
|
+
"content": "export {\n TeamMembersTable,\n type TeamMembersTableProps,\n type TeamMember,\n type ProjectRole,\n} from \"./team-members-table\";\n"
|
|
2027
|
+
},
|
|
2028
|
+
{
|
|
2029
|
+
"path": "blocks/team-members-table/team-members-table.tsx",
|
|
2030
|
+
"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 shadow-xs overflow-hidden\",\n className\n )}\n {...props}\n >\n <CardHeader className=\"flex flex-row flex-wrap items-center justify-between gap-3 pb-4 border-b border-border/40\">\n <div className=\"min-w-0\">\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-1.5 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-8\"\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
|
+
}
|
|
2033
|
+
]
|
|
2034
|
+
},
|
|
2035
|
+
{
|
|
2036
|
+
"name": "textarea",
|
|
2037
|
+
"type": "registry:ui",
|
|
2038
|
+
"title": "Textarea",
|
|
2039
|
+
"description": "Accessible Textarea primitive component built with Base UI and Tailwind v4.",
|
|
2040
|
+
"license": "GPL-3.0-only",
|
|
2041
|
+
"dependencies": [
|
|
2042
|
+
"class-variance-authority"
|
|
2043
|
+
],
|
|
2044
|
+
"devDependencies": [],
|
|
2045
|
+
"registryDependencies": [
|
|
2046
|
+
"utils"
|
|
2047
|
+
],
|
|
2048
|
+
"dependencyVersions": {
|
|
2049
|
+
"class-variance-authority": "^0.7.1"
|
|
2050
|
+
},
|
|
2051
|
+
"files": [
|
|
2052
|
+
{
|
|
2053
|
+
"path": "components/textarea/index.ts",
|
|
2054
|
+
"type": "registry:ui",
|
|
2055
|
+
"content": "export * from \"./textarea\";\n"
|
|
2056
|
+
},
|
|
2057
|
+
{
|
|
2058
|
+
"path": "components/textarea/textarea.tsx",
|
|
2059
|
+
"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-[80px] w-full rounded-md border border-input bg-field text-foreground px-3 py-2 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"
|
|
2061
|
+
}
|
|
2062
|
+
]
|
|
2063
|
+
},
|
|
2064
|
+
{
|
|
2065
|
+
"name": "timeline",
|
|
2066
|
+
"type": "registry:ui",
|
|
2067
|
+
"title": "Timeline",
|
|
2068
|
+
"description": "Accessible Timeline primitive component built with Base UI and Tailwind v4.",
|
|
2069
|
+
"license": "GPL-3.0-only",
|
|
2070
|
+
"dependencies": [],
|
|
2071
|
+
"devDependencies": [],
|
|
2072
|
+
"registryDependencies": [
|
|
2073
|
+
"utils"
|
|
2074
|
+
],
|
|
2075
|
+
"dependencyVersions": {},
|
|
2076
|
+
"files": [
|
|
2077
|
+
{
|
|
2078
|
+
"path": "components/timeline/index.ts",
|
|
2079
|
+
"type": "registry:ui",
|
|
2080
|
+
"content": "export {\n Timeline,\n TimelineItem,\n TimelineConnector,\n TimelineHeader,\n TimelineIcon,\n TimelineContent,\n TimelineTitle,\n TimelineDescription,\n TimelineTime,\n type TimelineProps,\n} from \"./timeline\";\n"
|
|
2081
|
+
},
|
|
2082
|
+
{
|
|
2083
|
+
"path": "components/timeline/timeline.tsx",
|
|
2084
|
+
"type": "registry:ui",
|
|
2085
|
+
"content": "import * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface TimelineProps extends React.HTMLAttributes<HTMLOListElement> {\n orientation?: \"vertical\" | \"horizontal\";\n}\n\nexport const Timeline = React.forwardRef<HTMLOListElement, TimelineProps>(\n ({ className, orientation = \"vertical\", ...props }, ref) => (\n <ol\n ref={ref}\n aria-label=\"timeline\"\n className={cn(\n \"group flex\",\n orientation === \"vertical\" ? \"flex-col\" : \"flex-row items-start\",\n className\n )}\n {...props}\n data-orientation={orientation}\n />\n )\n);\nTimeline.displayName = \"Timeline\";\n\nexport const TimelineItem = React.forwardRef<\n HTMLLIElement,\n React.LiHTMLAttributes<HTMLLIElement>\n>(({ className, ...props }, ref) => (\n <li\n ref={ref}\n className={cn(\n \"relative flex gap-4 pb-8 last:pb-0 group-data-[orientation=horizontal]:min-w-0 group-data-[orientation=horizontal]:flex-1 group-data-[orientation=horizontal]:basis-0 group-data-[orientation=horizontal]:flex-col group-data-[orientation=horizontal]:gap-2 group-data-[orientation=horizontal]:pb-0\",\n className\n )}\n {...props}\n />\n));\nTimelineItem.displayName = \"TimelineItem\";\n\nexport const TimelineConnector = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n aria-hidden=\"true\"\n className={cn(\n \"absolute left-4 top-4 -bottom-4 w-0.5 bg-border -translate-x-1/2 group-data-[orientation=horizontal]:left-4 group-data-[orientation=horizontal]:-right-4 group-data-[orientation=horizontal]:top-4 group-data-[orientation=horizontal]:bottom-auto group-data-[orientation=horizontal]:h-0.5 group-data-[orientation=horizontal]:w-auto group-data-[orientation=horizontal]:translate-x-0 group-data-[orientation=horizontal]:-translate-y-1/2\",\n className\n )}\n {...props}\n />\n));\nTimelineConnector.displayName = \"TimelineConnector\";\n\nexport const TimelineHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"flex items-center gap-3 group-data-[orientation=horizontal]:flex-col group-data-[orientation=horizontal]:items-start group-data-[orientation=horizontal]:gap-2\",\n className\n )}\n {...props}\n />\n));\nTimelineHeader.displayName = \"TimelineHeader\";\n\nexport const TimelineIcon = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"relative z-10 flex h-8 w-8 items-center justify-center rounded-full border border-border bg-background text-muted-foreground\",\n className\n )}\n {...props}\n />\n));\nTimelineIcon.displayName = \"TimelineIcon\";\n\nexport const TimelineContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"flex flex-1 flex-col gap-1 pt-0.5 group-data-[orientation=horizontal]:min-w-0 group-data-[orientation=horizontal]:flex-none group-data-[orientation=horizontal]:pt-0\",\n className\n )}\n {...props}\n />\n));\nTimelineContent.displayName = \"TimelineContent\";\n\nexport const TimelineTitle = React.forwardRef<\n HTMLHeadingElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h4\n ref={ref}\n className={cn(\"text-sm font-semibold text-foreground leading-none\", className)}\n {...props}\n />\n));\nTimelineTitle.displayName = \"TimelineTitle\";\n\nexport const TimelineDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\"text-xs text-muted-foreground leading-relaxed\", className)}\n {...props}\n />\n));\nTimelineDescription.displayName = \"TimelineDescription\";\n\nexport const TimelineTime = React.forwardRef<\n HTMLTimeElement,\n React.TimeHTMLAttributes<HTMLTimeElement>\n>(({ className, ...props }, ref) => (\n <time\n ref={ref}\n className={cn(\"text-xs font-mono text-muted-foreground\", className)}\n {...props}\n />\n));\nTimelineTime.displayName = \"TimelineTime\";\n"
|
|
2086
|
+
}
|
|
2087
|
+
]
|
|
2088
|
+
},
|
|
2089
|
+
{
|
|
2090
|
+
"name": "toast",
|
|
2091
|
+
"type": "registry:ui",
|
|
2092
|
+
"title": "Toast",
|
|
2093
|
+
"description": "Accessible Toast primitive component built with Base UI and Tailwind v4.",
|
|
2094
|
+
"license": "GPL-3.0-only",
|
|
2095
|
+
"dependencies": [
|
|
2096
|
+
"@base-ui/react",
|
|
2097
|
+
"class-variance-authority",
|
|
2098
|
+
"lucide-react"
|
|
2099
|
+
],
|
|
2100
|
+
"devDependencies": [],
|
|
2101
|
+
"registryDependencies": [
|
|
2102
|
+
"utils"
|
|
2103
|
+
],
|
|
2104
|
+
"dependencyVersions": {
|
|
2105
|
+
"@base-ui/react": "^1.6.0",
|
|
2106
|
+
"class-variance-authority": "^0.7.1",
|
|
2107
|
+
"lucide-react": "^1.25.0"
|
|
2108
|
+
},
|
|
2109
|
+
"files": [
|
|
2110
|
+
{
|
|
2111
|
+
"path": "components/toast/index.ts",
|
|
2112
|
+
"type": "registry:ui",
|
|
2113
|
+
"content": "export * from \"./toast\";\n"
|
|
2114
|
+
},
|
|
2115
|
+
{
|
|
2116
|
+
"path": "components/toast/toast.tsx",
|
|
2117
|
+
"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-4 bottom-4 top-auto left-auto z-50 flex w-[min(calc(100vw-2rem),24rem)] flex-col items-end gap-2 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-md border border-border bg-popover text-popover-foreground p-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-signal-teal/40 bg-signal-teal/10 text-signal-teal-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\", 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>(({ className, ...props }, ref) => (\n <BaseToast.Close\n ref={ref}\n aria-hidden={false}\n className={cn(\n \"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-70 transition-opacity hover:opacity-100 focus:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring\",\n className\n )}\n {...props}\n >\n <X className=\"h-4 w-4\" aria-hidden=\"true\" />\n <span className=\"sr-only\">Close</span>\n </BaseToast.Close>\n));\nToastClose.displayName = \"ToastClose\";\n"
|
|
2119
|
+
}
|
|
2120
|
+
]
|
|
2121
|
+
},
|
|
2122
|
+
{
|
|
2123
|
+
"name": "toggle",
|
|
2124
|
+
"type": "registry:ui",
|
|
2125
|
+
"title": "Toggle",
|
|
2126
|
+
"description": "Accessible Toggle primitive component built with Base UI and Tailwind v4.",
|
|
2127
|
+
"license": "GPL-3.0-only",
|
|
2128
|
+
"dependencies": [
|
|
2129
|
+
"@base-ui/react",
|
|
2130
|
+
"class-variance-authority"
|
|
2131
|
+
],
|
|
2132
|
+
"devDependencies": [],
|
|
2133
|
+
"registryDependencies": [
|
|
2134
|
+
"utils"
|
|
2135
|
+
],
|
|
2136
|
+
"dependencyVersions": {
|
|
2137
|
+
"@base-ui/react": "^1.6.0",
|
|
2138
|
+
"class-variance-authority": "^0.7.1"
|
|
2139
|
+
},
|
|
2140
|
+
"files": [
|
|
2141
|
+
{
|
|
2142
|
+
"path": "components/toggle/index.ts",
|
|
2143
|
+
"type": "registry:ui",
|
|
2144
|
+
"content": "export * from \"./toggle\";\n"
|
|
2145
|
+
},
|
|
2146
|
+
{
|
|
2147
|
+
"path": "components/toggle/toggle.tsx",
|
|
2148
|
+
"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-all 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
|
+
}
|
|
2151
|
+
]
|
|
2152
|
+
},
|
|
2153
|
+
{
|
|
2154
|
+
"name": "toggle-group",
|
|
2155
|
+
"type": "registry:ui",
|
|
2156
|
+
"title": "Toggle Group",
|
|
2157
|
+
"description": "Accessible Toggle Group primitive component built with Base UI and Tailwind v4.",
|
|
2158
|
+
"license": "GPL-3.0-only",
|
|
2159
|
+
"dependencies": [
|
|
2160
|
+
"@base-ui/react",
|
|
2161
|
+
"class-variance-authority"
|
|
2162
|
+
],
|
|
2163
|
+
"devDependencies": [],
|
|
2164
|
+
"registryDependencies": [
|
|
2165
|
+
"toggle",
|
|
2166
|
+
"utils"
|
|
2167
|
+
],
|
|
2168
|
+
"dependencyVersions": {
|
|
2169
|
+
"@base-ui/react": "^1.6.0",
|
|
2170
|
+
"class-variance-authority": "^0.7.1"
|
|
2171
|
+
},
|
|
2172
|
+
"files": [
|
|
2173
|
+
{
|
|
2174
|
+
"path": "components/toggle-group/index.ts",
|
|
2175
|
+
"type": "registry:ui",
|
|
2176
|
+
"content": "export * from \"./toggle-group\";\n"
|
|
2177
|
+
},
|
|
2178
|
+
{
|
|
2179
|
+
"path": "components/toggle-group/toggle-group.tsx",
|
|
2180
|
+
"type": "registry:ui",
|
|
2181
|
+
"content": "import * as React from \"react\";\nimport { ToggleGroup as BaseToggleGroup } from \"@base-ui/react/toggle-group\";\nimport { Toggle as BaseToggle } from \"@base-ui/react/toggle\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\nimport { toggleVariants } from \"../toggle/toggle\";\n\nconst ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({\n size: \"md\",\n variant: \"default\"\n});\n\nexport interface ToggleGroupProps\n extends React.ComponentPropsWithoutRef<typeof BaseToggleGroup>,\n VariantProps<typeof toggleVariants> {}\n\nexport const ToggleGroup = React.forwardRef<HTMLDivElement, ToggleGroupProps>(\n ({ className, variant, size, children, ...props }, ref) => (\n <BaseToggleGroup\n ref={ref}\n className={cn(\"flex items-center justify-center gap-1\", className)}\n {...props}\n >\n <ToggleGroupContext.Provider value={{ variant, size }}>\n {children}\n </ToggleGroupContext.Provider>\n </BaseToggleGroup>\n )\n);\n\nToggleGroup.displayName = \"ToggleGroup\";\n\nexport interface ToggleGroupItemProps\n extends React.ComponentPropsWithoutRef<typeof BaseToggle>,\n VariantProps<typeof toggleVariants> {}\n\nexport const ToggleGroupItem = React.forwardRef<HTMLButtonElement, ToggleGroupItemProps>(\n ({ className, children, variant, size, ...props }, ref) => {\n const context = React.useContext(ToggleGroupContext);\n return (\n <BaseToggle\n ref={ref}\n className={cn(\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size,\n className\n })\n )}\n {...props}\n >\n {children}\n </BaseToggle>\n );\n }\n);\n\nToggleGroupItem.displayName = \"ToggleGroupItem\";\n"
|
|
2182
|
+
}
|
|
2183
|
+
]
|
|
2184
|
+
},
|
|
2185
|
+
{
|
|
2186
|
+
"name": "tooltip",
|
|
2187
|
+
"type": "registry:ui",
|
|
2188
|
+
"title": "Tooltip",
|
|
2189
|
+
"description": "Accessible Tooltip primitive component built with Base UI and Tailwind v4.",
|
|
2190
|
+
"license": "GPL-3.0-only",
|
|
2191
|
+
"dependencies": [
|
|
2192
|
+
"@base-ui/react"
|
|
2193
|
+
],
|
|
2194
|
+
"devDependencies": [],
|
|
2195
|
+
"registryDependencies": [
|
|
2196
|
+
"utils"
|
|
2197
|
+
],
|
|
2198
|
+
"dependencyVersions": {
|
|
2199
|
+
"@base-ui/react": "^1.6.0"
|
|
2200
|
+
},
|
|
2201
|
+
"files": [
|
|
2202
|
+
{
|
|
2203
|
+
"path": "components/tooltip/index.ts",
|
|
2204
|
+
"type": "registry:ui",
|
|
2205
|
+
"content": "export * from \"./tooltip\";\n"
|
|
2206
|
+
},
|
|
2207
|
+
{
|
|
2208
|
+
"path": "components/tooltip/tooltip.tsx",
|
|
2209
|
+
"type": "registry:ui",
|
|
2210
|
+
"content": "import * as React from \"react\";\nimport { Tooltip as BaseTooltip } from \"@base-ui/react/tooltip\";\nimport { cn } from \"../../lib/utils\";\n\nexport const TooltipProvider = BaseTooltip.Provider;\nexport const Tooltip = BaseTooltip.Root;\nexport const TooltipTrigger = BaseTooltip.Trigger;\nexport const TooltipPortal = BaseTooltip.Portal;\n\nexport const TooltipContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BaseTooltip.Popup> & {\n sideOffset?: number;\n }\n>(({ className, sideOffset = 4, role = \"tooltip\", ...props }, ref) => (\n <TooltipPortal>\n <BaseTooltip.Positioner sideOffset={sideOffset}>\n <BaseTooltip.Popup\n ref={ref}\n role={role}\n className={cn(\n \"z-50 overflow-hidden rounded-sm border border-border bg-popover px-3 py-1.5 text-xs 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 </BaseTooltip.Positioner>\n </TooltipPortal>\n));\nTooltipContent.displayName = \"TooltipContent\";\n"
|
|
2211
|
+
}
|
|
2212
|
+
]
|
|
2213
|
+
},
|
|
2214
|
+
{
|
|
2215
|
+
"name": "tree-view",
|
|
2216
|
+
"type": "registry:ui",
|
|
2217
|
+
"title": "Tree View",
|
|
2218
|
+
"description": "Accessible Tree View primitive component built with Base UI and Tailwind v4.",
|
|
2219
|
+
"license": "GPL-3.0-only",
|
|
2220
|
+
"dependencies": [
|
|
2221
|
+
"lucide-react"
|
|
2222
|
+
],
|
|
2223
|
+
"devDependencies": [],
|
|
2224
|
+
"registryDependencies": [
|
|
2225
|
+
"utils"
|
|
2226
|
+
],
|
|
2227
|
+
"dependencyVersions": {
|
|
2228
|
+
"lucide-react": "^1.25.0"
|
|
2229
|
+
},
|
|
2230
|
+
"files": [
|
|
2231
|
+
{
|
|
2232
|
+
"path": "components/tree-view/index.ts",
|
|
2233
|
+
"type": "registry:ui",
|
|
2234
|
+
"content": "export {\n TreeView,\n TreeItem,\n TreeItemTrigger,\n TreeItemContent,\n type TreeViewProps,\n type TreeItemProps,\n} from \"./tree-view\";\n"
|
|
2235
|
+
},
|
|
2236
|
+
{
|
|
2237
|
+
"path": "components/tree-view/tree-view.tsx",
|
|
2238
|
+
"type": "registry:ui",
|
|
2239
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronRight } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface TreeViewProps extends React.HTMLAttributes<HTMLUListElement> {}\n\nexport const TreeView = React.forwardRef<HTMLUListElement, TreeViewProps>(\n ({ className, ...props }, ref) => (\n <ul\n ref={ref}\n role=\"tree\"\n className={cn(\"flex flex-col gap-1 select-none text-sm text-foreground\", className)}\n {...props}\n />\n )\n);\nTreeView.displayName = \"TreeView\";\n\nexport interface TreeItemProps extends React.LiHTMLAttributes<HTMLLIElement> {\n defaultExpanded?: boolean;\n expanded?: boolean;\n onExpandedChange?: (expanded: boolean) => void;\n}\n\ntype TreeItemContextType = {\n isExpanded: boolean;\n toggle: () => void;\n};\n\nconst TreeItemContext = React.createContext<TreeItemContextType>({\n isExpanded: false,\n toggle: () => {},\n});\n\nexport const TreeItem = React.forwardRef<HTMLLIElement, TreeItemProps>(\n ({ defaultExpanded = false, expanded: expandedProp, onExpandedChange, className, children, ...props }, ref) => {\n const [_expanded, setExpanded] = React.useState(defaultExpanded);\n const isExpanded = expandedProp !== undefined ? expandedProp : _expanded;\n\n const toggle = React.useCallback(() => {\n const next = !isExpanded;\n if (onExpandedChange) {\n onExpandedChange(next);\n } else {\n setExpanded(next);\n }\n }, [isExpanded, onExpandedChange]);\n\n return (\n <TreeItemContext.Provider value={{ isExpanded, toggle }}>\n <li\n ref={ref}\n role=\"treeitem\"\n aria-expanded={isExpanded}\n className={cn(\"relative flex flex-col gap-1\", className)}\n {...props}\n >\n {children}\n </li>\n </TreeItemContext.Provider>\n );\n }\n);\nTreeItem.displayName = \"TreeItem\";\n\nexport const TreeItemTrigger = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, children, onClick, ...props }, ref) => {\n const { isExpanded, toggle } = React.useContext(TreeItemContext);\n\n return (\n <div\n ref={ref}\n onClick={(e) => {\n onClick?.(e);\n toggle();\n }}\n className={cn(\n \"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-muted/70 cursor-pointer transition-colors\",\n className\n )}\n {...props}\n >\n <ChevronRight\n className={cn(\n \"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200\",\n isExpanded && \"rotate-90\"\n )}\n />\n {children}\n </div>\n );\n});\nTreeItemTrigger.displayName = \"TreeItemTrigger\";\n\nexport const TreeItemContent = React.forwardRef<\n HTMLUListElement,\n React.HTMLAttributes<HTMLUListElement>\n>(({ className, ...props }, ref) => {\n const { isExpanded } = React.useContext(TreeItemContext);\n\n if (!isExpanded) return null;\n\n return (\n <ul\n ref={ref}\n role=\"group\"\n className={cn(\"flex flex-col gap-1 pl-4 border-l border-border/60 ml-3.5\", className)}\n {...props}\n />\n );\n});\nTreeItemContent.displayName = \"TreeItemContent\";\n"
|
|
2240
|
+
}
|
|
2241
|
+
]
|
|
2242
|
+
},
|
|
2243
|
+
{
|
|
2244
|
+
"name": "utils",
|
|
2245
|
+
"type": "registry:lib",
|
|
2246
|
+
"title": "Utils",
|
|
2247
|
+
"description": "Shared cn() class merge utility for Usalyt components.",
|
|
2248
|
+
"license": "GPL-3.0-only",
|
|
2249
|
+
"dependencies": [
|
|
2250
|
+
"clsx",
|
|
2251
|
+
"tailwind-merge"
|
|
2252
|
+
],
|
|
2253
|
+
"devDependencies": [],
|
|
2254
|
+
"registryDependencies": [],
|
|
2255
|
+
"dependencyVersions": {
|
|
2256
|
+
"clsx": "^2.1.1",
|
|
2257
|
+
"tailwind-merge": "^3.0.2"
|
|
2258
|
+
},
|
|
2259
|
+
"files": [
|
|
2260
|
+
{
|
|
2261
|
+
"path": "lib/utils.ts",
|
|
2262
|
+
"type": "registry:lib",
|
|
2263
|
+
"content": "import { clsx, type ClassValue } from \"clsx\";\nimport { extendTailwindMerge } from \"tailwind-merge\";\n\n/**\n * tailwind-merge ships only the stock Tailwind vocabulary. The DESIGN.md\n * type scale (`text-caption`, `text-label`, …) and the weight aliases\n * (`font-w510`, `font-w590`) are custom theme keys: without registering\n * them, tailwind-merge misclassifies `text-caption` as a text COLOR and\n * silently drops it whenever a real color class follows in the same\n * `cn()` call — leaving rows at the inherited body size.\n */\nconst twMerge = extendTailwindMerge({\n extend: {\n classGroups: {\n \"font-size\": [\n {\n text: [\n \"micro\",\n \"label\",\n \"caption\",\n \"body-sm\",\n \"body-lg\",\n \"subheading\",\n \"heading-sm\",\n \"heading\",\n \"heading-lg\",\n \"display\",\n ],\n },\n ],\n \"font-weight\": [{ font: [\"light\", \"regular\", \"w510\", \"w590\"] }],\n },\n },\n});\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n"
|
|
2264
|
+
}
|
|
2265
|
+
]
|
|
2266
|
+
}
|
|
2267
|
+
]
|
|
2268
|
+
}
|