{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-finance-dashboard",
  "type": "registry:block",
  "title": "Finance dashboard",
  "description": "An overview under a top bar: key figures, charts, a transactions table and a side panel.",
  "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/button.json",
    "https://wideset.co/r/icon-button.json",
    "https://wideset.co/r/progress-bar.json",
    "https://wideset.co/r/segmented-control.json",
    "https://wideset.co/r/select.json",
    "https://wideset.co/r/status-badge.json",
    "https://wideset.co/r/table.json",
    "https://wideset.co/r/tabs.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/finance-dashboard/Change.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/finance-dashboard/Change.tsx",
      "content": "'use client';\n\nimport { RiArrowDownLine, RiArrowUpLine } from '@remixicon/react';\nimport { cn } from '@/lib/wideset/utils';\nimport type { ReactNode } from 'react';\n\nimport { formatChange } from './format';\n\n/** A change against the previous period: arrow and percentage, green up and red down. */\nexport function Change({ value, children }: { value: number; children?: ReactNode }) {\n  const up = value >= 0;\n  const Arrow = up ? RiArrowUpLine : RiArrowDownLine;\n\n  return (\n    <span className=\"gap-ws-3 typography-number-sm flex items-center tabular-nums\">\n      <Arrow\n        aria-hidden\n        className={cn(\n          'size-ws-7 shrink-0',\n          up ? 'text-ws-semantic-positive' : 'text-ws-semantic-negative',\n        )}\n      />\n      <span>\n        <span className={up ? 'text-ws-semantic-positive' : 'text-ws-semantic-negative'}>\n          <span className=\"sr-only\">{up ? 'Up ' : 'Down '}</span>\n          {formatChange(value)}\n        </span>\n        {children && <span className=\"text-ws-static-base\"> {children}</span>}\n      </span>\n    </span>\n  );\n}\n"
    },
    {
      "path": "src/blocks/finance-dashboard/data.ts",
      "type": "registry:file",
      "target": "blocks/wideset/finance-dashboard/data.ts",
      "content": "import { RiBarChartLine, RiBox3Line, RiHome5Line, RiTaskLine } from '@remixicon/react';\n\nexport const NAV = [\n  { label: 'Overview', href: '#overview', icon: RiHome5Line },\n  { label: 'Analytics', href: '#analytics', icon: RiBarChartLine },\n  { label: 'Products', href: '#products', icon: RiBox3Line },\n  { label: 'Tasks', href: '#tasks', icon: RiTaskLine },\n];\n\n/** `change` is against the previous period: 0.0354 is 3.54% up. */\nexport const KEY_FIGURES = [\n  { label: 'Approved Transactions', value: 1_748, change: 0.0354 },\n  { label: 'Declined Transactions', value: 224, change: 0.0123 },\n  { label: 'Refunded Transactions', value: 87, change: -0.0354 },\n  { label: 'New Customers', value: 344, change: -0.0123 },\n];\n\n/** Volume this year in USD, one point every two to three days, newest last. */\nexport const VOLUME = {\n  gross: { label: 'Gross Volume', total: 48_580, change: 0.0312 },\n  net: { label: 'Net Volume', total: 29_540, change: 0.0154 },\n  /** Gross volume, 0 to 100,000. */\n  grossSeries: [\n    61300, 60300, 62100, 61100, 61600, 60900, 64100, 64500, 65700, 66000, 67500, 68200, 66200,\n    63700, 61400, 62200, 60400, 59800, 60500, 60300, 62000, 65800, 67800, 70900, 73700, 76000,\n    76900, 77800, 79600, 79900, 79400, 80200, 79900, 79600, 79500, 79300, 78800, 77300, 72900,\n    70000, 67800, 62800, 58600, 56600, 53700, 51300, 52300, 51100, 50400, 50300, 51400, 52000,\n    53000, 56200, 57500, 56900, 56900, 56500, 57200, 56600, 58400, 58200, 58600, 58100, 59500,\n    59900, 59500, 60500, 61400, 63900, 64300, 65100, 65500, 68700, 69100, 70400, 70900, 73700,\n    74700, 76700, 77800, 77300, 77900, 77900, 76400, 75500, 74300, 73700, 72700, 72800, 72300,\n    72300, 73500, 72500, 75400, 77100, 76600, 77400, 78500, 78900, 80500, 81400, 82900, 85900,\n    85800, 88000, 88500, 88100, 88400, 89900, 90700, 90900, 92600, 92700, 90200, 89500, 88400,\n    90400, 90600, 91500, 91700, 92300, 94200, 93600, 95400, 94600, 95300, 93800, 93900, 93700,\n    94300, 94800, 95600, 95700, 96200, 90400, 88500, 86900, 85400, 83900, 82400, 81200, 80400,\n    81700,\n  ],\n  /** Net volume, 0 to 100,000. */\n  netSeries: [\n    34600, 34600, 34500, 32600, 33300, 33700, 32600, 33300, 34200, 35100, 33700, 33900, 34300,\n    35200, 35400, 35900, 36600, 37500, 37700, 37300, 35800, 34800, 33800, 32800, 32300, 30900,\n    30000, 30300, 31400, 32800, 33800, 34700, 35000, 36100, 36600, 37700, 37400, 36000, 36000,\n    35800, 36900, 37400, 37800, 36300, 35800, 35300, 34400, 32200, 32100, 33300, 34100, 34300,\n    35700, 36300, 36900, 37300, 38000, 38500, 38700, 36600, 36200, 35800, 35600, 35800, 36600,\n    37400, 38400, 38500, 39300, 40300, 41400, 43500, 43300, 43400, 44200, 45300, 44100, 44300,\n    44300, 44200, 44500, 43400, 42800, 43000, 43000, 43700, 44100, 44500, 45300, 46700, 48400,\n    50100, 50900, 53000, 55000, 55400, 56200, 58600, 55000, 52700, 50700, 48000, 47700, 47700,\n    49300, 49700, 51200, 51400, 48600, 46900, 45400, 44600, 43900, 42700, 41900, 41400, 40500,\n    41400, 41400, 42500, 43600, 45000, 46000, 46300, 47500, 47900, 48300, 49500, 50300, 50900,\n    52300, 53900, 54700, 55300, 55500, 56200, 56000, 57300, 59800, 60200, 60600, 60300, 61100,\n    62500,\n  ],\n  /** Transactions per week, 48 weeks. */\n  weeklyTransactions: [\n    3, 2, 12, 5, 11, 19, 11, 30, 6, 9, 21, 14, 10, 19, 26, 32, 17, 10, 3, 3, 10, 19, 4, 19, 10, 20,\n    25, 32, 28, 19, 6, 28, 10, 19, 6, 4, 10, 19, 6, 10, 10, 10, 6, 32, 10, 19, 6, 6,\n  ],\n  /** First day of each four-week group on the axis. */\n  axis: [\n    '2025-02-12',\n    '2025-03-12',\n    '2025-04-09',\n    '2025-05-07',\n    '2025-06-11',\n    '2025-07-09',\n    '2025-08-13',\n    '2025-09-10',\n    '2025-10-08',\n    '2025-11-12',\n    '2025-12-10',\n    '2026-01-07',\n  ],\n};\n\nexport const PERIODS = [\n  { value: 'this-year', label: 'This year' },\n  { value: 'last-year', label: 'Last year' },\n  { value: 'last-90-days', label: 'Last 90 days' },\n];\n\nexport const OUTCOMES = [\n  { value: 'approve', label: 'Approve' },\n  { value: 'decline', label: 'Decline' },\n  { value: 'refund', label: 'Refund' },\n];\n\nexport type Payment = {\n  id: string;\n  customer: string;\n  initials: string;\n  type: string;\n  status: 'approved' | 'declined';\n  /** Share of the amount settled, 0 to 100. */\n  progress: number;\n  due: string;\n  amount: number;\n};\n\nexport const PAYMENTS: Payment[] = [\n  {\n    id: 'pay-1042',\n    customer: 'Ralph Edwards',\n    initials: 'RE',\n    type: 'Refund',\n    status: 'approved',\n    progress: 100,\n    due: '2024-05-30',\n    amount: 127.25,\n  },\n  {\n    id: 'pay-1043',\n    customer: 'Jerome Bell',\n    initials: 'JB',\n    type: 'Sale',\n    status: 'declined',\n    progress: 50,\n    due: '2024-03-15',\n    amount: 89.3,\n  },\n];\n\n/** The side panel: this month's volume, one entry per tab, with a series from 6 Jan to 10 Feb. */\nexport const MONTHLY_VOLUME = [\n  {\n    value: 'total',\n    label: 'Total',\n    noun: 'total volume',\n    amount: 68_412.9,\n    change: 0.0212,\n    reference: 2_128.89,\n    series: [\n      1974, 1986, 1981, 1975, 1955, 1952, 1979, 1989, 2013, 2019, 2028, 2032, 1995, 2015, 2027,\n      2039, 2002, 1966, 1950, 1944, 1955, 1959, 1975, 1965, 1976, 1989, 1979, 2021, 2036, 2065,\n      2053, 2039, 2035, 2036, 2053, 2062, 2055, 2037, 2029, 2061, 2047, 2056, 2070, 2040, 2046,\n      2080, 2039, 2038, 2041, 2029, 2047, 2051, 2025, 2050, 2071, 2097, 2134, 2145, 2151, 2126,\n      2143, 2134, 2128, 2105, 2089, 2084, 2119, 2080, 2056, 2069, 2109, 2129, 2093, 2046, 2063,\n      2056, 2041, 2073, 2107, 2119, 2132, 2149, 2191, 2210, 2227, 2243, 2212, 2246, 2271, 2286,\n      2246, 2236, 2260, 2225, 2227, 2255, 2231, 2273, 2290, 2291, 2302, 2321, 2327, 2355, 2343,\n      2337, 2364, 2367, 2350, 2375, 2410, 2401, 2373, 2373, 2373, 2370, 2405, 2385, 2417, 2391,\n    ],\n  },\n  {\n    value: 'transaction',\n    label: 'Transaction',\n    noun: 'average transaction',\n    amount: 32.61,\n    change: -0.0087,\n    reference: 32.61,\n    series: [\n      30.1, 30.3, 30.7, 30.5, 30.1, 30.1, 30.3, 30.8, 30.4, 30, 30.3, 30.5, 31.1, 31.4, 31.4, 31.3,\n      32.2, 32.0, 31.7, 31.3, 31.3, 31.3, 31.2, 31.2, 31.3, 31.5, 31.9, 31.9, 31.3, 31.5, 31.0,\n      31.0, 30.5, 30.5, 30.3, 30.5, 31.7, 31.6, 31.9, 31.4, 31.3, 31.6, 31.5, 31.7, 31.7, 31.3,\n      31.5, 31.3, 31.9, 31.7, 32.0, 32.0, 32.3, 32.0, 32.3, 32.3, 32.7, 32.8, 32.8, 32.5, 32.7,\n      32.8, 33.3, 33.1, 33.2, 33.3, 33.3, 33.3, 33.3, 33.0, 32.5, 32.4, 32.5, 33.0, 33.3, 33.6,\n      33.8, 33.9, 33.8, 34.0, 34.5, 34.2, 33.9, 34.4, 34.4, 34.6, 34.7, 34.2, 34.9, 35.3, 35.2,\n      35.3, 35.1, 34.6, 34.5, 34.4, 34.7, 34.8, 34.7, 35.0, 34.6, 34.7, 34.9, 34.7, 33.9, 33.5,\n      33.5, 33.6, 34.1, 33.6, 33.5, 33.7, 33.6, 32.7, 32.9, 33.7, 34.0, 33.6, 33.3, 33.4,\n    ],\n  },\n  {\n    value: 'day-sale',\n    label: 'Day Sale',\n    noun: 'day sale volume',\n    amount: 2_243.34,\n    change: 0.0354,\n    reference: 74.77,\n    series: [\n      73.8, 73.62, 73.92, 73.88, 73.69, 74.3, 74.38, 74.68, 74.9, 75.11, 74.69, 74.15, 73.75, 73.63,\n      73.5, 73.66, 73.62, 74.5, 74.92, 75.49, 76.03, 76.66, 76.84, 76.99, 77.14, 77.04, 77.19,\n      77.11, 77.08, 77.04, 76.94, 76.12, 75.79, 75.03, 74.19, 73.27, 72.95, 72.5, 72.15, 71.97,\n      71.84, 71.88, 72.08, 72.26, 72.8, 73.11, 72.98, 73.04, 72.98, 72.93, 73.29, 73.25, 73.27,\n      73.35, 73.58, 73.5, 73.68, 74.03, 74.29, 74.47, 74.57, 75.11, 75.42, 75.62, 75.97, 76.24,\n      76.72, 76.72, 76.73, 76.79, 76.47, 76.3, 76.05, 75.9, 75.85, 75.75, 75.85, 75.84, 76.14,\n      76.64, 76.55, 76.68, 77.08, 77.07, 77.4, 77.76, 78.17, 78.4, 78.71, 78.6, 78.69, 79.03, 79.08,\n      79.37, 79.44, 78.94, 78.66, 78.97, 79.04, 79.22, 79.25, 79.48, 79.61, 79.95, 79.77, 79.87,\n      79.7, 79.6, 79.7, 79.8, 79.96, 79.98, 79.48, 78.78, 78.4, 78.05, 77.83, 77.46, 77.16, 77.22,\n    ],\n  },\n];\n\nexport const MONTHLY_PERIOD = { from: '2026-01-06', to: '2026-02-10' };\n\n/**\n * `share` is the bar length as Figma draws it, relative to the largest card type; Figma's lengths\n * do not follow the amounts. With real data, derive it: `amount / Math.max(...amounts)`.\n */\nexport const CARD_TYPES = [\n  { name: 'Visa', amount: 1_500.31, share: 1, color: 'blue' },\n  { name: 'Mastercard', amount: 489.3, share: 0.51, color: 'green' },\n  { name: 'American Express', amount: 312, share: 0.45, color: 'yellow' },\n  { name: 'Discover', amount: 60.5, share: 0.23, color: 'cyan' },\n  { name: 'Capital One', amount: 45, share: 0.12, color: 'pink' },\n  { name: 'Other', amount: 15.75, share: 0.04, color: 'orange' },\n] as const;\n"
    },
    {
      "path": "src/blocks/finance-dashboard/format.ts",
      "type": "registry:file",
      "target": "blocks/wideset/finance-dashboard/format.ts",
      "content": "// One locale for the whole screen; swap it for the user's.\nconst LOCALE = 'en-US';\n\nconst count = new Intl.NumberFormat(LOCALE);\nconst usd = new Intl.NumberFormat(LOCALE, { style: 'currency', currency: 'USD' });\nconst usdWhole = new Intl.NumberFormat(LOCALE, {\n  style: 'currency',\n  currency: 'USD',\n  maximumFractionDigits: 0,\n});\nconst percent = new Intl.NumberFormat(LOCALE, { style: 'percent', minimumFractionDigits: 2 });\n// Dates are calendar days (`2025-02-12`), parsed as UTC midnight: format them in UTC too.\nconst day = new Intl.DateTimeFormat('en-GB', { day: 'numeric', month: 'short', timeZone: 'UTC' });\nconst dayPadded = new Intl.DateTimeFormat('en-GB', {\n  day: '2-digit',\n  month: 'short',\n  timeZone: 'UTC',\n});\nconst isoDate = new Intl.DateTimeFormat('en-CA', { timeZone: 'UTC' });\n\nexport const formatCount = (value: number) => count.format(value);\nexport const formatUsd = (value: number) => usd.format(value);\nexport const formatUsdWhole = (value: number) => usdWhole.format(value);\n/** Unsigned: the arrow beside it carries the direction. */\nexport const formatChange = (value: number) => percent.format(Math.abs(value));\nexport const formatDay = (iso: string) => day.format(new Date(iso));\nexport const formatDayPadded = (iso: string) => dayPadded.format(new Date(iso));\nexport const formatDate = (iso: string) => isoDate.format(new Date(iso));\n"
    },
    {
      "path": "src/blocks/finance-dashboard/index.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/finance-dashboard/index.tsx",
      "content": "'use client';\n\nimport '@/styles/wideset-blocks.css';\n\nimport { RiAddLine } from '@remixicon/react';\nimport { AppShell } from '@/components/ui/wideset/app-shell/AppShell';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { useState } from 'react';\n\nimport { Change } from './Change';\nimport { KEY_FIGURES } from './data';\nimport { formatCount } from './format';\nimport { PaymentsTable } from './PaymentsTable';\nimport { TopBar } from './TopBar';\nimport { VolumeChart } from './VolumeChart';\nimport { VolumePanel } from './VolumePanel';\n\n/** Finance dashboard, Flat direction: one white surface, a top bar over the page, a side panel. */\nexport default function FinanceDashboard() {\n  const [panelOpen, setPanelOpen] = useState(true);\n\n  return (\n    <AppShell className=\"ws-block-utility\" direction=\"flat\">\n      <AppShell.Main>\n        <TopBar />\n        <div className=\"px-ws-18\">\n          <div className=\"gap-ws-16 py-ws-16 mx-auto flex w-full max-w-[80rem] flex-col\">\n            <div className=\"gap-ws-13 flex items-center justify-between\">\n              <h1 className=\"typography-title-md text-ws-static-strong\">Overview</h1>\n              <Button size=\"sm\">\n                <Button.Icon icon={RiAddLine} />\n                New payment\n              </Button>\n            </div>\n\n            <div className=\"gap-ws-7 grid grid-cols-4\">\n              {KEY_FIGURES.map((figure) => (\n                <div\n                  key={figure.label}\n                  className=\"bg-ws-static-alpha-subtle rounded-ws-container-md gap-ws-3 px-ws-11 py-ws-9 flex flex-col\"\n                >\n                  <p className=\"typography-label-sm text-ws-static-subtle\">{figure.label}</p>\n                  <p className=\"gap-ws-5 flex items-baseline\">\n                    <span className=\"typography-title-md text-ws-static-strong tabular-nums\">\n                      {formatCount(figure.value)}\n                    </span>\n                    <Change value={figure.change} />\n                  </p>\n                </div>\n              ))}\n            </div>\n\n            <VolumeChart />\n            <PaymentsTable />\n          </div>\n        </div>\n      </AppShell.Main>\n      {panelOpen && <VolumePanel onClose={() => setPanelOpen(false)} />}\n    </AppShell>\n  );\n}\n"
    },
    {
      "path": "src/blocks/finance-dashboard/PaymentsTable.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/finance-dashboard/PaymentsTable.tsx",
      "content": "'use client';\n\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\nimport { ProgressBar } from '@/components/ui/wideset/progress-bar/ProgressBar';\nimport { type SortDirection } from '@/components/ui/wideset/table/Table.types';\nimport { StatusBadge } from '@/components/ui/wideset/status-badge/StatusBadge';\nimport { Table } from '@/components/ui/wideset/table/Table';\nimport { useState } from 'react';\n\nimport { type Payment, PAYMENTS } from './data';\nimport { formatDate, formatUsd } from './format';\n\ntype Key = Exclude<keyof Payment, 'id' | 'initials'>;\n\nconst COLUMNS: { key: Key; label: string; align?: 'right'; className?: string }[] = [\n  { key: 'customer', label: 'Customer', className: 'w-[23%]' },\n  { key: 'type', label: 'Type' },\n  { key: 'status', label: 'Label' },\n  { key: 'progress', label: 'Progress' },\n  { key: 'due', label: 'Due date' },\n  { key: 'amount', label: 'Amount', align: 'right' },\n];\n\nconst STATUS = {\n  approved: { label: 'Approved', color: 'positive', progress: 'success' },\n  declined: { label: 'Declined', color: 'negative', progress: 'default' },\n} as const;\n\n/** Recent payments; every column sorts. */\nexport function PaymentsTable() {\n  const [sort, setSort] = useState<{ key: Key; direction: SortDirection }>({\n    key: 'due',\n    direction: null,\n  });\n\n  const rows = sort.direction\n    ? [...PAYMENTS].sort((a, b) => {\n        const order = a[sort.key] < b[sort.key] ? -1 : a[sort.key] > b[sort.key] ? 1 : 0;\n        return sort.direction === 'asc' ? order : -order;\n      })\n    : PAYMENTS;\n\n  return (\n    <Table className=\"w-full table-fixed\">\n      <Table.Head>\n        <Table.Row>\n          {COLUMNS.map((column) => (\n            <Table.Header\n              key={column.key}\n              align={column.align}\n              className={column.className}\n              sortable\n              sortDirection={sort.key === column.key ? sort.direction : null}\n              onSort={() =>\n                setSort({\n                  key: column.key,\n                  direction: sort.key === column.key && sort.direction === 'asc' ? 'desc' : 'asc',\n                })\n              }\n            >\n              {column.label}\n            </Table.Header>\n          ))}\n        </Table.Row>\n      </Table.Head>\n      <Table.Body>\n        {rows.map((payment) => {\n          const status = STATUS[payment.status];\n          return (\n            <Table.Row key={payment.id}>\n              <Table.Cell>\n                <div className=\"gap-ws-7 flex items-center\">\n                  <Avatar size=\"sm\" initials={payment.initials} status=\"online\" />\n                  {payment.customer}\n                </div>\n              </Table.Cell>\n              <Table.Cell>{payment.type}</Table.Cell>\n              <Table.Cell>\n                <StatusBadge color={status.color}>{status.label}</StatusBadge>\n              </Table.Cell>\n              <Table.Cell>\n                <div className=\"w-[5rem]\">\n                  <ProgressBar\n                    value={payment.progress}\n                    status={status.progress}\n                    aria-label={`${payment.customer}: settled`}\n                  />\n                </div>\n              </Table.Cell>\n              <Table.Cell>{formatDate(payment.due)}</Table.Cell>\n              <Table.Cell align=\"right\">\n                <span className=\"typography-number-sm tabular-nums\">\n                  {formatUsd(payment.amount)}\n                </span>\n              </Table.Cell>\n            </Table.Row>\n          );\n        })}\n      </Table.Body>\n    </Table>\n  );\n}\n"
    },
    {
      "path": "src/blocks/finance-dashboard/TopBar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/finance-dashboard/TopBar.tsx",
      "content": "'use client';\n\nimport {\n  type RemixiconComponentType,\n  RiInbox2Line,\n  RiMenuLine,\n  RiMoonLine,\n  RiNotification3Line,\n  RiSettings4Line,\n  RiSunFill,\n} from '@remixicon/react';\nimport { cn } from '@/lib/wideset/utils';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { SegmentedControl } from '@/components/ui/wideset/segmented-control/SegmentedControl';\nimport { type AnchorHTMLAttributes, useState } from 'react';\n\nimport { NAV } from './data';\n\n/** Figma \"Navigation Bar\" on the white page, a line below it: menu, navigation, tools. */\nexport function TopBar() {\n  const [current, setCurrent] = useState(NAV[0].href);\n\n  return (\n    <header className=\"h-ws-20 px-ws-12 flex shrink-0 items-center justify-between\">\n      <div className=\"gap-ws-9 flex items-center\">\n        <div className=\"gap-ws-5 flex items-center\">\n          <IconButton\n            variant=\"secondary\"\n            preset=\"ghost\"\n            size=\"sm\"\n            icon={RiMenuLine}\n            aria-label=\"Open menu\"\n          />\n        </div>\n        <nav aria-label=\"Main\" className=\"gap-ws-3 flex items-center\">\n          {NAV.map((item) => (\n            <NavItem\n              key={item.href}\n              href={item.href}\n              icon={item.icon}\n              active={item.href === current}\n              onClick={() => setCurrent(item.href)}\n            >\n              {item.label}\n            </NavItem>\n          ))}\n        </nav>\n      </div>\n\n      <div className=\"gap-ws-9 flex items-center\">\n        <SegmentedControl size=\"sm\" defaultValue=\"light\" aria-label=\"Theme\">\n          <SegmentedControl.Item value=\"light\" icon={RiSunFill} aria-label=\"Light\" />\n          <SegmentedControl.Item value=\"dark\" icon={RiMoonLine} aria-label=\"Dark\" />\n        </SegmentedControl>\n        <div className=\"gap-ws-3 flex items-center\">\n          {[\n            { icon: RiSettings4Line, label: 'Settings' },\n            { icon: RiInbox2Line, label: 'Inbox' },\n            { icon: RiNotification3Line, label: 'Notifications' },\n          ].map(({ icon, label }) => (\n            <IconButton\n              key={label}\n              variant=\"secondary\"\n              preset=\"ghost\"\n              size=\"sm\"\n              icon={icon}\n              aria-label={label}\n            />\n          ))}\n        </div>\n      </div>\n    </header>\n  );\n}\n\ntype NavItemProps = AnchorHTMLAttributes<HTMLAnchorElement> & {\n  active: boolean;\n  icon?: RemixiconComponentType;\n};\n\n/** Figma \"Assets / Navigation Bar Page\": a top-bar link, filled while it is the current page. */\nfunction NavItem({ active, icon: Icon, className, children, ...props }: NavItemProps) {\n  return (\n    <a\n      aria-current={active ? 'page' : undefined}\n      className={cn(\n        'typography-label-strong-sm rounded-ws-control-lg gap-ws-5 px-ws-5 py-ws-3 min-h-ws-14 flex items-center',\n        'focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default',\n        active\n          ? 'bg-ws-dynamic-tertiary-alpha-strong-default text-ws-static-strong'\n          : 'text-ws-static-base hover:bg-ws-dynamic-tertiary-alpha-strong-default hover:text-ws-static-strong',\n        className,\n      )}\n      {...props}\n    >\n      {Icon && (\n        <Icon\n          aria-hidden\n          className={cn('size-ws-10 shrink-0', !active && 'text-ws-static-subtle')}\n        />\n      )}\n      {children}\n    </a>\n  );\n}\n"
    },
    {
      "path": "src/blocks/finance-dashboard/VolumeChart.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/finance-dashboard/VolumeChart.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\nimport { Select } from '@/components/ui/wideset/select/Select';\nimport { useId } from 'react';\n\nimport { Change } from './Change';\nimport { OUTCOMES, PERIODS, VOLUME } from './data';\nimport { formatCount, formatDay, formatUsdWhole } from './format';\n\nconst MAX = 100_000;\nconst TICKS = [100_000, 75_000, 50_000, 25_000, 0];\n// The plot in viewBox units; the SVG stretches to the plot, strokes keep their width.\nconst WIDTH = 1000;\nconst HEIGHT = 240;\n\n// Wideset has no data-visualisation colours yet: gross takes the brand fill, net the subtle text.\nconst SERIES = {\n  gross: { color: 'text-(--ws-non-semantic-fill-brand-strong)', opacity: 1 },\n  net: { color: 'text-ws-static-subtle', opacity: 0.5 },\n};\n\nconst toPoints = (series: number[]) =>\n  series.map((value, index) => [\n    (index / (series.length - 1)) * WIDTH,\n    HEIGHT - (value / MAX) * HEIGHT,\n  ]);\n\nconst toPath = (points: number[][]) =>\n  points.map(([x, y], index) => `${index ? 'L' : 'M'}${x.toFixed(1)} ${y.toFixed(1)}`).join('');\n\n/** Gross and net volume over the year, with weekly transactions as bars along the bottom. */\nexport function VolumeChart() {\n  const gradientId = `gross-fill-${useId().replace(/[^\\w-]/g, '')}`;\n  const gross = toPoints(VOLUME.grossSeries);\n  const net = toPoints(VOLUME.netSeries);\n  const maxWeekly = Math.max(...VOLUME.weeklyTransactions);\n\n  return (\n    <section aria-label=\"Volume\" className=\"gap-ws-12 flex flex-col\">\n      <div className=\"flex items-center justify-between\">\n        <div className=\"gap-ws-14 flex items-center\">\n          <Total series=\"gross\" {...VOLUME.gross} />\n          <span aria-hidden className=\"h-ws-12 border-ws-static-base border-l\" />\n          <Total series=\"net\" {...VOLUME.net} />\n        </div>\n        <div className=\"gap-ws-5 flex\">\n          <Select\n            size=\"sm\"\n            options={PERIODS}\n            defaultValue=\"this-year\"\n            aria-label=\"Period\"\n            className=\"w-fit\"\n          />\n          <Select\n            size=\"sm\"\n            options={OUTCOMES}\n            defaultValue=\"decline\"\n            aria-label=\"Outcome\"\n            className=\"w-fit\"\n          />\n        </div>\n      </div>\n\n      <figure aria-label=\"Gross and net volume this year\" className=\"flex items-start\">\n        <div className=\"flex h-[16.25rem] w-[3.5rem] shrink-0 flex-col justify-between text-right\">\n          {TICKS.map((tick) => (\n            <span key={tick} className=\"typography-number-sm text-ws-static-subtle\">\n              {formatCount(tick)}\n            </span>\n          ))}\n        </div>\n        <div className=\"ml-ws-11 min-w-0 flex-1\">\n          <div className=\"mt-ws-7 relative h-[15rem]\">\n            {TICKS.map((tick) => (\n              <div\n                key={tick}\n                className=\"border-ws-static-subtle inset-x-ws-0 absolute border-t\"\n                style={{ top: `${100 - (tick / MAX) * 100}%` }}\n              />\n            ))}\n            <div className=\"h-ws-14 inset-x-ws-0 bottom-ws-0 absolute flex items-end gap-[3px]\">\n              {VOLUME.weeklyTransactions.map((count, week) => (\n                <div\n                  key={week}\n                  className=\"bg-ws-static-alpha-base rounded-t-ws-control-sm flex-1\"\n                  style={{ height: `${(count / maxWeekly) * 100}%` }}\n                />\n              ))}\n            </div>\n            <svg\n              viewBox={`0 0 ${WIDTH} ${HEIGHT}`}\n              preserveAspectRatio=\"none\"\n              aria-hidden\n              className=\"inset-ws-0 absolute size-full overflow-visible\"\n            >\n              <defs>\n                <linearGradient\n                  id={gradientId}\n                  x1=\"0\"\n                  y1=\"0\"\n                  x2=\"0\"\n                  y2=\"1\"\n                  className={SERIES.gross.color}\n                >\n                  <stop offset=\"0\" stopColor=\"currentColor\" stopOpacity={0.1} />\n                  <stop offset=\"0.6\" stopColor=\"currentColor\" stopOpacity={0} />\n                </linearGradient>\n              </defs>\n              <path\n                d={`${toPath(gross)}L${WIDTH} ${HEIGHT}L0 ${HEIGHT}Z`}\n                fill={`url(#${gradientId})`}\n              />\n              {(['net', 'gross'] as const).map((key) => {\n                const points = key === 'gross' ? gross : net;\n                const [lastX, lastY] = points[points.length - 1];\n                return (\n                  <g\n                    key={key}\n                    className={SERIES[key].color}\n                    stroke=\"currentColor\"\n                    strokeOpacity={SERIES[key].opacity}\n                    strokeLinecap=\"round\"\n                    strokeLinejoin=\"round\"\n                    fill=\"none\"\n                  >\n                    <path d={toPath(points)} strokeWidth={2} vectorEffect=\"non-scaling-stroke\" />\n                    <path\n                      d={`M${lastX} ${lastY}h0`}\n                      strokeWidth={10}\n                      vectorEffect=\"non-scaling-stroke\"\n                    />\n                  </g>\n                );\n              })}\n            </svg>\n          </div>\n          <div className=\"mt-ws-9 grid grid-cols-12 gap-[3px]\">\n            {VOLUME.axis.map((date) => (\n              <span key={date} className=\"typography-label-sm text-ws-static-subtle text-center\">\n                {formatDay(date)}\n              </span>\n            ))}\n          </div>\n        </div>\n      </figure>\n    </section>\n  );\n}\n\n/** A series' legend: its swatch and name, the total and its change. */\nfunction Total({\n  series,\n  label,\n  total,\n  change,\n}: {\n  series: keyof typeof SERIES;\n  label: string;\n  total: number;\n  change: number;\n}) {\n  return (\n    <div className=\"gap-ws-3 flex flex-col\">\n      <div className=\"gap-ws-5 flex items-center\">\n        <svg aria-hidden viewBox=\"0 0 12 12\" className={cn('size-ws-7', SERIES[series].color)}>\n          <rect\n            width=\"12\"\n            height=\"12\"\n            rx=\"2\"\n            fill=\"currentColor\"\n            fillOpacity={SERIES[series].opacity}\n          />\n        </svg>\n        <span className=\"typography-label-sm text-ws-static-subtle\">{label}</span>\n      </div>\n      <div className=\"gap-ws-5 flex items-baseline\">\n        <span className=\"typography-title-md text-ws-static-strong tabular-nums\">\n          {formatUsdWhole(total)}\n        </span>\n        <Change value={change}>last year</Change>\n      </div>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/finance-dashboard/VolumePanel.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/finance-dashboard/VolumePanel.tsx",
      "content": "'use client';\n\nimport { RiBarChartHorizontalFill, RiCloseLine, RiLineChartLine } from '@remixicon/react';\nimport { cn } from '@/lib/wideset/utils';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { SegmentedControl } from '@/components/ui/wideset/segmented-control/SegmentedControl';\nimport { Tabs } from '@/components/ui/wideset/tabs/Tabs';\nimport { useId } from 'react';\n\nimport { CARD_TYPES, MONTHLY_PERIOD, MONTHLY_VOLUME } from './data';\nimport { formatChange, formatDayPadded, formatUsd } from './format';\n\n// Wideset has no data-visualisation colours yet: Figma's Gold and Brown become yellow and orange.\nconst CARD_COLOR = {\n  blue: 'bg-ws-non-semantic-blue-strong',\n  green: 'bg-ws-non-semantic-green-strong',\n  yellow: 'bg-ws-non-semantic-yellow-strong',\n  cyan: 'bg-ws-non-semantic-cyan-strong',\n  pink: 'bg-ws-non-semantic-pink-strong',\n  orange: 'bg-ws-non-semantic-orange-strong',\n};\n\n/** The side panel: this month's volume by tab, then volume by card type. */\nexport function VolumePanel({ onClose }: { onClose: () => void }) {\n  return (\n    <aside\n      aria-labelledby=\"monthly-volume-title\"\n      className=\"bg-ws-static-alpha-subtle border-ws-static-subtle rounded-ws-container-lg my-ws-9 mr-ws-9 ws-scrollbar relative flex w-[27.5rem] shrink-0 flex-col overflow-y-auto border\"\n    >\n      <IconButton\n        variant=\"secondary\"\n        preset=\"border\"\n        size=\"sm\"\n        icon={RiCloseLine}\n        aria-label=\"Close panel\"\n        onClick={onClose}\n        className=\"top-ws-9 right-ws-9 absolute\"\n      />\n      <h2\n        id=\"monthly-volume-title\"\n        className=\"px-ws-14 pt-ws-14 typography-subtitle-md text-ws-static-strong\"\n      >\n        Monthly Volume\n      </h2>\n\n      <Tabs size=\"lg\" defaultValue=\"day-sale\" className=\"mt-ws-7\">\n        <Tabs.List className=\"px-ws-14 w-full\">\n          {MONTHLY_VOLUME.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        {MONTHLY_VOLUME.map((tab) => (\n          <Tabs.Content key={tab.value} value={tab.value} className=\"px-ws-14 pt-ws-18\">\n            <p className=\"typography-title-md text-ws-static-strong tabular-nums\">\n              {formatUsd(tab.amount)}\n            </p>\n            <p className=\"mt-ws-9 typography-body-lg text-ws-static-subtle\">\n              This month {tab.noun} is {formatChange(tab.change)}\n              <br />\n              {tab.change >= 0 ? 'larger' : 'smaller'} than last month\n            </p>\n            <Sparkline series={tab.series} reference={tab.reference} className=\"mt-ws-14\" />\n          </Tabs.Content>\n        ))}\n      </Tabs>\n\n      <section aria-labelledby=\"card-types-title\" className=\"px-ws-14 pb-ws-18 mt-ws-26\">\n        <div className=\"flex items-center justify-between\">\n          <h3 id=\"card-types-title\" className=\"typography-subtitle-sm text-ws-static-strong\">\n            Volume by Card Type\n          </h3>\n          <SegmentedControl size=\"sm\" defaultValue=\"bars\" aria-label=\"Chart type\">\n            <SegmentedControl.Item value=\"bars\" icon={RiBarChartHorizontalFill} aria-label=\"Bars\" />\n            <SegmentedControl.Item value=\"line\" icon={RiLineChartLine} aria-label=\"Line\" />\n          </SegmentedControl>\n        </div>\n        <ul className=\"mt-ws-11 gap-ws-9 flex flex-col\">\n          {CARD_TYPES.map((card) => (\n            <li key={card.name} className=\"gap-ws-5 flex flex-col\">\n              <span\n                aria-hidden\n                className={cn('rounded-ws-control-full h-[3px]', CARD_COLOR[card.color])}\n                style={{ width: `${card.share * 100}%` }}\n              />\n              <div className=\"typography-label-sm text-ws-static-base flex justify-between\">\n                <span>{card.name}</span>\n                <span className=\"typography-number-sm tabular-nums\">{formatUsd(card.amount)}</span>\n              </div>\n            </li>\n          ))}\n        </ul>\n      </section>\n    </aside>\n  );\n}\n\nconst WIDTH = 376;\nconst HEIGHT = 104;\n// The line keeps to the top 83px; the dates sit under the full box.\nconst LINE_HEIGHT = 83;\n\n/** The month's series as a line, with its reference value marked by a dashed rule and a pill. */\nfunction Sparkline({\n  series,\n  reference,\n  className,\n}: {\n  series: number[];\n  reference: number;\n  className?: string;\n}) {\n  const gradientId = `sparkline-fill-${useId().replace(/[^\\w-]/g, '')}`;\n  const min = Math.min(...series);\n  const max = Math.max(...series);\n  const y = (value: number) => ((max - value) / (max - min)) * LINE_HEIGHT;\n  const path = series\n    .map((value, index) => {\n      const x = (index / (series.length - 1)) * WIDTH;\n      return `${index ? 'L' : 'M'}${x.toFixed(1)} ${y(value).toFixed(1)}`;\n    })\n    .join('');\n  const referenceY = y(reference);\n\n  return (\n    <figure aria-label=\"Daily values this month\" className={className}>\n      <div className=\"relative h-[6.5rem]\">\n        <svg\n          viewBox={`0 0 ${WIDTH} ${HEIGHT}`}\n          preserveAspectRatio=\"none\"\n          aria-hidden\n          className=\"inset-ws-0 absolute size-full overflow-visible\"\n        >\n          <defs>\n            <linearGradient\n              id={gradientId}\n              x1=\"0\"\n              y1=\"0\"\n              x2=\"0\"\n              y2=\"1\"\n              className=\"text-(--ws-static-fill-highlight-strong)\"\n            >\n              <stop offset=\"0\" stopColor=\"currentColor\" />\n              <stop offset=\"1\" stopColor=\"currentColor\" stopOpacity={0} />\n            </linearGradient>\n          </defs>\n          <path d={`${path}L${WIDTH} ${HEIGHT}L0 ${HEIGHT}Z`} fill={`url(#${gradientId})`} />\n          <path\n            d={path}\n            fill=\"none\"\n            stroke=\"currentColor\"\n            strokeOpacity={0.5}\n            strokeWidth={1.5}\n            strokeLinejoin=\"round\"\n            vectorEffect=\"non-scaling-stroke\"\n            className=\"text-ws-static-subtle\"\n          />\n          <line\n            x1=\"0\"\n            x2={WIDTH}\n            y1={referenceY}\n            y2={referenceY}\n            stroke=\"currentColor\"\n            strokeDasharray=\"2 4\"\n            vectorEffect=\"non-scaling-stroke\"\n            className=\"text-ws-static-strong\"\n          />\n        </svg>\n        <span\n          className=\"bg-ws-static-inverse-background text-ws-static-inverse-strong typography-caption-strong-sm rounded-ws-control-full px-ws-5 py-ws-2 right-ws-0 absolute -translate-y-1/2 tabular-nums\"\n          style={{ top: `${(referenceY / HEIGHT) * 100}%` }}\n        >\n          {formatUsd(reference)}\n        </span>\n      </div>\n      <div className=\"typography-label-sm text-ws-static-subtle flex justify-between\">\n        <span>{formatDayPadded(MONTHLY_PERIOD.from)}</span>\n        <span>{formatDayPadded(MONTHLY_PERIOD.to)}</span>\n      </div>\n    </figure>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "1.1.0",
    "commit": "a734f9f0"
  }
}
