@betterstart/cli 0.1.74 → 0.1.76
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/cli.js +4 -3
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/templates/ui/button.tsx +29 -28
- package/templates/ui/card.tsx +1 -1
package/package.json
CHANGED
package/templates/ui/button.tsx
CHANGED
|
@@ -1,56 +1,57 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { cva, type VariantProps } from
|
|
3
|
-
import { Slot } from
|
|
4
|
-
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
import { Slot } from "radix-ui"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@cms/utils/cn"
|
|
5
6
|
|
|
6
7
|
const buttonVariants = cva(
|
|
7
|
-
"
|
|
8
|
+
"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 min-w-25",
|
|
8
9
|
{
|
|
9
10
|
variants: {
|
|
10
11
|
variant: {
|
|
11
|
-
default:
|
|
12
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
12
13
|
outline:
|
|
13
|
-
|
|
14
|
+
"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
14
15
|
secondary:
|
|
15
|
-
|
|
16
|
+
"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
16
17
|
ghost:
|
|
17
|
-
|
|
18
|
+
"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
18
19
|
destructive:
|
|
19
|
-
|
|
20
|
-
link:
|
|
20
|
+
"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
21
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
21
22
|
},
|
|
22
23
|
size: {
|
|
23
24
|
default:
|
|
24
|
-
|
|
25
|
-
xs: "h-
|
|
26
|
-
sm: "h-9 gap-1 rounded-[min(var(--radius-md),12px)] px-
|
|
27
|
-
lg:
|
|
28
|
-
icon:
|
|
29
|
-
|
|
25
|
+
"h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
26
|
+
xs: "h-7 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
27
|
+
sm: "h-9 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
28
|
+
lg: "h-12 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
|
|
29
|
+
icon: "size-8",
|
|
30
|
+
"icon-xs":
|
|
30
31
|
"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
32
|
+
"icon-sm":
|
|
33
|
+
"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
34
|
+
"icon-lg": "size-9",
|
|
35
|
+
},
|
|
35
36
|
},
|
|
36
37
|
defaultVariants: {
|
|
37
|
-
variant:
|
|
38
|
-
size:
|
|
39
|
-
}
|
|
38
|
+
variant: "default",
|
|
39
|
+
size: "default",
|
|
40
|
+
},
|
|
40
41
|
}
|
|
41
42
|
)
|
|
42
43
|
|
|
43
44
|
function Button({
|
|
44
45
|
className,
|
|
45
|
-
variant =
|
|
46
|
-
size =
|
|
46
|
+
variant = "default",
|
|
47
|
+
size = "default",
|
|
47
48
|
asChild = false,
|
|
48
49
|
...props
|
|
49
|
-
}: React.ComponentProps<
|
|
50
|
+
}: React.ComponentProps<"button"> &
|
|
50
51
|
VariantProps<typeof buttonVariants> & {
|
|
51
52
|
asChild?: boolean
|
|
52
53
|
}) {
|
|
53
|
-
const Comp = asChild ? Slot.Root :
|
|
54
|
+
const Comp = asChild ? Slot.Root : "button"
|
|
54
55
|
|
|
55
56
|
return (
|
|
56
57
|
<Comp
|
package/templates/ui/card.tsx
CHANGED
|
@@ -12,7 +12,7 @@ function Card({
|
|
|
12
12
|
data-slot="card"
|
|
13
13
|
data-size={size}
|
|
14
14
|
className={cn(
|
|
15
|
-
"group/card flex flex-col gap-6 overflow-hidden rounded-xl bg-card py-6 text-sm text-card-foreground has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl material-
|
|
15
|
+
"group/card flex flex-col gap-6 overflow-hidden rounded-xl bg-card py-6 text-sm text-card-foreground has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl material-md",
|
|
16
16
|
className
|
|
17
17
|
)}
|
|
18
18
|
{...props}
|