@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/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
|
|
|
@@ -2289,9 +2289,8 @@ const CardBody = ({ children, py = 'md', px = 'md', }) => {
|
|
|
2289
2289
|
};
|
|
2290
2290
|
CardBody.displayName = 'Card.Body';
|
|
2291
2291
|
|
|
2292
|
-
const CardBase = ({ ref, variant = 'outlined',
|
|
2293
|
-
|
|
2294
|
-
return (jsx("div", { ref: ref, className: cx(CARD_VARIANTS({ variant }), className), style: padding !== undefined ? { padding: theme.spacing[padding], ...style } : style, ...rest, children: children }));
|
|
2292
|
+
const CardBase = ({ ref, variant = 'outlined', className, children, ...rest }) => {
|
|
2293
|
+
return (jsx(Box, { ref: ref, className: cx(CARD_VARIANTS({ variant }), className), ...rest, children: children }));
|
|
2295
2294
|
};
|
|
2296
2295
|
CardBase.displayName = 'Card';
|
|
2297
2296
|
const Card = CardBase;
|