@starwind-ui/core 1.15.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 (216) hide show
  1. package/package.json +1 -1
  2. package/dist/index.d.ts +0 -28
  3. package/dist/index.js +0 -108
  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 -55
  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 -55
  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/collapsible/Collapsible.astro +0 -161
  63. package/dist/src/components/collapsible/CollapsibleContent.astro +0 -22
  64. package/dist/src/components/collapsible/CollapsibleTrigger.astro +0 -44
  65. package/dist/src/components/collapsible/index.ts +0 -13
  66. package/dist/src/components/dialog/Dialog.astro +0 -389
  67. package/dist/src/components/dialog/DialogClose.astro +0 -35
  68. package/dist/src/components/dialog/DialogContent.astro +0 -78
  69. package/dist/src/components/dialog/DialogDescription.astro +0 -14
  70. package/dist/src/components/dialog/DialogFooter.astro +0 -14
  71. package/dist/src/components/dialog/DialogHeader.astro +0 -14
  72. package/dist/src/components/dialog/DialogTitle.astro +0 -22
  73. package/dist/src/components/dialog/DialogTrigger.astro +0 -47
  74. package/dist/src/components/dialog/index.ts +0 -45
  75. package/dist/src/components/dropdown/Dropdown.astro +0 -377
  76. package/dist/src/components/dropdown/DropdownContent.astro +0 -81
  77. package/dist/src/components/dropdown/DropdownItem.astro +0 -48
  78. package/dist/src/components/dropdown/DropdownLabel.astro +0 -29
  79. package/dist/src/components/dropdown/DropdownSeparator.astro +0 -21
  80. package/dist/src/components/dropdown/DropdownTrigger.astro +0 -52
  81. package/dist/src/components/dropdown/index.ts +0 -33
  82. package/dist/src/components/dropzone/Dropzone.astro +0 -236
  83. package/dist/src/components/dropzone/DropzoneFilesList.astro +0 -26
  84. package/dist/src/components/dropzone/DropzoneLoadingIndicator.astro +0 -10
  85. package/dist/src/components/dropzone/DropzoneUploadIndicator.astro +0 -10
  86. package/dist/src/components/dropzone/index.ts +0 -24
  87. package/dist/src/components/image/Image.astro +0 -24
  88. package/dist/src/components/image/index.ts +0 -9
  89. package/dist/src/components/input/Input.astro +0 -25
  90. package/dist/src/components/input/index.ts +0 -7
  91. package/dist/src/components/input-otp/InputOtp.astro +0 -319
  92. package/dist/src/components/input-otp/InputOtpGroup.astro +0 -16
  93. package/dist/src/components/input-otp/InputOtpSeparator.astro +0 -25
  94. package/dist/src/components/input-otp/InputOtpSlot.astro +0 -48
  95. package/dist/src/components/input-otp/InputOtpTypes.ts +0 -6
  96. package/dist/src/components/input-otp/index.ts +0 -33
  97. package/dist/src/components/item/Item.astro +0 -52
  98. package/dist/src/components/item/ItemActions.astro +0 -16
  99. package/dist/src/components/item/ItemContent.astro +0 -16
  100. package/dist/src/components/item/ItemDescription.astro +0 -19
  101. package/dist/src/components/item/ItemFooter.astro +0 -16
  102. package/dist/src/components/item/ItemGroup.astro +0 -16
  103. package/dist/src/components/item/ItemHeader.astro +0 -16
  104. package/dist/src/components/item/ItemMedia.astro +0 -40
  105. package/dist/src/components/item/ItemSeparator.astro +0 -21
  106. package/dist/src/components/item/ItemTitle.astro +0 -16
  107. package/dist/src/components/item/index.ts +0 -50
  108. package/dist/src/components/kbd/Kbd.astro +0 -21
  109. package/dist/src/components/kbd/KbdGroup.astro +0 -16
  110. package/dist/src/components/kbd/index.ts +0 -11
  111. package/dist/src/components/label/Label.astro +0 -22
  112. package/dist/src/components/label/index.ts +0 -7
  113. package/dist/src/components/pagination/Pagination.astro +0 -20
  114. package/dist/src/components/pagination/PaginationContent.astro +0 -16
  115. package/dist/src/components/pagination/PaginationEllipsis.astro +0 -35
  116. package/dist/src/components/pagination/PaginationItem.astro +0 -16
  117. package/dist/src/components/pagination/PaginationLink.astro +0 -24
  118. package/dist/src/components/pagination/PaginationNext.astro +0 -30
  119. package/dist/src/components/pagination/PaginationPrevious.astro +0 -30
  120. package/dist/src/components/pagination/index.ts +0 -38
  121. package/dist/src/components/progress/Progress.astro +0 -155
  122. package/dist/src/components/progress/index.ts +0 -10
  123. package/dist/src/components/prose/Prose.astro +0 -617
  124. package/dist/src/components/prose/index.ts +0 -9
  125. package/dist/src/components/radio-group/RadioGroup.astro +0 -162
  126. package/dist/src/components/radio-group/RadioGroupItem.astro +0 -129
  127. package/dist/src/components/radio-group/RadioGroupTypes.ts +0 -6
  128. package/dist/src/components/radio-group/index.ts +0 -23
  129. package/dist/src/components/select/Select.astro +0 -751
  130. package/dist/src/components/select/SelectContent.astro +0 -94
  131. package/dist/src/components/select/SelectGroup.astro +0 -9
  132. package/dist/src/components/select/SelectItem.astro +0 -51
  133. package/dist/src/components/select/SelectLabel.astro +0 -14
  134. package/dist/src/components/select/SelectSearch.astro +0 -49
  135. package/dist/src/components/select/SelectSeparator.astro +0 -12
  136. package/dist/src/components/select/SelectTrigger.astro +0 -54
  137. package/dist/src/components/select/SelectTypes.ts +0 -13
  138. package/dist/src/components/select/SelectValue.astro +0 -19
  139. package/dist/src/components/select/index.ts +0 -49
  140. package/dist/src/components/separator/Separator.astro +0 -36
  141. package/dist/src/components/separator/index.ts +0 -7
  142. package/dist/src/components/sheet/Sheet.astro +0 -13
  143. package/dist/src/components/sheet/SheetClose.astro +0 -13
  144. package/dist/src/components/sheet/SheetContent.astro +0 -92
  145. package/dist/src/components/sheet/SheetDescription.astro +0 -16
  146. package/dist/src/components/sheet/SheetFooter.astro +0 -16
  147. package/dist/src/components/sheet/SheetHeader.astro +0 -16
  148. package/dist/src/components/sheet/SheetTitle.astro +0 -16
  149. package/dist/src/components/sheet/SheetTrigger.astro +0 -13
  150. package/dist/src/components/sheet/index.ts +0 -41
  151. package/dist/src/components/sidebar/Sidebar.astro +0 -213
  152. package/dist/src/components/sidebar/SidebarContent.astro +0 -24
  153. package/dist/src/components/sidebar/SidebarFooter.astro +0 -21
  154. package/dist/src/components/sidebar/SidebarGroup.astro +0 -21
  155. package/dist/src/components/sidebar/SidebarGroupContent.astro +0 -21
  156. package/dist/src/components/sidebar/SidebarGroupLabel.astro +0 -52
  157. package/dist/src/components/sidebar/SidebarHeader.astro +0 -21
  158. package/dist/src/components/sidebar/SidebarInput.astro +0 -22
  159. package/dist/src/components/sidebar/SidebarInset.astro +0 -21
  160. package/dist/src/components/sidebar/SidebarMenu.astro +0 -21
  161. package/dist/src/components/sidebar/SidebarMenuAction.astro +0 -59
  162. package/dist/src/components/sidebar/SidebarMenuBadge.astro +0 -30
  163. package/dist/src/components/sidebar/SidebarMenuButton.astro +0 -129
  164. package/dist/src/components/sidebar/SidebarMenuItem.astro +0 -21
  165. package/dist/src/components/sidebar/SidebarMenuSkeleton.astro +0 -40
  166. package/dist/src/components/sidebar/SidebarMenuSub.astro +0 -24
  167. package/dist/src/components/sidebar/SidebarMenuSubButton.astro +0 -49
  168. package/dist/src/components/sidebar/SidebarMenuSubItem.astro +0 -16
  169. package/dist/src/components/sidebar/SidebarProvider.astro +0 -213
  170. package/dist/src/components/sidebar/SidebarRail.astro +0 -71
  171. package/dist/src/components/sidebar/SidebarSeparator.astro +0 -22
  172. package/dist/src/components/sidebar/SidebarTrigger.astro +0 -66
  173. package/dist/src/components/sidebar/index.ts +0 -103
  174. package/dist/src/components/skeleton/Skeleton.astro +0 -14
  175. package/dist/src/components/skeleton/index.ts +0 -9
  176. package/dist/src/components/slider/Slider.astro +0 -411
  177. package/dist/src/components/slider/index.ts +0 -9
  178. package/dist/src/components/spinner/Spinner.astro +0 -21
  179. package/dist/src/components/spinner/index.ts +0 -7
  180. package/dist/src/components/switch/Switch.astro +0 -192
  181. package/dist/src/components/switch/SwitchTypes.ts +0 -6
  182. package/dist/src/components/switch/index.ts +0 -12
  183. package/dist/src/components/table/Table.astro +0 -18
  184. package/dist/src/components/table/TableBody.astro +0 -16
  185. package/dist/src/components/table/TableCaption.astro +0 -16
  186. package/dist/src/components/table/TableCell.astro +0 -16
  187. package/dist/src/components/table/TableFoot.astro +0 -16
  188. package/dist/src/components/table/TableHead.astro +0 -16
  189. package/dist/src/components/table/TableHeader.astro +0 -16
  190. package/dist/src/components/table/TableRow.astro +0 -16
  191. package/dist/src/components/table/index.ts +0 -42
  192. package/dist/src/components/tabs/Tabs.astro +0 -271
  193. package/dist/src/components/tabs/TabsContent.astro +0 -28
  194. package/dist/src/components/tabs/TabsList.astro +0 -22
  195. package/dist/src/components/tabs/TabsTrigger.astro +0 -34
  196. package/dist/src/components/tabs/index.ts +0 -20
  197. package/dist/src/components/textarea/Textarea.astro +0 -29
  198. package/dist/src/components/textarea/index.ts +0 -9
  199. package/dist/src/components/theme-toggle/ThemeToggle.astro +0 -208
  200. package/dist/src/components/theme-toggle/index.ts +0 -7
  201. package/dist/src/components/toast/ToastDescription.astro +0 -21
  202. package/dist/src/components/toast/ToastItem.astro +0 -54
  203. package/dist/src/components/toast/ToastTemplate.astro +0 -25
  204. package/dist/src/components/toast/ToastTitle.astro +0 -57
  205. package/dist/src/components/toast/Toaster.astro +0 -982
  206. package/dist/src/components/toast/index.ts +0 -29
  207. package/dist/src/components/toast/toast-manager.ts +0 -216
  208. package/dist/src/components/toggle/Toggle.astro +0 -174
  209. package/dist/src/components/toggle/ToggleTypes.ts +0 -14
  210. package/dist/src/components/toggle/index.ts +0 -8
  211. package/dist/src/components/tooltip/Tooltip.astro +0 -282
  212. package/dist/src/components/tooltip/TooltipContent.astro +0 -89
  213. package/dist/src/components/tooltip/TooltipTrigger.astro +0 -10
  214. package/dist/src/components/tooltip/index.ts +0 -16
  215. package/dist/src/components/video/Video.astro +0 -120
  216. package/dist/src/components/video/index.ts +0 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starwind-ui/core",
