@okta/odyssey-react-mui 1.0.2 → 1.2.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 (274) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +1 -1
  3. package/dist/Autocomplete.js +20 -3
  4. package/dist/Autocomplete.js.map +1 -1
  5. package/dist/Banner.js +3 -1
  6. package/dist/Banner.js.map +1 -1
  7. package/dist/Box.js +8 -4
  8. package/dist/Box.js.map +1 -1
  9. package/dist/Button.js +3 -1
  10. package/dist/Button.js.map +1 -1
  11. package/dist/Callout.js +2 -0
  12. package/dist/Callout.js.map +1 -1
  13. package/dist/Checkbox.js +6 -2
  14. package/dist/Checkbox.js.map +1 -1
  15. package/dist/CheckboxGroup.js +5 -7
  16. package/dist/CheckboxGroup.js.map +1 -1
  17. package/dist/CircularProgress.js +2 -0
  18. package/dist/CircularProgress.js.map +1 -1
  19. package/dist/Dialog.js +2 -0
  20. package/dist/Dialog.js.map +1 -1
  21. package/dist/Field.js.map +1 -1
  22. package/dist/FieldError.js +2 -0
  23. package/dist/FieldError.js.map +1 -1
  24. package/dist/FieldHint.js +2 -0
  25. package/dist/FieldHint.js.map +1 -1
  26. package/dist/FieldLabel.js +3 -1
  27. package/dist/FieldLabel.js.map +1 -1
  28. package/dist/Fieldset.js +3 -1
  29. package/dist/Fieldset.js.map +1 -1
  30. package/dist/Form.js +5 -3
  31. package/dist/Form.js.map +1 -1
  32. package/dist/Link.js +3 -1
  33. package/dist/Link.js.map +1 -1
  34. package/dist/MenuButton.js +8 -2
  35. package/dist/MenuButton.js.map +1 -1
  36. package/dist/MenuItem.js +6 -2
  37. package/dist/MenuItem.js.map +1 -1
  38. package/dist/NativeSelect.js +3 -1
  39. package/dist/NativeSelect.js.map +1 -1
  40. package/dist/OdysseyCacheProvider.js +4 -1
  41. package/dist/OdysseyCacheProvider.js.map +1 -1
  42. package/dist/OdysseyProvider.js +12 -5
  43. package/dist/OdysseyProvider.js.map +1 -1
  44. package/dist/OdysseyThemeProvider.js +8 -7
  45. package/dist/OdysseyThemeProvider.js.map +1 -1
  46. package/dist/OdysseyTranslationProvider.js +1 -1
  47. package/dist/OdysseyTranslationProvider.js.map +1 -1
  48. package/dist/OdysseyTranslationProvider.types.js +1 -1
  49. package/dist/OdysseyTranslationProvider.types.js.map +1 -1
  50. package/dist/PasswordField.js +18 -9
  51. package/dist/PasswordField.js.map +1 -1
  52. package/dist/Radio.js +2 -0
  53. package/dist/Radio.js.map +1 -1
  54. package/dist/RadioGroup.js +5 -2
  55. package/dist/RadioGroup.js.map +1 -1
  56. package/dist/SearchField.js +11 -10
  57. package/dist/SearchField.js.map +1 -1
  58. package/dist/Select.js +39 -35
  59. package/dist/Select.js.map +1 -1
  60. package/dist/SeleniumProps.js +2 -0
  61. package/dist/SeleniumProps.js.map +1 -0
  62. package/dist/Status.js +4 -2
  63. package/dist/Status.js.map +1 -1
  64. package/dist/Tabs.js +11 -4
  65. package/dist/Tabs.js.map +1 -1
  66. package/dist/Tag.js +4 -2
  67. package/dist/Tag.js.map +1 -1
  68. package/dist/TagList.js +3 -1
  69. package/dist/TagList.js.map +1 -1
  70. package/dist/TextField.js +6 -2
  71. package/dist/TextField.js.map +1 -1
  72. package/dist/Toast.js +2 -0
  73. package/dist/Toast.js.map +1 -1
  74. package/dist/Tooltip.js +2 -0
  75. package/dist/Tooltip.js.map +1 -1
  76. package/dist/Typography.js +71 -59
  77. package/dist/Typography.js.map +1 -1
  78. package/dist/createShadowDom.js +26 -0
  79. package/dist/createShadowDom.js.map +1 -0
  80. package/dist/{OdysseyI18n.js → i18n.js} +5 -2
  81. package/dist/i18n.js.map +1 -0
  82. package/dist/index.js +1 -0
  83. package/dist/index.js.map +1 -1
  84. package/dist/labs/DatePicker.js +4 -2
  85. package/dist/labs/DatePicker.js.map +1 -1
  86. package/dist/labs/PaginatedTable.js +6 -4
  87. package/dist/labs/PaginatedTable.js.map +1 -1
  88. package/dist/labs/StaticTable.js +9 -4
  89. package/dist/labs/StaticTable.js.map +1 -1
  90. package/dist/labs/datePickerTheme.js +4 -2
  91. package/dist/labs/datePickerTheme.js.map +1 -1
  92. package/dist/properties/ts/odyssey-react-mui.js +2 -0
  93. package/dist/properties/ts/odyssey-react-mui.js.map +1 -1
  94. package/dist/src/Autocomplete.d.ts +29 -4
  95. package/dist/src/Autocomplete.d.ts.map +1 -1
  96. package/dist/src/Banner.d.ts +3 -2
  97. package/dist/src/Banner.d.ts.map +1 -1
  98. package/dist/src/Box.d.ts +9 -2
  99. package/dist/src/Box.d.ts.map +1 -1
  100. package/dist/src/Button.d.ts +3 -2
  101. package/dist/src/Button.d.ts.map +1 -1
  102. package/dist/src/Callout.d.ts +3 -2
  103. package/dist/src/Callout.d.ts.map +1 -1
  104. package/dist/src/Checkbox.d.ts +8 -3
  105. package/dist/src/Checkbox.d.ts.map +1 -1
  106. package/dist/src/CheckboxGroup.d.ts +3 -6
  107. package/dist/src/CheckboxGroup.d.ts.map +1 -1
  108. package/dist/src/CircularProgress.d.ts +3 -2
  109. package/dist/src/CircularProgress.d.ts.map +1 -1
  110. package/dist/src/Dialog.d.ts +3 -2
  111. package/dist/src/Dialog.d.ts.map +1 -1
  112. package/dist/src/Field.d.ts +2 -1
  113. package/dist/src/Field.d.ts.map +1 -1
  114. package/dist/src/FieldError.d.ts +3 -2
  115. package/dist/src/FieldError.d.ts.map +1 -1
  116. package/dist/src/FieldHint.d.ts +3 -2
  117. package/dist/src/FieldHint.d.ts.map +1 -1
  118. package/dist/src/FieldLabel.d.ts +3 -2
  119. package/dist/src/FieldLabel.d.ts.map +1 -1
  120. package/dist/src/Fieldset.d.ts +3 -2
  121. package/dist/src/Fieldset.d.ts.map +1 -1
  122. package/dist/src/Form.d.ts +3 -2
  123. package/dist/src/Form.d.ts.map +1 -1
  124. package/dist/src/Link.d.ts +3 -2
  125. package/dist/src/Link.d.ts.map +1 -1
  126. package/dist/src/MenuButton.d.ts +12 -3
  127. package/dist/src/MenuButton.d.ts.map +1 -1
  128. package/dist/src/MenuItem.d.ts +5 -4
  129. package/dist/src/MenuItem.d.ts.map +1 -1
  130. package/dist/src/NativeSelect.d.ts +56 -2
  131. package/dist/src/NativeSelect.d.ts.map +1 -1
  132. package/dist/src/OdysseyCacheProvider.d.ts +6 -1
  133. package/dist/src/OdysseyCacheProvider.d.ts.map +1 -1
  134. package/dist/src/OdysseyProvider.d.ts +1 -1
  135. package/dist/src/OdysseyProvider.d.ts.map +1 -1
  136. package/dist/src/OdysseyThemeProvider.d.ts +2 -1
  137. package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
  138. package/dist/src/OdysseyTranslationProvider.d.ts +1 -1
  139. package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -1
  140. package/dist/src/OdysseyTranslationProvider.types.d.ts +1 -1
  141. package/dist/src/OdysseyTranslationProvider.types.d.ts.map +1 -1
  142. package/dist/src/PasswordField.d.ts +78 -2
  143. package/dist/src/PasswordField.d.ts.map +1 -1
  144. package/dist/src/Radio.d.ts +3 -2
  145. package/dist/src/Radio.d.ts.map +1 -1
  146. package/dist/src/RadioGroup.d.ts +8 -3
  147. package/dist/src/RadioGroup.d.ts.map +1 -1
  148. package/dist/src/SearchField.d.ts +58 -2
  149. package/dist/src/SearchField.d.ts.map +1 -1
  150. package/dist/src/Select.d.ts +7 -2
  151. package/dist/src/Select.d.ts.map +1 -1
  152. package/dist/src/SeleniumProps.d.ts +20 -0
  153. package/dist/src/SeleniumProps.d.ts.map +1 -0
  154. package/dist/src/Status.d.ts +3 -2
  155. package/dist/src/Status.d.ts.map +1 -1
  156. package/dist/src/Tabs.d.ts +9 -3
  157. package/dist/src/Tabs.d.ts.map +1 -1
  158. package/dist/src/Tag.d.ts +3 -2
  159. package/dist/src/Tag.d.ts.map +1 -1
  160. package/dist/src/TagList.d.ts +3 -2
  161. package/dist/src/TagList.d.ts.map +1 -1
  162. package/dist/src/TextField.d.ts +86 -2
  163. package/dist/src/TextField.d.ts.map +1 -1
  164. package/dist/src/Toast.d.ts +3 -2
  165. package/dist/src/Toast.d.ts.map +1 -1
  166. package/dist/src/Tooltip.d.ts +3 -2
  167. package/dist/src/Tooltip.d.ts.map +1 -1
  168. package/dist/src/Typography.d.ts +14 -49
  169. package/dist/src/Typography.d.ts.map +1 -1
  170. package/dist/src/createShadowDom.d.ts +16 -0
  171. package/dist/src/createShadowDom.d.ts.map +1 -0
  172. package/dist/src/{OdysseyI18n.d.ts → i18n.d.ts} +20 -2
  173. package/dist/src/i18n.d.ts.map +1 -0
  174. package/dist/src/index.d.ts +1 -0
  175. package/dist/src/index.d.ts.map +1 -1
  176. package/dist/src/labs/DatePicker.d.ts +5 -1
  177. package/dist/src/labs/DatePicker.d.ts.map +1 -1
  178. package/dist/src/labs/PaginatedTable.d.ts.map +1 -1
  179. package/dist/src/labs/StaticTable.d.ts.map +1 -1
  180. package/dist/src/properties/ts/odyssey-react-mui.d.ts +2 -0
  181. package/dist/src/properties/ts/odyssey-react-mui.d.ts.map +1 -1
  182. package/dist/src/theme/components.d.ts +4 -1
  183. package/dist/src/theme/components.d.ts.map +1 -1
  184. package/dist/src/theme/createOdysseyMuiTheme.d.ts +23 -0
  185. package/dist/src/theme/createOdysseyMuiTheme.d.ts.map +1 -0
  186. package/dist/src/theme/mixins.d.ts +3 -1
  187. package/dist/src/theme/mixins.d.ts.map +1 -1
  188. package/dist/src/theme/palette.d.ts +3 -1
  189. package/dist/src/theme/palette.d.ts.map +1 -1
  190. package/dist/src/theme/shape.d.ts +3 -1
  191. package/dist/src/theme/shape.d.ts.map +1 -1
  192. package/dist/src/theme/spacing.d.ts +3 -1
  193. package/dist/src/theme/spacing.d.ts.map +1 -1
  194. package/dist/src/theme/theme.d.ts +1 -8
  195. package/dist/src/theme/theme.d.ts.map +1 -1
  196. package/dist/src/theme/typography.d.ts +3 -1
  197. package/dist/src/theme/typography.d.ts.map +1 -1
  198. package/dist/theme/components.js +118 -73
  199. package/dist/theme/components.js.map +1 -1
  200. package/dist/theme/createOdysseyMuiTheme.js +51 -0
  201. package/dist/theme/createOdysseyMuiTheme.js.map +1 -0
  202. package/dist/theme/mixins.js +4 -1
  203. package/dist/theme/mixins.js.map +1 -1
  204. package/dist/theme/palette.js +4 -1
  205. package/dist/theme/palette.js.map +1 -1
  206. package/dist/theme/shape.js +4 -1
  207. package/dist/theme/shape.js.map +1 -1
  208. package/dist/theme/spacing.js +4 -1
  209. package/dist/theme/spacing.js.map +1 -1
  210. package/dist/theme/theme.js +1 -20
  211. package/dist/theme/theme.js.map +1 -1
  212. package/dist/theme/typography.js +4 -1
  213. package/dist/theme/typography.js.map +1 -1
  214. package/dist/tsconfig.production.tsbuildinfo +1 -1
  215. package/package.json +7 -6
  216. package/src/Autocomplete.tsx +56 -4
  217. package/src/Banner.tsx +11 -2
  218. package/src/Box.tsx +11 -5
  219. package/src/Button.tsx +6 -1
  220. package/src/Callout.tsx +5 -3
  221. package/src/Checkbox.tsx +14 -4
  222. package/src/CheckboxGroup.tsx +6 -10
  223. package/src/CircularProgress.tsx +5 -1
  224. package/src/Dialog.tsx +5 -2
  225. package/src/Field.tsx +2 -0
  226. package/src/FieldError.tsx +5 -3
  227. package/src/FieldHint.tsx +9 -3
  228. package/src/FieldLabel.tsx +5 -3
  229. package/src/Fieldset.tsx +4 -1
  230. package/src/Form.tsx +7 -4
  231. package/src/Link.tsx +18 -3
  232. package/src/MenuButton.tsx +33 -4
  233. package/src/MenuItem.tsx +11 -6
  234. package/src/NativeSelect.tsx +7 -2
  235. package/src/OdysseyCacheProvider.tsx +9 -1
  236. package/src/OdysseyProvider.tsx +18 -8
  237. package/src/OdysseyThemeProvider.tsx +12 -8
  238. package/src/OdysseyTranslationProvider.test.tsx +2 -2
  239. package/src/OdysseyTranslationProvider.tsx +1 -1
  240. package/src/OdysseyTranslationProvider.types.ts +1 -0
  241. package/src/PasswordField.tsx +37 -13
  242. package/src/Radio.tsx +5 -1
  243. package/src/RadioGroup.tsx +12 -4
  244. package/src/SearchField.tsx +23 -15
  245. package/src/Select.tsx +154 -149
  246. package/src/SeleniumProps.ts +20 -0
  247. package/src/Status.tsx +15 -3
  248. package/src/Tabs.tsx +18 -4
  249. package/src/Tag.tsx +12 -3
  250. package/src/TagList.tsx +4 -2
  251. package/src/TextField.tsx +14 -2
  252. package/src/Toast.tsx +4 -1
  253. package/src/Tooltip.tsx +4 -1
  254. package/src/Typography.tsx +76 -54
  255. package/src/createShadowDom.ts +46 -0
  256. package/src/{OdysseyI18n.ts → i18n.ts} +4 -2
  257. package/src/index.ts +1 -0
  258. package/src/labs/DatePicker.tsx +15 -7
  259. package/src/labs/PaginatedTable.tsx +12 -3
  260. package/src/labs/README.md +2 -2
  261. package/src/labs/StaticTable.tsx +13 -3
  262. package/src/labs/datePickerTheme.tsx +2 -2
  263. package/src/properties/odyssey-react-mui.properties +2 -0
  264. package/src/properties/ts/odyssey-react-mui.ts +1 -1
  265. package/src/theme/components.tsx +69 -18
  266. package/src/theme/createOdysseyMuiTheme.ts +47 -0
  267. package/src/theme/mixins.ts +5 -1
  268. package/src/theme/palette.ts +5 -3
  269. package/src/theme/shape.ts +5 -1
  270. package/src/theme/spacing.ts +5 -3
  271. package/src/theme/theme.ts +1 -26
  272. package/src/theme/typography.ts +5 -3
  273. package/dist/OdysseyI18n.js.map +0 -1
  274. package/dist/src/OdysseyI18n.d.ts.map +0 -1
