@designbasekorea/ui 0.1.39 → 0.1.40

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
@@ -2264,7 +2264,124 @@ const Button = React.forwardRef(({ variant = 'primary', size = 'm', radius, full
2264
2264
  });
2265
2265
  Button.displayName = 'Button';
2266
2266
 
2267
- const AdBanner = ({ type = 'hero', variant = 'primary', title, subtitle, ctaText, onCtaClick, onClose, autoClose = false, closeDelay = 5000, icon, className, }) => {
2267
+ // Designbase 테마 기반 색상 계열 (hex 사용)
2268
+ const colorSchemes = {
2269
+ primary: [
2270
+ '#48c3ff', // blue-400
2271
+ '#1ea2ff', // blue-500
2272
+ '#0683ff', // blue-600
2273
+ '#006fff', // blue-700
2274
+ '#0855c5', // blue-800
2275
+ ],
2276
+ secondary: [
2277
+ '#a4adb2', // neutral-400
2278
+ '#8c9499', // neutral-500
2279
+ '#757b80', // neutral-600
2280
+ '#5e6366', // neutral-700
2281
+ '#464a4d', // neutral-800
2282
+ ],
2283
+ success: [
2284
+ '#4ade80', // green-400
2285
+ '#22c55e', // green-500
2286
+ '#16a34a', // green-600
2287
+ '#14b8a6', // teal-500
2288
+ '#0d9485', // teal-600
2289
+ ],
2290
+ warning: [
2291
+ '#ff8c32', // orange-400
2292
+ '#ff6b0a', // orange-500
2293
+ '#ff5100', // orange-600
2294
+ '#ffe50d', // yellow-400
2295
+ '#ffd600', // yellow-500
2296
+ ],
2297
+ error: [
2298
+ '#f87171', // red-400
2299
+ '#ef4444', // red-500
2300
+ '#dc2626', // red-600
2301
+ '#b91c1c', // red-700
2302
+ '#991b1b', // red-800
2303
+ ],
2304
+ info: [
2305
+ '#48c3ff', // blue-400
2306
+ '#1ea2ff', // blue-500
2307
+ '#0683ff', // blue-600
2308
+ '#006fff', // blue-700
2309
+ '#0855c5', // blue-800
2310
+ ],
2311
+ purple: [
2312
+ '#a385ff', // purple-400
2313
+ '#8a58ff', // purple-500
2314
+ '#7830f7', // purple-600
2315
+ '#6a1ee3', // purple-700
2316
+ '#5818bf', // purple-800
2317
+ ],
2318
+ ocean: [
2319
+ '#1ea2ff', // blue-500
2320
+ '#48c3ff', // blue-400
2321
+ '#2dd4c2', // teal-400
2322
+ '#14b8a6', // teal-500
2323
+ '#0d9485', // teal-600
2324
+ ],
2325
+ sunset: [
2326
+ '#ff8c32', // orange-400
2327
+ '#ff6b0a', // orange-500
2328
+ '#ff5100', // orange-600
2329
+ '#ef4444', // red-500
2330
+ '#f87171', // red-400
2331
+ ],
2332
+ };
2333
+ const RandomGradient = ({ scheme = 'primary', width = '100%', height = '600px', blur = 60, colorCount = 4, animated = false, animationDuration = 10, overlay = true, overlayOpacity = 0.2, children, className, }) => {
2334
+ const [gradientStyle, setGradientStyle] = React.useState({});
2335
+ // 그라데이션 생성 함수
2336
+ const generateGradient = React.useMemo(() => {
2337
+ return () => {
2338
+ const schemeColors = colorSchemes[scheme];
2339
+ const numColors = Math.min(6, Math.max(3, colorCount));
2340
+ const colors = [];
2341
+ for (let i = 0; i < numColors; i++) {
2342
+ const randomColor = schemeColors[Math.floor(Math.random() * schemeColors.length)];
2343
+ colors.push(randomColor);
2344
+ }
2345
+ const positions = Array.from({ length: numColors }, () => Math.random() * 100).sort((a, b) => a - b);
2346
+ const gradientStops = colors.map((color, i) => `${color} ${positions[i]}%`).join(', ');
2347
+ const centerX = Math.random() * 100;
2348
+ const centerY = Math.random() * 100;
2349
+ return {
2350
+ background: `radial-gradient(circle at ${centerX}% ${centerY}%, ${gradientStops})`,
2351
+ filter: `blur(${blur}px)`,
2352
+ transition: `all ${animationDuration}s ease-in-out`,
2353
+ };
2354
+ };
2355
+ }, [scheme, colorCount, blur, animationDuration]);
2356
+ // 초기 그라데이션 및 애니메이션
2357
+ React.useEffect(() => {
2358
+ setGradientStyle(generateGradient());
2359
+ if (animated) {
2360
+ const interval = setInterval(() => {
2361
+ setGradientStyle(generateGradient());
2362
+ }, animationDuration * 1000);
2363
+ return () => clearInterval(interval);
2364
+ }
2365
+ }, [animated, animationDuration, generateGradient]);
2366
+ const classes = clsx('designbase-random-gradient', {
2367
+ 'designbase-random-gradient--animated': animated,
2368
+ 'designbase-random-gradient--with-overlay': overlay,
2369
+ }, className);
2370
+ const containerStyle = {
2371
+ width: typeof width === 'number' ? `${width}px` : width,
2372
+ height: typeof height === 'number' ? `${height}px` : height,
2373
+ };
2374
+ const overlayStyle = overlay
2375
+ ? {
2376
+ background: `linear-gradient(45deg, ${colorSchemes[scheme][0]}, ${colorSchemes[scheme][1]})`,
2377
+ opacity: overlayOpacity,
2378
+ }
2379
+ : {};
2380
+ 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 }))] }));
2381
+ };
2382
+ RandomGradient.displayName = 'RandomGradient';
2383
+
2384
+ const AdBanner = ({ type = 'hero', variant = 'primary', title, subtitle, ctaText, onCtaClick, onClose, autoClose = false, closeDelay = 5000, icon, useRandomGradient = false, gradientScheme, gradientAnimated = true, className, }) => {
2268
2385
  const [isVisible, setIsVisible] = React.useState(true);
2269
2386
  const [progress, setProgress] = React.useState(100);
2270
2387
  React.useEffect(() => {
@@ -2294,6 +2411,7 @@ const AdBanner = ({ type = 'hero', variant = 'primary', title, subtitle, ctaText
2294
2411
  return null;
2295
2412
  const classes = clsx('designbase-ad-banner', `designbase-ad-banner--type-${type}`, `designbase-ad-banner--variant-${variant}`, {
2296
2413
  'designbase-ad-banner--auto-close': autoClose,
2414
+ 'designbase-ad-banner--with-gradient': useRandomGradient,
2297
2415
  }, className);
2298
2416
  // 기본 아이콘
2299
2417
  const defaultIcons = {
@@ -2306,7 +2424,23 @@ const AdBanner = ({ type = 'hero', variant = 'primary', title, subtitle, ctaText
2306
2424
  const displayTitle = title || getDefaultTitle(type);
2307
2425
  const displaySubtitle = subtitle || getDefaultSubtitle(type);
2308
2426
  const displayCtaText = ctaText || getDefaultCtaText(type);
2309
- return (jsxRuntime.jsx("div", { className: classes, children: jsxRuntime.jsxs("div", { className: "designbase-ad-banner__content", children: [jsxRuntime.jsx("button", { className: "designbase-ad-banner__close", onClick: handleClose, "aria-label": "\uB2EB\uAE30", children: jsxRuntime.jsx(icons.CloseIcon, { size: type === 'hero' ? 20 : 18 }) }), type === 'hero' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "designbase-ad-banner__decoration designbase-ad-banner__decoration--top" }), jsxRuntime.jsx("div", { className: "designbase-ad-banner__decoration designbase-ad-banner__decoration--bottom" })] })), jsxRuntime.jsxs("div", { className: "designbase-ad-banner__main", children: [jsxRuntime.jsxs("div", { className: "designbase-ad-banner__icon", children: [displayIcon, type === 'topbar' && (jsxRuntime.jsx("span", { className: "designbase-ad-banner__label", children: "\uD2B9\uBCC4 \uC774\uBCA4\uD2B8" })), type === 'floating' && (jsxRuntime.jsx("span", { className: "designbase-ad-banner__badge", children: "HOT DEAL" }))] }), jsxRuntime.jsxs("div", { className: "designbase-ad-banner__text", children: [jsxRuntime.jsx("h2", { className: "designbase-ad-banner__title", children: displayTitle }), jsxRuntime.jsx("p", { className: "designbase-ad-banner__subtitle", children: displaySubtitle })] }), jsxRuntime.jsx("div", { className: "designbase-ad-banner__actions", children: jsxRuntime.jsxs(Button, { variant: "primary", size: type === 'hero' ? 'l' : type === 'card' ? 's' : 'm', onPress: handleCtaClick, className: "designbase-ad-banner__cta", fullWidth: type === 'floating', children: [displayCtaText, jsxRuntime.jsx(icons.ArrowRightIcon, { size: type === 'hero' ? 20 : 16 })] }) })] }), autoClose && (jsxRuntime.jsx("div", { className: "designbase-ad-banner__progress", children: jsxRuntime.jsx("div", { className: "designbase-ad-banner__progress-bar", style: { width: `${progress}%` } }) }))] }) }));
2427
+ // variant 따른 그라데이션 색상 계열 매핑
2428
+ const getGradientScheme = () => {
2429
+ if (gradientScheme)
2430
+ return gradientScheme;
2431
+ const schemeMap = {
2432
+ primary: 'primary',
2433
+ secondary: 'secondary',
2434
+ success: 'success',
2435
+ warning: 'warning',
2436
+ error: 'error',
2437
+ gradient: 'sunset',
2438
+ };
2439
+ return schemeMap[variant];
2440
+ };
2441
+ // 배너 컨텐츠
2442
+ const bannerContent = (jsxRuntime.jsxs("div", { className: "designbase-ad-banner__content", children: [jsxRuntime.jsx("button", { className: "designbase-ad-banner__close", onClick: handleClose, "aria-label": "\uB2EB\uAE30", children: jsxRuntime.jsx(icons.CloseIcon, { size: type === 'hero' ? 20 : 18 }) }), type === 'hero' && !useRandomGradient && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "designbase-ad-banner__decoration designbase-ad-banner__decoration--top" }), jsxRuntime.jsx("div", { className: "designbase-ad-banner__decoration designbase-ad-banner__decoration--bottom" })] })), jsxRuntime.jsxs("div", { className: "designbase-ad-banner__main", children: [jsxRuntime.jsxs("div", { className: "designbase-ad-banner__icon", children: [displayIcon, type === 'topbar' && (jsxRuntime.jsx("span", { className: "designbase-ad-banner__label", children: "\uD2B9\uBCC4 \uC774\uBCA4\uD2B8" })), type === 'floating' && (jsxRuntime.jsx("span", { className: "designbase-ad-banner__badge", children: "HOT DEAL" }))] }), jsxRuntime.jsxs("div", { className: "designbase-ad-banner__text", children: [jsxRuntime.jsx("h2", { className: "designbase-ad-banner__title", children: displayTitle }), jsxRuntime.jsx("p", { className: "designbase-ad-banner__subtitle", children: displaySubtitle })] }), jsxRuntime.jsx("div", { className: "designbase-ad-banner__actions", children: jsxRuntime.jsxs(Button, { variant: "primary", size: type === 'hero' ? 'l' : type === 'card' ? 's' : 'm', onPress: handleCtaClick, className: "designbase-ad-banner__cta", fullWidth: type === 'floating', children: [displayCtaText, jsxRuntime.jsx(icons.ArrowRightIcon, { size: type === 'hero' ? 20 : 16 })] }) })] }), autoClose && (jsxRuntime.jsx("div", { className: "designbase-ad-banner__progress", children: jsxRuntime.jsx("div", { className: "designbase-ad-banner__progress-bar", style: { width: `${progress}%` } }) }))] }));
2443
+ return (jsxRuntime.jsx("div", { className: classes, children: useRandomGradient ? (jsxRuntime.jsx(RandomGradient, { scheme: getGradientScheme(), animated: gradientAnimated, height: "100%", width: "100%", className: "designbase-ad-banner__gradient-bg", children: bannerContent })) : (bannerContent) }));
2310
2444
  };
