diff --git a/.bacon.yml b/.bacon.yml new file mode 100644 index 0000000000..1579edfee9 --- /dev/null +++ b/.bacon.yml @@ -0,0 +1,8 @@ +test_suites: + - name: semgrep + script_path: /root/okta/odyssey/scripts + sort_order: "1" + timeout: "10" + script_name: semgrep + criteria: MERGE + queue_name: small diff --git a/.yarn/cache/storybook-addon-rtl-direction-npm-0.0.19-a6fab876fe-688ac4c510.zip b/.yarn/cache/storybook-addon-rtl-direction-npm-0.0.19-a6fab876fe-688ac4c510.zip new file mode 100644 index 0000000000..fa7801fcb2 Binary files /dev/null and b/.yarn/cache/storybook-addon-rtl-direction-npm-0.0.19-a6fab876fe-688ac4c510.zip differ diff --git a/packages/odyssey-react-mui/README.md b/packages/odyssey-react-mui/README.md index e25492e877..4508ec891c 100644 --- a/packages/odyssey-react-mui/README.md +++ b/packages/odyssey-react-mui/README.md @@ -18,7 +18,7 @@ This project follows semantic versioning conventions: Install the package and peer dependencies: ```sh -yarn add @okta/odyssey-react-mui @emotion/react +yarn add @okta/odyssey-react-mui ``` Include fonts: diff --git a/packages/odyssey-react-mui/package.json b/packages/odyssey-react-mui/package.json index 4f086ef598..de2161cfb6 100644 --- a/packages/odyssey-react-mui/package.json +++ b/packages/odyssey-react-mui/package.json @@ -62,6 +62,8 @@ }, "dependencies": { "@emotion/cache": "^11.10.5", + "@emotion/react": "^11.11.1", + "@emotion/styled": "^11.11.0", "@mui/icons-material": "^5.11.0", "@mui/lab": "^5.0.0-alpha.117", "@mui/material": "^5.12.3", @@ -78,8 +80,6 @@ "devDependencies": { "@babel/cli": "^7.22.9", "@babel/core": "^7.22.9", - "@emotion/react": "^11.11.1", - "@emotion/styled": "^11.11.0", "@okta/browserslist-config-odyssey": "workspace:*", "@okta/odyssey-babel-preset": "workspace:*", "@okta/odyssey-icons": "workspace:*", @@ -114,8 +114,6 @@ "yargs": "^17.7.2" }, "peerDependencies": { - "@emotion/react": "^11", - "@emotion/styled": "^11", "react": ">=17 <19", "react-dom": ">=17 <19" } diff --git a/packages/odyssey-react-mui/src/Autocomplete.tsx b/packages/odyssey-react-mui/src/Autocomplete.tsx index 62481a15e7..54fd8aeae1 100644 --- a/packages/odyssey-react-mui/src/Autocomplete.tsx +++ b/packages/odyssey-react-mui/src/Autocomplete.tsx @@ -157,6 +157,7 @@ const Autocomplete = < ( +const Box = forwardRef( ({ children, component, id, sx }, ref) => ( ( ) ); -Box.displayName = "Box"; +const MemoizedBox = memo(Box); +MemoizedBox.displayName = "Box"; + +export { MemoizedBox as Box }; diff --git a/packages/odyssey-react-mui/src/MenuButton.tsx b/packages/odyssey-react-mui/src/MenuButton.tsx index f522d4e609..cafabfddd1 100644 --- a/packages/odyssey-react-mui/src/MenuButton.tsx +++ b/packages/odyssey-react-mui/src/MenuButton.tsx @@ -12,7 +12,7 @@ import { Button, buttonVariantValues, MenuItem, useUniqueId } from "./"; import { Divider, ListSubheader, Menu } from "@mui/material"; -import { ChevronDownIcon } from "./icons.generated"; +import { ChevronDownIcon, MoreIcon } from "./icons.generated"; import { memo, type ReactElement, useCallback, useMemo, useState } from "react"; import { MenuContext, MenuContextType } from "./MenuContext"; @@ -55,6 +55,10 @@ export type MenuButtonProps = { * The id of the Button */ id?: string; + /** + * If the MenuButton is an overflow menu or standard menu. + */ + isOverflow?: boolean; /** * The tooltip text for the Button if it's icon-only */ @@ -84,8 +88,9 @@ const MenuButton = ({ buttonLabel = "", buttonVariant = "secondary", children, - endIcon = , + endIcon: endIconProp, id: idOverride, + isOverflow, tooltipText, }: MenuButtonProps) => { const [anchorEl, setAnchorEl] = useState(null); @@ -115,6 +120,14 @@ const MenuButton = ({ [closeMenu, openMenu] ); + const endIcon = endIconProp ? ( + endIconProp + ) : isOverflow ? ( + + ) : ( + + ); + return (