@okta/odyssey-react-mui 0.14.1

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.
Files changed (105) hide show
  1. package/.browserslistrc +1 -0
  2. package/.eslintrc.cjs +18 -0
  3. package/CHANGELOG.md +10 -0
  4. package/LICENSE +187 -0
  5. package/README.md +64 -0
  6. package/babel.config.cjs +91 -0
  7. package/dist/components/Link/Link.d.ts +18 -0
  8. package/dist/components/Link/Link.d.ts.map +1 -0
  9. package/dist/components/Link/Link.js +36 -0
  10. package/dist/components/Link/Link.js.map +1 -0
  11. package/dist/components/Link/index.d.ts +13 -0
  12. package/dist/components/Link/index.d.ts.map +1 -0
  13. package/dist/components/Link/index.js +13 -0
  14. package/dist/components/Link/index.js.map +1 -0
  15. package/dist/components/PasswordInput/PasswordInput.d.ts +22 -0
  16. package/dist/components/PasswordInput/PasswordInput.d.ts.map +1 -0
  17. package/dist/components/PasswordInput/PasswordInput.js +83 -0
  18. package/dist/components/PasswordInput/PasswordInput.js.map +1 -0
  19. package/dist/components/PasswordInput/index.d.ts +13 -0
  20. package/dist/components/PasswordInput/index.d.ts.map +1 -0
  21. package/dist/components/PasswordInput/index.js +13 -0
  22. package/dist/components/PasswordInput/index.js.map +1 -0
  23. package/dist/components/index.d.ts +14 -0
  24. package/dist/components/index.d.ts.map +1 -0
  25. package/dist/components/index.js +14 -0
  26. package/dist/components/index.js.map +1 -0
  27. package/dist/index.d.ts +14 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +14 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/themes/index.d.ts +13 -0
  32. package/dist/themes/index.d.ts.map +1 -0
  33. package/dist/themes/index.js +13 -0
  34. package/dist/themes/index.js.map +1 -0
  35. package/dist/themes/odyssey/components.d.ts +14 -0
  36. package/dist/themes/odyssey/components.d.ts.map +1 -0
  37. package/dist/themes/odyssey/components.js +303 -0
  38. package/dist/themes/odyssey/components.js.map +1 -0
  39. package/dist/themes/odyssey/components.types.d.ts +75 -0
  40. package/dist/themes/odyssey/components.types.d.ts.map +1 -0
  41. package/dist/themes/odyssey/components.types.js +13 -0
  42. package/dist/themes/odyssey/components.types.js.map +1 -0
  43. package/dist/themes/odyssey/index.d.ts +13 -0
  44. package/dist/themes/odyssey/index.d.ts.map +1 -0
  45. package/dist/themes/odyssey/index.js +13 -0
  46. package/dist/themes/odyssey/index.js.map +1 -0
  47. package/dist/themes/odyssey/palette.d.ts +14 -0
  48. package/dist/themes/odyssey/palette.d.ts.map +1 -0
  49. package/dist/themes/odyssey/palette.js +94 -0
  50. package/dist/themes/odyssey/palette.js.map +1 -0
  51. package/dist/themes/odyssey/shape.d.ts +14 -0
  52. package/dist/themes/odyssey/shape.d.ts.map +1 -0
  53. package/dist/themes/odyssey/shape.js +16 -0
  54. package/dist/themes/odyssey/shape.js.map +1 -0
  55. package/dist/themes/odyssey/spacing.d.ts +14 -0
  56. package/dist/themes/odyssey/spacing.d.ts.map +1 -0
  57. package/dist/themes/odyssey/spacing.js +14 -0
  58. package/dist/themes/odyssey/spacing.js.map +1 -0
  59. package/dist/themes/odyssey/theme.d.ts +15 -0
  60. package/dist/themes/odyssey/theme.d.ts.map +1 -0
  61. package/dist/themes/odyssey/theme.js +27 -0
  62. package/dist/themes/odyssey/theme.js.map +1 -0
  63. package/dist/themes/odyssey/typography.d.ts +14 -0
  64. package/dist/themes/odyssey/typography.d.ts.map +1 -0
  65. package/dist/themes/odyssey/typography.js +90 -0
  66. package/dist/themes/odyssey/typography.js.map +1 -0
  67. package/dist/themes/odyssey/typography.types.d.ts +34 -0
  68. package/dist/themes/odyssey/typography.types.d.ts.map +1 -0
  69. package/dist/themes/odyssey/typography.types.js +2 -0
  70. package/dist/themes/odyssey/typography.types.js.map +1 -0
  71. package/dist/utils/index.d.ts +13 -0
  72. package/dist/utils/index.d.ts.map +1 -0
  73. package/dist/utils/index.js +13 -0
  74. package/dist/utils/index.js.map +1 -0
  75. package/dist/utils/oid.d.ts +15 -0
  76. package/dist/utils/oid.d.ts.map +1 -0
  77. package/dist/utils/oid.js +20 -0
  78. package/dist/utils/oid.js.map +1 -0
  79. package/jest.config.cjs +15 -0
  80. package/jest.setup.js +15 -0
  81. package/package.json +32 -0
  82. package/src/components/Link/Link.tsx +44 -0
  83. package/src/components/Link/index.tsx +13 -0
  84. package/src/components/PasswordInput/PasswordInput.test.tsx +51 -0
  85. package/src/components/PasswordInput/PasswordInput.tsx +111 -0
  86. package/src/components/PasswordInput/index.ts +13 -0
  87. package/src/components/index.ts +14 -0
  88. package/src/index.ts +14 -0
  89. package/src/themes/index.ts +13 -0
  90. package/src/themes/odyssey/components.ts +321 -0
  91. package/src/themes/odyssey/components.types.ts +78 -0
  92. package/src/themes/odyssey/index.ts +13 -0
  93. package/src/themes/odyssey/palette.ts +100 -0
  94. package/src/themes/odyssey/shape.ts +18 -0
  95. package/src/themes/odyssey/spacing.ts +27 -0
  96. package/src/themes/odyssey/theme.ts +29 -0
  97. package/src/themes/odyssey/typography.ts +92 -0
  98. package/src/themes/odyssey/typography.types.ts +36 -0
  99. package/src/utils/index.ts +13 -0
  100. package/src/utils/oid.test.ts +21 -0
  101. package/src/utils/oid.ts +22 -0
  102. package/test/a11yCheck.ts +28 -0
  103. package/test/index.ts +13 -0
  104. package/tsconfig.json +3 -0
  105. package/tsconfig.production.json +7 -0
