@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/cjs/index.js
CHANGED
|
@@ -579,11 +579,11 @@ const ICON_SIZE$2 = {
|
|
|
579
579
|
/**
|
|
580
580
|
* Theme-aware button built on `createVariants`.
|
|
581
581
|
*
|
|
582
|
-
* @example <Button onClick={save}
|
|
583
|
-
* @example <Button variant='outlined' color='error' startIcon={IconRegistry.CloseIcon}
|
|
584
|
-
* @example <Button color='success' isLoading width='100%'
|
|
582
|
+
* @example <Button label='Save' onClick={save} />
|
|
583
|
+
* @example <Button label='Delete' variant='outlined' color='error' startIcon={IconRegistry.CloseIcon} />
|
|
584
|
+
* @example <Button label='Submitting…' color='success' isLoading width='100%' />
|
|
585
585
|
*/
|
|
586
|
-
const Button = ({ ref, variant = 'contained', color = 'primary', size = 'md', width, flexGrow, flexShrink, isLoading = false, startIcon: StartIcon, endIcon: EndIcon,
|
|
586
|
+
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 }) => {
|
|
587
587
|
const isDisabled = disabled || isLoading;
|
|
588
588
|
const iconSize = ICON_SIZE$2[size];
|
|
589
589
|
const rootClassName = BUTTON_VARIANTS({ variant, color, size }, className);
|
|
@@ -593,7 +593,7 @@ const Button = ({ ref, variant = 'contained', color = 'primary', size = 'md', wi
|
|
|
593
593
|
...(flexGrow !== undefined ? { flexGrow } : {}),
|
|
594
594
|
...(flexShrink !== undefined ? { flexShrink } : {}),
|
|
595
595
|
};
|
|
596
|
-
return (jsxRuntime.jsxs("button", { ref: ref, type: type, className: rootClassName, disabled: isDisabled, "aria-busy": isLoading || undefined, style: mergedStyle, ...rest, children: [isLoading && (jsxRuntime.jsx("span", { className: BUTTON_STYLES.spinnerWrap, children: jsxRuntime.jsx(Icon, { icon: SpinnerIcon, size: iconSize, className: BUTTON_STYLES.spinnerIcon }) })), jsxRuntime.jsxs("span", { className: theme.cx(BUTTON_STYLES.content, isLoading && BUTTON_STYLES.contentHidden), children: [StartIcon && (jsxRuntime.jsx(Icon, { icon: StartIcon, size: iconSize })),
|
|
596
|
+
return (jsxRuntime.jsxs("button", { ref: ref, type: type, className: rootClassName, disabled: isDisabled, "aria-busy": isLoading || undefined, style: mergedStyle, ...rest, children: [isLoading && (jsxRuntime.jsx("span", { className: BUTTON_STYLES.spinnerWrap, children: jsxRuntime.jsx(Icon, { icon: SpinnerIcon, size: iconSize, className: BUTTON_STYLES.spinnerIcon }) })), jsxRuntime.jsxs("span", { className: theme.cx(BUTTON_STYLES.content, isLoading && BUTTON_STYLES.contentHidden), children: [StartIcon && (jsxRuntime.jsx(Icon, { icon: StartIcon, size: iconSize })), label && (jsxRuntime.jsx(Text, { variant: 'span', fontSize: LABEL_FONT_SIZE$1[size], fontWeight: 'medium', lineHeight: 'none', children: label })), EndIcon && (jsxRuntime.jsx(Icon, { icon: EndIcon, size: iconSize }))] })] }));
|
|
597
597
|
};
|
|
598
598
|
Button.displayName = 'Button';
|
|
599
599
|
|