@okta/odyssey-react-mui 1.13.6 → 1.13.8

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.8",
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.8",
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": "50e22cb3fb5c47d28ea5d3a0f8e4d5ed5c71e077"
67
67
  }
package/src/Accordion.tsx CHANGED
@@ -35,10 +35,6 @@ export type AccordionProps = {
35
35
  * The label text for the AccordionSummary
36
36
  */
37
37
  label: string;
38
- /**
39
- * If true, the Accordion item will have a shadow.
40
- */
41
- hasShadow?: boolean;
42
38
  /**
43
39
  * Whether the item is expanded by default
44
40
  */
@@ -70,7 +66,6 @@ export type AccordionProps = {
70
66
  const Accordion = ({
71
67
  children,
72
68
  label,
73
- hasShadow = true,
74
69
  id: idOverride,
75
70
  isDefaultExpanded,
76
71
  isDisabled,
@@ -88,7 +83,6 @@ const Accordion = ({
88
83
  disableGutters
89
84
  expanded={isExpanded}
90
85
  onChange={onChange}
91
- className={hasShadow ? `hasShadow` : undefined}
92
86
  >
93
87
  <MuiAccordionSummary
94
88
  aria-controls={contentId}
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(
@@ -62,15 +62,13 @@ export const components = ({
62
62
  styleOverrides: {
63
63
  root: () => ({
64
64
  backgroundColor: odysseyTokens.HueNeutralWhite,
65
- borderWidth: 1,
66
- borderInlineStyle: "solid",
67
- borderColor: odysseyTokens.HueNeutral100,
65
+ border: 0,
66
+ borderBottomColor: odysseyTokens.BorderColorDisplay,
67
+ borderBottomStyle: "solid",
68
+ borderBottomWidth: odysseyTokens.BorderWidthMain,
69
+ borderRadius: 0,
68
70
  boxShadow: "none",
69
71
 
70
- "&.hasShadow": {
71
- boxShadow: odysseyTokens.DepthLow,
72
- },
73
-
74
72
  "&.Mui-disabled": {
75
73
  backgroundColor: odysseyTokens.HueNeutralWhite,
76
74
  color: odysseyTokens.TypographyColorDisabled,
@@ -81,21 +79,18 @@ export const components = ({
81
79
  },
82
80
  },
83
81
 
84
- "&::before": {
85
- backgroundColor: odysseyTokens.BorderColorDisplay,
86
- opacity: "1 !important",
87
- },
88
-
89
82
  "&:first-of-type": {
90
- borderTopLeftRadius: odysseyTokens.BorderRadiusMain,
91
- borderTopRightRadius: odysseyTokens.BorderRadiusMain,
92
- borderBlockStartStyle: "solid",
83
+ borderRadius: 0,
84
+ borderTopColor: odysseyTokens.BorderColorDisplay,
85
+ borderTopStyle: "solid",
86
+ borderTopWidth: odysseyTokens.BorderWidthMain,
93
87
  },
94
88
 
95
89
  "&:last-of-type": {
96
- borderBottomLeftRadius: odysseyTokens.BorderRadiusMain,
97
- borderBottomRightRadius: odysseyTokens.BorderRadiusMain,
98
- borderBlockEndStyle: "solid",
90
+ borderRadius: 0,
91
+ borderBottomColor: odysseyTokens.BorderColorDisplay,
92
+ borderBottomStyle: "solid",
93
+ borderBottomWidth: odysseyTokens.BorderWidthMain,
99
94
  },
100
95
  }),
101
96
  },
@@ -106,26 +101,12 @@ export const components = ({
106
101
  paddingBlock: odysseyTokens.Spacing4,
107
102
  paddingInline: odysseyTokens.Spacing3,
108
103
 
109
- ".MuiAccordion-root:first-of-type &": {
110
- borderTopLeftRadius: odysseyTokens.BorderRadiusMain,
111
- borderTopRightRadius: odysseyTokens.BorderRadiusMain,
112
- },
113
-
114
- ".MuiAccordion-root:last-of-type &": {
115
- borderBottomLeftRadius: odysseyTokens.BorderRadiusMain,
116
- borderBottomRightRadius: odysseyTokens.BorderRadiusMain,
117
- },
118
-
119
- ".MuiAccordion-root.Mui-expanded &": {
120
- borderBottomLeftRadius: 0,
121
- borderBottomRightRadius: 0,
122
- },
123
-
124
- "&:hover, &:focus": {
104
+ "&:hover": {
125
105
  backgroundColor: odysseyTokens.HueNeutral50,
126
106
  },
127
107
 
128
108
  "&:focus-visible": {
109
+ backgroundColor: odysseyTokens.HueNeutral50,
129
110
  outlineColor: odysseyTokens.PalettePrimaryMain,
130
111
  outlineWidth: 2,
131
112
  outlineStyle: "solid",
@@ -540,6 +521,7 @@ export const components = ({
540
521
  paddingBlock: odysseyTokens.Spacing3,
541
522
  paddingInline: odysseyTokens.Spacing4,
542
523
  display: "inline-flex",
524
+ height: odysseyTokens.Spacing7,
543
525
  position: "relative",
544
526
  marginBlock: "0",
545
527
  marginInline: "0",
@@ -552,7 +534,7 @@ export const components = ({
552
534
  borderRadius: odysseyTokens.BorderRadiusMain,
553
535
  borderColor: "transparent",
554
536
  fontSize: odysseyTokens.TypographySizeBody,
555
- fontWeight: odysseyTokens.TypographyWeightBodyBold,
537
+ fontWeight: odysseyTokens.TypographyWeightHeading,
556
538
  fontFamily: odysseyTokens.TypographyFamilyButton,
557
539
  lineHeight: odysseyTokens.TypographyLineHeightUi,
558
540
  whiteSpace: "nowrap",
@@ -617,26 +599,6 @@ export const components = ({
617
599
  },
618
600
  }),
619
601
 
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
602
  ...(ownerState.variant === "danger" && {
641
603
  backgroundColor: odysseyTokens.PaletteDangerMain,
642
604
  color: odysseyTokens.HueNeutralWhite,
@@ -676,16 +638,17 @@ export const components = ({
676
638
  },
677
639
  }),
678
640
  ...(ownerState.size === "small" && {
641
+ height: odysseyTokens.Spacing6,
679
642
  paddingBlock: odysseyTokens.Spacing2,
680
643
  paddingInline: odysseyTokens.Spacing3,
681
644
  fontSize: odysseyTokens.TypographySizeBody,
682
645
  }),
683
646
  ...(ownerState.size === "large" && {
647
+ height: odysseyTokens.Spacing8,
684
648
  paddingBlock: odysseyTokens.Spacing4,
685
649
  paddingInline: odysseyTokens.Spacing4,
686
650
  }),
687
651
  ...(ownerState.fullWidth === true && {
688
- display: "block",
689
652
  width: "100%",
690
653
  marginBlock: "0",
691
654
  marginInline: "0",
@@ -705,6 +668,10 @@ export const components = ({
705
668
  ...(ownerState.size === "small" && {
706
669
  padding: odysseyTokens.Spacing2,
707
670
  }),
671
+
672
+ ...(ownerState.size === "large" && {
673
+ padding: odysseyTokens.Spacing4,
674
+ }),
708
675
  }),
709
676
  }),
710
677