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