@designbasekorea/ui 0.2.6 → 0.2.7
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 +8 -0
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.css.map +1 -1
- package/dist/index.esm.js +3 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3 -5
- 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 +3 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -6328,7 +6328,7 @@
|
|
|
6328
6328
|
}), onClick: handleDrawerClick, role: "dialog", "aria-modal": "true", "aria-labelledby": title ? `${id || 'drawer'}-title` : undefined, "aria-describedby": id ? `${id}-content` : undefined, tabIndex: -1, id: id, children: [(title || showCloseButton) && (jsxRuntime.jsxs("div", { className: "designbase-drawer__header", children: [title && (jsxRuntime.jsx("h2", { className: "designbase-drawer__title", id: id ? `${id}-title` : undefined, children: title })), showCloseButton && (jsxRuntime.jsx(Button, { variant: "ghost", size: "s", onClick: handleClose, className: "designbase-drawer__close-button", "aria-label": "\uB2EB\uAE30", children: jsxRuntime.jsx(icons.CloseIcon, { size: iconSize, color: "currentColor" }) }))] })), jsxRuntime.jsx("div", { className: "designbase-drawer__content", id: id ? `${id}-content` : undefined, children: children })] })] }), document.body);
|
|
6329
6329
|
};
|
|
6330
6330
|
|
|
6331
|
-
const Dropdown = ({ items, trigger, label = '메뉴', size = 'm', placement = 'bottom-left', fullWidth = false, disabled = false, className, isOpen: controlledIsOpen, onToggle, ...props }) => {
|
|
6331
|
+
const Dropdown = ({ items, trigger, label = '메뉴', triggerVariant = 'tertiary', triggerIcon, iconOnly = false, size = 'm', placement = 'bottom-left', fullWidth = false, disabled = false, className, isOpen: controlledIsOpen, onToggle, ...props }) => {
|
|
6332
6332
|
// 아이콘 크기 계산 (m이 기본값)
|
|
6333
6333
|
const iconSize = size === 's' ? 14 : size === 'l' ? 18 : 16;
|
|
6334
6334
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
@@ -6457,13 +6457,11 @@
|
|
|
6457
6457
|
'designbase-dropdown--full-width': fullWidth,
|
|
6458
6458
|
'designbase-dropdown--disabled': disabled,
|
|
6459
6459
|
}, className);
|
|
6460
|
-
const
|
|
6461
|
-
'designbase-dropdown__trigger--open': isDropdownOpen,
|
|
6462
|
-
});
|
|
6460
|
+
const buttonSize = size;
|
|
6463
6461
|
const menuClasses = clsx('designbase-dropdown__menu', `designbase-dropdown__menu--${placement}`, {
|
|
6464
6462
|
'designbase-dropdown__menu--open': isDropdownOpen,
|
|
6465
6463
|
});
|
|
6466
|
-
return (jsxRuntime.jsxs("div", { ref: containerRef, className: classes, ...props, children: [jsxRuntime.jsx("
|
|
6464
|
+
return (jsxRuntime.jsxs("div", { ref: containerRef, className: classes, ...props, children: [trigger ? (jsxRuntime.jsx("div", { ref: triggerRef, onClick: handleToggle, onKeyDown: handleKeyDown, children: trigger })) : (jsxRuntime.jsx("div", { ref: triggerRef, children: jsxRuntime.jsx(Button, { variant: triggerVariant, size: buttonSize, iconOnly: iconOnly, startIcon: triggerIcon, endIcon: icons.ChevronDownIcon, disabled: disabled, fullWidth: fullWidth, onPress: handleToggle, "aria-haspopup": "true", "aria-expanded": isDropdownOpen, "aria-label": label, className: isDropdownOpen ? 'designbase-dropdown__trigger--open' : '', children: label }) })), jsxRuntime.jsx("div", { ref: menuRef, className: menuClasses, role: "menu", "aria-label": label, children: items.map((item, index) => {
|
|
6467
6465
|
if (item.divider) {
|
|
6468
6466
|
return (jsxRuntime.jsx("div", { className: "designbase-dropdown__divider", role: "separator" }, `divider-${index}`));
|
|
6469
6467
|
}
|