@designbasekorea/ui 0.3.1 → 0.3.2

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
@@ -2402,7 +2402,7 @@ const Tooltip = ({ content, children, position = 'top', size = 'm', variant = 'd
2402
2402
  };
2403
2403
  Tooltip.displayName = 'Tooltip';
2404
2404
 
2405
- const Button = forwardRef(({ variant = 'primary', size = 'm', radius, fullWidth = false, disabled = false, loading = false, iconOnly = false, startIcon: StartIcon, endIcon: EndIcon, tooltip, tooltipProps, className, children, onPress, type = 'button', ...props }, forwardedRef) => {
2405
+ const Button = forwardRef(({ variant = 'primary', size = 'm', radius, fullWidth = false, disabled = false, loading = false, loadingText, iconOnly = false, startIcon: StartIcon, endIcon: EndIcon, tooltip, tooltipProps, className, children, onPress, type = 'button', ...props }, forwardedRef) => {
2406
2406
  const ref = $df56164dff5785e2$export$4338b53315abf666(forwardedRef);
2407
2407
  const { buttonProps } = $701a24aa0da5b062$export$ea18c227d4417cc3({
2408
2408
  ...props,
@@ -2447,7 +2447,13 @@ const Button = forwardRef(({ variant = 'primary', size = 'm', radius, fullWidth
2447
2447
  };
2448
2448
  const renderContent = () => {
2449
2449
  if (loading) {
2450
- return (jsxs(Fragment, { children: [jsx(Spinner, { type: "circular", size: size === 's' ? 's' : size === 'l' ? 'l' : 'm', color: getIconColor(), speed: 1, showLabel: false }), !iconOnly && jsx("span", { children: "\uB85C\uB529 \uC911..." })] }));
2450
+ // 로딩 표시할 텍스트 결정: loadingText > children > 기본값
2451
+ const displayText = loadingText !== undefined
2452
+ ? loadingText
2453
+ : (!iconOnly && children)
2454
+ ? children
2455
+ : null;
2456
+ return (jsxs(Fragment, { children: [jsx(Spinner, { type: "circular", size: size === 's' ? 's' : size === 'l' ? 'l' : 'm', color: getIconColor(), speed: 1, showLabel: false }), displayText && jsx("span", { children: displayText })] }));
2451
2457
  }
2452
2458
  // iconOnly 버튼일 때는 children을 아이콘으로 처리
2453
2459
  if (iconOnly && children && React.isValidElement(children)) {