@okta/odyssey-react-mui 0.16.1 → 0.17.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +6 -2
  3. package/dist/Link.d.ts +1 -1
  4. package/dist/Link.d.ts.map +1 -1
  5. package/dist/Link.js +2 -15
  6. package/dist/Link.js.map +1 -1
  7. package/dist/OdysseyCacheProvider.d.ts +23 -0
  8. package/dist/OdysseyCacheProvider.d.ts.map +1 -0
  9. package/dist/OdysseyCacheProvider.js +36 -0
  10. package/dist/OdysseyCacheProvider.js.map +1 -0
  11. package/dist/OdysseyThemeProvider.d.ts +17 -0
  12. package/dist/OdysseyThemeProvider.d.ts.map +1 -0
  13. package/dist/OdysseyThemeProvider.js +29 -0
  14. package/dist/OdysseyThemeProvider.js.map +1 -0
  15. package/dist/PasswordInput.d.ts +1 -1
  16. package/dist/ThemeProvider.d.ts +3 -2
  17. package/dist/ThemeProvider.d.ts.map +1 -1
  18. package/dist/ThemeProvider.js +12 -6
  19. package/dist/ThemeProvider.js.map +1 -1
  20. package/dist/createUniqueAlphabeticalId.d.ts +14 -0
  21. package/dist/createUniqueAlphabeticalId.d.ts.map +1 -0
  22. package/dist/createUniqueAlphabeticalId.js +14 -0
  23. package/dist/createUniqueAlphabeticalId.js.map +1 -0
  24. package/dist/createUniqueId.d.ts.map +1 -1
  25. package/dist/createUniqueId.js.map +1 -1
  26. package/dist/index.d.ts +5 -3
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +4 -2
  29. package/dist/index.js.map +1 -1
  30. package/dist/theme/components.d.ts.map +1 -1
  31. package/dist/theme/components.js +145 -73
  32. package/dist/theme/components.js.map +1 -1
  33. package/dist/useUniqueAlphabeticalId.d.ts +13 -0
  34. package/dist/useUniqueAlphabeticalId.d.ts.map +1 -0
  35. package/dist/useUniqueAlphabeticalId.js +18 -0
  36. package/dist/useUniqueAlphabeticalId.js.map +1 -0
  37. package/dist/useUniqueId.d.ts.map +1 -1
  38. package/dist/useUniqueId.js +1 -1
  39. package/dist/useUniqueId.js.map +1 -1
  40. package/package.json +7 -6
  41. package/src/Link.tsx +22 -24
  42. package/src/OdysseyCacheProvider.test.tsx +38 -0
  43. package/src/OdysseyCacheProvider.tsx +48 -0
  44. package/src/OdysseyThemeProvider.tsx +24 -0
  45. package/src/ThemeProvider.tsx +11 -5
  46. package/src/createUniqueAlphabeticalId.test.ts +22 -0
  47. package/src/createUniqueAlphabeticalId.ts +19 -0
  48. package/src/createUniqueId.ts +1 -1
  49. package/src/index.ts +5 -1
  50. package/src/theme/components.tsx +69 -2
  51. package/src/useUniqueAlphabeticalId.ts +21 -0
  52. package/src/useUniqueId.ts +2 -2
@@ -9,6 +9,7 @@
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
+ import { chipClasses } from "@mui/material/Chip";
12
13
  import { dialogActionsClasses } from "@mui/material/DialogActions";
13
14
  import { inputBaseClasses } from "@mui/material/InputBase";
14
15
  import { tableBodyClasses } from "@mui/material/TableBody";
@@ -17,7 +18,7 @@ import { tableHeadClasses } from "@mui/material/TableHead";
17
18
  import { tableRowClasses } from "@mui/material/TableRow";
18
19
  import { tableSortLabelClasses } from "@mui/material/TableSortLabel";
19
20
  import { tooltipClasses } from "@mui/material/Tooltip";
