@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,114 +0,0 @@
1
- ---
2
- import CaretUp from "@tabler/icons/filled/caret-up.svg";
3
- import type { HTMLAttributes } from "astro/types";
4
- import { tv } from "tailwind-variants";
5
-
6
- type Props = HTMLAttributes<"div"> & {
7
- /**
8
- * Side of the tooltip
9
- * @default top
10
- */
11
- side?: "top" | "right" | "bottom" | "left";
12
- /**
13
- * Alignment of the tooltip
14
- * @default center
15
- */
16
- align?: "start" | "center" | "end";
17
- /**
18
- * Offset distance in pixels
19
- * @default 8
20
- */
21
- sideOffset?: number;
22
- /**
23
- * Prevent the tooltip from colliding with other elements
24
- * @default true
25
- */
26
- avoidCollisions?: boolean;
27
- /**
28
- * Open and close animation duration in milliseconds
29
- * @default 150
30
- */
31
- animationDuration?: number;
32
- };
33
-
34
- export const tooltipContent = tv({
35
- base: [
36
- "starwind-tooltip-content",
37
- "absolute z-50 hidden w-fit px-3 py-1.5 will-change-transform",
38
- "bg-foreground text-background rounded-md",
39
- "animate-in fade-in zoom-in-95",
40
- "data-[state=closed]:animate-out data-[state=closed]:fill-mode-forwards fade-out zoom-out-95",
41
- ],
42
- variants: {
43
- side: {
44
- left: "slide-in-from-right-2 right-(--tooltip-offset)",
45
- right: "slide-in-from-left-2 left-(--tooltip-offset)",
46
- bottom: "slide-in-from-top-2 top-(--tooltip-offset)",
47
- top: "slide-in-from-bottom-2 bottom-(--tooltip-offset)",
48
- },
49
- align: { center: "", start: "", end: "" },
50
- sideAlign: {
51
- "top-center": "left-[50%] translate-x-[-50%]",
52
- "bottom-center": "left-[50%] translate-x-[-50%]",
53
- "left-center": "top-[50%] translate-y-[-50%]",
54
- "right-center": "top-[50%] translate-y-[-50%]",
55
- "top-start": "left-0",
56
- "bottom-start": "left-0",
57
- "top-end": "right-0",
58
- "bottom-end": "right-0",
59
- "left-start": "top-0",
60
- "right-start": "top-0",
61
- "left-end": "bottom-0",
62
- "right-end": "bottom-0",
63
- },
64
- },
65
- defaultVariants: { side: "top", align: "center" },
66
- compoundVariants: [
67
- { side: ["top", "bottom"], align: "center", class: "left-[50%] translate-x-[-50%]" },
68
- { side: ["left", "right"], align: "center", class: "top-[50%] translate-y-[-50%]" },
69
- { side: ["top", "bottom"], align: "start", class: "left-0" },
70
- { side: ["top", "bottom"], align: "end", class: "right-0" },
71
- { side: ["left", "right"], align: "start", class: "top-0" },
72
- { side: ["left", "right"], align: "end", class: "bottom-0" },
73
- ],
74
- });
75
-
76
- export const tooltipCaret = tv({
77
- base: ["text-foreground absolute z-50 size-4"],
78
- variants: {
79
- side: {
80
- top: "bottom-0 left-1/2 -translate-x-1/2 translate-y-[calc(50%+1px)] rotate-180",
81
- bottom: "top-0 left-1/2 -translate-x-1/2 -translate-y-[calc(50%+1px)]",
82
- left: "top-1/2 right-0 translate-x-[calc(50%+1px)] -translate-y-1/2 rotate-90",
83
- right: "top-1/2 left-0 -translate-x-[calc(50%+1px)] -translate-y-1/2 -rotate-90",
84
- },
85
- },
86
- defaultVariants: { side: "top" },
87
- });
88
-
89
- const {
90
- side = "top",
91
- align = "center",
92
- sideOffset = 8,
93
- avoidCollisions = true,
94
- animationDuration = 150,
95
- class: className,
96
- } = Astro.props;
97
- ---
98
-
99
- <div
100
- class={tooltipContent({ side, align, class: className })}
101
- data-slot="tooltip-content"
102
- data-state="closed"
103
- data-side={side}
104
- data-align={align}
105
- {...avoidCollisions && { "data-avoid-collisions": "" }}
106
- role="tooltip"
107
- style={{
108
- "--tooltip-offset": `calc(100% + ${sideOffset}px)`,
109
- animationDuration: `${animationDuration}ms`,
110
- }}
111
- >
112
- <slot> My tooltip! </slot>
113
- <CaretUp class={tooltipCaret({ side })} />
114
- </div>
@@ -1,10 +0,0 @@
1
- ---
2
- /**
3
- * This component is used to trigger the tooltip
4
- * All it does is require a slot
5
- */
6
-
7
- type Props = { children: any };
8
- ---
9
-
10
- <slot />
@@ -1,16 +0,0 @@
1
- import Tooltip, { tooltip } from "./Tooltip.astro";
2
- import TooltipContent, { tooltipContent } from "./TooltipContent.astro";
3
- import TooltipTrigger from "./TooltipTrigger.astro";
4
-
5
- const TooltipVariants = {
6
- tooltip,
7
- tooltipContent,
8
- };
9
-
10
- export { Tooltip, TooltipContent, TooltipTrigger, TooltipVariants };
11
-
12
- export default {
13
- Root: Tooltip,
14
- Trigger: TooltipTrigger,
15
- Content: TooltipContent,
16
- };
@@ -1,120 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- export const video = tv({
6
- base: "starwind-video aspect-video h-auto w-full",
7
- });
8
-
9
- type Props = HTMLAttributes<"video"> &
10
- HTMLAttributes<"iframe"> & {
11
- src: string;
12
- title?: string;
13
- autoplay?: boolean;
14
- muted?: boolean;
15
- loop?: boolean;
16
- controls?: boolean;
17
- poster?: string;
18
- };
19
-
20
- const {
21
- class: className,
22
- src,
23
- title = "Video",
24
- autoplay = false,
25
- muted = false,
26
- loop = false,
27
- controls = true,
28
- poster,
29
- ...rest
30
- } = Astro.props;
31
-
32
- /**
33
- * Detects the video type from the src URL
34
- */
35
- function getVideoType(url: string): "youtube" | "youtube-shorts" | "native" {
36
- if (url.includes("youtube.com/shorts/") || url.includes("youtu.be/shorts/")) {
37
- return "youtube-shorts";
38
- }
39
- if (
40
- url.includes("youtube.com") ||
41
- url.includes("youtu.be") ||
42
- url.includes("youtube-nocookie.com")
43
- ) {
44
- return "youtube";
45
- }
46
- return "native";
47
- }
48
-
49
- /**
50
- * Extracts YouTube video ID from various URL formats
51
- */
52
- function getYouTubeId(url: string): string | null {
53
- const patterns = [
54
- /youtube\.com\/shorts\/([^?&]+)/,
55
- /youtube\.com\/watch\?v=([^&]+)/,
56
- /youtube\.com\/embed\/([^?&]+)/,
57
- /youtu\.be\/([^?&]+)/,
58
- /youtube-nocookie\.com\/embed\/([^?&]+)/,
59
- ];
60
-
61
- for (const pattern of patterns) {
62
- const match = url.match(pattern);
63
- if (match) return match[1];
64
- }
65
- return null;
66
- }
67
-
68
- /**
69
- * Builds YouTube embed URL with parameters
70
- */
71
- function buildYouTubeEmbedUrl(videoId: string, isShort: boolean): string {
72
- const params = new URLSearchParams();
73
- if (autoplay) params.set("autoplay", "1");
74
- if (muted) params.set("mute", "1");
75
- if (loop) {
76
- params.set("loop", "1");
77
- params.set("playlist", videoId);
78
- }
79
- if (!controls) params.set("controls", "0");
80
-
81
- const baseUrl = `https://www.youtube-nocookie.com/embed/${videoId}`;
82
- const queryString = params.toString();
83
- return queryString ? `${baseUrl}?${queryString}` : baseUrl;
84
- }
85
-
86
- const videoType = getVideoType(src);
87
- const youtubeId = videoType !== "native" ? getYouTubeId(src) : null;
88
- const isShort = videoType === "youtube-shorts";
89
- const embedUrl = youtubeId ? buildYouTubeEmbedUrl(youtubeId, isShort) : null;
90
- ---
91
-
92
- {
93
- videoType === "native" || !embedUrl ? (
94
- <video
95
- class={video({ class: className })}
96
- src={src}
97
- autoplay={autoplay}
98
- muted={muted}
99
- loop={loop}
100
- controls={controls}
101
- poster={poster}
102
- data-slot="video"
103
- {...rest}
104
- >
105
- <track kind="captions" />
106
- </video>
107
- ) : (
108
- <iframe
109
- class={video({ class: className })}
110
- src={embedUrl}
111
- title={title}
112
- allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
113
- referrerpolicy="strict-origin-when-cross-origin"
114
- allowfullscreen
115
- data-slot="video"
116
- data-video-type={isShort ? "youtube-shorts" : "youtube"}
117
- {...rest}
118
- />
119
- )
120
- }
@@ -1,9 +0,0 @@
1
- import Video, { video } from "./Video.astro";
2
-
3
- const VideoVariants = {
4
- video,
5
- };
6
-
7
- export { Video, VideoVariants };
8
-
9
- export default Video;