fulldev-ui 0.14.2 → 0.14.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Fulldev UI
2
2
 
3
+ ## 0.14.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#215](https://github.com/fulldotdev/ui/pull/215) [`b87b9e1`](https://github.com/fulldotdev/ui/commit/b87b9e113f14453f9fd349555ee3654679457dc9) Thanks [@silveltman](https://github.com/silveltman)! - Pause the `Marquee` animation when the visitor prefers reduced motion, and keep a `disabled` value passed to `CarouselPrevious` or `CarouselNext` instead of overwriting it when the carousel scrolls.
8
+
3
9
  ## 0.14.2
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fulldev-ui",
3
3
  "type": "module",
4
- "version": "0.14.2",
4
+ "version": "0.14.3",
5
5
  "description": "Open-source Astro UI components and blocks",
6
6
  "homepage": "https://ui.full.dev",
7
7
  "bugs": "https://github.com/fulldotdev/ui/issues",
@@ -28,12 +28,12 @@
28
28
  },
29
29
  {
30
30
  "path": "src/components/ui/carousel/carousel-next.astro",
31
- "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport ChevronRightIcon from \"@lucide/astro/icons/chevron-right\"\n\nimport { cn } from \"@/lib/utils\"\nimport { buttonVariants, type ButtonVariantProps } from \"@/components/ui/button\"\n\ntype Props = Omit<HTMLAttributes<\"button\">, \"type\"> & ButtonVariantProps\n\nconst {\n class: className,\n variant = \"outline\",\n size = \"icon-sm\",\n ...props\n} = Astro.props\n---\n\n<button\n type=\"button\"\n data-slot=\"carousel-next\"\n class={cn(\n buttonVariants({ variant, size }),\n \"absolute touch-manipulation rounded-full group-data-[orientation=horizontal]/carousel:inset-y-0 group-data-[orientation=horizontal]/carousel:-right-12 group-data-[orientation=horizontal]/carousel:my-auto\",\n \"group-data-[orientation=vertical]/carousel:right-auto group-data-[orientation=vertical]/carousel:-bottom-12 group-data-[orientation=vertical]/carousel:left-1/2 group-data-[orientation=vertical]/carousel:-translate-x-1/2 group-data-[orientation=vertical]/carousel:translate-y-0 group-data-[orientation=vertical]/carousel:rotate-90\",\n className\n )}\n {...props}\n>\n <slot>\n <ChevronRightIcon aria-hidden=\"true\" />\n <span class=\"sr-only\">Next slide</span>\n </slot>\n</button>\n",
31
+ "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport ChevronRightIcon from \"@lucide/astro/icons/chevron-right\"\n\nimport { cn } from \"@/lib/utils\"\nimport { buttonVariants, type ButtonVariantProps } from \"@/components/ui/button\"\n\ntype Props = Omit<HTMLAttributes<\"button\">, \"type\"> & ButtonVariantProps\n\nconst {\n class: className,\n variant = \"outline\",\n size = \"icon-sm\",\n disabled,\n ...props\n} = Astro.props\n---\n\n<button\n type=\"button\"\n data-slot=\"carousel-next\"\n data-manual-disabled={disabled ? \"true\" : undefined}\n disabled={disabled}\n class={cn(\n buttonVariants({ variant, size }),\n \"absolute touch-manipulation rounded-full group-data-[orientation=horizontal]/carousel:inset-y-0 group-data-[orientation=horizontal]/carousel:-right-12 group-data-[orientation=horizontal]/carousel:my-auto\",\n \"group-data-[orientation=vertical]/carousel:right-auto group-data-[orientation=vertical]/carousel:-bottom-12 group-data-[orientation=vertical]/carousel:left-1/2 group-data-[orientation=vertical]/carousel:-translate-x-1/2 group-data-[orientation=vertical]/carousel:translate-y-0 group-data-[orientation=vertical]/carousel:rotate-90\",\n className\n )}\n {...props}\n>\n <slot>\n <ChevronRightIcon aria-hidden=\"true\" />\n <span class=\"sr-only\">Next slide</span>\n </slot>\n</button>\n",
32
32
  "type": "registry:ui"
33
33
  },
