@starwind-ui/core 1.11.2 → 1.12.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 (158) hide show
  1. package/package.json +1 -1
  2. package/dist/index.d.ts +0 -28
  3. package/dist/index.js +0 -74
  4. package/dist/index.js.map +0 -1
  5. package/dist/src/components/accordion/Accordion.astro +0 -247
  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 -273
  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 -51
  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 -53
  41. package/dist/src/components/button/index.ts +0 -7
  42. package/dist/src/components/card/Card.astro +0 -14
  43. package/dist/src/components/card/CardContent.astro +0 -14
  44. package/dist/src/components/card/CardDescription.astro +0 -14
  45. package/dist/src/components/card/CardFooter.astro +0 -14
  46. package/dist/src/components/card/CardHeader.astro +0 -14
  47. package/dist/src/components/card/CardTitle.astro +0 -14
  48. package/dist/src/components/card/index.ts +0 -26
  49. package/dist/src/components/carousel/Carousel.astro +0 -55
  50. package/dist/src/components/carousel/CarouselContent.astro +0 -26
  51. package/dist/src/components/carousel/CarouselItem.astro +0 -26
  52. package/dist/src/components/carousel/CarouselNext.astro +0 -37
  53. package/dist/src/components/carousel/CarouselPrevious.astro +0 -37
  54. package/dist/src/components/carousel/carousel-script.ts +0 -191
  55. package/dist/src/components/carousel/index.ts +0 -32
  56. package/dist/src/components/checkbox/Checkbox.astro +0 -127
  57. package/dist/src/components/checkbox/index.ts +0 -7
  58. package/dist/src/components/dialog/Dialog.astro +0 -263
  59. package/dist/src/components/dialog/DialogClose.astro +0 -35
  60. package/dist/src/components/dialog/DialogContent.astro +0 -67
  61. package/dist/src/components/dialog/DialogDescription.astro +0 -14
  62. package/dist/src/components/dialog/DialogFooter.astro +0 -14
  63. package/dist/src/components/dialog/DialogHeader.astro +0 -14
  64. package/dist/src/components/dialog/DialogTitle.astro +0 -20
  65. package/dist/src/components/dialog/DialogTrigger.astro +0 -47
  66. package/dist/src/components/dialog/index.ts +0 -45
  67. package/dist/src/components/dropdown/Dropdown.astro +0 -375
  68. package/dist/src/components/dropdown/DropdownContent.astro +0 -81
  69. package/dist/src/components/dropdown/DropdownItem.astro +0 -48
  70. package/dist/src/components/dropdown/DropdownLabel.astro +0 -29
  71. package/dist/src/components/dropdown/DropdownSeparator.astro +0 -21
  72. package/dist/src/components/dropdown/DropdownTrigger.astro +0 -52
  73. package/dist/src/components/dropdown/index.ts +0 -33
  74. package/dist/src/components/dropzone/Dropzone.astro +0 -233
  75. package/dist/src/components/dropzone/DropzoneFilesList.astro +0 -26
  76. package/dist/src/components/dropzone/DropzoneLoadingIndicator.astro +0 -10
  77. package/dist/src/components/dropzone/DropzoneUploadIndicator.astro +0 -10
  78. package/dist/src/components/dropzone/index.ts +0 -24
  79. package/dist/src/components/input/Input.astro +0 -24
  80. package/dist/src/components/input/index.ts +0 -7
  81. package/dist/src/components/item/Item.astro +0 -52
  82. package/dist/src/components/item/ItemActions.astro +0 -16
  83. package/dist/src/components/item/ItemContent.astro +0 -16
  84. package/dist/src/components/item/ItemDescription.astro +0 -19
  85. package/dist/src/components/item/ItemFooter.astro +0 -16
  86. package/dist/src/components/item/ItemGroup.astro +0 -16
  87. package/dist/src/components/item/ItemHeader.astro +0 -16
  88. package/dist/src/components/item/ItemMedia.astro +0 -40
  89. package/dist/src/components/item/ItemSeparator.astro +0 -21
  90. package/dist/src/components/item/ItemTitle.astro +0 -16
  91. package/dist/src/components/item/index.ts +0 -50
  92. package/dist/src/components/kbd/Kbd.astro +0 -21
  93. package/dist/src/components/kbd/KbdGroup.astro +0 -16
  94. package/dist/src/components/kbd/index.ts +0 -11
  95. package/dist/src/components/label/Label.astro +0 -22
  96. package/dist/src/components/label/index.ts +0 -7
  97. package/dist/src/components/pagination/Pagination.astro +0 -20
  98. package/dist/src/components/pagination/PaginationContent.astro +0 -16
  99. package/dist/src/components/pagination/PaginationEllipsis.astro +0 -25
  100. package/dist/src/components/pagination/PaginationItem.astro +0 -16
  101. package/dist/src/components/pagination/PaginationLink.astro +0 -24
  102. package/dist/src/components/pagination/PaginationNext.astro +0 -26
  103. package/dist/src/components/pagination/PaginationPrevious.astro +0 -26
  104. package/dist/src/components/pagination/index.ts +0 -38
  105. package/dist/src/components/progress/Progress.astro +0 -154
  106. package/dist/src/components/progress/index.ts +0 -10
  107. package/dist/src/components/radio-group/RadioGroup.astro +0 -157
  108. package/dist/src/components/radio-group/RadioGroupItem.astro +0 -129
  109. package/dist/src/components/radio-group/RadioGroupTypes.ts +0 -6
  110. package/dist/src/components/radio-group/index.ts +0 -23
  111. package/dist/src/components/select/Select.astro +0 -534
  112. package/dist/src/components/select/SelectContent.astro +0 -83
  113. package/dist/src/components/select/SelectGroup.astro +0 -9
  114. package/dist/src/components/select/SelectItem.astro +0 -49
  115. package/dist/src/components/select/SelectLabel.astro +0 -14
  116. package/dist/src/components/select/SelectSeparator.astro +0 -12
  117. package/dist/src/components/select/SelectTrigger.astro +0 -48
  118. package/dist/src/components/select/SelectTypes.ts +0 -13
  119. package/dist/src/components/select/SelectValue.astro +0 -19
  120. package/dist/src/components/select/index.ts +0 -45
  121. package/dist/src/components/separator/Separator.astro +0 -36
  122. package/dist/src/components/separator/index.ts +0 -7
  123. package/dist/src/components/sheet/Sheet.astro +0 -13
  124. package/dist/src/components/sheet/SheetClose.astro +0 -13
  125. package/dist/src/components/sheet/SheetContent.astro +0 -92
  126. package/dist/src/components/sheet/SheetDescription.astro +0 -16
  127. package/dist/src/components/sheet/SheetFooter.astro +0 -16
  128. package/dist/src/components/sheet/SheetHeader.astro +0 -16
  129. package/dist/src/components/sheet/SheetTitle.astro +0 -16
  130. package/dist/src/components/sheet/SheetTrigger.astro +0 -13
  131. package/dist/src/components/sheet/index.ts +0 -41
  132. package/dist/src/components/skeleton/Skeleton.astro +0 -14
  133. package/dist/src/components/skeleton/index.ts +0 -9
  134. package/dist/src/components/spinner/Spinner.astro +0 -21
  135. package/dist/src/components/spinner/index.ts +0 -7
  136. package/dist/src/components/switch/Switch.astro +0 -191
  137. package/dist/src/components/switch/SwitchTypes.ts +0 -6
  138. package/dist/src/components/switch/index.ts +0 -12
  139. package/dist/src/components/table/Table.astro +0 -18
  140. package/dist/src/components/table/TableBody.astro +0 -16
  141. package/dist/src/components/table/TableCaption.astro +0 -16
  142. package/dist/src/components/table/TableCell.astro +0 -16
  143. package/dist/src/components/table/TableFoot.astro +0 -16
  144. package/dist/src/components/table/TableHead.astro +0 -16
  145. package/dist/src/components/table/TableHeader.astro +0 -16
  146. package/dist/src/components/table/TableRow.astro +0 -16
  147. package/dist/src/components/table/index.ts +0 -42
  148. package/dist/src/components/tabs/Tabs.astro +0 -269
  149. package/dist/src/components/tabs/TabsContent.astro +0 -28
  150. package/dist/src/components/tabs/TabsList.astro +0 -22
  151. package/dist/src/components/tabs/TabsTrigger.astro +0 -34
  152. package/dist/src/components/tabs/index.ts +0 -20
  153. package/dist/src/components/textarea/Textarea.astro +0 -28
  154. package/dist/src/components/textarea/index.ts +0 -9
  155. package/dist/src/components/tooltip/Tooltip.astro +0 -237
  156. package/dist/src/components/tooltip/TooltipContent.astro +0 -114
  157. package/dist/src/components/tooltip/TooltipTrigger.astro +0 -10
  158. package/dist/src/components/tooltip/index.ts +0 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starwind-ui/core",
