fulldev-ui 0.17.2 → 0.17.3
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 +6 -0
- package/package.json +1 -1
- package/public/r/dialog.json +1 -1
- package/public/r/rating.json +1 -1
- package/public/r/styles/base-luma/dialog.json +1 -1
- package/public/r/styles/base-luma/rating.json +1 -1
- package/public/r/styles/base-lyra/dialog.json +1 -1
- package/public/r/styles/base-lyra/rating.json +1 -1
- package/public/r/styles/base-maia/dialog.json +1 -1
- package/public/r/styles/base-maia/rating.json +1 -1
- package/public/r/styles/base-mira/dialog.json +1 -1
- package/public/r/styles/base-mira/rating.json +1 -1
- package/public/r/styles/base-nova/dialog.json +1 -1
- package/public/r/styles/base-nova/rating.json +1 -1
- package/public/r/styles/base-rhea/dialog.json +1 -1
- package/public/r/styles/base-rhea/rating.json +1 -1
- package/public/r/styles/base-sera/dialog.json +1 -1
- package/public/r/styles/base-sera/rating.json +1 -1
- package/public/r/styles/base-vega/dialog.json +1 -1
- package/public/r/styles/base-vega/rating.json +1 -1
- package/src/components/ui/dialog/dialog-close.astro +1 -0
- package/src/components/ui/rating/rating.astro +16 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Fulldev UI
|
|
2
2
|
|
|
3
|
+
## 0.17.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#246](https://github.com/fulldotdev/ui/pull/246) [`41f1f73`](https://github.com/fulldotdev/ui/commit/41f1f73c687043265bca59c7dc39fc39c1fab6e5) Thanks [@silveltman](https://github.com/silveltman)! - Give the default `DialogClose` icon a screen-reader "Close" label, and expose `Rating` to assistive technology as an image labelled "Rated N out of 5" (override with `aria-label`).
|
|
8
|
+
|
|
3
9
|
## 0.17.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/package.json
CHANGED
package/public/r/dialog.json
CHANGED
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"path": "src/components/ui/dialog/dialog-close.astro",
|
|
61
|
-
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n </slot>\n</Button>\n",
|
|
61
|
+
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n <span class=\"sr-only\">Close</span>\n </slot>\n</Button>\n",
|
|
62
62
|
"type": "registry:ui"
|
|
63
63
|
},
|
|
64
64
|
{
|
package/public/r/rating.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
11
11
|
"path": "src/components/ui/rating/rating.astro",
|
|
12
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {
|
|
12
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {\n value = 5,\n class: className,\n \"aria-label\": ariaLabel = `Rated ${value} out of 5`,\n ...props\n} = Astro.props\n---\n\n<div\n role=\"img\"\n aria-label={ariaLabel}\n class={cn(\"flex items-center gap-1 text-base\", className)}\n {...props}\n>\n {\n Array.from({ length: 5 }).map((_, index) => {\n const fillPercentage =\n index < Math.floor(value)\n ? 100\n : index === Math.floor(value)\n ? (value % 1) * 100\n : 0\n\n return (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground/25 relative inline-flex size-[1em]\"\n >\n <Star class=\"size-[1em] fill-current\" />\n {fillPercentage > 0 && (\n <span\n class=\"text-primary absolute inset-0 overflow-hidden\"\n style={{ width: `${fillPercentage}%` }}\n >\n <Star class=\"size-[1em] fill-current\" />\n </span>\n )}\n </span>\n )\n })\n }\n</div>\n",
|
|
13
13
|
"type": "registry:ui"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"path": "src/components/ui/dialog/dialog-close.astro",
|
|
61
|
-
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n </slot>\n</Button>\n",
|
|
61
|
+
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n <span class=\"sr-only\">Close</span>\n </slot>\n</Button>\n",
|
|
62
62
|
"type": "registry:ui"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
11
11
|
"path": "src/components/ui/rating/rating.astro",
|
|
12
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {
|
|
12
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {\n value = 5,\n class: className,\n \"aria-label\": ariaLabel = `Rated ${value} out of 5`,\n ...props\n} = Astro.props\n---\n\n<div\n role=\"img\"\n aria-label={ariaLabel}\n class={cn(\"flex items-center gap-1 text-base\", className)}\n {...props}\n>\n {\n Array.from({ length: 5 }).map((_, index) => {\n const fillPercentage =\n index < Math.floor(value)\n ? 100\n : index === Math.floor(value)\n ? (value % 1) * 100\n : 0\n\n return (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground/25 relative inline-flex size-[1em]\"\n >\n <Star class=\"size-[1em] fill-current\" />\n {fillPercentage > 0 && (\n <span\n class=\"text-primary absolute inset-0 overflow-hidden\"\n style={{ width: `${fillPercentage}%` }}\n >\n <Star class=\"size-[1em] fill-current\" />\n </span>\n )}\n </span>\n )\n })\n }\n</div>\n",
|
|
13
13
|
"type": "registry:ui"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"path": "src/components/ui/dialog/dialog-close.astro",
|
|
61
|
-
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n </slot>\n</Button>\n",
|
|
61
|
+
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n <span class=\"sr-only\">Close</span>\n </slot>\n</Button>\n",
|
|
62
62
|
"type": "registry:ui"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
11
11
|
"path": "src/components/ui/rating/rating.astro",
|
|
12
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {
|
|
12
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {\n value = 5,\n class: className,\n \"aria-label\": ariaLabel = `Rated ${value} out of 5`,\n ...props\n} = Astro.props\n---\n\n<div\n role=\"img\"\n aria-label={ariaLabel}\n class={cn(\"flex items-center gap-1 text-base\", className)}\n {...props}\n>\n {\n Array.from({ length: 5 }).map((_, index) => {\n const fillPercentage =\n index < Math.floor(value)\n ? 100\n : index === Math.floor(value)\n ? (value % 1) * 100\n : 0\n\n return (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground/25 relative inline-flex size-[1em]\"\n >\n <Star class=\"size-[1em] fill-current\" />\n {fillPercentage > 0 && (\n <span\n class=\"text-primary absolute inset-0 overflow-hidden\"\n style={{ width: `${fillPercentage}%` }}\n >\n <Star class=\"size-[1em] fill-current\" />\n </span>\n )}\n </span>\n )\n })\n }\n</div>\n",
|
|
13
13
|
"type": "registry:ui"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"path": "src/components/ui/dialog/dialog-close.astro",
|
|
61
|
-
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n </slot>\n</Button>\n",
|
|
61
|
+
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n <span class=\"sr-only\">Close</span>\n </slot>\n</Button>\n",
|
|
62
62
|
"type": "registry:ui"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
11
11
|
"path": "src/components/ui/rating/rating.astro",
|
|
12
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {
|
|
12
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {\n value = 5,\n class: className,\n \"aria-label\": ariaLabel = `Rated ${value} out of 5`,\n ...props\n} = Astro.props\n---\n\n<div\n role=\"img\"\n aria-label={ariaLabel}\n class={cn(\"flex items-center gap-1 text-base\", className)}\n {...props}\n>\n {\n Array.from({ length: 5 }).map((_, index) => {\n const fillPercentage =\n index < Math.floor(value)\n ? 100\n : index === Math.floor(value)\n ? (value % 1) * 100\n : 0\n\n return (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground/25 relative inline-flex size-[1em]\"\n >\n <Star class=\"size-[1em] fill-current\" />\n {fillPercentage > 0 && (\n <span\n class=\"text-primary absolute inset-0 overflow-hidden\"\n style={{ width: `${fillPercentage}%` }}\n >\n <Star class=\"size-[1em] fill-current\" />\n </span>\n )}\n </span>\n )\n })\n }\n</div>\n",
|
|
13
13
|
"type": "registry:ui"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"path": "src/components/ui/dialog/dialog-close.astro",
|
|
61
|
-
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n </slot>\n</Button>\n",
|
|
61
|
+
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n <span class=\"sr-only\">Close</span>\n </slot>\n</Button>\n",
|
|
62
62
|
"type": "registry:ui"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
11
11
|
"path": "src/components/ui/rating/rating.astro",
|
|
12
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {
|
|
12
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {\n value = 5,\n class: className,\n \"aria-label\": ariaLabel = `Rated ${value} out of 5`,\n ...props\n} = Astro.props\n---\n\n<div\n role=\"img\"\n aria-label={ariaLabel}\n class={cn(\"flex items-center gap-1 text-base\", className)}\n {...props}\n>\n {\n Array.from({ length: 5 }).map((_, index) => {\n const fillPercentage =\n index < Math.floor(value)\n ? 100\n : index === Math.floor(value)\n ? (value % 1) * 100\n : 0\n\n return (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground/25 relative inline-flex size-[1em]\"\n >\n <Star class=\"size-[1em] fill-current\" />\n {fillPercentage > 0 && (\n <span\n class=\"text-primary absolute inset-0 overflow-hidden\"\n style={{ width: `${fillPercentage}%` }}\n >\n <Star class=\"size-[1em] fill-current\" />\n </span>\n )}\n </span>\n )\n })\n }\n</div>\n",
|
|
13
13
|
"type": "registry:ui"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"path": "src/components/ui/dialog/dialog-close.astro",
|
|
61
|
-
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n </slot>\n</Button>\n",
|
|
61
|
+
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n <span class=\"sr-only\">Close</span>\n </slot>\n</Button>\n",
|
|
62
62
|
"type": "registry:ui"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
11
11
|
"path": "src/components/ui/rating/rating.astro",
|
|
12
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {
|
|
12
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {\n value = 5,\n class: className,\n \"aria-label\": ariaLabel = `Rated ${value} out of 5`,\n ...props\n} = Astro.props\n---\n\n<div\n role=\"img\"\n aria-label={ariaLabel}\n class={cn(\"flex items-center gap-1 text-base\", className)}\n {...props}\n>\n {\n Array.from({ length: 5 }).map((_, index) => {\n const fillPercentage =\n index < Math.floor(value)\n ? 100\n : index === Math.floor(value)\n ? (value % 1) * 100\n : 0\n\n return (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground/25 relative inline-flex size-[1em]\"\n >\n <Star class=\"size-[1em] fill-current\" />\n {fillPercentage > 0 && (\n <span\n class=\"text-primary absolute inset-0 overflow-hidden\"\n style={{ width: `${fillPercentage}%` }}\n >\n <Star class=\"size-[1em] fill-current\" />\n </span>\n )}\n </span>\n )\n })\n }\n</div>\n",
|
|
13
13
|
"type": "registry:ui"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"path": "src/components/ui/dialog/dialog-close.astro",
|
|
61
|
-
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n </slot>\n</Button>\n",
|
|
61
|
+
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n <span class=\"sr-only\">Close</span>\n </slot>\n</Button>\n",
|
|
62
62
|
"type": "registry:ui"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
11
11
|
"path": "src/components/ui/rating/rating.astro",
|
|
12
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {
|
|
12
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {\n value = 5,\n class: className,\n \"aria-label\": ariaLabel = `Rated ${value} out of 5`,\n ...props\n} = Astro.props\n---\n\n<div\n role=\"img\"\n aria-label={ariaLabel}\n class={cn(\"flex items-center gap-1 text-base\", className)}\n {...props}\n>\n {\n Array.from({ length: 5 }).map((_, index) => {\n const fillPercentage =\n index < Math.floor(value)\n ? 100\n : index === Math.floor(value)\n ? (value % 1) * 100\n : 0\n\n return (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground/25 relative inline-flex size-[1em]\"\n >\n <Star class=\"size-[1em] fill-current\" />\n {fillPercentage > 0 && (\n <span\n class=\"text-primary absolute inset-0 overflow-hidden\"\n style={{ width: `${fillPercentage}%` }}\n >\n <Star class=\"size-[1em] fill-current\" />\n </span>\n )}\n </span>\n )\n })\n }\n</div>\n",
|
|
13
13
|
"type": "registry:ui"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"path": "src/components/ui/dialog/dialog-close.astro",
|
|
61
|
-
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n </slot>\n</Button>\n",
|
|
61
|
+
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n <span class=\"sr-only\">Close</span>\n </slot>\n</Button>\n",
|
|
62
62
|
"type": "registry:ui"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
11
11
|
"path": "src/components/ui/rating/rating.astro",
|
|
12
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {
|
|
12
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {\n value = 5,\n class: className,\n \"aria-label\": ariaLabel = `Rated ${value} out of 5`,\n ...props\n} = Astro.props\n---\n\n<div\n role=\"img\"\n aria-label={ariaLabel}\n class={cn(\"flex items-center gap-1 text-base\", className)}\n {...props}\n>\n {\n Array.from({ length: 5 }).map((_, index) => {\n const fillPercentage =\n index < Math.floor(value)\n ? 100\n : index === Math.floor(value)\n ? (value % 1) * 100\n : 0\n\n return (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground/25 relative inline-flex size-[1em]\"\n >\n <Star class=\"size-[1em] fill-current\" />\n {fillPercentage > 0 && (\n <span\n class=\"text-primary absolute inset-0 overflow-hidden\"\n style={{ width: `${fillPercentage}%` }}\n >\n <Star class=\"size-[1em] fill-current\" />\n </span>\n )}\n </span>\n )\n })\n }\n</div>\n",
|
|
13
13
|
"type": "registry:ui"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"path": "src/components/ui/dialog/dialog-close.astro",
|
|
61
|
-
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n </slot>\n</Button>\n",
|
|
61
|
+
"content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button class={cn(className)} data-slot=\"dialog-close\" {...props}>\n <slot>\n <X />\n <span class=\"sr-only\">Close</span>\n </slot>\n</Button>\n",
|
|
62
62
|
"type": "registry:ui"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
11
11
|
"path": "src/components/ui/rating/rating.astro",
|
|
12
|
-
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {
|
|
12
|
+
"content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport Star from \"@lucide/astro/icons/star\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n value?: number\n}\n\nconst {\n value = 5,\n class: className,\n \"aria-label\": ariaLabel = `Rated ${value} out of 5`,\n ...props\n} = Astro.props\n---\n\n<div\n role=\"img\"\n aria-label={ariaLabel}\n class={cn(\"flex items-center gap-1 text-base\", className)}\n {...props}\n>\n {\n Array.from({ length: 5 }).map((_, index) => {\n const fillPercentage =\n index < Math.floor(value)\n ? 100\n : index === Math.floor(value)\n ? (value % 1) * 100\n : 0\n\n return (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground/25 relative inline-flex size-[1em]\"\n >\n <Star class=\"size-[1em] fill-current\" />\n {fillPercentage > 0 && (\n <span\n class=\"text-primary absolute inset-0 overflow-hidden\"\n style={{ width: `${fillPercentage}%` }}\n >\n <Star class=\"size-[1em] fill-current\" />\n </span>\n )}\n </span>\n )\n })\n }\n</div>\n",
|
|
13
13
|
"type": "registry:ui"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
@@ -8,10 +8,20 @@ type Props = HTMLAttributes<"div"> & {
|
|
|
8
8
|
value?: number
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
const {
|
|
11
|
+
const {
|
|
12
|
+
value = 5,
|
|
13
|
+
class: className,
|
|
14
|
+
"aria-label": ariaLabel = `Rated ${value} out of 5`,
|
|
15
|
+
...props
|
|
16
|
+
} = Astro.props
|
|
12
17
|
---
|
|
13
18
|
|
|
14
|
-
<div
|
|
19
|
+
<div
|
|
20
|
+
role="img"
|
|
21
|
+
aria-label={ariaLabel}
|
|
22
|
+
class={cn("flex items-center gap-1 text-base", className)}
|
|
23
|
+
{...props}
|
|
24
|
+
>
|
|
15
25
|
{
|
|
16
26
|
Array.from({ length: 5 }).map((_, index) => {
|
|
17
27
|
const fillPercentage =
|
|
@@ -22,7 +32,10 @@ const { value = 5, class: className, ...props } = Astro.props
|
|
|
22
32
|
: 0
|
|
23
33
|
|
|
24
34
|
return (
|
|
25
|
-
<span
|
|
35
|
+
<span
|
|
36
|
+
aria-hidden="true"
|
|
37
|
+
class="text-muted-foreground/25 relative inline-flex size-[1em]"
|
|
38
|
+
>
|
|
26
39
|
<Star class="size-[1em] fill-current" />
|
|
27
40
|
{fillPercentage > 0 && (
|
|
28
41
|
<span
|