@starwind-ui/core 1.11.2 → 1.12.1

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 (158) hide show
  1. package/package.json +1 -1
  2. package/dist/index.d.ts +0 -28
  3. package/dist/index.js +0 -74
  4. package/dist/index.js.map +0 -1
  5. package/dist/src/components/accordion/Accordion.astro +0 -247
  6. package/dist/src/components/accordion/AccordionContent.astro +0 -33
  7. package/dist/src/components/accordion/AccordionItem.astro +0 -27
  8. package/dist/src/components/accordion/AccordionTrigger.astro +0 -32
  9. package/dist/src/components/accordion/index.ts +0 -15
  10. package/dist/src/components/alert/Alert.astro +0 -31
  11. package/dist/src/components/alert/AlertDescription.astro +0 -14
  12. package/dist/src/components/alert/AlertTitle.astro +0 -16
  13. package/dist/src/components/alert/index.ts +0 -13
  14. package/dist/src/components/alert-dialog/AlertDialog.astro +0 -273
  15. package/dist/src/components/alert-dialog/AlertDialogAction.astro +0 -44
  16. package/dist/src/components/alert-dialog/AlertDialogCancel.astro +0 -45
  17. package/dist/src/components/alert-dialog/AlertDialogContent.astro +0 -52
  18. package/dist/src/components/alert-dialog/AlertDialogDescription.astro +0 -18
  19. package/dist/src/components/alert-dialog/AlertDialogFooter.astro +0 -16
  20. package/dist/src/components/alert-dialog/AlertDialogHeader.astro +0 -14
  21. package/dist/src/components/alert-dialog/AlertDialogTitle.astro +0 -20
  22. package/dist/src/components/alert-dialog/AlertDialogTrigger.astro +0 -47
  23. package/dist/src/components/alert-dialog/index.ts +0 -46
  24. package/dist/src/components/aspect-ratio/AspectRatio.astro +0 -32
  25. package/dist/src/components/aspect-ratio/index.ts +0 -7
  26. package/dist/src/components/avatar/Avatar.astro +0 -29
  27. package/dist/src/components/avatar/AvatarFallback.astro +0 -18
  28. package/dist/src/components/avatar/AvatarImage.astro +0 -49
  29. package/dist/src/components/avatar/index.ts +0 -13
  30. package/dist/src/components/badge/Badge.astro +0 -51
  31. package/dist/src/components/badge/index.ts +0 -7
  32. package/dist/src/components/breadcrumb/Breadcrumb.astro +0 -11
  33. package/dist/src/components/breadcrumb/BreadcrumbEllipsis.astro +0 -28
  34. package/dist/src/components/breadcrumb/BreadcrumbItem.astro +0 -14
  35. package/dist/src/components/breadcrumb/BreadcrumbLink.astro +0 -22
  36. package/dist/src/components/breadcrumb/BreadcrumbList.astro +0 -16
  37. package/dist/src/components/breadcrumb/BreadcrumbPage.astro +0 -21
  38. package/dist/src/components/breadcrumb/BreadcrumbSeparator.astro +0 -23
  39. package/dist/src/components/breadcrumb/index.ts +0 -37
  40. package/dist/src/components/button/Button.astro +0 -53
  41. package/dist/src/components/button/index.ts +0 -7
  42. package/dist/src/components/card/Card.astro +0 -14
  43. package/dist/src/components/card/CardContent.astro +0 -14
  44. package/dist/src/components/card/CardDescription.astro +0 -14
  45. package/dist/src/components/card/CardFooter.astro +0 -14
  46. package/dist/src/components/card/CardHeader.astro +0 -14
  47. package/dist/src/components/card/CardTitle.astro +0 -14
  48. package/dist/src/components/card/index.ts +0 -26
  49. package/dist/src/components/carousel/Carousel.astro +0 -55
  50. package/dist/src/components/carousel/CarouselContent.astro +0 -26
  51. package/dist/src/components/carousel/CarouselItem.astro +0 -26
  52. package/dist/src/components/carousel/CarouselNext.astro +0 -37
  53. package/dist/src/components/carousel/CarouselPrevious.astro +0 -37
  54. package/dist/src/components/carousel/carousel-script.ts +0 -191
  55. package/dist/src/components/carousel/index.ts +0 -32
  56. package/dist/src/components/checkbox/Checkbox.astro +0 -127
  57. package/dist/src/components/checkbox/index.ts +0 -7
  58. package/dist/src/components/dialog/Dialog.astro +0 -263
  59. package/dist/src/components/dialog/DialogClose.astro +0 -35
  60. package/dist/src/components/dialog/DialogContent.astro +0 -67
  61. package/dist/src/components/dialog/DialogDescription.astro +0 -14
  62. package/dist/src/components/dialog/DialogFooter.astro +0 -14
  63. package/dist/src/components/dialog/DialogHeader.astro +0 -14
  64. package/dist/src/components/dialog/DialogTitle.astro +0 -20
  65. package/dist/src/components/dialog/DialogTrigger.astro +0 -47
  66. package/dist/src/components/dialog/index.ts +0 -45
  67. package/dist/src/components/dropdown/Dropdown.astro +0 -375
  68. package/dist/src/components/dropdown/DropdownContent.astro +0 -81
  69. package/dist/src/components/dropdown/DropdownItem.astro +0 -48
  70. package/dist/src/components/dropdown/DropdownLabel.astro +0 -29
  71. package/dist/src/components/dropdown/DropdownSeparator.astro +0 -21
  72. package/dist/src/components/dropdown/DropdownTrigger.astro +0 -52
  73. package/dist/src/components/dropdown/index.ts +0 -33
  74. package/dist/src/components/dropzone/Dropzone.astro +0 -233
  75. package/dist/src/components/dropzone/DropzoneFilesList.astro +0 -26
  76. package/dist/src/components/dropzone/DropzoneLoadingIndicator.astro +0 -10
  77. package/dist/src/components/dropzone/DropzoneUploadIndicator.astro +0 -10
  78. package/dist/src/components/dropzone/index.ts +0 -24
  79. package/dist/src/components/input/Input.astro +0 -24
  80. package/dist/src/components/input/index.ts +0 -7
  81. package/dist/src/components/item/Item.astro +0 -52
  82. package/dist/src/components/item/ItemActions.astro +0 -16
  83. package/dist/src/components/item/ItemContent.astro +0 -16
  84. package/dist/src/components/item/ItemDescription.astro +0 -19
  85. package/dist/src/components/item/ItemFooter.astro +0 -16
  86. package/dist/src/components/item/ItemGroup.astro +0 -16
  87. package/dist/src/components/item/ItemHeader.astro +0 -16
  88. package/dist/src/components/item/ItemMedia.astro +0 -40
  89. package/dist/src/components/item/ItemSeparator.astro +0 -21
  90. package/dist/src/components/item/ItemTitle.astro +0 -16
  91. package/dist/src/components/item/index.ts +0 -50
  92. package/dist/src/components/kbd/Kbd.astro +0 -21
  93. package/dist/src/components/kbd/KbdGroup.astro +0 -16
  94. package/dist/src/components/kbd/index.ts +0 -11
  95. package/dist/src/components/label/Label.astro +0 -22
  96. package/dist/src/components/label/index.ts +0 -7
  97. package/dist/src/components/pagination/Pagination.astro +0 -20
  98. package/dist/src/components/pagination/PaginationContent.astro +0 -16
  99. package/dist/src/components/pagination/PaginationEllipsis.astro +0 -25
  100. package/dist/src/components/pagination/PaginationItem.astro +0 -16
  101. package/dist/src/components/pagination/PaginationLink.astro +0 -24
  102. package/dist/src/components/pagination/PaginationNext.astro +0 -26
  103. package/dist/src/components/pagination/PaginationPrevious.astro +0 -26
  104. package/dist/src/components/pagination/index.ts +0 -38
  105. package/dist/src/components/progress/Progress.astro +0 -154
  106. package/dist/src/components/progress/index.ts +0 -10
  107. package/dist/src/components/radio-group/RadioGroup.astro +0 -157
  108. package/dist/src/components/radio-group/RadioGroupItem.astro +0 -129
  109. package/dist/src/components/radio-group/RadioGroupTypes.ts +0 -6
  110. package/dist/src/components/radio-group/index.ts +0 -23
  111. package/dist/src/components/select/Select.astro +0 -534
  112. package/dist/src/components/select/SelectContent.astro +0 -83
  113. package/dist/src/components/select/SelectGroup.astro +0 -9
  114. package/dist/src/components/select/SelectItem.astro +0 -49
  115. package/dist/src/components/select/SelectLabel.astro +0 -14
  116. package/dist/src/components/select/SelectSeparator.astro +0 -12
  117. package/dist/src/components/select/SelectTrigger.astro +0 -48
  118. package/dist/src/components/select/SelectTypes.ts +0 -13
  119. package/dist/src/components/select/SelectValue.astro +0 -19
  120. package/dist/src/components/select/index.ts +0 -45
  121. package/dist/src/components/separator/Separator.astro +0 -36
  122. package/dist/src/components/separator/index.ts +0 -7
  123. package/dist/src/components/sheet/Sheet.astro +0 -13
  124. package/dist/src/components/sheet/SheetClose.astro +0 -13
  125. package/dist/src/components/sheet/SheetContent.astro +0 -92
  126. package/dist/src/components/sheet/SheetDescription.astro +0 -16
  127. package/dist/src/components/sheet/SheetFooter.astro +0 -16
  128. package/dist/src/components/sheet/SheetHeader.astro +0 -16
  129. package/dist/src/components/sheet/SheetTitle.astro +0 -16
  130. package/dist/src/components/sheet/SheetTrigger.astro +0 -13
  131. package/dist/src/components/sheet/index.ts +0 -41
  132. package/dist/src/components/skeleton/Skeleton.astro +0 -14
  133. package/dist/src/components/skeleton/index.ts +0 -9
  134. package/dist/src/components/spinner/Spinner.astro +0 -21
  135. package/dist/src/components/spinner/index.ts +0 -7
  136. package/dist/src/components/switch/Switch.astro +0 -191
  137. package/dist/src/components/switch/SwitchTypes.ts +0 -6
  138. package/dist/src/components/switch/index.ts +0 -12
  139. package/dist/src/components/table/Table.astro +0 -18
  140. package/dist/src/components/table/TableBody.astro +0 -16
  141. package/dist/src/components/table/TableCaption.astro +0 -16
  142. package/dist/src/components/table/TableCell.astro +0 -16
  143. package/dist/src/components/table/TableFoot.astro +0 -16
  144. package/dist/src/components/table/TableHead.astro +0 -16
  145. package/dist/src/components/table/TableHeader.astro +0 -16
  146. package/dist/src/components/table/TableRow.astro +0 -16
  147. package/dist/src/components/table/index.ts +0 -42
  148. package/dist/src/components/tabs/Tabs.astro +0 -269
  149. package/dist/src/components/tabs/TabsContent.astro +0 -28
  150. package/dist/src/components/tabs/TabsList.astro +0 -22
  151. package/dist/src/components/tabs/TabsTrigger.astro +0 -34
  152. package/dist/src/components/tabs/index.ts +0 -20
  153. package/dist/src/components/textarea/Textarea.astro +0 -28
  154. package/dist/src/components/textarea/index.ts +0 -9
  155. package/dist/src/components/tooltip/Tooltip.astro +0 -237
  156. package/dist/src/components/tooltip/TooltipContent.astro +0 -114
  157. package/dist/src/components/tooltip/TooltipTrigger.astro +0 -10
  158. package/dist/src/components/tooltip/index.ts +0 -16
