@starwind-ui/core 1.7.3 → 1.9.0

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.
Files changed (134) hide show
  1. package/dist/index.js +41 -23
  2. package/dist/index.js.map +1 -1
  3. package/dist/src/components/accordion/Accordion.astro +8 -2
  4. package/dist/src/components/accordion/AccordionContent.astro +2 -1
  5. package/dist/src/components/accordion/AccordionItem.astro +8 -2
  6. package/dist/src/components/accordion/AccordionTrigger.astro +2 -1
  7. package/dist/src/components/accordion/index.ts +7 -5
  8. package/dist/src/components/alert/Alert.astro +5 -2
  9. package/dist/src/components/alert/AlertDescription.astro +4 -4
  10. package/dist/src/components/alert/AlertTitle.astro +3 -3
  11. package/dist/src/components/alert/index.ts +6 -4
  12. package/dist/src/components/alert-dialog/AlertDialog.astro +273 -0
  13. package/dist/src/components/alert-dialog/AlertDialogAction.astro +44 -0
  14. package/dist/src/components/alert-dialog/AlertDialogCancel.astro +45 -0
  15. package/dist/src/components/alert-dialog/AlertDialogContent.astro +50 -0
  16. package/dist/src/components/alert-dialog/AlertDialogDescription.astro +18 -0
  17. package/dist/src/components/alert-dialog/AlertDialogFooter.astro +16 -0
  18. package/dist/src/components/alert-dialog/AlertDialogHeader.astro +14 -0
  19. package/dist/src/components/alert-dialog/AlertDialogTitle.astro +20 -0
  20. package/dist/src/components/alert-dialog/AlertDialogTrigger.astro +47 -0
  21. package/dist/src/components/alert-dialog/index.ts +46 -0
  22. package/dist/src/components/avatar/Avatar.astro +2 -2
  23. package/dist/src/components/avatar/AvatarFallback.astro +2 -2
  24. package/dist/src/components/avatar/AvatarImage.astro +13 -2
  25. package/dist/src/components/avatar/index.ts +6 -4
  26. package/dist/src/components/badge/Badge.astro +2 -2
  27. package/dist/src/components/badge/index.ts +4 -2
  28. package/dist/src/components/breadcrumb/Breadcrumb.astro +1 -1
  29. package/dist/src/components/breadcrumb/BreadcrumbEllipsis.astro +4 -1
  30. package/dist/src/components/breadcrumb/BreadcrumbItem.astro +2 -2
  31. package/dist/src/components/breadcrumb/BreadcrumbLink.astro +2 -2
  32. package/dist/src/components/breadcrumb/BreadcrumbList.astro +2 -2
  33. package/dist/src/components/breadcrumb/BreadcrumbPage.astro +2 -1
  34. package/dist/src/components/breadcrumb/BreadcrumbSeparator.astro +2 -1
  35. package/dist/src/components/breadcrumb/index.ts +16 -6
  36. package/dist/src/components/button/Button.astro +2 -2
  37. package/dist/src/components/button/index.ts +4 -2
  38. package/dist/src/components/card/Card.astro +2 -2
  39. package/dist/src/components/card/CardContent.astro +2 -2
  40. package/dist/src/components/card/CardDescription.astro +2 -2
  41. package/dist/src/components/card/CardFooter.astro +2 -2
  42. package/dist/src/components/card/CardHeader.astro +2 -2
  43. package/dist/src/components/card/CardTitle.astro +2 -2
  44. package/dist/src/components/card/index.ts +16 -7
  45. package/dist/src/components/carousel/Carousel.astro +55 -0
  46. package/dist/src/components/carousel/CarouselContent.astro +26 -0
  47. package/dist/src/components/carousel/CarouselItem.astro +26 -0
  48. package/dist/src/components/carousel/CarouselNext.astro +33 -0
  49. package/dist/src/components/carousel/CarouselPrevious.astro +33 -0
  50. package/dist/src/components/carousel/carousel-script.ts +191 -0
  51. package/dist/src/components/carousel/index.ts +32 -0
  52. package/dist/src/components/checkbox/Checkbox.astro +10 -3
  53. package/dist/src/components/checkbox/index.ts +4 -2
  54. package/dist/src/components/dialog/Dialog.astro +24 -11
  55. package/dist/src/components/dialog/DialogClose.astro +7 -2
  56. package/dist/src/components/dialog/DialogContent.astro +6 -3
  57. package/dist/src/components/dialog/DialogDescription.astro +2 -2
  58. package/dist/src/components/dialog/DialogFooter.astro +2 -2
  59. package/dist/src/components/dialog/DialogHeader.astro +2 -2
  60. package/dist/src/components/dialog/DialogTitle.astro +2 -2
  61. package/dist/src/components/dialog/DialogTrigger.astro +7 -1
  62. package/dist/src/components/dialog/index.ts +20 -5
  63. package/dist/src/components/dropdown/Dropdown.astro +1 -0
  64. package/dist/src/components/dropdown/DropdownContent.astro +2 -1
  65. package/dist/src/components/dropdown/DropdownItem.astro +2 -1
  66. package/dist/src/components/dropdown/DropdownLabel.astro +2 -2
  67. package/dist/src/components/dropdown/DropdownSeparator.astro +2 -1
  68. package/dist/src/components/dropdown/DropdownTrigger.astro +7 -2
  69. package/dist/src/components/dropdown/index.ts +14 -5
  70. package/dist/src/components/dropzone/Dropzone.astro +3 -2
  71. package/dist/src/components/dropzone/DropzoneFilesList.astro +3 -2
  72. package/dist/src/components/dropzone/DropzoneLoadingIndicator.astro +1 -1
  73. package/dist/src/components/dropzone/DropzoneUploadIndicator.astro +1 -1
  74. package/dist/src/components/dropzone/index.ts +14 -3
  75. package/dist/src/components/input/Input.astro +2 -2
  76. package/dist/src/components/input/index.ts +4 -2
  77. package/dist/src/components/label/Label.astro +2 -2
  78. package/dist/src/components/label/index.ts +4 -2
  79. package/dist/src/components/pagination/Pagination.astro +8 -2
  80. package/dist/src/components/pagination/PaginationContent.astro +2 -2
  81. package/dist/src/components/pagination/PaginationEllipsis.astro +7 -2
  82. package/dist/src/components/pagination/PaginationItem.astro +2 -2
  83. package/dist/src/components/pagination/PaginationLink.astro +2 -1
  84. package/dist/src/components/pagination/PaginationNext.astro +2 -1
  85. package/dist/src/components/pagination/PaginationPrevious.astro +2 -1
  86. package/dist/src/components/pagination/index.ts +18 -7
  87. package/dist/src/components/progress/Progress.astro +5 -2
  88. package/dist/src/components/progress/index.ts +7 -2
  89. package/dist/src/components/radio-group/RadioGroup.astro +2 -1
  90. package/dist/src/components/radio-group/RadioGroupItem.astro +7 -6
  91. package/dist/src/components/radio-group/index.ts +16 -3
  92. package/dist/src/components/select/Select.astro +1 -0
  93. package/dist/src/components/select/SelectContent.astro +3 -2
  94. package/dist/src/components/select/SelectGroup.astro +1 -1
  95. package/dist/src/components/select/SelectItem.astro +3 -2
  96. package/dist/src/components/select/SelectLabel.astro +2 -2
  97. package/dist/src/components/select/SelectSeparator.astro +2 -2
  98. package/dist/src/components/select/SelectTrigger.astro +2 -1
  99. package/dist/src/components/select/SelectValue.astro +2 -2
  100. package/dist/src/components/select/index.ts +18 -6
  101. package/dist/src/components/sheet/Sheet.astro +13 -0
  102. package/dist/src/components/sheet/SheetClose.astro +13 -0
  103. package/dist/src/components/sheet/SheetContent.astro +90 -0
  104. package/dist/src/components/sheet/SheetDescription.astro +16 -0
  105. package/dist/src/components/sheet/SheetFooter.astro +16 -0
  106. package/dist/src/components/sheet/SheetHeader.astro +16 -0
  107. package/dist/src/components/sheet/SheetTitle.astro +16 -0
  108. package/dist/src/components/sheet/SheetTrigger.astro +13 -0
  109. package/dist/src/components/sheet/index.ts +41 -0
  110. package/dist/src/components/skeleton/Skeleton.astro +2 -2
  111. package/dist/src/components/skeleton/index.ts +6 -2
  112. package/dist/src/components/switch/Switch.astro +6 -4
  113. package/dist/src/components/switch/index.ts +8 -2
  114. package/dist/src/components/table/Table.astro +3 -3
  115. package/dist/src/components/table/TableBody.astro +2 -2
  116. package/dist/src/components/table/TableCaption.astro +2 -2
  117. package/dist/src/components/table/TableCell.astro +2 -2
  118. package/dist/src/components/table/TableFoot.astro +2 -2
  119. package/dist/src/components/table/TableHead.astro +2 -2
  120. package/dist/src/components/table/TableHeader.astro +2 -2
  121. package/dist/src/components/table/TableRow.astro +2 -2
  122. package/dist/src/components/table/index.ts +30 -9
  123. package/dist/src/components/tabs/Tabs.astro +2 -1
  124. package/dist/src/components/tabs/TabsContent.astro +4 -1
  125. package/dist/src/components/tabs/TabsList.astro +8 -2
  126. package/dist/src/components/tabs/TabsTrigger.astro +2 -1
  127. package/dist/src/components/tabs/index.ts +12 -5
  128. package/dist/src/components/textarea/Textarea.astro +2 -2
  129. package/dist/src/components/textarea/index.ts +6 -2
  130. package/dist/src/components/tooltip/Tooltip.astro +2 -1
  131. package/dist/src/components/tooltip/TooltipContent.astro +2 -1
  132. package/dist/src/components/tooltip/TooltipTrigger.astro +1 -1
  133. package/dist/src/components/tooltip/index.ts +8 -3
  134. package/package.json +1 -1