@@ -10,7 +10,7 @@ import _Typography from "@mui/material/Typography";
10
10
  *
11
11
  * See the License for the specific language governing permissions and limitations under the License.
12
12
  */
13
- import { useMemo } from "react";
13
+ import { memo, useMemo } from "react";
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
15
  export const typographyVariantMapping = {
16
16
  h1: "h1",
@@ -25,15 +25,15 @@ export const typographyVariantMapping = {
25
25
  legend: "legend"
26
26
  };
27
27
  export const typographyColorValues = ["primary", "textPrimary", "secondary", "textSecondary", "error"];
28
- export const Typography = _ref => {
28
+ const Typography = _ref => {
29
29
  let {
30
30
  ariaDescribedBy,
31
31
  ariaLabel,
32
32
  ariaLabelledBy,
33
33
  children,
34
- classes,
35
34
  color,
36
35
  component: componentProp,
36
+ testId,
37
37
  variant = "body"
38
38
  } = _ref;
39
39
  const component = useMemo(() => {
@@ -41,7 +41,7 @@ export const Typography = _ref => {
41
41
  if (variant === "body") {
42
42
  return "p";
43
43
  } else if (variant === "subordinate" || variant === "support") {
44
- return "h6";
44
+ return "p";
45
45
  } else {
46
46
  return variant;
47
47
  }
@@ -49,235 +49,247 @@ export const Typography = _ref => {
49
49
  return componentProp;
50
50
  }, [componentProp, variant]);
51
51
  return _jsx(_Typography, {
52
- ariaDescribedBy: ariaDescribedBy,
53
- ariaLabel: ariaLabel,
54
- ariaLabelledBy: ariaLabelledBy,
52
+ "aria-describedby": ariaDescribedBy,
53
+ "aria-label": ariaLabel,
54
+ "aria-labelledby": ariaLabelledBy,
55
55
  children: children,
56
- classes: classes,
57
56
  color: color,
58
57
  component: component,
58
+ "data-se": testId,
59
59
  variant: typographyVariantMapping[variant]
60
60
  });
61
61
  };
62
- Typography.displayName = "Typography";
63
- export const Heading1 = _ref2 => {
62
+ const MemoizedTypography = memo(Typography);
63
+ MemoizedTypography.displayName = "Typography";
64
+ const Heading1 = _ref2 => {
64
65
  let {
65
66
  ariaDescribedBy,
66
67
  ariaLabel,
67
68
  ariaLabelledBy,
68
69
  children,
69
- classes,
70
70
  color,
71
- component
71
+ component,
72
+ testId
72
73
  } = _ref2;
73
74
  return _jsx(Typography, {
74
75
  ariaDescribedBy: ariaDescribedBy,
75
76
  ariaLabel: ariaLabel,
76
77
  ariaLabelledBy: ariaLabelledBy,
77
78
  children: children,
78
- classes: classes,
79
79
  color: color,
80
80
  component: component,
81
+ "data-se": testId,
81
82
  variant: "h1"
82
83
  });
83
84
  };
84
- Heading1.displayName = "Heading1";
85
- export const Heading2 = _ref3 => {
85
+ const MemoizedHeading1 = memo(Heading1);
86
+ MemoizedHeading1.displayName = "Heading1";
87
+ const Heading2 = _ref3 => {
86
88
  let {
87
89
  ariaDescribedBy,
88
90
  ariaLabel,
89
91
  ariaLabelledBy,
90
92
  children,
91
- classes,
92
93
  color,
93
- component
94
+ component,
95
+ testId
94
96
  } = _ref3;
95
97
  return _jsx(Typography, {
96
98
  ariaDescribedBy: ariaDescribedBy,
97
99
  ariaLabel: ariaLabel,
98
100
  ariaLabelledBy: ariaLabelledBy,
99
101
  children: children,
100
- classes: classes,
101
102
  color: color,
102
103
  component: component,
104
+ "data-se": testId,
103
105
  variant: "h2"
104
106
  });
105
107
  };
106
- Heading2.displayName = "Heading2";
107
- export const Heading3 = _ref4 => {
108
+ const MemoizedHeading2 = memo(Heading2);
109
+ MemoizedHeading2.displayName = "Heading2";
110
+ const Heading3 = _ref4 => {
108
111
  let {
109
112
  ariaDescribedBy,
110
113
  ariaLabel,
111
114
  ariaLabelledBy,
112
115
  children,
113
- classes,
114
116
  color,
115
- component
117
+ component,
118
+ testId
116
119
  } = _ref4;
117
120
  return _jsx(Typography, {
118
121
  ariaDescribedBy: ariaDescribedBy,
119
122
  ariaLabel: ariaLabel,
120
123
  ariaLabelledBy: ariaLabelledBy,
121
124
  children: children,
122
- classes: classes,
123
125
  color: color,
124
126
  component: component,
127
+ "data-se": testId,
125
128
  variant: "h3"
126
129
  });
127
130
  };
128
- Heading3.displayName = "Heading3";
129
- export const Heading4 = _ref5 => {
131
+ const MemoizedHeading3 = memo(Heading3);
132
+ MemoizedHeading3.displayName = "Heading3";
133
+ const Heading4 = _ref5 => {
130
134
  let {
131
135
  ariaDescribedBy,
132
136
  ariaLabel,
133
137
  ariaLabelledBy,
134
138
  children,
135
- classes,
136
139
  color,
137
- component
140
+ component,
141
+ testId
138
142
  } = _ref5;
139
143
  return _jsx(Typography, {
140
144
  ariaDescribedBy: ariaDescribedBy,
141
145
  ariaLabel: ariaLabel,
142
146
  ariaLabelledBy: ariaLabelledBy,
143
147
  children: children,
144
- classes: classes,
145
148
  color: color,
146
149
  component: component,
150
+ "data-se": testId,
147
151
  variant: "h4"
148
152
  });
149
153
  };
150
- Heading4.displayName = "Heading4";
151
- export const Heading5 = _ref6 => {
154
+ const MemoizedHeading4 = memo(Heading4);
155
+ MemoizedHeading4.displayName = "Heading4";
156
+ const Heading5 = _ref6 => {
152
157
  let {
153
158
  ariaDescribedBy,
154
159
  ariaLabel,
155
160
  ariaLabelledBy,
156
161
  children,
157
- classes,
158
162
  color,
159
- component
163
+ component,
164
+ testId
160
165
  } = _ref6;
161
166
  return _jsx(Typography, {
162
167
  ariaDescribedBy: ariaDescribedBy,
163
168
  ariaLabel: ariaLabel,
164
169
  ariaLabelledBy: ariaLabelledBy,
165
170
  children: children,
166
- classes: classes,
167
171
  color: color,
168
172
  component: component,
173
+ "data-se": testId,
169
174
  variant: "h5"
170
175
  });
171
176
  };
172
- Heading5.displayName = "Heading5";
173
- export const Heading6 = _ref7 => {
177
+ const MemoizedHeading5 = memo(Heading5);
178
+ MemoizedHeading5.displayName = "Heading5";
179
+ const Heading6 = _ref7 => {
174
180
  let {
175
181
  ariaDescribedBy,
176
182
  ariaLabel,
177
183
  ariaLabelledBy,
178
184
  children,
179
- classes,
180
185
  color,
181
- component
186
+ component,
187
+ testId
182
188
  } = _ref7;
183
189
  return _jsx(Typography, {
184
190
  ariaDescribedBy: ariaDescribedBy,
185
191
  ariaLabel: ariaLabel,
186
192
  ariaLabelledBy: ariaLabelledBy,
187
193
  children: children,
188
- classes: classes,
189
194
  color: color,
190
195
  component: component,
196
+ "data-se": testId,
191
197
  variant: "h6"
192
198
  });
193
199
  };
194
- Heading6.displayName = "Heading6";
195
- export const Paragraph = _ref8 => {
200
+ const MemoizedHeading6 = memo(Heading6);
201
+ MemoizedHeading6.displayName = "Heading6";
202
+ const Paragraph = _ref8 => {
196
203
  let {
197
204
  ariaDescribedBy,
198
205
  ariaLabel,
199
206
  ariaLabelledBy,
200
207
  children,
201
- classes,
202
208
  color,
203
- component
209
+ component,
210
+ testId
204
211
  } = _ref8;
205
212
  return _jsx(Typography, {
206
213
  ariaDescribedBy: ariaDescribedBy,
207
214
  ariaLabel: ariaLabel,
208
215
  ariaLabelledBy: ariaLabelledBy,
209
216
  children: children,
210
- classes: classes,
211
217
  color: color,
212
218
  component: component,
219
+ "data-se": testId,
213
220
  variant: "body"
214
221
  });
215
222
  };
216
- Paragraph.displayName = "Paragraph";
217
- export const Subordinate = _ref9 => {
223
+ const MemoizedParagraph = memo(Paragraph);
224
+ MemoizedParagraph.displayName = "Paragraph";
225
+ const Subordinate = _ref9 => {
218
226
  let {
219
227
  ariaDescribedBy,
220
228
  ariaLabel,
221
229
  ariaLabelledBy,
222
230
  children,
223
- classes,
224
231
  color,
225
- component
232
+ component,
233
+ testId
226
234
  } = _ref9;
227
235
  return _jsx(Typography, {
228
236
  ariaDescribedBy: ariaDescribedBy,
229
237
  ariaLabel: ariaLabel,
230
238
  ariaLabelledBy: ariaLabelledBy,
231
239
  children: children,
232
- classes: classes,
233
240
  color: color,
234
241
  component: component,
242
+ "data-se": testId,
235
243
  variant: "subordinate"
236
244
  });
237
245
  };
238
- Subordinate.displayName = "Subordinate";
239
- export const Support = _ref10 => {
246
+ const MemoizedSubordinate = memo(Subordinate);
247
+ MemoizedSubordinate.displayName = "Subordinate";
248
+ const Support = _ref10 => {
240
249
  let {
241
250
  ariaDescribedBy,
242
251
  ariaLabel,
243
252
  ariaLabelledBy,
244
253
  children,
245
- classes,
246
254
  color,
247
- component
255
+ component,
256
+ testId
248
257
  } = _ref10;
249
258
  return _jsx(Typography, {
250
259
  ariaDescribedBy: ariaDescribedBy,
251
260
  ariaLabel: ariaLabel,
252
261
  ariaLabelledBy: ariaLabelledBy,
253
262
  children: children,
254
- classes: classes,
255
263
  color: color,
256
264
  component: component,
265
+ "data-se": testId,
257
266
  variant: "support"
258
267
  });
259
268
  };
260
- Support.displayName = "Support";
261
- export const Legend = _ref11 => {
269
+ const MemoizedSupport = memo(Support);
270
+ MemoizedSupport.displayName = "Support";
271
+ const Legend = _ref11 => {
262
272
  let {
263
273
  ariaDescribedBy,
264
274
  ariaLabel,
265
275
  ariaLabelledBy,
266
276
  children,
267
- classes,
268
277
  color,
269
- component
278
+ component,
279
+ testId
270
280
  } = _ref11;
271
281
  return _jsx(Typography, {
272
282
  ariaDescribedBy: ariaDescribedBy,
273
283
  ariaLabel: ariaLabel,
274
284
  ariaLabelledBy: ariaLabelledBy,
275
285
  children: children,
276
- classes: classes,
277
286
  color: color,
278
287
  component: component,
288
+ "data-se": testId,
279
289
  variant: "legend"
280
290
  });
281
291
  };
282
- Legend.displayName = "Legend";
292
+ const MemoizedLegend = memo(Legend);
293
+ MemoizedLegend.displayName = "Legend";
294
+ export { MemoizedTypography as Typography, MemoizedHeading1 as Heading1, MemoizedHeading2 as Heading2, MemoizedHeading3 as Heading3, MemoizedHeading4 as Heading4, MemoizedHeading5 as Heading5, MemoizedHeading6 as Heading6, MemoizedLegend as Legend, MemoizedParagraph as Paragraph, MemoizedSubordinate as Subordinate, MemoizedSupport as Support };
283
295
  //# sourceMappingURL=Typography.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Typography.js","names":["useMemo","jsx","_jsx","typographyVariantMapping","h1","h2","h3","h4","h5","h6","body","subordinate","support","legend","typographyColorValues","Typography","_ref","ariaDescribedBy","ariaLabel","ariaLabelledBy","children","classes","color","component","componentProp","variant","_Typography","displayName","Heading1","_ref2","Heading2","_ref3","Heading3","_ref4","Heading4","_ref5","Heading5","_ref6","Heading6","_ref7","Paragraph","_ref8","Subordinate","_ref9","Support","_ref10","Legend","_ref11"],"sources":["../src/Typography.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n Typography as MuiTypography,\n TypographyProps as MuiTypographyProps,\n} from \"@mui/material\";\nimport { ElementType, ReactNode, useMemo } from \"react\";\n\nexport type TypographyVariantValue =\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"body\"\n | \"subordinate\"\n | \"support\"\n | \"legend\";\n\nexport const typographyVariantMapping: Record<\n TypographyVariantValue,\n MuiTypographyProps[\"variant\"]\n> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n h6: \"h6\",\n body: \"body1\",\n subordinate: \"subtitle1\",\n support: \"subtitle2\",\n legend: \"legend\",\n} as const;\n\nexport const typographyColorValues = [\n \"primary\",\n \"textPrimary\",\n \"secondary\",\n \"textSecondary\",\n \"error\",\n] as const;\n\nexport type TypographyProps = {\n /**\n * The ID of the element that describes the component.\n */\n ariaDescribedBy?: string;\n /**\n * The ARIA label for the component.\n */\n ariaLabel?: string;\n /**\n * The ID of the element that labels the component.\n */\n ariaLabelledBy?: string;\n /**\n * The text content of the component.\n */\n children: ReactNode;\n /**\n * Additional classes to add to the component.\n */\n classes?: object;\n /**\n * The color of the text.\n */\n color?: (typeof typographyColorValues)[number];\n /**\n * The HTML element the component should render, if different from the default.\n */\n component?: ElementType;\n /**\n * The variant of Typography to render.\n */\n variant?: keyof typeof typographyVariantMapping;\n};\n\nexport const Typography = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n classes,\n color,\n component: componentProp,\n variant = \"body\",\n}: TypographyProps) => {\n const component = useMemo(() => {\n if (!componentProp) {\n if (variant === \"body\") {\n return \"p\";\n } else if (variant === \"subordinate\" || variant === \"support\") {\n return \"h6\";\n } else {\n return variant;\n }\n }\n return componentProp;\n }, [componentProp, variant]);\n\n return (\n <MuiTypography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n classes={classes}\n color={color}\n component={component}\n variant={typographyVariantMapping[variant]}\n />\n );\n};\n\nTypography.displayName = \"Typography\";\n\nexport const Heading1 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n classes,\n color,\n component,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n classes={classes}\n color={color}\n component={component}\n variant=\"h1\"\n />\n);\n\nHeading1.displayName = \"Heading1\";\n\nexport const Heading2 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n classes,\n color,\n component,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n classes={classes}\n color={color}\n component={component}\n variant=\"h2\"\n />\n);\n\nHeading2.displayName = \"Heading2\";\n\nexport const Heading3 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n classes,\n color,\n component,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n classes={classes}\n color={color}\n component={component}\n variant=\"h3\"\n />\n);\n\nHeading3.displayName = \"Heading3\";\n\nexport const Heading4 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n classes,\n color,\n component,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n classes={classes}\n color={color}\n component={component}\n variant=\"h4\"\n />\n);\n\nHeading4.displayName = \"Heading4\";\n\nexport const Heading5 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n classes,\n color,\n component,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n classes={classes}\n color={color}\n component={component}\n variant=\"h5\"\n />\n);\n\nHeading5.displayName = \"Heading5\";\n\nexport const Heading6 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n classes,\n color,\n component,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n classes={classes}\n color={color}\n component={component}\n variant=\"h6\"\n />\n);\n\nHeading6.displayName = \"Heading6\";\n\nexport const Paragraph = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n classes,\n color,\n component,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n classes={classes}\n color={color}\n component={component}\n variant=\"body\"\n />\n);\n\nParagraph.displayName = \"Paragraph\";\n\nexport const Subordinate = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n classes,\n color,\n component,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n classes={classes}\n color={color}\n component={component}\n variant=\"subordinate\"\n />\n);\n\nSubordinate.displayName = \"Subordinate\";\n\nexport const Support = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n classes,\n color,\n component,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n classes={classes}\n color={color}\n component={component}\n variant=\"support\"\n />\n);\n\nSupport.displayName = \"Support\";\n\nexport const Legend = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n classes,\n color,\n component,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n classes={classes}\n color={color}\n component={component}\n variant=\"legend\"\n />\n);\n\nLegend.displayName = \"Legend\";\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,SAAiCA,OAAO,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAcxD,OAAO,MAAMC,wBAGZ,GAAG;EACFC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,IAAI,EAAE,OAAO;EACbC,WAAW,EAAE,WAAW;EACxBC,OAAO,EAAE,WAAW;EACpBC,MAAM,EAAE;AACV,CAAU;AAEV,OAAO,MAAMC,qBAAqB,GAAG,CACnC,SAAS,EACT,aAAa,EACb,WAAW,EACX,eAAe,EACf,OAAO,CACC;AAqCV,OAAO,MAAMC,UAAU,GAAGC,IAAA,IASH;EAAA,IATI;IACzBC,eAAe;IACfC,SAAS;IACTC,cAAc;IACdC,QAAQ;IACRC,OAAO;IACPC,KAAK;IACLC,SAAS,EAAEC,aAAa;IACxBC,OAAO,GAAG;EACK,CAAC,GAAAT,IAAA;EAChB,MAAMO,SAAS,GAAGvB,OAAO,CAAC,MAAM;IAC9B,IAAI,CAACwB,aAAa,EAAE;MAClB,IAAIC,OAAO,KAAK,MAAM,EAAE;QACtB,OAAO,GAAG;MACZ,CAAC,MAAM,IAAIA,OAAO,KAAK,aAAa,IAAIA,OAAO,KAAK,SAAS,EAAE;QAC7D,OAAO,IAAI;MACb,CAAC,MAAM;QACL,OAAOA,OAAO;MAChB;IACF;IACA,OAAOD,aAAa;EACtB,CAAC,EAAE,CAACA,aAAa,EAAEC,OAAO,CAAC,CAAC;EAE5B,OACEvB,IAAA,CAAAwB,WAAA;IACET,eAA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AW,GAAG,QAAQ"}
1
+ {"version":3,"file":"Typography.js","names":["memo","useMemo","jsx","_jsx","typographyVariantMapping","h1","h2","h3","h4","h5","h6","body","subordinate","support","legend","typographyColorValues","Typography","_ref","ariaDescribedBy","ariaLabel","ariaLabelledBy","children","color","component","componentProp","testId","variant","_Typography","MemoizedTypography","displayName","Heading1","_ref2","MemoizedHeading1","Heading2","_ref3","MemoizedHeading2","Heading3","_ref4","MemoizedHeading3","Heading4","_ref5","MemoizedHeading4","Heading5","_ref6","MemoizedHeading5","Heading6","_ref7","MemoizedHeading6","Paragraph","_ref8","MemoizedParagraph","Subordinate","_ref9","MemoizedSubordinate","Support","_ref10","MemoizedSupport","Legend","_ref11","MemoizedLegend"],"sources":["../src/Typography.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n Typography as MuiTypography,\n TypographyProps as MuiTypographyProps,\n} from \"@mui/material\";\nimport { ElementType, ReactNode, memo, useMemo } from \"react\";\nimport { SeleniumProps } from \"./SeleniumProps\";\n\nexport type TypographyVariantValue =\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"body\"\n | \"subordinate\"\n | \"support\"\n | \"legend\";\n\nexport const typographyVariantMapping: Record<\n TypographyVariantValue,\n MuiTypographyProps[\"variant\"]\n> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n h6: \"h6\",\n body: \"body1\",\n subordinate: \"subtitle1\",\n support: \"subtitle2\",\n legend: \"legend\",\n} as const;\n\nexport const typographyColorValues = [\n \"primary\",\n \"textPrimary\",\n \"secondary\",\n \"textSecondary\",\n \"error\",\n] as const;\n\nexport type TypographyProps = {\n /**\n * The ID of the element that describes the component.\n */\n ariaDescribedBy?: string;\n /**\n * The ARIA label for the component.\n */\n ariaLabel?: string;\n /**\n * The ID of the element that labels the component.\n */\n ariaLabelledBy?: string;\n /**\n * The text content of the component.\n */\n children: ReactNode;\n /**\n * The color of the text.\n */\n color?: (typeof typographyColorValues)[number];\n /**\n * The HTML element the component should render, if different from the default.\n */\n component?: ElementType;\n /**\n * The variant of Typography to render.\n */\n variant?: keyof typeof typographyVariantMapping;\n} & SeleniumProps;\n\nconst Typography = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component: componentProp,\n testId,\n variant = \"body\",\n}: TypographyProps) => {\n const component = useMemo(() => {\n if (!componentProp) {\n if (variant === \"body\") {\n return \"p\";\n } else if (variant === \"subordinate\" || variant === \"support\") {\n return \"p\";\n } else {\n return variant;\n }\n }\n return componentProp;\n }, [componentProp, variant]);\n\n return (\n <MuiTypography\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant={typographyVariantMapping[variant]}\n />\n );\n};\n\nconst MemoizedTypography = memo(Typography);\nMemoizedTypography.displayName = \"Typography\";\n\nconst Heading1 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h1\"\n />\n);\n\nconst MemoizedHeading1 = memo(Heading1);\nMemoizedHeading1.displayName = \"Heading1\";\n\nconst Heading2 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h2\"\n />\n);\n\nconst MemoizedHeading2 = memo(Heading2);\nMemoizedHeading2.displayName = \"Heading2\";\n\nconst Heading3 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h3\"\n />\n);\n\nconst MemoizedHeading3 = memo(Heading3);\nMemoizedHeading3.displayName = \"Heading3\";\n\nconst Heading4 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h4\"\n />\n);\n\nconst MemoizedHeading4 = memo(Heading4);\nMemoizedHeading4.displayName = \"Heading4\";\n\nconst Heading5 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h5\"\n />\n);\n\nconst MemoizedHeading5 = memo(Heading5);\nMemoizedHeading5.displayName = \"Heading5\";\n\nconst Heading6 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h6\"\n />\n);\n\nconst MemoizedHeading6 = memo(Heading6);\nMemoizedHeading6.displayName = \"Heading6\";\n\nconst Paragraph = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"body\"\n />\n);\n\nconst MemoizedParagraph = memo(Paragraph);\nMemoizedParagraph.displayName = \"Paragraph\";\n\nconst Subordinate = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"subordinate\"\n />\n);\n\nconst MemoizedSubordinate = memo(Subordinate);\nMemoizedSubordinate.displayName = \"Subordinate\";\n\nconst Support = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"support\"\n />\n);\n\nconst MemoizedSupport = memo(Support);\nMemoizedSupport.displayName = \"Support\";\n\nconst Legend = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"legend\"\n />\n);\n\nconst MemoizedLegend = memo(Legend);\nMemoizedLegend.displayName = \"Legend\";\n\nexport {\n MemoizedTypography as Typography,\n MemoizedHeading1 as Heading1,\n MemoizedHeading2 as Heading2,\n MemoizedHeading3 as Heading3,\n MemoizedHeading4 as Heading4,\n MemoizedHeading5 as Heading5,\n MemoizedHeading6 as Heading6,\n MemoizedLegend as Legend,\n MemoizedParagraph as Paragraph,\n MemoizedSubordinate as Subordinate,\n MemoizedSupport as Support,\n};\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,SAAiCA,IAAI,EAAEC,OAAO,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAe9D,OAAO,MAAMC,wBAGZ,GAAG;EACFC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,IAAI,EAAE,OAAO;EACbC,WAAW,EAAE,WAAW;EACxBC,OAAO,EAAE,WAAW;EACpBC,MAAM,EAAE;AACV,CAAU;AAEV,OAAO,MAAMC,qBAAqB,GAAG,CACnC,SAAS,EACT,aAAa,EACb,WAAW,EACX,eAAe,EACf,OAAO,CACC;AAiCV,MAAMC,UAAU,GAAGC,IAAA,IASI;EAAA,IATH;IAClBC,eAAe;IACfC,SAAS;IACTC,cAAc;IACdC,QAAQ;IACRC,KAAK;IACLC,SAAS,EAAEC,aAAa;IACxBC,MAAM;IACNC,OAAO,GAAG;EACK,CAAC,GAAAT,IAAA;EAChB,MAAMM,SAAS,GAAGtB,OAAO,CAAC,MAAM;IAC9B,IAAI,CAACuB,aAAa,EAAE;MAClB,IAAIE,OAAO,KAAK,MAAM,EAAE;QACtB,OAAO,GAAG;MACZ,CAAC,MAAM,IAAIA,OAAO,KAAK,aAAa,IAAIA,OAAO,KAAK,SAAS,EAAE;QAC7D,OAAO,GAAG;MACZ,CAAC,MAAM;QACL,OAAOA,OAAO;MA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B,eAAe,GAAGxD,IAAI,CAACsD,OAAO,CAAC;AACrCE,eAAe,CAAC3B,WAAW,GAAG,SAAS;AAEvC,MAAM4B,MAAM,GAAGC,MAAA;EAAA,IAAC;IACdxC,eAAe;IACfC,SAAS;IACTC,cAAc;IACdC,QAAQ;IACRC,KAAK;IACLC,SAAS;IACTE;EACe,CAAC,GAAAiC,MAAA;EAAA,OAChBvD,IAAA,CAACa,UAAU;IACTE,eAAe,EAAEA,eAAgB;IACjCC,SAAS,EAAEA,SAAU;IACrBC,cAAc,EAAEA,cAAe;IAC/BC,QAAQ,EAAEA,QAAS;IACnBC,KAAK,EAAEA,KAAM;IACbC,SAAS,EAAEA,SAAU;IACrB,WAASE,MAAO;IAChBC,OAAO,EAAC;EAAQ,CACjB,CAAC;AAAA,CACH;AAED,MAAMiC,cAAc,GAAG3D,IAAI,CAACyD,MAAM,CAAC;AACnCE,cAAc,CAAC9B,WAAW,GAAG,QAAQ;AAErC,SACED,kBAAkB,IAAIZ,UAAU,EAChCgB,gBAAgB,IAAIF,QAAQ,EAC5BK,gBAAgB,IAAIF,QAAQ,EAC5BK,gBAAgB,IAAIF,QAAQ,EAC5BK,gBAAgB,IAAIF,QAAQ,EAC5BK,gBAAgB,IAAIF,QAAQ,EAC5BK,gBAAgB,IAAIF,QAAQ,EAC5Bc,cAAc,IAAIF,MAAM,EACxBP,iBAAiB,IAAIF,SAAS,EAC9BK,mBAAmB,IAAIF,WAAW,EAClCK,eAAe,IAAIF,OAAO"}
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * Copyright (c) 2023-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
+ export const createShadowDom = containerElement => {
14
+ const shadowContainer = containerElement.attachShadow({
15
+ mode: "open"
16
+ });
17
+ const emotionRootElement = document.createElement("style");
18
+ const shadowRootElement = document.createElement("div");
19
+ shadowContainer.appendChild(emotionRootElement);
20
+ shadowContainer.appendChild(shadowRootElement);
21
+ return {
22
+ emotionRootElement,
23
+ shadowRootElement
24
+ };
25
+ };
26
+ //# sourceMappingURL=createShadowDom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createShadowDom.js","names":["createShadowDom","containerElement","shadowContainer","attachShadow","mode","emotionRootElement","document","createElement","shadowRootElement","appendChild"],"sources":["../src/createShadowDom.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport const createShadowDom = (containerElement: HTMLElement) => {\n const shadowContainer = containerElement.attachShadow({ mode: \"open\" });\n const emotionRootElement = document.createElement(\"style\");\n const shadowRootElement = document.createElement(\"div\");\n\n shadowContainer.appendChild(emotionRootElement);\n shadowContainer.appendChild(shadowRootElement);\n\n return {\n emotionRootElement,\n shadowRootElement,\n };\n};\n\n// --DOCS--\n\n// const {\n// emotionRootElement,\n// shadowRootElement,\n// } = (\n// createShadowDom(\n// document.querySelector('#root') as HTMLElement\n// )\n// )\n\n// ReactDOM\n// .createRoot(\n// shadowRootElement\n// )\n// .render(\n// <OdysseyProvider emotionRootElement={emotionRootElement} shadowRootElement={shadowRootElement}>\n// <App />\n// </OdysseyProvider>\n// )\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,eAAe,GAAIC,gBAA6B,IAAK;EAChE,MAAMC,eAAe,GAAGD,gBAAgB,CAACE,YAAY,CAAC;IAAEC,IAAI,EAAE;EAAO,CAAC,CAAC;EACvE,MAAMC,kBAAkB,GAAGC,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;EAC1D,MAAMC,iBAAiB,GAAGF,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAEvDL,eAAe,CAACO,WAAW,CAACJ,kBAAkB,CAAC;EAC/CH,eAAe,CAACO,WAAW,CAACD,iBAAiB,CAAC;EAE9C,OAAO;IACLH,kBAAkB;IAClBG;EACF,CAAC;AACH,CAAC"}
@@ -38,6 +38,7 @@ import { translation as sv } from "./properties/ts/odyssey-react-mui_sv.js";
38
38
  import { translation as th } from "./properties/ts/odyssey-react-mui_th.js";
39
39
  import { translation as tr } from "./properties/ts/odyssey-react-mui_tr.js";
40
40
  import { translation as uk } from "./properties/ts/odyssey-react-mui_uk.js";
41
+ import { translation as vi } from "./properties/ts/odyssey-react-mui_vi.js";
41
42
  import { translation as zhCN } from "./properties/ts/odyssey-react-mui_zh_CN.js";
42
43
  import { translation as znTW } from "./properties/ts/odyssey-react-mui_zh_TW.js";
43
44
  import { supportedLanguages } from "./OdysseyTranslationProvider.types.js";
@@ -70,6 +71,7 @@ export const resources = {
70
71
  th,
71
72
  tr,
72
73
  uk,
74
+ vi,
73
75
  zh_CN: zhCN,
74
76
  zh_TW: znTW
75
77
  };
@@ -93,5 +95,6 @@ Object.entries(resources).forEach(_ref => {
93
95
  let [locale, property] = _ref;
94
96
  i18n.addResourceBundle(locale, defaultNS, property);
95
97
  });
96
- export default i18n;
97
- //# sourceMappingURL=OdysseyI18n.js.map
98
+ export const odysseyTranslate = i18n.t.bind(i18n);
99
+ export { i18n };
100
+ //# sourceMappingURL=i18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.js","names":["i18n","initReactI18next","translation","cs","da","de","el","en","es","fi","fr","hu","id","it","ja","ko","ms","nb","nlNL","okPL","okSK","pl","ptBR","ro","ru","sv","th","tr","uk","vi","zhCN","znTW","supportedLanguages","defaultLNG","defaultNS","resources","nl_NL","ok_PL","ok_SK","pt_BR","zh_CN","zh_TW","use","init","ns","fallbackLng","supportedLngs","load","keySeparator","interpolation","escapeValue","skipOnVariables","react","useSuspense","bindI18nStore","Object","entries","forEach","_ref","locale","property","addResourceBundle","odysseyTranslate","t","bind"],"sources":["../src/i18n.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport i18n from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\n\nimport { translation as cs } from \"./properties/ts/odyssey-react-mui_cs\";\nimport { translation as da } from \"./properties/ts/odyssey-react-mui_da\";\nimport { translation as de } from \"./properties/ts/odyssey-react-mui_de\";\nimport { translation as el } from \"./properties/ts/odyssey-react-mui_el\";\nimport { translation as en } from \"./properties/ts/odyssey-react-mui\";\nimport { translation as es } from \"./properties/ts/odyssey-react-mui_es\";\nimport { translation as fi } from \"./properties/ts/odyssey-react-mui_fi\";\nimport { translation as fr } from \"./properties/ts/odyssey-react-mui_fr\";\nimport { translation as hu } from \"./properties/ts/odyssey-react-mui_hu\";\nimport { translation as id } from \"./properties/ts/odyssey-react-mui_id\";\nimport { translation as it } from \"./properties/ts/odyssey-react-mui_it\";\nimport { translation as ja } from \"./properties/ts/odyssey-react-mui_ja\";\nimport { translation as ko } from \"./properties/ts/odyssey-react-mui_ko\";\nimport { translation as ms } from \"./properties/ts/odyssey-react-mui_ms\";\nimport { translation as nb } from \"./properties/ts/odyssey-react-mui_nb\";\nimport { translation as nlNL } from \"./properties/ts/odyssey-react-mui_nl_NL\";\nimport { translation as okPL } from \"./properties/ts/odyssey-react-mui_ok_PL\";\nimport { translation as okSK } from \"./properties/ts/odyssey-react-mui_ok_SK\";\nimport { translation as pl } from \"./properties/ts/odyssey-react-mui_pl\";\nimport { translation as ptBR } from \"./properties/ts/odyssey-react-mui_pt_BR\";\nimport { translation as ro } from \"./properties/ts/odyssey-react-mui_ro\";\nimport { translation as ru } from \"./properties/ts/odyssey-react-mui_ru\";\nimport { translation as sv } from \"./properties/ts/odyssey-react-mui_sv\";\nimport { translation as th } from \"./properties/ts/odyssey-react-mui_th\";\nimport { translation as tr } from \"./properties/ts/odyssey-react-mui_tr\";\nimport { translation as uk } from \"./properties/ts/odyssey-react-mui_uk\";\nimport { translation as vi } from \"./properties/ts/odyssey-react-mui_vi\";\nimport { translation as zhCN } from \"./properties/ts/odyssey-react-mui_zh_CN\";\nimport { translation as znTW } from \"./properties/ts/odyssey-react-mui_zh_TW\";\n\nimport {\n SupportedLanguages,\n supportedLanguages,\n} from \"./OdysseyTranslationProvider.types\";\n\nexport const defaultLNG: SupportedLanguages = \"en\";\nexport const defaultNS = \"translations\";\nexport const resources = {\n cs,\n da,\n de,\n el,\n en,\n es,\n fi,\n fr,\n hu,\n id,\n it,\n ja,\n ko,\n ms,\n nb,\n nl_NL: nlNL,\n ok_PL: okPL,\n ok_SK: okSK,\n pl,\n pt_BR: ptBR,\n ro,\n ru,\n sv,\n th,\n tr,\n uk,\n vi,\n zh_CN: zhCN,\n zh_TW: znTW,\n};\n\ni18n.use(initReactI18next).init({\n defaultNS,\n ns: [defaultNS],\n fallbackLng: defaultLNG,\n supportedLngs: supportedLanguages,\n load: \"currentOnly\",\n keySeparator: false,\n interpolation: {\n escapeValue: false, // react already safe from xss\n skipOnVariables: false, // to handle translations that use nesting\n },\n react: {\n useSuspense: false,\n bindI18nStore: \"added\",\n },\n});\n\nObject.entries(resources).forEach(([locale, property]) => {\n i18n.addResourceBundle(locale, defaultNS, property);\n});\n\nexport const odysseyTranslate = i18n.t.bind(i18n);\nexport { i18n };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,SAAS;AAC1B,SAASC,gBAAgB,QAAQ,eAAe;AAAC,SAExCC,WAAW,IAAIC,EAAE;AAAA,SACjBD,WAAW,IAAIE,EAAE;AAAA,SACjBF,WAAW,IAAIG,EAAE;AAAA,SACjBH,WAAW,IAAII,EAAE;AAAA,SACjBJ,WAAW,IAAIK,EAAE;AAAA,SACjBL,WAAW,IAAIM,EAAE;AAAA,SACjBN,WAAW,IAAIO,EAAE;AAAA,SACjBP,WAAW,IAAIQ,EAAE;AAAA,SACjBR,WAAW,IAAIS,EAAE;AAAA,SACjBT,WAAW,IAAIU,EAAE;AAAA,SACjBV,WAAW,IAAIW,EAAE;AAAA,SACjBX,WAAW,IAAIY,EAAE;AAAA,SACjBZ,WAAW,IAAIa,EAAE;AAAA,SACjBb,WAAW,IAAIc,EAAE;AAAA,SACjBd,WAAW,IAAIe,EAAE;AAAA,SACjBf,WAAW,IAAIgB,IAAI;AAAA,SACnBhB,WAAW,IAAIiB,IAAI;AAAA,SACnBjB,WAAW,IAAIkB,IAAI;AAAA,SACnBlB,WAAW,IAAImB,EAAE;AAAA,SACjBnB,WAAW,IAAIoB,IAAI;AAAA,SACnBpB,WAAW,IAAIqB,EAAE;AAAA,SACjBrB,WAAW,IAAIsB,EAAE;AAAA,SACjBtB,WAAW,IAAIuB,EAAE;AAAA,SACjBvB,WAAW,IAAIwB,EAAE;AAAA,SACjBxB,WAAW,IAAIyB,EAAE;AAAA,SACjBzB,WAAW,IAAI0B,EAAE;AAAA,SACjB1B,WAAW,IAAI2B,EAAE;AAAA,SACjB3B,WAAW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AC,CAAC;AAEF,OAAO,MAAME,gBAAgB,GAAG9D,IAAI,CAAC+D,CAAC,CAACC,IAAI,CAAChE,IAAI,CAAC;AACjD,SAASA,IAAI"}
package/dist/index.js CHANGED
@@ -31,6 +31,7 @@ export * from "./MenuItem.js";
31
31
  export * from "./NativeSelect.js";
32
32
  export * from "./NullElement.js";
33
33
  export * from "./OdysseyCacheProvider.js";
34
+ export { odysseyTranslate } from "./i18n.js";
34
35
  export * from "./OdysseyProvider.js";
35
36
  export * from "./OdysseyThemeProvider.js";
36
37
  export * from "./OdysseyTranslationProvider.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["deepmerge","visuallyHidden","createTheme","CssBaseline","DialogContentText","Divider","InputAdornment","InputBase","ListItemIcon","ListItemText","ListSubheader","MenuList","Paper","ScopedCssBaseline","ThemeProvider","useOdysseyDesignTokens"],"sources":["../src/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport { deepmerge, visuallyHidden } from \"@mui/utils\";\n\nexport {\n createTheme,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n CssBaseline,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n DialogContentText,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n Divider,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n InputAdornment,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n InputBase,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListItemIcon,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListItemText,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListSubheader,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n MenuList,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n Paper,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ScopedCssBaseline,\n ThemeProvider,\n} from \"@mui/material\";\n\nexport type {\n CssBaselineProps,\n DialogContentTextProps,\n DividerProps,\n InputAdornmentProps,\n InputBaseProps,\n ListItemIconProps,\n ListItemTextProps,\n ListSubheaderProps,\n MenuListProps,\n PaperProps,\n ScopedCssBaselineProps,\n ThemeOptions,\n} from \"@mui/material\";\n\nexport { useOdysseyDesignTokens } from \"./OdysseyDesignTokensContext\";\n\nexport * from \"./Autocomplete\";\nexport * from \"./Banner\";\nexport * from \"./Box\";\nexport * from \"./Button\";\nexport * from \"./Callout\";\nexport * from \"./Checkbox\";\nexport * from \"./CheckboxGroup\";\nexport * from \"./CircularProgress\";\nexport * from \"./createUniqueId\";\nexport * from \"./Dialog\";\nexport * from \"./Fieldset\";\nexport * from \"./Form\";\nexport * from \"./Link\";\nexport * from \"./MenuButton\";\nexport * from \"./MenuItem\";\nexport * from \"./NativeSelect\";\nexport * from \"./NullElement\";\nexport * from \"./OdysseyCacheProvider\";\nexport * from \"./OdysseyProvider\";\nexport * from \"./OdysseyThemeProvider\";\nexport * from \"./OdysseyTranslationProvider\";\nexport * from \"./PasswordField\";\nexport * from \"./Radio\";\nexport * from \"./RadioGroup\";\nexport * from \"./ScreenReaderText\";\nexport * from \"./SearchField\";\nexport * from \"./Select\";\nexport * from \"./Status\";\nexport * from \"./Tabs\";\nexport * from \"./Tag\";\nexport * from \"./TagList\";\nexport * from \"./TextField\";\nexport * from \"./theme\";\nexport * from \"./Toast\";\nexport * from \"./ToastStack\";\nexport * from \"./Tooltip\";\nexport * from \"./Typography\";\nexport * from \"./useUniqueId\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,cAAc,QAAQ,YAAY;AAEtD,SACEC,WAAW,EAEXC,WAAW,EAEXC,iBAAiB,EAEjBC,OAAO,EAEPC,cAAc,EAEdC,SAAS,EAETC,YAAY,EAEZC,YAAY,EAEZC,aAAa,EAEbC,QAAQ,EAERC,KAAK,EAELC,iBAAiB,EACjBC,aAAa,QACR,eAAe;AAAC,SAiBdC,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":["deepmerge","visuallyHidden","createTheme","CssBaseline","DialogContentText","Divider","InputAdornment","InputBase","ListItemIcon","ListItemText","ListSubheader","MenuList","Paper","ScopedCssBaseline","ThemeProvider","useOdysseyDesignTokens","odysseyTranslate"],"sources":["../src/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport { deepmerge, visuallyHidden } from \"@mui/utils\";\n\nexport {\n createTheme,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n CssBaseline,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n DialogContentText,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n Divider,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n InputAdornment,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n InputBase,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListItemIcon,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListItemText,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListSubheader,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n MenuList,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n Paper,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ScopedCssBaseline,\n ThemeProvider,\n} from \"@mui/material\";\n\nexport type {\n CssBaselineProps,\n DialogContentTextProps,\n DividerProps,\n InputAdornmentProps,\n InputBaseProps,\n ListItemIconProps,\n ListItemTextProps,\n ListSubheaderProps,\n MenuListProps,\n PaperProps,\n ScopedCssBaselineProps,\n ThemeOptions,\n} from \"@mui/material\";\n\nexport { useOdysseyDesignTokens } from \"./OdysseyDesignTokensContext\";\n\nexport * from \"./Autocomplete\";\nexport * from \"./Banner\";\nexport * from \"./Box\";\nexport * from \"./Button\";\nexport * from \"./Callout\";\nexport * from \"./Checkbox\";\nexport * from \"./CheckboxGroup\";\nexport * from \"./CircularProgress\";\nexport * from \"./createUniqueId\";\nexport * from \"./Dialog\";\nexport * from \"./Fieldset\";\nexport * from \"./Form\";\nexport * from \"./Link\";\nexport * from \"./MenuButton\";\nexport * from \"./MenuItem\";\nexport * from \"./NativeSelect\";\nexport * from \"./NullElement\";\nexport * from \"./OdysseyCacheProvider\";\nexport { odysseyTranslate } from \"./i18n\";\nexport * from \"./OdysseyProvider\";\nexport * from \"./OdysseyThemeProvider\";\nexport * from \"./OdysseyTranslationProvider\";\nexport * from \"./PasswordField\";\nexport * from \"./Radio\";\nexport * from \"./RadioGroup\";\nexport * from \"./ScreenReaderText\";\nexport * from \"./SearchField\";\nexport * from \"./Select\";\nexport * from \"./Status\";\nexport * from \"./Tabs\";\nexport * from \"./Tag\";\nexport * from \"./TagList\";\nexport * from \"./TextField\";\nexport * from \"./theme\";\nexport * from \"./Toast\";\nexport * from \"./ToastStack\";\nexport * from \"./Tooltip\";\nexport * from \"./Typography\";\nexport * from \"./useUniqueId\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,cAAc,QAAQ,YAAY;AAEtD,SACEC,WAAW,EAEXC,WAAW,EAEXC,iBAAiB,EAEjBC,OAAO,EAEPC,cAAc,EAEdC,SAAS,EAETC,YAAY,EAEZC,YAAY,EAEZC,aAAa,EAEbC,QAAQ,EAERC,KAAK,EAELC,iBAAiB,EACjBC,aAAa,QACR,eAAe;AAAC,SAiBdC,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAoBtBC,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
@@ -16,6 +16,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
16
16
  export const DatePicker = _ref => {
17
17
  let {
18
18
  label,
19
+ isOptional = false,
19
20
  onChange,
20
21
  value = null
21
22
  } = _ref;
@@ -29,9 +30,10 @@ export const DatePicker = _ref => {
29
30
  ...props
30
31
  };
31
32
  return _jsx(_InputBase, {
32
- ...combinedProps
33
+ ...combinedProps,
34
+ required: !isOptional
33
35
  });
34
- }, []);
36
+ }, [isOptional]);
35
37
  return _jsx(MuiDatePicker, {
36
38
  label: label,
37
39
  onChange: onChange,
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.js","names":["DatePicker","MuiDatePicker","useCallback","jsx","_jsx","_ref","label","onChange","value","renderInput","_ref2","InputProps","props","combinedProps","_InputBase"],"sources":["../../src/labs/DatePicker.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { InputBase } from \"@mui/material\";\nimport {\n DatePicker as MuiDatePicker,\n DatePickerProps as MuiDatePickerProps,\n} from \"@mui/x-date-pickers\";\nimport { useCallback } from \"react\";\n\nexport type DatePickerProps<TInputDate, TDate> = {\n label: MuiDatePickerProps<TInputDate, TDate>[\"label\"];\n onChange: MuiDatePickerProps<TInputDate, TDate>[\"onChange\"];\n value: MuiDatePickerProps<TInputDate, TDate>[\"value\"];\n};\n\nexport const DatePicker = <TInputDate, TDate>({\n label,\n onChange,\n value = null,\n}: DatePickerProps<TInputDate, TDate>) => {\n const renderInput = useCallback(({ InputProps, ...props }) => {\n const combinedProps = {\n ...InputProps,\n ...props,\n };\n\n return <InputBase {...combinedProps} />;\n }, []);\n\n return (\n <MuiDatePicker\n label={label}\n onChange={onChange}\n renderInput={renderInput}\n value={value}\n />\n );\n};\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SACEA,UAAU,IAAIC,aAAa,QAEtB,qBAAqB;AAC5B,SAASC,WAAW,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQpC,OAAO,MAAMJ,UAAU,GAAGK,IAAA,IAIgB;EAAA,IAJI;IAC5CC,KAAK;IACLC,QAAQ;IACRC,KAAK,GAAG;EAC0B,CAAC,GAAAH,IAAA;EACnC,MAAMI,WAAW,GAAGP,WAAW,CAACQ,KAAA,IAA8B;IAAA,IAA7B;MAAEC,UAAU;MAAE,GAAGC;IAAM,CAAC,GAAAF,KAAA;IACvD,MAAMG,aAAa,GAAG;MACpB,GAAGF,UAAU;MACb,GAAGC;IACL,CAAC;IAED,OAAOR,IAAA,CAAAU,UAAA;MAAA,GAAeD;IAAa,CAAG,CAAC;EACzC,CAAC,EAAE,EAAE,CAAC;EAEN,OACET,IAAA,CAACH,aAAa;IACZK,KAAK,EAAEA,KAAM;IACbC,QAAQ,EAAEA,QAAS;IACnBE,WAAW,EAAEA,WAAY;IACzBD,KAAK,EAAEA;EAAM,CACd,CAAC;AAEN,CAAC"}
1
+ {"version":3,"file":"DatePicker.js","names":["DatePicker","MuiDatePicker","useCallback","jsx","_jsx","_ref","label","isOptional","onChange","value","renderInput","_ref2","InputProps","props","combinedProps","_InputBase","required"],"sources":["../../src/labs/DatePicker.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { InputBase } from \"@mui/material\";\nimport {\n DatePicker as MuiDatePicker,\n DatePickerProps as MuiDatePickerProps,\n} from \"@mui/x-date-pickers\";\nimport { useCallback } from \"react\";\n\nexport type DatePickerProps<TInputDate, TDate> = {\n label: MuiDatePickerProps<TInputDate, TDate>[\"label\"];\n /**\n * If `true`, the `input` element is not required.\n */\n isOptional?: boolean;\n onChange: MuiDatePickerProps<TInputDate, TDate>[\"onChange\"];\n value: MuiDatePickerProps<TInputDate, TDate>[\"value\"];\n};\n\nexport const DatePicker = <TInputDate, TDate>({\n label,\n isOptional = false,\n onChange,\n value = null,\n}: DatePickerProps<TInputDate, TDate>) => {\n const renderInput = useCallback(\n ({ InputProps, ...props }) => {\n const combinedProps = {\n ...InputProps,\n ...props,\n };\n\n return <InputBase {...combinedProps} required={!isOptional} />;\n },\n [isOptional]\n );\n\n return (\n <MuiDatePicker\n label={label}\n onChange={onChange}\n renderInput={renderInput}\n value={value}\n />\n );\n};\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SACEA,UAAU,IAAIC,aAAa,QAEtB,qBAAqB;AAC5B,SAASC,WAAW,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAYpC,OAAO,MAAMJ,UAAU,GAAGK,IAAA,IAKgB;EAAA,IALI;IAC5CC,KAAK;IACLC,UAAU,GAAG,KAAK;IAClBC,QAAQ;IACRC,KAAK,GAAG;EAC0B,CAAC,GAAAJ,IAAA;EACnC,MAAMK,WAAW,GAAGR,WAAW,CAC7BS,KAAA,IAA8B;IAAA,IAA7B;MAAEC,UAAU;MAAE,GAAGC;IAAM,CAAC,GAAAF,KAAA;IACvB,MAAMG,aAAa,GAAG;MACpB,GAAGF,UAAU;MACb,GAAGC;IACL,CAAC;IAED,OAAOT,IAAA,CAAAW,UAAA;MAAA,GAAeD,aAAa;MAAEE,QAAQ,EAAE,CAACT;IAAW,CAAE,CAAC;EAChE,CAAC,EACD,CAACA,UAAU,CACb,CAAC;EAED,OACEH,IAAA,CAACH,aAAa;IACZK,KAAK,EAAEA,KAAM;IACbE,QAAQ,EAAEA,QAAS;IACnBE,WAAW,EAAEA,WAAY;IACzBD,KAAK,EAAEA;EAAM,CACd,CAAC;AAEN,CAAC"}
@@ -39,7 +39,7 @@ const PaginatedTable = _ref => {
39
39
  const [columnFilters, setColumnFilters] = useState([]);
40
40
  const [globalFilter, setGlobalFilter] = useState();
41
41
  useEffect(() => {
42
- if (globalFilter) {
42
+ if (globalFilter !== undefined) {
43
43
  onGlobalFilterChange?.(globalFilter);
44
44
  }
45
45
  }, [globalFilter, onGlobalFilterChange]);
@@ -114,13 +114,15 @@ const PaginatedTable = _ref => {
114
114
  ...initialState
115
115
  }), [initialState, pagination]);
116
116
  const modifiedState = useMemo(() => ({
117
- ...state,
118
117
  pagination: {
119
118
  pageIndex: pagination.pageIndex,
120
119
  pageSize: pagination.pageSize
121
120
  },
122
- rowSelection
123
- }), [pagination.pageIndex, pagination.pageSize, rowSelection, state]);
121
+ rowSelection,
122
+ globalFilter,
123
+ columnFilters,
124
+ ...state
125
+ }), [pagination.pageIndex, pagination.pageSize, rowSelection, globalFilter, columnFilters, state]);
124
126
  const muiToolbarAlertBannerProps = useMemo(() => hasError ? {
125
127
  children: t("table.error"),
126
128
  severity: "error"