@starwind-ui/core 1.0.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.
- package/dist/index.js +22 -99
- package/dist/index.js.map +1 -1
- package/dist/src/components/accordion/Accordion.astro +5 -12
- package/dist/src/components/accordion/AccordionContent.astro +11 -7
- package/dist/src/components/accordion/AccordionItem.astro +6 -10
- package/dist/src/components/accordion/AccordionTrigger.astro +12 -9
- package/dist/src/components/alert/Alert.astro +18 -28
- package/dist/src/components/alert/AlertDescription.astro +4 -1
- package/dist/src/components/alert/AlertTitle.astro +6 -7
- package/dist/src/components/avatar/Avatar.astro +19 -23
- package/dist/src/components/avatar/AvatarFallback.astro +7 -6
- package/dist/src/components/avatar/AvatarImage.astro +9 -23
- package/dist/src/components/avatar/index.ts +1 -1
- package/dist/src/components/badge/Badge.astro +39 -34
- package/dist/src/components/button/Button.astro +37 -50
- package/dist/src/components/card/Card.astro +4 -4
- package/dist/src/components/card/CardContent.astro +4 -1
- package/dist/src/components/card/CardDescription.astro +4 -1
- package/dist/src/components/card/CardFooter.astro +4 -1
- package/dist/src/components/card/CardHeader.astro +4 -1
- package/dist/src/components/card/CardTitle.astro +4 -1
- package/dist/src/components/checkbox/Checkbox.astro +82 -54
- package/dist/src/components/dialog/DialogContent.astro +32 -29
- package/dist/src/components/dialog/DialogDescription.astro +4 -1
- package/dist/src/components/dialog/DialogFooter.astro +4 -1
- package/dist/src/components/dialog/DialogHeader.astro +4 -1
- package/dist/src/components/dialog/DialogTitle.astro +4 -1
- package/dist/src/components/input/Input.astro +15 -17
- package/dist/src/components/label/Label.astro +12 -16
- package/dist/src/components/pagination/Pagination.astro +5 -9
- package/dist/src/components/pagination/PaginationContent.astro +5 -4
- package/dist/src/components/pagination/PaginationEllipsis.astro +6 -5
- package/dist/src/components/pagination/PaginationItem.astro +5 -4
- package/dist/src/components/pagination/PaginationLink.astro +25 -32
- package/dist/src/components/pagination/PaginationNext.astro +7 -8
- package/dist/src/components/pagination/PaginationPrevious.astro +7 -8
- package/dist/src/components/select/Select.astro +5 -13
- package/dist/src/components/select/SelectContent.astro +25 -11
- package/dist/src/components/select/SelectGroup.astro +1 -3
- package/dist/src/components/select/SelectItem.astro +14 -9
- package/dist/src/components/select/SelectLabel.astro +4 -1
- package/dist/src/components/select/SelectSeparator.astro +4 -1
- package/dist/src/components/select/SelectTrigger.astro +12 -9
- package/dist/src/components/select/SelectValue.astro +5 -2
- package/dist/src/components/switch/Switch.astro +40 -41
- package/dist/src/components/tabs/Tabs.astro +5 -4
- package/dist/src/components/tabs/TabsContent.astro +4 -1
- package/dist/src/components/tabs/TabsList.astro +6 -9
- package/dist/src/components/tabs/TabsTrigger.astro +11 -7
- package/dist/src/components/textarea/Textarea.astro +18 -15
- package/dist/src/components/tooltip/Tooltip.astro +4 -1
- package/dist/src/components/tooltip/TooltipContent.astro +44 -22
- package/dist/src/components/tooltip/TooltipTrigger.astro +1 -3
- package/package.json +1 -2
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
3
4
|
|
|
4
5
|
interface Props extends Omit<HTMLAttributes<"button">, "type" | "id" | "role"> {
|
|
5
6
|
value: string;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<button
|
|
12
|
-
class:list={[
|
|
9
|
+
const tabsTrigger = tv({
|
|
10
|
+
base: [
|
|
13
11
|
"starwind-transition-colors inline-flex grow items-center justify-center rounded-sm px-3 py-1.5 font-medium whitespace-nowrap",
|
|
14
12
|
"data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
15
13
|
"focus-visible:outline-outline focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
16
14
|
"disabled:pointer-events-none disabled:opacity-50",
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
],
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const { value, class: className, ...rest } = Astro.props;
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
<button
|
|
22
|
+
class={tabsTrigger({ class: className })}
|
|
19
23
|
data-tabs-trigger
|
|
20
24
|
data-value={value}
|
|
21
25
|
data-state="inactive"
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
3
4
|
|
|
4
|
-
type Props = HTMLAttributes<"textarea"> & {
|
|
5
|
-
size?: "sm" | "md" | "lg";
|
|
6
|
-
};
|
|
5
|
+
type Props = HTMLAttributes<"textarea"> & { size?: "sm" | "md" | "lg" };
|
|
7
6
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<textarea
|
|
12
|
-
class:list={[
|
|
7
|
+
const textarea = tv({
|
|
8
|
+
base: [
|
|
13
9
|
"border-input bg-background text-foreground ring-offset-background min-h-10 w-full rounded-md border",
|
|
14
10
|
"focus:outline-outline focus:ring-0 focus:outline-2 focus:outline-offset-2",
|
|
15
11
|
"file:text-foreground file:border-0 file:bg-transparent file:text-sm file:font-medium",
|
|
16
12
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
17
13
|
"peer placeholder:text-muted-foreground",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"min-h-
|
|
14
|
+
],
|
|
15
|
+
variants: {
|
|
16
|
+
size: {
|
|
17
|
+
sm: "min-h-9 px-2 py-1 text-sm",
|
|
18
|
+
md: "min-h-10 px-3 py-2 text-base",
|
|
19
|
+
lg: "min-h-12 px-4 py-3 text-lg",
|
|
22
20
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: { size: "md" },
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const { size = "md", class: className, ...rest } = Astro.props;
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
<textarea class={textarea({ size, class: className })} {...rest}></textarea>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
3
4
|
|
|
4
5
|
type Props = HTMLAttributes<"div"> & {
|
|
5
6
|
/**
|
|
@@ -16,6 +17,8 @@ type Props = HTMLAttributes<"div"> & {
|
|
|
16
17
|
disableHoverableContent?: boolean;
|
|
17
18
|
};
|
|
18
19
|
|
|
20
|
+
const tooltip = tv({ base: "starwind-tooltip relative inline-block" });
|
|
21
|
+
|
|
19
22
|
const {
|
|
20
23
|
openDelay = 200,
|
|
21
24
|
closeDelay = 200,
|
|
@@ -25,7 +28,7 @@ const {
|
|
|
25
28
|
---
|
|
26
29
|
|
|
27
30
|
<div
|
|
28
|
-
class
|
|
31
|
+
class={tooltip({ class: className })}
|
|
29
32
|
data-state="closed"
|
|
30
33
|
data-open-delay={openDelay}
|
|
31
34
|
data-close-delay={closeDelay}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
3
4
|
|
|
4
5
|
type Props = HTMLAttributes<"div"> & {
|
|
5
6
|
/**
|
|
@@ -29,6 +30,48 @@ type Props = HTMLAttributes<"div"> & {
|
|
|
29
30
|
animationDuration?: number;
|
|
30
31
|
};
|
|
31
32
|
|
|
33
|
+
const tooltipContent = tv({
|
|
34
|
+
base: [
|
|
35
|
+
"starwind-tooltip-content",
|
|
36
|
+
"absolute z-50 hidden px-3 py-1.5 whitespace-nowrap shadow-sm",
|
|
37
|
+
"bg-popover text-popover-foreground rounded-md border",
|
|
38
|
+
"animate-in fade-in-0 zoom-in-95",
|
|
39
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]: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
|
+
});
|
|
74
|
+
|
|
32
75
|
const {
|
|
33
76
|
side = "top",
|
|
34
77
|
align = "center",
|
|
@@ -40,28 +83,7 @@ const {
|
|
|
40
83
|
---
|
|
41
84
|
|
|
42
85
|
<div
|
|
43
|
-
class
|
|
44
|
-
"starwind-tooltip-content",
|
|
45
|
-
"absolute z-50 hidden px-3 py-1.5 whitespace-nowrap shadow-sm",
|
|
46
|
-
"bg-popover text-popover-foreground rounded-md border",
|
|
47
|
-
"animate-in fade-in-0 zoom-in-95",
|
|
48
|
-
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
49
|
-
{
|
|
50
|
-
"slide-in-from-right-2 right-(--tooltip-offset)": side === "left",
|
|
51
|
-
"slide-in-from-left-2 left-(--tooltip-offset)": side === "right",
|
|
52
|
-
"slide-in-from-top-2 top-(--tooltip-offset)": side === "bottom",
|
|
53
|
-
"slide-in-from-bottom-2 bottom-(--tooltip-offset)": side === "top",
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"left-[50%] translate-x-[-50%]": align === "center" && (side === "top" || side === "bottom"),
|
|
57
|
-
"top-[50%] translate-y-[-50%]": align === "center" && (side === "left" || side === "right"),
|
|
58
|
-
"left-0": align === "start" && (side === "top" || side === "bottom"),
|
|
59
|
-
"right-0": align === "end" && (side === "top" || side === "bottom"),
|
|
60
|
-
"top-0": align === "start" && (side === "left" || side === "right"),
|
|
61
|
-
"bottom-0": align === "end" && (side === "left" || side === "right"),
|
|
62
|
-
},
|
|
63
|
-
className,
|
|
64
|
-
]}
|
|
86
|
+
class={tooltipContent({ side, align, class: className })}
|
|
65
87
|
data-state="closed"
|
|
66
88
|
data-side={side}
|
|
67
89
|
data-align={align}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starwind-ui/core",
|
|
3
|
-
"version": "1.
|
|
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",
|