import { Button, Shipment } from "@replicas/ui";

export default function ShipmentDemo() {
  return (
    <Shipment.Root status="shipped" style={{ width: "100%", maxWidth: 420 }}>
      <Shipment.Header>
        <Shipment.Logo>N</Shipment.Logo>
        <Shipment.Merchant>
          <Shipment.Name>Northwind Optics</Shipment.Name>
          <Shipment.Meta>northwind.shop · Order #10482</Shipment.Meta>
        </Shipment.Merchant>
      </Shipment.Header>
      <Shipment.Status>On the way</Shipment.Status>
      <Shipment.Arrival>Arrives Thursday, Mar 14</Shipment.Arrival>
      <Shipment.Item>Prime 35mm f/1.4 lens</Shipment.Item>
      <Shipment.Progress steps={["Ordered", "Shipped", "Out for delivery", "Delivered"]} current={1} />
      <Shipment.Actions>
        <Button size="small">
          Track package
        </Button>
      </Shipment.Actions>
    </Shipment.Root>
  );
}

Prompt

Copy Prompt hands your agent everything it needs to build the Shipment in the Notion style: the measured tokens, the CSS and the structure.

Show Prompt
# Notion Shipment

An order on its way, with the store, arrival, item and tracking progress.

Build a Shipment in this project that looks and behaves like Notion's. Measured from the running Notion app (notion.com). Keep every value exact. Map the tokens onto the project's own theme variables instead of hard-coding them. Use the project's own component library for behaviour, or Base UI primitives if it has none.

Fidelity: Concept, not a real feature. Designed from Notion's card surface, the avatar tile, select option tag colours and the blue accent. Concept. The track fills in blue up to the current step; delivered uses the green tag and delayed the yellow.

## Tokens

| Token | Light | Dark |
| --- | --- | --- |
| `--c-texPri` | `#2c2c2b` | `#f0efed` |
| `--c-texSec` | `#7d7a75` | `#ada9a3` |
| `--c-texTer` | `#a19e99` | `#7d7a75` |
| `--c-icoSec` | `#8e8b86` | `#ada9a3` |
| `--c-icoTer` | `#ada9a3` | `#7d7a75` |
| `--ca-borSecTra` | `#2a1c0012` | `#fffff315` |
| `--c-bacEle` | `#fff` | `#202020` |
| `--ca-avaBac` | `#37352f0f` | `#ffffff0e` |
| `--c-bluBacAccPri` | `#2783de` | `#2783de` |
| `--c-bluTexAccPri` | `#2783de` | `#2783de` |
| `--ca-bluBacSecTra` | `#007cd718` | `#439bff3d` |
| `--c-greTexAccPri` | `#46a171` | `#46a171` |
| `--c-yelTexAccPri` | `#d8a32f` | `#d8a32f` |
| `--tag-bg-default` | `#54483114` | `#373737` |
| `--tag-bg-yellow` | `#ecbf4263` | `#564328` |
| `--tag-bg-green` | `#7bb78145` | `#243d30` |
| `--tag-bg-blue` | `#5da5ce45` | `#143a4e` |
| `--tag-text` | `#32302c` | `#d3d3d3` |
| `--c-shaOutSm` | `0px 2px 4px 0px #0000000a, 0px 0px 0px 1px #2a1c0012` | `0px 0px 0px 1px #383836, 0px 2px 4px 0px #19191914` |
| `--font-size-mini` | `12px` | `12px` |
| `--font-size-small` | `14px` | `14px` |
| `--font-size-regular` | `16px` | `16px` |
| `--font-weight-medium` | `500` | `500` |
| `--font-weight-semibold` | `600` | `600` |
| `--radius-callout` | `8px` | `8px` |
| `--radius-menu` | `10px` | `10px` |
| `--radius-rounded` | `9999px` | `9999px` |
| `--duration-expand` | `200ms` | `200ms` |
| `--ease-expand` | `ease-in-out` | `ease-in-out` |

## CSS

Scoped under `[data-style="notion"]`; dark rules sit under `[data-theme="dark"]`. The `ui-*` classes and data attributes match the structure below.

