create-better-t-stack 3.7.1 → 3.7.3
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 +1 -1
- package/dist/index.js +1 -1
- package/dist/{src-BmyCNYPk.js → src-b1TtTCMt.js} +29 -36
- package/package.json +2 -3
- package/templates/auth/better-auth/convex/native/base/lib/auth-client.ts.hbs +0 -2
- package/templates/auth/better-auth/web/react/base/src/lib/auth-client.ts.hbs +6 -2
- package/templates/auth/better-auth/web/react/tanstack-router/src/components/sign-in-form.tsx +117 -121
- package/templates/auth/better-auth/web/react/tanstack-router/src/components/sign-up-form.tsx +141 -145
- package/templates/auth/better-auth/web/react/tanstack-start/src/components/sign-in-form.tsx +117 -121
- package/templates/auth/better-auth/web/react/tanstack-start/src/components/sign-up-form.tsx +141 -145
- package/templates/auth/better-auth/web/solid/src/components/sign-in-form.tsx +3 -11
- package/templates/auth/better-auth/web/solid/src/components/sign-up-form.tsx +4 -14
- package/templates/backend/convex/packages/backend/convex/healthCheck.ts +2 -2
- package/templates/examples/ai/native/bare/polyfills.js +3 -7
- package/templates/examples/ai/native/unistyles/polyfills.js +3 -6
- package/templates/examples/ai/native/uniwind/polyfills.js +3 -7
- package/templates/examples/todo/server/drizzle/postgres/src/schema/todo.ts +1 -1
- package/templates/frontend/nuxt/package.json.hbs +1 -2
- package/templates/frontend/react/next/package.json.hbs +0 -1
- package/templates/frontend/react/react-router/package.json.hbs +1 -2
- package/templates/frontend/react/react-router/src/components/mode-toggle.tsx +3 -9
- package/templates/frontend/react/tanstack-router/package.json.hbs +1 -2
- package/templates/frontend/react/tanstack-router/src/components/mode-toggle.tsx +3 -9
- package/templates/frontend/react/tanstack-start/package.json.hbs +1 -2
- package/templates/frontend/react/web-base/src/components/ui/button.tsx +13 -16
- package/templates/frontend/react/web-base/src/components/ui/card.tsx +13 -30
- package/templates/frontend/react/web-base/src/components/ui/checkbox.tsx +8 -11
- package/templates/frontend/react/web-base/src/components/ui/dropdown-menu.tsx +37 -66
- package/templates/frontend/react/web-base/src/components/ui/input.tsx +5 -5
- package/templates/frontend/react/web-base/src/components/ui/label.tsx +7 -10
- package/templates/frontend/react/web-base/src/components/ui/skeleton.tsx +3 -3
- package/templates/frontend/react/web-base/src/lib/utils.ts +3 -3
- package/templates/frontend/solid/package.json.hbs +1 -2
- package/templates/frontend/svelte/package.json.hbs +1 -2
- package/templates/frontend/svelte/src/app.d.ts +7 -7
- package/templates/frontend/svelte/src/lib/index.ts +1 -0
- package/templates/frontend/svelte/vite.config.ts +4 -4
|
@@ -8,157 +8,153 @@ import { Button } from "./ui/button";
|
|
|
8
8
|
import { Input } from "./ui/input";
|
|
9
9
|
import { Label } from "./ui/label";
|
|
10
10
|
|
|
11
|
-
export default function SignUpForm({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})
|
|
16
|
-
const navigate = useNavigate({
|
|
17
|
-
from: "/",
|
|
18
|
-
});
|
|
19
|
-
const { isPending } = authClient.useSession();
|
|
11
|
+
export default function SignUpForm({ onSwitchToSignIn }: { onSwitchToSignIn: () => void }) {
|
|
12
|
+
const navigate = useNavigate({
|
|
13
|
+
from: "/",
|
|
14
|
+
});
|
|
15
|
+
const { isPending } = authClient.useSession();
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
17
|
+
const form = useForm({
|
|
18
|
+
defaultValues: {
|
|
19
|
+
email: "",
|
|
20
|
+
password: "",
|
|
21
|
+
name: "",
|
|
22
|
+
},
|
|
23
|
+
onSubmit: async ({ value }) => {
|
|
24
|
+
await authClient.signUp.email(
|
|
25
|
+
{
|
|
26
|
+
email: value.email,
|
|
27
|
+
password: value.password,
|
|
28
|
+
name: value.name,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
onSuccess: () => {
|
|
32
|
+
navigate({
|
|
33
|
+
to: "/dashboard",
|
|
34
|
+
});
|
|
35
|
+
toast.success("Sign up successful");
|
|
36
|
+
},
|
|
37
|
+
onError: (error) => {
|
|
38
|
+
toast.error(error.error.message || error.error.statusText);
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
},
|
|
43
|
+
validators: {
|
|
44
|
+
onSubmit: z.object({
|
|
45
|
+
name: z.string().min(2, "Name must be at least 2 characters"),
|
|
46
|
+
email: z.email("Invalid email address"),
|
|
47
|
+
password: z.string().min(8, "Password must be at least 8 characters"),
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
});
|
|
55
51
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
if (isPending) {
|
|
53
|
+
return <Loader />;
|
|
54
|
+
}
|
|
59
55
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
return (
|
|
57
|
+
<div className="mx-auto w-full mt-10 max-w-md p-6">
|
|
58
|
+
<h1 className="mb-6 text-center text-3xl font-bold">Create Account</h1>
|
|
63
59
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
60
|
+
<form
|
|
61
|
+
onSubmit={(e) => {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
e.stopPropagation();
|
|
64
|
+
form.handleSubmit();
|
|
65
|
+
}}
|
|
66
|
+
className="space-y-4"
|
|
67
|
+
>
|
|
68
|
+
<div>
|
|
69
|
+
<form.Field name="name">
|
|
70
|
+
{(field) => (
|
|
71
|
+
<div className="space-y-2">
|
|
72
|
+
<Label htmlFor={field.name}>Name</Label>
|
|
73
|
+
<Input
|
|
74
|
+
id={field.name}
|
|
75
|
+
name={field.name}
|
|
76
|
+
value={field.state.value}
|
|
77
|
+
onBlur={field.handleBlur}
|
|
78
|
+
onChange={(e) => field.handleChange(e.target.value)}
|
|
79
|
+
/>
|
|
80
|
+
{field.state.meta.errors.map((error) => (
|
|
81
|
+
<p key={error?.message} className="text-red-500">
|
|
82
|
+
{error?.message}
|
|
83
|
+
</p>
|
|
84
|
+
))}
|
|
85
|
+
</div>
|
|
86
|
+
)}
|
|
87
|
+
</form.Field>
|
|
88
|
+
</div>
|
|
93
89
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
90
|
+
<div>
|
|
91
|
+
<form.Field name="email">
|
|
92
|
+
{(field) => (
|
|
93
|
+
<div className="space-y-2">
|
|
94
|
+
<Label htmlFor={field.name}>Email</Label>
|
|
95
|
+
<Input
|
|
96
|
+
id={field.name}
|
|
97
|
+
name={field.name}
|
|
98
|
+
type="email"
|
|
99
|
+
value={field.state.value}
|
|
100
|
+
onBlur={field.handleBlur}
|
|
101
|
+
onChange={(e) => field.handleChange(e.target.value)}
|
|
102
|
+
/>
|
|
103
|
+
{field.state.meta.errors.map((error) => (
|
|
104
|
+
<p key={error?.message} className="text-red-500">
|
|
105
|
+
{error?.message}
|
|
106
|
+
</p>
|
|
107
|
+
))}
|
|
108
|
+
</div>
|
|
109
|
+
)}
|
|
110
|
+
</form.Field>
|
|
111
|
+
</div>
|
|
116
112
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
113
|
+
<div>
|
|
114
|
+
<form.Field name="password">
|
|
115
|
+
{(field) => (
|
|
116
|
+
<div className="space-y-2">
|
|
117
|
+
<Label htmlFor={field.name}>Password</Label>
|
|
118
|
+
<Input
|
|
119
|
+
id={field.name}
|
|
120
|
+
name={field.name}
|
|
121
|
+
type="password"
|
|
122
|
+
value={field.state.value}
|
|
123
|
+
onBlur={field.handleBlur}
|
|
124
|
+
onChange={(e) => field.handleChange(e.target.value)}
|
|
125
|
+
/>
|
|
126
|
+
{field.state.meta.errors.map((error) => (
|
|
127
|
+
<p key={error?.message} className="text-red-500">
|
|
128
|
+
{error?.message}
|
|
129
|
+
</p>
|
|
130
|
+
))}
|
|
131
|
+
</div>
|
|
132
|
+
)}
|
|
133
|
+
</form.Field>
|
|
134
|
+
</div>
|
|
139
135
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
136
|
+
<form.Subscribe>
|
|
137
|
+
{(state) => (
|
|
138
|
+
<Button
|
|
139
|
+
type="submit"
|
|
140
|
+
className="w-full"
|
|
141
|
+
disabled={!state.canSubmit || state.isSubmitting}
|
|
142
|
+
>
|
|
143
|
+
{state.isSubmitting ? "Submitting..." : "Sign Up"}
|
|
144
|
+
</Button>
|
|
145
|
+
)}
|
|
146
|
+
</form.Subscribe>
|
|
147
|
+
</form>
|
|
152
148
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
149
|
+
<div className="mt-4 text-center">
|
|
150
|
+
<Button
|
|
151
|
+
variant="link"
|
|
152
|
+
onClick={onSwitchToSignIn}
|
|
153
|
+
className="text-indigo-600 hover:text-indigo-800"
|
|
154
|
+
>
|
|
155
|
+
Already have an account? Sign In
|
|
156
|
+
</Button>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
);
|
|
164
160
|
}
|
|
@@ -4,11 +4,7 @@ import { useNavigate } from "@tanstack/solid-router";
|
|
|
4
4
|
import z from "zod";
|
|
5
5
|
import { For } from "solid-js";
|
|
6
6
|
|
|
7
|
-
export default function SignInForm({
|
|
8
|
-
onSwitchToSignUp,
|
|
9
|
-
}: {
|
|
10
|
-
onSwitchToSignUp: () => void;
|
|
11
|
-
}) {
|
|
7
|
+
export default function SignInForm({ onSwitchToSignUp }: { onSwitchToSignUp: () => void }) {
|
|
12
8
|
const navigate = useNavigate({
|
|
13
9
|
from: "/",
|
|
14
10
|
});
|
|
@@ -72,9 +68,7 @@ export default function SignInForm({
|
|
|
72
68
|
class="w-full rounded border p-2"
|
|
73
69
|
/>
|
|
74
70
|
<For each={field().state.meta.errors}>
|
|
75
|
-
{(error) =>
|
|
76
|
-
<p class="text-sm text-red-600">{error?.message}</p>
|
|
77
|
-
)}
|
|
71
|
+
{(error) => <p class="text-sm text-red-600">{error?.message}</p>}
|
|
78
72
|
</For>
|
|
79
73
|
</div>
|
|
80
74
|
)}
|
|
@@ -96,9 +90,7 @@ export default function SignInForm({
|
|
|
96
90
|
class="w-full rounded border p-2"
|
|
97
91
|
/>
|
|
98
92
|
<For each={field().state.meta.errors}>
|
|
99
|
-
{(error) =>
|
|
100
|
-
<p class="text-sm text-red-600">{error?.message}</p>
|
|
101
|
-
)}
|
|
93
|
+
{(error) => <p class="text-sm text-red-600">{error?.message}</p>}
|
|
102
94
|
</For>
|
|
103
95
|
</div>
|
|
104
96
|
)}
|
|
@@ -4,11 +4,7 @@ import { useNavigate } from "@tanstack/solid-router";
|
|
|
4
4
|
import z from "zod";
|
|
5
5
|
import { For } from "solid-js";
|
|
6
6
|
|
|
7
|
-
export default function SignUpForm({
|
|
8
|
-
onSwitchToSignIn,
|
|
9
|
-
}: {
|
|
10
|
-
onSwitchToSignIn: () => void;
|
|
11
|
-
}) {
|
|
7
|
+
export default function SignUpForm({ onSwitchToSignIn }: { onSwitchToSignIn: () => void }) {
|
|
12
8
|
const navigate = useNavigate({
|
|
13
9
|
from: "/",
|
|
14
10
|
});
|
|
@@ -74,9 +70,7 @@ export default function SignUpForm({
|
|
|
74
70
|
class="w-full rounded border p-2"
|
|
75
71
|
/>
|
|
76
72
|
<For each={field().state.meta.errors}>
|
|
77
|
-
{(error) =>
|
|
78
|
-
<p class="text-sm text-red-600">{error?.message}</p>
|
|
79
|
-
)}
|
|
73
|
+
{(error) => <p class="text-sm text-red-600">{error?.message}</p>}
|
|
80
74
|
</For>
|
|
81
75
|
</div>
|
|
82
76
|
)}
|
|
@@ -98,9 +92,7 @@ export default function SignUpForm({
|
|
|
98
92
|
class="w-full rounded border p-2"
|
|
99
93
|
/>
|
|
100
94
|
<For each={field().state.meta.errors}>
|
|
101
|
-
{(error) =>
|
|
102
|
-
<p class="text-sm text-red-600">{error?.message}</p>
|
|
103
|
-
)}
|
|
95
|
+
{(error) => <p class="text-sm text-red-600">{error?.message}</p>}
|
|
104
96
|
</For>
|
|
105
97
|
</div>
|
|
106
98
|
)}
|
|
@@ -122,9 +114,7 @@ export default function SignUpForm({
|
|
|
122
114
|
class="w-full rounded border p-2"
|
|
123
115
|
/>
|
|
124
116
|
<For each={field().state.meta.errors}>
|
|
125
|
-
{(error) =>
|
|
126
|
-
<p class="text-sm text-red-600">{error?.message}</p>
|
|
127
|
-
)}
|
|
117
|
+
{(error) => <p class="text-sm text-red-600">{error?.message}</p>}
|
|
128
118
|
</For>
|
|
129
119
|
</div>
|
|
130
120
|
)}
|
|
@@ -3,13 +3,10 @@ import { Platform } from "react-native";
|
|
|
3
3
|
|
|
4
4
|
if (Platform.OS !== "web") {
|
|
5
5
|
const setupPolyfills = async () => {
|
|
6
|
-
const { polyfillGlobal } = await import(
|
|
7
|
-
"react-native/Libraries/Utilities/PolyfillFunctions"
|
|
8
|
-
);
|
|
6
|
+
const { polyfillGlobal } = await import("react-native/Libraries/Utilities/PolyfillFunctions");
|
|
9
7
|
|
|
10
|
-
const { TextEncoderStream, TextDecoderStream } =
|
|
11
|
-
"@stardazed/streams-text-encoding"
|
|
12
|
-
);
|
|
8
|
+
const { TextEncoderStream, TextDecoderStream } =
|
|
9
|
+
await import("@stardazed/streams-text-encoding");
|
|
13
10
|
|
|
14
11
|
if (!("structuredClone" in global)) {
|
|
15
12
|
polyfillGlobal("structuredClone", () => structuredClone);
|
|
@@ -23,4 +20,3 @@ if (Platform.OS !== "web") {
|
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
export {};
|
|
26
|
-
|
|
@@ -3,13 +3,10 @@ import { Platform } from "react-native";
|
|
|
3
3
|
|
|
4
4
|
if (Platform.OS !== "web") {
|
|
5
5
|
const setupPolyfills = async () => {
|
|
6
|
-
const { polyfillGlobal } = await import(
|
|
7
|
-
"react-native/Libraries/Utilities/PolyfillFunctions"
|
|
8
|
-
);
|
|
6
|
+
const { polyfillGlobal } = await import("react-native/Libraries/Utilities/PolyfillFunctions");
|
|
9
7
|
|
|
10
|
-
const { TextEncoderStream, TextDecoderStream } =
|
|
11
|
-
"@stardazed/streams-text-encoding"
|
|
12
|
-
);
|
|
8
|
+
const { TextEncoderStream, TextDecoderStream } =
|
|
9
|
+
await import("@stardazed/streams-text-encoding");
|
|
13
10
|
|
|
14
11
|
if (!("structuredClone" in global)) {
|
|
15
12
|
polyfillGlobal("structuredClone", () => structuredClone);
|
|
@@ -3,13 +3,10 @@ import { Platform } from "react-native";
|
|
|
3
3
|
|
|
4
4
|
if (Platform.OS !== "web") {
|
|
5
5
|
const setupPolyfills = async () => {
|
|
6
|
-
const { polyfillGlobal } = await import(
|
|
7
|
-
"react-native/Libraries/Utilities/PolyfillFunctions"
|
|
8
|
-
);
|
|
6
|
+
const { polyfillGlobal } = await import("react-native/Libraries/Utilities/PolyfillFunctions");
|
|
9
7
|
|
|
10
|
-
const { TextEncoderStream, TextDecoderStream } =
|
|
11
|
-
"@stardazed/streams-text-encoding"
|
|
12
|
-
);
|
|
8
|
+
const { TextEncoderStream, TextDecoderStream } =
|
|
9
|
+
await import("@stardazed/streams-text-encoding");
|
|
13
10
|
|
|
14
11
|
if (!("structuredClone" in global)) {
|
|
15
12
|
polyfillGlobal("structuredClone", () => structuredClone);
|
|
@@ -23,4 +20,3 @@ if (Platform.OS !== "web") {
|
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
export {};
|
|
26
|
-
|
|
@@ -3,5 +3,5 @@ import { pgTable, text, boolean, serial } from "drizzle-orm/pg-core";
|
|
|
3
3
|
export const todo = pgTable("todo", {
|
|
4
4
|
id: serial("id").primaryKey(),
|
|
5
5
|
text: text("text").notNull(),
|
|
6
|
-
completed: boolean("completed").default(false).notNull()
|
|
6
|
+
completed: boolean("completed").default(false).notNull(),
|
|
7
7
|
});
|
|
@@ -22,15 +22,9 @@ export function ModeToggle() {
|
|
|
22
22
|
</Button>
|
|
23
23
|
</DropdownMenuTrigger>
|
|
24
24
|
<DropdownMenuContent align="end">
|
|
25
|
-
<DropdownMenuItem onClick={() => setTheme("light")}>
|
|
26
|
-
|
|
27
|
-
</DropdownMenuItem>
|
|
28
|
-
<DropdownMenuItem onClick={() => setTheme("dark")}>
|
|
29
|
-
Dark
|
|
30
|
-
</DropdownMenuItem>
|
|
31
|
-
<DropdownMenuItem onClick={() => setTheme("system")}>
|
|
32
|
-
System
|
|
33
|
-
</DropdownMenuItem>
|
|
25
|
+
<DropdownMenuItem onClick={() => setTheme("light")}>Light</DropdownMenuItem>
|
|
26
|
+
<DropdownMenuItem onClick={() => setTheme("dark")}>Dark</DropdownMenuItem>
|
|
27
|
+
<DropdownMenuItem onClick={() => setTheme("system")}>System</DropdownMenuItem>
|
|
34
28
|
</DropdownMenuContent>
|
|
35
29
|
</DropdownMenu>
|
|
36
30
|
);
|
|
@@ -22,15 +22,9 @@ export function ModeToggle() {
|
|
|
22
22
|
</Button>
|
|
23
23
|
</DropdownMenuTrigger>
|
|
24
24
|
<DropdownMenuContent align="end">
|
|
25
|
-
<DropdownMenuItem onClick={() => setTheme("light")}>
|
|
26
|
-
|
|
27
|
-
</DropdownMenuItem>
|
|
28
|
-
<DropdownMenuItem onClick={() => setTheme("dark")}>
|
|
29
|
-
Dark
|
|
30
|
-
</DropdownMenuItem>
|
|
31
|
-
<DropdownMenuItem onClick={() => setTheme("system")}>
|
|
32
|
-
System
|
|
33
|
-
</DropdownMenuItem>
|
|
25
|
+
<DropdownMenuItem onClick={() => setTheme("light")}>Light</DropdownMenuItem>
|
|
26
|
+
<DropdownMenuItem onClick={() => setTheme("dark")}>Dark</DropdownMenuItem>
|
|
27
|
+
<DropdownMenuItem onClick={() => setTheme("system")}>System</DropdownMenuItem>
|
|
34
28
|
</DropdownMenuContent>
|
|
35
29
|
</DropdownMenu>
|
|
36
30
|
);
|
|
@@ -26,8 +26,7 @@
|
|
|
26
26
|
"tailwindcss": "^4.1.3",
|
|
27
27
|
"tailwind-merge": "^3.3.1",
|
|
28
28
|
"tw-animate-css": "^1.2.5",
|
|
29
|
-
"vite-tsconfig-paths": "^5.1.4"
|
|
30
|
-
"zod": "^4.0.2"
|
|
29
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
31
30
|
},
|
|
32
31
|
"devDependencies": {
|
|
33
32
|
"@tanstack/react-router-devtools": {{#if (eq auth "clerk")}}"1.134.4"{{else}}"^1.132.31"{{/if}},
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { Slot as SlotPrimitive } from "radix-ui"
|
|
3
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Slot as SlotPrimitive } from "radix-ui";
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
4
|
|
|
5
|
-
import { cn } from "@/lib/utils"
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
6
|
|
|
7
7
|
const buttonVariants = cva(
|
|
8
8
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
default:
|
|
13
|
-
"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
12
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
14
13
|
destructive:
|
|
15
14
|
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
16
15
|
outline:
|
|
17
16
|
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
18
|
-
secondary:
|
|
19
|
-
|
|
20
|
-
ghost:
|
|
21
|
-
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
17
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
18
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
22
19
|
link: "text-primary underline-offset-4 hover:underline",
|
|
23
20
|
},
|
|
24
21
|
size: {
|
|
@@ -32,8 +29,8 @@ const buttonVariants = cva(
|
|
|
32
29
|
variant: "default",
|
|
33
30
|
size: "default",
|
|
34
31
|
},
|
|
35
|
-
}
|
|
36
|
-
)
|
|
32
|
+
},
|
|
33
|
+
);
|
|
37
34
|
|
|
38
35
|
function Button({
|
|
39
36
|
className,
|
|
@@ -43,9 +40,9 @@ function Button({
|
|
|
43
40
|
...props
|
|
44
41
|
}: React.ComponentProps<"button"> &
|
|
45
42
|
VariantProps<typeof buttonVariants> & {
|
|
46
|
-
asChild?: boolean
|
|
43
|
+
asChild?: boolean;
|
|
47
44
|
}) {
|
|
48
|
-
const Comp = asChild ? SlotPrimitive.Slot : "button"
|
|
45
|
+
const Comp = asChild ? SlotPrimitive.Slot : "button";
|
|
49
46
|
|
|
50
47
|
return (
|
|
51
48
|
<Comp
|
|
@@ -53,7 +50,7 @@ function Button({
|
|
|
53
50
|
className={cn(buttonVariants({ variant, size, className }))}
|
|
54
51
|
{...props}
|
|
55
52
|
/>
|
|
56
|
-
)
|
|
53
|
+
);
|
|
57
54
|
}
|
|
58
55
|
|
|
59
|
-
export { Button, buttonVariants }
|
|
56
|
+
export { Button, buttonVariants };
|