DiscountController
Mode toggle (—/%/$) + preset chips + manual input — discount editor.
Lifted straight from the deal-items panel. Emits a single `{ mode, value }` pair; the caller is responsible for computing the actual discount amount in micros / minor units against a subtotal.
Install
Pull from the workspace packages (already available if you ran pnpm add):
Examples
Default ($)
—
%
$
0%
5%
10%
15%
20%
EUR currency symbol
—
%
€
Anatomy
Mode toggleSegmentedControl with three values: NONE, PERCENT, FIXED.Preset chipsOnly when mode = PERCENT. Default presets 0/5/10/15/20.Manual inputFree-form numeric input. Clamps to ≤ 100 in PERCENT mode.Guidelines
✓
Place inside SummaryRow `controls` for the totals footer.Sized and aligned to fit a label↔value line.
✕
Format the input value yourself before passing.The recipe owns the input string state; passing pre-formatted values fights it.