@glideco/tradeoff-panel
v0.1.0
Published
Casa-style trust-altering modal for confirming consequential mutations (Self-Custody Plus, member removal, threshold change). 8 copy bundles, 3 severity tiers (catastrophic/consequential/soft), server-side acceptedAt validator.
Maintainers
Readme
@glideco/tradeoff-panel
Casa-style trust-altering modal for confirming consequential mutations.
8 copy bundles × 3 severity tiers (catastrophic / consequential / soft) for operations like Self-Custody Plus opt-in, member removal, threshold change, recovery setup, and other actions that weaken trust assumptions.
import {
TradeoffPanel,
type TradeoffConfirmResult,
} from '@glideco/tradeoff-panel';
<TradeoffPanel
action="member.remove"
context={{ memberName: '[email protected]', vaultBalanceUsd: 12_000_00 }}
onConfirm={({ acceptedAt }) => mutate({ memberId, acceptedAt })}
onCancel={close}
/>;Server-side validator
import { assertTradeoffAccepted } from '@glideco/tradeoff-panel/server';
assertTradeoffAccepted(input.acceptedAt);Throws TradeoffAcceptanceError with a discriminated code. Operators
map to their HTTP / RPC error layer.
Severity → visual weight
- catastrophic — full backdrop blur, danger left-border, type-vault-name confirm, 3-second countdown before primary becomes enabled.
- consequential — soft backdrop blur, warning left-border, single-click confirm.
- soft — inline expand only, no modal chrome.
License
MIT
