@okta/odyssey-react-mui 0.14.6 → 0.15.0

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.
@@ -13,9 +13,22 @@
13
13
  import type { ThemeOptions } from "@mui/material";
14
14
  //import radioClasses from "@mui/material";
15
15
  import { outlinedInputClasses } from "@mui/material/OutlinedInput";
16
+ import {
17
+ AlertTriangleFilledIcon,
18
+ CheckCircleFilledIcon,
19
+ InformationCircleFilledIcon,
20
+ } from "../../components/Icon";
16
21
 
17
22
  export const components: ThemeOptions["components"] = {
18
23
  MuiAlert: {
24
+ defaultProps: {
25
+ iconMapping: {
26
+ error: <AlertTriangleFilledIcon />,
27
+ info: <InformationCircleFilledIcon />,
28
+ success: <CheckCircleFilledIcon />,
29
+ warning: <AlertTriangleFilledIcon />,
30
+ },
31
+ },
19
32
  styleOverrides: {
20
33
  root: ({ ownerState, theme }) => ({
21
34
  padding: theme.spacing(4),
@@ -82,7 +95,7 @@ export const components: ThemeOptions["components"] = {
82
95
  }),
83
96
  message: ({ ownerState, theme }) => ({
84
97
  padding: 0,
85
- lineHeight: theme.typography.body.lineHeight,
98
+ lineHeight: theme.typography.body1.lineHeight,
86
99
  ...(ownerState.variant === "banner" && {
87
100
  display: "flex",
88
101
  justifyContent: "space-between",
@@ -90,9 +103,6 @@ export const components: ThemeOptions["components"] = {
90
103
  }),
91
104
  ...(ownerState.variant === "toast" && {
92
105
  flexGrow: 1,
93
- paddingRight: `calc((${theme.spacing(1)} * 2) + ${
94
- theme.typography.body.fontSize
95
- } + ${theme.spacing(4)})`,
96
106
  }),
97
107
  }),
98
108
  },
@@ -277,7 +287,7 @@ export const components: ThemeOptions["components"] = {
277
287
  lineHeight: "1.14285714",
278
288
  whiteSpace: "nowrap",
279
289
 
280
- "& + &": {
290
+ ".MuiButton-root + &": {
281
291
  marginInlineStart: theme.spacing(2),
282
292
  },
283
293
 
@@ -364,17 +374,26 @@ export const components: ThemeOptions["components"] = {
364
374
  },
365
375
  },
366
376
  MuiFormControl: {
377
+ defaultProps: {
378
+ margin: "normal",
379
+ },
367
380
  styleOverrides: {
368
381
  root: ({ ownerState, theme }) => ({
369
382
  width: "100%",
370
383
  maxWidth: "32rem",
371
384
  ...(ownerState.margin === "normal" && {
372
385
  marginTop: 0,
373
- marginBottom: theme.spacing(4),
386
+ marginBottom: theme.spacing(5),
387
+ "&:last-child": {
388
+ marginBottom: 0,
389
+ },
374
390
  }),
375
391
  ...(ownerState.margin === "dense" && {
376
392
  marginTop: 0,
377
- marginBottom: theme.spacing(4),
393
+ marginBottom: theme.spacing(5),
394
+ "&:last-child": {
395
+ marginBottom: 0,
396
+ },
378
397
  }),
379
398
  ...(ownerState.fullWidth && {
380
399
  maxWidth: "100%",
@@ -462,7 +481,7 @@ export const components: ThemeOptions["components"] = {
462
481
  styleOverrides: {
463
482
  root: ({ theme }) => ({
464
483
  padding: theme.spacing(1),
465
- fontSize: theme.typography.body.fontSize,
484
+ fontSize: theme.typography.body1.fontSize,
466
485
  }),
467
486
  },
468
487
  },
@@ -688,6 +707,12 @@ export const components: ThemeOptions["components"] = {
688
707
  },
689
708
  },
690
709
  },
710
+ MuiSvgIcon: {
711
+ defaultProps: {
712
+ fontSize: "inherit",
713
+ color: "inherit",
714
+ },
715
+ },
691
716
  MuiTab: {
692
717
  defaultProps: {
693
718
  iconPosition: "start",
@@ -698,7 +723,7 @@ export const components: ThemeOptions["components"] = {
698
723
  minWidth: "unset",
699
724
  minHeight: "unset",
700
725
  padding: `${theme.spacing(4)} 0`,
701
- lineHeight: theme.typography.body.lineHeight,
726
+ lineHeight: theme.typography.body1.lineHeight,
702
727
  overflow: "visible",
703
728
  ...(ownerState.selected == true && {
704
729
  color: theme.palette.text.primary,
@@ -708,8 +733,8 @@ export const components: ThemeOptions["components"] = {
708
733
  opacity: 1,
709
734
  }),
710
735
  ...(ownerState.wrapped && {
711
- fontSize: theme.typography.caption.fontSize,
712
- lineHeight: theme.typography.caption.lineHeight,
736
+ fontSize: theme.typography.subtitle1.fontSize,
737
+ lineHeight: theme.typography.subtitle1.lineHeight,
713
738
  }),
714
739
  "&:hover": {
715
740
  color: theme.palette.primary.main,
@@ -759,11 +784,40 @@ export const components: ThemeOptions["components"] = {
759
784
  defaultProps: {
760
785
  fontFamily:
761
786
  "'Public Sans', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu', 'Cantarell', 'Helvetica Neue', 'Noto Sans Arabic', sans-serif",
787
+ variantMapping: {
788
+ h1: "h1",
789
+ h2: "h2",
790
+ h3: "h3",
791
+ h4: "h4",
792
+ h5: "h5",
793
+ h6: "h6",
794
+ subtitle1: "p",
795
+ body1: "p",
796
+ inherit: "p",
797
+ kbd: "kbd",
798
+ legend: "legend",
799
+ },
762
800
  },
763
801
  styleOverrides: {
764
802
  paragraph: ({ theme }) => ({
765
803
  marginBottom: theme.spacing(4),
766
804
  }),
805
+ root: ({ theme, ownerState }) => ({
806
+ ...(ownerState.variant === "kbd" && {
807
+ display: "inline-block",
808
+ minWidth: `calc(${theme.typography.subtitle1.fontSize} * ${theme.typography.h5.lineHeight})`,
809
+ borderStyle: theme.mixins.borderStyle,
810
+ borderWidth: theme.mixins.borderWidth,
811
+ borderRadius: theme.mixins.borderRadius,
812
+ borderColor: theme.palette.grey[200],
813
+ backgroundColor: theme.palette.grey[50],
814
+ padding: `calc(${theme.spacing(1)} / 2) ${theme.spacing(1)}`,
815
+ fontSize: theme.typography.subtitle1.fontSize,
816
+ fontWeight: theme.typography.fontWeightRegular,
817
+ lineHeight: theme.typography.h5.lineHeight,
818
+ boxShadow: `0 1px 1px 0 hsla(240, 6%, 12%, 0.05)`,
819
+ }),
820
+ }),
767
821
  },
768
822
  },
769
823
  };
@@ -63,9 +63,13 @@ export const typography: ThemeOptions["typography"] = {
63
63
  lineHeight: Tokens.FontLineHeightHeading6,
64
64
  marginBottom: Tokens.SpaceScale1,
65
65
  },
66
- subtitle1: undefined,
66
+ subtitle1: {
67
+ fontWeight: Tokens.FontWeightNormal,
68
+ fontSize: Tokens.FontScale0,
69
+ lineHeight: Tokens.FontLineHeightBody,
70
+ },
67
71
  subtitle2: undefined,
68
- body: {
72
+ body1: {
69
73
  fontFamily: Tokens.FontFamilyBase,
70
74
  fontWeight: Number(Tokens.FontWeightNormal),
71
75
  fontSize: Tokens.FontScale1,
@@ -74,13 +78,14 @@ export const typography: ThemeOptions["typography"] = {
74
78
  lineHeight: Tokens.FontLineHeightBody,
75
79
  letterSpacing: "initial",
76
80
  },
77
- body1: undefined,
78
81
  body2: undefined,
79
82
  button: undefined,
80
- caption: {
81
- fontWeight: Tokens.FontWeightNormal,
82
- fontSize: Tokens.FontScale0,
83
- lineHeight: Tokens.FontLineHeightBody,
84
- },
85
83
  overline: undefined,
84
+ legend: {
85
+ padding: 0,
86
+ fontWeight: Number(Tokens.FontWeightBold),
87
+ fontSize: Tokens.FontScale2,
88
+ lineHeight: Tokens.FontLineHeightHeading6,
89
+ marginBottom: Tokens.SpaceScale1,
90
+ },
86
91
  };
@@ -14,23 +14,29 @@ import { CSSProperties } from "react";
14
14
 
15
15
  declare module "@mui/material/styles" {
16
16
  interface TypographyVariants {
17
- body: CSSProperties;
17
+ kbd: CSSProperties;
18
+ legend: CSSProperties;
18
19
  }
19
20
  interface TypographyVariantsOptions {
20
- body?: CSSProperties;
21
+ kbd?: CSSProperties;
22
+ legend?: CSSProperties;
21
23
  }
22
24
  }
23
25
 
24
26
  declare module "@mui/material/Typography" {
25
27
  interface TypographyPropsVariantOverrides {
26
- body1: false;
28
+ body1: true;
27
29
  body2: false;
28
30
  body: true;
29
31
  button: false;
32
+ kbd: true;
33
+ legend: true;
30
34
  overline: false;
31
- subtitle1: false;
35
+ subtitle1: true;
32
36
  subtitle2: false;
33
37
  default: true; // used by Link
34
38
  monochrome: true; // used by Link
35
39
  }
36
40
  }
41
+
42
+ export {};