@okta/odyssey-react-mui 1.13.6 → 1.13.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okta/odyssey-react-mui",
3
- "version": "1.13.6",
3
+ "version": "1.13.7",
4
4
  "description": "React MUI components for Odyssey, Okta's design system",
5
5
  "author": "Okta, Inc.",
6
6
  "license": "Apache-2.0",
@@ -51,7 +51,7 @@
51
51
  "@mui/system": "^5.14.9",
52
52
  "@mui/utils": "^5.11.2",
53
53
  "@mui/x-date-pickers": "^5.0.15",
54
- "@okta/odyssey-design-tokens": "1.13.6",
54
+ "@okta/odyssey-design-tokens": "1.13.7",
55
55
  "date-fns": "^2.30.0",
56
56
  "i18next": "^23.5.1",
57
57
  "material-react-table": "^2.0.2",
@@ -63,5 +63,5 @@
63
63
  "react": ">=17 <19",
64
64
  "react-dom": ">=17 <19"
65
65
  },
66
- "gitHead": "cab3fb1def0c2b9cfbc1699b54230489f626a758"
66
+ "gitHead": "30c72beca0bda76f3872f13621c5e27407bebcc4"
67
67
  }
package/src/Button.tsx CHANGED
@@ -32,7 +32,6 @@ export const buttonTypeValues = ["button", "submit", "reset"] as const;
32
32
  export const buttonVariantValues = [
33
33
  "primary",
34
34
  "secondary",
35
- "tertiary",
36
35
  "danger",
37
36
  "floating",
38
37
  ] as const;
@@ -112,7 +111,7 @@ export type ButtonProps = {
112
111
  /**
113
112
  * The variant of the Button
114
113
  */
115
- variant: (typeof buttonVariantValues)[number];
114
+ variant: (typeof buttonVariantValues)[number] | "tertiary";
116
115
  } & (
117
116
  | {
118
117
  endIcon?: ReactElement;
@@ -150,9 +149,13 @@ const Button = ({
150
149
  tooltipText,
151
150
  translate,
152
151
  type = "button",
153
- variant,
152
+ variant: variantProp,
154
153
  }: ButtonProps) => {
155
154
  const muiProps = useMuiProps();
155
+
156
+ // We're deprecating the "tertiary" variant, so map it to
157
+ // "secondary" in lieu of making a breaking change
158
+ const variant = variantProp === "tertiary" ? "secondary" : variantProp;
156
159
  const localButtonRef = useRef<HTMLButtonElement>(null);
157
160
 
158
161
  useImperativeHandle(
@@ -540,6 +540,7 @@ export const components = ({
540
540
  paddingBlock: odysseyTokens.Spacing3,
541
541
  paddingInline: odysseyTokens.Spacing4,
542
542
  display: "inline-flex",
543
+ height: odysseyTokens.Spacing7,
543
544
  position: "relative",
544
545
  marginBlock: "0",
545
546
  marginInline: "0",
@@ -552,7 +553,7 @@ export const components = ({
552
553
  borderRadius: odysseyTokens.BorderRadiusMain,
553
554
  borderColor: "transparent",
554
555
  fontSize: odysseyTokens.TypographySizeBody,
555
- fontWeight: odysseyTokens.TypographyWeightBodyBold,
556
+ fontWeight: odysseyTokens.TypographyWeightHeading,
556
557
  fontFamily: odysseyTokens.TypographyFamilyButton,
557
558
  lineHeight: odysseyTokens.TypographyLineHeightUi,
558
559
  whiteSpace: "nowrap",
@@ -617,26 +618,6 @@ export const components = ({
617
618
  },
618
619
  }),
619
620
 
620
- ...(ownerState.variant === "tertiary" && {
621
- backgroundColor: odysseyTokens.HueNeutral100,
622
- color: odysseyTokens.HueNeutral700,
623
-
624
- "&:hover": {
625
- backgroundColor: odysseyTokens.HueNeutral200,
626
- color: odysseyTokens.HueNeutral800,
627
- },
628
-
629
- "&:active": {
630
- backgroundColor: odysseyTokens.HueNeutral300,
631
- color: odysseyTokens.HueNeutral800,
632
- },
633
-
634
- "&:disabled": {
635
- backgroundColor: odysseyTokens.HueNeutral100,
636
- color: odysseyTokens.TypographyColorDisabled,
637
- },
638
- }),
639
-
640
621
  ...(ownerState.variant === "danger" && {
641
622
  backgroundColor: odysseyTokens.PaletteDangerMain,
642
623
  color: odysseyTokens.HueNeutralWhite,
@@ -676,16 +657,17 @@ export const components = ({
676
657
  },
677
658
  }),
678
659
  ...(ownerState.size === "small" && {
660
+ height: odysseyTokens.Spacing6,
679
661
  paddingBlock: odysseyTokens.Spacing2,
680
662
  paddingInline: odysseyTokens.Spacing3,
681
663
  fontSize: odysseyTokens.TypographySizeBody,
682
664
  }),
683
665
  ...(ownerState.size === "large" && {
666
+ height: odysseyTokens.Spacing8,
684
667
  paddingBlock: odysseyTokens.Spacing4,
685
668
  paddingInline: odysseyTokens.Spacing4,
686
669
  }),
687
670
  ...(ownerState.fullWidth === true && {
688
- display: "block",
689
671
  width: "100%",
690
672
  marginBlock: "0",
691
673
  marginInline: "0",
@@ -705,6 +687,10 @@ export const components = ({
705
687
  ...(ownerState.size === "small" && {
706
688
  padding: odysseyTokens.Spacing2,
707
689
  }),
690
+
691
+ ...(ownerState.size === "large" && {
692
+ padding: odysseyTokens.Spacing4,
693
+ }),
708
694
  }),
709
695
  }),
710
696