Skip to content

Commit

Permalink
run lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccahongsf committed Oct 30, 2024
1 parent 032a39b commit 8984cab
Show file tree
Hide file tree
Showing 48 changed files with 844 additions and 713 deletions.
14 changes: 7 additions & 7 deletions app/components/Container/Container.styles.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export const widths = {
full: 'w-full', // width: 100%; default
site: 'cc', // Use Decanter custom screen margins and sets max content width of 1500px
screen: 'w-screen', // width: 100vw
full: "w-full", // width: 100%; default
site: "cc", // Use Decanter custom screen margins and sets max content width of 1500px
screen: "w-screen", // width: 100vw
};

export const bgColors = {
black: 'bg-black text-white',
white: 'bg-white text-black',
'fog-light': 'bg-fog-light text-black',
'red-gradient': 'bg-soe-red-gradient text-white',
black: "bg-black text-white",
white: "bg-white text-black",
"fog-light": "bg-fog-light text-black",
"red-gradient": "bg-soe-red-gradient text-white",
};
30 changes: 15 additions & 15 deletions app/components/Container/Container.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HTMLAttributes } from 'react';
import { cnb } from 'cnbuilder';
import { HTMLAttributes } from "react";
import { cnb } from "cnbuilder";
import {
paddingTops,
paddingBottoms,
Expand All @@ -9,9 +9,9 @@ import {
marginVerticals,
type MarginType,
type PaddingType,
} from '@/utilities/datasource';
import * as styles from './Container.styles';
import * as types from './Container.types';
} from "@/utilities/datasource";
import * as styles from "./Container.styles";
import * as types from "./Container.types";

