{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "order-detail",
  "title": "Order Detail",
  "author": "Zubeyr <https://zubeyr.dev>",
  "description": "A record detail page: header with status badges and navigation, a customer note, line items, a payment summary and a side panel with contact, address, conversion, tags and timeline.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "https://tomei.zubeyr.dev/ui/r/sidebar.json",
    "https://tomei.zubeyr.dev/ui/r/button.json",
    "https://tomei.zubeyr.dev/ui/r/badge.json",
    "https://tomei.zubeyr.dev/ui/r/timeline.json"
  ],
  "files": [
    {
      "path": "registry/dashboard/pages/order-detail/order-detail.tsx",
      "content": "import {\n  BarChart3,\n  ChevronDown,\n  ChevronUp,\n  Globe,\n  Home,\n  Mail,\n  MapPin,\n  MoreHorizontal,\n  Package,\n  Pencil,\n  Plus,\n  Printer,\n  ShoppingBag,\n  Truck,\n  Users,\n} from 'lucide-react'\n\nimport { Badge } from '@/registry/dashboard/components/badge/badge'\nimport { Button } from '@/registry/dashboard/components/button/button'\nimport { InfoRow, InfoSection } from './info-section'\nimport { Note } from './note'\nimport { PageHeader } from './page-header'\nimport {\n  Sidebar,\n  SidebarContent,\n  SidebarFooter,\n  SidebarGroup,\n  SidebarHeader,\n  SidebarItem,\n} from '@/registry/dashboard/components/sidebar/sidebar'\nimport { SummaryList } from './summary-list'\nimport { LineItems } from './line-items'\nimport { Timeline } from '@/registry/dashboard/blocks/timeline/timeline'\n\nimport { customer, events, items, tags } from './data'\n\nexport function OrderDetail() {\n  return (\n    <div className=\"flex h-svh overflow-hidden bg-sidebar text-foreground\">\n      <Sidebar className=\"border-r-0 max-lg:hidden\">\n        <SidebarHeader\n          logo={<span className=\"size-8 rounded-lg bg-sidebar-primary-foreground\" />}\n          title=\"Tomei\"\n          subtitle=\"Store admin\"\n        />\n        <SidebarContent>\n          <SidebarGroup>\n            <SidebarItem icon={<Home />}>Home</SidebarItem>\n            <SidebarItem icon={<ShoppingBag />} count={12} active>\n              Orders\n            </SidebarItem>\n            <SidebarItem icon={<Package />}>Products</SidebarItem>\n            <SidebarItem icon={<Users />}>Customers</SidebarItem>\n            <SidebarItem icon={<BarChart3 />}>Analytics</SidebarItem>\n          </SidebarGroup>\n        </SidebarContent>\n        <SidebarFooter>\n          <SidebarItem icon={<Globe />}>Online store</SidebarItem>\n        </SidebarFooter>\n      </Sidebar>\n\n      <main className=\"min-w-0 flex-1 overflow-y-auto bg-card lg:my-2 lg:mr-2 lg:rounded-2xl lg:border\">\n        <div className=\"mx-auto flex max-w-[1120px] flex-col gap-8 p-6\">\n          <PageHeader\n            backHref=\"#\"\n            breadcrumb={\n              <span className=\"flex items-center gap-1.5\">\n                <ShoppingBag className=\"size-4\" /> Orders\n              </span>\n            }\n            tools={\n              <>\n                <Button size=\"icon\" aria-label=\"Print\">\n                  <Printer />\n                </Button>\n                <Button size=\"icon\" aria-label=\"Edit\">\n                  <Pencil />\n                </Button>\n                <Button size=\"icon\" aria-label=\"More actions\">\n                  <MoreHorizontal />\n                </Button>\n                <Button size=\"icon\" aria-label=\"Previous order\">\n                  <ChevronUp />\n                </Button>\n                <Button size=\"icon\" aria-label=\"Next order\">\n                  <ChevronDown />\n                </Button>\n              </>\n            }\n            title=\"Order #1078\"\n            badges={\n              <>\n                <Badge indicator=\"dot\">Paid</Badge>\n                <Badge tone=\"warning\" indicator=\"ring\">\n                  Unfulfilled\n                </Badge>\n              </>\n            }\n            subtitle=\"Oct 29, 2026 at 7:24 PM via Online Store\"\n          />\n\n          <div className=\"grid gap-10 lg:grid-cols-[minmax(0,1fr)_20rem]\">\n            <div className=\"flex min-w-0 flex-col gap-8\">\n              <Note label=\"Note from customer\">\n                Please delay shipping by two days, I&apos;m away and can&apos;t collect the package.\n                Thanks!\n              </Note>\n\n              <LineItems\n                items={items}\n                status={\n                  <Badge tone=\"warning\" indicator=\"ring\">\n                    Unfulfilled\n                  </Badge>\n                }\n                actions={\n                  <>\n                    <Button variant=\"ghost\" size=\"icon\" aria-label=\"More fulfillment actions\">\n                      <MoreHorizontal />\n                    </Button>\n                    <Button>Mark as fulfilled</Button>\n                    <Button variant=\"primary\">Create shipping label</Button>\n                  </>\n                }\n                meta={\n                  <>\n                    <span className=\"flex items-center gap-2\">\n                      <Truck /> Express\n                    </span>\n                    <span className=\"flex items-center gap-2\">\n                      <MapPin /> Main warehouse\n                    </span>\n                  </>\n                }\n              />\n\n              <section className=\"flex flex-col gap-3\">\n                <h2 className=\"text-base font-semibold\">Payment</h2>\n                <SummaryList\n                  rows={[\n                    { label: 'Subtotal', detail: '4 items', value: '$397.50' },\n                    { label: 'Discount', detail: 'WELCOME10', value: '−$30.00' },\n                    { label: 'Shipping', detail: 'Express', value: '$4.99' },\n                  ]}\n                  total={{ label: 'Total', value: '$372.49' }}\n                  footer={[\n                    { label: 'Store credit', value: '$50.00' },\n                    { label: 'Visa •••• 3840', value: '$322.49' },\n                  ]}\n                />\n              </section>\n            </div>\n\n            <aside className=\"flex flex-col\">\n              <InfoSection>\n                <h2 className=\"text-lg font-semibold\">{customer.name}</h2>\n                <InfoRow icon={<Mail />}>{customer.email}</InfoRow>\n                <InfoRow icon={<ShoppingBag />}>{customer.orders} orders</InfoRow>\n              </InfoSection>\n\n              <InfoSection title=\"Shipping address\">\n                <address className=\"text-sm leading-6 not-italic\">\n                  {customer.address.map((line) => (\n                    <span key={line} className=\"block\">\n                      {line}\n                    </span>\n                  ))}\n                </address>\n              </InfoSection>\n\n              <InfoSection title=\"Conversion summary\">\n                <InfoRow icon={<ShoppingBag />}>{customer.orders}th order</InfoRow>\n                <InfoRow icon={<Globe />}>Source: direct</InfoRow>\n              </InfoSection>\n\n              <InfoSection\n                title=\"Tags\"\n                action={\n                  <Button variant=\"ghost\" size=\"icon-sm\" aria-label=\"Add tag\">\n                    <Plus />\n                  </Button>\n                }\n              >\n                <div className=\"flex flex-wrap gap-1.5\">\n                  {tags.map((tag) => (\n                    <Badge key={tag}>{tag}</Badge>\n                  ))}\n                </div>\n              </InfoSection>\n\n              <InfoSection title=\"Timeline\">\n                <Timeline events={events} />\n              </InfoSection>\n            </aside>\n          </div>\n        </div>\n      </main>\n    </div>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/dashboard/order-detail/order-detail.tsx"
    },
    {
      "path": "registry/dashboard/pages/order-detail/data.tsx",
      "content": "import type { TimelineEvent } from '@/registry/dashboard/blocks/timeline/timeline'\n\nimport type { LineItem } from './line-items'\n\nconst swatch = (color: string) => <span className=\"size-full\" style={{ background: color }} />\n\nexport const items: LineItem[] = [\n  {\n    id: '1',\n    name: 'Canvas Sneakers',\n    variant: '10.5 US',\n    price: 235,\n    quantity: 1,\n    image: swatch('#d6cfc4'),\n  },\n  {\n    id: '2',\n    name: 'Button-down Shirt',\n    variant: 'Blue / XL',\n    price: 65,\n    quantity: 2,\n    image: swatch('#3b4a6b'),\n  },\n  {\n    id: '3',\n    name: 'Knit Beanie',\n    variant: 'One size',\n    price: 32.5,\n    quantity: 1,\n    image: swatch('#6b7a4f'),\n  },\n]\n\nexport const customer = {\n  name: 'Jordan Ellis',\n  email: 'jordan@example.com',\n  orders: 4,\n  address: ['Jordan Ellis', '184 Kent Ave', 'Brooklyn, NY', 'United States'],\n}\n\nexport const tags = ['VIP', 'Wholesale']\n\nexport const events: TimelineEvent[] = [\n  { id: '1', content: 'Order confirmation email was sent to Jordan Ellis.', time: '1:36 PM' },\n  { id: '2', content: 'A $322.49 payment was processed on Visa •••• 3840.', time: '1:36 PM' },\n  { id: '3', content: 'Jordan Ellis placed this order on the Online Store.', time: '1:35 PM' },\n]\n",
      "type": "registry:component",
      "target": "components/dashboard/order-detail/data.tsx"
    },
    {
      "path": "registry/dashboard/pages/order-detail/info-section.tsx",
      "content": "import { cn } from '@/lib/utils'\n\ntype InfoSectionProps = {\n  title?: React.ReactNode\n  action?: React.ReactNode\n  className?: string\n  children?: React.ReactNode\n}\n\nexport function InfoSection({ title, action, className, children }: InfoSectionProps) {\n  return (\n    <section\n      className={cn('flex flex-col gap-3 border-b py-5 first:pt-0 last:border-0', className)}\n    >\n      {(title || action) && (\n        <div className=\"flex items-center justify-between gap-2\">\n          {title && <h2 className=\"text-sm text-muted-foreground\">{title}</h2>}\n          {action}\n        </div>\n      )}\n      {children}\n    </section>\n  )\n}\n\nexport function InfoRow({\n  icon,\n  className,\n  children,\n}: {\n  icon?: React.ReactNode\n  className?: string\n  children: React.ReactNode\n}) {\n  return (\n    <p\n      className={cn(\n        'flex min-w-0 items-center gap-2.5 text-sm [&_svg]:size-4 [&_svg]:shrink-0',\n        className,\n      )}\n    >\n      {icon && <span className=\"flex text-muted-foreground\">{icon}</span>}\n      <span className=\"min-w-0 truncate\">{children}</span>\n    </p>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/dashboard/order-detail/info-section.tsx"
    },
    {
      "path": "registry/dashboard/pages/order-detail/line-items.tsx",
      "content": "import { cn } from '@/lib/utils'\n\nexport type LineItem = {\n  id: string\n  name: React.ReactNode\n  image?: React.ReactNode\n  variant?: React.ReactNode\n  price: number\n  quantity: number\n}\n\ntype LineItemsProps = {\n  items: LineItem[]\n  status?: React.ReactNode\n  actions?: React.ReactNode\n  meta?: React.ReactNode\n  formatOptions?: Intl.NumberFormatOptions\n  className?: string\n}\n\nexport function LineItems({\n  items,\n  status,\n  actions,\n  meta,\n  formatOptions = { style: 'currency', currency: 'USD' },\n  className,\n}: LineItemsProps) {\n  const money = new Intl.NumberFormat('en-US', formatOptions)\n\n  return (\n    <section className={cn('flex flex-col gap-3', className)}>\n      {(status || actions) && (\n        <div className=\"flex flex-wrap items-center justify-between gap-2\">\n          <div className=\"flex items-center gap-2 text-base font-semibold\">{status}</div>\n          {actions && <div className=\"flex items-center gap-2\">{actions}</div>}\n        </div>\n      )}\n      <div className=\"rounded-xl bg-card shadow-(--shadow-card)\">\n        {meta && (\n          <div className=\"flex items-center justify-between gap-3 border-b px-4 py-3 text-sm text-muted-foreground [&_svg]:size-4\">\n            {meta}\n          </div>\n        )}\n        <ul className=\"divide-y px-4\">\n          {items.map((item) => (\n            <li\n              key={item.id}\n              className=\"grid grid-cols-[auto_1fr_auto_auto] items-center gap-4 py-3\"\n            >\n              <span className=\"flex size-12 items-center justify-center overflow-hidden rounded-lg bg-muted\">\n                {item.image}\n              </span>\n              <span className=\"flex min-w-0 flex-col items-start gap-1.5\">\n                <span className=\"truncate text-sm font-medium\">{item.name}</span>\n                {item.variant && (\n                  <span className=\"rounded-md bg-muted px-1.5 py-0.5 text-xs\">{item.variant}</span>\n                )}\n              </span>\n              <span className=\"flex items-center gap-1.5 text-sm text-muted-foreground tabular-nums max-sm:hidden\">\n                {money.format(item.price)} ×\n                <span className=\"rounded bg-muted px-1.5 text-xs text-foreground\">\n                  {item.quantity}\n                </span>\n              </span>\n              <span className=\"w-20 text-right text-sm tabular-nums\">\n                {money.format(item.price * item.quantity)}\n              </span>\n            </li>\n          ))}\n        </ul>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/dashboard/order-detail/line-items.tsx"
    },
    {
      "path": "registry/dashboard/pages/order-detail/note.tsx",
      "content": "import { cn } from '@/lib/utils'\n\nconst tones = {\n  yellow: 'bg-yellow-200/80 dark:bg-yellow-400/25',\n  blue: 'bg-sky-200/80 dark:bg-sky-400/25',\n  pink: 'bg-pink-200/80 dark:bg-pink-400/25',\n}\n\ntype NoteProps = {\n  label?: React.ReactNode\n  tone?: keyof typeof tones\n  className?: string\n  children: React.ReactNode\n}\n\nexport function Note({ label, tone = 'yellow', className, children }: NoteProps) {\n  return (\n    <figure className={cn('flex flex-col gap-1.5 border-l pl-3', className)}>\n      {label && <figcaption className=\"text-xs text-muted-foreground\">{label}</figcaption>}\n      <blockquote className=\"text-sm leading-7\">\n        <span className={cn('box-decoration-clone px-1.5 py-1', tones[tone])}>{children}</span>\n      </blockquote>\n    </figure>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/dashboard/order-detail/note.tsx"
    },
    {
      "path": "registry/dashboard/pages/order-detail/page-header.tsx",
      "content": "import { cn } from '@/lib/utils'\n\ntype PageHeaderProps = {\n  title: React.ReactNode\n  badges?: React.ReactNode\n  subtitle?: React.ReactNode\n  backHref?: string\n  breadcrumb?: React.ReactNode\n  tools?: React.ReactNode\n  actions?: React.ReactNode\n  className?: string\n}\n\nexport function PageHeader({\n  title,\n  badges,\n  subtitle,\n  backHref,\n  breadcrumb,\n  tools,\n  actions,\n  className,\n}: PageHeaderProps) {\n  return (\n    <header className={cn('flex flex-col gap-6', className)}>\n      {(backHref || breadcrumb || tools) && (\n        <div className=\"flex items-center justify-between gap-3\">\n          <div className=\"flex items-center gap-2 text-sm text-muted-foreground\">\n            {backHref && (\n              <a\n                href={backHref}\n                aria-label=\"Back\"\n                className=\"flex size-8 items-center justify-center rounded-full bg-card text-foreground shadow-(--shadow-button) hover:bg-muted\"\n              >\n                <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden className=\"size-4\">\n                  <path\n                    d=\"M10 3 5 8l5 5\"\n                    stroke=\"currentColor\"\n                    strokeWidth=\"1.6\"\n                    strokeLinecap=\"round\"\n                    strokeLinejoin=\"round\"\n                  />\n                </svg>\n              </a>\n            )}\n            {breadcrumb}\n          </div>\n          {tools && <div className=\"flex items-center gap-1.5\">{tools}</div>}\n        </div>\n      )}\n      <div className=\"flex flex-wrap items-end justify-between gap-4\">\n        <div className=\"flex min-w-0 flex-col gap-2\">\n          <div className=\"flex flex-wrap items-center gap-2\">\n            <h1 className=\"text-2xl font-semibold tracking-tight\">{title}</h1>\n            {badges}\n          </div>\n          {subtitle && <p className=\"text-sm text-muted-foreground\">{subtitle}</p>}\n        </div>\n        {actions && <div className=\"flex flex-wrap items-center gap-2\">{actions}</div>}\n      </div>\n    </header>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/dashboard/order-detail/page-header.tsx"
    },
    {
      "path": "registry/dashboard/pages/order-detail/summary-list.tsx",
      "content": "import { cn } from '@/lib/utils'\n\nexport type SummaryRow = {\n  label: React.ReactNode\n  detail?: React.ReactNode\n  value: React.ReactNode\n}\n\ntype SummaryListProps = {\n  rows: SummaryRow[]\n  total?: { label: React.ReactNode; value: React.ReactNode }\n  footer?: SummaryRow[]\n  className?: string\n}\n\nfunction Row({ label, detail, value, strong }: SummaryRow & { strong?: boolean }) {\n  return (\n    <div\n      className={cn(\n        'grid grid-cols-[1fr_auto_6rem] items-center gap-4 py-2 text-sm',\n        strong && 'font-semibold',\n      )}\n    >\n      <span>{label}</span>\n      <span className=\"text-right text-muted-foreground\">{detail}</span>\n      <span className=\"text-right tabular-nums\">{value}</span>\n    </div>\n  )\n}\n\nexport function SummaryList({ rows, total, footer, className }: SummaryListProps) {\n  return (\n    <div className={cn('rounded-xl bg-muted', className)}>\n      <div className=\"rounded-xl bg-card px-4 py-2 shadow-(--shadow-card)\">\n        {rows.map((row, i) => (\n          <Row key={i} {...row} />\n        ))}\n        {total && (\n          <div className=\"mt-1 border-t pt-1\">\n            <Row label={total.label} value={total.value} strong />\n          </div>\n        )}\n      </div>\n      {footer?.length ? (\n        <div className=\"px-4 py-2\">\n          {footer.map((row, i) => (\n            <Row key={i} {...row} />\n          ))}\n        </div>\n      ) : null}\n    </div>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/dashboard/order-detail/summary-list.tsx"
    }
  ],
  "meta": {
    "scenario": "dashboard",
    "kind": "pages"
  },
  "categories": [
    "dashboard",
    "detail",
    "layout"
  ],
  "type": "registry:block"
}