@okta/odyssey-react-mui 1.11.1 → 1.12.1

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 (60) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/Autocomplete.js +3 -1
  3. package/dist/Autocomplete.js.map +1 -1
  4. package/dist/CheckboxGroup.js +2 -0
  5. package/dist/CheckboxGroup.js.map +1 -1
  6. package/dist/CircularProgress.js +6 -1
  7. package/dist/CircularProgress.js.map +1 -1
  8. package/dist/Field.js +3 -2
  9. package/dist/Field.js.map +1 -1
  10. package/dist/FieldComponentProps.js.map +1 -1
  11. package/dist/NativeSelect.js +2 -0
  12. package/dist/NativeSelect.js.map +1 -1
  13. package/dist/PasswordField.js +2 -0
  14. package/dist/PasswordField.js.map +1 -1
  15. package/dist/RadioGroup.js +2 -0
  16. package/dist/RadioGroup.js.map +1 -1
  17. package/dist/SearchField.js +2 -0
  18. package/dist/SearchField.js.map +1 -1
  19. package/dist/Select.js +2 -0
  20. package/dist/Select.js.map +1 -1
  21. package/dist/TextField.js +2 -0
  22. package/dist/TextField.js.map +1 -1
  23. package/dist/labs/VirtualizedAutocomplete.js +3 -1
  24. package/dist/labs/VirtualizedAutocomplete.js.map +1 -1
  25. package/dist/src/Autocomplete.d.ts +2 -2
  26. package/dist/src/Autocomplete.d.ts.map +1 -1
  27. package/dist/src/CheckboxGroup.d.ts +2 -2
  28. package/dist/src/CheckboxGroup.d.ts.map +1 -1
  29. package/dist/src/CircularProgress.d.ts +3 -1
  30. package/dist/src/CircularProgress.d.ts.map +1 -1
  31. package/dist/src/Field.d.ts +1 -1
  32. package/dist/src/Field.d.ts.map +1 -1
  33. package/dist/src/FieldComponentProps.d.ts +4 -0
  34. package/dist/src/FieldComponentProps.d.ts.map +1 -1
  35. package/dist/src/NativeSelect.d.ts +1 -1
  36. package/dist/src/NativeSelect.d.ts.map +1 -1
  37. package/dist/src/PasswordField.d.ts.map +1 -1
  38. package/dist/src/RadioGroup.d.ts +2 -2
  39. package/dist/src/RadioGroup.d.ts.map +1 -1
  40. package/dist/src/SearchField.d.ts +2 -2
  41. package/dist/src/SearchField.d.ts.map +1 -1
  42. package/dist/src/Select.d.ts +2 -2
  43. package/dist/src/Select.d.ts.map +1 -1
  44. package/dist/src/TextField.d.ts.map +1 -1
  45. package/dist/src/labs/VirtualizedAutocomplete.d.ts +2 -2
  46. package/dist/src/labs/VirtualizedAutocomplete.d.ts.map +1 -1
  47. package/dist/tsconfig.production.tsbuildinfo +1 -1
  48. package/package.json +3 -3
  49. package/src/Autocomplete.tsx +4 -0
  50. package/src/CheckboxGroup.tsx +3 -0
  51. package/src/CircularProgress.tsx +7 -1
  52. package/src/Field.tsx +8 -4
  53. package/src/FieldComponentProps.ts +4 -0
  54. package/src/NativeSelect.tsx +3 -0
  55. package/src/PasswordField.tsx +2 -0
  56. package/src/RadioGroup.tsx +3 -0
  57. package/src/SearchField.tsx +6 -1
  58. package/src/Select.tsx +3 -0
  59. package/src/TextField.tsx +2 -0
  60. package/src/labs/VirtualizedAutocomplete.tsx +10 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okta/odyssey-react-mui",
3
- "version": "1.11.1",
3
+ "version": "1.12.1",
4
4
  "description": "React MUI components for Odyssey, Okta's design system",
5
5
  "author": "Okta, Inc.",
6
6
  "license": "Apache-2.0",
@@ -51,7 +51,7 @@
51
51
  "@mui/system": "^5.14.9",
52
52
  "@mui/utils": "^5.11.2",
53
53
  "@mui/x-date-pickers": "^5.0.15",
