@tioelvis/next-template 2.4.2 → 2.4.5

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.4.2",
3
+ "version": "2.4.5",
4
4
  "description": "CLI to scaffold a Next.js + Tailwind project using shadcn/ui components",
5
5
  "type": "module",
6
6
  "bin": {
@@ -54,6 +54,8 @@
54
54
  "@radix-ui/react-slot": "^1.2.3",
55
55
  "@radix-ui/react-switch": "^1.2.5",
56
56
  "@radix-ui/react-tabs": "^1.1.12",
57
+ "@radix-ui/react-toggle": "^1.1.9",
58
+ "@radix-ui/react-toggle-group": "^1.1.10",
57
59
  "@radix-ui/react-tooltip": "^1.2.7",
58
60
  "@tailwindcss/postcss": "^4.1.11",
59
61
  "@tanstack/react-query": "^5.83.0",
@@ -0,0 +1,6 @@
1
+ {
2
+ "dependencies": [],
3
+ "dev_dependence": [],
4
+ "hooks": [],
5
+ "supports": []
6
+ }
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+
3
+ import { cn } from "@/lib/utils";
4
+
5
+ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
6
+ return (
7
+ <textarea
8
+ data-slot="textarea"
9
+ className={cn(
10
+ "border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 text-sm",
11
+ className
12
+ )}
13
+ {...props}
14
+ />
15
+ );
16
+ }
17
+
18
+ export { Textarea };
@@ -0,0 +1,6 @@
1
+ {
2
+ "dependencies": ["@radix-ui/react-toggle-group"],
3
+ "dev_dependence": [],
4
+ "hooks": [],
5
+ "supports": ["toggle"]
6
+ }
@@ -0,0 +1,71 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
5
+ import { type VariantProps } from "class-variance-authority";
6
+
7
+ import { cn } from "@/lib/utils";
8
+ import { toggleVariants } from "@/components/ui/toggle";
9
+
10
+ const ToggleGroupContext = React.createContext<
11
+ VariantProps<typeof toggleVariants>
12
+ >({
13
+ size: "default",
14
+ variant: "default",
15
+ });
16
+
17
+ function ToggleGroup({
18
+ className,
19
+ variant,
20
+ size,
21
+ children,
22
+ ...props
23
+ }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &
24
+ VariantProps<typeof toggleVariants>) {
25
+ return (
26
+ <ToggleGroupPrimitive.Root
27
+ data-slot="toggle-group"
28
+ data-variant={variant}
29
+ data-size={size}
30
+ className={cn(
31
+ "group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",
32
+ className
33
+ )}
34
+ {...props}>
35
+ <ToggleGroupContext.Provider value={{ variant, size }}>
36
+ {children}
37
+ </ToggleGroupContext.Provider>
38
+ </ToggleGroupPrimitive.Root>
39
+ );
40
+ }
41
+
42
+ function ToggleGroupItem({
43
+ className,
44
+ children,
45
+ variant,
46
+ size,
47
+ ...props
48
+ }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &
49
+ VariantProps<typeof toggleVariants>) {
50
+ const context = React.useContext(ToggleGroupContext);
51
+
52
+ return (
53
+ <ToggleGroupPrimitive.Item
54
+ data-slot="toggle-group-item"
55
+ data-variant={context.variant || variant}
56
+ data-size={context.size || size}
57
+ className={cn(
58
+ toggleVariants({
59
+ variant: context.variant || variant,
60
+ size: context.size || size,
61
+ }),
62
+ "min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",
63
+ className
64
+ )}
65
+ {...props}>
66
+ {children}
67
+ </ToggleGroupPrimitive.Item>
68
+ );
69
+ }
70
+
71
+ export { ToggleGroup, ToggleGroupItem };
@@ -0,0 +1,6 @@
1
+ {
2
+ "dependencies": ["@radix-ui/react-toggle"],
3
+ "dev_dependence": [],
4
+ "hooks": [],
5
+ "supports": []
6
+ }
@@ -0,0 +1,47 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as TogglePrimitive from "@radix-ui/react-toggle";
5
+ import { cva, type VariantProps } from "class-variance-authority";
6
+
7
+ import { cn } from "@/lib/utils";
8
+
9
+ const toggleVariants = cva(
10
+ "inline-flex items-center cursor-pointer justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
11
+ {
12
+ variants: {
13
+ variant: {
14
+ default: "bg-transparent",
15
+ outline:
16
+ "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
17
+ },
18
+ size: {
19
+ default: "h-9 px-2 min-w-9",
20
+ sm: "h-8 px-1.5 min-w-8",
21
+ lg: "h-10 px-2.5 min-w-10",
22
+ },
23
+ },
24
+ defaultVariants: {
25
+ variant: "default",
26
+ size: "default",
27
+ },
28
+ }
29
+ );
30
+
31
+ function Toggle({
32
+ className,
33
+ variant,
34
+ size,
35
+ ...props
36
+ }: React.ComponentProps<typeof TogglePrimitive.Root> &
37
+ VariantProps<typeof toggleVariants>) {
38
+ return (
39
+ <TogglePrimitive.Root
40
+ data-slot="toggle"
41
+ className={cn(toggleVariants({ variant, size, className }))}
42
+ {...props}
43
+ />
44
+ );
45
+ }
46
+
47
+ export { Toggle, toggleVariants };
package/src/constants.js CHANGED
@@ -80,6 +80,9 @@ const COMPONENTS = [
80
80
  "switch",
81
81
  "table",
82
82
  "tabs",
83
+ "textarea",
84
+ "toggle",
85
+ "toggle-group",
83
86
  ];
84
87
 
85
88
  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,