@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.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import React, { useState, useCallback, useEffect, useRef, useMemo, useContext, forwardRef, useId, useLayoutEffect } from 'react';
|
|
3
|
-
import { ChevronDownIcon, CloseIcon, InfoFilledIcon, ErrorFilledIcon, WarningFilledIcon, CircleCheckFilledIcon, RefreshIcon, ChevronLeftIcon, PauseIcon, PlayIcon, ChevronRightIcon, RepeatIcon, MuteFilledIcon, VolumeUpIcon, SettingsIcon, UserIcon, HideIcon, ShowIcon, SearchIcon, ChevronUpIcon, GalleryIcon, HeartIcon, BookmarkIcon, ShareAltIcon, DownloadIcon, ArrowLeftIcon,
|
|
3
|
+
import { ChevronDownIcon, StarIcon, TrendingUpIcon, StarFilledIcon, CartIcon, CloseIcon, ArrowRightIcon, InfoFilledIcon, ErrorFilledIcon, WarningFilledIcon, CircleCheckFilledIcon, RefreshIcon, ChevronLeftIcon, PauseIcon, PlayIcon, ChevronRightIcon, RepeatIcon, MuteFilledIcon, VolumeUpIcon, SettingsIcon, UserIcon, HideIcon, ShowIcon, SearchIcon, ChevronUpIcon, GalleryIcon, HeartIcon, BookmarkIcon, ShareAltIcon, DownloadIcon, ArrowLeftIcon, ShrinkIcon, ExpandIcon, DoneIcon as DoneIcon$1, CopyIcon, BulbIcon, CloudCloseIcon, BellActiveIcon, AwardIcon, CalendarIcon, PlusIcon, ErrorIcon, ClockIcon, MinusIcon as MinusIcon$1, VideoIcon, CodeIcon, WriteIcon, UploadIcon, ArrowBarLeftIcon, ArrowBarRightIcon, StarHalfIcon, MoveIcon, MoreVerticalIcon, ArrowDownIcon, ArrowUpLeftIcon, ArrowUpRightIcon, ArrowDownLeftIcon, ArrowDownRightIcon, FacebookIcon, XIcon, InstagramIcon, LinkedinIcon, PinterestIcon, WhatsappIcon, TelegramIcon, MailIcon, LinkIcon, ScanQrcodeIcon, VerticalArrowsIcon, CaretUpdownFilledIcon } from '@designbasekorea/icons';
|
|
4
4
|
import { flushSync, createPortal } from 'react-dom';
|
|
5
5
|
|
|
6
6
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
@@ -2262,6 +2262,80 @@ const Button = forwardRef(({ variant = 'primary', size = 'm', radius, fullWidth
|
|
|
2262
2262
|
});
|
|
2263
2263
|
Button.displayName = 'Button';
|
|
2264
2264
|
|
|
2265
|
+
const AdBanner = ({ type = 'hero', variant = 'primary', title, subtitle, ctaText, onCtaClick, onClose, autoClose = false, closeDelay = 5000, icon, className, }) => {
|
|
2266
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
2267
|
+
const [progress, setProgress] = useState(100);
|
|
2268
|
+
useEffect(() => {
|
|
2269
|
+
if (autoClose) {
|
|
2270
|
+
const interval = setInterval(() => {
|
|
2271
|
+
setProgress(prev => {
|
|
2272
|
+
const newProgress = prev - (100 / (closeDelay / 100));
|
|
2273
|
+
if (newProgress <= 0) {
|
|
2274
|
+
handleClose();
|
|
2275
|
+
clearInterval(interval);
|
|
2276
|
+
return 0;
|
|
2277
|
+
}
|
|
2278
|
+
return newProgress;
|
|
2279
|
+
});
|
|
2280
|
+
}, 100);
|
|
2281
|
+
return () => clearInterval(interval);
|
|
2282
|
+
}
|
|
2283
|
+
}, [autoClose, closeDelay]);
|
|
2284
|
+
const handleClose = () => {
|
|
2285
|
+
setIsVisible(false);
|
|
2286
|
+
onClose?.();
|
|
2287
|
+
};
|
|
2288
|
+
const handleCtaClick = () => {
|
|
2289
|
+
onCtaClick?.();
|
|
2290
|
+
};
|
|
2291
|
+
if (!isVisible)
|
|
2292
|
+
return null;
|
|
2293
|
+
const classes = clsx('designbase-ad-banner', `designbase-ad-banner--type-${type}`, `designbase-ad-banner--variant-${variant}`, {
|
|
2294
|
+
'designbase-ad-banner--auto-close': autoClose,
|
|
2295
|
+
}, className);
|
|
2296
|
+
// 기본 아이콘
|
|
2297
|
+
const defaultIcons = {
|
|
2298
|
+
hero: jsx(StarIcon, { size: 24 }),
|
|
2299
|
+
topbar: jsx(TrendingUpIcon, { size: 24 }),
|
|
2300
|
+
card: jsx(StarFilledIcon, { size: 32 }),
|
|
2301
|
+
floating: jsx(CartIcon, { size: 28 }),
|
|
2302
|
+
};
|
|
2303
|
+
const displayIcon = icon || defaultIcons[type];
|
|
2304
|
+
const displayTitle = title || getDefaultTitle(type);
|
|
2305
|
+
const displaySubtitle = subtitle || getDefaultSubtitle(type);
|
|
2306
|
+
const displayCtaText = ctaText || getDefaultCtaText(type);
|
|
2307
|
+
return (jsx("div", { className: classes, children: jsxs("div", { className: "designbase-ad-banner__content", children: [jsx("button", { className: "designbase-ad-banner__close", onClick: handleClose, "aria-label": "\uB2EB\uAE30", children: jsx(CloseIcon, { size: type === 'hero' ? 20 : 18 }) }), type === 'hero' && (jsxs(Fragment, { children: [jsx("div", { className: "designbase-ad-banner__decoration designbase-ad-banner__decoration--top" }), jsx("div", { className: "designbase-ad-banner__decoration designbase-ad-banner__decoration--bottom" })] })), jsxs("div", { className: "designbase-ad-banner__main", children: [jsxs("div", { className: "designbase-ad-banner__icon", children: [displayIcon, type === 'topbar' && (jsx("span", { className: "designbase-ad-banner__label", children: "\uD2B9\uBCC4 \uC774\uBCA4\uD2B8" })), type === 'floating' && (jsx("span", { className: "designbase-ad-banner__badge", children: "HOT DEAL" }))] }), jsxs("div", { className: "designbase-ad-banner__text", children: [jsx("h2", { className: "designbase-ad-banner__title", children: displayTitle }), jsx("p", { className: "designbase-ad-banner__subtitle", children: displaySubtitle })] }), jsx("div", { className: "designbase-ad-banner__actions", children: jsxs(Button, { variant: "primary", size: type === 'hero' ? 'l' : type === 'card' ? 's' : 'm', onPress: handleCtaClick, className: "designbase-ad-banner__cta", fullWidth: type === 'floating', children: [displayCtaText, jsx(ArrowRightIcon, { size: type === 'hero' ? 20 : 16 })] }) })] }), autoClose && (jsx("div", { className: "designbase-ad-banner__progress", children: jsx("div", { className: "designbase-ad-banner__progress-bar", style: { width: `${progress}%` } }) }))] }) }));
|
|
2308
|
+
};
|
|
2309
|
+
// 기본 텍스트 헬퍼
|
|
2310
|
+
function getDefaultTitle(type) {
|
|
2311
|
+
const titles = {
|
|
2312
|
+
hero: '지금 바로 시작하세요',
|
|
2313
|
+
topbar: '🎉 신규 가입 시 10,000원 적립금 증정!',
|
|
2314
|
+
card: '프리미엄 멤버십',
|
|
2315
|
+
floating: '오늘만 특가!',
|
|
2316
|
+
};
|
|
2317
|
+
return titles[type];
|
|
2318
|
+
}
|
|
2319
|
+
function getDefaultSubtitle(type) {
|
|
2320
|
+
const subtitles = {
|
|
2321
|
+
hero: '최대 50% 할인된 가격으로 프리미엄 서비스를 경험해보세요. 기간 한정 특별 혜택!',
|
|
2322
|
+
topbar: '오늘 하루만 특별 혜택',
|
|
2323
|
+
card: '무제한 서비스 이용권을 특별가에 만나보세요',
|
|
2324
|
+
floating: '장바구니에 담긴 상품 추가 20% 할인',
|
|
2325
|
+
};
|
|
2326
|
+
return subtitles[type];
|
|
2327
|
+
}
|
|
2328
|
+
function getDefaultCtaText(type) {
|
|
2329
|
+
const ctaTexts = {
|
|
2330
|
+
hero: '자세히 보기',
|
|
2331
|
+
topbar: '지금 가입하기',
|
|
2332
|
+
card: '알아보기',
|
|
2333
|
+
floating: '할인받기',
|
|
2334
|
+
};
|
|
2335
|
+
return ctaTexts[type];
|
|
2336
|
+
}
|
|
2337
|
+
AdBanner.displayName = 'AdBanner';
|
|
2338
|
+
|
|
2265
2339
|
const Alert = ({ title, children, variant = 'info', size = 'm', showIcon = true, closable = true, actions, actionButtons, onClose, className, ...props }) => {
|
|
2266
2340
|
const [isVisible, setIsVisible] = useState(true);
|
|
2267
2341
|
const handleClose = () => {
|
|
@@ -8543,70 +8617,70 @@ const ProgressStep = ({ items, size = 'm', layout = 'vertical', currentStep = 0,
|
|
|
8543
8617
|
}) }));
|
|
8544
8618
|
};
|
|
8545
8619
|
|
|
8546
|
-
// Designbase 테마
|
|
8620
|
+
// Designbase 테마 기반 색상 계열 (hex 값 사용)
|
|
8547
8621
|
const colorSchemes = {
|
|
8548
8622
|
primary: [
|
|
8549
|
-
'
|
|
8550
|
-
'
|
|
8551
|
-
'
|
|
8552
|
-
'
|
|
8553
|
-
'
|
|
8623
|
+
'#48c3ff', // blue-400
|
|
8624
|
+
'#1ea2ff', // blue-500
|
|
8625
|
+
'#0683ff', // blue-600
|
|
8626
|
+
'#006fff', // blue-700
|
|
8627
|
+
'#0855c5', // blue-800
|
|
8554
8628
|
],
|
|
8555
8629
|
secondary: [
|
|
8556
|
-
'
|
|
8557
|
-
'
|
|
8558
|
-
'
|
|
8559
|
-
'
|
|
8560
|
-
'
|
|
8630
|
+
'#a4adb2', // neutral-400
|
|
8631
|
+
'#8c9499', // neutral-500
|
|
8632
|
+
'#757b80', // neutral-600
|
|
8633
|
+
'#5e6366', // neutral-700
|
|
8634
|
+
'#464a4d', // neutral-800
|
|
8561
8635
|
],
|
|
8562
8636
|
success: [
|
|
8563
|
-
'
|
|
8564
|
-
'
|
|
8565
|
-
'
|
|
8566
|
-
'
|
|
8567
|
-
'
|
|
8637
|
+
'#4ade80', // green-400
|
|
8638
|
+
'#22c55e', // green-500
|
|
8639
|
+
'#16a34a', // green-600
|
|
8640
|
+
'#14b8a6', // teal-500
|
|
8641
|
+
'#0d9485', // teal-600
|
|
8568
8642
|
],
|
|
8569
8643
|
warning: [
|
|
8570
|
-
'
|
|
8571
|
-
'
|
|
8572
|
-
'
|
|
8573
|
-
'
|
|
8574
|
-
'
|
|
8644
|
+
'#ff8c32', // orange-400
|
|
8645
|
+
'#ff6b0a', // orange-500
|
|
8646
|
+
'#ff5100', // orange-600
|
|
8647
|
+
'#ffe50d', // yellow-400
|
|
8648
|
+
'#ffd600', // yellow-500
|
|
8575
8649
|
],
|
|
8576
8650
|
error: [
|
|
8577
|
-
'
|
|
8578
|
-
'
|
|
8579
|
-
'
|
|
8580
|
-
'
|
|
8581
|
-
'
|
|
8651
|
+
'#f87171', // red-400
|
|
8652
|
+
'#ef4444', // red-500
|
|
8653
|
+
'#dc2626', // red-600
|
|
8654
|
+
'#b91c1c', // red-700
|
|
8655
|
+
'#991b1b', // red-800
|
|
8582
8656
|
],
|
|
8583
8657
|
info: [
|
|
8584
|
-
'
|
|
8585
|
-
'
|
|
8586
|
-
'
|
|
8587
|
-
'
|
|
8588
|
-
'
|
|
8658
|
+
'#48c3ff', // blue-400
|
|
8659
|
+
'#1ea2ff', // blue-500
|
|
8660
|
+
'#0683ff', // blue-600
|
|
8661
|
+
'#006fff', // blue-700
|
|
8662
|
+
'#0855c5', // blue-800
|
|
8589
8663
|
],
|
|
8590
8664
|
purple: [
|
|
8591
|
-
'
|
|
8592
|
-
'
|
|
8593
|
-
'
|
|
8594
|
-
'
|
|
8595
|
-
'
|
|
8665
|
+
'#a385ff', // purple-400
|
|
8666
|
+
'#8a58ff', // purple-500
|
|
8667
|
+
'#7830f7', // purple-600
|
|
8668
|
+
'#6a1ee3', // purple-700
|
|
8669
|
+
'#5818bf', // purple-800
|
|
8596
8670
|
],
|
|
8597
8671
|
ocean: [
|
|
8598
|
-
'
|
|
8599
|
-
'
|
|
8600
|
-
'
|
|
8601
|
-
'
|
|
8602
|
-
'
|
|
8672
|
+
'#1ea2ff', // blue-500
|
|
8673
|
+
'#48c3ff', // blue-400
|
|
8674
|
+
'#2dd4c2', // teal-400
|
|
8675
|
+
'#14b8a6', // teal-500
|
|
8676
|
+
'#0d9485', // teal-600
|
|
8603
8677
|
],
|
|
8604
8678
|
sunset: [
|
|
8605
|
-
'
|
|
8606
|
-
'
|
|
8607
|
-
'
|
|
8608
|
-
'
|
|
8609
|
-
'
|
|
8679
|
+
'#ff8c32', // orange-400
|
|
8680
|
+
'#ff6b0a', // orange-500
|
|
8681
|
+
'#ff5100', // orange-600
|
|
8682
|
+
'#ef4444', // red-500
|
|
8683
|
+
'#f87171', // red-400
|
|
8610
8684
|
],
|
|
8611
8685
|
};
|
|
8612
8686
|
const RandomGradient = ({ scheme = 'primary', width = '100%', height = '600px', blur = 60, colorCount = 4, animated = false, animationDuration = 10, overlay = true, overlayOpacity = 0.2, children, className, }) => {
|
|
@@ -11190,5 +11264,5 @@ const toggleTheme = () => {
|
|
|
11190
11264
|
console.log('toggleTheme called');
|
|
11191
11265
|
};
|
|
11192
11266
|
|
|
11193
|
-
export { Accordion, Alert, AnimationBackground, AnimationText, AudioPlayer, Avatar, Backdrop, Badge, Banner, BottomSheet, Breadcrumbs, Button, Calendar, Card, Carousel, Checkbox, Chip, ColorPicker, Confirm, Container, ContextMenu, Countdown, DatePicker, Divider, Drawer, Dropdown, Dropzone, EmptyState, FileUploader, FloatingActionButton, Form, Gradient, Grid, HeroFeature, Image$1 as Image, ImageList, Input, Label, Lightbox, List, Logo, MarkdownEditor, Masonry, MenuItem, Modal, ModalBody, ModalFooter, ModalHeader, Navbar, Pagination, Popover, Progress, ProgressStep, Progressbar, Radio, RandomGradient, RangeSlider, Rating, Reorder, ResizablePanels, ScrollArea, SearchBar, Section, SegmentControl, Select, Share, Sidebar, Skeleton, Spinner, SplitView, Stack, Stat, Stepper, Table, Tabs, Textarea, TimePicker, Timeline, Toast, Toggle, Toolbar, Tooltip, VideoPlayer, YouTubePlayer, getTheme, setTheme, toggleTheme };
|
|
11267
|
+
export { Accordion, AdBanner, Alert, AnimationBackground, AnimationText, AudioPlayer, Avatar, Backdrop, Badge, Banner, BottomSheet, Breadcrumbs, Button, Calendar, Card, Carousel, Checkbox, Chip, ColorPicker, Confirm, Container, ContextMenu, Countdown, DatePicker, Divider, Drawer, Dropdown, Dropzone, EmptyState, FileUploader, FloatingActionButton, Form, Gradient, Grid, HeroFeature, Image$1 as Image, ImageList, Input, Label, Lightbox, List, Logo, MarkdownEditor, Masonry, MenuItem, Modal, ModalBody, ModalFooter, ModalHeader, Navbar, Pagination, Popover, Progress, ProgressStep, Progressbar, Radio, RandomGradient, RangeSlider, Rating, Reorder, ResizablePanels, ScrollArea, SearchBar, Section, SegmentControl, Select, Share, Sidebar, Skeleton, Spinner, SplitView, Stack, Stat, Stepper, Table, Tabs, Textarea, TimePicker, Timeline, Toast, Toggle, Toolbar, Tooltip, VideoPlayer, YouTubePlayer, getTheme, setTheme, toggleTheme };
|
|
11194
11268
|
//# sourceMappingURL=index.esm.js.map
|