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