project-nomad/admin/inertia/components/markdoc/Table.tsx
Chris Sherwood 4db69d2173
feat(UI): add Night Ops dark mode with theme toggle
Add a warm charcoal dark mode ("Night Ops") using CSS variable swapping
under [data-theme="dark"]. All 23 desert palette variables are overridden
with dark-mode counterparts, and ~313 generic Tailwind classes (bg-white,
text-gray-*, border-gray-*) are replaced with semantic tokens.

Infrastructure:
- CSS variable overrides in app.css for both themes
- ThemeProvider + useTheme hook (localStorage + KV store sync)
- ThemeToggle component (moon/sun icons, "Night Ops"/"Day Ops" labels)
- FOUC prevention script in inertia_layout.edge
- Toggle placed in StyledSidebar and Footer for access on every page

Color replacements across 50 files:
- bg-white → bg-surface-primary
- bg-gray-50/100 → bg-surface-secondary
- text-gray-900/800 → text-text-primary
- text-gray-600/500 → text-text-secondary/text-text-muted
- border-gray-200/300 → border-border-subtle/border-border-default
- text-desert-white → text-white (fixes invisible text on colored bg)
- Button hover/active states use dedicated btn-green-hover/active vars

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 23:19:17 +00:00

38 lines
1.1 KiB
TypeScript

export function Table({ children }: { children: React.ReactNode }) {
return (
<div className="overflow-x-auto my-6 rounded-lg border border-desert-tan-lighter shadow-sm">
<table className="min-w-full divide-y divide-desert-tan-lighter">
{children}
</table>
</div>
)
}
export function TableHead({ children }: { children: React.ReactNode }) {
return <thead className="bg-desert-green">{children}</thead>
}
export function TableBody({ children }: { children: React.ReactNode }) {
return <tbody className="divide-y divide-desert-tan-lighter/50 bg-surface-primary">{children}</tbody>
}
export function TableRow({ children }: { children: React.ReactNode }) {
return <tr className="hover:bg-desert-sand/40 transition-colors">{children}</tr>
}
export function TableHeader({ children }: { children: React.ReactNode }) {
return (
<th className="px-5 py-3 text-left text-sm font-semibold text-white tracking-wide">
{children}
</th>
)
}
export function TableCell({ children }: { children: React.ReactNode }) {
return (
<td className="px-5 py-3.5 text-sm text-desert-green-darker">
{children}
</td>
)
}