mirror of
https://github.com/hanzo-apps/industries.git
synced 2026-10-30 14:47:50 +00:00
The site rendered in the system fallback: @hanzo/design 0.5.x replaced Geist with Zen, and this app pinned 0.4.6, so the family every surface asked for was one nothing declared any more. Bumping design alone strands it — @hanzo/ui inlines a copy of that token block — so the pair moves together, to @hanzo/design 0.5.21 and @hanzo/ui 8.3.4. @hanzo/ui depends on none of its @hanzogui/* peers; it declares them, so this app installs them. With only @hanzo/gui declared, pnpm resolved @hanzogui/lucide-icons-2 a generation behind, which dragged a second @hanzogui/core, and every @hanzo/ui component carrying an icon then read a theme context no provider fills — prerender died on "Missing theme.". Declaring the cohort, as hanzo.ai and the console already do, collapses it to one core. The old font test matched /geist|system-ui|sans-serif/, so it passed on the fallback: the exact failure it existed to catch. Both checks ask the font loader now. shots.mjs asks for Zen Mono only where a page renders mono, because a face loads when a glyph wants it; mutation-checked by aborting **/*.woff2. CommandPalette was controlled, nothing ever owned it, and its global handler could only close — so Cmd+K opened nothing and its test had never passed. A palette is the thing Cmd+K opens, so it owns the shortcut and mounts itself. 51 pages, 414/414 gui classes covered, 36/36 e2e, 60/60 routes across phone+desktop x light+dark. Co-authored-by: Hanzo Dev <[email protected]>
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
'use client'
|
|
|
|
/**
|
|
* The app's providers, in one place: the theme, the @hanzo/gui scale every
|
|
* @hanzo/ui component renders through, the toast outlet, and telemetry. (No
|
|
* tooltip root — this site renders no tooltip; that provider was starter cargo.)
|
|
*
|
|
* The scale comes from `@hanzo/ui/gui-config` — the ecosystem's one type/radius/
|
|
* spacing ladder, shared with the console and `sites`, so this site cannot drift
|
|
* onto a private one.
|
|
*
|
|
* `next-themes` writes `light` / `dark` onto <html>, which is exactly what
|
|
* @hanzo/design's token sets key off (`:root` is dark, `.light` the counterpart),
|
|
* and the same resolved value is handed to gui so its components theme with the
|
|
* page rather than against it.
|
|
*/
|
|
import type { ReactNode } from 'react'
|
|
import { GuiProvider } from '@hanzo/gui'
|
|
import { Toaster } from '@hanzo/ui'
|
|
import guiConfig from '@hanzo/ui/gui-config'
|
|
import { ThemeProvider, useTheme } from 'next-themes'
|
|
|
|
import { Analytics } from '@/components/Analytics'
|
|
import CommandPalette from '@/components/CommandPalette'
|
|
|
|
function Themed({ children }: { children: ReactNode }) {
|
|
const { resolvedTheme } = useTheme()
|
|
return (
|
|
<GuiProvider config={guiConfig} defaultTheme={resolvedTheme === 'dark' ? 'dark' : 'light'}>
|
|
<Toaster />
|
|
<CommandPalette />
|
|
{children}
|
|
</GuiProvider>
|
|
)
|
|
}
|
|
|
|
export function Providers({ children }: { children: ReactNode }) {
|
|
return (
|
|
<ThemeProvider attribute="class" defaultTheme="light" enableSystem disableTransitionOnChange>
|
|
<Themed>
|
|
<Analytics>{children}</Analytics>
|
|
</Themed>
|
|
</ThemeProvider>
|
|
)
|
|
}
|