@aurora-ds/components 1.1.1 → 1.1.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/cjs/index.js +5 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -559,11 +559,11 @@ const ICON_SIZE$2 = {
|
|
|
559
559
|
/**
|
|
560
560
|
* Theme-aware button built on `createVariants`.
|
|
561
561
|
*
|
|
562
|
-
* @example <Button onClick={save}
|
|
563
|
-
* @example <Button variant='outlined' color='error' startIcon={IconRegistry.CloseIcon}
|
|
564
|
-
* @example <Button color='success' isLoading width='100%'
|
|
562
|
+
* @example <Button label='Save' onClick={save} />
|
|
563
|
+
* @example <Button label='Delete' variant='outlined' color='error' startIcon={IconRegistry.CloseIcon} />
|
|
564
|
+
* @example <Button label='Submitting…' color='success' isLoading width='100%' />
|
|
565
565
|
*/
|
|
566
|
-
const Button = ({ ref, variant = 'contained', color = 'primary', size = 'md', width, flexGrow, flexShrink, isLoading = false, startIcon: StartIcon, endIcon: EndIcon,
|
|
566
|
+
const Button = ({ ref, variant = 'contained', color = 'primary', size = 'md', width, flexGrow, flexShrink, isLoading = false, startIcon: StartIcon, endIcon: EndIcon, label, className, type = 'button', disabled, style, ...rest }) => {
|
|
567
567
|
const isDisabled = disabled || isLoading;
|
|
568
568
|
const iconSize = ICON_SIZE$2[size];
|
|
569
569
|
const rootClassName = BUTTON_VARIANTS({ variant, color, size }, className);
|
|
@@ -573,7 +573,7 @@ const Button = ({ ref, variant = 'contained', color = 'primary', size = 'md', wi
|
|
|
573
573
|
...(flexGrow !== undefined ? { flexGrow } : {}),
|
|
574
574
|
...(flexShrink !== undefined ? { flexShrink } : {}),
|
|
575
575
|
};
|
|
576
|
-
return (jsxs("button", { ref: ref, type: type, className: rootClassName, disabled: isDisabled, "aria-busy": isLoading || undefined, style: mergedStyle, ...rest, children: [isLoading && (jsx("span", { className: BUTTON_STYLES.spinnerWrap, children: jsx(Icon, { icon: SpinnerIcon, size: iconSize, className: BUTTON_STYLES.spinnerIcon }) })), jsxs("span", { className: cx(BUTTON_STYLES.content, isLoading && BUTTON_STYLES.contentHidden), children: [StartIcon && (jsx(Icon, { icon: StartIcon, size: iconSize })),
|
|
576
|
+
return (jsxs("button", { ref: ref, type: type, className: rootClassName, disabled: isDisabled, "aria-busy": isLoading || undefined, style: mergedStyle, ...rest, children: [isLoading && (jsx("span", { className: BUTTON_STYLES.spinnerWrap, children: jsx(Icon, { icon: SpinnerIcon, size: iconSize, className: BUTTON_STYLES.spinnerIcon }) })), jsxs("span", { className: cx(BUTTON_STYLES.content, isLoading && BUTTON_STYLES.contentHidden), children: [StartIcon && (jsx(Icon, { icon: StartIcon, size: iconSize })), label && (jsx(Text, { variant: 'span', fontSize: LABEL_FONT_SIZE$1[size], fontWeight: 'medium', lineHeight: 'none', children: label })), EndIcon && (jsx(Icon, { icon: EndIcon, size: iconSize }))] })] }));
|
|
577
577
|
};
|
|
578
578
|
Button.displayName = 'Button';
|
|
579
579
|
|