@orbitkit/components 0.1.0 → 0.2.0-beta.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 (133) hide show
  1. package/README.md +25 -25
  2. package/dist/astro/accordion/Accordion.astro +34 -0
  3. package/dist/astro/accordion/AccordionItem.astro +16 -0
  4. package/dist/astro/accordion/AccordionTrigger.astro +33 -0
  5. package/dist/astro/accordion/AcordionContent.astro +26 -0
  6. package/dist/astro/accordion/accordion.ts +125 -0
  7. package/dist/astro/accordion/index.ts +6 -0
  8. package/dist/astro/alert/Alert.astro +30 -30
  9. package/dist/astro/alert/AlertDescription.astro +10 -10
  10. package/dist/astro/alert/AlertTitle.astro +15 -15
  11. package/dist/astro/alert/alertVariants.ts +51 -51
  12. package/dist/astro/alert/index.ts +6 -6
  13. package/dist/astro/avatar/Avatar.astro +16 -16
  14. package/dist/astro/avatar/AvatarFallback.astro +18 -18
  15. package/dist/astro/avatar/AvatarImage.astro +14 -14
  16. package/dist/astro/avatar/avatarVariants.ts +23 -23
  17. package/dist/astro/avatar/index.ts +6 -6
  18. package/dist/astro/badge/Badge.astro +22 -22
  19. package/dist/astro/badge/badgeVariants.ts +37 -37
  20. package/dist/astro/badge/index.ts +4 -4
  21. package/dist/astro/breadcrumb/Breadcrumb.astro +12 -12
  22. package/dist/astro/breadcrumb/BreadcrumbEllipsis.astro +20 -20
  23. package/dist/astro/breadcrumb/BreadcrumbItem.astro +15 -15
  24. package/dist/astro/breadcrumb/BreadcrumbLink.astro +18 -18
  25. package/dist/astro/breadcrumb/BreadcrumbList.astro +18 -18
  26. package/dist/astro/breadcrumb/BreadcrumbPage.astro +18 -18
  27. package/dist/astro/breadcrumb/BreadcrumbSeparator.astro +17 -17
  28. package/dist/astro/breadcrumb/index.ts +17 -17
  29. package/dist/astro/button/Button.astro +29 -29
  30. package/dist/astro/button/buttonVariants.ts +61 -61
  31. package/dist/astro/button/index.ts +4 -4
  32. package/dist/astro/card/Card.astro +18 -18
  33. package/dist/astro/card/CardContent.astro +12 -12
  34. package/dist/astro/card/CardDescription.astro +12 -12
  35. package/dist/astro/card/CardFooter.astro +15 -15
  36. package/dist/astro/card/CardHeader.astro +12 -12
  37. package/dist/astro/card/CardTitle.astro +18 -18
  38. package/dist/astro/card/index.ts +15 -15
  39. package/dist/astro/checkbox/Checkbox.astro +38 -38
  40. package/dist/astro/checkbox/index.ts +3 -3
  41. package/dist/astro/collapsible/Collapsible.astro +34 -0
  42. package/dist/astro/collapsible/CollapsibleContent.astro +20 -0
  43. package/dist/astro/collapsible/collapsible.ts +81 -0
  44. package/dist/astro/collapsible/index.ts +4 -0
  45. package/dist/astro/divider/Divider.astro +22 -22
  46. package/dist/astro/divider/index.ts +3 -3
  47. package/dist/astro/drawer/Drawer.astro +19 -0
  48. package/dist/astro/drawer/DrawerContent.astro +74 -0
  49. package/dist/astro/drawer/DrawerDescription.astro +12 -0
  50. package/dist/astro/drawer/DrawerFooter.astro +15 -0
  51. package/dist/astro/drawer/DrawerHeader.astro +12 -0
  52. package/dist/astro/drawer/DrawerTitle.astro +18 -0
  53. package/dist/astro/drawer/drawer.ts +104 -0
  54. package/dist/astro/drawer/drawerVariants.ts +83 -0
  55. package/dist/astro/drawer/index.ts +15 -0
  56. package/dist/astro/dropdown/DropdownMenu.astro +19 -0
  57. package/dist/astro/dropdown/DropdownMenuContent.astro +42 -0
  58. package/dist/astro/dropdown/DropdownMenuGroup.astro +3 -0
  59. package/dist/astro/dropdown/DropdownMenuItem.astro +27 -0
  60. package/dist/astro/dropdown/DropdownMenuLabel.astro +3 -0
  61. package/dist/astro/dropdown/DropdownMenuSeparator.astro +6 -0
  62. package/dist/astro/dropdown/dropdown.ts +157 -0
  63. package/dist/astro/dropdown/dropdownVariants.ts +134 -0
  64. package/dist/astro/dropdown/index.ts +15 -0
  65. package/dist/astro/input/Input.astro +18 -18
  66. package/dist/astro/input/index.ts +4 -4
  67. package/dist/astro/input/inputVariants.ts +30 -30
  68. package/dist/astro/kbd/Kbd.astro +18 -0
  69. package/dist/astro/kbd/index.ts +3 -0
  70. package/dist/astro/label/Label.astro +14 -14
  71. package/dist/astro/label/index.ts +3 -3
  72. package/dist/astro/list/List.astro +25 -25
  73. package/dist/astro/list/ListItem.astro +39 -39
  74. package/dist/astro/list/ListVariants.ts +65 -65
  75. package/dist/astro/list/index.ts +5 -5
  76. package/dist/astro/modal/Modal.astro +19 -0
  77. package/dist/astro/modal/ModalContent.astro +71 -0
  78. package/dist/astro/modal/ModalDescription.astro +12 -0
  79. package/dist/astro/modal/ModalFooter.astro +15 -0
  80. package/dist/astro/modal/ModalHeader.astro +12 -0
  81. package/dist/astro/modal/ModalTitle.astro +18 -0
  82. package/dist/astro/modal/index.ts +15 -0
  83. package/dist/astro/modal/modal.ts +101 -0
  84. package/dist/astro/pagination/Pagination.astro +12 -0
  85. package/dist/astro/pagination/PaginationContent.astro +15 -0
  86. package/dist/astro/pagination/PaginationEllipsis.astro +33 -0
  87. package/dist/astro/pagination/PaginationItem.astro +12 -0
  88. package/dist/astro/pagination/PaginationLink.astro +21 -0
  89. package/dist/astro/pagination/PaginationNext.astro +29 -0
  90. package/dist/astro/pagination/PaginationPrevious.astro +34 -0
  91. package/dist/astro/pagination/index.ts +13 -0
  92. package/dist/astro/pagination/paginationVariants.ts +26 -0
  93. package/dist/astro/popover/Popover.astro +17 -0
  94. package/dist/astro/popover/PopoverContent.astro +39 -0
  95. package/dist/astro/popover/index.ts +4 -0
  96. package/dist/astro/popover/popover.ts +113 -0
  97. package/dist/astro/popover/popoverVariants.ts +115 -0
  98. package/dist/astro/progress/Progress.astro +23 -23
  99. package/dist/astro/progress/index.ts +4 -4
  100. package/dist/astro/progress/progressContainer.astro +17 -17
  101. package/dist/astro/radio/Radio.astro +26 -26
  102. package/dist/astro/radio/index.ts +3 -3
  103. package/dist/astro/select/Option.astro +11 -11
  104. package/dist/astro/select/Select.astro +39 -39
  105. package/dist/astro/select/index.ts +5 -5
  106. package/dist/astro/select/selectVariants.ts +30 -30
  107. package/dist/astro/skeleton/Skeleton.astro +12 -12
  108. package/dist/astro/skeleton/SkeletonItem.astro +18 -18
  109. package/dist/astro/skeleton/index.ts +4 -4
  110. package/dist/astro/stat/Stat.astro +12 -0
  111. package/dist/astro/stat/StatDescription.astro +12 -0
  112. package/dist/astro/stat/StatTitle.astro +18 -0
  113. package/dist/astro/stat/StatValue.astro +12 -0
  114. package/dist/astro/stat/index.ts +6 -0
  115. package/dist/astro/switch/Switch.astro +19 -19
  116. package/dist/astro/switch/index.ts +3 -3
  117. package/dist/astro/tab/Tab.astro +33 -0
  118. package/dist/astro/tab/TabContent.astro +19 -0
  119. package/dist/astro/tab/TabList.astro +19 -0
  120. package/dist/astro/tab/TabTrigger.astro +24 -0
  121. package/dist/astro/tab/index.ts +6 -0
  122. package/dist/astro/tab/tab.ts +142 -0
  123. package/dist/astro/textarea/Textarea.astro +19 -19
  124. package/dist/astro/textarea/TextareaVariants.ts +30 -30
  125. package/dist/astro/textarea/index.ts +4 -4
  126. package/dist/astro/tooltip/Tooltip.astro +40 -0
  127. package/dist/astro/tooltip/TooltipContent.astro +39 -0
  128. package/dist/astro/tooltip/index.ts +6 -0
  129. package/dist/astro/tooltip/tooltip.ts +137 -0
  130. package/dist/astro/tooltip/tooltipVariants.ts +115 -0
  131. package/dist/index.js +44 -0
  132. package/dist/index.js.map +1 -1
  133. package/package.json +54 -54
