@okta/odyssey-react-mui 1.9.11 → 1.9.13
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 +8 -0
- package/dist/Accordion.js +3 -1
- package/dist/Accordion.js.map +1 -1
- package/dist/AllowedProps.js +2 -0
- package/dist/AllowedProps.js.map +1 -0
- package/dist/Autocomplete.js +4 -2
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Badge.js +35 -30
- package/dist/Badge.js.map +1 -1
- package/dist/Banner.js +5 -1
- package/dist/Banner.js.map +1 -1
- package/dist/Box.js +4 -2
- package/dist/Box.js.map +1 -1
- package/dist/Breadcrumbs.js +5 -1
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/Button.js +3 -1
- package/dist/Button.js.map +1 -1
- package/dist/Callout.js +4 -1
- package/dist/Callout.js.map +1 -1
- package/dist/Checkbox.js +5 -2
- package/dist/Checkbox.js.map +1 -1
- package/dist/CheckboxGroup.js +4 -2
- package/dist/CheckboxGroup.js.map +1 -1
- package/dist/CircularProgress.js.map +1 -1
- package/dist/Dialog.js +2 -0
- package/dist/Dialog.js.map +1 -1
- package/dist/FieldError.js +4 -1
- package/dist/FieldError.js.map +1 -1
- package/dist/FieldHint.js +3 -1
- package/dist/FieldHint.js.map +1 -1
- package/dist/FieldLabel.js +4 -1
- package/dist/FieldLabel.js.map +1 -1
- package/dist/Fieldset.js +4 -1
- package/dist/Fieldset.js.map +1 -1
- package/dist/Form.js +4 -1
- package/dist/Form.js.map +1 -1
- package/dist/Link.js +2 -0
- package/dist/Link.js.map +1 -1
- package/dist/MenuButton.js +3 -1
- package/dist/MenuButton.js.map +1 -1
- package/dist/MenuItem.js.map +1 -1
- package/dist/NativeSelect.js +4 -2
- package/dist/NativeSelect.js.map +1 -1
- package/dist/PasswordField.js +3 -1
- package/dist/PasswordField.js.map +1 -1
- package/dist/Radio.js +2 -0
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js +3 -1
- package/dist/RadioGroup.js.map +1 -1
- package/dist/ScreenReaderText.js +3 -1
- package/dist/ScreenReaderText.js.map +1 -1
- package/dist/SearchField.js +3 -1
- package/dist/SearchField.js.map +1 -1
- package/dist/Select.js +4 -2
- package/dist/Select.js.map +1 -1
- package/dist/Status.js +2 -0
- package/dist/Status.js.map +1 -1
- package/dist/Tabs.js +54 -10
- package/dist/Tabs.js.map +1 -1
- package/dist/Tag.js +5 -3
- package/dist/Tag.js.map +1 -1
- package/dist/TagList.js.map +1 -1
- package/dist/TextField.js +6 -2
- package/dist/TextField.js.map +1 -1
- package/dist/Toast.js +4 -1
- package/dist/Toast.js.map +1 -1
- package/dist/Tooltip.js +3 -1
- package/dist/Tooltip.js.map +1 -1
- package/dist/Typography.js +32 -10
- package/dist/Typography.js.map +1 -1
- package/dist/labs/Switch.js.map +1 -1
- package/dist/labs/VirtualizedAutocomplete.js +4 -2
- package/dist/labs/VirtualizedAutocomplete.js.map +1 -1
- package/dist/src/Accordion.d.ts +3 -3
- package/dist/src/Accordion.d.ts.map +1 -1
- package/dist/src/{SeleniumProps.d.ts → AllowedProps.d.ts} +6 -2
- package/dist/src/AllowedProps.d.ts.map +1 -0
- package/dist/src/Autocomplete.d.ts +3 -3
- package/dist/src/Autocomplete.d.ts.map +1 -1
- package/dist/src/Badge.d.ts +3 -3
- package/dist/src/Badge.d.ts.map +1 -1
- package/dist/src/Banner.d.ts +3 -3
- package/dist/src/Banner.d.ts.map +1 -1
- package/dist/src/Box.d.ts +3 -3
- package/dist/src/Box.d.ts.map +1 -1
- package/dist/src/Breadcrumbs.d.ts +3 -2
- package/dist/src/Breadcrumbs.d.ts.map +1 -1
- package/dist/src/Button.d.ts +3 -3
- package/dist/src/Button.d.ts.map +1 -1
- package/dist/src/Callout.d.ts +3 -3
- package/dist/src/Callout.d.ts.map +1 -1
- package/dist/src/Checkbox.d.ts +3 -3
- package/dist/src/Checkbox.d.ts.map +1 -1
- package/dist/src/CheckboxGroup.d.ts +3 -3
- package/dist/src/CheckboxGroup.d.ts.map +1 -1
- package/dist/src/CircularProgress.d.ts +2 -2
- package/dist/src/CircularProgress.d.ts.map +1 -1
- package/dist/src/Dialog.d.ts +3 -3
- package/dist/src/Dialog.d.ts.map +1 -1
- package/dist/src/FieldError.d.ts +3 -3
- package/dist/src/FieldError.d.ts.map +1 -1
- package/dist/src/FieldHint.d.ts +3 -3
- package/dist/src/FieldHint.d.ts.map +1 -1
- package/dist/src/FieldLabel.d.ts +3 -3
- package/dist/src/FieldLabel.d.ts.map +1 -1
- package/dist/src/Fieldset.d.ts +3 -3
- package/dist/src/Fieldset.d.ts.map +1 -1
- package/dist/src/Form.d.ts +3 -3
- package/dist/src/Form.d.ts.map +1 -1
- package/dist/src/Link.d.ts +3 -3
- package/dist/src/Link.d.ts.map +1 -1
- package/dist/src/MenuButton.d.ts +3 -3
- package/dist/src/MenuButton.d.ts.map +1 -1
- package/dist/src/MenuItem.d.ts +2 -2
- package/dist/src/MenuItem.d.ts.map +1 -1
- package/dist/src/NativeSelect.d.ts +2 -2
- package/dist/src/NativeSelect.d.ts.map +1 -1
- package/dist/src/PasswordField.d.ts +3 -3
- package/dist/src/PasswordField.d.ts.map +1 -1
- package/dist/src/Radio.d.ts +3 -3
- package/dist/src/Radio.d.ts.map +1 -1
- package/dist/src/RadioGroup.d.ts +3 -3
- package/dist/src/RadioGroup.d.ts.map +1 -1
- package/dist/src/ScreenReaderText.d.ts +3 -2
- package/dist/src/ScreenReaderText.d.ts.map +1 -1
- package/dist/src/SearchField.d.ts +3 -3
- package/dist/src/SearchField.d.ts.map +1 -1
- package/dist/src/Select.d.ts +3 -3
- package/dist/src/Select.d.ts.map +1 -1
- package/dist/src/Status.d.ts +3 -3
- package/dist/src/Status.d.ts.map +1 -1
- package/dist/src/Tabs.d.ts +7 -3
- package/dist/src/Tabs.d.ts.map +1 -1
- package/dist/src/Tag.d.ts +3 -3
- package/dist/src/Tag.d.ts.map +1 -1
- package/dist/src/TagList.d.ts +2 -2
- package/dist/src/TagList.d.ts.map +1 -1
- package/dist/src/TextField.d.ts +3 -3
- package/dist/src/TextField.d.ts.map +1 -1
- package/dist/src/Toast.d.ts +3 -3
- package/dist/src/Toast.d.ts.map +1 -1
- package/dist/src/Tooltip.d.ts +3 -3
- package/dist/src/Tooltip.d.ts.map +1 -1
- package/dist/src/Typography.d.ts +13 -13
- package/dist/src/Typography.d.ts.map +1 -1
- package/dist/src/labs/Switch.d.ts +2 -2
- package/dist/src/labs/Switch.d.ts.map +1 -1
- package/dist/src/labs/VirtualizedAutocomplete.d.ts +3 -3
- package/dist/src/labs/VirtualizedAutocomplete.d.ts.map +1 -1
- package/dist/theme/components.js +1 -1
- package/dist/theme/components.js.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Accordion.tsx +6 -3
- package/src/{SeleniumProps.ts → AllowedProps.ts} +5 -1
- package/src/Autocomplete.tsx +4 -2
- package/src/Badge.tsx +37 -27
- package/src/Banner.tsx +8 -5
- package/src/Box.tsx +4 -3
- package/src/Breadcrumbs.tsx +6 -1
- package/src/Button.tsx +5 -2
- package/src/Callout.tsx +14 -5
- package/src/Checkbox.tsx +6 -4
- package/src/CheckboxGroup.tsx +5 -3
- package/src/CircularProgress.tsx +2 -2
- package/src/Dialog.tsx +4 -3
- package/src/FieldError.tsx +5 -5
- package/src/FieldHint.tsx +10 -4
- package/src/FieldLabel.tsx +11 -5
- package/src/Fieldset.tsx +5 -4
- package/src/Form.tsx +9 -4
- package/src/Link.tsx +4 -2
- package/src/MenuButton.tsx +4 -2
- package/src/MenuItem.tsx +2 -2
- package/src/NativeSelect.tsx +5 -2
- package/src/PasswordField.tsx +5 -2
- package/src/Radio.tsx +4 -2
- package/src/RadioGroup.tsx +5 -3
- package/src/ScreenReaderText.tsx +4 -3
- package/src/SearchField.tsx +5 -2
- package/src/Select.tsx +5 -2
- package/src/Status.tsx +4 -2
- package/src/Tabs.tsx +87 -19
- package/src/Tag.tsx +14 -3
- package/src/TagList.tsx +2 -2
- package/src/TextField.tsx +11 -4
- package/src/Toast.tsx +5 -4
- package/src/Tooltip.tsx +4 -2
- package/src/Typography.tsx +24 -2
- package/src/labs/Switch.tsx +2 -2
- package/src/labs/VirtualizedAutocomplete.tsx +4 -2
- package/src/theme/components.tsx +1 -1
- package/dist/SeleniumProps.js +0 -2
- package/dist/SeleniumProps.js.map +0 -1
- package/dist/src/SeleniumProps.d.ts.map +0 -1
package/src/Fieldset.tsx
CHANGED
|
@@ -18,7 +18,7 @@ import { FieldsetContext } from "./FieldsetContext";
|
|
|
18
18
|
import { Legend, Support } from "./Typography";
|
|
19
19
|
import { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext";
|
|
20
20
|
import { useUniqueId } from "./useUniqueId";
|
|
21
|
-
import type {
|
|
21
|
+
import type { AllowedProps } from "./AllowedProps";
|
|
22
22
|
|
|
23
23
|
export type FieldsetProps = {
|
|
24
24
|
/**
|
|
@@ -49,7 +49,7 @@ export type FieldsetProps = {
|
|
|
49
49
|
* The name associated with the group.
|
|
50
50
|
*/
|
|
51
51
|
name?: string;
|
|
52
|
-
} &
|
|
52
|
+
} & AllowedProps;
|
|
53
53
|
|
|
54
54
|
const Fieldset = ({
|
|
55
55
|
alert,
|
|
@@ -60,6 +60,7 @@ const Fieldset = ({
|
|
|
60
60
|
legend,
|
|
61
61
|
name,
|
|
62
62
|
testId,
|
|
63
|
+
translate,
|
|
63
64
|
}: FieldsetProps) => {
|
|
64
65
|
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
65
66
|
const id = useUniqueId(idOverride);
|
|
@@ -90,9 +91,9 @@ const Fieldset = ({
|
|
|
90
91
|
},
|
|
91
92
|
}}
|
|
92
93
|
>
|
|
93
|
-
<Legend>{legend}</Legend>
|
|
94
|
+
<Legend translate={translate}>{legend}</Legend>
|
|
94
95
|
|
|
95
|
-
{description && <Support>{description}</Support>}
|
|
96
|
+
{description && <Support translate={translate}>{description}</Support>}
|
|
96
97
|
|
|
97
98
|
{alert}
|
|
98
99
|
|
package/src/Form.tsx
CHANGED
|
@@ -17,7 +17,7 @@ import { Button } from "./Button";
|
|
|
17
17
|
import { Callout } from "./Callout";
|
|
18
18
|
import { Heading4, Support } from "./Typography";
|
|
19
19
|
import { useUniqueId } from "./useUniqueId";
|
|
20
|
-
import type {
|
|
20
|
+
import type { AllowedProps } from "./AllowedProps";
|
|
21
21
|
|
|
22
22
|
export const formEncodingTypeValues = [
|
|
23
23
|
"application/x-www-form-urlencoded",
|
|
@@ -85,7 +85,7 @@ export type FormProps = {
|
|
|
85
85
|
* The title of the Form
|
|
86
86
|
*/
|
|
87
87
|
title?: string;
|
|
88
|
-
} &
|
|
88
|
+
} & AllowedProps;
|
|
89
89
|
|
|
90
90
|
const Form = ({
|
|
91
91
|
alert,
|
|
@@ -101,6 +101,7 @@ const Form = ({
|
|
|
101
101
|
target,
|
|
102
102
|
testId,
|
|
103
103
|
title,
|
|
104
|
+
translate,
|
|
104
105
|
}: FormProps) => {
|
|
105
106
|
const id = useUniqueId(idOverride);
|
|
106
107
|
|
|
@@ -127,8 +128,12 @@ const Form = ({
|
|
|
127
128
|
marginBlockEnd: (theme) => theme.spacing(4),
|
|
128
129
|
}}
|
|
129
130
|
>
|
|
130
|
-
{title &&
|
|
131
|
-
|
|
131
|
+
{title && (
|
|
132
|
+
<Heading4 component="h1" translate={translate}>
|
|
133
|
+
{title}
|
|
134
|
+
</Heading4>
|
|
135
|
+
)}
|
|
136
|
+
{description && <Support translate={translate}>{description}</Support>}
|
|
132
137
|
{alert}
|
|
133
138
|
</Box>
|
|
134
139
|
<Box component="div">{children}</Box>
|
package/src/Link.tsx
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { memo, ReactElement, useImperativeHandle, useRef } from "react";
|
|
14
14
|
import { ExternalLinkIcon } from "./icons.generated";
|
|
15
|
-
import type {
|
|
15
|
+
import type { AllowedProps } from "./AllowedProps";
|
|
16
16
|
|
|
17
17
|
import { Link as MuiLink, LinkProps as MuiLinkProps } from "@mui/material";
|
|
18
18
|
import { FocusHandle } from "./@types/react-augment";
|
|
@@ -57,7 +57,7 @@ export type LinkProps = {
|
|
|
57
57
|
* The visual presentation of the Link (default or monochrome)
|
|
58
58
|
*/
|
|
59
59
|
variant?: (typeof linkVariantValues)[number];
|
|
60
|
-
} &
|
|
60
|
+
} & AllowedProps;
|
|
61
61
|
|
|
62
62
|
const Link = ({
|
|
63
63
|
children,
|
|
@@ -67,6 +67,7 @@ const Link = ({
|
|
|
67
67
|
rel,
|
|
68
68
|
target,
|
|
69
69
|
testId,
|
|
70
|
+
translate,
|
|
70
71
|
variant,
|
|
71
72
|
onClick,
|
|
72
73
|
}: LinkProps) => {
|
|
@@ -91,6 +92,7 @@ const Link = ({
|
|
|
91
92
|
ref={ref}
|
|
92
93
|
rel={rel}
|
|
93
94
|
target={target}
|
|
95
|
+
translate={translate}
|
|
94
96
|
variant={variant}
|
|
95
97
|
onClick={onClick}
|
|
96
98
|
>
|
package/src/MenuButton.tsx
CHANGED
|
@@ -28,7 +28,7 @@ import { memo, type ReactElement, useCallback, useMemo, useState } from "react";
|
|
|
28
28
|
|
|
29
29
|
import { MenuContext, MenuContextType } from "./MenuContext";
|
|
30
30
|
import { NullElement } from "./NullElement";
|
|
31
|
-
import type {
|
|
31
|
+
import type { AllowedProps } from "./AllowedProps";
|
|
32
32
|
|
|
33
33
|
export const menuAlignmentValues = ["left", "right"] as const;
|
|
34
34
|
|
|
@@ -109,7 +109,7 @@ export type MenuButtonProps = {
|
|
|
109
109
|
buttonLabel?: undefined | "";
|
|
110
110
|
}
|
|
111
111
|
) &
|
|
112
|
-
|
|
112
|
+
AllowedProps;
|
|
113
113
|
|
|
114
114
|
const MenuButton = ({
|
|
115
115
|
ariaLabel,
|
|
@@ -126,6 +126,7 @@ const MenuButton = ({
|
|
|
126
126
|
size,
|
|
127
127
|
testId,
|
|
128
128
|
tooltipText,
|
|
129
|
+
translate,
|
|
129
130
|
}: MenuButtonProps) => {
|
|
130
131
|
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
|
|
131
132
|
|
|
@@ -197,6 +198,7 @@ const MenuButton = ({
|
|
|
197
198
|
onClick={openMenu}
|
|
198
199
|
size={size}
|
|
199
200
|
tooltipText={tooltipText}
|
|
201
|
+
translate={translate}
|
|
200
202
|
variant={buttonVariant}
|
|
201
203
|
/>
|
|
202
204
|
|
package/src/MenuItem.tsx
CHANGED
|
@@ -18,7 +18,7 @@ import { menuItemClasses } from "@mui/material/MenuItem";
|
|
|
18
18
|
import { memo, useCallback, useContext, type ReactNode } from "react";
|
|
19
19
|
|
|
20
20
|
import { MenuContext } from "./MenuContext";
|
|
21
|
-
import type {
|
|
21
|
+
import type { AllowedProps } from "./AllowedProps";
|
|
22
22
|
|
|
23
23
|
export type MenuItemProps = {
|
|
24
24
|
/**
|
|
@@ -51,7 +51,7 @@ export type MenuItemProps = {
|
|
|
51
51
|
* - "destructive": A variant indicating a destructive action.
|
|
52
52
|
*/
|
|
53
53
|
variant?: "default" | "destructive";
|
|
54
|
-
} &
|
|
54
|
+
} & AllowedProps;
|
|
55
55
|
|
|
56
56
|
const MenuItem = ({
|
|
57
57
|
children,
|
package/src/NativeSelect.tsx
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "@mui/material";
|
|
25
25
|
import { Field } from "./Field";
|
|
26
26
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
27
|
-
import type {
|
|
27
|
+
import type { AllowedProps } from "./AllowedProps";
|
|
28
28
|
import { getControlState, useInputValues } from "./inputUtils";
|
|
29
29
|
import { ForwardRefWithType } from "./@types/react-augment";
|
|
30
30
|
|
|
@@ -89,7 +89,7 @@ export type NativeSelectProps<
|
|
|
89
89
|
| "isFullWidth"
|
|
90
90
|
| "isOptional"
|
|
91
91
|
> &
|
|
92
|
-
|
|
92
|
+
AllowedProps;
|
|
93
93
|
|
|
94
94
|
const NativeSelect: ForwardRefWithType = forwardRef(
|
|
95
95
|
<
|
|
@@ -112,6 +112,7 @@ const NativeSelect: ForwardRefWithType = forwardRef(
|
|
|
112
112
|
onChange: onChangeProp,
|
|
113
113
|
onFocus,
|
|
114
114
|
testId,
|
|
115
|
+
translate,
|
|
115
116
|
value,
|
|
116
117
|
children,
|
|
117
118
|
}: NativeSelectProps<Value, HasMultipleChoices>,
|
|
@@ -164,6 +165,7 @@ const NativeSelect: ForwardRefWithType = forwardRef(
|
|
|
164
165
|
onChange={onChange}
|
|
165
166
|
onFocus={onFocus}
|
|
166
167
|
ref={ref}
|
|
168
|
+
translate={translate}
|
|
167
169
|
/>
|
|
168
170
|
),
|
|
169
171
|
[
|
|
@@ -176,6 +178,7 @@ const NativeSelect: ForwardRefWithType = forwardRef(
|
|
|
176
178
|
onFocus,
|
|
177
179
|
ref,
|
|
178
180
|
testId,
|
|
181
|
+
translate,
|
|
179
182
|
]
|
|
180
183
|
);
|
|
181
184
|
|
package/src/PasswordField.tsx
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
import { ShowIcon, HideIcon } from "./icons.generated";
|
|
26
26
|
import { Field } from "./Field";
|
|
27
27
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
28
|
-
import type {
|
|
28
|
+
import type { AllowedProps } from "./AllowedProps";
|
|
29
29
|
import { useTranslation } from "react-i18next";
|
|
30
30
|
import { getControlState, useInputValues } from "./inputUtils";
|
|
31
31
|
import { FocusHandle } from "./@types/react-augment";
|
|
@@ -78,7 +78,7 @@ export type PasswordFieldProps = {
|
|
|
78
78
|
*/
|
|
79
79
|
value?: string;
|
|
80
80
|
} & FieldComponentProps &
|
|
81
|
-
|
|
81
|
+
AllowedProps;
|
|
82
82
|
|
|
83
83
|
const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(
|
|
84
84
|
(
|
|
@@ -102,6 +102,7 @@ const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(
|
|
|
102
102
|
onBlur,
|
|
103
103
|
placeholder,
|
|
104
104
|
testId,
|
|
105
|
+
translate,
|
|
105
106
|
value,
|
|
106
107
|
},
|
|
107
108
|
ref
|
|
@@ -191,6 +192,7 @@ const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(
|
|
|
191
192
|
readOnly={isReadOnly}
|
|
192
193
|
ref={ref}
|
|
193
194
|
required={!isOptional}
|
|
195
|
+
translate={translate}
|
|
194
196
|
type={inputType}
|
|
195
197
|
/>
|
|
196
198
|
),
|
|
@@ -211,6 +213,7 @@ const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(
|
|
|
211
213
|
hasShowPassword,
|
|
212
214
|
ref,
|
|
213
215
|
testId,
|
|
216
|
+
translate,
|
|
214
217
|
]
|
|
215
218
|
);
|
|
216
219
|
|
package/src/Radio.tsx
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import { memo, useCallback, useRef, useImperativeHandle } from "react";
|
|
20
20
|
|
|
21
21
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
22
|
-
import type {
|
|
22
|
+
import type { AllowedProps } from "./AllowedProps";
|
|
23
23
|
import { FocusHandle } from "./@types/react-augment";
|
|
24
24
|
|
|
25
25
|
export type RadioProps = {
|
|
@@ -52,7 +52,7 @@ export type RadioProps = {
|
|
|
52
52
|
*/
|
|
53
53
|
onBlur?: MuiFormControlLabelProps["onBlur"];
|
|
54
54
|
} & Pick<FieldComponentProps, "isDisabled" | "name"> &
|
|
55
|
-
|
|
55
|
+
AllowedProps;
|
|
56
56
|
|
|
57
57
|
const Radio = ({
|
|
58
58
|
inputFocusRef,
|
|
@@ -62,6 +62,7 @@ const Radio = ({
|
|
|
62
62
|
label,
|
|
63
63
|
name,
|
|
64
64
|
testId,
|
|
65
|
+
translate,
|
|
65
66
|
value,
|
|
66
67
|
onChange: onChangeProp,
|
|
67
68
|
onBlur: onBlurProp,
|
|
@@ -103,6 +104,7 @@ const Radio = ({
|
|
|
103
104
|
disabled={isDisabled}
|
|
104
105
|
label={label}
|
|
105
106
|
name={name}
|
|
107
|
+
translate={translate}
|
|
106
108
|
value={value}
|
|
107
109
|
onBlur={onBlur}
|
|
108
110
|
/>
|
package/src/RadioGroup.tsx
CHANGED
|
@@ -19,7 +19,7 @@ import { memo, ReactElement, useCallback, useRef } from "react";
|
|
|
19
19
|
import { Radio, RadioProps } from "./Radio";
|
|
20
20
|
import { Field } from "./Field";
|
|
21
21
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
22
|
-
import type {
|
|
22
|
+
import type { AllowedProps } from "./AllowedProps";
|
|
23
23
|
import { getControlState, useInputValues } from "./inputUtils";
|
|
24
24
|
|
|
25
25
|
export type RadioGroupProps = {
|
|
@@ -47,7 +47,7 @@ export type RadioGroupProps = {
|
|
|
47
47
|
FieldComponentProps,
|
|
48
48
|
"errorMessage" | "hint" | "HintLinkComponent" | "id" | "isDisabled" | "name"
|
|
49
49
|
> &
|
|
50
|
-
|
|
50
|
+
AllowedProps;
|
|
51
51
|
|
|
52
52
|
const RadioGroup = ({
|
|
53
53
|
children,
|
|
@@ -61,6 +61,7 @@ const RadioGroup = ({
|
|
|
61
61
|
name: nameOverride,
|
|
62
62
|
onChange: onChangeProp,
|
|
63
63
|
testId,
|
|
64
|
+
translate,
|
|
64
65
|
value,
|
|
65
66
|
}: RadioGroupProps) => {
|
|
66
67
|
const controlledStateRef = useRef(
|
|
@@ -89,11 +90,12 @@ const RadioGroup = ({
|
|
|
89
90
|
id={id}
|
|
90
91
|
name={nameOverride ?? id}
|
|
91
92
|
onChange={onChange}
|
|
93
|
+
translate={translate}
|
|
92
94
|
>
|
|
93
95
|
{children}
|
|
94
96
|
</MuiRadioGroup>
|
|
95
97
|
),
|
|
96
|
-
[children, inputValues, nameOverride, onChange, testId]
|
|
98
|
+
[children, inputValues, nameOverride, onChange, testId, translate]
|
|
97
99
|
);
|
|
98
100
|
|
|
99
101
|
return (
|
package/src/ScreenReaderText.tsx
CHANGED
|
@@ -13,13 +13,14 @@
|
|
|
13
13
|
import { memo, ReactNode } from "react";
|
|
14
14
|
import { Box } from "@mui/material";
|
|
15
15
|
import { visuallyHidden } from "@mui/utils";
|
|
16
|
+
import { AllowedProps } from "./AllowedProps";
|
|
16
17
|
|
|
17
18
|
export type ScreenReaderTextProps = {
|
|
18
19
|
/**
|
|
19
20
|
* The visually-hidden text.
|
|
20
21
|
*/
|
|
21
22
|
children: ReactNode;
|
|
22
|
-
};
|
|
23
|
+
} & AllowedProps;
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* MUI sx expects you pass in a CSS object, not an object with CSS.
|
|
@@ -28,8 +29,8 @@ export type ScreenReaderTextProps = {
|
|
|
28
29
|
*/
|
|
29
30
|
const style = { ...visuallyHidden };
|
|
30
31
|
|
|
31
|
-
const ScreenReaderText = ({ children }: ScreenReaderTextProps) => (
|
|
32
|
-
<Box sx={style} component="span">
|
|
32
|
+
const ScreenReaderText = ({ children, translate }: ScreenReaderTextProps) => (
|
|
33
|
+
<Box sx={style} component="span" translate={translate}>
|
|
33
34
|
{children}
|
|
34
35
|
</Box>
|
|
35
36
|
);
|
package/src/SearchField.tsx
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import { CloseCircleFilledIcon, SearchIcon } from "./icons.generated";
|
|
25
25
|
import { Field } from "./Field";
|
|
26
26
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
27
|
-
import type {
|
|
27
|
+
import type { AllowedProps } from "./AllowedProps";
|
|
28
28
|
import { getControlState, useInputValues } from "./inputUtils";
|
|
29
29
|
|
|
30
30
|
export type SearchFieldProps = {
|
|
@@ -79,7 +79,7 @@ export type SearchFieldProps = {
|
|
|
79
79
|
*/
|
|
80
80
|
value?: string;
|
|
81
81
|
} & Pick<FieldComponentProps, "id" | "isDisabled" | "name" | "isFullWidth"> &
|
|
82
|
-
|
|
82
|
+
AllowedProps;
|
|
83
83
|
|
|
84
84
|
const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(
|
|
85
85
|
(
|
|
@@ -98,6 +98,7 @@ const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(
|
|
|
98
98
|
onClear: onClearProp,
|
|
99
99
|
placeholder,
|
|
100
100
|
testId,
|
|
101
|
+
translate,
|
|
101
102
|
value,
|
|
102
103
|
},
|
|
103
104
|
ref
|
|
@@ -161,6 +162,7 @@ const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(
|
|
|
161
162
|
<SearchIcon />
|
|
162
163
|
</InputAdornment>
|
|
163
164
|
}
|
|
165
|
+
translate={translate}
|
|
164
166
|
type="search"
|
|
165
167
|
/>
|
|
166
168
|
),
|
|
@@ -178,6 +180,7 @@ const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(
|
|
|
178
180
|
placeholder,
|
|
179
181
|
ref,
|
|
180
182
|
testId,
|
|
183
|
+
translate,
|
|
181
184
|
]
|
|
182
185
|
);
|
|
183
186
|
|
package/src/Select.tsx
CHANGED
|
@@ -33,7 +33,7 @@ import { SelectProps as MuiSelectProps } from "@mui/material";
|
|
|
33
33
|
import { Field } from "./Field";
|
|
34
34
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
35
35
|
import { CheckIcon } from "./icons.generated";
|
|
36
|
-
import type {
|
|
36
|
+
import type { AllowedProps } from "./AllowedProps";
|
|
37
37
|
import {
|
|
38
38
|
ComponentControlledState,
|
|
39
39
|
useInputValues,
|
|
@@ -106,7 +106,7 @@ export type SelectProps<
|
|
|
106
106
|
| "isOptional"
|
|
107
107
|
| "name"
|
|
108
108
|
> &
|
|
109
|
-
|
|
109
|
+
AllowedProps;
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
112
|
* Options in Odyssey <Select> are passed as an array, which can contain any combination
|
|
@@ -146,6 +146,7 @@ const Select = <
|
|
|
146
146
|
onFocus,
|
|
147
147
|
options,
|
|
148
148
|
testId,
|
|
149
|
+
translate,
|
|
149
150
|
value,
|
|
150
151
|
}: SelectProps<Value, HasMultipleChoices>) => {
|
|
151
152
|
const hasMultipleChoices = useMemo(
|
|
@@ -297,6 +298,7 @@ const Select = <
|
|
|
297
298
|
onChange={onChange}
|
|
298
299
|
onFocus={onFocus}
|
|
299
300
|
renderValue={hasMultipleChoices ? renderValue : undefined}
|
|
301
|
+
translate={translate}
|
|
300
302
|
/>
|
|
301
303
|
),
|
|
302
304
|
[
|
|
@@ -309,6 +311,7 @@ const Select = <
|
|
|
309
311
|
onFocus,
|
|
310
312
|
renderValue,
|
|
311
313
|
testId,
|
|
314
|
+
translate,
|
|
312
315
|
]
|
|
313
316
|
);
|
|
314
317
|
|
package/src/Status.tsx
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { Chip } from "@mui/material";
|
|
14
14
|
|
|
15
15
|
import { useMuiProps } from "./MuiPropsContext";
|
|
16
|
-
import type {
|
|
16
|
+
import type { AllowedProps } from "./AllowedProps";
|
|
17
17
|
|
|
18
18
|
export const statusSeverityValues = [
|
|
19
19
|
"default",
|
|
@@ -36,12 +36,13 @@ export type StatusProps = {
|
|
|
36
36
|
* The style of the Status indicator
|
|
37
37
|
*/
|
|
38
38
|
variant?: (typeof statusVariantValues)[number];
|
|
39
|
-
} &
|
|
39
|
+
} & AllowedProps;
|
|
40
40
|
|
|
41
41
|
export const Status = ({
|
|
42
42
|
label,
|
|
43
43
|
severity,
|
|
44
44
|
testId,
|
|
45
|
+
translate,
|
|
45
46
|
variant = "lamp",
|
|
46
47
|
}: StatusProps) => {
|
|
47
48
|
const muiProps = useMuiProps();
|
|
@@ -52,6 +53,7 @@ export const Status = ({
|
|
|
52
53
|
color={severity}
|
|
53
54
|
data-se={testId}
|
|
54
55
|
label={label}
|
|
56
|
+
translate={translate}
|
|
55
57
|
variant={variant}
|
|
56
58
|
/>
|
|
57
59
|
);
|
package/src/Tabs.tsx
CHANGED
|
@@ -10,13 +10,6 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {
|
|
14
|
-
TabContext as MuiTabContext,
|
|
15
|
-
TabList as MuiTabList,
|
|
16
|
-
TabListProps as MuiTabListProps,
|
|
17
|
-
TabPanel as MuiTabPanel,
|
|
18
|
-
} from "@mui/lab";
|
|
19
|
-
import { Tab as MuiTab } from "@mui/material";
|
|
20
13
|
import {
|
|
21
14
|
ReactElement,
|
|
22
15
|
ReactNode,
|
|
@@ -25,7 +18,18 @@ import {
|
|
|
25
18
|
useEffect,
|
|
26
19
|
useState,
|
|
27
20
|
} from "react";
|
|
28
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
TabContext as MuiTabContext,
|
|
23
|
+
TabList as MuiTabList,
|
|
24
|
+
TabListProps as MuiTabListProps,
|
|
25
|
+
TabPanel as MuiTabPanel,
|
|
26
|
+
} from "@mui/lab";
|
|
27
|
+
import { Tab as MuiTab } from "@mui/material";
|
|
28
|
+
|
|
29
|
+
import { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext";
|
|
30
|
+
import { Badge, BadgeProps } from "./Badge";
|
|
31
|
+
import { AllowedProps } from "./AllowedProps";
|
|
32
|
+
import { Box } from "./Box";
|
|
29
33
|
|
|
30
34
|
export type TabItemProps = {
|
|
31
35
|
/**
|
|
@@ -48,7 +52,10 @@ export type TabItemProps = {
|
|
|
48
52
|
* The value associated with the TabItem
|
|
49
53
|
*/
|
|
50
54
|
value?: string;
|
|
51
|
-
} &
|
|
55
|
+
} & {
|
|
56
|
+
notificationCount?: BadgeProps["badgeContent"];
|
|
57
|
+
notificationCountMax?: BadgeProps["badgeContentMax"];
|
|
58
|
+
} & AllowedProps;
|
|
52
59
|
|
|
53
60
|
export type TabsProps = {
|
|
54
61
|
/**
|
|
@@ -74,6 +81,42 @@ export type TabsProps = {
|
|
|
74
81
|
onChange?: MuiTabListProps["onChange"];
|
|
75
82
|
};
|
|
76
83
|
|
|
84
|
+
const TabLabel = ({
|
|
85
|
+
label,
|
|
86
|
+
notificationCount,
|
|
87
|
+
notificationCountMax,
|
|
88
|
+
tabState,
|
|
89
|
+
value,
|
|
90
|
+
}: Pick<
|
|
91
|
+
TabItemProps,
|
|
92
|
+
"label" | "notificationCount" | "notificationCountMax" | "value"
|
|
93
|
+
> & {
|
|
94
|
+
tabState: string;
|
|
95
|
+
}) => {
|
|
96
|
+
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<>
|
|
100
|
+
{label}
|
|
101
|
+
{notificationCount !== undefined && notificationCount > 0 && (
|
|
102
|
+
<Box
|
|
103
|
+
sx={{
|
|
104
|
+
marginInlineStart: notificationCount
|
|
105
|
+
? odysseyDesignTokens.Spacing2
|
|
106
|
+
: 0,
|
|
107
|
+
}}
|
|
108
|
+
>
|
|
109
|
+
<Badge
|
|
110
|
+
badgeContent={notificationCount}
|
|
111
|
+
badgeContentMax={notificationCountMax}
|
|
112
|
+
type={value === tabState ? "attention" : "default"}
|
|
113
|
+
/>
|
|
114
|
+
</Box>
|
|
115
|
+
)}
|
|
116
|
+
</>
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
|
|
77
120
|
const Tabs = ({
|
|
78
121
|
ariaLabel,
|
|
79
122
|
initialValue,
|
|
@@ -97,19 +140,44 @@ const Tabs = ({
|
|
|
97
140
|
}
|
|
98
141
|
}, [value]);
|
|
99
142
|
|
|
143
|
+
const renderTab = useCallback(
|
|
144
|
+
(tab, index) => {
|
|
145
|
+
const {
|
|
146
|
+
testId,
|
|
147
|
+
isDisabled,
|
|
148
|
+
label,
|
|
149
|
+
startIcon,
|
|
150
|
+
value,
|
|
151
|
+
notificationCount,
|
|
152
|
+
notificationCountMax,
|
|
153
|
+
} = tab;
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<MuiTab
|
|
157
|
+
data-se={testId}
|
|
158
|
+
disabled={isDisabled}
|
|
159
|
+
icon={startIcon}
|
|
160
|
+
label={
|
|
161
|
+
<TabLabel
|
|
162
|
+
label={label}
|
|
163
|
+
notificationCount={notificationCount}
|
|
164
|
+
notificationCountMax={notificationCountMax}
|
|
165
|
+
tabState={tabState}
|
|
166
|
+
value={value}
|
|
167
|
+
/>
|
|
168
|
+
}
|
|
169
|
+
value={value ? value : index.toString()}
|
|
170
|
+
key={value ? value : index.toString()}
|
|
171
|
+
/>
|
|
172
|
+
);
|
|
173
|
+
},
|
|
174
|
+
[tabState]
|
|
175
|
+
);
|
|
176
|
+
|
|
100
177
|
return (
|
|
101
178
|
<MuiTabContext value={tabState}>
|
|
102
179
|
<MuiTabList onChange={onChange} aria-label={ariaLabel}>
|
|
103
|
-
{tabs.map((tab, index) => (
|
|
104
|
-
<MuiTab
|
|
105
|
-
data-se={tab.testId}
|
|
106
|
-
disabled={tab.isDisabled}
|
|
107
|
-
icon={tab.startIcon}
|
|
108
|
-
label={tab.label}
|
|
109
|
-
value={tab.value ? tab.value : index.toString()}
|
|
110
|
-
key={tab.value ? tab.value : index.toString()}
|
|
111
|
-
/>
|
|
112
|
-
))}
|
|
180
|
+
{tabs.map((tab, index) => renderTab(tab, index))}
|
|
113
181
|
</MuiTabList>
|
|
114
182
|
{tabs.map((tab, index) => (
|
|
115
183
|
<MuiTabPanel
|
package/src/Tag.tsx
CHANGED
|
@@ -14,7 +14,7 @@ import { Chip as MuiChip, ChipProps as MuiChipProps } from "@mui/material";
|
|
|
14
14
|
import { memo, ReactElement, useCallback, useContext } from "react";
|
|
15
15
|
import { TagListContext } from "./TagListContext";
|
|
16
16
|
import { MuiPropsContext } from "./MuiPropsContext";
|
|
17
|
-
import {
|
|
17
|
+
import { AllowedProps } from "./AllowedProps";
|
|
18
18
|
|
|
19
19
|
export type TagProps = {
|
|
20
20
|
icon?: ReactElement;
|
|
@@ -31,7 +31,7 @@ export type TagProps = {
|
|
|
31
31
|
* Callback fired when the remove button of the Tag is clicked
|
|
32
32
|
*/
|
|
33
33
|
onRemove?: MuiChipProps["onDelete"];
|
|
34
|
-
} &
|
|
34
|
+
} & AllowedProps;
|
|
35
35
|
|
|
36
36
|
const Tag = ({
|
|
37
37
|
icon,
|
|
@@ -40,6 +40,7 @@ const Tag = ({
|
|
|
40
40
|
onClick,
|
|
41
41
|
onRemove,
|
|
42
42
|
testId,
|
|
43
|
+
translate,
|
|
43
44
|
}: TagProps) => {
|
|
44
45
|
const { chipElementType } = useContext(TagListContext);
|
|
45
46
|
|
|
@@ -56,9 +57,19 @@ const Tag = ({
|
|
|
56
57
|
label={label}
|
|
57
58
|
onClick={onClick}
|
|
58
59
|
onDelete={onRemove}
|
|
60
|
+
translate={translate}
|
|
59
61
|
/>
|
|
60
62
|
),
|
|
61
|
-
[
|
|
63
|
+
[
|
|
64
|
+
chipElementType,
|
|
65
|
+
icon,
|
|
66
|
+
isDisabled,
|
|
67
|
+
label,
|
|
68
|
+
onClick,
|
|
69
|
+
onRemove,
|
|
70
|
+
testId,
|
|
71
|
+
translate,
|
|
72
|
+
]
|
|
62
73
|
);
|
|
63
74
|
|
|
64
75
|
return <MuiPropsContext.Consumer>{renderTag}</MuiPropsContext.Consumer>;
|
package/src/TagList.tsx
CHANGED
|
@@ -14,14 +14,14 @@ import { Tag } from "./Tag";
|
|
|
14
14
|
import { Stack } from "@mui/material";
|
|
15
15
|
import { memo, ReactElement, useMemo } from "react";
|
|
16
16
|
import { ChipElementType, TagListContext } from "./TagListContext";
|
|
17
|
-
import {
|
|
17
|
+
import { AllowedProps } from "./AllowedProps";
|
|
18
18
|
|
|
19
19
|
export type TagListProps = {
|
|
20
20
|
/**
|
|
21
21
|
* The Tag or array of Tags within the TagList
|
|
22
22
|
*/
|
|
23
23
|
children: ReactElement<typeof Tag> | Array<ReactElement<typeof Tag>>;
|
|
24
|
-
} &
|
|
24
|
+
} & AllowedProps;
|
|
25
25
|
|
|
26
26
|
const TagList = ({ children, testId }: TagListProps) => {
|
|
27
27
|
const providerValue = useMemo<{
|