@okta/odyssey-react-mui 1.9.16 → 1.9.17
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 +4 -0
- package/dist/Callout.js +12 -1
- package/dist/Callout.js.map +1 -1
- package/dist/src/Callout.d.ts +27 -3
- package/dist/src/Callout.d.ts.map +1 -1
- package/dist/src/theme/components.d.ts.map +1 -1
- package/dist/theme/components.js +34 -6
- 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/theme/components.tsx +36 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.9.17](https://github.com/okta/odyssey/compare/v1.9.16...v1.9.17) (2024-01-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @okta/odyssey-react-mui
|
|
9
|
+
|
|
6
10
|
## [1.9.16](https://github.com/okta/odyssey/compare/v1.9.15...v1.9.16) (2024-01-08)
|
|
7
11
|
|
|
8
12
|
### Bug Fixes
|
package/dist/Callout.js
CHANGED
|
@@ -16,6 +16,8 @@ import _AlertTitle from "@mui/material/AlertTitle";
|
|
|
16
16
|
import { memo } from "react";
|
|
17
17
|
import { ScreenReaderText } from "./ScreenReaderText.js";
|
|
18
18
|
import { useTranslation } from "react-i18next";
|
|
19
|
+
import { Link } from "./Link.js";
|
|
20
|
+
import { Paragraph } from "./Typography.js";
|
|
19
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
22
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
23
|
export const calloutRoleValues = ["status", "alert"];
|
|
@@ -23,9 +25,12 @@ export const calloutSeverityValues = ["success", "info", "warning", "error"];
|
|
|
23
25
|
const Callout = _ref => {
|
|
24
26
|
let {
|
|
25
27
|
children,
|
|
28
|
+
linkText,
|
|
29
|
+
linkUrl,
|
|
26
30
|
role,
|
|
27
31
|
severity,
|
|
28
32
|
testId,
|
|
33
|
+
text,
|
|
29
34
|
title,
|
|
30
35
|
translate
|
|
31
36
|
} = _ref;
|
|
@@ -43,9 +48,15 @@ const Callout = _ref => {
|
|
|
43
48
|
}), title && _jsx(_AlertTitle, {
|
|
44
49
|
translate: translate,
|
|
45
50
|
children: title
|
|
46
|
-
}), _jsx(_Box, {
|
|
51
|
+
}), children && _jsx(_Box, {
|
|
47
52
|
component: "div",
|
|
48
53
|
children: children
|
|
54
|
+
}), text && _jsx(Paragraph, {
|
|
55
|
+
children: text
|
|
56
|
+
}), linkUrl && _jsx(Link, {
|
|
57
|
+
href: linkUrl,
|
|
58
|
+
variant: "monochrome",
|
|
59
|
+
children: linkText
|
|
49
60
|
})]
|
|
50
61
|
});
|
|
51
62
|
};
|
package/dist/Callout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.js","names":["memo","ScreenReaderText","useTranslation","jsx","_jsx","jsxs","_jsxs","calloutRoleValues","calloutSeverityValues","Callout","_ref","children","role","severity","testId","title","translate","t","_Alert","variant","_AlertTitle","_Box","component","MemoizedCallout","displayName"],"sources":["../src/Callout.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, ReactNode } from \"react\";\nimport { Alert, AlertTitle, Box } from \"@mui/material\";\nimport { ScreenReaderText } from \"./ScreenReaderText\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { AllowedProps } from \"./AllowedProps\";\n\nexport const calloutRoleValues = [\"status\", \"alert\"] as const;\nexport const calloutSeverityValues = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n] as const;\n\nexport type CalloutProps = {\n /**\n * The contents of the Callout\n */\n children
|
|
1
|
+
{"version":3,"file":"Callout.js","names":["memo","ScreenReaderText","useTranslation","Link","Paragraph","jsx","_jsx","jsxs","_jsxs","calloutRoleValues","calloutSeverityValues","Callout","_ref","children","linkText","linkUrl","role","severity","testId","text","title","translate","t","_Alert","variant","_AlertTitle","_Box","component","href","MemoizedCallout","displayName"],"sources":["../src/Callout.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, ReactNode } from \"react\";\nimport { Alert, AlertTitle, Box } from \"@mui/material\";\nimport { ScreenReaderText } from \"./ScreenReaderText\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { AllowedProps } from \"./AllowedProps\";\nimport { Link } from \"./Link\";\nimport { Paragraph } from \"./Typography\";\n\nexport const calloutRoleValues = [\"status\", \"alert\"] as const;\nexport const calloutSeverityValues = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n] as const;\n\nexport type CalloutProps = {\n /**\n * The contents of the Callout\n */\n children?: ReactNode;\n /**\n * Sets the ARIA role of the Callout\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: (typeof calloutRoleValues)[number];\n /**\n * Determine the color and icon of the Callout\n */\n severity: (typeof calloutSeverityValues)[number];\n /**\n * The text content of the Callout\n */\n text?: string;\n /**\n * The title of the Callout\n */\n title?: string;\n} & (\n | {\n text: string;\n children?: never;\n }\n | {\n text?: never;\n children: ReactNode;\n }\n) &\n (\n | {\n /**\n * If linkUrl is not undefined, this is the text of the link.\n * If left blank, it defaults to \"Learn more\".\n * Note that linkText does nothing if linkUrl is not defined\n */\n linkUrl: string;\n /**\n * If defined, the Toast will include a link to the URL\n */\n linkText: string;\n }\n | {\n linkUrl?: never;\n linkText?: never;\n }\n ) &\n AllowedProps;\n\nconst Callout = ({\n children,\n linkText,\n linkUrl,\n role,\n severity,\n testId,\n text,\n title,\n translate,\n}: CalloutProps) => {\n const { t } = useTranslation();\n\n return (\n <Alert data-se={testId} role={role} severity={severity} variant=\"callout\">\n <ScreenReaderText translate={translate}>\n {t(`severity.${severity}`)}\n </ScreenReaderText>\n {title && <AlertTitle translate={translate}>{title}</AlertTitle>}\n {children && <Box component=\"div\">{children}</Box>}\n {text && <Paragraph>{text}</Paragraph>}\n {linkUrl && (\n <Link href={linkUrl} variant=\"monochrome\">\n {linkText}\n </Link>\n )}\n </Alert>\n );\n};\n\nconst MemoizedCallout = memo(Callout);\nMemoizedCallout.displayName = \"Callout\";\n\nexport { MemoizedCallout as Callout };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAmB,OAAO;AAAC,SAE/BC,gBAAgB;AACzB,SAASC,cAAc,QAAQ,eAAe;AAAC,SAGtCC,IAAI;AAAA,SACJC,SAAS;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAElB,OAAO,MAAMC,iBAAiB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU;AAC7D,OAAO,MAAMC,qBAAqB,GAAG,CACnC,SAAS,EACT,MAAM,EACN,SAAS,EACT,OAAO,CACC;AAuDV,MAAMC,OAAO,GAAGC,IAAA,IAUI;EAAA,IAVH;IACfC,QAAQ;IACRC,QAAQ;IACRC,OAAO;IACPC,IAAI;IACJC,QAAQ;IACRC,MAAM;IACNC,IAAI;IACJC,KAAK;IACLC;EACY,CAAC,GAAAT,IAAA;EACb,MAAM;IAAEU;EAAE,CAAC,GAAGpB,cAAc,CAAC,CAAC;EAE9B,OACEM,KAAA,CAAAe,MAAA;IAAO,WAASL,MAAO;IAACF,IAAI,EAAEA,IAAK;IAACC,QAAQ,EAAEA,QAAS;IAACO,OAAO,EAAC,SAAS;IAAAX,QAAA,GACvEP,IAAA,CAACL,gBAAgB;MAACoB,SAAS,EAAEA,SAAU;MAAAR,QAAA,EACpCS,CAAC,CAAE,YAAWL,QAAS,EAAC;IAAC,CACV,CAAC,EAClBG,KAAK,IAAId,IAAA,CAAAmB,WAAA;MAAYJ,SAAS,EAAEA,SAAU;MAAAR,QAAA,EAAEO;IAAK,CAAa,CAAC,EAC/DP,QAAQ,IAAIP,IAAA,CAAAoB,IAAA;MAAKC,SAAS,EAAC,KAAK;MAAAd,QAAA,EAAEA;IAAQ,CAAM,CAAC,EACjDM,IAAI,IAAIb,IAAA,CAACF,SAAS;MAAAS,QAAA,EAAEM;IAAI,CAAY,CAAC,EACrCJ,OAAO,IACNT,IAAA,CAACH,IAAI;MAACyB,IAAI,EAAEb,OAAQ;MAACS,OAAO,EAAC,YAAY;MAAAX,QAAA,EACtCC;IAAQ,CACL,CACP;EAAA,CACI,CAAC;AAEZ,CAAC;AAED,MAAMe,eAAe,GAAG7B,IAAI,CAACW,OAAO,CAAC;AACrCkB,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAIlB,OAAO"}
|
package/dist/src/Callout.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export type CalloutProps = {
|
|
|
17
17
|
/**
|
|
18
18
|
* The contents of the Callout
|
|
19
19
|
*/
|
|
20
|
-
children
|
|
20
|
+
children?: ReactNode;
|
|
21
21
|
/**
|
|
22
22
|
* Sets the ARIA role of the Callout
|
|
23
23
|
* ("status" for something that dynamically updates, "alert" for errors, null for something
|
|
@@ -28,11 +28,35 @@ export type CalloutProps = {
|
|
|
28
28
|
* Determine the color and icon of the Callout
|
|
29
29
|
*/
|
|
30
30
|
severity: (typeof calloutSeverityValues)[number];
|
|
31
|
+
/**
|
|
32
|
+
* The text content of the Callout
|
|
33
|
+
*/
|
|
34
|
+
text?: string;
|
|
31
35
|
/**
|
|
32
36
|
* The title of the Callout
|
|
33
37
|
*/
|
|
34
38
|
title?: string;
|
|
35
|
-
} &
|
|
36
|
-
|
|
39
|
+
} & ({
|
|
40
|
+
text: string;
|
|
41
|
+
children?: never;
|
|
42
|
+
} | {
|
|
43
|
+
text?: never;
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
}) & ({
|
|
46
|
+
/**
|
|
47
|
+
* If linkUrl is not undefined, this is the text of the link.
|
|
48
|
+
* If left blank, it defaults to "Learn more".
|
|
49
|
+
* Note that linkText does nothing if linkUrl is not defined
|
|
50
|
+
*/
|
|
51
|
+
linkUrl: string;
|
|
52
|
+
/**
|
|
53
|
+
* If defined, the Toast will include a link to the URL
|
|
54
|
+
*/
|
|
55
|
+
linkText: string;
|
|
56
|
+
} | {
|
|
57
|
+
linkUrl?: never;
|
|
58
|
+
linkText?: never;
|
|
59
|
+
}) & AllowedProps;
|
|
60
|
+
declare const MemoizedCallout: import("react").MemoExoticComponent<({ children, linkText, linkUrl, role, severity, testId, text, title, translate, }: CalloutProps) => JSX.Element>;
|
|
37
61
|
export { MemoizedCallout as Callout };
|
|
38
62
|
//# sourceMappingURL=Callout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.d.ts","sourceRoot":"","sources":["../../src/Callout.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAQ,SAAS,EAAE,MAAM,OAAO,CAAC;AAKxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Callout.d.ts","sourceRoot":"","sources":["../../src/Callout.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAQ,SAAS,EAAE,MAAM,OAAO,CAAC;AAKxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAInD,eAAO,MAAM,iBAAiB,8BAA+B,CAAC;AAC9D,eAAO,MAAM,qBAAqB,kDAKxB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,IAAI,CAAC,EAAE,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;IAC1C;;OAEG;IACH,QAAQ,EAAE,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;IACjD;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,CACA;IACE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB,GACD;IACE,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,SAAS,CAAC;CACrB,CACJ,GACC,CACI;IACE;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,GACD;IACE,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB,CACJ,GACD,YAAY,CAAC;AAgCf,QAAA,MAAM,eAAe,yHApBlB,YAAY,iBAoBsB,CAAC;AAGtC,OAAO,EAAE,eAAe,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/theme/components.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/theme/components.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAqC7C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,eAAO,MAAM,UAAU;mBAIN,YAAY;;MAEzB,YAAY,CAAC,YAAY,CAmoF5B,CAAC"}
|
package/dist/theme/components.js
CHANGED
|
@@ -21,6 +21,7 @@ import { formLabelClasses } from "@mui/material/FormLabel";
|
|
|
21
21
|
import { formGroupClasses } from "@mui/material/FormGroup";
|
|
22
22
|
import { inputAdornmentClasses } from "@mui/material/InputAdornment";
|
|
23
23
|
import { inputBaseClasses } from "@mui/material/InputBase";
|
|
24
|
+
import { linkClasses } from "@mui/material/Link";
|
|
24
25
|
import { listItemIconClasses } from "@mui/material/ListItemIcon";
|
|
25
26
|
import { listItemTextClasses } from "@mui/material/ListItemText";
|
|
26
27
|
import { menuItemClasses } from "@mui/material/MenuItem";
|
|
@@ -179,6 +180,10 @@ export const components = _ref => {
|
|
|
179
180
|
}),
|
|
180
181
|
...(ownerState.variant === "banner" && {
|
|
181
182
|
marginBlockEnd: 0
|
|
183
|
+
}),
|
|
184
|
+
...(ownerState.variant === "callout" && {
|
|
185
|
+
fontSize: odysseyTokens.TypographySizeHeading5,
|
|
186
|
+
lineHeight: odysseyTokens.TypographyLineHeightHeading5
|
|
182
187
|
})
|
|
183
188
|
},
|
|
184
189
|
...(ownerState.variant === "banner" && {
|
|
@@ -192,6 +197,7 @@ export const components = _ref => {
|
|
|
192
197
|
}),
|
|
193
198
|
...(ownerState.variant === "callout" && {
|
|
194
199
|
borderRadius: odysseyTokens.BorderRadiusMain,
|
|
200
|
+
padding: odysseyTokens.Spacing5,
|
|
195
201
|
"&:not(:last-child)": {
|
|
196
202
|
marginBottom: odysseyTokens.Spacing6
|
|
197
203
|
}
|
|
@@ -200,7 +206,10 @@ export const components = _ref => {
|
|
|
200
206
|
maxWidth: odysseyTokens.TypographyLineLengthMax,
|
|
201
207
|
borderRadius: odysseyTokens.BorderRadiusOuter,
|
|
202
208
|
position: "relative",
|
|
203
|
-
|
|
209
|
+
paddingInlineStart: odysseyTokens.Spacing5,
|
|
210
|
+
paddingInlineEnd: odysseyTokens.Spacing4,
|
|
211
|
+
paddingBlock: odysseyTokens.Spacing3,
|
|
212
|
+
alignItems: "flex-start",
|
|
204
213
|
backdropFilter: "blur(10px)"
|
|
205
214
|
})
|
|
206
215
|
};
|
|
@@ -220,8 +229,16 @@ export const components = _ref => {
|
|
|
220
229
|
}),
|
|
221
230
|
...(ownerState.variant === "toast" && {
|
|
222
231
|
padding: 0,
|
|
223
|
-
|
|
224
|
-
|
|
232
|
+
marginInline: 0,
|
|
233
|
+
marginBlock: 1,
|
|
234
|
+
[`& .${buttonClasses.root}`]: {
|
|
235
|
+
"&:hover, &:focus": {
|
|
236
|
+
backgroundColor: odysseyTokens.PaletteNeutralDark.concat("11")
|
|
237
|
+
},
|
|
238
|
+
"&:active": {
|
|
239
|
+
backgroundColor: odysseyTokens.PaletteNeutralDark.concat("22")
|
|
240
|
+
}
|
|
241
|
+
}
|
|
225
242
|
})
|
|
226
243
|
};
|
|
227
244
|
},
|
|
@@ -244,7 +261,13 @@ export const components = _ref => {
|
|
|
244
261
|
color: odysseyTokens.PaletteSuccessMain
|
|
245
262
|
}),
|
|
246
263
|
...(ownerState.severity === "warning" && {
|
|
247
|
-
color: odysseyTokens.
|
|
264
|
+
color: odysseyTokens.HueYellow400
|
|
265
|
+
}),
|
|
266
|
+
...(ownerState.variant === "toast" && {
|
|
267
|
+
marginBlock: odysseyTokens.Spacing2
|
|
268
|
+
}),
|
|
269
|
+
...(ownerState.variant === "callout" && {
|
|
270
|
+
marginBlock: 1.5
|
|
248
271
|
}),
|
|
249
272
|
[`& .${svgIconClasses.root}`]: {
|
|
250
273
|
alignSelf: "center",
|
|
@@ -265,8 +288,13 @@ export const components = _ref => {
|
|
|
265
288
|
gap: odysseyTokens.Spacing4
|
|
266
289
|
}),
|
|
267
290
|
...(ownerState.variant === "toast" && {
|
|
268
|
-
flexGrow: 1
|
|
269
|
-
|
|
291
|
+
flexGrow: 1,
|
|
292
|
+
marginBlock: odysseyTokens.Spacing2
|
|
293
|
+
}),
|
|
294
|
+
[`& .${linkClasses.root}`]: {
|
|
295
|
+
display: "inline-block",
|
|
296
|
+
marginTop: odysseyTokens.Spacing5
|
|
297
|
+
}
|
|
270
298
|
};
|
|
271
299
|
}
|
|
272
300
|
}
|