Tier 2: drag feel, wheel overhaul, refs/meta/forms, Meter, gradients
- rotaryMode: 'absolute' | 'relative' (angle deltas, no grab jump) |
'pickup' (MIDI-style: engages when the pointer sweeps past the value)
- dragAcceleration: velocity gain for relative drags (Shift bypasses);
hideCursorOnDrag hides the cursor mid-gesture
- Wheel: trackpad delta accumulation (flicks can't rocket the value,
one notch per wheel click), wheelStep override, wheelRequiresFocus
opt-out of the hover scroll-trap
- onChange/onChangeStart/onChangeEnd now receive { source: 'drag' |
'wheel' | 'keyboard' | 'reset' | 'api' }
- Every component forwards a ref to its root; name prop renders a
hidden form input; SVG primitives carry data-part attributes
- Arc gradient: position-anchored color stops rendered as sliced arcs
(mixColors/sampleGradient exported, unit-tested)
- New read-only Meter: LED level meter with peak hold, zones, readout
- Fader capColor/capLength for custom handle styling
- Docs: Meter/gradient/drag-feel gallery cards, white-cap fader demo,
API rows, README
This commit is contained in:
parent
804a85cca6
commit
0aee48b749
27 changed files with 756 additions and 134 deletions
|
|
@ -19,7 +19,7 @@ export interface SteppedKnobProps extends SkinProps {
|
|||
}
|
||||
|
||||
/** Detented selector knob — mode/range switches with hard stops. */
|
||||
export const SteppedKnob: React.FC<SteppedKnobProps> = ({
|
||||
export const SteppedKnob = React.forwardRef<HTMLDivElement, SteppedKnobProps>(function SteppedKnob({
|
||||
size = 90,
|
||||
positions,
|
||||
steps,
|
||||
|
|
@ -34,7 +34,7 @@ export const SteppedKnob: React.FC<SteppedKnobProps> = ({
|
|||
className,
|
||||
style,
|
||||
...core
|
||||
}) => {
|
||||
}, ref) {
|
||||
const theme = useKnobTheme();
|
||||
const color = colorProp ?? theme.accent ?? '#ffd23e';
|
||||
const detents = positions ? positions.length : steps ?? 5;
|
||||
|
|
@ -43,6 +43,7 @@ export const SteppedKnob: React.FC<SteppedKnobProps> = ({
|
|||
|
||||
return (
|
||||
<Knob
|
||||
ref={ref}
|
||||
size={size}
|
||||
className={className}
|
||||
style={style}
|
||||
|
|
@ -109,4 +110,4 @@ export const SteppedKnob: React.FC<SteppedKnobProps> = ({
|
|||
}}
|
||||
</Knob>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue