@starwind-ui/core 1.1.0 → 1.3.0

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 (48) hide show
  1. package/dist/index.js +22 -99
  2. package/dist/index.js.map +1 -1
  3. package/dist/src/components/accordion/Accordion.astro +2 -9
  4. package/dist/src/components/alert/Alert.astro +2 -4
  5. package/dist/src/components/alert/AlertDescription.astro +1 -3
  6. package/dist/src/components/avatar/Avatar.astro +3 -10
  7. package/dist/src/components/avatar/AvatarImage.astro +7 -18
  8. package/dist/src/components/avatar/index.ts +1 -1
  9. package/dist/src/components/badge/Badge.astro +13 -60
  10. package/dist/src/components/button/Button.astro +1 -4
  11. package/dist/src/components/card/Card.astro +1 -3
  12. package/dist/src/components/card/CardContent.astro +1 -3
  13. package/dist/src/components/card/CardDescription.astro +1 -3
  14. package/dist/src/components/card/CardFooter.astro +1 -3
  15. package/dist/src/components/card/CardHeader.astro +1 -3
  16. package/dist/src/components/card/CardTitle.astro +1 -3
  17. package/dist/src/components/checkbox/Checkbox.astro +6 -24
  18. package/dist/src/components/dialog/DialogContent.astro +3 -12
  19. package/dist/src/components/dialog/DialogDescription.astro +1 -3
  20. package/dist/src/components/dialog/DialogFooter.astro +1 -3
  21. package/dist/src/components/dialog/DialogHeader.astro +1 -3
  22. package/dist/src/components/dialog/DialogTitle.astro +1 -3
  23. package/dist/src/components/input/Input.astro +4 -12
  24. package/dist/src/components/label/Label.astro +3 -13
  25. package/dist/src/components/pagination/Pagination.astro +3 -12
  26. package/dist/src/components/pagination/PaginationContent.astro +2 -6
  27. package/dist/src/components/pagination/PaginationEllipsis.astro +3 -7
  28. package/dist/src/components/pagination/PaginationItem.astro +2 -6
  29. package/dist/src/components/pagination/PaginationLink.astro +1 -4
  30. package/dist/src/components/pagination/PaginationNext.astro +4 -8
  31. package/dist/src/components/pagination/PaginationPrevious.astro +4 -8
  32. package/dist/src/components/select/Select.astro +4 -12
  33. package/dist/src/components/select/SelectContent.astro +3 -4
  34. package/dist/src/components/select/SelectGroup.astro +1 -3
  35. package/dist/src/components/select/SelectItem.astro +1 -3
  36. package/dist/src/components/select/SelectLabel.astro +1 -3
  37. package/dist/src/components/select/SelectSeparator.astro +1 -3
  38. package/dist/src/components/select/SelectTrigger.astro +1 -1
  39. package/dist/src/components/select/SelectValue.astro +1 -3
  40. package/dist/src/components/switch/Switch.astro +6 -27
  41. package/dist/src/components/tabs/Tabs.astro +2 -6
  42. package/dist/src/components/tabs/TabsContent.astro +1 -3
  43. package/dist/src/components/tabs/TabsList.astro +1 -6
  44. package/dist/src/components/textarea/Textarea.astro +2 -6
  45. package/dist/src/components/tooltip/Tooltip.astro +1 -3
  46. package/dist/src/components/tooltip/TooltipContent.astro +8 -39
  47. package/dist/src/components/tooltip/TooltipTrigger.astro +1 -3
  48. package/package.json +1 -2
package/dist/index.js CHANGED
@@ -3,104 +3,27 @@ import { join } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
 
5
5
  // src/registry.json
6
- var registry_default = [
7
- {
8
- name: "accordion",
9
- type: "component",
10
- version: "1.1.0",
11
- dependencies: []
12
- },
13
- {
14
- name: "alert",
15
- type: "component",
16
- version: "1.1.0",
17
- dependencies: []
18
- },
19
- {
20
- name: "avatar",
21
- type: "component",
22
- version: "1.1.0",
23
- dependencies: []
24
- },
25
- {
26
- name: "badge",
27
- type: "component",
28
- version: "1.1.0",
29
- dependencies: []
30
- },
31
- {
32
- name: "button",
33
- type: "component",
34
- version: "2.0.0",
35
- dependencies: []
36
- },
37
- {
38
- name: "card",
39
- type: "component",
40
- version: "1.1.0",
41
- dependencies: []
42
- },
43
- {
44
- name: "checkbox",
45
- type: "component",
46
- version: "1.1.0",
47
- dependencies: []
48
- },
49
- {
50
- name: "dialog",
51
- type: "component",
52
- version: "1.1.0",
53
- dependencies: []
54
- },
55
- {
56
- name: "input",
57
- type: "component",
58
- version: "1.1.0",
59
- dependencies: []
60
- },
61
- {
62
- name: "label",
63
- type: "component",
64
- version: "1.1.0",
65
- dependencies: []
66
- },
67
- {
68
- name: "pagination",
69
- type: "component",
70
- version: "2.0.0",
71
- dependencies: []
72
- },
73
- {
74
- name: "select",
75
- type: "component",
76
- version: "1.1.0",
77
- dependencies: []
78
- },
79
- {
80
- name: "switch",
81
- type: "component",
82
- version: "1.1.0",
83
- dependencies: []
84
- },
85
- {
86
- name: "tabs",
87
- type: "component",
88
- version: "1.1.0",
89
- dependencies: []
90
- },
91
- {
92
- name: "textarea",
93
- type: "component",
94
- version: "1.1.0",
95
- dependencies: []
96
- },
97
- {
98
- name: "tooltip",
99
- type: "component",
100
- version: "1.1.0",
101
- dependencies: []
102
- }
103
- ];
6
+ var registry_default = {
7
+ $schema: "https://starwind.dev/registry-schema.json",
8
+ components: [
9
+ { name: "accordion", type: "component", version: "1.1.0", dependencies: [] },
10
+ { name: "alert", type: "component", version: "1.1.0", dependencies: [] },
11
+ { name: "avatar", type: "component", version: "1.1.0", dependencies: [] },
12
+ { name: "badge", type: "component", version: "1.1.0", dependencies: [] },
13
+ { name: "button", type: "component", version: "2.0.0", dependencies: [] },
14
+ { name: "card", type: "component", version: "1.1.0", dependencies: [] },
15
+ { name: "checkbox", type: "component", version: "1.1.0", dependencies: [] },
16
+ { name: "dialog", type: "component", version: "1.1.0", dependencies: [] },
17
+ { name: "input", type: "component", version: "1.1.0", dependencies: [] },
18
+ { name: "label", type: "component", version: "1.1.0", dependencies: [] },
19
+ { name: "pagination", type: "component", version: "2.0.0", dependencies: [] },
20
+ { name: "select", type: "component", version: "1.1.0", dependencies: [] },
21
+ { name: "switch", type: "component", version: "1.1.0", dependencies: [] },
22
+ { name: "tabs", type: "component", version: "1.1.0", dependencies: [] },
23
+ { name: "textarea", type: "component", version: "1.1.0", dependencies: [] },
24
+ { name: "tooltip", type: "component", version: "1.1.0", dependencies: [] }
25
+ ]
26
+ };
104
27
 