3
- "version": "1.15.0",
3
+ "version": "1.15.1",
4
4
  "description": "Starwind UI core components and registry",
5
5
  "license": "MIT",
6
6
  "author": {
package/dist/index.d.ts DELETED
@@ -1,28 +0,0 @@
1
- /**
2
- * Component metadata interface describing a Starwind UI component
3
- */
4
- interface ComponentMeta {
5
- name: string;
6
- version: string;
7
- type: "component";
8
- dependencies: string[];
9
- }
10
- /**
11
- * Registry interface containing all available components
12
- */
13
- interface Registry {
14
- components: ComponentMeta[];
15
- }
16
- /**
17
- * Get the absolute path to a component file
18
- * @param {string} componentName - The name of the component
19
- * @param {string} fileName - The name of the file within the component
20
- * @returns {string} The absolute path to the component file
21
- */
22
- declare const getComponentPath: (componentName: string, fileName: string) => string;
23
- /**
24
- * Map of all components and their metadata from registry
25
- */
26
- declare const registry: ComponentMeta[];
27
-
28
- export { type ComponentMeta, type Registry, getComponentPath, registry };
package/dist/index.js DELETED
@@ -1,108 +0,0 @@
1
- // src/index.ts
2
- import { join } from "path";
3
- import { fileURLToPath } from "url";
4
-
5
- // src/registry.json
6
- var registry_default = {
7
- $schema: "https://starwind.dev/registry-schema.json",
8
- components: [
9
- { name: "accordion", type: "component", version: "1.3.3", dependencies: [] },
10
- { name: "alert", type: "component", version: "1.3.0", dependencies: [] },
11
- {
12
- name: "alert-dialog",
13
- type: "component",
14
- version: "1.0.3",
15
- dependencies: ["@starwind-ui/core/button@^2.1.0"]
16
- },
17
- { name: "aspect-ratio", type: "component", version: "1.0.0", dependencies: [] },
18
- { name: "avatar", type: "component", version: "1.2.1", dependencies: [] },
19
- { name: "badge", type: "component", version: "1.4.0", dependencies: [] },
20
- { name: "breadcrumb", type: "component", version: "1.1.1", dependencies: [] },
21
- {
22
- name: "button-group",
23
- type: "component",
24
- version: "1.0.0",
25
- dependencies: ["@starwind-ui/core/separator@^1.0.0"]
26
- },
27
- { name: "button", type: "component", version: "2.3.0", dependencies: [] },
28
- { name: "card", type: "component", version: "1.3.0", dependencies: [] },
29
- {
30
- name: "carousel",
31
- type: "component",
32
- version: "1.0.1",
33
- dependencies: ["@starwind-ui/core/button@^2.1.0", "embla-carousel@^8.6.0"]
34
- },
35
- { name: "checkbox", type: "component", version: "1.4.1", dependencies: [] },
36
- { name: "collapsible", type: "component", version: "1.0.0", dependencies: [] },
37
- { name: "dialog", type: "component", version: "1.4.3", dependencies: [] },
38
- { name: "dropdown", type: "component", version: "1.2.3", dependencies: [] },
39
- { name: "dropzone", type: "component", version: "1.2.2", dependencies: [] },
40
- { name: "image", type: "component", version: "1.0.0", dependencies: [] },
41
- { name: "input", type: "component", version: "1.3.1", dependencies: [] },
42
- { name: "input-otp", type: "component", version: "1.0.0", dependencies: [] },
43
- {
44
- name: "item",
45
- type: "component",
46
- version: "1.0.0",
47
- dependencies: ["@starwind-ui/core/separator@^1.0.0"]
48
- },
49
- { name: "kbd", type: "component", version: "1.0.0", dependencies: [] },
50
- { name: "label", type: "component", version: "1.2.0", dependencies: [] },
51
- { name: "pagination", type: "component", version: "3.0.2", dependencies: [] },
52
- { name: "progress", type: "component", version: "1.1.1", dependencies: [] },
53
- { name: "prose", type: "component", version: "1.0.0", dependencies: [] },
54
- { name: "radio-group", type: "component", version: "1.2.4", dependencies: [] },
55
- { name: "select", type: "component", version: "1.8.2", dependencies: [] },
56
- { name: "separator", type: "component", version: "1.0.0", dependencies: [] },
57
- {
58
- name: "sheet",
59
- type: "component",
60
- version: "1.1.1",
61
- dependencies: ["@starwind-ui/core/dialog@^1.3.0"]
62
- },
63
- {
64
- name: "sidebar",
65
- type: "component",
66
- version: "1.0.0",
67
- dependencies: [
68
- "@starwind-ui/core/button@^2.3.0",
69
- "@starwind-ui/core/dialog@^1.4.3",
70
- "@starwind-ui/core/input@^1.3.1",
71
- "@starwind-ui/core/separator@^1.0.0",
72
- "@starwind-ui/core/sheet@^1.1.1",
73
- "@starwind-ui/core/skeleton@^1.2.0",
74
- "@starwind-ui/core/tooltip@^1.4.0"
75
- ]
76
- },
77
- { name: "skeleton", type: "component", version: "1.2.0", dependencies: [] },
78
- { name: "slider", type: "component", version: "1.0.0", dependencies: [] },
79
- { name: "spinner", type: "component", version: "1.0.0", dependencies: [] },
80
- { name: "switch", type: "component", version: "1.3.1", dependencies: [] },
81
- { name: "table", type: "component", version: "1.1.0", dependencies: [] },
82
- { name: "tabs", type: "component", version: "1.4.1", dependencies: [] },
83
- { name: "textarea", type: "component", version: "1.3.1", dependencies: [] },
84
- {
85
- name: "theme-toggle",
86
- type: "component",
87
- version: "1.0.0",
88
- dependencies: ["@starwind-ui/core/toggle@^1.0.1"]
89
- },
90
- { name: "toast", type: "component", version: "1.0.0", dependencies: [] },
91
- { name: "toggle", type: "component", version: "1.0.1", dependencies: [] },
92
- { name: "tooltip", type: "component", version: "1.4.0", dependencies: [] },
93
- { name: "video", type: "component", version: "1.0.0", dependencies: [] }
94
- ]
95
- };
96
-
97
- // src/index.ts
98
- var __dirname = fileURLToPath(new URL(".", import.meta.url));
99
- var getComponentPath = (componentName, fileName) => {
100
- const componentsDir = __dirname.includes("dist") ? "src/components" : "src/components";
101
- return join(__dirname, componentsDir, componentName, fileName);
102
- };
103
- var registry = registry_default.components;
104
- export {
105
- getComponentPath,
106
- registry
107
- };
108
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts","../src/registry.json"],"sourcesContent":["import { join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport componentRegistry from \"./registry.json\" with { type: \"json\" };\n\n/**\n * Component metadata interface describing a Starwind UI component\n */\nexport interface ComponentMeta {\n name: string;\n version: string;\n type: \"component\";\n dependencies: string[];\n}\n\n/**\n * Registry interface containing all available components\n */\nexport interface Registry {\n components: ComponentMeta[];\n}\n\nconst __dirname = fileURLToPath(new URL(\".\", import.meta.url));\n\n/**\n * Get the absolute path to a component file\n * @param {string} componentName - The name of the component\n * @param {string} fileName - The name of the file within the component\n * @returns {string} The absolute path to the component file\n */\nexport const getComponentPath = (componentName: string, fileName: string): string => {\n // In production (when installed as a dependency), the components will be in dist/src/components\n // In development, they will be in src/components\n const componentsDir = __dirname.includes(\"dist\") ? \"src/components\" : \"src/components\";\n return join(__dirname, componentsDir, componentName, fileName);\n};\n\n/**\n * Map of all components and their metadata from registry\n */\nexport const registry = componentRegistry.components as ComponentMeta[];\n","{\n \"$schema\": \"https://starwind.dev/registry-schema.json\",\n \"components\": [\n { \"name\": \"accordion\", \"type\": \"component\", \"version\": \"1.3.3\", \"dependencies\": [] },\n { \"name\": \"alert\", \"type\": \"component\", \"version\": \"1.3.0\", \"dependencies\": [] },\n {\n \"name\": \"alert-dialog\",\n \"type\": \"component\",\n \"version\": \"1.0.3\",\n \"dependencies\": [\"@starwind-ui/core/button@^2.1.0\"]\n },\n { \"name\": \"aspect-ratio\", \"type\": \"component\", \"version\": \"1.0.0\", \"dependencies\": [] },\n { \"name\": \"avatar\", \"type\": \"component\", \"version\": \"1.2.1\", \"dependencies\": [] },\n { \"name\": \"badge\", \"type\": \"component\", \"version\": \"1.4.0\", \"dependencies\": [] },\n { \"name\": \"breadcrumb\", \"type\": \"component\", \"version\": \"1.1.1\", \"dependencies\": [] },\n {\n \"name\": \"button-group\",\n \"type\": \"component\",\n \"version\": \"1.0.0\",\n \"dependencies\": [\"@starwind-ui/core/separator@^1.0.0\"]\n },\n { \"name\": \"button\", \"type\": \"component\", \"version\": \"2.3.0\", \"dependencies\": [] },\n { \"name\": \"card\", \"type\": \"component\", \"version\": \"1.3.0\", \"dependencies\": [] },\n {\n \"name\": \"carousel\",\n \"type\": \"component\",\n \"version\": \"1.0.1\",\n \"dependencies\": [\"@starwind-ui/core/button@^2.1.0\", \"embla-carousel@^8.6.0\"]\n },\n { \"name\": \"checkbox\", \"type\": \"component\", \"version\": \"1.4.1\", \"dependencies\": [] },\n { \"name\": \"collapsible\", \"type\": \"component\", \"version\": \"1.0.0\", \"dependencies\": [] },\n { \"name\": \"dialog\", \"type\": \"component\", \"version\": \"1.4.3\", \"dependencies\": [] },\n { \"name\": \"dropdown\", \"type\": \"component\", \"version\": \"1.2.3\", \"dependencies\": [] },\n { \"name\": \"dropzone\", \"type\": \"component\", \"version\": \"1.2.2\", \"dependencies\": [] },\n { \"name\": \"image\", \"type\": \"component\", \"version\": \"1.0.0\", \"dependencies\": [] },\n { \"name\": \"input\", \"type\": \"component\", \"version\": \"1.3.1\", \"dependencies\": [] },\n { \"name\": \"input-otp\", \"type\": \"component\", \"version\": \"1.0.0\", \"dependencies\": [] },\n {\n \"name\": \"item\",\n \"type\": \"component\",\n \"version\": \"1.0.0\",\n \"dependencies\": [\"@starwind-ui/core/separator@^1.0.0\"]\n },\n { \"name\": \"kbd\", \"type\": \"component\", \"version\": \"1.0.0\", \"dependencies\": [] },\n { \"name\": \"label\", \"type\": \"component\", \"version\": \"1.2.0\", \"dependencies\": [] },\n { \"name\": \"pagination\", \"type\": \"component\", \"version\": \"3.0.2\", \"dependencies\": [] },\n { \"name\": \"progress\", \"type\": \"component\", \"version\": \"1.1.1\", \"dependencies\": [] },\n { \"name\": \"prose\", \"type\": \"component\", \"version\": \"1.0.0\", \"dependencies\": [] },\n { \"name\": \"radio-group\", \"type\": \"component\", \"version\": \"1.2.4\", \"dependencies\": [] },\n { \"name\": \"select\", \"type\": \"component\", \"version\": \"1.8.2\", \"dependencies\": [] },\n { \"name\": \"separator\", \"type\": \"component\", \"version\": \"1.0.0\", \"dependencies\": [] },\n {\n \"name\": \"sheet\",\n \"type\": \"component\",\n \"version\": \"1.1.1\",\n \"dependencies\": [\"@starwind-ui/core/dialog@^1.3.0\"]\n },\n {\n \"name\": \"sidebar\",\n \"type\": \"component\",\n \"version\": \"1.0.0\",\n \"dependencies\": [\n \"@starwind-ui/core/button@^2.3.0\",\n \"@starwind-ui/core/dialog@^1.4.3\",\n \"@starwind-ui/core/input@^1.3.1\",\n \"@starwind-ui/core/separator@^1.0.0\",\n \"@starwind-ui/core/sheet@^1.1.1\",\n \"@starwind-ui/core/skeleton@^1.2.0\",\n \"@starwind-ui/core/tooltip@^1.4.0\"\n ]\n },\n { \"name\": \"skeleton\", \"type\": \"component\", \"version\": \"1.2.0\", \"dependencies\": [] },\n { \"name\": \"slider\", \"type\": \"component\", \"version\": \"1.0.0\", \"dependencies\": [] },\n { \"name\": \"spinner\", \"type\": \"component\", \"version\": \"1.0.0\", \"dependencies\": [] },\n { \"name\": \"switch\", \"type\": \"component\", \"version\": \"1.3.1\", \"dependencies\": [] },\n { \"name\": \"table\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n { \"name\": \"tabs\", \"type\": \"component\", \"version\": \"1.4.1\", \"dependencies\": [] },\n { \"name\": \"textarea\", \"type\": \"component\", \"version\": \"1.3.1\", \"dependencies\": [] },\n {\n \"name\": \"theme-toggle\",\n \"type\": \"component\",\n \"version\": \"1.0.0\",\n \"dependencies\": [\"@starwind-ui/core/toggle@^1.0.1\"]\n },\n { \"name\": \"toast\", \"type\": \"component\", \"version\": \"1.0.0\", \"dependencies\": [] },\n { \"name\": \"toggle\", \"type\": \"component\", \"version\": \"1.0.1\", \"dependencies\": [] },\n { \"name\": \"tooltip\", \"type\": \"component\", \"version\": \"1.4.0\", \"dependencies\": [] },\n { \"name\": \"video\", \"type\": \"component\", \"version\": \"1.0.0\", \"dependencies\": [] }\n ]\n}\n"],"mappings":"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","names":[]}
@@ -1,254 +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 type of accordion. If "single", only one item can be open at a time.
8
- */
9
- type?: "single" | "multiple";
10
- /**
11
- * The value of the item that should be open by default
12
- */
13
- defaultValue?: string;
14
- };
15
-
16
- export const accordion = tv({ base: "starwind-accordion" });
17
-
18
- const { type = "single", defaultValue, class: className, ...rest } = Astro.props;
19
- ---
20
-
21
- <div
22
- class={accordion({ class: className })}
23
- data-type={type}
24
- data-value={defaultValue}
25
- data-slot="accordion"
26
- {...rest}
27
- >
28
- <slot />
29
- </div>
30
-
31
- <script>
32
- type AccordionType = "single" | "multiple";
33
- type AccordionState = "open" | "closed";
34
-
35
- /** Represents a single accordion item with its associated elements */
36
- interface AccordionItem {
37
- element: HTMLElement;
38
- trigger: HTMLElement;
39
- content: HTMLElement;
40
- value: string;
41
- }
42
-
43
- /**
44
- * Handles the functionality of an accordion component.
45
- * Supports single and multiple open items, keyboard navigation,
46
- * and maintains ARIA accessibility standards.
47
- */
48
- class AccordionHandler {
49
- private accordion: HTMLElement;
50
- private type: AccordionType;
51
- private items: AccordionItem[];
52
- private itemsByValue: Map<string, AccordionItem>;
53
- private accordionId: string;
54
- private isInitialized: boolean = false;
55
-
56
- /**
57
- * Creates a new AccordionHandler instance
58
- * @param accordion - The root accordion element
59
- * @param idx - Unique index for this accordion instance
60
- */
61
- constructor(accordion: HTMLElement, idx: number) {
62
- this.accordion = accordion;
63
- this.type = (accordion.dataset.type || "single") as AccordionType;
64
- this.accordionId = `starwind-accordion${idx}`;
65
-
66
- // Cache all items and create lookup maps
67
- this.items = this.initializeItems();
68
- this.itemsByValue = new Map(this.items.map((item) => [item.value, item]));
69
-
70
- this.setupItems();
71
- this.setInitialState();
72
- this.isInitialized = true;
73
- }
74
-
75
- /**
76
- * Initializes accordion items by querying the DOM and setting up data structures
77
- * @returns Array of AccordionItem objects
78
- */
79
- private initializeItems(): AccordionItem[] {
80
- return Array.from(this.accordion.querySelectorAll<HTMLElement>(".starwind-accordion-item"))
81
- .map((element, idx) => {
82
- const trigger = element.querySelector<HTMLElement>(".starwind-accordion-trigger");
83
- const content = element.querySelector<HTMLElement>(".starwind-accordion-content");
84
- const value = element.getAttribute("data-value") || String(idx);
85
-
86
- if (!trigger || !content) return null;
87
-
88
- return { element, trigger, content, value };
89
- })
90
- .filter((item): item is AccordionItem => item !== null);
91
- }
92
-
93
- /**
94
- * Sets up initial state and event listeners for all accordion items
95
- */
96
- private setupItems(): void {
97
- this.items.forEach((item, idx) => {
98
- this.setupAccessibility(item, idx);
99
- this.setContentHeight(item.content);
100
- this.setupEventListeners(item);
101
- });
102
- }
103
-
104
- /**
105
- * Sets up ARIA attributes and IDs for accessibility
106
- * @param item - The accordion item to setup
107
- * @param idx - Index of the item
108
- */
109
- private setupAccessibility(item: AccordionItem, idx: number): void {
110
- const triggerId = `${this.accordionId}-t${idx}`;
111
- const contentId = `${this.accordionId}-c${idx}`;
112
-
113
- item.trigger.id = triggerId;
114
- item.trigger.setAttribute("aria-controls", contentId);
115
- item.trigger.setAttribute("aria-expanded", "false");
116
-
117
- item.content.id = contentId;
118
- item.content.setAttribute("aria-labelledby", triggerId);
119
- item.content.setAttribute("role", "region");
120
- }
121
-
122
- /**
123
- * Calculates and sets the content height CSS variable for animations
124
- * @param content - The content element to measure
125
- */
126
- private setContentHeight(content: HTMLElement): void {
127
- const contentInner = content.firstElementChild as HTMLElement;
128
- if (contentInner) {
129
- const height = contentInner.getBoundingClientRect().height;
130
- content.style.setProperty("--starwind-accordion-content-height", `${height}px`);
131
- }
132
- }
133
-
134
- /**
135
- * Sets the initial state based on the default value attribute
136
- */
137
- private setInitialState(): void {
138
- const defaultValue = this.accordion.dataset.value;
139
- if (defaultValue) {
140
- const item = this.itemsByValue.get(defaultValue);
141
- if (item) {
142
- this.setItemState(item, true);
143
- }
144
- }
145
- }
146
-
147
- /**
148
- * Sets up click and keyboard event listeners for an accordion item
149
- * @param item - The accordion item to setup listeners for
150
- */
151
- private setupEventListeners(item: AccordionItem): void {
152
- item.trigger.addEventListener("click", () => this.handleClick(item));
153
- item.trigger.addEventListener("keydown", (e) => this.handleKeyDown(e, item));
154
- }
155
-
156
- /**
157
- * Handles click events on accordion triggers
158
- * @param item - The clicked accordion item
159
- */
160
- private handleClick(item: AccordionItem): void {
161
- const isOpen = item.element.getAttribute("data-state") === "open";
162
- this.toggleItem(item, !isOpen);
163
- }
164
-
165
- /**
166
- * Handles keyboard navigation events
167
- * @param event - The keyboard event
168
- * @param item - The current accordion item
169
- */
170
- private handleKeyDown(event: KeyboardEvent, item: AccordionItem): void {
171
- const index = this.items.indexOf(item);
172
-
173
- const keyActions: Record<string, () => void> = {
174
- ArrowDown: () => this.focusItem(index + 1),
175
- ArrowUp: () => this.focusItem(index - 1),
176
- Home: () => this.focusItem(0),
177
- End: () => this.focusItem(this.items.length - 1),
178
- };
179
-
180
- const action = keyActions[event.key];
181
- if (action) {
182
- event.preventDefault();
183
- action();
184
- }
185
- }
186
-
187
- /**
188
- * Focuses an accordion item by index with wrapping
189
- * @param index - The target index to focus
190
- */
191
- private focusItem(index: number): void {
192
- const targetIndex = (index + this.items.length) % this.items.length;
193
- this.items[targetIndex].trigger.focus();
194
- }
195
-
196
- /**
197
- * Toggles an accordion item's state
198
- * @param item - The item to toggle
199
- * @param shouldOpen - Whether the item should be opened
200
- */
201
- private toggleItem(item: AccordionItem, shouldOpen: boolean): void {
202
- if (this.type === "single" && shouldOpen) {
203
- // Close other items if in single mode
204
- this.items.forEach((otherItem) => {
205
- if (otherItem !== item && otherItem.element.getAttribute("data-state") === "open") {
206
- this.setItemState(otherItem, false);
207
- }
208
- });
209
- }
210
-
211
- this.setItemState(item, shouldOpen);
212
- }
213
-
214
- /**
215
- * Sets the state of an accordion item
216
- * @param item - The item to update
217
- * @param isOpen - Whether the item should be open
218
- */
219
- private setItemState(item: AccordionItem, isOpen: boolean): void {
220
- const state: AccordionState = isOpen ? "open" : "closed";
221
-
222
- // Skip animation during initial setup, enable for subsequent toggles
223
- if (!this.isInitialized) {
224
- item.content.style.setProperty("animation", "none");
225
- } else {
226
- item.content.style.removeProperty("animation");
227
- }
228
-
229
- // Set content height variable for animations
230
- this.setContentHeight(item.content);
231
-
232
- item.element.setAttribute("data-state", state);
233
- item.content.setAttribute("data-state", state);
234
- item.trigger.setAttribute("data-state", state);
235
- item.trigger.setAttribute("aria-expanded", isOpen.toString());
236
- }
237
- }
238
-
239
- // Store instances in a WeakMap to avoid memory leaks
240
- const accordionInstances = new WeakMap<HTMLElement, AccordionHandler>();
241
- let accordionCounter = 0;
242
-
243
- const setupAccordions = () => {
244
- document.querySelectorAll<HTMLElement>(".starwind-accordion").forEach((accordion) => {
245
- if (!accordionInstances.has(accordion)) {
246
- accordionInstances.set(accordion, new AccordionHandler(accordion, accordionCounter++));
247
- }
248
- });
249
- };
250
-
251
- setupAccordions();
252
- document.addEventListener("astro:after-swap", setupAccordions);
253
- document.addEventListener("starwind:init", setupAccordions);
254
- </script>
@@ -1,33 +0,0 @@
1
- ---
2
- /**
3
- * NOTE: style="animation: none;" makes it so the close animation doesn't run on page load
4
- * It is later removed in the Accordion.astro script
5
- */
6
- import type { HTMLAttributes } from "astro/types";
7
- import { tv } from "tailwind-variants";
8
-
9
- type Props = HTMLAttributes<"div">;
10
-
11
- export const accordionContent = tv({
12
- base: [
13
- "starwind-accordion-content",
14
- "transform-gpu overflow-hidden",
15
- "data-[state=closed]:animate-accordion-up data-[state=closed]:h-0",
16
- "data-[state=open]:animate-accordion-down",
17
- ],
18
- });
19
-
20
- const { class: className, ...rest } = Astro.props;
21
- ---
22
-
23
- <div
24
- class={accordionContent({ class: className })}
25
- data-state="closed"
26
- style="animation: none;"
27
- data-slot="accordion-content"
28
- {...rest}
29
- >
30
- <div class="pt-0 pb-4">
31
- <slot />
32
- </div>
33
- </div>
@@ -1,27 +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 value of the item
8
- */
9
- value: string;
10
- };
11
-
12
- export const accordionItem = tv({
13
- base: "starwind-accordion-item border-b last:border-b-0",
14
- });
15
-
16
- const { value, class: className, ...rest } = Astro.props;
17
- ---
18
-
19
- <div
20
- class={accordionItem({ class: className })}
21
- data-value={value}
22
- data-state="closed"
23
- data-slot="accordion-item"
24
- {...rest}
25
- >
26
- <slot />
27
- </div>
@@ -1,32 +0,0 @@
1
- ---
2
- import ChevronDown from "@tabler/icons/outline/chevron-down.svg";
3
- import type { HTMLAttributes } from "astro/types";
4
- import { tv } from "tailwind-variants";
5
-
6
- type Props = HTMLAttributes<"button">;
7
-
8
- export const accordionTrigger = tv({
9
- base: [
10
- "starwind-accordion-trigger",
11
- "flex w-full items-center justify-between gap-4 rounded-md py-4",
12
- "hover:text-muted-foreground text-left font-medium transition-all",
13
- "[&[data-state=open]>svg]:rotate-180",
14
- "focus-visible:border-outline focus-visible:ring-outline/50 outline-none focus-visible:ring-3",
15
- ],
16
- });
17
-
18
- const { class: className, ...rest } = Astro.props;
19
- ---
20
-
21
- <button
22
- type="button"
23
- class={accordionTrigger({ class: className })}
24
- data-slot="accordion-trigger"
25
- aria-expanded="false"
26
- {...rest}
27
- >
28
- <slot />
29
- <slot name="icon">
30
- <ChevronDown class="size-5 shrink-0 transition-transform duration-200" />
31
- </slot>
32
- </button>
@@ -1,15 +0,0 @@
1
- import Accordion, { accordion } from "./Accordion.astro";
2
- import AccordionContent, { accordionContent } from "./AccordionContent.astro";
3
- import AccordionItem, { accordionItem } from "./AccordionItem.astro";
4
- import AccordionTrigger, { accordionTrigger } from "./AccordionTrigger.astro";
5
-
6
- const AccordionVariants = { accordion, accordionContent, accordionItem, accordionTrigger };
7
-
8
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccordionVariants };
9
-
10
- export default {
11
- Root: Accordion,
12
- Content: AccordionContent,
13
- Item: AccordionItem,
14
- Trigger: AccordionTrigger,
15
- };
@@ -1,31 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv, type VariantProps } from "tailwind-variants";
4
-
5
- type Props = HTMLAttributes<"div"> & VariantProps<typeof alert>;
6
-
7
- export const alert = tv({
8
- base: "text-foreground relative w-full rounded-lg border p-4",
9
- variants: {
10
- variant: {
11
- default: "bg-background dark:bg-input/30 [&>h5>svg]:text-foreground",
12
- primary: "border-primary bg-primary/7 [&>h5>svg]:text-primary",
13
- secondary: "border-secondary bg-secondary/7 [&>h5>svg]:text-secondary",
14
- info: "border-info bg-info/7 [&>h5>svg]:text-info",
15
- success: "border-success bg-success/7 [&>h5>svg]:text-success",
16
- warning: "border-warning bg-warning/7 [&>h5>svg]:text-warning",
17
- error: "border-error bg-error/7 [&>h5>svg]:text-error",
18
- },
19
- },
20
- defaultVariants: { variant: "default" },
21
- });
22
-
23
- const { variant, class: className, ...rest } = Astro.props;
24
-
25
- const inferredRole =
26
- rest.role ?? (variant === "error" || variant === "warning" ? "alert" : "status");
27
- ---
28
-
29
- <div class={alert({ variant, class: className })} data-slot="alert" role={inferredRole} {...rest}>
30
- <slot />
31
- </div>
@@ -1,14 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- export const alertDescription = tv({ base: "leading-relaxed" });
6
-
7
- type Props = HTMLAttributes<"p">;
8
-
9
- const { class: className, ...rest } = Astro.props;
10
- ---
11
-
12
- <p class={alertDescription({ class: className })} data-slot="alert-description" {...rest}>
13
- <slot />
14
- </p>
@@ -1,16 +0,0 @@
1
- ---
2
- import type { HTMLAttributes } from "astro/types";
3
- import { tv } from "tailwind-variants";
4
-
5
- export const alertTitle = tv({
6
- base: "font-heading mb-2 flex items-center gap-2 text-lg leading-none font-medium tracking-tight",
7
- });
8
-
9
- type Props = HTMLAttributes<"h5">;
10
-
11
- const { class: className, ...rest } = Astro.props;
12
- ---
13
-
14
- <h5 class={alertTitle({ class: className })} data-slot="alert-title" {...rest}>
15
- <slot />
16
- </h5>
@@ -1,13 +0,0 @@
1
- import Alert, { alert } from "./Alert.astro";
2
- import AlertDescription, { alertDescription } from "./AlertDescription.astro";
3
- import AlertTitle, { alertTitle } from "./AlertTitle.astro";
4
-
5
- const AlertVariants = { alert, alertDescription, alertTitle };
6
-
7
- export { Alert, AlertDescription, AlertTitle, AlertVariants };
8
-
9
- export default {
10
- Root: Alert,
11
- Description: AlertDescription,
12
- Title: AlertTitle,
13
- };