@designbasekorea/ui 0.5.4 → 0.5.5

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
@@ -8205,7 +8205,7 @@ const HeroFeature = ({ title, subtitle, description, image, imageAlt, background
8205
8205
  const renderButtons = () => {
8206
8206
  if (buttons.length === 0)
8207
8207
  return null;
8208
- return (jsx("div", { className: "designbase-hero-feature__buttons", children: buttons.map((button, index) => (jsx(Button, { href: button.href, variant: button.variant || 'primary', size: button.size || 'md', onClick: button.onClick, target: button.external ? '_blank' : undefined, rel: button.external ? 'noopener noreferrer' : undefined, icon: button.icon, children: button.text }, index))) }));
8208
+ return (jsx("div", { className: "designbase-hero-feature__buttons", children: buttons.map((button, index) => (jsx(Button, { href: button.href, variant: button.variant || 'primary', size: button.size || 'm', onClick: button.onClick, target: button.external ? '_blank' : undefined, rel: button.external ? 'noopener noreferrer' : undefined, icon: button.icon, children: button.text }, index))) }));
8209
8209
  };
8210
8210
  const renderStats = () => {
8211
8211
  if (stats.length === 0)
@@ -10833,14 +10833,34 @@ const ScrollArea = ({ direction = 'vertical', scrollbarStyle = 'auto', maxHeight
10833
10833
  return (jsx("div", { className: classes, style: style, children: jsx("div", { ref: scrollRef, className: "designbase-scroll-area__content", children: children }) }));
10834
10834
  };
10835
10835
 
10836
- const Section = ({ title, subtitle, description, size = 'm', variant = 'default', header, footer, actions, noPadding = false, fullWidth = false, fullHeight = false, className, children, }) => {
10836
+ const Section = ({ title, subtitle, description = '', size = 'm', variant = 'default', header, footer, actions, noPadding = false, fullWidth = false, fullHeight = false, className, children, }) => {
10837
+ const normalizeActionButtonSize = (node) => {
10838
+ if (!React.isValidElement(node))
10839
+ return node;
10840
+ const element = node;
10841
+ const elementType = element.type;
10842
+ const isButtonComponent = elementType?.displayName === 'Button' || elementType?.name === 'Button';
10843
+ // Button이고 size가 지정되지 않았으면 기본값 m 적용
10844
+ if (isButtonComponent && element.props?.size === undefined) {
10845
+ return React.cloneElement(element, { size: 'm' });
10846
+ }
10847
+ if (element.props?.children) {
10848
+ return React.cloneElement(element, {
10849
+ children: React.Children.map(element.props.children, normalizeActionButtonSize),
10850
+ });
10851
+ }
10852
+ return element;
10853
+ };
10854
+ const normalizedActions = actions
10855
+ ? React.Children.map(actions, normalizeActionButtonSize)
10856
+ : actions;
10837
10857
  const classes = clsx('designbase-section', `designbase-section--size-${size}`, `designbase-section--variant-${variant}`, {
10838
10858
  'designbase-section--no-padding': noPadding,
10839
10859
  'designbase-section--full-width': fullWidth,
10840
10860
  'designbase-section--full-height': fullHeight,
10841
10861
  }, className);
10842
- const hasHeader = title || subtitle || description || header || actions;
10843
- return (jsxs("section", { className: classes, children: [hasHeader && (jsx("div", { className: "designbase-section__header", children: header || (jsxs(Fragment, { children: [(title || subtitle) && (jsxs("div", { className: "designbase-section__title-area", children: [title && (jsx("h2", { className: "designbase-section__title", children: title })), subtitle && (jsx("h3", { className: "designbase-section__subtitle", children: subtitle })), description && (jsx("p", { className: "designbase-section__description", children: description }))] })), actions && (jsx("div", { className: "designbase-section__actions", children: actions }))] })) })), jsx("div", { className: "designbase-section__content", children: children }), footer && (jsx("div", { className: "designbase-section__footer", children: footer }))] }));
10862
+ const hasHeader = title || subtitle || description || header || normalizedActions;
10863
+ return (jsxs("section", { className: classes, children: [hasHeader && (jsx("div", { className: "designbase-section__header", children: header || (jsxs(Fragment, { children: [(title || subtitle) && (jsxs("div", { className: "designbase-section__title-area", children: [title && (jsx("h2", { className: "designbase-section__title", children: title })), subtitle && (jsx("h3", { className: "designbase-section__subtitle", children: subtitle })), description && (jsx("p", { className: "designbase-section__description", children: description }))] })), normalizedActions && (jsx("div", { className: "designbase-section__actions", children: normalizedActions }))] })) })), jsx("div", { className: "designbase-section__content", children: children }), footer && (jsx("div", { className: "designbase-section__footer", children: footer }))] }));
10844
10864
  };
10845
10865
 
10846
10866
  const Share = ({ url, title, description = '', imageUrl, hashtags = [], variant = 'button', size = 'm', position = 'bottom', platforms = ['facebook', 'x', 'linkedin', 'whatsapp', 'email', 'link'], customPlatforms = {}, buttonText = '공유', buttonIcon = ShareAltIcon, modalTitle = '공유하기', copySuccessMessage = '링크가 클립보드에 복사되었습니다!', showQrCode = true, qrCodeSize = 200, className, style, onShare, onShareError, onCopySuccess, onCopyError, }) => {
@@ -11093,11 +11113,11 @@ const Skeleton = forwardRef(({ variant = 'text', size = 'm', width, height, anim
11093
11113
  switch (size) {
11094
11114
  case 'xs':
11095
11115
  return variant === 'circular' ? '16px' : '12px';
11096
- case 'sm':
11116
+ case 's':
11097
11117
  return variant === 'circular' ? '24px' : '16px';
11098
- case 'md':
11118
+ case 'm':
11099
11119
  return variant === 'circular' ? '32px' : '20px';
11100
- case 'lg':
11120
+ case 'l':
11101
11121
  return variant === 'circular' ? '48px' : '24px';
11102
11122
  case 'xl':
11103
11123
  return variant === 'circular' ? '64px' : '32px';
@@ -11109,9 +11129,9 @@ const Skeleton = forwardRef(({ variant = 'text', size = 'm', width, height, anim
11109
11129
  const getTextLineHeight = () => {
11110
11130
  switch (size) {
11111
11131
  case 'xs': return '12px';
11112
- case 'sm': return '16px';
11113
- case 'md': return '20px';
11114
- case 'lg': return '24px';
11132
+ case 's': return '16px';
11133
+ case 'm': return '20px';
11134
+ case 'l': return '24px';
11115
11135
  case 'xl': return '32px';
11116
11136
  default: return '20px';
11117
11137
  }