@okta/odyssey-react-mui 1.9.16 → 1.9.18
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/Callout.js +12 -1
- package/dist/Callout.js.map +1 -1
- package/dist/Status.js +2 -4
- package/dist/Status.js.map +1 -1
- package/dist/Tabs.js +2 -0
- package/dist/Tabs.js.map +1 -1
- package/dist/src/Callout.d.ts +27 -3
- package/dist/src/Callout.d.ts.map +1 -1
- package/dist/src/Status.d.ts +1 -6
- package/dist/src/Status.d.ts.map +1 -1
- package/dist/src/Tabs.d.ts.map +1 -1
- package/dist/src/theme/components.d.ts.map +1 -1
- package/dist/theme/components.js +75 -49
- package/dist/theme/components.js.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Callout.tsx +46 -3
- package/src/Status.tsx +2 -13
- package/src/Tabs.tsx +6 -1
- package/src/theme/components.tsx +82 -50
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okta/odyssey-react-mui",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.18",
|
|
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.9.
|
|
54
|
+
"@okta/odyssey-design-tokens": "1.9.18",
|
|
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": "8a77d836848d7af0e8f42dd010ffc3f11c535ca7"
|
|
67
67
|
}
|
package/src/Callout.tsx
CHANGED
|
@@ -16,6 +16,8 @@ import { ScreenReaderText } from "./ScreenReaderText";
|
|
|
16
16
|
import { useTranslation } from "react-i18next";
|
|
17
17
|
|
|
18
18
|
import type { AllowedProps } from "./AllowedProps";
|
|
19
|
+
import { Link } from "./Link";
|
|
20
|
+
import { Paragraph } from "./Typography";
|
|
19
21
|
|
|
20
22
|
export const calloutRoleValues = ["status", "alert"] as const;
|
|
21
23
|
export const calloutSeverityValues = [
|
|
@@ -29,7 +31,7 @@ export type CalloutProps = {
|
|
|
29
31
|
/**
|
|
30
32
|
* The contents of the Callout
|
|
31
33
|
*/
|
|
32
|
-
children
|
|
34
|
+
children?: ReactNode;
|
|
33
35
|
/**
|
|
34
36
|
* Sets the ARIA role of the Callout
|
|
35
37
|
* ("status" for something that dynamically updates, "alert" for errors, null for something
|
|
@@ -40,17 +42,52 @@ export type CalloutProps = {
|
|
|
40
42
|
* Determine the color and icon of the Callout
|
|
41
43
|
*/
|
|
42
44
|
severity: (typeof calloutSeverityValues)[number];
|
|
45
|
+
/**
|
|
46
|
+
* The text content of the Callout
|
|
47
|
+
*/
|
|
48
|
+
text?: string;
|
|
43
49
|
/**
|
|
44
50
|
* The title of the Callout
|
|
45
51
|
*/
|
|
46
52
|
title?: string;
|
|
47
|
-
} &
|
|
53
|
+
} & (
|
|
54
|
+
| {
|
|
55
|
+
text: string;
|
|
56
|
+
children?: never;
|
|
57
|
+
}
|
|
58
|
+
| {
|
|
59
|
+
text?: never;
|
|
60
|
+
children: ReactNode;
|
|
61
|
+
}
|
|
62
|
+
) &
|
|
63
|
+
(
|
|
64
|
+
| {
|
|
65
|
+
/**
|
|
66
|
+
* If linkUrl is not undefined, this is the text of the link.
|
|
67
|
+
* If left blank, it defaults to "Learn more".
|
|
68
|
+
* Note that linkText does nothing if linkUrl is not defined
|
|
69
|
+
*/
|
|
70
|
+
linkUrl: string;
|
|
71
|
+
/**
|
|
72
|
+
* If defined, the Toast will include a link to the URL
|
|
73
|
+
*/
|
|
74
|
+
linkText: string;
|
|
75
|
+
}
|
|
76
|
+
| {
|
|
77
|
+
linkUrl?: never;
|
|
78
|
+
linkText?: never;
|
|
79
|
+
}
|
|
80
|
+
) &
|
|
81
|
+
AllowedProps;
|
|
48
82
|
|
|
49
83
|
const Callout = ({
|
|
50
84
|
children,
|
|
85
|
+
linkText,
|
|
86
|
+
linkUrl,
|
|
51
87
|
role,
|
|
52
88
|
severity,
|
|
53
89
|
testId,
|
|
90
|
+
text,
|
|
54
91
|
title,
|
|
55
92
|
translate,
|
|
56
93
|
}: CalloutProps) => {
|
|
@@ -62,7 +99,13 @@ const Callout = ({
|
|
|
62
99
|
{t(`severity.${severity}`)}
|
|
63
100
|
</ScreenReaderText>
|
|
64
101
|
{title && <AlertTitle translate={translate}>{title}</AlertTitle>}
|
|
65
|
-
<Box component="div">{children}</Box>
|
|
102
|
+
{children && <Box component="div">{children}</Box>}
|
|
103
|
+
{text && <Paragraph>{text}</Paragraph>}
|
|
104
|
+
{linkUrl && (
|
|
105
|
+
<Link href={linkUrl} variant="monochrome">
|
|
106
|
+
{linkText}
|
|
107
|
+
</Link>
|
|
108
|
+
)}
|
|
66
109
|
</Alert>
|
|
67
110
|
);
|
|
68
111
|
};
|
package/src/Status.tsx
CHANGED
|
@@ -21,7 +21,6 @@ export const statusSeverityValues = [
|
|
|
21
21
|
"success",
|
|
22
22
|
"warning",
|
|
23
23
|
] as const;
|
|
24
|
-
export const statusVariantValues = ["lamp", "pill"] as const;
|
|
25
24
|
|
|
26
25
|
export type StatusProps = {
|
|
27
26
|
/**
|
|
@@ -32,19 +31,9 @@ export type StatusProps = {
|
|
|
32
31
|
* Determine the color and icon of the Status
|
|
33
32
|
*/
|
|
34
33
|
severity: (typeof statusSeverityValues)[number];
|
|
35
|
-
/**
|
|
36
|
-
* The style of the Status indicator
|
|
37
|
-
*/
|
|
38
|
-
variant?: (typeof statusVariantValues)[number];
|
|
39
34
|
} & AllowedProps;
|
|
40
35
|
|
|
41
|
-
export const Status = ({
|
|
42
|
-
label,
|
|
43
|
-
severity,
|
|
44
|
-
testId,
|
|
45
|
-
translate,
|
|
46
|
-
variant = "lamp",
|
|
47
|
-
}: StatusProps) => {
|
|
36
|
+
export const Status = ({ label, severity, testId, translate }: StatusProps) => {
|
|
48
37
|
const muiProps = useMuiProps();
|
|
49
38
|
|
|
50
39
|
return (
|
|
@@ -54,7 +43,7 @@ export const Status = ({
|
|
|
54
43
|
data-se={testId}
|
|
55
44
|
label={label}
|
|
56
45
|
translate={translate}
|
|
57
|
-
variant=
|
|
46
|
+
variant="pill"
|
|
58
47
|
/>
|
|
59
48
|
);
|
|
60
49
|
};
|
package/src/Tabs.tsx
CHANGED
|
@@ -157,6 +157,7 @@ const Tabs = ({
|
|
|
157
157
|
data-se={testId}
|
|
158
158
|
disabled={isDisabled}
|
|
159
159
|
icon={startIcon}
|
|
160
|
+
tabIndex={0}
|
|
160
161
|
label={
|
|
161
162
|
<TabLabel
|
|
162
163
|
label={label}
|
|
@@ -176,7 +177,11 @@ const Tabs = ({
|
|
|
176
177
|
|
|
177
178
|
return (
|
|
178
179
|
<MuiTabContext value={tabState}>
|
|
179
|
-
<MuiTabList
|
|
180
|
+
<MuiTabList
|
|
181
|
+
onChange={onChange}
|
|
182
|
+
aria-label={ariaLabel}
|
|
183
|
+
variant="scrollable"
|
|
184
|
+
>
|
|
180
185
|
{tabs.map((tab, index) => renderTab(tab, index))}
|
|
181
186
|
</MuiTabList>
|
|
182
187
|
{tabs.map((tab, index) => (
|
package/src/theme/components.tsx
CHANGED
|
@@ -23,6 +23,7 @@ import { formLabelClasses } from "@mui/material/FormLabel";
|
|
|
23
23
|
import { formGroupClasses } from "@mui/material/FormGroup";
|
|
24
24
|
import { inputAdornmentClasses } from "@mui/material/InputAdornment";
|
|
25
25
|
import { inputBaseClasses } from "@mui/material/InputBase";
|
|
26
|
+
import { linkClasses } from "@mui/material/Link";
|
|
26
27
|
import { listItemIconClasses } from "@mui/material/ListItemIcon";
|
|
27
28
|
import { listItemTextClasses } from "@mui/material/ListItemText";
|
|
28
29
|
import { menuItemClasses } from "@mui/material/MenuItem";
|
|
@@ -220,6 +221,10 @@ export const components = ({
|
|
|
220
221
|
...(ownerState.variant === "banner" && {
|
|
221
222
|
marginBlockEnd: 0,
|
|
222
223
|
}),
|
|
224
|
+
...(ownerState.variant === "callout" && {
|
|
225
|
+
fontSize: odysseyTokens.TypographySizeHeading5,
|
|
226
|
+
lineHeight: odysseyTokens.TypographyLineHeightHeading5,
|
|
227
|
+
}),
|
|
223
228
|
},
|
|
224
229
|
|
|
225
230
|
// Alert variant styling
|
|
@@ -235,6 +240,7 @@ export const components = ({
|
|
|
235
240
|
}),
|
|
236
241
|
...(ownerState.variant === "callout" && {
|
|
237
242
|
borderRadius: odysseyTokens.BorderRadiusMain,
|
|
243
|
+
padding: odysseyTokens.Spacing5,
|
|
238
244
|
"&:not(:last-child)": {
|
|
239
245
|
marginBottom: odysseyTokens.Spacing6,
|
|
240
246
|
},
|
|
@@ -243,7 +249,10 @@ export const components = ({
|
|
|
243
249
|
maxWidth: odysseyTokens.TypographyLineLengthMax,
|
|
244
250
|
borderRadius: odysseyTokens.BorderRadiusOuter,
|
|
245
251
|
position: "relative",
|
|
246
|
-
|
|
252
|
+
paddingInlineStart: odysseyTokens.Spacing5,
|
|
253
|
+
paddingInlineEnd: odysseyTokens.Spacing4,
|
|
254
|
+
paddingBlock: odysseyTokens.Spacing3,
|
|
255
|
+
alignItems: "flex-start",
|
|
247
256
|
backdropFilter: "blur(10px)",
|
|
248
257
|
}),
|
|
249
258
|
}),
|
|
@@ -258,8 +267,18 @@ export const components = ({
|
|
|
258
267
|
}),
|
|
259
268
|
...(ownerState.variant === "toast" && {
|
|
260
269
|
padding: 0,
|
|
261
|
-
|
|
262
|
-
|
|
270
|
+
marginInline: 0,
|
|
271
|
+
marginBlock: 1,
|
|
272
|
+
|
|
273
|
+
[`& .${buttonClasses.root}`]: {
|
|
274
|
+
"&:hover, &:focus": {
|
|
275
|
+
backgroundColor: odysseyTokens.PaletteNeutralDark.concat("11"),
|
|
276
|
+
},
|
|
277
|
+
|
|
278
|
+
"&:active": {
|
|
279
|
+
backgroundColor: odysseyTokens.PaletteNeutralDark.concat("22"),
|
|
280
|
+
},
|
|
281
|
+
},
|
|
263
282
|
}),
|
|
264
283
|
}),
|
|
265
284
|
icon: ({ ownerState }) => ({
|
|
@@ -277,7 +296,15 @@ export const components = ({
|
|
|
277
296
|
color: odysseyTokens.PaletteSuccessMain,
|
|
278
297
|
}),
|
|
279
298
|
...(ownerState.severity === "warning" && {
|
|
280
|
-
color: odysseyTokens.
|
|
299
|
+
color: odysseyTokens.HueYellow400,
|
|
300
|
+
}),
|
|
301
|
+
|
|
302
|
+
...(ownerState.variant === "toast" && {
|
|
303
|
+
marginBlock: odysseyTokens.Spacing2,
|
|
304
|
+
}),
|
|
305
|
+
|
|
306
|
+
...(ownerState.variant === "callout" && {
|
|
307
|
+
marginBlock: 1.5,
|
|
281
308
|
}),
|
|
282
309
|
|
|
283
310
|
[`& .${svgIconClasses.root}`]: {
|
|
@@ -295,7 +322,12 @@ export const components = ({
|
|
|
295
322
|
}),
|
|
296
323
|
...(ownerState.variant === "toast" && {
|
|
297
324
|
flexGrow: 1,
|
|
325
|
+
marginBlock: odysseyTokens.Spacing2,
|
|
298
326
|
}),
|
|
327
|
+
[`& .${linkClasses.root}`]: {
|
|
328
|
+
display: "inline-block",
|
|
329
|
+
marginTop: odysseyTokens.Spacing5,
|
|
330
|
+
},
|
|
299
331
|
}),
|
|
300
332
|
},
|
|
301
333
|
},
|
|
@@ -814,8 +846,12 @@ export const components = ({
|
|
|
814
846
|
[`&.${chipClasses.disabled}`]: {
|
|
815
847
|
opacity: 1,
|
|
816
848
|
pointerEvents: "none",
|
|
817
|
-
|
|
849
|
+
borderColor: odysseyTokens.BorderColorDisabled,
|
|
818
850
|
color: odysseyTokens.TypographyColorDisabled,
|
|
851
|
+
|
|
852
|
+
[`& .${chipClasses.deleteIcon}`]: {
|
|
853
|
+
color: odysseyTokens.HueNeutral300,
|
|
854
|
+
},
|
|
819
855
|
},
|
|
820
856
|
|
|
821
857
|
...(ownerState.clickable && {
|
|
@@ -840,45 +876,6 @@ export const components = ({
|
|
|
840
876
|
marginInlineEnd: odysseyTokens.Spacing1,
|
|
841
877
|
},
|
|
842
878
|
|
|
843
|
-
...(ownerState.variant === "lamp" && {
|
|
844
|
-
paddingBlock: 0,
|
|
845
|
-
paddingInline: 0,
|
|
846
|
-
borderRadius: 0,
|
|
847
|
-
border: 0,
|
|
848
|
-
backgroundColor: "transparent",
|
|
849
|
-
color: odysseyTokens.TypographyColorBody,
|
|
850
|
-
|
|
851
|
-
"&::before": {
|
|
852
|
-
content: "''",
|
|
853
|
-
width: ".64em",
|
|
854
|
-
height: ".64em",
|
|
855
|
-
marginInlineEnd: odysseyTokens.Spacing2,
|
|
856
|
-
borderRadius: "100%",
|
|
857
|
-
backgroundColor: odysseyTokens.HueNeutral600,
|
|
858
|
-
},
|
|
859
|
-
|
|
860
|
-
[`&.${chipClasses.colorError}`]: {
|
|
861
|
-
"&::before": {
|
|
862
|
-
border: 0,
|
|
863
|
-
backgroundColor: odysseyTokens.PaletteDangerMain,
|
|
864
|
-
},
|
|
865
|
-
},
|
|
866
|
-
|
|
867
|
-
[`&.${chipClasses.colorSuccess}`]: {
|
|
868
|
-
"&::before": {
|
|
869
|
-
border: 0,
|
|
870
|
-
backgroundColor: odysseyTokens.PaletteSuccessMain,
|
|
871
|
-
},
|
|
872
|
-
},
|
|
873
|
-
|
|
874
|
-
[`&.${chipClasses.colorWarning}`]: {
|
|
875
|
-
"&::before": {
|
|
876
|
-
border: 0,
|
|
877
|
-
backgroundColor: odysseyTokens.HueYellow200,
|
|
878
|
-
},
|
|
879
|
-
},
|
|
880
|
-
}),
|
|
881
|
-
|
|
882
879
|
...(ownerState.variant === "pill" && {
|
|
883
880
|
paddingBlock: odysseyTokens.Spacing1,
|
|
884
881
|
paddingInline: odysseyTokens.Spacing2,
|
|
@@ -888,15 +885,16 @@ export const components = ({
|
|
|
888
885
|
lineHeight: odysseyTokens.TypographyLineHeightOverline,
|
|
889
886
|
backgroundColor: odysseyTokens.HueNeutral50,
|
|
890
887
|
color: odysseyTokens.TypographyColorSubordinate,
|
|
891
|
-
fontSize:
|
|
888
|
+
fontSize: "0.71428571rem",
|
|
889
|
+
textTransform: "uppercase",
|
|
892
890
|
|
|
893
891
|
"&::before": {
|
|
894
892
|
content: "''",
|
|
895
|
-
width: ".
|
|
896
|
-
height: ".
|
|
897
|
-
marginInlineEnd: odysseyTokens.
|
|
893
|
+
width: "0.42857143rem",
|
|
894
|
+
height: "0.42857143rem",
|
|
895
|
+
marginInlineEnd: odysseyTokens.Spacing2,
|
|
898
896
|
borderRadius: "100%",
|
|
899
|
-
backgroundColor: odysseyTokens.
|
|
897
|
+
backgroundColor: odysseyTokens.HueNeutral400,
|
|
900
898
|
},
|
|
901
899
|
|
|
902
900
|
[`&.${chipClasses.colorError}`]: {
|
|
@@ -2273,9 +2271,43 @@ export const components = ({
|
|
|
2273
2271
|
marginBottom: odysseyTokens.Spacing5,
|
|
2274
2272
|
},
|
|
2275
2273
|
|
|
2274
|
+
scroller: {
|
|
2275
|
+
borderBottom: `${odysseyTokens.BorderWidthMain} ${odysseyTokens.BorderStyleMain} ${odysseyTokens.BorderColorDisplay}`,
|
|
2276
|
+
},
|
|
2277
|
+
|
|
2276
2278
|
flexContainer: {
|
|
2277
2279
|
gap: odysseyTokens.Spacing5,
|
|
2278
|
-
|
|
2280
|
+
},
|
|
2281
|
+
|
|
2282
|
+
scrollButtons: {
|
|
2283
|
+
zIndex: 1,
|
|
2284
|
+
transitionProperty: "opacity",
|
|
2285
|
+
transitionDuration: odysseyTokens.TransitionDurationMain,
|
|
2286
|
+
transitionTimingFunction: odysseyTokens.TransitionTimingMain,
|
|
2287
|
+
|
|
2288
|
+
"& svg": {
|
|
2289
|
+
width: odysseyTokens.Spacing4,
|
|
2290
|
+
height: odysseyTokens.Spacing4,
|
|
2291
|
+
color: odysseyTokens.PaletteNeutralDark,
|
|
2292
|
+
},
|
|
2293
|
+
|
|
2294
|
+
"&::after": {
|
|
2295
|
+
content: '""',
|
|
2296
|
+
position: "absolute",
|
|
2297
|
+
top: 0,
|
|
2298
|
+
bottom: 0,
|
|
2299
|
+
width: odysseyTokens.Spacing3,
|
|
2300
|
+
},
|
|
2301
|
+
"&:first-of-type::after": {
|
|
2302
|
+
right: `-${odysseyTokens.Spacing3}`,
|
|
2303
|
+
background:
|
|
2304
|
+
"linear-gradient(90deg, #FFF 0%, #FFF 72.49%, rgba(255, 255, 255, 0.70) 86.5%, rgba(255, 255, 255, 0.00) 100%)",
|
|
2305
|
+
},
|
|
2306
|
+
"&:last-of-type::after": {
|
|
2307
|
+
left: `-${odysseyTokens.Spacing3}`,
|
|
2308
|
+
background:
|
|
2309
|
+
"linear-gradient(-90deg, #FFF 0%, #FFF 72.49%, rgba(255, 255, 255, 0.70) 86.5%, rgba(255, 255, 255, 0.00) 100%)",
|
|
2310
|
+
},
|
|
2279
2311
|
},
|
|
2280
2312
|
},
|
|
2281
2313
|
},
|