mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-21 00:18:41 +00:00
The gui deps pinned ^7.3.0/^0.1.0, which cannot resolve to 8.x — a consumer would have installed a 7.x copy alongside the 8.x one, which is the version split that broke rendering before. Peer floors move to >=8.0.0 so the split cannot re-form. The build was already red at 8.0.33 (39 errors, unchanged by the bump). Cause: pkgs/canvas augments GuiCustomConfig but never declared @hanzogui/core, and TS drops a `declare module` whose package it cannot resolve — silently, so every shorthand style prop went untyped and even `bg` and `p` read as nonexistent. Declaring it fixes 36. The last 3 are real: Switch and Checkbox are styled() components whose prop types are enumerated explicitly, so they never accept the config's shorthand vocabulary. They now use the canonical longhand names. Co-authored-by: Hanzo Dev <[email protected]>
21 lines
875 B
TypeScript
21 lines
875 B
TypeScript
/**
|
|
* Registers our Gui config with the type system so component style props
|
|
* (tokens, themes, shorthands) are typed. `GuiCustomConfig` is declared in
|
|
* `@hanzogui/web` and re-exported across the Gui packages; augmenting it there
|
|
* flows the types through every `@hanzo/gui` component.
|
|
*/
|
|
import type { Conf } from "./gui.config"
|
|
|
|
declare module "@hanzogui/web" {
|
|
interface GuiCustomConfig extends Conf {}
|
|
}
|
|
|
|
// `@hanzogui/core` re-declares the same extension point, and the components are
|
|
// re-exported through it — so augmenting only `web` leaves every style prop
|
|
// untyped here and tsc rejects the whole shorthand vocabulary, `bg` and `p`
|
|
// included, as if the config had no shorthands at all. Both declarations are
|
|
// required; pkg/ui and pkgs/dashboard already carry the pair.
|
|
declare module "@hanzogui/core" {
|
|
interface GuiCustomConfig extends Conf {}
|
|
}
|