{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-order-detail",
  "type": "registry:block",
  "title": "Order detail",
  "description": "One order on a raised page: its items and totals and the delivery timeline, each in a bordered card, the customer and addresses beside them, and refunding it from the header.",
  "dependencies": [
    "@remixicon/react@^4.9.0"
  ],
  "registryDependencies": [
    "https://wideset.co/r/app-shell.json",
    "https://wideset.co/r/avatar.json",
    "https://wideset.co/r/block-styles.json",
    "https://wideset.co/r/breadcrumbs.json",
    "https://wideset.co/r/button.json",
    "https://wideset.co/r/card.json",
    "https://wideset.co/r/divider.json",
    "https://wideset.co/r/dropdown-menu.json",
    "https://wideset.co/r/form-field.json",
    "https://wideset.co/r/icon-button.json",
    "https://wideset.co/r/link-button.json",
    "https://wideset.co/r/list-item.json",
    "https://wideset.co/r/modal.json",
    "https://wideset.co/r/select.json",
    "https://wideset.co/r/sidebar.json",
    "https://wideset.co/r/status-badge.json",
    "https://wideset.co/r/table.json",
    "https://wideset.co/r/text-input.json",
    "https://wideset.co/r/toast.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/order-detail/address.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/address.tsx",
      "content": "'use client';\n\n// TODO(custom): postal address (its lines one under another); no Address or DescriptionList in Wideset.\n\n/** An address as it is written on a parcel: one line under another, the name first. */\nexport function Address({ lines }: { lines: string[] }) {\n  return (\n    <address className=\"typography-body-md text-ws-static-base not-italic\">\n      {lines.map((line) => (\n        <span key={line} className=\"block\">\n          {line}\n        </span>\n      ))}\n    </address>\n  );\n}\n"
    },
    {
      "path": "src/blocks/order-detail/brand-mark.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/brand-mark.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nconst TILE =\n  'M0 16C0 8.45753 0 4.68629 2.34315 2.34315C4.68629 0 8.45753 0 16 0C23.5425 0 27.3137 0 29.6569 2.34315C32 4.68629 32 8.45753 32 16C32 23.5425 32 27.3137 29.6569 29.6569C27.3137 32 23.5425 32 16 32C8.45753 32 4.68629 32 2.34315 29.6569C0 27.3137 0 23.5425 0 16Z';\n\n/**\n * Orbit's mark: a planet and its ring on the inverse tile, so it inverts in dark mode. It takes\n * the size of its place (32px in a sidebar, 36px in a larger switcher). Decorative beside the\n * product's name; give it a `label` when it stands alone.\n */\nexport function BrandMark({ className, label }: { className?: string; label?: string }) {\n  return (\n    <svg\n      viewBox=\"0 0 32 32\"\n      role={label ? 'img' : undefined}\n      aria-label={label}\n      aria-hidden={label ? undefined : true}\n      className={cn('size-ws-14 shrink-0', className)}\n    >\n      <path d={TILE} className=\"fill-(--ws-static-fill-inverse-background)\" />\n      <ellipse\n        cx=\"16\"\n        cy=\"16\"\n        rx=\"10.5\"\n        ry=\"4\"\n        transform=\"rotate(-28 16 16)\"\n        strokeWidth=\"1.75\"\n        className=\"fill-none stroke-(--ws-static-text-inverse-strong)\"\n      />\n      <circle cx=\"16\" cy=\"16\" r=\"4.75\" className=\"fill-(--ws-static-text-inverse-strong)\" />\n    </svg>\n  );\n}\n"
    },
    {
      "path": "src/blocks/order-detail/customer-summary.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/customer-summary.tsx",
      "content": "'use client';\n\n// TODO(custom): customer summary (the company, the person who ordered, the way to the customer); ListItem always looks clickable.\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\nimport { LinkButton } from '@/components/ui/wideset/button/LinkButton';\n\nimport { customer } from './data';\nimport { formatMonth } from './format';\n\n/**\n * Who bought: the company first, then the person who placed the order and how to reach them.\n * The one link leads to the customer's own page; the contact lines stay text to copy.\n */\nexport function CustomerSummary() {\n  const { contact } = customer;\n\n  return (\n    <div className=\"gap-ws-9 flex flex-col\">\n      <div className=\"gap-ws-7 flex items-center\">\n        <Avatar shape=\"square\" initials={customer.initials} aria-hidden=\"true\" />\n        <div className=\"flex min-w-0 flex-col\">\n          <span className=\"typography-label-strong-sm text-ws-static-strong truncate\">\n            {customer.name}\n          </span>\n          <span className=\"typography-caption-md text-ws-static-subtle truncate\">\n            Customer since {formatMonth(customer.since)}\n          </span>\n        </div>\n      </div>\n      <div className=\"gap-ws-3 flex flex-col items-start\">\n        <p className=\"typography-body-md text-ws-static-base flex max-w-full flex-col\">\n          <span>\n            {contact.name}, {contact.role.toLowerCase()}\n          </span>\n          <span className=\"truncate\">{contact.email}</span>\n          <span className=\"tabular-nums\">{contact.phone}</span>\n        </p>\n        {/* Pulled left by its own padding, so its words start on the column's edge. */}\n        <LinkButton href={`#customer-${customer.id}`} className=\"-ml-ws-6\">\n          View customer\n        </LinkButton>\n      </div>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/order-detail/data.ts",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/data.ts",
      "content": "import {\n  type RemixiconComponentType,\n  RiBankCardLine,\n  RiContactsBook3Line,\n  RiHandCoinLine,\n  RiHome5Line,\n  RiInbox2Line,\n  RiKey2Line,\n  RiLineChartLine,\n  RiPieChart2Line,\n  RiPlugLine,\n  RiQuestionLine,\n  RiSettings3Line,\n  RiShoppingBag3Fill,\n  RiShoppingBag3Line,\n  RiTeamLine,\n} from '@remixicon/react';\n\n/*\n  One order from the Orders list: #6178, placed by Marlow & Finch on Thursday 5 November 2026 to\n  fit out two meeting rooms: two hubs, two cameras and the onboarding package. Lumen Studio Ltd\n  and Marlow & Finch are both UK businesses, so the order carries 20% VAT. The hardware left the\n  warehouse on Friday with Northline, crossed the weekend, and is on the van today, 10 November.\n  Money is kept in whole cents and every total is worked out from the lines.\n*/\n\n/** The product is Orbit; the workspace selling through it is Lumen Studio. */\nexport const product = { name: 'Orbit' };\nexport const workspace = { name: 'Lumen Studio', initials: 'LS' };\nexport const account = { name: 'Maya Okafor', email: 'maya@lumenstudio.co', initials: 'MO' };\n\nexport type NavLink = {\n  id: string;\n  label: string;\n  icon: RemixiconComponentType;\n  /** The icon while the page is open (a line icon swaps for its fill). */\n  activeIcon?: RemixiconComponentType;\n};\n\nexport const mainLinks: NavLink[] = [\n  { id: 'home', label: 'Home', icon: RiHome5Line },\n  { id: 'inbox', label: 'Inbox', icon: RiInbox2Line },\n  { id: 'customers', label: 'Customers', icon: RiContactsBook3Line },\n  { id: 'deals', label: 'Deals', icon: RiHandCoinLine },\n  { id: 'orders', label: 'Orders', icon: RiShoppingBag3Line, activeIcon: RiShoppingBag3Fill },\n  { id: 'revenue', label: 'Revenue', icon: RiLineChartLine },\n  { id: 'reports', label: 'Reports', icon: RiPieChart2Line },\n];\n\nexport const settingsLinks: NavLink[] = [\n  { id: 'general', label: 'General', icon: RiSettings3Line },\n  { id: 'members', label: 'Members', icon: RiTeamLine },\n  { id: 'billing', label: 'Billing', icon: RiBankCardLine },\n  { id: 'integrations', label: 'Integrations', icon: RiPlugLine },\n  { id: 'api-keys', label: 'API keys', icon: RiKey2Line },\n];\n\nexport const helpLink: NavLink = { id: 'help', label: 'Help and support', icon: RiQuestionLine };\n\n/** Who bought, and the person there who placed the order. */\nexport const customer = {\n  id: 'marlow-finch',\n  name: 'Marlow & Finch',\n  initials: 'MF',\n  /** The month they first bought. */\n  since: '2025-03-01',\n  contact: {\n    name: 'Imogen Hartley',\n    role: 'Office manager',\n    email: 'imogen.hartley@marlowfinch.com',\n    phone: '+44 117 496 0142',\n  },\n};\n\nexport const shippingAddress = [\n  'Marlow & Finch',\n  'Imogen Hartley',\n  '14 Queen Square',\n  'Bristol BS1 4NT',\n  'United Kingdom',\n];\n\nexport const billingAddress = [\n  'Marlow & Finch LLP',\n  'Accounts payable',\n  '40 Carter Lane',\n  'London EC4V 5EA',\n  'United Kingdom',\n  'VAT GB 284 6093 71',\n];\n\n/** What the customer asked of the courier at checkout. */\nexport const note =\n  'Please use the loading bay on Mill Avenue, behind the building. Reception signs for parcels until 4 PM.';\n\nexport type OrderLine = {\n  id: string;\n  name: string;\n  /** What the item is and its stock number, under its name. */\n  detail: string;\n  quantity: number;\n  /** In cents. */\n  unitPrice: number;\n};\n\nexport const order = {\n  /** As shown: \"Order #6178\". */\n  number: '#6178',\n  /** ISO date and time, UTC. */\n  placed: '2026-11-05T09:42:00Z',\n  lines: [\n    {\n      id: 'hub',\n      name: 'Lumen Hub',\n      detail: 'Meeting room console, LS-HUB-02',\n      quantity: 2,\n      unitPrice: 64900,\n    },\n    {\n      id: 'camera',\n      name: 'Lumen Cam 4K',\n      detail: 'Conference camera, LS-CAM-4K',\n      quantity: 2,\n      unitPrice: 34900,\n    },\n    {\n      id: 'onboarding',\n      name: 'Onboarding package, Team',\n      detail: 'Remote setup and two training sessions, SV-ONB-TM',\n      quantity: 1,\n      unitPrice: 240000,\n    },\n  ] satisfies OrderLine[],\n  /** The hardware travels; the onboarding does not. */\n  shipping: {\n    service: 'Northline Standard',\n    price: 3800,\n    trackingNumber: '3409-4934-6178',\n    /** The day and the hour the courier promises. */\n    expected: { day: '2026-11-10', by: '2:00 PM' },\n  },\n  vatRate: 0.2,\n  card: 'Visa ending 6411',\n  paidOn: '2026-11-05',\n};\n\nexport const lineAmount = (line: OrderLine) => line.quantity * line.unitPrice;\nexport const subtotal = order.lines.reduce((sum, line) => sum + lineAmount(line), 0);\n/** VAT is charged on the goods and on getting them there. */\nexport const vatAmount = Math.round((subtotal + order.shipping.price) * order.vatRate);\nexport const total = subtotal + order.shipping.price + vatAmount;\n\nexport type TrackingKind = 'confirmed' | 'depot' | 'out-for-delivery' | 'shipped';\n\nexport type TrackingEvent = {\n  id: string;\n  kind: TrackingKind;\n  title: string;\n  /** ISO date and time, UTC. */\n  at: string;\n  /** Where it happened, or what it meant. */\n  text: string;\n};\n\n/** The order's way to the door, newest first: the first event is where the parcels are now. */\nexport const tracking: TrackingEvent[] = [\n  {\n    id: 'out-for-delivery',\n    kind: 'out-for-delivery',\n    title: 'Out for delivery',\n    at: '2026-11-10T07:48:00Z',\n    text: 'On the van from the Avonmouth depot.',\n  },\n  {\n    id: 'depot',\n    kind: 'depot',\n    title: 'Arrived at the delivery depot',\n    at: '2026-11-09T21:15:00Z',\n    text: 'Northline depot, Avonmouth, Bristol.',\n  },\n  {\n    id: 'shipped',\n    kind: 'shipped',\n    title: 'Product shipped',\n    at: '2026-11-06T16:05:00Z',\n    text: 'Two parcels handed over to Northline in London.',\n  },\n  {\n    id: 'confirmed',\n    kind: 'confirmed',\n    title: 'Order confirmed',\n    at: '2026-11-05T09:44:00Z',\n    text: `Payment processed with the ${order.card}.`,\n  },\n];\n"
    },
    {
      "path": "src/blocks/order-detail/format.ts",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/format.ts",
      "content": "// One locale for the whole screen; swap it for the user's.\nconst LOCALE = 'en-US';\n\nconst usd = new Intl.NumberFormat(LOCALE, { style: 'currency', currency: 'USD' });\nconst decimal = new Intl.NumberFormat(LOCALE, {\n  minimumFractionDigits: 2,\n  maximumFractionDigits: 2,\n});\nconst percent = new Intl.NumberFormat(LOCALE, { style: 'percent', maximumFractionDigits: 2 });\n// Dates are calendar days (`2026-11-05`) or UTC times: format them in UTC too.\nconst date = new Intl.DateTimeFormat(LOCALE, {\n  day: 'numeric',\n  month: 'short',\n  year: 'numeric',\n  timeZone: 'UTC',\n});\nconst dateTime = new Intl.DateTimeFormat(LOCALE, {\n  dateStyle: 'medium',\n  timeStyle: 'short',\n  timeZone: 'UTC',\n});\nconst month = new Intl.DateTimeFormat(LOCALE, { month: 'long', year: 'numeric', timeZone: 'UTC' });\n\n/** Money is kept in whole cents: 532080 → $5,320.80. */\nexport const formatUsd = (cents: number) => usd.format(cents / 100);\n/** The same without the sign, for a field that shows `$` beside it: 532080 → 5,320.80. */\nexport const formatAmount = (cents: number) => decimal.format(cents / 100);\n/** What was typed into such a field, in cents: `5,320.8` → 532080. Not a number: NaN. */\nexport const parseAmount = (text: string) =>\n  text.trim() ? Math.round(Number(text.replace(/,/g, '')) * 100) : NaN;\nexport const formatPercent = (rate: number) => percent.format(rate);\n/** Nov 5, 2026. */\nexport const formatDate = (iso: string) => date.format(new Date(iso));\n/** Nov 5, 2026, 9:42 AM. */\nexport const formatDateTime = (iso: string) => dateTime.format(new Date(iso));\n/** March 2025. */\nexport const formatMonth = (iso: string) => month.format(new Date(iso));\n"
    },
    {
      "path": "src/blocks/order-detail/index.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/index.tsx",
      "content": "'use client';\n\nimport '@/styles/wideset-blocks.css';\n\nimport { RiSideBarLine } from '@remixicon/react';\nimport { AppShell } from '@/components/ui/wideset/app-shell/AppShell';\nimport { Breadcrumbs } from '@/components/ui/wideset/breadcrumbs/Breadcrumbs';\nimport { Card } from '@/components/ui/wideset/card/Card';\nimport { cn } from '@/lib/wideset/utils';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { ToastProvider, useToast } from '@/components/ui/wideset/toast/Toast.context';\nimport { useId, useState } from 'react';\n\nimport { Address } from './address';\nimport { CustomerSummary } from './customer-summary';\nimport { billingAddress, customer, note, order, shippingAddress, total, tracking } from './data';\nimport { formatDate, formatUsd } from './format';\nimport { ItemsTable } from './items-table';\nimport { KeyValue } from './key-value';\nimport { OrderHeader } from './order-header';\nimport { OrderTotals } from './order-totals';\nimport { RefundDialog } from './refund-dialog';\nimport { Section } from './section';\nimport { SectionCard } from './section-card';\nimport { OrderDetailSidebar } from './sidebar';\nimport { TrackingTimeline } from './tracking-timeline';\n\n/** One column of the page: the header and the body share its edges. */\nconst COLUMN = 'px-ws-14 mx-auto w-full max-w-[80rem]';\n/** A section's two parts side by side; the second is as wide as the page's side column. */\nconst SPLIT = 'gap-ws-16 grid grid-cols-[minmax(0,1fr)_18rem] items-start';\n\n/** The page inside the card: under the toasts, so a refund can report itself. */\nfunction OrderPage() {\n  const { showToast } = useToast();\n  // What went back to the customer so far, in cents.\n  const [refunded, setRefunded] = useState(0);\n  const [refunding, setRefunding] = useState(false);\n\n  const { shipping } = order;\n  const status =\n    refunded === 0 ? 'Shipped' : refunded === total ? 'Refunded' : 'Partially refunded';\n\n  return (\n    <div className={cn(COLUMN, 'gap-ws-12 pt-ws-14 pb-ws-16 flex flex-col')}>\n      <OrderHeader\n        status={status}\n        onRefund={refunded < total ? () => setRefunding(true) : undefined}\n      />\n\n      <div className=\"gap-ws-16 grid grid-cols-1 items-start lg:grid-cols-[minmax(0,1fr)_18rem]\">\n        <div className=\"gap-ws-12 flex min-w-0 flex-col\">\n          <SectionCard title=\"Items\">\n            {/* Straight in the card, so the table's row lines run from edge to edge. */}\n            <ItemsTable />\n            {/* The totals stand under the amounts they add up; how it was paid reads beside them.\n                Card.Content keeps 10px free on its right for a scrollbar: the padding gives it\n                back, so the amounts end on the table's. */}\n            <Card.Content contentClassName=\"pr-ws-6\">\n              <div className={SPLIT}>\n                <dl className=\"gap-ws-11 flex flex-col\">\n                  <KeyValue label=\"Paid with\">{order.card}</KeyValue>\n                  <KeyValue label=\"Paid on\">{formatDate(order.paidOn)}</KeyValue>\n                </dl>\n                <OrderTotals refunded={refunded} />\n              </div>\n            </Card.Content>\n          </SectionCard>\n\n          <SectionCard title=\"Delivery\">\n            <Card.Content contentClassName=\"pr-ws-6\">\n              {/* Where the parcels are comes first; who carries them and when they land beside\n                  it, in the totals' column. */}\n              <div className={SPLIT}>\n                <TrackingTimeline events={tracking} />\n                {/* Dropped by the timeline's own inset, so the first label and the first event\n                    share a line. */}\n                <dl className=\"gap-ws-11 pt-ws-4 flex flex-col\">\n                  <KeyValue label=\"Courier\">{shipping.service}</KeyValue>\n                  <KeyValue label=\"Tracking number\">{shipping.trackingNumber}</KeyValue>\n                  <KeyValue label=\"Estimated delivery\">\n                    {formatDate(shipping.expected.day)}, by {shipping.expected.by}\n                  </KeyValue>\n                </dl>\n              </div>\n            </Card.Content>\n          </SectionCard>\n        </div>\n\n        {/* Dropped by the card header's inset, so \"Customer\" stands on the cards' title line. */}\n        <aside aria-label=\"Customer and addresses\" className=\"gap-ws-14 lg:pt-ws-9 flex flex-col\">\n          <Section title=\"Customer\">\n            <CustomerSummary />\n          </Section>\n          <Section title=\"Shipping address\">\n            <Address lines={shippingAddress} />\n          </Section>\n          <Section title=\"Billing address\">\n            <Address lines={billingAddress} />\n          </Section>\n          <Section title=\"Delivery note\">\n            <p className=\"typography-body-md text-ws-static-base\">{note}</p>\n          </Section>\n        </aside>\n      </div>\n\n      <RefundDialog\n        open={refunding}\n        onOpenChange={setRefunding}\n        order={{\n          number: order.number,\n          customer: customer.name,\n          paid: total,\n          refundable: total - refunded,\n          card: order.card,\n        }}\n        onConfirm={(amount) => {\n          setRefunded(refunded + amount);\n          setRefunding(false);\n          showToast({\n            content: `${formatUsd(amount)} refunded to ${customer.name}`,\n            status: 'success',\n          });\n        }}\n      />\n    </div>\n  );\n}\n\n/**\n * Order detail (Inset direction): one order on the raised page beside the workspace sidebar. The\n * main column reads top to bottom as the order does, each part in its own bordered card: what was\n * bought and what it came to, then where the parcels are, as a timeline whose first event is the\n * current step. The side column holds who bought and where it goes, plain, as facts to look up. Refunding takes the same dialog as the list; it changes\n * the status and adds a row to the totals.\n */\nexport default function OrderDetail() {\n  const sidebarId = useId();\n  const [collapsed, setCollapsed] = useState(false);\n\n  return (\n    <ToastProvider>\n      <AppShell className=\"ws-block-utility\" direction=\"inset\">\n        <OrderDetailSidebar id={sidebarId} collapsed={collapsed} onCollapsedChange={setCollapsed} />\n        <AppShell.Main>\n          <div className=\"h-ws-18 border-ws-static-base flex shrink-0 items-center border-b\">\n            {/* The bar belongs to the surround: it runs edge to edge. The sidebar's toggle is\n                pulled left so its glyph, not its box, sits 20px from the edge; the crumbs follow\n                it. */}\n            <div className=\"gap-ws-5 px-ws-11 flex w-full items-center\">\n              <IconButton\n                icon={RiSideBarLine}\n                variant=\"secondary\"\n                preset=\"ghost\"\n                size=\"sm\"\n                iconClassName=\"text-ws-static-subtle size-ws-9\"\n                aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}\n                aria-expanded={!collapsed}\n                aria-controls={sidebarId}\n                onClick={() => setCollapsed(!collapsed)}\n                className=\"-ml-ws-5\"\n              />\n              <Breadcrumbs separator=\"arrow\">\n                <Breadcrumbs.Item asChild>\n                  <a href=\"#orders\">Orders</a>\n                </Breadcrumbs.Item>\n                <Breadcrumbs.Item>{order.number}</Breadcrumbs.Item>\n              </Breadcrumbs>\n            </div>\n          </div>\n\n          {/* The page scrolls inside the card, so the card's corners stay put. */}\n          <div className=\"ws-scrollbar min-h-0 flex-1 overflow-y-auto\">\n            <OrderPage />\n          </div>\n        </AppShell.Main>\n      </AppShell>\n    </ToastProvider>\n  );\n}\n"
    },
    {
      "path": "src/blocks/order-detail/items-table.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/items-table.tsx",
      "content": "'use client';\n\nimport { Table } from '@/components/ui/wideset/table/Table';\n\nimport { lineAmount, order } from './data';\nimport { formatUsd } from './format';\n\n/**\n * What was ordered: one row per item, quantity times unit price. It sits straight in its card, so\n * the row lines run from edge to edge; the outer columns take the card's 20px inset, so the names\n * start on the card title's line and the amounts end over the totals.\n */\nexport function ItemsTable() {\n  return (\n    <Table size=\"md\" aria-label=\"Order items\" className=\"w-full\">\n      <Table.Head>\n        <Table.Row>\n          <Table.Header className=\"pl-ws-11 w-full\">Product</Table.Header>\n          <Table.Header align=\"right\">Quantity</Table.Header>\n          <Table.Header align=\"right\" className=\"whitespace-nowrap\">\n            Unit price\n          </Table.Header>\n          <Table.Header align=\"right\" className=\"pr-ws-11\">\n            Amount\n          </Table.Header>\n        </Table.Row>\n      </Table.Head>\n      <Table.Body>\n        {order.lines.map((line) => (\n          <Table.Row key={line.id}>\n            <Table.Cell className=\"pl-ws-11\">\n              <span className=\"text-ws-static-strong\">{line.name}</span>\n              <Table.CellDescription>{line.detail}</Table.CellDescription>\n            </Table.Cell>\n            <Table.Cell align=\"right\" className=\"tabular-nums\">\n              {line.quantity}\n            </Table.Cell>\n            <Table.Cell align=\"right\" className=\"tabular-nums\">\n              {formatUsd(line.unitPrice)}\n            </Table.Cell>\n            <Table.Cell align=\"right\" className=\"pr-ws-11 tabular-nums\">\n              {formatUsd(lineAmount(line))}\n            </Table.Cell>\n          </Table.Row>\n        ))}\n      </Table.Body>\n    </Table>\n  );\n}\n"
    },
    {
      "path": "src/blocks/order-detail/key-value.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/key-value.tsx",
      "content": "'use client';\n\n// TODO(custom): key-value pair (label above value); no DescriptionList in Wideset.\nimport type { ReactNode } from 'react';\n\n/** A fact: its label above its value. Render inside a `dl`. */\nexport function KeyValue({ label, children }: { label: string; children: ReactNode }) {\n  return (\n    <div className=\"gap-ws-3 flex min-w-0 flex-col\">\n      <dt className=\"typography-label-sm text-ws-static-subtle\">{label}</dt>\n      <dd className=\"typography-body-md text-ws-static-base tabular-nums\">{children}</dd>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/order-detail/order-header.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/order-header.tsx",
      "content": "'use client';\n\nimport {\n  type RemixiconComponentType,\n  RiDownload2Line,\n  RiLinkM,\n  RiMailSendLine,\n  RiMoreFill,\n  RiPrinterLine,\n  RiRefund2Line,\n} from '@remixicon/react';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { ListItem } from '@/components/ui/wideset/list-item/ListItem';\nimport { StatusBadge } from '@/components/ui/wideset/status-badge/StatusBadge';\n\nimport { customer, order } from './data';\nimport { formatDate } from './format';\n\nconst MENU: { label: string; icon: RemixiconComponentType }[] = [\n  { label: 'Print packing slip', icon: RiPrinterLine },\n  { label: 'Resend confirmation', icon: RiMailSendLine },\n  { label: 'Copy link', icon: RiLinkM },\n];\n\ntype OrderHeaderProps = {\n  /** Where the order stands, in a word or two. */\n  status: string;\n  /** Opens the refund dialog; left out once nothing is left to refund, which disables the button. */\n  onRefund?: () => void;\n};\n\n/**\n * The order's header: its number and status, who placed it and when, then what to do with it.\n * The badge carries the status's meaning: Shipped went out as it should (positive); a refund is\n * how the order ended, with nothing to signal (neutral). An order is a record to look up, with no\n * main flow, so no button is filled: Download invoice and Refund are both bordered. Once an order\n * has shipped it can be refunded, not cancelled.\n */\nexport function OrderHeader({ status, onRefund }: OrderHeaderProps) {\n  return (\n    <header className=\"gap-ws-12 flex flex-wrap items-center justify-between\">\n      <div className=\"gap-ws-2 flex min-w-0 flex-col\">\n        <div className=\"gap-ws-7 flex items-center\">\n          <h1 className=\"typography-title-sm text-ws-static-strong tabular-nums\">\n            Order {order.number}\n          </h1>\n          <StatusBadge size=\"lg\" color={status === 'Shipped' ? 'positive' : 'neutral'}>\n            {status}\n          </StatusBadge>\n        </div>\n        <p className=\"typography-body-md text-ws-static-subtle tabular-nums\">\n          Placed by {customer.name} on {formatDate(order.placed)}\n        </p>\n      </div>\n\n      <div className=\"gap-ws-5 flex items-center\">\n        <DropdownMenu>\n          <DropdownMenu.Trigger asChild>\n            <IconButton\n              icon={RiMoreFill}\n              variant=\"secondary\"\n              preset=\"border\"\n              size=\"sm\"\n              aria-label=\"More actions\"\n            />\n          </DropdownMenu.Trigger>\n          <DropdownMenu.Content align=\"end\" className=\"ws-block-utility w-[14rem]\">\n            {MENU.map(({ label, icon: Icon }) => (\n              <DropdownMenu.Item key={label}>\n                <ListItem.Prefix>\n                  <Icon className=\"size-ws-9\" />\n                </ListItem.Prefix>\n                <ListItem.Content>\n                  <ListItem.Label>{label}</ListItem.Label>\n                </ListItem.Content>\n              </DropdownMenu.Item>\n            ))}\n          </DropdownMenu.Content>\n        </DropdownMenu>\n        <Button\n          variant=\"secondary\"\n          preset=\"border\"\n          size=\"sm\"\n          disabled={!onRefund}\n          onClick={onRefund}\n        >\n          <Button.Icon icon={RiRefund2Line} />\n          Refund\n        </Button>\n        <Button variant=\"secondary\" preset=\"border\" size=\"sm\">\n          <Button.Icon icon={RiDownload2Line} />\n          Download invoice\n        </Button>\n      </div>\n    </header>\n  );\n}\n"
    },
    {
      "path": "src/blocks/order-detail/order-totals.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/order-totals.tsx",
      "content": "'use client';\n\n// TODO(custom): order totals (label and amount rows, the total under a line); no DescriptionList in Wideset.\nimport { cn } from '@/lib/wideset/utils';\n\nimport { order, subtotal, total, vatAmount } from './data';\nimport { formatPercent, formatUsd } from './format';\n\ntype RowProps = { label: string; value: number; strong?: boolean };\n\n/**\n * A label and its amount on one row; `strong` for the figure the reader is after, which also\n * opens a group under a line. The line is the row's own border: a `dl` holds only its rows.\n */\nfunction Row({ label, value, strong }: RowProps) {\n  const type = strong\n    ? 'typography-label-strong-md text-ws-static-strong'\n    : 'typography-body-md text-ws-static-base';\n  return (\n    <div\n      className={cn(\n        'gap-ws-9 flex items-baseline justify-between',\n        strong && 'border-ws-static-base pt-ws-7 border-t',\n      )}\n    >\n      <dt className={strong ? type : 'typography-body-md text-ws-static-subtle'}>{label}</dt>\n      <dd className={`${type} tabular-nums`}>{formatUsd(value)}</dd>\n    </div>\n  );\n}\n\n/**\n * What the order comes to, under the amounts it adds up: the goods, getting them there, the\n * VAT and the total, then what has gone back since. Every figure comes from `data.ts`, so the\n * rows always add up.\n */\nexport function OrderTotals({ refunded }: { refunded: number }) {\n  return (\n    <dl className=\"gap-ws-7 flex flex-col\">\n      <Row label=\"Subtotal\" value={subtotal} />\n      <Row label=\"Shipping\" value={order.shipping.price} />\n      <Row label={`VAT ${formatPercent(order.vatRate)}`} value={vatAmount} />\n      <Row label=\"Total\" value={total} strong />\n      {refunded > 0 && <Row label=\"Refunded\" value={-refunded} />}\n    </dl>\n  );\n}\n"
    },
    {
      "path": "src/blocks/order-detail/people.assets.ts",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/people.assets.ts",
      "content": "// Portraits of the sample people as small JPEG data URLs (a block ships only .ts and .tsx).\n// Exported from the Wideset Core Figma file by people.cjs: do not edit by hand.\n\n/** A person’s photo by name. People who are not here show their initials. */\nexport const PHOTOS: Record<string, string | undefined> = {\n  'Maya Okafor':\n    'data:image/jpeg;base64,/9j/4A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iWHOFOWJbrKo1LqFiXvYhtJwvjKU44qRdFdTW/Td1ukW5yUx/wBQS0W3XDhG5G7gnwzv/FNk6whCisNYyeOKSRNFzb7cWIMKMt+U+oJQ2kck/wBB6+FO0KoGAoiRZ6dTvuo/aajiSmJrCH4zzbzCxlLjagpKvsRSkVI9NdPGNOaVtdmwlS4rQSpYGMq5Kj7qJNHSNGPhO+O4Ck+Ch3Vsmi2Ia27QW9Tar4T/ABI0mjBxR0q3SoKsPtFIH+ocik4NBII5zbp1UqrxIcj0jzpzT72oJvZoO1hvBdX5DyHqatJmzxrSlLcZlKGsDuHP80RoW3CFp+Orbhb+XVHzz3fjFP7mFpQT5lJrQpUwq56zz/WNRe5rtTB8KnAHzELaQ5jP80oTltQUPeiktlh1SPDvFGnuowmPIjqrppadUuLlMuKgXFf7nWk5Ss+akeP3GDVbS+id8TJQf8FKbTxuS4U59iKvTOPPNe7RYP7iKRr6fQrHiYYPpH7fU7igOFWyPWUOr4fZ90dQqZNjQmU+DSS4r27h75qxNJ9NrBoZClwGC7NcG1cp47nFDyz4D0GKmaipYwSTRak/UPSrULGjQOUG/nK3GoV7gYdtvIbRKIyFHcoZJNKEMJSg4AAr2PqA8AK6+5sVHb/5F01E4ln2pp9gpWgHcOePCqlvlt/Spqmx/lq5TVzSXgqYIoOCEb1HyA/9NVxrVjfHafA+rG/2JoVZAVmto141vcKM+FtjP//Z',\n};\n"
    },
    {
      "path": "src/blocks/order-detail/person-avatar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/person-avatar.tsx",
      "content": "'use client';\n\nimport type { AvatarProps } from '@/components/ui/wideset/avatar/Avatar.types';\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\n\nimport { PHOTOS } from './people.assets';\n\ntype PersonAvatarProps = Pick<\n  AvatarProps,\n  'size' | 'shape' | 'status' | 'color' | 'className' | 'title' | 'aria-hidden' | 'aria-label'\n> & {\n  /** The person's full name: the key their photo is filed under. */\n  name: string;\n  initials: string;\n  /** Leave empty beside the person's name; pass the name where the avatar stands alone. */\n  alt?: string;\n};\n\n/**\n * A person's avatar: their photo when the sample people have one, otherwise their initials in\n * their colour. A real product mixes the two, so every place the block draws a person asks here\n * and the choice is made once. The initials stay as the fallback if the image fails to load.\n */\nexport function PersonAvatar({ name, initials, color, alt = '', ...props }: PersonAvatarProps) {\n  const photo = PHOTOS[name];\n  return photo ? (\n    <Avatar src={photo} alt={alt} initials={initials} {...props} />\n  ) : (\n    <Avatar initials={initials} color={color} {...props} />\n  );\n}\n"
    },
    {
      "path": "src/blocks/order-detail/refund-dialog.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/refund-dialog.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { FormField } from '@/components/ui/wideset/form-field/FormField';\nimport { Modal } from '@/components/ui/wideset/modal/Modal';\nimport { Select } from '@/components/ui/wideset/select/Select';\nimport { TextInput } from '@/components/ui/wideset/text-input/TextInput';\nimport { useEffect, useId, useRef, useState } from 'react';\n\nimport { formatAmount, formatUsd, parseAmount } from './format';\n\nconst REASONS = [\n  { value: 'requested', label: 'Requested by the customer' },\n  { value: 'duplicate', label: 'Duplicate order' },\n  { value: 'faulty', label: 'Damaged or faulty item' },\n  { value: 'not-delivered', label: 'Not delivered' },\n  { value: 'mistake', label: 'Ordered by mistake' },\n  { value: 'other', label: 'Other' },\n];\n\n/** What the dialog needs to know about the order it refunds. Money in cents. */\nexport type RefundTarget = {\n  /** The order's number, as shown: \"#6178\". */\n  number: string;\n  customer: string;\n  /** What the card was charged. */\n  paid: number;\n  /** What is left of the payment: what was paid less what went back already. */\n  refundable: number;\n  /** The card the money goes back to: \"Visa ending 6411\". */\n  card: string;\n};\n\ntype RefundFormProps = {\n  id: string;\n  order: RefundTarget;\n  pending: boolean;\n  onRefund: (amount: number, reason: string) => void;\n};\n\n/**\n * The dialog's content. It mounts with the dialog, so every opening starts from the full amount\n * and no reason. Errors wait for the first try at refunding, then follow what is typed.\n */\nfunction RefundForm({ id, order, pending, onRefund }: RefundFormProps) {\n  const [text, setText] = useState(formatAmount(order.refundable));\n  const [reason, setReason] = useState('');\n  const [tried, setTried] = useState(false);\n\n  const amount = parseAmount(text);\n  const max = formatUsd(order.refundable);\n  const amountError = !(amount > 0)\n    ? 'Enter an amount above $0.00.'\n    : amount > order.refundable\n      ? `Enter ${max} or less.`\n      : undefined;\n  const reasonError = reason ? undefined : 'Choose a reason.';\n  const rest = order.refundable - amount;\n\n  function refund() {\n    setTried(true);\n    if (amountError) document.getElementById(`${id}-amount`)?.focus();\n    else if (reasonError) document.getElementById(`${id}-reason`)?.focus();\n    else onRefund(amount, reason);\n  }\n\n  return (\n    <>\n      <Modal.Header>\n        <Modal.Title>Refund order {order.number}</Modal.Title>\n        <Modal.Description>\n          {order.customer} paid {formatUsd(order.paid)} with {order.card}.\n          {order.paid > order.refundable &&\n            ` ${formatUsd(order.paid - order.refundable)} of it has gone back already.`}\n        </Modal.Description>\n      </Modal.Header>\n      <Modal.Body className=\"gap-ws-11 flex flex-col\">\n        <div className=\"gap-ws-9 grid grid-cols-2 items-start\">\n          <FormField\n            label=\"Amount\"\n            htmlFor={`${id}-amount`}\n            helperText={`Up to ${max}.`}\n            errorText={tried ? amountError : undefined}\n          >\n            <TextInput\n              id={`${id}-amount`}\n              name=\"amount\"\n              required\n              inputMode=\"decimal\"\n              autoComplete=\"off\"\n              placeholder=\"0.00\"\n              variant={tried && amountError ? 'danger' : 'primary'}\n              value={text}\n              onChange={(event) => setText(event.target.value.replace(/[^\\d.,]/g, ''))}\n              // Leaving the field settles what was typed into an amount: 1200 → 1,200.00.\n              onBlur={() => amount > 0 && setText(formatAmount(amount))}\n            >\n              <TextInput.Prefix>$</TextInput.Prefix>\n              <TextInput.Input className=\"tabular-nums\" />\n            </TextInput>\n          </FormField>\n          <FormField\n            label=\"Reason\"\n            htmlFor={`${id}-reason`}\n            errorText={tried ? reasonError : undefined}\n          >\n            <Select\n              id={`${id}-reason`}\n              name=\"reason\"\n              className=\"w-full\"\n              required\n              options={REASONS}\n              placeholder=\"Choose a reason\"\n              variant={tried && reasonError ? 'danger' : 'primary'}\n              value={reason}\n              onValueChange={setReason}\n            />\n          </FormField>\n        </div>\n        {/* What confirming does, in words, following the amount as it is typed. */}\n        <p className=\"typography-body-md text-ws-static-subtle tabular-nums\">\n          {amountError\n            ? `A refund goes back to the ${order.card} within 5 to 10 business days.`\n            : `${formatUsd(amount)} goes back to the ${order.card} within 5 to 10 business days. The order is marked ${\n                rest === 0 ? 'Refunded' : `Partially refunded and ${formatUsd(rest)} stays paid`\n              }.`}{' '}\n          {order.customer} gets a confirmation by email. A refund cannot be undone.\n        </p>\n      </Modal.Body>\n      <Modal.Footer>\n        <Modal.Close asChild>\n          <Button variant=\"secondary\" preset=\"border\" disabled={pending}>\n            Cancel\n          </Button>\n        </Modal.Close>\n        <Button onClick={refund} disabled={pending}>\n          {pending ? 'Refunding…' : amountError ? 'Refund' : `Refund ${formatUsd(amount)}`}\n        </Button>\n      </Modal.Footer>\n    </>\n  );\n}\n\ntype RefundDialogProps = {\n  open: boolean;\n  onOpenChange: (open: boolean) => void;\n  order: RefundTarget;\n  /** Called once the refund went through, with the amount in cents and the reason's value. */\n  onConfirm: (amount: number, reason: string) => void;\n};\n\n/**\n * Refunding an order: the amount, full unless changed and never above what is left of the\n * payment, the reason, and what confirming does. Money leaves on a click, never on Enter in a\n * field: the fields are not a form, and the button names the amount it sends back.\n */\nexport function RefundDialog({ open, onOpenChange, order, onConfirm }: RefundDialogProps) {\n  const id = useId();\n  const [pending, setPending] = useState(false);\n\n  // Cleared on unmount, so the stand-in request never lands on a closed screen.\n  const timer = useRef<number>(undefined);\n  useEffect(() => () => window.clearTimeout(timer.current), []);\n\n  // A timeout stands in for the request; a real screen awaits it and shows an InlineAlert in the\n  // body if it fails, keeping the dialog open.\n  function refund(amount: number, reason: string) {\n    setPending(true);\n    timer.current = window.setTimeout(() => {\n      setPending(false);\n      onConfirm(amount, reason);\n    }, 800);\n  }\n\n  return (\n    <Modal open={open} onOpenChange={(next) => !pending && onOpenChange(next)}>\n      <Modal.Content className=\"ws-block-utility\"\n        persistent={pending}\n        onOpenAutoFocus={(event) => {\n          event.preventDefault();\n          document.getElementById(`${id}-amount`)?.focus();\n        }}\n      >\n        <RefundForm id={id} order={order} pending={pending} onRefund={refund} />\n      </Modal.Content>\n    </Modal>\n  );\n}\n"
    },
    {
      "path": "src/blocks/order-detail/section-card.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/section-card.tsx",
      "content": "'use client';\n\nimport { Card } from '@/components/ui/wideset/card/Card';\nimport { type ReactNode, useId } from 'react';\n\n/**\n * One part of the order to work with, in a bordered Card: the title in the header, what it holds\n * under the line. The items and the delivery are what an order is handled by, so each gets its\n * own container; the side column's facts stay plain. The title names the region. The children\n * are the card's own parts: `Card.Content` for padded content, or a table straight in the card,\n * so its row lines run from edge to edge.\n */\nexport function SectionCard({ title, children }: { title: string; children: ReactNode }) {\n  const id = useId();\n\n  return (\n    <Card role=\"region\" aria-labelledby={id}>\n      <Card.Header>\n        <h2 id={id} className=\"typography-label-strong-md text-ws-static-strong\">\n          {title}\n        </h2>\n      </Card.Header>\n      {children}\n    </Card>\n  );\n}\n"
    },
    {
      "path": "src/blocks/order-detail/section.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/section.tsx",
      "content": "'use client';\n\n// TODO(custom): section title above its content; Wideset has no Section or PageSection.\nimport { type ReactNode, useId } from 'react';\n\n/** One part of the order: a 16px title, then what it holds. The title names the region. */\nexport function Section({ title, children }: { title: string; children: ReactNode }) {\n  const id = useId();\n\n  return (\n    <section aria-labelledby={id} className=\"gap-ws-7 flex flex-col\">\n      <h2 id={id} className=\"typography-label-strong-md text-ws-static-strong\">\n        {title}\n      </h2>\n      {children}\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/order-detail/sidebar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/sidebar.tsx",
      "content": "'use client';\n\n// TODO(custom): workspace switcher and account menu are composed by hand.\nimport {\n  RiAddLine,\n  RiArrowDownSLine,\n  RiLogoutBoxRLine,\n  RiSearchLine,\n  RiSettingsLine,\n} from '@remixicon/react';\nimport { Divider } from '@/components/ui/wideset/divider/Divider';\nimport { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { ListItem } from '@/components/ui/wideset/list-item/ListItem';\nimport { Sidebar } from '@/components/ui/wideset/sidebar/Sidebar';\nimport { type SidebarProps } from '@/components/ui/wideset/sidebar/Sidebar.types';\nimport { TextInput } from '@/components/ui/wideset/text-input/TextInput';\nimport { useState } from 'react';\n\nimport { BrandMark } from './brand-mark';\nimport {\n  account,\n  helpLink,\n  mainLinks,\n  type NavLink,\n  product,\n  settingsLinks,\n  workspace,\n} from './data';\nimport { PersonAvatar } from './person-avatar';\n\n/**\n * The workspace sidebar: switcher, search, the app's pages, settings and the signed-in account.\n * Its toggle sits in the page bar, so the screen holds `collapsed` and passes it down; collapsed,\n * it keeps the mark, the page icons and the avatar.\n */\nexport function OrderDetailSidebar(\n  props: Pick<SidebarProps, 'id' | 'collapsed' | 'onCollapsedChange'>,\n) {\n  const [active, setActive] = useState('orders');\n\n  const link = ({ id, label, icon, activeIcon }: NavLink) => (\n    <Sidebar.Item\n      key={id}\n      href={`#${id}`}\n      icon={active === id ? (activeIcon ?? icon) : icon}\n      label={label}\n      active={active === id}\n      onClick={() => setActive(id)}\n    />\n  );\n\n  const nav = (\n    <nav aria-label=\"Workspace\" className=\"gap-ws-9 flex flex-col\">\n      <div className=\"flex flex-col\">{mainLinks.map(link)}</div>\n      <Divider weight=\"thin\" />\n      <div role=\"group\" aria-labelledby=\"sidebar-settings\" className=\"gap-ws-2 flex flex-col\">\n        <Sidebar.SectionHeader id=\"sidebar-settings\">Settings</Sidebar.SectionHeader>\n        {settingsLinks.map(link)}\n      </div>\n    </nav>\n  );\n\n  return (\n    <Sidebar {...props}>\n      <Sidebar.Header>\n        <Sidebar.Expanded>\n          <div className=\"gap-ws-9 flex flex-col\">\n            <div className=\"gap-ws-7 pt-ws-3 pb-ws-7 flex items-center\">\n              <BrandMark className=\"size-ws-15\" />\n              <div className=\"flex min-w-0 flex-1 flex-col\">\n                <span className=\"typography-label-strong-sm text-ws-static-strong truncate\">\n                  {workspace.name}\n                </span>\n                <span className=\"typography-caption-md text-ws-static-subtle truncate\">\n                  {product.name}\n                </span>\n              </div>\n              <DropdownMenu>\n                <DropdownMenu.Trigger asChild>\n                  <IconButton\n                    icon={RiArrowDownSLine}\n                    variant=\"secondary\"\n                    preset=\"ghost\"\n                    size=\"xs\"\n                    aria-label=\"Switch workspace\"\n                    className=\"mr-ws-3\"\n                  />\n                </DropdownMenu.Trigger>\n                <DropdownMenu.Content className=\"ws-block-utility\" align=\"end\">\n                  <DropdownMenu.Item data-state=\"checked\">\n                    <ListItem.Content>\n                      <ListItem.Label>{workspace.name}</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                  <DropdownMenu.Separator />\n                  <DropdownMenu.Item>\n                    <ListItem.Prefix>\n                      <RiAddLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>New workspace</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                </DropdownMenu.Content>\n              </DropdownMenu>\n            </div>\n            <TextInput size=\"sm\">\n              <TextInput.Prefix inner>\n                <TextInput.Icon icon={RiSearchLine} />\n              </TextInput.Prefix>\n              <TextInput.Input type=\"search\" placeholder=\"Search\" aria-label=\"Search\" />\n            </TextInput>\n          </div>\n        </Sidebar.Expanded>\n        <Sidebar.Collapsed>\n          <div className=\"pt-ws-3 pb-ws-7 flex justify-center\">\n            <BrandMark className=\"size-ws-15\" />\n          </div>\n        </Sidebar.Collapsed>\n      </Sidebar.Header>\n\n      {/* A section draws only the slot for the state it is in, so the pages go in both. */}\n      <Sidebar.Section scrollable>{nav}</Sidebar.Section>\n\n      <Sidebar.Footer>\n        <div className=\"gap-ws-9 flex flex-col\">\n          <div className=\"flex flex-col\">{link(helpLink)}</div>\n          {/* On the grey ground the line keeps the nav's inset: run edge to edge, it would stop\n              short of the page and read as broken. */}\n          <div className=\"border-ws-static-base pt-ws-5 border-t\">\n            <Sidebar.Expanded>\n              <DropdownMenu>\n                <DropdownMenu.Trigger asChild>\n                  <button\n                    type=\"button\"\n                    className=\"gap-ws-5 px-ws-5 py-ws-3 rounded-ws-control-lg hover:bg-ws-dynamic-tertiary-alpha-strong-default focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default flex w-full items-center text-left\"\n                  >\n                    <PersonAvatar name={account.name} initials={account.initials} color=\"orange\" />\n                    <span className=\"flex min-w-0 flex-1 flex-col\">\n                      <span className=\"typography-label-strong-sm text-ws-static-base truncate\">\n                        {account.name}\n                      </span>\n                      <span className=\"typography-caption-md text-ws-static-subtle truncate\">\n                        {account.email}\n                      </span>\n                    </span>\n                    <RiArrowDownSLine\n                      aria-hidden=\"true\"\n                      className=\"size-ws-9 text-ws-static-strong\"\n                    />\n                  </button>\n                </DropdownMenu.Trigger>\n                <DropdownMenu.Content side=\"top\" align=\"start\" className=\"ws-block-utility w-[14rem]\">\n                  <DropdownMenu.Item>\n                    <ListItem.Prefix>\n                      <RiSettingsLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>Account settings</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                  <DropdownMenu.Separator />\n                  <DropdownMenu.Item variant=\"danger\">\n                    <ListItem.Prefix>\n                      <RiLogoutBoxRLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>Log out</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                </DropdownMenu.Content>\n              </DropdownMenu>\n            </Sidebar.Expanded>\n            <Sidebar.Collapsed>\n              <div className=\"flex justify-center\">\n                <PersonAvatar\n                  name={account.name}\n                  initials={account.initials}\n                  color=\"orange\"\n                  alt={account.name}\n                  title={account.name}\n                />\n              </div>\n            </Sidebar.Collapsed>\n          </div>\n        </div>\n      </Sidebar.Footer>\n    </Sidebar>\n  );\n}\n"
    },
    {
      "path": "src/blocks/order-detail/tracking-timeline.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/order-detail/tracking-timeline.tsx",
      "content": "'use client';\n\n// TODO(custom): tracking timeline (mark, event, time, text, the current step filled); no Timeline in Wideset.\nimport {\n  type RemixiconComponentType,\n  RiBankCardLine,\n  RiBox3Line,\n  RiBuilding2Line,\n  RiTruckLine,\n} from '@remixicon/react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { TrackingEvent, TrackingKind } from './data';\nimport { formatDateTime } from './format';\n\nconst ICON: Record<TrackingKind, RemixiconComponentType> = {\n  confirmed: RiBankCardLine,\n  shipped: RiBox3Line,\n  depot: RiBuilding2Line,\n  'out-for-delivery': RiTruckLine,\n};\n\n/**\n * The order's way to the door, newest first, on one line of marks: the event and when, then\n * where it happened. The first event is where the parcels are now: its mark is filled the way\n * the library fills an active step, the earlier ones stay outlined.\n */\nexport function TrackingTimeline({ events }: { events: TrackingEvent[] }) {\n  return (\n    <ol className=\"flex flex-col\">\n      {events.map((event, index) => {\n        const Icon = ICON[event.kind];\n        const current = index === 0;\n        const last = index === events.length - 1;\n        return (\n          <li\n            key={event.id}\n            aria-current={current ? 'step' : undefined}\n            className=\"gap-ws-7 relative flex\"\n          >\n            {last ? null : (\n              <span\n                aria-hidden=\"true\"\n                className=\"border-ws-static-base top-ws-15 bottom-ws-3 left-ws-9 absolute border-l\"\n              />\n            )}\n            <span\n              aria-hidden=\"true\"\n              className={cn(\n                'size-ws-14 rounded-ws-control-full flex shrink-0 items-center justify-center',\n                current\n                  ? 'bg-ws-dynamic-primary-alpha-strong-default text-ws-dynamic-primary-default'\n                  : 'border-ws-static-base text-ws-static-subtle border',\n              )}\n            >\n              <Icon className=\"size-ws-8\" />\n            </span>\n            <div className={cn('min-w-0 flex-1', !last && 'pb-ws-11')}>\n              <div className=\"gap-ws-9 pt-ws-4 flex items-baseline justify-between\">\n                <p\n                  className={cn(\n                    'typography-label-strong-sm',\n                    current ? 'text-ws-static-strong' : 'text-ws-static-base',\n                  )}\n                >\n                  {event.title}\n                </p>\n                <time\n                  dateTime={event.at}\n                  className=\"typography-caption-md text-ws-static-subtle shrink-0 tabular-nums\"\n                >\n                  {formatDateTime(event.at)}\n                </time>\n              </div>\n              <p className=\"typography-body-md text-ws-static-subtle\">{event.text}</p>\n            </div>\n          </li>\n        );\n      })}\n    </ol>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "1.1.0",
    "commit": "a734f9f0"
  }
}
