@starwind-ui/core 1.6.2 → 1.7.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.
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/src/components/accordion/Accordion.astro +224 -224
- package/dist/src/components/accordion/AccordionContent.astro +13 -13
- package/dist/src/components/accordion/AccordionItem.astro +6 -6
- package/dist/src/components/accordion/AccordionTrigger.astro +13 -13
- package/dist/src/components/accordion/index.ts +4 -4
- package/dist/src/components/alert/Alert.astro +15 -15
- package/dist/src/components/alert/AlertDescription.astro +1 -1
- package/dist/src/components/alert/AlertTitle.astro +2 -2
- package/dist/src/components/alert/index.ts +3 -3
- package/dist/src/components/avatar/Avatar.astro +16 -16
- package/dist/src/components/avatar/AvatarFallback.astro +3 -3
- package/dist/src/components/avatar/AvatarImage.astro +12 -12
- package/dist/src/components/avatar/index.ts +4 -4
- package/dist/src/components/badge/Badge.astro +33 -33
- package/dist/src/components/breadcrumb/Breadcrumb.astro +1 -1
- package/dist/src/components/breadcrumb/BreadcrumbEllipsis.astro +6 -6
- package/dist/src/components/breadcrumb/BreadcrumbItem.astro +1 -1
- package/dist/src/components/breadcrumb/BreadcrumbLink.astro +8 -8
- package/dist/src/components/breadcrumb/BreadcrumbList.astro +2 -2
- package/dist/src/components/breadcrumb/BreadcrumbPage.astro +6 -6
- package/dist/src/components/breadcrumb/BreadcrumbSeparator.astro +7 -7
- package/dist/src/components/breadcrumb/index.ts +14 -14
- package/dist/src/components/button/Button.astro +38 -38
- package/dist/src/components/card/Card.astro +1 -1
- package/dist/src/components/card/CardContent.astro +1 -1
- package/dist/src/components/card/CardDescription.astro +1 -1
- package/dist/src/components/card/CardFooter.astro +1 -1
- package/dist/src/components/card/CardHeader.astro +1 -1
- package/dist/src/components/card/CardTitle.astro +1 -1
- package/dist/src/components/card/index.ts +7 -7
- package/dist/src/components/checkbox/Checkbox.astro +89 -89
- package/dist/src/components/dialog/Dialog.astro +237 -178
- package/dist/src/components/dialog/DialogClose.astro +14 -14
- package/dist/src/components/dialog/DialogContent.astro +32 -32
- package/dist/src/components/dialog/DialogDescription.astro +1 -1
- package/dist/src/components/dialog/DialogFooter.astro +1 -1
- package/dist/src/components/dialog/DialogHeader.astro +1 -1
- package/dist/src/components/dialog/DialogTitle.astro +6 -6
- package/dist/src/components/dialog/DialogTrigger.astro +26 -20
- package/dist/src/components/dialog/index.ts +16 -16
- package/dist/src/components/dropdown/Dropdown.astro +359 -359
- package/dist/src/components/dropdown/DropdownContent.astro +63 -63
- package/dist/src/components/dropdown/DropdownItem.astro +31 -31
- package/dist/src/components/dropdown/DropdownLabel.astro +14 -14
- package/dist/src/components/dropdown/DropdownSeparator.astro +5 -5
- package/dist/src/components/dropdown/DropdownTrigger.astro +26 -26
- package/dist/src/components/dropdown/index.ts +12 -12
- package/dist/src/components/dropzone/Dropzone.astro +232 -0
- package/dist/src/components/dropzone/DropzoneFilesList.astro +25 -0
- package/dist/src/components/dropzone/DropzoneLoadingIndicator.astro +10 -0
- package/dist/src/components/dropzone/DropzoneUploadIndicator.astro +10 -0
- package/dist/src/components/dropzone/index.ts +13 -0
- package/dist/src/components/input/Input.astro +12 -12
- package/dist/src/components/label/Label.astro +8 -8
- package/dist/src/components/pagination/Pagination.astro +1 -1
- package/dist/src/components/pagination/PaginationContent.astro +3 -3
- package/dist/src/components/pagination/PaginationEllipsis.astro +2 -2
- package/dist/src/components/pagination/PaginationItem.astro +3 -3
- package/dist/src/components/pagination/PaginationLink.astro +27 -27
- package/dist/src/components/pagination/PaginationNext.astro +7 -6
- package/dist/src/components/pagination/PaginationPrevious.astro +7 -6
- package/dist/src/components/pagination/index.ts +14 -14
- package/dist/src/components/progress/Progress.astro +151 -0
- package/dist/src/components/progress/index.ts +5 -0
- package/dist/src/components/radio-group/RadioGroup.astro +156 -0
- package/dist/src/components/radio-group/RadioGroupItem.astro +125 -0
- package/dist/src/components/radio-group/RadioGroupTypes.ts +6 -0
- package/dist/src/components/radio-group/index.ts +10 -0
- package/dist/src/components/select/Select.astro +515 -475
- package/dist/src/components/select/SelectContent.astro +62 -62
- package/dist/src/components/select/SelectItem.astro +27 -27
- package/dist/src/components/select/SelectLabel.astro +1 -1
- package/dist/src/components/select/SelectTrigger.astro +28 -28
- package/dist/src/components/select/SelectTypes.ts +11 -5
- package/dist/src/components/select/SelectValue.astro +5 -5
- package/dist/src/components/select/index.ts +16 -16
- package/dist/src/components/skeleton/Skeleton.astro +14 -0
- package/dist/src/components/skeleton/index.ts +5 -0
- package/dist/src/components/switch/Switch.astro +150 -150
- package/dist/src/components/switch/SwitchTypes.ts +4 -4
- package/dist/src/components/table/Table.astro +5 -5
- package/dist/src/components/table/TableBody.astro +3 -3
- package/dist/src/components/table/TableCaption.astro +3 -3
- package/dist/src/components/table/TableCell.astro +3 -3
- package/dist/src/components/table/TableFoot.astro +3 -3
- package/dist/src/components/table/TableHead.astro +3 -3
- package/dist/src/components/table/TableHeader.astro +3 -3
- package/dist/src/components/table/TableRow.astro +3 -3
- package/dist/src/components/table/index.ts +8 -8
- package/dist/src/components/tabs/Tabs.astro +250 -250
- package/dist/src/components/tabs/TabsContent.astro +10 -10
- package/dist/src/components/tabs/TabsList.astro +2 -2
- package/dist/src/components/tabs/TabsTrigger.astro +15 -15
- package/dist/src/components/tabs/index.ts +4 -4
- package/dist/src/components/textarea/Textarea.astro +16 -16
- package/dist/src/components/tooltip/Tooltip.astro +217 -217
- package/dist/src/components/tooltip/TooltipContent.astro +81 -81
- package/dist/src/components/tooltip/index.ts +3 -3
- package/package.json +6 -6
|
@@ -3,96 +3,96 @@ import type { HTMLAttributes } from "astro/types";
|
|
|
3
3
|
import { tv } from "tailwind-variants";
|
|
4
4
|
|
|
5
5
|
type Props = HTMLAttributes<"div"> & {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Side of the tooltip
|
|
8
|
+
* @default top
|
|
9
|
+
*/
|
|
10
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
11
|
+
/**
|
|
12
|
+
* Alignment of the tooltip
|
|
13
|
+
* @default center
|
|
14
|
+
*/
|
|
15
|
+
align?: "start" | "center" | "end";
|
|
16
|
+
/**
|
|
17
|
+
* Offset distance in pixels
|
|
18
|
+
* @default 4
|
|
19
|
+
*/
|
|
20
|
+
sideOffset?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Prevent the tooltip from colliding with other elements
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
avoidCollisions?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Open and close animation duration in milliseconds
|
|
28
|
+
* @default 150
|
|
29
|
+
*/
|
|
30
|
+
animationDuration?: number;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
const tooltipContent = tv({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
34
|
+
base: [
|
|
35
|
+
"starwind-tooltip-content",
|
|
36
|
+
"absolute z-50 hidden px-3 py-1.5 whitespace-nowrap shadow-sm will-change-transform",
|
|
37
|
+
"bg-popover text-popover-foreground rounded-md border",
|
|
38
|
+
"animate-in fade-in zoom-in-95",
|
|
39
|
+
"data-[state=closed]:animate-out data-[state=closed]:fill-mode-forwards fade-out zoom-out-95",
|
|
40
|
+
],
|
|
41
|
+
variants: {
|
|
42
|
+
side: {
|
|
43
|
+
left: "slide-in-from-right-2 right-(--tooltip-offset)",
|
|
44
|
+
right: "slide-in-from-left-2 left-(--tooltip-offset)",
|
|
45
|
+
bottom: "slide-in-from-top-2 top-(--tooltip-offset)",
|
|
46
|
+
top: "slide-in-from-bottom-2 bottom-(--tooltip-offset)",
|
|
47
|
+
},
|
|
48
|
+
align: { center: "", start: "", end: "" },
|
|
49
|
+
sideAlign: {
|
|
50
|
+
"top-center": "left-[50%] translate-x-[-50%]",
|
|
51
|
+
"bottom-center": "left-[50%] translate-x-[-50%]",
|
|
52
|
+
"left-center": "top-[50%] translate-y-[-50%]",
|
|
53
|
+
"right-center": "top-[50%] translate-y-[-50%]",
|
|
54
|
+
"top-start": "left-0",
|
|
55
|
+
"bottom-start": "left-0",
|
|
56
|
+
"top-end": "right-0",
|
|
57
|
+
"bottom-end": "right-0",
|
|
58
|
+
"left-start": "top-0",
|
|
59
|
+
"right-start": "top-0",
|
|
60
|
+
"left-end": "bottom-0",
|
|
61
|
+
"right-end": "bottom-0",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
defaultVariants: { side: "top", align: "center" },
|
|
65
|
+
compoundVariants: [
|
|
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" },
|
|
72
|
+
],
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
const {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
side = "top",
|
|
77
|
+
align = "center",
|
|
78
|
+
sideOffset = 4,
|
|
79
|
+
avoidCollisions = true,
|
|
80
|
+
animationDuration = 150,
|
|
81
|
+
class: className,
|
|
82
82
|
} = Astro.props;
|
|
83
83
|
---
|
|
84
84
|
|
|
85
85
|
<div
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
86
|
+
class={tooltipContent({ side, align, class: className })}
|
|
87
|
+
data-state="closed"
|
|
88
|
+
data-side={side}
|
|
89
|
+
data-align={align}
|
|
90
|
+
{...avoidCollisions && { "data-avoid-collisions": "" }}
|
|
91
|
+
role="tooltip"
|
|
92
|
+
style={{
|
|
93
|
+
"--tooltip-offset": `calc(100% + ${sideOffset}px)`,
|
|
94
|
+
animationDuration: `${animationDuration}ms`,
|
|
95
|
+
}}
|
|
96
96
|
>
|
|
97
|
-
|
|
97
|
+
<slot> My tooltip! </slot>
|
|
98
98
|
</div>
|
|
@@ -5,7 +5,7 @@ import TooltipTrigger from "./TooltipTrigger.astro";
|
|
|
5
5
|
export { Tooltip, TooltipContent, TooltipTrigger };
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
Root: Tooltip,
|
|
9
|
+
Trigger: TooltipTrigger,
|
|
10
|
+
Content: TooltipContent,
|
|
11
11
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starwind-ui/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "Starwind UI core components and registry",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"astro": "
|
|
32
|
-
"fs-extra": "
|
|
33
|
-
"glob": "
|
|
34
|
-
"tailwindcss": "
|
|
35
|
-
"tsup": "
|
|
31
|
+
"astro": "5.11.0",
|
|
32
|
+
"fs-extra": "11.3.0",
|
|
33
|
+
"glob": "11.0.3",
|
|
34
|
+
"tailwindcss": "4.1.11",
|
|
35
|
+
"tsup": "8.5.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "pnpm clean && tsup",
|