Sebastián Balderas — Home

Storybook · Demonstration scenario

Design System Operations: From Request to Release

One request, followed until it becomes a governed pattern: a decision about what the system should own, a live component with its states, and a release note a team could check against. The scenario is fictional. The component is real, and it lives in my Storybook.

A self-initiated demonstration using fictional sample data. The team, the request and the people in it are invented, and nothing on this page describes how an existing company operates.

Open Approval Task in Storybook

The request

A fictional field-service team asks for an approval screen. Technicians request parts for a work order, and someone has to approve or reject each request before the part ships.

The obvious answer is one more screen. In this scenario that isn't enough: the same decision happens at a desk, on site and on a phone between jobs, and each surface was about to get its own version.

Who decides
A supervisor, within a personal approval limit.
The task
Approve or reject one parts request, with a reason when rejecting.
Where
At a desk reviewing a queue, on a tablet on site, on a phone between jobs.
The constraint
The decision has to be unmistakable on every surface, including when this person isn't allowed to make it.
States
Pending, approved, rejected, blocked by permission, error.
The exception
A request above the supervisor's limit. They can see it; they can't approve it.

What the system owns, and what it doesn't

Before drawing anything, the question is what belongs in the system and what stays in the product.

  • Reused

    Button and Spinner from the site's own components, the semantic color and type tokens, and an existing rule: state is told apart by wording and icon, never by color alone.

  • Adapted

    Actions grow to 44px on tablet and phone. Rejected uses a neutral tone, because it is a decision, not a failure, so red stays reserved for the one state where something actually broke.

  • Not a component

    The queue, its filters and its sorting stay product code. They change with each team's workflow; freezing them into the system would create the drift it exists to prevent.

No new warning color. The system deliberately has none: pending and blocked are carried by wording and an icon.

Out of scope: delegation, multi-step approval chains and partial approval. The pattern covers one person deciding one request.

The options I considered

Each decision above had an obvious alternative. Here are the three I weighed, and what each would have done to the person deciding, the team consuming the component and whoever maintains it.

  1. Option considered

    A disabled Approve button for requests above the limit

    Person deciding
    They see an action they can't take and no reason why. The site's Button renders disabled at 50% opacity with pointer events off: it says no, not who can say yes.
    Team consuming it
    Every team adds its own tooltip or helper text to explain the block, each worded differently.
    Maintenance
    The explanation lives outside the component, so it can't be versioned or reviewed with it.

    Why I rejected it. The constraint of the task is that the decision is unmistakable even when this person can't make it. A disabled button hides exactly that.

    What I chose. A Blocked state that replaces the actions with who can act.

  2. Option considered

    Rejected in red

    Person deciding
    A correct rejection looks like a failure, and it can't be told apart from the error state at a glance.
    Team consuming it
    Red stops mapping to one meaning; teams have to learn when red is a decision and when it is a fault.
    Maintenance
    The danger tokens get spread over a state that isn't a failure, which weakens them everywhere else.

    Why I rejected it. A rejection is a decision, not a failure; red stays reserved for error.

    What I chose. Rejected in the neutral tone, with its own icon, wording and reason line.

  3. Option considered

    The queue inside the component

    Person deciding
    The phone would inherit the queue, when the only job there is to decide the request in front of you.
    Team consuming it
    Every team's filters and sort order differ, so the component would need a prop for each workflow.
    Maintenance
    The API grows with each team, and the system freezes product decisions it doesn't own.

    Why I rejected it. The queue changes with each team's workflow, so it stays product code, as decided above. The row variant is what a queue renders per request.

    What I chose. One component for one request; the queue, filters and sorting stay product code.

The component, live

This is the same component the Storybook entry documents, rendered here, not a picture of it. Switch states to see what changes and what doesn't.

Approval Task

One parts request, in the tablet variant. Approve and Reject work; so does Try again.

components/demos/approval-task.tsx → ApprovalTask
Sample data

RQ-0142

Awaiting your decision
Item
Pump seal kit × 2
Work order
WO-381
Requested by
Field technician
Note
Seal failed during a routine inspection.

