AI danger zone
Shown as Breakwater, a made-up product
A project's danger zone where an assistant shows the blast radius first: what a member owns before removal, and the storage, domains and risks before a typed, held delete with a grace period.
Installation
pnpm dlx shadcn@latest add "https://propui.dev/r/breakwater-danger.json?token=…"Adds the piece to components/propui/03-breakwater-danger/ and installs motion. Needs a free account: sign in and the command includes your token. Fonts load from Prop UI; download the zip to self-host them.
When to use
Reach for it when
- The danger zone of a project's settings: removing a member and deleting the project.
- Any destructive action where an assistant should first show what it touches and offer a safe default for each part.
- Flows that need a strong confirmation (type the name, then hold) with an undo window or a grace period after.
Something else fits when
- A single low-stakes delete: a plain confirm dialog is enough.
- Reviewing many queued changes from agents: AI agent runs has an approval queue built for that.
- Settings with no destructive actions: a normal settings form is lighter.
Usage
Fills a full window: give it a container with a definite height.
import Piece from "@/components/propui/03-breakwater-danger/Section";
export default function Page() {
return (
<main className="h-dvh w-full overflow-hidden">
<Piece />
</main>
);
}Replace PROJECT, ACTOR, MEMBER, TEAMMATES, MEMBER_FINDINGS, ENVIRONMENTS, STORAGE, DOMAINS and RISKS in data.ts, and call your API from confirmRemove(), confirmDelete(), runRisk() and restore() in Section.tsx. Totals, the summary line and the audit line are computed from the data.
Your data
Replace these and everything on screen follows.
PROJECT{ name; slug; platform }- The header, the slug a person types to confirm, and every sentence that names the project.
ACTOR{ name; initials }- Who the audit line says made the change.
MEMBER{ id; name; initials; role; email; tone }- The member row and the remove panel.
TEAMMATES{ id; name; initials; role; tone }[]- Who can take over environments and approvals; the first is the default pick.
MEMBER_FINDINGS{ environments: string[]; approvals; key: { id; lastUsed } }- What the assistant found the member owns: environments to transfer, approvals to reassign, a key to revoke.
ENVIRONMENTS, STORAGE{ id; label; deployments }[], { id; label; gb; tone }[]- The blast radius in the delete panel: deployment counts per environment and the storage bar; DEPLOYMENTS and STORAGE_GB are their sums.
DOMAINSstring[]- The domains counted in the delete row and named in the domains risk.
RISKS{ id; title; detail; action; done }[]- The 'Before you delete' list, each with a one-click fix and the line that replaces it once done.
GRACE_DAYS, UNDO_SECONDSnumber- How long a deleted project can be restored, and how long the remove toast offers Undo.
Interactions
- Remove opens a panel listing what the member owns; pick who takes over environments and approvals, choose whether to revoke the key, and read the summary of exactly what will happen.
- Confirm the removal, then Undo it from the toast while its 10-second bar runs out; after that it lands in the audit line.
- Delete project opens a panel with the storage, deployments and domains it removes, and three risks to handle first, each with a one-click fix.
- Type the project slug to unlock the delete button, then press and hold it; 'Use a click instead' swaps the hold for a plain click.
- A deleted project shows its deletion date and a Restore button.
- Try a state makes the next confirm fail with an error and Retry, or resets the demo.
Keyboard
- TaborShift+Tab
- Move through the open panel; focus stays inside it.
- Esc
- Close the open panel or the Try a state menu (not while an action is running).
- EnterorSpace
- On the delete button, hold to delete; letting go early cancels.
Behaviour
Read from the code: roles, motion, breakpoints and what runs.
Accessibility
- Panels are modal dialogs labelled by their heading; focus moves in when they open and returns to whatever now stands where the trigger was when they close.
- The slug field has a label and marks itself invalid while what is typed doesn't match.
- The remove summary and the audit line are polite live regions, the undo toast is a status, and a failed attempt is an alert with Retry.
- Pickers are native selects with labels, and the revoke and fail toggles are checkboxes with the switch role.
- The delete button names its hint with aria-describedby, and 'Use a click instead' serves anyone who can't hold a button.
Motion
- Panels open from their trigger with one spring (scale and opacity); on phones they slide up as a bottom sheet over a scrim.
- Holding the delete button fills it left to right over 1.5 s; letting go drains it back.
- Storage figures count up, risks tick off as they are handled, and the audit line crossfades to its new sentence.
- Reduced motion drops the movement and keeps the fades, and slows the spinner.
Responsive
- The card is centred and shrinks with the screen; panels sit under their trigger, flip above when there is no room, and scroll inside with their actions pinned.
- Below 560px panels become bottom sheets, rows put their button under the text, and the panel's actions share a row with the alternate link underneath.
Performance
- No animation loop: timers drive the demo's working states, and the undo countdown runs only while the toast is up.
- Panel placement re-measures on resize and scroll only while a panel is open.
- No canvas or images: two local font files and inline SVG.
Notes for AI
Give your coding assistant the Markdown, not a screenshot.
- Keep every figure in data.ts; totals and sentences are computed from it, so they always agree.
- Keep the confirmation strong: typed slug, then hold (or click in click mode), and keep the undo window and grace period.
- Light and dark follow the nearest data-theme attribute above the piece, or the system setting. Keep colours in the tokens at the top of post.css.
/p/breakwater-danger/markdownThe whole library for assistants: llms.txt, or the MCP server in AI tools and MCP.