create-huenei-template 0.2.16 → 0.2.17

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.
Files changed (107) hide show
  1. package/dist/templates/frontend/pre-sales/.cursor/agents/pre-sales-builder.agent.md +92 -77
  2. package/dist/templates/frontend/pre-sales/.cursor/agents/pre-sales-demo-runner.agent.md +36 -0
  3. package/dist/templates/frontend/pre-sales/.cursor/agents/pre-sales-deploy.agent.md +87 -80
  4. package/dist/templates/frontend/pre-sales/.cursor/agents/qa-test-expert.agent.md +48 -49
  5. package/dist/templates/frontend/pre-sales/.cursor/commands/deploy-demo.md +73 -0
  6. package/dist/templates/frontend/pre-sales/.cursor/commands/new-component.md +192 -232
  7. package/dist/templates/frontend/pre-sales/.cursor/commands/prepare-deploy.md +135 -134
  8. package/dist/templates/frontend/pre-sales/.cursor/commands/ver-demo.md +58 -0
  9. package/dist/templates/frontend/pre-sales/.cursor/context/pre-sales.md +2 -0
  10. package/dist/templates/frontend/pre-sales/.cursor/hooks/injectPreSalesContext.ts +24 -1
  11. package/dist/templates/frontend/pre-sales/.cursor/hooks.json +23 -26
  12. package/dist/templates/frontend/pre-sales/.cursor/mcp.json +1 -5
  13. package/dist/templates/frontend/pre-sales/.cursor/rules/architech.mdc +199 -206
  14. package/dist/templates/frontend/pre-sales/.cursor/rules/component-patterns.mdc +4 -0
  15. package/dist/templates/frontend/pre-sales/.cursor/rules/deployment-ready.mdc +52 -52
  16. package/dist/templates/frontend/pre-sales/.cursor/rules/domain-business-bootstrap.mdc +74 -0
  17. package/dist/templates/frontend/pre-sales/.cursor/rules/pre-sales-mode.mdc +104 -60
  18. package/dist/templates/frontend/pre-sales/.cursor/rules/separation-of-concerns.mdc +41 -42
  19. package/dist/templates/frontend/pre-sales/.cursor/skills/deploy-to-vercel/SKILL.md +296 -0
  20. package/dist/templates/frontend/pre-sales/.cursor/skills/deploy-to-vercel/resources/deploy-codex.sh +301 -0
  21. package/dist/templates/frontend/pre-sales/.cursor/skills/deploy-to-vercel/resources/deploy.sh +301 -0
  22. package/dist/templates/frontend/pre-sales/.impeccable.md +26 -0
  23. package/dist/templates/frontend/pre-sales/index.html +11 -2
  24. package/dist/templates/frontend/pre-sales/src/__tests__/components/layout/navbar.test.tsx +0 -1
  25. package/dist/templates/frontend/pre-sales/src/__tests__/components/layout/sidebar.test.tsx +58 -68
  26. package/dist/templates/frontend/pre-sales/src/__tests__/hooks/useAuth.test.tsx +2 -1
  27. package/dist/templates/frontend/pre-sales/src/__tests__/lib/auth.test.ts +102 -102
  28. package/dist/templates/frontend/pre-sales/src/__tests__/routes/__root.test.tsx +72 -72
  29. package/dist/templates/frontend/pre-sales/src/__tests__/routes/_authenticated.test.tsx +57 -58
  30. package/dist/templates/frontend/pre-sales/src/__tests__/routes/index.test.tsx +8 -43
  31. package/dist/templates/frontend/pre-sales/src/components/layout/navbar.tsx +121 -75
  32. package/dist/templates/frontend/pre-sales/src/components/layout/sidebar.tsx +42 -30
  33. package/dist/templates/frontend/pre-sales/src/components/providers/auth-provider.tsx +60 -0
  34. package/dist/templates/frontend/pre-sales/src/components/ui/button.tsx +1 -1
  35. package/dist/templates/frontend/pre-sales/src/components/ui/card.tsx +1 -1
  36. package/dist/templates/frontend/pre-sales/src/components/ui/combobox.tsx +308 -308
  37. package/dist/templates/frontend/pre-sales/src/components/ui/command.tsx +179 -182
  38. package/dist/templates/frontend/pre-sales/src/components/ui/input.tsx +2 -0
  39. package/dist/templates/frontend/pre-sales/src/components/ui/textarea.tsx +2 -0
  40. package/dist/templates/frontend/pre-sales/src/components/ui/theme-toggle.tsx +35 -0
  41. package/dist/templates/frontend/pre-sales/src/data/dashboard.ts +249 -255
  42. package/dist/templates/frontend/pre-sales/src/hooks/useAuth.ts +13 -0
  43. package/dist/templates/frontend/pre-sales/src/hooks/useTheme.ts +73 -0
  44. package/dist/templates/frontend/pre-sales/src/index.css +282 -134
  45. package/dist/templates/frontend/pre-sales/src/main.tsx +3 -2
  46. package/dist/templates/frontend/pre-sales/src/routes/__root.tsx +62 -54
  47. package/dist/templates/frontend/pre-sales/src/routes/_authenticated/app.tsx +20 -0
  48. package/dist/templates/frontend/pre-sales/src/routes/_authenticated.tsx +5 -4
  49. package/dist/templates/frontend/pre-sales/src/routes/auth/iniciar-sesion.tsx +173 -163
  50. package/dist/templates/frontend/pre-sales/src/routes/index.tsx +53 -198
  51. package/dist/templates/frontend/pre-sales/src/test/utils.tsx +2 -1
  52. package/dist/templates/frontend/pre-sales/src/vite-env.d.ts +11 -0
  53. package/package.json +1 -1
  54. package/templates/frontend/pre-sales/.cursor/agents/pre-sales-builder.agent.md +92 -77
  55. package/templates/frontend/pre-sales/.cursor/agents/pre-sales-demo-runner.agent.md +36 -0
  56. package/templates/frontend/pre-sales/.cursor/agents/pre-sales-deploy.agent.md +87 -80
  57. package/templates/frontend/pre-sales/.cursor/agents/qa-test-expert.agent.md +48 -49
  58. package/templates/frontend/pre-sales/.cursor/commands/deploy-demo.md +73 -0
  59. package/templates/frontend/pre-sales/.cursor/commands/new-component.md +192 -232
  60. package/templates/frontend/pre-sales/.cursor/commands/prepare-deploy.md +135 -134
  61. package/templates/frontend/pre-sales/.cursor/commands/ver-demo.md +58 -0
  62. package/templates/frontend/pre-sales/.cursor/context/pre-sales.md +2 -0
  63. package/templates/frontend/pre-sales/.cursor/hooks/injectPreSalesContext.ts +24 -1
  64. package/templates/frontend/pre-sales/.cursor/hooks.json +23 -26
  65. package/templates/frontend/pre-sales/.cursor/mcp.json +1 -5
  66. package/templates/frontend/pre-sales/.cursor/rules/architech.mdc +199 -206
  67. package/templates/frontend/pre-sales/.cursor/rules/component-patterns.mdc +4 -0
  68. package/templates/frontend/pre-sales/.cursor/rules/deployment-ready.mdc +52 -52
  69. package/templates/frontend/pre-sales/.cursor/rules/domain-business-bootstrap.mdc +74 -0
  70. package/templates/frontend/pre-sales/.cursor/rules/pre-sales-mode.mdc +104 -60
  71. package/templates/frontend/pre-sales/.cursor/rules/separation-of-concerns.mdc +41 -42
  72. package/templates/frontend/pre-sales/.cursor/skills/deploy-to-vercel/SKILL.md +296 -0
  73. package/templates/frontend/pre-sales/.cursor/skills/deploy-to-vercel/resources/deploy-codex.sh +301 -0
  74. package/templates/frontend/pre-sales/.cursor/skills/deploy-to-vercel/resources/deploy.sh +301 -0
  75. package/templates/frontend/pre-sales/.impeccable.md +26 -0
  76. package/templates/frontend/pre-sales/index.html +11 -2
  77. package/templates/frontend/pre-sales/pnpm-lock.yaml +6448 -0
  78. package/templates/frontend/pre-sales/skills-lock.json +10 -0
  79. package/templates/frontend/pre-sales/src/__tests__/components/layout/navbar.test.tsx +0 -1
  80. package/templates/frontend/pre-sales/src/__tests__/components/layout/sidebar.test.tsx +58 -68
  81. package/templates/frontend/pre-sales/src/__tests__/hooks/useAuth.test.tsx +2 -1
  82. package/templates/frontend/pre-sales/src/__tests__/lib/auth.test.ts +102 -102
  83. package/templates/frontend/pre-sales/src/__tests__/routes/__root.test.tsx +72 -72
  84. package/templates/frontend/pre-sales/src/__tests__/routes/_authenticated.test.tsx +57 -58
  85. package/templates/frontend/pre-sales/src/__tests__/routes/index.test.tsx +8 -43
  86. package/templates/frontend/pre-sales/src/components/layout/navbar.tsx +121 -75
  87. package/templates/frontend/pre-sales/src/components/layout/sidebar.tsx +42 -30
  88. package/templates/frontend/pre-sales/src/components/providers/auth-provider.tsx +60 -0
  89. package/templates/frontend/pre-sales/src/components/ui/button.tsx +1 -1
  90. package/templates/frontend/pre-sales/src/components/ui/card.tsx +1 -1
  91. package/templates/frontend/pre-sales/src/components/ui/combobox.tsx +308 -308
  92. package/templates/frontend/pre-sales/src/components/ui/command.tsx +179 -182
  93. package/templates/frontend/pre-sales/src/components/ui/input.tsx +2 -0
  94. package/templates/frontend/pre-sales/src/components/ui/textarea.tsx +2 -0
  95. package/templates/frontend/pre-sales/src/components/ui/theme-toggle.tsx +35 -0
  96. package/templates/frontend/pre-sales/src/data/dashboard.ts +249 -255
  97. package/templates/frontend/pre-sales/src/hooks/useAuth.ts +13 -0
  98. package/templates/frontend/pre-sales/src/hooks/useTheme.ts +73 -0
  99. package/templates/frontend/pre-sales/src/index.css +282 -134
  100. package/templates/frontend/pre-sales/src/main.tsx +3 -2
  101. package/templates/frontend/pre-sales/src/routes/__root.tsx +62 -54
  102. package/templates/frontend/pre-sales/src/routes/_authenticated/app.tsx +20 -0
  103. package/templates/frontend/pre-sales/src/routes/_authenticated.tsx +5 -4
  104. package/templates/frontend/pre-sales/src/routes/auth/iniciar-sesion.tsx +173 -163
  105. package/templates/frontend/pre-sales/src/routes/index.tsx +53 -198
  106. package/templates/frontend/pre-sales/src/test/utils.tsx +2 -1
  107. package/templates/frontend/pre-sales/src/vite-env.d.ts +11 -0