@@ -0,0 +1,44 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import React, { forwardRef, ReactElement } from "react";
14
+
15
+ import { Link as MuiLink, SvgIcon } from "@mui/material";
16
+ import type { LinkProps as MuiLinkProps } from "@mui/material";
17
+
18
+ export interface LinkProps extends MuiLinkProps {
19
+ icon?: ReactElement;
20
+ }
21
+
22
+ export const Link = forwardRef<HTMLLinkElement | HTMLAnchorElement, LinkProps>(
23
+ (props) => {
24
+ const { icon, children, target } = props;
25
+ return (
26
+ <MuiLink {...props}>
27
+ <span className="Link-icon">{icon}</span>
28
+ {children}
29
+ {target === "_blank" && (
30
+ <span className="Link-indicator" role="presentation">
31
+ <SvgIcon viewBox="0 0 16 16">
32
+ <path
33
+ fillRule="evenodd"
34
+ clipRule="evenodd"
35
+ d="M13.2929 2H7.99998V1H14.5C14.7761 1 15 1.22386 15 1.5V8H14V2.70711L6.35353 10.3536L5.64642 9.64645L13.2929 2ZM1.5 4H1V4.5V14.5V15H1.5H11.5H12V14.5V8H11V14H2V5H8V4H1.5Z"
36
+ fill="currentColor"
37
+ />
38
+ </SvgIcon>
39
+ </span>
40
+ )}
41
+ </MuiLink>
42
+ );
43
+ }
44
+ );
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ export * from "./Link";
@@ -0,0 +1,51 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import React from "react";
14
+ import { render, screen } from "@testing-library/react";
15
+ import { a11yCheck } from "../../../test";
16
+ import { PasswordInput } from ".";
17
+
18
+ const label = "Password";
19
+ const tooltipOnLabel = "Show password";
20
+ const tooltipOffLabel = "Hide password";
21
+
22
+ describe("PasswordInput", () => {
23
+ it("renders into the document", () => {
24
+ render(<PasswordInput label={label} tooltipLabel={tooltipOnLabel} />);
25
+ expect(screen.getByLabelText(label)).toBeVisible();
26
+ });
27
+
28
+ it("has a button that changes the type when clicked", () => {
29
+ const tooltipLabel = (isHidden: boolean) => {
30
+ return isHidden ? tooltipOnLabel : tooltipOffLabel;
31
+ };
32
+ render(
33
+ <PasswordInput
34
+ label={label}
35
+ tooltipLabel={tooltipLabel}
36
+ defaultValue="Imma password"
37
+ />
38
+ );
39
+ const inputElement = screen.getByLabelText(label);
40
+ expect(inputElement).toHaveValue("Imma password");
41
+ expect(inputElement).toHaveAttribute("type", "password");
42
+ const eyeButton = screen.getByRole("button");
43
+ expect(eyeButton).toBeInTheDocument();
44
+ eyeButton.click();
45
+ expect(inputElement).toHaveAttribute("type", "text");
46
+ });
47
+
48
+ a11yCheck(() =>
49
+ render(<PasswordInput label="input label" tooltipLabel="tooltip label" />)
50
+ );
51
+ });
@@ -0,0 +1,111 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import React, { forwardRef, useState, useMemo } from "react";
14
+ import type { Ref, ChangeEvent, MouseEvent } from "react";
15
+ import type { OutlinedInputProps, TooltipProps } from "@mui/material";
16
+ import {
17
+ Tooltip,
18
+ IconButton,
19
+ Box,
20
+ InputLabel,
21
+ OutlinedInput,
22
+ InputAdornment,
23
+ } from "@mui/material";
24
+ import { Visibility, VisibilityOff } from "@mui/icons-material";
25
+ import { useOid } from "../../utils";
26
+
27
+ interface State {
28
+ password: string;
29
+ showPassword: boolean;
30
+ }
31
+
32
+ export interface PasswordInputProps
33
+ extends Omit<OutlinedInputProps, "type" | "label" | "defaultValue" | "ref"> {
34
+ ref?: Ref<HTMLInputElement>;
35
+ defaultValue?: string;
36
+ label: string;
37
+ tooltipLabel?:
38
+ | TooltipProps["title"]
39
+ | ((isHidden: boolean) => TooltipProps["title"]);
40
+ }
41
+
42
+ export const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(
43
+ (props, ref) => {
44
+ const {
45
+ tooltipLabel,
46
+ id,
47
+ label,
48
+ defaultValue: password = "",
49
+ inputProps,
50
+ ...rest
51
+ } = props;
52
+
53
+ const [values, setValues] = useState<State>({
54
+ password,
55
+ showPassword: false,
56
+ });
57
+
58
+ const handlePasswordChange = (event: ChangeEvent<HTMLInputElement>) => {
59
+ setValues({ ...values, password: event.target.value });
60
+ props.onChange?.(event);
61
+ };
62
+
63
+ const handleClickShowPassword = () => {
64
+ setValues({
65
+ ...values,
66
+ showPassword: !values.showPassword,
67
+ });
68
+ };
69
+
70
+ const handleMouseDownPassword = (event: MouseEvent<HTMLButtonElement>) => {
71
+ event.preventDefault();
72
+ };
73
+
74
+ const tooltipTitle = useMemo(() => {
75
+ return typeof tooltipLabel === "function"
76
+ ? tooltipLabel(values.showPassword === false)
77
+ : tooltipLabel;
78
+ }, [values, tooltipLabel]);
79
+
80
+ const oid = useOid(id);
81
+
82
+ return (
83
+ <Box>
84
+ <InputLabel htmlFor={oid}>{label}</InputLabel>
85
+ <OutlinedInput
86
+ {...rest}
87
+ id={oid}
88
+ inputProps={inputProps}
89
+ inputRef={ref}
90
+ onChange={handlePasswordChange}
91
+ type={values.showPassword ? "text" : "password"}
92
+ value={values.password}
93
+ endAdornment={
94
+ <InputAdornment position="end">
95
+ <Tooltip title={tooltipTitle}>
96
+ <IconButton
97
+ aria-label="toggle password visibility"
98
+ onClick={handleClickShowPassword}
99
+ onMouseDown={handleMouseDownPassword}
100
+ edge="end"
101
+ >
102
+ {values.showPassword ? <VisibilityOff /> : <Visibility />}
103
+ </IconButton>
104
+ </Tooltip>
105
+ </InputAdornment>
106
+ }
107
+ />
108
+ </Box>
109
+ );
110
+ }
111
+ );
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ export * from "./PasswordInput";
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ export * from "./PasswordInput";
14
+ export * from "./Link";
package/src/index.ts ADDED
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ export * from "./components";
14
+ export * from "./themes";
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ export * from "./odyssey";
@@ -0,0 +1,321 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import type { ThemeOptions } from "@mui/material";
14
+
15
+ export const components: ThemeOptions["components"] = {
16
+ MuiCssBaseline: {
17
+ styleOverrides: {
18
+ boxSizing: "border-box",
19
+ },
20
+ },
21
+ MuiCircularProgress: {
22
+ defaultProps: {
23
+ size: "1.14285714rem",
24
+ thickness: 8,
25
+ color: "primary",
26
+ disableShrink: false,
27
+ variant: "indeterminate",
28
+ },
29
+ styleOverrides: {
30
+ root: ({ ownerState }) => ({
31
+ ...(ownerState.color !== "inherit" && {
32
+ color: "#00297a",
33
+ }),
34
+ }),
35
+ circle: ({ ownerState }) => ({
36
+ ...(ownerState.variant === "indeterminate" && {
37
+ strokeDasharray: "160%, 360%",
38
+ }),
39
+ }),
40
+ },
41
+ },
42
+ MuiFormLabel: {
43
+ styleOverrides: {
44
+ root: {
45
+ color: "#1d1d21",
46
+ lineHeight: "1.42857143",
47
+ fontSize: "1rem",
48
+ fontWeight: 600,
49
+ },
50
+ },
51
+ },
52
+ MuiInputBase: {
53
+ styleOverrides: {
54
+ root: {
55
+ lineHeight: "1.14285714",
56
+ },
57
+ input: {
58
+ boxSizing: "border-box",
59
+ height: "auto",
60
+ },
61
+ },
62
+ },
63
+ MuiTypography: {
64
+ defaultProps: {
65
+ fontFamily:
66
+ "'Public Sans', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu', 'Cantarell', 'Helvetica Neue', 'Noto Sans Arabic', sans-serif",
67
+ },
68
+ styleOverrides: {
69
+ paragraph: {
70
+ marginBottom: "1.14285714rem",
71
+ },
72
+ },
73
+ },
74
+ MuiLink: {
75
+ styleOverrides: {
76
+ root: {
77
+ color: "#1662dd",
78
+ textDecoration: "none",
79
+
80
+ "&:hover": {
81
+ color: "#1662dd",
82
+ textDecoration: "underline",
83
+ },
84
+
85
+ "&:focus-visible": {
86
+ outlineColor: "#1662dd",
87
+ outlineOffset: "2px",
88
+ outlineStyle: "solid",
89
+ outlineWidth: "1px",
90
+ },
91
+
92
+ "&:visited": {
93
+ color: "#1662dd",
94
+ },
95
+
96
+ ".Link-indicator, .Link-icon": {
97
+ display: "inline-block",
98
+ height: "1em",
99
+ lineHeight: 1,
100
+ },
101
+
102
+ ".Link-indicator": {
103
+ marginInlineStart: "0.57142857rem",
104
+ },
105
+
106
+ ".Link-icon": {
107
+ marginInlineEnd: "0.57142857rem",
108
+ },
109
+ svg: {
110
+ fontSize: "1rem",
111
+ height: "1em",
112
+ position: "relative",
113
+ top: "-0.0625em",
114
+ verticalAlign: "middle",
115
+ width: "1em",
116
+ },
117
+ },
118
+ },
119
+ variants: [
120
+ {
121
+ props: { variant: "monochrome" },
122
+ style: {
123
+ color: "#1d1d21",
124
+ textDecoration: "underline",
125
+
126
+ "&:hover": {
127
+ color: "#6e6e78",
128
+ },
129
+
130
+ "&:focus-visible": {
131
+ outlineColor: "#1662dd",
132
+ outlineOffset: "2px",
133
+ outlineStyle: "solid",
134
+ outlineWidth: "1px",
135
+ },
136
+
137
+ "&:visited": {
138
+ color: "#1d1d21",
139
+ },
140
+ },
141
+ },
142
+ ],
143
+ },
144
+ MuiButtonBase: {
145
+ defaultProps: {
146
+ disableRipple: true,
147
+ },
148
+ },
149
+ MuiButton: {
150
+ defaultProps: {
151
+ disableElevation: true,
152
+ },
153
+ variants: [
154
+ {
155
+ props: { variant: "primary" },
156
+ style: {
157
+ fontWeight: 600,
158
+ color: "#ffffff",
159
+ borderColor: "transparent",
160
+ backgroundColor: "#1662dd",
161
+
162
+ "&:hover, &:focus-visible": {
163
+ backgroundColor: "#00297a",
164
+ },
165
+
166
+ "&:active": {
167
+ backgroundColor: "#1662dd",
168
+ },
169
+
170
+ "&:disabled": {
171
+ color: "#ffffff",
172
+ backgroundColor: "#a7b5ec",
173
+ },
174
+ },
175
+ },
176
+ {
177
+ props: { variant: "secondary" },
178
+ style: {
179
+ backgroundColor: "#f5f5f6",
180
+ borderColor: "#d7d7dc",
181
+ color: "#1d1d21",
182
+ "&:hover": {
183
+ background: "#f2f5ff",
184
+ borderColor: "#a7b5ec",
185
+ color: "#1662dd",
186
+ },
187
+
188
+ "&:focus-visible": {
189
+ backgroundColor: "#1662dd",
190
+ color: "#1662dd",
191
+ },
192
+
193
+ "&:active": {
194
+ borderColor: "#1662dd",
195
+ },
196
+
197
+ "&:disabled": {
198
+ borderColor: "#ebebed",
199
+ backgroundColor: "#ebebed",
200
+ color: "#8c8c96",
201
+ },
202
+ },
203
+ },
204
+ {
205
+ props: { variant: "danger" },
206
+ style: {
207
+ backgroundColor: "#da372c",
208
+ color: "#ffffff",
209
+ "&:hover": {
210
+ borderColor: "transparent",
211
+ backgroundColor: "#640019",
212
+ },
213
+
214
+ "&:focus-visible": {
215
+ outlineColor: "#f88c90",
216
+ backgroundColor: "#640019",
217
+ },
218
+
219
+ "&:active": {
220
+ borderColor: "transparent",
221
+ backgroundColor: "#da372c",
222
+ },
223
+
224
+ "&:disabled": {
225
+ color: "#ffffff",
226
+ borderColor: "#f88c90",
227
+ backgroundColor: "#f88c90",
228
+ },
229
+ },
230
+ },
231
+ {
232
+ props: { variant: "floating" },
233
+ style: {
234
+ backgroundColor: "#ffffff",
235
+ color: "#1d1d21",
236
+ borderColor: "transparent",
237
+
238
+ "&:hover, &:focus-visible": {
239
+ backgroundColor: "rgba(29, 29, 33, 0.1)",
240
+ borderColor: "transparent",
241
+ },
242
+ "&:active": {
243
+ backgroundColor: "rgba(29, 29, 33, 0.2)",
244
+ borderColor: "transparent",
245
+ },
246
+ "&:disabled": {
247
+ backgroundColor: "rgba(235, 235, 237, 0.6)",
248
+ color: "#6e6e78",
249
+ borderColor: "transparent",
250
+ },
251
+ },
252
+ },
253
+ {
254
+ props: { size: "s" },
255
+ style: {
256
+ paddingBlock: "calc(0.57142857rem - 1px)",
257
+ paddingInline: "calc(0.85714286rem - - 1px)",
258
+ fontSize: "1rem",
259
+ },
260
+ },
261
+ {
262
+ props: { size: "l" },
263
+ style: {
264
+ paddingBlock: "calc(1.14285714rem - 1px)",
265
+ paddingInline: "calc(1.14285714rem - 1px)",
266
+ },
267
+ },
268
+ {
269
+ props: { fullWidth: true },
270
+ style: {
271
+ display: "block",
272
+ width: "100%",
273
+ marginBlock: "0",
274
+ marginInline: "0",
275
+
276
+ "&:not(:last-child)": {
277
+ marginBlockEnd: "1.14285714rem",
278
+ },
279
+ },
280
+ },
281
+ ],
282
+ styleOverrides: {
283
+ root: ({ ownerState }) => ({
284
+ ...ownerState,
285
+ fontWeight: 600,
286
+ paddingBlock: "0.85714286rem",
287
+ paddingInline: "0.85714286rem",
288
+ display: "inline-block",
289
+ position: "relative",
290
+ marginBlock: "0",
291
+ marginInline: "0",
292
+ transitionProperty:
293
+ "color, background-color, border-color, outline-offset, outline-color",
294
+ transitionDuration: "100ms",
295
+ transitionTimingFunction: "linear",
296
+ borderWidth: "1px",
297
+ borderStyle: "solid",
298
+ outlineColor: "transparent",
299
+ outlineOffset: "0",
300
+ fontSize: "1rem",
301
+ lineHeight: "1.14285714",
302
+ whiteSpace: "nowrap",
303
+
304
+ "& + &": {
305
+ marginInlineStart: "0.57142857rem",
306
+ },
307
+
308
+ "&:focus-visible": {
309
+ outlineOffset: "2px",
310
+ outlineStyle: "solid",
311
+ outlineWidth: "2px",
312
+ },
313
+
314
+ "&:disabled": {
315
+ cursor: "not-allowed",
316
+ pointerEvents: "inherit", // in order to have cursor: not-allowed, must change pointer-events from 'none'
317
+ },
318
+ }),
319
+ },
320
+ },
321
+ };
@@ -0,0 +1,78 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ declare module "@mui/material/Link" {
14
+ interface LinkPropsVariantOverrides {
15
+ default: true;
16
+ monochrome: true;
17
+ body1: false;
18
+ body2: false;
19
+ button: false;
20
+ caption: false;
21
+ h1: false;
22
+ h2: false;
23
+ h3: false;
24
+ h4: false;
25
+ h5: false;
26
+ h6: false;
27
+ inherit: false;
28
+ overline: false;
29
+ subtitle1: false;
30
+ subtitle2: false;
31
+ }
32
+
33
+ interface LinkPropsUnderlineOverrides {
34
+ none: false;
35
+ hover: false;
36
+ always: false;
37
+ }
38
+
39
+ interface LinkPropsColorOverrides {
40
+ inherit: false;
41
+ primary: false;
42
+ secondary: false;
43
+ error: false;
44
+ info: false;
45
+ warning: false;
46
+ success: false;
47
+ }
48
+ }
49
+ declare module "@mui/material/Button" {
50
+ interface ButtonPropsVariantOverrides {
51
+ floating: true;
52
+ primary: true;
53
+ secondary: true;
54
+ danger: true;
55
+ text: false;
56
+ contained: false;
57
+ outlined: false;
58
+ }
59
+ interface ButtonPropsSizeOverrides {
60
+ s: true;
61
+ m: true;
62
+ l: true;
63
+ small: false;
64
+ medium: false;
65
+ large: false;
66
+ }
67
+ interface ButtonPropsColorOverrides {
68
+ inherit: false;
69
+ primary: false;
70
+ secondary: false;
71
+ error: false;
72
+ info: false;
73
+ warning: false;
74
+ success: false;
75
+ }
76
+ }
77
+
78
+ export {};
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ export { theme as odysseyTheme } from "./theme";