Skip to content

Commit e1a9307

Browse files
committed
Mega menu link group styles
1 parent 3bf9872 commit e1a9307

File tree

7 files changed

+57
-21
lines changed

7 files changed

+57
-21
lines changed

components/Cta/Cta.styles.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ export const ctaTextColors = {
6161
// Additional CTA variants we use for this site, e.g., as subcomponents for other components. These include styles for sizes, colors, icon styles, and other properties.
6262
export const ctaVariants = {
6363
'local-footer': 'text-digital-red hocus:text-black underline leading-snug font-normal text-16 md:text-18 *:[&_svg]:hocus:text-digital-red',
64-
'sub-menu': 'text-14 sm:text-16 text-white leading-[4rem] md:leading-cozy hocus:text-white md:text-cool-grey md:hocus:text-digital-red font-normal no-underline hocus:underline',
64+
'sub-menu': 'text-14 sm:text-16 py-6 md:py-10 text-white leading-[4rem] md:leading-cozy hocus:text-white md:text-cool-grey md:hocus:text-digital-red font-normal no-underline hocus:underline',
65+
'mega-menu-link-lvl2': 'text-black hocus:text-digital-red no-underline hocus:underline leading-display font-normal text-19 *:[&_svg]:text-digital-red',
6566
};
6667

6768
// Maps to linkButtonSize prop in SbCtaLink. Only used for the button styles

components/Cta/CtaContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as types from './Cta.types';
77
type CtaContentProps = Omit<types.CtaCommonProps, 'buttonSize' | 'textColor'>;
88

99
export const CtaContent = ({
10-
icon = 'su-link--action',
10+
icon,
1111
iconProps,
1212
srText,
1313
children,

components/Storyblok/SbMegaMenu/SbMegaMenu.styles.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ export const navItem = 'mb-0';
1212

1313
export const MegaMenuNavLevel1Cta = 'relative inline-block text-20 lg:text-21 lg:py-16 font-semibold leading-cozy no-underline hocus:no-underline text-black hocus:text-digital-red before:absolute before:inline-block before:h-10 before:w-full before:left-0 before:bottom-0 before:bg-digital-red before:scale-x-0 before:transition-transform hocus:before:scale-x-100 aria-expanded:before:scale-x-100';
1414

15-
export const MegaMenuNavLinkGroupHeading = 'mb-14 pt-10 md:pt-0 border-t border-black-40 first:border-t-0 md:border-t-0 text-17';
15+
/**
16+
* Mega menu link group
17+
*/
18+
export const linkGroup = 'mb-20 md:mb-0 empty:mb-0';
19+
export const linkGroupHeading = 'mb-[1.4em] pt-10 md:pt-0 border-t border-black-40 first:border-t-0 md:border-t-0 text-17';
20+
export const linkGroupList = 'list-unstyled';
21+
export const linkGroupItem = 'mb-20 last:mb-0';
1622

1723
/**
1824
* Mega menu card
Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,44 @@
11
import { type SbBlokData, storyblokEditable } from '@storyblok/react/rsc';
2-
import { CreateBloks } from '@/components/CreateBloks';
2+
import { CtaLink } from '@/components/Cta';
33
import { FlexCell } from '@/components/Storyblok/partials/FlexCell';
4-
import { Heading } from '../../Typography';
4+
import { Heading } from '@/components/Typography';
5+
import { getNumBloks } from '@/utilities/getNumBloks';
6+
import { type SbOodMegaMenuNavItemProps } from '@/components/Storyblok/Storyblok.types';
57
import * as styles from './SbMegaMenu.styles';
68

79
export type SbMegaMenuLinkGroupProps = {
810
blok: SbBlokData & {
911
heading?: string;
10-
links?: SbBlokData[];
12+
links?: SbOodMegaMenuNavItemProps[];
1113
};
1214
};
1315

14-
export const SbMegaMenuLinkGroup = (props: SbMegaMenuLinkGroupProps) => (
15-
<FlexCell {...storyblokEditable(props.blok)} md={4} className="ood-mega-nav__link-group mb-20 md:mb-0 empty:mb-0">
16-
{props.blok.heading && (
17-
<Heading font="sans" weight="bold" uppercase tracking="widest" className={`ood-mega-nav__link-group-heading ${styles.MegaMenuNavLinkGroupHeading}`}>
18-
{props.blok.heading}
19-
</Heading>
20-
)}
21-
{!!props.blok.links?.length && (
22-
<ul className="ood-mega-nav__menu-lv2 list-unstyled">
23-
<CreateBloks blokSection={props.blok.links} className="!text-plum" />
24-
</ul>
25-
)}
26-
</FlexCell>
27-
);
16+
export const SbMegaMenuLinkGroup = (props: SbMegaMenuLinkGroupProps) => {
17+
const { heading, links } = props.blok;
18+
19+
return (
20+
<FlexCell {...storyblokEditable(props.blok)} md={4} className={styles.linkGroup}>
21+
{heading && (
22+
<Heading font="sans" weight="bold" uppercase tracking="widest" className={styles.linkGroupHeading}>
23+
{heading}
24+
</Heading>
25+
)}
26+
{!!getNumBloks(links) && (
27+
<ul className={styles.linkGroupList}>
28+
{links?.map(({ _uid, link, linkText }) => (
29+
<li key={_uid} className={styles.linkGroupItem}>
30+
<CtaLink
31+
sbLink={link}
32+
variant="mega-menu-link-lvl2"
33+
align="right"
34+
icon={link.linktype === 'story' ? 'su-link--no-icon' : 'su-link--external'}
35+
>
36+
{linkText}
37+
</CtaLink>
38+
</li>
39+
))}
40+
</ul>
41+
)}
42+
</FlexCell>
43+
);
44+
};

components/Storyblok/SbMegaMenu/SbMegaMenuSection.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export const SbMegaMenuSection = (props: SbMegaMenuSectionProps) => {
4444
<Grid gap="default" lg={3} className="ood-mega-nav__section-links">
4545
<CreateBloks blokSection={props.blok.linkGroups} />
4646
</Grid>
47-
<CreateBloks blokSection={props.blok.sectionCtaLink} />
47+
<div className="rs-mt-4">
48+
<CreateBloks blokSection={props.blok.sectionCtaLink} />
49+
</div>
4850
</div>
4951
<div className="lg:col-span-1">
5052
<CreateBloks blokSection={props.blok.card} />

components/Storyblok/SbSubMenu.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import { CtaLink } from '@/components/Cta';
44
import { FlexBox } from '@/components/FlexBox';
55
import { type SbNavItemProps } from './Storyblok.types';
66

7+
/**
8+
* Deprecating the topBarColor prop because we no longer have a brand bar.
9+
* The digital red top border instead of a brand bar is always used.
10+
*/
711
export type SbSubMenuProps = {
812
blok: SbBlokData & {
913
menuLinkItems?: SbNavItemProps[];

components/Storyblok/Storyblok.types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,9 @@ export type SbNavItemProps = {
6868
link?: SbLinkType;
6969
linkClass?: CtaIconType;
7070
};
71+
72+
export type SbOodMegaMenuNavItemProps = {
73+
_uid: string;
74+
linkText?: string;
75+
link?: SbLinkType;
76+
}

0 commit comments

Comments
 (0)