{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-crypto",
  "type": "registry:block",
  "title": "Crypto",
  "description": "A wallet on a grey canvas: a swap form, the balance with a chart, transactions and a distribution.",
  "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/checkbox.json",
    "https://wideset.co/r/divider.json",
    "https://wideset.co/r/dropdown-menu.json",
    "https://wideset.co/r/icon-button.json",
    "https://wideset.co/r/list-item.json",
    "https://wideset.co/r/tooltip.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/crypto/Balance.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/crypto/Balance.tsx",
      "content": "'use client';\n\nimport { Tooltip } from '@/components/ui/wideset/tooltip/Tooltip';\n\nimport { DISTRIBUTION, MONTHLY_BALANCE } from './data';\nimport { formatCompactUsd, formatUsd } from './format';\n\nconst MAX = 60_000;\nconst TICKS = [60_000, 40_000, 20_000, 0];\n\n/** The wallet total beside its balance by month. */\nexport function Balance() {\n  const total = DISTRIBUTION.reduce((sum, item) => sum + item.usd, 0);\n\n  return (\n    <section\n      aria-label=\"Balance\"\n      className=\"gap-ws-16 flex min-h-[16.25rem] items-end justify-between\"\n    >\n      <div className=\"gap-ws-11 flex max-w-[18.25rem] flex-col\">\n        <p className=\"typography-title-lg text-ws-static-strong tabular-nums\">{formatUsd(total)}</p>\n        <p className=\"typography-body-md text-ws-static-subtle\">\n          The combined value of all your cryptocurrency holdings across your wallet calculated in\n          your preferred fiat currency\n        </p>\n      </div>\n\n      <figure aria-label=\"Balance by month\" className=\"gap-ws-12 flex w-[31.6875rem] shrink-0\">\n        <div className=\"pb-ws-12 flex h-[13.75rem] flex-col justify-between\">\n          {TICKS.map((tick) => (\n            <span key={tick} className=\"typography-number-xs text-ws-static-subtle\">\n              {formatCompactUsd(tick)}\n            </span>\n          ))}\n        </div>\n        <div className=\"flex-1\">\n          <div className=\"mt-ws-5 relative h-[11.25rem]\">\n            <svg aria-hidden className=\"inset-ws-0 absolute size-full overflow-visible\">\n              {TICKS.map((tick) => (\n                <line\n                  key={tick}\n                  x1=\"0\"\n                  x2=\"100%\"\n                  y1={`${100 - (tick / MAX) * 100}%`}\n                  y2={`${100 - (tick / MAX) * 100}%`}\n                  strokeDasharray=\"2 6\"\n                  className=\"stroke-(--ws-static-stroke-strong)\"\n                />\n              ))}\n            </svg>\n            <div className=\"gap-x-ws-14 relative grid h-full grid-cols-8 items-end\">\n              {/* Each bar is a stop for Tab and the pointer alike: its month and value show in a\n                  tooltip on hover and on keyboard focus, and a screen reader reads its label. */}\n              {MONTHLY_BALANCE.map(({ month, usd }) => (\n                <Tooltip key={month} size=\"sm\">\n                  <Tooltip.Trigger asChild>\n                    <button\n                      type=\"button\"\n                      aria-label={`${month}: ${formatUsd(usd)}`}\n                      className=\"bg-ws-non-semantic-pink-strong rounded-ws-control-md focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default cursor-default\"\n                      style={{ height: `${(usd / MAX) * 100}%` }}\n                    />\n                  </Tooltip.Trigger>\n                  <Tooltip.Content className=\"ws-block-utility\">\n                    <Tooltip.Label>{month}</Tooltip.Label>\n                    <Tooltip.Description>{formatUsd(usd)}</Tooltip.Description>\n                  </Tooltip.Content>\n                </Tooltip>\n              ))}\n            </div>\n          </div>\n          <div aria-hidden className=\"mt-ws-9 gap-x-ws-14 grid grid-cols-8\">\n            {MONTHLY_BALANCE.map(({ month }) => (\n              <span key={month} className=\"typography-body-sm text-ws-static-subtle text-center\">\n                {month}\n              </span>\n            ))}\n          </div>\n        </div>\n      </figure>\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/crypto/brand-mark.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/crypto/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';\nconst W =\n  'M21.6907 12C21.6907 12 19.618 17.322 19.5381 17.5183C19.4954 17.4215 17.1775 12 17.1775 12H15.0877C15.0877 12 12.7755 17.5183 12.7413 17.5916C12.7042 17.5157 10.2409 12 10.2409 12H8L11.7434 20H13.8047L16.1483 14.3403H16.1853C16.211 14.3953 18.5802 20 18.5802 20H20.7042C20.7042 20 23.9772 12.0707 24 12.0052L21.6935 12H21.6907Z';\n\n/**\n * The Wideset mark: a W on the inverse tile, Figma's workspace Thumbnail. It takes the size of\n * its place (32px in a sidebar or top bar, 36px in a larger switcher) and inverts in dark mode.\n * Decorative beside the 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      <path d={W} className=\"fill-(--ws-static-text-inverse-strong)\" />\n    </svg>\n  );\n}\n"
    },
    {
      "path": "src/blocks/crypto/data.ts",
      "type": "registry:file",
      "target": "blocks/wideset/crypto/data.ts",
      "content": "export type Coin = 'BTC' | 'ETH' | 'XRP';\n\nexport const NAV = [\n  { label: 'Overview', href: '#overview' },\n  { label: 'Transactions', href: '#transactions' },\n  { label: 'Fees', href: '#fees' },\n  { label: 'Charts', href: '#charts' },\n];\n\nexport const ACCOUNT = { name: 'Andrew Tang', initials: 'AT' };\n\n/** Spot prices in USD; the swap form converts with them. */\nexport const PRICES: Record<Coin, number> = { BTC: 105_253.9, ETH: 3_401.365, XRP: 2.24 };\n\nexport const COINS: { coin: Coin; name: string }[] = [\n  { coin: 'BTC', name: 'Bitcoin' },\n  { coin: 'ETH', name: 'Ethereum' },\n  { coin: 'XRP', name: 'XRP' },\n];\n\nexport const QUOTE = {\n  sell: { coin: 'BTC' as Coin, amount: '0.39' },\n  buy: { coin: 'ETH' as Coin, amount: '12' },\n  /** The swap's costs as shares of the amount; the gas fee is paid in ETH whatever the pair. */\n  fee: 0.005,\n  spread: 0.002,\n  gasEth: 0.00045,\n  priceImpact: 0.0004,\n} as const;\n\n/** Wallet value at the end of each month, in USD. */\nexport const MONTHLY_BALANCE = [\n  { month: 'Jan', usd: 24_700 },\n  { month: 'Feb', usd: 52_000 },\n  { month: 'Mar', usd: 21_000 },\n  { month: 'Apr', usd: 46_300 },\n  { month: 'May', usd: 59_300 },\n  { month: 'Jun', usd: 40_000 },\n  { month: 'Jul', usd: 24_700 },\n  { month: 'Aug', usd: 36_000 },\n];\n\nexport const TRANSACTIONS: {\n  id: string;\n  amount: number;\n  coin: Coin;\n  direction: 'sent' | 'received';\n  address: string;\n  at: string;\n}[] = [\n  {\n    id: 'tx-1',\n    amount: 0.0020009,\n    coin: 'BTC',\n    direction: 'sent',\n    address: 'dk2de',\n    at: '2026-11-06T16:50',\n  },\n  {\n    id: 'tx-2',\n    amount: 0.03,\n    coin: 'ETH',\n    direction: 'sent',\n    address: 'r224s1',\n    at: '2026-11-06T14:30',\n  },\n  {\n    id: 'tx-3',\n    amount: 0.0020009,\n    coin: 'BTC',\n    direction: 'sent',\n    address: 'y8349',\n    at: '2026-11-06T12:22',\n  },\n  {\n    id: 'tx-4',\n    amount: 0.0020009,\n    coin: 'BTC',\n    direction: 'sent',\n    address: 'y8349',\n    at: '2026-11-06T12:22',\n  },\n];\n\n/** Holdings by asset; `color` picks the chart colour in Distribution. */\nexport const DISTRIBUTION = [\n  { name: 'Bitcoin', usd: 6_074.72, share: 0.41, color: 'violet' },\n  { name: 'Ethereum', usd: 4_741.24, share: 0.32, color: 'pink' },\n  { name: 'XRP', usd: 2_370.62, share: 0.16, color: 'pinkSubtle' },\n  { name: 'Other', usd: 1_629.8, share: 0.11, color: 'neutral' },\n] as const;\n"
    },
    {
      "path": "src/blocks/crypto/Distribution.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/crypto/Distribution.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nimport { DISTRIBUTION } from './data';\nimport { formatPercent, formatUsd } from './format';\n\n// Wideset has no data-visualisation colours yet: the closest non-semantic fills stand in.\nconst COLOR = {\n  violet: {\n    swatch: 'bg-ws-non-semantic-violet-strong',\n    stroke: 'stroke-(--ws-non-semantic-fill-violet-strong)',\n  },\n  pink: {\n    swatch: 'bg-ws-non-semantic-pink-strong',\n    stroke: 'stroke-(--ws-non-semantic-fill-pink-strong)',\n  },\n  pinkSubtle: {\n    swatch: 'bg-ws-non-semantic-pink-subtle',\n    stroke: 'stroke-(--ws-non-semantic-fill-pink-subtle)',\n  },\n  neutral: { swatch: 'bg-ws-static-alpha-base', stroke: 'stroke-(--ws-static-fill-alpha-base)' },\n};\n\n// Donut geometry in its 174px box: a ring 18px wide.\nconst SIZE = 174;\nconst RING = 18;\nconst RADIUS = (SIZE - RING) / 2;\n\n/** Holdings by asset: a donut and its legend. */\nexport function Distribution({ className }: { className?: string }) {\n  let offset = 0;\n\n  return (\n    <section aria-labelledby=\"distribution-title\" className={cn('flex flex-col', className)}>\n      <h2 id=\"distribution-title\" className=\"typography-subtitle-xs text-ws-static-base\">\n        Distribution\n      </h2>\n\n      <svg\n        viewBox={`0 0 ${SIZE} ${SIZE}`}\n        aria-hidden\n        className=\"mt-ws-19 size-[10.875rem] shrink-0 self-center\"\n      >\n        {DISTRIBUTION.map((item) => {\n          const start = offset;\n          offset += item.share;\n          return (\n            <circle\n              key={item.name}\n              cx={SIZE / 2}\n              cy={SIZE / 2}\n              r={RADIUS}\n              fill=\"none\"\n              strokeWidth={RING}\n              pathLength={1}\n              strokeDasharray={`${item.share} 1`}\n              strokeDashoffset={-start}\n              transform={`rotate(-90 ${SIZE / 2} ${SIZE / 2})`}\n              className={COLOR[item.color].stroke}\n            />\n          );\n        })}\n      </svg>\n\n      <ul className=\"gap-ws-7 mt-ws-21 flex flex-col\">\n        {DISTRIBUTION.map((item) => (\n          <li key={item.name} className=\"gap-ws-6 flex items-center\">\n            <span\n              aria-hidden\n              className={cn('size-ws-7 rounded-ws-control-sm shrink-0', COLOR[item.color].swatch)}\n            />\n            <span className=\"typography-body-md text-ws-static-base flex-1\">{item.name}</span>\n            <span className=\"typography-number-sm text-ws-static-base w-[2rem] text-right\">\n              {formatPercent(item.share)}\n            </span>\n            <span className=\"typography-number-sm text-ws-static-subtle w-[6.25rem] text-right\">\n              {formatUsd(item.usd)}\n            </span>\n          </li>\n        ))}\n      </ul>\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/crypto/format.ts",
      "type": "registry:file",
      "target": "blocks/wideset/crypto/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, { minimumFractionDigits: 2, maximumFractionDigits: 2 });\nconst coin = new Intl.NumberFormat(LOCALE, { maximumFractionDigits: 8 });\nconst rate = new Intl.NumberFormat(LOCALE, { maximumSignificantDigits: 4 });\nconst compact = new Intl.NumberFormat(LOCALE, { notation: 'compact' });\nconst percent = new Intl.NumberFormat(LOCALE, { style: 'percent', maximumFractionDigits: 2 });\nconst time = new Intl.DateTimeFormat('en-GB', { hour: '2-digit', minute: '2-digit' });\n\nexport const formatUsd = (value: number) => `${usd.format(value)} USD`;\nexport const formatCompactUsd = (value: number) => `${compact.format(value)} USD`;\nexport const formatCoin = (value: number, unit: string) => `${coin.format(value)} ${unit}`;\nexport const formatRate = (value: number) => rate.format(value);\nexport const formatPercent = (value: number) => percent.format(value);\nexport const formatTime = (iso: string) => time.format(new Date(iso));\n\nexport const formatValue = (value: number, unit: string) =>\n  unit === 'percent'\n    ? formatPercent(value)\n    : unit === 'USD'\n      ? formatUsd(value)\n      : formatCoin(value, unit);\n"
    },
    {
      "path": "src/blocks/crypto/index.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/crypto/index.tsx",
      "content": "'use client';\n\nimport '@/styles/wideset-blocks.css';\n\nimport { AppShell } from '@/components/ui/wideset/app-shell/AppShell';\n\nimport { Balance } from './Balance';\nimport { Distribution } from './Distribution';\nimport { SwapForm } from './SwapForm';\nimport { TopBar } from './TopBar';\nimport { Transactions } from './Transactions';\n\n/** Crypto wallet, Canvas direction: a grey page, the top bar on it, the content in white sections. */\nexport default function Crypto() {\n  return (\n    <AppShell className=\"ws-block-utility\" direction=\"canvas\">\n      <AppShell.Main className=\"flex flex-col\">\n        <TopBar />\n        {/* 6px under the cards, not Figma's 8: the 111px gap above \"Transactions\"' button rounds\n          up to the 112px token, and 8 would push a 960px-tall window into a 1px scroll. */}\n        <div className=\"gap-ws-16 pr-ws-5 pb-ws-4 pl-ws-16 mx-auto flex w-full max-w-[90rem] flex-1 items-start\">\n          <SwapForm className=\"w-[26.5rem] shrink-0\" />\n          <div className=\"bg-ws-static-foreground rounded-ws-container-md pt-ws-16 pr-ws-14 pl-ws-16 flex min-w-0 flex-1 flex-col\">\n            <Balance />\n            <div className=\"mt-ws-16 border-ws-static-subtle flex flex-1 border-t\">\n              <Transactions className=\"border-ws-static-subtle pt-ws-14 pr-ws-16 pb-ws-16 flex-1 border-r\" />\n              <Distribution className=\"pt-ws-14 pb-ws-19 pl-ws-16 flex-1\" />\n            </div>\n          </div>\n        </div>\n      </AppShell.Main>\n    </AppShell>\n  );\n}\n"
    },
    {
      "path": "src/blocks/crypto/SwapForm.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/crypto/SwapForm.tsx",
      "content": "'use client';\n\nimport {\n  RiArrowDownSLine,\n  RiArrowUpDownLine,\n  RiArrowUpSLine,\n  RiBtcFill,\n  RiEthFill,\n  RiInformationLine,\n  RiXrpFill,\n} from '@remixicon/react';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { Checkbox } from '@/components/ui/wideset/checkbox/Checkbox';\nimport { cn } from '@/lib/wideset/utils';\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 { Tooltip } from '@/components/ui/wideset/tooltip/Tooltip';\nimport { useId, useState } from 'react';\n\nimport { type Coin, COINS, PRICES, QUOTE } from './data';\nimport { formatRate, formatUsd, formatValue } from './format';\n\nconst MODES = ['Swap', 'Send', 'Buy'] as const;\n\n/** The swap form, straight on the grey canvas: its fields take the highlight fill. */\nexport function SwapForm({ className }: { className?: string }) {\n  const [mode, setMode] = useState<(typeof MODES)[number]>('Swap');\n  const [sell, setSell] = useState<Side>(QUOTE.sell);\n  const [buy, setBuy] = useState<Side>(QUOTE.buy);\n  // The quote follows the pair and the amount: what arrives, in USD and at worst after the fee.\n  const received = Number.parseFloat(buy.amount) || 0;\n  const summary = [\n    { label: 'Estimate fee', value: QUOTE.fee, unit: 'percent' },\n    { label: 'You will receive', value: received * PRICES[buy.coin], unit: 'USD' },\n    { label: 'Spread', value: QUOTE.spread, unit: 'percent' },\n    { label: 'Gas fee', value: QUOTE.gasEth, unit: 'ETH' },\n  ];\n  const details = [\n    { label: 'Price impact', value: QUOTE.priceImpact, unit: 'percent' },\n    { label: 'Minimum received', value: received * (1 - QUOTE.fee), unit: buy.coin },\n  ];\n  const [agreed, setAgreed] = useState(true);\n  const [advanced, setAdvanced] = useState(false);\n  const advancedId = useId();\n\n  return (\n    <div className={cn('pt-ws-12 flex flex-col', className)}>\n      <div role=\"group\" aria-label=\"Transaction type\" className=\"gap-ws-9 flex\">\n        {MODES.map((item) => (\n          <button\n            key={item}\n            type=\"button\"\n            aria-pressed={mode === item}\n            onClick={() => setMode(item)}\n            className={cn(\n              'typography-subtitle-sm rounded-ws-control-sm focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default cursor-pointer',\n              mode === item\n                ? 'text-ws-static-strong'\n                : 'text-ws-static-subtle hover:text-ws-static-base',\n            )}\n          >\n            {item}\n          </button>\n        ))}\n      </div>\n\n      <div className=\"mt-ws-12 gap-ws-5 relative flex flex-col\">\n        <AmountField label=\"Sell\" side={sell} onChange={setSell} />\n        <AmountField label=\"Buy\" side={buy} onChange={setBuy} />\n        <div className=\"bg-ws-static-foreground shadow-ws-low rounded-ws-control-full absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2\">\n          {/* Round in every state: the button takes the circle's radius, so its hover, press\n              and focus ring follow the round chip instead of drawing a square inside it. */}\n          <IconButton\n            variant=\"secondary\"\n            preset=\"ghost\"\n            icon={RiArrowUpDownLine}\n            aria-label=\"Switch currencies\"\n            className=\"rounded-ws-control-full\"\n            onClick={() => {\n              setSell(buy);\n              setBuy(sell);\n            }}\n          />\n        </div>\n      </div>\n\n      <div className=\"mt-ws-9 gap-ws-2 flex items-center justify-center\">\n        <Tooltip>\n          <Tooltip.Trigger asChild>\n            <IconButton\n              variant=\"secondary\"\n              preset=\"ghost\"\n              size=\"xs\"\n              icon={RiInformationLine}\n              aria-label=\"About the rate\"\n            />\n          </Tooltip.Trigger>\n          <Tooltip.Content className=\"ws-block-utility\">\n            <Tooltip.Label>Mid-market rate, refreshed every 30 seconds</Tooltip.Label>\n          </Tooltip.Content>\n        </Tooltip>\n        <p className=\"typography-body-sm text-ws-static-subtle\">\n          1 {sell.coin} = {formatRate(PRICES[sell.coin] / PRICES[buy.coin])} {buy.coin}\n        </p>\n      </div>\n\n      <Divider weight=\"thin\" emphasis=\"subtle\" className=\"mt-ws-14\" />\n\n      <section aria-labelledby=\"swap-summary\" className=\"mt-ws-14\">\n        <h2 id=\"swap-summary\" className=\"typography-subtitle-xs text-ws-static-base\">\n          Summary\n        </h2>\n        <Rows rows={summary} className=\"mt-ws-12\" />\n      </section>\n\n      <div className=\"mt-ws-23 gap-ws-7 flex flex-col\">\n        <Checkbox checked={agreed} onCheckedChange={(checked) => setAgreed(checked === true)}>\n          <Checkbox.Label>\n            I agree to <span className=\"font-ws-medium\">terms & conditions</span> of the platform\n            services\n          </Checkbox.Label>\n          <Checkbox.Description>Swaps can’t be reversed once confirmed.</Checkbox.Description>\n        </Checkbox>\n        <div className=\"gap-ws-5 flex flex-col\">\n          <Button variant=\"secondary\" size=\"lg\" className=\"w-full\" disabled={!agreed}>\n            {mode}\n          </Button>\n          <Button\n            variant=\"secondary\"\n            preset=\"ghost\"\n            size=\"lg\"\n            className=\"w-full\"\n            aria-expanded={advanced}\n            aria-controls={advancedId}\n            onClick={() => setAdvanced((open) => !open)}\n          >\n            Advanced info\n            <Button.Icon icon={advanced ? RiArrowUpSLine : RiArrowDownSLine} />\n          </Button>\n        </div>\n        <Rows id={advancedId} rows={details} hidden={!advanced} />\n      </div>\n    </div>\n  );\n}\n\ntype Side = { coin: Coin; amount: string };\n\n/** A sell or buy amount: the label, a large amount input, its USD value and the coin picker. */\nfunction AmountField({\n  label,\n  side,\n  onChange,\n}: {\n  label: string;\n  side: Side;\n  onChange: (side: Side) => void;\n}) {\n  const id = useId();\n  const usd = (Number.parseFloat(side.amount) || 0) * PRICES[side.coin];\n\n  return (\n    <div className=\"bg-ws-static-highlight-base rounded-ws-control-lg shadow-ws-forms-base focus-within:shadow-ws-forms-active py-ws-9 pr-ws-7 pl-ws-9 flex items-start\">\n      <label\n        htmlFor={id}\n        className=\"typography-label-sm text-ws-static-subtle w-[3.75rem] shrink-0\"\n      >\n        {label}\n      </label>\n      <div className=\"gap-ws-7 flex min-w-0 flex-1 flex-col\">\n        <input\n          id={id}\n          inputMode=\"decimal\"\n          autoComplete=\"off\"\n          value={side.amount}\n          onChange={(event) => onChange({ ...side, amount: event.target.value })}\n          className=\"typography-title-sm text-ws-static-strong w-full bg-transparent tabular-nums outline-none\"\n        />\n        <span className=\"typography-number-xs text-ws-static-subtle\">{formatUsd(usd)}</span>\n      </div>\n      <DropdownMenu>\n        <DropdownMenu.Trigger asChild>\n          <button\n            type=\"button\"\n            aria-label={`${label} currency: ${side.coin}`}\n            className=\"bg-ws-static-alpha-base hover:bg-ws-dynamic-secondary-hover rounded-ws-control-full gap-ws-4 py-ws-3 pr-ws-5 pl-ws-3 text-ws-static-strong focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default flex shrink-0 cursor-pointer items-center\"\n          >\n            <CoinMark coin={side.coin} />\n            <RiArrowDownSLine aria-hidden className=\"size-ws-7\" />\n          </button>\n        </DropdownMenu.Trigger>\n        <DropdownMenu.Content className=\"ws-block-utility\" align=\"end\">\n          {COINS.map(({ coin, name }) => (\n            <DropdownMenu.Item key={coin} onSelect={() => onChange({ ...side, coin })}>\n              <ListItem.Prefix>\n                <CoinMark coin={coin} />\n              </ListItem.Prefix>\n              <ListItem.Content>\n                <ListItem.Label>{name}</ListItem.Label>\n              </ListItem.Content>\n            </DropdownMenu.Item>\n          ))}\n        </DropdownMenu.Content>\n      </DropdownMenu>\n    </div>\n  );\n}\n\nconst MARK: Record<Coin, { icon: typeof RiBtcFill; className: string }> = {\n  BTC: {\n    icon: RiBtcFill,\n    className: 'bg-ws-non-semantic-orange-strong text-ws-non-semantic-orange-on-strong',\n  },\n  ETH: { icon: RiEthFill, className: 'bg-ws-static-highlight-base text-ws-static-strong' },\n  XRP: {\n    icon: RiXrpFill,\n    className: 'bg-ws-static-inverse-background text-ws-static-inverse-strong',\n  },\n};\n\n/** A coin's mark: its Remix glyph on a round chip. */\nfunction CoinMark({ coin }: { coin: Coin }) {\n  const { icon: Icon, className } = MARK[coin];\n  return (\n    <span\n      className={cn(\n        'size-ws-11 rounded-ws-control-full flex shrink-0 items-center justify-center',\n        className,\n      )}\n    >\n      <Icon aria-hidden className=\"size-ws-9\" />\n    </span>\n  );\n}\n\n/** Label and value rows of a quote. */\nfunction Rows({\n  rows,\n  className,\n  ...props\n}: {\n  rows: readonly { label: string; value: number; unit: string }[];\n  className?: string;\n  id?: string;\n  hidden?: boolean;\n}) {\n  return (\n    <dl className={cn('gap-ws-7 flex flex-col', className)} {...props}>\n      {rows.map((row) => (\n        <div key={row.label} className=\"gap-ws-9 flex justify-between\">\n          <dt className=\"typography-body-md text-ws-static-base\">{row.label}</dt>\n          <dd className=\"typography-number-sm text-ws-static-base tabular-nums\">\n            {formatValue(row.value, row.unit)}\n          </dd>\n        </div>\n      ))}\n    </dl>\n  );\n}\n"
    },
    {
      "path": "src/blocks/crypto/TopBar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/crypto/TopBar.tsx",
      "content": "'use client';\n\nimport { type RemixiconComponentType, RiMenuLine } from '@remixicon/react';\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\nimport { cn } from '@/lib/wideset/utils';\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 { type AnchorHTMLAttributes, useState } from 'react';\n\nimport { BrandMark } from './brand-mark';\nimport { ACCOUNT, NAV } from './data';\n\n/** Figma \"Navigation Bar\" on the grey canvas, no fill and no line: brand, navigation, account. */\nexport function TopBar() {\n  const [current, setCurrent] = useState(NAV[0].href);\n\n  return (\n    <header className=\"h-ws-22 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          <BrandMark label=\"Wideset\" />\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              active={item.href === current}\n              onClick={() => setCurrent(item.href)}\n            >\n              {item.label}\n            </NavItem>\n          ))}\n        </nav>\n      </div>\n\n      <DropdownMenu>\n        <DropdownMenu.Trigger asChild>\n          <button\n            type=\"button\"\n            className=\"typography-label-strong-sm text-ws-static-strong rounded-ws-control-lg gap-ws-5 px-ws-5 py-ws-3 hover:bg-ws-dynamic-secondary-alpha-hover focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default flex cursor-pointer items-center\"\n          >\n            <Avatar initials={ACCOUNT.initials} aria-hidden />\n            {ACCOUNT.name}\n          </button>\n        </DropdownMenu.Trigger>\n        <DropdownMenu.Content className=\"ws-block-utility\" align=\"end\">\n          {['Profile', 'Settings', 'Log out'].map((label) => (\n            <DropdownMenu.Item key={label}>\n              <ListItem.Content>\n                <ListItem.Label>{label}</ListItem.Label>\n              </ListItem.Content>\n            </DropdownMenu.Item>\n          ))}\n        </DropdownMenu.Content>\n      </DropdownMenu>\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/crypto/Transactions.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/crypto/Transactions.tsx",
      "content": "'use client';\n\nimport { RiArrowDownLine, RiArrowDownSLine, RiArrowUpLine } from '@remixicon/react';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { cn } from '@/lib/wideset/utils';\nimport { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';\nimport { ListItem } from '@/components/ui/wideset/list-item/ListItem';\nimport { useState } from 'react';\n\nimport { TRANSACTIONS } from './data';\nimport { formatCoin, formatTime } from './format';\n\nconst FILTERS = [\n  { value: 'all', label: 'All transactions' },\n  { value: 'sent', label: 'Sent' },\n  { value: 'received', label: 'Received' },\n] as const;\n\n/** Today's transfers, newest first, with a filter by direction. */\nexport function Transactions({ className }: { className?: string }) {\n  const [filter, setFilter] = useState<(typeof FILTERS)[number]>(FILTERS[0]);\n  const rows = TRANSACTIONS.filter((tx) => filter.value === 'all' || tx.direction === filter.value);\n\n  return (\n    <section aria-labelledby=\"transactions-title\" className={cn('flex flex-col', className)}>\n      <h2 id=\"transactions-title\" className=\"typography-subtitle-xs text-ws-static-base\">\n        Today’s transactions\n      </h2>\n\n      {rows.length > 0 ? (\n        <ul className=\"mt-ws-14 gap-ws-13 flex flex-col\">\n          {rows.map((tx) => {\n            const Icon = tx.direction === 'sent' ? RiArrowUpLine : RiArrowDownLine;\n            return (\n              <li key={tx.id} className=\"gap-ws-12 flex items-center\">\n                <span className=\"bg-ws-static-highlight-base text-ws-dynamic-secondary-default size-ws-16 rounded-ws-control-full flex shrink-0 items-center justify-center\">\n                  <Icon aria-hidden className=\"size-ws-11\" />\n                </span>\n                <div className=\"gap-ws-3 flex min-w-0 flex-1 flex-col\">\n                  <span className=\"typography-number-sm text-ws-static-strong\">\n                    {formatCoin(tx.amount, tx.coin)}\n                  </span>\n                  <span className=\"typography-body-md text-ws-static-subtle\">\n                    {tx.direction === 'sent' ? 'Sent to' : 'Received from'} •••• {tx.address}\n                  </span>\n                </div>\n                <time dateTime={tx.at} className=\"typography-number-sm text-ws-static-subtle\">\n                  {formatTime(tx.at)}\n                </time>\n              </li>\n            );\n          })}\n        </ul>\n      ) : (\n        <p className=\"mt-ws-14 typography-body-md text-ws-static-subtle\">\n          No {filter.label.toLowerCase()} transactions today.\n        </p>\n      )}\n\n      <DropdownMenu>\n        <DropdownMenu.Trigger asChild>\n          <Button variant=\"secondary\" preset=\"border\" size=\"sm\" className=\"mt-ws-25 self-start\">\n            {filter.label}\n            <Button.Icon icon={RiArrowDownSLine} />\n          </Button>\n        </DropdownMenu.Trigger>\n        <DropdownMenu.Content className=\"ws-block-utility\" align=\"start\">\n          {FILTERS.map((item) => (\n            <DropdownMenu.Item key={item.value} onSelect={() => setFilter(item)}>\n              <ListItem.Content>\n                <ListItem.Label>{item.label}</ListItem.Label>\n              </ListItem.Content>\n            </DropdownMenu.Item>\n          ))}\n        </DropdownMenu.Content>\n      </DropdownMenu>\n    </section>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "1.1.0",
    "commit": "a734f9f0"
  }
}
