@exem-ui/react 0.3.4-next.20261013013807 → 0.3.4-next.20261014014656

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.d.mts CHANGED
@@ -230,10 +230,13 @@ type ButtonVariantProps = {
230
230
 
231
231
  type ButtonProps = Button$1.Props & ButtonVariantProps & {
232
232
  size?: ButtonSize;
233
- icon?: React__default.ReactElement<IconBaseProps>;
233
+ /** 글자 왼쪽에 표시할 아이콘 */
234
+ leftIcon?: React__default.ReactElement<IconBaseProps>;
235
+ /** 글자 오른쪽에 표시할 아이콘 */
236
+ rightIcon?: React__default.ReactElement<IconBaseProps>;
234
237
  };
235
238
  /** @see https://base-ui.com/react/components/button */
236
- declare function Button({ className, variant, color, background, size, icon, children, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
239
+ declare function Button({ className, variant, color, background, size, leftIcon, rightIcon, children, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
237
240
  /** @deprecated 컴포넌트 타입은 `typeof Button`으로 바로 얻을 수 있어 이 별칭은 불필요합니다. */
238
241
  type ButtonComponent = typeof Button;
239
242
 
@@ -269,6 +272,8 @@ type ButtonGroupComponent = typeof ButtonGroup;
269
272
 
270
273
  type IconButtonProps = ButtonProps & {
271
274
  children?: never;
275
+ leftIcon?: never;
276
+ rightIcon?: never;
272
277
  icon: React__default.ReactElement<IconBaseProps>;
273
278
  /** 툴팁 설정 (문자열 또는 FlatTooltip 설정 객체) */
274
279
  tooltip?: ConditionalTooltipProps['tooltip'];
package/dist/index.d.ts CHANGED
@@ -230,10 +230,13 @@ type ButtonVariantProps = {
230
230
 
231
231
  type ButtonProps = Button$1.Props & ButtonVariantProps & {
232
232
  size?: ButtonSize;
233
- icon?: React__default.ReactElement<IconBaseProps>;
233
+ /** 글자 왼쪽에 표시할 아이콘 */
234
+ leftIcon?: React__default.ReactElement<IconBaseProps>;
235
+ /** 글자 오른쪽에 표시할 아이콘 */
236
+ rightIcon?: React__default.ReactElement<IconBaseProps>;
234
237
  };
235
238
  /** @see https://base-ui.com/react/components/button */
236
- declare function Button({ className, variant, color, background, size, icon, children, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
239
+ declare function Button({ className, variant, color, background, size, leftIcon, rightIcon, children, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
237
240
  /** @deprecated 컴포넌트 타입은 `typeof Button`으로 바로 얻을 수 있어 이 별칭은 불필요합니다. */
238
241
  type ButtonComponent = typeof Button;
239
242
 
@@ -269,6 +272,8 @@ type ButtonGroupComponent = typeof ButtonGroup;
269
272
 
270
273
  type IconButtonProps = ButtonProps & {
271
274
  children?: never;
275
+ leftIcon?: never;
276
+ rightIcon?: never;
272
277
  icon: React__default.ReactElement<IconBaseProps>;
273
278
  /** 툴팁 설정 (문자열 또는 FlatTooltip 설정 객체) */
274
279
  tooltip?: ConditionalTooltipProps['tooltip'];
package/dist/index.js CHANGED
@@ -507,13 +507,20 @@ var iconSizeMap = {
507
507
  large: chunk6NFYQZSK_js.iconSizes.md,
508
508
  xlarge: chunk6NFYQZSK_js.iconSizes.lg
509
509
  };
510
+ function renderIcon(icon, colorClass, size) {
511
+ return React.cloneElement(icon, {
512
+ className: utils.cn("shrink-0", colorClass, icon.props.className),
513
+ size: icon.props.size ?? iconSizeMap[size]
514
+ });
515
+ }
510
516
  function Button({
511
517
  className,
512
518
  variant = "solid",
513
519
  color = "primary",
514
520
  background,
515
521
  size = "medium",
516
- icon,
522
+ leftIcon,
523
+ rightIcon,
517
524
  children,
518
525
  ...props
519
526
  }) {
@@ -529,11 +536,9 @@ function Button({
529
536
  ),
530
537
  ...props,
531
538
  children: [
532
- icon && React.cloneElement(icon, {
533
- className: utils.cn("shrink-0", colorStyles[color][variant].icon, icon.props.className),
534
- size: icon.props.size ?? iconSizeMap[size]
535
- }),
536
- children != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: utils.cn("min-w-0 truncate", size === "xlarge" ? "px-1" : "px-0.5"), children })
539
+ leftIcon && renderIcon(leftIcon, colorStyles[color][variant].icon, size),
540
+ children != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: utils.cn("min-w-0 truncate", size === "xlarge" ? "px-1" : "px-0.5"), children }),
541
+ rightIcon && renderIcon(rightIcon, colorStyles[color][variant].icon, size)
537
542
  ]
538
543
  }
539
544
  );
@@ -561,7 +566,7 @@ function IconButton({
561
566
  "aria-label": ariaLabel ?? (ariaLabelledBy === void 0 ? tooltipLabel : void 0),
562
567
  "aria-labelledby": ariaLabelledBy,
563
568
  className: utils.cn(iconButtonSizeClasses[size], "px-0", className),
564
- icon,
569
+ leftIcon: icon,
565
570
  size,
566
571
  ...props
567
572
  }
@@ -619,7 +624,7 @@ function ButtonGroup({
619
624
  item.id
620
625
  );
621
626
  }
622
- return /* @__PURE__ */ jsxRuntime.jsx(chunkMC4SYR5X_js.ConditionalTooltip, { tooltip: item.tooltip, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { ...buttonBaseProps, icon: item.icon, children: item.label }) }, item.id);
627
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkMC4SYR5X_js.ConditionalTooltip, { tooltip: item.tooltip, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { ...buttonBaseProps, leftIcon: item.icon, children: item.label }) }, item.id);
623
628
  })
624
629
  }
625
630
  );
package/dist/index.mjs CHANGED
@@ -482,13 +482,20 @@ var iconSizeMap = {
482
482
  large: iconSizes.md,
483
483
  xlarge: iconSizes.lg
484
484
  };
485
+ function renderIcon(icon, colorClass, size) {
486
+ return cloneElement(icon, {
487
+ className: cn("shrink-0", colorClass, icon.props.className),
488
+ size: icon.props.size ?? iconSizeMap[size]
489
+ });
490
+ }
485
491
  function Button({
486
492
  className,
487
493
  variant = "solid",
488
494
  color = "primary",
489
495
  background,
490
496
  size = "medium",
491
- icon,
497
+ leftIcon,
498
+ rightIcon,
492
499
  children,
493
500
  ...props
494
501
  }) {
@@ -504,11 +511,9 @@ function Button({
504
511
  ),
505
512
  ...props,
506
513
  children: [
507
- icon && cloneElement(icon, {
508
- className: cn("shrink-0", colorStyles[color][variant].icon, icon.props.className),
509
- size: icon.props.size ?? iconSizeMap[size]
510
- }),
511
- children != null && /* @__PURE__ */ jsx("span", { className: cn("min-w-0 truncate", size === "xlarge" ? "px-1" : "px-0.5"), children })
514
+ leftIcon && renderIcon(leftIcon, colorStyles[color][variant].icon, size),
515
+ children != null && /* @__PURE__ */ jsx("span", { className: cn("min-w-0 truncate", size === "xlarge" ? "px-1" : "px-0.5"), children }),
516
+ rightIcon && renderIcon(rightIcon, colorStyles[color][variant].icon, size)
512
517
  ]
513
518
  }
514
519
  );
@@ -536,7 +541,7 @@ function IconButton({
536
541
  "aria-label": ariaLabel ?? (ariaLabelledBy === void 0 ? tooltipLabel : void 0),
537
542
  "aria-labelledby": ariaLabelledBy,
538
543
  className: cn(iconButtonSizeClasses[size], "px-0", className),
539
- icon,
544
+ leftIcon: icon,
540
545
  size,
541
546
  ...props
542
547
  }
@@ -594,7 +599,7 @@ function ButtonGroup({
594
599
  item.id
595
600
  );
596
601
  }
597
- return /* @__PURE__ */ jsx(ConditionalTooltip, { tooltip: item.tooltip, children: /* @__PURE__ */ jsx(Button, { ...buttonBaseProps, icon: item.icon, children: item.label }) }, item.id);
602
+ return /* @__PURE__ */ jsx(ConditionalTooltip, { tooltip: item.tooltip, children: /* @__PURE__ */ jsx(Button, { ...buttonBaseProps, leftIcon: item.icon, children: item.label }) }, item.id);
598
603
  })
599
604
  }
600
605
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exem-ui/react",
3
- "version": "0.3.4-next.20261013013807",
3
+ "version": "0.3.4-next.20261014014656",
4
4
  "description": "Exem Design System - React Components",
5
5
  "author": "Exem Design Team",
6
6
  "license": "Apache-2.0",
@@ -100,7 +100,7 @@
100
100
  "tailwind-merge": "^3.3.1",
101
101
  "tailwind-scrollbar-hide": "^4.0.0",
102
102
  "tiny-invariant": "^1.3.3",
103
- "@exem-ui/core": "0.3.3-next.20261013013807"
103
+ "@exem-ui/core": "0.3.3-next.20261014014656"
104
104
  },
105
105
  "devDependencies": {
106
106
  "@eslint/js": "^9.15.0",
@@ -136,7 +136,7 @@
136
136
  "tsup": "^8.5.0",
137
137
  "typescript": "^5.8.2",
138
138
  "typescript-eslint": "^8.16.0",
139
- "@exem-ui/tailwindcss3": "0.3.2-next.20261013013807"
139
+ "@exem-ui/tailwindcss3": "0.3.2-next.20261014014656"
140
140
  },
141
141
  "scripts": {
142
142
  "generate": "node scripts/generate-icons.js",