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

[WIP] Nav menu redesign #11952

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9be3ce6
style: add menu semantic tokens
wackerow Jan 17, 2024
32fbf6d
refactor: update nav item architecture
wackerow Jan 17, 2024
c91dac5
refactor: update Nav with new useNav, rm subnav
wackerow Jan 17, 2024
372bb3f
refactor: initialize mobile nav updates
wackerow Jan 17, 2024
39627f9
refactor: new Menu design using Popover
wackerow Jan 17, 2024
6bf6dbb
fix: pass direction to Chakra theme provider
wackerow Jan 15, 2024
9fa3f37
refactor: extract reusable MenuButton component
wackerow Jan 17, 2024
aaf7bb1
style: add bold font-weight to button label
wackerow Jan 17, 2024
76265b1
style: remove expand chevron
wackerow Jan 17, 2024
289886c
style: implement partiallyActive and hover styles
wackerow Jan 17, 2024
2725369
feat: implement menu icons
wackerow Jan 17, 2024
dcdffdc
refactor: extract section labels to constants
wackerow Jan 18, 2024
c70a82c
feat: initial draft of mobile menu
wackerow Jan 18, 2024
3e070ec
fix: lvl4 items, allowToggle, linting
wackerow Jan 18, 2024
ec76681
fix: hide hamburger on desktop
wackerow Jan 18, 2024
d4f651e
style: remove hover, wrap buttons
wackerow Jan 18, 2024
0f38a19
refactor: extract reusable Level type
wackerow Jan 18, 2024
55d4528
refactor: extract reusable LvlAccordion
wackerow Jan 18, 2024
e5024c0
fix: apply 'modal' zIndex to search modal
wackerow Jan 19, 2024
7e59a80
style: change isPartiallyActive to highContrast
wackerow Jan 19, 2024
07ec669
fix: hiding logic for desktop and mobile
wackerow Jan 20, 2024
ac2f3c5
style: display mobile menu below md breakpoint
wackerow Jan 20, 2024
9f27996
style: add box styles per design
wackerow Jan 20, 2024
db0016a
style: add auto-scroll to menu grid
wackerow Jan 21, 2024
84465a4
fix: isActive styling, add cleanPath util
wackerow Jan 21, 2024
af2f57d
style: animate active section bg with layoutId
wackerow Jan 22, 2024
5534be5
style: improve logic for minW of menu section
wackerow Jan 22, 2024
c947331
style: improve hover animations, tablet sizes
wackerow Jan 22, 2024
43cbc2f
fix: mobile RTL alignment
wackerow Jan 22, 2024
61891d5
fix: layout shift for nav icons
wackerow Jan 22, 2024
0103da0
Merge branch 'dev' into nav-menu
wackerow Jan 22, 2024
696c219
Merge branch 'dev' into nav-menu
wackerow Jan 25, 2024
8187c56
Merge branch 'dev' into nav-menu
wackerow Jan 30, 2024
6a6a96b
i18n: extract JSON strings
wackerow Feb 1, 2024
cc88aad
Merge branch 'dev' into nav-menu
wackerow Feb 1, 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
35 changes: 35 additions & 0 deletions src/@chakra-ui/semanticTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,36 @@ const semanticTokens = {
_light: "rgba(255, 255, 255, 0.80)",
_dark: "rgba(34, 34, 34, 0.80)",
},

// Menu
menu: {
stroke: { _light: "gray.200", _dark: "gray.600" },
highlight: "primary.base",
lvl1: {
main: "body.base",
subtext: { _light: "gray.400", _dark: "gray.400" },
background: { _light: "white", _dark: "black" },
activeBackground: { _light: "gray.150", _dark: "gray.700" },
},
lvl2: {
main: "body.base",
subtext: { _light: "gray.400", _dark: "gray.300" },
background: { _light: "gray.150", _dark: "gray.700" },
activeBackground: { _light: "gray.200", _dark: "gray.600" },
},
lvl3: {
main: "body.base",
subtext: { _light: "gray.500", _dark: "gray.300" },
background: { _light: "gray.200", _dark: "gray.600" },
activeBackground: { _light: "gray.100", _dark: "gray.700" },
},
lvl4: {
main: "body.base",
subtext: { _light: "gray.700", _dark: "gray.300" },
background: { _light: "gray.300", _dark: "gray.700" },
activeBackground: { _light: "gray.200", _dark: "gray.800" },
},
}
},
gradients: {
bgMainGradient: {
Expand All @@ -105,6 +135,11 @@ const semanticTokens = {
"linear-gradient(102.7deg, rgba(185, 185, 241, 0.2) 0%, rgba(84, 132, 234, 0.2) 51.56%, rgba(58, 142, 137, 0.2) 100%)",
},
},
shadows: {
menu: {
accordion: "0px 2px 2px 0px rgba(0, 0, 0, 0.12) inset, 0px -3px 2px 0px rgba(0, 0, 0, 0.14) inset"
}
}
}

export default semanticTokens
8 changes: 4 additions & 4 deletions src/components/Nav/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Box, Fade, Flex, Icon, ListItem } from "@chakra-ui/react"

import { BaseLink, type LinkProps } from "../Link"

import { ISection } from "./types"
import { NavSectionDetail } from "./types"

import { useOnClickOutside } from "@/hooks/useOnClickOutside"

Expand Down Expand Up @@ -41,7 +41,7 @@ const DropdownContext = React.createContext<IDropdownContext | null>(null)

export interface IProps {
children?: React.ReactNode
section: ISection
section: NavSectionDetail
}

const NavDropdown: React.FC<IProps> & {
Expand Down Expand Up @@ -76,7 +76,7 @@ const NavDropdown: React.FC<IProps> & {
}
}

const ariaLabel = section.ariaLabel || section.text
const ariaLabel = section.ariaLabel || section.label

return (
<DropdownContext.Provider
Expand Down Expand Up @@ -106,7 +106,7 @@ const NavDropdown: React.FC<IProps> & {
},
}}
>
{section.text}
{section.label}
<Icon
as={MdExpandMore}
color="text200"
Expand Down
Loading
Loading