@okta/odyssey-react-mui 1.10.3 → 1.11.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 +7 -0
- package/dist/Accordion.js +8 -0
- package/dist/Accordion.js.map +1 -1
- package/dist/CheckboxGroup.js +4 -0
- package/dist/CheckboxGroup.js.map +1 -1
- package/dist/PasswordField.js +2 -0
- package/dist/PasswordField.js.map +1 -1
- package/dist/src/Accordion.d.ts +5 -1
- package/dist/src/Accordion.d.ts.map +1 -1
- package/dist/src/CheckboxGroup.d.ts +2 -2
- package/dist/src/CheckboxGroup.d.ts.map +1 -1
- package/dist/src/PasswordField.d.ts.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Accordion.tsx +17 -2
- package/src/CheckboxGroup.tsx +5 -1
- package/src/PasswordField.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.11.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.11.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": "36ec4393909bdea95455892c4a9eb65c38ea0857"
|
|
67
67
|
}
|
package/src/Accordion.tsx
CHANGED
|
@@ -20,12 +20,17 @@ import {
|
|
|
20
20
|
} from "@mui/material";
|
|
21
21
|
import { ChevronDownIcon } from "./icons.generated";
|
|
22
22
|
import { Support } from "./Typography";
|
|
23
|
+
import { useUniqueId } from "./useUniqueId";
|
|
23
24
|
|
|
24
25
|
export type AccordionProps = {
|
|
25
26
|
/**
|
|
26
27
|
* The content of the Accordion itself
|
|
27
28
|
*/
|
|
28
29
|
children: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Defines IDs for the header and the content of the Accordion
|
|
32
|
+
*/
|
|
33
|
+
id?: string;
|
|
29
34
|
/**
|
|
30
35
|
* The label text for the AccordionSummary
|
|
31
36
|
*/
|
|
@@ -66,12 +71,16 @@ const Accordion = ({
|
|
|
66
71
|
children,
|
|
67
72
|
label,
|
|
68
73
|
hasShadow = true,
|
|
74
|
+
id: idOverride,
|
|
69
75
|
isDefaultExpanded,
|
|
70
76
|
isDisabled,
|
|
71
77
|
isExpanded,
|
|
72
78
|
onChange,
|
|
73
79
|
translate,
|
|
74
80
|
}: AccordionProps) => {
|
|
81
|
+
const id = useUniqueId(idOverride);
|
|
82
|
+
const headerId = `${id}-header`;
|
|
83
|
+
const contentId = `${id}-content`;
|
|
75
84
|
return (
|
|
76
85
|
<MuiAccordion
|
|
77
86
|
defaultExpanded={isDefaultExpanded}
|
|
@@ -81,12 +90,18 @@ const Accordion = ({
|
|
|
81
90
|
onChange={onChange}
|
|
82
91
|
className={hasShadow ? `hasShadow` : undefined}
|
|
83
92
|
>
|
|
84
|
-
<MuiAccordionSummary
|
|
93
|
+
<MuiAccordionSummary
|
|
94
|
+
aria-controls={contentId}
|
|
95
|
+
expandIcon={<ChevronDownIcon />}
|
|
96
|
+
id={headerId}
|
|
97
|
+
>
|
|
85
98
|
<Support component="div" translate={translate}>
|
|
86
99
|
{label}
|
|
87
100
|
</Support>
|
|
88
101
|
</MuiAccordionSummary>
|
|
89
|
-
<MuiAccordionDetails
|
|
102
|
+
<MuiAccordionDetails aria-labelledby={headerId}>
|
|
103
|
+
{children}
|
|
104
|
+
</MuiAccordionDetails>
|
|
90
105
|
</MuiAccordion>
|
|
91
106
|
);
|
|
92
107
|
};
|
package/src/CheckboxGroup.tsx
CHANGED
|
@@ -39,6 +39,7 @@ export type CheckboxGroupProps = {
|
|
|
39
39
|
| "errorMessageList"
|
|
40
40
|
| "hint"
|
|
41
41
|
| "HintLinkComponent"
|
|
42
|
+
| "id"
|
|
42
43
|
| "isDisabled"
|
|
43
44
|
> &
|
|
44
45
|
AllowedProps;
|
|
@@ -49,6 +50,7 @@ const CheckboxGroup = ({
|
|
|
49
50
|
errorMessageList,
|
|
50
51
|
hint,
|
|
51
52
|
HintLinkComponent,
|
|
53
|
+
id: idOverride,
|
|
52
54
|
isDisabled,
|
|
53
55
|
isRequired = false,
|
|
54
56
|
label,
|
|
@@ -56,12 +58,13 @@ const CheckboxGroup = ({
|
|
|
56
58
|
translate,
|
|
57
59
|
}: CheckboxGroupProps) => {
|
|
58
60
|
const renderFieldComponent = useCallback(
|
|
59
|
-
({ ariaDescribedBy, errorMessageElementId, labelElementId }) => (
|
|
61
|
+
({ ariaDescribedBy, errorMessageElementId, id, labelElementId }) => (
|
|
60
62
|
<MuiFormGroup
|
|
61
63
|
aria-describedby={ariaDescribedBy}
|
|
62
64
|
aria-errormessage={errorMessageElementId}
|
|
63
65
|
aria-labelledby={labelElementId}
|
|
64
66
|
data-se={testId}
|
|
67
|
+
id={id}
|
|
65
68
|
translate={translate}
|
|
66
69
|
>
|
|
67
70
|
{children}
|
|
@@ -78,6 +81,7 @@ const CheckboxGroup = ({
|
|
|
78
81
|
hasVisibleLabel={true}
|
|
79
82
|
hint={hint}
|
|
80
83
|
HintLinkComponent={HintLinkComponent}
|
|
84
|
+
id={idOverride}
|
|
81
85
|
isDisabled={isDisabled}
|
|
82
86
|
isOptional={!isRequired}
|
|
83
87
|
label={label}
|
package/src/PasswordField.tsx
CHANGED
|
@@ -165,11 +165,13 @@ const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(
|
|
|
165
165
|
hasShowPassword && (
|
|
166
166
|
<InputAdornment position="end">
|
|
167
167
|
<IconButton
|
|
168
|
+
aria-controls={id}
|
|
168
169
|
aria-label={
|
|
169
170
|
inputType === "password"
|
|
170
171
|
? t("passwordfield.icon.label.show")
|
|
171
172
|
: t("passwordfield.icon.label.hide")
|
|
172
173
|
}
|
|
174
|
+
aria-pressed={inputType === "text"}
|
|
173
175
|
onClick={togglePasswordVisibility}
|
|
174
176
|
>
|
|
175
177
|
{inputType === "password" ? <ShowIcon /> : <HideIcon />}
|