@@ -1,6 +1,6 @@
1
- import Avatar from "./Avatar.astro";
2
- import AvatarFallback from "./AvatarFallback.astro";
3
- import AvatarImage from "./AvatarImage.astro";
4
- import { avatarVariants } from "./avatarVariants";
5
-
6
- export { Avatar, AvatarFallback, AvatarImage, avatarVariants };
1
+ import Avatar from "./Avatar.astro";
2
+ import AvatarFallback from "./AvatarFallback.astro";
3
+ import AvatarImage from "./AvatarImage.astro";
4
+ import { avatarVariants } from "./avatarVariants";
5
+
6
+ export { Avatar, AvatarFallback, AvatarImage, avatarVariants };
@@ -1,22 +1,22 @@
1
- ---
2
- import { cn } from "@/utils/cn";
3
- import { type HTMLAttributes } from "astro/types";
4
- import type { VariantProps } from "class-variance-authority";
5
- import { badgeVariants } from "./badgeVariants";
6
-
7
- interface Props
8
- extends HTMLAttributes<"div">,
9
- HTMLAttributes<"a">,
10
- VariantProps<typeof badgeVariants> {}
11
-
12
- const { class: className, variant, rounded, size, ...attrs } = Astro.props;
13
-
14
- const Comp = Astro.props.href ? "a" : "div";
15
- ---
16
-
17
- <Comp
18
- {...attrs}
19
- class={cn(badgeVariants({ variant, rounded, size, className }))}
20
- >
21
- <slot />
22
- </Comp>
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+ import type { VariantProps } from "class-variance-authority";
5
+ import { badgeVariants } from "./badgeVariants";
6
+
7
+ interface Props
8
+ extends HTMLAttributes<"div">,
9
+ HTMLAttributes<"a">,
10
+ VariantProps<typeof badgeVariants> {}
11
+
12
+ const { class: className, variant, rounded, size, ...attrs } = Astro.props;
13
+
14
+ const Comp = Astro.props.href ? "a" : "div";
15
+ ---
16
+
17
+ <Comp
18
+ {...attrs}
19
+ class={cn(badgeVariants({ variant, rounded, size, className }))}
20
+ >
21
+ <slot />
22
+ </Comp>
@@ -1,37 +1,37 @@
1
- import { cva } from "class-variance-authority";
2
-
3
- const classBase =
4
- "inline-flex justify-center items-center gap-1 text-xs font-medium px-2.5 py-0.5";
5
-
6
- const badgeVariants = cva(classBase, {
7
- variants: {
8
- variant: {
9
- default: "bg-secondary text-secondary-foreground",
10
- outline:
11
- "bg-secondary text-secondary-foreground border-secondary-accent border",
12
- },
13
- rounded: {
14
- none: "rounded-none",
15
- xs: "rounded-xs",
16
- sm: "rounded-sm",
17
- md: "rounded-md",
18
- lg: "rounded-lg",
19
- xl: "rounded-xl",
20
- full: "rounded-full",
21
- },
22
- size: {
23
- xs: "text-xs [&_svg]:size-2.5",
24
- sm: "text-sm [&_svg]:size-3",
25
- md: "text-base [&_svg]:size-3",
26
- lg: "text-lg [&_svg]:size-4",
27
- xl: "text-xl [&_svg]:size-4",
28
- },
29
- },
30
- defaultVariants: {
31
- variant: "default",
32
- rounded: "sm",
33
- size: "xs",
34
- },
35
- });
36
-
37
- export { badgeVariants };
1
+ import { cva } from "class-variance-authority";
2
+
3
+ const classBase =
4
+ "inline-flex justify-center items-center gap-1 text-xs font-medium px-2.5 py-0.5";
5
+
6
+ const badgeVariants = cva(classBase, {
7
+ variants: {
8
+ variant: {
9
+ default: "bg-secondary text-secondary-foreground",
10
+ outline:
11
+ "bg-secondary text-secondary-foreground border-secondary-accent border",
12
+ },
13
+ rounded: {
14
+ none: "rounded-none",
15
+ xs: "rounded-xs",
16
+ sm: "rounded-sm",
17
+ md: "rounded-md",
18
+ lg: "rounded-lg",
19
+ xl: "rounded-xl",
20
+ full: "rounded-full",
21
+ },
22
+ size: {
23
+ xs: "text-xs [&_svg]:size-2.5",
24
+ sm: "text-sm [&_svg]:size-3",
25
+ md: "text-base [&_svg]:size-3",
26
+ lg: "text-lg [&_svg]:size-4",
27
+ xl: "text-xl [&_svg]:size-4",
28
+ },
29
+ },
30
+ defaultVariants: {
31
+ variant: "default",
32
+ rounded: "sm",
33
+ size: "xs",
34
+ },
35
+ });
36
+
37
+ export { badgeVariants };
@@ -1,4 +1,4 @@
1
- import Badge from "./Badge.astro";
2
- import { badgeVariants } from "./badgeVariants";
3
-
4
- export { Badge, badgeVariants };
1
+ import Badge from "./Badge.astro";
2
+ import { badgeVariants } from "./badgeVariants";
3
+
4
+ export { Badge, badgeVariants };
@@ -1,12 +1,12 @@
1
- ---
2
- import { cn } from "@/utils/cn";
3
- import { type HTMLAttributes } from "astro/types";
4
-
5
- interface Props extends HTMLAttributes<"nav"> {}
6
-
7
- const { class: className, ...attrs } = Astro.props;
8
- ---
9
-
10
- <nav aria-label="breadcrumb" class={cn("w-max", className)}>
11
- <slot />
12
- </nav>
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"nav"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <nav aria-label="breadcrumb" class={cn("w-max", className)}>
11
+ <slot />
12
+ </nav>
@@ -1,20 +1,20 @@
1
- ---
2
- import { cn } from "@/utils/cn";
3
- import type { HTMLAttributes } from "astro/types";
4
-
5
- type Props = HTMLAttributes<"span">;
6
-
7
- const { class: className, ...attrs } = Astro.props;
8
- ---
9
-
10
- <span
11
- {...attrs}
12
- role="presentation"
13
- aria-hidden="true"
14
- class={cn(
15
- "flex size-6 items-center justify-center [&>svg]:size-4",
16
- className,
17
- )}
18
- >
19
- <slot> ... </slot>
20
- </span>
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import type { HTMLAttributes } from "astro/types";
4
+
5
+ type Props = HTMLAttributes<"span">;
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <span
11
+ {...attrs}
12
+ role="presentation"
13
+ aria-hidden="true"
14
+ class={cn(
15
+ "flex size-6 items-center justify-center [&>svg]:size-4",
16
+ className,
17
+ )}
18
+ >
19
+ <slot> ... </slot>
20
+ </span>
@@ -1,15 +1,15 @@
1
- ---
2
- import { cn } from "@/utils/cn";
3
- import { type HTMLAttributes } from "astro/types";
4
-
5
- interface Props extends HTMLAttributes<"li"> {}
6
-
7
- const { class: className, ...attrs } = Astro.props;
8
- ---
9
-
10
- <li
11
- {...attrs}
12
- class={cn("flex flex-row items-center justify-between gap-1", className)}
13
- >
14
- <slot />
15
- </li>
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"li"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <li
11
+ {...attrs}
12
+ class={cn("flex flex-row items-center justify-between gap-1", className)}
13
+ >
14
+ <slot />
15
+ </li>
@@ -1,18 +1,18 @@
1
- ---
2
- import { cn } from "@/utils/cn";
3
- import { type HTMLAttributes } from "astro/types";
4
-
5
- interface Props extends HTMLAttributes<"a"> {}
6
-
7
- const { class: className, ...attrs } = Astro.props;
8
- ---
9
-
10
- <a
11
- {...attrs}
12
- class={cn(
13
- "flex items-center justify-between gap-1 cursor-pointer hover:text-foreground [&_svg]:size-4",
14
- className,
15
- )}
16
- >
17
- <slot />
18
- </a>
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"a"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <a
11
+ {...attrs}
12
+ class={cn(
13
+ "flex items-center justify-between gap-1 cursor-pointer hover:text-foreground [&_svg]:size-4",
14
+ className,
15
+ )}
16
+ >
17
+ <slot />
18
+ </a>
@@ -1,18 +1,18 @@
1
- ---
2
- import { cn } from "@/utils/cn";
3
- import { type HTMLAttributes } from "astro/types";
4
-
5
- interface Props extends HTMLAttributes<"ol"> {}
6
-
7
- const { class: className, ...attrs } = Astro.props;
8
- ---
9
-
10
- <ol
11
- {...attrs}
12
- class={cn(
13
- "flex flex-row flex-wrap items-center gap-2 rtl:flex-row-reverse text-muted-foreground break-words font-medium",
14
- className,
15
- )}
16
- >
17
- <slot />
18
- </ol>
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"ol"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <ol
11
+ {...attrs}
12
+ class={cn(
13
+ "flex flex-row flex-wrap items-center gap-2 rtl:flex-row-reverse text-muted-foreground break-words font-medium",
14
+ className,
15
+ )}
16
+ >
17
+ <slot />
18
+ </ol>
@@ -1,18 +1,18 @@
1
- ---
2
- import { cn } from "@/utils/cn";
3
- import { type HTMLAttributes } from "astro/types";
4
-
5
- interface Props extends HTMLAttributes<"span"> {}
6
-
7
- const { class: className, ...attrs } = Astro.props;
8
- ---
9
-
10
- <spam
11
- {...attrs}
12
- class={cn(
13
- "flex items-center justify-between gap-1 cursor-pointer text-foreground [&_svg]:size-4",
14
- className,
15
- )}
16
- >
17
- <slot />
18
- </spam>
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"span"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <spam
11
+ {...attrs}
12
+ class={cn(
13
+ "flex items-center justify-between gap-1 cursor-pointer text-foreground [&_svg]:size-4",
14
+ className,
15
+ )}
16
+ >
17
+ <slot />
18
+ </spam>
@@ -1,17 +1,17 @@
1
- ---
2
- import { cn } from "@/utils/cn";
3
- import type { HTMLAttributes } from "astro/types";
4
-
5
- type Props = HTMLAttributes<"li">;
6
-
7
- const { class: className, ...attrs } = Astro.props;
8
- ---
9
-
10
- <li
11
- {...attrs}
12
- role="presentation"
13
- aria-hidden="true"
14
- class={cn("[&_svg]:size-4", className)}
15
- >
16
- <slot> / </slot>
17
- </li>
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import type { HTMLAttributes } from "astro/types";
4
+
5
+ type Props = HTMLAttributes<"li">;
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <li
11
+ {...attrs}
12
+ role="presentation"
13
+ aria-hidden="true"
14
+ class={cn("[&_svg]:size-4", className)}
15
+ >
16
+ <slot> / </slot>
17
+ </li>
@@ -1,17 +1,17 @@
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";
8
-
9
- export {
10
- Breadcrumb,
11
- BreadcrumbEllipsis,
12
- BreadcrumbItem,
13
- BreadcrumbLink,
14
- BreadcrumbList,
15
- BreadcrumbPage,
16
- BreadcrumbSeparator,
17
- };
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";
8
+
9
+ export {
10
+ Breadcrumb,
11
+ BreadcrumbEllipsis,
12
+ BreadcrumbItem,
13
+ BreadcrumbLink,
14
+ BreadcrumbList,
15
+ BreadcrumbPage,
16
+ BreadcrumbSeparator,
17
+ };
@@ -1,29 +1,29 @@
1
- ---
2
- import { cn } from "@/utils/cn";
3
- import type { HTMLAttributes } from "astro/types";
4
- import { type VariantProps } from "class-variance-authority";
5
- import buttonVariants from "./buttonVariants";
6
-
7
- export interface Props
8
- extends Omit<HTMLAttributes<"button">, "disabled">,
9
- Omit<HTMLAttributes<"a">, "type">,
10
- VariantProps<typeof buttonVariants> {}
11
-
12
- const {
13
- class: className,
14
- variant,
15
- size,
16
- rounded,
17
- disabled,
18
- ...attrs
19
- } = Astro.props;
20
-
21
- const Comp = Astro.props.href ? "a" : "button";
22
- ---
23
-
24
- <Comp
25
- {...attrs}
26
- class={cn(buttonVariants({ variant, size, rounded, disabled, className }))}
27
- >
28
- <slot />
29
- </Comp>
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import type { HTMLAttributes } from "astro/types";
4
+ import { type VariantProps } from "class-variance-authority";
5
+ import buttonVariants from "./buttonVariants";
6
+
7
+ export interface Props
8
+ extends Omit<HTMLAttributes<"button">, "disabled">,
9
+ Omit<HTMLAttributes<"a">, "type">,
10
+ VariantProps<typeof buttonVariants> {}
11
+
12
+ const {
13
+ class: className,
14
+ variant,
15
+ size,
16
+ rounded,
17
+ disabled,
18
+ ...attrs
19
+ } = Astro.props;
20
+
21
+ const Comp = Astro.props.href ? "a" : "button";
22
+ ---
23
+
24
+ <Comp
25
+ {...attrs}
26
+ class={cn(buttonVariants({ variant, size, rounded, disabled, className }))}
27
+ >
28
+ <slot />
29
+ </Comp>
@@ -1,61 +1,61 @@
1
- import { cva } from "class-variance-authority";
2
-
3
- const baseClass =
4
- "flex justify-center gap-1.5 items-center font-medium cursor-pointer outline-none border [&_svg]:pointer-events-none [&_svg]:shrink-0";
5
-
6
- const buttonVariants = cva(baseClass, {
7
- variants: {
8
- variant: {
9
- default: "border-primary text-primary-foreground bg-primary",
10
- outline: "text-primary border-primary",
11
- ghost: "text-primary bg-transparent border-transparent",
12
- },
13
- rounded: {
14
- none: "rounded-none",
15
- xs: "rounded-xs",
16
- sm: "rounded-sm",
17
- md: "rounded-md",
18
- lg: "rounded-lg",
19
- xl: "rounded-xl",
20
- full: "rounded-full",
21
- },
22
- size: {
23
- xs: "px-3 py-2 text-xs [&_svg]:size-3.5",
24
- sm: "px-3 py-2 text-sm [&_svg]:size-4",
25
- md: "px-5 py-2.5 text-sm [&_svg]:size-4",
26
- lg: "px-5 py-3 text-base [&_svg]:size-[18px]",
27
- xl: "px-6 py-3.5 text-base [&_svg]:size-[18px]",
28
- },
29
- disabled: {
30
- false: null,
31
- true: ["opacity-50", "cursor-not-allowed"],
32
- },
33
- },
34
- compoundVariants: [
35
- {
36
- variant: "default",
37
- disabled: false,
38
- class: "hover:bg-primary-accent hover:border-primary-accent",
39
- },
40
- {
41
- variant: "outline",
42
- disabled: false,
43
- class:
44
- "hover:text-primary-foreground hover:bg-primary-accent hover:border-primary-accent",
45
- },
46
- {
47
- variant: "ghost",
48
- disabled: false,
49
- class:
50
- "hover:bg-primary hover:text-primary-foreground hover:border-primary",
51
- },
52
- ],
53
- defaultVariants: {
54
- variant: "default",
55
- size: "sm",
56
- rounded: "lg",
57
- disabled: false,
58
- },
59
- });
60
-
61
- export default buttonVariants;
1
+ import { cva } from "class-variance-authority";
2
+
3
+ const baseClass =
4
+ "flex justify-center gap-1.5 items-center font-medium cursor-pointer outline-none border [&_svg]:pointer-events-none [&_svg]:shrink-0";
5
+
6
+ const buttonVariants = cva(baseClass, {
7
+ variants: {
8
+ variant: {
9
+ default: "border-primary text-primary-foreground bg-primary",
10
+ outline: "text-primary border-primary",
11
+ ghost: "text-primary bg-transparent border-transparent",
12
+ },
13
+ rounded: {
14
+ none: "rounded-none",
15
+ xs: "rounded-xs",
16
+ sm: "rounded-sm",
17
+ md: "rounded-md",
18
+ lg: "rounded-lg",
19
+ xl: "rounded-xl",
20
+ full: "rounded-full",
21
+ },
22
+ size: {
23
+ xs: "px-3 py-2 text-xs [&_svg]:size-3.5",
24
+ sm: "px-3 py-2 text-sm [&_svg]:size-4",
25
+ md: "px-5 py-2.5 text-sm [&_svg]:size-4",
26
+ lg: "px-5 py-3 text-base [&_svg]:size-[18px]",
27
+ xl: "px-6 py-3.5 text-base [&_svg]:size-[18px]",
28
+ },
29
+ disabled: {
30
+ false: null,
31
+ true: ["opacity-50", "cursor-not-allowed"],
32
+ },
33
+ },
34
+ compoundVariants: [
35
+ {
36
+ variant: "default",
37
+ disabled: false,
38
+ class: "hover:bg-primary-accent hover:border-primary-accent",
39
+ },
40
+ {
41
+ variant: "outline",
42
+ disabled: false,
43
+ class:
44
+ "hover:text-primary-foreground hover:bg-primary-accent hover:border-primary-accent",
45
+ },
46
+ {
47
+ variant: "ghost",
48
+ disabled: false,
49
+ class:
50
+ "hover:bg-primary hover:text-primary-foreground hover:border-primary",
51
+ },
52
+ ],
53
+ defaultVariants: {
54
+ variant: "default",
55
+ size: "sm",
56
+ rounded: "lg",
57
+ disabled: false,
58
+ },
59
+ });
60
+
61
+ export default buttonVariants;
@@ -1,4 +1,4 @@
1
- import Button from "./Button.astro";
2
- import buttonVariants from "./buttonVariants";
3
-
4
- export { Button, buttonVariants };
1
+ import Button from "./Button.astro";
2
+ import buttonVariants from "./buttonVariants";
3
+
4
+ export { Button, buttonVariants };
@@ -1,18 +1,18 @@
1
- ---
2
- import { cn } from "@/utils/cn";
3
- import { type HTMLAttributes } from "astro/types";
4
-
5
- interface Props extends HTMLAttributes<"div"> {}
6
-
7
- const { class: className, ...attrs } = Astro.props;
8
- ---
9
-
10
- <div
11
- {...attrs}
12
- class={cn(
13
- "bg-surface text-foreground border-border border rounded-lg shadow-sm",
14
- className,
15
- )}
16
- >
17
- <slot />
18
- </div>
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <div
11
+ {...attrs}
12
+ class={cn(
13
+ "bg-surface text-foreground border-border border rounded-lg shadow-sm",
14
+ className,
15
+ )}
16
+ >
17
+ <slot />
18
+ </div>