/** * สเกลตัวอักษร "ตามบทบาท" — แหล่งความจริงเดียวของ type scale * * ค่าจริงอยู่ใน `styles.css` (@theme → `--text-*` ชี้ไปที่ `--fs-*` เพื่อให้เปลี่ยนตาม * breakpoint ได้) ไฟล์นี้คือรายการบทบาทสำหรับเอกสาร/showcase จะได้ไม่เขียนสเกลซ้ำสองที่ * แล้วคลาดกันภายหลัง — เพิ่มบทบาทใหม่ต้องแก้ทั้งสองไฟล์คู่กันเสมอ */ export type TypographyRole = { /** ชื่อคลาสที่ใช้จริง เช่น `text-body` */ className: string; /** ชื่อบทบาทสำหรับเอกสาร */ name: string; /** ขนาดบนมือถือ (< 48rem) */ mobile: string; /** ขนาดบนจอกว้าง (≥ 48rem) — ว่าง = เท่ากับมือถือ */ desktop: string; /** ใช้กับอะไร */ usage: string; }; export const TYPOGRAPHY_ROLES: readonly TypographyRole[] = [ { className: "text-title-lg", name: "Page Title", mobile: "24px", desktop: "24px", usage: "ชื่อหน้าหลักของแต่ละ Module ใน PageShell", }, { className: "text-title", name: "Section Title", mobile: "18px", desktop: "18px", usage: "หัวข้อหลักของ Card, Dialog, Sheet, Tabs panel", }, { className: "text-subtitle", name: "Subsection Title", mobile: "17px", desktop: "16px", usage: "หัวข้อย่อยใน Form section หรือ Card sub-block", }, { className: "text-body", name: "Body", mobile: "16px", desktop: "15px", usage: "เนื้อหาหลัก, ชื่อรายการ, Table row, ข้อความใน Dialog", }, { className: "text-caption", name: "Caption / Metadata", mobile: "14px", desktop: "13px", usage: "คำอธิบายรอง, timestamp, metadata chip, ตัวนับ", }, { className: "text-label", name: "Field Label", mobile: "12px", desktop: "12px", usage: "ป้ายชื่อฟิลด์ (มักคู่กับ uppercase/font-bold), overline", }, ] as const;