@okta/odyssey-react-mui 0.21.1 → 0.21.2

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 CHANGED
@@ -3,6 +3,18 @@
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
+ ## [0.21.2](https://github.com/okta/odyssey/compare/v0.21.1...v0.21.2) (2023-03-30)
7
+
8
+ ### Features
9
+
10
+ - add context to Banner and Infobox ([18b277c](https://github.com/okta/odyssey/commit/18b277c949065ad659508a75e04125637bc5308c))
11
+ - add missing autoFocus from TextField ([d01dcd4](https://github.com/okta/odyssey/commit/d01dcd4120017d16677ae870c3d1e0f7d1b13b47))
12
+
13
+ ### Bug Fixes
14
+
15
+ - **odyssey-react-mui:** fix Button, Floating, Disabled bg color ([a9c332a](https://github.com/okta/odyssey/commit/a9c332a85e3b4162bf68837978028081ef2133f7))
16
+ - **odyssey-react-mui:** fixes spacing for Hint/Error field helpers ([846134e](https://github.com/okta/odyssey/commit/846134efcdf9cd8c62932e5f849ee64b0b81e468))
17
+
6
18
  ## [0.21.1](https://github.com/okta/odyssey/compare/v0.21.0...v0.21.1) (2023-03-16)
7
19
 
8
20
  ### Features
package/dist/Banner.js CHANGED
@@ -10,9 +10,9 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
  import { memo } from "react";
13
- import { Alert, Link } from "./index.js";
14
- import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { Alert, Link, visuallyHidden } from "./index.js";
15
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
16
 
17
17
  const Banner = _ref => {
18
18
  let {
@@ -28,7 +28,10 @@ const Banner = _ref => {
28
28
  role: role,
29
29
  severity: severity,
30
30
  variant: "banner",
31
- children: [text, linkUrl && _jsx(Link, {
31
+ children: [_jsxs("span", {
32
+ style: visuallyHidden,
33
+ children: [severity, ":"]
34
+ }), text, linkUrl && _jsx(Link, {
32
35
  href: linkUrl,
33
36
  variant: "monochrome",
34
37
  children: linkText
@@ -1 +1 @@
1
- {"version":3,"file":"Banner.js","names":["memo","Alert","Link","Banner","onClose","severity","role","linkUrl","linkText","text","MemoizedBanner"],"sources":["../src/Banner.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 { AlertColor, AlertProps } from \"@mui/material\";\nimport { memo } from \"react\";\nimport { Alert, Link } from \"./\";\n\nexport interface BannerProps {\n /**\n * Determine the color and icon of the alert\n */\n severity: AlertColor;\n /**\n * Sets the ARIA role of the alert\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: \"status\" | \"alert\";\n /**\n * The text content of the alert\n */\n text: string;\n /**\n * The function that's fired when the user clicks the close button. If undefined,\n * the close button will not be shown.\n */\n onClose?: AlertProps[\"onClose\"];\n /**\n * If defined, the alert will include a link to the URL\n */\n linkUrl?: string;\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 linkText?: string;\n}\n\nconst Banner = ({\n onClose,\n severity,\n role,\n linkUrl,\n linkText,\n text,\n}: BannerProps) => (\n <Alert onClose={onClose} role={role} severity={severity} variant=\"banner\">\n {text}\n {linkUrl && (\n <Link href={linkUrl} variant=\"monochrome\">\n {linkText}\n </Link>\n )}\n </Alert>\n);\n\nconst MemoizedBanner = memo(Banner);\n\nexport { MemoizedBanner as Banner };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAT,QAAqB,OAArB;SACSC,K,EAAOC,I;;;;AAkChB,MAAMC,MAAM,GAAG;EAAA,IAAC;IACdC,OADc;IAEdC,QAFc;IAGdC,IAHc;IAIdC,OAJc;IAKdC,QALc;IAMdC;EANc,CAAD;EAAA,OAQb,MAAC,KAAD;IAAO,OAAO,EAAEL,OAAhB;IAAyB,IAAI,EAAEE,IAA/B;IAAqC,QAAQ,EAAED,QAA/C;IAAyD,OAAO,EAAC,QAAjE;IAAA,WACGI,IADH,EAEGF,OAAO,IACN,KAAC,IAAD;MAAM,IAAI,EAAEA,OAAZ;MAAqB,OAAO,EAAC,YAA7B;MAAA,UACGC;IADH,EAHJ;EAAA,EARa;AAAA,CAAf;;AAkBA,MAAME,cAAc,GAAGV,IAAI,CAACG,MAAD,CAA3B;AAEA,SAASO,cAAc,IAAIP,MAA3B"}
1
+ {"version":3,"file":"Banner.js","names":["memo","Alert","Link","visuallyHidden","Banner","onClose","severity","role","linkUrl","linkText","text","MemoizedBanner"],"sources":["../src/Banner.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 { AlertColor, AlertProps } from \"@mui/material\";\nimport { memo } from \"react\";\nimport { Alert, Link, visuallyHidden } from \"./\";\n\nexport interface BannerProps {\n /**\n * Determine the color and icon of the alert\n */\n severity: AlertColor;\n /**\n * Sets the ARIA role of the alert\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: \"status\" | \"alert\";\n /**\n * The text content of the alert\n */\n text: string;\n /**\n * The function that's fired when the user clicks the close button. If undefined,\n * the close button will not be shown.\n */\n onClose?: AlertProps[\"onClose\"];\n /**\n * If defined, the alert will include a link to the URL\n */\n linkUrl?: string;\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 linkText?: string;\n}\n\nconst Banner = ({\n onClose,\n severity,\n role,\n linkUrl,\n linkText,\n text,\n}: BannerProps) => (\n <Alert onClose={onClose} role={role} severity={severity} variant=\"banner\">\n <span style={visuallyHidden}>{severity}:</span>\n {text}\n {linkUrl && (\n <Link href={linkUrl} variant=\"monochrome\">\n {linkText}\n </Link>\n )}\n </Alert>\n);\n\nconst MemoizedBanner = memo(Banner);\n\nexport { MemoizedBanner as Banner };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAT,QAAqB,OAArB;SACSC,K,EAAOC,I,EAAMC,c;;;;AAkCtB,MAAMC,MAAM,GAAG;EAAA,IAAC;IACdC,OADc;IAEdC,QAFc;IAGdC,IAHc;IAIdC,OAJc;IAKdC,QALc;IAMdC;EANc,CAAD;EAAA,OAQb,MAAC,KAAD;IAAO,OAAO,EAAEL,OAAhB;IAAyB,IAAI,EAAEE,IAA/B;IAAqC,QAAQ,EAAED,QAA/C;IAAyD,OAAO,EAAC,QAAjE;IAAA,WACE;MAAM,KAAK,EAAEH,cAAb;MAAA,WAA8BG,QAA9B;IAAA,EADF,EAEGI,IAFH,EAGGF,OAAO,IACN,KAAC,IAAD;MAAM,IAAI,EAAEA,OAAZ;MAAqB,OAAO,EAAC,YAA7B;MAAA,UACGC;IADH,EAJJ;EAAA,EARa;AAAA,CAAf;;AAmBA,MAAME,cAAc,GAAGX,IAAI,CAACI,MAAD,CAA3B;AAEA,SAASO,cAAc,IAAIP,MAA3B"}
package/dist/Infobox.js CHANGED
@@ -10,9 +10,9 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
  import { memo } from "react";
13
- import { Alert, AlertTitle } from "./index.js";
14
- import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { Alert, AlertTitle, visuallyHidden } from "./index.js";
15
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
16
 
17
17
  const Infobox = _ref => {
18
18
  let {
@@ -25,7 +25,10 @@ const Infobox = _ref => {
25
25
  role: role,
26
26
  severity: severity,
27
27
  variant: "infobox",
28
- children: [title && _jsx(AlertTitle, {
28
+ children: [_jsxs("span", {
29
+ style: visuallyHidden,
30
+ children: [severity, ": "]
31
+ }), title && _jsx(AlertTitle, {
29
32
  children: title
30
33
  }), children]
31
34
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Infobox.js","names":["memo","Alert","AlertTitle","Infobox","children","severity","role","title","MemoizedInfobox"],"sources":["../src/Infobox.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 { AlertColor } from \"@mui/material\";\nimport { memo, ReactNode } from \"react\";\nimport { Alert, AlertTitle } from \".\";\n\nexport interface InfoboxProps {\n /**\n * The contents of the alert\n */\n children: ReactNode;\n /**\n * Determine the color and icon of the alert\n */\n severity: AlertColor;\n /**\n * Sets the ARIA role of the alert\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: \"status\" | \"alert\";\n /**\n * The title of the alert\n */\n title?: string;\n}\n\nconst Infobox = ({ children, severity, role, title }: InfoboxProps) => (\n <Alert role={role} severity={severity} variant=\"infobox\">\n {title && <AlertTitle>{title}</AlertTitle>}\n {children}\n </Alert>\n);\n\nconst MemoizedInfobox = memo(Infobox);\n\nexport { MemoizedInfobox as Infobox };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAT,QAAgC,OAAhC;SACSC,K,EAAOC,U;;;;AAuBhB,MAAMC,OAAO,GAAG;EAAA,IAAC;IAAEC,QAAF;IAAYC,QAAZ;IAAsBC,IAAtB;IAA4BC;EAA5B,CAAD;EAAA,OACd,MAAC,KAAD;IAAO,IAAI,EAAED,IAAb;IAAmB,QAAQ,EAAED,QAA7B;IAAuC,OAAO,EAAC,SAA/C;IAAA,WACGE,KAAK,IAAI,KAAC,UAAD;MAAA,UAAaA;IAAb,EADZ,EAEGH,QAFH;EAAA,EADc;AAAA,CAAhB;;AAOA,MAAMI,eAAe,GAAGR,IAAI,CAACG,OAAD,CAA5B;AAEA,SAASK,eAAe,IAAIL,OAA5B"}
1
+ {"version":3,"file":"Infobox.js","names":["memo","Alert","AlertTitle","visuallyHidden","Infobox","children","severity","role","title","MemoizedInfobox"],"sources":["../src/Infobox.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 { AlertColor } from \"@mui/material\";\nimport { memo, ReactNode } from \"react\";\nimport { Alert, AlertTitle, visuallyHidden } from \".\";\n\nexport interface InfoboxProps {\n /**\n * The contents of the alert\n */\n children: ReactNode;\n /**\n * Determine the color and icon of the alert\n */\n severity: AlertColor;\n /**\n * Sets the ARIA role of the alert\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: \"status\" | \"alert\";\n /**\n * The title of the alert\n */\n title?: string;\n}\n\nconst Infobox = ({ children, severity, role, title }: InfoboxProps) => (\n <Alert role={role} severity={severity} variant=\"infobox\">\n <span style={visuallyHidden}>{severity}: </span>\n {title && <AlertTitle>{title}</AlertTitle>}\n {children}\n </Alert>\n);\n\nconst MemoizedInfobox = memo(Infobox);\n\nexport { MemoizedInfobox as Infobox };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAT,QAAgC,OAAhC;SACSC,K,EAAOC,U,EAAYC,c;;;;AAuB5B,MAAMC,OAAO,GAAG;EAAA,IAAC;IAAEC,QAAF;IAAYC,QAAZ;IAAsBC,IAAtB;IAA4BC;EAA5B,CAAD;EAAA,OACd,MAAC,KAAD;IAAO,IAAI,EAAED,IAAb;IAAmB,QAAQ,EAAED,QAA7B;IAAuC,OAAO,EAAC,SAA/C;IAAA,WACE;MAAM,KAAK,EAAEH,cAAb;MAAA,WAA8BG,QAA9B;IAAA,EADF,EAEGE,KAAK,IAAI,KAAC,UAAD;MAAA,UAAaA;IAAb,EAFZ,EAGGH,QAHH;EAAA,EADc;AAAA,CAAhB;;AAQA,MAAMI,eAAe,GAAGT,IAAI,CAACI,OAAD,CAA5B;AAEA,SAASK,eAAe,IAAIL,OAA5B"}
package/dist/TextField.js CHANGED
@@ -8,6 +8,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
8
8
  const TextField = forwardRef((_ref, ref) => {
9
9
  let {
10
10
  autoCompleteType,
11
+ autoFocus,
11
12
  endAdornment,
12
13
  errorMessage,
13
14
  hint,
@@ -59,7 +60,8 @@ const TextField = forwardRef((_ref, ref) => {
59
60
  children: hint
60
61
  }), _jsx(_InputBase, {
61
62
  autoComplete: autoCompleteType,
62
- endAdornment: inputType === "password" ? _jsx(_InputAdornment, {
63
+ autoFocus: autoFocus,
64
+ endAdornment: type === "password" ? _jsx(_InputAdornment, {
63
65
  position: "end",
64
66
  children: _jsx(IconButton, {
65
67
  "aria-label": "toggle password visibility",
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.js","names":["forwardRef","memo","useCallback","useEffect","useMemo","useState","EyeIcon","EyeOffIcon","FormControl","FormHelperText","IconButton","SearchIcon","Typography","useUniqueId","visuallyHidden","TextField","ref","autoCompleteType","endAdornment","errorMessage","hint","id","idOverride","inputProps","isDisabled","isMultiline","isReadOnly","isRequired","label","onChange","onFocus","onBlur","optionalLabel","placeholder","startAdornment","type","value","inputType","setInputType","togglePasswordVisibility","currentType","hintId","undefined","errorId","labelId","localInputProps","ariaDescribedBy","concat","Boolean","MemoizedTextField"],"sources":["../src/TextField.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 {\n InputAdornment,\n InputBase,\n InputBaseProps,\n InputLabel,\n} from \"@mui/material\";\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\n\nimport {\n EyeIcon,\n EyeOffIcon,\n FormControl,\n FormHelperText,\n IconButton,\n SearchIcon,\n Typography,\n useUniqueId,\n visuallyHidden,\n} from \"./\";\n\nexport type TextFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoCompleteType?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * End `InputAdornment` for this component.\n */\n endAdornment?: ReactNode;\n /**\n * If `error` is not undefined, the `input` will indicate an error.\n */\n errorMessage?: string;\n /**\n * The helper text content.\n */\n hint?: string;\n /**\n * The id of the `input` element.\n */\n id?: string;\n /**\n * Props that go onto the HTML `input` element.\n */\n inputProps?: InputBaseProps[\"inputProps\"];\n /**\n * If `true`, the component is disabled.\n */\n isDisabled?: boolean;\n /**\n * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.\n */\n isMultiline?: boolean;\n /**\n * It prevents the user from changing the value of the field\n */\n isReadOnly?: boolean;\n /**\n * If `true`, the `input` element is required.\n */\n isRequired?: boolean;\n /**\n * The label for the `input` element.\n */\n label?: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The label for the `input` element if the it's not optional\n */\n optionalLabel?: string;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * Start `InputAdornment` for this component.\n */\n startAdornment?: ReactNode;\n /**\n * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).\n */\n type?: string;\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value?: unknown;\n};\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n autoCompleteType,\n endAdornment,\n errorMessage,\n hint,\n id: idOverride,\n inputProps = {},\n isDisabled = false,\n isMultiline = false,\n isReadOnly,\n isRequired = true,\n label,\n onChange,\n onFocus,\n onBlur,\n optionalLabel,\n placeholder,\n startAdornment,\n type = \"text\",\n value,\n },\n ref\n ) => {\n const [inputType, setInputType] = useState(type);\n\n useEffect(() => {\n setInputType(type);\n }, [type]);\n\n const togglePasswordVisibility = useCallback(() => {\n setInputType((currentType) =>\n currentType === \"password\" ? \"text\" : \"password\"\n );\n }, []);\n\n const id = useUniqueId(idOverride);\n const hintId = hint ? `${id}-hint` : undefined;\n const errorId = errorMessage ? `${id}-error` : undefined;\n const labelId = label ? `${id}-label` : undefined;\n\n const localInputProps = useMemo(() => {\n const ariaDescribedBy =\n errorId && hintId ? `${hintId} ${errorId}` : errorId || hintId;\n\n return {\n ...inputProps,\n \"aria-describedby\":\n inputProps[\"aria-describedby\"]?.concat(` ${ariaDescribedBy}`) ??\n ariaDescribedBy,\n };\n }, [errorId, hintId, inputProps]);\n\n return (\n <FormControl disabled={isDisabled} error={Boolean(errorMessage)}>\n <InputLabel htmlFor={id} id={labelId}>\n {label}\n {!isRequired && (\n <Typography variant=\"subtitle1\">{optionalLabel}</Typography>\n )}\n </InputLabel>\n {hint && <FormHelperText id={hintId}>{hint}</FormHelperText>}\n <InputBase\n autoComplete={autoCompleteType}\n endAdornment={\n inputType === \"password\" ? (\n <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"toggle password visibility\"\n edge=\"end\"\n onClick={togglePasswordVisibility}\n >\n {inputType === \"password\" ? <EyeIcon /> : <EyeOffIcon />}\n </IconButton>\n </InputAdornment>\n ) : (\n endAdornment\n )\n }\n id={id}\n inputProps={localInputProps}\n multiline={isMultiline}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n startAdornment={\n inputType === \"search\" ? (\n <InputAdornment position=\"start\">\n <SearchIcon />\n </InputAdornment>\n ) : (\n startAdornment\n )\n }\n type={inputType}\n value={value}\n />\n {errorMessage && (\n <FormHelperText error id={errorId}>\n <span style={visuallyHidden}>Error:</span>\n {errorMessage}\n </FormHelperText>\n )}\n </FormControl>\n );\n }\n);\n\nconst MemoizedTextField = memo(TextField);\n\nexport { MemoizedTextField as TextField };\n"],"mappings":";;;AAkBA,SAGEA,UAHF,EAKEC,IALF,EAOEC,WAPF,EAQEC,SARF,EASEC,OATF,EAUEC,QAVF,QAWO,OAXP;SAcEC,O,EACAC,U,EACAC,W,EACAC,c,EACAC,U,EACAC,U,EACAC,U,EACAC,W,EACAC,c;;;AAoFF,MAAMC,SAAS,GAAGf,UAAU,CAC1B,OAsBEgB,GAtBF,KAuBK;EAAA,IAtBH;IACEC,gBADF;IAEEC,YAFF;IAGEC,YAHF;IAIEC,IAJF;IAKEC,EAAE,EAAEC,UALN;IAMEC,UAAU,GAAG,EANf;IAOEC,UAAU,GAAG,KAPf;IAQEC,WAAW,GAAG,KARhB;IASEC,UATF;IAUEC,UAAU,GAAG,IAVf;IAWEC,KAXF;IAYEC,QAZF;IAaEC,OAbF;IAcEC,MAdF;IAeEC,aAfF;IAgBEC,WAhBF;IAiBEC,cAjBF;IAkBEC,IAAI,GAAG,MAlBT;IAmBEC;EAnBF,CAsBG;EACH,MAAM,CAACC,SAAD,EAAYC,YAAZ,IAA4BjC,QAAQ,CAAC8B,IAAD,CAA1C;EAEAhC,SAAS,CAAC,MAAM;IACdmC,YAAY,CAACH,IAAD,CAAZ;EACD,CAFQ,EAEN,CAACA,IAAD,CAFM,CAAT;EAIA,MAAMI,wBAAwB,GAAGrC,WAAW,CAAC,MAAM;IACjDoC,YAAY,CAAEE,WAAD,IACXA,WAAW,KAAK,UAAhB,GAA6B,MAA7B,GAAsC,UAD5B,CAAZ;EAGD,CAJ2C,EAIzC,EAJyC,CAA5C;EAMA,MAAMnB,EAAE,GAAGR,WAAW,CAACS,UAAD,CAAtB;EACA,MAAMmB,MAAM,GAAGrB,IAAI,GAAI,GAAEC,EAAG,OAAT,GAAkBqB,SAArC;EAC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AEwB,eAlBd;MAmBE,SAAS,EAAEpB,WAnBb;MAoBE,QAAQ,EAAEI,QApBZ;MAqBE,OAAO,EAAEC,OArBX;MAsBE,MAAM,EAAEC,MAtBV;MAuBE,WAAW,EAAEE,WAvBf;MAwBE,QAAQ,EAAEP,UAxBZ;MAyBE,GAAG,EAAEV,GAzBP;MA0BE,cAAc,EACZqB,SAAS,KAAK,QAAd,GACE;QAAgB,QAAQ,EAAC,OAAzB;QAAA,UACE,KAAC,UAAD;MADF,EADF,GAKEH,cAhCN;MAmCE,IAAI,EAAEG,SAnCR;MAoCE,KAAK,EAAED;IApCT,EARF,EA8CGjB,YAAY,IACX,MAAC,cAAD;MAAgB,KAAK,MAArB;MAAsB,EAAE,EAAEwB,OAA1B;MAAA,WACE;QAAM,KAAK,EAAE7B,cAAb;QAAA;MAAA,EADF,EAEGK,YAFH;IAAA,EA/CJ;EAAA,EADF;AAuDD,CA7GyB,CAA5B;AAgHA,MAAM8B,iBAAiB,GAAGhD,IAAI,CAACc,SAAD,CAA9B;AAEA,SAASkC,iBAAiB,IAAIlC,SAA9B"}
1
+ {"version":3,"file":"TextField.js","names":["forwardRef","memo","useCallback","useEffect","useMemo","useState","EyeIcon","EyeOffIcon","FormControl","FormHelperText","IconButton","SearchIcon","Typography","useUniqueId","visuallyHidden","TextField","ref","autoCompleteType","autoFocus","endAdornment","errorMessage","hint","id","idOverride","inputProps","isDisabled","isMultiline","isReadOnly","isRequired","label","onChange","onFocus","onBlur","optionalLabel","placeholder","startAdornment","type","value","inputType","setInputType","togglePasswordVisibility","currentType","hintId","undefined","errorId","labelId","localInputProps","ariaDescribedBy","concat","Boolean","MemoizedTextField"],"sources":["../src/TextField.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 {\n InputAdornment,\n InputBase,\n InputBaseProps,\n InputLabel,\n} from \"@mui/material\";\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\n\nimport {\n EyeIcon,\n EyeOffIcon,\n FormControl,\n FormHelperText,\n IconButton,\n SearchIcon,\n Typography,\n useUniqueId,\n visuallyHidden,\n} from \"./\";\n\nexport type TextFieldProps = {\n /**\n * If `true`, the component will receive focus automatically.\n */\n autoFocus?: boolean;\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoCompleteType?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * End `InputAdornment` for this component.\n */\n endAdornment?: ReactNode;\n /**\n * If `error` is not undefined, the `input` will indicate an error.\n */\n errorMessage?: string;\n /**\n * The helper text content.\n */\n hint?: string;\n /**\n * The id of the `input` element.\n */\n id?: string;\n /**\n * Props that go onto the HTML `input` element.\n */\n inputProps?: InputBaseProps[\"inputProps\"];\n /**\n * If `true`, the component is disabled.\n */\n isDisabled?: boolean;\n /**\n * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.\n */\n isMultiline?: boolean;\n /**\n * It prevents the user from changing the value of the field\n */\n isReadOnly?: boolean;\n /**\n * If `true`, the `input` element is required.\n */\n isRequired?: boolean;\n /**\n * The label for the `input` element.\n */\n label?: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The label for the `input` element if the it's not optional\n */\n optionalLabel?: string;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * Start `InputAdornment` for this component.\n */\n startAdornment?: ReactNode;\n /**\n * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).\n */\n type?: string;\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value?: unknown;\n};\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n autoCompleteType,\n autoFocus,\n endAdornment,\n errorMessage,\n hint,\n id: idOverride,\n inputProps = {},\n isDisabled = false,\n isMultiline = false,\n isReadOnly,\n isRequired = true,\n label,\n onChange,\n onFocus,\n onBlur,\n optionalLabel,\n placeholder,\n startAdornment,\n type = \"text\",\n value,\n },\n ref\n ) => {\n const [inputType, setInputType] = useState(type);\n\n useEffect(() => {\n setInputType(type);\n }, [type]);\n\n const togglePasswordVisibility = useCallback(() => {\n setInputType((currentType) =>\n currentType === \"password\" ? \"text\" : \"password\"\n );\n }, []);\n\n const id = useUniqueId(idOverride);\n const hintId = hint ? `${id}-hint` : undefined;\n const errorId = errorMessage ? `${id}-error` : undefined;\n const labelId = label ? `${id}-label` : undefined;\n\n const localInputProps = useMemo(() => {\n const ariaDescribedBy =\n errorId && hintId ? `${hintId} ${errorId}` : errorId || hintId;\n\n return {\n ...inputProps,\n \"aria-describedby\":\n inputProps[\"aria-describedby\"]?.concat(` ${ariaDescribedBy}`) ??\n ariaDescribedBy,\n };\n }, [errorId, hintId, inputProps]);\n\n return (\n <FormControl disabled={isDisabled} error={Boolean(errorMessage)}>\n <InputLabel htmlFor={id} id={labelId}>\n {label}\n {!isRequired && (\n <Typography variant=\"subtitle1\">{optionalLabel}</Typography>\n )}\n </InputLabel>\n {hint && <FormHelperText id={hintId}>{hint}</FormHelperText>}\n <InputBase\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={autoFocus}\n endAdornment={\n type === \"password\" ? (\n <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"toggle password visibility\"\n edge=\"end\"\n onClick={togglePasswordVisibility}\n >\n {inputType === \"password\" ? <EyeIcon /> : <EyeOffIcon />}\n </IconButton>\n </InputAdornment>\n ) : (\n endAdornment\n )\n }\n id={id}\n inputProps={localInputProps}\n multiline={isMultiline}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n startAdornment={\n inputType === \"search\" ? (\n <InputAdornment position=\"start\">\n <SearchIcon />\n </InputAdornment>\n ) : (\n startAdornment\n )\n }\n type={inputType}\n value={value}\n />\n {errorMessage && (\n <FormHelperText error id={errorId}>\n <span style={visuallyHidden}>Error:</span>\n {errorMessage}\n </FormHelperText>\n )}\n </FormControl>\n );\n }\n);\n\nconst MemoizedTextField = memo(TextField);\n\nexport { MemoizedTextField as TextField };\n"],"mappings":";;;AAkBA,SAGEA,UAHF,EAKEC,IALF,EAOEC,WAPF,EAQEC,SARF,EASEC,OATF,EAUEC,QAVF,QAWO,OAXP;SAcEC,O,EACAC,U,EACAC,W,EACAC,c,EACAC,U,EACAC,U,EACAC,U,EACAC,W,EACAC,c;;;AAwFF,MAAMC,SAAS,GAAGf,UAAU,CAC1B,OAuBEgB,GAvBF,KAwBK;EAAA,IAvBH;IACEC,gBADF;IAEEC,SAFF;IAGEC,YAHF;IAIEC,YAJF;IAKEC,IALF;IAMEC,EAAE,EAAEC,UANN;IAOEC,UAAU,GAAG,EAPf;IAQEC,UAAU,GAAG,KARf;IASEC,WAAW,GAAG,KAThB;IAUEC,UAVF;IAWEC,UAAU,GAAG,IAXf;IAYEC,KAZF;IAaEC,QAbF;IAcEC,OAdF;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IAAI,CAACc,SAAD,CAA9B;AAEA,SAASmC,iBAAiB,IAAInC,SAA9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../src/Banner.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIvD,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,QAAQ,EAAE,UAAU,CAAC;IACrB;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAoBD,QAAA,MAAM,cAAc,8FAXjB,WAAW,iBAWqB,CAAC;AAEpC,OAAO,EAAE,cAAc,IAAI,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../src/Banner.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIvD,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,QAAQ,EAAE,UAAU,CAAC;IACrB;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAqBD,QAAA,MAAM,cAAc,8FAZjB,WAAW,iBAYqB,CAAC;AAEpC,OAAO,EAAE,cAAc,IAAI,MAAM,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Infobox.d.ts","sourceRoot":"","sources":["../../src/Infobox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAQ,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxC,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,UAAU,CAAC;IACrB;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AASD,QAAA,MAAM,eAAe,4EAPiC,YAAY,iBAO7B,CAAC;AAEtC,OAAO,EAAE,eAAe,IAAI,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"Infobox.d.ts","sourceRoot":"","sources":["../../src/Infobox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAQ,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxC,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,UAAU,CAAC;IACrB;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAUD,QAAA,MAAM,eAAe,4EARiC,YAAY,iBAQ7B,CAAC;AAEtC,OAAO,EAAE,eAAe,IAAI,OAAO,EAAE,CAAC"}
@@ -12,6 +12,10 @@
12
12
  import { InputBaseProps } from "@mui/material";
13
13
  import { ChangeEventHandler, FocusEventHandler, InputHTMLAttributes, ReactNode } from "react";
14
14
  export type TextFieldProps = {
15
+ /**
16
+ * If `true`, the component will receive focus automatically.
17
+ */
18
+ autoFocus?: boolean;
15
19
  /**
16
20
  * This prop helps users to fill forms faster, especially on mobile devices.
17
21
  * The name can be confusing, as it's more like an autofill.
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../src/TextField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAGL,cAAc,EAEf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EAEjB,mBAAmB,EAEnB,SAAS,EAKV,MAAM,OAAO,CAAC;AAcf,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC,cAAc,CAAC,CAAC;IACzE;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IAC1C;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;IACnE;;OAEG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;IACtE;;OAE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AC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;IACnE;;OAEG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;IACtE;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;IACpE;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAqHF,QAAA,MAAM,iBAAiB,kJAAkB,CAAC;AAE1C,OAAO,EAAE,iBAAiB,IAAI,SAAS,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;AA4B7C,eAAO,MAAM,UAAU,EAAE,YAAY,CAAC,YAAY,CAwyDjD,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;AA4B7C,eAAO,MAAM,UAAU,EAAE,YAAY,CAAC,YAAY,CAmxDjD,CAAC"}
@@ -193,9 +193,6 @@ export const components = {
193
193
  "&:hover, &:focus-visible": {
194
194
  backgroundColor: theme.palette.primary.dark
195
195
  },
196
- "&:focus-visible": {
197
- outlineColor: theme.palette.primary.main
198
- },
199
196
  "&:active": {
200
197
  backgroundColor: theme.palette.primary.main
201
198
  },
@@ -222,9 +219,6 @@ export const components = {
222
219
  borderColor: theme.palette.primary.light,
223
220
  color: theme.palette.primary.main
224
221
  },
225
- "&:focus-visible": {
226
- outlineColor: theme.palette.primary.main
227
- },
228
222
  "&:active": {
229
223
  borderColor: theme.palette.primary.main
230
224
  },
@@ -251,7 +245,7 @@ export const components = {
251
245
  backgroundColor: theme.palette.error.dark
252
246
  },
253
247
  "&:focus-visible": {
254
- outlineColor: theme.palette.error.main,
248
+ boxShadow: `0 0 0 2px ${theme.palette.background.default}, 0 0 0 4px ${theme.palette.error.main}`,
255
249
  backgroundColor: theme.palette.error.dark
256
250
  },
257
251
  "&:active": {
@@ -279,15 +273,12 @@ export const components = {
279
273
  backgroundColor: "rgba(29, 29, 33, 0.1)",
280
274
  borderColor: "transparent"
281
275
  },
282
- "&:focus-visible": {
283
- outlineColor: theme.palette.primary.main
284
- },
285
276
  "&:active": {
286
277
  backgroundColor: "rgba(29, 29, 33, 0.2)",
287
278
  borderColor: "transparent"
288
279
  },
289
280
  "&:disabled": {
290
- backgroundColor: "rgba(235, 235, 237, 0.6)",
281
+ backgroundColor: "transparent",
291
282
  color: theme.palette.text.secondary,
292
283
  borderColor: "transparent"
293
284
  }
@@ -362,14 +353,12 @@ export const components = {
362
353
  position: "relative",
363
354
  marginBlock: "0",
364
355
  marginInline: "0",
365
- transitionProperty: "color, background-color, border-color, outline-offset, outline-color",
356
+ transitionProperty: "color, background-color, border-color, box-shadow",
366
357
  transitionDuration: "100ms",
367
358
  transitionTimingFunction: "linear",
368
359
  borderWidth: theme.mixins.borderWidth,
369
360
  borderStyle: theme.mixins.borderStyle,
370
361
  borderRadius: theme.mixins.borderRadius,
371
- outlineColor: "transparent",
372
- outlineOffset: "0",
373
362
  fontSize: theme.typography.body1.fontSize,
374
363
  lineHeight: theme.typography.ui.lineHeight,
375
364
  whiteSpace: "nowrap",
@@ -377,9 +366,9 @@ export const components = {
377
366
  marginInlineStart: theme.spacing(2)
378
367
  },
379
368
  "&:focus-visible": {
380
- outlineOffset: "2px",
381
- outlineStyle: "solid",
382
- outlineWidth: "2px"
369
+ boxShadow: `0 0 0 2px ${theme.palette.background.default}, 0 0 0 4px ${theme.palette.primary.main}`,
370
+ outline: "2px solid transparent",
371
+ outlineOffset: "1px"
383
372
  },
384
373
  "&:disabled": {
385
374
  cursor: "not-allowed",
@@ -452,12 +441,6 @@ export const components = {
452
441
  "&:hover": {
453
442
  color: theme.palette.error.dark
454
443
  }
455
- },
456
- "&.Mui-focusVisible": {
457
- outlineColor: theme.palette.primary.main,
458
- outlineOffset: 0,
459
- outlineStyle: "solid",
460
- outlineWidth: "2px"
461
444
  }
462
445
  };
463
446
  }
@@ -762,7 +745,7 @@ export const components = {
762
745
  content: "attr(data-a11y-end)"
763
746
  }
764
747
  },
765
- p: {
748
+ "p:not([class])": {
766
749
  maxWidth: theme.mixins.maxWidth,
767
750
  marginBlockStart: 0,
768
751
  marginBlockEnd: theme.spacing(4),
@@ -1038,14 +1021,14 @@ export const components = {
1038
1021
  return {
1039
1022
  fontSize: theme.typography.subtitle1.fontSize,
1040
1023
  lineHeight: "1.33333333",
1041
- marginTop: theme.spacing(2),
1024
+ marginBlockStart: theme.spacing(2),
1042
1025
  ".MuiFormLabel-root + &": {
1043
- marginTop: `-${theme.spacing(1)}`,
1026
+ marginBlockStart: `-${theme.spacing(1)}`,
1044
1027
  color: theme.palette.text.secondary
1045
1028
  },
1046
- marginBottom: theme.spacing(2),
1029
+ marginBlockEnd: theme.spacing(2),
1047
1030
  "&:last-child": {
1048
- marginBottom: 0
1031
+ marginBlockEnd: 0
1049
1032
  },
1050
1033
  textAlign: "start"
1051
1034
  };
@@ -1186,10 +1169,9 @@ export const components = {
1186
1169
  },
1187
1170
  [`&.${inputBaseClasses.focused}`]: {
1188
1171
  borderColor: theme.palette.primary.main,
1189
- outlineColor: theme.palette.primary.main,
1190
- outlineOffset: 0,
1191
- outlineStyle: "solid",
1192
- outlineWidth: "1px"
1172
+ boxShadow: `0 0 0 1px ${theme.palette.primary.main}`,
1173
+ outline: "2px solid transparent",
1174
+ outlineOffset: "1px"
1193
1175
  },
1194
1176
  [`&.${inputBaseClasses.error}`]: {
1195
1177
  borderColor: theme.palette.error.main
@@ -1199,7 +1181,7 @@ export const components = {
1199
1181
  },
1200
1182
  [`&.${inputBaseClasses.error}.${inputBaseClasses.focused}`]: {
1201
1183
  borderColor: theme.palette.error.main,
1202
- outlineColor: theme.palette.error.main
1184
+ boxShadow: `0 0 0 1px ${theme.palette.error.main}`
1203
1185
  },
1204
1186
  [`&.${inputBaseClasses.disabled}`]: {
1205
1187
  color: theme.palette.text.disabled,