@@ -0,0 +1,50 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { tv } from "tailwind-variants";
4
+
5
+ type Props = HTMLAttributes<"dialog"> & {
6
+ /**
7
+ * Open and close animation duration in milliseconds
8
+ */
9
+ animationDuration?: number;
10
+ };
11
+
12
+ export const alertDialogBackdrop = tv({
13
+ base: [
14
+ "starwind-alert-dialog-backdrop fixed inset-0 z-50 hidden bg-black/50",
15
+ "data-[state=open]:animate-in fade-in",
16
+ "data-[state=closed]:animate-out data-[state=closed]:fill-mode-forwards fade-out",
17
+ ],
18
+ });
19
+
20
+ export const alertDialogContent = tv({
21
+ base: [
22
+ "bg-background space-y-4 rounded-lg border p-6 shadow-lg sm:max-w-lg",
23
+ "fixed top-[50%] left-[50%] z-50 w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%]",
24
+ "data-[state=open]:animate-in fade-in zoom-in-95 will-change-transform",
25
+ "data-[state=closed]:animate-out data-[state=closed]:fill-mode-forwards fade-out zoom-out-95",
26
+ ],
27
+ });
28
+
29
+ const { class: className, animationDuration = 200, ...rest } = Astro.props;
30
+ ---
31
+
32
+ <!-- dialog overlay -->
33
+ <div
34
+ class={alertDialogBackdrop()}
35
+ data-state="closed"
36
+ data-slot="alert-dialog-backdrop"
37
+ style={{ animationDuration: `${animationDuration}ms` }}
38
+ >
39
+ </div>
40
+
41
+ <dialog
42
+ class={alertDialogContent({ class: className })}
43
+ data-state="closed"
44
+ data-slot="alert-dialog-content"
45
+ role="alertdialog"
46
+ {...rest}
47
+ style={{ animationDuration: `${animationDuration}ms` }}
48
+ >
49
+ <slot />
50
+ </dialog>
@@ -0,0 +1,18 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { tv } from "tailwind-variants";
4
+
5
+ type Props = HTMLAttributes<"p">;
6
+
7
+ export const alertDialogDescription = tv({ base: "text-muted-foreground" });
8
+
9
+ const { class: className, ...rest } = Astro.props;
10
+ ---
11
+
12
+ <p
13
+ class={alertDialogDescription({ class: className })}
14
+ data-slot="alert-dialog-description"
15
+ {...rest}
16
+ >
17
+ <slot />
18
+ </p>
@@ -0,0 +1,16 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { tv } from "tailwind-variants";
4
+
5
+ type Props = HTMLAttributes<"div">;
6
+
7
+ export const alertDialogFooter = tv({
8
+ base: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
9
+ });
10
+
11
+ const { class: className, ...rest } = Astro.props;
12
+ ---
13
+
14
+ <div class={alertDialogFooter({ class: className })} data-slot="alert-dialog-footer" {...rest}>
15
+ <slot />
16
+ </div>
@@ -0,0 +1,14 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { tv } from "tailwind-variants";
4
+
5
+ type Props = HTMLAttributes<"div">;
6
+
7
+ export const alertDialogHeader = tv({ base: "flex flex-col gap-2 text-center sm:text-left" });
8
+
9
+ const { class: className, ...rest } = Astro.props;
10
+ ---
11
+
12
+ <div class={alertDialogHeader({ class: className })} data-slot="alert-dialog-header" {...rest}>
13
+ <slot />
14
+ </div>
@@ -0,0 +1,20 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { tv } from "tailwind-variants";
4
+
5
+ type Props = Omit<HTMLAttributes<"h2">, "id"> & {
6
+ /**
7
+ * The content to be rendered inside the dialog title
8
+ */
9
+
10
+ children: any;
11
+ };
12
+
13
+ export const alertDialogTitle = tv({ base: "text-xl font-semibold" });
14
+
15
+ const { class: className, ...rest } = Astro.props;
16
+ ---
17
+
18
+ <h2 class={alertDialogTitle({ class: className })} data-slot="alert-dialog-title" {...rest}>
19
+ <slot />
20
+ </h2>
@@ -0,0 +1,47 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+
4
+ type Props = HTMLAttributes<"button"> & {
5
+ /**
6
+ * When true, the component will render its child element with a simple wrapper instead of a button component
7
+ */
8
+ asChild?: boolean;
9
+ /**
10
+ * Optional ID of the dialog to trigger. If not provided and the trigger is inside a Dialog component,
11
+ * it will automatically target that dialog. Required when used outside a Dialog component.
12
+ */
13
+ for?: string;
14
+ };
15
+
16
+ const { class: className, asChild = false, for: dialogFor, ...rest } = Astro.props;
17
+
18
+ // Get the first child element if asChild is true
19
+ let hasChildren = false;
20
+ if (Astro.slots.has("default")) {
21
+ hasChildren = true;
22
+ }
23
+ ---
24
+
25
+ {
26
+ asChild && hasChildren ? (
27
+ <div
28
+ class:list={["starwind-alert-dialog-trigger", className]}
29
+ data-slot="alert-dialog-trigger"
30
+ data-as-child
31
+ data-dialog-for={dialogFor}
32
+ >
33
+ <slot />
34
+ </div>
35
+ ) : (
36
+ <button
37
+ type="button"
38
+ aria-haspopup="dialog"
39
+ class:list={["starwind-alert-dialog-trigger", className]}
40
+ data-slot="alert-dialog-trigger"
41
+ data-dialog-for={dialogFor}
42
+ {...rest}
43
+ >
44
+ <slot />
45
+ </button>
46
+ )
47
+ }
@@ -0,0 +1,46 @@
1
+ import AlertDialog from "./AlertDialog.astro";
2
+ import AlertDialogAction from "./AlertDialogAction.astro";
3
+ import AlertDialogCancel from "./AlertDialogCancel.astro";
4
+ import AlertDialogContent, {
5
+ alertDialogBackdrop,
6
+ alertDialogContent,
7
+ } from "./AlertDialogContent.astro";
8
+ import AlertDialogDescription, { alertDialogDescription } from "./AlertDialogDescription.astro";
9
+ import AlertDialogFooter, { alertDialogFooter } from "./AlertDialogFooter.astro";
10
+ import AlertDialogHeader, { alertDialogHeader } from "./AlertDialogHeader.astro";
11
+ import AlertDialogTitle, { alertDialogTitle } from "./AlertDialogTitle.astro";
12
+ import AlertDialogTrigger from "./AlertDialogTrigger.astro";
13
+
14
+ const AlertDialogVariants = {
15
+ alertDialogBackdrop,
16
+ alertDialogContent,
17
+ alertDialogDescription,
18
+ alertDialogFooter,
19
+ alertDialogHeader,
20
+ alertDialogTitle,
21
+ };
22
+
23
+ export {
24
+ AlertDialog,
25
+ AlertDialogAction,
26
+ AlertDialogCancel,
27
+ AlertDialogContent,
28
+ AlertDialogDescription,
29
+ AlertDialogFooter,
30
+ AlertDialogHeader,
31
+ AlertDialogTitle,
32
+ AlertDialogTrigger,
33
+ AlertDialogVariants,
34
+ };
35
+
36
+ export default {
37
+ Root: AlertDialog,
38
+ Trigger: AlertDialogTrigger,
39
+ Content: AlertDialogContent,
40
+ Header: AlertDialogHeader,
41
+ Footer: AlertDialogFooter,
42
+ Title: AlertDialogTitle,
43
+ Description: AlertDialogDescription,
44
+ Action: AlertDialogAction,
45
+ Cancel: AlertDialogCancel,
46
+ };
@@ -4,7 +4,7 @@ import { tv, type VariantProps } from "tailwind-variants";
4
4
 
