From 589cdec14fa2459bb55d91556af492a61b0b0b11 Mon Sep 17 00:00:00 2001 From: Aaron Wright Date: Sun, 15 Dec 2024 16:33:56 -0500 Subject: [PATCH] Add newsletter signp form --- docs/components/NewsletterSignupBanner.tsx | 152 ++++++++++++++ docs/components/atomic-ui-elements/button.tsx | 59 ++++++ docs/components/atomic-ui-elements/input.tsx | 36 ++++ docs/components/home/index.tsx | 187 +++++++++++------- docs/tailwind.config.js | 15 +- 5 files changed, 364 insertions(+), 85 deletions(-) create mode 100644 docs/components/NewsletterSignupBanner.tsx create mode 100644 docs/components/atomic-ui-elements/button.tsx create mode 100644 docs/components/atomic-ui-elements/input.tsx diff --git a/docs/components/NewsletterSignupBanner.tsx b/docs/components/NewsletterSignupBanner.tsx new file mode 100644 index 000000000..c481da27d --- /dev/null +++ b/docs/components/NewsletterSignupBanner.tsx @@ -0,0 +1,152 @@ +import { faEnvelope } from '@fortawesome/free-solid-svg-icons' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { Button } from './atomic-ui-elements/button' +import { Input } from './atomic-ui-elements/input' + +export function NewsletterSignupBanner() { + return ( +
+
+

+ Quint +

+ +

+ A modern and executable specification language +

+
+ +
+ + +

+ Subscibe to our newsletter for the latest + updates and features +

+ +
+ + + +
+ + + + + + + {/* The purple background */} +
+
+ ) +} diff --git a/docs/components/atomic-ui-elements/button.tsx b/docs/components/atomic-ui-elements/button.tsx new file mode 100644 index 000000000..572d9e00d --- /dev/null +++ b/docs/components/atomic-ui-elements/button.tsx @@ -0,0 +1,59 @@ +import { ComponentProps, ElementType } from 'react' + +type ButtonProps = ComponentProps & { + children: React.ReactNode + as?: T + variant?: keyof typeof classNamesByVariant +} + +const classNamesByVariant = { + primary: ` + bg-quint-purple + text-white + hover:bg-[#2d0075] + hover:text-quint-purple + px-8 + py-4 + `, + secondary: ` + bg-quint-purple + text-white + hover:bg-[#2d0075] + hover:text-quint-purple + px-6 + py-2 + `, +} + +export function Button({ + as, + children, + className, + variant = 'primary', + ...props +}: ButtonProps) { + const Component = (as ?? 'button') as ElementType + return ( + + {children} + + ) +} diff --git a/docs/components/atomic-ui-elements/input.tsx b/docs/components/atomic-ui-elements/input.tsx new file mode 100644 index 000000000..0a8def8fb --- /dev/null +++ b/docs/components/atomic-ui-elements/input.tsx @@ -0,0 +1,36 @@ +import { ComponentProps, ElementType } from 'react' + +type InputProps = Omit< + ComponentProps, + 'children' +> & { + as?: T + variant?: keyof typeof classNamesByVariant +} + +const classNamesByVariant = { + text: ` + px-8 + py-4 + bg-white + rounded + `, +} + +export function Input({ + as, + className, + variant = 'text', + ...props +}: InputProps) { + const Component = (as ?? 'input') as ElementType + return ( + + ) +} diff --git a/docs/components/home/index.tsx b/docs/components/home/index.tsx index 8a660e35d..94455410b 100644 --- a/docs/components/home/index.tsx +++ b/docs/components/home/index.tsx @@ -1,47 +1,56 @@ -import { Code, Pre } from "nextra/components" +import { Code, Pre } from 'nextra/components' -import React from "react"; -import { useState, useEffect } from 'react' -import { useTheme } from 'nextra-theme-docs' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faCheckCircle } from '@fortawesome/free-solid-svg-icons' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { useTheme } from 'nextra-theme-docs' +import { useEffect, useState } from 'react' import CodeSample from './code_sample.mdx' import ViolationSample from './violation_sample.mdx' import Image from 'next/image' -import { classNames } from "./classNames"; -import { ProsOrConsList } from "./ProsOrConsList"; +import { Button } from '../atomic-ui-elements/button' +import { NewsletterSignupBanner } from '../NewsletterSignupBanner' +import { classNames } from './classNames' +import { ProsOrConsList } from './ProsOrConsList' const benefits = [ [ - "Executable", - ["Quint", ["checked names and types", "executable"]], - ["English & Markdown", ["not checked", "not executuable"]], + 'Executable', + ['Quint', ['checked names and types', 'executable']], + ['English & Markdown', ['not checked', 'not executuable']], ], [ - "Abstract", - ["Specification Languages", ["define only what you care about"]], - ["Programming Languages", ["define how things happen, in detail"]], + 'Abstract', + ['Specification Languages', ['define only what you care about']], + ['Programming Languages', ['define how things happen, in detail']], ], [ - "Modern", - ["Quint", ["familiar syntax", "CLI and your editor"]], - ["Existing Spec Languages", ["math-y syntax", "old GUI tools"]], + 'Modern', + ['Quint', ['familiar syntax', 'CLI and your editor']], + ['Existing Spec Languages', ['math-y syntax', 'old GUI tools']], ], -] as const; - +] as const function informalSystemsLogo() { - const { resolvedTheme } = useTheme(); - const [theme, setTheme] = useState(null); - useEffect(() => { - setTheme(resolvedTheme); - }, [resolvedTheme]); + const { resolvedTheme } = useTheme() + const [theme, setTheme] = useState(null) + useEffect(() => { + setTheme(resolvedTheme) + }, [resolvedTheme]) return ( - Informal Systems + Informal Systems ) } @@ -52,67 +61,95 @@ const components = { } export function Home() { - const [isViolationVisible, setViolationVisible] = useState(false); + const [isViolationVisible, setViolationVisible] = useState(false) const handleToggleVisibility = () => { - setViolationVisible(true); - }; - - return (
-
-
- -
+ setViolationVisible(true) + } -
-

Quint

-

A modern and executable specification language

-
-
-
- {benefits.map(([label, [prosLabel, pros], [consLabel, cons]]) => ( -
-

-
- + return ( +
+
+
+

+ Quint +

+

+ A modern and executable specification language +

+
+
+
+ {benefits.map( + ([label, [prosLabel, pros], [consLabel, cons]]) => ( +
+

+
+ +
+ {label} +

+ +
+ + +
- {label} -

- -
- - -
-
- ))} + ), + )} +
+ +
+ +
-
- - Get started - +
+ +
+ +
+
+ +
-
- -
- -
-
- -
-
-
+ -
- {informalSystemsLogo()} +
+ {informalSystemsLogo()} +
-
-
-
- + +
) } diff --git a/docs/tailwind.config.js b/docs/tailwind.config.js index 5b09bc485..1f042333c 100644 --- a/docs/tailwind.config.js +++ b/docs/tailwind.config.js @@ -1,22 +1,17 @@ /** @type {import('tailwindcss').Config} */ module.exports = { content: [ - "./app/**/*.{js,ts,jsx,tsx,mdx}", - "./pages/**/*.{js,ts,jsx,tsx,mdx}", - "./components/**/*.{js,ts,jsx,tsx,mdx}", + './app/**/*.{js,ts,jsx,tsx,mdx}', + './pages/**/*.{js,ts,jsx,tsx,mdx}', + './components/**/*.{js,ts,jsx,tsx,mdx}', ], theme: { - colors: { - primary: { - 600: '#9d6ce5', - } - }, extend: { colors: { 'quint-purple': '#9d6ce5', 'quint-orange': '#ffab70', }, - } + }, }, plugins: [], -}; +}