@aurora-ds/components 1.1.0 → 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 +7 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +7 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +7 -8
- 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
|
|
|
@@ -2309,9 +2309,8 @@ const CardBody = ({ children, py = 'md', px = 'md', }) => {
|
|
|
2309
2309
|
};
|
|
2310
2310
|
CardBody.displayName = 'Card.Body';
|
|
2311
2311
|
|
|
2312
|
-
const CardBase = ({ ref, variant = 'outlined',
|
|
2313
|
-
|
|
2314
|
-
return (jsxRuntime.jsx("div", { ref: ref, className: theme.cx(CARD_VARIANTS({ variant }), className), style: padding !== undefined ? { padding: theme$1.spacing[padding], ...style } : style, ...rest, children: children }));
|
|
2312
|
+
const CardBase = ({ ref, variant = 'outlined', className, children, ...rest }) => {
|
|
2313
|
+
return (jsxRuntime.jsx(Box, { ref: ref, className: theme.cx(CARD_VARIANTS({ variant }), className), ...rest, children: children }));
|
|
2315
2314
|
};
|
|
2316
2315
|
CardBase.displayName = 'Card';
|
|
2317
2316
|
const Card = CardBase;
|