v1.1.3: Radix-composable buttons, meter ballistics/dBFS/loudness, PanKnob

- PushButton/Button forward native button props (...rest) and compose their
  own event handlers with consumer/Radix-injected ones, so a Button works as
  a Radix `asChild` trigger (dropdowns/tooltips/popovers). Prop types now
  extend React.ButtonHTMLAttributes.
- Meter gains opt-in metering: `ballistics` (PPM attack/decay), `peakDecay`
  (peak-hold fall tail), `scale="db"` (feed amplitude → dBFS with reference
  lines; min/max default -60/0), and `integrated` (windowed LUFS-ish loudness
  readout + marker). New rAF engine in meterEngine.ts with ampToDb/dbToAmp
  helpers; default behavior unchanged.
- New `PanKnob` — bipolar stereo pan: fills from center, center detent,
  L<n>/C/R<n> readout, -50..50 default.
- Docs: ApiDocs rows + recipes (dBFS meter, pan strip, Button-as-trigger),
  gallery cards (dBFS meter, Pan) + a Regenerate Button in the panel.
  CHANGELOG 1.1.3; version 1.1.3; install URLs bumped.

Library + docs typecheck and build; 46 tests pass.

- Meter dBFS readout: muted-grey unit labels (LUFS matched to dB), value-first
  layout in an aligned 2-column grid so peak/loudness decimals line up, and
  ghost pad digits removed — the loudness row no longer looks like a stray tag.

- Action buttons (Button / PushButton mode="action") no longer show an LED
  by default — an action has no state to indicate. led defaults to 'strip' for
  toggle/momentary and false for action; led="dot"/"strip" opts back in.
- Meter dBFS readout: units (dB / LUFS) sit centered directly under each
  value; grid alignment tidied and ghost pad digits removed. Docs: dBFS-meter
  card moved next to the Meters card (same component) + a horizontal example.
This commit is contained in:
Dreamodus 2026-07-14 11:16:44 -07:00
parent 605c38af51
commit d183d7d16b
15 changed files with 644 additions and 80 deletions

View file

@ -5,7 +5,7 @@ headless core, any number range, any decimal precision, and colors you fully con
Zero runtime dependencies.
```
pnpm add https://git.dreamodus.software/Dreamodus/DreamKnob/releases/download/v1.1.2/dreamknob-1.1.2.tgz
pnpm add https://git.dreamodus.software/Dreamodus/DreamKnob/releases/download/v1.1.3/dreamknob-1.1.3.tgz
```
(Latest release tarballs: https://git.dreamodus.software/Dreamodus/DreamKnob/releases)
@ -95,14 +95,16 @@ import {
LEDKnob, // segmented LED ring + true seven-segment readout
NeonKnob, // glowing arc for dark UIs
SteppedKnob, // detented selector (positions={['LP','BP','HP']})
PanKnob, // bipolar stereo pan — center detent, L<n>/C/R<n> readout
Fader, // linear channel fader, vertical or horizontal
LEDFader, // segmented LED meter-fader with color zones
ImageKnob, // film-strip sprite knob (KnobMan-style PNG strips)
Meter, // read-only LED level meter — mono or multi-channel (value={[l, r]})
Meter, // LED level meter — multi-channel, PPM ballistics, dBFS scale, loudness
MeterBridge, // labeled multi-strip meter block with per-channel peak text
Gauge, // read-only radial arc meter (round sibling of Meter) for CPU/RAM/load
XYPad, // two-parameter pad (cutoff/resonance, vector mixing)
PushButton, // panel button with LED strip or corner dot (toggle or momentary)
PushButton, // latch/hold panel button — LED strip or corner dot (toggle/momentary)
Button, // click-to-fire command button (no LED by default; led="dot" opt-in)
IndicatorLamp, // pressable LED lamp — the hardware checkbox (blink, momentary)
LampRow, // row of indicator lamps with console-print captions
ToggleSwitch, // rocker/slider boolean — the knob slides OFF↔ON
@ -118,7 +120,10 @@ import {
Knob skins also take `sublabel` (a second caption line) and `labelSize` (caption
size independent of the dial); `Meter` and `Fader` take `fill` to stretch to their
container.
container. `Meter` adds `ballistics` (PPM attack/decay), `peakDecay`, `scale="db"`
(feed amplitude, show dBFS) and `integrated` (windowed loudness) — all opt-in.
`PushButton`/`Button` forward native button props and compose handlers, so a
`Button` works as a Radix `asChild` trigger.
## Theming