@okta/odyssey-react-mui 0.16.1 → 0.18.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 (170) hide show
  1. package/CHANGELOG.md +121 -0
  2. package/README.md +7 -19
  3. package/dist/Banner.d.ts +47 -0
  4. package/dist/Banner.d.ts.map +1 -0
  5. package/dist/Banner.js +41 -0
  6. package/dist/Banner.js.map +1 -0
  7. package/dist/Link.d.ts +1 -1
  8. package/dist/Link.d.ts.map +1 -1
  9. package/dist/Link.js +2 -1
  10. package/dist/Link.js.map +1 -1
  11. package/dist/OdysseyCacheProvider.d.ts +23 -0
  12. package/dist/OdysseyCacheProvider.d.ts.map +1 -0
  13. package/dist/OdysseyCacheProvider.js +36 -0
  14. package/dist/OdysseyCacheProvider.js.map +1 -0
  15. package/dist/OdysseyThemeProvider.d.ts +19 -0
  16. package/dist/OdysseyThemeProvider.d.ts.map +1 -0
  17. package/dist/OdysseyThemeProvider.js +32 -0
  18. package/dist/OdysseyThemeProvider.js.map +1 -0
  19. package/dist/PasswordInput.d.ts +1 -1
  20. package/dist/PasswordInput.d.ts.map +1 -1
  21. package/dist/Radio.d.ts +19 -0
  22. package/dist/Radio.d.ts.map +1 -0
  23. package/dist/Radio.js +32 -0
  24. package/dist/Radio.js.map +1 -0
  25. package/dist/RadioGroup.d.ts +47 -0
  26. package/dist/RadioGroup.d.ts.map +1 -0
  27. package/dist/RadioGroup.js +59 -0
  28. package/dist/RadioGroup.js.map +1 -0
  29. package/dist/Status.d.ts +23 -0
  30. package/dist/Status.d.ts.map +1 -0
  31. package/dist/Status.js +25 -0
  32. package/dist/Status.js.map +1 -0
  33. package/dist/TextField.d.ts +87 -0
  34. package/dist/TextField.d.ts.map +1 -0
  35. package/dist/TextField.js +100 -0
  36. package/dist/TextField.js.map +1 -0
  37. package/dist/ThemeProvider.d.ts +3 -2
  38. package/dist/ThemeProvider.d.ts.map +1 -1
  39. package/dist/ThemeProvider.js +12 -6
  40. package/dist/ThemeProvider.js.map +1 -1
  41. package/dist/createUniqueAlphabeticalId.d.ts +14 -0
  42. package/dist/createUniqueAlphabeticalId.d.ts.map +1 -0
  43. package/dist/createUniqueAlphabeticalId.js +14 -0
  44. package/dist/createUniqueAlphabeticalId.js.map +1 -0
  45. package/dist/createUniqueId.d.ts.map +1 -1
  46. package/dist/createUniqueId.js.map +1 -1
  47. package/dist/iconDictionary/Add.d.ts +1 -1
  48. package/dist/iconDictionary/Add.d.ts.map +1 -1
  49. package/dist/iconDictionary/AddCircle.d.ts +1 -1
  50. package/dist/iconDictionary/AddCircle.d.ts.map +1 -1
  51. package/dist/iconDictionary/AlertCircle.d.ts +1 -1
  52. package/dist/iconDictionary/AlertCircle.d.ts.map +1 -1
  53. package/dist/iconDictionary/AlertCircleFilled.d.ts +1 -1
  54. package/dist/iconDictionary/AlertCircleFilled.d.ts.map +1 -1
  55. package/dist/iconDictionary/AlertTriangleFilled.d.ts +1 -1
  56. package/dist/iconDictionary/AlertTriangleFilled.d.ts.map +1 -1
  57. package/dist/iconDictionary/Anchor.d.ts +1 -1
  58. package/dist/iconDictionary/Anchor.d.ts.map +1 -1
  59. package/dist/iconDictionary/ArrowDown.d.ts +1 -1
  60. package/dist/iconDictionary/ArrowDown.d.ts.map +1 -1
  61. package/dist/iconDictionary/ArrowLeft.d.ts +1 -1
  62. package/dist/iconDictionary/ArrowLeft.d.ts.map +1 -1
  63. package/dist/iconDictionary/ArrowRight.d.ts +1 -1
  64. package/dist/iconDictionary/ArrowRight.d.ts.map +1 -1
  65. package/dist/iconDictionary/ArrowUp.d.ts +1 -1
  66. package/dist/iconDictionary/ArrowUp.d.ts.map +1 -1
  67. package/dist/iconDictionary/ArrowUpDown.d.ts +1 -1
  68. package/dist/iconDictionary/ArrowUpDown.d.ts.map +1 -1
  69. package/dist/iconDictionary/Calendar.d.ts +1 -1
  70. package/dist/iconDictionary/Calendar.d.ts.map +1 -1
  71. package/dist/iconDictionary/Check.d.ts +1 -1
  72. package/dist/iconDictionary/Check.d.ts.map +1 -1
  73. package/dist/iconDictionary/CheckCircleFilled.d.ts +1 -1
  74. package/dist/iconDictionary/CheckCircleFilled.d.ts.map +1 -1
  75. package/dist/iconDictionary/ChevronDown.d.ts +1 -1
  76. package/dist/iconDictionary/ChevronDown.d.ts.map +1 -1
  77. package/dist/iconDictionary/ChevronUp.d.ts +1 -1
  78. package/dist/iconDictionary/ChevronUp.d.ts.map +1 -1
  79. package/dist/iconDictionary/Close.d.ts +1 -1
  80. package/dist/iconDictionary/Close.d.ts.map +1 -1
  81. package/dist/iconDictionary/CloseCircleFilled.d.ts +1 -1
  82. package/dist/iconDictionary/CloseCircleFilled.d.ts.map +1 -1
  83. package/dist/iconDictionary/Copy.d.ts +1 -1
  84. package/dist/iconDictionary/Copy.d.ts.map +1 -1
  85. package/dist/iconDictionary/Delete.d.ts +1 -1
  86. package/dist/iconDictionary/Delete.d.ts.map +1 -1
  87. package/dist/iconDictionary/Download.d.ts +1 -1
  88. package/dist/iconDictionary/Download.d.ts.map +1 -1
  89. package/dist/iconDictionary/DragHandle.d.ts +1 -1
  90. package/dist/iconDictionary/DragHandle.d.ts.map +1 -1
  91. package/dist/iconDictionary/Edit.d.ts +1 -1
  92. package/dist/iconDictionary/Edit.d.ts.map +1 -1
  93. package/dist/iconDictionary/ExternalLink.d.ts +1 -1
  94. package/dist/iconDictionary/ExternalLink.d.ts.map +1 -1
  95. package/dist/iconDictionary/Eye.d.ts +1 -1
  96. package/dist/iconDictionary/Eye.d.ts.map +1 -1
  97. package/dist/iconDictionary/EyeOff.d.ts +1 -1
  98. package/dist/iconDictionary/EyeOff.d.ts.map +1 -1
  99. package/dist/iconDictionary/Filter.d.ts +1 -1
  100. package/dist/iconDictionary/Filter.d.ts.map +1 -1
  101. package/dist/iconDictionary/Globe.d.ts +1 -1
  102. package/dist/iconDictionary/Globe.d.ts.map +1 -1
  103. package/dist/iconDictionary/Home.d.ts +1 -1
  104. package/dist/iconDictionary/Home.d.ts.map +1 -1
  105. package/dist/iconDictionary/InformationCircle.d.ts +1 -1
  106. package/dist/iconDictionary/InformationCircle.d.ts.map +1 -1
  107. package/dist/iconDictionary/InformationCircleFilled.d.ts +1 -1
  108. package/dist/iconDictionary/InformationCircleFilled.d.ts.map +1 -1
  109. package/dist/iconDictionary/Notification.d.ts +1 -1
  110. package/dist/iconDictionary/Notification.d.ts.map +1 -1
  111. package/dist/iconDictionary/OverflowVertical.d.ts +1 -1
  112. package/dist/iconDictionary/OverflowVertical.d.ts.map +1 -1
  113. package/dist/iconDictionary/QuestionCircle.d.ts +1 -1
  114. package/dist/iconDictionary/QuestionCircle.d.ts.map +1 -1
  115. package/dist/iconDictionary/QuestionCircleFilled.d.ts +1 -1
  116. package/dist/iconDictionary/QuestionCircleFilled.d.ts.map +1 -1
  117. package/dist/iconDictionary/Search.d.ts +1 -1
  118. package/dist/iconDictionary/Search.d.ts.map +1 -1
  119. package/dist/iconDictionary/Settings.d.ts +1 -1
  120. package/dist/iconDictionary/Settings.d.ts.map +1 -1
  121. package/dist/iconDictionary/Subtract.d.ts +1 -1
  122. package/dist/iconDictionary/Subtract.d.ts.map +1 -1
  123. package/dist/iconDictionary/User.d.ts +1 -1
  124. package/dist/iconDictionary/User.d.ts.map +1 -1
  125. package/dist/iconDictionary/UserGroup.d.ts +1 -1
  126. package/dist/iconDictionary/UserGroup.d.ts.map +1 -1
  127. package/dist/index.d.ts +13 -6
  128. package/dist/index.d.ts.map +1 -1
  129. package/dist/index.js +11 -4
  130. package/dist/index.js.map +1 -1
  131. package/dist/theme/components.d.ts.map +1 -1
  132. package/dist/theme/components.js +645 -174
  133. package/dist/theme/components.js.map +1 -1
  134. package/dist/theme/components.types.d.ts +5 -0
  135. package/dist/theme/components.types.d.ts.map +1 -1
  136. package/dist/theme/components.types.js.map +1 -1
  137. package/dist/theme/typography.d.ts.map +1 -1
  138. package/dist/theme/typography.js +6 -0
  139. package/dist/theme/typography.js.map +1 -1
  140. package/dist/theme/typography.types.d.ts +3 -3
  141. package/dist/theme/typography.types.d.ts.map +1 -1
  142. package/dist/theme/typography.types.js.map +1 -1
  143. package/dist/useUniqueAlphabeticalId.d.ts +13 -0
  144. package/dist/useUniqueAlphabeticalId.d.ts.map +1 -0
  145. package/dist/useUniqueAlphabeticalId.js +18 -0
  146. package/dist/useUniqueAlphabeticalId.js.map +1 -0
  147. package/dist/useUniqueId.d.ts.map +1 -1
  148. package/dist/useUniqueId.js +1 -1
  149. package/dist/useUniqueId.js.map +1 -1
  150. package/package.json +8 -7
  151. package/src/Banner.tsx +69 -0
  152. package/src/Link.tsx +21 -23
  153. package/src/OdysseyCacheProvider.test.tsx +38 -0
  154. package/src/OdysseyCacheProvider.tsx +48 -0
  155. package/src/OdysseyThemeProvider.tsx +44 -0
  156. package/src/Radio.tsx +28 -0
  157. package/src/RadioGroup.tsx +105 -0
  158. package/src/Status.tsx +29 -0
  159. package/src/TextField.tsx +220 -0
  160. package/src/ThemeProvider.tsx +11 -5
  161. package/src/createUniqueAlphabeticalId.test.ts +22 -0
  162. package/src/createUniqueAlphabeticalId.ts +19 -0
  163. package/src/createUniqueId.ts +1 -1
  164. package/src/index.ts +35 -14
  165. package/src/theme/components.tsx +585 -85
  166. package/src/theme/components.types.ts +7 -0
  167. package/src/theme/typography.ts +6 -0
  168. package/src/theme/typography.types.ts +3 -3
  169. package/src/useUniqueAlphabeticalId.ts +21 -0
  170. package/src/useUniqueId.ts +2 -2