54
- "@okta/odyssey-design-tokens": "1.11.1",
54
+ "@okta/odyssey-design-tokens": "1.12.1",
55
55
  "date-fns": "^2.30.0",
56
56
  "i18next": "^23.5.1",
57
57
  "material-react-table": "^2.0.2",
@@ -63,5 +63,5 @@
63
63
  "react": ">=17 <19",
64
64
  "react-dom": ">=17 <19"
65
65
  },
66
- "gitHead": "3318d342f74b82e7b957bf881007fe0f78556635"
66
+ "gitHead": "87b8df23a19fe7c326cfce67504c61876e046301"
67
67
  }
@@ -161,6 +161,7 @@ export type AutocompleteProps<
161
161
  getIsOptionEqualToValue?: (option: OptionType, value: OptionType) => boolean;
162
162
  } & Pick<
163
163
  FieldComponentProps,
164
+ | "ariaDescribedBy"
164
165
  | "errorMessage"
165
166
  | "errorMessageList"
166
167
  | "hint"
@@ -177,6 +178,7 @@ const Autocomplete = <
177
178
  HasMultipleChoices extends boolean | undefined,
178
179
  IsCustomValueAllowed extends boolean | undefined
179
180
  >({
181
+ ariaDescribedBy,
180
182
  defaultValue,
181
183
  errorMessage,
182
184
  errorMessageList,
@@ -245,6 +247,7 @@ const Autocomplete = <
245
247
  const renderInput = useCallback(
246
248
  ({ InputLabelProps, InputProps, ...params }) => (
247
249
  <Field
250
+ ariaDescribedBy={ariaDescribedBy}
248
251
  errorMessage={errorMessage}
249
252
  errorMessageList={errorMessageList}
250
253
  fieldType="single"
@@ -278,6 +281,7 @@ const Autocomplete = <
278
281
  />
279
282
  ),
280
283
  [
284
+ ariaDescribedBy,
281
285
  errorMessage,
282
286
  errorMessageList,
283
287
  hint,
@@ -35,6 +35,7 @@ export type CheckboxGroupProps = {
35
35
  label: string;
36
36
  } & Pick<
37
37
  FieldComponentProps,
38
+ | "ariaDescribedBy"
38
39
  | "errorMessage"
39
40
  | "errorMessageList"
40
41
  | "hint"
@@ -45,6 +46,7 @@ export type CheckboxGroupProps = {
45
46
  AllowedProps;
46
47
 
47
48
  const CheckboxGroup = ({
49
+ ariaDescribedBy,
48
50
  children,
49
51
  errorMessage,
50
52
  errorMessageList,
@@ -75,6 +77,7 @@ const CheckboxGroup = ({
75
77
 
76
78
  return (
77
79
  <Field
80
+ ariaDescribedBy={ariaDescribedBy}
78
81
  errorMessage={errorMessage}
79
82
  errorMessageList={errorMessageList}
80
83
  fieldType="group"
@@ -10,6 +10,7 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
 
13
+ import { memo } from "react";
13
14
  import { CircularProgress as MuiCircularProgress } from "@mui/material";
14
15
 
15
16
  import type { AllowedProps } from "./AllowedProps";
@@ -26,7 +27,7 @@ export type CircularProgressProps = {
26
27
  value?: number;
27
28
  } & AllowedProps;
28
29
 
29
- export const CircularProgress = ({
30
+ const CircularProgress = ({
30
31
  ariaLabel,
31
32
  testId,
32
33
  value,
@@ -38,3 +39,8 @@ export const CircularProgress = ({
38
39
  aria-label={ariaLabel}
39
40
  />
40
41
  );
42
+
43
+ const MemoizedCircularProgress = memo(CircularProgress);
44
+ MemoizedCircularProgress.displayName = "CircularProgress";
45
+
46
+ export { MemoizedCircularProgress as CircularProgress };
package/src/Field.tsx CHANGED
@@ -80,6 +80,7 @@ export type FieldProps = {
80
80
  };
81
81
 
82
82
  const Field = ({
83
+ ariaDescribedBy,
83
84
  errorMessage,
84
85
  errorMessageList,
85
86
  fieldType,
@@ -96,6 +97,7 @@ const Field = ({
96
97
  }: FieldProps &
97
98
  Pick<
98
99
  FieldComponentProps,
100
+ | "ariaDescribedBy"
99
101
  | "errorMessage"
100
102
  | "errorMessageList"
101
103
  | "hint"
@@ -113,9 +115,11 @@ const Field = ({
113
115
  errorMessage || errorMessageList ? `${id}-error` : undefined;
114
116
  const labelElementId = `${id}-label`;
115
117
 
116
- const ariaDescribedBy = useMemo(
117
- () => [hintId, errorMessageElementId].join(" ").trim() || undefined,
118
- [errorMessageElementId, hintId]
118
+ const localAriaDescribedBy = useMemo(
119
+ () =>
120
+ [hintId, errorMessageElementId, ariaDescribedBy].join(" ").trim() ||
121
+ undefined,
122
+ [ariaDescribedBy, errorMessageElementId, hintId]
119
123
  );
120
124
 
121
125
  const { isDisabled: isFieldsetDisabled } = useFieldset();
@@ -160,7 +164,7 @@ const Field = ({
160
164
  )}
161
165
 
162
166
  {renderFieldComponent({
163
- ariaDescribedBy,
167
+ ariaDescribedBy: localAriaDescribedBy,
164
168
  errorMessageElementId,
165
169
  id,
166
170
  labelElementId,
@@ -15,6 +15,10 @@ import { ReactElement } from "react";
15
15
  import { HintLink } from "./HintLink";
16
16
 
17
17
  export type FieldComponentProps = {
18
+ /**
19
+ * The ID of the element that describes the Field
20
+ */
21
+ ariaDescribedBy?: string;
18
22
  /**
19
23
  * If `error` is not undefined, the `input` will indicate an error.
20
24
  */
@@ -93,6 +93,7 @@ export type NativeSelectProps<
93
93
  value?: Value;
94
94
  } & Pick<
95
95
  FieldComponentProps,
96
+ | "ariaDescribedBy"
96
97
  | "errorMessage"
97
98
  | "errorMessageList"
98
99
  | "hint"
@@ -110,6 +111,7 @@ const NativeSelect: ForwardRefWithType = forwardRef(
110
111
  HasMultipleChoices extends boolean
111
112
  >(
112
113
  {
114
+ ariaDescribedBy,
113
115
  autoCompleteType,
114
116
  defaultValue,
115
117
  errorMessage,
@@ -217,6 +219,7 @@ const NativeSelect: ForwardRefWithType = forwardRef(
217
219
 
218
220
  return (
219
221
  <Field
222
+ ariaDescribedBy={ariaDescribedBy}
220
223
  errorMessage={errorMessage}
221
224
  errorMessageList={errorMessageList}
222
225
  fieldType="single"
@@ -82,6 +82,7 @@ export type PasswordFieldProps = {
82
82
  const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(
83
83
  (
84
84
  {
85
+ ariaDescribedBy,
85
86
  autoCompleteType,
86
87
  defaultValue,
87
88
  errorMessage,
@@ -220,6 +221,7 @@ const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(
220
221
 
221
222
  return (
222
223
  <Field
224
+ ariaDescribedBy={ariaDescribedBy}
223
225
  errorMessage={errorMessage}
224
226
  errorMessageList={errorMessageList}
225
227
  fieldType="single"
@@ -45,6 +45,7 @@ export type RadioGroupProps = {
45
45
  value?: RadioProps["value"];
46
46
  } & Pick<
47
47
  FieldComponentProps,
48
+ | "ariaDescribedBy"
48
49
  | "errorMessage"
49
50
  | "errorMessageList"
50
51
  | "hint"
@@ -56,6 +57,7 @@ export type RadioGroupProps = {
56
57
  AllowedProps;
57
58
 
58
59
  const RadioGroup = ({
60
+ ariaDescribedBy,
59
61
  children,
60
62
  defaultValue,
61
63
  errorMessage,
@@ -107,6 +109,7 @@ const RadioGroup = ({
107
109
 
108
110
  return (
109
111
  <Field
112
+ ariaDescribedBy={ariaDescribedBy}
110
113
  errorMessage={errorMessage}
111
114
  errorMessageList={errorMessageList}
112
115
  fieldType="group"
@@ -78,12 +78,16 @@ export type SearchFieldProps = {
78
78
  * The value of the `input` element, to use when controlled.
79
79
  */
80
80
  value?: string;
81
- } & Pick<FieldComponentProps, "id" | "isDisabled" | "name" | "isFullWidth"> &
81
+ } & Pick<
82
+ FieldComponentProps,
83
+ "ariaDescribedBy" | "id" | "isDisabled" | "name" | "isFullWidth"
84
+ > &
82
85
  AllowedProps;
83
86
 
84
87
  const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(
85
88
  (
86
89
  {
90
+ ariaDescribedBy,
87
91
  autoCompleteType,
88
92
  defaultValue,
89
93
  hasInitialFocus,
@@ -186,6 +190,7 @@ const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(
186
190
 
187
191
  return (
188
192
  <Field
193
+ ariaDescribedBy={ariaDescribedBy}
189
194
  fieldType="single"
190
195
  hasVisibleLabel={false}
191
196
  id={idOverride}
package/src/Select.tsx CHANGED
@@ -97,6 +97,7 @@ export type SelectProps<
97
97
  value?: Value;
98
98
  } & Pick<
99
99
  FieldComponentProps,
100
+ | "ariaDescribedBy"
100
101
  | "errorMessage"
101
102
  | "errorMessageList"
102
103
  | "hint"
@@ -129,6 +130,7 @@ const Select = <
129
130
  Value extends SelectValueType<HasMultipleChoices>,
130
131
  HasMultipleChoices extends boolean
131
132
  >({
133
+ ariaDescribedBy,
132
134
  defaultValue,
133
135
  errorMessage,
134
136
  errorMessageList,
@@ -318,6 +320,7 @@ const Select = <
318
320
 
319
321
  return (
320
322
  <Field
323
+ ariaDescribedBy={ariaDescribedBy}
321
324
  errorMessage={errorMessage}
322
325
  errorMessageList={errorMessageList}
323
326
  fieldType="single"
package/src/TextField.tsx CHANGED
@@ -106,6 +106,7 @@ export type TextFieldProps = {
106
106
  const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
107
107
  (
108
108
  {
109
+ ariaDescribedBy,
109
110
  autoCompleteType,
110
111
  defaultValue,
111
112
  hasInitialFocus,
@@ -237,6 +238,7 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
237
238
 
238
239
  return (
239
240
  <Field
241
+ ariaDescribedBy={ariaDescribedBy}
240
242
  errorMessage={errorMessage}
241
243
  errorMessageList={errorMessageList}
242
244
  fieldType="single"
@@ -168,7 +168,13 @@ export type AutocompleteProps<
168
168
  getIsOptionEqualToValue?: (option: OptionType, value: OptionType) => boolean;
169
169
  } & Pick<
170
170
  FieldComponentProps,
171
- "errorMessage" | "errorMessageList" | "hint" | "id" | "isOptional" | "name"
171
+ | "ariaDescribedBy"
172
+ | "errorMessage"
173
+ | "errorMessageList"
174
+ | "hint"
175
+ | "id"
176
+ | "isOptional"
177
+ | "name"
172
178
  > &
173
179
  AllowedProps;
174
180
 
@@ -177,6 +183,7 @@ const VirtualizedAutocomplete = <
177
183
  HasMultipleChoices extends boolean | undefined,
178
184
  IsCustomValueAllowed extends boolean | undefined
179
185
  >({
186
+ ariaDescribedBy,
180
187
  defaultValue,
181
188
  errorMessage,
182
189
  errorMessageList,
@@ -243,6 +250,7 @@ const VirtualizedAutocomplete = <
243
250
  const renderInput = useCallback(
244
251
  ({ InputLabelProps, InputProps, ...params }) => (
245
252
  <Field
253
+ ariaDescribedBy={ariaDescribedBy}
246
254
  errorMessage={errorMessage}
247
255
  errorMessageList={errorMessageList}
248
256
  fieldType="single"
@@ -275,6 +283,7 @@ const VirtualizedAutocomplete = <
275
283
  />
276
284
  ),
277
285
  [
286
+ ariaDescribedBy,
278
287
  errorMessage,
279
288
  errorMessageList,
280
289
  hint,