@starwind-ui/core 1.14.0 → 1.15.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 (179) hide show
  1. package/package.json +1 -1
  2. package/dist/index.d.ts +0 -28
  3. package/dist/index.js +0 -85
  4. package/dist/index.js.map +0 -1
  5. package/dist/src/components/accordion/Accordion.astro +0 -254
  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 -275
  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 -49
  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 -54
  41. package/dist/src/components/button/index.ts +0 -7
  42. package/dist/src/components/button-group/ButtonGroup.astro +0 -62
  43. package/dist/src/components/button-group/ButtonGroupSeparator.astro +0 -27
  44. package/dist/src/components/button-group/ButtonGroupText.astro +0 -19
  45. package/dist/src/components/button-group/index.ts +0 -17
  46. package/dist/src/components/card/Card.astro +0 -14
  47. package/dist/src/components/card/CardContent.astro +0 -14
  48. package/dist/src/components/card/CardDescription.astro +0 -14
  49. package/dist/src/components/card/CardFooter.astro +0 -14
  50. package/dist/src/components/card/CardHeader.astro +0 -14
  51. package/dist/src/components/card/CardTitle.astro +0 -14
  52. package/dist/src/components/card/index.ts +0 -26
  53. package/dist/src/components/carousel/Carousel.astro +0 -55
  54. package/dist/src/components/carousel/CarouselContent.astro +0 -26
  55. package/dist/src/components/carousel/CarouselItem.astro +0 -26
  56. package/dist/src/components/carousel/CarouselNext.astro +0 -37
  57. package/dist/src/components/carousel/CarouselPrevious.astro +0 -37
  58. package/dist/src/components/carousel/carousel-script.ts +0 -191
  59. package/dist/src/components/carousel/index.ts +0 -32
  60. package/dist/src/components/checkbox/Checkbox.astro +0 -128
  61. package/dist/src/components/checkbox/index.ts +0 -7
  62. package/dist/src/components/dialog/Dialog.astro +0 -355
  63. package/dist/src/components/dialog/DialogClose.astro +0 -35
  64. package/dist/src/components/dialog/DialogContent.astro +0 -78
  65. package/dist/src/components/dialog/DialogDescription.astro +0 -14
  66. package/dist/src/components/dialog/DialogFooter.astro +0 -14
  67. package/dist/src/components/dialog/DialogHeader.astro +0 -14
  68. package/dist/src/components/dialog/DialogTitle.astro +0 -22
  69. package/dist/src/components/dialog/DialogTrigger.astro +0 -47
  70. package/dist/src/components/dialog/index.ts +0 -45
  71. package/dist/src/components/dropdown/Dropdown.astro +0 -377
  72. package/dist/src/components/dropdown/DropdownContent.astro +0 -81
  73. package/dist/src/components/dropdown/DropdownItem.astro +0 -48
  74. package/dist/src/components/dropdown/DropdownLabel.astro +0 -29
  75. package/dist/src/components/dropdown/DropdownSeparator.astro +0 -21
  76. package/dist/src/components/dropdown/DropdownTrigger.astro +0 -52
  77. package/dist/src/components/dropdown/index.ts +0 -33
  78. package/dist/src/components/dropzone/Dropzone.astro +0 -236
  79. package/dist/src/components/dropzone/DropzoneFilesList.astro +0 -26
  80. package/dist/src/components/dropzone/DropzoneLoadingIndicator.astro +0 -10
  81. package/dist/src/components/dropzone/DropzoneUploadIndicator.astro +0 -10
  82. package/dist/src/components/dropzone/index.ts +0 -24
  83. package/dist/src/components/image/Image.astro +0 -24
  84. package/dist/src/components/image/index.ts +0 -9
  85. package/dist/src/components/input/Input.astro +0 -25
  86. package/dist/src/components/input/index.ts +0 -7
  87. package/dist/src/components/item/Item.astro +0 -52
  88. package/dist/src/components/item/ItemActions.astro +0 -16
  89. package/dist/src/components/item/ItemContent.astro +0 -16
  90. package/dist/src/components/item/ItemDescription.astro +0 -19
  91. package/dist/src/components/item/ItemFooter.astro +0 -16
  92. package/dist/src/components/item/ItemGroup.astro +0 -16
  93. package/dist/src/components/item/ItemHeader.astro +0 -16
  94. package/dist/src/components/item/ItemMedia.astro +0 -40
  95. package/dist/src/components/item/ItemSeparator.astro +0 -21
  96. package/dist/src/components/item/ItemTitle.astro +0 -16
  97. package/dist/src/components/item/index.ts +0 -50
  98. package/dist/src/components/kbd/Kbd.astro +0 -21
  99. package/dist/src/components/kbd/KbdGroup.astro +0 -16
  100. package/dist/src/components/kbd/index.ts +0 -11
  101. package/dist/src/components/label/Label.astro +0 -22
  102. package/dist/src/components/label/index.ts +0 -7
  103. package/dist/src/components/pagination/Pagination.astro +0 -20
  104. package/dist/src/components/pagination/PaginationContent.astro +0 -16
  105. package/dist/src/components/pagination/PaginationEllipsis.astro +0 -35
  106. package/dist/src/components/pagination/PaginationItem.astro +0 -16
  107. package/dist/src/components/pagination/PaginationLink.astro +0 -24
  108. package/dist/src/components/pagination/PaginationNext.astro +0 -30
  109. package/dist/src/components/pagination/PaginationPrevious.astro +0 -30
  110. package/dist/src/components/pagination/index.ts +0 -38
  111. package/dist/src/components/progress/Progress.astro +0 -155
  112. package/dist/src/components/progress/index.ts +0 -10
  113. package/dist/src/components/radio-group/RadioGroup.astro +0 -162
  114. package/dist/src/components/radio-group/RadioGroupItem.astro +0 -129
  115. package/dist/src/components/radio-group/RadioGroupTypes.ts +0 -6
  116. package/dist/src/components/radio-group/index.ts +0 -23
  117. package/dist/src/components/select/Select.astro +0 -751
  118. package/dist/src/components/select/SelectContent.astro +0 -94
  119. package/dist/src/components/select/SelectGroup.astro +0 -9
  120. package/dist/src/components/select/SelectItem.astro +0 -51
  121. package/dist/src/components/select/SelectLabel.astro +0 -14
  122. package/dist/src/components/select/SelectSearch.astro +0 -49
  123. package/dist/src/components/select/SelectSeparator.astro +0 -12
  124. package/dist/src/components/select/SelectTrigger.astro +0 -54
  125. package/dist/src/components/select/SelectTypes.ts +0 -13
  126. package/dist/src/components/select/SelectValue.astro +0 -19
  127. package/dist/src/components/select/index.ts +0 -49
  128. package/dist/src/components/separator/Separator.astro +0 -36
  129. package/dist/src/components/separator/index.ts +0 -7
  130. package/dist/src/components/sheet/Sheet.astro +0 -13
  131. package/dist/src/components/sheet/SheetClose.astro +0 -13
  132. package/dist/src/components/sheet/SheetContent.astro +0 -92
  133. package/dist/src/components/sheet/SheetDescription.astro +0 -16
  134. package/dist/src/components/sheet/SheetFooter.astro +0 -16
  135. package/dist/src/components/sheet/SheetHeader.astro +0 -16
  136. package/dist/src/components/sheet/SheetTitle.astro +0 -16
  137. package/dist/src/components/sheet/SheetTrigger.astro +0 -13
  138. package/dist/src/components/sheet/index.ts +0 -41
  139. package/dist/src/components/skeleton/Skeleton.astro +0 -14
  140. package/dist/src/components/skeleton/index.ts +0 -9
  141. package/dist/src/components/slider/Slider.astro +0 -411
  142. package/dist/src/components/slider/index.ts +0 -9
  143. package/dist/src/components/spinner/Spinner.astro +0 -21
  144. package/dist/src/components/spinner/index.ts +0 -7
  145. package/dist/src/components/switch/Switch.astro +0 -192
  146. package/dist/src/components/switch/SwitchTypes.ts +0 -6
  147. package/dist/src/components/switch/index.ts +0 -12
  148. package/dist/src/components/table/Table.astro +0 -18
  149. package/dist/src/components/table/TableBody.astro +0 -16
  150. package/dist/src/components/table/TableCaption.astro +0 -16
  151. package/dist/src/components/table/TableCell.astro +0 -16
  152. package/dist/src/components/table/TableFoot.astro +0 -16
  153. package/dist/src/components/table/TableHead.astro +0 -16
  154. package/dist/src/components/table/TableHeader.astro +0 -16
  155. package/dist/src/components/table/TableRow.astro +0 -16
  156. package/dist/src/components/table/index.ts +0 -42
  157. package/dist/src/components/tabs/Tabs.astro +0 -271
  158. package/dist/src/components/tabs/TabsContent.astro +0 -28
  159. package/dist/src/components/tabs/TabsList.astro +0 -22
  160. package/dist/src/components/tabs/TabsTrigger.astro +0 -34
  161. package/dist/src/components/tabs/index.ts +0 -20
  162. package/dist/src/components/textarea/Textarea.astro +0 -29
  163. package/dist/src/components/textarea/index.ts +0 -9
  164. package/dist/src/components/toast/ToastDescription.astro +0 -21
  165. package/dist/src/components/toast/ToastItem.astro +0 -54
  166. package/dist/src/components/toast/ToastTemplate.astro +0 -25
  167. package/dist/src/components/toast/ToastTitle.astro +0 -57
  168. package/dist/src/components/toast/Toaster.astro +0 -982
  169. package/dist/src/components/toast/index.ts +0 -29
  170. package/dist/src/components/toast/toast-manager.ts +0 -216
  171. package/dist/src/components/toggle/Toggle.astro +0 -174
  172. package/dist/src/components/toggle/ToggleTypes.ts +0 -14
  173. package/dist/src/components/toggle/index.ts +0 -8
  174. package/dist/src/components/tooltip/Tooltip.astro +0 -239
  175. package/dist/src/components/tooltip/TooltipContent.astro +0 -114
  176. package/dist/src/components/tooltip/TooltipTrigger.astro +0 -10
  177. package/dist/src/components/tooltip/index.ts +0 -16
  178. package/dist/src/components/video/Video.astro +0 -120
  179. package/dist/src/components/video/index.ts +0 -9