@@ -52,6 +52,13 @@ declare module "@mui/material/Button" {
52
52
  }
53
53
  }
54
54
 
55
+ declare module "@mui/material/Chip" {
56
+ interface ChipPropsVariantOverrides {
57
+ // Enable Odyssey variant for Status component
58
+ status: true;
59
+ }
60
+ }
61
+
55
62
  declare module "@mui/material/Link" {
56
63
  interface LinkPropsVariantOverrides {
57
64
  default: true;
@@ -89,4 +89,10 @@ export const typography: ThemeOptions["typography"] = {
89
89
  lineHeight: Tokens.FontLineHeightHeading6,
90
90
  marginBottom: Tokens.SpaceScale1,
91
91
  },
92
+ ui: {
93
+ fontWeight: Number(Tokens.FontWeightNormal),
94
+ fontSize: Tokens.FontScale1,
95
+ lineHeight: Tokens.FontLineHeightUi,
96
+ letterSpacing: "initial",
97
+ },
92
98
  };
@@ -14,12 +14,12 @@ import { CSSProperties } from "react";
14
14
 
15
15
  declare module "@mui/material/styles" {
16
16
  interface TypographyVariants {
17
- kbd: CSSProperties;
18
17
  legend: CSSProperties;
18
+ ui: CSSProperties;
19
19
  }
20
20
  interface TypographyVariantsOptions {
21
- kbd?: CSSProperties;
22
21
  legend?: CSSProperties;
22
+ ui: CSSProperties;
23
23
  }
24
24
  }
25
25
 
@@ -28,11 +28,11 @@ declare module "@mui/material/Typography" {
28
28
  body1: true; // Design may refer to this as "body"
29
29
  body2: false;
30
30
  button: false;
31
- kbd: true;
32
31
  legend: true;
33
32
  overline: false;
34
33
  subtitle1: true; // Design may refer to this as "caption"
35
34
  subtitle2: false;
35
+ ui: true;
36
36
  default: true; // used by <Link>
37
37
  monochrome: true; // used by <Link>
38
38
  }
@@ -0,0 +1,21 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { useMemo } from "react";
14
+
15
+ import { createUniqueAlphabeticalId } from "./createUniqueAlphabeticalId";
16
+
17
+ export const useUniqueAlphabeticalId = (id?: string) => {
18
+ const uniqueAlphabeticalId = useMemo(() => createUniqueAlphabeticalId(), []);
19
+
20
+ return id ?? uniqueAlphabeticalId;
21
+ };
@@ -14,8 +14,8 @@ import { useMemo } from "react";
14
14
 
15
15
  import { createUniqueId } from "./createUniqueId";
16
16
 
17
- export const useUniqueId = (id?: string): string => {
17
+ export const useUniqueId = (id?: string) => {
18
18
  const uniqueId = useMemo(() => createUniqueId(), []);
19
19
 
20
- return id || uniqueId;
20
+ return id ?? uniqueId;
21
21
  };