diff --git a/packages/paste-website/src/components/homepage/HomeHero.tsx b/packages/paste-website/src/components/homepage/HomeHero.tsx index 2368321805..340b94cba8 100644 --- a/packages/paste-website/src/components/homepage/HomeHero.tsx +++ b/packages/paste-website/src/components/homepage/HomeHero.tsx @@ -1,74 +1,129 @@ +import { Anchor } from "@twilio-paste/anchor"; +import { Badge } from "@twilio-paste/badge"; import { Box } from "@twilio-paste/box"; -import { DisplayHeading } from "@twilio-paste/display-heading"; +import { Column, Grid } from "@twilio-paste/grid"; +import { ArrowForwardIcon } from "@twilio-paste/icons/esm/ArrowForwardIcon"; +import { NewIcon } from "@twilio-paste/icons/esm/NewIcon"; import { Text } from "@twilio-paste/text"; -import { useTheme } from "@twilio-paste/theme"; +import * as React from "react"; import { SITE_CONTENT_MAX_WIDTH } from "../../constants"; -import CircleIcon from "../icons/CircleIcon"; -import { BouncyAnchor } from "./BouncyAnchor"; -import { SearchBox } from "./SearchBox"; -import { ComponentShowcase } from "./component-showcase"; +import { event } from "../../lib/gtag"; +import { SlantedBackgroundGradient } from "../SlantedBackgroundGradient"; +import { HomeHeroIllustration } from "./HomeHeroIllustration"; +import { NewComponentBanner } from "./NewComponentBanner"; +import { NewComponentBannerLink } from "./NewComponentBannerLink"; +import { NewComponentBannerText } from "./NewComponentBannerText"; + +const SeeRoadmapAnchor = (): JSX.Element => { + const [hovered, setHovered] = React.useState(false); + + const handleMouseEnter = (): void => { + setHovered(true); + }; + const handleMouseLeave = (): void => { + setHovered(false); + }; -const HomeHero = (): JSX.Element => { - const theme = useTheme(); return ( - + + + event({ + category: "Hero", + action: "click-see-roadmap", + label: "See our roadmap", + }) + } + > + See our roadmap + + + + + ); +}; + +const HomeHero = (): JSX.Element => { + return ( + + - - - Paste - - - Build inclusive, delightful customer experiences with Twilio’s open-source design system. - - - - - - - + + + + + + New + + The Page Header component is here! + + event({ + category: "Hero", + action: "click-new-banner", + label: "Page header announcement", + }) + } + > + See more + + + + Build inclusive, delightful Twilio customer experiences with Paste. + + + + + + + + + - - - - - + ); }; diff --git a/packages/paste-website/src/components/homepage/NewHomeHero.tsx b/packages/paste-website/src/components/homepage/NewHomeHero.tsx new file mode 100644 index 0000000000..50aa4b7459 --- /dev/null +++ b/packages/paste-website/src/components/homepage/NewHomeHero.tsx @@ -0,0 +1,76 @@ +import { Box } from "@twilio-paste/box"; +import { DisplayHeading } from "@twilio-paste/display-heading"; +import { Text } from "@twilio-paste/text"; +import { useTheme } from "@twilio-paste/theme"; + +import { SITE_CONTENT_MAX_WIDTH } from "../../constants"; +import CircleIcon from "../icons/CircleIcon"; +import { BouncyAnchor } from "./BouncyAnchor"; +import { SearchBox } from "./SearchBox"; +import { ComponentShowcase } from "./component-showcase"; + +const NewHomeHero = (): JSX.Element => { + const theme = useTheme(); + return ( + + + + + + Paste + + + Build inclusive, delightful customer experiences with Twilio’s open-source design system. + + + + + + + + + + + + + + + ); +}; + +export { NewHomeHero }; diff --git a/packages/paste-website/src/pages/index.tsx b/packages/paste-website/src/pages/index.tsx index 0c1af20245..1316559d21 100644 --- a/packages/paste-website/src/pages/index.tsx +++ b/packages/paste-website/src/pages/index.tsx @@ -1,18 +1,12 @@ -import { Box } from "@twilio-paste/box"; import type { GetStaticProps, InferGetStaticPropsType } from "next"; import Head from "next/head"; import * as React from "react"; import VisibilitySensor from "react-visibility-sensor"; -import { Accessibility } from "../components/homepage/Accessibility"; -import { CommunityOfBuilders } from "../components/homepage/CommunityOfBuilders"; -import { DesignEfficiency } from "../components/homepage/DesignEfficiency"; -import { ForTwilioCustomers } from "../components/homepage/ForTwilioCustomers"; +import { Experiment } from "../components/homepage/Experiment"; +import { GetStarted } from "../components/homepage/GetStarted"; import { HomeHero } from "../components/homepage/HomeHero"; -import { NewSection } from "../components/homepage/NewSection"; -import { Templates } from "../components/homepage/Templates"; -import { Themeable } from "../components/homepage/Themeable"; -import { WeDoTheThinking } from "../components/homepage/WeDoTheThinking"; +import { PopularComponentsAndPatterns } from "../components/homepage/Popular"; import { SiteWrapper } from "../components/site-wrapper"; import { SiteMetaDefaults } from "../constants"; import { getNavigationData } from "../utils/api"; @@ -29,7 +23,6 @@ const Homepage = ({ navigationData }: InferGetStaticPropsType @@ -38,29 +31,20 @@ const Homepage = ({ navigationData }: InferGetStaticPropsType - - - - - - - - + - + + ); }; - export const getStaticProps: GetStaticProps<{ navigationData: Feature[] }> = async () => { const navigationData = await getNavigationData(); - return { props: { navigationData, }, }; }; - export default Homepage; diff --git a/packages/paste-website/src/pages/new/index.tsx b/packages/paste-website/src/pages/new/index.tsx new file mode 100644 index 0000000000..b60f1781d4 --- /dev/null +++ b/packages/paste-website/src/pages/new/index.tsx @@ -0,0 +1,64 @@ +import { Box } from "@twilio-paste/box"; +import type { GetStaticProps, InferGetStaticPropsType } from "next"; +import Head from "next/head"; +import * as React from "react"; +import VisibilitySensor from "react-visibility-sensor"; + +import { Accessibility } from "../../components/homepage/Accessibility"; +import { CommunityOfBuilders } from "../../components/homepage/CommunityOfBuilders"; +import { DesignEfficiency } from "../../components/homepage/DesignEfficiency"; +import { ForTwilioCustomers } from "../../components/homepage/ForTwilioCustomers"; +import { NewHomeHero } from "../../components/homepage/NewHomeHero"; +import { NewSection } from "../../components/homepage/NewSection"; +import { Templates } from "../../components/homepage/Templates"; +import { Themeable } from "../../components/homepage/Themeable"; +import { WeDoTheThinking } from "../../components/homepage/WeDoTheThinking"; +import { SiteWrapper } from "../../components/site-wrapper"; +import { SiteMetaDefaults } from "../../constants"; +import { getNavigationData } from "../../utils/api"; +import type { Feature } from "../../utils/api"; + +const NewHomePage = ({ navigationData }: InferGetStaticPropsType): React.ReactElement => { + /* + * Only load the Experiment section iframe when the user scrolls down to + * the Popular section (the section prior) + */ + const [showIframe, setShowIframe] = React.useState(false); + function handleVisibilityChange(isVisible: boolean): void { + if (!showIframe) { + setShowIframe(isVisible); + } + } + return ( + + + {SiteMetaDefaults.TITLE} + + + + + + + + + + + + + + + + + ); +}; + +export const getStaticProps: GetStaticProps<{ navigationData: Feature[] }> = async () => { + const navigationData = await getNavigationData(); + return { + props: { + navigationData, + }, + }; +}; + +export default NewHomePage;