From 8bae5fa3f5beaf7db54fc93ab2582318718b689d Mon Sep 17 00:00:00 2001 From: Pavel <14926950+prichodko@users.noreply.github.com> Date: Tue, 16 May 2023 11:57:15 +0200 Subject: [PATCH] Add website layouts and nav menus (#400) * merge global styles * add logos * add app layout * fix fonts * add links * add homepage * update repos cols * update page footer * add logo variants * update links * add feature sections * update layouts * add blog pages * add learn pages * add deps * enable disableStaticImages in Next config * remove logo variant * add navigation menus * add theme-color meta tag * stop ignoring next-env.d.ts * use our Link --- apps/website/.gitignore | 1 - apps/website/next-env.d.ts | 5 + apps/website/next.config.js | 12 +- apps/website/package.json | 8 +- apps/website/public/images/logo/blog.svg | 1 + apps/website/public/images/logo/default.svg | 1 + apps/website/public/images/logo/dev.svg | 1 + apps/website/public/images/logo/learn.svg | 1 + apps/website/src/components/link.tsx | 20 +++ apps/website/src/components/logo.tsx | 56 ++++++++ apps/website/src/components/nav-menu.tsx | 100 +++++++++++++ apps/website/src/components/page-footer.tsx | 135 ++++++++++++++++++ apps/website/src/config/links.ts | 67 +++++++++ apps/website/src/layouts/app-layout.tsx | 99 +++++++++++++ apps/website/src/layouts/insights-layout.tsx | 52 +++---- apps/website/src/pages/_app.tsx | 9 +- apps/website/src/pages/_document.tsx | 1 + apps/website/src/pages/blog/[slug].tsx | 15 ++ apps/website/src/pages/blog/index.tsx | 68 +++++++++ apps/website/src/pages/index.tsx | 130 +++++++++++++++++ apps/website/src/pages/insights/repos.tsx | 8 +- apps/website/src/pages/learn/[slug].tsx | 15 ++ apps/website/src/pages/learn/index.tsx | 15 ++ apps/website/src/styles/app.css | 23 --- .../src/styles/{reset.css => global.css} | 29 ++-- apps/website/tailwind.config.js | 54 +++++-- package.json | 4 +- yarn.lock | 64 ++++++++- 28 files changed, 891 insertions(+), 103 deletions(-) create mode 100644 apps/website/next-env.d.ts create mode 100644 apps/website/public/images/logo/blog.svg create mode 100644 apps/website/public/images/logo/default.svg create mode 100644 apps/website/public/images/logo/dev.svg create mode 100644 apps/website/public/images/logo/learn.svg create mode 100644 apps/website/src/components/link.tsx create mode 100644 apps/website/src/components/logo.tsx create mode 100644 apps/website/src/components/nav-menu.tsx create mode 100644 apps/website/src/components/page-footer.tsx create mode 100644 apps/website/src/config/links.ts create mode 100644 apps/website/src/layouts/app-layout.tsx create mode 100644 apps/website/src/pages/blog/[slug].tsx create mode 100644 apps/website/src/pages/blog/index.tsx create mode 100644 apps/website/src/pages/index.tsx create mode 100644 apps/website/src/pages/learn/[slug].tsx create mode 100644 apps/website/src/pages/learn/index.tsx delete mode 100644 apps/website/src/styles/app.css rename apps/website/src/styles/{reset.css => global.css} (84%) diff --git a/apps/website/.gitignore b/apps/website/.gitignore index 93cf48e0..b47c5754 100644 --- a/apps/website/.gitignore +++ b/apps/website/.gitignore @@ -33,7 +33,6 @@ yarn-error.log* # typescript *.tsbuildinfo -next-env.d.ts # Tamagui .tamagui diff --git a/apps/website/next-env.d.ts b/apps/website/next-env.d.ts new file mode 100644 index 00000000..4f11a03d --- /dev/null +++ b/apps/website/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/apps/website/next.config.js b/apps/website/next.config.js index 2e77ac2a..aa85ba48 100644 --- a/apps/website/next.config.js +++ b/apps/website/next.config.js @@ -13,7 +13,7 @@ let config = { ignoreBuildErrors: true, }, images: { - disableStaticImages: true, + // disableStaticImages: true, }, transpilePackages: [ // 'react-native', @@ -27,16 +27,6 @@ let config = { legacyBrowsers: false, // esmExternals: 'loose', }, - - redirects: async () => { - return [ - { - source: '/', - destination: '/insights', - permanent: false, - }, - ] - }, } const plugins = [ diff --git a/apps/website/package.json b/apps/website/package.json index c1b8acee..8bf06285 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -13,16 +13,19 @@ }, "dependencies": { "@radix-ui/react-dialog": "^1.0.3", + "@radix-ui/react-navigation-menu": "^1.1.2", "@scure/base": "^1.1.1", + "@status-im/colors": "*", "@status-im/components": "*", "@status-im/icons": "*", "@status-im/js": "*", - "@status-im/colors": "*", "@tamagui/next-theme": "1.11.1", + "class-variance-authority": "^0.6.0", "next": "13.2.4", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-native-web": "^0.18.12" + "react-native-web": "^0.18.12", + "ts-pattern": "^4.3.0" }, "devDependencies": { "@achingbrain/ssdp": "^4.0.1", @@ -33,6 +36,7 @@ "autoprefixer": "^10.4.14", "postcss": "^8.4.21", "tailwindcss": "^3.3.1", + "tailwindcss-animate": "^1.0.5", "typescript": "^5.0.3" }, "engines": { diff --git a/apps/website/public/images/logo/blog.svg b/apps/website/public/images/logo/blog.svg new file mode 100644 index 00000000..5e99696b --- /dev/null +++ b/apps/website/public/images/logo/blog.svg @@ -0,0 +1 @@ + diff --git a/apps/website/public/images/logo/default.svg b/apps/website/public/images/logo/default.svg new file mode 100644 index 00000000..5e99696b --- /dev/null +++ b/apps/website/public/images/logo/default.svg @@ -0,0 +1 @@ + diff --git a/apps/website/public/images/logo/dev.svg b/apps/website/public/images/logo/dev.svg new file mode 100644 index 00000000..ad98fc58 --- /dev/null +++ b/apps/website/public/images/logo/dev.svg @@ -0,0 +1 @@ + diff --git a/apps/website/public/images/logo/learn.svg b/apps/website/public/images/logo/learn.svg new file mode 100644 index 00000000..4fa1c9e2 --- /dev/null +++ b/apps/website/public/images/logo/learn.svg @@ -0,0 +1 @@ + diff --git a/apps/website/src/components/link.tsx b/apps/website/src/components/link.tsx new file mode 100644 index 00000000..51701a61 --- /dev/null +++ b/apps/website/src/components/link.tsx @@ -0,0 +1,20 @@ +import NextLink from 'next/link' + +import type { ComponentProps } from 'react' + +export const Link = (props: ComponentProps) => { + const external = + typeof props.href === 'string' + ? props.href.startsWith('http') + : Boolean(props.href.pathname?.startsWith('http')) + + return ( + + ) +} diff --git a/apps/website/src/components/logo.tsx b/apps/website/src/components/logo.tsx new file mode 100644 index 00000000..5dbb1b4c --- /dev/null +++ b/apps/website/src/components/logo.tsx @@ -0,0 +1,56 @@ +import Image from 'next/image' +import { useRouter } from 'next/router' +import { match, P } from 'ts-pattern' + +import logoSrc from '../../public/images/logo/default.svg' +import logoDevSrc from '../../public/images/logo/dev.svg' +import logoLearnSrc from '../../public/images/logo/learn.svg' + +type Props = { + label?: boolean +} + +export const Logo = (props: Props) => { + const { label = true } = props + + const { pathname } = useRouter() + + return ( +
+ {match(pathname) + .with( + P.when(p => p.startsWith('/insights')), + () => Status logo + ) + .with( + P.when(p => p.startsWith('/learn')), + () => Status logo + ) + .with( + P.when(p => p.startsWith('/blog')), + () => Status logo + ) + .otherwise(() => ( + Status logo + ))} + {label && ( + + + + )} +
+ ) +} + +export type { Props as LogoProps } diff --git a/apps/website/src/components/nav-menu.tsx b/apps/website/src/components/nav-menu.tsx new file mode 100644 index 00000000..328a58cd --- /dev/null +++ b/apps/website/src/components/nav-menu.tsx @@ -0,0 +1,100 @@ +import { useEffect, useRef, useState } from 'react' + +import * as NavigationMenu from '@radix-ui/react-navigation-menu' +import { Button, Text } from '@status-im/components' +import { DownloadIcon, ExternalIcon } from '@status-im/icons' +import { cx } from 'class-variance-authority' + +import { LINKS } from '@/config/links' + +import { Link } from './link' +import { Logo } from './logo' + +export const NavMenu = () => { + const [visible, setVisible] = useState(false) + + // Using ref to prevent re-running of useEffect + const visibleRef = useRef(visible) + visibleRef.current = visible + useEffect(() => { + const handleScroll = () => { + if (window.scrollY > 60) { + visibleRef.current === false && setVisible(true) + } else { + visibleRef.current === true && setVisible(false) + } + } + + handleScroll() + + window.addEventListener('scroll', handleScroll, { passive: true }) + return () => { + window.removeEventListener('scroll', handleScroll) + } + }, []) + + return ( + +
+ + + {Object.entries(LINKS).map(([name, links]) => ( + + + + {name} + + + + + {links.map(link => { + const external = link.href.startsWith('http') + return ( + + + + {link.name} + + {external && ( + + )} + + + ) + })} + + + ))} + + + +
+ + +
+ ) +} diff --git a/apps/website/src/components/page-footer.tsx b/apps/website/src/components/page-footer.tsx new file mode 100644 index 00000000..7b8507f2 --- /dev/null +++ b/apps/website/src/components/page-footer.tsx @@ -0,0 +1,135 @@ +import { Button, Text } from '@status-im/components' +import Link from 'next/link' + +import { LINKS, SOCIALS } from '@/config/links' + +import { Logo } from './logo' + +import type { Links } from '@/config/links' + +export const PageFooter = () => { + return ( +
+
+ +
+
+ {Object.entries(LINKS).map(([title, links]) => ( +
+ ))} + +
+ + {"Let's connect"} + +
+ {Object.values(SOCIALS).map(social => ( + + {social.name} + + ))} +
+
+
+ +
+ + +
+ +
+ + © Status Research & Development GmbH + + + + + + + + +
+ + Terms of use + + + Privacy policy + + + Cookies + +
+
+
+ ) +} + +type SectionProps = { + title: string + links: Links +} + +const Section = (props: SectionProps) => { + const { title, links } = props + + return ( +
+
+ + {title} + +
    + {links.map(link => ( +
  • + + + {link.name} + + +
  • + ))} +
+
+
+ ) +} + +type ActionCardProps = { + title: string + description: string + action: string +} + +const ActionCard = (props: ActionCardProps) => { + const { title, description, action } = props + + return ( +
+
+ + {title} + + + {description} + +
+ +
+ ) +} diff --git a/apps/website/src/config/links.ts b/apps/website/src/config/links.ts new file mode 100644 index 00000000..10b16bee --- /dev/null +++ b/apps/website/src/config/links.ts @@ -0,0 +1,67 @@ +export const LINKS = { + Features: [ + { name: 'Communities', href: '/features/communities' }, + { name: 'Messenger', href: '/features/messenger' }, + { name: 'Wallet', href: '/features/wallet' }, + { name: 'Browser', href: '/features/browser' }, + ], + Platforms: [ + { name: 'Mobile', href: '/platforms/mobile' }, + { name: 'Desktop', href: '/platforms/desktop' }, + { name: 'Web', href: '/platforms/web' }, + ], + About: [ + { name: 'Mission', href: '/' }, + { name: 'Principles', href: '/' }, + { name: 'Team', href: '/' }, + { name: 'Partners', href: '/' }, + { name: 'Press Kit', href: '/' }, + ], + Learn: [ + { name: 'Getting Started', href: '/learn/' }, + { name: 'Using Status', href: '/learn/' }, + { name: 'Communities', href: '/learn/' }, + { name: 'Wallet', href: '/learn/' }, + { name: 'Profile', href: '/learn/' }, + ], + Collaborate: [ + { name: 'Discuss', href: '/' }, + { name: 'Feature upvote', href: '/' }, + { name: 'Blog', href: '/blog' }, + { name: 'Translations', href: '/' }, + { name: 'Community groups', href: '/' }, + { name: 'Jobs', href: '/' }, + ], + Developers: [ + { name: 'Repos', href: 'https://github.com/status-im' }, + { name: 'Insights', href: '/insights' }, + { name: 'Integrations', href: '/' }, + ], + SNT: [ + { name: 'Token', href: '/' }, + { name: 'Governance', href: '/' }, + { name: 'Curate', href: '/' }, + { name: 'Exchanges', href: '/' }, + ], +} as const + +export const SOCIALS = { + status: { + name: 'Status', + href: '', + }, + twitter: { + name: 'Twitter', + href: 'https://twitter.com/ethstatus', + }, + github: { + name: 'GitHub', + href: 'https://github.com/status-im', + }, + youtube: { + name: 'YouTube', + href: 'https://youtube.com/', + }, +} + +export type Links = (typeof LINKS)[keyof typeof LINKS] diff --git a/apps/website/src/layouts/app-layout.tsx b/apps/website/src/layouts/app-layout.tsx new file mode 100644 index 00000000..7a5e89b9 --- /dev/null +++ b/apps/website/src/layouts/app-layout.tsx @@ -0,0 +1,99 @@ +import * as NavigationMenu from '@radix-ui/react-navigation-menu' +import { Button, Text } from '@status-im/components' +import { DownloadIcon, ExternalIcon } from '@status-im/icons' +import { cx } from 'class-variance-authority' + +import { Logo } from '@/components/logo' +import { NavMenu } from '@/components/nav-menu' +import { PageFooter } from '@/components/page-footer' +import { LINKS } from '@/config/links' + +import { Link } from '../components/link' + +import type { PageLayout } from 'next' + +export const AppLayout: PageLayout = page => { + return ( + <> + +
+ +
+
+ + + +
+ +
+ + {Object.entries(LINKS).map(([name, links]) => ( + + + + {name} + + + + {links.map(link => { + const external = link.href.startsWith('http') + + return ( + + + + {link.name} + + {external && ( + + )} + + + ) + })} + + + ))} + +
+ +
+ +
+
+ +
+ + {/* ROUNDED WHITE BG */} + {/*
{page}
*/} + {page} + + +
+ + ) +} diff --git a/apps/website/src/layouts/insights-layout.tsx b/apps/website/src/layouts/insights-layout.tsx index e02fd459..e11faf80 100644 --- a/apps/website/src/layouts/insights-layout.tsx +++ b/apps/website/src/layouts/insights-layout.tsx @@ -1,33 +1,24 @@ -import { Button, Text } from '@status-im/components' -import { LockedIcon, StatusIcon } from '@status-im/icons' -import Link from 'next/link' +import { Text } from '@status-im/components' import { useRouter } from 'next/router' +import { Link } from '@/components/link' + +import { AppLayout } from './app-layout' + import type { PageLayout } from 'next' import type { LinkProps } from 'next/link' export const InsightsLayout: PageLayout = page => { - return ( - <> -
- - - - -
- -
-
- -
{page}
- + return AppLayout( +
+ +
{page}
+
) } @@ -38,13 +29,12 @@ const NavLink = (props: LinkProps & { children: string }) => { const active = asPath === props.href return ( - - + + {children} diff --git a/apps/website/src/pages/_app.tsx b/apps/website/src/pages/_app.tsx index f910f341..c8d00ecb 100644 --- a/apps/website/src/pages/_app.tsx +++ b/apps/website/src/pages/_app.tsx @@ -1,5 +1,4 @@ -import '@/styles/app.css' -import '@/styles/reset.css' +import '@/styles/global.css' import { Provider } from '@status-im/components' import { Inter } from 'next/font/google' @@ -8,8 +7,8 @@ import type { Page, PageLayout } from 'next' import type { AppProps } from 'next/app' const inter = Inter({ - variable: '--font-sans', - weight: ['400', '500', '600'], + variable: '--font-inter', + weight: ['400', '500', '600', '700'], subsets: ['latin'], }) @@ -21,7 +20,7 @@ export default function App({ Component, pageProps }: Props) { const getLayout: PageLayout = Component.getLayout || (page => page) return ( -
+
{getLayout()}
) diff --git a/apps/website/src/pages/_document.tsx b/apps/website/src/pages/_document.tsx index df9bd6c0..d352f7e2 100644 --- a/apps/website/src/pages/_document.tsx +++ b/apps/website/src/pages/_document.tsx @@ -29,6 +29,7 @@ export default class Document extends NextDocument { id="tamagui" dangerouslySetInnerHTML={{ __html: Tamagui.getCSS() }} /> +
diff --git a/apps/website/src/pages/blog/[slug].tsx b/apps/website/src/pages/blog/[slug].tsx new file mode 100644 index 00000000..5f2c4a70 --- /dev/null +++ b/apps/website/src/pages/blog/[slug].tsx @@ -0,0 +1,15 @@ +import { AppLayout } from '@/layouts/app-layout' + +import type { Page } from 'next' + +const BlogDetailPage: Page = () => { + return ( +
+

Blog

+
+ ) +} + +BlogDetailPage.getLayout = AppLayout + +export default BlogDetailPage diff --git a/apps/website/src/pages/blog/index.tsx b/apps/website/src/pages/blog/index.tsx new file mode 100644 index 00000000..08f43a6d --- /dev/null +++ b/apps/website/src/pages/blog/index.tsx @@ -0,0 +1,68 @@ +import { Button, Shadow, Tag, Text } from '@status-im/components' + +import { AppLayout } from '@/layouts/app-layout' + +import type { Page } from 'next' + +const BlogPage: Page = () => { + return ( +
+
+
+

Blog

+ Long form articles, thoughts, and ideas. +
+ +
+
+ {[1, 2, 3, 4, 5, 6, 7, 8, 9].map(v => ( + + ))} +
+
+ +
+ +
+
+
+ ) +} + +const PostCard = () => { + return ( + +
+
+ +
+ + Long form articles, thoughts, and ideas. + +
+ + Status + + + on Jul 12, 2022 + +
+
+
+ {/* eslint-disable-next-line jsx-a11y/alt-text */} + +
+
+ ) +} + +BlogPage.getLayout = AppLayout + +export default BlogPage diff --git a/apps/website/src/pages/index.tsx b/apps/website/src/pages/index.tsx new file mode 100644 index 00000000..d5bafa64 --- /dev/null +++ b/apps/website/src/pages/index.tsx @@ -0,0 +1,130 @@ +import { Button, Text } from '@status-im/components' +import { DownloadIcon, PlayIcon } from '@status-im/icons' + +import { AppLayout } from '@/layouts/app-layout' + +import type { Page } from 'next' + +const HomePage: Page = () => { + return ( + <> +
+
+
+

+ Make the +
+ jump to web3 +

+ + + An open source, decentralized communication super app + +
+ +
+
+ + +
+ + Avaliable for Mac, Windows, Linux, iOS & Android + +
+
+ + +
+ +
+

+ Own a community? Time to take back control! +

+ + {"Don't give Discord and Telegram power over your community."} + +
+ +
+ + + + + +
+ + ) +} + +type FeatureSectionProps = { + title: string + description: string +} + +const FeatureSection = ({ title, description }: FeatureSectionProps) => { + return ( +
+
+

+ {title} +

+ +
+ {description} + + Learn More + +
+
+ + +
+ ) +} + +const FeatureGrid = () => { + return ( +
+
+ + Title + +
+
+ + Title + +
+
+ + Title + +
+
+ + Title + +
+
+ ) +} + +HomePage.getLayout = AppLayout + +export default HomePage diff --git a/apps/website/src/pages/insights/repos.tsx b/apps/website/src/pages/insights/repos.tsx index eb320f58..3c34f36a 100644 --- a/apps/website/src/pages/insights/repos.tsx +++ b/apps/website/src/pages/insights/repos.tsx @@ -1,6 +1,6 @@ import { Text } from '@status-im/components' -import Link from 'next/link' +import { Link } from '@/components/link' import { InsightsLayout } from '@/layouts/insights-layout' import type { Page } from 'next' @@ -53,14 +53,12 @@ const ReposPage: Page = () => {
-
+
{repos.map(repo => ( {repo.name} diff --git a/apps/website/src/pages/learn/[slug].tsx b/apps/website/src/pages/learn/[slug].tsx new file mode 100644 index 00000000..5f2c4a70 --- /dev/null +++ b/apps/website/src/pages/learn/[slug].tsx @@ -0,0 +1,15 @@ +import { AppLayout } from '@/layouts/app-layout' + +import type { Page } from 'next' + +const BlogDetailPage: Page = () => { + return ( +
+

Blog

+
+ ) +} + +BlogDetailPage.getLayout = AppLayout + +export default BlogDetailPage diff --git a/apps/website/src/pages/learn/index.tsx b/apps/website/src/pages/learn/index.tsx new file mode 100644 index 00000000..9764ad64 --- /dev/null +++ b/apps/website/src/pages/learn/index.tsx @@ -0,0 +1,15 @@ +import { AppLayout } from '@/layouts/app-layout' + +import type { Page } from 'next' + +const LearnPage: Page = () => { + return ( +
+

Learn

+
+ ) +} + +LearnPage.getLayout = AppLayout + +export default LearnPage diff --git a/apps/website/src/styles/app.css b/apps/website/src/styles/app.css deleted file mode 100644 index 3ec312a6..00000000 --- a/apps/website/src/styles/app.css +++ /dev/null @@ -1,23 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -html, -body, -#__next { - height: 100%; - overscroll-behavior: none; - user-select: none; - color: #000; -} - -*::selection { - color: #fff; - background: hsla(229, 71%, 57%, 1); -} - -#app { - position: relative; - isolation: isolate; - height: 100%; -} diff --git a/apps/website/src/styles/reset.css b/apps/website/src/styles/global.css similarity index 84% rename from apps/website/src/styles/reset.css rename to apps/website/src/styles/global.css index a9bb35ba..5e825901 100644 --- a/apps/website/src/styles/reset.css +++ b/apps/website/src/styles/global.css @@ -1,3 +1,13 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +@layer base { + body { + @apply !bg-neutral-100; + } +} + /* 1. Use a more-intuitive box-sizing model. */ @@ -8,12 +18,7 @@ } :root { - font-family: var(--font-sans); - font-size: 16px; - line-height: 24px; - font-weight: 400; - - color-scheme: light dark; + /* color-scheme: light dark; */ /* color: rgba(255, 255, 255, 0.87); */ /* background-color: #fff; */ @@ -35,12 +40,16 @@ 3. Allow percentage-based heights in the application */ html, -body { +body, +#__next, +#app { width: 100vw; - min-height: 100%; + min-height: 100vh; /* overflow: hidden; */ overscroll-behavior-y: none; /* not working on Safari */ + user-select: none; } + /* Typographic tweaks! 4. Add accessible line-height @@ -52,6 +61,7 @@ body { padding: 0; -webkit-overflow-scrolling: touch; } + /* 6. Improve media defaults */ @@ -63,6 +73,7 @@ svg { display: block; max-width: 100%; } + /* 7. Remove built-in form typography styles */ @@ -73,6 +84,7 @@ select { font: inherit; all: unset; } + /* 8. Avoid text overflows */ @@ -88,7 +100,6 @@ h6 { /* 9. Create a root stacking context */ -#root, #__next { isolation: isolate; } diff --git a/apps/website/tailwind.config.js b/apps/website/tailwind.config.js index 41cb12f4..804c8a8e 100644 --- a/apps/website/tailwind.config.js +++ b/apps/website/tailwind.config.js @@ -1,5 +1,8 @@ -// eslint-disable-next-line @typescript-eslint/no-var-requires +// eslint-disable-next-line eslint-comments/disable-enable-pair +/* eslint-disable @typescript-eslint/no-var-requires */ +const { fontFamily } = require('tailwindcss/defaultTheme') const colors = require('@status-im/colors') +const plugin = require('tailwindcss/plugin') /** @type {import('tailwindcss').Config} */ module.exports = { @@ -9,20 +12,51 @@ module.exports = { ], theme: { fontFamily: { - sans: ['var(--font-inter)'], + sans: ['var(--font-inter)', ...fontFamily.sans], }, colors, - // use from @status-im/components - fontSize: {}, + // use from @status-im/components or arbitrary values + // fontSize: {}, fontWeight: { - // regular: '400', - // medium: '500', - // semibold: '600', + regular: '400', + medium: '500', + semibold: '600', + bold: '700', }, - extend: {}, - }, + extend: { + transitionProperty: { + height: 'height', + }, - plugins: [], + keyframes: { + heightIn: { + from: { height: 0 }, + // to: { height: 296 }, + to: { height: 'var(--radix-navigation-menu-viewport-height)' }, + }, + heightOut: { + from: { height: 'var(--radix-navigation-menu-viewport-height)' }, + // from: { height: 296 }, + to: { height: 0 }, + }, + }, + }, + + animation: { + heightIn: 'heightIn 250ms ease', + heightOut: 'heightOut 250ms ease', + }, + }, + plugins: [ + require('tailwindcss-animate'), + plugin(({ matchUtilities }) => { + matchUtilities({ + perspective: value => ({ + perspective: value, + }), + }) + }), + ], } diff --git a/package.json b/package.json index 870b883d..d5a02f7c 100644 --- a/package.json +++ b/package.json @@ -51,8 +51,8 @@ "husky": "^8.0.3", "lint-staged": "^13.2.0", "patch-package": "^6.5.1", - "prettier": "^2.8.7", - "prettier-plugin-tailwindcss": "^0.2.7", + "prettier": "^2.8.8", + "prettier-plugin-tailwindcss": "^0.2.8", "rimraf": "^4.4.1", "turbo": "^1.8.8", "typescript": "^5.0.3", diff --git a/yarn.lock b/yarn.lock index 7f51870c..58381695 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3938,6 +3938,27 @@ aria-hidden "^1.1.1" react-remove-scroll "2.5.5" +"@radix-ui/react-navigation-menu@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-navigation-menu/-/react-navigation-menu-1.1.2.tgz#ca5ee35ddbc4e57a9403be92f9573435173e35c8" + integrity sha512-1fSjOAGTThYSgJ5pENG2V8we7+6KDbfbiyt66HmLTeo0W3PAmmciclm0o97VlcVZW7q5Vg2hN7Cbj4XKo5u2sw== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.0" + "@radix-ui/react-collection" "1.0.2" + "@radix-ui/react-compose-refs" "1.0.0" + "@radix-ui/react-context" "1.0.0" + "@radix-ui/react-direction" "1.0.0" + "@radix-ui/react-dismissable-layer" "1.0.3" + "@radix-ui/react-id" "1.0.0" + "@radix-ui/react-presence" "1.0.0" + "@radix-ui/react-primitive" "1.0.2" + "@radix-ui/react-use-callback-ref" "1.0.0" + "@radix-ui/react-use-controllable-state" "1.0.0" + "@radix-ui/react-use-layout-effect" "1.0.0" + "@radix-ui/react-use-previous" "1.0.0" + "@radix-ui/react-visually-hidden" "1.0.2" + "@radix-ui/react-popover@^1.0.5": version "1.0.5" resolved "https://registry.yarnpkg.com/@radix-ui/react-popover/-/react-popover-1.0.5.tgz#9c58100ed6809eb611c0acbf032f9ab58c0b55d1" @@ -4124,6 +4145,13 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/react-use-previous@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-previous/-/react-use-previous-1.0.0.tgz#e48a69c3a7d8078a967084038df66d0d181c56ac" + integrity sha512-RG2K8z/K7InnOKpq6YLDmT49HGjNmrK+fr82UCVKT2sW0GYfVnYp4wZWBooT/EYfQ5faA9uIjvsuMMhH61rheg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-previous@^0.1.1": version "0.1.1" resolved "https://registry.yarnpkg.com/@radix-ui/react-use-previous/-/react-use-previous-0.1.1.tgz#0226017f72267200f6e832a7103760e96a6db5d0" @@ -8392,6 +8420,13 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" +class-variance-authority@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/class-variance-authority/-/class-variance-authority-0.6.0.tgz#d10df1ee148bb8efc11c17909ef1567abdc85a03" + integrity sha512-qdRDgfjx3GRb9fpwpSvn+YaidnT7IUJNe4wt5/SWwM+PmUwJUhQRk/8zAyNro0PmVfmen2635UboTjIBXXxy5A== + dependencies: + clsx "1.2.1" + clean-css@^5.2.2: version "5.3.2" resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-5.3.2.tgz#70ecc7d4d4114921f5d298349ff86a31a9975224" @@ -8502,6 +8537,11 @@ clone@^2.1.2: resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== +clsx@1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.2.1.tgz#0ddc4a20a549b59c93a4116bb26f5294ca17dc12" + integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg== + collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" @@ -14276,6 +14316,7 @@ node-fetch-native@^1.0.1: node-fetch@2.6.7, node-fetch@^2.2.0, node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.7: version "2.6.7" + uid "1b5d62978f2ed07b99444f64f0df39f960a6d34d" resolved "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz#1b5d62978f2ed07b99444f64f0df39f960a6d34d" node-forge@^1.1.0, node-forge@^1.2.1, node-forge@^1.3.1: @@ -15198,10 +15239,10 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== -prettier-plugin-tailwindcss@^0.2.7: - version "0.2.7" - resolved "https://registry.yarnpkg.com/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.2.7.tgz#2314d728cce9c9699ced41a01253eb48b4218da5" - integrity sha512-jQopIOgjLpX+y8HeD56XZw7onupRTC0cw7eKKUimI7vhjkPF5/1ltW5LyqaPtSyc8HvEpvNZsvvsGFa2qpa59w== +prettier-plugin-tailwindcss@^0.2.8: + version "0.2.8" + resolved "https://registry.yarnpkg.com/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.2.8.tgz#e9c0356680331f909a86fefe8fc2b247c21e23a2" + integrity sha512-KgPcEnJeIijlMjsA6WwYgRs5rh3/q76oInqtMXBA/EMcamrcYJpyhtRhyX1ayT9hnHlHTuO8sIifHF10WuSDKg== prettier@^1.19.1: version "1.19.1" @@ -15218,6 +15259,11 @@ prettier@^2.8.7: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== +prettier@^2.8.8: + version "2.8.8" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== + pretty-bytes@5.6.0: version "5.6.0" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" @@ -17173,6 +17219,11 @@ tabbable@^6.0.1: resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-6.0.1.tgz#427a09b13c83ae41eed3e88abb76a4af28bde1a6" integrity sha512-SYJSIgeyXW7EuX1ytdneO5e8jip42oHWg9xl/o3oTYhmXusZVgiA+VlPvjIN+kHii9v90AmzTZEBcsEvuAY+TA== +tailwindcss-animate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/tailwindcss-animate/-/tailwindcss-animate-1.0.5.tgz#a6720e3b0616e1ff922b32846729881c626a069d" + integrity sha512-UU3qrOJ4lFQABY+MVADmBm+0KW3xZyhMdRvejwtXqYOL7YjHYxmuREFAZdmVG5LPe5E9CAst846SLC4j5I3dcw== + tailwindcss@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.3.1.tgz#b6662fab6a9b704779e48d083a9fef5a81d2b81e" @@ -17569,6 +17620,11 @@ ts-interface-checker@^0.1.9: resolved "https://registry.yarnpkg.com/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699" integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA== +ts-pattern@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ts-pattern/-/ts-pattern-4.3.0.tgz#7a995b39342f1b00d1507c2d2f3b90ea16e178a6" + integrity sha512-pefrkcd4lmIVR0LA49Imjf9DYLK8vtWhqBPA3Ya1ir8xCW0O2yjL9dsCVvI7pCodLC5q7smNpEtDR2yVulQxOg== + tsconfig-paths@^3.14.1: version "3.14.2" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz#6e32f1f79412decd261f92d633a9dc1cfa99f088"