@orbitkit/components 0.0.1 → 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 (132) hide show
  1. package/dist/astro/accordion/Accordion.astro +34 -0
  2. package/dist/astro/accordion/AccordionItem.astro +16 -0
  3. package/dist/astro/accordion/AccordionTrigger.astro +33 -0
  4. package/dist/astro/accordion/AcordionContent.astro +26 -0
  5. package/dist/astro/accordion/accordion.ts +125 -0
  6. package/dist/astro/accordion/index.ts +6 -0
  7. package/dist/astro/alert/Alert.astro +30 -30
  8. package/dist/astro/alert/AlertDescription.astro +10 -10
  9. package/dist/astro/alert/AlertTitle.astro +15 -15
  10. package/dist/astro/alert/alertVariants.ts +51 -51
  11. package/dist/astro/alert/index.ts +6 -6
  12. package/dist/astro/avatar/Avatar.astro +16 -16
  13. package/dist/astro/avatar/AvatarFallback.astro +18 -18
  14. package/dist/astro/avatar/AvatarImage.astro +14 -14
  15. package/dist/astro/avatar/avatarVariants.ts +23 -23
  16. package/dist/astro/avatar/index.ts +6 -6
  17. package/dist/astro/badge/Badge.astro +22 -22
  18. package/dist/astro/badge/badgeVariants.ts +37 -37
  19. package/dist/astro/badge/index.ts +4 -4
  20. package/dist/astro/breadcrumb/Breadcrumb.astro +12 -12
  21. package/dist/astro/breadcrumb/BreadcrumbEllipsis.astro +20 -20
  22. package/dist/astro/breadcrumb/BreadcrumbItem.astro +15 -15
  23. package/dist/astro/breadcrumb/BreadcrumbLink.astro +18 -18
  24. package/dist/astro/breadcrumb/BreadcrumbList.astro +18 -18
  25. package/dist/astro/breadcrumb/BreadcrumbPage.astro +18 -18
  26. package/dist/astro/breadcrumb/BreadcrumbSeparator.astro +17 -17
  27. package/dist/astro/breadcrumb/index.ts +17 -17
  28. package/dist/astro/button/Button.astro +29 -29
  29. package/dist/astro/button/buttonVariants.ts +61 -61
  30. package/dist/astro/button/index.ts +4 -4
  31. package/dist/astro/card/Card.astro +18 -18
  32. package/dist/astro/card/CardContent.astro +12 -12
  33. package/dist/astro/card/CardDescription.astro +12 -12
  34. package/dist/astro/card/CardFooter.astro +15 -15
  35. package/dist/astro/card/CardHeader.astro +12 -12
  36. package/dist/astro/card/CardTitle.astro +18 -18
  37. package/dist/astro/card/index.ts +15 -15
  38. package/dist/astro/checkbox/Checkbox.astro +38 -38
  39. package/dist/astro/checkbox/index.ts +3 -3
  40. package/dist/astro/collapsible/Collapsible.astro +34 -0
  41. package/dist/astro/collapsible/CollapsibleContent.astro +20 -0
  42. package/dist/astro/collapsible/collapsible.ts +81 -0
  43. package/dist/astro/collapsible/index.ts +4 -0
  44. package/dist/astro/divider/Divider.astro +22 -0
  45. package/dist/astro/divider/index.ts +3 -0
  46. package/dist/astro/drawer/Drawer.astro +19 -0
  47. package/dist/astro/drawer/DrawerContent.astro +74 -0
  48. package/dist/astro/drawer/DrawerDescription.astro +12 -0
  49. package/dist/astro/drawer/DrawerFooter.astro +15 -0
  50. package/dist/astro/drawer/DrawerHeader.astro +12 -0
  51. package/dist/astro/drawer/DrawerTitle.astro +18 -0
  52. package/dist/astro/drawer/drawer.ts +104 -0
  53. package/dist/astro/drawer/drawerVariants.ts +83 -0
  54. package/dist/astro/drawer/index.ts +15 -0
  55. package/dist/astro/dropdown/DropdownMenu.astro +19 -0
  56. package/dist/astro/dropdown/DropdownMenuContent.astro +42 -0
  57. package/dist/astro/dropdown/DropdownMenuGroup.astro +3 -0
  58. package/dist/astro/dropdown/DropdownMenuItem.astro +27 -0
  59. package/dist/astro/dropdown/DropdownMenuLabel.astro +3 -0
  60. package/dist/astro/dropdown/DropdownMenuSeparator.astro +6 -0
  61. package/dist/astro/dropdown/dropdown.ts +157 -0
  62. package/dist/astro/dropdown/dropdownVariants.ts +134 -0
  63. package/dist/astro/dropdown/index.ts +15 -0
  64. package/dist/astro/input/Input.astro +18 -18
  65. package/dist/astro/input/index.ts +4 -4
  66. package/dist/astro/input/inputVariants.ts +30 -30
  67. package/dist/astro/kbd/Kbd.astro +18 -0
  68. package/dist/astro/kbd/index.ts +3 -0
  69. package/dist/astro/label/Label.astro +14 -14
  70. package/dist/astro/label/index.ts +3 -3
  71. package/dist/astro/list/List.astro +25 -0
  72. package/dist/astro/list/ListItem.astro +39 -0
  73. package/dist/astro/list/ListVariants.ts +65 -0
  74. package/dist/astro/list/index.ts +5 -0
  75. package/dist/astro/modal/Modal.astro +19 -0
  76. package/dist/astro/modal/ModalContent.astro +71 -0
  77. package/dist/astro/modal/ModalDescription.astro +12 -0
  78. package/dist/astro/modal/ModalFooter.astro +15 -0
  79. package/dist/astro/modal/ModalHeader.astro +12 -0
  80. package/dist/astro/modal/ModalTitle.astro +18 -0
  81. package/dist/astro/modal/index.ts +15 -0
  82. package/dist/astro/modal/modal.ts +101 -0
  83. package/dist/astro/pagination/Pagination.astro +12 -0
  84. package/dist/astro/pagination/PaginationContent.astro +15 -0
  85. package/dist/astro/pagination/PaginationEllipsis.astro +33 -0
  86. package/dist/astro/pagination/PaginationItem.astro +12 -0
  87. package/dist/astro/pagination/PaginationLink.astro +21 -0
  88. package/dist/astro/pagination/PaginationNext.astro +29 -0
  89. package/dist/astro/pagination/PaginationPrevious.astro +34 -0
  90. package/dist/astro/pagination/index.ts +13 -0
  91. package/dist/astro/pagination/paginationVariants.ts +26 -0
  92. package/dist/astro/popover/Popover.astro +17 -0
  93. package/dist/astro/popover/PopoverContent.astro +39 -0
  94. package/dist/astro/popover/index.ts +4 -0
  95. package/dist/astro/popover/popover.ts +113 -0
  96. package/dist/astro/popover/popoverVariants.ts +115 -0
  97. package/dist/astro/progress/Progress.astro +23 -23
  98. package/dist/astro/progress/index.ts +4 -4
  99. package/dist/astro/progress/progressContainer.astro +17 -17
  100. package/dist/astro/radio/Radio.astro +26 -26
  101. package/dist/astro/radio/index.ts +3 -3
  102. package/dist/astro/select/Option.astro +11 -11
  103. package/dist/astro/select/Select.astro +39 -39
  104. package/dist/astro/select/index.ts +5 -5
  105. package/dist/astro/select/selectVariants.ts +30 -30
  106. package/dist/astro/skeleton/Skeleton.astro +12 -0
  107. package/dist/astro/skeleton/SkeletonItem.astro +18 -0
  108. package/dist/astro/skeleton/index.ts +4 -0
  109. package/dist/astro/stat/Stat.astro +12 -0
  110. package/dist/astro/stat/StatDescription.astro +12 -0
  111. package/dist/astro/stat/StatTitle.astro +18 -0
  112. package/dist/astro/stat/StatValue.astro +12 -0
  113. package/dist/astro/stat/index.ts +6 -0
  114. package/dist/astro/switch/Switch.astro +19 -19
  115. package/dist/astro/switch/index.ts +3 -3
  116. package/dist/astro/tab/Tab.astro +33 -0
  117. package/dist/astro/tab/TabContent.astro +19 -0
  118. package/dist/astro/tab/TabList.astro +19 -0
  119. package/dist/astro/tab/TabTrigger.astro +24 -0
  120. package/dist/astro/tab/index.ts +6 -0
  121. package/dist/astro/tab/tab.ts +142 -0
  122. package/dist/astro/textarea/Textarea.astro +19 -19
  123. package/dist/astro/textarea/TextareaVariants.ts +30 -30
  124. package/dist/astro/textarea/index.ts +4 -4
  125. package/dist/astro/tooltip/Tooltip.astro +40 -0
  126. package/dist/astro/tooltip/TooltipContent.astro +39 -0
  127. package/dist/astro/tooltip/index.ts +6 -0
  128. package/dist/astro/tooltip/tooltip.ts +137 -0
  129. package/dist/astro/tooltip/tooltipVariants.ts +115 -0
  130. package/dist/index.js +57 -1
  131. package/dist/index.js.map +1 -1
  132. package/package.json +9 -2