Try it

Only the actions change shape between states. The summary never moves, so the person never loses track of the request they're deciding on.

Anatomy

  1. 1. Request summary
  2. 2. Status (badge, icon and text)
  3. 3. Context line
  4. 4. Actions

Semantic tokens only: text, surface, border, success and danger. No raw color values.

Three surfaces, three jobs

The answer isn't one layout scaled down. Each surface keeps the task that matters most there and drops what doesn't.

Desktop · Row

Review in volume.

A dense row inside a queue: summary, status and inline actions on one line, so a reviewer can move through many requests without opening each one. Blocked requests stay in the queue with their reason visible instead of disappearing.

Queue — product code, not part of the component

  • Sample data

    RQ-0142 · Pump seal kit × 2

    Requested by Field technician · WO-381

    Awaiting your decision
  • Sample data

    RQ-0139 · Compressor valve

    This request is above your approval limit. A regional manager can approve it.

    Needs a regional manager
  • Request approved.
    Sample data

    RQ-0136 · Filter cartridge × 4

    Approved by you · sample time

    Approved

iPad · Detail

Stay on the task.

On site, the request opens beside the list with its full context (work order, requester, note) and 44px actions. In this scenario, an interruption doesn't lose the open request.

  • ·
  • RQ-0139 · Compressor valve
  • RQ-0136 · Filter cartridge × 4
Sample data

RQ-0142

Awaiting your decision
Item
Pump seal kit × 2
Work order
WO-381
Requested by
Field technician
Note
Seal failed during a routine inspection.

Phone · Focus

Decide one thing.

One request, status first, actions stacked full-width at the bottom. No queue and no table: between jobs, the only job is to decide the request in front of you, or to learn who can.

Needs a regional manager

This request is above your approval limit. A regional manager can approve it.

Sample data

Pump seal kit × 2

RQ-0142 · WO-381

All three are one component with three variants, chosen for the task, not by screen width alone.

The token layer

The component uses no raw color. Each class resolves through two steps in app/globals.css: a primitive (the palette value), a semantic token (what the value means), then the Tailwind utility the component writes.

Semantic tokens used by ApprovalTask, with their light and dark primitives
Semantic tokenLight → primitiveDark → primitiveUtility in the componentUsed for
--bg-surface-default--paper-50 #faf9f8--ink-900 #171716bg-bg-surface-defaultCard surface
--bg-surface-raised--paper-100 #f2f1ed--ink-800 #232321bg-bg-surface-raisedNeutral badge fill (pending, rejected, blocked)
--border-default#e4e2dc (literal, no primitive)--ink-700 #34342fborder-border-defaultCard and badge border
--text-primary--ink-900 #171716--paper-50 #faf9f8text-text-primaryRequest id and values
--text-secondary--ink-600 #4a4a47--ink-200 #b8b6b0text-text-secondaryNeutral badge text, context line
--text-muted--ink-500 #6b6b66--ink-300 #a8a6a0text-text-muted“Sample data” and field labels
--success--success-600 #2d6a4f--success-300 #74c69dtext-success, bg-success/10, border-success/30Approved badge
--danger-text--danger-600 #8a2e2e--danger-300 #f5b5b5text-danger-textError message
--danger-bg--danger-bg-50 #fdf1f1--danger-bg-900 #3a1f1fbg-danger-bgError surface
--danger-border--danger-border-200 #e0a1a1--danger-border-700 #8f4444border-danger-borderError border
--accent-primary--accent-primary-700 #297373--accent-primary-400 #3ca9a9bg-primary, ring-ring (via Button)Approve fill and focus ring
--border-control--ink-400 #8a8a85--ink-400 #8a8a85border-border-control (via Button)Outline action border

There is no warning token in globals.css, and the component doesn't add one.

The API

ApprovalTaskProps, as declared in the component. Every prop is optional, so the component renders its pending row with the sample request by default.