@@ -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,49 +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">, Omit<HTMLAttributes<"a">, "type">, VariantProps<typeof badge> {}
7
-
8
- export const badge = tv({
9
- base: [
10
- "starwind-badge inline-flex items-center rounded-full font-semibold",
11
- "transition-all outline-none focus-visible:ring-3",
12
- ],
13
- variants: {
14
- variant: {
15
- default: "bg-foreground text-background focus-visible:ring-outline/50",
16
- primary: "bg-primary text-primary-foreground focus-visible:ring-primary/50",
17
- secondary: "bg-secondary text-secondary-foreground focus-visible:ring-secondary/50",
18
- outline: "border-border focus-visible:border-outline focus-visible:ring-outline/50 border",
19
- ghost: "bg-foreground/10 text-foreground focus-visible:ring-outline/50",
20
- info: "bg-info text-info-foreground focus-visible:ring-info/50",
21
- success: "bg-success text-success-foreground focus-visible:ring-success/50",
22
- warning: "bg-warning text-warning-foreground focus-visible:ring-warning/50",
23
- error: "bg-error text-error-foreground focus-visible:ring-error/50",
24
- },
25
- 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" },
26
- isLink: { true: "cursor-pointer", false: "" },
27
- },
28
- compoundVariants: [
29
- { isLink: true, variant: "default", className: "hover:bg-foreground/80" },
30
- { isLink: true, variant: "primary", className: "hover:bg-primary/80" },
31
- { isLink: true, variant: "secondary", className: "hover:bg-secondary/80" },
32
- { isLink: true, variant: "outline", className: "hover:border-border/80" },
33
- { isLink: true, variant: "ghost", className: "hover:bg-foreground/7" },
34
- { isLink: true, variant: "info", className: "hover:bg-info/80" },
35
- { isLink: true, variant: "success", className: "hover:bg-success/80" },
36
- { isLink: true, variant: "warning", className: "hover:bg-warning/80" },
37
- { isLink: true, variant: "error", className: "hover:bg-error/80" },
38
- ],
39
- defaultVariants: { variant: "default", size: "md", isLink: false },
40
- });
41
-
42
- const { variant, size, class: className, ...rest } = Astro.props;
43
- const isLink = Astro.props.href ? true : false;
44
- const Tag = Astro.props.href ? "a" : "div";
45
- ---
46
-
47
- <Tag class={badge({ variant, size, isLink, class: className })} data-slot="badge" {...rest}>
48
- <slot />
49
- </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,54 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv, type VariantProps } from "tailwind-variants";
4
-
5
- interface Props
6
- extends
7
- HTMLAttributes<"button">,
8
- Omit<HTMLAttributes<"a">, "type">,
9
- VariantProps<typeof button> {}
10
-
11
- const { variant, size, class: className, ...rest } = Astro.props;
12
-
13
- export const button = tv({
14
- base: [
15
- "inline-flex items-center justify-center gap-1.5 rounded-md font-medium whitespace-nowrap",
16
- "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
17
- "transition-all outline-none focus-visible:ring-3",
18
- "disabled:pointer-events-none disabled:opacity-50",
19
- ],
20
- variants: {
21
- variant: {
22
- default: "bg-foreground text-background hover:bg-foreground/90 focus-visible:ring-outline/50",
23
- primary:
24
- "bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-primary/50",
25
- secondary:
26
- "bg-secondary text-secondary-foreground hover:bg-secondary/90 focus-visible:ring-secondary/50",
27
- outline:
28
- "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",
29
- ghost: "hover:bg-muted hover:text-foreground focus-visible:ring-outline/50",
30
- info: "bg-info text-info-foreground hover:bg-info/90 focus-visible:ring-info/50",
31
- success:
32
- "bg-success text-success-foreground hover:bg-success/90 focus-visible:ring-success/50",
33
- warning:
34
- "bg-warning text-warning-foreground hover:bg-warning/90 focus-visible:ring-warning/50",
35
- error: "bg-error text-error-foreground hover:bg-error/90 focus-visible:ring-error/50",
36
- },
37
- size: {
38
- sm: "h-9 px-3 py-2 text-sm",
39
- md: "h-11 px-4 py-2 text-base",
40
- lg: "h-12 px-8 py-2 text-lg",
41
- icon: "size-11",
42
- "icon-sm": "size-9",
43
- "icon-lg": "size-12",
44
- },
45
- },
46
- defaultVariants: { variant: "default", size: "md" },
47
- });
48
-
49
- const Tag = Astro.props.href ? "a" : "button";
50
- ---
51
-
52
- <Tag class={button({ variant, size, class: className })} data-slot="button" {...rest}>
53
- <slot />
54
- </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,62 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- type Props = HTMLAttributes<"div"> & {
6
- /**
7
- * The orientation of the button group.
8
- * @default "horizontal"
9
- */
10
- orientation?: "horizontal" | "vertical";
11
- };
12
-
13
- export const buttonGroup = tv({
14
- base: [
15
- "flex w-fit items-stretch",
16
- "[&>*]:focus-visible:relative [&>*]:focus-visible:z-10",
17
- "has-[>[data-slot=button-group]]:gap-2 [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
18
- ],
19
- variants: {
20
- orientation: {
21
- horizontal: [
22
- "[&>*:not(:first-child)]:rounded-l-none",
23
- "[&>*:not(:first-child)]:border-l-0",
24
- "[&>*:not(:last-child):not(:has(+_script:last-child))]:rounded-r-none",
25
- "[&>*:not(:first-child)_>_[data-as-child]_>_*]:rounded-l-none",
26
- "[&>*:not(:first-child)_>_[data-as-child]_>_*]:border-l-0",
27
- "[&>*:not(:last-child):not(:has(+_script:last-child))_>_[data-as-child]_>_*]:rounded-r-none",
28
- "[&>*:not(:first-child)_>_[data-slot=select-trigger]]:rounded-l-none",
29
- "[&>*:not(:first-child)_>_[data-slot=select-trigger]]:border-l-0",
30
- "[&>*:not(:last-child):not(:has(+_script:last-child))_>_[data-slot=select-trigger]]:rounded-r-none",
31
- ],
32
- vertical: [
33
- "flex-col",
34
- "[&>*:not(:first-child)]:rounded-t-none",
35
- "[&>*:not(:first-child)]:border-t-0",
36
- "[&>*:not(:last-child):not(:has(+_script:last-child))]:rounded-b-none",
37
- "[&>*:not(:first-child)_>_[data-as-child]_>_*]:rounded-t-none",
38
- "[&>*:not(:first-child)_>_[data-as-child]_>_*]:border-t-0",
39
- "[&>*:not(:last-child):not(:has(+_script:last-child))_>_[data-as-child]_>_*]:rounded-b-none",
40
- "[&>*:not(:first-child)_>_[data-slot=select-trigger]]:rounded-t-none",
41
- "[&>*:not(:first-child)_>_[data-slot=select-trigger]]:border-t-0",
42
- "[&>*:not(:last-child):not(:has(+_script:last-child))_>_[data-slot=select-trigger]]:rounded-b-none",
43
- ],
44
- },
45
- },
46
- defaultVariants: {
47
- orientation: "horizontal",
48
- },
49
- });
50
-
51
- const { class: className, orientation = "horizontal", ...rest } = Astro.props;
52
- ---
53
-
54
- <div
55
- role="group"
56
- data-slot="button-group"
57
- data-orientation={orientation}
58
- class={buttonGroup({ orientation, class: className })}
59
- {...rest}
60
- >
61
- <slot />
62
- </div>
@@ -1,27 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- import { Separator } from "@/components/starwind/separator";
6
-
7
- type Props = HTMLAttributes<"div"> & {
8
- /**
9
- * The orientation of the separator.
10
- * @default "vertical"
11
- */
12
- orientation?: "horizontal" | "vertical";
13
- };
14
-
15
- export const buttonGroupSeparator = tv({
16
- base: ["bg-input relative m-0! self-stretch data-[orientation=vertical]:h-auto"],
17
- });
18
-
19
- const { class: className, orientation = "vertical", ...rest } = Astro.props;
20
- ---
21
-
22
- <Separator
23
- data-slot="button-group-separator"
24
- orientation={orientation}
25
- class={buttonGroupSeparator({ class: className })}
26
- {...rest}
27
- />
@@ -1,19 +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 buttonGroupText = tv({
8
- base: [
9
- "bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs",
10
- "[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
11
- ],
12
- });
13
-
14
- const { class: className, ...rest } = Astro.props;
15
- ---
16
-
17
- <div class:list={[buttonGroupText(), className]} data-slot="button-group-text" {...rest}>
18
- <slot />
19
- </div>
@@ -1,17 +0,0 @@
1
- import ButtonGroup, { buttonGroup } from "./ButtonGroup.astro";
2
- import ButtonGroupSeparator, { buttonGroupSeparator } from "./ButtonGroupSeparator.astro";
3
- import ButtonGroupText, { buttonGroupText } from "./ButtonGroupText.astro";
4
-
5
- const ButtonGroupVariants = {
6
- buttonGroup,
7
- buttonGroupSeparator,
8
- buttonGroupText,
9
- };
10
-
11
- export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, ButtonGroupVariants };
12
-
13
- export default {
14
- Root: ButtonGroup,
15
- Separator: ButtonGroupSeparator,
16
- Text: ButtonGroupText,
17
- };
@@ -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
- };