Skip to content

Commit

Permalink
Merge pull request #105 from fourkitchens/develop
Browse files Browse the repository at this point in the history
Release - 06/18/2024
  • Loading branch information
mcortes19 authored Jun 18, 2024
2 parents 518c619 + 19ae608 commit 4ba337b
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 42 deletions.
24 changes: 11 additions & 13 deletions src/lib/components/02-components/cta/cta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export default function CTA({
link,
linkComponent: LinkElement = 'a',
theme = 'azure',
...props
}: CtaProps) {
const cardStyles: CSSProperties = {};

Expand All @@ -87,21 +88,19 @@ export default function CTA({

return (
<div
className={cn('py-lg md:py-xl', colorSchema[theme].wrapper)}
style={cardStyles}
>
<div
className={cn(
'mx-lg flex max-w-screen-xl flex-col items-center gap-y-lg text-center md:mx-auto',
className,
)}
>
{...props}
className={cn(
'px-md py-lg md:py-xl',
colorSchema[theme].wrapper,
className,
)}
style={cardStyles}>
<div className="flex flex-col items-center gap-y-lg text-center">
{header && (
<Typography
variant="h1"
component="h1"
className={cn('font-semibold', colorSchema[theme].header)}
>
className={cn('font-semibold', colorSchema[theme].header)}>
{header}
</Typography>
)}
Expand All @@ -113,8 +112,7 @@ export default function CTA({
component={LinkElement}
endIcon={<ArrowRightIcon />}
color={colorSchema[theme].button}
className="mt-md w-full justify-center md:w-fit"
>
className="mt-md w-full justify-center md:w-fit">
{link.title}
</Button>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ export const List = () => {
<div style={listStyles}>
<div
className="px-md py-lg md:mx-auto md:max-w-screen-xl"
style={listStyles}
>
style={listStyles}>
<FeaturedResourceListItem
url="/"
eyebrow="eyebrow"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { ComponentPropsWithoutRef, ReactNode } from 'react';
import ArrowRight from '../../../assets/img/icons/arrow-right.svg?react';
import { cn } from '../../../utils/tailwind-merge';
import {
calculateBrightness,
hexToRgb,
} from '../../00-tokens/color/color-shared';
import Button from '../../01-elements/button/button';

export type ResourceImageDetails = {
Expand All @@ -17,6 +21,7 @@ export interface FeaturedResourceCardProps
renderedImageComponent?: ReactNode;
title?: string;
url?: string;
sectionBgColor?: string;
}

export default function FeaturedResourceCard({
Expand All @@ -25,9 +30,18 @@ export default function FeaturedResourceCard({
renderedImageComponent,
title,
url,
sectionBgColor,
className,
...props
}: FeaturedResourceCardProps) {
let isDarkMode = false;

if (sectionBgColor) {
const color = hexToRgb(sectionBgColor);
const brightness = calculateBrightness(color);
isDarkMode = brightness < 125;
}

const renderedImage = renderedImageComponent ? (
renderedImageComponent
) : image ? (
Expand All @@ -44,7 +58,11 @@ export default function FeaturedResourceCard({
<div
{...props}
className={cn(
'md:white rounded-m max-md:border-2 max-md:border-azure md:max-w-[480px] md:bg-azure',
'rounded-m md:max-w-[480px]',
{
'border-2 border-azure': isDarkMode,
'max-md:border-2 max-md:border-azure md:bg-azure': !isDarkMode,
},
className,
)}>
{renderedImage && (
Expand All @@ -54,7 +72,11 @@ export default function FeaturedResourceCard({
)}
<div className="flex flex-col gap-md p-md md:gap-lg md:p-lg">
{title && (
<span className="text-h3 font-[600] text-black md:text-h4">
<span
className={cn('text-h3 font-[600] md:text-h4', {
'text-white': isDarkMode,
'text-black': !isDarkMode,
})}>
{title}
</span>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@ export default function FeaturedResourceListItem({
href={url}
component={LinkComponent}
className="group/resource-link w-full border-b border-brumosa last:border-transparent"
>
color={isDarkMode ? 'white' : 'blue'}>
<div className="flex flex-col gap-md py-md uppercase">
<Typography
variant="h5"
className={cn('font-[600] leading-none text-viola', {
'text-sandwisp': isDarkMode,
})}
>
})}>
{eyebrow}
</Typography>
<div className="flex gap-md">
Expand All @@ -56,13 +55,12 @@ export default function FeaturedResourceListItem({
endIcon={endIcon}
color={isDarkMode ? 'white' : 'blue'}
className={cn(
'font-[600] text-h4 normal-case leading-none group-hover/resource-link:text-navy',
'text-h4 font-[600] normal-case leading-none group-hover/resource-link:text-navy',
{
'group-hover/resource-link:text-sandwisp': isDarkMode,
},
)}
animated
>
animated>
{title}
</Link>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default function MarketoReference({
bgColor,
formStyle: style = 'none',
className,
...props
}: MarketoReferenceProps) {
const formStyle = style ? style : 'none';
const renderedImage =
Expand Down Expand Up @@ -85,20 +86,19 @@ export default function MarketoReference({

return (
<div
{...props}
style={bgImageStyles}
className={cn(
'flex w-full',
marketoReferenceColorStyles[bgColor],
marketoReferenceFormWrapperStyles[formStyle],
className,
)}
>
)}>
{renderedImage && (
<div
className={cn('hidden md:block md:w-full', {
'md:-mt-5': formStyle === 'aside_contained_image_overflow_top',
})}
>
})}>
{renderedImage}
</div>
)}
Expand All @@ -109,8 +109,7 @@ export default function MarketoReference({
{
'lg:max-w-1/2': formStyle !== 'aside_contained_image_overflow_top',
},
)}
>
)}>
{renderedMarketoForm}
</div>
</div>
Expand Down
20 changes: 7 additions & 13 deletions src/lib/components/02-components/slider/content-slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,16 @@ export default function ContentSlider({
}, [active, isFocused, sliderItems.length]);
return (
<div
className={cn('p-lg', {
className={cn({
'bg-black': theme === 'dark',
})}
>
})}>
{sliderTitle && (
<Typography
variant="display"
component="h2"
className={cn('mb-4 w-full font-bold', {
'text-azure': theme === 'dark',
})}
>
})}>
{sliderTitle}
</Typography>
)}
Expand All @@ -66,8 +64,7 @@ export default function ContentSlider({
variant="h3"
className={cn('mb-4 w-full font-bold', {
'text-azure': theme === 'dark',
})}
>
})}>
{sliderSubTitle}
</Typography>
)}
Expand All @@ -79,8 +76,7 @@ export default function ContentSlider({
onMouseOver={() => setIsFocused(true)}
onMouseLeave={() => setIsFocused(false)}
onFocus={() => setIsFocused(true)}
onBlur={() => setIsFocused(false)}
>
onBlur={() => setIsFocused(false)}>
<SlideItemComponent
{...item}
theme={theme}
Expand All @@ -94,16 +90,14 @@ export default function ContentSlider({
<div
className={cn('hidden overflow-hidden sm:inline', {
'col-start-1 row-start-1': alignment === 'right',
})}
>
})}>
{sliderItems.map((item, index) => (
<div
key={index}
className={cn(
'relative top-0 h-full w-full transition-[opacity] duration-500 ease-in-out',
active !== index ? 'h-0 opacity-0' : 'h-[100%] opacity-100',
)}
>
)}>
{item.img}
</div>
))}
Expand Down

0 comments on commit 4ba337b

Please sign in to comment.