@edux-design/buttons 0.0.5 → 0.0.6
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/CHANGELOG.md +6 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +152 -4886
- package/dist/index.mjs +162 -4911
- package/package.json +1 -1
- package/src/elements/ButtonGroup.jsx +7 -5
package/package.json
CHANGED
|
@@ -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
|
|
344
|
-
|
|
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
|
-
{
|
|
375
|
+
{hasEndAdornment && (
|
|
374
376
|
<span
|
|
375
377
|
aria-hidden="true"
|
|
376
378
|
className="flex items-center text-current"
|
|
377
379
|
>
|
|
378
|
-
{
|
|
380
|
+
{endAdornment}
|
|
379
381
|
</span>
|
|
380
382
|
)}
|
|
381
383
|
</button>
|