@@ -1,182 +1,179 @@
1
- import * as React from "react"
2
- import { Command as CommandPrimitive } from "cmdk"
3
- import { SearchIcon } from "lucide-react"
4
-
5
- import { cn } from "@/lib/utils"
6
- import {
7
- Dialog,
8
- DialogContent,
9
- DialogDescription,
10
- DialogHeader,
11
- DialogTitle,
12
- } from "@/components/ui/dialog"
13
-
14
- function Command({
15
- className,
16
- ...props
17
- }: React.ComponentProps<typeof CommandPrimitive>) {
18
- return (
19
- <CommandPrimitive
20
- data-slot="command"
21
- className={cn(
22
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-base-100 text-base-content",
23
- className
24
- )}
25
- {...props}
26
- />
27
- )
28
- }
29
-
30
- function CommandDialog({
31
- title = "Command Palette",
32
- description = "Search for a command to run...",
33
- children,
34
- className,
35
- showCloseButton = true,
36
- ...props
37
- }: React.ComponentProps<typeof Dialog> & {
38
- title?: string
39
- description?: string
40
- className?: string
41
- showCloseButton?: boolean
42
- }) {
43
- return (
44
- <Dialog {...props}>
45
- <DialogHeader className="sr-only">
46
- <DialogTitle>{title}</DialogTitle>
47
- <DialogDescription>{description}</DialogDescription>
48
- </DialogHeader>
49
- <DialogContent
50
- className={cn("overflow-hidden p-0", className)}
51
- showCloseButton={showCloseButton}
52
- >
53
- <Command className="**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-base-content/60 [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
54
- {children}
55
- </Command>
56
- </DialogContent>
57
- </Dialog>
58
- )
59
- }
60
-
61
- function CommandInput({
62
- className,
63
- ...props
64
- }: React.ComponentProps<typeof CommandPrimitive.Input>) {
65
- return (
66
- <div
67
- data-slot="command-input-wrapper"
68
- className="flex h-9 items-center gap-2 border-b px-3"
69
- >
70
- <SearchIcon className="size-4 shrink-0 opacity-50" />
71
- <CommandPrimitive.Input
72
- data-slot="command-input"
73
- className={cn(
74
- "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-base-content/60 disabled:cursor-not-allowed disabled:opacity-50",
75
- className
76
- )}
77
- {...props}
78
- />
79
- </div>
80
- )
81
- }
82
-
83
- function CommandList({
84
- className,
85
- ...props
86
- }: React.ComponentProps<typeof CommandPrimitive.List>) {
87
- return (
88
- <CommandPrimitive.List
89
- data-slot="command-list"
90
- className={cn(
91
- "max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
92
- className
93
- )}
94
- {...props}
95
- />
96
- )
97
- }
98
-
99
- function CommandEmpty({
100
- ...props
101
- }: React.ComponentProps<typeof CommandPrimitive.Empty>) {
102
- return (
103
- <CommandPrimitive.Empty
104
- data-slot="command-empty"
105
- className="py-6 text-center text-sm"
106
- {...props}
107
- />
108
- )
109
- }
110
-
111
- function CommandGroup({
112
- className,
113
- ...props
114
- }: React.ComponentProps<typeof CommandPrimitive.Group>) {
115
- return (
116
- <CommandPrimitive.Group
117
- data-slot="command-group"
118
- className={cn(
119
- "overflow-hidden p-1 text-base-content [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-base-content/60",
120
- className
121
- )}
122
- {...props}
123
- />
124
- )
125
- }
126
-
127
- function CommandSeparator({
128
- className,
129
- ...props
130
- }: React.ComponentProps<typeof CommandPrimitive.Separator>) {
131
- return (
132
- <CommandPrimitive.Separator
133
- data-slot="command-separator"
134
- className={cn("-mx-1 h-px bg-base-300", className)}
135
- {...props}
136
- />
137
- )
138
- }
139
-
140
- function CommandItem({
141
- className,
142
- ...props
143
- }: React.ComponentProps<typeof CommandPrimitive.Item>) {
144
- return (
145
- <CommandPrimitive.Item
146
- data-slot="command-item"
147
- className={cn(
148
- "relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-base-200 data-[selected=true]:text-base-content [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-base-content/60",
149
- className
150
- )}
151
- {...props}
152
- />
153
- )
154
- }
155
-
156
- function CommandShortcut({
157
- className,
158
- ...props
159
- }: React.ComponentProps<"span">) {
160
- return (
161
- <span
162
- data-slot="command-shortcut"
163
- className={cn(
164
- "ml-auto text-xs tracking-widest text-base-content/60",
165
- className
166
- )}
167
- {...props}
168
- />
169
- )
170
- }
171
-
172
- export {
173
- Command,
174
- CommandDialog,
175
- CommandInput,
176
- CommandList,
177
- CommandEmpty,
178
- CommandGroup,
179
- CommandItem,
180
- CommandShortcut,
181
- CommandSeparator,
182
- }
1
+ import * as React from "react"
2
+ import { Command as CommandPrimitive } from "cmdk"
3
+ import { SearchIcon } from "lucide-react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+ import {
7
+ Dialog,
8
+ DialogContent,
9
+ DialogDescription,
10
+ DialogHeader,
11
+ DialogTitle,
12
+ } from "@/components/ui/dialog"
13
+
14
+ function Command({
15
+ className,
16
+ ...props
17
+ }: React.ComponentProps<typeof CommandPrimitive>) {
18
+ return (
19
+ <CommandPrimitive
20
+ data-slot="command"
21
+ className={cn(
22
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-base-100 text-base-content",
23
+ className
24
+ )}
25
+ {...props}
26
+ />
27
+ )
28
+ }
29
+
30
+ function CommandDialog({
31
+ title = "Command Palette",
32
+ description = "Search for a command to run...",
33
+ children,
34
+ className,
35
+ ...props
36
+ }: React.ComponentProps<typeof Dialog> & {
37
+ title?: string
38
+ description?: string
39
+ className?: string
40
+ }) {
41
+ return (
42
+ <Dialog {...props}>
43
+ <DialogHeader className="sr-only">
44
+ <DialogTitle>{title}</DialogTitle>
45
+ <DialogDescription>{description}</DialogDescription>
46
+ </DialogHeader>
47
+ <DialogContent
48
+ className={cn("overflow-hidden p-0", className)}
49
+ >
50
+ <Command className="**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-base-content/60 [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
51
+ {children}
52
+ </Command>
53
+ </DialogContent>
54
+ </Dialog>
55
+ )
56
+ }
57
+
58
+ function CommandInput({
59
+ className,
60
+ ...props
61
+ }: React.ComponentProps<typeof CommandPrimitive.Input>) {
62
+ return (
63
+ <div
64
+ data-slot="command-input-wrapper"
65
+ className="flex h-9 items-center gap-2 border-b px-3"
66
+ >
67
+ <SearchIcon className="size-4 shrink-0 opacity-50" />
68
+ <CommandPrimitive.Input
69
+ data-slot="command-input"
70
+ className={cn(
71
+ "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-base-content/60 disabled:cursor-not-allowed disabled:opacity-50",
72
+ className
73
+ )}
74
+ {...props}
75
+ />
76
+ </div>
77
+ )
78
+ }
79
+
80
+ function CommandList({
81
+ className,
82
+ ...props
83
+ }: React.ComponentProps<typeof CommandPrimitive.List>) {
84
+ return (
85
+ <CommandPrimitive.List
86
+ data-slot="command-list"
87
+ className={cn(
88
+ "max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
89
+ className
90
+ )}
91
+ {...props}
92
+ />
93
+ )
94
+ }
95
+
96
+ function CommandEmpty({
97
+ ...props
98
+ }: React.ComponentProps<typeof CommandPrimitive.Empty>) {
99
+ return (
100
+ <CommandPrimitive.Empty
101
+ data-slot="command-empty"
102
+ className="py-6 text-center text-sm"
103
+ {...props}
104
+ />
105
+ )
106
+ }
107
+
108
+ function CommandGroup({
109
+ className,
110
+ ...props
111
+ }: React.ComponentProps<typeof CommandPrimitive.Group>) {
112
+ return (
113
+ <CommandPrimitive.Group
114
+ data-slot="command-group"
115
+ className={cn(
116
+ "overflow-hidden p-1 text-base-content [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-base-content/60",
117
+ className
118
+ )}
119
+ {...props}
120
+ />
121
+ )
122
+ }
123
+
124
+ function CommandSeparator({
125
+ className,
126
+ ...props
127
+ }: React.ComponentProps<typeof CommandPrimitive.Separator>) {
128
+ return (
129
+ <CommandPrimitive.Separator
130
+ data-slot="command-separator"
131
+ className={cn("-mx-1 h-px bg-base-300", className)}
132
+ {...props}
133
+ />
134
+ )
135
+ }
136
+
137
+ function CommandItem({
138
+ className,
139
+ ...props
140
+ }: React.ComponentProps<typeof CommandPrimitive.Item>) {
141
+ return (
142
+ <CommandPrimitive.Item
143
+ data-slot="command-item"
144
+ className={cn(
145
+ "relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-base-200 data-[selected=true]:text-base-content [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-base-content/60",
146
+ className
147
+ )}
148
+ {...props}
149
+ />
150
+ )
151
+ }
152
+
153
+ function CommandShortcut({
154
+ className,
155
+ ...props
156
+ }: React.ComponentProps<"span">) {
157
+ return (
158
+ <span
159
+ data-slot="command-shortcut"
160
+ className={cn(
161
+ "ml-auto text-xs tracking-widest text-base-content/60",
162
+ className
163
+ )}
164
+ {...props}
165
+ />
166
+ )
167
+ }
168
+
169
+ export {
170
+ Command,
171
+ CommandDialog,
172
+ CommandInput,
173
+ CommandList,
174
+ CommandEmpty,
175
+ CommandGroup,
176
+ CommandItem,
177
+ CommandShortcut,
178
+ CommandSeparator,
179
+ }
@@ -12,6 +12,8 @@ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
12
12
  "file:text-base-content placeholder:text-base-content/50",
