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.
| Key | English | Arabic |
|---|---|---|
reference | Reference | الرقم |
brand | Brand | البراند |
for | For | لـ |
claimed | Units claimed | الوحدات المتبلّغ عنها |
confirmed | Units confirmed | الوحدات المتأكدة |
status | Status | الحالة |
sentOn | Sent {d} | اتبعت {d} |
stockUsed | Stock used | المستخدم من المخزون |
sent | Sent | اتبعت |
delivered | Delivered | اتسلم |
receivedVsClaimed | Received vs claimed | اللي وصل قصاد اللي اتقال |
state | State | الوضع |
ofTotal | {used} of {total} units used | {used} من {total} وحدة اتستخدمت |
claimsLabel | Gift stock claims | شحنات الهدايا |
byBrandLabel | Gift stock by brand | مخزون الهدايا لكل براند |
says | What {b} says it sent | {b} بيقول بعت إيه |
saysVs | What {b} says it sent vs what arrived | {b} بيقول بعت إيه قصاد اللي وصل |
product | Product | المنتج |
brandSays | Brand says sent | البراند بيقول بعت |
inFull | Arrived in full? | وصل كامل؟ |
good | Good | سليم |
damaged | Damaged | تالف |
missing | Missing | ناقص |
extra | +{n} extra | +{n} زيادة |
allOk | All {n} OK | الـ {n} كلهم تمام |
goodHint | Count | اعدّ |
goodOf | Good units of {p} | الوحدات السليمة من {p} |
damagedOf | Damaged units of {p} | الوحدات التالفة من {p} |
check | Check what arrived · {n} product | راجع اللي وصل · {n} منتج |
tickAll | Tick all as received in full | علّم على الكل إنه وصل كامل |
howTo | Tick 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}. |
boxes | Boxes received | الكراتين اللي وصلت |
brandSaid | {b} said {n} | {b} قال {n} |
confirm | Confirm received quantities | أكّد الكميات اللي وصلت |
confirming | Confirming… | بنأكّد… |
boxesErr | Boxes received must be a whole number from 1 to 99. | عدد الكراتين لازم يكون رقم صحيح من 1 لـ 99. |
unitsErr | Enter the good and damaged units for every product (whole numbers, 0 or more). | اكتب الوحدات السليمة والتالفة لكل منتج (أرقام صحيحة، 0 أو أكتر). |
difference | You 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} بيشوف الفرق ويقدر يبلّغ عن مشكلة. |
matched | All {good} units matched the claim and are in {b}'s gift stock. | الـ {good} وحدة طابقوا اللي اتقال ودخلوا مخزون هدايا {b}. |
problem | {b} reported a problem ({d}) | {b} بلّغ عن مشكلة ({d}) |
keep | Keep the count | سيب العدد زي ما هو |
recount | Recount | اعد العد |
cancelled | This claim was cancelled. Nothing was added to gift stock. | الشحنة دي اتلغت. مفيش حاجة اتضافت للمخزون. |
shipments | Shipments 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
- Card:
<section class="kit-card kit-pr-ship">labelled by its title. - Head:
h2"Shipments from brands" (ortitle). - List: one
<li>per entry,PrStatusPillat the start and the count bold at the end, 8px padding, top rules. - Note: "1 problem report open" / "{n} problem reports open", 12.5px muted.
Variants
| Prop | Effect |
|---|---|
counts order | The rows' order (the mock: Expected, Arrived, Confirmed, Confirmed with difference) |
title | Replaces 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
GiftShipmentCountsversion.
Guidelines
Do
- Count shipments, in the mock's order.
- Use it only where you also use
giftAnalyticsColumns/giftClaimColumns.
Don't
- Don't wrap it in another Card (it is one).
- Don't use both this and
GiftShipmentCountson 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 anh2heading, 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
--inkon white (18.4:1); the note is--ink-3on white (5.1:1); pills asPrStatusPill(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.
Related
GiftShipmentCounts: its replacement, body-only.GiftClaimCheck: the claim page of the same API family.
See also: Banner · Button · DataTable · FormField · useLanguage · BrandCell · PrStatusPill · BrandGiftStockCard · GiftAttentionList · GiftShipmentCard
Source
src/pr/gifts/GiftClaims.tsx (line 201) on GitHub.