@@ -0,0 +1,113 @@
1
+ export class Popover {
2
+ // References to tooltip elements
3
+ private dropdownMenu: HTMLElement;
4
+ private trigger: HTMLElement | null;
5
+ private content: HTMLElement | null;
6
+
7
+ constructor(dropowndMenu: HTMLElement) {
8
+ this.dropdownMenu = dropowndMenu;
9
+ this.content = this.dropdownMenu.querySelector("[data-popover-content]");
10
+ this.trigger = this.dropdownMenu.querySelector("[data-trigger]");
11
+
12
+ if (!this.content || !this.trigger) {
13
+ console.error("Popover not initialized properly", {
14
+ content: this.content,
15
+ trigger: this.trigger,
16
+ });
17
+ return;
18
+ }
19
+
20
+ this.init();
21
+ }
22
+
23
+ private init() {
24
+ this.setupAccessibility();
25
+ this.setupEventListeners();
26
+ }
27
+
28
+ private setupAccessibility() {
29
+ if (!this.trigger || !this.content) return;
30
+
31
+ const id =
32
+ this.content.id ||
33
+ `popover-id-${Math.random().toString(36).substring(2, 9)}`;
34
+ this.content.id = id;
35
+ this.trigger.setAttribute("aria-describedby", id);
36
+ this.setState("closed");
37
+ }
38
+
39
+ private setupEventListeners() {
40
+ if (!this.trigger || !this.content) return;
41
+
42
+ this.trigger.addEventListener("click", () => this.popoverToggle());
43
+
44
+ this.content.addEventListener("click", (e) => {
45
+ const target = e.target as HTMLElement;
46
+ const item = target.closest('[role="menuitem"]') as HTMLElement;
47
+
48
+ if (item && item.dataset.disabled !== "true") {
49
+ this.closePopover();
50
+ }
51
+ });
52
+
53
+ document.addEventListener("click", (e) => {
54
+ const target = e.target as HTMLElement;
55
+ if (
56
+ this.content &&
57
+ !this.content.contains(target) &&
58
+ target !== this.trigger
59
+ ) {
60
+ this.closePopover();
61
+ }
62
+ });
63
+
64
+ this.trigger.addEventListener("keydown", (e) => {
65
+ const isOpen = this.content?.dataset.state === "open";
66
+ if (e.key === "Enter" || e.key === " ") {
67
+ e.preventDefault();
68
+ this.popoverToggle();
69
+ } else if (e.key === "Escape" && isOpen) {
70
+ e.preventDefault();
71
+ this.closePopover();
72
+ }
73
+ });
74
+
75
+ document.addEventListener("keydown", (e) => this.handleKeydown(e));
76
+ }
77
+
78
+ private popoverToggle() {
79
+ if (this.content?.dataset.state === "open") {
80
+ this.closePopover();
81
+ } else {
82
+ this.openPopover();
83
+ }
84
+ }
85
+
86
+ private openPopover() {
87
+ this.content?.classList.remove("hidden");
88
+
89
+ window.setTimeout(() => {
90
+ this.setState("open");
91
+ }, 0);
92
+ }
93
+
94
+ private closePopover() {
95
+ this.trigger?.focus();
96
+ this.setState("closed");
97
+ window.setTimeout(() => {
98
+ this.content?.classList.add("hidden");
99
+ }, 100);
100
+ }
101
+
102
+ private setState(state: "open" | "closed") {
103
+ this.content?.setAttribute("aria-hidden", `${state === "closed"}`);
104
+ this.content?.setAttribute("data-state", state);
105
+ }
106
+
107
+ private handleKeydown = (event: KeyboardEvent) => {
108
+ if (event.key === "Escape" && this.content!.dataset.state === "open") {
109
+ this.closePopover();
110
+ event.preventDefault();
111
+ }
112
+ };
113
+ }
@@ -0,0 +1,115 @@
1
+ import { cva } from "class-variance-authority";
2
+
3
+ const baseClass = [
4
+ "hidden absolute z-50 bg-surface border border-border p-4 rounded-md",
5
+ "transform duration-100 transition-all ease-in data-[state=closed]:opacity-0 data-[state=closed]:scale-95 data[state=open]:opacity-100 data[state=open]:scale-100",
6
+ ];
7
+
8
+ const popoverVariants = cva(baseClass, {
9
+ variants: {
10
+ side: {
11
+ top: "bottom-full mb-(--tooltip-offset)",
12
+ bottom: "top-full mt-(--tooltip-offset)",
13
+ left: "right-full mr-(--tooltip-offset)",
14
+ right: "left-full ml-(--tooltip-offset)",
15
+ },
16
+ alignment: {
17
+ start: "",
18
+ center: "",
19
+ end: "",
20
+ },
21
+ },
22
+ compoundVariants: [
23
+ {
24
+ side: ["top", "bottom"],
25
+ alignment: "start",
26
+ class: "left-0",
27
+ },
28
+ {
29
+ side: ["top", "bottom"],
30
+ alignment: "end",
31
+ class: "left-full -translate-x-full",
32
+ },
33
+ {
34
+ side: ["top", "bottom"],
35
+ alignment: "center",
36
+ class: "left-1/2 -translate-x-1/2",
37
+ },
38
+ {
39
+ side: ["left", "right"],
40
+ alignment: "start",
41
+ class: "top-0 -translate-y-0",
42
+ },
43
+ {
44
+ side: ["left", "right"],
45
+ alignment: "center",
46
+ class: "top-1/2 -translate-y-1/2",
47
+ },
48
+ {
49
+ side: ["left", "right"],
50
+ alignment: "end",
51
+ class: "top-full -translate-y-full",
52
+ },
53
+ ],
54
+ defaultVariants: {
55
+ side: "bottom",
56
+ alignment: "center",
57
+ },
58
+ });
59
+
60
+ const arrowClass =
61
+ "absolute w-0 h-0 transition-all transform ease-in size-2 bg-surface transform rotate-45 border-border";
62
+
63
+ const popoverArrowVariants = cva(arrowClass, {
64
+ variants: {
65
+ side: {
66
+ top: "top-full -mt-1 border-b border-r",
67
+ bottom: "bottom-full -mb-1 border-t border-l",
68
+ left: "left-full -ml-1 border-t border-r",
69
+ right: "right-full -mr-1 border-b border-l",
70
+ },
71
+ alignment: {
72
+ start: "",
73
+ center: "",
74
+ end: "",
75
+ },
76
+ },
77
+ compoundVariants: [
78
+ {
79
+ side: ["top", "bottom"],
80
+ alignment: "start",
81
+ class: "left-0 ml-3 ",
82
+ },
83
+ {
84
+ side: ["top", "bottom"],
85
+ alignment: "end",
86
+ class: "right-0 mr-3",
87
+ },
88
+ {
89
+ side: ["top", "bottom"],
90
+ alignment: "center",
91
+ class: "left-1/2 -translate-x-1/2",
92
+ },
93
+ {
94
+ side: ["left", "right"],
95
+ alignment: "start",
96
+ class: "top-0 mt-3",
97
+ },
98
+ {
99
+ side: ["left", "right"],
100
+ alignment: "center",
101
+ class: "top-1/2 -translate-y-1/2",
102
+ },
103
+ {
104
+ side: ["left", "right"],
105
+ alignment: "end",
106
+ class: "bottom-0 mb-3",
107
+ },
108
+ ],
109
+ defaultVariants: {
110
+ side: "bottom",
111
+ alignment: "center",
112
+ },
113
+ });
114
+
115
+ export { popoverArrowVariants, popoverVariants };
@@ -1,23 +1,23 @@
1
- ---
2
- import { cn } from "@/utils/cn";
3
- import { type HTMLAttributes } from "astro/types";
4
-
5
- interface Props extends HTMLAttributes<"div"> {
6
- value?: number;
7
- }
8
-
9
- const { class: className, value = 50 } = Astro.props;
10
-
11
- if (value < 0 || value > 100) {
12
- throw new Error("Value must be between 0 and 100");
13
- }
14
- ---
15
-
16
- <div
17
- class={cn(
18
- "flex items-center justify-center h-full overflow-hidden text-primary-foreground break-all bg-primary rounded-full",
19
- className,
20
- )}
21
- style={{ width: `${value}%` }}
22
- >
23
- </div>
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {
6
+ value?: number;
7
+ }
8
+
9
+ const { class: className, value = 50 } = Astro.props;
10
+
11
+ if (value < 0 || value > 100) {
12
+ throw new Error("Value must be between 0 and 100");
13
+ }
14
+ ---
15
+
16
+ <div
17
+ class={cn(
18
+ "flex items-center justify-center h-full overflow-hidden text-primary-foreground break-all bg-primary rounded-full",
19
+ className,
20
+ )}
21
+ style={{ width: `${value}%` }}
22
+ >
23
+ </div>
@@ -1,4 +1,4 @@
1
- import Progress from "./Progress.astro";
2
- import ProgressContainer from "./progressContainer.astro";
3
-
4
- export { Progress, ProgressContainer };
1
+ import Progress from "./Progress.astro";
2
+ import ProgressContainer from "./progressContainer.astro";
3
+
4
+ export { Progress, ProgressContainer };
@@ -1,17 +1,17 @@
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 } = Astro.props;
8
- ---
9
-
10
- <div
11
- class={cn(
12
- "flex-start flex h-2.5 w-full overflow-hidden rounded-full bg-muted font-sans text-xs font-medium",
13
- className,
14
- )}
15
- >
16
- <slot />
17
- </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 } = Astro.props;
8
+ ---
9
+
10
+ <div
11
+ class={cn(
12
+ "flex-start flex h-2.5 w-full overflow-hidden rounded-full bg-muted font-sans text-xs font-medium",
13
+ className,
14
+ )}
15
+ >
16
+ <slot />
17
+ </div>
@@ -1,26 +1,26 @@
1
- ---
2
- import { cn } from "@/utils/cn";
3
- import { type HTMLAttributes } from "astro/types";
4
-
5
- interface Props extends Omit<HTMLAttributes<"input">, "type"> {}
6
-
7
- const { class: className, id, ...attrs } = Astro.props;
8
- ---
9
-
10
- <div class="inline-flex items-center">
11
- <label class="relative flex cursor-pointer items-center" for={id}>
12
- <input
13
- {...attrs}
14
- id={id}
15
- type="radio"
16
- class="border-input-border checked:border-primary peer h-5 w-5 cursor-pointer appearance-none rounded-full border transition-all"
17
- />
18
- <span
19
- class={cn(
20
- "absolute bg-primary w-3 h-3 rounded-full opacity-0 peer-checked:opacity-100 transition-opacity duration-200 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
21
- className,
22
- )}
23
- >
24
- </span>
25
- </label>
26
- </div>
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends Omit<HTMLAttributes<"input">, "type"> {}
6
+
7
+ const { class: className, id, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <div class="inline-flex items-center">
11
+ <label class="relative flex cursor-pointer items-center" for={id}>
12
+ <input
13
+ {...attrs}
14
+ id={id}
15
+ type="radio"
16
+ class="border-input-border checked:border-primary peer h-5 w-5 cursor-pointer appearance-none rounded-full border transition-all"
17
+ />
18
+ <span
19
+ class={cn(
20
+ "absolute bg-primary w-3 h-3 rounded-full opacity-0 peer-checked:opacity-100 transition-opacity duration-200 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
21
+ className,
22
+ )}
23
+ >
24
+ </span>
25
+ </label>
26
+ </div>
@@ -1,3 +1,3 @@
1
- import Radio from "./Radio.astro";
2
-
3
- export { Radio };
1
+ import Radio from "./Radio.astro";
2
+
3
+ export { Radio };
@@ -1,11 +1,11 @@
1
- ---
2
- import { type HTMLAttributes } from "astro/types";
3
-
4
- interface Props extends Omit<HTMLAttributes<"select">, "type"> {}
5
-
6
- const { ...attrs } = Astro.props;
7
- ---
8
-
9
- <option {...attrs}>
10
- <slot />
11
- </option>
1
+ ---
2
+ import { type HTMLAttributes } from "astro/types";
3
+
4
+ interface Props extends HTMLAttributes<"option"> {}
5
+
6
+ const { ...attrs } = Astro.props;
7
+ ---
8
+
9
+ <option {...attrs}>
10
+ <slot />
11
+ </option>
@@ -1,39 +1,39 @@
1
- ---
2
- import { cn } from "@/utils/cn";
3
- import { type HTMLAttributes } from "astro/types";
4
- import type { VariantProps } from "class-variance-authority";
5
- import { selectVariants } from "./selectVariants";
6
-
7
- interface Props
8
- extends Omit<HTMLAttributes<"select">, "disabled">,
9
- VariantProps<typeof selectVariants> {}
10
-
11
- const { class: className, multiple, variant, disabled, ...attrs } = Astro.props;
12
- ---
13
-
14
- <div class="relative">
15
- <select
16
- {...attrs}
17
- disabled={disabled}
18
- multiple={multiple}
19
- class={cn(selectVariants({ variant, disabled, className }))}
20
- >
21
- <slot />
22
- </select>
23
-
24
- {
25
- !multiple && (
26
- <svg
27
- xmlns="http://www.w3.org/2000/svg"
28
- viewBox="0 0 24 24"
29
- fill="none"
30
- stroke="currentColor"
31
- stroke-width="2"
32
- class="text-input-placeholder absolute right-2.5 top-2.5 h-5 w-5"
33
- >
34
- <path d="m7 15 5 5 5-5" />
35
- <path d="m7 9 5-5 5 5" />
36
- </svg>
37
- )
38
- }
39
- </div>
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import { type HTMLAttributes } from "astro/types";
4
+ import type { VariantProps } from "class-variance-authority";
5
+ import { selectVariants } from "./selectVariants";
6
+
7
+ interface Props
8
+ extends Omit<HTMLAttributes<"select">, "disabled">,
9
+ VariantProps<typeof selectVariants> {}
10
+
11
+ const { class: className, multiple, variant, disabled, ...attrs } = Astro.props;
12
+ ---
13
+
14
+ <div class="relative">
15
+ <select
16
+ {...attrs}
17
+ disabled={disabled}
18
+ multiple={multiple}
19
+ class={cn(selectVariants({ variant, disabled, className }))}
20
+ >
21
+ <slot />
22
+ </select>
23
+
24
+ {
25
+ !multiple && (
26
+ <svg
27
+ xmlns="http://www.w3.org/2000/svg"
28
+ viewBox="0 0 24 24"
29
+ fill="none"
30
+ stroke="currentColor"
31
+ stroke-width="2"
32
+ class="text-input-placeholder absolute right-2.5 top-2.5 h-5 w-5"
33
+ >
34
+ <path d="m7 15 5 5 5-5" />
35
+ <path d="m7 9 5-5 5 5" />
36
+ </svg>
37
+ )
38
+ }
39
+ </div>
@@ -1,5 +1,5 @@
1
- import Option from "./Option.astro";
2
- import Select from "./Select.astro";
3
- import { selectVariants } from "./selectVariants";
4
-
5
- export { Option, Select, selectVariants };
1
+ import Option from "./Option.astro";
2
+ import Select from "./Select.astro";
3
+ import { selectVariants } from "./selectVariants";
4
+
5
+ export { Option, Select, selectVariants };
@@ -1,30 +1,30 @@
1
- import { cva } from "class-variance-authority";
2
-
3
- const baseClass =
4
- "block w-full p-2.5 mb-2 text-sm rounded-lg outline-1 -outline-offset-1 appearance-none";
5
-
6
- const selectVariants = cva(baseClass, {
7
- variants: {
8
- variant: {
9
- default:
10
- "text-foreground bg-input outline-input-border placeholder-input-placeholder cursor-pointer",
11
- },
12
- disabled: {
13
- false: null,
14
- true: "bg-input/40 outline-input-border/40 text-muted-foreground cursor-not-allowed",
15
- },
16
- },
17
- compoundVariants: [
18
- {
19
- variant: "default",
20
- disabled: false,
21
- class: "focus:outline-2 focus:-outline-offset-2 focus:outline-primary",
22
- },
23
- ],
24
- defaultVariants: {
25
- variant: "default",
26
- disabled: false,
27
- },
28
- });
29
-
30
- export { selectVariants };
1
+ import { cva } from "class-variance-authority";
2
+
3
+ const baseClass =
4
+ "block w-full p-2.5 mb-2 text-sm rounded-lg outline-1 -outline-offset-1 appearance-none";
5
+
6
+ const selectVariants = cva(baseClass, {
7
+ variants: {
8
+ variant: {
9
+ default:
10
+ "text-foreground bg-input outline-input-border placeholder-input-placeholder cursor-pointer",
11
+ },
12
+ disabled: {
13
+ false: null,
14
+ true: "bg-input/40 outline-input-border/40 text-muted-foreground cursor-not-allowed",
15
+ },
16
+ },
17
+ compoundVariants: [
18
+ {
19
+ variant: "default",
20
+ disabled: false,
21
+ class: "focus:outline-2 focus:-outline-offset-2 focus:outline-primary",
22
+ },
23
+ ],
24
+ defaultVariants: {
25
+ variant: "default",
26
+ disabled: false,
27
+ },
28
+ });
29
+
30
+ export { selectVariants };
@@ -0,0 +1,12 @@
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 {...attrs} role="status" class={cn("animate-pulse", className)}>
11
+ <slot />
12
+ </div>
@@ -0,0 +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
+ "rounded-md bg-muted text-muted-foreground flex items-center justify-center",
14
+ className,
15
+ )}
16
+ >
17
+ <slot />
18
+ </div>
@@ -0,0 +1,4 @@
1
+ import Skeleton from "./Skeleton.astro";
2
+ import SkeletonItem from "./SkeletonItem.astro";
3
+
4
+ export { Skeleton, SkeletonItem };
@@ -0,0 +1,12 @@
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 class={cn("inline-flex flex-col gap-0.5", className)} {...attrs}>
11
+ <slot />
12
+ </div>
@@ -0,0 +1,12 @@
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
+ <p class={cn("text-sm text-foreground/70", className)} {...attrs}>
11
+ <slot />
12
+ </p>
@@ -0,0 +1,18 @@
1
+ ---
2
+ import { cn } from "@/utils/cn";
3
+ import type { HTMLAttributes } from "astro/types";
4
+
5
+ interface Props extends HTMLAttributes<"h3"> {}
6
+
7
+ const { class: className, ...attrs } = Astro.props;
8
+ ---
9
+
10
+ <h3
11
+ class={cn(
12
+ "text-sm font-medium text-foreground/80 uppercase tracking-wide",
13
+ className,
14
+ )}
15
+ {...attrs}
16
+ >
17
+ <slot />
18
+ </h3>
@@ -0,0 +1,12 @@
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
+ <span class={cn("text-3xl font-bold text-foreground", className)} {...attrs}>
11
+ <slot />
12
+ </span>
@@ -0,0 +1,6 @@
1
+ import Stat from "./Stat.astro";
2
+ import StatDescription from "./StatDescription.astro";
3
+ import StatTitle from "./StatTitle.astro";
4
+ import StatValue from "./StatValue.astro";
5
+
6
+ export { Stat, StatDescription, StatTitle, StatValue };