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