Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SideNav updates #2402

Merged
merged 43 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
0521de3
refactor: alphabetize props
jordankoschei-okta Oct 29, 2024
eb2e3c8
feat: add the loading state
jordankoschei-okta Oct 29, 2024
ca28c63
feat: add more a11y roles
jordankoschei-okta Oct 29, 2024
37e241e
feat(odyssey-storybook): add SideNavToggleButton
bryancunningham-okta Oct 30, 2024
760055d
feat(odyssey-storybook): refacor and use new toggle button
bryancunningham-okta Oct 30, 2024
619e815
test: add unit tests for SideNav
jordankoschei-okta Oct 30, 2024
7adb13e
Merge branch 'bc-jk-sidenav-updates' of github.com:okta/odyssey into …
jordankoschei-okta Oct 30, 2024
673f8eb
fix: add accessible heading role to sidenav
jordankoschei-okta Oct 30, 2024
c5f2d88
refactor: replace t with useTranslation in imports
jordankoschei-okta Oct 30, 2024
3225267
feat(odyssey-storybook): add translations for toggle button
bryancunningham-okta Oct 30, 2024
4431e6e
feat(odyssey-storybook): update padding and cleanup footer code
bryancunningham-okta Oct 30, 2024
da6b506
feat: add badge to SideNav
jordankoschei-okta Oct 30, 2024
20b3c7f
refactor: updating accessibility roles
jordankoschei-okta Oct 30, 2024
53dc12f
Merge remote-tracking branch 'origin/main' into bc-jk-sidenav-updates
KevinGhadyani-Okta Oct 30, 2024
d65d3dc
fix: fixes Side nav collapse icon wasn't showing up over the app content
KevinGhadyani-Okta Oct 30, 2024
72dff57
fix: fix a11y role violations
jordankoschei-okta Oct 31, 2024
5d29133
feat: add overflow scroll to TopNav
jordankoschei-okta Oct 31, 2024
b12e91d
fix: adjust width of Heading skeleton
jordankoschei-okta Oct 31, 2024
d1004ab
feat(odyssey-storybook): add custom logo props
bryancunningham-okta Oct 31, 2024
3eb6d35
fix: moves banner above UI Shell
KevinGhadyani-Okta Oct 31, 2024
8c4f60f
fix: fixes styling of TopNav slots and responsiveness
KevinGhadyani-Okta Oct 31, 2024
64fda9c
fix: refactors UI Shell scroll logic into useScrollState
KevinGhadyani-Okta Oct 31, 2024
9076cf9
fix: minor rename of useScrollState generic
KevinGhadyani-Okta Oct 31, 2024
084f200
feat(odyssey-storybook): more style updates to match Figma
bryancunningham-okta Oct 31, 2024
fd85509
feat: adds ability to know if UI Shell is rendered on the page
KevinGhadyani-Okta Oct 31, 2024
4a571bd
fix: fixes PageTemplate padding for UI Shell mode
KevinGhadyani-Okta Oct 31, 2024
33c4554
fix: adds missing clip-path to TopNav shadow
KevinGhadyani-Okta Oct 31, 2024
d270745
fix: fixes border not showing up when scrolling side nav in UI Shell
KevinGhadyani-Okta Oct 31, 2024
a447803
fix: fixes topnav shadow not going over Surface
KevinGhadyani-Okta Oct 31, 2024
795b654
fix: removes unused expandedWidth
KevinGhadyani-Okta Oct 31, 2024
bb802d0
feat(odyssey-react-mui): updated footer padding
bryancunningham-okta Nov 1, 2024
b696d52
feat(odyssey-react-mui): updated footer padding and logos dont grow
bryancunningham-okta Nov 1, 2024
33acce7
fix: fixes clip-path issue causing top nav to cut-off modals in Admin
KevinGhadyani-Okta Nov 1, 2024
58beae7
fix: removes unused commented CSS from side nav
KevinGhadyani-Okta Nov 1, 2024
4c709d9
feat(odyssey-react-mui): use generic in callback for keyboard event
bryancunningham-okta Nov 1, 2024
5d56b05
feat(odyssey-react-mui): use grid for sidenav layout
bryancunningham-okta Nov 1, 2024
542239b
feat(odyssey-react-mui): updated grid transition timing
bryancunningham-okta Nov 1, 2024
5f97f2c
feat(odyssey-react-mui): add id for button to control
bryancunningham-okta Nov 1, 2024
844e3fc
fix: fixes type issues
KevinGhadyani-Okta Nov 1, 2024
778b3b3
fix: renames SideNavTest.test.ts to SideNav.test.ts
KevinGhadyani-Okta Nov 1, 2024
a011f0a
feat(odyssey-react-mui): updated button position. make count and seve…
bryancunningham-okta Nov 4, 2024
5640ebd
feat(odyssey-react-mui): updated button focus ring. fix storybook tests
bryancunningham-okta Nov 4, 2024
53023e9
refactor: make specific CSS less specific
jordankoschei-okta Nov 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/odyssey-react-mui/src/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,27 @@
*/

