|
| 1 | +import type { Meta, StoryObj } from "@storybook/react-vite"; |
| 2 | + |
| 3 | +// Visual catalogue of the shared brand assets (shared/assets/brand) — the single |
| 4 | +// source of truth for the Stirling logos used across the apps. |
| 5 | +import modernMarkDark from "@shared/assets/brand/modern-logo/StirlingPDFLogoNoTextDark.svg"; |
| 6 | +import modernMarkLight from "@shared/assets/brand/modern-logo/StirlingPDFLogoNoTextLight.svg"; |
| 7 | +import modernBlack from "@shared/assets/brand/modern-logo/StirlingPDFLogoBlackText.svg"; |
| 8 | +import modernWhite from "@shared/assets/brand/modern-logo/StirlingPDFLogoWhiteText.svg"; |
| 9 | +import modernGrey from "@shared/assets/brand/modern-logo/StirlingPDFLogoGreyText.svg"; |
| 10 | +import classicMarkDark from "@shared/assets/brand/classic-logo/StirlingPDFLogoNoTextDark.svg"; |
| 11 | +import classicMarkLight from "@shared/assets/brand/classic-logo/StirlingPDFLogoNoTextLight.svg"; |
| 12 | +import classicBlack from "@shared/assets/brand/classic-logo/StirlingPDFLogoBlackText.svg"; |
| 13 | +import classicWhite from "@shared/assets/brand/classic-logo/StirlingPDFLogoWhiteText.svg"; |
| 14 | +import classicGrey from "@shared/assets/brand/classic-logo/StirlingPDFLogoGreyText.svg"; |
| 15 | + |
| 16 | +type Asset = { label: string; src: string; onDark?: boolean }; |
| 17 | +type VariantSet = { variant: string; mark: Asset[]; wordmark: Asset[] }; |
| 18 | + |
| 19 | +const SETS: VariantSet[] = [ |
| 20 | + { |
| 21 | + variant: "modern", |
| 22 | + mark: [ |
| 23 | + { label: "NoTextDark", src: modernMarkDark }, |
| 24 | + { label: "NoTextLight", src: modernMarkLight, onDark: true }, |
| 25 | + ], |
| 26 | + wordmark: [ |
| 27 | + { label: "BlackText", src: modernBlack }, |
| 28 | + { label: "GreyText", src: modernGrey }, |
| 29 | + { label: "WhiteText", src: modernWhite, onDark: true }, |
| 30 | + ], |
| 31 | + }, |
| 32 | + { |
| 33 | + variant: "classic", |
| 34 | + mark: [ |
| 35 | + { label: "NoTextDark", src: classicMarkDark }, |
| 36 | + { label: "NoTextLight", src: classicMarkLight, onDark: true }, |
| 37 | + ], |
| 38 | + wordmark: [ |
| 39 | + { label: "BlackText", src: classicBlack }, |
| 40 | + { label: "GreyText", src: classicGrey }, |
| 41 | + { label: "WhiteText", src: classicWhite, onDark: true }, |
| 42 | + ], |
| 43 | + }, |
| 44 | +]; |
| 45 | + |
| 46 | +function Swatch({ label, src, onDark, h }: Asset & { h: number }) { |
| 47 | + return ( |
| 48 | + <figure |
| 49 | + style={{ margin: 0, display: "grid", gap: 6, justifyItems: "center" }} |
| 50 | + > |
| 51 | + <div |
| 52 | + style={{ |
| 53 | + display: "grid", |
| 54 | + placeItems: "center", |
| 55 | + padding: 16, |
| 56 | + minWidth: 140, |
| 57 | + borderRadius: 8, |
| 58 | + border: "1px solid rgba(128,128,128,0.25)", |
| 59 | + background: onDark ? "#1a1a1a" : "#ffffff", |
| 60 | + }} |
| 61 | + > |
| 62 | + <img src={src} alt={label} style={{ height: h, maxWidth: 200 }} /> |
| 63 | + </div> |
| 64 | + <figcaption style={{ fontSize: 12, color: "var(--text-muted, #71717a)" }}> |
| 65 | + {label} |
| 66 | + </figcaption> |
| 67 | + </figure> |
| 68 | + ); |
| 69 | +} |
| 70 | + |
| 71 | +function Row({ title, items }: { title: string; items: Asset[] }) { |
| 72 | + return ( |
| 73 | + <div style={{ display: "grid", gap: 8 }}> |
| 74 | + <h4 style={{ margin: 0, textTransform: "capitalize" }}>{title}</h4> |
| 75 | + <div style={{ display: "flex", gap: 16, flexWrap: "wrap" }}> |
| 76 | + {items.map((a) => ( |
| 77 | + <Swatch key={a.label} {...a} h={title === "mark" ? 48 : 28} /> |
| 78 | + ))} |
| 79 | + </div> |
| 80 | + </div> |
| 81 | + ); |
| 82 | +} |
| 83 | + |
| 84 | +const meta: Meta = { |
| 85 | + title: "Brand/Logos", |
| 86 | + parameters: { layout: "padded" }, |
| 87 | +}; |
| 88 | +export default meta; |
| 89 | +type Story = StoryObj; |
| 90 | + |
| 91 | +/** Every brand mark + wordmark, per variant, on the background each is built for. */ |
| 92 | +export const Logos: Story = { |
| 93 | + render: () => ( |
| 94 | + <div style={{ display: "grid", gap: 32 }}> |
| 95 | + {SETS.map((set) => ( |
| 96 | + <section key={set.variant} style={{ display: "grid", gap: 16 }}> |
| 97 | + <h3 style={{ margin: 0, textTransform: "capitalize" }}> |
| 98 | + {set.variant} |
| 99 | + </h3> |
| 100 | + <Row title="mark" items={set.mark} /> |
| 101 | + <Row title="wordmark" items={set.wordmark} /> |
| 102 | + </section> |
| 103 | + ))} |
| 104 | + </div> |
| 105 | + ), |
| 106 | +}; |
0 commit comments