@designbasekorea/ui 0.1.36 → 0.1.37

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
@@ -8545,6 +8545,123 @@ const ProgressStep = ({ items, size = 'm', layout = 'vertical', currentStep = 0,
8545
8545
  }) }));
8546
8546
  };
8547
8547
 
8548
+ // Designbase 테마 변수 기반 색상 계열
8549
+ const colorSchemes = {
8550
+ primary: [
8551
+ 'var(--color-foundation-blue-400)',
8552
+ 'var(--color-foundation-blue-500)',
8553
+ 'var(--color-foundation-blue-600)',
8554
+ 'var(--color-foundation-indigo-500)',
8555
+ 'var(--color-foundation-indigo-600)',
8556
+ ],
8557
+ secondary: [
8558
+ 'var(--color-foundation-gray-400)',
8559
+ 'var(--color-foundation-gray-500)',
8560
+ 'var(--color-foundation-gray-600)',
8561
+ 'var(--color-foundation-slate-500)',
8562
+ 'var(--color-foundation-slate-600)',
8563
+ ],
8564
+ success: [
8565
+ 'var(--color-foundation-green-400)',
8566
+ 'var(--color-foundation-green-500)',
8567
+ 'var(--color-foundation-green-600)',
8568
+ 'var(--color-foundation-emerald-500)',
8569
+ 'var(--color-foundation-teal-500)',
8570
+ ],
8571
+ warning: [
8572
+ 'var(--color-foundation-amber-400)',
8573
+ 'var(--color-foundation-amber-500)',
8574
+ 'var(--color-foundation-orange-400)',
8575
+ 'var(--color-foundation-orange-500)',
8576
+ 'var(--color-foundation-yellow-500)',
8577
+ ],
8578
+ error: [
8579
+ 'var(--color-foundation-red-400)',
8580
+ 'var(--color-foundation-red-500)',
8581
+ 'var(--color-foundation-red-600)',
8582
+ 'var(--color-foundation-rose-500)',
8583
+ 'var(--color-foundation-pink-500)',
8584
+ ],
8585
+ info: [
8586
+ 'var(--color-foundation-cyan-400)',
8587
+ 'var(--color-foundation-cyan-500)',
8588
+ 'var(--color-foundation-sky-400)',
8589
+ 'var(--color-foundation-sky-500)',
8590
+ 'var(--color-foundation-blue-400)',
8591
+ ],
8592
+ purple: [
8593
+ 'var(--color-foundation-purple-400)',
8594
+ 'var(--color-foundation-purple-500)',
8595
+ 'var(--color-foundation-purple-600)',
8596
+ 'var(--color-foundation-violet-500)',
8597
+ 'var(--color-foundation-fuchsia-500)',
8598
+ ],
8599
+ ocean: [
8600
+ 'var(--color-foundation-blue-500)',
8601
+ 'var(--color-foundation-cyan-500)',
8602
+ 'var(--color-foundation-teal-500)',
8603
+ 'var(--color-foundation-sky-500)',
8604
+ 'var(--color-foundation-indigo-500)',
8605
+ ],
8606
+ sunset: [
8607
+ 'var(--color-foundation-orange-400)',
8608
+ 'var(--color-foundation-orange-500)',
8609
+ 'var(--color-foundation-red-400)',
8610
+ 'var(--color-foundation-pink-400)',
8611
+ 'var(--color-foundation-rose-400)',
8612
+ ],
8613
+ };
8614
+ const RandomGradient = ({ scheme = 'primary', width = '100%', height = '600px', blur = 60, colorCount = 4, animated = false, animationDuration = 10, overlay = true, overlayOpacity = 0.2, children, className, }) => {
8615
+ const [gradientStyle, setGradientStyle] = React.useState({});
8616
+ // 그라데이션 생성 함수
8617
+ const generateGradient = React.useMemo(() => {
8618
+ return () => {
8619
+ const schemeColors = colorSchemes[scheme];
8620
+ const numColors = Math.min(6, Math.max(3, colorCount));
8621
+ const colors = [];
8622
+ for (let i = 0; i < numColors; i++) {
8623
+ const randomColor = schemeColors[Math.floor(Math.random() * schemeColors.length)];
8624
+ colors.push(randomColor);
8625
+ }
8626
+ const positions = Array.from({ length: numColors }, () => Math.random() * 100).sort((a, b) => a - b);
8627
+ const gradientStops = colors.map((color, i) => `${color} ${positions[i]}%`).join(', ');
8628
+ const centerX = Math.random() * 100;
8629
+ const centerY = Math.random() * 100;
8630
+ return {
8631
+ background: `radial-gradient(circle at ${centerX}% ${centerY}%, ${gradientStops})`,
8632
+ filter: `blur(${blur}px)`,
8633
+ transition: `all ${animationDuration}s ease-in-out`,
8634
+ };
8635
+ };
8636
+ }, [scheme, colorCount, blur, animationDuration]);
8637
+ // 초기 그라데이션 및 애니메이션
8638
+ React.useEffect(() => {
8639
+ setGradientStyle(generateGradient());
8640
+ if (animated) {
8641
+ const interval = setInterval(() => {
8642
+ setGradientStyle(generateGradient());
8643
+ }, animationDuration * 1000);
8644
+ return () => clearInterval(interval);
8645
+ }
8646
+ }, [animated, animationDuration, generateGradient]);
8647
+ const classes = clsx('designbase-random-gradient', {
8648
+ 'designbase-random-gradient--animated': animated,
8649
+ 'designbase-random-gradient--with-overlay': overlay,
8650
+ }, className);
8651
+ const containerStyle = {
8652
+ width: typeof width === 'number' ? `${width}px` : width,
8653
+ height: typeof height === 'number' ? `${height}px` : height,
8654
+ };
8655
+ const overlayStyle = overlay
8656
+ ? {
8657
+ background: `linear-gradient(45deg, ${colorSchemes[scheme][0]}, ${colorSchemes[scheme][1]})`,
8658
+ opacity: overlayOpacity,
8659
+ }
8660
+ : {};
8661
+ return (jsxRuntime.jsxs("div", { className: classes, style: containerStyle, children: [jsxRuntime.jsx("div", { className: "designbase-random-gradient__background", style: gradientStyle }), overlay && (jsxRuntime.jsx("div", { className: "designbase-random-gradient__overlay", style: overlayStyle })), children && (jsxRuntime.jsx("div", { className: "designbase-random-gradient__content", children: children }))] }));
8662
+ };
8663
+ RandomGradient.displayName = 'RandomGradient';
8664
+
8548
8665
  const RangeSlider = ({ value, range, min = 0, max = 100, step = 1, size = 'm', variant = 'default', showValue = false, showMarks = false, marks = [], markLabels = {}, disabled = false, readOnly = false, fullWidth = false, vertical = false, onChange, onRangeChange, className, ...props }) => {
8549
8666
  const [internalValue, setInternalValue] = React.useState(value ?? min);
8550
8667
  const [internalRange, setInternalRange] = React.useState(range ?? [min, max]);
@@ -11130,6 +11247,7 @@ exports.Progress = Progress;
11130
11247
  exports.ProgressStep = ProgressStep;
11131
11248
  exports.Progressbar = Progressbar;
11132
11249
  exports.Radio = Radio;
11250
+ exports.RandomGradient = RandomGradient;
11133
11251
  exports.RangeSlider = RangeSlider;
11134
11252
  exports.Rating = Rating;
11135
11253
  exports.Reorder = Reorder;