3
- "version": "1.11.2",
3
+ "version": "1.12.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,74 +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.2", dependencies: [] },
10
- { name: "alert", type: "component", version: "1.3.0", dependencies: [] },
11
- {
12
- name: "alert-dialog",
13
- type: "component",
14
- version: "1.0.1",
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.3.0", dependencies: [] },
20
- { name: "breadcrumb", type: "component", version: "1.1.1", dependencies: [] },
21
- { name: "button", type: "component", version: "2.2.0", dependencies: [] },
22
- { name: "card", type: "component", version: "1.3.0", dependencies: [] },
23
- {
24
- name: "carousel",
25
- type: "component",
26
- version: "1.0.1",
27
- dependencies: ["@starwind-ui/core/button@^2.1.0", "embla-carousel@^8.6.0"]
28
- },
29
- { name: "checkbox", type: "component", version: "1.4.0", dependencies: [] },
30
- { name: "dialog", type: "component", version: "1.4.1", dependencies: [] },
31
- { name: "dropdown", type: "component", version: "1.2.1", dependencies: [] },
32
- { name: "dropzone", type: "component", version: "1.2.0", dependencies: [] },
33
- { name: "input", type: "component", version: "1.3.0", dependencies: [] },
34
- {
35
- name: "item",
36
- type: "component",
37
- version: "1.0.0",
38
- dependencies: ["@starwind-ui/core/separator@^1.0.0"]
39
- },
40
- { name: "kbd", type: "component", version: "1.0.0", dependencies: [] },
41
- { name: "label", type: "component", version: "1.2.0", dependencies: [] },
42
- { name: "pagination", type: "component", version: "3.0.1", dependencies: [] },
43
- { name: "progress", type: "component", version: "1.1.0", dependencies: [] },
44
- { name: "radio-group", type: "component", version: "1.2.2", dependencies: [] },
45
- { name: "select", type: "component", version: "1.6.1", dependencies: [] },
46
- { name: "separator", type: "component", version: "1.0.0", dependencies: [] },
47
- {
48
- name: "sheet",
49
- type: "component",
50
- version: "1.1.1",
51
- dependencies: ["@starwind-ui/core/dialog@^1.3.0"]
52
- },
53
- { name: "skeleton", type: "component", version: "1.2.0", dependencies: [] },
54
- { name: "spinner", type: "component", version: "1.0.0", dependencies: [] },
55
- { name: "switch", type: "component", version: "1.3.0", dependencies: [] },
56
- { name: "table", type: "component", version: "1.1.0", dependencies: [] },
57
- { name: "tabs", type: "component", version: "1.4.0", dependencies: [] },
58
- { name: "textarea", type: "component", version: "1.3.0", dependencies: [] },
59
- { name: "tooltip", type: "component", version: "1.3.0", dependencies: [] }
60
- ]
61
- };
62
-
63
- // src/index.ts
64
- var __dirname = fileURLToPath(new URL(".", import.meta.url));
65
- var getComponentPath = (componentName, fileName) => {
66
- const componentsDir = __dirname.includes("dist") ? "src/components" : "src/components";
67
- return join(__dirname, componentsDir, componentName, fileName);
68
- };
69
- var registry = registry_default.components;
70
- export {
71
- getComponentPath,
72
- registry
73
- };
74
- //# 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.2\", \"dependencies\": [] },\n { \"name\": \"alert\", \"type\": \"component\", \"version\": \"1.3.0\", \"dependencies\": [] },\n {\n \"name\": \"alert-dialog\",\n \"type\": \"component\",\n \"version\": \"1.0.1\",\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.3.0\", \"dependencies\": [] },\n { \"name\": \"breadcrumb\", \"type\": \"component\", \"version\": \"1.1.1\", \"dependencies\": [] },\n { \"name\": \"button\", \"type\": \"component\", \"version\": \"2.2.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.0\", \"dependencies\": [] },\n { \"name\": \"dialog\", \"type\": \"component\", \"version\": \"1.4.1\", \"dependencies\": [] },\n { \"name\": \"dropdown\", \"type\": \"component\", \"version\": \"1.2.1\", \"dependencies\": [] },\n { \"name\": \"dropzone\", \"type\": \"component\", \"version\": \"1.2.0\", \"dependencies\": [] },\n { \"name\": \"input\", \"type\": \"component\", \"version\": \"1.3.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.1\", \"dependencies\": [] },\n { \"name\": \"progress\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n { \"name\": \"radio-group\", \"type\": \"component\", \"version\": \"1.2.2\", \"dependencies\": [] },\n { \"name\": \"select\", \"type\": \"component\", \"version\": \"1.6.1\", \"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 { \"name\": \"skeleton\", \"type\": \"component\", \"version\": \"1.2.0\", \"dependencies\": [] },\n { \"name\": \"spinner\", \"type\": \"component\", \"version\": \"1.0.0\", \"dependencies\": [] },\n { \"name\": \"switch\", \"type\": \"component\", \"version\": \"1.3.0\", \"dependencies\": [] },\n { \"name\": \"table\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n { \"name\": \"tabs\", \"type\": \"component\", \"version\": \"1.4.0\", \"dependencies\": [] },\n { \"name\": \"textarea\", \"type\": \"component\", \"version\": \"1.3.0\", \"dependencies\": [] },\n { \"name\": \"tooltip\", \"type\": \"component\", \"version\": \"1.3.0\", \"dependencies\": [] }\n ]\n}\n"],"mappings":";AAAA,SAAS,YAAY;AACrB,SAAS,qBAAqB;;;ACD9B;AAAA,EACE,SAAW;AAAA,EAC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AW,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,EACnF;AACF;;;ADjCA,IAAM,YAAY,cAAc,IAAI,IAAI,KAAK,YAAY,GAAG,CAAC;AAQtD,IAAM,mBAAmB,CAAC,eAAuB,aAA6B;AAGnF,QAAM,gBAAgB,UAAU,SAAS,MAAM,IAAI,mBAAmB;AACtE,SAAO,KAAK,WAAW,eAAe,eAAe,QAAQ;AAC/D;AAKO,IAAM,WAAW,iBAAkB;","names":[]}
@@ -1,247 +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
-
55
- /**
56
- * Creates a new AccordionHandler instance
57
- * @param accordion - The root accordion element
58
- * @param idx - Unique index for this accordion instance
59
- */
60
- constructor(accordion: HTMLElement, idx: number) {
61
- this.accordion = accordion;
62
- this.type = (accordion.dataset.type || "single") as AccordionType;
63
- this.accordionId = `starwind-accordion${idx}`;
64
-
65
- // Cache all items and create lookup maps
66
- this.items = this.initializeItems();
67
- this.itemsByValue = new Map(this.items.map((item) => [item.value, item]));
68
-
69
- this.setupItems();
70
- this.setInitialState();
71
- }
72
-
73
- /**
74
- * Initializes accordion items by querying the DOM and setting up data structures
75
- * @returns Array of AccordionItem objects
76
- */
77
- private initializeItems(): AccordionItem[] {
78
- return Array.from(this.accordion.querySelectorAll<HTMLElement>(".starwind-accordion-item"))
79
- .map((element, idx) => {
80
- const trigger = element.querySelector<HTMLElement>(".starwind-accordion-trigger");
81
- const content = element.querySelector<HTMLElement>(".starwind-accordion-content");
82
- const value = element.getAttribute("data-value") || String(idx);
83
-
84
- if (!trigger || !content) return null;
85
-
86
- return { element, trigger, content, value };
87
- })
88
- .filter((item): item is AccordionItem => item !== null);
89
- }
90
-
91
- /**
92
- * Sets up initial state and event listeners for all accordion items
93
- */
94
- private setupItems(): void {
95
- this.items.forEach((item, idx) => {
96
- this.setupAccessibility(item, idx);
97
- this.setContentHeight(item.content);
98
- this.setupEventListeners(item);
99
- });
100
- }
101
-
102
- /**
103
- * Sets up ARIA attributes and IDs for accessibility
104
- * @param item - The accordion item to setup
105
- * @param idx - Index of the item
106
- */
107
- private setupAccessibility(item: AccordionItem, idx: number): void {
108
- const triggerId = `${this.accordionId}-t${idx}`;
109
- const contentId = `${this.accordionId}-c${idx}`;
110
-
111
- item.trigger.id = triggerId;
112
- item.trigger.setAttribute("aria-controls", contentId);
113
- item.trigger.setAttribute("aria-expanded", "false");
114
-
115
- item.content.id = contentId;
116
- item.content.setAttribute("aria-labelledby", triggerId);
117
- item.content.setAttribute("role", "region");
118
- }
119
-
120
- /**
121
- * Calculates and sets the content height CSS variable for animations
122
- * @param content - The content element to measure
123
- */
124
- private setContentHeight(content: HTMLElement): void {
125
- const contentInner = content.firstElementChild as HTMLElement;
126
- if (contentInner) {
127
- const height = contentInner.getBoundingClientRect().height;
128
- content.style.setProperty("--starwind-accordion-content-height", `${height}px`);
129
- }
130
- }
131
-
132
- /**
133
- * Sets the initial state based on the default value attribute
134
- */
135
- private setInitialState(): void {
136
- const defaultValue = this.accordion.dataset.value;
137
- if (defaultValue) {
138
- const item = this.itemsByValue.get(defaultValue);
139
- if (item) {
140
- this.setItemState(item, true);
141
- }
142
- }
143
- }
144
-
145
- /**
146
- * Sets up click and keyboard event listeners for an accordion item
147
- * @param item - The accordion item to setup listeners for
148
- */
149
- private setupEventListeners(item: AccordionItem): void {
150
- item.trigger.addEventListener("click", () => this.handleClick(item));
151
- item.trigger.addEventListener("keydown", (e) => this.handleKeyDown(e, item));
152
- }
153
-
154
- /**
155
- * Handles click events on accordion triggers
156
- * @param item - The clicked accordion item
157
- */
158
- private handleClick(item: AccordionItem): void {
159
- const isOpen = item.element.getAttribute("data-state") === "open";
160
- this.toggleItem(item, !isOpen);
161
- }
162
-
163
- /**
164
- * Handles keyboard navigation events
165
- * @param event - The keyboard event
166
- * @param item - The current accordion item
167
- */
168
- private handleKeyDown(event: KeyboardEvent, item: AccordionItem): void {
169
- const index = this.items.indexOf(item);
170
-
171
- const keyActions: Record<string, () => void> = {
172
- ArrowDown: () => this.focusItem(index + 1),
173
- ArrowUp: () => this.focusItem(index - 1),
174
- Home: () => this.focusItem(0),
175
- End: () => this.focusItem(this.items.length - 1),
176
- };
177
-
178
- const action = keyActions[event.key];
179
- if (action) {
180
- event.preventDefault();
181
- action();
182
- }
183
- }
184
-
185
- /**
186
- * Focuses an accordion item by index with wrapping
187
- * @param index - The target index to focus
188
- */
189
- private focusItem(index: number): void {
190
- const targetIndex = (index + this.items.length) % this.items.length;
191
- this.items[targetIndex].trigger.focus();
192
- }
193
-
194
- /**
195
- * Toggles an accordion item's state
196
- * @param item - The item to toggle
197
- * @param shouldOpen - Whether the item should be opened
198
- */
199
- private toggleItem(item: AccordionItem, shouldOpen: boolean): void {
200
- if (this.type === "single" && shouldOpen) {
201
- // Close other items if in single mode
202
- this.items.forEach((otherItem) => {
203
- if (otherItem !== item && otherItem.element.getAttribute("data-state") === "open") {
204
- this.setItemState(otherItem, false);
205
- }
206
- });
207
- }
208
-
209
- this.setItemState(item, shouldOpen);
210
- }
211
-
212
- /**
213
- * Sets the state of an accordion item
214
- * @param item - The item to update
215
- * @param isOpen - Whether the item should be open
216
- */
217
- private setItemState(item: AccordionItem, isOpen: boolean): void {
218
- const state: AccordionState = isOpen ? "open" : "closed";
219
-
220
- if (isOpen) {
221
- item.content.style.removeProperty("animation");
222
- }
223
-
224
- // Set content height variable for animations
225
- this.setContentHeight(item.content);
226
-
227
- item.element.setAttribute("data-state", state);
228
- item.content.setAttribute("data-state", state);
229
- item.trigger.setAttribute("data-state", state);
230
- item.trigger.setAttribute("aria-expanded", isOpen.toString());
231
- }
232
- }
233
-
234
- // Store instances in a WeakMap to avoid memory leaks
235
- const accordionInstances = new WeakMap<HTMLElement, AccordionHandler>();
236
-
237
- const setupAccordions = () => {
238
- document.querySelectorAll<HTMLElement>(".starwind-accordion").forEach((accordion, idx) => {
239
- if (!accordionInstances.has(accordion)) {
240
- accordionInstances.set(accordion, new AccordionHandler(accordion, idx));
241
- }
242
- });
243
- };
244
-
245
- setupAccordions();
246
- document.addEventListener("astro:after-swap", setupAccordions);
247
- </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: "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
- };