feat(frontend): add cabinet shells, brand tokens, and state primitives
This commit is contained in:
1 parent
dda3825786
commit
0e2a3b02ab
85 files changed
+3313
-113
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import type { ReactNode } from "react";
|
||||
import styles from "./layout.module.css";
|
||||
|
||||
const productName = "Lincodex";
|
||||
|
||||
type PageProps = {
|
||||
/** Text of the page's single h1 and of the document title. */
|
||||
title: string;
|
||||
/** Short context line above the heading, for example the cabinet name. */
|
||||
eyebrow?: string | undefined;
|
||||
lead?: ReactNode;
|
||||
width?: "narrow" | "wide";
|
||||
children?: ReactNode;
|
||||
};
|
||||
|
||||
/**
|
||||
* Page content inside a shell's main landmark. It owns the only h1 of the
|
||||
* page and sets the document title (React hoists <title> into <head>).
|
||||
*/
|
||||
export function Page({ title, eyebrow, lead, width = "narrow", children }: PageProps) {
|
||||
return (
|
||||
<div className={`${styles.page} ${styles[width]}`}>
|
||||
<title>{`${title} - ${productName}`}</title>
|
||||
<header className={styles["page-header"]}>
|
||||
{eyebrow ? <p className={styles.eyebrow}>{eyebrow}</p> : null}
|
||||
<h1 className={styles.title}>{title}</h1>
|
||||
{lead ? <div className={styles.lead}>{lead}</div> : null}
|
||||
</header>
|
||||
{children ? <div className={styles["page-body"]}>{children}</div> : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user