Skip to Content
BBRICKSv0.7.4
PR PortalGifts

ShipmentSummary

The Gift analytics "Shipments from brands" card: each claim status as its pill and how many claims have it, then open problem reports.

Deprecated

Since 0.7.0: use GiftShipmentCounts (counts as a record) inside a Card, the 0.4.0 gift family. Kept working; removed in 1.0.

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

Examples

Shipments from brands

Deprecated since 0.7.0: use GiftShipmentCounts (counts as a record) inside a Card; this card keeps working. How many claims are in each status, as on Gift analytics, then the open problem reports.

Code
import { ShipmentSummary } from '@ergasti/bricks';

function Summary() {
  return (
    <div style={{ maxWidth: 440 }}>
      <ShipmentSummary
        counts={[{ status: 'gift_expected', count: 3 }, { status: 'gift_arrived', count: 2 }, { status: 'gift_confirmed', count: 1 }, { status: 'gift_confirmed_diff', count: 1 }]}
        problems={1}
      />
    </div>
  );
}

Nothing yet

No claims in a status shows 0 next to its pill, and no open reports reads "0 problem reports open".

Code
import { ShipmentSummary } from '@ergasti/bricks';

function Empty() {
  return (
    <div style={{ maxWidth: 440 }}>
      <ShipmentSummary counts={[{ status: 'gift_expected', count: 0 }, { status: 'gift_arrived', count: 0 }, { status: 'gift_confirmed', count: 0 }, { status: 'gift_confirmed_diff', count: 0 }]} />
    </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 prGifts, or with the component's own prop where it has one. A {name} is a value the component fills in.

prGifts
KeyEnglishArabic
referenceReferenceالرقم
brandBrandالبراند
forForلـ
claimedUnits claimedالوحدات المتبلّغ عنها
confirmedUnits confirmedالوحدات المتأكدة
statusStatusالحالة
sentOnSent {d}اتبعت {d}
stockUsedStock usedالمستخدم من المخزون
sentSentاتبعت
deliveredDeliveredاتسلم
receivedVsClaimedReceived vs claimedاللي وصل قصاد اللي اتقال
stateStateالوضع
ofTotal{used} of {total} units used{used} من {total} وحدة اتستخدمت
claimsLabelGift stock claimsشحنات الهدايا
byBrandLabelGift stock by brandمخزون الهدايا لكل براند
saysWhat {b} says it sent{b} بيقول بعت إيه
saysVsWhat {b} says it sent vs what arrived{b} بيقول بعت إيه قصاد اللي وصل
productProductالمنتج
brandSaysBrand says sentالبراند بيقول بعت
inFullArrived in full?وصل كامل؟
goodGoodسليم
damagedDamagedتالف
missingMissingناقص
extra+{n} extra+{n} زيادة
allOkAll {n} OKالـ {n} كلهم تمام
goodHintCountاعدّ
goodOfGood units of {p}الوحدات السليمة من {p}
damagedOfDamaged units of {p}الوحدات التالفة من {p}
checkCheck what arrived · {n} productراجع اللي وصل · {n} منتج
tickAllTick all as received in fullعلّم على الكل إنه وصل كامل
howToTick each product that arrived in full and undamaged. If a count is off, leave it unticked and enter the good and damaged units you actually received. Units that can't be gifted go under Damaged. Only good units go into {b}'s gift stock.علّم على كل منتج وصل كامل ومن غير تلف. لو العدد مش مظبوط، سيبه من غير علامة واكتب الوحدات السليمة والتالفة اللي وصلت فعلًا. الوحدات اللي متنفعش هدية تتكتب تحت تالف. الوحدات السليمة بس هي اللي بتدخل مخزون هدايا {b}.
boxesBoxes receivedالكراتين اللي وصلت
brandSaid{b} said {n}{b} قال {n}
confirmConfirm received quantitiesأكّد الكميات اللي وصلت
confirmingConfirming…بنأكّد…
boxesErrBoxes received must be a whole number from 1 to 99.عدد الكراتين لازم يكون رقم صحيح من 1 لـ 99.
unitsErrEnter the good and damaged units for every product (whole numbers, 0 or more).اكتب الوحدات السليمة والتالفة لكل منتج (أرقام صحيحة، 0 أو أكتر).
differenceYou confirmed {good} of the {claimed} units {b} claimed. Only {good} are in stock. {b} sees the difference and can report a problem.أكّدت {good} من الـ {claimed} وحدة اللي {b} قال عليها. {good} بس اللي في المخزون. {b} بيشوف الفرق ويقدر يبلّغ عن مشكلة.
matchedAll {good} units matched the claim and are in {b}'s gift stock.الـ {good} وحدة طابقوا اللي اتقال ودخلوا مخزون هدايا {b}.
problem{b} reported a problem ({d}){b} بلّغ عن مشكلة ({d})
keepKeep the countسيب العدد زي ما هو
recountRecountاعد العد
cancelledThis claim was cancelled. Nothing was added to gift stock.الشحنة دي اتلغت. مفيش حاجة اتضافت للمخزون.
shipmentsShipments from brandsالشحنات من البراندات
problems{n} problem report open{n} بلاغ مشكلة مفتوح

Design guidance

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

Deprecated since 0.7.0. Use GiftShipmentCounts inside a Card with a title (MIGRATION.md part 11). It keeps working until 1.0.

A self-contained "Shipments from brands" card: each gift claim status with its pill and count, then the open problem reports; use it on Gift analytics when the screen uses the gift claim API family.

ShipmentSummary is the fidelity branch's alternate of GiftShipmentCounts. Unlike that body-only block, it draws its own card and heading, takes counts as an ordered list of { status, count }, and always shows the problem line (0 by default). For a new screen use GiftShipmentCounts inside your own Card.

Anatomy

  1. Card: <section class="kit-card kit-pr-ship"> labelled by its title.
  2. Head: h2 "Shipments from brands" (or title).
  3. List: one <li> per entry, PrStatusPill at the start and the count bold at the end, 8px padding, top rules.
  4. Note: "1 problem report open" / "{n} problem reports open", 12.5px muted.

Variants

PropEffect
counts orderThe rows' order (the mock: Expected, Arrived, Confirmed, Confirmed with difference)
titleReplaces the heading and the region's name

States

Static. problems 0 reads "0 problem reports open".

Usage

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

<ShipmentSummary
  counts={[
    { status: 'gift_expected', count: 3 },
    { status: 'gift_arrived', count: 2 },
    { status: 'gift_confirmed', count: 1 },
    { status: 'gift_confirmed_diff', count: 1 },
  ]}
  problems={1}
/>
// Gift analytics (fidelity): By brand table and the side card
<div style={{ display: 'grid', gridTemplateColumns: '2fr 1fr', gap: 16 }}>
  <Card title="By brand"><DataTable label="Gift stock by brand" rows={stock} rowKey={(r) => r.id} columns={giftAnalyticsColumns('en')} /></Card>
  <ShipmentSummary counts={byStatus} problems={openReports} />
</div>

Nothing yet. No claims in a status shows 0 next to its pill, and no open reports reads "0 problem reports open". (docs example Empty)

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

export function Empty() {
  return (
    <div style={{ maxWidth: 440 }}>
      <ShipmentSummary counts={[{ status: 'gift_expected', count: 0 }, { status: 'gift_arrived', count: 0 }, { status: 'gift_confirmed', count: 0 }, { status: 'gift_confirmed_diff', count: 0 }]} />
    </div>
  );
}

Where it appears

  • PR Portal › Gift analytics › "Shipments from brands" (fidelity compositions).
  • Dashboard screen: PrGiftAnalytics shows the primary GiftShipmentCounts version.

Guidelines

Do

Don't

  • Don't wrap it in another Card (it is one).
  • Don't use both this and GiftShipmentCounts on one page.

RTL and Arabic

Rows mirror. Arabic: "الشحنات من البراندات", "{n} بلاغات مشاكل مفتوحة" / "بلاغ مشكلة مفتوح".

Tokens

--line, --ink-3, card tokens, PrStatusPill tones.

Accessibility

  • Role: a <section> region named by its title (aria-label, "Shipments from brands"), with an h2 heading, a plain <ul> of rows and a <p> note. Nothing in it is focusable; it adds no tab stops.
  • Reading order: heading, then each row as "status word, count", then "1 problem report open".
  • Text alternative: every row's status is a word in a pill and the count is text; no meaning is carried by colour alone.
  • Changes: counts do not announce updates; the card is a summary read on page load.
  • Contrast: counts are --ink on white (18.4:1); the note is --ink-3 on white (5.1:1); pills as PrStatusPill (Expected 7.0:1, Confirmed 4.6:1, Confirmed with difference 6.0:1; Arrived is lilac ink on lilac).

Found in the source

  • Roles in the markup: alert.
  • ARIA attributes set: aria-hidden, aria-label, aria-invalid.

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

See also: Banner · Button · DataTable · FormField · useLanguage · BrandCell · PrStatusPill · BrandGiftStockCard · GiftAttentionList · GiftShipmentCard

Source

src/pr/gifts/GiftClaims.tsx (line 201) on GitHub.

On this page