UNPKG

trellis

Version:

Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications

24 lines 1.06 kB
/** * Colorpicker React — `useColorPicker` hook (ADR 0034 wedge 9). * * Import from `trellis/colorpicker/react`: * * const picker = useColorPicker({ initial: '#3366ff' }); * picker.actions.open(); * // <input value={picker.state.draft} onChange={e => picker.actions.setDraft(e.target.value)} /> * // {picker.state.contrast && `white ${picker.state.contrast.white.toFixed(2)}`} * * The core is created once per mount; state flows through * `useSyncExternalStore` (same bridge as `trellis/forms/react`). * * @module trellis/colorpicker/react */ import type { ColorPickerConfig, UseColorPickerReturn } from '../core/index.js'; /** Accept either a config (fresh core) or an existing core (shared mount). */ export type ColorPickerInput = ColorPickerConfig | UseColorPickerReturn; /** * Bind a colorpicker core to React. Pass a config for a fresh core, or an * existing core to share one mount across adapters. */ export declare function useColorPicker(input?: ColorPickerInput): UseColorPickerReturn; //# sourceMappingURL=index.d.ts.map