20
- import { AlertTriangleFilledIcon, ArrowDownIcon, CheckCircleFilledIcon, InformationCircleFilledIcon } from "../iconDictionary/index.js";
21
+ import { AlertTriangleFilledIcon, ArrowDownIcon, CheckCircleFilledIcon, CloseCircleFilledIcon, InformationCircleFilledIcon } from "../iconDictionary/index.js";
21
22
  import { jsx as _jsx } from "react/jsx-runtime";
22
23
  export const components = {
23
24
  MuiAlert: {
@@ -339,7 +340,7 @@ export const components = {
339
340
  fontWeight: 600,
340
341
  minWidth: "unset",
341
342
  padding: `calc(${theme.spacing(3)} - 1px) ${theme.spacing(3)}`,
342
- display: "inline-block",
343
+ display: "inline-flex",
343
344
  position: "relative",
344
345
  marginBlock: "0",
345
346
  marginInline: "0",
@@ -367,9 +368,19 @@ export const components = {
367
368
  pointerEvents: "inherit"
368
369
  },
369
370
  ".MuiButton-startIcon > *:nth-of-type(1)": {
370
- fontSize: "inherit"
371
+ fontSize: "1.14285714em"
371
372
  }
372
373
  };
374
+ },
375
+ startIcon: _ref14 => {
376
+ let {
377
+ theme
378
+ } = _ref14;
379
+ return {
380
+ display: "inline-flex",
381
+ margin: 0,
382
+ marginInlineEnd: theme.spacing(2)
383
+ };
373
384
  }
374
385
  }
375
386
  },
@@ -390,10 +401,10 @@ export const components = {
390
401
  size: "small"
391
402
  },
