@okta/odyssey-react-mui 1.8.1 → 1.9.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.
- package/CHANGELOG.md +10 -0
- package/dist/Autocomplete.js +2 -0
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Checkbox.js +6 -1
- package/dist/Checkbox.js.map +1 -1
- package/dist/Field.js +2 -0
- package/dist/Field.js.map +1 -1
- package/dist/FieldComponentProps.js.map +1 -1
- package/dist/NativeSelect.js +2 -0
- package/dist/NativeSelect.js.map +1 -1
- package/dist/PasswordField.js +2 -0
- package/dist/PasswordField.js.map +1 -1
- package/dist/Radio.js +7 -2
- package/dist/Radio.js.map +1 -1
- package/dist/SearchField.js +2 -0
- package/dist/SearchField.js.map +1 -1
- package/dist/Select.js +2 -0
- package/dist/Select.js.map +1 -1
- package/dist/TextField.js +2 -0
- package/dist/TextField.js.map +1 -1
- package/dist/src/Autocomplete.d.ts +2 -2
- package/dist/src/Autocomplete.d.ts.map +1 -1
- package/dist/src/Checkbox.d.ts +6 -2
- package/dist/src/Checkbox.d.ts.map +1 -1
- package/dist/src/Field.d.ts +5 -1
- package/dist/src/Field.d.ts.map +1 -1
- package/dist/src/FieldComponentProps.d.ts +4 -0
- package/dist/src/FieldComponentProps.d.ts.map +1 -1
- package/dist/src/NativeSelect.d.ts +1 -1
- package/dist/src/NativeSelect.d.ts.map +1 -1
- package/dist/src/PasswordField.d.ts.map +1 -1
- package/dist/src/Radio.d.ts +6 -2
- package/dist/src/Radio.d.ts.map +1 -1
- package/dist/src/SearchField.d.ts +2 -2
- package/dist/src/SearchField.d.ts.map +1 -1
- package/dist/src/Select.d.ts +2 -2
- package/dist/src/Select.d.ts.map +1 -1
- package/dist/src/TextField.d.ts.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Autocomplete.tsx +3 -1
- package/src/Checkbox.tsx +14 -0
- package/src/Field.tsx +6 -0
- package/src/FieldComponentProps.ts +4 -0
- package/src/NativeSelect.tsx +3 -1
- package/src/PasswordField.tsx +2 -0
- package/src/Radio.tsx +14 -0
- package/src/SearchField.tsx +3 -1
- package/src/Select.tsx +9 -1
- package/src/TextField.tsx +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okta/odyssey-react-mui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
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.
|
|
54
|
+
"@okta/odyssey-design-tokens": "1.9.0",
|
|
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": "
|
|
66
|
+
"gitHead": "dbcfcc17285a611b6d6ea641429e1a42ba62e105"
|
|
67
67
|
}
|
package/src/Autocomplete.tsx
CHANGED
|
@@ -161,7 +161,7 @@ export type AutocompleteProps<
|
|
|
161
161
|
getIsOptionEqualToValue?: (option: OptionType, value: OptionType) => boolean;
|
|
162
162
|
} & Pick<
|
|
163
163
|
FieldComponentProps,
|
|
164
|
-
"errorMessage" | "hint" | "id" | "isOptional" | "name"
|
|
164
|
+
"errorMessage" | "hint" | "id" | "isOptional" | "name" | "isFullWidth"
|
|
165
165
|
> &
|
|
166
166
|
SeleniumProps;
|
|
167
167
|
|
|
@@ -177,6 +177,7 @@ const Autocomplete = <
|
|
|
177
177
|
inputValue,
|
|
178
178
|
isCustomValueAllowed,
|
|
179
179
|
isDisabled,
|
|
180
|
+
isFullWidth = false,
|
|
180
181
|
isLoading,
|
|
181
182
|
isOptional = false,
|
|
182
183
|
isReadOnly,
|
|
@@ -309,6 +310,7 @@ const Autocomplete = <
|
|
|
309
310
|
freeSolo={isCustomValueAllowed}
|
|
310
311
|
filterSelectedOptions={true}
|
|
311
312
|
id={idOverride}
|
|
313
|
+
fullWidth={isFullWidth}
|
|
312
314
|
loading={isLoading}
|
|
313
315
|
multiple={hasMultipleChoices}
|
|
314
316
|
onBlur={onBlur}
|
package/src/Checkbox.tsx
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
Checkbox as MuiCheckbox,
|
|
17
17
|
CheckboxProps as MuiCheckboxProps,
|
|
18
18
|
FormControlLabel,
|
|
19
|
+
FormControlLabelProps as MuiFormControlLabelProps,
|
|
19
20
|
FormHelperText,
|
|
20
21
|
} from "@mui/material";
|
|
21
22
|
|
|
@@ -68,6 +69,10 @@ export type CheckboxProps = {
|
|
|
68
69
|
* The value attribute of the Checkbox
|
|
69
70
|
*/
|
|
70
71
|
value?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Callback fired when the blur event happens. Provides event value.
|
|
74
|
+
*/
|
|
75
|
+
onBlur?: MuiFormControlLabelProps["onBlur"];
|
|
71
76
|
} & Pick<FieldComponentProps, "id" | "isDisabled" | "name"> &
|
|
72
77
|
CheckedFieldProps<MuiCheckboxProps> &
|
|
73
78
|
SeleniumProps;
|
|
@@ -85,6 +90,7 @@ const Checkbox = ({
|
|
|
85
90
|
hint,
|
|
86
91
|
name: nameOverride,
|
|
87
92
|
onChange: onChangeProp,
|
|
93
|
+
onBlur: onBlurProp,
|
|
88
94
|
testId,
|
|
89
95
|
validity = "inherit",
|
|
90
96
|
value,
|
|
@@ -127,6 +133,13 @@ const Checkbox = ({
|
|
|
127
133
|
[onChangeProp]
|
|
128
134
|
);
|
|
129
135
|
|
|
136
|
+
const onBlur = useCallback<NonNullable<MuiFormControlLabelProps["onBlur"]>>(
|
|
137
|
+
(event) => {
|
|
138
|
+
onBlurProp?.(event);
|
|
139
|
+
},
|
|
140
|
+
[onBlurProp]
|
|
141
|
+
);
|
|
142
|
+
|
|
130
143
|
return (
|
|
131
144
|
<FormControlLabel
|
|
132
145
|
sx={{ alignItems: "flex-start" }}
|
|
@@ -157,6 +170,7 @@ const Checkbox = ({
|
|
|
157
170
|
name={nameOverride ?? idOverride}
|
|
158
171
|
value={value}
|
|
159
172
|
required={isRequired}
|
|
173
|
+
onBlur={onBlur}
|
|
160
174
|
/>
|
|
161
175
|
);
|
|
162
176
|
};
|
package/src/Field.tsx
CHANGED
|
@@ -59,6 +59,10 @@ export type FieldProps = {
|
|
|
59
59
|
* If `true`, the component is disabled.
|
|
60
60
|
*/
|
|
61
61
|
isDisabled?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* If `true`, the component can stretch to fill the width of the container.
|
|
64
|
+
*/
|
|
65
|
+
isFullWidth?: boolean;
|
|
62
66
|
/**
|
|
63
67
|
* If `true`, the `input` element is not required.
|
|
64
68
|
*/
|
|
@@ -96,6 +100,7 @@ const Field = ({
|
|
|
96
100
|
hint,
|
|
97
101
|
id: idOverride,
|
|
98
102
|
isDisabled: isDisabledProp = false,
|
|
103
|
+
isFullWidth = false,
|
|
99
104
|
isRadioGroup = false,
|
|
100
105
|
isOptional = false,
|
|
101
106
|
label,
|
|
@@ -126,6 +131,7 @@ const Field = ({
|
|
|
126
131
|
disabled={isDisabled}
|
|
127
132
|
error={Boolean(errorMessage)}
|
|
128
133
|
role={isRadioGroup ? "radiogroup" : undefined}
|
|
134
|
+
fullWidth={isFullWidth}
|
|
129
135
|
>
|
|
130
136
|
{fieldType === "group" ? (
|
|
131
137
|
<MuiFormLabel component="legend">
|
|
@@ -27,6 +27,10 @@ export type FieldComponentProps = {
|
|
|
27
27
|
* If `true`, the component is disabled.
|
|
28
28
|
*/
|
|
29
29
|
isDisabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* If `true`, the component can stretch to fill the width of the container.
|
|
32
|
+
*/
|
|
33
|
+
isFullWidth?: boolean;
|
|
30
34
|
/**
|
|
31
35
|
* If `true`, the `input` element is not required.
|
|
32
36
|
*/
|
package/src/NativeSelect.tsx
CHANGED
|
@@ -81,7 +81,7 @@ export type NativeSelectProps<
|
|
|
81
81
|
value?: Value;
|
|
82
82
|
} & Pick<
|
|
83
83
|
FieldComponentProps,
|
|
84
|
-
"errorMessage" | "hint" | "id" | "isDisabled" | "isOptional"
|
|
84
|
+
"errorMessage" | "hint" | "id" | "isDisabled" | "isOptional" | "isFullWidth"
|
|
85
85
|
> &
|
|
86
86
|
SeleniumProps;
|
|
87
87
|
|
|
@@ -97,6 +97,7 @@ const NativeSelect: ForwardRefWithType = forwardRef(
|
|
|
97
97
|
hint,
|
|
98
98
|
id: idOverride,
|
|
99
99
|
isDisabled = false,
|
|
100
|
+
isFullWidth = false,
|
|
100
101
|
isMultiSelect,
|
|
101
102
|
isOptional = false,
|
|
102
103
|
label,
|
|
@@ -179,6 +180,7 @@ const NativeSelect: ForwardRefWithType = forwardRef(
|
|
|
179
180
|
hint={hint}
|
|
180
181
|
id={idOverride}
|
|
181
182
|
isDisabled={isDisabled}
|
|
183
|
+
isFullWidth={isFullWidth}
|
|
182
184
|
isOptional={isOptional}
|
|
183
185
|
label={label}
|
|
184
186
|
renderFieldComponent={renderFieldComponent}
|
package/src/PasswordField.tsx
CHANGED
|
@@ -84,6 +84,7 @@ const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(
|
|
|
84
84
|
hint,
|
|
85
85
|
id: idOverride,
|
|
86
86
|
isDisabled = false,
|
|
87
|
+
isFullWidth = false,
|
|
87
88
|
isOptional = false,
|
|
88
89
|
hasShowPassword = true,
|
|
89
90
|
isReadOnly,
|
|
@@ -199,6 +200,7 @@ const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(
|
|
|
199
200
|
hint={hint}
|
|
200
201
|
id={idOverride}
|
|
201
202
|
isDisabled={isDisabled}
|
|
203
|
+
isFullWidth={isFullWidth}
|
|
202
204
|
isOptional={isOptional}
|
|
203
205
|
label={label}
|
|
204
206
|
renderFieldComponent={renderFieldComponent}
|
package/src/Radio.tsx
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
14
|
FormControlLabel,
|
|
15
|
+
FormControlLabelProps as MuiFormControlLabelProps,
|
|
15
16
|
Radio as MuiRadio,
|
|
16
17
|
RadioProps as MuiRadioProps,
|
|
17
18
|
} from "@mui/material";
|
|
@@ -41,6 +42,10 @@ export type RadioProps = {
|
|
|
41
42
|
* Callback fired when the state is changed. Provides event and checked value.
|
|
42
43
|
*/
|
|
43
44
|
onChange?: MuiRadioProps["onChange"];
|
|
45
|
+
/**
|
|
46
|
+
* Callback fired when the blur event happens. Provides event value.
|
|
47
|
+
*/
|
|
48
|
+
onBlur?: MuiFormControlLabelProps["onBlur"];
|
|
44
49
|
} & Pick<FieldComponentProps, "isDisabled" | "name"> &
|
|
45
50
|
SeleniumProps;
|
|
46
51
|
|
|
@@ -53,6 +58,7 @@ const Radio = ({
|
|
|
53
58
|
testId,
|
|
54
59
|
value,
|
|
55
60
|
onChange: onChangeProp,
|
|
61
|
+
onBlur: onBlurProp,
|
|
56
62
|
}: RadioProps) => {
|
|
57
63
|
const onChange = useCallback<NonNullable<MuiRadioProps["onChange"]>>(
|
|
58
64
|
(event, checked) => {
|
|
@@ -61,6 +67,13 @@ const Radio = ({
|
|
|
61
67
|
[onChangeProp]
|
|
62
68
|
);
|
|
63
69
|
|
|
70
|
+
const onBlur = useCallback<NonNullable<MuiFormControlLabelProps["onBlur"]>>(
|
|
71
|
+
(event) => {
|
|
72
|
+
onBlurProp?.(event);
|
|
73
|
+
},
|
|
74
|
+
[onBlurProp]
|
|
75
|
+
);
|
|
76
|
+
|
|
64
77
|
return (
|
|
65
78
|
<FormControlLabel
|
|
66
79
|
checked={isChecked}
|
|
@@ -71,6 +84,7 @@ const Radio = ({
|
|
|
71
84
|
label={label}
|
|
72
85
|
name={name}
|
|
73
86
|
value={value}
|
|
87
|
+
onBlur={onBlur}
|
|
74
88
|
/>
|
|
75
89
|
);
|
|
76
90
|
};
|
package/src/SearchField.tsx
CHANGED
|
@@ -78,7 +78,7 @@ 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"> &
|
|
81
|
+
} & Pick<FieldComponentProps, "id" | "isDisabled" | "name" | "isFullWidth"> &
|
|
82
82
|
SeleniumProps;
|
|
83
83
|
|
|
84
84
|
const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(
|
|
@@ -89,6 +89,7 @@ const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(
|
|
|
89
89
|
hasInitialFocus,
|
|
90
90
|
id: idOverride,
|
|
91
91
|
isDisabled = false,
|
|
92
|
+
isFullWidth = false,
|
|
92
93
|
label,
|
|
93
94
|
name: nameOverride,
|
|
94
95
|
onChange: onChangeProp,
|
|
@@ -186,6 +187,7 @@ const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(
|
|
|
186
187
|
hasVisibleLabel={false}
|
|
187
188
|
id={idOverride}
|
|
188
189
|
isDisabled={isDisabled}
|
|
190
|
+
isFullWidth={isFullWidth}
|
|
189
191
|
isOptional={true}
|
|
190
192
|
label={label}
|
|
191
193
|
renderFieldComponent={renderFieldComponent}
|
package/src/Select.tsx
CHANGED
|
@@ -84,7 +84,13 @@ export type SelectProps<
|
|
|
84
84
|
value?: Value;
|
|
85
85
|
} & Pick<
|
|
86
86
|
FieldComponentProps,
|
|
87
|
-
|
|
87
|
+
| "errorMessage"
|
|
88
|
+
| "hint"
|
|
89
|
+
| "id"
|
|
90
|
+
| "isDisabled"
|
|
91
|
+
| "isOptional"
|
|
92
|
+
| "name"
|
|
93
|
+
| "isFullWidth"
|
|
88
94
|
> &
|
|
89
95
|
SeleniumProps;
|
|
90
96
|
|
|
@@ -114,6 +120,7 @@ const Select = <
|
|
|
114
120
|
hint,
|
|
115
121
|
id: idOverride,
|
|
116
122
|
isDisabled = false,
|
|
123
|
+
isFullWidth = false,
|
|
117
124
|
isMultiSelect,
|
|
118
125
|
isOptional = false,
|
|
119
126
|
label,
|
|
@@ -282,6 +289,7 @@ const Select = <
|
|
|
282
289
|
hint={hint}
|
|
283
290
|
id={idOverride}
|
|
284
291
|
isDisabled={isDisabled}
|
|
292
|
+
isFullWidth={isFullWidth}
|
|
285
293
|
isOptional={isOptional}
|
|
286
294
|
label={label}
|
|
287
295
|
renderFieldComponent={renderFieldComponent}
|
package/src/TextField.tsx
CHANGED
|
@@ -104,6 +104,7 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
|
|
104
104
|
hint,
|
|
105
105
|
id: idOverride,
|
|
106
106
|
isDisabled = false,
|
|
107
|
+
isFullWidth = false,
|
|
107
108
|
isMultiline = false,
|
|
108
109
|
isOptional = false,
|
|
109
110
|
isReadOnly,
|
|
@@ -205,6 +206,7 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
|
|
205
206
|
hint={hint}
|
|
206
207
|
id={idOverride}
|
|
207
208
|
isDisabled={isDisabled}
|
|
209
|
+
isFullWidth={isFullWidth}
|
|
208
210
|
isOptional={isOptional}
|
|
209
211
|
label={label}
|
|
210
212
|
renderFieldComponent={renderFieldComponent}
|