5
5
  interface Props extends HTMLAttributes<"div">, VariantProps<typeof avatar> {}
6
6
 
7
- const avatar = tv({
7
+ export const avatar = tv({
8
8
  base: "text-foreground bg-muted relative overflow-hidden rounded-full border-2",
9
9
  variants: {
10
10
  variant: {
@@ -24,6 +24,6 @@ const avatar = tv({
24
24
  const { variant, size, class: className, ...rest } = Astro.props;
25
25
  ---
26
26
 
27
- <figure class={avatar({ variant, size, class: className })} {...rest}>
27
+ <figure class={avatar({ variant, size, class: className })} data-slot="avatar" {...rest}>
28
28
  <slot />
29
29
  </figure>
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  import { tv } from "tailwind-variants";
3
3
 
4
- const avatarFallback = tv({
4
+ export const avatarFallback = tv({
5
5
  base: "absolute inset-0.5 flex items-center justify-center rounded-full font-medium",
6
6
  });
7
7
 
@@ -12,6 +12,6 @@ interface Props {
12
12
  const { class: className } = Astro.props;
13
13
  ---
14
14
 
15
- <div class={avatarFallback({ class: className })}>
15
+ <div class={avatarFallback({ class: className })} data-slot="avatar-fallback">
16
16
  <slot />
17
17
  </div>
@@ -2,7 +2,7 @@
2
2
  import { Image } from "astro:assets";
3
3
  import { tv } from "tailwind-variants";
4
4
 
5
- const avatarImage = tv({ base: "relative z-1 h-full w-full object-cover" });
5
+ export const avatarImage = tv({ base: "relative z-1 h-full w-full object-cover" });
6
6
 
7
7
  type BaseProps = { alt: string; class?: string };
8
8
 
@@ -29,7 +29,18 @@ if (!src && !image) {
29
29
  width={64}
30
30
  height={64}
31
31
  onerror="this.style.display='none'"
32
+ data-slot="avatar-image"
33
+ />
34
+ )
35
+ }
36
+ {
37
+ image && (
38
+ <Image
39
+ src={image}
40
+ alt={alt}
41
+ class={avatarImage({ class: className })}
42
+ width={64}
43
+ data-slot="avatar-image"
32
44
  />
33
45
  )
34
46
  }
35
- {image && <Image src={image} alt={alt} class={avatarImage({ class: className })} width={64} />}
@@ -1,8 +1,10 @@
1
- import Avatar from "./Avatar.astro";
2
- import AvatarFallback from "./AvatarFallback.astro";
3
- import AvatarImage from "./AvatarImage.astro";
1
+ import Avatar, { avatar } from "./Avatar.astro";
2
+ import AvatarFallback, { avatarFallback } from "./AvatarFallback.astro";
3
+ import AvatarImage, { avatarImage } from "./AvatarImage.astro";
4
4
 
5
- export { Avatar, AvatarFallback, AvatarImage };
5
+ const AvatarVariants = { avatar, avatarFallback, avatarImage };
6
+
7
+ export { Avatar, AvatarFallback, AvatarImage, AvatarVariants };
6
8
 
7
9
  export default {
8
10
  Root: Avatar,
@@ -7,7 +7,7 @@ interface Props
7
7
  Omit<HTMLAttributes<"a">, "type">,
8
8
  VariantProps<typeof badge> {}
9
9
 
10
- const badge = tv({
10
+ export const badge = tv({
11
11
  base: "starwind-badge starwind-transition-colors inline-flex items-center rounded-full font-semibold focus-visible:outline-2 focus-visible:outline-offset-2",
12
12
  variants: {
13
13
  variant: {
@@ -43,6 +43,6 @@ const isLink = Astro.props.href ? true : false;
43
43
  const Tag = Astro.props.href ? "a" : "div";
44
44
  ---
45
45
 
46
- <Tag class={badge({ variant, size, isLink, class: className })} {...rest}>
46
+ <Tag class={badge({ variant, size, isLink, class: className })} data-slot="badge" {...rest}>
47
47
  <slot />
48
48
  </Tag>
@@ -1,5 +1,7 @@
1
- import Badge from "./Badge.astro";
1
+ import Badge, { badge } from "./Badge.astro";
2
2
 
3
- export { Badge };
3
+ const BadgeVariants = { badge };
4
+
5
+ export { Badge, BadgeVariants };
4
6
 
5
7
  export default Badge;
@@ -6,6 +6,6 @@ type Props = HTMLAttributes<"nav">;
6
6
  const { class: className, ...rest } = Astro.props;
7
7
  ---
8
8
 
9
- <nav aria-label="breadcrumb" class={className} {...rest}>
9
+ <nav aria-label="breadcrumb" class={className} data-slot="breadcrumb" {...rest}>
10
10
  <slot />
11
11
  </nav>
@@ -5,7 +5,9 @@ import { tv } from "tailwind-variants";
5
5
 
6
6
  type Props = HTMLAttributes<"span">;
7
7
 
8
- const breadcrumbEllipsis = tv({ base: "flex size-6 items-center justify-center [&>svg]:size-4" });
8
+ export const breadcrumbEllipsis = tv({
9
+ base: "flex size-6 items-center justify-center [&>svg]:size-4",
10
+ });
9
11
 
10
12
  const { class: className, ...rest } = Astro.props;
11
13
  ---
@@ -14,6 +16,7 @@ const { class: className, ...rest } = Astro.props;
14
16
  role="presentation"
15
17
  aria-hidden="true"
16
18
  class={breadcrumbEllipsis({ class: className })}
19
+ data-slot="breadcrumb-ellipsis"
17
20
  {...rest}
18
21
  >
19
22
  <Dots />
@@ -4,11 +4,11 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"li">;
6
6
 
7
- const breadcrumbItem = tv({ base: "inline-flex items-center gap-1.5" });
7
+ export const breadcrumbItem = tv({ base: "inline-flex items-center gap-1.5" });
8
8
 
9
9
  const { class: className, ...rest } = Astro.props;
10
10
  ---
11
11
 
12
- <li class={breadcrumbItem({ class: className })} {...rest}>
12
+ <li class={breadcrumbItem({ class: className })} data-slot="breadcrumb-item" {...rest}>
13
13
  <slot />
14
14
  </li>
@@ -6,7 +6,7 @@ type Props = HTMLAttributes<"a"> & {
6
6
  asChild?: boolean;
7
7
  };
8
8
 
9
- const breadcrumbLink = tv({ base: "hover:text-foreground transition-colors" });
9
+ export const breadcrumbLink = tv({ base: "hover:text-foreground transition-colors" });
10
10
 
11
11
  const { class: className, asChild = false, ...rest } = Astro.props;
12
12
  ---
@@ -15,7 +15,7 @@ const { class: className, asChild = false, ...rest } = Astro.props;
15
15
  asChild ? (
16
16
  <slot />
17
17
  ) : (
18
- <a class={breadcrumbLink({ class: className })} {...rest}>
18
+ <a class={breadcrumbLink({ class: className })} data-slot="breadcrumb-link" {...rest}>
19
19
  <slot />
20
20
  </a>
21
21
  )
@@ -4,13 +4,13 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"ol">;
6
6
 
7
- const breadcrumbList = tv({
7
+ export const breadcrumbList = tv({
8
8
  base: "text-muted-foreground flex flex-wrap items-center gap-1.5 break-words sm:gap-2",
9
9
  });
10
10
 
11
11
  const { class: className, ...rest } = Astro.props;
12
12
  ---
13
13
 
14
- <ol class={breadcrumbList({ class: className })} {...rest}>
14
+ <ol class={breadcrumbList({ class: className })} data-slot="breadcrumb-list" {...rest}>
15
15
  <slot />
16
16
  </ol>
@@ -4,7 +4,7 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"span">;
6
6
 
7
- const breadcrumbPage = tv({ base: "text-foreground font-normal" });
7
+ export const breadcrumbPage = tv({ base: "text-foreground font-normal" });
8
8
 
9
9
  const { class: className, ...rest } = Astro.props;
10
10
  ---
@@ -14,6 +14,7 @@ const { class: className, ...rest } = Astro.props;
14
14
  aria-disabled="true"
15
15
  aria-current="page"
16
16
  class={breadcrumbPage({ class: className })}
17
+ data-slot="breadcrumb-page"
17
18
  {...rest}
18
19
  >
19
20
  <slot />
@@ -5,7 +5,7 @@ import { tv } from "tailwind-variants";
5
5
 
6
6
  type Props = HTMLAttributes<"li">;
7
7
 
8
- const breadcrumbSeparator = tv({ base: "[&>svg]:size-4" });
8
+ export const breadcrumbSeparator = tv({ base: "[&>svg]:size-4" });
9
9
 
10
10
  const { class: className, ...rest } = Astro.props;
11
11
  ---
@@ -14,6 +14,7 @@ const { class: className, ...rest } = Astro.props;
14
14
  role="presentation"
15
15
  aria-hidden="true"
16
16
  class={breadcrumbSeparator({ class: className })}
17
+ data-slot="breadcrumb-separator"
17
18
  {...rest}
18
19
  >
19
20
  <slot>
@@ -1,10 +1,19 @@
1
1
  import Breadcrumb from "./Breadcrumb.astro";
2
- import BreadcrumbEllipsis from "./BreadcrumbEllipsis.astro";
3
- import BreadcrumbItem from "./BreadcrumbItem.astro";
4
- import BreadcrumbLink from "./BreadcrumbLink.astro";
5
- import BreadcrumbList from "./BreadcrumbList.astro";
6
- import BreadcrumbPage from "./BreadcrumbPage.astro";
7
- import BreadcrumbSeparator from "./BreadcrumbSeparator.astro";
2
+ import BreadcrumbEllipsis, { breadcrumbEllipsis } from "./BreadcrumbEllipsis.astro";
3
+ import BreadcrumbItem, { breadcrumbItem } from "./BreadcrumbItem.astro";
4
+ import BreadcrumbLink, { breadcrumbLink } from "./BreadcrumbLink.astro";
5
+ import BreadcrumbList, { breadcrumbList } from "./BreadcrumbList.astro";
6
+ import BreadcrumbPage, { breadcrumbPage } from "./BreadcrumbPage.astro";
7
+ import BreadcrumbSeparator, { breadcrumbSeparator } from "./BreadcrumbSeparator.astro";
8
+
9
+ const BreadcrumbVariants = {
10
+ breadcrumbEllipsis,
11
+ breadcrumbItem,
12
+ breadcrumbLink,
13
+ breadcrumbList,
14
+ breadcrumbPage,
15
+ breadcrumbSeparator,
16
+ };
8
17
 
9
18
  export {
10
19
  Breadcrumb,
@@ -14,6 +23,7 @@ export {
14
23
  BreadcrumbList,
15
24
  BreadcrumbPage,
16
25
  BreadcrumbSeparator,
26
+ BreadcrumbVariants,
17
27
  };
18
28
 
19
29
  export default {
@@ -9,7 +9,7 @@ interface Props
9
9
 
10
10
  const { variant, size, class: className, ...rest } = Astro.props;
11
11
 
12
- const button = tv({
12
+ export const button = tv({
13
13
  base: [
14
14
  "inline-flex items-center justify-center gap-1.5 rounded-md font-medium whitespace-nowrap",
15
15
  "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
@@ -48,6 +48,6 @@ const button = tv({
48
48
  const Tag = Astro.props.href ? "a" : "button";
49
49
  ---
50
50
 
51
- <Tag class={button({ variant, size, class: className })} {...rest}>
51
+ <Tag class={button({ variant, size, class: className })} data-slot="button" {...rest}>
52
52
  <slot />
53
53
  </Tag>
@@ -1,5 +1,7 @@
1
- import Button from "./Button.astro";
1
+ import Button, { button } from "./Button.astro";
2
2
 
3
- export { Button };
3
+ const ButtonVariants = { button };
4
+
5
+ export { Button, ButtonVariants };
4
6
 
5
7
  export default Button;
@@ -4,11 +4,11 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"div">;
6
6
 
7
- const card = tv({ base: "bg-card text-card-foreground rounded-2xl border shadow-sm" });
7
+ export const card = tv({ base: "bg-card text-card-foreground rounded-2xl border shadow-sm" });
8
8
 
9
9
  const { class: className, ...rest } = Astro.props;
10
10
  ---
11
11
 
12
- <div class={card({ class: className })} {...rest}>
12
+ <div class={card({ class: className })} data-slot="card" {...rest}>
13
13
  <slot />
14
14
  </div>
@@ -4,11 +4,11 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"div">;
6
6
 
7
- const cardContent = tv({ base: "p-8 pt-0" });
7
+ export const cardContent = tv({ base: "p-8 pt-0" });
8
8
 
9
9
  const { class: className, ...rest } = Astro.props;
10
10
  ---
11
11
 
12
- <div class={cardContent({ class: className })} {...rest}>
12
+ <div class={cardContent({ class: className })} data-slot="card-content" {...rest}>
13
13
  <slot />
14
14
  </div>
@@ -4,11 +4,11 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"div">;
6
6
 
7
- const cardDescription = tv({ base: "text-muted-foreground text-base" });
7
+ export const cardDescription = tv({ base: "text-muted-foreground text-base" });
8
8
 
9
9
  const { class: className, ...rest } = Astro.props;
10
10
  ---
11
11
 
12
- <div class={cardDescription({ class: className })} {...rest}>
12
+ <div class={cardDescription({ class: className })} data-slot="card-description" {...rest}>
13
13
  <slot />
14
14
  </div>
@@ -4,11 +4,11 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"div">;
6
6
 
7
- const cardFooter = tv({ base: "flex items-center p-8 pt-0" });
7
+ export const cardFooter = tv({ base: "flex items-center p-8 pt-0" });
8
8
 
9
9
  const { class: className, ...rest } = Astro.props;
10
10
  ---
11
11
 
12
- <div class={cardFooter({ class: className })} {...rest}>
12
+ <div class={cardFooter({ class: className })} data-slot="card-footer" {...rest}>
13
13
  <slot />
14
14
  </div>
@@ -4,11 +4,11 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"div">;
6
6
 
7
- const cardHeader = tv({ base: "flex flex-col space-y-2 p-8" });
7
+ export const cardHeader = tv({ base: "flex flex-col space-y-2 p-8" });
8
8
 
9
9
  const { class: className, ...rest } = Astro.props;
10
10
  ---
11
11
 
12
- <div class={cardHeader({ class: className })} {...rest}>
12
+ <div class={cardHeader({ class: className })} data-slot="card-header" {...rest}>
13
13
  <slot />
14
14
  </div>
@@ -4,11 +4,11 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"div">;
6
6
 
7
- const cardTitle = tv({ base: "text-3xl leading-none font-semibold tracking-tight" });
7
+ export const cardTitle = tv({ base: "text-3xl leading-none font-semibold tracking-tight" });
8
8
 
9
9
  const { class: className, ...rest } = Astro.props;
10
10
  ---
11
11
 
12
- <div class={cardTitle({ class: className })} {...rest}>
12
+ <div class={cardTitle({ class: className })} data-slot="card-title" {...rest}>
13
13
  <slot />
14
14
  </div>
@@ -1,11 +1,20 @@
1
- import Card from "./Card.astro";
2
- import CardContent from "./CardContent.astro";
3
- import CardDescription from "./CardDescription.astro";
4
- import CardFooter from "./CardFooter.astro";
5
- import CardHeader from "./CardHeader.astro";
6
- import CardTitle from "./CardTitle.astro";
1
+ import Card, { card } from "./Card.astro";
2
+ import CardContent, { cardContent } from "./CardContent.astro";
3
+ import CardDescription, { cardDescription } from "./CardDescription.astro";
4
+ import CardFooter, { cardFooter } from "./CardFooter.astro";
5
+ import CardHeader, { cardHeader } from "./CardHeader.astro";
6
+ import CardTitle, { cardTitle } from "./CardTitle.astro";
7
7
 
8
- export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
8
+ const CardVariants = {
9
+ card,
10
+ cardContent,
11
+ cardDescription,
12
+ cardFooter,
13
+ cardHeader,
14
+ cardTitle,
15
+ };
16
+
17
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CardVariants };
9
18
 
10
19
  export default {
11
20
  Root: Card,