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