-
Notifications
You must be signed in to change notification settings - Fork 34
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
SideNav updates #2402
Conversation
…bc-jk-sidenav-updates
# 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)", |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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}`, |
There was a problem hiding this comment.
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.
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> | ||
)); |
There was a problem hiding this comment.
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.
"svg, img": { | ||
height: "100%", | ||
width: "auto", | ||
maxWidth: "100%", | ||
}, |
There was a problem hiding this comment.
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`, |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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`, |
There was a problem hiding this comment.
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}`, |
There was a problem hiding this comment.
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?
packages/odyssey-react-mui/src/labs/SideNav/SideNavItemLinkContent.tsx
Outdated
Show resolved
Hide resolved
borderRadius: odysseyDesignTokens.BorderRadiusMain, | ||
paddingBlock: odysseyDesignTokens.Spacing3, | ||
paddingInline: odysseyDesignTokens.Spacing4, | ||
lineHeight: 1.5, |
There was a problem hiding this comment.
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
There was a problem hiding this 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.
…rity mutually exclusive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
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
Updates to the SideNav, from @bryancunningham-okta and @jordankoschei-okta