From 580e798e16346eb894eb899edac82d2efdf40adc Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Sat, 18 Apr 2026 22:32:53 -0500 Subject: initial commit --- src/components/BrandDoc.tsx | 518 +++++++++++++++++++++++++++++++++++++ src/components/CopyButton.tsx | 31 +++ src/components/InputPanel.tsx | 133 ++++++++++ src/components/PackageSwitcher.tsx | 125 +++++++++ src/components/PreviewPanel.tsx | 116 +++++++++ src/components/SettingsPanel.tsx | 158 +++++++++++ src/components/TokenInput.tsx | 85 ++++++ 7 files changed, 1166 insertions(+) create mode 100644 src/components/BrandDoc.tsx create mode 100644 src/components/CopyButton.tsx create mode 100644 src/components/InputPanel.tsx create mode 100644 src/components/PackageSwitcher.tsx create mode 100644 src/components/PreviewPanel.tsx create mode 100644 src/components/SettingsPanel.tsx create mode 100644 src/components/TokenInput.tsx (limited to 'src/components') diff --git a/src/components/BrandDoc.tsx b/src/components/BrandDoc.tsx new file mode 100644 index 0000000..fffea97 --- /dev/null +++ b/src/components/BrandDoc.tsx @@ -0,0 +1,518 @@ +import { useRef, useState } from 'react'; +import type { BrandInputs, BrandOutputs, ColorSwatch, LockedSections, Typography } from '../types'; +import { CopyButton } from './CopyButton'; + +// ── Editable text ───────────────────────────────────────────────────────────── + +interface EditableProps { + value: string; + onChange: (v: string) => void; + multiline?: boolean; +} + +function Editable({ value, onChange, multiline = false }: EditableProps) { + const [editing, setEditing] = useState(false); + const [draft, setDraft] = useState(value); + const ref = useRef(null); + + const commit = () => { + setEditing(false); + if (draft !== value) onChange(draft); + }; + + if (!editing) { + return ( +
{ setDraft(value); setEditing(true); }} + title="Click to edit" + style={{ whiteSpace: multiline ? 'pre-wrap' : 'normal', padding: '2px 4px', margin: '-2px -4px' }} + > + {value} +
+ ); + } + + if (multiline) { + return ( +