13
13
  "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
14
14
  "aria-invalid:input-error",
15
+ "transition-[border-color,box-shadow] duration-(--duration-fast) ease-(--ease-out-quart)",
16
+ "focus:shadow-[0_0_0_3px_oklch(72%_0.17_55/12%)]",
15
17
  className
16
18
  )}
17
19
  {...props}
@@ -11,6 +11,8 @@ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
11
11
  "placeholder:text-base-content/50",
12
12
  "disabled:cursor-not-allowed disabled:opacity-50",
13
13
  "aria-invalid:textarea-error",
14
+ "transition-[border-color,box-shadow] duration-(--duration-fast) ease-(--ease-out-quart)",
15
+ "focus:shadow-[0_0_0_3px_oklch(72%_0.17_55/12%)]",
14
16
  className
15
17
  )}
16
18
  {...props}
@@ -0,0 +1,35 @@
1
+ import { Moon, Sun } from "lucide-react";
2
+ import { useTheme } from "@/hooks/useTheme";
3
+ import { cn } from "@/lib/utils";
4
+
5
+ export function ThemeToggle({ className }: { className?: string }) {
6
+ const { isDark, toggleThemeWithTransition } = useTheme();
7
+
8
+ return (
9
+ <button
10
+ onClick={toggleThemeWithTransition}
11
+ className={cn(
12
+ "relative inline-flex size-9 items-center justify-center rounded-lg",
13
+ "text-base-content/60 hover:text-base-content hover:bg-base-200",
14
+ "transition-colors duration-(--duration-normal) ease-(--ease-out-quart)",
15
+ className,
16
+ )}
17
+ aria-label={isDark ? "Cambiar a modo claro" : "Cambiar a modo oscuro"}
18
+ >
19
+ <Sun
20
+ className={cn(
21
+ "size-4.5 transition-all duration-300",
22
+ isDark ? "rotate-90 scale-0 opacity-0" : "rotate-0 scale-100 opacity-100",
23
+ )}
24
+ style={{ position: isDark ? "absolute" : "relative" }}
25
+ />
26
+ <Moon
27
+ className={cn(
28
+ "size-4.5 transition-all duration-300",
29
+ isDark ? "rotate-0 scale-100 opacity-100" : "-rotate-90 scale-0 opacity-0",
30
+ )}
31
+ style={{ position: !isDark ? "absolute" : "relative" }}
32
+ />
33
+ </button>
34
+ );
35
+ }