{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-modal-details",
  "type": "registry:block",
  "title": "Details modal",
  "description": "A record read in a modal: its key facts and actions, tabs over its history, and moving to the previous or next record.",
  "dependencies": [
    "@remixicon/react@^4.9.0"
  ],
  "registryDependencies": [
    "https://wideset.co/r/block-styles.json",
    "https://wideset.co/r/button.json",
    "https://wideset.co/r/icon-button.json",
    "https://wideset.co/r/modal.json",
    "https://wideset.co/r/tabs.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/modal-details/data.ts",
      "type": "registry:file",
      "target": "blocks/wideset/modal-details/data.ts",
      "content": "import {\n  type RemixiconComponentType,\n  RiHeadphoneLine,\n  RiLightbulbLine,\n  RiShoppingBag3Line,\n} from '@remixicon/react';\n\n/*\n  Three orders from Lumen Studio's shop, as Orbit lists them. The modal opens on the middle one,\n  so there is an order to step to on both sides.\n*/\n\n/** A fact about the order: its label and its value. */\nexport type Fact = { label: string; value: string };\n\n/** One step in the order's history. */\nexport type OrderEvent = {\n  id: string;\n  title: string;\n  /** When it happened, as shown. */\n  at: string;\n  text: string;\n  /** Facts that came with the step, under the text. */\n  details?: Fact[];\n};\n\nexport type Order = {\n  /** The order number, shown as \"Order #5913\". */\n  id: string;\n  /** The line under the title. */\n  description: string;\n  /** Stands in for the product's photo. */\n  icon: RemixiconComponentType;\n  /** The key facts under the title, two to a row. */\n  facts: Fact[];\n  /** Newest first. */\n  history: OrderEvent[];\n  item: Fact[];\n  courier: Fact[];\n  receiver: Fact[];\n};\n\nexport const orders: Order[] = [\n  {\n    id: '5912',\n    description: '1 item, $129.00, paid by card',\n    icon: RiLightbulbLine,\n    facts: [\n      { label: 'Item', value: 'Halo Desk Lamp, Sand' },\n      { label: 'Courier', value: 'Northline, I. Sorensen' },\n      { label: 'Start time', value: 'Sep 11, 2026, 9:12:48 AM' },\n      { label: 'Address', value: '208 Juniper Row, Alderbrook, Oregon 97035' },\n    ],\n    history: [\n      {\n        id: 'delivered',\n        title: 'Order delivered',\n        at: 'Sep 12, 2026, 2:41 PM',\n        text: 'The parcel was handed to the receiver and signed for.',\n        details: [{ label: 'Signed by', value: 'Dana Whitfield' }],\n      },\n      {\n        id: 'shipped',\n        title: 'Product shipped',\n        at: 'Sep 11, 2026, 4:05 PM',\n        text: 'The product was handed over to the courier for delivery.',\n        details: [\n          { label: 'Courier service', value: 'Northline, I. Sorensen' },\n          { label: 'Estimated delivery', value: 'Sep 12, 2026' },\n        ],\n      },\n      {\n        id: 'placed',\n        title: 'Order placed',\n        at: 'Sep 11, 2026, 9:12 AM',\n        text: 'Customer placed an order for a Halo Desk Lamp.',\n        details: [\n          { label: 'Product', value: 'Halo Desk Lamp, Sand' },\n          { label: 'Price', value: '$129' },\n        ],\n      },\n    ],\n    item: [\n      { label: 'Product', value: 'Halo Desk Lamp, Sand' },\n      { label: 'SKU', value: 'HL-DL-0112' },\n      { label: 'Quantity', value: '1' },\n      { label: 'Price', value: '$129.00' },\n    ],\n    courier: [\n      { label: 'Service', value: 'Northline Standard' },\n      { label: 'Courier', value: 'I. Sorensen' },\n      { label: 'Tracking number', value: '3409-4934-4198' },\n      { label: 'Delivered', value: 'Sep 12, 2026' },\n    ],\n    receiver: [\n      { label: 'Name', value: 'Dana Whitfield' },\n      { label: 'Phone', value: '(503) 555-0142' },\n      { label: 'Address', value: '208 Juniper Row, Alderbrook, Oregon 97035' },\n      { label: 'Delivery note', value: 'Leave with the front desk' },\n    ],\n  },\n  {\n    id: '5913',\n    description: '1 item, $399.00, paid by card',\n    icon: RiHeadphoneLine,\n    facts: [\n      { label: 'Item', value: 'Aria Wireless Headphones' },\n      { label: 'Courier', value: 'Northline, R. Tanaka' },\n      { label: 'Start time', value: 'Sep 13, 2026, 3:43:23 PM' },\n      { label: 'Address', value: '4517 Larkspur Avenue, Maplewood, Kentucky 39495' },\n    ],\n    history: [\n      {\n        id: 'shipped',\n        title: 'Product shipped',\n        at: 'Sep 13, 2026, 5:23 PM',\n        text: 'The product was handed over to the courier for delivery.',\n        details: [\n          { label: 'Courier service', value: 'Northline, R. Tanaka' },\n          { label: 'Estimated delivery', value: 'Sep 15, 2026' },\n        ],\n      },\n      {\n        id: 'packaging',\n        title: 'Product packaging',\n        at: 'Sep 13, 2026, 4:13 PM',\n        text: 'The Aria headphones were carefully packaged and prepared for shipment.',\n        details: [\n          { label: 'Tracking number', value: '3409-4934-4253' },\n          { label: 'Warehouse', value: 'Maplewood Dock 13b' },\n        ],\n      },\n      {\n        id: 'confirmed',\n        title: 'Order confirmed',\n        at: 'Sep 13, 2026, 3:53 PM',\n        text: 'The order was confirmed and the payment was processed at 3:51 PM.',\n      },\n      {\n        id: 'placed',\n        title: 'Order placed',\n        at: 'Sep 13, 2026, 3:43 PM',\n        text: 'Customer placed an order for Aria Wireless Headphones.',\n        details: [\n          { label: 'Product', value: 'Aria Wireless Headphones' },\n          { label: 'Price', value: '$399' },\n        ],\n      },\n    ],\n    item: [\n      { label: 'Product', value: 'Aria Wireless Headphones' },\n      { label: 'SKU', value: 'AR-WH-0408' },\n      { label: 'Quantity', value: '1' },\n      { label: 'Price', value: '$399.00' },\n    ],\n    courier: [\n      { label: 'Service', value: 'Northline Express' },\n      { label: 'Courier', value: 'R. Tanaka' },\n      { label: 'Tracking number', value: '3409-4934-4253' },\n      { label: 'Estimated delivery', value: 'Sep 15, 2026' },\n    ],\n    receiver: [\n      { label: 'Name', value: 'Jonah Reyes' },\n      { label: 'Phone', value: '(606) 555-0187' },\n      { label: 'Address', value: '4517 Larkspur Avenue, Maplewood, Kentucky 39495' },\n      { label: 'Delivery note', value: 'Ring the bell twice' },\n    ],\n  },\n  {\n    id: '5914',\n    description: '2 items, $58.00, paid by card',\n    icon: RiShoppingBag3Line,\n    facts: [\n      { label: 'Item', value: 'Canvas Tote Bag, Ink' },\n      { label: 'Courier', value: 'Not assigned yet' },\n      { label: 'Start time', value: 'Sep 13, 2026, 6:02:10 PM' },\n      { label: 'Address', value: '77 Quarry Street, Fernhill, Vermont 05488' },\n    ],\n    history: [\n      {\n        id: 'confirmed',\n        title: 'Order confirmed',\n        at: 'Sep 13, 2026, 6:04 PM',\n        text: 'The order was confirmed and the payment was processed at 6:03 PM.',\n      },\n      {\n        id: 'placed',\n        title: 'Order placed',\n        at: 'Sep 13, 2026, 6:02 PM',\n        text: 'Customer placed an order for two Canvas Tote Bags.',\n        details: [\n          { label: 'Product', value: 'Canvas Tote Bag, Ink' },\n          { label: 'Price', value: '$58' },\n        ],\n      },\n    ],\n    item: [\n      { label: 'Product', value: 'Canvas Tote Bag, Ink' },\n      { label: 'SKU', value: 'CT-TB-0231' },\n      { label: 'Quantity', value: '2' },\n      { label: 'Price', value: '$58.00' },\n    ],\n    courier: [\n      { label: 'Service', value: 'Northline Standard' },\n      { label: 'Courier', value: 'Not assigned yet' },\n      { label: 'Tracking number', value: 'Not issued yet' },\n      { label: 'Estimated delivery', value: 'Sep 16, 2026' },\n    ],\n    receiver: [\n      { label: 'Name', value: 'Priya Lindqvist' },\n      { label: 'Phone', value: '(802) 555-0119' },\n      { label: 'Address', value: '77 Quarry Street, Fernhill, Vermont 05488' },\n      { label: 'Delivery note', value: 'None' },\n    ],\n  },\n];\n"
    },
    {
      "path": "src/blocks/modal-details/index.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/modal-details/index.tsx",
      "content": "'use client';\n\nimport '@/styles/wideset-blocks.css';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { useState } from 'react';\n\nimport { orders } from './data';\nimport { OrderDetailsModal } from './order-details-modal';\n\n/** Details modal: a record read over the page, here over an empty page that reopens it. */\nexport default function ModalDetailsBlock() {\n  const [open, setOpen] = useState(true);\n  // The middle order of three, so both steps in the footer have somewhere to go.\n  const [index, setIndex] = useState(1);\n\n  return (\n    <div className=\"ws-block-utility bg-ws-static-foreground flex h-dvh items-center justify-center\">\n      <Button variant=\"secondary\" preset=\"border\" onClick={() => setOpen(true)}>\n        Open order\n      </Button>\n      <OrderDetailsModal\n        order={orders[index]}\n        open={open}\n        onOpenChange={setOpen}\n        onPrevious={index > 0 ? () => setIndex(index - 1) : undefined}\n        onNext={index < orders.length - 1 ? () => setIndex(index + 1) : undefined}\n      />\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/modal-details/order-details-modal.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/modal-details/order-details-modal.tsx",
      "content": "'use client';\n\nimport { RiArrowLeftLine, RiArrowRightLine, RiMoreFill } from '@remixicon/react';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { Modal } from '@/components/ui/wideset/modal/Modal';\nimport { Tabs } from '@/components/ui/wideset/tabs/Tabs';\n\nimport type { Order } from './data';\nimport { OrderFacts } from './order-facts';\nimport { OrderThumbnail } from './order-thumbnail';\nimport { OrderTimeline } from './order-timeline';\nimport { RecordStep } from './record-step';\n\ntype OrderDetailsModalProps = {\n  order: Order;\n  open: boolean;\n  onOpenChange: (open: boolean) => void;\n  /** Steps to the order before this one; left out on the first, which disables the step. */\n  onPrevious?: () => void;\n  /** Steps to the order after this one; left out on the last. */\n  onNext?: () => void;\n};\n\n/** The tabs whose panel is a list of facts; Order history, the first tab, is the timeline. */\nconst FACT_TABS = [\n  { value: 'item', label: 'Item details' },\n  { value: 'courier', label: 'Courier' },\n  { value: 'receiver', label: 'Receiver' },\n] as const;\n\n/**\n * Figma's Modal `Type=Details`: a record read over the page. Everything above the footer scrolls\n * as one, so the modal never outgrows a short window; the footer stays put and steps to the\n * neighbouring record, swapping the content without closing.\n */\nexport function OrderDetailsModal({\n  order,\n  open,\n  onOpenChange,\n  onPrevious,\n  onNext,\n}: OrderDetailsModalProps) {\n  return (\n    <Modal open={open} onOpenChange={onOpenChange}>\n      {/* Figma's close button sits 20px from the top, over the content: it is placed below. */}\n      <Modal.Content\n        showCloseButton={false}\n        // The dialog takes the focus, not its first button: a record is read from the top. It is\n        // not a control, so it shows no ring (Popup's content does the same).\n        className=\"ws-block-utility outline-hidden\"\n        onOpenAutoFocus={(event) => {\n          event.preventDefault();\n          if (event.currentTarget instanceof HTMLElement) event.currentTarget.focus();\n        }}\n      >\n        <div className=\"ws-scrollbar flex min-h-0 flex-1 flex-col overflow-y-auto\">\n          <div className=\"gap-ws-12 p-ws-11 relative flex flex-col items-start\">\n            <OrderThumbnail icon={order.icon} />\n            <div className=\"flex w-full flex-col\">\n              {/* Modal.Title is 18px; Figma's title here is 24/32 in Static/Text/Base. */}\n              <Modal.Title className=\"-mt-ws-2\">\n                <span className=\"typography-title-sm text-ws-static-base block\">\n                  Order #{order.id}\n                </span>\n              </Modal.Title>\n              <Modal.Description className=\"mt-ws-7 pb-ws-0\">{order.description}</Modal.Description>\n              <div className=\"mt-ws-7 py-ws-5\">\n                <OrderFacts facts={order.facts} />\n              </div>\n            </div>\n            <div className=\"gap-ws-5 flex\">\n              <Button size=\"sm\">Print details</Button>\n              <Button size=\"sm\" variant=\"secondary\" preset=\"border\">\n                Confirmation\n              </Button>\n              <IconButton\n                size=\"sm\"\n                variant=\"secondary\"\n                preset=\"border\"\n                icon={RiMoreFill}\n                aria-label=\"More actions\"\n              />\n            </div>\n            {/* Last in its block, so the keyboard reaches the record's actions first. */}\n            <Modal.Close className=\"top-ws-11 right-ws-11 absolute\" />\n          </div>\n\n          <Tabs defaultValue=\"history\" size=\"sm\" divider={false}>\n            {/* The line under the tabs runs edge to edge: Static/Stroke/Base, on the row. */}\n            <div className=\"border-ws-static-base px-ws-11 pt-ws-1 border-b\">\n              <Tabs.List aria-label=\"Order sections\">\n                <Tabs.Item value=\"history\">\n                  <Tabs.Label>Order history</Tabs.Label>\n                </Tabs.Item>\n                {FACT_TABS.map((tab) => (\n                  <Tabs.Item key={tab.value} value={tab.value}>\n                    <Tabs.Label>{tab.label}</Tabs.Label>\n                  </Tabs.Item>\n                ))}\n              </Tabs.List>\n            </div>\n            <div className=\"px-ws-11 py-ws-12\">\n              <Tabs.Content value=\"history\">\n                <OrderTimeline events={order.history} />\n              </Tabs.Content>\n              {FACT_TABS.map((tab) => (\n                <Tabs.Content key={tab.value} value={tab.value}>\n                  <OrderFacts facts={order[tab.value]} />\n                </Tabs.Content>\n              ))}\n            </div>\n          </Tabs>\n        </div>\n\n        <Modal.Footer variant=\"extension\">\n          <RecordStep label=\"Previous order\" icon={RiArrowLeftLine} onClick={onPrevious} />\n          <RecordStep label=\"Next order\" icon={RiArrowRightLine} iconLast onClick={onNext} />\n        </Modal.Footer>\n      </Modal.Content>\n    </Modal>\n  );\n}\n"
    },
    {
      "path": "src/blocks/modal-details/order-facts.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/modal-details/order-facts.tsx",
      "content": "'use client';\n\n// TODO(custom): facts in two columns (label above value); no DescriptionList in Wideset.\nimport type { Fact } from './data';\n\n/**\n * A record's facts, two to a row as Figma draws them. A value keeps to one line, so a long\n * address is cut with an ellipsis and read in full on hover.\n */\nexport function OrderFacts({ facts }: { facts: Fact[] }) {\n  return (\n    <dl className=\"gap-x-ws-5 gap-y-ws-9 grid grid-cols-2\">\n      {facts.map((fact) => (\n        <div key={fact.label} className=\"gap-ws-3 flex min-w-0 flex-col\">\n          <dt className=\"typography-body-sm text-ws-static-subtle\">{fact.label}</dt>\n          <dd className=\"typography-body-md text-ws-static-base truncate\" title={fact.value}>\n            {fact.value}\n          </dd>\n        </div>\n      ))}\n    </dl>\n  );\n}\n"
    },
    {
      "path": "src/blocks/modal-details/order-thumbnail.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/modal-details/order-thumbnail.tsx",
      "content": "'use client';\n\n// TODO(custom): product picture tile (116px, outlined); Wideset's Thumbnail is internal and stops at 40px.\nimport type { RemixiconComponentType } from '@remixicon/react';\n\n/**\n * The record's picture: Figma's Order Badge, a 116px outlined tile. A block ships no binary\n * assets, so an icon of the product stands in for the photo.\n */\nexport function OrderThumbnail({ icon: Icon }: { icon: RemixiconComponentType }) {\n  return (\n    // Figma's stroke (#ddd) and radius (12px) are unbound: Static/Stroke/Base and Container/md.\n    <div\n      aria-hidden=\"true\"\n      className=\"border-ws-static-base rounded-ws-container-md text-ws-static-subtle flex size-[7.25rem] shrink-0 items-center justify-center border\"\n    >\n      <Icon className=\"size-ws-18\" />\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/modal-details/order-timeline.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/modal-details/order-timeline.tsx",
      "content": "'use client';\n\n// TODO(custom): event timeline (dot, event, time, text, facts); no Timeline in Wideset.\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { OrderEvent } from './data';\n\n/**\n * What happened to the order, newest first, on a line of dots: the event and when, what it meant,\n * and the facts that came with it.\n */\nexport function OrderTimeline({ events }: { events: OrderEvent[] }) {\n  return (\n    <ol className=\"flex flex-col\">\n      {events.map((event, index) => {\n        const last = index === events.length - 1;\n        return (\n          <li key={event.id} className={cn('gap-ws-7 relative flex', !last && 'pb-ws-12')}>\n            {/* Figma's dot (#c2c2c2, 11px down) is unbound: the nearest tokens stand in. */}\n            <span aria-hidden=\"true\" className=\"w-ws-13 pt-ws-6 flex shrink-0 justify-center\">\n              <span className=\"size-ws-4 rounded-ws-control-full bg-(--ws-semantic-stroke-neutral)\" />\n            </span>\n            {/* The line stops 4px short of the dots at both ends. */}\n            {last ? null : (\n              <span\n                aria-hidden=\"true\"\n                className=\"border-ws-static-base left-ws-8 top-ws-11 -bottom-ws-4 absolute border-l\"\n              />\n            )}\n            <div className=\"gap-ws-3 flex min-w-0 flex-1 flex-col\">\n              <div className=\"gap-ws-12 flex items-start justify-between\">\n                <p className=\"typography-label-strong-sm text-ws-static-base\">{event.title}</p>\n                <p className=\"typography-caption-md text-ws-static-subtle shrink-0\">{event.at}</p>\n              </div>\n              <p className=\"typography-body-sm text-ws-static-subtle\">{event.text}</p>\n              {event.details ? (\n                <dl className=\"mt-ws-7 gap-ws-2 text-ws-static-subtle flex flex-col\">\n                  {event.details.map((detail) => (\n                    <div key={detail.label} className=\"typography-body-sm\">\n                      <dt className=\"font-ws-semibold inline\">{detail.label}: </dt>\n                      <dd className=\"inline\">{detail.value}</dd>\n                    </div>\n                  ))}\n                </dl>\n              ) : null}\n            </div>\n          </li>\n        );\n      })}\n    </ol>\n  );\n}\n"
    },
    {
      "path": "src/blocks/modal-details/record-step.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/modal-details/record-step.tsx",
      "content": "'use client';\n\n// TODO(custom): a step to the neighbouring record (xs icon button with its words beside it); no such control in Wideset.\nimport type { RemixiconComponentType } from '@remixicon/react';\nimport { cn } from '@/lib/wideset/utils';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { useId } from 'react';\n\ntype RecordStepProps = {\n  label: string;\n  icon: RemixiconComponentType;\n  /** Puts the words first, for the step on the right. */\n  iconLast?: boolean;\n  /** Left out when there is no record on that side: the step is disabled. */\n  onClick?: () => void;\n};\n\n/**\n * Figma's footer step: an icon button and the words that say where it goes. The words are the\n * button's `label`, so a click on them steps too and the pair is one target.\n */\nexport function RecordStep({ label, icon, iconLast, onClick }: RecordStepProps) {\n  const id = useId();\n\n  return (\n    <span className={cn('gap-ws-5 flex items-center', iconLast && 'flex-row-reverse')}>\n      <IconButton\n        id={id}\n        variant=\"secondary\"\n        preset=\"border\"\n        size=\"xs\"\n        icon={icon}\n        aria-label={label}\n        disabled={!onClick}\n        onClick={onClick}\n      />\n      <label htmlFor={id} aria-hidden=\"true\" className=\"typography-body-md text-ws-static-subtle\">\n        {label}\n      </label>\n    </span>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "1.1.0",
    "commit": "a734f9f0"
  }
}
