nexoreui-cli 1.8.4 → 1.8.6

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/dist/index.js CHANGED
@@ -2864,11 +2864,11 @@ var button = {
2864
2864
  import * as React from 'react';
2865
2865
  import { cva, type VariantProps } from 'class-variance-authority';
2866
2866
  import { cn } from '../utils/cn';
2867
- import { motion } from 'framer-motion';
2867
+ import { motion, useReducedMotion } from 'framer-motion';
2868
2868
  import { Loader2 } from 'lucide-react';
2869
2869
 
2870
2870
  const buttonVariants = cva(
2871
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:scale-95",
2871
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:scale-95",
2872
2872
  {
2873
2873
  variants: {
2874
2874
  variant: {
@@ -2891,9 +2891,9 @@ const buttonVariants = cva(
2891
2891
  },
2892
2892
  size: {
2893
2893
  default: "h-10 px-5 py-2",
2894
- sm: "h-9 rounded-lg px-3 text-xs",
2895
- lg: "h-11 rounded-xl px-8 text-base",
2896
- icon: "h-10 w-10 rounded-full",
2894
+ sm: "h-9 rounded-sm px-3 text-xs",
2895
+ lg: "h-11 rounded-lg px-8 text-base",
2896
+ icon: "h-10 w-10 rounded-md",
2897
2897
  },
2898
2898
  },
2899
2899
  defaultVariants: {
@@ -3006,7 +3006,10 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
3006
3006
  isGlow && "shadow-[0_0_var(--glow-radius)_rgba(var(--glow-color),var(--glow-strength))]"
3007
3007
  );
3008
3008
 
3009
- if (!animate) {
3009
+ const shouldReduceMotion = useReducedMotion();
3010
+ const shouldAnimate = animate && !shouldReduceMotion;
3011
+
3012
+ if (!shouldAnimate) {
3010
3013
  return (
3011
3014
  <button
3012
3015
  ref={ref}
@@ -3277,11 +3280,11 @@ var card = {
3277
3280
 
3278
3281
  import * as React from "react"
3279
3282
  import { cn } from "../utils/cn"
3280
- import { motion } from "framer-motion"
3283
+ import { motion, useReducedMotion } from "framer-motion"
3281
3284
  import { cva, type VariantProps } from "class-variance-authority"
3282
3285
 
3283
3286
  const cardVariants = cva(
3284
- "rounded-2xl text-card-foreground transition-all duration-300 overflow-hidden",
3287
+ "rounded-xl text-card-foreground transition-all duration-300 overflow-hidden",
3285
3288
  {
3286
3289
  variants: {
3287
3290
  variant: {
@@ -3399,12 +3402,12 @@ const Card = React.forwardRef<HTMLDivElement, CardProps>(
3399
3402
  transition={{ type: "spring", stiffness: 300, damping: 22 }}
3400
3403
  >
3401
3404
  {/* Front Face */}
3402
- <div className="absolute inset-0 backface-hidden border bg-card text-card-foreground rounded-2xl shadow-sm flex flex-col justify-between overflow-hidden">
3405
+ <div className="absolute inset-0 backface-hidden border bg-card text-card-foreground rounded-xl shadow-sm flex flex-col justify-between overflow-hidden">
3403
3406
  {children}
3404
3407
  </div>
3405
3408
 
3406
3409
  {/* Back Face */}
3407
- <div className="absolute inset-0 backface-hidden rotate-y-180 border bg-linear-to-br from-primary/10 to-primary/5 text-card-foreground rounded-2xl shadow-sm flex flex-col p-6 items-center justify-center text-center overflow-hidden">
3410
+ <div className="absolute inset-0 backface-hidden rotate-y-180 border bg-linear-to-br from-primary/10 to-primary/5 text-card-foreground rounded-xl shadow-sm flex flex-col p-6 items-center justify-center text-center overflow-hidden">
3408
3411
  {backContent || (
3409
3412
  <div className="text-sm font-medium text-muted-foreground">
3410
3413
  Flip side content placeholder
@@ -3419,7 +3422,7 @@ const Card = React.forwardRef<HTMLDivElement, CardProps>(
3419
3422
  // Spotlight Variant Render Extra Element
3420
3423
  const spotlightEffect = isSpotlight && (
3421
3424
  <div
3422
- className="pointer-events-none absolute -inset-px rounded-2xl opacity-0 hover:opacity-100 group-hover:opacity-100 transition-opacity duration-300"
3425
+ className="pointer-events-none absolute -inset-px rounded-xl opacity-0 hover:opacity-100 group-hover:opacity-100 transition-opacity duration-300"
3423
3426
  style={{
3424
3427
  background: \`radial-gradient(400px circle at \${mousePos.x}px \${mousePos.y}px, \${spotlightColor}, transparent 80%)\`,
3425
3428
  }}
@@ -3429,7 +3432,10 @@ const Card = React.forwardRef<HTMLDivElement, CardProps>(
3429
3432
  // Build the resolved element attributes
3430
3433
  const cardClass = cn(cardVariants({ variant, hover: isFlip || isTilt ? "none" : hover, className }), isSpotlight && "group");
3431
3434
 
3432
- if (animate || isTilt) {
3435
+ const shouldReduceMotion = useReducedMotion();
3436
+ const shouldAnimate = (animate && !shouldReduceMotion) || isTilt;
3437
+
3438
+ if (shouldAnimate) {
3433
3439
  return (
3434
3440
  <motion.div
3435
3441
  ref={ref}
@@ -37834,8 +37840,9 @@ function injectThemeCss(baseDir, cssRelativePath, themeName, radiusValue, fontFa
37834
37840
  --motion-ease: linear;
37835
37841
  --motion-duration: 0s;
37836
37842
  }
37837
- button, a, input, select, textarea, [role="button"] {
37843
+ button, a, input, select, textarea, [role="button"], [class*="card"] {
37838
37844
  transition-duration: 0s !important;
37845
+ transform: none !important;
37839
37846
  }
37840
37847
  `;
37841
37848
  } else if (animationStyle === "subtle") {
@@ -37876,9 +37883,13 @@ button, a, input, select, textarea, [role="button"] {
37876
37883
  --color-border: var(--border);
37877
37884
  --color-input: var(--input);
37878
37885
  --color-ring: var(--ring);
37886
+ --radius-3xl: max(0rem, calc(var(--radius) * 2));
37887
+ --radius-2xl: max(0rem, calc(var(--radius) * 1.5));
37888
+ --radius-xl: max(0rem, calc(var(--radius) * 1.25));
37879
37889
  --radius-lg: var(--radius);
37880
- --radius-md: calc(var(--radius) - 2px);
37881
- --radius-sm: calc(var(--radius) - 4px);
37890
+ --radius-md: max(0rem, calc(var(--radius) - 2px));
37891
+ --radius-sm: max(0rem, calc(var(--radius) - 4px));
37892
+ --radius: var(--radius);
37882
37893
  --font-sans: ${selectedFont};
37883
37894
  }
37884
37895
 
@@ -37945,9 +37956,7 @@ html, body {
37945
37956
  }
37946
37957
  ${animationCss}
37947
37958
  /* End NexoreUI Theme Tokens */`;
37948
- const fontImports = `@import url('https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');`;
37949
37959
  const cleanFullCss = `@import "tailwindcss";
37950
- ${fontImports}
37951
37960
 
37952
37961
  @custom-variant dark (&:where(.dark, .dark *));
37953
37962
 
@@ -38045,22 +38054,28 @@ async function initCommand(options = {}) {
38045
38054
  if (didInjectCss) {
38046
38055
  console.log(`\x1B[32m\u2714\x1B[0m Injected Tailwind CSS v4 @theme tokens into \x1B[1m${defaultCssFile}\x1B[0m`);
38047
38056
  }
38048
- if (mode === "dark") {
38049
- const indexHtmlPath = path5.join(project.baseDir, "index.html");
38050
- if (fs5.existsSync(indexHtmlPath)) {
38051
- try {
38052
- let html = fs5.readFileSync(indexHtmlPath, "utf8");
38053
- if (!html.includes('class="dark"')) {
38054
- html = html.replace(/<html(\s+[^>]*)?>/i, (match) => {
38055
- if (match.includes('class="')) {
38056
- return match.replace('class="', 'class="dark ');
38057
- }
38058
- return match.replace("<html", '<html class="dark"');
38059
- });
38060
- fs5.writeFileSync(indexHtmlPath, html, "utf8");
38061
- }
38062
- } catch {
38057
+ const indexHtmlPath = path5.join(project.baseDir, "index.html");
38058
+ if (fs5.existsSync(indexHtmlPath)) {
38059
+ try {
38060
+ let html = fs5.readFileSync(indexHtmlPath, "utf8");
38061
+ if (mode === "dark" && !html.includes('class="dark"')) {
38062
+ html = html.replace(/<html(\s+[^>]*)?>/i, (match) => {
38063
+ if (match.includes('class="')) {
38064
+ return match.replace('class="', 'class="dark ');
38065
+ }
38066
+ return match.replace("<html", '<html class="dark"');
38067
+ });
38063
38068
  }
38069
+ if (!html.includes("fonts.googleapis.com")) {
38070
+ const fontLinks = ` <!-- NexoreUI Fonts -->
38071
+ <link rel="preconnect" href="https://fonts.googleapis.com">
38072
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
38073
+ <link href="https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap" rel="stylesheet">
38074
+ </head>`;
38075
+ html = html.replace("</head>", fontLinks);
38076
+ }
38077
+ fs5.writeFileSync(indexHtmlPath, html, "utf8");
38078
+ } catch {
38064
38079
  }
38065
38080
  }
38066
38081
  installPeerDependencies(project.baseDir, project.packageManager);
@@ -38146,6 +38161,7 @@ async function createCommand(projectName, options = {}) {
38146
38161
  } catch {
38147
38162
  }
38148
38163
  const appTsxPath = path6.join(targetDir, "src", "App.tsx");
38164
+ const isNoAnim = options.animation === "none";
38149
38165
  const starterAppCode = `import { useState } from 'react';
38150
38166
  import { Button } from '@/components/ui/button';
38151
38167
  import { Card, CardHeader, CardTitle, CardDescription, CardContent } from '@/components/ui/card';
@@ -38158,7 +38174,7 @@ export default function App() {
38158
38174
  <main className="min-h-screen bg-background text-foreground flex flex-col items-center justify-center p-6 transition-colors selection:bg-primary/20">
38159
38175
  <div className="max-w-xl w-full space-y-8 text-center">
38160
38176
  {/* Status Badge */}
38161
- <div className="inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-primary/10 border border-primary/20 text-xs font-semibold text-primary shadow-xs">
38177
+ <div className="inline-flex items-center gap-2 px-3.5 py-1.5 rounded-md bg-primary/10 border border-primary/20 text-xs font-semibold text-primary shadow-xs">
38162
38178
  <Sparkles className="h-3.5 w-3.5" />
38163
38179
  <span>NexoreUI + Tailwind CSS v4</span>
38164
38180
  </div>
@@ -38174,7 +38190,7 @@ export default function App() {
38174
38190
  </div>
38175
38191
 
38176
38192
  {/* Demo Interactive Card */}
38177
- <Card className="max-w-md mx-auto text-left shadow-xl border-border/80">
38193
+ <Card ${isNoAnim ? 'hover="none" animate={false} ' : ""}className="max-w-md mx-auto text-left shadow-xl border-border/80">
38178
38194
  <CardHeader>
38179
38195
  <CardTitle className="text-base flex items-center gap-2">
38180
38196
  <Layers className="h-4 w-4 text-primary" />
@@ -38185,17 +38201,17 @@ export default function App() {
38185
38201
  </CardDescription>
38186
38202
  </CardHeader>
38187
38203
  <CardContent className="space-y-4">
38188
- <div className="flex items-center justify-between p-3 rounded-xl bg-muted/50 border border-border/60">
38204
+ <div className="flex items-center justify-between p-3 rounded-md bg-muted/50 border border-border/60">
38189
38205
  <span className="text-xs font-medium">Click Counter</span>
38190
- <span className="text-xs font-mono font-bold px-2.5 py-0.5 rounded-md bg-primary/15 text-primary">
38206
+ <span className="text-xs font-mono font-bold px-2.5 py-0.5 rounded-sm bg-primary/15 text-primary">
38191
38207
  {count} clicks
38192
38208
  </span>
38193
38209
  </div>
38194
38210
  <div className="flex items-center gap-3">
38195
- <Button onClick={() => setCount((c) => c + 1)} className="flex-1">
38211
+ <Button ${isNoAnim ? "animate={false} " : ""}onClick={() => setCount((c) => c + 1)} className="flex-1">
38196
38212
  Increment Count
38197
38213
  </Button>
38198
- <Button variant="outline" onClick={() => setCount(0)}>
38214
+ <Button ${isNoAnim ? "animate={false} " : ""}variant="outline" onClick={() => setCount(0)}>
38199
38215
  Reset
38200
38216
  </Button>
38201
38217
  </div>
@@ -38203,7 +38219,7 @@ export default function App() {
38203
38219
  </Card>
38204
38220
 
38205
38221
  {/* CLI Hint */}
38206
- <div className="p-3.5 rounded-xl bg-muted/40 border border-border text-xs text-muted-foreground font-mono inline-flex items-center gap-2">
38222
+ <div className="p-3.5 rounded-md bg-muted/40 border border-border text-xs text-muted-foreground font-mono inline-flex items-center gap-2">
38207
38223
  <Terminal className="h-4 w-4 text-primary shrink-0" />
38208
38224
  <span>npx nexoreui add --all</span>
38209
38225
  </div>