@okta/odyssey-react-mui 0.15.1 → 0.15.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 +26 -0
- package/README.md +33 -9
- package/dist/components/Icon/Add.d.ts +1 -1
- package/dist/components/Icon/AddCircle.d.ts +1 -1
- package/dist/components/Icon/AlertCircle.d.ts +1 -1
- package/dist/components/Icon/AlertCircleFilled.d.ts +1 -1
- package/dist/components/Icon/AlertTriangleFilled.d.ts +1 -1
- package/dist/components/Icon/Anchor.d.ts +1 -1
- package/dist/components/Icon/ArrowDown.d.ts +1 -1
- package/dist/components/Icon/ArrowLeft.d.ts +1 -1
- package/dist/components/Icon/ArrowRight.d.ts +1 -1
- package/dist/components/Icon/ArrowUp.d.ts +1 -1
- package/dist/components/Icon/ArrowUpDown.d.ts +1 -1
- package/dist/components/Icon/Calendar.d.ts +1 -1
- package/dist/components/Icon/Check.d.ts +1 -1
- package/dist/components/Icon/CheckCircleFilled.d.ts +1 -1
- package/dist/components/Icon/ChevronDown.d.ts +1 -1
- package/dist/components/Icon/ChevronUp.d.ts +1 -1
- package/dist/components/Icon/Close.d.ts +1 -1
- package/dist/components/Icon/CloseCircleFilled.d.ts +1 -1
- package/dist/components/Icon/Copy.d.ts +1 -1
- package/dist/components/Icon/Delete.d.ts +1 -1
- package/dist/components/Icon/Download.d.ts +1 -1
- package/dist/components/Icon/DragHandle.d.ts +1 -1
- package/dist/components/Icon/Edit.d.ts +1 -1
- package/dist/components/Icon/ExternalLink.d.ts +1 -1
- package/dist/components/Icon/Eye.d.ts +1 -1
- package/dist/components/Icon/EyeOff.d.ts +1 -1
- package/dist/components/Icon/Filter.d.ts +1 -1
- package/dist/components/Icon/Globe.d.ts +1 -1
- package/dist/components/Icon/Home.d.ts +1 -1
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icon/InformationCircle.d.ts +1 -1
- package/dist/components/Icon/InformationCircleFilled.d.ts +1 -1
- package/dist/components/Icon/Notification.d.ts +1 -1
- package/dist/components/Icon/OverflowVertical.d.ts +1 -1
- package/dist/components/Icon/QuestionCircle.d.ts +1 -1
- package/dist/components/Icon/QuestionCircleFilled.d.ts +1 -1
- package/dist/components/Icon/Search.d.ts +1 -1
- package/dist/components/Icon/Settings.d.ts +1 -1
- package/dist/components/Icon/Subtract.d.ts +1 -1
- package/dist/components/Icon/User.d.ts +1 -1
- package/dist/components/Icon/UserGroup.d.ts +1 -1
- package/dist/components/Icon/index.d.ts +40 -40
- package/dist/components/Link/Link.d.ts +1 -1
- package/dist/components/Link/Link.js +1 -1
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/PasswordInput/PasswordInput.js +4 -4
- package/dist/components/PasswordInput/PasswordInput.js.map +1 -1
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +16 -0
- package/dist/components/ThemeProvider/ThemeProvider.d.ts.map +1 -0
- package/dist/components/ThemeProvider/ThemeProvider.js +24 -0
- package/dist/components/ThemeProvider/ThemeProvider.js.map +1 -0
- package/dist/components/ThemeProvider/index.d.ts +13 -0
- package/dist/components/ThemeProvider/index.d.ts.map +1 -0
- package/dist/components/ThemeProvider/index.js +13 -0
- package/dist/components/ThemeProvider/index.js.map +1 -0
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -2
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/themes/odyssey/components.d.ts.map +1 -1
- package/dist/themes/odyssey/components.js +123 -10
- package/dist/themes/odyssey/components.js.map +1 -1
- package/dist/themes/odyssey/components.types.d.ts +5 -0
- package/dist/themes/odyssey/components.types.d.ts.map +1 -1
- package/dist/themes/odyssey/components.types.js.map +1 -1
- package/dist/themes/odyssey/shape.d.ts.map +1 -1
- package/dist/themes/odyssey/shape.js +2 -1
- package/dist/themes/odyssey/shape.js.map +1 -1
- package/dist/themes/odyssey/theme.d.ts +2 -2
- package/dist/themes/odyssey/theme.d.ts.map +1 -1
- package/dist/themes/odyssey/theme.js +8 -8
- package/dist/themes/odyssey/theme.js.map +1 -1
- package/dist/themes/odyssey/typography.js +6 -6
- package/dist/themes/odyssey/typography.js.map +1 -1
- package/dist/utils/{oid.d.ts → createUniqueId.d.ts} +3 -4
- package/dist/utils/createUniqueId.d.ts.map +1 -0
- package/dist/utils/{oid.js → createUniqueId.js} +3 -9
- package/dist/utils/createUniqueId.js.map +1 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/useUniqueId.d.ts +13 -0
- package/dist/utils/useUniqueId.d.ts.map +1 -0
- package/dist/utils/useUniqueId.js +18 -0
- package/dist/utils/useUniqueId.js.map +1 -0
- package/package.json +7 -5
- package/src/components/Link/Link.tsx +1 -1
- package/src/components/PasswordInput/PasswordInput.tsx +4 -4
- package/src/components/ThemeProvider/ThemeProvider.tsx +20 -0
- package/src/components/ThemeProvider/index.ts +13 -0
- package/src/components/index.ts +3 -2
- package/src/index.ts +80 -0
- package/src/themes/odyssey/components.tsx +120 -5
- package/src/themes/odyssey/components.types.ts +6 -0
- package/src/themes/odyssey/shape.ts +7 -1
- package/src/themes/odyssey/theme.ts +7 -7
- package/src/themes/odyssey/typography.ts +6 -6
- package/src/utils/{oid.test.ts → createUniqueId.test.ts} +5 -4
- package/src/utils/{oid.ts → createUniqueId.ts} +4 -9
- package/src/utils/index.ts +2 -1
- package/src/utils/useUniqueId.ts +21 -0
- package/dist/utils/oid.d.ts.map +0 -1
- package/dist/utils/oid.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -9,5 +9,6 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export * from "./createUniqueId.js";
|
|
13
|
+
export * from "./useUniqueId.js";
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/utils/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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\nexport * from \"./createUniqueId\";\nexport * from \"./useUniqueId\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -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
|
+
export declare const useUniqueId: (id?: string) => string;
|
|
13
|
+
//# sourceMappingURL=useUniqueId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUniqueId.d.ts","sourceRoot":"","sources":["../../src/utils/useUniqueId.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,eAAO,MAAM,WAAW,QAAS,MAAM,KAAG,MAIzC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
import { useMemo } from "react";
|
|
13
|
+
import { createUniqueId } from "./createUniqueId.js";
|
|
14
|
+
export const useUniqueId = id => {
|
|
15
|
+
const uniqueId = useMemo(() => createUniqueId(), []);
|
|
16
|
+
return id || uniqueId;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=useUniqueId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUniqueId.js","names":["useMemo","createUniqueId","useUniqueId","id","uniqueId"],"sources":["../../src/utils/useUniqueId.ts"],"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 { useMemo } from \"react\";\n\nimport { createUniqueId } from \"./createUniqueId\";\n\nexport const useUniqueId = (id?: string): string => {\n const uniqueId = useMemo(() => createUniqueId(), []);\n\n return id || uniqueId;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,OAAT,QAAwB,OAAxB;SAESC,c;AAET,OAAO,MAAMC,WAAW,GAAIC,EAAD,IAAyB;EAClD,MAAMC,QAAQ,GAAGJ,OAAO,CAAC,MAAMC,cAAc,EAArB,EAAyB,EAAzB,CAAxB;EAEA,OAAOE,EAAE,IAAIC,QAAb;AACD,CAJM"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okta/odyssey-react-mui",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"description": "React MUI components for Odyssey, Okta's design system",
|
|
5
5
|
"author": "Okta, Inc.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -19,15 +19,17 @@
|
|
|
19
19
|
"directory": "packages/odyssey-react-mui"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@
|
|
22
|
+
"@mui/icons-material": "^5.10.3",
|
|
23
|
+
"@mui/lab": "^5.0.0-alpha.103",
|
|
24
|
+
"@mui/material": "^5.10.5",
|
|
25
|
+
"@mui/utils": "^5.10.3",
|
|
26
|
+
"@okta/odyssey-design-tokens": "^0.15.2"
|
|
23
27
|
},
|
|
24
28
|
"peerDependencies": {
|
|
25
29
|
"@emotion/react": "^11",
|
|
26
30
|
"@emotion/styled": "^11",
|
|
27
|
-
"@mui/icons-material": "^5",
|
|
28
|
-
"@mui/material": "^5.9.0",
|
|
29
31
|
"react": ">=17 <19",
|
|
30
32
|
"react-dom": ">=17 <19"
|
|
31
33
|
},
|
|
32
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "fadeba32af958366b356d424c7a0a8dfcdf7a3f3"
|
|
33
35
|
}
|
|
@@ -24,7 +24,7 @@ export const Link = forwardRef<HTMLLinkElement | HTMLAnchorElement, LinkProps>(
|
|
|
24
24
|
const { icon, children, target } = props;
|
|
25
25
|
return (
|
|
26
26
|
<MuiLink {...props}>
|
|
27
|
-
<span className="Link-icon">{icon}</span>
|
|
27
|
+
{icon && <span className="Link-icon">{icon}</span>}
|
|
28
28
|
{children}
|
|
29
29
|
{target === "_blank" && (
|
|
30
30
|
<span className="Link-indicator" role="presentation">
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
InputAdornment,
|
|
23
23
|
} from "@mui/material";
|
|
24
24
|
import { Visibility, VisibilityOff } from "@mui/icons-material";
|
|
25
|
-
import {
|
|
25
|
+
import { useUniqueId } from "../../utils";
|
|
26
26
|
|
|
27
27
|
interface State {
|
|
28
28
|
password: string;
|
|
@@ -77,14 +77,14 @@ export const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(
|
|
|
77
77
|
: tooltipLabel;
|
|
78
78
|
}, [values, tooltipLabel]);
|
|
79
79
|
|
|
80
|
-
const
|
|
80
|
+
const uniqueId = useUniqueId(id);
|
|
81
81
|
|
|
82
82
|
return (
|
|
83
83
|
<Box>
|
|
84
|
-
<InputLabel htmlFor={
|
|
84
|
+
<InputLabel htmlFor={uniqueId}>{label}</InputLabel>
|
|
85
85
|
<OutlinedInput
|
|
86
86
|
{...rest}
|
|
87
|
-
id={
|
|
87
|
+
id={uniqueId}
|
|
88
88
|
inputProps={inputProps}
|
|
89
89
|
inputRef={ref}
|
|
90
90
|
onChange={handlePasswordChange}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { ThemeProvider as MuiThemeProvider } from "@mui/material/styles";
|
|
14
|
+
import { ReactElement } from "react";
|
|
15
|
+
|
|
16
|
+
import { odysseyTheme } from "../../themes";
|
|
17
|
+
|
|
18
|
+
export const ThemeProvider = ({ children }: { children: ReactElement }) => (
|
|
19
|
+
<MuiThemeProvider theme={odysseyTheme}>{children}</MuiThemeProvider>
|
|
20
|
+
);
|
|
@@ -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 "./ThemeProvider";
|
package/src/components/index.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
export * from "./PasswordInput";
|
|
14
|
-
export * from "./Link";
|
|
15
13
|
export * from "./Icon";
|
|
14
|
+
export * from "./Link";
|
|
15
|
+
export * from "./PasswordInput";
|
|
16
|
+
export * from "./ThemeProvider";
|
package/src/index.ts
CHANGED
|
@@ -10,5 +10,85 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
export {
|
|
14
|
+
Alert,
|
|
15
|
+
AlertTitle,
|
|
16
|
+
Box,
|
|
17
|
+
Button,
|
|
18
|
+
Checkbox,
|
|
19
|
+
CircularProgress,
|
|
20
|
+
CssBaseline,
|
|
21
|
+
FormControl,
|
|
22
|
+
FormControlLabel,
|
|
23
|
+
FormGroup,
|
|
24
|
+
FormHelperText,
|
|
25
|
+
FormLabel,
|
|
26
|
+
InputAdornment,
|
|
27
|
+
InputLabel,
|
|
28
|
+
OutlinedInput,
|
|
29
|
+
Radio,
|
|
30
|
+
RadioGroup,
|
|
31
|
+
Select,
|
|
32
|
+
Snackbar,
|
|
33
|
+
Stack,
|
|
34
|
+
SvgIcon,
|
|
35
|
+
Tab,
|
|
36
|
+
Table,
|
|
37
|
+
TableBody,
|
|
38
|
+
TableCell,
|
|
39
|
+
TableContainer,
|
|
40
|
+
TableHead,
|
|
41
|
+
TableRow,
|
|
42
|
+
TableSortLabel,
|
|
43
|
+
ThemeProvider as MuiThemeProvider,
|
|
44
|
+
Tooltip,
|
|
45
|
+
Typography,
|
|
46
|
+
useTheme,
|
|
47
|
+
} from "@mui/material";
|
|
48
|
+
|
|
49
|
+
export type {
|
|
50
|
+
AlertProps,
|
|
51
|
+
AlertTitleProps,
|
|
52
|
+
BoxProps,
|
|
53
|
+
ButtonProps,
|
|
54
|
+
CheckboxProps,
|
|
55
|
+
CircularProgressProps,
|
|
56
|
+
CssBaselineProps,
|
|
57
|
+
FormControlLabelProps,
|
|
58
|
+
FormControlProps,
|
|
59
|
+
FormGroupProps,
|
|
60
|
+
FormHelperTextProps,
|
|
61
|
+
FormLabelProps,
|
|
62
|
+
InputAdornmentProps,
|
|
63
|
+
InputLabelProps,
|
|
64
|
+
OutlinedInputProps,
|
|
65
|
+
RadioGroupProps,
|
|
66
|
+
RadioProps,
|
|
67
|
+
SelectProps,
|
|
68
|
+
SnackbarProps,
|
|
69
|
+
StackProps,
|
|
70
|
+
SvgIconProps,
|
|
71
|
+
TabProps,
|
|
72
|
+
TableBodyProps,
|
|
73
|
+
TableCellProps,
|
|
74
|
+
TableContainerProps,
|
|
75
|
+
TableHeadProps,
|
|
76
|
+
TableProps,
|
|
77
|
+
TableRowProps,
|
|
78
|
+
TableSortLabelProps,
|
|
79
|
+
TooltipProps,
|
|
80
|
+
TypographyProps,
|
|
81
|
+
useThemeProps,
|
|
82
|
+
} from "@mui/material";
|
|
83
|
+
|
|
84
|
+
export { TabContext, TabList, TabPanel } from "@mui/lab";
|
|
85
|
+
|
|
86
|
+
export type { TabContextProps, TabListProps, TabPanelProps } from "@mui/lab";
|
|
87
|
+
|
|
88
|
+
export { Favorite as FavoriteIcon } from "@mui/icons-material";
|
|
89
|
+
|
|
90
|
+
export { visuallyHidden } from "@mui/utils";
|
|
91
|
+
|
|
13
92
|
export * from "./components";
|
|
14
93
|
export * from "./themes";
|
|
94
|
+
export * from "./utils";
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import type { ThemeOptions } from "@mui/material";
|
|
14
|
+
import type {} from "@mui/lab/themeAugmentation";
|
|
14
15
|
//import radioClasses from "@mui/material";
|
|
15
16
|
import { outlinedInputClasses } from "@mui/material/OutlinedInput";
|
|
16
17
|
import { tableBodyClasses } from "@mui/material/TableBody";
|
|
@@ -18,6 +19,7 @@ import { tableCellClasses } from "@mui/material/TableCell";
|
|
|
18
19
|
import { tableHeadClasses } from "@mui/material/TableHead";
|
|
19
20
|
import { tableRowClasses } from "@mui/material/TableRow";
|
|
20
21
|
import { tableSortLabelClasses } from "@mui/material/TableSortLabel";
|
|
22
|
+
import { tooltipClasses } from "@mui/material/Tooltip";
|
|
21
23
|
import {
|
|
22
24
|
AlertTriangleFilledIcon,
|
|
23
25
|
ArrowDownIcon,
|
|
@@ -49,18 +51,21 @@ export const components: ThemeOptions["components"] = {
|
|
|
49
51
|
justifyContent: "center",
|
|
50
52
|
alignItems: "center",
|
|
51
53
|
borderWidth: 0,
|
|
54
|
+
borderRadius: 0,
|
|
52
55
|
}),
|
|
53
56
|
...(ownerState.variant === "infobox" && {
|
|
54
|
-
borderStyle:
|
|
55
|
-
borderWidth:
|
|
57
|
+
borderStyle: theme.mixins.borderStyle,
|
|
58
|
+
borderWidth: theme.mixins.borderWidth,
|
|
59
|
+
borderRadius: theme.mixins.borderRadius,
|
|
56
60
|
"&:not(:last-child)": {
|
|
57
61
|
marginBottom: theme.spacing(4),
|
|
58
62
|
},
|
|
59
63
|
}),
|
|
60
64
|
...(ownerState.variant === "toast" && {
|
|
61
65
|
maxWidth: theme.mixins.maxWidth,
|
|
62
|
-
borderStyle:
|
|
63
|
-
borderWidth:
|
|
66
|
+
borderStyle: theme.mixins.borderStyle,
|
|
67
|
+
borderWidth: theme.mixins.borderWidth,
|
|
68
|
+
borderRadius: theme.mixins.borderRadius,
|
|
64
69
|
position: "relative",
|
|
65
70
|
alignItems: "start",
|
|
66
71
|
}),
|
|
@@ -127,6 +132,7 @@ export const components: ThemeOptions["components"] = {
|
|
|
127
132
|
},
|
|
128
133
|
MuiButton: {
|
|
129
134
|
defaultProps: {
|
|
135
|
+
variant: "primary",
|
|
130
136
|
disableElevation: true,
|
|
131
137
|
},
|
|
132
138
|
variants: [
|
|
@@ -289,6 +295,7 @@ export const components: ThemeOptions["components"] = {
|
|
|
289
295
|
transitionTimingFunction: "linear",
|
|
290
296
|
borderWidth: theme.mixins.borderWidth,
|
|
291
297
|
borderStyle: theme.mixins.borderStyle,
|
|
298
|
+
borderRadius: theme.mixins.borderRadius,
|
|
292
299
|
outlineColor: "transparent",
|
|
293
300
|
outlineOffset: "0",
|
|
294
301
|
fontSize: theme.typography.body1.fontSize,
|
|
@@ -802,6 +809,13 @@ export const components: ThemeOptions["components"] = {
|
|
|
802
809
|
}),
|
|
803
810
|
},
|
|
804
811
|
},
|
|
812
|
+
MuiTabPanel: {
|
|
813
|
+
styleOverrides: {
|
|
814
|
+
root: {
|
|
815
|
+
padding: 0,
|
|
816
|
+
},
|
|
817
|
+
},
|
|
818
|
+
},
|
|
805
819
|
MuiTable: {
|
|
806
820
|
styleOverrides: {
|
|
807
821
|
root: ({ theme, ownerState }) => ({
|
|
@@ -838,6 +852,10 @@ export const components: ThemeOptions["components"] = {
|
|
|
838
852
|
paddingInline: theme.spacing(4),
|
|
839
853
|
overflowWrap: "break-word",
|
|
840
854
|
|
|
855
|
+
[`.${tableRowClasses.root}:hover &[rowspan]`]: {
|
|
856
|
+
backgroundColor: theme.palette.common.white,
|
|
857
|
+
},
|
|
858
|
+
|
|
841
859
|
[`.${tableBodyClasses.root} .${tableRowClasses.root}:last-of-type &`]: {
|
|
842
860
|
borderBottom: 0,
|
|
843
861
|
},
|
|
@@ -933,7 +951,7 @@ export const components: ThemeOptions["components"] = {
|
|
|
933
951
|
styleOverrides: {
|
|
934
952
|
root: ({ theme }) => ({
|
|
935
953
|
verticalAlign: "unset",
|
|
936
|
-
[`&.${tableRowClasses.
|
|
954
|
+
[`&.${tableRowClasses.root}:hover`]: {
|
|
937
955
|
backgroundColor: theme.palette.grey[50],
|
|
938
956
|
},
|
|
939
957
|
[`&.${tableRowClasses.selected}`]: {
|
|
@@ -1017,6 +1035,103 @@ export const components: ThemeOptions["components"] = {
|
|
|
1017
1035
|
}),
|
|
1018
1036
|
},
|
|
1019
1037
|
},
|
|
1038
|
+
MuiTooltip: {
|
|
1039
|
+
defaultProps: {
|
|
1040
|
+
arrow: true,
|
|
1041
|
+
enterDelay: 500,
|
|
1042
|
+
enterNextDelay: 250,
|
|
1043
|
+
placement: "top",
|
|
1044
|
+
},
|
|
1045
|
+
styleOverrides: {
|
|
1046
|
+
tooltip: ({ theme, ownerState }) => ({
|
|
1047
|
+
maxWidth: `calc(${theme.mixins.maxWidth} / 2)`,
|
|
1048
|
+
paddingBlock: theme.spacing(2),
|
|
1049
|
+
paddingInline: theme.spacing(3),
|
|
1050
|
+
backgroundColor: theme.palette.grey[900],
|
|
1051
|
+
color: theme.palette.common.white,
|
|
1052
|
+
fontSize: theme.typography.subtitle1.fontSize,
|
|
1053
|
+
lineHeight: theme.typography.subtitle1.lineHeight,
|
|
1054
|
+
...(ownerState.touch === true && {
|
|
1055
|
+
paddingBlock: theme.spacing(2),
|
|
1056
|
+
paddingInline: theme.spacing(3),
|
|
1057
|
+
fontSize: theme.typography.subtitle1.fontSize,
|
|
1058
|
+
lineHeight: theme.typography.subtitle1.lineHeight,
|
|
1059
|
+
fontWeight: theme.typography.fontWeightRegular,
|
|
1060
|
+
}),
|
|
1061
|
+
[`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]: {
|
|
1062
|
+
transformOrigin: "right center",
|
|
1063
|
+
...(ownerState.isRtl
|
|
1064
|
+
? {
|
|
1065
|
+
marginLeft: theme.spacing(3),
|
|
1066
|
+
...(ownerState.touch === true && {
|
|
1067
|
+
marginLeft: theme.spacing(4),
|
|
1068
|
+
}),
|
|
1069
|
+
}
|
|
1070
|
+
: {
|
|
1071
|
+
marginRight: theme.spacing(3),
|
|
1072
|
+
...(ownerState.touch === true && {
|
|
1073
|
+
marginRight: theme.spacing(4),
|
|
1074
|
+
}),
|
|
1075
|
+
}),
|
|
1076
|
+
},
|
|
1077
|
+
[`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]: {
|
|
1078
|
+
transformOrigin: "left center",
|
|
1079
|
+
...(ownerState.isRtl
|
|
1080
|
+
? {
|
|
1081
|
+
marginRight: theme.spacing(3),
|
|
1082
|
+
...(ownerState.touch === true && {
|
|
1083
|
+
marginRight: theme.spacing(4),
|
|
1084
|
+
}),
|
|
1085
|
+
}
|
|
1086
|
+
: {
|
|
1087
|
+
marginLeft: theme.spacing(3),
|
|
1088
|
+
...(ownerState.touch === true && {
|
|
1089
|
+
marginLeft: theme.spacing(4),
|
|
1090
|
+
}),
|
|
1091
|
+
}),
|
|
1092
|
+
},
|
|
1093
|
+
[`.${tooltipClasses.popper}[data-popper-placement*="top"] &`]: {
|
|
1094
|
+
transformOrigin: "center bottom",
|
|
1095
|
+
marginBottom: theme.spacing(3),
|
|
1096
|
+
...(ownerState.touch === true && {
|
|
1097
|
+
marginBottom: theme.spacing(4),
|
|
1098
|
+
}),
|
|
1099
|
+
},
|
|
1100
|
+
[`.${tooltipClasses.popper}[data-popper-placement*="bottom"] &`]: {
|
|
1101
|
+
transformOrigin: "center top",
|
|
1102
|
+
marginTop: theme.spacing(3),
|
|
1103
|
+
...(ownerState.touch === true && {
|
|
1104
|
+
marginTop: theme.spacing(4),
|
|
1105
|
+
}),
|
|
1106
|
+
},
|
|
1107
|
+
}),
|
|
1108
|
+
arrow: ({ theme }) => ({
|
|
1109
|
+
color: theme.palette.grey[900],
|
|
1110
|
+
"&::before": {
|
|
1111
|
+
borderRadius: "0",
|
|
1112
|
+
},
|
|
1113
|
+
|
|
1114
|
+
[`.${tooltipClasses.popper}[data-popper-placement*="top"] &::before`]: {
|
|
1115
|
+
borderRadius: `0 0 3px 0`,
|
|
1116
|
+
},
|
|
1117
|
+
|
|
1118
|
+
[`.${tooltipClasses.popper}[data-popper-placement*="right"] &::before`]:
|
|
1119
|
+
{
|
|
1120
|
+
borderRadius: `0 0 0 3px`,
|
|
1121
|
+
},
|
|
1122
|
+
|
|
1123
|
+
[`.${tooltipClasses.popper}[data-popper-placement*="bottom"] &::before`]:
|
|
1124
|
+
{
|
|
1125
|
+
borderRadius: `3px 0 0 0`,
|
|
1126
|
+
},
|
|
1127
|
+
|
|
1128
|
+
[`.${tooltipClasses.popper}[data-popper-placement*="left"] &::before`]:
|
|
1129
|
+
{
|
|
1130
|
+
borderRadius: `0 3px 0 0`,
|
|
1131
|
+
},
|
|
1132
|
+
}),
|
|
1133
|
+
},
|
|
1134
|
+
},
|
|
1020
1135
|
MuiTypography: {
|
|
1021
1136
|
defaultProps: {
|
|
1022
1137
|
fontFamily:
|
|
@@ -13,6 +13,12 @@
|
|
|
13
13
|
import type { ThemeOptions } from "@mui/material";
|
|
14
14
|
import * as Tokens from "@okta/odyssey-design-tokens";
|
|
15
15
|
|
|
16
|
+
// Strip units from BorderRadiusBase to accommodate MUI's typing
|
|
17
|
+
const NumericalBorderRadiusBase =
|
|
18
|
+
typeof Tokens.BorderRadiusBase === "string"
|
|
19
|
+
? Number(Tokens.BorderRadiusBase.replace(/(\d+).*/, "$1"))
|
|
20
|
+
: Tokens.BorderRadiusBase;
|
|
21
|
+
|
|
16
22
|
export const shape: ThemeOptions["shape"] = {
|
|
17
|
-
borderRadius:
|
|
23
|
+
borderRadius: NumericalBorderRadiusBase,
|
|
18
24
|
};
|
|
@@ -12,22 +12,22 @@
|
|
|
12
12
|
|
|
13
13
|
import { createTheme } from "@mui/material/styles";
|
|
14
14
|
|
|
15
|
+
import { components } from "./components";
|
|
16
|
+
import { mixins } from "./mixins";
|
|
15
17
|
import { palette } from "./palette";
|
|
16
|
-
import "./palette.types";
|
|
17
18
|
import { shape } from "./shape";
|
|
18
|
-
import { mixins } from "./mixins";
|
|
19
|
-
import "./mixins.types";
|
|
20
19
|
import { spacing } from "./spacing";
|
|
21
20
|
import { typography } from "./typography";
|
|
22
|
-
import "./typography.types";
|
|
23
|
-
import { components } from "./components";
|
|
24
21
|
import "./components.types";
|
|
22
|
+
import "./mixins.types";
|
|
23
|
+
import "./palette.types";
|
|
24
|
+
import "./typography.types";
|
|
25
25
|
|
|
26
26
|
export const theme = createTheme({
|
|
27
|
+
components,
|
|
28
|
+
mixins,
|
|
27
29
|
palette,
|
|
28
30
|
shape,
|
|
29
|
-
mixins,
|
|
30
31
|
spacing,
|
|
31
32
|
typography,
|
|
32
|
-
components,
|
|
33
33
|
});
|
|
@@ -28,37 +28,37 @@ export const typography: ThemeOptions["typography"] = {
|
|
|
28
28
|
letterSpacing: 0,
|
|
29
29
|
},
|
|
30
30
|
h1: {
|
|
31
|
-
fontWeight: Tokens.FontWeightBold,
|
|
31
|
+
fontWeight: Number(Tokens.FontWeightBold),
|
|
32
32
|
fontSize: Tokens.FontSizeHeading1,
|
|
33
33
|
lineHeight: Tokens.FontLineHeightHeading1,
|
|
34
34
|
marginBottom: Tokens.SpaceScale1,
|
|
35
35
|
},
|
|
36
36
|
h2: {
|
|
37
|
-
fontWeight: Tokens.FontWeightBold,
|
|
37
|
+
fontWeight: Number(Tokens.FontWeightBold),
|
|
38
38
|
fontSize: Tokens.FontSizeHeading2,
|
|
39
39
|
lineHeight: Tokens.FontLineHeightHeading2,
|
|
40
40
|
marginBottom: Tokens.SpaceScale1,
|
|
41
41
|
},
|
|
42
42
|
h3: {
|
|
43
|
-
fontWeight: Tokens.FontWeightBold,
|
|
43
|
+
fontWeight: Number(Tokens.FontWeightBold),
|
|
44
44
|
fontSize: Tokens.FontSizeHeading3,
|
|
45
45
|
lineHeight: Tokens.FontLineHeightHeading3,
|
|
46
46
|
marginBottom: Tokens.SpaceScale1,
|
|
47
47
|
},
|
|
48
48
|
h4: {
|
|
49
|
-
fontWeight: Tokens.FontWeightBold,
|
|
49
|
+
fontWeight: Number(Tokens.FontWeightBold),
|
|
50
50
|
fontSize: Tokens.FontSizeHeading4,
|
|
51
51
|
lineHeight: Tokens.FontLineHeightHeading4,
|
|
52
52
|
marginBottom: Tokens.SpaceScale1,
|
|
53
53
|
},
|
|
54
54
|
h5: {
|
|
55
|
-
fontWeight: Tokens.FontWeightBold,
|
|
55
|
+
fontWeight: Number(Tokens.FontWeightBold),
|
|
56
56
|
fontSize: Tokens.FontSizeHeading5,
|
|
57
57
|
lineHeight: Tokens.FontLineHeightHeading5,
|
|
58
58
|
marginBottom: Tokens.SpaceScale1,
|
|
59
59
|
},
|
|
60
60
|
h6: {
|
|
61
|
-
fontWeight: Tokens.FontWeightBold,
|
|
61
|
+
fontWeight: Number(Tokens.FontWeightBold),
|
|
62
62
|
fontSize: Tokens.FontScale2,
|
|
63
63
|
lineHeight: Tokens.FontLineHeightHeading6,
|
|
64
64
|
marginBottom: Tokens.SpaceScale1,
|
|
@@ -10,12 +10,13 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { createUniqueId, uniqueIdLength } from "./createUniqueId";
|
|
14
14
|
|
|
15
|
-
describe("
|
|
15
|
+
describe("createUniqueId", () => {
|
|
16
16
|
it("returns a nice id string", () => {
|
|
17
|
-
const result =
|
|
17
|
+
const result = createUniqueId();
|
|
18
|
+
|
|
18
19
|
expect(typeof result).toBe("string");
|
|
19
|
-
expect(result).toHaveLength(
|
|
20
|
+
expect(result).toHaveLength(uniqueIdLength);
|
|
20
21
|
});
|
|
21
22
|
});
|
|
@@ -10,13 +10,8 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
// This is a random number chosen to shrink down the unique ID to an arbitrary length.
|
|
14
|
+
export const uniqueIdLength = 6;
|
|
14
15
|
|
|
15
|
-
export const
|
|
16
|
-
|
|
17
|
-
export const oid = (): string => Math.random().toString(36).slice(-length);
|
|
18
|
-
|
|
19
|
-
export const useOid = (id?: string): string => {
|
|
20
|
-
const _oid = useMemo(oid, [oid]);
|
|
21
|
-
return id || _oid;
|
|
22
|
-
};
|
|
16
|
+
export const createUniqueId = (): string =>
|
|
17
|
+
Math.random().toString(36).slice(-uniqueIdLength);
|
package/src/utils/index.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
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 { useMemo } from "react";
|
|
14
|
+
|
|
15
|
+
import { createUniqueId } from "./createUniqueId";
|
|
16
|
+
|
|
17
|
+
export const useUniqueId = (id?: string): string => {
|
|
18
|
+
const uniqueId = useMemo(() => createUniqueId(), []);
|
|
19
|
+
|
|
20
|
+
return id || uniqueId;
|
|
21
|
+
};
|
package/dist/utils/oid.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oid.d.ts","sourceRoot":"","sources":["../../src/utils/oid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,eAAO,MAAM,MAAM,IAAI,CAAC;AAExB,eAAO,MAAM,GAAG,QAAO,MAAmD,CAAC;AAE3E,eAAO,MAAM,MAAM,QAAS,MAAM,KAAG,MAGpC,CAAC"}
|
package/dist/utils/oid.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oid.js","names":["useMemo","length","oid","Math","random","toString","slice","useOid","id","_oid"],"sources":["../../src/utils/oid.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-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 { useMemo } from \"react\";\n\nexport const length = 6;\n\nexport const oid = (): string => Math.random().toString(36).slice(-length);\n\nexport const useOid = (id?: string): string => {\n const _oid = useMemo(oid, [oid]);\n return id || _oid;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,OAAT,QAAwB,OAAxB;AAEA,OAAO,MAAMC,MAAM,GAAG,CAAf;AAEP,OAAO,MAAMC,GAAG,GAAG,MAAcC,IAAI,CAACC,MAAL,GAAcC,QAAd,CAAuB,EAAvB,EAA2BC,KAA3B,CAAiC,CAACL,MAAlC,CAA1B;AAEP,OAAO,MAAMM,MAAM,GAAIC,EAAD,IAAyB;EAC7C,MAAMC,IAAI,GAAGT,OAAO,CAACE,GAAD,EAAM,CAACA,GAAD,CAAN,CAApB;;EACA,OAAOM,EAAE,IAAIC,IAAb;AACD,CAHM"}
|