@moderneinc/design-system-components 7.9.0-next.227c6c → 7.9.0-next.869ab7
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/index.esm.js +14 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -771,6 +771,7 @@ function ModBreadcrumbs({ children, className }) {
|
|
|
771
771
|
);
|
|
772
772
|
}
|
|
773
773
|
|
|
774
|
+
const LABEL_LINE_HEIGHT = 20;
|
|
774
775
|
const StyledButton = styled(Button, {
|
|
775
776
|
shouldForwardProp: (prop) => prop !== "buttonVariant" && prop !== "buttonSize"
|
|
776
777
|
})(({ theme, buttonVariant: variant, buttonSize: size }) => {
|
|
@@ -787,24 +788,30 @@ const StyledButton = styled(Button, {
|
|
|
787
788
|
}
|
|
788
789
|
};
|
|
789
790
|
const sizeStyles = sizeConfig[size];
|
|
791
|
+
const paddingY = (sizeStyles.height - LABEL_LINE_HEIGHT) / 2 - 1;
|
|
790
792
|
const paddingX = variant === "tertiary" ? 0 : sizeStyles.paddingX;
|
|
791
793
|
const spinnerSize = size === "small" ? iconSize.md : iconSize.xl;
|
|
792
794
|
const disabled = `&.${buttonClasses.disabled}:not(.${buttonClasses.loading})`;
|
|
793
795
|
const baseStyles = {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
+
// A label that wraps grows the button instead of spilling out of it; fit-content, not auto, so a
|
|
797
|
+
// flex row doesn't stretch it to the row's tallest item
|
|
798
|
+
minHeight: sizeStyles.height,
|
|
799
|
+
height: "fit-content",
|
|
800
|
+
padding: `${paddingY}px ${paddingX}px`,
|
|
796
801
|
fontFamily: "inherit",
|
|
797
802
|
fontSize: sizeStyles.fontSize,
|
|
798
803
|
fontWeight: typography.fontWeight.semiBold,
|
|
799
804
|
letterSpacing: "inherit",
|
|
800
805
|
lineHeight: "1.25rem",
|
|
806
|
+
textAlign: "center",
|
|
801
807
|
borderRadius: borderRadius.button,
|
|
802
808
|
textTransform: "none",
|
|
803
809
|
transition: theme.transitions.create(["background-color", "border-color", "color"], {
|
|
804
810
|
duration: theme.transitions.duration.short
|
|
805
811
|
}),
|
|
806
812
|
position: "relative",
|
|
807
|
-
|
|
813
|
+
// Shrinks in a tight row down to its longest word, then wraps
|
|
814
|
+
minWidth: "min-content",
|
|
808
815
|
gap: spacing.spacing_1,
|
|
809
816
|
...touchTarget(theme),
|
|
810
817
|
// `gap` spaces the icons; MUI's slot margins would add to it
|
|
@@ -6494,6 +6501,10 @@ const Group = styled("div", {
|
|
|
6494
6501
|
shouldForwardProp: (prop) => prop !== "splitVariant"
|
|
6495
6502
|
})(({ theme, splitVariant }) => ({
|
|
6496
6503
|
display: "inline-flex",
|
|
6504
|
+
// Both halves match the taller one when the label wraps
|
|
6505
|
+
[`& > .${buttonClasses.root}`]: {
|
|
6506
|
+
height: "auto"
|
|
6507
|
+
},
|
|
6497
6508
|
[`& > .${buttonClasses.root}:first-of-type`]: {
|
|
6498
6509
|
borderStartEndRadius: 0,
|
|
6499
6510
|
borderEndEndRadius: 0
|