'use client'; import { createGui } from '@hanzo/gui'; import { config as hanzoConfig } from '@hanzo/ui/gui-config'; import { defaultConfig } from '@hanzogui/config/v5'; import { animations } from '@hanzogui/config/v5-css'; // Branding = VALUE, not place: the brand hex table lives in ./white-label, // beside the identity rows it colours, so reading a brand never drags the gui // engine along. Re-exported here because this module is where the themes are // built from it. export { LUX_BRAND, PARS_GOLD, type LuxBrand } from './white-label'; import { LUX_BRAND, PARS_GOLD } from './white-label'; // Shared true-black neutral base: take @hanzogui's resolved dark theme and // force a pure-black canvas so every Lux surface sits on the same ground. const TRUE_BLACK = '#000000'; const darkBase = { ...defaultConfig.themes.dark, background: TRUE_BLACK, backgroundHover: '#0A0A0A', backgroundPress: '#141414', backgroundFocus: '#0A0A0A', } as typeof defaultConfig.themes.dark; // A brand child-theme row = the true-black base with the brand accent woven // into the accent-carrying keys. `` under a dark parent // resolves to `dark_lux`. const brandTheme = ( accent: string, extra: Record = {}, ): typeof darkBase => ({ ...darkBase, accentBackground: accent, accentColor: '#FFFFFF', borderColorHover: accent, colorHover: accent, ...extra, }) as typeof darkBase; export const luxThemes = { dark: darkBase, dark_lux: brandTheme(LUX_BRAND.lux), dark_zoo: brandTheme(LUX_BRAND.zoo), dark_hanzo: brandTheme(LUX_BRAND.hanzo), dark_pars: brandTheme(LUX_BRAND.pars, { accentColor: PARS_GOLD }), dark_bootnode: brandTheme(LUX_BRAND.bootnode), }; // One engine, tokens-not-forks: reuse @hanzogui's v5 defaultConfig // (tokens / fonts / media / shorthands) and only add the Lux child-theme rows // over it. The lone settings override — `onlyAllowShorthands: false` — keeps the // harvested exchange primitives (which author with longhand style props like // `borderRadius` / `paddingHorizontal`) valid; v5 defaults to shorthands-only. // `@hanzogui/config/v5` ships WITHOUT an animation driver — "users must provide // their own". Sheet is not merely unanimated without one, it throws // (`Sheet requires an animation driver to be set`), and every `transition` prop // on every other primitive is inert. Feeding the CSS driver here is what earns // the motion — one wiring for the whole fleet, not one per app. // Native surfaces can swap `@hanzogui/config/v5-css` for `/v5-rn` without // touching a component: the transition token names are identical. // The type ramp comes from @hanzo/ui's shared config, not from v5's literals. // // That config publishes gui's `$n` font ladder as `var(--text-*, )` rather // than as numbers, and @hanzo/design's ramp multiplies `--text-*` by // `--type-scale` — the knob @hanzo/appearance writes onto . gui resolves // a size in JS and applies it INLINE, and an inline style outranks every // stylesheet, so a custom property is the only thing that can reach a // `fontSize="$n"` call site at all. Taking v5's ladder instead would render // identically today and be frozen forever: a person's type-size setting would // have nothing to move. // // The px literal survives as each var()'s fallback, so a Lux surface that // mounts no token layer still renders at the intended size. // // Only TYPE is on that ramp upstream — `space` and `radius` arrive as numbers, // so density is not adjustable yet. That is a gap in the shared config, not // something to paper over here with a private scale. export const config = createGui({ ...defaultConfig, ...hanzoConfig, animations, settings: { ...defaultConfig.settings, onlyAllowShorthands: false, }, themes: { ...defaultConfig.themes, ...luxThemes, }, }); export type Conf = typeof config; declare module '@hanzo/gui' { interface GuiCustomConfig extends Conf {} } export default config;