export type ContainerProps = HTMLAttributes<HTMLElement> & {
as?: types.ContainerElementType;
Expand All @@ -27,8 +27,8 @@ export type ContainerProps = HTMLAttributes<HTMLElement> & {
};

export const Container = ({
as: AsComponent = 'div',
width = 'site',
as: AsComponent = "div",
width = "site",
py,
pt,
pb,
Expand All @@ -45,14 +45,14 @@ export const Container = ({
{...props}
style={style}
className={cnb(
bgColor ? styles.bgColors[bgColor] : '',
py ? paddingVerticals[py] : '',
pt ? paddingTops[pt] : '',
pb ? paddingBottoms[pb] : '',
my ? marginVerticals[my] : '',
mt ? marginTops[mt] : '',
mb ? marginBottoms[mb] : '',
width ? styles.widths[width] : '',
bgColor ? styles.bgColors[bgColor] : "",
py ? paddingVerticals[py] : "",
pt ? paddingTops[pt] : "",
pb ? paddingBottoms[pb] : "",
my ? marginVerticals[my] : "",
mt ? marginTops[mt] : "",
mb ? marginBottoms[mb] : "",
width ? styles.widths[width] : "",
className,
)}
>
Expand Down
17 changes: 14 additions & 3 deletions app/components/Container/Container.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
import * as styles from './Container.styles';
import * as styles from "./Container.styles";

export type ContainerElementType = 'div' | 'section' | 'article' | 'main' | 'footer' | 'aside' | 'header' | 'nav' | 'form' | 'fieldset' | 'figcaption';
export type ContainerElementType =
| "div"
| "section"
| "article"
| "main"
| "footer"
| "aside"
| "header"
| "nav"
| "form"
| "fieldset"
| "figcaption";

export type WidthType = keyof typeof styles.widths;

export type BgColorType = keyof typeof styles.bgColors | '';
export type BgColorType = keyof typeof styles.bgColors | "";
6 changes: 3 additions & 3 deletions app/components/Container/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './Container';
export * from './Container.styles';
export * from './Container.types';
export * from "./Container";
export * from "./Container.styles";
export * from "./Container.types";
9 changes: 5 additions & 4 deletions app/components/FeatureHero/FeatureHero.styles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const root = 'h-full max-h-[1200px] relative overflow-hidden';
export const wrapper = 'mr-0 au-ml-auto flex-col lg:flex-row';
export const gradient = 'absolute top-0 left-0 bg-feature-gradient-rl bg-feature-gradient-bt w-full h-full z-30';
export const contentWrapper = 'lg:rs-pr-9 ml-0 *:text-white z-50';
export const root = "h-full max-h-[1200px] relative overflow-hidden";
export const wrapper = "mr-0 au-ml-auto flex-col lg:flex-row";
export const gradient =
"absolute top-0 left-0 bg-feature-gradient-rl bg-feature-gradient-bt w-full h-full z-30";
export const contentWrapper = "lg:rs-pr-9 ml-0 *:text-white z-50";
58 changes: 36 additions & 22 deletions app/components/FeatureHero/FeatureHero.tsx
Original file line number Diff line number Diff line change
@@ -1,51 +1,65 @@
'use client';
"use client";

import { HTMLAttributes } from 'react';
import { Container } from '../Container';
import { FlexBox } from '../FlexBox';
import { HTMLAttributes } from "react";
import { Container } from "../Container";
import { FlexBox } from "../FlexBox";
// import * as styles from './FeatureHero.styles';
import Image from 'next/image';
import ShapeA from '../images/shape-a';
import { motion, useScroll, useTransform } from 'framer-motion';
import Image from "next/image";
import ShapeA from "../images/shape-a";
import { motion, useScroll, useTransform } from "framer-motion";

type FeatureHeroProps = HTMLAttributes<HTMLDivElement> & {
children: React.ReactNode;
imageSrc?: string;
};

export const FeatureHero = ({
children,
...props
}: FeatureHeroProps) => {
export const FeatureHero = ({ children, ...props }: FeatureHeroProps) => {
const { scrollYProgress } = useScroll();
const opacity = useTransform(scrollYProgress, [0, 0.05], [1, 0]);

return (
<FlexBox {...props} as="section" alignItems="start" justifyContent="between" className="relative flex-col bg-soe-black h-auto w-full z-10">
<Container width="full" className='order-last flex flex-col rs-p-9 *:text-white z-50 lg:max-w-[50%] *:font-dm-sans bg-soe-black lg:bg-transparent'>
<FlexBox
{...props}
as="section"
alignItems="start"
justifyContent="between"
className="relative flex-col bg-soe-black h-auto w-full z-10"
>
<Container
width="full"
className="order-last flex flex-col rs-p-9 *:text-white z-50 lg:max-w-[50%] *:font-dm-sans bg-soe-black lg:bg-transparent"
>
{children}
</Container>
<div className="relative w-full aspect-[16/9] bg-cool-grey lg:absolute lg:top-0 lg:left-0 h-auto z-10 overflow-hidden">
<Image className="absolute top-0 left-0 lg:left-[300px] z-0 w-full h-auto"
<Image
className="absolute top-0 left-0 lg:left-[300px] z-0 w-full h-auto"
alt=""
src={`soe-centennial-nextjs/assets/images/Hawa-Racine-Thiam.jpg`}
width={0}
height={0}
sizes="100vw" />
<motion.div style={{ opacity }} >
sizes="100vw"
/>
<motion.div style={{ opacity }}>
<div className="absolute w-full h-full top-0 left-0 z-10">
<div className="w-full h-full bg-plum-dark absolute top-0 left-0 z-10" />
<ShapeA className="absolute bottom-10 left-10 lg:left-[300px] z-20 *:stroke-plum" height={1200} />
<ShapeA
className="absolute bottom-10 left-10 lg:left-[300px] z-20 *:stroke-plum"
height={1200}
/>
</div>
</motion.div>
<div className='absolute top-0 left-0 bg-transparent lg:bg-feature-gradient-rl bg-feature-gradient-bt w-full h-full z-50' />
<Image className="absolute top-0 left-0 lg:left-[300px] z-20 w-full h-auto"
<div className="absolute top-0 left-0 bg-transparent lg:bg-feature-gradient-rl bg-feature-gradient-bt w-full h-full z-50" />
<Image
className="absolute top-0 left-0 lg:left-[300px] z-20 w-full h-auto"
alt=""
src={`soe-centennial-nextjs/assets/images/Hawa-Racine-Thiam_silhouette.png`}
width={0}
height={0}
sizes="100vw" />
<div className='absolute top-0 left-0 bg-feature-gradient-bt w-full h-full z-50' />
sizes="100vw"
/>
<div className="absolute top-0 left-0 bg-feature-gradient-bt w-full h-full z-50" />
</div>
</FlexBox>
);};
);
};
4 changes: 2 additions & 2 deletions app/components/FeatureHero/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './FeatureHero';
export * from './FeatureHero.styles';
export * from "./FeatureHero";
export * from "./FeatureHero.styles";
48 changes: 24 additions & 24 deletions app/components/FlexBox/FlexBox.styles.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
export const flexDirection = {
row: 'flex-row',
'row-reverse': 'flex-row-reverse',
col: 'flex-col',
'col-reverse': 'flex-col-reverse',
row: "flex-row",
"row-reverse": "flex-row-reverse",
col: "flex-col",
"col-reverse": "flex-col-reverse",
};

export const flexWrap = {
wrap: 'flex-wrap',
'wrap-reverse': 'flex-wrap-reverse',
nowrap: 'flex-nowrap',
wrap: "flex-wrap",
"wrap-reverse": "flex-wrap-reverse",
nowrap: "flex-nowrap",
};

export const flexJustifyContent = {
start: 'justify-start',
end: 'justify-end',
center: 'justify-center',
between: 'justify-between',
around: 'justify-around',
evenly: 'justify-evenly',
start: "justify-start",
end: "justify-end",
center: "justify-center",
between: "justify-between",
around: "justify-around",
evenly: "justify-evenly",
};

export const flexAlignContent = {
start: 'content-start',
end: 'content-end',
center: 'content-center',
between: 'content-between',
around: 'content-around',
evenly: 'content-evenly',
start: "content-start",
end: "content-end",
center: "content-center",
between: "content-between",
around: "content-around",
evenly: "content-evenly",
};

export const flexAlignItems = {
start: 'items-start',
end: 'items-end',
center: 'items-center',
baseline: 'items-baseline',
stretch: 'items-stretch',
start: "items-start",
end: "items-end",
center: "items-center",
baseline: "items-baseline",
stretch: "items-stretch",
};
24 changes: 12 additions & 12 deletions app/components/FlexBox/FlexBox.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ReactNode, HTMLAttributes } from 'react';
import { cnb } from 'cnbuilder';
import * as styles from './FlexBox.styles';
import * as types from './FlexBox.types';
import React, { ReactNode, HTMLAttributes } from "react";
import { cnb } from "cnbuilder";
import * as styles from "./FlexBox.styles";
import * as types from "./FlexBox.types";

type FlexBoxProps = HTMLAttributes<HTMLElement> & {
as?: types.FlexElementType;
Expand All @@ -15,7 +15,7 @@ type FlexBoxProps = HTMLAttributes<HTMLElement> & {
};

export const FlexBox = ({
as: AsComponent = 'div',
as: AsComponent = "div",
direction,
gap,
wrap,
Expand All @@ -29,13 +29,13 @@ export const FlexBox = ({
<AsComponent
{...props}
className={cnb(
'flex',
direction ? styles.flexDirection[direction] : '',
wrap ? styles.flexWrap[wrap] : '',
justifyContent ? styles.flexJustifyContent[justifyContent] : '',
alignContent ? styles.flexAlignContent[alignContent] : '',
alignItems ? styles.flexAlignItems[alignItems] : '',
gap ? 'grid-gap' : '',
"flex",
direction ? styles.flexDirection[direction] : "",
wrap ? styles.flexWrap[wrap] : "",
justifyContent ? styles.flexJustifyContent[justifyContent] : "",
alignContent ? styles.flexAlignContent[alignContent] : "",
alignItems ? styles.flexAlignItems[alignItems] : "",
gap ? "grid-gap" : "",
className,
)}
>
Expand Down
19 changes: 17 additions & 2 deletions app/components/FlexBox/FlexBox.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
import * as styles from './FlexBox.styles';
import * as styles from "./FlexBox.styles";

export type FlexElementType = 'div' | 'section' | 'article' | 'main' | 'footer' | 'aside' | 'header' | 'nav' | 'form' | 'button' | 'fieldset' | 'ul' | 'ol' | 'li' | 'span';
export type FlexElementType =
| "div"
| "section"
| "article"
| "main"
| "footer"
| "aside"
| "header"
| "nav"
| "form"
| "button"
| "fieldset"
| "ul"
| "ol"
| "li"
| "span";

export type FlexDirectionType = keyof typeof styles.flexDirection;

Expand Down
6 changes: 3 additions & 3 deletions app/components/FlexBox/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './FlexBox';
export * from './FlexBox.styles';
export * from './FlexBox.types';
export * from "./FlexBox";
export * from "./FlexBox.styles";
export * from "./FlexBox.types";
39 changes: 21 additions & 18 deletions app/components/Logo/Logo.styles.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
import { cnb } from 'cnbuilder';
import { cnb } from "cnbuilder";

export type LogoVariantType = 'horizontal' | 'stacked';
export type LogoVariantType = "horizontal" | "stacked";

export const logoColors = {
black: 'fill-black',
white: 'fill-white',
current: 'fill-current',
black: "fill-black",
white: "fill-white",
current: "fill-current",
};
export type LogoColorType = keyof typeof logoColors;

export const link = (color: LogoColorType) => cnb('group block no-underline focus-visible:ring-2', {
'focus-visible:ring-black': color === 'black',
'focus-visible:ring-white': color === 'white',
});
export const link = (color: LogoColorType) =>
cnb("group block no-underline focus-visible:ring-2", {
"focus-visible:ring-black": color === "black",
"focus-visible:ring-white": color === "white",
});

// Giving Stories Logo styles
export const root = 'no-underline inline-block font-normal';
export const contentWrapper = 'flex-col sm:flex-row items-start sm:items-center';
export const logo = 'text-19 sm:text-[1.43em] leading-half mt-[0.27em]';
export const bar = 'hidden sm:block w-1 h-1em mx-03em';
export const text = 'font-dm-sans text-15 sm:text-[1.05em] mt-03em -ml-01em sm:ml-0';
export const root = "no-underline inline-block font-normal";
export const contentWrapper =
"flex-col sm:flex-row items-start sm:items-center";
export const logo = "text-19 sm:text-[1.43em] leading-half mt-[0.27em]";
export const bar = "hidden sm:block w-1 h-1em mx-03em";
export const text =
"font-dm-sans text-15 sm:text-[1.05em] mt-03em -ml-01em sm:ml-0";
export const textColor = {
default: 'text-black-60',
white: 'text-white',
default: "text-black-60",
white: "text-white",
};
export const barColor = {
default: 'bg-black-60',
white: 'bg-white',
default: "bg-black-60",
white: "bg-white",
};
Loading

0 comments on commit 8984cab

Please sign in to comment.