```css
[data-style="notion"] {
  .ui-shipment {
    --shipment-status: var(--c-bluTexAccPri);
    --shipment-status-bg: var(--tag-bg-blue);

    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 14px;
    border-radius: var(--radius-menu);
    background-color: var(--c-bacEle);
    box-shadow: var(--c-shaOutSm);
    color: var(--c-texPri);
    font-family: inherit;
    font-size: var(--font-size-small);
    line-height: 20px;
  }

  .ui-shipment[data-status="ordered"] {
    --shipment-status: var(--c-icoSec);
    --shipment-status-bg: var(--tag-bg-default);
  }

  .ui-shipment[data-status="delivered"] {
    --shipment-status: var(--c-greTexAccPri);
    --shipment-status-bg: var(--tag-bg-green);
  }

  .ui-shipment[data-status="delayed"] {
    --shipment-status: var(--c-yelTexAccPri);
    --shipment-status-bg: var(--tag-bg-yellow);
  }

  .ui-shipment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin-bottom: 12px;
  }

  .ui-shipment-logo {
    box-sizing: border-box;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    overflow: hidden;
    border-radius: var(--radius-callout);
    background-color: var(--ca-avaBac);
    box-shadow: inset 0 0 0 1px var(--ca-borSecTra);
    color: var(--c-texSec);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-semibold);
    line-height: 20px;

    & :is(svg, img) {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  .ui-shipment-merchant {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
  }

  .ui-shipment-name {
    overflow: hidden;
    color: var(--c-texPri);
    font-weight: var(--font-weight-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ui-shipment-meta {
    overflow: hidden;
    color: var(--c-texSec);
    font-size: var(--font-size-mini);
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ui-shipment-status {
    box-sizing: border-box;
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 5px;
    height: 20px;
    margin-bottom: 4px;
    padding: 0 8px 0 7px;
    border-radius: var(--radius-rounded);
    background-color: var(--shipment-status-bg);
    color: var(--tag-text);
    font-size: var(--font-size-mini);
    line-height: 20px;
    white-space: nowrap;

    &::before {
      content: "";
      width: 6px;
      height: 6px;
      border-radius: var(--radius-rounded);
      background-color: var(--shipment-status);
    }
  }

  .ui-shipment-arrival {
    color: var(--c-texPri);
    font-size: var(--font-size-regular);
    font-weight: var(--font-weight-semibold);
    line-height: 24px;
  }

  .ui-shipment-item {
    color: var(--c-texSec);
  }

  .ui-shipment-progress {
    --shipment-steps: 4;

    position: relative;
    margin: 14px 0 2px;
  }

  .ui-shipment-progress:has(.ui-shipment-step:nth-child(2):last-child) {
    --shipment-steps: 2;
  }

  .ui-shipment-progress:has(.ui-shipment-step:nth-child(3):last-child) {
    --shipment-steps: 3;
  }

  .ui-shipment-progress:has(.ui-shipment-step:nth-child(5):last-child) {
    --shipment-steps: 5;
  }

  .ui-shipment-progress:has(.ui-shipment-step:nth-child(6):last-child) {
    --shipment-steps: 6;
  }

  .ui-shipment-track {
    position: absolute;
    top: 4px;
    right: calc(50% / var(--shipment-steps));
    left: calc(50% / var(--shipment-steps));
    height: 2px;
    overflow: hidden;
    border-radius: var(--radius-rounded);
    background-color: var(--ca-borSecTra);
  }

  .ui-shipment-fill {
    display: block;
    width: calc(var(--progress, 0) * 100%);
    height: 100%;
    border-radius: inherit;
    background-color: var(--c-bluBacAccPri);
    transition: width var(--duration-expand) var(--ease-expand);
  }

  .ui-shipment-steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--shipment-steps), minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .ui-shipment-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    text-align: center;
  }

  .ui-shipment-node {
    box-sizing: border-box;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-rounded);
    background-color: var(--c-bacEle);
    box-shadow: inset 0 0 0 1.5px var(--c-icoTer);
  }

  .ui-shipment-step:is([data-state="complete"], [data-state="current"]) .ui-shipment-node {
    background-color: var(--c-bluBacAccPri);
    box-shadow: none;
  }

  .ui-shipment-step[data-state="current"] .ui-shipment-node {
    box-shadow: 0 0 0 3px var(--ca-bluBacSecTra);
  }

  .ui-shipment-step-label {
    max-width: 100%;
    color: var(--c-texTer);
    font-size: var(--font-size-mini);
    line-height: 16px;
  }

  .ui-shipment-step[data-state="complete"] .ui-shipment-step-label {
    color: var(--c-texSec);
  }

  .ui-shipment-step[data-state="current"] .ui-shipment-step-label {
    color: var(--c-texPri);
    font-weight: var(--font-weight-medium);
  }

  .ui-shipment-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
  }

  @media (prefers-reduced-motion: reduce) {
    .ui-shipment-fill {
      transition: none;
    }
  }
}
```

