Tier 1: origin anchor, detents, theming, type-in editing, ImageKnob

- origin: bipolar anchor value — Arc from=center, Fader fill and
  LEDFader segments draw from origin instead of min/mid-travel
- detents + detentSize: magnetic snap while dragging (normalized
  space, wheel/keyboard unaffected); applyDetents exported
- DreamknobProvider + KnobTheme: accent/track/face/text/label/ticks/
  focusRing/fonts tokens with dark and light bases; every skin
  resolves defaults from the theme, instance props win
- editable + parseValue: double-click knobs (or click fader readouts)
  to type exact values; Enter/blur commits, Esc cancels, 1.2k parses;
  ValueInput + defaultParseValue exported; setValue added to context
- ImageKnob: film-strip sprite knob (KnobMan-style strips), vertical
  or horizontal, with focus ring, editing, value/label
- Docs: LED gallery cards for film-strip/bipolar/editing/theming,
  playground editable toggle, theming API section, README updates
This commit is contained in:
Dreamodus 2026-07-12 15:05:46 -07:00
parent d8992408fa
commit 804a85cca6
25 changed files with 999 additions and 162 deletions

View file

@ -2,6 +2,16 @@
export { useKnob, type UseKnobResult } from './hooks/useKnob';
export { Knob, type KnobProps } from './components/Knob';
export { useKnobContext, type KnobRenderContext } from './core/context';
export {
DreamknobProvider,
useKnobTheme,
darkTheme,
lightTheme,
MONO_FONT,
UI_FONT,
type KnobTheme,
type DreamknobProviderProps,
} from './core/theme';
export type { KnobCoreProps, KnobState, InteractionMode } from './core/types';
export {
clamp,
@ -9,6 +19,7 @@ export {
snapToStep,
decimalsFromStep,
findClosest,
applyDetents,
linearTaper,
logTaper,
powTaper,
@ -31,6 +42,9 @@ export { KnobValue, KnobLabel, type KnobValueProps, type KnobLabelProps } from '
// Digital
export { SegmentDisplay, type SegmentDisplayProps } from './digital/SegmentDisplay';
// Value editing
export { defaultParseValue, ValueInput, type ValueInputProps } from './components/ValueInput';
// Prebuilt skins
export type { SkinProps } from './skins/shared';
export { FlatKnob, type FlatKnobProps } from './skins/FlatKnob';
@ -42,4 +56,5 @@ export { NeonKnob, type NeonKnobProps } from './skins/NeonKnob';
export { SteppedKnob, type SteppedKnobProps } from './skins/SteppedKnob';
export { Fader, type FaderProps } from './skins/Fader';
export { LEDFader, type LEDFaderProps, type LEDFaderZone } from './skins/LEDFader';
export { ImageKnob, type ImageKnobProps } from './skins/ImageKnob';
export { GlowFilter, type GlowFilterProps } from './primitives/GlowFilter';