import { Box as MuiBox, BoxProps as MuiBoxProps } from "@mui/material";
import { ReactNode, forwardRef, memo } from "react";
import { AriaRole, ReactNode, forwardRef, memo } from "react";

import type { HtmlProps } from "./HtmlProps";

export type BoxProps = {
children?: ReactNode;
component?: MuiBoxProps["component"];
id?: MuiBoxProps["id"];
role?: AriaRole;
sx?: MuiBoxProps["sx"];
} & Pick<HtmlProps, "testId" | "translate">;

const Box = forwardRef<HTMLElement, BoxProps>(
({ children, component, id, sx, testId, translate }, ref) => (
({ children, component, id, role, sx, testId, translate }, ref) => (
<MuiBox
ref={ref}
children={children}
component={component}
data-se={testId}
id={id}
role={role}
sx={sx}
jordankoschei-okta marked this conversation as resolved.
Show resolved Hide resolved
translate={translate}
/>
Expand Down
28 changes: 18 additions & 10 deletions packages/odyssey-react-mui/src/labs/PageTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
import { DocumentationIcon } from "../icons.generated";
import { Heading4, Subordinate } from "../Typography";
import { Link } from "../Link";
import { useHasUiShell } from "./UiShell";

export type PageTemplateProps = {
/**
Expand Down Expand Up @@ -72,16 +73,20 @@ type TemplateContentProps = {

const TemplateContainer = styled("div", {
shouldForwardProp: (prop) =>
prop !== "odysseyDesignTokens" && prop !== "isFullWidth",
prop !== "odysseyDesignTokens" &&
prop !== "hasUiShell" &&
prop !== "isFullWidth",
})<{
odysseyDesignTokens: DesignTokens;
hasUiShell: boolean;
isFullWidth: boolean;
}>(({ odysseyDesignTokens, isFullWidth }) => ({
odysseyDesignTokens: DesignTokens;
}>(({ hasUiShell, isFullWidth, odysseyDesignTokens }) => ({
maxWidth: isFullWidth
? "100%"
: `calc(1440px + ${odysseyDesignTokens.Spacing6} + ${odysseyDesignTokens.Spacing6})`,
marginInline: isFullWidth ? odysseyDesignTokens.Spacing6 : "auto",
padding: odysseyDesignTokens.Spacing6,
marginInline:
isFullWidth && !hasUiShell ? odysseyDesignTokens.Spacing6 : "auto",
padding: hasUiShell ? 0 : odysseyDesignTokens.Spacing6,
}));

const TemplateHeader = styled("div")(() => ({
Expand Down Expand Up @@ -163,24 +168,27 @@ const TemplateContent = styled("div", {
);

const PageTemplate = ({
title,
children,
description,
documentationLink,
documentationText,
drawer,
isFullWidth = false,
primaryCallToActionComponent,
secondaryCallToActionComponent,
tertiaryCallToActionComponent,
children,
drawer,
isFullWidth = false,
title,
}: PageTemplateProps) => {
const odysseyDesignTokens = useOdysseyDesignTokens();
const { isOpen: isDrawerOpen, variant: drawerVariant } = drawer?.props ?? {};

const hasUiShell = useHasUiShell();

return (
<TemplateContainer
odysseyDesignTokens={odysseyDesignTokens}
hasUiShell={hasUiShell}
isFullWidth={isFullWidth}
odysseyDesignTokens={odysseyDesignTokens}
>
<TemplateHeader>
<TemplateHeaderPrimaryContent>
Expand Down
38 changes: 22 additions & 16 deletions packages/odyssey-react-mui/src/labs/SideNav/NavAccordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
import { ReactNode, memo } from "react";

import type { HtmlProps } from "../../HtmlProps";
import { ChevronRightIcon } from "../../icons.generated";
import { ChevronDownIcon } from "../../icons.generated";
import {
DesignTokens,
useOdysseyDesignTokens,
Expand Down Expand Up @@ -86,26 +86,32 @@ const AccordionSummaryContainer = styled(MuiAccordionSummary, {
shouldForwardProp: (prop) =>
prop !== "odysseyDesignTokens" &&
prop !== "isCompact" &&
prop != "isDisabled",
prop !== "isDisabled",
})<{
odysseyDesignTokens: DesignTokens;
isCompact?: boolean;
isDisabled?: boolean;
}>(({ odysseyDesignTokens, isCompact, isDisabled }) => ({
minHeight: isCompact
? `${odysseyDesignTokens.Spacing6}`
: `${odysseyDesignTokens.Spacing7}`,
padding: isCompact
? `${odysseyDesignTokens.Spacing0} ${odysseyDesignTokens.Spacing4}`
: `${odysseyDesignTokens.Spacing2} ${odysseyDesignTokens.Spacing4}`,
"&:hover": {
backgroundColor: !isDisabled ? odysseyDesignTokens.HueBlue50 : "inherit",
"& span": {
color: isDisabled
? "default"
: `${odysseyDesignTokens.TypographyColorAction}`,
},
borderRadius: odysseyDesignTokens.BorderRadiusMain,
paddingBlock: odysseyDesignTokens.Spacing3,
paddingInline: odysseyDesignTokens.Spacing4,
lineHeight: 1.5,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use TypographyLineHeightBody here


"&:focus-visible": {
backgroundColor: "unset",
outline: "none",
boxShadow: `inset 0 0 0 3px ${odysseyDesignTokens.PalettePrimaryMain}`,
},

...(isCompact && {
paddingBlock: odysseyDesignTokens.Spacing2,
}),

...(!isDisabled && {
"&:hover": {
backgroundColor: odysseyDesignTokens.HueNeutral50,
},
}),
}));

const NavAccordion = ({
Expand Down Expand Up @@ -135,7 +141,7 @@ const NavAccordion = ({
<AccordionSummaryContainer
className="nav-accordion-summary"
aria-controls={contentId}
expandIcon={<ChevronRightIcon />}
expandIcon={<ChevronDownIcon />}
id={headerId}
odysseyDesignTokens={odysseyDesignTokens}
isCompact={isCompact}
Expand Down
1 change: 1 addition & 0 deletions packages/odyssey-react-mui/src/labs/SideNav/OktaLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const OktaLogo = () => {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<title>Okta</title>
<path
d="M55.308 20.5716C52.1058 20.5716 49.8418 18.0813 49.8418 14.8145C49.8418 11.5476 52.1058 9.0574 55.308 9.0574C58.5103 9.0574 60.7097 11.5476 60.7097 14.8145C60.7097 18.0813 58.478 20.5716 55.308 20.5716ZM54.7905 24C57.3782 24 59.5777 22.9972 60.9682 20.8947C61.2267 22.9326 62.7147 23.6763 64.5905 23.6763H66.0785V20.4418H65.4317C64.3643 20.4418 64.1058 19.9242 64.1058 18.7276V5.95153H60.6774V8.57159C59.5131 6.72814 57.3136 5.62842 54.7911 5.62842C50.2952 5.62842 46.1554 9.38051 46.1554 14.8139C46.1554 20.2473 50.2947 24 54.7905 24ZM37.1309 19.5688C37.1309 22.4797 38.942 23.6763 41.1092 23.6763H45.2813V20.4418H42.2412C40.9799 20.4418 40.7209 19.9565 40.7209 18.7276V9.18608H45.2813V5.95153H40.7209V0H37.1309V19.5688ZM20.7972 23.6763H24.3872V16.0758H25.5838L31.6969 23.6763H36.225L28.4301 14.0379L34.4139 5.9521H30.371L25.4869 12.7766H24.3872V0.00113398H20.7972V23.6763ZM9.1532 5.62842C4.13983 5.62842 0 9.38051 0 14.8139C0 20.2473 4.13983 23.9994 9.1532 23.9994C14.1666 23.9994 18.3064 20.2473 18.3064 14.8139C18.3064 9.38051 14.1666 5.62842 9.1532 5.62842ZM9.1532 20.5716C5.95096 20.5716 3.68689 18.0813 3.68689 14.8145C3.68689 11.5476 5.95096 9.0574 9.1532 9.0574C12.3554 9.0574 14.6195 11.5476 14.6195 14.8145C14.6195 18.0813 12.3554 20.5716 9.1532 20.5716Z"
fill="black"
Expand Down
Loading