ApprovalTask props
PropTypeDefaultWhat it controls
status"pending" | "approved" | "rejected" | "blocked" | "error""pending"Which state renders: badge, context line and which actions exist.
variant"row" | "detail" | "focus""row"The layout for the task: queue row, full context, or one decision.
request{ id, item, workOrder, requester, note? }SAMPLE_REQUESTThe request being decided.
reasonstringSAMPLE_REJECTION_REASONThe reason line shown in rejected.
submitting"approve" | "reject"undefinedA decision in flight: both actions disabled, a Spinner in the one pressed, aria-busy on the root. Only applies in pending.
onApprove() => voidundefinedApprove, in pending.
onReject() => voidundefinedReject, in pending.
onEscalate() => voidundefinedSend to regional manager, in blocked. The escalation flow itself is product code.
onRetry() => voidundefinedTry again, in error.
classNamestring""Extra classes on the root.

The code that carries the decisions

Trimmed to the lines that hold each decision. Extracted from the component file when the page is built, so it can't drift from what runs above.

State model: tone is chosen per state, and rejected is neutral

type Tone = "neutral" | "success";

const BADGE_TONE: Record<Tone, string> = {
  neutral: "bg-bg-surface-raised text-text-secondary border-border-default",
  success: "bg-success/10 text-success border-success/30",
};

const STATUS: Record<
  Exclude<ApprovalStatus, "error">,
  { tone: Tone; label: string; icon: ReactNode }
> = {
  pending: { tone: "neutral", label: "Awaiting your decision", icon: <Clock aria-hidden="true" className="size-3.5" /> },
  approved: { tone: "success", label: "Approved", icon: <Check aria-hidden="true" className="size-3.5" /> },
  rejected: { tone: "neutral", label: "Rejected", icon: <X aria-hidden="true" className="size-3.5" /> },
  blocked: { tone: "neutral", label: "Needs a regional manager", icon: <Lock aria-hidden="true" className="size-3.5" /> },
};
components/demos/approval-task.tsx · lines 66–81

