Adopt the new palette; square corners, superellipse buttons
The theme defaults (light and dark) come from the 16-color grid, kept as PALETTE in src/lib/color.ts; every text pair passes the admin's 4.5:1 check. Nothing is rounded any more except buttons, which share one btn utility (Poppins Bold, a superellipse corner where the browser has corner-shape) and true dots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ecdcd4ec37
commit
d81f7bd856
62 changed files with 416 additions and 384 deletions
|
|
@ -70,7 +70,7 @@ export function DriveFolderTabs({ folders, value, onChange }: { folders: string[
|
|||
aria-selected={value === tab}
|
||||
onClick={() => onChange(tab)}
|
||||
className={
|
||||
"rounded-full px-3 py-1 text-sm transition-colors " +
|
||||
"btn px-3 py-1 text-sm transition-colors " +
|
||||
(value === tab ? "bg-action font-semibold text-white" : "border border-muted/25 text-muted hover:border-brand/50")
|
||||
}
|
||||
>
|
||||
|
|
@ -82,7 +82,7 @@ export function DriveFolderTabs({ folders, value, onChange }: { folders: string[
|
|||
}
|
||||
|
||||
const button =
|
||||
"rounded-full border border-brand px-3 py-1 text-sm font-medium text-link " +
|
||||
"btn border border-brand px-3 py-1 text-sm text-link " +
|
||||
"transition-colors hover:bg-tint disabled:cursor-default disabled:opacity-50";
|
||||
|
||||
export const FILE_HELP =
|
||||
|
|
@ -205,7 +205,7 @@ export function FileList({
|
|||
const isSelected = selected === file.url;
|
||||
const body = (
|
||||
<span className="flex items-center gap-3">
|
||||
<span className="flex h-16 w-14 shrink-0 items-center justify-center overflow-hidden rounded-md border border-muted/20 bg-tint">
|
||||
<span className="flex h-16 w-14 shrink-0 items-center justify-center overflow-hidden border border-muted/20 bg-tint">
|
||||
{file.preview ? (
|
||||
<img src={file.preview} alt="" loading="lazy" className="h-full w-full object-cover object-top" />
|
||||
) : (
|
||||
|
|
@ -223,7 +223,7 @@ export function FileList({
|
|||
return (
|
||||
<li
|
||||
key={file.id}
|
||||
className={`rounded-xl border bg-surface p-2 ${isSelected ? "border-brand ring-2 ring-brand/30" : "border-muted/20"}`}
|
||||
className={`border bg-surface p-2 ${isSelected ? "border-brand ring-2 ring-brand/30": "border-muted/20"}`}
|
||||
>
|
||||
{onPick ? (
|
||||
<button type="button" onClick={() => onPick(file)} className="block w-full text-left" aria-pressed={isSelected}>
|
||||
|
|
@ -273,7 +273,7 @@ export function FilePicker({
|
|||
onClick={(e) => {
|
||||
if (e.target === dialogRef.current) dialogRef.current?.close();
|
||||
}}
|
||||
className="m-auto w-[min(48rem,calc(100vw-2rem))] rounded-2xl p-0 backdrop:bg-[#0f2f36]/40"
|
||||
className="m-auto w-[min(48rem,calc(100vw-2rem))] p-0 backdrop:bg-[#001011]/40"
|
||||
>
|
||||
<div className="flex max-h-[85vh] flex-col">
|
||||
<div className="flex flex-wrap items-center gap-3 border-b border-brand/15 px-5 py-4">
|
||||
|
|
@ -283,13 +283,13 @@ export function FilePicker({
|
|||
value={query}
|
||||
onChange={(e) => setQuery(e.target.value)}
|
||||
placeholder="Search by file name"
|
||||
className="ml-auto w-56 rounded-lg border border-muted/25 px-3 py-1.5 text-sm outline-none focus:border-brand"
|
||||
className="ml-auto w-56 border border-muted/25 px-3 py-1.5 text-sm outline-none focus:border-brand"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => dialogRef.current?.close()}
|
||||
aria-label="Close"
|
||||
className="flex h-8 w-8 items-center justify-center rounded-full text-muted hover:bg-tint"
|
||||
className="flex h-8 w-8 items-center justify-center btn text-muted hover:bg-tint"
|
||||
>
|
||||
<X aria-hidden="true" weight="bold" className="h-4 w-4" />
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ export function FolderTabs({
|
|||
aria-selected={value === folder}
|
||||
onClick={() => onChange(folder)}
|
||||
className={
|
||||
"rounded-full px-3 py-1 text-sm transition-colors " +
|
||||
"btn px-3 py-1 text-sm transition-colors " +
|
||||
(value === folder ? "bg-action font-semibold text-white" : "border border-muted/25 text-muted hover:border-brand/50")
|
||||
}
|
||||
>
|
||||
|
|
@ -103,7 +103,7 @@ export function FolderTabs({
|
|||
}
|
||||
|
||||
const button =
|
||||
"rounded-full border border-brand px-3 py-1 text-sm font-medium text-link " +
|
||||
"btn border border-brand px-3 py-1 text-sm text-link " +
|
||||
"transition-colors hover:bg-tint disabled:cursor-default disabled:opacity-50";
|
||||
|
||||
/* A light checkerboard, so a white logo on a transparent background
|
||||
|
|
@ -111,8 +111,8 @@ const button =
|
|||
const CHECKER = {
|
||||
backgroundColor: "#fff",
|
||||
backgroundImage:
|
||||
"linear-gradient(45deg,#e6eef0 25%,transparent 25%),linear-gradient(-45deg,#e6eef0 25%,transparent 25%)," +
|
||||
"linear-gradient(45deg,transparent 75%,#e6eef0 75%),linear-gradient(-45deg,transparent 75%,#e6eef0 75%)",
|
||||
"linear-gradient(45deg,#c2fbff 25%,transparent 25%),linear-gradient(-45deg,#c2fbff 25%,transparent 25%)," +
|
||||
"linear-gradient(45deg,transparent 75%,#c2fbff 75%),linear-gradient(-45deg,transparent 75%,#c2fbff 75%)",
|
||||
backgroundSize: "12px 12px",
|
||||
backgroundPosition: "0 0,0 6px,6px -6px,-6px 0",
|
||||
};
|
||||
|
|
@ -231,7 +231,7 @@ export function UploadButton({
|
|||
type="checkbox"
|
||||
checked={keepOriginal}
|
||||
onChange={(e) => setKeepOriginal(e.target.checked)}
|
||||
className="h-3.5 w-3.5 rounded border-muted/40 text-link"
|
||||
className="h-3.5 w-3.5 border-muted/40 text-link"
|
||||
/>
|
||||
Keep original
|
||||
</label>
|
||||
|
|
@ -268,7 +268,7 @@ export function MediaGrid({
|
|||
const isSelected = selected === item.url;
|
||||
const thumb = (
|
||||
<>
|
||||
<div className="aspect-[4/3] overflow-hidden rounded-lg" style={CHECKER}>
|
||||
<div className="aspect-[4/3] overflow-hidden" style={CHECKER}>
|
||||
{item.content_type.startsWith("video/") ? (
|
||||
// A still of the first frame; metadata only, not the file.
|
||||
<video src={item.url} preload="metadata" muted className="h-full w-full bg-black object-contain" />
|
||||
|
|
@ -295,7 +295,7 @@ export function MediaGrid({
|
|||
return (
|
||||
<li
|
||||
key={item.id}
|
||||
className={`rounded-xl border bg-surface p-2 ${
|
||||
className={`border bg-surface p-2 ${
|
||||
isSelected ? "border-brand ring-2 ring-brand/30" : "border-muted/20"
|
||||
}`}
|
||||
>
|
||||
|
|
@ -362,9 +362,9 @@ function RequestImages({ folder, onPick }: { folder?: string; onPick: (item: Med
|
|||
{error && <p className="mb-3 text-sm text-danger">{error}</p>}
|
||||
<ul className="grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4">
|
||||
{files.map((file) => (
|
||||
<li key={file.id} className="rounded-xl border border-muted/20 bg-surface p-2">
|
||||
<li key={file.id} className="border border-muted/20 bg-surface p-2">
|
||||
<button type="button" disabled={busy !== null} onClick={() => pick(file)} className="block w-full text-left disabled:opacity-60">
|
||||
<div className="aspect-[4/3] overflow-hidden rounded-lg" style={CHECKER}>
|
||||
<div className="aspect-[4/3] overflow-hidden" style={CHECKER}>
|
||||
{/* Straight from Drive through the server; private to the admin. */}
|
||||
<img
|
||||
src={`/api/admin/feedback/${file.feedback_id}/files/${file.id}`}
|
||||
|
|
@ -422,7 +422,7 @@ export function MediaPicker({
|
|||
// A click on the backdrop lands on the dialog itself.
|
||||
if (e.target === dialogRef.current) dialogRef.current?.close();
|
||||
}}
|
||||
className="m-auto w-[min(56rem,calc(100vw-2rem))] rounded-2xl p-0 backdrop:bg-[#0f2f36]/40"
|
||||
className="m-auto w-[min(56rem,calc(100vw-2rem))] p-0 backdrop:bg-[#001011]/40"
|
||||
>
|
||||
<div className="flex max-h-[85vh] flex-col">
|
||||
<div className="flex flex-wrap items-center gap-3 border-b border-brand/15 px-5 py-4">
|
||||
|
|
@ -432,13 +432,13 @@ export function MediaPicker({
|
|||
value={query}
|
||||
onChange={(e) => setQuery(e.target.value)}
|
||||
placeholder="Search by file name"
|
||||
className="ml-auto w-56 rounded-lg border border-muted/25 px-3 py-1.5 text-sm outline-none focus:border-brand"
|
||||
className="ml-auto w-56 border border-muted/25 px-3 py-1.5 text-sm outline-none focus:border-brand"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => dialogRef.current?.close()}
|
||||
aria-label="Close"
|
||||
className="flex h-8 w-8 items-center justify-center rounded-full text-muted hover:bg-tint"
|
||||
className="flex h-8 w-8 items-center justify-center btn text-muted hover:bg-tint"
|
||||
>
|
||||
<X aria-hidden="true" weight="bold" className="h-4 w-4" />
|
||||
</button>
|
||||
|
|
@ -525,7 +525,7 @@ export function ImageInput({
|
|||
return (
|
||||
<div className="flex gap-3">
|
||||
<div
|
||||
className="flex h-20 w-20 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-muted/20"
|
||||
className="flex h-20 w-20 shrink-0 items-center justify-center overflow-hidden border border-muted/20"
|
||||
style={CHECKER}
|
||||
>
|
||||
{src && !broken ? (
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ export function SectionJump({ sections }: { sections: EditorSection[] }) {
|
|||
<select
|
||||
value={active ?? ""}
|
||||
onChange={(e) => jump(e.target.value)}
|
||||
className="w-full rounded-lg border border-muted/25 bg-surface px-3 py-1.5 text-sm text-body outline-none focus:border-brand"
|
||||
className="w-full border border-muted/25 bg-surface px-3 py-1.5 text-sm text-body outline-none focus:border-brand"
|
||||
>
|
||||
{sections.map((section) => (
|
||||
<option key={section.id} value={section.id}>
|
||||
|
|
|
|||
|
|
@ -119,12 +119,12 @@ const PREVIEWS = {
|
|||
};
|
||||
|
||||
const input =
|
||||
"w-full rounded-lg border border-muted/25 bg-surface px-3 py-2 text-sm text-body " +
|
||||
"w-full border border-muted/25 bg-surface px-3 py-2 text-sm text-body "+
|
||||
"outline-none transition-colors focus:border-brand focus:ring-2 focus:ring-brand/25";
|
||||
|
||||
/* Same box, but lit by the real input nested inside it. */
|
||||
const inputShell =
|
||||
"flex w-full items-center rounded-lg border border-muted/25 bg-surface px-3 py-2 text-sm " +
|
||||
"flex w-full items-center border border-muted/25 bg-surface px-3 py-2 text-sm "+
|
||||
"text-body transition-colors focus-within:border-brand focus-within:ring-2 " +
|
||||
"focus-within:ring-brand/25";
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ const shellError =
|
|||
/* Reads as settled fact rather than as an empty box someone forgot
|
||||
to fill in. */
|
||||
const inputLocked =
|
||||
"w-full rounded-lg border border-muted/20 bg-tint-soft px-3 py-2 text-sm " +
|
||||
"w-full border border-muted/20 bg-tint-soft px-3 py-2 text-sm "+
|
||||
"text-muted outline-none cursor-default focus:border-muted/40";
|
||||
|
||||
/* ── Dotted paths ────────────────────────────────────────────── */
|
||||
|
|
@ -145,7 +145,7 @@ const inputLocked =
|
|||
else the brand teal. */
|
||||
function colorPlaceholder(field, row): string {
|
||||
const own = typeof field.placeholder === "function" ? field.placeholder(row) : field.placeholder;
|
||||
return own || "#138ba0";
|
||||
return own || "#008fa8";
|
||||
}
|
||||
|
||||
export function getPath(object, path) {
|
||||
|
|
@ -278,7 +278,7 @@ export function Field({ field, value, row, options, error, onChange, onPatch }:
|
|||
checked={value === 1 || value === true}
|
||||
disabled={locked}
|
||||
onChange={(e) => onChange(e.target.checked ? 1 : 0)}
|
||||
className="h-4 w-4 rounded border-muted/40 text-link focus:ring-brand/40 disabled:opacity-50"
|
||||
className="h-4 w-4 border-muted/40 text-link focus:ring-brand/40 disabled:opacity-50"
|
||||
/>
|
||||
{helpText(field, row) ?? "Yes"}
|
||||
</label>
|
||||
|
|
@ -315,7 +315,7 @@ export function Field({ field, value, row, options, error, onChange, onPatch }:
|
|||
value={/^#[0-9a-f]{6}$/i.test(value ?? "") ? value : colorPlaceholder(field, row)}
|
||||
disabled={locked}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
className="h-9 w-12 shrink-0 rounded border border-muted/25 bg-surface disabled:opacity-50"
|
||||
className="h-9 w-12 shrink-0 border border-muted/25 bg-surface disabled:opacity-50"
|
||||
/>
|
||||
<input
|
||||
{...common}
|
||||
|
|
@ -547,7 +547,7 @@ export function Repeater({
|
|||
<button
|
||||
type="button"
|
||||
onClick={add}
|
||||
className="ml-auto rounded-full border border-brand px-3 py-1 text-sm font-medium text-link transition-colors hover:bg-tint"
|
||||
className="ml-auto btn border border-brand px-3 py-1 text-sm text-link transition-colors hover:bg-tint"
|
||||
>
|
||||
{spec.addLabel ?? "Add"}
|
||||
</button>
|
||||
|
|
@ -586,7 +586,7 @@ export function Repeater({
|
|||
endDrag();
|
||||
}}
|
||||
className={
|
||||
`rounded-xl border bg-tint-soft ${expanded ? "p-4" : "px-4 py-2.5"} transition-colors ` +
|
||||
`border bg-tint-soft ${expanded ? "p-4": "px-4 py-2.5"} transition-colors `+
|
||||
(over
|
||||
? "border-brand ring-2 ring-brand/25 "
|
||||
: "border-muted/20 ") +
|
||||
|
|
@ -710,7 +710,7 @@ export function Repeater({
|
|||
))}
|
||||
|
||||
{spec.preview && PREVIEWS[spec.preview] && (
|
||||
<div className="mt-4 rounded-lg border border-dashed border-brand/30 bg-surface p-4">
|
||||
<div className="mt-4 border border-dashed border-brand/30 bg-surface p-4">
|
||||
<p className="mb-3 text-xs font-semibold uppercase tracking-wider text-muted/70">
|
||||
Preview
|
||||
</p>
|
||||
|
|
@ -736,7 +736,7 @@ function IconButton({ label, onClick, danger = false, disabled = false, children
|
|||
aria-label={label}
|
||||
title={label}
|
||||
className={
|
||||
"flex h-7 w-7 items-center justify-center rounded-full border text-sm leading-none transition-colors " +
|
||||
"flex h-7 w-7 items-center justify-center btn border text-sm leading-none transition-colors " +
|
||||
(disabled
|
||||
? "cursor-default border-muted/20 text-muted/40"
|
||||
: danger
|
||||
|
|
@ -796,7 +796,7 @@ function TestNoticeInput({
|
|||
type="button"
|
||||
disabled={busy || !value?.trim()}
|
||||
onClick={send}
|
||||
className="rounded-full border border-brand px-3 py-1 text-sm font-medium text-link transition-colors hover:bg-tint disabled:cursor-default disabled:opacity-50"
|
||||
className="btn border border-brand px-3 py-1 text-sm text-link transition-colors hover:bg-tint disabled:cursor-default disabled:opacity-50"
|
||||
>
|
||||
{busy ? "Sending…" : "Send a test notice"}
|
||||
</button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue