v0.4.0
The widget visual system release. A single CSS-var channel now drives icon color,
glow, and shell gradient across every widget. Tones encode meaning; the oklch
palette delivers low-opacity vibrancy; dark/light mode swaps at the root with no
widget-side authoring.
Breaking changes
- Removed
WidgetIconglowprop. The icon glow is now driven by the channel
via--widget-glow-strength. Authors who setglowon a per-icon basis must
migrate to<Widget tone="...">or<Widget color="...">on the parent. - Removed
WidgetIcondynamicColorprop. Dynamic color now flows through
<Widget.Icon color="...">(the standard channel override path). The light
widget's entity-derived bulb color is the reference migration. - Removed
ColorVarianttype export. State-driven coloring goes through the
tone enum ("success" | "warning" | "danger" | "info" | "neutral" | "accent"). - Removed
adaptive-color.tsand its exports. Per-mode adaptation is now
handled by the envelope CSS vars (--widget-grad-strength,
--widget-glow-default,--widget-border-highlight) defined at:rootand
.dark. - Removed
HVAC_MODE_COLORSTailwind class map. Climate widget consumers
must use<Widget color colorTo>with oklch values. - Trimmed public type surface. Internal component
Propsinterfaces
(GlowProps,WidgetSliderFillProps,WidgetContentProps,
WidgetEmptyStateProps,WidgetIconProps,WidgetMetricsProps,
WidgetMetricsComponent,WidgetMetricsItemProps,WidgetStatusProps,
WidgetSubtitleProps,WidgetTitleProps,WidgetValueProps,
WidgetEmptyStateConfig(Widget.tsx duplicate),WidgetProps,
WidgetComponent,CursorDef,GestureHandlersre-export from hooks,
WidgetStackProps,InjectTokensRoot) are no longer exported. Consumers
use the components via JSX, not by importing Props.
Added
- Channel API. Four CSS variables flow through every Widget instance:
--widget-color,--widget-gradient,--widget-icon-color,
--widget-glow-strength. Authors set them via<Widget tone>,<Widget color>,
<Widget colorTo>,<Widget gradient>, and<Widget.Icon color>props. injectTokens()helper. Injects the SDK tokens stylesheet into<head>
with DOM and module-level idempotency guards. Wired intoWidgetonMount.ToneSchemaandToneexports. Zod schema + type for the six-tone
semantic enum.- Retuned oklch tone palette. Six tones (
success,warning,danger,
info,neutral,accent) tuned for vibrancy at 20% alpha in both modes. - Per-mode envelope variables.
--widget-grad-strength,
--widget-glow-default,--widget-border-highlightdiffer between:root
and.darkso widgets adapt without authoringdark:classes. @property --widget-color. Declared with<color>syntax and
inherits: trueso state-driven color transitions animate smoothly via CSS.- WidgetSliderFill channel wiring. Slider stripe and glow read
var(--widget-color)with--widget-icon-coloras an optional override.
Changed
- Widget shell collapsed to a single
<div>with the gradient computed by
a single SDK rule usingcolor-mix(in oklch, ...)at asymmetric stops. - WidgetIcon rewritten for channel consumption; previous
shadow-[...]
Tailwind arbitrary classes removed. - Glow migrated to channel. No per-call color props.
- Empty-state and loading states migrated off Tailwind to channel-driven
styling. - Mobile and desktop gesture grammars split. Gestures bind on the Widget
container with touch-action derived from gesture orientation.
Fixed
tokens.css?rawtype emit. Added sibling ambient declaration plus a
triple-slash reference intokens.tsso downstream consumers compiling SDK
source via the@glasshome/sourcecustomCondition resolve the?rawquery
at type-check time.- Auto-contrast icon glyph. Removed the
text-foregroundfallback that
caused incorrect glyph contrast on saturated channel backgrounds. - EntityView timestamps. Reverted to
Datefor backward compat after a
brief Date-to-string detour. - Cached widget rect.
useWidgetGesturesreads from the ResizeObserver
cache inonPointerMoverather than re-measuring (perf fix from Phase 01). - Widget Save button reactivity and scrollbar gutter reservation in the
config dialog.
Removed
adaptive-color.tsmodule and exports.ColorVarianttype.HVAC_MODE_COLORSTailwind class map.WidgetIconglowanddynamicColorprops.src/framework/design-system/index.tsbarrel (dead, all consumers used direct file paths).vite-plugin-externalize-depsdevDependency (never referenced byvite.config.ts).