@tioelvis/next-template 2.3.8 → 2.4.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tioelvis/next-template",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "CLI to scaffold a Next.js + Tailwind project using shadcn/ui components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"@radix-ui/react-separator": "^1.1.7",
|
|
53
53
|
"@radix-ui/react-slider": "^1.3.5",
|
|
54
54
|
"@radix-ui/react-slot": "^1.2.3",
|
|
55
|
+
"@radix-ui/react-switch": "^1.2.5",
|
|
55
56
|
"@radix-ui/react-tooltip": "^1.2.7",
|
|
56
57
|
"@tailwindcss/postcss": "^4.1.11",
|
|
57
58
|
"@tanstack/react-query": "^5.83.0",
|
|
@@ -78,6 +79,7 @@
|
|
|
78
79
|
"react-hook-form": "^7.61.1",
|
|
79
80
|
"react-resizable-panels": "^3.0.3",
|
|
80
81
|
"recharts": "^2.15.4",
|
|
82
|
+
"sonner": "^2.0.6",
|
|
81
83
|
"tailwind-merge": "^3.3.1",
|
|
82
84
|
"tailwindcss": "^4.1.11",
|
|
83
85
|
"tw-animate-css": "^1.3.6",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useTheme } from "next-themes";
|
|
4
|
+
import { Toaster as Sonner, ToasterProps } from "sonner";
|
|
5
|
+
|
|
6
|
+
const Toaster = ({ ...props }: ToasterProps) => {
|
|
7
|
+
const { theme = "system" } = useTheme();
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<Sonner
|
|
11
|
+
theme={theme as ToasterProps["theme"]}
|
|
12
|
+
className="toaster group"
|
|
13
|
+
style={
|
|
14
|
+
{
|
|
15
|
+
"--normal-bg": "var(--popover)",
|
|
16
|
+
"--normal-text": "var(--popover-foreground)",
|
|
17
|
+
"--normal-border": "var(--border)",
|
|
18
|
+
} as React.CSSProperties
|
|
19
|
+
}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { Toaster };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils";
|
|
7
|
+
|
|
8
|
+
function Switch({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof SwitchPrimitive.Root>) {
|
|
12
|
+
return (
|
|
13
|
+
<SwitchPrimitive.Root
|
|
14
|
+
data-slot="switch"
|
|
15
|
+
className={cn(
|
|
16
|
+
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...props}>
|
|
20
|
+
<SwitchPrimitive.Thumb
|
|
21
|
+
data-slot="switch-thumb"
|
|
22
|
+
className={cn(
|
|
23
|
+
"bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground cursor-pointer block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
|
|
24
|
+
)}
|
|
25
|
+
/>
|
|
26
|
+
</SwitchPrimitive.Root>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { Switch };
|
package/src/constants.js
CHANGED
package/src/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
copy_components,
|
|
@@ -116,7 +116,7 @@ process.on("SIGINT", () => on_cancel());
|
|
|
116
116
|
);
|
|
117
117
|
|
|
118
118
|
// Install dependencies
|
|
119
|
-
console.log(chalk.cyan("⬇️
|
|
119
|
+
console.log(chalk.cyan("⬇️ Installing dependencies..."));
|
|
120
120
|
|
|
121
121
|
if (package_manager === "npm") {
|
|
122
122
|
run_command(`npm install ${DEPENDENCIES.join(" ")}`, DEST);
|
|
@@ -131,10 +131,18 @@ process.on("SIGINT", () => on_cancel());
|
|
|
131
131
|
// Finish project
|
|
132
132
|
console.log(
|
|
133
133
|
chalk.yellow(
|
|
134
|
-
"
|
|
134
|
+
"⚠️ IMPORTANT: make sure to add your variable NEXT_PUBLIC_API in the .env file, e.g.: NEXT_PUBLIC_API=http://localhost:9000"
|
|
135
135
|
)
|
|
136
136
|
);
|
|
137
137
|
|
|
138
|
+
if (components.some((e) => e === "sonner") === true) {
|
|
139
|
+
console.log(
|
|
140
|
+
chalk.yellow(
|
|
141
|
+
"⚠️ IMPORTANT: you install the sonner component. Don't forget to add the Toaster in your layout"
|
|
142
|
+
)
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
138
146
|
console.log(
|
|
139
147
|
chalk.green(`\n✅ Project ${project_name} created successfully! 🚀`)
|
|
140
148
|
);
|
|
@@ -206,6 +214,13 @@ process.on("SIGINT", () => on_cancel());
|
|
|
206
214
|
}
|
|
207
215
|
|
|
208
216
|
// Finish project
|
|
217
|
+
if (components.some((e) => e === "sonner") === true) {
|
|
218
|
+
console.log(
|
|
219
|
+
chalk.yellow(
|
|
220
|
+
"⚠️ IMPORTANT: you install the sonner component. Don't forget to add the Toaster in your layout"
|
|
221
|
+
)
|
|
222
|
+
);
|
|
223
|
+
}
|
|
209
224
|
console.log(chalk.green("\n✅ Components add successfully!"));
|
|
210
225
|
} catch (error) {
|
|
211
226
|
console.error(chalk.red("❌ Internal error:"), error.message);
|