@djangocfg/ui-nextjs 2.1.1 → 2.1.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/package.json +6 -3
- package/src/blocks/SuperHero.tsx +32 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/ui-nextjs",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "Next.js UI component library with Radix UI primitives, Tailwind CSS styling, charts, and form components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui-components",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"check": "tsc --noEmit"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@djangocfg/api": "^2.1.
|
|
61
|
+
"@djangocfg/api": "^2.1.3",
|
|
62
62
|
"@djangocfg/ui-core": "^1.0.4",
|
|
63
63
|
"@types/react": "^19.1.0",
|
|
64
64
|
"@types/react-dom": "^19.1.0",
|
|
@@ -73,6 +73,9 @@
|
|
|
73
73
|
"consola": "^3.4.2"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
+
"class-variance-authority": "^0.7.1",
|
|
77
|
+
"libphonenumber-js": "^1.12.24",
|
|
78
|
+
"sonner": "2.0.7",
|
|
76
79
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
77
80
|
"@radix-ui/react-menubar": "^1.1.16",
|
|
78
81
|
"@radix-ui/react-navigation-menu": "^1.2.14",
|
|
@@ -99,7 +102,7 @@
|
|
|
99
102
|
"vidstack": "next"
|
|
100
103
|
},
|
|
101
104
|
"devDependencies": {
|
|
102
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
105
|
+
"@djangocfg/typescript-config": "^2.1.3",
|
|
103
106
|
"@types/node": "^24.7.2",
|
|
104
107
|
"eslint": "^9.37.0",
|
|
105
108
|
"tailwindcss-animate": "1.0.7",
|
package/src/blocks/SuperHero.tsx
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { ArrowRight, Sparkles, Wand2
|
|
3
|
+
import { ArrowRight, Sparkles, Wand2 } from 'lucide-react';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
6
|
import { cn } from '@djangocfg/ui-core/lib';
|
|
7
|
-
import { Button, ButtonLink, Sticky, Tooltip, TooltipTrigger, TooltipContent } from '@djangocfg/ui-core/components';
|
|
8
|
-
import { useCopy } from '@djangocfg/ui-core/hooks';
|
|
7
|
+
import { Button, ButtonLink, Sticky, Tooltip, TooltipTrigger, TooltipContent, CopyButton } from '@djangocfg/ui-core/components';
|
|
9
8
|
import { AnimatedBackground, type BackgroundVariant } from '../animations';
|
|
10
9
|
import { ForceTheme } from '../theme';
|
|
11
10
|
|
|
@@ -45,7 +44,10 @@ interface SuperHeroProps {
|
|
|
45
44
|
backgroundVariant?: BackgroundVariant;
|
|
46
45
|
backgroundIntensity?: 'subtle' | 'medium' | 'strong';
|
|
47
46
|
showBackgroundSwitcher?: boolean;
|
|
47
|
+
/** Single command (for backwards compatibility) */
|
|
48
48
|
codeCommand?: string;
|
|
49
|
+
/** Array of commands to display with copy buttons */
|
|
50
|
+
codeCommands?: string[];
|
|
49
51
|
className?: string;
|
|
50
52
|
}
|
|
51
53
|
|
|
@@ -90,12 +92,19 @@ export const SuperHero: React.FC<SuperHeroProps> = ({
|
|
|
90
92
|
backgroundIntensity = 'medium',
|
|
91
93
|
showBackgroundSwitcher = false,
|
|
92
94
|
codeCommand,
|
|
95
|
+
codeCommands,
|
|
93
96
|
className
|
|
94
97
|
}) => {
|
|
95
98
|
const [currentVariant, setCurrentVariant] = React.useState<BackgroundVariant>(backgroundVariant);
|
|
96
99
|
const [isMenuOpen, setIsMenuOpen] = React.useState(false);
|
|
97
100
|
const [heroTheme, setHeroTheme] = React.useState<'light' | 'dark'>('dark');
|
|
98
|
-
|
|
101
|
+
|
|
102
|
+
// Merge codeCommand (deprecated) with codeCommands for backwards compatibility
|
|
103
|
+
const commands = React.useMemo(() => {
|
|
104
|
+
if (codeCommands && codeCommands.length > 0) return codeCommands;
|
|
105
|
+
if (codeCommand) return [codeCommand];
|
|
106
|
+
return [];
|
|
107
|
+
}, [codeCommand, codeCommands]);
|
|
99
108
|
|
|
100
109
|
// Show background switcher in development mode or if explicitly enabled
|
|
101
110
|
const isDevelopment = process.env.NODE_ENV === 'development';
|
|
@@ -153,18 +162,26 @@ export const SuperHero: React.FC<SuperHeroProps> = ({
|
|
|
153
162
|
{subtitle}
|
|
154
163
|
</p>
|
|
155
164
|
|
|
156
|
-
{/* Code
|
|
157
|
-
{
|
|
158
|
-
<div className="flex
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
<
|
|
165
|
+
{/* Code Commands */}
|
|
166
|
+
{commands.length > 0 && (
|
|
167
|
+
<div className="flex flex-col items-center gap-2 mb-8">
|
|
168
|
+
{commands.map((cmd, index) => (
|
|
169
|
+
<div
|
|
170
|
+
key={index}
|
|
171
|
+
className="inline-flex items-center gap-3 px-6 py-3 bg-background/50 backdrop-blur-md border border-primary/20 rounded-xl shadow-lg hover:border-primary/40 transition-colors group"
|
|
172
|
+
>
|
|
173
|
+
<span className="text-muted-foreground font-mono text-sm select-none">$</span>
|
|
174
|
+
<code className="font-mono text-lg text-primary font-semibold">
|
|
175
|
+
{cmd}
|
|
176
|
+
</code>
|
|
177
|
+
<CopyButton
|
|
178
|
+
value={cmd}
|
|
179
|
+
variant="ghost"
|
|
180
|
+
className="p-1.5 h-auto rounded-md bg-primary/10 text-primary hover:bg-primary hover:text-primary-foreground transition-colors"
|
|
181
|
+
iconClassName="w-4 h-4"
|
|
182
|
+
/>
|
|
166
183
|
</div>
|
|
167
|
-
|
|
184
|
+
))}
|
|
168
185
|
</div>
|
|
169
186
|
)}
|
|
170
187
|
|