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

SideNav updates #2402

merged 43 commits into from
Nov 4, 2024

Conversation

jordankoschei-okta
Copy link
Contributor

Updates to the SideNav, from @bryancunningham-okta and @jordankoschei-okta

jordankoschei-okta and others added 25 commits October 29, 2024 11:40
# Conflicts:
#	packages/odyssey-react-mui/src/labs/UiShell/UiShellContent.tsx
# Conflicts:
#	packages/odyssey-react-mui/src/labs/TopNav/TopNav.tsx
// The box shadow should appear above the footer only if the scrollable region has overflow
...(isContentScrollable && {
boxShadow: odysseyDesignTokens.DepthHigh,
boxShadow: "0px -8px 8px -8px rgba(39, 39, 39, 0.08)",
Copy link
Contributor

@KevinGhadyani-Okta KevinGhadyani-Okta Nov 1, 2024

Choose a reason for hiding this comment

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

Is there a reason we couldn't use the shadow from Odyssey itself?

We can add clip-path if this was causing bleed-over (like I did on top nav)

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need any support for IE11? Will SIW team use this?

"& + &": {
marginInlineStart: odysseyDesignTokens.Spacing4,
paddingInlineStart: odysseyDesignTokens.Spacing4,
borderInlineStart: `1px solid ${odysseyDesignTokens.HueNeutral300}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we have these 1px solid styles in Odyssey design tokens.

Comment on lines +47 to 60
const memoizedFooterContent = useMemo(() => {
return footerItems?.map((item) => (
<StyledFooterItemContainer
key={item.id}
odysseyDesignTokens={odysseyDesignTokens}
role="menuitem"
>
{item.href ? (
<Link key={item.id} href={item.href}>
{item.label}
</Link>
<Link href={item.href}>{item.label}</Link>
) : (
<Box component="span" key={item.id}>
{item.label}
</Box>
)}
{index < footerItems.length - 1 && (
<Box
key={`${item.id}-separator`}
sx={{
marginLeft: odysseyDesignTokens.Spacing4,
marginRight: odysseyDesignTokens.Spacing4,
color: odysseyDesignTokens.HueNeutral300,
}}
>
|
</Box>
<Box component="span">{item.label}</Box>
)}
</Box>
</StyledFooterItemContainer>
));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason this is memoized and not inline? We don't have any objects requiring memoization. I'd just move it down because we're creating an in-place component for no reason resulting in unnecessary indirection. If we wanna make a separate component, we should move it to another file.

Comment on lines 33 to 37
"svg, img": {
height: "100%",
width: "auto",
maxWidth: "100%",
},
Copy link
Contributor

Choose a reason for hiding this comment

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

We only need this if they're passing those to us and we're not rendering them ourselves.

Since we're rendering the images now, we should be able to put the styles there ourselves. I think the issue is we can't pass props to svg elements in Odyssey.

transition: `backgroundColor ${odysseyDesignTokens.TransitionDurationMain}, color ${odysseyDesignTokens.TransitionDurationMain}`,

...(isSelected && {
color: `${odysseyDesignTokens.TypographyColorAction} !important`,
Copy link
Contributor

Choose a reason for hiding this comment

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

I hope we could find a way to remove this !important.

Copy link
Contributor

Choose a reason for hiding this comment

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

color from MuiLink is getting higher precedence somewhere.

margin: `${odysseyDesignTokens.Spacing1} 0`,
backgroundColor: "unset",
borderRadius: odysseyDesignTokens.BorderRadiusMain,
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.

What's this line-height doing compared to padding? Just wanna make sure I'm on board.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's increasing the height of the items to 48px. As opposed to just setting a height on them

Copy link
Contributor

Choose a reason for hiding this comment

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

same as above. I guess we can use the TypographyLineHeightBody

padding: contextValue.isCompact
? `${odysseyDesignTokens.Spacing0} ${odysseyDesignTokens.Spacing4} ${odysseyDesignTokens.Spacing0} calc(${odysseyDesignTokens.Spacing4} * ${contextValue.depth})`
: `${odysseyDesignTokens.Spacing2} ${odysseyDesignTokens.Spacing4} ${odysseyDesignTokens.Spacing2} calc(${odysseyDesignTokens.Spacing4} * ${contextValue.depth})`,
color: `${odysseyDesignTokens.TypographyColorHeading} !important`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Another !important color.

outlineStyle: odysseyDesignTokens.FocusOutlineStyle,
outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,
outline: "none",
boxShadow: `inset 0 0 0 3px ${odysseyDesignTokens.PalettePrimaryMain}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have this box shadow in Odyssey?

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

Copy link
Contributor

@ganeshsomasundaram-okta ganeshsomasundaram-okta left a comment

Choose a reason for hiding this comment

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

lgtm! Added some comments to review.

Copy link
Contributor

@ganeshsomasundaram-okta ganeshsomasundaram-okta left a comment

Choose a reason for hiding this comment

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

🚢

@oktapp-aperture-okta oktapp-aperture-okta bot merged commit 2a520c4 into main Nov 4, 2024
1 check passed
@oktapp-aperture-okta oktapp-aperture-okta bot deleted the bc-jk-sidenav-updates branch November 4, 2024 17:53
benschell-okta pushed a commit that referenced this pull request Nov 15, 2024
DES-6714 refactor: alphabetize props
feat: add the loading state
feat: add more a11y roles
feat(odyssey-storybook): add SideNavToggleButton
feat(odyssey-storybook): refacor and use new toggle button
test: add unit tests for SideNav
Merge branch 'bc-jk-sidenav-updates' of github.com:okta/odyssey into bc-jk-sidenav-updates
fix: add accessible heading role to sidenav
refactor: replace t with useTranslation in imports
feat(odyssey-storybook): add translations for toggle button
feat(odyssey-storybook): update padding and cleanup footer code
feat: add badge to SideNav
refactor: updating accessibility roles
Merge remote-tracking branch 'origin/main' into bc-jk-sidenav-updates
fix: fixes Side nav collapse icon wasn't showing up over the app content
fix: fix a11y role violations
feat: add overflow scroll to TopNav
fix: adjust width of Heading skeleton
feat(odyssey-storybook): add custom logo props
fix: moves banner above UI Shell

# Conflicts:
#	packages/odyssey-react-mui/src/labs/UiShell/UiShellContent.tsx
fix: fixes styling of TopNav slots and responsiveness

# Conflicts:
#	packages/odyssey-react-mui/src/labs/TopNav/TopNav.tsx
fix: refactors UI Shell scroll logic into useScrollState
fix: minor rename of useScrollState generic
feat(odyssey-storybook): more style updates to match Figma
feat: adds ability to know if UI Shell is rendered on the page
fix: fixes PageTemplate padding for UI Shell mode
fix: adds missing clip-path to TopNav shadow
fix: fixes border not showing up when scrolling side nav in UI Shell
fix: fixes topnav shadow not going over Surface
fix: removes unused expandedWidth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants