@tioelvis/next-template 2.3.7 → 2.3.9

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.7",
3
+ "version": "2.3.9",
4
4
  "description": "CLI to scaffold a Next.js + Tailwind project using shadcn/ui components",
5
5
  "type": "module",
6
6
  "bin": {
@@ -50,6 +50,7 @@
50
50
  "@radix-ui/react-scroll-area": "^1.2.9",
51
51
  "@radix-ui/react-select": "^2.2.5",
52
52
  "@radix-ui/react-separator": "^1.1.7",
53
+ "@radix-ui/react-slider": "^1.3.5",
53
54
  "@radix-ui/react-slot": "^1.2.3",
54
55
  "@radix-ui/react-tooltip": "^1.2.7",
55
56
  "@tailwindcss/postcss": "^4.1.11",
@@ -77,6 +78,7 @@
77
78
  "react-hook-form": "^7.61.1",
78
79
  "react-resizable-panels": "^3.0.3",
79
80
  "recharts": "^2.15.4",
81
+ "sonner": "^2.0.6",
80
82
  "tailwind-merge": "^3.3.1",
81
83
  "tailwindcss": "^4.1.11",
82
84
  "tw-animate-css": "^1.3.6",
@@ -0,0 +1,6 @@
1
+ {
2
+ "dependencies": ["@radix-ui/react-slider"],
3
+ "dev_dependence": [],
4
+ "hooks": [],
5
+ "supports": []
6
+ }
@@ -0,0 +1,61 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as SliderPrimitive from "@radix-ui/react-slider";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ function Slider({
9
+ className,
10
+ defaultValue,
11
+ value,
12
+ min = 0,
13
+ max = 100,
14
+ ...props
15
+ }: React.ComponentProps<typeof SliderPrimitive.Root>) {
16
+ const _values = React.useMemo(
17
+ () =>
18
+ Array.isArray(value)
19
+ ? value
20
+ : Array.isArray(defaultValue)
21
+ ? defaultValue
22
+ : [min, max],
23
+ [value, defaultValue, min, max]
24
+ );
25
+
26
+ return (
27
+ <SliderPrimitive.Root
28
+ data-slot="slider"
29
+ defaultValue={defaultValue}
30
+ value={value}
31
+ min={min}
32
+ max={max}
33
+ className={cn(
34
+ "relative flex w-full touch-none items-center cursor-pointer select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
35
+ className
36
+ )}
37
+ {...props}>
38
+ <SliderPrimitive.Track
39
+ data-slot="slider-track"
40
+ className={cn(
41
+ "bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
42
+ )}>
43
+ <SliderPrimitive.Range
44
+ data-slot="slider-range"
45
+ className={cn(
46
+ "bg-primary cursor-pointer absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
47
+ )}
48
+ />
49
+ </SliderPrimitive.Track>
50
+ {Array.from({ length: _values.length }, (_, index) => (
51
+ <SliderPrimitive.Thumb
52
+ data-slot="slider-thumb"
53
+ key={index}
54
+ className="cursor-pointer border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50"
55
+ />
56
+ ))}
57
+ </SliderPrimitive.Root>
58
+ );
59
+ }
60
+
61
+ export { Slider };
@@ -0,0 +1,6 @@
1
+ {
2
+ "dependencies": ["sonner"],
3
+ "dev_dependence": [],
4
+ "hooks": [],
5
+ "supports": []
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 };
package/src/constants.js CHANGED
@@ -75,6 +75,8 @@ const COMPONENTS = [
75
75
  "sheet",
76
76
  "sidebar",
77
77
  "skeleton",
78
+ "slider",
79
+ "sonner",
78
80
  ];
79
81
 
80
82
  export {
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("⬇️ Installing dependencies..."));
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
- "📄 IMPORTANT: make sure to add your variable NEXT_PUBLIC_API in the .env file, e.g.: NEXT_PUBLIC_API=http://localhost:9000"
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);