@designbasekorea/ui 0.6.0 → 0.7.0
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 +104 -4
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.css.map +1 -1
- package/dist/index.esm.js +167 -53
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +169 -52
- 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 +169 -52
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -4451,7 +4451,53 @@ const Checkbox = forwardRef(({ isSelected, defaultSelected, isIndeterminate = fa
|
|
|
4451
4451
|
});
|
|
4452
4452
|
Checkbox.displayName = 'Checkbox';
|
|
4453
4453
|
|
|
4454
|
-
const
|
|
4454
|
+
const Chip = ({ label, size = 'm', variant = 'default', color = 'primary', deletable = false, onDelete, onClick, startIcon, endIcon, disabled = false, selected = false, fullWidth = false, className, ...props }) => {
|
|
4455
|
+
// 사이즈별 아이콘 크기
|
|
4456
|
+
const getIconSize = () => {
|
|
4457
|
+
switch (size) {
|
|
4458
|
+
case 's':
|
|
4459
|
+
return 12;
|
|
4460
|
+
case 'm':
|
|
4461
|
+
return 16;
|
|
4462
|
+
case 'l':
|
|
4463
|
+
return 20;
|
|
4464
|
+
default:
|
|
4465
|
+
return 16;
|
|
4466
|
+
}
|
|
4467
|
+
};
|
|
4468
|
+
const iconSize = getIconSize();
|
|
4469
|
+
const handleDelete = (e) => {
|
|
4470
|
+
e.stopPropagation();
|
|
4471
|
+
if (!disabled && onDelete) {
|
|
4472
|
+
onDelete();
|
|
4473
|
+
}
|
|
4474
|
+
};
|
|
4475
|
+
const handleClick = () => {
|
|
4476
|
+
if (!disabled && onClick) {
|
|
4477
|
+
onClick();
|
|
4478
|
+
}
|
|
4479
|
+
};
|
|
4480
|
+
const classes = clsx('designbase-chip', `designbase-chip--${size}`, `designbase-chip--${variant}`, {
|
|
4481
|
+
'designbase-chip--deletable': deletable,
|
|
4482
|
+
'designbase-chip--disabled': disabled,
|
|
4483
|
+
'designbase-chip--selected': selected,
|
|
4484
|
+
'designbase-chip--clickable': onClick,
|
|
4485
|
+
'designbase-chip--full-width': fullWidth,
|
|
4486
|
+
}, className);
|
|
4487
|
+
return (jsxs("div", { className: classes, role: onClick ? 'button' : undefined, tabIndex: onClick && !disabled ? 0 : undefined, onClick: handleClick, onKeyDown: (e) => {
|
|
4488
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
4489
|
+
e.preventDefault();
|
|
4490
|
+
handleClick();
|
|
4491
|
+
}
|
|
4492
|
+
}, ...props, children: [startIcon && (jsx("span", { className: "designbase-chip__start-icon", children: React.isValidElement(startIcon)
|
|
4493
|
+
? React.cloneElement(startIcon, { size: iconSize })
|
|
4494
|
+
: startIcon })), jsx("span", { className: "designbase-chip__label", children: label }), endIcon && !deletable && (jsx("span", { className: "designbase-chip__end-icon", children: React.isValidElement(endIcon)
|
|
4495
|
+
? React.cloneElement(endIcon, { size: iconSize })
|
|
4496
|
+
: endIcon })), deletable && (jsx("button", { type: "button", className: "designbase-chip__delete-button", onClick: handleDelete, disabled: disabled, "aria-label": `${label} 삭제`, children: jsx("svg", { width: iconSize, height: iconSize, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M18 6L6 18M6 6l12 12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) }))] }));
|
|
4497
|
+
};
|
|
4498
|
+
Chip.displayName = 'Chip';
|
|
4499
|
+
|
|
4500
|
+
const SearchBar = ({ value, defaultValue = '', placeholder = '검색...', size = 'm', variant = 'default', disabled = false, readOnly = false, fullWidth = false, searchIcon: SearchIconComponent = SearchIcon, clearIcon: ClearIconComponent = CloseIcon, enableRecentSearches = false, recentSearchesKey = 'searchbar-recent-searches', recentSearchesLayout = 'vertical', suggestedSearches = [], suggestionRollingInterval = 5000, categories = [], selectedCategory = '', onCategoryChange, searchResults, renderSearchResult, onSearchResultClick, emptyStateMessage, onChange, onSearch, onFocus, onBlur, onKeyDown, showShortcut = false, shortcutLabel = '⌘K', className, ...rest }) => {
|
|
4455
4501
|
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
4456
4502
|
const [recentSearches, setRecentSearches] = useState([]);
|
|
4457
4503
|
const [showRecentSearches, setShowRecentSearches] = useState(false);
|
|
@@ -4498,6 +4544,26 @@ const SearchBar = ({ value, defaultValue = '', placeholder = '검색...', size =
|
|
|
4498
4544
|
setInternalValue(value);
|
|
4499
4545
|
}
|
|
4500
4546
|
}, [value]);
|
|
4547
|
+
// 전역 단축키 포커스
|
|
4548
|
+
useEffect(() => {
|
|
4549
|
+
if (!showShortcut || disabled || readOnly)
|
|
4550
|
+
return;
|
|
4551
|
+
const handleGlobalKeyDown = (e) => {
|
|
4552
|
+
const isModifier = e.metaKey || e.ctrlKey;
|
|
4553
|
+
let keyToMatch = 'k'; // 기본값 (⌘K)
|
|
4554
|
+
if (shortcutLabel) {
|
|
4555
|
+
const lastChar = shortcutLabel.slice(-1).toLowerCase();
|
|
4556
|
+
if (lastChar)
|
|
4557
|
+
keyToMatch = lastChar;
|
|
4558
|
+
}
|
|
4559
|
+
if (isModifier && e.key.toLowerCase() === keyToMatch) {
|
|
4560
|
+
e.preventDefault();
|
|
4561
|
+
inputRef.current?.focus();
|
|
4562
|
+
}
|
|
4563
|
+
};
|
|
4564
|
+
window.addEventListener('keydown', handleGlobalKeyDown);
|
|
4565
|
+
return () => window.removeEventListener('keydown', handleGlobalKeyDown);
|
|
4566
|
+
}, [showShortcut, shortcutLabel, disabled, readOnly]);
|
|
4501
4567
|
const handleChange = (e) => {
|
|
4502
4568
|
const newValue = e.target.value;
|
|
4503
4569
|
setInternalValue(newValue);
|
|
@@ -4582,6 +4648,20 @@ const SearchBar = ({ value, defaultValue = '', placeholder = '검색...', size =
|
|
|
4582
4648
|
}
|
|
4583
4649
|
handleSearch(suggestion);
|
|
4584
4650
|
};
|
|
4651
|
+
const handleSearchResultClick = (result) => {
|
|
4652
|
+
onSearchResultClick?.(result);
|
|
4653
|
+
setShowRecentSearches(false); // Close dropdown
|
|
4654
|
+
};
|
|
4655
|
+
const handleCategoryClick = (category) => {
|
|
4656
|
+
onCategoryChange?.(category);
|
|
4657
|
+
};
|
|
4658
|
+
const hasSearchResults = searchResults !== undefined && searchResults.length > 0;
|
|
4659
|
+
const hasValue = currentValue && currentValue.length > 0;
|
|
4660
|
+
const showDropdown = isFocused && (categories.length > 0 ||
|
|
4661
|
+
(enableRecentSearches && recentSearches.length > 0 && !hasValue) ||
|
|
4662
|
+
(suggestedSearches.length > 0 && !hasValue) ||
|
|
4663
|
+
(searchResults !== undefined && hasValue) ||
|
|
4664
|
+
(emptyStateMessage && !hasValue && (!enableRecentSearches || recentSearches.length === 0) && suggestedSearches.length === 0));
|
|
4585
4665
|
const classes = clsx('designbase-search-bar', `designbase-search-bar--${size}`, `designbase-search-bar--${variant}`, {
|
|
4586
4666
|
'designbase-search-bar--disabled': disabled,
|
|
4587
4667
|
'designbase-search-bar--readonly': readOnly,
|
|
@@ -4597,9 +4677,30 @@ const SearchBar = ({ value, defaultValue = '', placeholder = '검색...', size =
|
|
|
4597
4677
|
? suggestedSearches[currentSuggestion]
|
|
4598
4678
|
: placeholder;
|
|
4599
4679
|
const shortcutBadgeSize = size === 'l' ? 'm' : 's';
|
|
4600
|
-
return (jsxs("div", { className: classes, role: "search", children: [jsxs("div", { className: "designbase-search-bar__container", children: [jsx("div", { className: "designbase-search-bar__search-icon", children: jsx(SearchIconComponent, { size: size === 's' ? 16 : size === 'l' ? 24 : 20 }) }), jsx("input", { ref: inputRef, type: "text", className: inputClasses, value: currentValue, placeholder: currentPlaceholder, disabled: disabled, readOnly: readOnly, onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: handleKeyDown, "aria-label": "\uAC80\uC0C9\uC5B4 \uC785\uB825", ...rest }), showShortcut && !currentValue && !disabled && !readOnly && (jsx(Badge, { className: "designbase-search-bar__shortcut-badge", size: shortcutBadgeSize, variant: "secondary", style: "text", "aria-hidden": "true", children: shortcutLabel })), currentValue && currentValue.length > 0 && !disabled && !readOnly && (jsx("button", { type: "button", className: "designbase-search-bar__clear-button", onClick: handleClear, "aria-label": "\uAC80\uC0C9\uC5B4 \uC9C0\uC6B0\uAE30", children: jsx(ClearIconComponent, { size: size === 's' ? 16 : size === 'l' ? 24 : 20 }) }))] }),
|
|
4601
|
-
|
|
4602
|
-
|
|
4680
|
+
return (jsxs("div", { className: classes, role: "search", children: [jsxs("div", { className: "designbase-search-bar__container", children: [jsx("div", { className: "designbase-search-bar__search-icon", children: jsx(SearchIconComponent, { size: size === 's' ? 16 : size === 'l' ? 24 : 20 }) }), jsx("input", { ref: inputRef, type: "text", className: inputClasses, value: currentValue, placeholder: currentPlaceholder, disabled: disabled, readOnly: readOnly, onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: handleKeyDown, "aria-label": "\uAC80\uC0C9\uC5B4 \uC785\uB825", ...rest }), showShortcut && !currentValue && !disabled && !readOnly && (jsx(Badge, { className: "designbase-search-bar__shortcut-badge", size: shortcutBadgeSize, variant: "secondary", style: "text", "aria-hidden": "true", children: shortcutLabel })), currentValue && currentValue.length > 0 && !disabled && !readOnly && (jsx("button", { type: "button", className: "designbase-search-bar__clear-button", onClick: handleClear, "aria-label": "\uAC80\uC0C9\uC5B4 \uC9C0\uC6B0\uAE30", children: jsx(ClearIconComponent, { size: size === 's' ? 16 : size === 'l' ? 24 : 20 }) }))] }), showDropdown && (jsxs("div", { className: "designbase-search-bar__dropdown", children: [categories.length > 0 && (jsx("div", { className: "designbase-search-bar__categories", children: categories.map((category) => (jsx(Chip, { label: category, size: "s", variant: category === selectedCategory ? 'primary' : 'default', onClick: () => { }, onMouseDown: (e) => {
|
|
4681
|
+
// prevent blur
|
|
4682
|
+
e.preventDefault();
|
|
4683
|
+
handleCategoryClick(category);
|
|
4684
|
+
} }, category))) })), hasValue && searchResults !== undefined ? (jsx("div", { className: "designbase-search-bar__results", children: hasSearchResults ? (jsx("ul", { className: "designbase-search-bar__results-list", children: searchResults.map((result, index) => (jsx("li", { className: "designbase-search-bar__result-item", onMouseDown: (e) => {
|
|
4685
|
+
e.preventDefault();
|
|
4686
|
+
handleSearchResultClick(result);
|
|
4687
|
+
}, children: renderSearchResult ? renderSearchResult(result, index) : result.toString() }, index))) })) : (jsx("div", { className: "designbase-search-bar__results-empty", children: "\uAC80\uC0C9 \uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4." })) })) : (
|
|
4688
|
+
/* 2. 최근 검색어 & 추천 검색어 (검색어가 없을 때) */
|
|
4689
|
+
jsxs(Fragment, { children: [enableRecentSearches && !hasValue && recentSearches.length > 0 && (jsxs("div", { className: clsx('designbase-search-bar__recent-searches', `designbase-search-bar__recent-searches--${recentSearchesLayout}`), children: [jsxs("div", { className: "designbase-search-bar__recent-header", children: [jsx("span", { className: "designbase-search-bar__recent-title", children: "\uCD5C\uADFC \uAC80\uC0C9\uC5B4" }), jsx("button", { type: "button", className: "designbase-search-bar__clear-all-button", onMouseDown: (e) => {
|
|
4690
|
+
e.preventDefault();
|
|
4691
|
+
handleClearAllRecentSearches();
|
|
4692
|
+
}, "aria-label": "\uBAA8\uB4E0 \uCD5C\uADFC \uAC80\uC0C9\uC5B4 \uC0AD\uC81C", children: "\uC804\uCCB4 \uC0AD\uC81C" })] }), jsx("div", { className: "designbase-search-bar__recent-list", children: recentSearches.map((searchTerm, index) => (jsxs("div", { className: "designbase-search-bar__recent-item", children: [jsx("button", { type: "button", className: "designbase-search-bar__recent-search-button", onMouseDown: (e) => {
|
|
4693
|
+
e.preventDefault();
|
|
4694
|
+
handleRecentSearchClick(searchTerm);
|
|
4695
|
+
}, children: searchTerm }), jsx("button", { type: "button", className: "designbase-search-bar__recent-remove-button", onMouseDown: (e) => {
|
|
4696
|
+
e.preventDefault();
|
|
4697
|
+
handleRemoveRecentSearch(searchTerm);
|
|
4698
|
+
}, "aria-label": `${searchTerm} 삭제`, children: jsx(CloseIcon, { size: 16 }) })] }, index))) })] })), suggestedSearches.length > 0 && !hasValue && (jsxs("div", { className: "designbase-search-bar__suggestions", children: [jsx("div", { className: "designbase-search-bar__suggestions-header", children: jsx("span", { className: "designbase-search-bar__suggestions-title", children: "\uCD94\uCC9C \uAC80\uC0C9\uC5B4" }) }), jsx("div", { className: "designbase-search-bar__suggestions-list", children: suggestedSearches.map((suggestion, index) => (jsx("button", { type: "button", className: clsx('designbase-search-bar__suggestion-item', {
|
|
4699
|
+
'designbase-search-bar__suggestion-item--active': index === currentSuggestion
|
|
4700
|
+
}), onMouseDown: (e) => {
|
|
4701
|
+
e.preventDefault();
|
|
4702
|
+
handleSuggestionClick(suggestion);
|
|
4703
|
+
}, children: suggestion }, index))) })] })), emptyStateMessage && !hasValue && (!enableRecentSearches || recentSearches.length === 0) && suggestedSearches.length === 0 && (jsx("div", { className: "designbase-search-bar__empty-state", children: emptyStateMessage }))] }))] }))] }));
|
|
4603
4704
|
};
|
|
4604
4705
|
SearchBar.displayName = 'SearchBar';
|
|
4605
4706
|
|
|
@@ -5771,52 +5872,6 @@ const Carousel = ({ items, size = 'm', variant = 'default', theme = 'light', tra
|
|
|
5771
5872
|
}, title: "\uB2E4\uC6B4\uB85C\uB4DC", children: jsx(DownloadIcon, { size: iconSize, color: "currentColor" }) }))] })] }, item.id))) }), showNavigation && items.length > 1 && (jsxs(Fragment, { children: [jsx("button", { className: clsx('designbase-carousel__nav-button', 'designbase-carousel__nav-button--prev'), onClick: goToPrevious, disabled: disabled || readonly || isPrevDisabled, title: "\uC774\uC804 \uC2AC\uB77C\uC774\uB4DC", type: "button", children: jsx(ChevronLeftIcon, { size: iconSize, color: "currentColor" }) }), jsx("button", { className: clsx('designbase-carousel__nav-button', 'designbase-carousel__nav-button--next'), onClick: goToNext, disabled: disabled || readonly || isNextDisabled, title: "\uB2E4\uC74C \uC2AC\uB77C\uC774\uB4DC", type: "button", children: jsx(ChevronRightIcon, { size: iconSize, color: "currentColor" }) })] })), enablePaging && items.length > 1 && (jsxs(Fragment, { children: [jsx("button", { className: "designbase-carousel__quick-nav-button designbase-carousel__quick-nav-button--first", onClick: goToFirst, disabled: disabled || readonly || currentIndex === 0, title: "\uCCAB \uBC88\uC9F8 \uC2AC\uB77C\uC774\uB4DC", type: "button", children: jsx(ArrowLeftIcon, { size: iconSize, color: "currentColor" }) }), jsx("button", { className: "designbase-carousel__quick-nav-button designbase-carousel__quick-nav-button--last", onClick: goToLast, disabled: disabled || readonly || currentIndex === items.length - 1, title: "\uB9C8\uC9C0\uB9C9 \uC2AC\uB77C\uC774\uB4DC", type: "button", children: jsx(ArrowRightIcon, { size: iconSize, color: "currentColor" }) })] })), enableFullscreen && (jsx("button", { className: "designbase-carousel__fullscreen-button", onClick: handleFullscreenToggle, disabled: disabled || readonly, title: isFullscreen ? "전체화면 해제" : "전체화면", type: "button", children: isFullscreen ? jsx(ShrinkIcon, { size: iconSize, color: "currentColor" }) : jsx(ExpandIcon, { size: iconSize, color: "currentColor" }) }))] }), jsxs("div", { className: "designbase-carousel__controls", children: [showIndicators && items.length > 1 && (jsx("div", { className: "designbase-carousel__indicators", children: jsx(Indicator, { current: currentIndex, total: items.length, type: indicatorStyle === 'lines' ? 'line' : indicatorStyle === 'numbers' ? 'numbers' : 'dots', size: "s", clickable: true, onStepClick: goToSlide }) })), showAutoPlayControl && items.length > 1 && (jsx("button", { className: "designbase-carousel__autoplay-button", onClick: handleAutoPlayToggle, disabled: disabled || readonly, title: isAutoPlaying ? "자동 재생 정지" : "자동 재생 시작", type: "button", children: isAutoPlaying ? jsx(PauseIcon, { size: iconSize, color: "currentColor" }) : jsx(PlayIcon, { size: iconSize, color: "currentColor" }) }))] })] }));
|
|
5772
5873
|
};
|
|
5773
5874
|
|
|
5774
|
-
const Chip = ({ label, size = 'm', variant = 'default', color = 'primary', deletable = false, onDelete, onClick, startIcon, endIcon, disabled = false, selected = false, fullWidth = false, className, ...props }) => {
|
|
5775
|
-
// 사이즈별 아이콘 크기
|
|
5776
|
-
const getIconSize = () => {
|
|
5777
|
-
switch (size) {
|
|
5778
|
-
case 's':
|
|
5779
|
-
return 12;
|
|
5780
|
-
case 'm':
|
|
5781
|
-
return 16;
|
|
5782
|
-
case 'l':
|
|
5783
|
-
return 20;
|
|
5784
|
-
default:
|
|
5785
|
-
return 16;
|
|
5786
|
-
}
|
|
5787
|
-
};
|
|
5788
|
-
const iconSize = getIconSize();
|
|
5789
|
-
const handleDelete = (e) => {
|
|
5790
|
-
e.stopPropagation();
|
|
5791
|
-
if (!disabled && onDelete) {
|
|
5792
|
-
onDelete();
|
|
5793
|
-
}
|
|
5794
|
-
};
|
|
5795
|
-
const handleClick = () => {
|
|
5796
|
-
if (!disabled && onClick) {
|
|
5797
|
-
onClick();
|
|
5798
|
-
}
|
|
5799
|
-
};
|
|
5800
|
-
const classes = clsx('designbase-chip', `designbase-chip--${size}`, `designbase-chip--${variant}`, {
|
|
5801
|
-
'designbase-chip--deletable': deletable,
|
|
5802
|
-
'designbase-chip--disabled': disabled,
|
|
5803
|
-
'designbase-chip--selected': selected,
|
|
5804
|
-
'designbase-chip--clickable': onClick,
|
|
5805
|
-
'designbase-chip--full-width': fullWidth,
|
|
5806
|
-
}, className);
|
|
5807
|
-
return (jsxs("div", { className: classes, role: onClick ? 'button' : undefined, tabIndex: onClick && !disabled ? 0 : undefined, onClick: handleClick, onKeyDown: (e) => {
|
|
5808
|
-
if (e.key === 'Enter' || e.key === ' ') {
|
|
5809
|
-
e.preventDefault();
|
|
5810
|
-
handleClick();
|
|
5811
|
-
}
|
|
5812
|
-
}, ...props, children: [startIcon && (jsx("span", { className: "designbase-chip__start-icon", children: React.isValidElement(startIcon)
|
|
5813
|
-
? React.cloneElement(startIcon, { size: iconSize })
|
|
5814
|
-
: startIcon })), jsx("span", { className: "designbase-chip__label", children: label }), endIcon && !deletable && (jsx("span", { className: "designbase-chip__end-icon", children: React.isValidElement(endIcon)
|
|
5815
|
-
? React.cloneElement(endIcon, { size: iconSize })
|
|
5816
|
-
: endIcon })), deletable && (jsx("button", { type: "button", className: "designbase-chip__delete-button", onClick: handleDelete, disabled: disabled, "aria-label": `${label} 삭제`, children: jsx("svg", { width: iconSize, height: iconSize, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M18 6L6 18M6 6l12 12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) }))] }));
|
|
5817
|
-
};
|
|
5818
|
-
Chip.displayName = 'Chip';
|
|
5819
|
-
|
|
5820
5875
|
/* ----------------------- 유틸 ----------------------- */
|
|
5821
5876
|
const clamp = (n, min, max) => Math.max(min, Math.min(max, n));
|
|
5822
5877
|
const normalizeHex = (s) => (s || '').trim().toUpperCase();
|
|
@@ -8255,6 +8310,32 @@ const HeroFeature = ({ title, subtitle, description, image, imageAlt, background
|
|
|
8255
8310
|
return (jsxs("section", { className: classes, style: containerStyle, children: [renderBackground(), renderOverlay(), jsxs("div", { className: "designbase-hero-feature__container", children: [jsxs("div", { className: "designbase-hero-feature__content", children: [icon && (jsx("div", { className: "designbase-hero-feature__icon", children: icon })), renderBadge(), jsx("h1", { className: "designbase-hero-feature__title", children: title }), subtitle && (jsx("h2", { className: "designbase-hero-feature__subtitle", children: subtitle })), description && (jsx("p", { className: "designbase-hero-feature__description", children: description })), renderButtons(), renderStats()] }), variant === 'split' && renderImage()] }), variant !== 'split' && renderImage()] }));
|
|
8256
8311
|
};
|
|
8257
8312
|
|
|
8313
|
+
/**
|
|
8314
|
+
* ImagePlaceholder 컴포넌트
|
|
8315
|
+
*
|
|
8316
|
+
* 이미지가 없거나 업로드 전 대기 상태일 때 격자 패턴과 라벨을 보여주는 자리표시자입니다.
|
|
8317
|
+
*/
|
|
8318
|
+
const ImagePlaceholder = ({ className, style, label, showLabel = false, patternSize = 20, patternColor = '#f3f3f3', backgroundColor = '#e7e7e7', width = '100%', height, aspectRatio, hoverEffect = false, onClick, }) => {
|
|
8319
|
+
const rootStyle = {
|
|
8320
|
+
width,
|
|
8321
|
+
height,
|
|
8322
|
+
aspectRatio,
|
|
8323
|
+
...style,
|
|
8324
|
+
};
|
|
8325
|
+
const patternStyle = {
|
|
8326
|
+
'--db-placeholder-bg': backgroundColor,
|
|
8327
|
+
'--db-placeholder-pattern': patternColor,
|
|
8328
|
+
'--db-placeholder-size': `${patternSize}px`,
|
|
8329
|
+
'--db-placeholder-half-size': `${patternSize / 2}px`,
|
|
8330
|
+
};
|
|
8331
|
+
const classes = clsx('designbase-image-placeholder', {
|
|
8332
|
+
'designbase-image-placeholder--hover': hoverEffect,
|
|
8333
|
+
'designbase-image-placeholder--clickable': !!onClick,
|
|
8334
|
+
}, className);
|
|
8335
|
+
return (jsxs("div", { className: classes, style: rootStyle, onClick: onClick, role: onClick ? 'button' : undefined, tabIndex: onClick ? 0 : undefined, children: [jsx("div", { className: "designbase-image-placeholder__pattern", style: patternStyle }), showLabel && label && (jsx("div", { className: "designbase-image-placeholder__label-wrap", children: jsx("span", { className: "designbase-image-placeholder__label", children: label }) }))] }));
|
|
8336
|
+
};
|
|
8337
|
+
ImagePlaceholder.displayName = 'ImagePlaceholder';
|
|
8338
|
+
|
|
8258
8339
|
const Lightbox = ({ images, currentIndex = 0, size = 'l', isOpen, onOpenChange, onImageChange, enableZoom = true, enableRotate = true, enableDownload = true, enableFullscreen = true, enableKeyboard = true, enableWheelZoom = true, showThumbnails = true, showCounter = true, showCloseButton = true, showNavigationButtons = true, showToolbar = true, closeOnBackdropClick = true, closeOnEscape = true, className, }) => {
|
|
8259
8340
|
const [internalCurrentIndex, setInternalCurrentIndex] = useState(currentIndex);
|
|
8260
8341
|
const [zoomLevel, setZoomLevel] = useState(1);
|
|
@@ -9354,6 +9435,17 @@ const OnboardingModal = ({ steps, currentStep = 0, isOpen, onClose, onStepChange
|
|
|
9354
9435
|
};
|
|
9355
9436
|
OnboardingModal.displayName = 'OnboardingModal';
|
|
9356
9437
|
|
|
9438
|
+
/**
|
|
9439
|
+
* PageHeader 컴포넌트
|
|
9440
|
+
*
|
|
9441
|
+
* 브레드크럼, 타이틀, 서브타이틀, 설명 및 액션(버튼, 탭 등)을 포함하는 페이지 헤더 섹션입니다.
|
|
9442
|
+
*/
|
|
9443
|
+
const PageHeader = ({ title, description, subtitle, breadcrumbs, actions, align = 'center', className, }) => {
|
|
9444
|
+
const classes = clsx('designbase-page-header', `designbase-page-header--${align}`, className);
|
|
9445
|
+
return (jsxs("div", { className: classes, children: [breadcrumbs && breadcrumbs.length > 0 && (jsx("div", { className: "designbase-page-header__breadcrumbs", children: jsx(Breadcrumbs, { items: breadcrumbs, size: "s" }) })), jsxs("div", { className: "designbase-page-header__content", children: [jsx("h1", { className: "designbase-page-header__title", children: title }), subtitle && (jsx("h2", { className: "designbase-page-header__subtitle", children: subtitle })), description && (jsx("div", { className: "designbase-page-header__description", children: description }))] }), actions && (jsx("div", { className: "designbase-page-header__actions", children: actions }))] }));
|
|
9446
|
+
};
|
|
9447
|
+
PageHeader.displayName = 'PageHeader';
|
|
9448
|
+
|
|
9357
9449
|
const Tutorial = ({ steps, currentStep = 0, isActive, onStart, onEnd, onStepChange, onNext, onPrev, indicatorType = 'numbers', indicatorSize = 'm', closeIcon: CloseIconComponent = CloseIcon, prevIcon: PrevIconComponent = ChevronLeftIcon, nextIcon: NextIconComponent = ChevronRightIcon, className, ...props }) => {
|
|
9358
9450
|
const [internalStep, setInternalStep] = useState(currentStep);
|
|
9359
9451
|
const [targetElement, setTargetElement] = useState(null);
|
|
@@ -10038,7 +10130,7 @@ const Progress = ({ value, max = 100, size = 'm', variant = 'default', type = 'l
|
|
|
10038
10130
|
return (jsx("div", { className: classes, children: type === 'linear' ? renderLinearProgress() : renderCircularProgress() }));
|
|
10039
10131
|
};
|
|
10040
10132
|
|
|
10041
|
-
const ProgressStep = ({ items, size = 'm', layout = '
|
|
10133
|
+
const ProgressStep = ({ items, size = 'm', layout = 'horizontal', currentStep = 0, clickable = false, fullWidth = false, disabled = false, className, style, onStepClick, }) => {
|
|
10042
10134
|
const handleStepClick = (item, index) => {
|
|
10043
10135
|
if (disabled || item.disabled || !clickable)
|
|
10044
10136
|
return;
|
|
@@ -10076,7 +10168,7 @@ const ProgressStep = ({ items, size = 'm', layout = 'vertical', currentStep = 0,
|
|
|
10076
10168
|
e.preventDefault();
|
|
10077
10169
|
handleStepClick(item, index);
|
|
10078
10170
|
}
|
|
10079
|
-
}, children: [status === 'active' && (jsx("div", { className: "designbase-progress-step__pulse" })), item.icon ? (jsx("div", { className: "designbase-progress-step__icon", children: item.icon })) : (jsx("span", { className: "designbase-progress-step__number", children: index + 1 }))] }), !isLast && (jsx("div", { className: connectorClasses }))] }), jsxs("div", { className: "designbase-progress-step__content", children: [
|
|
10171
|
+
}, children: [status === 'active' && (jsx("div", { className: "designbase-progress-step__pulse" })), item.icon ? (jsx("div", { className: "designbase-progress-step__icon", children: item.icon })) : (jsx("div", { className: "designbase-progress-step__icon", children: status === 'completed' ? (jsx(DoneIcon$1, { size: size === 's' ? 12 : size === 'l' ? 20 : 16 })) : status === 'error' ? (jsx(WarningFilledIcon, { size: size === 's' ? 12 : size === 'l' ? 20 : 16 })) : (jsx("span", { className: "designbase-progress-step__number", children: index + 1 })) }))] }), !isLast && (jsx("div", { className: connectorClasses }))] }), jsxs("div", { className: "designbase-progress-step__content", children: [jsx("div", { className: "designbase-progress-step__header", children: jsx("h3", { className: "designbase-progress-step__title", children: item.title }) }), item.description && (jsx("p", { className: "designbase-progress-step__description", children: item.description })), item.timestamp && (jsx("span", { className: "designbase-progress-step__timestamp", children: item.timestamp }))] })] }, item.id));
|
|
10080
10172
|
}) }));
|
|
10081
10173
|
};
|
|
10082
10174
|
|
|
@@ -12182,6 +12274,28 @@ const Toolbar = ({ items, size = 'm', variant = 'default', position = 'top', ful
|
|
|
12182
12274
|
return (jsx("div", { className: classes, children: jsxs("div", { className: "designbase-toolbar__content", children: [Object.entries(groupedItems).map(([groupName, groupItems], groupIndex) => (jsxs("div", { className: "designbase-toolbar__group", children: [groupItems.map(renderItem), groupIndex < Object.keys(groupedItems).length - 1 && (jsx("div", { className: "designbase-toolbar__group-separator" }))] }, groupName))), children && (jsx("div", { className: "designbase-toolbar__children", children: children }))] }) }));
|
|
12183
12275
|
};
|
|
12184
12276
|
|
|
12277
|
+
/**
|
|
12278
|
+
* TopBanner 컴포넌트
|
|
12279
|
+
*
|
|
12280
|
+
* 페이지 최상단에 위치하여 공지사항이나 프로모션을 안내하는 슬림한 배너입니다.
|
|
12281
|
+
*/
|
|
12282
|
+
const TopBanner = ({ badgeText, content, image, linkText, onLinkPress, onClose, variant = 'primary', fixed = false, className, }) => {
|
|
12283
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
12284
|
+
if (!isVisible)
|
|
12285
|
+
return null;
|
|
12286
|
+
const handleClose = () => {
|
|
12287
|
+
setIsVisible(false);
|
|
12288
|
+
onClose?.();
|
|
12289
|
+
};
|
|
12290
|
+
const isDarkBg = variant === 'primary' || variant === 'dark';
|
|
12291
|
+
const classes = clsx('designbase-top-banner', `designbase-top-banner--${variant}`, {
|
|
12292
|
+
'designbase-top-banner--fixed': fixed,
|
|
12293
|
+
'designbase-top-banner--has-image': !!image,
|
|
12294
|
+
}, className);
|
|
12295
|
+
return (jsx("div", { className: classes, role: "alert", children: jsxs("div", { className: "designbase-top-banner__container", children: [jsxs("div", { className: "designbase-top-banner__content", children: [image && (jsx("div", { className: "designbase-top-banner__image-wrapper", children: jsx("img", { src: image, alt: "", className: "designbase-top-banner__image" }) })), badgeText && (jsx(Badge, { size: "s", variant: isDarkBg ? 'secondary' : 'primary', style: "text", className: "designbase-top-banner__badge", children: badgeText })), jsx("span", { className: "designbase-top-banner__text", children: content }), linkText && (jsx(Button, { className: "designbase-top-banner__link", variant: isDarkBg ? 'secondary' : 'ghost', size: "s", onPress: onLinkPress, endIcon: ChevronRightIcon, children: linkText }))] }), jsx(Button, { className: "designbase-top-banner__close", variant: "ghost", size: "m", iconOnly: true, onPress: handleClose, "aria-label": "\uB2EB\uAE30", children: jsx(CloseIcon, {}) })] }) }));
|
|
12296
|
+
};
|
|
12297
|
+
TopBanner.displayName = 'TopBanner';
|
|
12298
|
+
|
|
12185
12299
|
const VideoPlayer = ({ src, poster, title, description, size = 'm', variant = 'default', theme = 'auto', autoPlay = false, loop = false, muted = false, showControls = true, enableFullscreen = true, enableKeyboard = true, enableTouch = true, showProgress = true, showTime = true, showVolume = true, showSettings = false, playlist = [], currentIndex = 0, autoPause = true, playbackRates = [0.5, 0.75, 1, 1.25, 1.5, 2], defaultPlaybackRate = 1, qualities = [], defaultQuality = '', subtitles = [], defaultSubtitle = '', onPlay, onPause, onEnded, onTimeUpdate, onVolumeChange, onFullscreenChange, onPlaylistChange, onPlaybackRateChange, onQualityChange, onSubtitleChange, onError, className, }) => {
|
|
12186
12300
|
const videoRef = useRef(null);
|
|
12187
12301
|
const containerRef = useRef(null);
|
|
@@ -12634,5 +12748,5 @@ const YouTubePlayer = ({ videoId, title, description, size = 'm', variant = 'def
|
|
|
12634
12748
|
};
|
|
12635
12749
|
YouTubePlayer.displayName = 'YouTubePlayer';
|
|
12636
12750
|
|
|
12637
|
-
export { Accordion, AdBanner, Alert, AnimationBackground, AnimationText, AudioPlayer, Avatar, Backdrop, Badge, Banner, BottomNavigation, 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, Indicator, Input, Label, Lightbox, List, Logo, MarkdownEditor, Marquee, Masonry, MenuItem, Modal, ModalBody, ModalFooter, ModalHeader, Navbar, OnboardingModal, 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, Testimonial, Textarea, TimePicker, Timeline, Toast, ToastContainer, ToastProvider, Toggle, Toolbar, Tooltip, Tutorial, VideoPlayer, YouTubePlayer, useToast };
|
|
12751
|
+
export { Accordion, AdBanner, Alert, AnimationBackground, AnimationText, AudioPlayer, Avatar, Backdrop, Badge, Banner, BottomNavigation, 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, ImagePlaceholder, Indicator, Input, Label, Lightbox, List, Logo, MarkdownEditor, Marquee, Masonry, MenuItem, Modal, ModalBody, ModalFooter, ModalHeader, Navbar, OnboardingModal, PageHeader, 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, Testimonial, Textarea, TimePicker, Timeline, Toast, ToastContainer, ToastProvider, Toggle, Toolbar, Tooltip, TopBanner, Tutorial, VideoPlayer, YouTubePlayer, useToast };
|
|
12638
12752
|
//# sourceMappingURL=index.esm.js.map
|