34
34
  {
35
35
  "path": "src/components/ui/carousel/carousel-previous.astro",
36
- "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport ChevronLeftIcon from \"@lucide/astro/icons/chevron-left\"\n\nimport { cn } from \"@/lib/utils\"\nimport { buttonVariants, type ButtonVariantProps } from \"@/components/ui/button\"\n\ntype Props = Omit<HTMLAttributes<\"button\">, \"type\"> & ButtonVariantProps\n\nconst {\n class: className,\n variant = \"outline\",\n size = \"icon-sm\",\n ...props\n} = Astro.props\n---\n\n<button\n type=\"button\"\n data-slot=\"carousel-previous\"\n class={cn(\n buttonVariants({ variant, size }),\n \"absolute touch-manipulation rounded-full group-data-[orientation=horizontal]/carousel:inset-y-0 group-data-[orientation=horizontal]/carousel:-left-12 group-data-[orientation=horizontal]/carousel:my-auto\",\n \"group-data-[orientation=vertical]/carousel:-top-12 group-data-[orientation=vertical]/carousel:left-1/2 group-data-[orientation=vertical]/carousel:-translate-x-1/2 group-data-[orientation=vertical]/carousel:translate-y-0 group-data-[orientation=vertical]/carousel:rotate-90\",\n className\n )}\n {...props}\n>\n <slot>\n <ChevronLeftIcon aria-hidden=\"true\" />\n <span class=\"sr-only\">Previous slide</span>\n </slot>\n</button>\n",
36
+ "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport ChevronLeftIcon from \"@lucide/astro/icons/chevron-left\"\n\nimport { cn } from \"@/lib/utils\"\nimport { buttonVariants, type ButtonVariantProps } from \"@/components/ui/button\"\n\ntype Props = Omit<HTMLAttributes<\"button\">, \"type\"> & ButtonVariantProps\n\nconst {\n class: className,\n variant = \"outline\",\n size = \"icon-sm\",\n disabled,\n ...props\n} = Astro.props\n---\n\n<button\n type=\"button\"\n data-slot=\"carousel-previous\"\n data-manual-disabled={disabled ? \"true\" : undefined}\n disabled={disabled}\n class={cn(\n buttonVariants({ variant, size }),\n \"absolute touch-manipulation rounded-full group-data-[orientation=horizontal]/carousel:inset-y-0 group-data-[orientation=horizontal]/carousel:-left-12 group-data-[orientation=horizontal]/carousel:my-auto\",\n \"group-data-[orientation=vertical]/carousel:-top-12 group-data-[orientation=vertical]/carousel:left-1/2 group-data-[orientation=vertical]/carousel:-translate-x-1/2 group-data-[orientation=vertical]/carousel:translate-y-0 group-data-[orientation=vertical]/carousel:rotate-90\",\n className\n )}\n {...props}\n>\n <slot>\n <ChevronLeftIcon aria-hidden=\"true\" />\n <span class=\"sr-only\">Previous slide</span>\n </slot>\n</button>\n",
37
37
  "type": "registry:ui"
38
38
  },
