@okta/odyssey-react-mui 1.12.9 → 1.12.11
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.map +1 -1
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Badge.js.map +1 -1
- package/dist/Banner.js.map +1 -1
- package/dist/Box.js.map +1 -1
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/Button.js +27 -25
- package/dist/Button.js.map +1 -1
- package/dist/Callout.js.map +1 -1
- package/dist/Checkbox.js.map +1 -1
- package/dist/CheckboxGroup.js.map +1 -1
- package/dist/CircularProgress.js.map +1 -1
- package/dist/Dialog.js.map +1 -1
- package/dist/FieldError.js.map +1 -1
- package/dist/FieldHint.js.map +1 -1
- package/dist/FieldLabel.js.map +1 -1
- package/dist/Fieldset.js.map +1 -1
- package/dist/Form.js.map +1 -1
- package/dist/HtmlProps.js +2 -0
- package/dist/HtmlProps.js.map +1 -0
- package/dist/Link.js.map +1 -1
- package/dist/MenuButton.js.map +1 -1
- package/dist/MenuItem.js.map +1 -1
- package/dist/MuiPropsContext.js.map +1 -1
- package/dist/NativeSelect.js.map +1 -1
- package/dist/PasswordField.js.map +1 -1
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js.map +1 -1
- package/dist/ScreenReaderText.js.map +1 -1
- package/dist/SearchField.js.map +1 -1
- package/dist/Select.js +1 -1
- package/dist/Select.js.map +1 -1
- package/dist/Status.js.map +1 -1
- package/dist/Tabs.js.map +1 -1
- package/dist/Tag.js.map +1 -1
- package/dist/TagList.js.map +1 -1
- package/dist/TextField.js.map +1 -1
- package/dist/Toast.js.map +1 -1
- package/dist/Tooltip.js.map +1 -1
- package/dist/Typography.js.map +1 -1
- package/dist/labs/Switch.js.map +1 -1
- package/dist/labs/VirtualizedAutocomplete.js.map +1 -1
- package/dist/src/Accordion.d.ts +2 -2
- package/dist/src/Accordion.d.ts.map +1 -1
- package/dist/src/Autocomplete.d.ts +2 -2
- package/dist/src/Autocomplete.d.ts.map +1 -1
- package/dist/src/Badge.d.ts +2 -2
- package/dist/src/Badge.d.ts.map +1 -1
- package/dist/src/Banner.d.ts +2 -2
- 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 +2 -2
- package/dist/src/Breadcrumbs.d.ts.map +1 -1
- package/dist/src/Button.d.ts +2 -2
- package/dist/src/Button.d.ts.map +1 -1
- package/dist/src/Callout.d.ts +2 -2
- package/dist/src/Callout.d.ts.map +1 -1
- package/dist/src/Checkbox.d.ts +2 -2
- package/dist/src/Checkbox.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/CircularProgress.d.ts +2 -2
- package/dist/src/CircularProgress.d.ts.map +1 -1
- package/dist/src/Dialog.d.ts +2 -2
- package/dist/src/Dialog.d.ts.map +1 -1
- package/dist/src/FieldError.d.ts +2 -2
- package/dist/src/FieldError.d.ts.map +1 -1
- package/dist/src/FieldHint.d.ts +2 -2
- package/dist/src/FieldHint.d.ts.map +1 -1
- package/dist/src/FieldLabel.d.ts +2 -2
- package/dist/src/FieldLabel.d.ts.map +1 -1
- package/dist/src/Fieldset.d.ts +2 -2
- package/dist/src/Fieldset.d.ts.map +1 -1
- package/dist/src/Form.d.ts +2 -2
- package/dist/src/Form.d.ts.map +1 -1
- package/dist/src/{AllowedProps.d.ts → HtmlProps.d.ts} +2 -2
- package/dist/src/HtmlProps.d.ts.map +1 -0
- package/dist/src/Link.d.ts +2 -2
- package/dist/src/Link.d.ts.map +1 -1
- package/dist/src/MenuButton.d.ts +2 -2
- 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/MuiPropsContext.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 +2 -2
- package/dist/src/Radio.d.ts.map +1 -1
- package/dist/src/RadioGroup.d.ts +2 -2
- package/dist/src/RadioGroup.d.ts.map +1 -1
- package/dist/src/ScreenReaderText.d.ts +2 -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 +2 -2
- package/dist/src/Select.d.ts.map +1 -1
- package/dist/src/Status.d.ts +2 -2
- package/dist/src/Status.d.ts.map +1 -1
- package/dist/src/Tabs.d.ts +2 -2
- package/dist/src/Tabs.d.ts.map +1 -1
- package/dist/src/Tag.d.ts +2 -2
- 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 +2 -2
- package/dist/src/Toast.d.ts.map +1 -1
- package/dist/src/Tooltip.d.ts +2 -2
- package/dist/src/Tooltip.d.ts.map +1 -1
- package/dist/src/Typography.d.ts +2 -2
- 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 +2 -2
- package/dist/src/labs/VirtualizedAutocomplete.d.ts.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Accordion.tsx +2 -2
- package/src/Autocomplete.tsx +2 -2
- package/src/Badge.tsx +2 -2
- package/src/Banner.tsx +2 -2
- package/src/Box.tsx +2 -2
- package/src/Breadcrumbs.tsx +2 -2
- package/src/Button.tsx +37 -35
- package/src/Callout.tsx +2 -2
- package/src/Checkbox.tsx +2 -2
- package/src/CheckboxGroup.tsx +2 -2
- package/src/CircularProgress.tsx +2 -2
- package/src/Dialog.tsx +2 -2
- package/src/FieldError.tsx +2 -2
- package/src/FieldHint.tsx +2 -2
- package/src/FieldLabel.tsx +2 -2
- package/src/Fieldset.tsx +2 -2
- package/src/Form.tsx +2 -2
- package/src/{AllowedProps.ts → HtmlProps.ts} +1 -1
- package/src/Link.tsx +2 -2
- package/src/MenuButton.tsx +2 -2
- package/src/MenuItem.tsx +2 -2
- package/src/MuiPropsContext.ts +0 -1
- package/src/NativeSelect.tsx +2 -2
- package/src/PasswordField.tsx +2 -2
- package/src/Radio.tsx +2 -2
- package/src/RadioGroup.tsx +2 -2
- package/src/ScreenReaderText.tsx +2 -2
- package/src/SearchField.tsx +2 -2
- package/src/Select.tsx +9 -7
- package/src/Status.tsx +2 -2
- package/src/Tabs.tsx +2 -2
- package/src/Tag.tsx +2 -2
- package/src/TagList.tsx +2 -2
- package/src/TextField.tsx +2 -2
- package/src/Toast.tsx +2 -2
- package/src/Tooltip.tsx +2 -2
- package/src/Typography.tsx +2 -2
- package/src/labs/Switch.tsx +2 -2
- package/src/labs/VirtualizedAutocomplete.tsx +2 -2
- package/dist/AllowedProps.js +0 -2
- package/dist/AllowedProps.js.map +0 -1
- package/dist/src/AllowedProps.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okta/odyssey-react-mui",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.11",
|
|
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.12.
|
|
54
|
+
"@okta/odyssey-design-tokens": "1.12.11",
|
|
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": "ebf671d9cd017cca109a7d341f500f54c3e47e41"
|
|
67
67
|
}
|
package/src/Accordion.tsx
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { ReactNode, memo } from "react";
|
|
14
|
-
import type {
|
|
14
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
15
15
|
import {
|
|
16
16
|
Accordion as MuiAccordion,
|
|
17
17
|
AccordionDetails as MuiAccordionDetails,
|
|
@@ -65,7 +65,7 @@ export type AccordionProps = {
|
|
|
65
65
|
isExpanded?: never;
|
|
66
66
|
}
|
|
67
67
|
) &
|
|
68
|
-
|
|
68
|
+
HtmlProps;
|
|
69
69
|
|
|
70
70
|
const Accordion = ({
|
|
71
71
|
children,
|
package/src/Autocomplete.tsx
CHANGED
|
@@ -21,7 +21,7 @@ import { memo, useCallback, useMemo, useRef } from "react";
|
|
|
21
21
|
|
|
22
22
|
import { Field } from "./Field";
|
|
23
23
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
24
|
-
import type {
|
|
24
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
25
25
|
import {
|
|
26
26
|
ComponentControlledState,
|
|
27
27
|
useInputValues,
|
|
@@ -171,7 +171,7 @@ export type AutocompleteProps<
|
|
|
171
171
|
| "isOptional"
|
|
172
172
|
| "name"
|
|
173
173
|
> &
|
|
174
|
-
|
|
174
|
+
HtmlProps;
|
|
175
175
|
|
|
176
176
|
const Autocomplete = <
|
|
177
177
|
OptionType,
|
package/src/Badge.tsx
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
DesignTokens,
|
|
18
18
|
} from "./OdysseyDesignTokensContext";
|
|
19
19
|
import { Box } from "./Box";
|
|
20
|
-
import type {
|
|
20
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
21
21
|
|
|
22
22
|
export type BadgeContentMax = 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100;
|
|
23
23
|
|
|
@@ -27,7 +27,7 @@ export type BadgeProps = {
|
|
|
27
27
|
badgeContent: number;
|
|
28
28
|
badgeContentMax?: BadgeContentMax;
|
|
29
29
|
type?: (typeof badgeTypeValues)[number];
|
|
30
|
-
} &
|
|
30
|
+
} & HtmlProps;
|
|
31
31
|
|
|
32
32
|
const badgeTypeColors = (odysseyTokens: DesignTokens) => ({
|
|
33
33
|
default: {
|
package/src/Banner.tsx
CHANGED
|
@@ -16,7 +16,7 @@ import { ScreenReaderText } from "./ScreenReaderText";
|
|
|
16
16
|
import { memo } from "react";
|
|
17
17
|
import { useTranslation } from "react-i18next";
|
|
18
18
|
|
|
19
|
-
import type {
|
|
19
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
20
20
|
|
|
21
21
|
export const bannerRoleValues = ["status", "alert"] as const;
|
|
22
22
|
export const bannerSeverityValues: AlertColor[] = [
|
|
@@ -56,7 +56,7 @@ export type BannerProps = {
|
|
|
56
56
|
* The text content of the alert
|
|
57
57
|
*/
|
|
58
58
|
text: string;
|
|
59
|
-
} &
|
|
59
|
+
} & HtmlProps;
|
|
60
60
|
|
|
61
61
|
const Banner = ({
|
|
62
62
|
linkUrl,
|
package/src/Box.tsx
CHANGED
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
import { Box as MuiBox, BoxProps as MuiBoxProps } from "@mui/material";
|
|
14
14
|
import { ReactNode, forwardRef, memo } from "react";
|
|
15
15
|
|
|
16
|
-
import type {
|
|
16
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
17
17
|
|
|
18
18
|
export type BoxProps = {
|
|
19
19
|
children?: ReactNode;
|
|
20
20
|
component?: MuiBoxProps["component"];
|
|
21
21
|
id?: MuiBoxProps["id"];
|
|
22
22
|
sx?: MuiBoxProps["sx"];
|
|
23
|
-
} &
|
|
23
|
+
} & HtmlProps;
|
|
24
24
|
|
|
25
25
|
const Box = forwardRef<HTMLElement, BoxProps>(
|
|
26
26
|
({ children, component, id, sx, testId, translate }, ref) => (
|
package/src/Breadcrumbs.tsx
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
import { GroupIcon, HomeIcon, UserIcon } from "./icons.generated";
|
|
30
30
|
import { Subordinate } from "./Typography";
|
|
31
31
|
import { useTranslation } from "react-i18next";
|
|
32
|
-
import {
|
|
32
|
+
import { HtmlProps } from "./HtmlProps";
|
|
33
33
|
|
|
34
34
|
export type BreadcrumbType = "listItem" | "menuItem" | "currentPage";
|
|
35
35
|
|
|
@@ -43,7 +43,7 @@ export type BreadcrumbsProps = {
|
|
|
43
43
|
children: ReactElement<typeof Breadcrumb>[];
|
|
44
44
|
homeHref?: string;
|
|
45
45
|
maxVisibleItems?: number;
|
|
46
|
-
} &
|
|
46
|
+
} & HtmlProps;
|
|
47
47
|
|
|
48
48
|
export type BreadcrumbContextType = {
|
|
49
49
|
breadcrumbType: BreadcrumbType;
|
package/src/Button.tsx
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
|
|
23
23
|
import { MuiPropsContext, useMuiProps } from "./MuiPropsContext";
|
|
24
24
|
import { Tooltip } from "./Tooltip";
|
|
25
|
-
import type {
|
|
25
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
26
26
|
import { FocusHandle } from "./inputUtils";
|
|
27
27
|
|
|
28
28
|
export const buttonSizeValues = ["small", "medium", "large"] as const;
|
|
@@ -113,7 +113,7 @@ export type ButtonProps = {
|
|
|
113
113
|
startIcon?: ReactElement;
|
|
114
114
|
}
|
|
115
115
|
) &
|
|
116
|
-
|
|
116
|
+
HtmlProps;
|
|
117
117
|
|
|
118
118
|
const Button = ({
|
|
119
119
|
ariaDescribedBy,
|
|
@@ -135,8 +135,8 @@ const Button = ({
|
|
|
135
135
|
variant,
|
|
136
136
|
}: ButtonProps) => {
|
|
137
137
|
const muiProps = useMuiProps();
|
|
138
|
-
|
|
139
138
|
const localButtonRef = useRef<HTMLButtonElement>(null);
|
|
139
|
+
|
|
140
140
|
useImperativeHandle(
|
|
141
141
|
buttonRef,
|
|
142
142
|
() => {
|
|
@@ -150,28 +150,32 @@ const Button = ({
|
|
|
150
150
|
);
|
|
151
151
|
|
|
152
152
|
const renderButton = useCallback(
|
|
153
|
-
(muiProps) =>
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
153
|
+
(muiProps) => {
|
|
154
|
+
muiProps?.ref?.(localButtonRef.current);
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
<MuiButton
|
|
158
|
+
{...muiProps}
|
|
159
|
+
aria-label={ariaLabel}
|
|
160
|
+
aria-labelledby={ariaLabelledBy}
|
|
161
|
+
aria-describedby={ariaDescribedBy}
|
|
162
|
+
data-se={testId}
|
|
163
|
+
disabled={isDisabled}
|
|
164
|
+
endIcon={endIcon}
|
|
165
|
+
fullWidth={isFullWidth}
|
|
166
|
+
id={id}
|
|
167
|
+
onClick={onClick}
|
|
168
|
+
ref={localButtonRef}
|
|
169
|
+
size={size}
|
|
170
|
+
startIcon={startIcon}
|
|
171
|
+
translate={translate}
|
|
172
|
+
type={type}
|
|
173
|
+
variant={variant}
|
|
174
|
+
>
|
|
175
|
+
{label}
|
|
176
|
+
</MuiButton>
|
|
177
|
+
);
|
|
178
|
+
},
|
|
175
179
|
[
|
|
176
180
|
ariaDescribedBy,
|
|
177
181
|
ariaLabel,
|
|
@@ -191,17 +195,15 @@ const Button = ({
|
|
|
191
195
|
]
|
|
192
196
|
);
|
|
193
197
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
<
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
if (tooltipText) {
|
|
199
|
+
return (
|
|
200
|
+
<Tooltip ariaType="description" placement="top" text={tooltipText}>
|
|
201
|
+
<MuiPropsContext.Consumer>{renderButton}</MuiPropsContext.Consumer>
|
|
202
|
+
</Tooltip>
|
|
203
|
+
);
|
|
204
|
+
}
|
|
201
205
|
|
|
202
|
-
|
|
203
|
-
</>
|
|
204
|
-
);
|
|
206
|
+
return renderButton(muiProps);
|
|
205
207
|
};
|
|
206
208
|
|
|
207
209
|
const MemoizedButton = memo(Button);
|
package/src/Callout.tsx
CHANGED
|
@@ -15,7 +15,7 @@ import { Alert, AlertTitle, Box } from "@mui/material";
|
|
|
15
15
|
import { ScreenReaderText } from "./ScreenReaderText";
|
|
16
16
|
import { useTranslation } from "react-i18next";
|
|
17
17
|
|
|
18
|
-
import type {
|
|
18
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
19
19
|
import { Link } from "./Link";
|
|
20
20
|
import { Paragraph } from "./Typography";
|
|
21
21
|
|
|
@@ -78,7 +78,7 @@ export type CalloutProps = {
|
|
|
78
78
|
linkText?: never;
|
|
79
79
|
}
|
|
80
80
|
) &
|
|
81
|
-
|
|
81
|
+
HtmlProps;
|
|
82
82
|
|
|
83
83
|
const Callout = ({
|
|
84
84
|
children,
|
package/src/Checkbox.tsx
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
|
|
23
23
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
24
24
|
import { Typography } from "./Typography";
|
|
25
|
-
import type {
|
|
25
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
26
26
|
import {
|
|
27
27
|
ComponentControlledState,
|
|
28
28
|
FocusHandle,
|
|
@@ -83,7 +83,7 @@ export type CheckboxProps = {
|
|
|
83
83
|
onBlur?: MuiFormControlLabelProps["onBlur"];
|
|
84
84
|
} & Pick<FieldComponentProps, "id" | "isDisabled" | "name"> &
|
|
85
85
|
CheckedFieldProps<MuiCheckboxProps> &
|
|
86
|
-
|
|
86
|
+
HtmlProps;
|
|
87
87
|
|
|
88
88
|
const Checkbox = ({
|
|
89
89
|
ariaLabel,
|
package/src/CheckboxGroup.tsx
CHANGED
|
@@ -16,7 +16,7 @@ import { memo, ReactElement, useCallback } from "react";
|
|
|
16
16
|
import { Checkbox } from "./Checkbox";
|
|
17
17
|
import { Field } from "./Field";
|
|
18
18
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
19
|
-
import type {
|
|
19
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
20
20
|
|
|
21
21
|
export type CheckboxGroupProps = {
|
|
22
22
|
/**
|
|
@@ -43,7 +43,7 @@ export type CheckboxGroupProps = {
|
|
|
43
43
|
| "id"
|
|
44
44
|
| "isDisabled"
|
|
45
45
|
> &
|
|
46
|
-
|
|
46
|
+
HtmlProps;
|
|
47
47
|
|
|
48
48
|
const CheckboxGroup = ({
|
|
49
49
|
ariaDescribedBy,
|
package/src/CircularProgress.tsx
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { memo } from "react";
|
|
14
14
|
import { CircularProgress as MuiCircularProgress } from "@mui/material";
|
|
15
15
|
|
|
16
|
-
import type {
|
|
16
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
17
17
|
|
|
18
18
|
export type CircularProgressProps = {
|
|
19
19
|
/**
|
|
@@ -25,7 +25,7 @@ export type CircularProgressProps = {
|
|
|
25
25
|
* If undefined, the spinner will spin perpetually.
|
|
26
26
|
*/
|
|
27
27
|
value?: number;
|
|
28
|
-
} &
|
|
28
|
+
} & HtmlProps;
|
|
29
29
|
|
|
30
30
|
const CircularProgress = ({
|
|
31
31
|
ariaLabel,
|
package/src/Dialog.tsx
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
ReactElement,
|
|
30
30
|
} from "react";
|
|
31
31
|
|
|
32
|
-
import type {
|
|
32
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
33
33
|
|
|
34
34
|
export type DialogProps = {
|
|
35
35
|
/**
|
|
@@ -64,7 +64,7 @@ export type DialogProps = {
|
|
|
64
64
|
* The title of the Dialog
|
|
65
65
|
*/
|
|
66
66
|
title: string;
|
|
67
|
-
} &
|
|
67
|
+
} & HtmlProps;
|
|
68
68
|
|
|
69
69
|
const Dialog = ({
|
|
70
70
|
callToActionFirstComponent,
|
package/src/FieldError.tsx
CHANGED
|
@@ -17,14 +17,14 @@ import { ScreenReaderText } from "./ScreenReaderText";
|
|
|
17
17
|
import { ErrorMessageList } from "./ErrorMessageList";
|
|
18
18
|
import { useTranslation } from "react-i18next";
|
|
19
19
|
|
|
20
|
-
import type {
|
|
20
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
21
21
|
import { Box } from "./Box";
|
|
22
22
|
|
|
23
23
|
export type FieldErrorProps = {
|
|
24
24
|
id?: string;
|
|
25
25
|
message?: string;
|
|
26
26
|
messageList?: string[];
|
|
27
|
-
} &
|
|
27
|
+
} & HtmlProps;
|
|
28
28
|
|
|
29
29
|
const FieldError = ({
|
|
30
30
|
id,
|
package/src/FieldHint.tsx
CHANGED
|
@@ -15,13 +15,13 @@ import { memo } from "react";
|
|
|
15
15
|
import { FormHelperText } from "@mui/material";
|
|
16
16
|
|
|
17
17
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
18
|
-
import type {
|
|
18
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
19
19
|
|
|
20
20
|
export type FieldHintProps = {
|
|
21
21
|
LinkComponent?: FieldComponentProps["HintLinkComponent"];
|
|
22
22
|
id?: string;
|
|
23
23
|
text: string;
|
|
24
|
-
} &
|
|
24
|
+
} & HtmlProps;
|
|
25
25
|
|
|
26
26
|
const FieldHint = ({
|
|
27
27
|
id,
|
package/src/FieldLabel.tsx
CHANGED
|
@@ -16,7 +16,7 @@ import { memo, useMemo } from "react";
|
|
|
16
16
|
import { useTranslation } from "react-i18next";
|
|
17
17
|
import { ScreenReaderText } from "./ScreenReaderText";
|
|
18
18
|
import { Subordinate } from "./Typography";
|
|
19
|
-
import type {
|
|
19
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
20
20
|
|
|
21
21
|
export type FieldLabelProps = {
|
|
22
22
|
hasVisibleLabel: boolean;
|
|
@@ -24,7 +24,7 @@ export type FieldLabelProps = {
|
|
|
24
24
|
inputId: string;
|
|
25
25
|
isOptional: boolean;
|
|
26
26
|
text: string;
|
|
27
|
-
} &
|
|
27
|
+
} & HtmlProps;
|
|
28
28
|
|
|
29
29
|
const FieldLabel = ({
|
|
30
30
|
hasVisibleLabel,
|
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 { HtmlProps } from "./HtmlProps";
|
|
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
|
+
} & HtmlProps;
|
|
53
53
|
|
|
54
54
|
const Fieldset = ({
|
|
55
55
|
alert,
|
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 { HtmlProps } from "./HtmlProps";
|
|
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
|
+
} & HtmlProps;
|
|
89
89
|
|
|
90
90
|
const Form = ({
|
|
91
91
|
alert,
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
export type
|
|
13
|
+
export type HtmlProps = {
|
|
14
14
|
/**
|
|
15
15
|
* This prop puts a `data` attribute on an HTML element in this component with the value provided.
|
|
16
16
|
*
|
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 { HtmlProps } from "./HtmlProps";
|
|
16
16
|
import { FocusHandle } from "./inputUtils";
|
|
17
17
|
|
|
18
18
|
import { Link as MuiLink, LinkProps as MuiLinkProps } from "@mui/material";
|
|
@@ -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
|
+
} & HtmlProps;
|
|
61
61
|
|
|
62
62
|
const Link = ({
|
|
63
63
|
children,
|
package/src/MenuButton.tsx
CHANGED
|
@@ -29,7 +29,7 @@ import { ChevronDownIcon, MoreIcon } from "./icons.generated";
|
|
|
29
29
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
30
30
|
import { MenuContext, MenuContextType } from "./MenuContext";
|
|
31
31
|
import { NullElement } from "./NullElement";
|
|
32
|
-
import type {
|
|
32
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
33
33
|
|
|
34
34
|
export const menuAlignmentValues = ["left", "right"] as const;
|
|
35
35
|
|
|
@@ -111,7 +111,7 @@ export type MenuButtonProps = {
|
|
|
111
111
|
}
|
|
112
112
|
) &
|
|
113
113
|
Pick<FieldComponentProps, "isDisabled"> &
|
|
114
|
-
|
|
114
|
+
HtmlProps;
|
|
115
115
|
|
|
116
116
|
const MenuButton = ({
|
|
117
117
|
ariaLabel,
|
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 { HtmlProps } from "./HtmlProps";
|
|
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
|
+
} & HtmlProps;
|
|
55
55
|
|
|
56
56
|
const MenuItem = ({
|
|
57
57
|
children,
|
package/src/MuiPropsContext.ts
CHANGED
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
import { createContext, useContext } from "react";
|
|
14
14
|
|
|
15
15
|
export type MuiPropsContextType = Record<string, unknown>;
|
|
16
|
-
|
|
17
16
|
export const MuiPropsContext = createContext<MuiPropsContextType>({});
|
|
18
17
|
|
|
19
18
|
export const useMuiProps = () => useContext(MuiPropsContext);
|
package/src/NativeSelect.tsx
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from "@mui/material";
|
|
27
27
|
import { Field } from "./Field";
|
|
28
28
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
29
|
-
import type {
|
|
29
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
30
30
|
import { FocusHandle, getControlState, useInputValues } from "./inputUtils";
|
|
31
31
|
import { ForwardRefWithType } from "./@types/react-augment";
|
|
32
32
|
|
|
@@ -103,7 +103,7 @@ export type NativeSelectProps<
|
|
|
103
103
|
| "isFullWidth"
|
|
104
104
|
| "isOptional"
|
|
105
105
|
> &
|
|
106
|
-
|
|
106
|
+
HtmlProps;
|
|
107
107
|
|
|
108
108
|
const NativeSelect: ForwardRefWithType = forwardRef(
|
|
109
109
|
<
|
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 { HtmlProps } from "./HtmlProps";
|
|
29
29
|
import { useTranslation } from "react-i18next";
|
|
30
30
|
import { FocusHandle, getControlState, useInputValues } from "./inputUtils";
|
|
31
31
|
|
|
@@ -77,7 +77,7 @@ export type PasswordFieldProps = {
|
|
|
77
77
|
*/
|
|
78
78
|
value?: string;
|
|
79
79
|
} & FieldComponentProps &
|
|
80
|
-
|
|
80
|
+
HtmlProps;
|
|
81
81
|
|
|
82
82
|
const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(
|
|
83
83
|
(
|
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 { HtmlProps } from "./HtmlProps";
|
|
23
23
|
import { FocusHandle } from "./inputUtils";
|
|
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
|
+
HtmlProps;
|
|
56
56
|
|
|
57
57
|
const Radio = ({
|
|
58
58
|
inputRef,
|
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 { HtmlProps } from "./HtmlProps";
|
|
23
23
|
import { getControlState, useInputValues } from "./inputUtils";
|
|
24
24
|
|
|
25
25
|
export type RadioGroupProps = {
|
|
@@ -54,7 +54,7 @@ export type RadioGroupProps = {
|
|
|
54
54
|
| "isDisabled"
|
|
55
55
|
| "name"
|
|
56
56
|
> &
|
|
57
|
-
|
|
57
|
+
HtmlProps;
|
|
58
58
|
|
|
59
59
|
const RadioGroup = ({
|
|
60
60
|
ariaDescribedBy,
|
package/src/ScreenReaderText.tsx
CHANGED
|
@@ -13,14 +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 {
|
|
16
|
+
import { HtmlProps } from "./HtmlProps";
|
|
17
17
|
|
|
18
18
|
export type ScreenReaderTextProps = {
|
|
19
19
|
/**
|
|
20
20
|
* The visually-hidden text.
|
|
21
21
|
*/
|
|
22
22
|
children: ReactNode;
|
|
23
|
-
} &
|
|
23
|
+
} & HtmlProps;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* MUI sx expects you pass in a CSS object, not an object with CSS.
|
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 { HtmlProps } from "./HtmlProps";
|
|
28
28
|
import { getControlState, useInputValues } from "./inputUtils";
|
|
29
29
|
|
|
30
30
|
export type SearchFieldProps = {
|
|
@@ -82,7 +82,7 @@ export type SearchFieldProps = {
|
|
|
82
82
|
FieldComponentProps,
|
|
83
83
|
"ariaDescribedBy" | "id" | "isDisabled" | "name" | "isFullWidth"
|
|
84
84
|
> &
|
|
85
|
-
|
|
85
|
+
HtmlProps;
|
|
86
86
|
|
|
87
87
|
const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(
|
|
88
88
|
(
|
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 { HtmlProps } from "./HtmlProps";
|
|
37
37
|
import {
|
|
38
38
|
ComponentControlledState,
|
|
39
39
|
FocusHandle,
|
|
@@ -109,7 +109,7 @@ export type SelectProps<
|
|
|
109
109
|
| "isOptional"
|
|
110
110
|
| "name"
|
|
111
111
|
> &
|
|
112
|
-
|
|
112
|
+
HtmlProps;
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
115
|
* Options in Odyssey <Select> are passed as an array, which can contain any combination
|
|
@@ -288,11 +288,13 @@ const Select = <
|
|
|
288
288
|
/>
|
|
289
289
|
)}
|
|
290
290
|
{option.text}
|
|
291
|
-
{
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
291
|
+
{!hasMultipleChoices &&
|
|
292
|
+
(internalSelectedValues?.includes(option.value) ||
|
|
293
|
+
internalSelectedValues === option.value) && (
|
|
294
|
+
<ListItemSecondaryAction>
|
|
295
|
+
<CheckIcon />
|
|
296
|
+
</ListItemSecondaryAction>
|
|
297
|
+
)}
|
|
296
298
|
</MenuItem>
|
|
297
299
|
);
|
|
298
300
|
}),
|