@starwind-ui/core 1.6.2 → 1.7.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 (101) hide show
  1. package/dist/index.js +4 -0
  2. package/dist/index.js.map +1 -1
  3. package/dist/src/components/accordion/Accordion.astro +224 -224
  4. package/dist/src/components/accordion/AccordionContent.astro +13 -13
  5. package/dist/src/components/accordion/AccordionItem.astro +6 -6
  6. package/dist/src/components/accordion/AccordionTrigger.astro +13 -13
  7. package/dist/src/components/accordion/index.ts +4 -4
  8. package/dist/src/components/alert/Alert.astro +15 -15
  9. package/dist/src/components/alert/AlertDescription.astro +1 -1
  10. package/dist/src/components/alert/AlertTitle.astro +2 -2
  11. package/dist/src/components/alert/index.ts +3 -3
  12. package/dist/src/components/avatar/Avatar.astro +16 -16
  13. package/dist/src/components/avatar/AvatarFallback.astro +3 -3
  14. package/dist/src/components/avatar/AvatarImage.astro +12 -12
  15. package/dist/src/components/avatar/index.ts +4 -4
  16. package/dist/src/components/badge/Badge.astro +33 -33
  17. package/dist/src/components/breadcrumb/Breadcrumb.astro +1 -1
  18. package/dist/src/components/breadcrumb/BreadcrumbEllipsis.astro +6 -6
  19. package/dist/src/components/breadcrumb/BreadcrumbItem.astro +1 -1
  20. package/dist/src/components/breadcrumb/BreadcrumbLink.astro +8 -8
  21. package/dist/src/components/breadcrumb/BreadcrumbList.astro +2 -2
  22. package/dist/src/components/breadcrumb/BreadcrumbPage.astro +6 -6
  23. package/dist/src/components/breadcrumb/BreadcrumbSeparator.astro +7 -7
  24. package/dist/src/components/breadcrumb/index.ts +14 -14
  25. package/dist/src/components/button/Button.astro +38 -38
  26. package/dist/src/components/card/Card.astro +1 -1
  27. package/dist/src/components/card/CardContent.astro +1 -1
  28. package/dist/src/components/card/CardDescription.astro +1 -1
  29. package/dist/src/components/card/CardFooter.astro +1 -1
  30. package/dist/src/components/card/CardHeader.astro +1 -1
  31. package/dist/src/components/card/CardTitle.astro +1 -1
  32. package/dist/src/components/card/index.ts +7 -7
  33. package/dist/src/components/checkbox/Checkbox.astro +89 -89
  34. package/dist/src/components/dialog/Dialog.astro +178 -178
  35. package/dist/src/components/dialog/DialogClose.astro +14 -14
  36. package/dist/src/components/dialog/DialogContent.astro +32 -32
  37. package/dist/src/components/dialog/DialogDescription.astro +1 -1
  38. package/dist/src/components/dialog/DialogFooter.astro +1 -1
  39. package/dist/src/components/dialog/DialogHeader.astro +1 -1
  40. package/dist/src/components/dialog/DialogTitle.astro +6 -6
  41. package/dist/src/components/dialog/DialogTrigger.astro +19 -19
  42. package/dist/src/components/dialog/index.ts +16 -16
  43. package/dist/src/components/dropdown/Dropdown.astro +359 -359
  44. package/dist/src/components/dropdown/DropdownContent.astro +63 -63
  45. package/dist/src/components/dropdown/DropdownItem.astro +31 -31
  46. package/dist/src/components/dropdown/DropdownLabel.astro +14 -14
  47. package/dist/src/components/dropdown/DropdownSeparator.astro +5 -5
  48. package/dist/src/components/dropdown/DropdownTrigger.astro +26 -26
  49. package/dist/src/components/dropdown/index.ts +12 -12
  50. package/dist/src/components/dropzone/Dropzone.astro +232 -0
  51. package/dist/src/components/dropzone/DropzoneFilesList.astro +25 -0
  52. package/dist/src/components/dropzone/DropzoneLoadingIndicator.astro +10 -0
  53. package/dist/src/components/dropzone/DropzoneUploadIndicator.astro +10 -0
  54. package/dist/src/components/dropzone/index.ts +13 -0
  55. package/dist/src/components/input/Input.astro +12 -12
  56. package/dist/src/components/label/Label.astro +8 -8
  57. package/dist/src/components/pagination/Pagination.astro +1 -1
  58. package/dist/src/components/pagination/PaginationContent.astro +3 -3
  59. package/dist/src/components/pagination/PaginationEllipsis.astro +2 -2
  60. package/dist/src/components/pagination/PaginationItem.astro +3 -3
  61. package/dist/src/components/pagination/PaginationLink.astro +27 -27
  62. package/dist/src/components/pagination/PaginationNext.astro +7 -6
  63. package/dist/src/components/pagination/PaginationPrevious.astro +7 -6
  64. package/dist/src/components/pagination/index.ts +14 -14
  65. package/dist/src/components/progress/Progress.astro +151 -0
  66. package/dist/src/components/progress/index.ts +5 -0
  67. package/dist/src/components/radio-group/RadioGroup.astro +156 -0
  68. package/dist/src/components/radio-group/RadioGroupItem.astro +125 -0
  69. package/dist/src/components/radio-group/RadioGroupTypes.ts +6 -0
  70. package/dist/src/components/radio-group/index.ts +10 -0
  71. package/dist/src/components/select/Select.astro +475 -475
  72. package/dist/src/components/select/SelectContent.astro +62 -62
  73. package/dist/src/components/select/SelectItem.astro +27 -27
  74. package/dist/src/components/select/SelectLabel.astro +1 -1
  75. package/dist/src/components/select/SelectTrigger.astro +28 -28
  76. package/dist/src/components/select/SelectTypes.ts +5 -5
  77. package/dist/src/components/select/SelectValue.astro +5 -5
  78. package/dist/src/components/select/index.ts +16 -16
  79. package/dist/src/components/skeleton/Skeleton.astro +14 -0
  80. package/dist/src/components/skeleton/index.ts +5 -0
  81. package/dist/src/components/switch/Switch.astro +150 -150
  82. package/dist/src/components/switch/SwitchTypes.ts +4 -4
  83. package/dist/src/components/table/Table.astro +5 -5
  84. package/dist/src/components/table/TableBody.astro +3 -3
  85. package/dist/src/components/table/TableCaption.astro +3 -3
  86. package/dist/src/components/table/TableCell.astro +3 -3
  87. package/dist/src/components/table/TableFoot.astro +3 -3
  88. package/dist/src/components/table/TableHead.astro +3 -3
  89. package/dist/src/components/table/TableHeader.astro +3 -3
  90. package/dist/src/components/table/TableRow.astro +3 -3
  91. package/dist/src/components/table/index.ts +8 -8
  92. package/dist/src/components/tabs/Tabs.astro +250 -250
  93. package/dist/src/components/tabs/TabsContent.astro +10 -10
  94. package/dist/src/components/tabs/TabsList.astro +2 -2
  95. package/dist/src/components/tabs/TabsTrigger.astro +15 -15
  96. package/dist/src/components/tabs/index.ts +4 -4
  97. package/dist/src/components/textarea/Textarea.astro +16 -16
  98. package/dist/src/components/tooltip/Tooltip.astro +217 -217
  99. package/dist/src/components/tooltip/TooltipContent.astro +81 -81
  100. package/dist/src/components/tooltip/index.ts +3 -3
  101. package/package.json +1 -1
