@edux-design/buttons 0.0.5 → 0.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edux-design/buttons",
3
- "version": "0.0.5",
3
+ "version": "0.1.0",
4
4
  "private": false,
5
5
  "sideEffects": [
6
6
  "**/*.css"
@@ -29,8 +29,10 @@
29
29
  "@tailwindcss/postcss": "^4.1.12"
30
30
  },
31
31
  "dependencies": {
32
- "react": "^19.1.0",
33
- "react-dom": "^19.1.0",
34
32
  "@edux-design/utils": "*"
33
+ },
34
+ "peerDependencies": {
35
+ "react": "^19.1.0",
36
+ "react-dom": "^19.1.0"
35
37
  }
36
38
  }
@@ -28,7 +28,8 @@ const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;
28
28
  * @typedef {Object} ButtonGroupOption
29
29
  * @property {React.ReactNode} [label] - Main label for the option.
30
30
  * @property {React.ReactNode} [startAdornment] - Optional leading element (icon, badge, etc.).
31
- * @property {React.ReactNode} [endIcon] - Optional trailing element.
31
+ * @property {React.ReactNode} [endIcon] - Optional trailing element (legacy alias).
32
+ * @property {React.ReactNode} [endAdornment] - Optional trailing element.
32
33
  * @property {string|number} [value] - Unique value used for selection.
33
34
  * @property {boolean} [disabled] - Whether the option is disabled.
34
35
  */
@@ -340,8 +341,9 @@ export const ButtonGroup = forwardRef(function ButtonGroup(
340
341
  const hasStartAdornment =
341
342
  option.startAdornment !== undefined &&
342
343
  option.startAdornment !== null;
343
- const hasendIcon =
344
- option.endIcon !== undefined && option.endIcon !== null;
344
+ const endAdornment = option.endAdornment ?? option.endIcon;
345
+ const hasEndAdornment =
346
+ endAdornment !== undefined && endAdornment !== null;
345
347
 
346
348
  return (
347
349
  <button
@@ -370,12 +372,12 @@ export const ButtonGroup = forwardRef(function ButtonGroup(
370
372
  {option.label ?? `Option ${index + 1}`}
371
373
  </span>
372
374
 
373
- {hasendIcon && (
375
+ {hasEndAdornment && (
374
376
  <span
375
377
  aria-hidden="true"
376
378
  className="flex items-center text-current"
377
379
  >
378
- {option.endIcon}
380
+ {endAdornment}
379
381
  </span>
380
382
  )}
381
383
  </button>