|
| 1 | +import { code, CodeBlock, CodeBlockBody, CodeBlockCode, CodeBlockCopyButton } from "@/code-block"; |
| 2 | +import { InlineCode } from "@/inline-code"; |
| 3 | +import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/table"; |
| 4 | +import { TextArea } from "@/text-area"; |
| 5 | +import type { HeadersFunction, MetaFunction } from "@remix-run/node"; |
| 6 | +import { Example } from "~/components/example"; |
| 7 | + |
| 8 | +export const meta: MetaFunction = () => { |
| 9 | + return [ |
| 10 | + { title: "@ngrok/mantle — TextArea" }, |
| 11 | + { name: "description", content: "mantle is ngrok's UI library and design system" }, |
| 12 | + ]; |
| 13 | +}; |
| 14 | + |
| 15 | +export const headers: HeadersFunction = () => { |
| 16 | + return { |
| 17 | + "Cache-Control": "max-age=300, stale-while-revalidate=604800", |
| 18 | + }; |
| 19 | +}; |
| 20 | + |
| 21 | +export default function Page() { |
| 22 | + return ( |
| 23 | + <div> |
| 24 | + <h1 className="text-5xl font-medium">TextArea</h1> |
| 25 | + <p className="mt-4 text-xl text-gray-600">Displays a form textarea or a component that looks like a textarea.</p> |
| 26 | + |
| 27 | + <Example className="mt-4 flex-col gap-4"> |
| 28 | + <TextArea className="max-w-64" placeholder="Enter a username" /> |
| 29 | + <TextArea className="max-w-64" appearance="monospaced" placeholder="Enter a username" /> |
| 30 | + <TextArea className="max-w-64" placeholder="Enter a username" aria-invalid /> |
| 31 | + </Example> |
| 32 | + <CodeBlock className="rounded-b-lg rounded-t-none"> |
| 33 | + <CodeBlockBody> |
| 34 | + <CodeBlockCopyButton /> |
| 35 | + <CodeBlockCode language="tsx">{code` |
| 36 | + <> |
| 37 | + <TextArea placeholder="Enter a username" /> |
| 38 | + <TextArea className="max-w-64" appearance="monospaced" placeholder="Enter a username" /> |
| 39 | + <TextArea placeholder="Enter a username" aria-invalid /> |
| 40 | + </> |
| 41 | + `}</CodeBlockCode> |
| 42 | + </CodeBlockBody> |
| 43 | + </CodeBlock> |
| 44 | + |
| 45 | + <h2 className="mt-16 text-3xl font-medium">API Reference</h2> |
| 46 | + <div className="z-10 mt-4 overflow-hidden rounded-lg border border-gray-300"> |
| 47 | + <Table> |
| 48 | + <TableHeader> |
| 49 | + <TableRow> |
| 50 | + <TableHead>Prop</TableHead> |
| 51 | + <TableHead>Type</TableHead> |
| 52 | + <TableHead>Default</TableHead> |
| 53 | + </TableRow> |
| 54 | + </TableHeader> |
| 55 | + <TableBody className="font-mono text-xs text-gray-600"> |
| 56 | + <TableRow> |
| 57 | + <TableCell className="align-top font-medium">appearance</TableCell> |
| 58 | + <TableCell className="space-y-2 align-top text-xs"> |
| 59 | + <InlineCode>"monospaced" | undefined</InlineCode> |
| 60 | + </TableCell> |
| 61 | + <TableCell className="align-top"> |
| 62 | + <InlineCode>undefined</InlineCode> |
| 63 | + </TableCell> |
| 64 | + </TableRow> |
| 65 | + </TableBody> |
| 66 | + </Table> |
| 67 | + </div> |
| 68 | + </div> |
| 69 | + ); |
| 70 | +} |
0 commit comments