@designbasekorea/ui 0.1.37 → 0.1.39

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,6 +2264,80 @@ 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, }) => {
2268
+ const [isVisible, setIsVisible] = React.useState(true);
2269
+ const [progress, setProgress] = React.useState(100);
2270
+ React.useEffect(() => {
2271
+ if (autoClose) {
2272
+ const interval = setInterval(() => {
2273
+ setProgress(prev => {
2274
+ const newProgress = prev - (100 / (closeDelay / 100));
2275
+ if (newProgress <= 0) {
2276
+ handleClose();
2277
+ clearInterval(interval);
2278
+ return 0;
2279
+ }
2280
+ return newProgress;
2281
+ });
2282
+ }, 100);
2283
+ return () => clearInterval(interval);
2284
+ }
2285
+ }, [autoClose, closeDelay]);
2286
+ const handleClose = () => {
2287
+ setIsVisible(false);
2288
+ onClose?.();
2289
+ };
2290
+ const handleCtaClick = () => {
2291
+ onCtaClick?.();
2292
+ };
2293
+ if (!isVisible)
2294
+ return null;
2295
+ const classes = clsx('designbase-ad-banner', `designbase-ad-banner--type-${type}`, `designbase-ad-banner--variant-${variant}`, {
2296
+ 'designbase-ad-banner--auto-close': autoClose,
2297
+ }, className);
2298
+ // 기본 아이콘
2299
+ const defaultIcons = {
2300
+ hero: jsxRuntime.jsx(icons.StarIcon, { size: 24 }),
2301
+ topbar: jsxRuntime.jsx(icons.TrendingUpIcon, { size: 24 }),
2302
+ card: jsxRuntime.jsx(icons.StarFilledIcon, { size: 32 }),
2303
+ floating: jsxRuntime.jsx(icons.CartIcon, { size: 28 }),
2304
+ };
2305
+ const displayIcon = icon || defaultIcons[type];
2306
+ const displayTitle = title || getDefaultTitle(type);
2307
+ const displaySubtitle = subtitle || getDefaultSubtitle(type);
2308
+ 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}%` } }) }))] }) }));
2310
+ };
2311
+ // 기본 텍스트 헬퍼
2312
+ function getDefaultTitle(type) {
2313
+ const titles = {
2314
+ hero: '지금 바로 시작하세요',
2315
+ topbar: '🎉 신규 가입 시 10,000원 적립금 증정!',
2316
+ card: '프리미엄 멤버십',
2317
+ floating: '오늘만 특가!',
2318
+ };
2319
+ return titles[type];
2320
+ }
2321
+ function getDefaultSubtitle(type) {
2322
+ const subtitles = {
2323
+ hero: '최대 50% 할인된 가격으로 프리미엄 서비스를 경험해보세요. 기간 한정 특별 혜택!',
2324
+ topbar: '오늘 하루만 특별 혜택',
2325
+ card: '무제한 서비스 이용권을 특별가에 만나보세요',
2326
+ floating: '장바구니에 담긴 상품 추가 20% 할인',
2327
+ };
2328
+ return subtitles[type];
2329
+ }
2330
+ function getDefaultCtaText(type) {
2331
+ const ctaTexts = {
2332
+ hero: '자세히 보기',
2333
+ topbar: '지금 가입하기',
2334
+ card: '알아보기',
2335
+ floating: '할인받기',
2336
+ };
2337
+ return ctaTexts[type];
2338
+ }
2339
+ AdBanner.displayName = 'AdBanner';
2340
+
2267
2341
  const Alert = ({ title, children, variant = 'info', size = 'm', showIcon = true, closable = true, actions, actionButtons, onClose, className, ...props }) => {
2268
2342
  const [isVisible, setIsVisible] = React.useState(true);
2269
2343
  const handleClose = () => {
@@ -8545,70 +8619,70 @@ const ProgressStep = ({ items, size = 'm', layout = 'vertical', currentStep = 0,
8545
8619
  }) }));
8546
8620
  };
8547
8621
 
8548
- // Designbase 테마 변수 기반 색상 계열
8622
+ // Designbase 테마 기반 색상 계열 (hex 값 사용)
8549
8623
  const colorSchemes = {
8550
8624
  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)',
8625
+ '#48c3ff', // blue-400
8626
+ '#1ea2ff', // blue-500
8627
+ '#0683ff', // blue-600
8628
+ '#006fff', // blue-700
8629
+ '#0855c5', // blue-800
8556
8630
  ],
8557
8631
  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)',
8632
+ '#a4adb2', // neutral-400
8633
+ '#8c9499', // neutral-500
8634
+ '#757b80', // neutral-600
8635
+ '#5e6366', // neutral-700
8636
+ '#464a4d', // neutral-800
8563
8637
  ],
8564
8638
  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)',
8639
+ '#4ade80', // green-400
8640
+ '#22c55e', // green-500
8641
+ '#16a34a', // green-600
8642
+ '#14b8a6', // teal-500
8643
+ '#0d9485', // teal-600
8570
8644
  ],
8571
8645
  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)',
8646
+ '#ff8c32', // orange-400
8647
+ '#ff6b0a', // orange-500
8648
+ '#ff5100', // orange-600
8649
+ '#ffe50d', // yellow-400
8650
+ '#ffd600', // yellow-500
8577
8651
  ],
8578
8652
  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)',
8653
+ '#f87171', // red-400
8654
+ '#ef4444', // red-500
8655
+ '#dc2626', // red-600
8656
+ '#b91c1c', // red-700
8657
+ '#991b1b', // red-800
8584
8658
  ],
8585
8659
  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)',
8660
+ '#48c3ff', // blue-400
8661
+ '#1ea2ff', // blue-500
8662
+ '#0683ff', // blue-600
8663
+ '#006fff', // blue-700
8664
+ '#0855c5', // blue-800
8591
8665
  ],
8592
8666
  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)',
8667
+ '#a385ff', // purple-400
8668
+ '#8a58ff', // purple-500
8669
+ '#7830f7', // purple-600
8670
+ '#6a1ee3', // purple-700
8671
+ '#5818bf', // purple-800
8598
8672
  ],
8599
8673
  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)',
8674
+ '#1ea2ff', // blue-500
8675
+ '#48c3ff', // blue-400
8676
+ '#2dd4c2', // teal-400
8677
+ '#14b8a6', // teal-500
8678
+ '#0d9485', // teal-600
8605
8679
  ],
8606
8680
  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)',
8681
+ '#ff8c32', // orange-400
8682
+ '#ff6b0a', // orange-500
8683
+ '#ff5100', // orange-600
8684
+ '#ef4444', // red-500
8685
+ '#f87171', // red-400
8612
8686
  ],
8613
8687
  };
8614
8688
  const RandomGradient = ({ scheme = 'primary', width = '100%', height = '600px', blur = 60, colorCount = 4, animated = false, animationDuration = 10, overlay = true, overlayOpacity = 0.2, children, className, }) => {
@@ -11193,6 +11267,7 @@ const toggleTheme = () => {
11193
11267
  };
11194
11268
 
11195
11269
  exports.Accordion = Accordion;
11270
+ exports.AdBanner = AdBanner;
11196
11271
  exports.Alert = Alert;
11197
11272
  exports.AnimationBackground = AnimationBackground;
11198
11273
  exports.AnimationText = AnimationText;