Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/responsive-image-formats.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fulldev-ui": minor
---

Add an optional Image component with Astro Picture formats, responsive sources and an unchanged single-image default.
3 changes: 1 addition & 2 deletions public/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,11 @@
/blocks/pricings/ /blocks/pricing/ 301!

/docs/components/auto-form/ /components/form/ 301!
/docs/components/image/ /components/ 301!
/docs/components/image/ /components/image/ 301!
/docs/components/list/ /components/typography/ 301!
/docs/components/ /components/ 301!
/docs/components/* /components/:splat 301!
/components/gradient/ /components/ 301!
/components/image/ /components/ 301!
/components/tile/ /components/ 301!

/docs/cli/ /docs/installation/ 301!
Expand Down
Binary file added public/og/components/image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/r/styles/base-luma/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@fulldev/header",
"@fulldev/hover-card",
"@fulldev/icon",
"@fulldev/image",
"@fulldev/input",
"@fulldev/input-group",
"@fulldev/item",
Expand Down
23 changes: 23 additions & 0 deletions public/r/styles/base-luma/image.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "image",
"title": "Image",
"description": "An optional image with responsive picture formats for existing Astro blocks.",
"files": [
{
"path": "src/components/ui/image/image.astro",
"content": "---\nimport { Image as AstroImage, Picture as AstroPicture } from \"astro:assets\"\nimport type { ComponentProps } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = Partial<ComponentProps<typeof AstroPicture>> & {\n inferSize?: boolean\n}\n\nconst {\n class: className,\n alt,\n src,\n inferSize = true,\n formats,\n fallbackFormat,\n pictureAttributes,\n ...props\n} = Astro.props\n\nconst imageProps = {\n ...props,\n src,\n alt: alt ?? \"\",\n class: cn(\"h-auto w-full\", className),\n inferSize,\n} as ComponentProps<typeof AstroImage>\nconst pictureProps = {\n ...imageProps,\n formats,\n fallbackFormat,\n pictureAttributes: {\n ...pictureAttributes,\n class: cn(\"contents [&>source]:hidden\", pictureAttributes?.class),\n },\n} as ComponentProps<typeof AstroPicture>\nconst usePicture = !!formats?.length\n---\n\n{src && usePicture && <AstroPicture {...pictureProps} />}\n{src && !usePicture && <AstroImage {...imageProps} />}\n",
"type": "registry:ui"
},
{
"path": "src/components/ui/image/index.ts",
"content": "export { default as Image } from \"./image.astro\"\n",
"type": "registry:ui"
}
],
"docs": "https://ui.full.dev/components/image/",
"categories": [
"ui"
],
"type": "registry:ui"
}
21 changes: 21 additions & 0 deletions public/r/styles/base-luma/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,26 @@
}
]
},
{
"name": "image",
"type": "registry:ui",
"title": "Image",
"description": "An optional image with responsive picture formats for existing Astro blocks.",
"categories": [
"ui"
],
"docs": "https://ui.full.dev/components/image/",
"files": [
{
"path": "src/components/ui/image/image.astro",
"type": "registry:ui"
},
{
"path": "src/components/ui/image/index.ts",
"type": "registry:ui"
}
]
},
{
"name": "input",
"type": "registry:ui",
Expand Down Expand Up @@ -2547,6 +2567,7 @@
"@fulldev/header",
"@fulldev/hover-card",
"@fulldev/icon",
"@fulldev/image",
"@fulldev/input",
"@fulldev/input-group",
"@fulldev/item",
Expand Down
1 change: 1 addition & 0 deletions public/r/styles/base-lyra/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@fulldev/header",
"@fulldev/hover-card",
"@fulldev/icon",
"@fulldev/image",
"@fulldev/input",
"@fulldev/input-group",
"@fulldev/item",
Expand Down
23 changes: 23 additions & 0 deletions public/r/styles/base-lyra/image.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "image",
"title": "Image",
"description": "An optional image with responsive picture formats for existing Astro blocks.",
"files": [
{
"path": "src/components/ui/image/image.astro",
"content": "---\nimport { Image as AstroImage, Picture as AstroPicture } from \"astro:assets\"\nimport type { ComponentProps } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = Partial<ComponentProps<typeof AstroPicture>> & {\n inferSize?: boolean\n}\n\nconst {\n class: className,\n alt,\n src,\n inferSize = true,\n formats,\n fallbackFormat,\n pictureAttributes,\n ...props\n} = Astro.props\n\nconst imageProps = {\n ...props,\n src,\n alt: alt ?? \"\",\n class: cn(\"h-auto w-full\", className),\n inferSize,\n} as ComponentProps<typeof AstroImage>\nconst pictureProps = {\n ...imageProps,\n formats,\n fallbackFormat,\n pictureAttributes: {\n ...pictureAttributes,\n class: cn(\"contents [&>source]:hidden\", pictureAttributes?.class),\n },\n} as ComponentProps<typeof AstroPicture>\nconst usePicture = !!formats?.length\n---\n\n{src && usePicture && <AstroPicture {...pictureProps} />}\n{src && !usePicture && <AstroImage {...imageProps} />}\n",
"type": "registry:ui"
},
{
"path": "src/components/ui/image/index.ts",
"content": "export { default as Image } from \"./image.astro\"\n",
"type": "registry:ui"
}
],
"docs": "https://ui.full.dev/components/image/",
"categories": [
"ui"
],
"type": "registry:ui"
}
21 changes: 21 additions & 0 deletions public/r/styles/base-lyra/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,26 @@
}
]
},
{
"name": "image",
"type": "registry:ui",
"title": "Image",
"description": "An optional image with responsive picture formats for existing Astro blocks.",
"categories": [
"ui"
],
"docs": "https://ui.full.dev/components/image/",
"files": [
{
"path": "src/components/ui/image/image.astro",
"type": "registry:ui"
},
{
"path": "src/components/ui/image/index.ts",
"type": "registry:ui"
}
]
},
{
"name": "input",
"type": "registry:ui",
Expand Down Expand Up @@ -2547,6 +2567,7 @@
"@fulldev/header",
"@fulldev/hover-card",
"@fulldev/icon",
"@fulldev/image",
"@fulldev/input",
"@fulldev/input-group",
"@fulldev/item",
Expand Down
1 change: 1 addition & 0 deletions public/r/styles/base-maia/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@fulldev/header",
"@fulldev/hover-card",
"@fulldev/icon",
"@fulldev/image",
"@fulldev/input",
"@fulldev/input-group",
"@fulldev/item",
Expand Down
23 changes: 23 additions & 0 deletions public/r/styles/base-maia/image.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "image",
"title": "Image",
"description": "An optional image with responsive picture formats for existing Astro blocks.",
"files": [
{
"path": "src/components/ui/image/image.astro",
"content": "---\nimport { Image as AstroImage, Picture as AstroPicture } from \"astro:assets\"\nimport type { ComponentProps } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = Partial<ComponentProps<typeof AstroPicture>> & {\n inferSize?: boolean\n}\n\nconst {\n class: className,\n alt,\n src,\n inferSize = true,\n formats,\n fallbackFormat,\n pictureAttributes,\n ...props\n} = Astro.props\n\nconst imageProps = {\n ...props,\n src,\n alt: alt ?? \"\",\n class: cn(\"h-auto w-full\", className),\n inferSize,\n} as ComponentProps<typeof AstroImage>\nconst pictureProps = {\n ...imageProps,\n formats,\n fallbackFormat,\n pictureAttributes: {\n ...pictureAttributes,\n class: cn(\"contents [&>source]:hidden\", pictureAttributes?.class),\n },\n} as ComponentProps<typeof AstroPicture>\nconst usePicture = !!formats?.length\n---\n\n{src && usePicture && <AstroPicture {...pictureProps} />}\n{src && !usePicture && <AstroImage {...imageProps} />}\n",
"type": "registry:ui"
},
{
"path": "src/components/ui/image/index.ts",
"content": "export { default as Image } from \"./image.astro\"\n",
"type": "registry:ui"
}
],
"docs": "https://ui.full.dev/components/image/",
"categories": [
"ui"
],
"type": "registry:ui"
}
21 changes: 21 additions & 0 deletions public/r/styles/base-maia/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,26 @@
}
]
},
{
"name": "image",
"type": "registry:ui",
"title": "Image",
"description": "An optional image with responsive picture formats for existing Astro blocks.",
"categories": [
"ui"
],
"docs": "https://ui.full.dev/components/image/",
"files": [
{
"path": "src/components/ui/image/image.astro",
"type": "registry:ui"
},
{
"path": "src/components/ui/image/index.ts",
"type": "registry:ui"
}
]
},
{
"name": "input",
"type": "registry:ui",
Expand Down Expand Up @@ -2547,6 +2567,7 @@
"@fulldev/header",
"@fulldev/hover-card",
"@fulldev/icon",
"@fulldev/image",
"@fulldev/input",
"@fulldev/input-group",
"@fulldev/item",
Expand Down
1 change: 1 addition & 0 deletions public/r/styles/base-mira/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@fulldev/header",
"@fulldev/hover-card",
"@fulldev/icon",
"@fulldev/image",
"@fulldev/input",
"@fulldev/input-group",
"@fulldev/item",
Expand Down
23 changes: 23 additions & 0 deletions public/r/styles/base-mira/image.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "image",
"title": "Image",
"description": "An optional image with responsive picture formats for existing Astro blocks.",
"files": [
{
"path": "src/components/ui/image/image.astro",
"content": "---\nimport { Image as AstroImage, Picture as AstroPicture } from \"astro:assets\"\nimport type { ComponentProps } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = Partial<ComponentProps<typeof AstroPicture>> & {\n inferSize?: boolean\n}\n\nconst {\n class: className,\n alt,\n src,\n inferSize = true,\n formats,\n fallbackFormat,\n pictureAttributes,\n ...props\n} = Astro.props\n\nconst imageProps = {\n ...props,\n src,\n alt: alt ?? \"\",\n class: cn(\"h-auto w-full\", className),\n inferSize,\n} as ComponentProps<typeof AstroImage>\nconst pictureProps = {\n ...imageProps,\n formats,\n fallbackFormat,\n pictureAttributes: {\n ...pictureAttributes,\n class: cn(\"contents [&>source]:hidden\", pictureAttributes?.class),\n },\n} as ComponentProps<typeof AstroPicture>\nconst usePicture = !!formats?.length\n---\n\n{src && usePicture && <AstroPicture {...pictureProps} />}\n{src && !usePicture && <AstroImage {...imageProps} />}\n",
"type": "registry:ui"
},
{
"path": "src/components/ui/image/index.ts",
"content": "export { default as Image } from \"./image.astro\"\n",
"type": "registry:ui"
}
],
"docs": "https://ui.full.dev/components/image/",
"categories": [
"ui"
],
"type": "registry:ui"
}
21 changes: 21 additions & 0 deletions public/r/styles/base-mira/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,26 @@
}
]
},
{
"name": "image",
"type": "registry:ui",
"title": "Image",
"description": "An optional image with responsive picture formats for existing Astro blocks.",
"categories": [
"ui"
],
"docs": "https://ui.full.dev/components/image/",
"files": [
{
"path": "src/components/ui/image/image.astro",
"type": "registry:ui"
},
{
"path": "src/components/ui/image/index.ts",
"type": "registry:ui"
}
]
},
{
"name": "input",
"type": "registry:ui",
Expand Down Expand Up @@ -2547,6 +2567,7 @@
"@fulldev/header",
"@fulldev/hover-card",
"@fulldev/icon",
"@fulldev/image",
"@fulldev/input",
"@fulldev/input-group",
"@fulldev/item",
Expand Down
1 change: 1 addition & 0 deletions public/r/styles/base-nova/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@fulldev/header",
"@fulldev/hover-card",
"@fulldev/icon",
"@fulldev/image",
"@fulldev/input",
"@fulldev/input-group",
"@fulldev/item",
Expand Down
23 changes: 23 additions & 0 deletions public/r/styles/base-nova/image.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "image",
"title": "Image",
"description": "An optional image with responsive picture formats for existing Astro blocks.",
"files": [
{
"path": "src/components/ui/image/image.astro",
"content": "---\nimport { Image as AstroImage, Picture as AstroPicture } from \"astro:assets\"\nimport type { ComponentProps } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = Partial<ComponentProps<typeof AstroPicture>> & {\n inferSize?: boolean\n}\n\nconst {\n class: className,\n alt,\n src,\n inferSize = true,\n formats,\n fallbackFormat,\n pictureAttributes,\n ...props\n} = Astro.props\n\nconst imageProps = {\n ...props,\n src,\n alt: alt ?? \"\",\n class: cn(\"h-auto w-full\", className),\n inferSize,\n} as ComponentProps<typeof AstroImage>\nconst pictureProps = {\n ...imageProps,\n formats,\n fallbackFormat,\n pictureAttributes: {\n ...pictureAttributes,\n class: cn(\"contents [&>source]:hidden\", pictureAttributes?.class),\n },\n} as ComponentProps<typeof AstroPicture>\nconst usePicture = !!formats?.length\n---\n\n{src && usePicture && <AstroPicture {...pictureProps} />}\n{src && !usePicture && <AstroImage {...imageProps} />}\n",
"type": "registry:ui"
},
{
"path": "src/components/ui/image/index.ts",
"content": "export { default as Image } from \"./image.astro\"\n",
"type": "registry:ui"
}
],
"docs": "https://ui.full.dev/components/image/",
"categories": [
"ui"
],
"type": "registry:ui"
}
21 changes: 21 additions & 0 deletions public/r/styles/base-nova/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,26 @@
}
]
},
{
"name": "image",
"type": "registry:ui",
"title": "Image",
"description": "An optional image with responsive picture formats for existing Astro blocks.",
"categories": [
"ui"
],
"docs": "https://ui.full.dev/components/image/",
"files": [
{
"path": "src/components/ui/image/image.astro",
"type": "registry:ui"
},
{
"path": "src/components/ui/image/index.ts",
"type": "registry:ui"
}
]
},
{
"name": "input",
"type": "registry:ui",
Expand Down Expand Up @@ -2547,6 +2567,7 @@
"@fulldev/header",
"@fulldev/hover-card",
"@fulldev/icon",
"@fulldev/image",
"@fulldev/input",
"@fulldev/input-group",
"@fulldev/item",
Expand Down
1 change: 1 addition & 0 deletions public/r/styles/base-rhea/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@fulldev/header",
"@fulldev/hover-card",
"@fulldev/icon",
"@fulldev/image",
"@fulldev/input",
"@fulldev/input-group",
"@fulldev/item",
Expand Down
23 changes: 23 additions & 0 deletions public/r/styles/base-rhea/image.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "image",
"title": "Image",
"description": "An optional image with responsive picture formats for existing Astro blocks.",
"files": [
{
"path": "src/components/ui/image/image.astro",
"content": "---\nimport { Image as AstroImage, Picture as AstroPicture } from \"astro:assets\"\nimport type { ComponentProps } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = Partial<ComponentProps<typeof AstroPicture>> & {\n inferSize?: boolean\n}\n\nconst {\n class: className,\n alt,\n src,\n inferSize = true,\n formats,\n fallbackFormat,\n pictureAttributes,\n ...props\n} = Astro.props\n\nconst imageProps = {\n ...props,\n src,\n alt: alt ?? \"\",\n class: cn(\"h-auto w-full\", className),\n inferSize,\n} as ComponentProps<typeof AstroImage>\nconst pictureProps = {\n ...imageProps,\n formats,\n fallbackFormat,\n pictureAttributes: {\n ...pictureAttributes,\n class: cn(\"contents [&>source]:hidden\", pictureAttributes?.class),\n },\n} as ComponentProps<typeof AstroPicture>\nconst usePicture = !!formats?.length\n---\n\n{src && usePicture && <AstroPicture {...pictureProps} />}\n{src && !usePicture && <AstroImage {...imageProps} />}\n",
"type": "registry:ui"
},
{
"path": "src/components/ui/image/index.ts",
"content": "export { default as Image } from \"./image.astro\"\n",
"type": "registry:ui"
}
],
"docs": "https://ui.full.dev/components/image/",
"categories": [
"ui"
],
"type": "registry:ui"
}
Loading