2311
2445
  // 기본 텍스트 헬퍼
2312
2446
  function getDefaultTitle(type) {
@@ -8619,123 +8753,6 @@ const ProgressStep = ({ items, size = 'm', layout = 'vertical', currentStep = 0,
8619
8753
  }) }));
8620
8754
  };
8621
8755
 
8622
- // Designbase 테마 기반 색상 계열 (hex 값 사용)
8623
- const colorSchemes = {
8624
- primary: [
8625
- '#48c3ff', // blue-400
8626
- '#1ea2ff', // blue-500
8627
- '#0683ff', // blue-600
8628
- '#006fff', // blue-700
8629
- '#0855c5', // blue-800
8630
- ],
8631
- secondary: [
8632
- '#a4adb2', // neutral-400
8633
- '#8c9499', // neutral-500
8634
- '#757b80', // neutral-600
8635
- '#5e6366', // neutral-700
8636
- '#464a4d', // neutral-800
8637
- ],
8638
- success: [
8639
- '#4ade80', // green-400
8640
- '#22c55e', // green-500
8641
- '#16a34a', // green-600
8642
- '#14b8a6', // teal-500
8643
- '#0d9485', // teal-600
8644
- ],
8645
- warning: [
8646
- '#ff8c32', // orange-400
8647
- '#ff6b0a', // orange-500
8648
- '#ff5100', // orange-600
8649
- '#ffe50d', // yellow-400
8650
- '#ffd600', // yellow-500
8651
- ],
8652
- error: [
8653
- '#f87171', // red-400
8654
- '#ef4444', // red-500
8655
- '#dc2626', // red-600
8656
- '#b91c1c', // red-700
8657
- '#991b1b', // red-800
8658
- ],
8659
- info: [
8660
- '#48c3ff', // blue-400
8661
- '#1ea2ff', // blue-500
8662
- '#0683ff', // blue-600
8663
- '#006fff', // blue-700
8664
- '#0855c5', // blue-800
8665
- ],
8666
- purple: [
8667
- '#a385ff', // purple-400
8668
- '#8a58ff', // purple-500
8669
- '#7830f7', // purple-600
8670
- '#6a1ee3', // purple-700
8671
- '#5818bf', // purple-800
8672
- ],
8673
- ocean: [
8674
- '#1ea2ff', // blue-500
8675
- '#48c3ff', // blue-400
8676
- '#2dd4c2', // teal-400
8677
- '#14b8a6', // teal-500
8678
- '#0d9485', // teal-600
8679
- ],
8680
- sunset: [
8681
- '#ff8c32', // orange-400
8682
- '#ff6b0a', // orange-500
8683
- '#ff5100', // orange-600
8684
- '#ef4444', // red-500
8685
- '#f87171', // red-400
8686
- ],
8687
- };
8688
- const RandomGradient = ({ scheme = 'primary', width = '100%', height = '600px', blur = 60, colorCount = 4, animated = false, animationDuration = 10, overlay = true, overlayOpacity = 0.2, children, className, }) => {
8689
- const [gradientStyle, setGradientStyle] = React.useState({});
8690
- // 그라데이션 생성 함수
8691
- const generateGradient = React.useMemo(() => {
8692
- return () => {
8693
- const schemeColors = colorSchemes[scheme];
8694
- const numColors = Math.min(6, Math.max(3, colorCount));
8695
- const colors = [];
8696
- for (let i = 0; i < numColors; i++) {
8697
- const randomColor = schemeColors[Math.floor(Math.random() * schemeColors.length)];
8698
- colors.push(randomColor);
8699
- }
8700
- const positions = Array.from({ length: numColors }, () => Math.random() * 100).sort((a, b) => a - b);
8701
- const gradientStops = colors.map((color, i) => `${color} ${positions[i]}%`).join(', ');
8702
- const centerX = Math.random() * 100;
8703
- const centerY = Math.random() * 100;
8704
- return {
8705
- background: `radial-gradient(circle at ${centerX}% ${centerY}%, ${gradientStops})`,
8706
- filter: `blur(${blur}px)`,
8707
- transition: `all ${animationDuration}s ease-in-out`,
8708
- };
8709
- };
8710
- }, [scheme, colorCount, blur, animationDuration]);
8711
- // 초기 그라데이션 및 애니메이션
8712
- React.useEffect(() => {
8713
- setGradientStyle(generateGradient());
8714
- if (animated) {
8715
- const interval = setInterval(() => {
8716
- setGradientStyle(generateGradient());
8717
- }, animationDuration * 1000);
8718
- return () => clearInterval(interval);
8719
- }
8720
- }, [animated, animationDuration, generateGradient]);
8721
- const classes = clsx('designbase-random-gradient', {
8722
- 'designbase-random-gradient--animated': animated,
8723
- 'designbase-random-gradient--with-overlay': overlay,
8724
- }, className);
8725
- const containerStyle = {
8726
- width: typeof width === 'number' ? `${width}px` : width,
8727
- height: typeof height === 'number' ? `${height}px` : height,
8728
- };
8729
- const overlayStyle = overlay
8730
- ? {
8731
- background: `linear-gradient(45deg, ${colorSchemes[scheme][0]}, ${colorSchemes[scheme][1]})`,
8732
- opacity: overlayOpacity,
8733
- }
8734
- : {};
8735
- 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 }))] }));
8736
- };
8737
- RandomGradient.displayName = 'RandomGradient';
8738
-
8739
8756
  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 }) => {
8740
8757
  const [internalValue, setInternalValue] = React.useState(value ?? min);
8741
8758
  const [internalRange, setInternalRange] = React.useState(range ?? [min, max]);