@@ -0,0 +1,125 @@
1
+ ---
2
+ import CircleFilled from "@tabler/icons/filled/circle.svg";
3
+ import type { HTMLAttributes } from "astro/types";
4
+ import { tv, type VariantProps } from "tailwind-variants";
5
+
6
+ type Props = HTMLAttributes<"input"> &
7
+ VariantProps<typeof radioWrapper> &
8
+ VariantProps<typeof radioControl> & {
9
+ /**
10
+ * Value of the radio item
11
+ */
12
+ value: string;
13
+ /**
14
+ * Whether the radio is disabled
15
+ */
16
+ disabled?: boolean;
17
+ /**
18
+ * Optional ID for the radio item
19
+ */
20
+ id?: string;
21
+ /**
22
+ * Name to group radio inputs
23
+ */
24
+ name?: string;
25
+ /**
26
+ * Whether the radio is checked (only for initial state)
27
+ */
28
+ checked?: boolean;
29
+ };
30
+
31
+ const radioWrapper = tv({
32
+ base: "relative isolate flex shrink-0",
33
+ variants: {
34
+ size: {
35
+ sm: "size-4",
36
+ md: "size-5",
37
+ lg: "size-6",
38
+ },
39
+ },
40
+ defaultVariants: {
41
+ size: "md",
42
+ },
43
+ });
44
+
45
+ const radioItem = tv({
46
+ base: [
47
+ "starwind-radio-item peer z-10 h-full w-full",
48
+ "absolute inset-0 cursor-pointer opacity-0 outline-none focus:outline-none focus-visible:outline-none",
49
+ "disabled:cursor-not-allowed",
50
+ ],
51
+ });
52
+
53
+ const radioControl = tv({
54
+ base: [
55
+ "starwind-radio-control",
56
+ "border-input bg-background",
57
+ "peer-focus-visible:outline-2 peer-focus-visible:outline-offset-1 peer-focus-visible:transition-none",
58
+ "absolute inset-0 rounded-full border shadow-xs",
59
+ "starwind-transition-colors peer-checked:[&>svg]:opacity-100",
60
+ "peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
61
+ "flex items-center justify-center",
62
+ ],
63
+ variants: {
64
+ variant: {
65
+ default:
66
+ "peer-checked:border-foreground [&>svg]:fill-foreground peer-focus-visible:outline-outline",
67
+ primary:
68
+ "peer-checked:border-primary [&>svg]:fill-primary peer-focus-visible:outline-primary",
69
+ secondary:
70
+ "peer-checked:border-secondary [&>svg]:fill-secondary peer-focus-visible:outline-secondary",
71
+ info: "peer-checked:border-info [&>svg]:fill-info peer-focus-visible:outline-info",
72
+ success:
73
+ "peer-checked:border-success [&>svg]:fill-success peer-focus-visible:outline-success",
74
+ warning:
75
+ "peer-checked:border-warning [&>svg]:fill-warning peer-focus-visible:outline-warning",
76
+ error: "peer-checked:border-error [&>svg]:fill-error peer-focus-visible:outline-error",
77
+ },
78
+ },
79
+ defaultVariants: {
80
+ variant: "primary",
81
+ },
82
+ });
83
+
84
+ const radioIndicator = tv({
85
+ base: ["starwind-radio-indicator", "opacity-0 transition-opacity"],
86
+ variants: {
87
+ size: {
88
+ sm: "size-2",
89
+ md: "size-3",
90
+ lg: "size-4",
91
+ },
92
+ },
93
+ defaultVariants: {
94
+ size: "md",
95
+ },
96
+ });
97
+
98
+ const {
99
+ value,
100
+ name,
101
+ disabled = false,
102
+ checked = false,
103
+ id,
104
+ class: className,
105
+ size = "md",
106
+ variant = "default",
107
+ ...rest
108
+ } = Astro.props;
109
+ ---
110
+
111
+ <div class={radioWrapper({ size })}>
112
+ <input
113
+ type="radio"
114
+ class={radioItem()}
115
+ name={name}
116
+ id={id}
117
+ value={value}
118
+ checked={checked}
119
+ disabled={disabled}
120
+ {...rest}
121
+ />
122
+ <span class={radioControl({ variant, class: className })}>
123
+ <CircleFilled class={radioIndicator({ size })} />
124
+ </span>
125
+ </div>
@@ -0,0 +1,6 @@
1
+ export interface RadioGroupChangeEvent extends CustomEvent {
2
+ detail: {
3
+ value: string;
4
+ radioGroupId?: string;
5
+ };
6
+ }
@@ -0,0 +1,10 @@
1
+ import RadioGroup from "./RadioGroup.astro";
2
+ import RadioGroupItem from "./RadioGroupItem.astro";
3
+ import type { RadioGroupChangeEvent } from "./RadioGroupTypes";
4
+
5
+ export { RadioGroup, type RadioGroupChangeEvent, RadioGroupItem };
6
+
7
+ export default {
8
+ Root: RadioGroup,
9
+ Item: RadioGroupItem,
10
+ };