Blocked: the actions are replaced, never disabled

) : status === "blocked" ? (
  <Button
    variant="outline"
    size={variant === "row" ? "default" : "lg"}
    className={`${touch} ${actionWidth}`}
    onClick={onEscalate}
  >
    Send to regional manager
  </Button>
components/demos/approval-task.tsx · lines 215–223

Variant and targets: 44px where the task is done by touch

// 44px targets where the task happens by touch (tablet, phone). The desktop
// row keeps the default 32px: it is a pointer surface reviewed in volume.
const touch = variant === "row" ? "" : "min-h-11";
const actionWidth = variant === "focus" ? "w-full" : "";
components/demos/approval-task.tsx · lines 187–190

Focus after a decision: moved to the status, never left on the page

// Focus after a decision (finding of 2026-11-13). When the status changes,
// the action that was pressed can unmount with the old state, and focus
// would fall to <body>. If focus was inside this card and nothing else has
// it now, move it deliberately to the status element. A status change that
// comes from outside the card (focus elsewhere) never steals focus.
const rootRef = useRef<HTMLDivElement>(null);
const statusRef = useRef<HTMLElement>(null);
const focusInside = useRef(false);
useEffect(() => {
  const active = document.activeElement;
  if (focusInside.current && (active === null || active === document.body)) {
    statusRef.current?.focus();
  }
}, [status]);
components/demos/approval-task.tsx · lines 161–174

Announcement: the live region is always mounted

// The polite region is ALWAYS mounted so a change of text is announced; an
// element inserted already-filled is not reliably read.
const live = (
  <span aria-live="polite" className="sr-only">
    {ANNOUNCEMENT[status] ?? ""}
  </span>
);
components/demos/approval-task.tsx · lines 257–263

How I verified it

Checks I ran on 13 November 2026 against a local production build of the site (next build, then next start), driving the page with Playwright 1.62.1 in Chromium. Light and dark theme. The numbers are computed colors composited over the real surface each element sits on.

Production build, lint and type check pass with this page included.

Contrast, per state

AA is 4.5:1 for text and 3:1 for a control's boundary or a focus indicator.

Measured contrast ratios per state, light and dark
PairStatesLightDark
Neutral badge text on its fillPending, rejected, blocked7.87:17.76:1
Success badge text on its tintApproved5.28:17.36:1
Context lineApproved, rejected, blocked8.46:18.85:1
“Sample data” and field labelsAll but error5.09:17.37:1
Error message on the error surfaceError7.58:18.71:1
Field labels on the error surfaceError4.85:16.18:1
Approve label on its fillPending5.26:16.36:1
Outline action labelPending, blocked, error17.06:113.60–15.52:1
Outline action border on the cardPending, blocked3.30:15.17:1
“Try again” border on the error surfaceError3.14:14.34:1
Focus ring on the cardPending5.26:16.36:1

Touch targets

Measured action heights per variant
VariantAction heightResult
detail (tablet)44pxMeets 44px
focus (phone)44px, full widthMeets 44px
row (desktop)32pxBy design: a pointer surface reviewed in volume
  • Focus order and visible focus

    Tabbing into the live demo reaches Approve, then Reject, then the state controls: reading order. Each action shows the Button's focus ring, a 2px gap in the surface color and a 2px ring in --accent-primary.

  • Keyboard operation

    Enter on Approve and Space on Reject each set aria-busy on the root and disable both actions while the decision is in flight, then land on approved or rejected. The polite live region announces “Request approved.” or “Request rejected.”, and focus lands on the status badge. In error, the message is a role="alert" and Enter on Try again returns to pending with focus on Approve.

  • Blocked has no disabled action

    In blocked, the only action rendered is “Send to regional manager”. There is no Approve button in the DOM, disabled or otherwise.

One finding, fixed and re-measured

Found
In the first run, after Approve or Reject by keyboard, the pressed button left the DOM with the pending state and focus fell back to the document body. A keyboard user lost their place.
Fixed
The card now tracks whether focus is inside it. When the status changes and nothing has focus, focus moves to the status element: the badge, or the error message in error. Both take tabindex="-1", so they stay out of the tab order, and show the Button's ring. A status change from outside the card never moves focus.
Re-measured
Enter on Approve and Space on Reject now land focus on the “Approved” and “Rejected” badges, with :focus-visible and the 2px --accent-primary ring in light and dark; Tab continues to the next control. The tab order before the decision, the live-region announcements, aria-busy and the contrast numbers above are unchanged from the first run. Changing the state from the demo's controls leaves focus on the control.

The contract lives in Storybook

The Storybook entry is the versioned contract: what an engineer builds against, and what a reviewer checks a change against. It holds:

  • The live component, with every state and variant behind Controls.
  • The real source file in the Code tab, not a snippet written for the docs.
  • Props, states, variants and responsive behavior, written down.
  • Accessibility: how each state is announced, focus order, 44px targets, and contrast measured on the surface the component sits on.
  • When to use it, when not to, and what is deliberately out of scope.
Open Approval Task (Demonstration) in Storybook

This Storybook is my own. It shows how I document and version a component; it is not code shipped for any team I have worked with. In those engagements, Engineering implements.

Release, and how a team would know it worked

Approval Task — demonstration release, 14 October 2026

Added
One component, three variants (row, detail, focus), five states.
Decided
Rejected is neutral, not red. Blocked replaces the actions with who can act; there is no disabled Approve button. No warning color.
Not included
Delegation, multi-step approvals, partial approval.
Before use
Design checks wording and states; Engineering checks props, focus order and announcements.

The component and its Storybook entry are real and dated. Everything below is hypothetical: the checks I would set up with a team.

Adoption — what I would look for

  • New approval flows import the shared component instead of building a local one.
  • Blocked requests explain who can act, in the system's wording.
  • Rejections arrive with a reason.

Drift — what I would watch for

  • A yellow or orange “pending” badge appears, a color the system doesn't have.

None of these are measured results. They are the checks I would agree on with a team before calling a change adopted.

MEDIUM · CONTRA

The states no component library ships:Read the full article on Medium

I write about these decisions in more depth.

Design System Starter, fixed scope:Check the price on Contra