105
28
  // src/index.ts
106
29
  var __dirname = fileURLToPath(new URL(".", import.meta.url));
@@ -108,7 +31,7 @@ var getComponentPath = (componentName, fileName) => {
108
31
  const componentsDir = __dirname.includes("dist") ? "src/components" : "src/components";
109
32
  return join(__dirname, componentsDir, componentName, fileName);
110
33
  };
111
- var registry = registry_default;
34
+ var registry = registry_default.components;
112
35
  export {
113
36
  getComponentPath,
114
37
  registry
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/registry.json"],"sourcesContent":["import { join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport componentRegistry from \"./registry.json\" assert { type: \"json\" };\n\n/**\n * Component metadata interface describing a Starwind UI component\n */\nexport interface ComponentMeta {\n\tname: string;\n\tversion: string;\n\ttype: \"component\";\n\tdependencies: string[];\n}\n\n/**\n * Registry interface containing all available components\n */\nexport interface Registry {\n\tcomponents: 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\t// In production (when installed as a dependency), the components will be in dist/src/components\n\t// In development, they will be in src/components\n\tconst componentsDir = __dirname.includes(\"dist\") ? \"src/components\" : \"src/components\";\n\treturn join(__dirname, componentsDir, componentName, fileName);\n};\n\n/**\n * Map of all components and their metadata from registry\n */\nexport const registry = componentRegistry as ComponentMeta[];\n","[\n\t{\n\t\t\"name\": \"accordion\",\n\t\t\"type\": \"component\",\n\t\t\"version\": \"1.1.0\",\n\t\t\"dependencies\": []\n\t},\n\t{\n\t\t\"name\": \"alert\",\n\t\t\"type\": \"component\",\n\t\t\"version\": \"1.1.0\",\n\t\t\"dependencies\": []\n\t},\n\t{\n\t\t\"name\": \"avatar\",\n\t\t\"type\": \"component\",\n\t\t\"version\": \"1.1.0\",\n\t\t\"dependencies\": []\n\t},\n\t{\n\t\t\"name\": \"badge\",\n\t\t\"type\": \"component\",\n\t\t\"version\": \"1.1.0\",\n\t\t\"dependencies\": []\n\t},\n\t{\n\t\t\"name\": \"button\",\n\t\t\"type\": \"component\",\n\t\t\"version\": \"2.0.0\",\n\t\t\"dependencies\": []\n\t},\n\t{\n\t\t\"name\": \"card\",\n\t\t\"type\": \"component\",\n\t\t\"version\": \"1.1.0\",\n\t\t\"dependencies\": []\n\t},\n\t{\n\t\t\"name\": \"checkbox\",\n\t\t\"type\": \"component\",\n\t\t\"version\": \"1.1.0\",\n\t\t\"dependencies\": []\n\t},\n\t{\n\t\t\"name\": \"dialog\",\n\t\t\"type\": \"component\",\n\t\t\"version\": \"1.1.0\",\n\t\t\"dependencies\": []\n\t},\n\t{\n\t\t\"name\": \"input\",\n\t\t\"type\": \"component\",\n\t\t\"version\": \"1.1.0\",\n\t\t\"dependencies\": []\n\t},\n\t{\n\t\t\"name\": \"label\",\n\t\t\"type\": \"component\",\n\t\t\"version\": \"1.1.0\",\n\t\t\"dependencies\": []\n\t},\n\t{\n\t\t\"name\": \"pagination\",\n\t\t\"type\": \"component\",\n\t\t\"version\": \"2.0.0\",\n\t\t\"dependencies\": []\n\t},\n\t{\n\t\t\"name\": \"select\",\n\t\t\"type\": \"component\",\n\t\t\"version\": \"1.1.0\",\n\t\t\"dependencies\": []\n\t},\n\t{\n\t\t\"name\": \"switch\",\n\t\t\"type\": \"component\",\n\t\t\"version\": \"1.1.0\",\n\t\t\"dependencies\": []\n\t},\n\t{\n\t\t\"name\": \"tabs\",\n\t\t\"type\": \"component\",\n\t\t\"version\": \"1.1.0\",\n\t\t\"dependencies\": []\n\t},\n\t{\n\t\t\"name\": \"textarea\",\n\t\t\"type\": \"component\",\n\t\t\"version\": \"1.1.0\",\n\t\t\"dependencies\": []\n\t},\n\t{\n\t\t\"name\": \"tooltip\",\n\t\t\"type\": \"component\",\n\t\t\"version\": \"1.1.0\",\n\t\t\"dependencies\": []\n\t}\n]\n"],"mappings":";AAAA,SAAS,YAAY;AACrB,SAAS,qBAAqB;;;ACD9B;AAAA,EACC;AAAA,IACC,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,SAAW;AAAA,IACX,cAAgB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,IACC,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,SAAW;AAAA,IACX,cAAgB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,IACC,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,SAAW;AAAA,IACX,cAAgB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,IACC,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,SAAW;AAAA,IACX,cAAgB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,IACC,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,SAAW;AAAA,IACX,cAAgB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,IACC,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,SAAW;AAAA,IACX,cAAgB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,IACC,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,SAAW;AAAA,IACX,cAAgB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,IACC,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,SAAW;AAAA,IACX,cAAgB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,IACC,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,SAAW;AAAA,IACX,cAAgB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,IACC,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,SAAW;AAAA,IACX,cAAgB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,IACC,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,SAAW;AAAA,IACX,cAAgB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,IACC,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,SAAW;AAAA,IACX,cAAgB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,IACC,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,SAAW;AAAA,IACX,cAAgB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,IACC,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,SAAW;AAAA,IACX,cAAgB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,IACC,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,SAAW;AAAA,IACX,cAAgB,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,IACC,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,SAAW;AAAA,IACX,cAAgB,CAAC;AAAA,EAClB;AACD;;;AD5EA,IAAM,YAAY,cAAc,IAAI,IAAI,KAAK,YAAY,GAAG,CAAC;AAQtD,IAAM,mBAAmB,CAAC,eAAuB,aAA6B;AAGpF,QAAM,gBAAgB,UAAU,SAAS,MAAM,IAAI,mBAAmB;AACtE,SAAO,KAAK,WAAW,eAAe,eAAe,QAAQ;AAC9D;AAKO,IAAM,WAAW;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/registry.json"],"sourcesContent":["import { join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport componentRegistry from \"./registry.json\" with { type: \"json\" };\n\n/**\n * Component metadata interface describing a Starwind UI component\n */\nexport interface ComponentMeta {\n\tname: string;\n\tversion: string;\n\ttype: \"component\";\n\tdependencies: string[];\n}\n\n/**\n * Registry interface containing all available components\n */\nexport interface Registry {\n\tcomponents: 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\t// In production (when installed as a dependency), the components will be in dist/src/components\n\t// In development, they will be in src/components\n\tconst componentsDir = __dirname.includes(\"dist\") ? \"src/components\" : \"src/components\";\n\treturn 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\t\"$schema\": \"https://starwind.dev/registry-schema.json\",\n\t\"components\": [\n\t\t{ \"name\": \"accordion\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n\t\t{ \"name\": \"alert\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n\t\t{ \"name\": \"avatar\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n\t\t{ \"name\": \"badge\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n\t\t{ \"name\": \"button\", \"type\": \"component\", \"version\": \"2.0.0\", \"dependencies\": [] },\n\t\t{ \"name\": \"card\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n\t\t{ \"name\": \"checkbox\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n\t\t{ \"name\": \"dialog\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n\t\t{ \"name\": \"input\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n\t\t{ \"name\": \"label\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n\t\t{ \"name\": \"pagination\", \"type\": \"component\", \"version\": \"2.0.0\", \"dependencies\": [] },\n\t\t{ \"name\": \"select\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n\t\t{ \"name\": \"switch\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n\t\t{ \"name\": \"tabs\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n\t\t{ \"name\": \"textarea\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] },\n\t\t{ \"name\": \"tooltip\", \"type\": \"component\", \"version\": \"1.1.0\", \"dependencies\": [] }\n\t]\n}\n"],"mappings":";AAAA,SAAS,YAAY;AACrB,SAAS,qBAAqB;;;ACD9B;AAAA,EACC,SAAW;AAAA,EACX,YAAc;AAAA,IACb,EAAE,MAAQ,aAAa,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,IACnF,EAAE,MAAQ,SAAS,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,IAC/E,EAAE,MAAQ,UAAU,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,IAChF,EAAE,MAAQ,SAAS,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,IAC/E,EAAE,MAAQ,UAAU,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,IAChF,EAAE,MAAQ,QAAQ,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,IAC9E,EAAE,MAAQ,YAAY,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,IAClF,EAAE,MAAQ,UAAU,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,IAChF,EAAE,MAAQ,SAAS,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,IAC/E,EAAE,MAAQ,SAAS,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,IAC/E,EAAE,MAAQ,cAAc,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,IACpF,EAAE,MAAQ,UAAU,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,IAChF,EAAE,MAAQ,UAAU,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,IAChF,EAAE,MAAQ,QAAQ,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,IAC9E,EAAE,MAAQ,YAAY,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,IAClF,EAAE,MAAQ,WAAW,MAAQ,aAAa,SAAW,SAAS,cAAgB,CAAC,EAAE;AAAA,EAClF;AACD;;;ADCA,IAAM,YAAY,cAAc,IAAI,IAAI,KAAK,YAAY,GAAG,CAAC;AAQtD,IAAM,mBAAmB,CAAC,eAAuB,aAA6B;AAGpF,QAAM,gBAAgB,UAAU,SAAS,MAAM,IAAI,mBAAmB;AACtE,SAAO,KAAK,WAAW,eAAe,eAAe,QAAQ;AAC9D;AAKO,IAAM,WAAW,iBAAkB;","names":[]}
@@ -13,9 +13,7 @@ type Props = HTMLAttributes<"div"> & {
13
13
  defaultValue?: string;
14
14
  };
