Skip to Content
BBRICKSv0.7.4
PR PortalAudit log

AuditLogEntry

One audit log entry (the mock's .logi and the Activity log's first column): a coloured dot, what happened over why, then (unless compact, the brand page's "Recent activity") the area pill, who and when. A list item; put entries in <ul className="kit-pr-log">. dot={false} drops the dot (the PR mock's brand page "Recent activity").

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

Examples

Audit log

Who did what and when, with a tone dot and the area it touched; compact is the short form for a side card.

Code
import { AuditLogList, Card } from '@ergasti/bricks';
import { auditEntries } from './pr';

function Log() {
  return (
    <div style={{ display: 'grid', gap: 16 }}>
      <Card><AuditLogList label="Recent activity" entries={auditEntries} /></Card>
      <Card><AuditLogList label="Recent activity" entries={auditEntries.slice(0, 2)} compact /></Card>
    </div>
  );
}

One entry and the area pill

Code
import { AuditAreaPill, AuditLogEntry } from '@ergasti/bricks';
import { auditEntries } from './pr';

function Single() {
  return (
    <div style={{ display: 'grid', gap: 12 }}>
      <AuditLogEntry entry={auditEntries[0]} />
      <div style={{ display: 'flex', gap: 8 }}>{(['approvals', 'programs', 'owners'] as const).map((area) => <AuditAreaPill key={area} area={area} />)}</div>
    </div>
  );
}

No activity yet

The list draws only its entries; with none, show PrEmpty in its place. compact on a single AuditLogEntry is the short side-card form.

Code
import { AuditLogEntry, AuditLogList, Card, PrEmpty } from '@ergasti/bricks';
import { auditEntries } from './pr';

function Empty() {
  const entries: typeof auditEntries = [];
  return (
    <div style={{ display: 'grid', gap: 16 }}>
      <Card>{entries.length ? <AuditLogList label="Recent activity" entries={entries} /> : <PrEmpty title="No activity yet" text="Approvals, edits and payouts show up here as they happen." icon="log" tone="sky" />}</Card>
      <Card><AuditLogEntry entry={auditEntries[1]} compact /></Card>
    </div>
  );
}

Without the dot

dot={false} drops the coloured dot so the text starts at the card's edge; with compact the rows take plain 6px padding and the time sits right under the text (the PR brand page's "Recent activity" side card). Keep the dot (default true) on the full Activity log, where the colour helps scan outcomes. Default on the left, no dot on the right.

Code
import { AuditLogList, Card } from '@ergasti/bricks';
import { auditEntries } from './pr';

function NoDot() {
  return (
    <div style={{ display: 'grid', gap: 16, gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))' }}>
      <Card><AuditLogList label="Recent activity, with dots" entries={auditEntries.slice(0, 3)} compact /></Card>
      <Card><AuditLogList label="Recent activity" entries={auditEntries.slice(0, 3)} compact dot={false} /></Card>
    </div>
  );
}

One entry without the dot

AuditLogEntry takes dot too, for a single line in a card of its own.

Code
import { AuditLogEntry, Card } from '@ergasti/bricks';
import { auditEntries } from './pr';

function SingleNoDot() {
  return (
    <Card>
      <ul className="kit-pr-log" aria-label="Last change">
        <AuditLogEntry entry={auditEntries[1]} compact dot={false} />
      </ul>
    </Card>
  );
}

Props

Prop

Type

Design guidance

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

One audit log entry: a coloured dot for the outcome, what happened over why, then the area pill, who did it and when; use it as a list item inside AuditLogList (or <ul className="kit-pr-log">).

It is the PR mock's .logi. compact is the brand page's "Recent activity" form (no area or actor, the time under the text); dot={false} drops the dot so the text starts at the edge.

Anatomy

  1. Row (<li class="kit-pr-logi">): grid 14px | 1fr | auto, 14px padding, bottom border (none on the last).
  2. Dot (.kit-pr-dot--{tone}, 10px, aria-hidden).
  3. Text (.kit-pr-logi-t): the sentence (names may be bold), then the muted detail; in compact, the muted time.
  4. Meta (.kit-pr-logi-m, full only): AuditAreaPill, the actor (small avatar + name), the <time>; wraps under the text on narrow widths.

Variants

entry.toneDotUse for
'ok'--okApprovals, payouts sent.
'rasp'--raspMoney changes (commission).
'bad'--badRejections, removals.
'sky'--sky-inkMoves, owner changes.
'lilac'--lilac-inkTier moves, messages.
'butter'--butter-inkWarnings.
PropLook
compactTwo columns, 8px rows, no border, time under the text, 13px.
dot={false}No dot; with compact, plain 6px rows.

States

Static. Long sentences wrap.

Types

AuditEntry (entry): { id, tone, text, detail?, area?, actor: PrPerson, when }; when is pre-formatted ("Today · 10:12"). tone: 'ok' | 'rasp' | 'bad' | 'sky' | 'lilac' | 'butter'.

Usage

<ul className="kit-pr-log">
  <AuditLogEntry entry={{
    id: 2, tone: 'rasp',
    text: <>Mona changed Glow Lab commission <b>8% of sale → 10% of sale</b></>,
    detail: 'Brand notified. Applies to new orders.',
    area: 'programs', actor: { name: 'Mona', seed: 0 }, when: 'Today · 09:30',
  }} />
</ul>
<Card><AuditLogEntry entry={entries[1]} compact /></Card>

Where it appears

  • PR Portal › Activity log (each row's first column). Screen: PR · Activity log.
  • PR Portal › Brand detail › "Recent activity" (compact, no dot). Screen: PR · Brand.
  • PR Portal › Tiers › manual changes.

Guidelines

Do

  • Write text as "{who} {did what} {to what}" with the changed value in bold; put the reason or effect in detail.
  • Pick the tone by outcome, consistently.

Don't

  • Don't format when inside the component; pass it formatted.
  • Don't put links or buttons in text.

RTL and Arabic

  • Dot and text on the right, meta on the left; mixed Arabic/Latin sentences rely on isolation of names you pass (wrap Latin names in <bdi> if needed).

Tokens

--line, --ok, --rasp, --bad, --sky-ink, --lilac-ink, --butter-ink, --ink-3.

Accessibility

  • <li>; the dot is aria-hidden (the sentence says the outcome); time is a <time> with dir="auto".

Found in the source

  • ARIA attributes set: aria-hidden, aria-label.

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

See also: Avatar · Pill · useBricks · useLanguage · Card · PrEmpty

Source

src/pr/AuditLog.tsx (line 43) on GitHub.

On this page