Skip to content

Commit

Permalink
chore: mega menu prep changes for glossary (#2047)
Browse files Browse the repository at this point in the history
* chore: mega menu prep changes for glossary

* chore: add glossary lord icon

* chore: changeset

* chore: apply suggested changes

---------

Co-authored-by: Timon Rey Turak <[email protected]>
Co-authored-by: Timon Turak <[email protected]>
  • Loading branch information
3 people authored Aug 20, 2024
1 parent c349fc4 commit 522ec0f
Show file tree
Hide file tree
Showing 13 changed files with 22,075 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changeset/quick-horses-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@commercetools-docs/gatsby-theme-docs': minor
'@commercetools-docs/ui-kit': minor
---

Mega menu changes for Glossary implementation
38 changes: 36 additions & 2 deletions packages/gatsby-theme-docs/src/components/top-menu-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,39 @@ const MenuColumWrapper = styled.div`
`}
`;

const BottomMenuColumnWrapper = styled.div`
padding: 16px;
display: flex;
flex-direction: column;
flex-wrap: wrap;
height: 96px;
${(props) =>
props.level === 3 &&
css`
opacity: 0;
`}
${(props) =>
props.level === 3 &&
props.isExpanded &&
css`
animation: ${showContentAnimation} 0.25s ease-out;
animation-delay: 0.3s;
animation-fill-mode: forwards;
`}
${(props) =>
props.level === 3 &&
!props.isExpanded &&
css`
animation: ${hideContentAnimation} 0.25s ease-out;
animation-fill-mode: backwards;
white-space: nowrap;
overflow: hidden;
`}
`;

export const MenuColumn = (props) => {
const [localItems, setLocalItems] = useState([]);
useEffect(() => {
Expand Down Expand Up @@ -226,17 +259,18 @@ MenuColumn.propTypes = {

export const BottomItems = (props) => {
return (
<MenuColumWrapper>
<BottomMenuColumnWrapper>
{props.items.map((item, index) => (
<TopMenuItem
id={`boottom-item-${index}`}
key={index}
icon={item.icon}
text={item.footerTitle}
href={item.href}
isBottomItem
/>
))}
</MenuColumWrapper>
</BottomMenuColumnWrapper>
);
};

Expand Down
3 changes: 3 additions & 0 deletions packages/gatsby-theme-docs/src/components/top-menu-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const MenuItemWrapper = styled.div`
padding: ${({ isSmall }) =>
isSmall ? '4px 12px 4px 8px' : '8px 12px 8px 8px'};
height: 32px;
min-width: ${({ isBottomItem }) => (isBottomItem ? '160px' : '0')};
a {
color: ${designSystem.colors.light.textPrimary};
Expand Down Expand Up @@ -144,6 +145,7 @@ export const TopMenuItem = (props) => {
onClick={onClickHandler}
isSelected={props.isSelected}
isSmall={props.level > 1 && !props.isExpandable}
isBottomItem={props.isBottomItem}
>
{props.icon && (
<MenuIconWrapper>
Expand Down Expand Up @@ -188,6 +190,7 @@ TopMenuItem.propTypes = {
level: PropTypes.number,
// eslint-disable-next-line react/no-unused-prop-types
shouldShrink: PropTypes.bool,
isBottomItem: PropTypes.bool,
};

export const TopMenuLabelItem = styled.div`
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby-theme-docs/src/components/top-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ const MenuBottom = styled.div`
`;

const ItemsArea = styled.div`
width: ${designSystem.dimensions.widths.topMenuSingleCoumn};
width: ${designSystem.dimensions.widths.topMenuTwoColums};
`;
const FeedbackArea = styled.div`
padding-right: 40px;
Expand All @@ -255,7 +255,7 @@ const FeedbackArea = styled.div`
transition: opacity 0.3s ease-in-out;
@media screen and (${designSystem.dimensions.viewports.laptop}) {
display: flex;
display: ${(props) => (props.isVisible ? 'flex' : 'none')};
}
`;

Expand Down
8 changes: 7 additions & 1 deletion packages/gatsby-theme-docs/src/data/top-menu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@
- title: Getting started item 2
href: /

- footer-title: Support
icon: headset
href: /
- footer-title: System status
icon: heartbeat
href: /
- footer-title: Free trial
icon: free
icon: padlock
href: /
- footer-title: Log in to Merchant Center
icon: login
Expand Down
80 changes: 80 additions & 0 deletions packages/ui-kit/src/icons/generated/LordIconMmGlossary.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

162 changes: 162 additions & 0 deletions packages/ui-kit/src/icons/generated/LordIconMmPadlock.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/ui-kit/src/icons/generated/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 522ec0f

Please sign in to comment.