15
15
 
16
- const accordion = tv({
17
- base: "starwind-accordion",
18
- });
16
+ const accordion = tv({ base: "starwind-accordion" });
19
17
 
20
18
  const { type = "single", defaultValue, class: className, ...rest } = Astro.props;
21
19
  ---
@@ -79,12 +77,7 @@ const { type = "single", defaultValue, class: className, ...rest } = Astro.props
79
77
 
80
78
  if (!trigger || !content) return null;
81
79
 
82
- return {
83
- element,
84
- trigger,
85
- content,
86
- value,
87
- };
80
+ return { element, trigger, content, value };
88
81
  })
89
82
  .filter((item): item is AccordionItem => item !== null);
90
83
  }
@@ -13,11 +13,9 @@ const alert = tv({
13
13
  success: "border-success bg-success/7 [&>h5>svg]:text-success",
14
14
  warning: "border-warning bg-warning/7 [&>h5>svg]:text-warning",
15
15
  error: "border-error bg-error/7 [&>h5>svg]:text-error",
16
- }
16
+ },
17
17
  },
18
- defaultVariants: {
19
- variant: "default"
20
- }
18
+ defaultVariants: { variant: "default" },
21
19
  });
22
20
 
23
21
  type Props = HTMLAttributes<"div"> & {
@@ -2,9 +2,7 @@
2
2
  import type { HTMLAttributes } from "astro/types";
3
3
  import { tv } from "tailwind-variants";
4
4
 
5
- const alertDescription = tv({
6
- base: "[&_p]:leading-relaxed",
7
- });
5
+ const alertDescription = tv({ base: "[&_p]:leading-relaxed" });
8
6
 
9
7
  type Props = HTMLAttributes<"div">;
10
8
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  import type { HTMLAttributes } from "astro/types";
3
- import { tv, type VariantProps } from "tailwind-variants";
3
+ import { tv } from "tailwind-variants";
4
4
 
5
5
  interface Props extends HTMLAttributes<"div"> {
6
6
  /**
@@ -27,16 +27,9 @@ const avatar = tv({
27
27
  warning: "border-warning",
28
28
  error: "border-error",
29
29
  },
30
- size: {
31
- sm: "h-8 w-8 text-xs",
32
- md: "h-10 w-10 text-sm",
33
- lg: "h-12 w-12 text-base",
34
- },
35
- },
36
- defaultVariants: {
37
- variant: "default",
38
- size: "md",
30
+ size: { sm: "h-8 w-8 text-xs", md: "h-10 w-10 text-sm", lg: "h-12 w-12 text-base" },
39
31
  },
32
+ defaultVariants: { variant: "default", size: "md" },
40
33
  });
41
34
 
42
35
  const { variant, size, class: className, ...rest } = Astro.props;
@@ -2,24 +2,13 @@
2
2
  import { Image } from "astro:assets";
3
3
  import { tv } from "tailwind-variants";
4
4
 
5
- const avatarImage = tv({
6
- base: "relative z-1 h-full w-full object-cover",
7
- });
8
-
9
- type BaseProps = {
10
- alt: string;
11
- class?: string;
12
- };
13
-
14
- type WithSrc = BaseProps & {
15
- src: string;
16
- image?: never;
17
- };
18
-
19
- type WithImage = BaseProps & {
20
- src?: never;
21
- image: ImageMetadata;
22
- };
5
+ const avatarImage = tv({ base: "relative z-1 h-full w-full object-cover" });
6
+
7
+ type BaseProps = { alt: string; class?: string };
8
+
9
+ type WithSrc = BaseProps & { src: string; image?: never };
10
+
11
+ type WithImage = BaseProps & { src?: never; image: ImageMetadata };
23
12
 
24
13
  type Props = WithSrc | WithImage;
25
14
 
@@ -1,6 +1,6 @@
1
1
  import Avatar from "./Avatar.astro";
2
- import AvatarImage from "./AvatarImage.astro";
3
2
  import AvatarFallback from "./AvatarFallback.astro";
3
+ import AvatarImage from "./AvatarImage.astro";
4
4
 
5
5
  export { Avatar, AvatarImage, AvatarFallback };
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  import type { HTMLAttributes } from "astro/types";
3
- import { tv, type VariantProps } from "tailwind-variants";
3
+ import { tv } from "tailwind-variants";
4
4
 
5
5
  interface Props extends HTMLAttributes<"div">, Omit<HTMLAttributes<"a">, "type"> {
6
6
  /**
@@ -42,68 +42,21 @@ const badgeVariants = tv({
42
42
  warning: "bg-warning text-warning-foreground focus-visible:outline-warning",
43
43
  error: "bg-error text-error-foreground focus-visible:outline-error",
44
44
  },
45
- size: {
46
- sm: "px-2.5 py-0.5 text-xs",
47
- md: "px-3 py-0.5 text-sm",
48
- lg: "px-4 py-1 text-base",
49
- },
50
- isLink: {
51
- true: "cursor-pointer",
52
- false: "",
53
- },
45
+ size: { sm: "px-2.5 py-0.5 text-xs", md: "px-3 py-0.5 text-sm", lg: "px-4 py-1 text-base" },
46
+ isLink: { true: "cursor-pointer", false: "" },
54
47
  },
55
48
  compoundVariants: [
56
- {
57
- isLink: true,
58
- variant: "default",
59
- className: "hover:bg-foreground/80",
60
- },
61
- {
62
- isLink: true,
63
- variant: "primary",
64
- className: "hover:bg-primary/80",
65
- },
66
- {
67
- isLink: true,
68
- variant: "secondary",
69
- className: "hover:bg-secondary/80",
70
- },
71
- {
72
- isLink: true,
73
- variant: "outline",
74
- className: "hover:border-border/80",
75
- },
76
- {
77
- isLink: true,
78
- variant: "ghost",
79
- className: "hover:bg-foreground/7",
80
- },
81
- {
82
- isLink: true,
83
- variant: "info",
84
- className: "hover:bg-info/80",
85
- },
86
- {
87
- isLink: true,
88
- variant: "success",
89
- className: "hover:bg-success/80",
90
- },
91
- {
92
- isLink: true,
93
- variant: "warning",
94
- className: "hover:bg-warning/80",
95
- },
96
- {
97
- isLink: true,
98
- variant: "error",
99
- className: "hover:bg-error/80",
100
- },
49
+ { isLink: true, variant: "default", className: "hover:bg-foreground/80" },
50
+ { isLink: true, variant: "primary", className: "hover:bg-primary/80" },
51
+ { isLink: true, variant: "secondary", className: "hover:bg-secondary/80" },
52
+ { isLink: true, variant: "outline", className: "hover:border-border/80" },
53
+ { isLink: true, variant: "ghost", className: "hover:bg-foreground/7" },
54
+ { isLink: true, variant: "info", className: "hover:bg-info/80" },
55
+ { isLink: true, variant: "success", className: "hover:bg-success/80" },
56
+ { isLink: true, variant: "warning", className: "hover:bg-warning/80" },
57
+ { isLink: true, variant: "error", className: "hover:bg-error/80" },
101
58
  ],
102
- defaultVariants: {
103
- variant: "default",
104
- size: "md",
105
- isLink: false,
106
- },
59
+ defaultVariants: { variant: "default", size: "md", isLink: false },
107
60
  });
108
61
 
109
62
  const { variant = "default", size = "md", class: className, href, ...rest } = Astro.props;
@@ -59,10 +59,7 @@ const button = tv({
59
59
  icon: "h-11 w-11",
60
60
  },
61
61
  },
62
- defaultVariants: {
63
- variant: "default",
64
- size: "md",
65
- },
62
+ defaultVariants: { variant: "default", size: "md" },
66
63
  });
67
64
 
68
65
  const Tag = Astro.props.href ? "a" : "button";
@@ -4,9 +4,7 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"div">;
6
6
 
7
- const card = tv({
8
- base: "bg-card text-card-foreground rounded-2xl border shadow-sm",
9
- });
7
+ const card = tv({ base: "bg-card text-card-foreground rounded-2xl border shadow-sm" });
10
8
 
11
9
  const { class: className, ...rest } = Astro.props;
12
10
  ---
@@ -4,9 +4,7 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"div">;
6
6
 
7
- const cardContent = tv({
8
- base: "p-8 pt-0",
9
- });
7
+ const cardContent = tv({ base: "p-8 pt-0" });
10
8
 
11
9
  const { class: className, ...rest } = Astro.props;
12
10
  ---
@@ -4,9 +4,7 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"div">;
6
6
 
7
- const cardDescription = tv({
8
- base: "text-muted-foreground text-base",
9
- });
7
+ const cardDescription = tv({ base: "text-muted-foreground text-base" });
10
8
 
11
9
  const { class: className, ...rest } = Astro.props;
12
10
  ---
@@ -4,9 +4,7 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"div">;
6
6
 
7
- const cardFooter = tv({
8
- base: "flex items-center p-8 pt-0",
9
- });
7
+ const cardFooter = tv({ base: "flex items-center p-8 pt-0" });
10
8
 
11
9
  const { class: className, ...rest } = Astro.props;
12
10
  ---
@@ -4,9 +4,7 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"div">;
6
6
 
7
- const cardHeader = tv({
8
- base: "flex flex-col space-y-2 p-8",
9
- });
7
+ const cardHeader = tv({ base: "flex flex-col space-y-2 p-8" });
10
8
 
11
9
  const { class: className, ...rest } = Astro.props;
12
10
  ---
@@ -4,9 +4,7 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"div">;
6
6
 
7
- const cardTitle = tv({
8
- base: "text-3xl leading-none font-semibold tracking-tight",
9
- });
7
+ const cardTitle = tv({ base: "text-3xl leading-none font-semibold tracking-tight" });
10
8
 
11
9
  const { class: className, ...rest } = Astro.props;
12
10
  ---
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  import Check from "@tabler/icons/outline/check.svg";
3
3
  import type { HTMLAttributes } from "astro/types";
4
- import { tv, type VariantProps } from "tailwind-variants";
4
+ import { tv } from "tailwind-variants";
5
5
 
6
6
  type Props = Omit<HTMLAttributes<"input">, "type"> & {
7
7
  /**
@@ -42,21 +42,9 @@ const checkbox = tv({
42
42
  },
43
43
  variants: {
44
44
  size: {
45
- sm: {
46
- input: "size-4",
47
- icon: "size-4",
48
- label: "text-sm",
49
- },
50
- md: {
51
- input: "size-5",
52
- icon: "size-5",
53
- label: "text-base",
54
- },
55
- lg: {
56
- input: "size-6",
57
- icon: "size-6",
58
- label: "text-lg",
59
- },
45
+ sm: { input: "size-4", icon: "size-4", label: "text-sm" },
46
+ md: { input: "size-5", icon: "size-5", label: "text-base" },
47
+ lg: { input: "size-6", icon: "size-6", label: "text-lg" },
60
48
  },
61
49
  variant: {
62
50
  default: {
@@ -71,10 +59,7 @@ const checkbox = tv({
71
59
  input: "checked:bg-secondary focus-visible:outline-secondary",
72
60
  icon: "text-secondary-foreground",
73
61
  },
74
- info: {
75
- input: "checked:bg-info focus-visible:outline-info",
76
- icon: "text-info-foreground",
77
- },
62
+ info: { input: "checked:bg-info focus-visible:outline-info", icon: "text-info-foreground" },
78
63
  success: {
79
64
  input: "checked:bg-success focus-visible:outline-success",
80
65
  icon: "text-success-foreground",
@@ -89,10 +74,7 @@ const checkbox = tv({
89
74
  },
90
75
  },
91
76
  },
92
- defaultVariants: {
93
- size: "md",
94
- variant: "default",
95
- },
77
+ defaultVariants: { size: "md", variant: "default" },
96
78
  });
97
79
 
98
80
  const {
@@ -43,9 +43,7 @@ const { class: className, animationDuration = 200, ...rest } = Astro.props;
43
43
  <div
44
44
  class={dialogBackdrop()}
45
45
  data-state="closed"
46
- style={{
47
- animationDuration: `${animationDuration}ms`,
48
- }}
46
+ style={{ animationDuration: `${animationDuration}ms` }}
49
47
  >
50
48
  </div>
51
49
 
@@ -53,17 +51,10 @@ const { class: className, animationDuration = 200, ...rest } = Astro.props;
53
51
  class={dialogContent({ class: className })}
54
52
  data-state="closed"
55
53
  {...rest}
56
- style={{
57
- animationDuration: `${animationDuration}ms`,
58
- }}
54
+ style={{ animationDuration: `${animationDuration}ms` }}
59
55
  >
60
56
  <slot />
61
- <button
62
- type="button"
63
- class={dialogCloseButton()}
64
- data-dialog-close
65
- aria-label="Close dialog"
66
- >
57
+ <button type="button" class={dialogCloseButton()} data-dialog-close aria-label="Close dialog">
67
58
  <X class="size-5" />
68
59
  </button>
69
60
  </dialog>
@@ -4,9 +4,7 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"p">;
6
6
 
7
- const dialogDescription = tv({
8
- base: "text-muted-foreground",
9
- });
7
+ const dialogDescription = tv({ base: "text-muted-foreground" });
10
8
 
11
9
  const { class: className, ...rest } = Astro.props;
12
10
  ---
@@ -4,9 +4,7 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"div">;
6
6
 
7
- const dialogFooter = tv({
8
- base: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
9
- });
7
+ const dialogFooter = tv({ base: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end" });
10
8
 
11
9
  const { class: className, ...rest } = Astro.props;
12
10
  ---
@@ -4,9 +4,7 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"div">;
6
6
 
7
- const dialogHeader = tv({
8
- base: "flex flex-col space-y-2 text-center sm:text-left",
9
- });
7
+ const dialogHeader = tv({ base: "flex flex-col space-y-2 text-center sm:text-left" });
10
8
 
11
9
  const { class: className, ...rest } = Astro.props;
12
10
  ---
@@ -9,9 +9,7 @@ type Props = Omit<HTMLAttributes<"h2">, "id"> & {
9
9
  children: any;
10
10
  };
11
11
 
12
- const dialogTitle = tv({
13
- base: "text-2xl leading-none font-semibold tracking-tight",
14
- });
12
+ const dialogTitle = tv({ base: "text-2xl leading-none font-semibold tracking-tight" });
15
13
 
16
14
  const { class: className, ...rest } = Astro.props;
17
15
  ---
@@ -1,10 +1,8 @@
1
1
  ---
2
2
  import type { HTMLAttributes } from "astro/types";
3
- import { tv, type VariantProps } from "tailwind-variants";
3
+ import { tv } from "tailwind-variants";
4
4
 
5
- type Props = HTMLAttributes<"input"> & {
6
- size?: "sm" | "md" | "lg";
7
- };
5
+ type Props = HTMLAttributes<"input"> & { size?: "sm" | "md" | "lg" };
8
6
 
9
7
  const input = tv({
10
8
  base: [
@@ -15,15 +13,9 @@ const input = tv({
15
13
  "peer placeholder:text-muted-foreground",
16
14
  ],
17
15
  variants: {
18
- size: {
19
- sm: "h-9 px-2 text-sm",
20
- md: "h-11 px-3 text-base",
21
- lg: "h-12 px-4 text-lg",
22
- },
23
- },
24
- defaultVariants: {
25
- size: "md",
16
+ size: { sm: "h-9 px-2 text-sm", md: "h-11 px-3 text-base", lg: "h-12 px-4 text-lg" },
26
17
  },
18
+ defaultVariants: { size: "md" },
27
19
  });
28
20
 
29
21
  const { size = "md", class: className, ...rest } = Astro.props;
@@ -2,25 +2,15 @@
2
2
  import type { HTMLAttributes } from "astro/types";
3
3
  import { tv } from "tailwind-variants";
4
4
 
5
- type Props = HTMLAttributes<"label"> & {
6
- size?: "sm" | "md" | "lg";
7
- };
5
+ type Props = HTMLAttributes<"label"> & { size?: "sm" | "md" | "lg" };
8
6
 
9
7
  const label = tv({
10
8
  base: [
11
9
  "text-foreground leading-none font-medium",
12
10
  "peer-disabled:cursor-not-allowed peer-disabled:opacity-70 has-[+:disabled]:cursor-not-allowed has-[+:disabled]:opacity-70",
13
11
  ],
14
- variants: {
15
- size: {
16
- sm: "text-sm",
17
- md: "text-base",
18
- lg: "text-lg",
19
- },
20
- },
21
- defaultVariants: {
22
- size: "md",
23
- },
12
+ variants: { size: { sm: "text-sm", md: "text-base", lg: "text-lg" } },
13
+ defaultVariants: { size: "md" },
24
14
  });
25
15
 
26
16
  const { size = "md", class: className = "", ...rest } = Astro.props;
@@ -2,22 +2,13 @@
2
2
  import type { HTMLAttributes } from "astro/types";
3
3
  import { tv } from "tailwind-variants";
4
4
 
5
- type Props = HTMLAttributes<"nav"> & {
6
- children: any;
7
- };
5
+ type Props = HTMLAttributes<"nav"> & { children: any };
8
6
 
9
- const pagination = tv({
10
- base: "mx-auto flex w-full justify-center",
11
- });
7
+ const pagination = tv({ base: "mx-auto flex w-full justify-center" });
12
8
 
13
9
  const { class: className, ...rest } = Astro.props;
14
10
  ---
15
11
 
16
- <nav
17
- role="navigation"
18
- aria-label="pagination"
19
- class={pagination({ class: className })}
20
- {...rest}
21
- >
12
+ <nav role="navigation" aria-label="pagination" class={pagination({ class: className })} {...rest}>
22
13
  <slot />
23
14
  </nav>
@@ -2,13 +2,9 @@
2
2
  import type { HTMLAttributes } from "astro/types";
3
3
  import { tv } from "tailwind-variants";
4
4
 
5
- type Props = HTMLAttributes<"ul"> & {
6
- children: any;
7
- };
5
+ type Props = HTMLAttributes<"ul"> & { children: any };
8
6
 
9
- const paginationContent = tv({
10
- base: "flex flex-row items-center gap-1",
11
- });
7
+ const paginationContent = tv({ base: "flex flex-row items-center gap-1" });
12
8
 
13
9
  const { class: className, ...rest } = Astro.props;
14
10
  ---
@@ -1,15 +1,11 @@
1
1
  ---
2
- import type { HTMLAttributes } from "astro/types";
3
2
  import Dots from "@tabler/icons/outline/dots.svg";
3
+ import type { HTMLAttributes } from "astro/types";
4
4
  import { tv } from "tailwind-variants";
5
5
 
6
- type Props = HTMLAttributes<"span"> & {
7
- children?: any;
8
- };
6
+ type Props = HTMLAttributes<"span"> & { children?: any };
9
7
 
10
- const paginationEllipsis = tv({
11
- base: "flex h-9 w-9 items-center justify-center",
12
- });
8
+ const paginationEllipsis = tv({ base: "flex h-9 w-9 items-center justify-center" });
13
9
 
14
10
  const { class: className, ...rest } = Astro.props;
15
11
  ---
@@ -2,13 +2,9 @@
2
2
  import type { HTMLAttributes } from "astro/types";
3
3
  import { tv } from "tailwind-variants";
4
4
 
5
- type Props = HTMLAttributes<"li"> & {
6
- children: any;
7
- };
5
+ type Props = HTMLAttributes<"li"> & { children: any };
8
6
 
9
- const paginationItem = tv({
10
- base: "",
11
- });
7
+ const paginationItem = tv({ base: "" });
12
8
 
13
9
  const { class: className, ...rest } = Astro.props;
14
10
  ---
@@ -28,10 +28,7 @@ const paginationLink = tv({
28
28
  icon: "h-11 w-11",
29
29
  },
30
30
  },
31
- defaultVariants: {
32
- isActive: false,
33
- size: "icon",
34
- },
31
+ defaultVariants: { isActive: false, size: "icon" },
35
32
  });
36
33
 
37
34
  const { class: className, isActive, size = "icon", ...rest } = Astro.props;
@@ -1,16 +1,12 @@
1
1
  ---
2
- import type { HTMLAttributes } from "astro/types";
3
2
  import ChevronRight from "@tabler/icons/outline/chevron-right.svg";
4
- import PaginationLink from "./PaginationLink.astro";
3
+ import type { HTMLAttributes } from "astro/types";
5
4
  import { tv } from "tailwind-variants";
5
+ import PaginationLink from "./PaginationLink.astro";
6
6
 
7
- type Props = HTMLAttributes<"a"> & {
8
- size?: "sm" | "md" | "lg" | "icon";
9
- };
7
+ type Props = HTMLAttributes<"a"> & { size?: "sm" | "md" | "lg" | "icon" };
10
8
 
11
- const paginationNext = tv({
12
- base: "group gap-1",
13
- });
9
+ const paginationNext = tv({ base: "group gap-1" });
14
10
 
15
11
  const { class: className, size = "md", ...rest } = Astro.props;
16
12
  ---
@@ -1,16 +1,12 @@
1
1
  ---
2
- import type { HTMLAttributes } from "astro/types";
3
2
  import ChevronLeft from "@tabler/icons/outline/chevron-left.svg";
4
- import PaginationLink from "./PaginationLink.astro";
3
+ import type { HTMLAttributes } from "astro/types";
5
4
  import { tv } from "tailwind-variants";
5
+ import PaginationLink from "./PaginationLink.astro";
6
6
 
7
- type Props = HTMLAttributes<"a"> & {
8
- size?: "sm" | "md" | "lg" | "icon";
9
- };
7
+ type Props = HTMLAttributes<"a"> & { size?: "sm" | "md" | "lg" | "icon" };
10
8
 
11
- const paginationPrevious = tv({
12
- base: "group gap-1",
13
- });
9
+ const paginationPrevious = tv({ base: "group gap-1" });
14
10
 
15
11
  const { class: className, size = "md", ...rest } = Astro.props;
16
12
  ---
@@ -1,9 +1,7 @@
1
1
  ---
2
2
  import type { HTMLAttributes } from "astro/types";
3
3
 
4
- type Props = HTMLAttributes<"div"> & {
5
- children: any;
6
- };
4
+ type Props = HTMLAttributes<"div"> & { children: any };
7
5
 
8
6
  const { class: className, ...rest } = Astro.props;
9
7
  ---
@@ -210,10 +208,8 @@ const { class: className, ...rest } = Astro.props;
210
208
  }
211
209
  });
212
210
 
213
- // passive resize listener to call setSize() on window resize
214
- window.addEventListener("resize", () => this.setSize(), {
215
- passive: true,
216
- });
211
+ // passive resize listener to call setSize()
212
+ window.addEventListener("resize", () => this.setSize(), { passive: true });
217
213
  }
218
214
 
219
215
  private handleNavigationKeys(e: KeyboardEvent) {
@@ -366,11 +362,7 @@ const { class: className, ...rest } = Astro.props;
366
362
 
367
363
  // Dispatch custom event with the new value
368
364
  const event = new CustomEvent<SelectChangeEvent["detail"]>("starwind-select:change", {
369
- detail: {
370
- value: newValue,
371
- selectId: this.select.id,
372
- label: item.textContent || "",
373
- },
365
+ detail: { value: newValue, selectId: this.select.id, label: item.textContent || "" },
374
366
  bubbles: true,
375
367
  cancelable: true,
376
368
  });
@@ -30,13 +30,12 @@ const selectContent = tv({
30
30
  ],
31
31
  variants: {
32
32
  side: {
33
- bottom: "data-[side=bottom]:slide-in-from-top-4 data-[side=bottom]:top-(--select-content-offset)",
33
+ bottom:
34
+ "data-[side=bottom]:slide-in-from-top-4 data-[side=bottom]:top-(--select-content-offset)",
34
35
  top: "data-[side=top]:slide-in-from-bottom-4 data-[side=top]:bottom-(--select-content-offset)",
35
36
  },
36
37
  },
37
- defaultVariants: {
38
- side: "bottom",
39
- },
38
+ defaultVariants: { side: "bottom" },
40
39
  });
41
40
 
42
41
  const selectContentInner = tv({
@@ -2,9 +2,7 @@
2
2
  /**
3
3
  * This current doesn't do anything
4
4
  */
5
- type Props = {
6
- children: any;
7
- };
5
+ type Props = { children: any };
8
6
  ---
9
7
 
10
8
  <slot />
@@ -23,9 +23,7 @@ const selectItem = tv({
23
23
  ],
24
24
  });
25
25
 
26
- const selectItemIcon = tv({
27
- base: "absolute left-2 size-3.5 items-center justify-center",
28
- });
26
+ const selectItemIcon = tv({ base: "absolute left-2 size-3.5 items-center justify-center" });
29
27
 
30
28
  const { class: className, value, disabled, ...rest } = Astro.props;
31
29
  ---
@@ -4,9 +4,7 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"div">;
6
6
 
7
- const selectLabel = tv({
8
- base: "py-1.5 pr-2 pl-8 font-semibold",
9
- });
7
+ const selectLabel = tv({ base: "py-1.5 pr-2 pl-8 font-semibold" });
10
8
 
11
9
  const { class: className, ...rest } = Astro.props;
12
10
  ---
@@ -4,9 +4,7 @@ import { tv } from "tailwind-variants";
4
4
 
5
5
  type Props = HTMLAttributes<"div">;
6
6
 
7
- const selectSeparator = tv({
8
- base: "bg-muted -mx-1 my-1 h-px",
9
- });
7
+ const selectSeparator = tv({ base: "bg-muted -mx-1 my-1 h-px" });
10
8
 
11
9
  const { class: className, ...rest } = Astro.props;
12
10
  ---
@@ -1,7 +1,7 @@
1
1
  ---
2
+ import ChevronDown from "@tabler/icons/outline/chevron-down.svg";
2
3
  import type { HTMLAttributes } from "astro/types";
3
4
  import { tv } from "tailwind-variants";
4
- import ChevronDown from "@tabler/icons/outline/chevron-down.svg";
5
5
 
6
6
  type Props = Omit<HTMLAttributes<"button">, "role" | "type"> & {
7
7
  /**
@@ -9,9 +9,7 @@ type Props = HTMLAttributes<"span"> & {
9
9
  placeholder?: string;
10
10
  };
11
11
 
12
- const selectValue = tv({
13
- base: "pointer-events-none",
14
- });
12
+ const selectValue = tv({ base: "pointer-events-none" });
15
13
 
16
14
  const { placeholder = "select", class: className, ...rest } = Astro.props;
17
15
  ---
@@ -76,9 +76,7 @@ const switchButton = tv({
76
76
  error: "aria-checked:border-error focus:outline-error",
77
77
  },
78
78
  },
79
- defaultVariants: {
80
- variant: "default",
81
- },
79
+ defaultVariants: { variant: "default" },
82
80
  });
83
81
 
84
82
  const switchToggle = tv({
@@ -86,30 +84,14 @@ const switchToggle = tv({
86
84
  "bg-foreground inline-block transform rounded-full transition-transform",
87
85
  "group-aria-checked:translate-x-(--translation) group-aria-[checked=false]:translate-x-[calc(var(--padding)-var(--border-offset))]",
88
86
  ],
89
- variants: {
90
- size: {
91
- sm: "size-4",
92
- md: "size-5",
93
- lg: "size-6",
94
- },
95
- },
96
- defaultVariants: {
97
- size: "md",
98
- },
87
+ variants: { size: { sm: "size-4", md: "size-5", lg: "size-6" } },
88
+ defaultVariants: { size: "md" },
99
89
  });
100
90
 
101
91
  const switchLabel = tv({
102
92
  base: "text-foreground ml-2 font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
103
- variants: {
104
- size: {
105
- sm: "text-sm",
106
- md: "text-base",
107
- lg: "text-lg",
108
- },
109
- },
110
- defaultVariants: {
111
- size: "md",
112
- },
93
+ variants: { size: { sm: "text-sm", md: "text-base", lg: "text-lg" } },
94
+ defaultVariants: { size: "md" },
113
95
  });
114
96
  ---
115
97
 
@@ -170,10 +152,7 @@ const switchLabel = tv({
170
152
 
171
153
  // Dispatch custom event with the new state
172
154
  const event = new CustomEvent<SwitchChangeEvent["detail"]>("starwind-switch:change", {
173
- detail: {
174
- checked: newState,
175
- switchId: this.switchButton.id,
176
- },
155
+ detail: { checked: newState, switchId: this.switchButton.id },
177
156
  bubbles: true,
178
157
  cancelable: true,
179
158
  });
@@ -7,9 +7,7 @@ interface Props extends HTMLAttributes<"div"> {
7
7
  syncKey?: string;
8
8
  }
9
9
 
10
- const tabs = tv({
11
- base: "starwind-tabs",
12
- });
10
+ const tabs = tv({ base: "starwind-tabs" });
13
11
 
14
12
  const { defaultValue, syncKey, class: className, ...rest } = Astro.props;
15
13
  ---
@@ -129,9 +127,7 @@ const { defaultValue, syncKey, class: className, ...rest } = Astro.props;
129
127
  if (!this.syncKey) return;
130
128
 
131
129
  document.dispatchEvent(
132
- new CustomEvent(`starwind-tabs-sync:${this.syncKey}`, {
133
- detail: { value },
134
- }),
130
+ new CustomEvent(`starwind-tabs-sync:${this.syncKey}`, { detail: { value } }),
135
131
  );
136
132
 
137
133
  localStorage.setItem(this.storageKey, value);
@@ -6,9 +6,7 @@ interface Props extends Omit<HTMLAttributes<"div">, "id" | "role" | "tabindex" |
6
6
  value: string;
7
7
  }
8
8
 
9
- const tabsContent = tv({
10
- base: "mt-2 focus-visible:outline-2 focus-visible:outline-offset-2",
11
- });
9
+ const tabsContent = tv({ base: "mt-2 focus-visible:outline-2 focus-visible:outline-offset-2" });
12
10
 
13
11
  const { value, class: className, ...rest } = Astro.props;
14
12
  ---
@@ -11,11 +11,6 @@ const tabsList = tv({
11
11
  const { class: className, ...rest } = Astro.props;
12
12
  ---
13
13
 
14
- <div
15
- class={tabsList({ class: className })}
16
- data-tabs-list
17
- role="tablist"
18
- {...rest}
19
- >
14
+ <div class={tabsList({ class: className })} data-tabs-list role="tablist" {...rest}>
20
15
  <slot />
21
16
  </div>
@@ -2,9 +2,7 @@
2
2
  import type { HTMLAttributes } from "astro/types";
3
3
  import { tv } from "tailwind-variants";
4
4
 
5
- type Props = HTMLAttributes<"textarea"> & {
6
- size?: "sm" | "md" | "lg";
7
- };
5
+ type Props = HTMLAttributes<"textarea"> & { size?: "sm" | "md" | "lg" };
8
6
 
9
7
  const textarea = tv({
10
8
  base: [
@@ -21,9 +19,7 @@ const textarea = tv({
21
19
  lg: "min-h-12 px-4 py-3 text-lg",
22
20
  },
23
21
  },
24
- defaultVariants: {
25
- size: "md",
26
- },
22
+ defaultVariants: { size: "md" },
27
23
  });
28
24
 
29
25
  const { size = "md", class: className, ...rest } = Astro.props;
@@ -17,9 +17,7 @@ type Props = HTMLAttributes<"div"> & {
17
17
  disableHoverableContent?: boolean;
18
18
  };
19
19
 
20
- const tooltip = tv({
21
- base: "starwind-tooltip relative inline-block",
22
- });
20
+ const tooltip = tv({ base: "starwind-tooltip relative inline-block" });
23
21
 
24
22
  const {
25
23
  openDelay = 200,
@@ -45,11 +45,7 @@ const tooltipContent = tv({
45
45
  bottom: "slide-in-from-top-2 top-(--tooltip-offset)",
46
46
  top: "slide-in-from-bottom-2 bottom-(--tooltip-offset)",
47
47
  },
48
- align: {
49
- center: "",
50
- start: "",
51
- end: "",
52
- },
48
+ align: { center: "", start: "", end: "" },
53
49
  sideAlign: {
54
50
  "top-center": "left-[50%] translate-x-[-50%]",
55
51
  "bottom-center": "left-[50%] translate-x-[-50%]",
@@ -65,41 +61,14 @@ const tooltipContent = tv({
65
61
  "right-end": "bottom-0",
66
62
  },
67
63
  },
68
- defaultVariants: {
69
- side: "top",
70
- align: "center",
71
- },
64
+ defaultVariants: { side: "top", align: "center" },
72
65
  compoundVariants: [
73
- {
74
- side: ["top", "bottom"],
75
- align: "center",
76
- class: "left-[50%] translate-x-[-50%]",
77
- },
78
- {
79
- side: ["left", "right"],
80
- align: "center",
81
- class: "top-[50%] translate-y-[-50%]",
82
- },
83
- {
84
- side: ["top", "bottom"],
85
- align: "start",
86
- class: "left-0",
87
- },
88
- {
89
- side: ["top", "bottom"],
90
- align: "end",
91
- class: "right-0",
92
- },
93
- {
94
- side: ["left", "right"],
95
- align: "start",
96
- class: "top-0",
97
- },
98
- {
99
- side: ["left", "right"],
100
- align: "end",
101
- class: "bottom-0",
102
- },
66
+ { side: ["top", "bottom"], align: "center", class: "left-[50%] translate-x-[-50%]" },
67
+ { side: ["left", "right"], align: "center", class: "top-[50%] translate-y-[-50%]" },
68
+ { side: ["top", "bottom"], align: "start", class: "left-0" },
69
+ { side: ["top", "bottom"], align: "end", class: "right-0" },
70
+ { side: ["left", "right"], align: "start", class: "top-0" },
71
+ { side: ["left", "right"], align: "end", class: "bottom-0" },
103
72
  ],
104
73
  });
105
74
 
@@ -3,9 +3,7 @@
3
3
  * This component is used to trigger the tooltip
4
4
  * All it does is require a slot
5
5
  */
6
- type Props = {
7
- children: any;
8
- };
6
+ type Props = { children: any };
9
7
  ---
10
8
 
11
9
  <slot />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starwind-ui/core",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Starwind UI core components and registry",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -30,7 +30,6 @@
30
30
  "dev": "tsup --watch",
31
31
  "core:link": "pnpm link --global",
32
32
  "core:unlink": "pnpm rm --global @starwind-ui/core",
33
- "sync:docs": "pnpm exec starwind sync src/components ../../apps/docs/src/components/starwind",
34
33
  "sync:demo": "pnpm exec starwind sync src/components ../../apps/demo/src/components/starwind",
35
34
  "publish:beta": "pnpm publish --tag beta --access public",
36
35
  "publish:next": "pnpm publish --tag next --access public",