fulldev-ui 0.25.2 → 0.25.4
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 +12 -0
- package/README.md +4 -5
- package/liquid/assets/ui-manifest.json +4 -4
- package/liquid/assets/ui-typography.css +6 -0
- package/liquid/snippets/ui-alert.liquid +2 -1
- package/liquid/snippets/ui-badge.liquid +6 -0
- package/liquid/snippets/ui-button.liquid +8 -2
- package/package.json +10 -10
- package/public/r/liquid/alert.json +1 -1
- package/public/r/liquid/badge.json +1 -1
- package/public/r/liquid/button.json +1 -1
- package/public/r/liquid/components.json +1 -1
- package/public/r/liquid/typography.json +1 -1
- package/public/r/react/styles/base-luma/typography.json +1 -1
- package/public/r/react/styles/base-lyra/typography.json +1 -1
- package/public/r/react/styles/base-maia/typography.json +1 -1
- package/public/r/react/styles/base-mira/typography.json +1 -1
- package/public/r/react/styles/base-nova/typography.json +1 -1
- package/public/r/react/styles/base-rhea/typography.json +1 -1
- package/public/r/react/styles/base-sera/typography.json +1 -1
- package/public/r/react/styles/base-vega/typography.json +1 -1
- package/public/r/styles/base-luma/alert.json +1 -1
- package/public/r/styles/base-luma/attachment-examples.json +1 -1
- package/public/r/styles/base-luma/attachment.json +2 -2
- package/public/r/styles/base-luma/badge.json +1 -1
- package/public/r/styles/base-luma/button.json +1 -1
- package/public/r/styles/base-luma/typography.json +1 -1
- package/public/r/styles/base-lyra/alert.json +1 -1
- package/public/r/styles/base-lyra/attachment-examples.json +1 -1
- package/public/r/styles/base-lyra/attachment.json +2 -2
- package/public/r/styles/base-lyra/badge.json +1 -1
- package/public/r/styles/base-lyra/button.json +1 -1
- package/public/r/styles/base-lyra/typography.json +1 -1
- package/public/r/styles/base-maia/alert.json +1 -1
- package/public/r/styles/base-maia/attachment-examples.json +1 -1
- package/public/r/styles/base-maia/attachment.json +2 -2
- package/public/r/styles/base-maia/badge.json +1 -1
- package/public/r/styles/base-maia/button.json +1 -1
- package/public/r/styles/base-maia/typography.json +1 -1
- package/public/r/styles/base-mira/alert.json +1 -1
- package/public/r/styles/base-mira/attachment-examples.json +1 -1
- package/public/r/styles/base-mira/attachment.json +2 -2
- package/public/r/styles/base-mira/badge.json +1 -1
- package/public/r/styles/base-mira/button.json +1 -1
- package/public/r/styles/base-mira/typography.json +1 -1
- package/public/r/styles/base-nova/alert.json +1 -1
- package/public/r/styles/base-nova/attachment-examples.json +1 -1
- package/public/r/styles/base-nova/attachment.json +2 -2
- package/public/r/styles/base-nova/badge.json +1 -1
- package/public/r/styles/base-nova/button.json +1 -1
- package/public/r/styles/base-nova/typography.json +1 -1
- package/public/r/styles/base-rhea/alert.json +1 -1
- package/public/r/styles/base-rhea/attachment-examples.json +1 -1
- package/public/r/styles/base-rhea/attachment.json +2 -2
- package/public/r/styles/base-rhea/badge.json +1 -1
- package/public/r/styles/base-rhea/button.json +1 -1
- package/public/r/styles/base-rhea/typography.json +1 -1
- package/public/r/styles/base-sera/alert.json +1 -1
- package/public/r/styles/base-sera/attachment-examples.json +1 -1
- package/public/r/styles/base-sera/attachment.json +2 -2
- package/public/r/styles/base-sera/badge.json +1 -1
- package/public/r/styles/base-sera/button.json +1 -1
- package/public/r/styles/base-sera/typography.json +1 -1
- package/public/r/styles/base-vega/alert.json +1 -1
- package/public/r/styles/base-vega/attachment-examples.json +1 -1
- package/public/r/styles/base-vega/attachment.json +2 -2
- package/public/r/styles/base-vega/badge.json +1 -1
- package/public/r/styles/base-vega/button.json +1 -1
- package/public/r/styles/base-vega/typography.json +1 -1
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"path": "src/components/ui/attachment/attachment-description.astro",
|
|
27
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<span\n data-slot=\"attachment-description\"\n class={cn(\n \"mt-0.5 text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive
|
|
27
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n// shadcn/ui uses text-destructive/80 for the error description. Like its\n// FieldError, this uses the full destructive color, so the small text keeps a\n// 4.5:1 contrast.\n---\n\n<span\n data-slot=\"attachment-description\"\n class={cn(\n \"mt-0.5 text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive block max-w-full min-w-0 truncate\",\n className\n )}\n {...props}\n>\n <slot />\n</span>\n",
|
|
28
28
|
"type": "registry:ui"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"path": "src/components/ui/attachment/attachment-title.astro",
|
|
42
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<span\n data-slot=\"attachment-title\"\n class={cn(\n \"font-medium block max-w-full min-w-0 truncate group-data-[state=processing]/attachment:
|
|
42
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<span\n data-slot=\"attachment-title\"\n class={cn(\n \"font-medium block max-w-full min-w-0 truncate group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer\",\n className\n )}\n {...props}\n>\n <slot />\n</span>\n",
|
|
43
43
|
"type": "registry:ui"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "src/components/ui/badge/badge-variants.ts",
|
|
9
|
-
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const badgeVariants = cva(\n \"h-5 gap-1 rounded-none border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n secondary: \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\",\n destructive: \"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20\",\n outline: \"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground\",\n ghost: \"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport type BadgeVariantProps = VariantProps<typeof badgeVariants>\n",
|
|
9
|
+
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const badgeVariants = cva(\n \"h-5 gap-1 rounded-none border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n secondary: \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\",\n destructive: \"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20\",\n outline: \"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground\",\n ghost: \"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50\",\n // shadcn/ui uses text-primary, below 4.5:1 in dark mode with most theme\n // colors. A lighter step of the primary keeps 4.5:1 there.\n link: \"text-(--fd-link,var(--primary)) dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)] underline-offset-4 hover:underline\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport type BadgeVariantProps = VariantProps<typeof badgeVariants>\n",
|
|
10
10
|
"type": "registry:ui"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "src/components/ui/button/button-variants.ts",
|
|
9
|
-
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-none border border-transparent bg-clip-padding text-xs font-medium focus-visible:ring-1 aria-invalid:ring-1 active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n outline: \"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n ghost: \"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground\",\n destructive: \"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n xs: \"h-6 gap-1 rounded-none px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-7 gap-1 rounded-none px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n lg: \"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n icon: \"size-8\",\n \"icon-xs\": \"size-6 rounded-none [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-7 rounded-none\",\n \"icon-lg\": \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>\n",
|
|
9
|
+
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-none border border-transparent bg-clip-padding text-xs font-medium focus-visible:ring-1 aria-invalid:ring-1 active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n outline: \"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n ghost: \"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground\",\n // shadcn/ui uses text-destructive, about 4:1 on the button's tint.\n // Mixing in a fifth of the foreground keeps 4.5:1, as the native Liquid\n // button does.\n destructive: \"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-[color-mix(in_oklab,var(--destructive)_80%,var(--foreground))] focus-visible:border-destructive/40 dark:hover:bg-destructive/30\",\n // shadcn/ui uses text-primary, below 4.5:1 in dark mode with most theme\n // colors. A lighter step of the primary keeps 4.5:1 there.\n link: \"text-(--fd-link,var(--primary)) dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)] underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n xs: \"h-6 gap-1 rounded-none px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-7 gap-1 rounded-none px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n lg: \"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n icon: \"size-8\",\n \"icon-xs\": \"size-6 rounded-none [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-7 rounded-none\",\n \"icon-lg\": \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>\n",
|
|
10
10
|
"type": "registry:ui"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"path": "src/components/ui/typography/typography-a.astro",
|
|
14
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Size = \"sm\" | \"default\" | \"lg\"\ntype Props = HTMLAttributes<\"a\"> & {\n size?: Size\n}\n\nconst { class: className, size = \"default\", ...props } = Astro.props\n\nconst sizeClass =\n size === \"sm\" ? \"text-sm\" : size === \"lg\" ? \"text-lg\" : \"text-base\"\n---\n\n<a\n data-slot=\"typography-a\"\n data-size={size}\n class={cn(\n \"text-primary font-medium underline underline-offset-4\",\n sizeClass,\n className\n )}\n {...props}\n>\n <slot />\n</a>\n",
|
|
14
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Size = \"sm\" | \"default\" | \"lg\"\ntype Props = HTMLAttributes<\"a\"> & {\n size?: Size\n}\n\nconst { class: className, size = \"default\", ...props } = Astro.props\n\nconst sizeClass =\n size === \"sm\" ? \"text-sm\" : size === \"lg\" ? \"text-lg\" : \"text-base\"\n// shadcn/ui's typography link uses text-primary, below 4.5:1 in dark mode with\n// most theme colors. There a lighter step of the primary keeps 4.5:1, as in\n// Button's link variant.\n---\n\n<a\n data-slot=\"typography-a\"\n data-size={size}\n class={cn(\n \"text-(--fd-link,var(--primary)) font-medium underline underline-offset-4 dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)]\",\n sizeClass,\n className\n )}\n {...props}\n>\n <slot />\n</a>\n",
|
|
15
15
|
"type": "registry:ui"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "src/components/ui/alert/alert.astro",
|
|
9
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = VariantProps<typeof variants> & HTMLAttributes<\"div\">\n\nconst variants = cva(\"grid gap-0.5 rounded-lg border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 group/alert relative w-full\", {\n variants: {\n variant: {\n default: \"bg-card text-card-foreground\",\n destructive: \"text-destructive bg-card *:data-[slot=alert-description]:text-destructive
|
|
9
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = VariantProps<typeof variants> & HTMLAttributes<\"div\">\n\nconst variants = cva(\"grid gap-0.5 rounded-lg border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 group/alert relative w-full\", {\n variants: {\n variant: {\n default: \"bg-card text-card-foreground\",\n // shadcn/ui shows the description at text-destructive/90. Like its\n // FieldError, this uses the full destructive color, for 4.5:1 contrast.\n destructive: \"text-destructive bg-card *:data-[slot=alert-description]:text-destructive *:[svg]:text-current\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n})\n\nconst { class: className, variant, ...props } = Astro.props\n---\n\n<div\n data-slot=\"alert\"\n role=\"alert\"\n class={cn(variants({ variant }), className)}\n {...props}\n>\n <slot />\n</div>\n",
|
|
10
10
|
"type": "registry:ui"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
{
|
|
16
16
|
"path": "src/components/examples/attachment/attachment-demo.astro",
|
|
17
|
-
"content": "---\nimport FileCodeIcon from \"@lucide/astro/icons/file-code\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport {\n Attachment,\n AttachmentAction,\n AttachmentActions,\n AttachmentContent,\n AttachmentDescription,\n AttachmentGroup,\n AttachmentMedia,\n AttachmentTitle,\n} from \"@/components/ui/attachment\"\nimport { Spinner } from \"@/components/ui/spinner\"\n\nconst images = [\n {\n name: \"workspace.png\",\n meta: \"PNG · 820 KB\",\n src: \"https://images.unsplash.com/photo-1497366754035-f200968a6e72?w=900&auto=format&fit=crop&q=80\",\n alt: \"Workspace\",\n },\n {\n name: \"desk-reference.jpg\",\n meta: \"JPG · 1.1 MB\",\n src: \"https://images.unsplash.com/photo-1497215728101-856f4ea42174?w=900&auto=format&fit=crop&q=80\",\n alt: \"Desk\",\n },\n {\n name: \"office-reference.jpg\",\n meta: \"JPG · 940 KB\",\n src: \"https://images.unsplash.com/photo-1497366811353-6870744d04b2?w=900&auto=format&fit=crop&q=80\",\n alt: \"Office\",\n },\n]\n---\n\n<div class=\"mx-auto flex w-full max-w-sm flex-col gap-3 py-12\">\n <AttachmentGroup>\n {images.map((image) => (\n <Attachment orientation=\"vertical\">\n <AttachmentMedia variant=\"image\">\n <img src={image.src} alt={image.alt} />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>{image.name}</AttachmentTitle>\n <AttachmentDescription>{image.meta}</AttachmentDescription>\n </AttachmentContent>\n </Attachment>\n ))}\n </AttachmentGroup>\n <Attachment state=\"uploading\" class=\"w-full\">\n <AttachmentMedia>\n <Spinner />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>sales-dashboard.pdf</AttachmentTitle>\n <AttachmentDescription>Uploading · 64%</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Cancel upload\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n <Attachment class=\"w-full\">\n <AttachmentMedia>\n <FileCodeIcon />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>message-renderer.tsx</AttachmentTitle>\n <AttachmentDescription>TypeScript · 12 KB</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Remove message-renderer.tsx\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n</div>\n",
|
|
17
|
+
"content": "---\nimport FileCodeIcon from \"@lucide/astro/icons/file-code\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport {\n Attachment,\n AttachmentAction,\n AttachmentActions,\n AttachmentContent,\n AttachmentDescription,\n AttachmentGroup,\n AttachmentMedia,\n AttachmentTitle,\n} from \"@/components/ui/attachment\"\nimport { Spinner } from \"@/components/ui/spinner\"\n\nconst images = [\n {\n name: \"workspace.png\",\n meta: \"PNG · 820 KB\",\n src: \"https://images.unsplash.com/photo-1497366754035-f200968a6e72?w=900&auto=format&fit=crop&q=80\",\n alt: \"Workspace\",\n },\n {\n name: \"desk-reference.jpg\",\n meta: \"JPG · 1.1 MB\",\n src: \"https://images.unsplash.com/photo-1497215728101-856f4ea42174?w=900&auto=format&fit=crop&q=80\",\n alt: \"Desk\",\n },\n {\n name: \"office-reference.jpg\",\n meta: \"JPG · 940 KB\",\n src: \"https://images.unsplash.com/photo-1497366811353-6870744d04b2?w=900&auto=format&fit=crop&q=80\",\n alt: \"Office\",\n },\n]\n---\n\n<div class=\"mx-auto flex w-full max-w-sm flex-col gap-3 py-12\">\n {/* Unlike shadcn/ui's demo, the group takes focus: its attachments have no\n controls, so a keyboard could not scroll it otherwise. */}\n <AttachmentGroup tabindex=\"0\">\n {images.map((image) => (\n <Attachment orientation=\"vertical\">\n <AttachmentMedia variant=\"image\">\n <img src={image.src} alt={image.alt} />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>{image.name}</AttachmentTitle>\n <AttachmentDescription>{image.meta}</AttachmentDescription>\n </AttachmentContent>\n </Attachment>\n ))}\n </AttachmentGroup>\n <Attachment state=\"uploading\" class=\"w-full\">\n <AttachmentMedia>\n <Spinner />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>sales-dashboard.pdf</AttachmentTitle>\n <AttachmentDescription>Uploading · 64%</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Cancel upload\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n <Attachment class=\"w-full\">\n <AttachmentMedia>\n <FileCodeIcon />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>message-renderer.tsx</AttachmentTitle>\n <AttachmentDescription>TypeScript · 12 KB</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Remove message-renderer.tsx\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n</div>\n",
|
|
18
18
|
"type": "registry:component"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"path": "src/components/ui/attachment/attachment-description.astro",
|
|
27
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<span\n data-slot=\"attachment-description\"\n class={cn(\n \"mt-0.5 text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive
|
|
27
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n// shadcn/ui uses text-destructive/80 for the error description. Like its\n// FieldError, this uses the full destructive color, so the small text keeps a\n// 4.5:1 contrast.\n---\n\n<span\n data-slot=\"attachment-description\"\n class={cn(\n \"mt-0.5 text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive block max-w-full min-w-0 truncate\",\n className\n )}\n {...props}\n>\n <slot />\n</span>\n",
|
|
28
28
|
"type": "registry:ui"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"path": "src/components/ui/attachment/attachment-title.astro",
|
|
42
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<span\n data-slot=\"attachment-title\"\n class={cn(\n \"font-medium block max-w-full min-w-0 truncate group-data-[state=processing]/attachment:
|
|
42
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<span\n data-slot=\"attachment-title\"\n class={cn(\n \"font-medium block max-w-full min-w-0 truncate group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer\",\n className\n )}\n {...props}\n>\n <slot />\n</span>\n",
|
|
43
43
|
"type": "registry:ui"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "src/components/ui/badge/badge-variants.ts",
|
|
9
|
-
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const badgeVariants = cva(\n \"h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n secondary: \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\",\n destructive: \"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20\",\n outline: \"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/30\",\n ghost: \"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport type BadgeVariantProps = VariantProps<typeof badgeVariants>\n",
|
|
9
|
+
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const badgeVariants = cva(\n \"h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n secondary: \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\",\n destructive: \"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20\",\n outline: \"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/30\",\n ghost: \"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50\",\n // shadcn/ui uses text-primary, below 4.5:1 in dark mode with most theme\n // colors. A lighter step of the primary keeps 4.5:1 there.\n link: \"text-(--fd-link,var(--primary)) dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)] underline-offset-4 hover:underline\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport type BadgeVariantProps = VariantProps<typeof badgeVariants>\n",
|
|
10
10
|
"type": "registry:ui"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "src/components/ui/button/button-variants.ts",
|
|
9
|
-
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-4xl border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n outline: \"border-border bg-input/30 hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n ghost: \"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground\",\n destructive: \"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5\",\n xs: \"h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n lg: \"h-10 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3\",\n icon: \"size-9\",\n \"icon-xs\": \"size-6 [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-8\",\n \"icon-lg\": \"size-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>\n",
|
|
9
|
+
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-4xl border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n outline: \"border-border bg-input/30 hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n ghost: \"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground\",\n // shadcn/ui uses text-destructive, about 4:1 on the button's tint.\n // Mixing in a fifth of the foreground keeps 4.5:1, as the native Liquid\n // button does.\n destructive: \"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-[color-mix(in_oklab,var(--destructive)_80%,var(--foreground))] focus-visible:border-destructive/40 dark:hover:bg-destructive/30\",\n // shadcn/ui uses text-primary, below 4.5:1 in dark mode with most theme\n // colors. A lighter step of the primary keeps 4.5:1 there.\n link: \"text-(--fd-link,var(--primary)) dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)] underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5\",\n xs: \"h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n lg: \"h-10 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3\",\n icon: \"size-9\",\n \"icon-xs\": \"size-6 [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-8\",\n \"icon-lg\": \"size-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>\n",
|
|
10
10
|
"type": "registry:ui"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"path": "src/components/ui/typography/typography-a.astro",
|
|
14
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Size = \"sm\" | \"default\" | \"lg\"\ntype Props = HTMLAttributes<\"a\"> & {\n size?: Size\n}\n\nconst { class: className, size = \"default\", ...props } = Astro.props\n\nconst sizeClass =\n size === \"sm\" ? \"text-sm\" : size === \"lg\" ? \"text-lg\" : \"text-base\"\n---\n\n<a\n data-slot=\"typography-a\"\n data-size={size}\n class={cn(\n \"text-primary font-medium underline underline-offset-4\",\n sizeClass,\n className\n )}\n {...props}\n>\n <slot />\n</a>\n",
|
|
14
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Size = \"sm\" | \"default\" | \"lg\"\ntype Props = HTMLAttributes<\"a\"> & {\n size?: Size\n}\n\nconst { class: className, size = \"default\", ...props } = Astro.props\n\nconst sizeClass =\n size === \"sm\" ? \"text-sm\" : size === \"lg\" ? \"text-lg\" : \"text-base\"\n// shadcn/ui's typography link uses text-primary, below 4.5:1 in dark mode with\n// most theme colors. There a lighter step of the primary keeps 4.5:1, as in\n// Button's link variant.\n---\n\n<a\n data-slot=\"typography-a\"\n data-size={size}\n class={cn(\n \"text-(--fd-link,var(--primary)) font-medium underline underline-offset-4 dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)]\",\n sizeClass,\n className\n )}\n {...props}\n>\n <slot />\n</a>\n",
|
|
15
15
|
"type": "registry:ui"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "src/components/ui/alert/alert.astro",
|
|
9
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = VariantProps<typeof variants> & HTMLAttributes<\"div\">\n\nconst variants = cva(\"grid gap-0.5 rounded-lg border px-2 py-1.5 text-left text-xs/relaxed has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-1.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-3.5 group/alert relative w-full\", {\n variants: {\n variant: {\n default: \"bg-card text-card-foreground\",\n destructive: \"text-destructive bg-card *:data-[slot=alert-description]:text-destructive
|
|
9
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = VariantProps<typeof variants> & HTMLAttributes<\"div\">\n\nconst variants = cva(\"grid gap-0.5 rounded-lg border px-2 py-1.5 text-left text-xs/relaxed has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-1.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-3.5 group/alert relative w-full\", {\n variants: {\n variant: {\n default: \"bg-card text-card-foreground\",\n // shadcn/ui shows the description at text-destructive/90. Like its\n // FieldError, this uses the full destructive color, for 4.5:1 contrast.\n destructive: \"text-destructive bg-card *:data-[slot=alert-description]:text-destructive *:[svg]:text-current\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n})\n\nconst { class: className, variant, ...props } = Astro.props\n---\n\n<div\n data-slot=\"alert\"\n role=\"alert\"\n class={cn(variants({ variant }), className)}\n {...props}\n>\n <slot />\n</div>\n",
|
|
10
10
|
"type": "registry:ui"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
{
|
|
16
16
|
"path": "src/components/examples/attachment/attachment-demo.astro",
|
|
17
|
-
"content": "---\nimport FileCodeIcon from \"@lucide/astro/icons/file-code\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport {\n Attachment,\n AttachmentAction,\n AttachmentActions,\n AttachmentContent,\n AttachmentDescription,\n AttachmentGroup,\n AttachmentMedia,\n AttachmentTitle,\n} from \"@/components/ui/attachment\"\nimport { Spinner } from \"@/components/ui/spinner\"\n\nconst images = [\n {\n name: \"workspace.png\",\n meta: \"PNG · 820 KB\",\n src: \"https://images.unsplash.com/photo-1497366754035-f200968a6e72?w=900&auto=format&fit=crop&q=80\",\n alt: \"Workspace\",\n },\n {\n name: \"desk-reference.jpg\",\n meta: \"JPG · 1.1 MB\",\n src: \"https://images.unsplash.com/photo-1497215728101-856f4ea42174?w=900&auto=format&fit=crop&q=80\",\n alt: \"Desk\",\n },\n {\n name: \"office-reference.jpg\",\n meta: \"JPG · 940 KB\",\n src: \"https://images.unsplash.com/photo-1497366811353-6870744d04b2?w=900&auto=format&fit=crop&q=80\",\n alt: \"Office\",\n },\n]\n---\n\n<div class=\"mx-auto flex w-full max-w-sm flex-col gap-3 py-12\">\n <AttachmentGroup>\n {images.map((image) => (\n <Attachment orientation=\"vertical\">\n <AttachmentMedia variant=\"image\">\n <img src={image.src} alt={image.alt} />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>{image.name}</AttachmentTitle>\n <AttachmentDescription>{image.meta}</AttachmentDescription>\n </AttachmentContent>\n </Attachment>\n ))}\n </AttachmentGroup>\n <Attachment state=\"uploading\" class=\"w-full\">\n <AttachmentMedia>\n <Spinner />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>sales-dashboard.pdf</AttachmentTitle>\n <AttachmentDescription>Uploading · 64%</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Cancel upload\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n <Attachment class=\"w-full\">\n <AttachmentMedia>\n <FileCodeIcon />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>message-renderer.tsx</AttachmentTitle>\n <AttachmentDescription>TypeScript · 12 KB</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Remove message-renderer.tsx\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n</div>\n",
|
|
17
|
+
"content": "---\nimport FileCodeIcon from \"@lucide/astro/icons/file-code\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport {\n Attachment,\n AttachmentAction,\n AttachmentActions,\n AttachmentContent,\n AttachmentDescription,\n AttachmentGroup,\n AttachmentMedia,\n AttachmentTitle,\n} from \"@/components/ui/attachment\"\nimport { Spinner } from \"@/components/ui/spinner\"\n\nconst images = [\n {\n name: \"workspace.png\",\n meta: \"PNG · 820 KB\",\n src: \"https://images.unsplash.com/photo-1497366754035-f200968a6e72?w=900&auto=format&fit=crop&q=80\",\n alt: \"Workspace\",\n },\n {\n name: \"desk-reference.jpg\",\n meta: \"JPG · 1.1 MB\",\n src: \"https://images.unsplash.com/photo-1497215728101-856f4ea42174?w=900&auto=format&fit=crop&q=80\",\n alt: \"Desk\",\n },\n {\n name: \"office-reference.jpg\",\n meta: \"JPG · 940 KB\",\n src: \"https://images.unsplash.com/photo-1497366811353-6870744d04b2?w=900&auto=format&fit=crop&q=80\",\n alt: \"Office\",\n },\n]\n---\n\n<div class=\"mx-auto flex w-full max-w-sm flex-col gap-3 py-12\">\n {/* Unlike shadcn/ui's demo, the group takes focus: its attachments have no\n controls, so a keyboard could not scroll it otherwise. */}\n <AttachmentGroup tabindex=\"0\">\n {images.map((image) => (\n <Attachment orientation=\"vertical\">\n <AttachmentMedia variant=\"image\">\n <img src={image.src} alt={image.alt} />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>{image.name}</AttachmentTitle>\n <AttachmentDescription>{image.meta}</AttachmentDescription>\n </AttachmentContent>\n </Attachment>\n ))}\n </AttachmentGroup>\n <Attachment state=\"uploading\" class=\"w-full\">\n <AttachmentMedia>\n <Spinner />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>sales-dashboard.pdf</AttachmentTitle>\n <AttachmentDescription>Uploading · 64%</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Cancel upload\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n <Attachment class=\"w-full\">\n <AttachmentMedia>\n <FileCodeIcon />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>message-renderer.tsx</AttachmentTitle>\n <AttachmentDescription>TypeScript · 12 KB</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Remove message-renderer.tsx\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n</div>\n",
|
|
18
18
|
"type": "registry:component"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"path": "src/components/ui/attachment/attachment-description.astro",
|
|
27
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<span\n data-slot=\"attachment-description\"\n class={cn(\n \"mt-0.5 text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive
|
|
27
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n// shadcn/ui uses text-destructive/80 for the error description. Like its\n// FieldError, this uses the full destructive color, so the small text keeps a\n// 4.5:1 contrast.\n---\n\n<span\n data-slot=\"attachment-description\"\n class={cn(\n \"mt-0.5 text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive block max-w-full min-w-0 truncate\",\n className\n )}\n {...props}\n>\n <slot />\n</span>\n",
|
|
28
28
|
"type": "registry:ui"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"path": "src/components/ui/attachment/attachment-title.astro",
|
|
42
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<span\n data-slot=\"attachment-title\"\n class={cn(\n \"font-medium block max-w-full min-w-0 truncate group-data-[state=processing]/attachment:
|
|
42
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<span\n data-slot=\"attachment-title\"\n class={cn(\n \"font-medium block max-w-full min-w-0 truncate group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer\",\n className\n )}\n {...props}\n>\n <slot />\n</span>\n",
|
|
43
43
|
"type": "registry:ui"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "src/components/ui/badge/badge-variants.ts",
|
|
9
|
-
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const badgeVariants = cva(\n \"h-5 gap-1 rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-2.5! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n secondary: \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\",\n destructive: \"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20\",\n outline: \"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/20 dark:bg-input/30\",\n ghost: \"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport type BadgeVariantProps = VariantProps<typeof badgeVariants>\n",
|
|
9
|
+
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const badgeVariants = cva(\n \"h-5 gap-1 rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-2.5! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n secondary: \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\",\n destructive: \"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20\",\n outline: \"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/20 dark:bg-input/30\",\n ghost: \"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50\",\n // shadcn/ui uses text-primary, below 4.5:1 in dark mode with most theme\n // colors. A lighter step of the primary keeps 4.5:1 there.\n link: \"text-(--fd-link,var(--primary)) dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)] underline-offset-4 hover:underline\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport type BadgeVariantProps = VariantProps<typeof badgeVariants>\n",
|
|
10
10
|
"type": "registry:ui"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "src/components/ui/button/button-variants.ts",
|
|
9
|
-
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium focus-visible:ring-2 aria-invalid:ring-2 active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n outline: \"border-border dark:bg-input/30 hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n ghost: \"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground\",\n destructive: \"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n xs: \"h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5\",\n sm: \"h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n lg: \"h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4\",\n icon: \"size-7 [&_svg:not([class*='size-'])]:size-3.5\",\n \"icon-xs\": \"size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5\",\n \"icon-sm\": \"size-6 [&_svg:not([class*='size-'])]:size-3\",\n \"icon-lg\": \"size-8 [&_svg:not([class*='size-'])]:size-4\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>\n",
|
|
9
|
+
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium focus-visible:ring-2 aria-invalid:ring-2 active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n outline: \"border-border dark:bg-input/30 hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n ghost: \"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground\",\n // shadcn/ui uses text-destructive, about 4:1 on the button's tint.\n // Mixing in a fifth of the foreground keeps 4.5:1, as the native Liquid\n // button does.\n destructive: \"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-[color-mix(in_oklab,var(--destructive)_80%,var(--foreground))] focus-visible:border-destructive/40 dark:hover:bg-destructive/30\",\n // shadcn/ui uses text-primary, below 4.5:1 in dark mode with most theme\n // colors. A lighter step of the primary keeps 4.5:1 there.\n link: \"text-(--fd-link,var(--primary)) dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)] underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n xs: \"h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5\",\n sm: \"h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n lg: \"h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4\",\n icon: \"size-7 [&_svg:not([class*='size-'])]:size-3.5\",\n \"icon-xs\": \"size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5\",\n \"icon-sm\": \"size-6 [&_svg:not([class*='size-'])]:size-3\",\n \"icon-lg\": \"size-8 [&_svg:not([class*='size-'])]:size-4\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>\n",
|
|
10
10
|
"type": "registry:ui"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"path": "src/components/ui/typography/typography-a.astro",
|
|
14
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Size = \"sm\" | \"default\" | \"lg\"\ntype Props = HTMLAttributes<\"a\"> & {\n size?: Size\n}\n\nconst { class: className, size = \"default\", ...props } = Astro.props\n\nconst sizeClass =\n size === \"sm\" ? \"text-sm\" : size === \"lg\" ? \"text-lg\" : \"text-base\"\n---\n\n<a\n data-slot=\"typography-a\"\n data-size={size}\n class={cn(\n \"text-primary font-medium underline underline-offset-4\",\n sizeClass,\n className\n )}\n {...props}\n>\n <slot />\n</a>\n",
|
|
14
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Size = \"sm\" | \"default\" | \"lg\"\ntype Props = HTMLAttributes<\"a\"> & {\n size?: Size\n}\n\nconst { class: className, size = \"default\", ...props } = Astro.props\n\nconst sizeClass =\n size === \"sm\" ? \"text-sm\" : size === \"lg\" ? \"text-lg\" : \"text-base\"\n// shadcn/ui's typography link uses text-primary, below 4.5:1 in dark mode with\n// most theme colors. There a lighter step of the primary keeps 4.5:1, as in\n// Button's link variant.\n---\n\n<a\n data-slot=\"typography-a\"\n data-size={size}\n class={cn(\n \"text-(--fd-link,var(--primary)) font-medium underline underline-offset-4 dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)]\",\n sizeClass,\n className\n )}\n {...props}\n>\n <slot />\n</a>\n",
|
|
15
15
|
"type": "registry:ui"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "src/components/ui/alert/alert.astro",
|
|
9
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = VariantProps<typeof variants> & HTMLAttributes<\"div\">\n\nconst variants = cva(\"grid gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 group/alert relative w-full\", {\n variants: {\n variant: {\n default: \"bg-card text-card-foreground\",\n destructive: \"text-destructive bg-card *:data-[slot=alert-description]:text-destructive
|
|
9
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = VariantProps<typeof variants> & HTMLAttributes<\"div\">\n\nconst variants = cva(\"grid gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 group/alert relative w-full\", {\n variants: {\n variant: {\n default: \"bg-card text-card-foreground\",\n // shadcn/ui shows the description at text-destructive/90. Like its\n // FieldError, this uses the full destructive color, for 4.5:1 contrast.\n destructive: \"text-destructive bg-card *:data-[slot=alert-description]:text-destructive *:[svg]:text-current\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n})\n\nconst { class: className, variant, ...props } = Astro.props\n---\n\n<div\n data-slot=\"alert\"\n role=\"alert\"\n class={cn(variants({ variant }), className)}\n {...props}\n>\n <slot />\n</div>\n",
|
|
10
10
|
"type": "registry:ui"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
{
|
|
16
16
|
"path": "src/components/examples/attachment/attachment-demo.astro",
|
|
17
|
-
"content": "---\nimport FileCodeIcon from \"@lucide/astro/icons/file-code\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport {\n Attachment,\n AttachmentAction,\n AttachmentActions,\n AttachmentContent,\n AttachmentDescription,\n AttachmentGroup,\n AttachmentMedia,\n AttachmentTitle,\n} from \"@/components/ui/attachment\"\nimport { Spinner } from \"@/components/ui/spinner\"\n\nconst images = [\n {\n name: \"workspace.png\",\n meta: \"PNG · 820 KB\",\n src: \"https://images.unsplash.com/photo-1497366754035-f200968a6e72?w=900&auto=format&fit=crop&q=80\",\n alt: \"Workspace\",\n },\n {\n name: \"desk-reference.jpg\",\n meta: \"JPG · 1.1 MB\",\n src: \"https://images.unsplash.com/photo-1497215728101-856f4ea42174?w=900&auto=format&fit=crop&q=80\",\n alt: \"Desk\",\n },\n {\n name: \"office-reference.jpg\",\n meta: \"JPG · 940 KB\",\n src: \"https://images.unsplash.com/photo-1497366811353-6870744d04b2?w=900&auto=format&fit=crop&q=80\",\n alt: \"Office\",\n },\n]\n---\n\n<div class=\"mx-auto flex w-full max-w-sm flex-col gap-3 py-12\">\n <AttachmentGroup>\n {images.map((image) => (\n <Attachment orientation=\"vertical\">\n <AttachmentMedia variant=\"image\">\n <img src={image.src} alt={image.alt} />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>{image.name}</AttachmentTitle>\n <AttachmentDescription>{image.meta}</AttachmentDescription>\n </AttachmentContent>\n </Attachment>\n ))}\n </AttachmentGroup>\n <Attachment state=\"uploading\" class=\"w-full\">\n <AttachmentMedia>\n <Spinner />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>sales-dashboard.pdf</AttachmentTitle>\n <AttachmentDescription>Uploading · 64%</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Cancel upload\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n <Attachment class=\"w-full\">\n <AttachmentMedia>\n <FileCodeIcon />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>message-renderer.tsx</AttachmentTitle>\n <AttachmentDescription>TypeScript · 12 KB</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Remove message-renderer.tsx\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n</div>\n",
|
|
17
|
+
"content": "---\nimport FileCodeIcon from \"@lucide/astro/icons/file-code\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport {\n Attachment,\n AttachmentAction,\n AttachmentActions,\n AttachmentContent,\n AttachmentDescription,\n AttachmentGroup,\n AttachmentMedia,\n AttachmentTitle,\n} from \"@/components/ui/attachment\"\nimport { Spinner } from \"@/components/ui/spinner\"\n\nconst images = [\n {\n name: \"workspace.png\",\n meta: \"PNG · 820 KB\",\n src: \"https://images.unsplash.com/photo-1497366754035-f200968a6e72?w=900&auto=format&fit=crop&q=80\",\n alt: \"Workspace\",\n },\n {\n name: \"desk-reference.jpg\",\n meta: \"JPG · 1.1 MB\",\n src: \"https://images.unsplash.com/photo-1497215728101-856f4ea42174?w=900&auto=format&fit=crop&q=80\",\n alt: \"Desk\",\n },\n {\n name: \"office-reference.jpg\",\n meta: \"JPG · 940 KB\",\n src: \"https://images.unsplash.com/photo-1497366811353-6870744d04b2?w=900&auto=format&fit=crop&q=80\",\n alt: \"Office\",\n },\n]\n---\n\n<div class=\"mx-auto flex w-full max-w-sm flex-col gap-3 py-12\">\n {/* Unlike shadcn/ui's demo, the group takes focus: its attachments have no\n controls, so a keyboard could not scroll it otherwise. */}\n <AttachmentGroup tabindex=\"0\">\n {images.map((image) => (\n <Attachment orientation=\"vertical\">\n <AttachmentMedia variant=\"image\">\n <img src={image.src} alt={image.alt} />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>{image.name}</AttachmentTitle>\n <AttachmentDescription>{image.meta}</AttachmentDescription>\n </AttachmentContent>\n </Attachment>\n ))}\n </AttachmentGroup>\n <Attachment state=\"uploading\" class=\"w-full\">\n <AttachmentMedia>\n <Spinner />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>sales-dashboard.pdf</AttachmentTitle>\n <AttachmentDescription>Uploading · 64%</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Cancel upload\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n <Attachment class=\"w-full\">\n <AttachmentMedia>\n <FileCodeIcon />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>message-renderer.tsx</AttachmentTitle>\n <AttachmentDescription>TypeScript · 12 KB</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Remove message-renderer.tsx\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n</div>\n",
|
|
18
18
|
"type": "registry:component"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"path": "src/components/ui/attachment/attachment-description.astro",
|
|
27
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<span\n data-slot=\"attachment-description\"\n class={cn(\n \"mt-0.5 text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive
|
|
27
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n// shadcn/ui uses text-destructive/80 for the error description. Like its\n// FieldError, this uses the full destructive color, so the small text keeps a\n// 4.5:1 contrast.\n---\n\n<span\n data-slot=\"attachment-description\"\n class={cn(\n \"mt-0.5 text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive block max-w-full min-w-0 truncate\",\n className\n )}\n {...props}\n>\n <slot />\n</span>\n",
|
|
28
28
|
"type": "registry:ui"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"path": "src/components/ui/attachment/attachment-title.astro",
|
|
42
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<span\n data-slot=\"attachment-title\"\n class={cn(\n \"font-medium block max-w-full min-w-0 truncate group-data-[state=processing]/attachment:
|
|
42
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<span\n data-slot=\"attachment-title\"\n class={cn(\n \"font-medium block max-w-full min-w-0 truncate group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer\",\n className\n )}\n {...props}\n>\n <slot />\n</span>\n",
|
|
43
43
|
"type": "registry:ui"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "src/components/ui/badge/badge-variants.ts",
|
|
9
|
-
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const badgeVariants = cva(\n \"h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n secondary: \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\",\n destructive: \"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20\",\n outline: \"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground\",\n ghost: \"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport type BadgeVariantProps = VariantProps<typeof badgeVariants>\n",
|
|
9
|
+
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const badgeVariants = cva(\n \"h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n secondary: \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\",\n destructive: \"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20\",\n outline: \"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground\",\n ghost: \"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50\",\n // shadcn/ui uses text-primary, below 4.5:1 in dark mode with most theme\n // colors. A lighter step of the primary keeps 4.5:1 there.\n link: \"text-(--fd-link,var(--primary)) dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)] underline-offset-4 hover:underline\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport type BadgeVariantProps = VariantProps<typeof badgeVariants>\n",
|
|
10
10
|
"type": "registry:ui"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "src/components/ui/button/button-variants.ts",
|
|
9
|
-
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n outline: \"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n ghost: \"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground\",\n destructive: \"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n xs: \"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n lg: \"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n icon: \"size-8\",\n \"icon-xs\": \"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg\",\n \"icon-lg\": \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>\n",
|
|
9
|
+
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n outline: \"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n ghost: \"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground\",\n // shadcn/ui uses text-destructive, about 4:1 on the button's tint.\n // Mixing in a fifth of the foreground keeps 4.5:1, as the native Liquid\n // button does.\n destructive: \"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-[color-mix(in_oklab,var(--destructive)_80%,var(--foreground))] focus-visible:border-destructive/40 dark:hover:bg-destructive/30\",\n // shadcn/ui uses text-primary, below 4.5:1 in dark mode with most theme\n // colors. A lighter step of the primary keeps 4.5:1 there.\n link: \"text-(--fd-link,var(--primary)) dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)] underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n xs: \"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n lg: \"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n icon: \"size-8\",\n \"icon-xs\": \"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg\",\n \"icon-lg\": \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>\n",
|
|
10
10
|
"type": "registry:ui"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"path": "src/components/ui/typography/typography-a.astro",
|
|
14
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Size = \"sm\" | \"default\" | \"lg\"\ntype Props = HTMLAttributes<\"a\"> & {\n size?: Size\n}\n\nconst { class: className, size = \"default\", ...props } = Astro.props\n\nconst sizeClass =\n size === \"sm\" ? \"text-sm\" : size === \"lg\" ? \"text-lg\" : \"text-base\"\n---\n\n<a\n data-slot=\"typography-a\"\n data-size={size}\n class={cn(\n \"text-primary font-medium underline underline-offset-4\",\n sizeClass,\n className\n )}\n {...props}\n>\n <slot />\n</a>\n",
|
|
14
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Size = \"sm\" | \"default\" | \"lg\"\ntype Props = HTMLAttributes<\"a\"> & {\n size?: Size\n}\n\nconst { class: className, size = \"default\", ...props } = Astro.props\n\nconst sizeClass =\n size === \"sm\" ? \"text-sm\" : size === \"lg\" ? \"text-lg\" : \"text-base\"\n// shadcn/ui's typography link uses text-primary, below 4.5:1 in dark mode with\n// most theme colors. There a lighter step of the primary keeps 4.5:1, as in\n// Button's link variant.\n---\n\n<a\n data-slot=\"typography-a\"\n data-size={size}\n class={cn(\n \"text-(--fd-link,var(--primary)) font-medium underline underline-offset-4 dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)]\",\n sizeClass,\n className\n )}\n {...props}\n>\n <slot />\n</a>\n",
|
|
15
15
|
"type": "registry:ui"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "src/components/ui/alert/alert.astro",
|
|
9
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = VariantProps<typeof variants> & HTMLAttributes<\"div\">\n\nconst variants = cva(\"grid gap-0.5 rounded-2xl border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 group/alert relative w-full\", {\n variants: {\n variant: {\n default: \"bg-card text-card-foreground\",\n destructive: \"text-destructive bg-card *:data-[slot=alert-description]:text-destructive
|
|
9
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = VariantProps<typeof variants> & HTMLAttributes<\"div\">\n\nconst variants = cva(\"grid gap-0.5 rounded-2xl border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 group/alert relative w-full\", {\n variants: {\n variant: {\n default: \"bg-card text-card-foreground\",\n // shadcn/ui shows the description at text-destructive/90. Like its\n // FieldError, this uses the full destructive color, for 4.5:1 contrast.\n destructive: \"text-destructive bg-card *:data-[slot=alert-description]:text-destructive *:[svg]:text-current\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n})\n\nconst { class: className, variant, ...props } = Astro.props\n---\n\n<div\n data-slot=\"alert\"\n role=\"alert\"\n class={cn(variants({ variant }), className)}\n {...props}\n>\n <slot />\n</div>\n",
|
|
10
10
|
"type": "registry:ui"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
{
|
|
16
16
|
"path": "src/components/examples/attachment/attachment-demo.astro",
|
|
17
|
-
"content": "---\nimport FileCodeIcon from \"@lucide/astro/icons/file-code\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport {\n Attachment,\n AttachmentAction,\n AttachmentActions,\n AttachmentContent,\n AttachmentDescription,\n AttachmentGroup,\n AttachmentMedia,\n AttachmentTitle,\n} from \"@/components/ui/attachment\"\nimport { Spinner } from \"@/components/ui/spinner\"\n\nconst images = [\n {\n name: \"workspace.png\",\n meta: \"PNG · 820 KB\",\n src: \"https://images.unsplash.com/photo-1497366754035-f200968a6e72?w=900&auto=format&fit=crop&q=80\",\n alt: \"Workspace\",\n },\n {\n name: \"desk-reference.jpg\",\n meta: \"JPG · 1.1 MB\",\n src: \"https://images.unsplash.com/photo-1497215728101-856f4ea42174?w=900&auto=format&fit=crop&q=80\",\n alt: \"Desk\",\n },\n {\n name: \"office-reference.jpg\",\n meta: \"JPG · 940 KB\",\n src: \"https://images.unsplash.com/photo-1497366811353-6870744d04b2?w=900&auto=format&fit=crop&q=80\",\n alt: \"Office\",\n },\n]\n---\n\n<div class=\"mx-auto flex w-full max-w-sm flex-col gap-3 py-12\">\n <AttachmentGroup>\n {images.map((image) => (\n <Attachment orientation=\"vertical\">\n <AttachmentMedia variant=\"image\">\n <img src={image.src} alt={image.alt} />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>{image.name}</AttachmentTitle>\n <AttachmentDescription>{image.meta}</AttachmentDescription>\n </AttachmentContent>\n </Attachment>\n ))}\n </AttachmentGroup>\n <Attachment state=\"uploading\" class=\"w-full\">\n <AttachmentMedia>\n <Spinner />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>sales-dashboard.pdf</AttachmentTitle>\n <AttachmentDescription>Uploading · 64%</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Cancel upload\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n <Attachment class=\"w-full\">\n <AttachmentMedia>\n <FileCodeIcon />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>message-renderer.tsx</AttachmentTitle>\n <AttachmentDescription>TypeScript · 12 KB</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Remove message-renderer.tsx\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n</div>\n",
|
|
17
|
+
"content": "---\nimport FileCodeIcon from \"@lucide/astro/icons/file-code\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport {\n Attachment,\n AttachmentAction,\n AttachmentActions,\n AttachmentContent,\n AttachmentDescription,\n AttachmentGroup,\n AttachmentMedia,\n AttachmentTitle,\n} from \"@/components/ui/attachment\"\nimport { Spinner } from \"@/components/ui/spinner\"\n\nconst images = [\n {\n name: \"workspace.png\",\n meta: \"PNG · 820 KB\",\n src: \"https://images.unsplash.com/photo-1497366754035-f200968a6e72?w=900&auto=format&fit=crop&q=80\",\n alt: \"Workspace\",\n },\n {\n name: \"desk-reference.jpg\",\n meta: \"JPG · 1.1 MB\",\n src: \"https://images.unsplash.com/photo-1497215728101-856f4ea42174?w=900&auto=format&fit=crop&q=80\",\n alt: \"Desk\",\n },\n {\n name: \"office-reference.jpg\",\n meta: \"JPG · 940 KB\",\n src: \"https://images.unsplash.com/photo-1497366811353-6870744d04b2?w=900&auto=format&fit=crop&q=80\",\n alt: \"Office\",\n },\n]\n---\n\n<div class=\"mx-auto flex w-full max-w-sm flex-col gap-3 py-12\">\n {/* Unlike shadcn/ui's demo, the group takes focus: its attachments have no\n controls, so a keyboard could not scroll it otherwise. */}\n <AttachmentGroup tabindex=\"0\">\n {images.map((image) => (\n <Attachment orientation=\"vertical\">\n <AttachmentMedia variant=\"image\">\n <img src={image.src} alt={image.alt} />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>{image.name}</AttachmentTitle>\n <AttachmentDescription>{image.meta}</AttachmentDescription>\n </AttachmentContent>\n </Attachment>\n ))}\n </AttachmentGroup>\n <Attachment state=\"uploading\" class=\"w-full\">\n <AttachmentMedia>\n <Spinner />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>sales-dashboard.pdf</AttachmentTitle>\n <AttachmentDescription>Uploading · 64%</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Cancel upload\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n <Attachment class=\"w-full\">\n <AttachmentMedia>\n <FileCodeIcon />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>message-renderer.tsx</AttachmentTitle>\n <AttachmentDescription>TypeScript · 12 KB</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Remove message-renderer.tsx\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n</div>\n",
|
|
18
18
|
"type": "registry:component"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"path": "src/components/ui/attachment/attachment-description.astro",
|
|
27
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<span\n data-slot=\"attachment-description\"\n class={cn(\n \"mt-0.5 text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive
|
|
27
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n// shadcn/ui uses text-destructive/80 for the error description. Like its\n// FieldError, this uses the full destructive color, so the small text keeps a\n// 4.5:1 contrast.\n---\n\n<span\n data-slot=\"attachment-description\"\n class={cn(\n \"mt-0.5 text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive block max-w-full min-w-0 truncate\",\n className\n )}\n {...props}\n>\n <slot />\n</span>\n",
|
|
28
28
|
"type": "registry:ui"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"path": "src/components/ui/attachment/attachment-title.astro",
|
|
42
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<span\n data-slot=\"attachment-title\"\n class={cn(\n \"font-medium block max-w-full min-w-0 truncate group-data-[state=processing]/attachment:
|
|
42
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"span\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<span\n data-slot=\"attachment-title\"\n class={cn(\n \"font-medium block max-w-full min-w-0 truncate group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer\",\n className\n )}\n {...props}\n>\n <slot />\n</span>\n",
|
|
43
43
|
"type": "registry:ui"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "src/components/ui/badge/badge-variants.ts",
|
|
9
|
-
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const badgeVariants = cva(\n \"h-5 gap-1 rounded-2xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n secondary: \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\",\n destructive: \"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20\",\n outline: \"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground\",\n ghost: \"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport type BadgeVariantProps = VariantProps<typeof badgeVariants>\n",
|
|
9
|
+
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const badgeVariants = cva(\n \"h-5 gap-1 rounded-2xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n secondary: \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\",\n destructive: \"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20\",\n outline: \"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground\",\n ghost: \"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50\",\n // shadcn/ui uses text-primary, below 4.5:1 in dark mode with most theme\n // colors. A lighter step of the primary keeps 4.5:1 there.\n link: \"text-(--fd-link,var(--primary)) dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)] underline-offset-4 hover:underline\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport type BadgeVariantProps = VariantProps<typeof badgeVariants>\n",
|
|
10
10
|
"type": "registry:ui"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "src/components/ui/button/button-variants.ts",
|
|
9
|
-
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-2xl border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n outline: \"border-border bg-background dark:bg-transparent hover:bg-muted hover:text-foreground dark:hover:bg-input/30 aria-expanded:bg-muted aria-expanded:text-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n ghost: \"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground\",\n destructive: \"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-8 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5\",\n xs: \"h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-7 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n lg: \"h-9 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3\",\n icon: \"size-8\",\n \"icon-xs\": \"size-6 [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-7\",\n \"icon-lg\": \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>\n",
|
|
9
|
+
"content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-2xl border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n outline: \"border-border bg-background dark:bg-transparent hover:bg-muted hover:text-foreground dark:hover:bg-input/30 aria-expanded:bg-muted aria-expanded:text-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n ghost: \"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground\",\n // shadcn/ui uses text-destructive, about 4:1 on the button's tint.\n // Mixing in a fifth of the foreground keeps 4.5:1, as the native Liquid\n // button does.\n destructive: \"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-[color-mix(in_oklab,var(--destructive)_80%,var(--foreground))] focus-visible:border-destructive/40 dark:hover:bg-destructive/30\",\n // shadcn/ui uses text-primary, below 4.5:1 in dark mode with most theme\n // colors. A lighter step of the primary keeps 4.5:1 there.\n link: \"text-(--fd-link,var(--primary)) dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)] underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-8 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5\",\n xs: \"h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-7 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n lg: \"h-9 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3\",\n icon: \"size-8\",\n \"icon-xs\": \"size-6 [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-7\",\n \"icon-lg\": \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>\n",
|
|
10
10
|
"type": "registry:ui"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"path": "src/components/ui/typography/typography-a.astro",
|
|
14
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Size = \"sm\" | \"default\" | \"lg\"\ntype Props = HTMLAttributes<\"a\"> & {\n size?: Size\n}\n\nconst { class: className, size = \"default\", ...props } = Astro.props\n\nconst sizeClass =\n size === \"sm\" ? \"text-sm\" : size === \"lg\" ? \"text-lg\" : \"text-base\"\n---\n\n<a\n data-slot=\"typography-a\"\n data-size={size}\n class={cn(\n \"text-primary font-medium underline underline-offset-4\",\n sizeClass,\n className\n )}\n {...props}\n>\n <slot />\n</a>\n",
|
|
14
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Size = \"sm\" | \"default\" | \"lg\"\ntype Props = HTMLAttributes<\"a\"> & {\n size?: Size\n}\n\nconst { class: className, size = \"default\", ...props } = Astro.props\n\nconst sizeClass =\n size === \"sm\" ? \"text-sm\" : size === \"lg\" ? \"text-lg\" : \"text-base\"\n// shadcn/ui's typography link uses text-primary, below 4.5:1 in dark mode with\n// most theme colors. There a lighter step of the primary keeps 4.5:1, as in\n// Button's link variant.\n---\n\n<a\n data-slot=\"typography-a\"\n data-size={size}\n class={cn(\n \"text-(--fd-link,var(--primary)) font-medium underline underline-offset-4 dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)]\",\n sizeClass,\n className\n )}\n {...props}\n>\n <slot />\n</a>\n",
|
|
15
15
|
"type": "registry:ui"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "src/components/ui/alert/alert.astro",
|
|
9
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = VariantProps<typeof variants> & HTMLAttributes<\"div\">\n\nconst variants = cva(\"grid gap-1 bg-background border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 after:-inset-y-px after:-left-px after:w-0.5 after:absolute group/alert relative w-full\", {\n variants: {\n variant: {\n default: \"bg-card text-card-foreground after:bg-foreground\",\n destructive: \"text-destructive bg-card *:data-[slot=alert-description]:text-destructive
|
|
9
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = VariantProps<typeof variants> & HTMLAttributes<\"div\">\n\nconst variants = cva(\"grid gap-1 bg-background border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 after:-inset-y-px after:-left-px after:w-0.5 after:absolute group/alert relative w-full\", {\n variants: {\n variant: {\n default: \"bg-card text-card-foreground after:bg-foreground\",\n // shadcn/ui shows the description at text-destructive/90. Like its\n // FieldError, this uses the full destructive color, for 4.5:1 contrast.\n destructive: \"text-destructive bg-card *:data-[slot=alert-description]:text-destructive *:[svg]:text-current after:bg-destructive\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n})\n\nconst { class: className, variant, ...props } = Astro.props\n---\n\n<div\n data-slot=\"alert\"\n role=\"alert\"\n class={cn(variants({ variant }), className)}\n {...props}\n>\n <slot />\n</div>\n",
|
|
10
10
|
"type": "registry:ui"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
{
|
|
16
16
|
"path": "src/components/examples/attachment/attachment-demo.astro",
|
|
17
|
-
"content": "---\nimport FileCodeIcon from \"@lucide/astro/icons/file-code\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport {\n Attachment,\n AttachmentAction,\n AttachmentActions,\n AttachmentContent,\n AttachmentDescription,\n AttachmentGroup,\n AttachmentMedia,\n AttachmentTitle,\n} from \"@/components/ui/attachment\"\nimport { Spinner } from \"@/components/ui/spinner\"\n\nconst images = [\n {\n name: \"workspace.png\",\n meta: \"PNG · 820 KB\",\n src: \"https://images.unsplash.com/photo-1497366754035-f200968a6e72?w=900&auto=format&fit=crop&q=80\",\n alt: \"Workspace\",\n },\n {\n name: \"desk-reference.jpg\",\n meta: \"JPG · 1.1 MB\",\n src: \"https://images.unsplash.com/photo-1497215728101-856f4ea42174?w=900&auto=format&fit=crop&q=80\",\n alt: \"Desk\",\n },\n {\n name: \"office-reference.jpg\",\n meta: \"JPG · 940 KB\",\n src: \"https://images.unsplash.com/photo-1497366811353-6870744d04b2?w=900&auto=format&fit=crop&q=80\",\n alt: \"Office\",\n },\n]\n---\n\n<div class=\"mx-auto flex w-full max-w-sm flex-col gap-3 py-12\">\n <AttachmentGroup>\n {images.map((image) => (\n <Attachment orientation=\"vertical\">\n <AttachmentMedia variant=\"image\">\n <img src={image.src} alt={image.alt} />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>{image.name}</AttachmentTitle>\n <AttachmentDescription>{image.meta}</AttachmentDescription>\n </AttachmentContent>\n </Attachment>\n ))}\n </AttachmentGroup>\n <Attachment state=\"uploading\" class=\"w-full\">\n <AttachmentMedia>\n <Spinner />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>sales-dashboard.pdf</AttachmentTitle>\n <AttachmentDescription>Uploading · 64%</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Cancel upload\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n <Attachment class=\"w-full\">\n <AttachmentMedia>\n <FileCodeIcon />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>message-renderer.tsx</AttachmentTitle>\n <AttachmentDescription>TypeScript · 12 KB</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Remove message-renderer.tsx\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n</div>\n",
|
|
17
|
+
"content": "---\nimport FileCodeIcon from \"@lucide/astro/icons/file-code\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport {\n Attachment,\n AttachmentAction,\n AttachmentActions,\n AttachmentContent,\n AttachmentDescription,\n AttachmentGroup,\n AttachmentMedia,\n AttachmentTitle,\n} from \"@/components/ui/attachment\"\nimport { Spinner } from \"@/components/ui/spinner\"\n\nconst images = [\n {\n name: \"workspace.png\",\n meta: \"PNG · 820 KB\",\n src: \"https://images.unsplash.com/photo-1497366754035-f200968a6e72?w=900&auto=format&fit=crop&q=80\",\n alt: \"Workspace\",\n },\n {\n name: \"desk-reference.jpg\",\n meta: \"JPG · 1.1 MB\",\n src: \"https://images.unsplash.com/photo-1497215728101-856f4ea42174?w=900&auto=format&fit=crop&q=80\",\n alt: \"Desk\",\n },\n {\n name: \"office-reference.jpg\",\n meta: \"JPG · 940 KB\",\n src: \"https://images.unsplash.com/photo-1497366811353-6870744d04b2?w=900&auto=format&fit=crop&q=80\",\n alt: \"Office\",\n },\n]\n---\n\n<div class=\"mx-auto flex w-full max-w-sm flex-col gap-3 py-12\">\n {/* Unlike shadcn/ui's demo, the group takes focus: its attachments have no\n controls, so a keyboard could not scroll it otherwise. */}\n <AttachmentGroup tabindex=\"0\">\n {images.map((image) => (\n <Attachment orientation=\"vertical\">\n <AttachmentMedia variant=\"image\">\n <img src={image.src} alt={image.alt} />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>{image.name}</AttachmentTitle>\n <AttachmentDescription>{image.meta}</AttachmentDescription>\n </AttachmentContent>\n </Attachment>\n ))}\n </AttachmentGroup>\n <Attachment state=\"uploading\" class=\"w-full\">\n <AttachmentMedia>\n <Spinner />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>sales-dashboard.pdf</AttachmentTitle>\n <AttachmentDescription>Uploading · 64%</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Cancel upload\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n <Attachment class=\"w-full\">\n <AttachmentMedia>\n <FileCodeIcon />\n </AttachmentMedia>\n <AttachmentContent>\n <AttachmentTitle>message-renderer.tsx</AttachmentTitle>\n <AttachmentDescription>TypeScript · 12 KB</AttachmentDescription>\n </AttachmentContent>\n <AttachmentActions>\n <AttachmentAction aria-label=\"Remove message-renderer.tsx\">\n <XIcon />\n </AttachmentAction>\n </AttachmentActions>\n </Attachment>\n</div>\n",
|
|
18
18
|
"type": "registry:component"
|
|
19
19
|
},
|
|
20
20
|
{
|