@designbasekorea/ui 0.2.32 → 0.2.34

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
@@ -2477,56 +2477,57 @@ const Button = React.forwardRef(({ variant = 'primary', size = 'm', radius, full
2477
2477
  });
2478
2478
  Button.displayName = 'Button';
2479
2479
 
2480
- // 톤별 색상 팔레트
2480
+ // 톤별 색상 팔레트 (Light Tone은 더 밝은 색상만 사용)
2481
2481
  const colorPalettes = {
2482
2482
  primary: {
2483
- light: ['#eff6ff', '#dbeafe', '#bfdbfe', '#93c5fd', '#60a5fa'], // blue-50 ~ blue-400 (더 밝게)
2483
+ light: ['#eff6ff', '#dbeafe', '#bfdbfe', '#93c5fd'], // blue-50 ~ blue-300 (더 밝게, blue-400 제거)
2484
2484
  vivid: ['#3b82f6', '#2563eb', '#1d4ed8', '#1e40af', '#1e3a8a'], // blue-500 ~ blue-900
2485
2485
  dark: ['#0f172a', '#1e293b', '#334155', '#475569', '#64748b'], // slate-900 ~ slate-600 (더 어둡게)
2486
2486
  },
2487
2487
  secondary: {
2488
- light: ['#f8fafc', '#f1f5f9', '#e2e8f0', '#cbd5e1', '#94a3b8'], // slate-50 ~ slate-400 (더 밝게)
2488
+ light: ['#f8fafc', '#f1f5f9', '#e2e8f0', '#cbd5e1'], // slate-50 ~ slate-300 (더 밝게, slate-400 제거)
2489
2489
  vivid: ['#6b7280', '#4b5563', '#374151', '#1f2937', '#111827'], // gray-500 ~ gray-900
2490
2490
  dark: ['#0f0f0f', '#1a1a1a', '#262626', '#404040', '#525252'], // neutral-950 ~ neutral-600 (더 어둡게)
2491
2491
  },
2492
2492
  success: {
2493
- light: ['#f0fdf4', '#dcfce7', '#bbf7d0', '#86efac', '#4ade80'], // green-50 ~ green-400 (더 밝게)
2493
+ light: ['#f0fdf4', '#dcfce7', '#bbf7d0', '#86efac'], // green-50 ~ green-300 (더 밝게, green-400 제거)
2494
2494
  vivid: ['#22c55e', '#16a34a', '#15803d', '#166534', '#14532d'], // green-500 ~ green-900
2495
2495
  dark: ['#052e16', '#14532d', '#166534', '#15803d', '#16a34a'], // green-950 ~ green-600 (더 어둡게)
2496
2496
  },
2497
2497
  warning: {
2498
- light: ['#fffbeb', '#fef3c7', '#fde68a', '#fcd34d', '#fbbf24'], // amber-50 ~ amber-400 (더 밝게)
2498
+ light: ['#fffbeb', '#fef3c7', '#fde68a'], // amber-50 ~ amber-200 (더 밝게, amber-300 이상 제거)
2499
2499
  vivid: ['#f59e0b', '#d97706', '#b45309', '#92400e', '#78350f'], // amber-600 ~ amber-900
2500
2500
  dark: ['#451a03', '#78350f', '#92400e', '#b45309', '#d97706'], // amber-950 ~ amber-600 (더 어둡게)
2501
2501
  },
2502
2502
  error: {
2503
- light: ['#fef2f2', '#fecaca', '#fca5a5', '#f87171', '#f56565'], // red-50 ~ red-400 (더 밝게)
2503
+ light: ['#fef2f2', '#fecaca', '#fca5a5'], // red-50 ~ red-200 (더 밝게, red-300 이상 제거)
2504
2504
  vivid: ['#ef4444', '#dc2626', '#b91c1c', '#991b1b', '#7f1d1d'], // red-500 ~ red-900
2505
2505
  dark: ['#450a0a', '#7f1d1d', '#991b1b', '#b91c1c', '#dc2626'], // red-950 ~ red-600 (더 어둡게)
2506
2506
  },
2507
2507
  info: {
2508
- light: ['#eff6ff', '#dbeafe', '#bfdbfe', '#93c5fd', '#60a5fa'], // blue-50 ~ blue-400 (더 밝게)
2508
+ light: ['#eff6ff', '#dbeafe', '#bfdbfe', '#93c5fd'], // blue-50 ~ blue-300 (더 밝게, blue-400 제거)
2509
2509
  vivid: ['#3b82f6', '#2563eb', '#1d4ed8', '#1e40af', '#1e3a8a'], // blue-500 ~ blue-900
2510
2510
  dark: ['#0f172a', '#1e293b', '#334155', '#475569', '#64748b'], // slate-900 ~ slate-600 (더 어둡게)
2511
2511
  },
2512
2512
  purple: {
2513
- light: ['#faf5ff', '#f3e8ff', '#e9d5ff', '#d8b4fe', '#c084fc'], // purple-50 ~ purple-400 (더 밝게)
2513
+ light: ['#faf5ff', '#f3e8ff', '#e9d5ff', '#d8b4fe'], // purple-50 ~ purple-300 (더 밝게, purple-400 제거)
2514
2514
  vivid: ['#a855f7', '#9333ea', '#7c3aed', '#6d28d9', '#5b21b6'], // purple-600 ~ purple-900
2515
2515
  dark: ['#3b0764', '#581c87', '#6b21a8', '#7c3aed', '#9333ea'], // purple-950 ~ purple-600 (더 어둡게)
2516
2516
  },
2517
2517
  ocean: {
2518
- light: ['#f0fdfa', '#ccfbf1', '#99f6e4', '#5eead4', '#2dd4bf'], // teal-50 ~ teal-400 (더 밝게)
2518
+ light: ['#f0fdfa', '#ccfbf1', '#99f6e4'], // teal-50 ~ teal-200 (더 밝게, teal-300 이상 제거)
2519
2519
  vivid: ['#14b8a6', '#0d9488', '#0f766e', '#115e59', '#134e4a'], // teal-500 ~ teal-900
2520
2520
  dark: ['#042f2e', '#134e4a', '#115e59', '#0f766e', '#0d9488'], // teal-950 ~ teal-600 (더 어둡게)
2521
2521
  },
2522
2522
  sunset: {
2523
- light: ['#fff7ed', '#fed7aa', '#fdba74', '#fb923c', '#f97316'], // orange-50 ~ orange-500 (더 밝게)
2523
+ light: ['#fff7ed', '#fed7aa', '#fdba74'], // orange-50 ~ orange-200 (더 밝게, orange-300 이상 제거)
2524
2524
  vivid: ['#f97316', '#ea580c', '#c2410c', '#9a3412', '#7c2d12'], // orange-600 ~ orange-900
2525
2525
  dark: ['#431407', '#7c2d12', '#9a3412', '#c2410c', '#ea580c'], // orange-950 ~ orange-600 (더 어둡게)
2526
2526
  },
2527
2527
  };
2528
- const RandomGradient = ({ scheme = 'primary', tone = 'vivid', width = '100%', height = '600px', blur = 60, colorCount = 4, animated = false, animationDuration = 10, overlay = true, overlayOpacity = 0.2, children, className, }) => {
2529
- const [gradientStyle, setGradientStyle] = React.useState({});
2528
+ const RandomGradient = ({ scheme = 'primary', tone = 'vivid', width = '100%', height = '600px', blur = 80, colorCount = 4, animated = false, animationDuration = 10, overlay = true, overlayOpacity = 0.2, children, className, }) => {
2529
+ // 블러 최소값 80으로 제한 (더 부드러운 그라데이션을 위해)
2530
+ const minBlur = Math.max(80, blur);
2530
2531
  // 그라데이션 생성 함수
2531
2532
  const generateGradient = React.useMemo(() => {
2532
2533
  return () => {
@@ -2543,14 +2544,55 @@ const RandomGradient = ({ scheme = 'primary', tone = 'vivid', width = '100%', he
2543
2544
  const centerY = Math.random() * 100;
2544
2545
  return {
2545
2546
  background: `radial-gradient(circle at ${centerX}% ${centerY}%, ${gradientStops})`,
2546
- filter: `blur(${blur}px)`,
2547
- transition: `all ${animationDuration}s ease-in-out`,
2547
+ filter: `blur(${minBlur}px)`,
2548
+ transition: animated ? `background ${animationDuration}s ease-in-out` : 'none', // 블러는 transition 적용 안 함
2548
2549
  };
2549
2550
  };
2550
- }, [scheme, tone, colorCount, blur, animationDuration]);
2551
- // 초기 그라데이션 애니메이션
2551
+ }, [scheme, tone, colorCount, minBlur, animationDuration, animated]);
2552
+ // 초기 그라데이션 생성 함수
2553
+ const createInitialGradient = React.useCallback(() => {
2554
+ const schemeColors = colorPalettes[scheme][tone];
2555
+ const numColors = Math.min(6, Math.max(3, colorCount));
2556
+ const colors = [];
2557
+ for (let i = 0; i < numColors; i++) {
2558
+ const randomColor = schemeColors[Math.floor(Math.random() * schemeColors.length)];
2559
+ colors.push(randomColor);
2560
+ }
2561
+ const positions = Array.from({ length: numColors }, () => Math.random() * 100).sort((a, b) => a - b);
2562
+ const gradientStops = colors.map((color, i) => `${color} ${positions[i]}%`).join(', ');
2563
+ const centerX = Math.random() * 100;
2564
+ const centerY = Math.random() * 100;
2565
+ return {
2566
+ background: `radial-gradient(circle at ${centerX}% ${centerY}%, ${gradientStops})`,
2567
+ filter: `blur(${minBlur}px)`,
2568
+ transition: animated ? `background ${animationDuration}s ease-in-out` : 'none',
2569
+ };
2570
+ }, [scheme, tone, colorCount, minBlur, animated, animationDuration]);
2571
+ // 초기 그라데이션을 즉시 계산하여 설정 (useState 초기값 함수 사용)
2572
+ const [gradientStyle, setGradientStyle] = React.useState(() => {
2573
+ const schemeColors = colorPalettes[scheme][tone];
2574
+ const numColors = Math.min(6, Math.max(3, colorCount));
2575
+ const colors = [];
2576
+ for (let i = 0; i < numColors; i++) {
2577
+ const randomColor = schemeColors[Math.floor(Math.random() * schemeColors.length)];
2578
+ colors.push(randomColor);
2579
+ }
2580
+ const positions = Array.from({ length: numColors }, () => Math.random() * 100).sort((a, b) => a - b);
2581
+ const gradientStops = colors.map((color, i) => `${color} ${positions[i]}%`).join(', ');
2582
+ const centerX = Math.random() * 100;
2583
+ const centerY = Math.random() * 100;
2584
+ return {
2585
+ background: `radial-gradient(circle at ${centerX}% ${centerY}%, ${gradientStops})`,
2586
+ filter: `blur(${minBlur}px)`,
2587
+ transition: animated ? `background ${animationDuration}s ease-in-out` : 'none',
2588
+ };
2589
+ });
2590
+ // props 변경 시 그라데이션 업데이트
2591
+ React.useEffect(() => {
2592
+ setGradientStyle(createInitialGradient());
2593
+ }, [createInitialGradient]);
2594
+ // 애니메이션 업데이트
2552
2595
  React.useEffect(() => {
2553
- setGradientStyle(generateGradient());
2554
2596
  if (animated) {
2555
2597
  const interval = setInterval(() => {
2556
2598
  setGradientStyle(generateGradient());