Skip to Content
BBRICKSv0.7.4
PR PortalForms and dialogs

DecisionsCard

The PR mock's sidebar card "Open decisions": the codes of the product decisions still open as small butter pills (each with its question as the tooltip and in the accessible name), and a switch that shows or hides the inline DecisionTags across the screens. Sits in AppShell's sidebarCard slot (a SidebarCard, so it hides on the icon rail).

import { DecisionsCard } from '@ergasti/bricks';

Examples

Open decisions

DecisionsCard sits in AppShell's sidebarCard slot: the open codes (each one's question is its tooltip) and a switch. The app keeps the switch's state and hands it to a DecisionTagsProvider around the page, so every inline DecisionTag shows or hides with it. variant="open" is the "Open · R10" pill that always shows, in place of a value nobody has decided.

Code
import { useState } from 'react';
import { Card, DecisionTag, DecisionTagsProvider, DecisionsCard } from '@ergasti/bricks';

const OPEN = [
  { id: 'C3', question: 'Can a brand opt out of a TRNDR-wide challenge?' },
  { id: 'R10', question: 'What a tier gives creators' },
  { id: 'S4', question: 'Can PR add or remove tiers?' },
  { id: 'T4', question: 'When challenge rewards are paid' },
  { id: 'GS1', question: 'Damaged or extra units: brand collects within 14 days?' },
  { id: 'GS2', question: 'Can PR launch a gift challenge with fewer gifts than planned?' },
];

function Sidebar() {
  const [show, setShow] = useState(true);
  return (
    <DecisionTagsProvider visible={show}>
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(248px, 1fr))', gap: 16, alignItems: 'start' }}>
        <div style={{ maxWidth: 248, padding: 14, borderRadius: 18, background: '#141414' }}>
          <DecisionsCard decisions={OPEN} showTags={show} onShowTagsChange={setShow} />
        </div>
        <Card>
          <Card.Header title={<>Needs you<DecisionTag id="S12" /></>} sub="Most urgent first" />
          <p style={{ margin: 0 }}>Affiliate program<DecisionTag id="P6" question="Who can change a program?" /></p>
          <p>What creators get: <DecisionTag id="R10" question="What a tier gives creators" variant="open" /></p>
        </Card>
      </div>
    </DecisionTagsProvider>
  );
}

Codes you can focus

tip="focus" makes each code a tab stop that shows its question in its own tooltip on hover and keyboard focus (Escape hides it), so keyboard users can read it too. The default 'title' uses the browser's tooltip, which only a mouse shows.

Code
import { useState } from 'react';
import { DecisionsCard } from '@ergasti/bricks';

const OPEN = [
  { id: 'C3', question: 'Can a brand opt out of a TRNDR-wide challenge?' },
  { id: 'R10', question: 'What a tier gives creators' },
  { id: 'S4', question: 'Can PR add or remove tiers?' },
  { id: 'T4', question: 'When challenge rewards are paid' },
  { id: 'GS1', question: 'Damaged or extra units: brand collects within 14 days?' },
  { id: 'GS2', question: 'Can PR launch a gift challenge with fewer gifts than planned?' },
];

function FocusTips() {
  const [show, setShow] = useState(false);
  return (
    <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(248px, 1fr))', gap: 16, alignItems: 'start' }}>
      {(['title', 'focus'] as const).map((tip) => (
        <div key={tip} style={{ maxWidth: 248, padding: 14, borderRadius: 18, background: '#141414' }}>
          <DecisionsCard decisions={OPEN.slice(0, 4)} tip={tip} showTags={show} onShowTagsChange={setShow} />
        </div>
      ))}
    </div>
  );
}

Props

Prop

Type

Labels

Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the key prDecisionsCard, or with the component's own prop where it has one. A {name} is a value the component fills in.

prDecisionsCard
KeyEnglishArabic
titleOpen decisionsقرارات مفتوحة
showShow decision tagsاعرض علامات القرارات
noneNothing open.مفيش حاجة مفتوحة.

Design guidance

How the BRICKS design system uses DecisionsCard. Written in docs/content/components/DecisionsCard.md; the props above are read from the code, which wins where the two disagree.