392
403
  styleOverrides: {
393
- root: _ref14 => {
404
+ root: _ref15 => {
394
405
  let {
395
406
  theme
396
- } = _ref14;
407
+ } = _ref15;
397
408
  return {
398
409
  borderRadius: "4px",
399
410
  "&:hover": {
@@ -421,6 +432,67 @@ export const components = {
421
432
  }
422
433
  }
423
434
  },
435
+ MuiChip: {
436
+ defaultProps: {
437
+ deleteIcon: _jsx(CloseCircleFilledIcon, {})
438
+ },
439
+ styleOverrides: {
440
+ root: _ref16 => {
441
+ let {
442
+ theme,
443
+ ownerState
444
+ } = _ref16;
445
+ return {
446
+ height: "auto",
447
+ paddingBlock: theme.spacing(2),
448
+ paddingInline: theme.spacing(3),
449
+ fontSize: theme.typography.body1.fontSize,
450
+ lineHeight: "1.14285714",
451
+ borderRadius: "1.5em",
452
+ backgroundColor: theme.palette.grey[100],
453
+ ...(ownerState.onDelete && {
454
+ paddingInlineEnd: theme.spacing(2)
455
+ }),
456
+ [`& .${chipClasses.deleteIcon}`]: {
457
+ WebkitTapHighlightColor: "transparent",
458
+ color: theme.palette.text.secondary,
459
+ fontSize: "1em",
460
+ cursor: "pointer",
461
+ margin: "0",
462
+ marginInlineStart: theme.spacing(2),
463
+ "&:hover": {
464
+ color: theme.palette.text.primary
465
+ }
466
+ },
467
+ [`&.${chipClasses.disabled}`]: {
468
+ opacity: 1,
469
+ pointerEvents: "none",
470
+ backgroundColor: theme.palette.grey[50],
471
+ color: theme.palette.text.secondary
472
+ },
473
+ ...(ownerState.clickable && {
474
+ "&:hover": {
475
+ backgroundColor: theme.palette.grey[200]
476
+ },
477
+ [`&.${chipClasses.focusVisible}`]: {
478
+ backgroundColor: theme.palette.grey[200],
479
+ outlineColor: theme.palette.primary.main,
480
+ outlineOffset: "2px",
481
+ outlineStyle: "solid",
482
+ outlineWidth: "2px"
483
+ },
484
+ "&:active": {
485
+ boxShadow: "none",
486
+ backgroundColor: theme.palette.grey[300]
487
+ }
488
+ })
489
+ };
490
+ },
491
+ label: {
492
+ padding: 0
493
+ }
494
+ }
495
+ },
424
496
  MuiCircularProgress: {
425
497
  defaultProps: {
426
498
  size: "1.14285714rem",
@@ -430,20 +502,20 @@ export const components = {
430
502
  variant: "indeterminate"
431
503
  },
432
504
  styleOverrides: {
433
- root: _ref15 => {
505
+ root: _ref17 => {
434
506
  let {
435
507
  theme,
436
508
  ownerState
437
- } = _ref15;
509
+ } = _ref17;
438
510
  return { ...(ownerState.color !== "inherit" && {
439
511
  color: theme.palette.primary.dark
440
512
  })
441
513
  };
442
514
  },
443
- circle: _ref16 => {
515
+ circle: _ref18 => {
444
516
  let {
445
517
  ownerState
446
- } = _ref16;
518
+ } = _ref18;
447
519
  return { ...(ownerState.variant === "indeterminate" && {
448
520
  strokeDasharray: "160%, 360%"
449
521
  })
@@ -456,10 +528,10 @@ export const components = {
456
528
  scroll: "paper"
457
529
  },
458
530
  styleOverrides: {
459
- paper: _ref17 => {
531
+ paper: _ref19 => {
460
532
  let {
461
533
  theme
462
- } = _ref17;
534
+ } = _ref19;
463
535
  return {
464
536
  maxWidth: `calc(${theme.mixins.maxWidth} + (${theme.spacing(6)} * 2))`,
465
537
  boxShadow: "none",
@@ -470,10 +542,10 @@ export const components = {
470
542
  },
471
543
  MuiDialogActions: {
472
544
  styleOverrides: {
473
- root: _ref18 => {
545
+ root: _ref20 => {
474
546
  let {
475
547
  theme
476
- } = _ref18;
548
+ } = _ref20;
477
549
  return {
478
550
  paddingBlockStart: theme.spacing(4),
479
551
  paddingBlockEnd: theme.spacing(6),
@@ -484,11 +556,11 @@ export const components = {
484
556
  },
485
557
  MuiDialogContent: {
486
558
  styleOverrides: {
487
- root: _ref19 => {
559
+ root: _ref21 => {
488
560
  let {
489
561
  theme,
490
562
  ownerState
491
- } = _ref19;
563
+ } = _ref21;
492
564
  return {
493
565
  padding: 0,
494
566
  paddingBlock: theme.spacing(4),
@@ -507,10 +579,10 @@ export const components = {
507
579
  color: "text.primary"
508
580
  },
509
581
  styleOverrides: {
510
- root: _ref20 => {
582
+ root: _ref22 => {
511
583
  let {
512
584
  theme
513
- } = _ref20;
585
+ } = _ref22;
514
586
  return {
515
587
  marginBlockEnd: theme.spacing(5),
516
588
  "&:last-child": {
@@ -526,10 +598,10 @@ export const components = {
526
598
  variant: "h5"
527
599
  },
528
600
  styleOverrides: {
529
- root: _ref21 => {
601
+ root: _ref23 => {
530
602
  let {
531
603
  theme
532
- } = _ref21;
604
+ } = _ref23;
533
605
  return {
534
606
  display: "flex",
535
607
  justifyContent: "space-between",
@@ -548,11 +620,11 @@ export const components = {
548
620
  margin: "normal"
549
621
  },
550
622
  styleOverrides: {
551
- root: _ref22 => {
623
+ root: _ref24 => {
552
624
  let {
553
625
  ownerState,
554
626
  theme
555
- } = _ref22;
627
+ } = _ref24;
556
628
  return {
557
629
  width: "100%",
558
630
  maxWidth: "32rem",
@@ -579,11 +651,11 @@ export const components = {
579
651
  },
580
652
  MuiFormControlLabel: {
581
653
  styleOverrides: {
582
- root: _ref23 => {
654
+ root: _ref25 => {
583
655
  let {
584
656
  theme,
585
657
  ownerState
586
- } = _ref23;
658
+ } = _ref25;
587
659
  return {
588
660
  gap: theme.spacing(2),
589
661
  marginLeft: 0,
@@ -625,10 +697,10 @@ export const components = {
625
697
  variant: "standard"
626
698
  },
627
699
  styleOverrides: {
628
- root: _ref24 => {
700
+ root: _ref26 => {
629
701
  let {
630
702
  theme
631
- } = _ref24;
703
+ } = _ref26;
632
704
  return {
633
705
  fontSize: theme.typography.subtitle1.fontSize,
634
706
  lineHeight: "1.33333333",
@@ -647,10 +719,10 @@ export const components = {
647
719
  },
648
720
  MuiFormLabel: {
649
721
  styleOverrides: {
650
- root: _ref25 => {
722
+ root: _ref27 => {
651
723
  let {
652
724
  theme
653
- } = _ref25;
725
+ } = _ref27;
654
726
  return {
655
727
  color: theme.palette.text.primary,
656
728
  lineHeight: "1.14285714",
@@ -666,10 +738,10 @@ export const components = {
666
738
  },
667
739
  MuiIconButton: {
668
740
  styleOverrides: {
669
- root: _ref26 => {
741
+ root: _ref28 => {
670
742
  let {
671
743
  theme
672
- } = _ref26;
744
+ } = _ref28;
673
745
  return {
674
746
  padding: theme.spacing(1),
675
747
  fontSize: theme.typography.body1.fontSize,
@@ -714,11 +786,11 @@ export const components = {
714
786
  variant: "outlined"
715
787
  },
716
788
  styleOverrides: {
717
- root: _ref27 => {
789
+ root: _ref29 => {
718
790
  let {
719
791
  theme,
720
792
  ownerState
721
- } = _ref27;
793
+ } = _ref29;
722
794
  return {
723
795
  display: "flex",
724
796
  minWidth: "1em",
@@ -745,11 +817,11 @@ export const components = {
745
817
  required: true
746
818
  },
747
819
  styleOverrides: {
748
- root: _ref28 => {
820
+ root: _ref30 => {
749
821
  let {
750
822
  ownerState,
751
823
  theme
752
- } = _ref28;
824
+ } = _ref30;
753
825
  return { ...theme.typography.body1,
754
826
  flex: "1",
755
827
  width: "auto",
@@ -804,10 +876,10 @@ export const components = {
804
876
  }
805
877
  };
806
878
  },
807
- input: _ref29 => {
879
+ input: _ref31 => {
808
880
  let {
809
881
  theme
810
- } = _ref29;
882
+ } = _ref31;
811
883
  return {
812
884
  boxSizing: "border-box",
813
885
  height: "auto",
@@ -833,10 +905,10 @@ export const components = {
833
905
  shrink: false
834
906
  },
835
907
  styleOverrides: {
836
- root: _ref30 => {
908
+ root: _ref32 => {
837
909
  let {
838
910
  ownerState
839
- } = _ref30;
911
+ } = _ref32;
840
912
  return {
841
913
  display: "flex",
842
914
  justifyContent: "space-between",
@@ -858,10 +930,10 @@ export const components = {
858
930
  },
859
931
  MuiLink: {
860
932
  styleOverrides: {
861
- root: _ref31 => {
933
+ root: _ref33 => {
862
934
  let {
863
935
  theme
864
- } = _ref31;
936
+ } = _ref33;
865
937
  return {
866
938
  color: theme.palette.primary.main,
867
939
  textDecoration: "none",
@@ -904,10 +976,10 @@ export const components = {
904
976
  props: {
905
977
  variant: "monochrome"
906
978
  },
907
- style: _ref32 => {
979
+ style: _ref34 => {
908
980
  let {
909
981
  theme
910
- } = _ref32;
982
+ } = _ref34;
911
983
  return {
912
984
  color: theme.palette.text.primary,
913
985
  textDecoration: "underline",
@@ -932,10 +1004,10 @@ export const components = {
932
1004
  variant: "standard"
933
1005
  },
934
1006
  styleOverrides: {
935
- icon: _ref33 => {
1007
+ icon: _ref35 => {
936
1008
  let {
937
1009
  theme
938
- } = _ref33;
1010
+ } = _ref35;
939
1011
  return {
940
1012
  color: theme.palette.text.primary
941
1013
  };
@@ -947,10 +1019,10 @@ export const components = {
947
1019
  size: "small"
948
1020
  },
949
1021
  styleOverrides: {
950
- root: _ref34 => {
1022
+ root: _ref36 => {
951
1023
  let {
952
1024
  theme
953
- } = _ref34;
1025
+ } = _ref36;
954
1026
  return {
955
1027
  "&:hover": {
956
1028
  backgroundColor: "transparent"
@@ -985,10 +1057,10 @@ export const components = {
985
1057
  variant: "standard"
986
1058
  },
987
1059
  styleOverrides: {
988
- icon: _ref35 => {
1060
+ icon: _ref37 => {
989
1061
  let {
990
1062
  theme
991
- } = _ref35;
1063
+ } = _ref37;
992
1064
  return {
993
1065
  color: theme.palette.text.primary
994
1066
  };
@@ -1006,11 +1078,11 @@ export const components = {
1006
1078
  iconPosition: "start"
1007
1079
  },
1008
1080
  styleOverrides: {
1009
- root: _ref36 => {
1081
+ root: _ref38 => {
1010
1082
  let {
1011
1083
  theme,
1012
1084
  ownerState
1013
- } = _ref36;
1085
+ } = _ref38;
1014
1086
  return {
1015
1087
  maxWidth: `calc(${theme.mixins.maxWidth} / 2)`,
1016
1088
  minWidth: "unset",
@@ -1071,11 +1143,11 @@ export const components = {
1071
1143
  },
1072
1144
  MuiTable: {
1073
1145
  styleOverrides: {
1074
- root: _ref37 => {
1146
+ root: _ref39 => {
1075
1147
  let {
1076
1148
  theme,
1077
1149
  ownerState
1078
- } = _ref37;
1150
+ } = _ref39;
1079
1151
  return {
1080
1152
  display: "table",
1081
1153
  width: "auto",
@@ -1098,11 +1170,11 @@ export const components = {
1098
1170
  },
1099
1171
  MuiTableCell: {
1100
1172
  styleOverrides: {
1101
- root: _ref38 => {
1173
+ root: _ref40 => {
1102
1174
  let {
1103
1175
  theme,
1104
1176
  ownerState
1105
- } = _ref38;
1177
+ } = _ref40;
1106
1178
  return { ...theme.typography.body1,
1107
1179
  maxWidth: theme.mixins.maxWidth,
1108
1180
  borderBottom: `${theme.mixins.borderWidth} ${theme.mixins.borderStyle} ${theme.palette.grey[100]}`,
@@ -1178,10 +1250,10 @@ export const components = {
1178
1250
  },
1179
1251
  MuiTableContainer: {
1180
1252
  styleOverrides: {
1181
- root: _ref39 => {
1253
+ root: _ref41 => {
1182
1254
  let {
1183
1255
  theme
1184
- } = _ref39;
1256
+ } = _ref41;
1185
1257
  return {
1186
1258
  width: "unset",
1187
1259
  maxWidth: "100%",
@@ -1198,10 +1270,10 @@ export const components = {
1198
1270
  },
1199
1271
  MuiTableRow: {
1200
1272
  styleOverrides: {
1201
- root: _ref40 => {
1273
+ root: _ref42 => {
1202
1274
  let {
1203
1275
  theme
1204
- } = _ref40;
1276
+ } = _ref42;
1205
1277
  return {
1206
1278
  verticalAlign: "unset",
1207
1279
  [`&.${tableRowClasses.root}:hover`]: {
@@ -1222,10 +1294,10 @@ export const components = {
1222
1294
  IconComponent: ArrowDownIcon
1223
1295
  },
1224
1296
  styleOverrides: {
1225
- root: _ref41 => {
1297
+ root: _ref43 => {
1226
1298
  let {
1227
1299
  theme
1228
- } = _ref41;
1300
+ } = _ref43;
1229
1301
  return {
1230
1302
  cursor: "pointer",
1231
1303
  display: "inline-flex",
@@ -1254,11 +1326,11 @@ export const components = {
1254
1326
  }
1255
1327
  };
1256
1328
  },
1257
- icon: _ref42 => {
1329
+ icon: _ref44 => {
1258
1330
  let {
1259
1331
  theme,
1260
1332
  ownerState
1261
- } = _ref42;
1333
+ } = _ref44;
1262
1334
  return {
1263
1335
  fontSize: "inherit",
1264
1336
  marginRight: 0,
@@ -1287,19 +1359,19 @@ export const components = {
1287
1359
  },
1288
1360
  MuiTabs: {
1289
1361
  styleOverrides: {
1290
- root: _ref43 => {
1362
+ root: _ref45 => {
1291
1363
  let {
1292
1364
  theme
1293
- } = _ref43;
1365
+ } = _ref45;
1294
1366
  return {
1295
1367
  minHeight: "unset",
1296
1368
  marginBottom: theme.spacing(5)
1297
1369
  };
1298
1370
  },
1299
- flexContainer: _ref44 => {
1371
+ flexContainer: _ref46 => {
1300
1372
  let {
1301
1373
  theme
1302
- } = _ref44;
1374
+ } = _ref46;
1303
1375
  return {
1304
1376
  gap: theme.spacing(5),
1305
1377
  borderBottom: `${theme.mixins.borderWidth} ${theme.mixins.borderStyle} ${theme.palette.divider}`
@@ -1315,11 +1387,11 @@ export const components = {
1315
1387
  placement: "top"
1316
1388
  },
1317
1389
  styleOverrides: {
1318
- tooltip: _ref45 => {
1390
+ tooltip: _ref47 => {
1319
1391
  let {
1320
1392
  theme,
1321
1393
  ownerState
1322
- } = _ref45;
1394
+ } = _ref47;
1323
1395
  return {
1324
1396
  maxWidth: `calc(${theme.mixins.maxWidth} / 2)`,
1325
1397
  paddingBlock: theme.spacing(2),
@@ -1379,10 +1451,10 @@ export const components = {
1379
1451
  }
1380
1452
  };
1381
1453
  },
1382
- arrow: _ref46 => {
1454
+ arrow: _ref48 => {
1383
1455
  let {
1384
1456
  theme
1385
- } = _ref46;
1457
+ } = _ref48;
1386
1458
  return {
1387
1459
  color: theme.palette.grey[900],
1388
1460
  "&::before": {
@@ -1422,19 +1494,19 @@ export const components = {
1422
1494
  }
1423
1495
  },
1424
1496
  styleOverrides: {
1425
- paragraph: _ref47 => {
1497
+ paragraph: _ref49 => {
1426
1498
  let {
1427
1499
  theme
1428
- } = _ref47;
1500
+ } = _ref49;
1429
1501
  return {
1430
1502
  marginBottom: theme.spacing(4)
1431
1503
  };
1432
1504
  },
1433
- root: _ref48 => {
1505
+ root: _ref50 => {
1434
1506
  let {
1435
1507
  theme,
1436
1508
  ownerState
1437
- } = _ref48;
1509
+ } = _ref50;
1438
1510
  return { ...(ownerState.variant === "kbd" && {
1439
1511
  display: "inline-block",
1440
1512
  minWidth: `calc(${theme.typography.subtitle1.fontSize} * ${theme.typography.h5.lineHeight})`,