39
39
  {
@@ -6,7 +6,7 @@
6
6
  "files": [
7
7
  {
8
8
  "path": "src/components/ui/marquee/marquee.astro",
9
- "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst trackVariants = cva(\n \"flex min-w-max shrink-0 [animation:marquee_var(--marquee-duration)_linear_infinite] items-center gap-[var(--marquee-gap)] before:block before:size-0 before:shrink-0 before:content-['']\",\n {\n variants: {\n direction: {\n left: \"\",\n right: \"[animation-direction:reverse]\",\n },\n pauseOnHover: {\n true: \"group-hover/marquee:[animation-play-state:paused]\",\n false: \"\",\n },\n },\n defaultVariants: {\n direction: \"left\",\n pauseOnHover: false,\n },\n }\n)\n\ntype Props = HTMLAttributes<\"div\"> &\n VariantProps<typeof trackVariants> & {\n duration?: string\n gap?: string\n infinite?: boolean\n }\n\nconst {\n class: className,\n direction,\n pauseOnHover,\n duration = \"40s\",\n gap = \"1.5rem\",\n infinite = true,\n style,\n ...props\n} = Astro.props\n\nconst resolvedStyle = [\n `--marquee-duration:${duration}`,\n `--marquee-gap:${gap}`,\n typeof style === \"string\" ? style : undefined,\n]\n .filter(Boolean)\n .join(\";\")\n---\n\n<div\n class={cn(\n \"group/marquee flex overflow-hidden select-none [--marquee-duration:40s] [--marquee-gap:1.5rem]\",\n className\n )}\n style={resolvedStyle}\n {...props}\n>\n <div class={trackVariants({ direction, pauseOnHover })}>\n <slot />\n </div>\n {\n infinite && (\n <div\n aria-hidden=\"true\"\n class={trackVariants({ direction, pauseOnHover })}\n >\n <slot />\n </div>\n )\n }\n</div>\n\n<style>\n @keyframes marquee {\n from {\n transform: translateX(0);\n }\n\n to {\n transform: translateX(-100%);\n }\n }\n</style>\n",
9
+ "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst trackVariants = cva(\n \"flex min-w-max shrink-0 [animation:marquee_var(--marquee-duration)_linear_infinite] items-center gap-[var(--marquee-gap)] before:block before:size-0 before:shrink-0 before:content-[''] motion-reduce:[animation-play-state:paused]\",\n {\n variants: {\n direction: {\n left: \"\",\n right: \"[animation-direction:reverse]\",\n },\n pauseOnHover: {\n true: \"group-hover/marquee:[animation-play-state:paused]\",\n false: \"\",\n },\n },\n defaultVariants: {\n direction: \"left\",\n pauseOnHover: false,\n },\n }\n)\n\ntype Props = HTMLAttributes<\"div\"> &\n VariantProps<typeof trackVariants> & {\n duration?: string\n gap?: string\n infinite?: boolean\n }\n\nconst {\n class: className,\n direction,\n pauseOnHover,\n duration = \"40s\",\n gap = \"1.5rem\",\n infinite = true,\n style,\n ...props\n} = Astro.props\n\nconst resolvedStyle = [\n `--marquee-duration:${duration}`,\n `--marquee-gap:${gap}`,\n typeof style === \"string\" ? style : undefined,\n]\n .filter(Boolean)\n .join(\";\")\n---\n\n<div\n class={cn(\n \"group/marquee flex overflow-hidden select-none [--marquee-duration:40s] [--marquee-gap:1.5rem]\",\n className\n )}\n style={resolvedStyle}\n {...props}\n>\n <div class={trackVariants({ direction, pauseOnHover })}>\n <slot />\n </div>\n {\n infinite && (\n <div\n aria-hidden=\"true\"\n class={trackVariants({ direction, pauseOnHover })}\n >\n <slot />\n </div>\n )\n }\n</div>\n\n<style>\n @keyframes marquee {\n from {\n transform: translateX(0);\n }\n\n to {\n transform: translateX(-100%);\n }\n }\n</style>\n",
10
10
  "type": "registry:ui"
11
11
  },
12
12
  {
@@ -11,6 +11,7 @@ const {
11
11
  class: className,
12
12
  variant = "outline",
13
13
  size = "icon-sm",
14
+ disabled,
14
15
  ...props
15
16
  } = Astro.props
16
17
  ---
@@ -18,6 +19,8 @@ const {
18
19
  <button
19
20
  type="button"
20
21
  data-slot="carousel-next"
22
+ data-manual-disabled={disabled ? "true" : undefined}
23
+ disabled={disabled}
21
24
  class={cn(
22
25
  buttonVariants({ variant, size }),
23
26
  "absolute touch-manipulation rounded-full group-data-[orientation=horizontal]/carousel:inset-y-0 group-data-[orientation=horizontal]/carousel:-right-12 group-data-[orientation=horizontal]/carousel:my-auto",
@@ -11,6 +11,7 @@ const {
11
11
  class: className,
12
12
  variant = "outline",
13
13
  size = "icon-sm",
14
+ disabled,
14
15
  ...props
15
16
  } = Astro.props
16
17
  ---
@@ -18,6 +19,8 @@ const {
18
19
  <button
19
20
  type="button"
20
21
  data-slot="carousel-previous"
22
+ data-manual-disabled={disabled ? "true" : undefined}
23
+ disabled={disabled}
21
24
  class={cn(
22
25
  buttonVariants({ variant, size }),
23
26
  "absolute touch-manipulation rounded-full group-data-[orientation=horizontal]/carousel:inset-y-0 group-data-[orientation=horizontal]/carousel:-left-12 group-data-[orientation=horizontal]/carousel:my-auto",
@@ -5,7 +5,7 @@ import { cva, type VariantProps } from "class-variance-authority"
5
5
  import { cn } from "@/lib/utils"
6
6
 
7
7
  const trackVariants = cva(
8
- "flex min-w-max shrink-0 [animation:marquee_var(--marquee-duration)_linear_infinite] items-center gap-[var(--marquee-gap)] before:block before:size-0 before:shrink-0 before:content-['']",
8
+ "flex min-w-max shrink-0 [animation:marquee_var(--marquee-duration)_linear_infinite] items-center gap-[var(--marquee-gap)] before:block before:size-0 before:shrink-0 before:content-[''] motion-reduce:[animation-play-state:paused]",
9
9
  {
10
10
  variants: {
11
11
  direction: {