## Structure

How Replicas assembles it on Base UI.

```tsx
import type { ComponentProps, CSSProperties, ReactNode } from "react";
import { join } from "./utils";

type RootProps = ComponentProps<"article"> & { status?: "ordered" | "shipped" | "out-for-delivery" | "delivered" | "delayed" };

function Root({ className, status, ...props }: RootProps) {
  return <article className={join("ui-shipment", className)} data-status={status} {...props} />;
}

const part = (name: string) =>
  function Part({ className, ...props }: ComponentProps<"div">) {
    return <div className={join(`ui-shipment-${name}`, className)} {...props} />;
  };

const text = (name: string) =>
  function Text({ className, ...props }: ComponentProps<"span">) {
    return <span className={join(`ui-shipment-${name}`, className)} {...props} />;
  };

type ProgressProps = Omit<ComponentProps<"div">, "children"> & { steps: ReactNode[]; current: number };

function Progress({ className, steps, current, style, ...props }: ProgressProps) {
  const last = Math.max(steps.length - 1, 1);
  return (
    <div
      className={join("ui-shipment-progress", className)}
      style={{ "--progress": Math.min(Math.max(current, 0), last) / last, ...style } as CSSProperties}
      {...props}
    >
      <span className="ui-shipment-track" aria-hidden>
        <span className="ui-shipment-fill" />
      </span>
      <ol className="ui-shipment-steps">
        {steps.map((step, index) => (
          <li
            key={`step-${index}`}
            className="ui-shipment-step"
            data-state={index < current ? "complete" : index === current ? "current" : "upcoming"}
            aria-current={index === current ? "step" : undefined}
          >
            <span className="ui-shipment-node" aria-hidden />
            <span className="ui-shipment-step-label">{step}</span>
          </li>
        ))}
      </ol>
    </div>
  );
}

export const Shipment = {
  Root,
  Header: part("header"),
  Logo: text("logo"),
  Merchant: part("merchant"),
  Name: text("name"),
  Meta: text("meta"),
  Status: text("status"),
  Arrival: text("arrival"),
  Item: text("item"),
  Progress,
  Actions: part("actions"),
};
```

## Example

```tsx
import { Button, Shipment } from "@replicas/ui";

export default function ShipmentDemo() {
  return (
    <Shipment.Root status="shipped" style={{ width: "100%", maxWidth: 420 }}>
      <Shipment.Header>
        <Shipment.Logo>N</Shipment.Logo>
        <Shipment.Merchant>
          <Shipment.Name>Northwind Optics</Shipment.Name>
          <Shipment.Meta>northwind.shop · Order #10482</Shipment.Meta>
        </Shipment.Merchant>
      </Shipment.Header>
      <Shipment.Status>On the way</Shipment.Status>
      <Shipment.Arrival>Arrives Thursday, Mar 14</Shipment.Arrival>
      <Shipment.Item>Prime 35mm f/1.4 lens</Shipment.Item>
      <Shipment.Progress steps={["Ordered", "Shipped", "Out for delivery", "Delivered"]} current={1} />
      <Shipment.Actions>
        <Button size="small">
          Track package
        </Button>
      </Shipment.Actions>
    </Shipment.Root>
  );
}
```

## Foundations

The rest of the Notion style, as a skill: https://replicas.raphaelsalaja.com/skills/notion/SKILL.md