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