The PR sidebar's "Open decisions" card: the codes of the product decisions still open as small butter pills, and a "Show decision tags" switch that shows or hides the inline DecisionTags across every screen; use it in AppShell's sidebar card slot.

Design-review aid. Remove before release; never shown to brands. It marks open product decisions while the v3 design is being reviewed; a production build ships without it.

DecisionsCard is the PR mock v3's sidebar card. Each code's question is its tooltip and part of its accessible name; with tip="focus" every code is a tab stop with its own tooltip, so keyboard and touch users can read it too. The app keeps the switch's state and passes it to a DecisionTagsProvider around the page. It is a SidebarCard, so it hides on the icon rail.

Anatomy

  1. SidebarCard: dark sidebar card with the heading "Open decisions" (or title).
  2. Codes: a <ul> labelled by the heading, wrapping butter pills 5px apart ("C3", "R10", "GS1"); with tip="focus" each code is focusable with a tooltip.
  3. Empty: "Nothing open."
  4. Switch (with onShowTagsChange): "Show decision tags" label and a kit Switch.

Variants

PropValueEffect
tiptitle (default)Browser tooltips; question read after the code
focusFocusable codes with their own tooltips (Escape hides)
onShowTagsChangeomittedNo switch

States

StateTrigger
Codesdecisions non-empty
Nothing opendecisions=[]
Tags on / offshowTags
Code focusedtip="focus": focus ring and tooltip

Types

OpenDecision (decisions): { id, question? } in display order.

Usage

import { useState } from 'react';
import { Card, DecisionTag, DecisionTagsProvider, DecisionsCard } from '@ergasti/bricks';

const OPEN = [
  { id: 'C3', question: 'Can a brand opt out of a TRNDR-wide challenge?' },
  { id: 'R10', question: 'What a tier gives creators' },
  { id: 'S4', question: 'Can PR add or remove tiers?' },
  { id: 'GS1', question: 'Damaged or extra units: brand collects within 14 days?' },
];

export function Sidebar() {
  const [show, setShow] = useState(true);
  return (
    <DecisionTagsProvider visible={show}>
      <div style={{ maxWidth: 248, padding: 14, borderRadius: 18, background: '#141414' }}>
        <DecisionsCard decisions={OPEN} showTags={show} onShowTagsChange={setShow} />
      </div>
      <Card>
        <Card.Header title={<>Needs you<DecisionTag id="S12" /></>} sub="Most urgent first" />
      </Card>
    </DecisionTagsProvider>
  );
}
// In the app shell, with focusable codes
<AppShell
  brand={{ name: <>TRNDR<span className="kit-shell-accent">.</span></>, label: 'TRNDR', tagline: 'PR Portal' }}
  nav={prNav}
  activeId="home"
  onNavigate={go}
  sidebarCard={<DecisionsCard decisions={openDecisions} tip="focus" showTags={showTags} onShowTagsChange={setShowTags} />}
>
  {page}
</AppShell>

Where it appears

  • PR Portal › every page › sidebar, under the nav ("Open decisions" with the switch).
  • Dashboard screen: PrHome ("Queue tiles, needs-attention rows, decisions").

Guidelines

Do

  • Wrap the whole app in DecisionTagsProvider with the switch's state.
  • Use tip="focus" so keyboard users can read the questions.

Don't

  • Don't ship it: it is a design-review aid; remove it before release, and never show it to brands.
  • Don't list closed decisions.

RTL and Arabic

Mirrors with the sidebar; codes stay Latin; tooltips dir="auto".

Tokens

--butter, --butter-ink, --focus-ring, --min-touch-target, plus SidebarCard and Switch tokens.

Accessibility

A labelled list of codes with their questions (tooltip and hidden text, or described-by tooltips with tip="focus"); a labelled switch; focus rings and 44px targets (touch tiers, ≤1024px) on focusable codes.

Found in the source

  • Roles in the markup: tooltip.
  • ARIA attributes set: aria-labelledby, aria-describedby.

Read from the component's source and tests. See Accessibility for the patterns the library follows.

See also: Switch · useLanguage · Sidebar · Card · BulkAction · ChangePreview · ChoiceGroup · FigureRow

Source

src/pr/decisions/DecisionsCard.tsx (line 49) on GitHub.

On this page