@@ -1,49 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { Image } from "astro:assets";
4
- import { tv } from "tailwind-variants";
5
-
6
- export const avatarImage = tv({ base: "relative z-1 h-full w-full object-cover" });
7
-
8
- type BaseProps = { alt: string; class?: string };
9
-
10
- type WithSrc = BaseProps & { src: string; image?: never };
11
-
12
- type WithImage = BaseProps & { src?: never; image: ImageMetadata };
13
-
14
- type Props = HTMLAttributes<"img"> & (WithSrc | WithImage);
15
-
16
- const { src, image, alt, class: className, width, height, ...rest } = Astro.props;
17
-
18
- if (!src && !image) {
19
- throw new Error("Either 'src' or 'image' is required for an avatar image.");
20
- }
21
- ---
22
-
23
- {
24
- src && (
25
- // eslint-disable-next-line astro/jsx-a11y/no-noninteractive-element-interactions
26
- <img
27
- src={src}
28
- alt={alt}
29
- class={avatarImage({ class: className })}
30
- width={64}
31
- height={64}
32
- onerror="this.style.display='none'"
33
- data-slot="avatar-image"
34
- {...rest}
35
- />
36
- )
37
- }
38
- {
39
- image && (
40
- <Image
41
- src={image}
42
- alt={alt}
43
- class={avatarImage({ class: className })}
44
- width={64}
45
- data-slot="avatar-image"
46
- {...rest}
47
- />
48
- )
49
- }
@@ -1,13 +0,0 @@
1
- import Avatar, { avatar } from "./Avatar.astro";
2
- import AvatarFallback, { avatarFallback } from "./AvatarFallback.astro";
3
- import AvatarImage, { avatarImage } from "./AvatarImage.astro";
4
-
5
- const AvatarVariants = { avatar, avatarFallback, avatarImage };
6
-
7
- export { Avatar, AvatarFallback, AvatarImage, AvatarVariants };
8
-
9
- export default {
10
- Root: Avatar,
11
- Image: AvatarImage,
12
- Fallback: AvatarFallback,
13
- };
@@ -1,51 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv, type VariantProps } from "tailwind-variants";
4
-
5
- interface Props
6
- extends HTMLAttributes<"div">,
7
- Omit<HTMLAttributes<"a">, "type">,
8
- VariantProps<typeof badge> {}
9
-
10
- export const badge = tv({
11
- base: [
12
- "starwind-badge inline-flex items-center rounded-full font-semibold",
13
- "transition-all outline-none focus-visible:ring-3",
14
- ],
15
- variants: {
16
- variant: {
17
- default: "bg-foreground text-background focus-visible:ring-outline/50",
18
- primary: "bg-primary text-primary-foreground focus-visible:ring-primary/50",
19
- secondary: "bg-secondary text-secondary-foreground focus-visible:ring-secondary/50",
20
- outline: "border-border focus-visible:border-outline focus-visible:ring-outline/50 border",
21
- ghost: "bg-foreground/10 text-foreground focus-visible:ring-outline/50",
22
- info: "bg-info text-info-foreground focus-visible:ring-info/50",
23
- success: "bg-success text-success-foreground focus-visible:ring-success/50",
24
- warning: "bg-warning text-warning-foreground focus-visible:ring-warning/50",
25
- error: "bg-error text-error-foreground focus-visible:ring-error/50",
26
- },
27
- size: { sm: "px-2.5 py-0.5 text-xs", md: "px-3 py-0.5 text-sm", lg: "px-4 py-1 text-base" },
28
- isLink: { true: "cursor-pointer", false: "" },
29
- },
30
- compoundVariants: [
31
- { isLink: true, variant: "default", className: "hover:bg-foreground/80" },
32
- { isLink: true, variant: "primary", className: "hover:bg-primary/80" },
33
- { isLink: true, variant: "secondary", className: "hover:bg-secondary/80" },
34
- { isLink: true, variant: "outline", className: "hover:border-border/80" },
35
- { isLink: true, variant: "ghost", className: "hover:bg-foreground/7" },
36
- { isLink: true, variant: "info", className: "hover:bg-info/80" },
37
- { isLink: true, variant: "success", className: "hover:bg-success/80" },
38
- { isLink: true, variant: "warning", className: "hover:bg-warning/80" },
39
- { isLink: true, variant: "error", className: "hover:bg-error/80" },
40
- ],
41
- defaultVariants: { variant: "default", size: "md", isLink: false },
42
- });
43
-
44
- const { variant, size, class: className, ...rest } = Astro.props;
45
- const isLink = Astro.props.href ? true : false;
46
- const Tag = Astro.props.href ? "a" : "div";
47
- ---
48
-
49
- <Tag class={badge({ variant, size, isLink, class: className })} data-slot="badge" {...rest}>
50
- <slot />
51
- </Tag>
@@ -1,7 +0,0 @@
1
- import Badge, { badge } from "./Badge.astro";
2
-
3
- const BadgeVariants = { badge };
4
-
5
- export { Badge, BadgeVariants };
6
-
7
- export default Badge;
@@ -1,11 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
-
4
- type Props = HTMLAttributes<"nav">;
5
-
6
- const { class: className, ...rest } = Astro.props;
7
- ---
8
-
9
- <nav aria-label="breadcrumb" class={className} data-slot="breadcrumb" {...rest}>
10
- <slot />
11
- </nav>
@@ -1,28 +0,0 @@
1
- ---
2
- import Dots from "@tabler/icons/outline/dots.svg";
3
- import type { HTMLAttributes } from "astro/types";
4
- import { tv } from "tailwind-variants";
5
-
6
- type Props = HTMLAttributes<"span">;
7
-
8
- export const breadcrumbEllipsis = tv({
9
- base: "flex size-6 items-center justify-center [&>svg]:size-4",
10
- });
11
-
12
- const { class: className, ...rest } = Astro.props;
13
- ---
14
-
15
- <span
16
- role="presentation"
17
- aria-hidden="true"
18
- class={breadcrumbEllipsis({ class: className })}
19
- data-slot="breadcrumb-ellipsis"
20
- {...rest}
21
- >
22
- <slot name="icon">
23
- <Dots />
24
- </slot>
25
- <slot>
26
- <span class="sr-only">More</span>
27
- </slot>
28
- </span>
@@ -1,14 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- type Props = HTMLAttributes<"li">;
6
-
7
- export const breadcrumbItem = tv({ base: "inline-flex items-center gap-1.5" });
8
-
9
- const { class: className, ...rest } = Astro.props;
10
- ---
11
-
12
- <li class={breadcrumbItem({ class: className })} data-slot="breadcrumb-item" {...rest}>
13
- <slot />
14
- </li>
@@ -1,22 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- type Props = HTMLAttributes<"a"> & {
6
- asChild?: boolean;
7
- };
8
-
9
- export const breadcrumbLink = tv({ base: "hover:text-foreground transition-colors" });
10
-
11
- const { class: className, asChild = false, ...rest } = Astro.props;
12
- ---
13
-
14
- {
15
- asChild ? (
16
- <slot />
17
- ) : (
18
- <a class={breadcrumbLink({ class: className })} data-slot="breadcrumb-link" {...rest}>
19
- <slot />
20
- </a>
21
- )
22
- }
@@ -1,16 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- type Props = HTMLAttributes<"ol">;
6
-
7
- export const breadcrumbList = tv({
8
- base: "text-muted-foreground flex flex-wrap items-center gap-1.5 break-words sm:gap-2",
9
- });
10
-
11
- const { class: className, ...rest } = Astro.props;
12
- ---
13
-
14
- <ol class={breadcrumbList({ class: className })} data-slot="breadcrumb-list" {...rest}>
15
- <slot />
16
- </ol>
@@ -1,21 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- type Props = HTMLAttributes<"span">;
6
-
7
- export const breadcrumbPage = tv({ base: "text-foreground font-normal" });
8
-
9
- const { class: className, ...rest } = Astro.props;
10
- ---
11
-
12
- <span
13
- role="link"
14
- aria-disabled="true"
15
- aria-current="page"
16
- class={breadcrumbPage({ class: className })}
17
- data-slot="breadcrumb-page"
18
- {...rest}
19
- >
20
- <slot />
21
- </span>
@@ -1,23 +0,0 @@
1
- ---
2
- import ChevronRight from "@tabler/icons/outline/chevron-right.svg";
3
- import type { HTMLAttributes } from "astro/types";
4
- import { tv } from "tailwind-variants";
5
-
6
- type Props = HTMLAttributes<"li">;
7
-
8
- export const breadcrumbSeparator = tv({ base: "[&>svg]:size-4" });
9
-
10
- const { class: className, ...rest } = Astro.props;
11
- ---
12
-
13
- <li
14
- role="presentation"
15
- aria-hidden="true"
16
- class={breadcrumbSeparator({ class: className })}
17
- data-slot="breadcrumb-separator"
18
- {...rest}
19
- >
20
- <slot>
21
- <ChevronRight />
22
- </slot>
23
- </li>
@@ -1,37 +0,0 @@
1
- import Breadcrumb from "./Breadcrumb.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
- };
17
-
18
- export {
19
- Breadcrumb,
20
- BreadcrumbEllipsis,
21
- BreadcrumbItem,
22
- BreadcrumbLink,
23
- BreadcrumbList,
24
- BreadcrumbPage,
25
- BreadcrumbSeparator,
26
- BreadcrumbVariants,
27
- };
28
-
29
- export default {
30
- Root: Breadcrumb,
31
- List: BreadcrumbList,
32
- Ellipsis: BreadcrumbEllipsis,
33
- Item: BreadcrumbItem,
34
- Link: BreadcrumbLink,
35
- Separator: BreadcrumbSeparator,
36
- Page: BreadcrumbPage,
37
- };
@@ -1,53 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv, type VariantProps } from "tailwind-variants";
4
-
5
- interface Props
6
- extends HTMLAttributes<"button">,
7
- Omit<HTMLAttributes<"a">, "type">,
8
- VariantProps<typeof button> {}
9
-
10
- const { variant, size, class: className, ...rest } = Astro.props;
11
-
12
- export const button = tv({
13
- base: [
14
- "inline-flex items-center justify-center gap-1.5 rounded-md font-medium whitespace-nowrap",
15
- "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
16
- "transition-all outline-none focus-visible:ring-3",
17
- "disabled:pointer-events-none disabled:opacity-50",
18
- ],
19
- variants: {
20
- variant: {
21
- default: "bg-foreground text-background hover:bg-foreground/90 focus-visible:ring-outline/50",
22
- primary:
23
- "bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-primary/50",
24
- secondary:
25
- "bg-secondary text-secondary-foreground hover:bg-secondary/90 focus-visible:ring-secondary/50",
26
- outline:
27
- "dark:border-input focus-visible:ring-outline/50 bg-background dark:bg-input/30 focus-visible:border-outline hover:bg-muted dark:hover:bg-input/50 hover:text-foreground border shadow-xs",
28
- ghost: "hover:bg-muted hover:text-foreground focus-visible:ring-outline/50",
29
- info: "bg-info text-info-foreground hover:bg-info/90 focus-visible:ring-info/50",
30
- success:
31
- "bg-success text-success-foreground hover:bg-success/90 focus-visible:ring-success/50",
32
- warning:
33
- "bg-warning text-warning-foreground hover:bg-warning/90 focus-visible:ring-warning/50",
34
- error: "bg-error text-error-foreground hover:bg-error/90 focus-visible:ring-error/50",
35
- },
36
- size: {
37
- sm: "h-9 px-3 py-2 text-sm",
38
- md: "h-11 px-4 py-2 text-base",
39
- lg: "h-12 px-8 py-2 text-lg",
40
- icon: "size-11",
41
- "icon-sm": "size-9",
42
- "icon-lg": "size-12",
43
- },
44
- },
45
- defaultVariants: { variant: "default", size: "md" },
46
- });
47
-
48
- const Tag = Astro.props.href ? "a" : "button";
49
- ---
50
-
51
- <Tag class={button({ variant, size, class: className })} data-slot="button" {...rest}>
52
- <slot />
53
- </Tag>
@@ -1,7 +0,0 @@
1
- import Button, { button } from "./Button.astro";
2
-
3
- const ButtonVariants = { button };
4
-
5
- export { Button, ButtonVariants };
6
-
7
- export default Button;
@@ -1,14 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- type Props = HTMLAttributes<"div">;
6
-
7
- export const card = tv({ base: "bg-card text-card-foreground rounded-2xl border shadow-sm" });
8
-
9
- const { class: className, ...rest } = Astro.props;
10
- ---
11
-
12
- <div class={card({ class: className })} data-slot="card" {...rest}>
13
- <slot />
14
- </div>
@@ -1,14 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- type Props = HTMLAttributes<"div">;
6
-
7
- export const cardContent = tv({ base: "p-8 pt-0" });
8
-
9
- const { class: className, ...rest } = Astro.props;
10
- ---
11
-
12
- <div class={cardContent({ class: className })} data-slot="card-content" {...rest}>
13
- <slot />
14
- </div>
@@ -1,14 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- type Props = HTMLAttributes<"div">;
6
-
7
- export const cardDescription = tv({ base: "text-muted-foreground text-base" });
8
-
9
- const { class: className, ...rest } = Astro.props;
10
- ---
11
-
12
- <div class={cardDescription({ class: className })} data-slot="card-description" {...rest}>
13
- <slot />
14
- </div>
@@ -1,14 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- type Props = HTMLAttributes<"div">;
6
-
7
- export const cardFooter = tv({ base: "flex items-center p-8 pt-0" });
8
-
9
- const { class: className, ...rest } = Astro.props;
10
- ---
11
-
12
- <div class={cardFooter({ class: className })} data-slot="card-footer" {...rest}>
13
- <slot />
14
- </div>
@@ -1,14 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- type Props = HTMLAttributes<"div">;
6
-
7
- export const cardHeader = tv({ base: "flex flex-col space-y-2 p-8" });
8
-
9
- const { class: className, ...rest } = Astro.props;
10
- ---
11
-
12
- <div class={cardHeader({ class: className })} data-slot="card-header" {...rest}>
13
- <slot />
14
- </div>
@@ -1,14 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- type Props = HTMLAttributes<"div">;
6
-
7
- export const cardTitle = tv({ base: "text-xl leading-none font-semibold tracking-tight" });
8
-
9
- const { class: className, ...rest } = Astro.props;
10
- ---
11
-
12
- <div class={cardTitle({ class: className })} data-slot="card-title" {...rest}>
13
- <slot />
14
- </div>
@@ -1,26 +0,0 @@
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
-
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 };
18
-
19
- export default {
20
- Root: Card,
21
- Header: CardHeader,
22
- Footer: CardFooter,
23
- Title: CardTitle,
24
- Description: CardDescription,
25
- Content: CardContent,
26
- };
@@ -1,55 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { type EmblaOptionsType } from "embla-carousel";
4
- import { tv } from "tailwind-variants";
5
-
6
- const carousel = tv({
7
- base: "starwind-carousel group/carousel relative",
8
- });
9
-
10
- export interface Props extends HTMLAttributes<"div"> {
11
- orientation?: "horizontal" | "vertical";
12
- opts?: EmblaOptionsType;
13
- autoInit?: boolean;
14
- }
15
-
16
- const {
17
- class: className,
18
- orientation = "horizontal",
19
- opts = {},
20
- autoInit = true,
21
- ...rest
22
- } = Astro.props;
23
- ---
24
-
25
- <div
26
- class={carousel({ class: className })}
27
- role="region"
28
- aria-roledescription="carousel"
29
- data-slot="carousel"
30
- data-axis={orientation === "horizontal" ? "x" : "y"}
31
- data-opts={JSON.stringify(opts)}
32
- data-auto-init={autoInit}
33
- {...rest}
34
- >
35
- <slot />
36
- </div>
37
-
38
- <script>
39
- import { initCarousel } from "./index";
40
-
41
- const setupCarousels = () => {
42
- const carousels = document.querySelectorAll(".starwind-carousel") as NodeListOf<HTMLElement>;
43
- carousels.forEach((carousel) => {
44
- if (carousel.dataset.autoInit === "false") {
45
- return;
46
- }
47
- initCarousel(carousel);
48
- });
49
- };
50
-
51
- document.addEventListener("DOMContentLoaded", setupCarousels);
52
-
53
- // Re-initialize after Astro page transitions
54
- document.addEventListener("astro:after-swap", setupCarousels);
55
- </script>
@@ -1,26 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- const carouselContent = tv({
6
- base: "overflow-hidden",
7
- });
8
-
9
- const carouselContainer = tv({
10
- base: [
11
- "flex group-data-[axis=y]/carousel:flex-col",
12
- "group-data-[axis=x]/carousel:-ml-4",
13
- "group-data-[axis=y]/carousel:-mt-4",
14
- ],
15
- });
16
-
17
- type Props = HTMLAttributes<"div">;
18
-
19
- const { class: className = "", ...rest } = Astro.props;
20
- ---
21
-
22
- <div class={carouselContent()} data-slot="carousel-content" {...rest}>
23
- <div class={carouselContainer({ class: className })} data-slot="carousel-container">
24
- <slot />
25
- </div>
26
- </div>
@@ -1,26 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- const carouselItem = tv({
6
- base: [
7
- "min-w-0 shrink-0 grow-0 basis-full",
8
- "group-data-[axis=x]/carousel:pl-4",
9
- "group-data-[axis=y]/carousel:pt-4",
10
- ],
11
- });
12
-
13
- type Props = HTMLAttributes<"div">;
14
-
15
- const { class: className = "", ...rest } = Astro.props;
16
- ---
17
-
18
- <div
19
- role="group"
20
- aria-roledescription="slide"
21
- data-slot="carousel-item"
22
- class={carouselItem({ class: className })}
23
- {...rest}
24
- >
25
- <slot />
26
- </div>
@@ -1,37 +0,0 @@
1
- ---
2
- import ArrowRight from "@tabler/icons/outline/arrow-right.svg";
3
- import type { ComponentProps } from "astro/types";
4
- import { tv } from "tailwind-variants";
5
-
6
- import { Button } from "@/components/starwind/button";
7
-
8
- export const carouselNext = tv({
9
- base: [
10
- "starwind-carousel-next absolute size-8 rounded-full",
11
- // Horizontal positioning
12
- "group-data-[axis=x]/carousel:top-1/2 group-data-[axis=x]/carousel:-right-12 group-data-[axis=x]/carousel:-translate-y-1/2",
13
- // Vertical positioning
14
- "group-data-[axis=y]/carousel:-bottom-12 group-data-[axis=y]/carousel:left-1/2 group-data-[axis=y]/carousel:-translate-x-1/2 group-data-[axis=y]/carousel:rotate-90",
15
- ],
16
- });
17
-
18
- type Props = ComponentProps<typeof Button>;
19
-
20
- const { class: className = "", variant = "outline", size = "icon", ...rest } = Astro.props;
21
- ---
22
-
23
- <Button
24
- data-slot="carousel-next"
25
- variant={variant}
26
- size={size}
27
- class={carouselNext({ class: className })}
28
- aria-label="Next slide"
29
- {...rest}
30
- >
31
- <slot name="icon">
32
- <ArrowRight />
33
- </slot>
34
- <slot>
35
- <span class="sr-only">Next slide</span>
36
- </slot>
37
- </Button>