{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-send-payment",
  "type": "registry:block",
  "title": "Send payment",
  "description": "Sending a payment on a raised page: one narrow card that is the form, then the review before anything moves, then the receipt, with recent transfers beside it and a confirmation only above a stated limit.",
  "dependencies": [
    "@remixicon/react@^4.9.0"
  ],
  "registryDependencies": [
    "https://wideset.co/r/app-shell.json",
    "https://wideset.co/r/avatar.json",
    "https://wideset.co/r/block-styles.json",
    "https://wideset.co/r/breadcrumbs.json",
    "https://wideset.co/r/button.json",
    "https://wideset.co/r/card.json",
    "https://wideset.co/r/date-picker.json",
    "https://wideset.co/r/divider.json",
    "https://wideset.co/r/dropdown-menu.json",
    "https://wideset.co/r/form-field.json",
    "https://wideset.co/r/icon-button.json",
    "https://wideset.co/r/list-item.json",
    "https://wideset.co/r/radio-button.json",
    "https://wideset.co/r/select.json",
    "https://wideset.co/r/sidebar.json",
    "https://wideset.co/r/status-badge.json",
    "https://wideset.co/r/status-modal.json",
    "https://wideset.co/r/text-input.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/send-payment/brand-mark.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/send-payment/brand-mark.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nconst TILE =\n  'M0 16C0 8.45753 0 4.68629 2.34315 2.34315C4.68629 0 8.45753 0 16 0C23.5425 0 27.3137 0 29.6569 2.34315C32 4.68629 32 8.45753 32 16C32 23.5425 32 27.3137 29.6569 29.6569C27.3137 32 23.5425 32 16 32C8.45753 32 4.68629 32 2.34315 29.6569C0 27.3137 0 23.5425 0 16Z';\n\n/**\n * Orbit's mark: a planet and its ring on the inverse tile, so it inverts in dark mode. It takes\n * the size of its place (32px in a sidebar, 36px in a larger switcher). Decorative beside the\n * product's name; give it a `label` when it stands alone.\n */\nexport function BrandMark({ className, label }: { className?: string; label?: string }) {\n  return (\n    <svg\n      viewBox=\"0 0 32 32\"\n      role={label ? 'img' : undefined}\n      aria-label={label}\n      aria-hidden={label ? undefined : true}\n      className={cn('size-ws-14 shrink-0', className)}\n    >\n      <path d={TILE} className=\"fill-(--ws-static-fill-inverse-background)\" />\n      <ellipse\n        cx=\"16\"\n        cy=\"16\"\n        rx=\"10.5\"\n        ry=\"4\"\n        transform=\"rotate(-28 16 16)\"\n        strokeWidth=\"1.75\"\n        className=\"fill-none stroke-(--ws-static-text-inverse-strong)\"\n      />\n      <circle cx=\"16\" cy=\"16\" r=\"4.75\" className=\"fill-(--ws-static-text-inverse-strong)\" />\n    </svg>\n  );\n}\n"
    },
    {
      "path": "src/blocks/send-payment/confirm-dialog.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/send-payment/confirm-dialog.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { StatusModal } from '@/components/ui/wideset/status-modal/StatusModal';\n\nimport { formatUsd } from './format';\n\ntype ConfirmDialogProps = {\n  open: boolean;\n  onOpenChange: (open: boolean) => void;\n  /** The payment's amount, in cents. */\n  amount: number;\n  recipient: string;\n  /** Scheduling a payment for later, not sending it now. */\n  scheduled: boolean;\n  onConfirm: () => void;\n};\n\n/**\n * A confirmation step for the example payment. Cancel and Esc return to the review.\n */\nexport function ConfirmDialog({\n  open,\n  onOpenChange,\n  amount,\n  recipient,\n  scheduled,\n  onConfirm,\n}: ConfirmDialogProps) {\n  const action = `${scheduled ? 'Schedule' : 'Send'} ${formatUsd(amount)}`;\n\n  return (\n    <StatusModal status=\"notice\" open={open} onOpenChange={onOpenChange}>\n      <StatusModal.Content className=\"ws-block-utility\">\n        <StatusModal.Title>\n          {action} to {recipient}?\n        </StatusModal.Title>\n        <StatusModal.Body>\n          Check the amount and recipient before confirming this sample payment.\n        </StatusModal.Body>\n        <StatusModal.Footer>\n          <StatusModal.Close asChild>\n            <Button variant=\"secondary\" preset=\"border\">\n              Cancel\n            </Button>\n          </StatusModal.Close>\n          <Button onClick={onConfirm}>{action}</Button>\n        </StatusModal.Footer>\n      </StatusModal.Content>\n    </StatusModal>\n  );\n}\n"
    },
    {
      "path": "src/blocks/send-payment/data.ts",
      "type": "registry:file",
      "target": "blocks/wideset/send-payment/data.ts",
      "content": "import {\n  type RemixiconComponentType,\n  RiBankCardLine,\n  RiContactsBook3Line,\n  RiExchangeDollarFill,\n  RiExchangeDollarLine,\n  RiHandCoinLine,\n  RiHome5Line,\n  RiInbox2Line,\n  RiKey2Line,\n  RiLineChartLine,\n  RiPieChart2Line,\n  RiPlugLine,\n  RiQuestionLine,\n  RiSettings3Line,\n  RiTeamLine,\n} from '@remixicon/react';\n\n// Example payout from Lumen Studio's balance. Display amounts are in cents.\n\n/** The product is Orbit; the workspace paying is Lumen Studio. */\nexport const product = { name: 'Orbit' };\nexport const workspace = { name: 'Lumen Studio', initials: 'LS' };\nexport const account = { name: 'Maya Okafor', email: 'maya@lumenstudio.co', initials: 'MO' };\n\n/** The day the screen shows: a Tuesday. */\nexport const today = '2026-11-10';\n\n/** Where the links lead: replace with your routes. */\nexport const ROUTES = { transfers: '#payouts' };\n\nexport type NavLink = {\n  id: string;\n  label: string;\n  icon: RemixiconComponentType;\n  /** The icon while the page is open (a line icon swaps for its fill). */\n  activeIcon?: RemixiconComponentType;\n};\n\nexport const mainLinks: NavLink[] = [\n  { id: 'home', label: 'Home', icon: RiHome5Line },\n  { id: 'inbox', label: 'Inbox', icon: RiInbox2Line },\n  { id: 'customers', label: 'Customers', icon: RiContactsBook3Line },\n  { id: 'deals', label: 'Deals', icon: RiHandCoinLine },\n  { id: 'revenue', label: 'Revenue', icon: RiLineChartLine },\n  { id: 'reports', label: 'Reports', icon: RiPieChart2Line },\n  {\n    id: 'payouts',\n    label: 'Payouts',\n    icon: RiExchangeDollarLine,\n    activeIcon: RiExchangeDollarFill,\n  },\n];\n\nexport const settingsLinks: NavLink[] = [\n  { id: 'general', label: 'General', icon: RiSettings3Line },\n  { id: 'members', label: 'Members', icon: RiTeamLine },\n  { id: 'billing', label: 'Billing', icon: RiBankCardLine },\n  { id: 'integrations', label: 'Integrations', icon: RiPlugLine },\n  { id: 'api-keys', label: 'API keys', icon: RiKey2Line },\n];\n\nexport const helpLink: NavLink = { id: 'help', label: 'Help and support', icon: RiQuestionLine };\n\n/** Values supplied with the demo payment. The arrival illustrates the immediate transfer. */\nexport const samplePayment = { balance: 48_210_75, fee: 21_25, arrival: '2026-11-12' };\n\nexport type Recipient = {\n  id: string;\n  name: string;\n  /** The account's last four digits. */ account: string;\n};\n\n/** Who has been paid before, by name. */\nexport const recipients: Recipient[] = [\n  { id: 'atlas-robotics', name: 'Atlas Robotics', account: '6608' },\n  { id: 'cobalt-security', name: 'Cobalt Security', account: '1175' },\n  { id: 'halcyon-freight', name: 'Halcyon Freight', account: '4417' },\n  { id: 'juniper-legal', name: 'Juniper Legal', account: '7392' },\n  { id: 'kestrel-analytics', name: 'Kestrel Analytics', account: '2251' },\n  { id: 'marlow-finch', name: 'Marlow & Finch', account: '5046' },\n  { id: 'northwind-health', name: 'Northwind Health', account: '9034' },\n  { id: 'tidewater-energy', name: 'Tidewater Energy', account: '3819' },\n];\n\n/** A recipient as one line: the name, then the masked account. */\nexport const recipientLabel = ({ name, account }: Recipient) => `${name} ··· ${account}`;\n\nexport const recipientById = (id: string) => recipients.find((recipient) => recipient.id === id);\n\nexport type TransferStatus = 'Scheduled' | 'Processing' | 'Completed';\n\nexport type Transfer = {\n  /** The transfer's number, as the receipt shows it. */\n  id: string;\n  recipient: string;\n  date: string;\n  amount: number;\n  status: TransferStatus;\n};\n\n/** The last payments sent, newest first. */\nexport const recentTransfers: Transfer[] = [\n  {\n    id: 'TRF-2026-0456',\n    recipient: 'Northwind Health',\n    date: '2026-11-06',\n    amount: 1_820_00,\n    status: 'Completed',\n  },\n  {\n    id: 'TRF-2026-0455',\n    recipient: 'Kestrel Analytics',\n    date: '2026-11-03',\n    amount: 960_00,\n    status: 'Completed',\n  },\n  {\n    id: 'TRF-2026-0454',\n    recipient: 'Juniper Legal',\n    date: '2026-10-28',\n    amount: 2_400_00,\n    status: 'Completed',\n  },\n  {\n    id: 'TRF-2026-0453',\n    recipient: 'Halcyon Freight',\n    date: '2026-10-21',\n    amount: 3_975_50,\n    status: 'Completed',\n  },\n];\n\n/** The number the next transfer gets. */\nexport const nextTransferId = 'TRF-2026-0457';\n"
    },
    {
      "path": "src/blocks/send-payment/facts-list.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/send-payment/facts-list.tsx",
      "content": "'use client';\n\n// TODO(custom): facts read back as rows (label left, value right, groups under a line, a strong total); no DescriptionList in Wideset.\nimport { cn } from '@/lib/wideset/utils';\n\nexport type Fact = {\n  label: string;\n  value: string;\n  /** The figure the reader is after: the total. */\n  strong?: boolean;\n};\n\n/**\n * Facts as rows, the label on the left and its value on the right edge, so amounts stand in one\n * column. Each group after the first opens under a line. The line is the group's own border: a\n * `dl` holds only its rows.\n */\nexport function FactsList({ groups }: { groups: Fact[][] }) {\n  return (\n    <div className=\"gap-ws-9 flex flex-col\">\n      {groups.map((facts, index) => (\n        <dl\n          key={facts[0].label}\n          className={cn(\n            'gap-ws-7 flex flex-col',\n            index > 0 && 'border-ws-static-base pt-ws-9 border-t',\n          )}\n        >\n          {facts.map(({ label, value, strong }) => (\n            <div key={label} className=\"gap-ws-9 flex items-baseline justify-between\">\n              <dt\n                className={\n                  strong\n                    ? 'typography-label-strong-md text-ws-static-strong'\n                    : 'typography-body-md text-ws-static-subtle'\n                }\n              >\n                {label}\n              </dt>\n              <dd\n                className={cn(\n                  'text-right tabular-nums',\n                  strong\n                    ? 'typography-label-strong-md text-ws-static-strong'\n                    : 'typography-body-md text-ws-static-base',\n                )}\n              >\n                {value}\n              </dd>\n            </div>\n          ))}\n        </dl>\n      ))}\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/send-payment/format.ts",
      "type": "registry:file",
      "target": "blocks/wideset/send-payment/format.ts",
      "content": "// One locale for the whole screen; swap it for the user's.\nconst LOCALE = 'en-US';\n\nconst usd = new Intl.NumberFormat(LOCALE, { style: 'currency', currency: 'USD' });\nconst decimal = new Intl.NumberFormat(LOCALE, {\n  minimumFractionDigits: 2,\n  maximumFractionDigits: 2,\n});\n// Dates are calendar days (`2026-11-10`), parsed as UTC midnight: format them in UTC too.\nconst date = new Intl.DateTimeFormat(LOCALE, {\n  day: 'numeric',\n  month: 'short',\n  year: 'numeric',\n  timeZone: 'UTC',\n});\nconst dayMonth = new Intl.DateTimeFormat(LOCALE, {\n  day: 'numeric',\n  month: 'short',\n  timeZone: 'UTC',\n});\n\n/** Money is kept in whole cents: 425000 → $4,250.00. */\nexport const formatUsd = (cents: number) => usd.format(cents / 100);\n/** The same without the sign, for a field that shows `$` beside it: 425000 → 4,250.00. */\nexport const formatAmount = (cents: number) => decimal.format(cents / 100);\nexport const formatDate = (iso: string) => date.format(new Date(iso));\nexport const formatDayMonth = (iso: string) => dayMonth.format(new Date(iso));\n"
    },
    {
      "path": "src/blocks/send-payment/index.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/send-payment/index.tsx",
      "content": "'use client';\n\nimport '@/styles/wideset-blocks.css';\n\nimport { RiSideBarLine } from '@remixicon/react';\nimport { AppShell } from '@/components/ui/wideset/app-shell/AppShell';\nimport { Breadcrumbs } from '@/components/ui/wideset/breadcrumbs/Breadcrumbs';\nimport { cn } from '@/lib/wideset/utils';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { StatusBadge } from '@/components/ui/wideset/status-badge/StatusBadge';\nimport { useEffect, useId, useRef, useState } from 'react';\n\nimport { ConfirmDialog } from './confirm-dialog';\nimport { nextTransferId, recentTransfers, recipientById, type Transfer, workspace } from './data';\nimport { formatDate, formatUsd } from './format';\nimport {\n  draftPayment,\n  emptyPayment,\n  type PaymentErrors,\n  type PaymentValues,\n  summarizePayment,\n  validatePaymentForm,\n} from './payment';\nimport { PaymentForm } from './payment-form';\nimport { PaymentReceipt } from './payment-receipt';\nimport { PaymentReview } from './payment-review';\nimport { RecentTransfers } from './recent-transfers';\nimport { SendPaymentSidebar } from './sidebar';\n\n/** One column of the page: the header and the body share its edges. */\nconst COLUMN = 'px-ws-14 mx-auto w-full max-w-[80rem]';\n\ntype Step = 'form' | 'review' | 'receipt';\n\n/**\n * Send payment (Inset direction): one payment on the raised page beside the workspace sidebar,\n * in three steps that share one narrow card: the form, the review before anything moves, and the\n * receipt the page becomes. The recent transfers stand beside it as text. The screen holds the\n * payment, so going back keeps what was typed. A dialog demonstrates the confirmation step.\n */\nexport default function SendPayment() {\n  const formId = useId();\n  const sidebarId = useId();\n  const [collapsed, setCollapsed] = useState(false);\n\n  const [step, setStep] = useState<Step>('form');\n  const [values, setValues] = useState<PaymentValues>(draftPayment);\n  const [errors, setErrors] = useState<PaymentErrors>({});\n  const [confirming, setConfirming] = useState(false);\n  const [sending, setSending] = useState(false);\n\n  const summary = summarizePayment(values);\n  const recipient = recipientById(values.recipientId)?.name ?? '';\n  const amount = formatUsd(summary.amount);\n\n  // Each step replaces the last one in place, so focus moves to the title that names it.\n  const title = useRef<HTMLHeadingElement>(null);\n  const shown = useRef(step);\n  useEffect(() => {\n    if (shown.current !== step) title.current?.focus();\n    shown.current = step;\n  }, [step]);\n\n  const change = (patch: Partial<PaymentValues>) => {\n    setValues((current) => ({ ...current, ...patch }));\n    // A field stops being in error the moment it is changed; it is checked again on submit.\n    setErrors((current) => ({\n      ...current,\n      ...Object.fromEntries(Object.keys(patch).map((field) => [field, undefined])),\n    }));\n  };\n\n  const review = () => {\n    const found = validatePaymentForm(values);\n    setErrors(found);\n    const [first] = Object.keys(found);\n    if (first) document.getElementById(`${formId}-${first}`)?.focus();\n    else setStep('review');\n  };\n\n  // Cleared on unmount, so the stand-in request never lands on a closed screen.\n  const timer = useRef<number>(undefined);\n  useEffect(() => () => window.clearTimeout(timer.current), []);\n\n  // A timeout stands in for the transfer; a real screen awaits it and, when it is refused, stays\n  // on the review and says why.\n  const send = () => {\n    setConfirming(false);\n    setSending(true);\n    timer.current = window.setTimeout(() => {\n      setSending(false);\n      setStep('receipt');\n    }, 1200);\n  };\n\n  const status = summary.scheduled ? 'Scheduled' : 'Processing';\n  const header = {\n    form: {\n      title: 'Send payment',\n      line: `Pay a saved recipient from ${workspace.name}’s balance.`,\n    },\n    review: {\n      title: 'Review payment',\n      line: 'Check it over. Nothing moves until you send it.',\n    },\n    receipt: summary.scheduled\n      ? {\n          title: 'Payment scheduled',\n          line: `${amount} goes to ${recipient} on ${formatDate(summary.sendDate)}.`,\n        }\n      : {\n          title: 'Payment sent',\n          line: `${amount} is on its way to ${recipient}.`,\n        },\n  }[step];\n\n  const sent: Transfer = {\n    id: nextTransferId,\n    recipient,\n    date: summary.sendDate,\n    amount: summary.amount,\n    status,\n  };\n\n  return (\n    <AppShell className=\"ws-block-utility\" direction=\"inset\">\n      <SendPaymentSidebar id={sidebarId} collapsed={collapsed} onCollapsedChange={setCollapsed} />\n      <AppShell.Main>\n        <div className=\"h-ws-18 border-ws-static-base flex shrink-0 items-center border-b\">\n          {/* The bar belongs to the surround: it runs edge to edge. The sidebar's toggle is pulled\n              left so its glyph, not its box, sits 20px from the edge; the crumbs follow it. */}\n          <div className=\"gap-ws-5 px-ws-11 flex w-full items-center\">\n            <IconButton\n              icon={RiSideBarLine}\n              variant=\"secondary\"\n              preset=\"ghost\"\n              size=\"sm\"\n              iconClassName=\"text-ws-static-subtle size-ws-9\"\n              aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}\n              aria-expanded={!collapsed}\n              aria-controls={sidebarId}\n              onClick={() => setCollapsed(!collapsed)}\n              className=\"-ml-ws-5\"\n            />\n            <Breadcrumbs separator=\"arrow\">\n              <Breadcrumbs.Item asChild>\n                <a href=\"#payouts\">Payouts</a>\n              </Breadcrumbs.Item>\n              <Breadcrumbs.Item>Send payment</Breadcrumbs.Item>\n            </Breadcrumbs>\n          </div>\n        </div>\n\n        {/* The page scrolls inside the card, so the card's corners stay put. */}\n        <div className=\"ws-scrollbar min-h-0 flex-1 overflow-y-auto\">\n          <div className={cn(COLUMN, 'gap-ws-12 pt-ws-14 pb-ws-16 flex flex-col')}>\n            <header className=\"gap-ws-2 flex flex-col\">\n              <div className=\"gap-ws-7 flex items-center\">\n                <h1\n                  ref={title}\n                  tabIndex={-1}\n                  className=\"typography-title-md text-ws-static-strong outline-none\"\n                >\n                  {header.title}\n                </h1>\n                {/* Processing and Scheduled are lifecycle states, so the badge stays neutral. */}\n                {step === 'receipt' && <StatusBadge size=\"lg\">{status}</StatusBadge>}\n              </div>\n              <p className=\"typography-body-md text-ws-static-subtle tabular-nums\">{header.line}</p>\n            </header>\n\n            <div className=\"gap-ws-18 grid grid-cols-1 items-start lg:grid-cols-[minmax(0,38rem)_18rem]\">\n              {step === 'form' && (\n                <PaymentForm\n                  id={formId}\n                  values={values}\n                  errors={errors}\n                  onChange={change}\n                  onSubmit={review}\n                />\n              )}\n              {step === 'review' && (\n                <PaymentReview\n                  values={values}\n                  summary={summary}\n                  sending={sending}\n                  onBack={() => setStep('form')}\n                  onSend={() => setConfirming(true)}\n                />\n              )}\n              {step === 'receipt' && (\n                <PaymentReceipt\n                  values={values}\n                  summary={summary}\n                  transferId={nextTransferId}\n                  onSendAnother={() => {\n                    setValues(emptyPayment);\n                    setStep('form');\n                  }}\n                />\n              )}\n\n              <RecentTransfers\n                transfers={step === 'receipt' ? [sent, ...recentTransfers] : recentTransfers}\n              />\n            </div>\n          </div>\n        </div>\n      </AppShell.Main>\n\n      <ConfirmDialog\n        open={confirming}\n        onOpenChange={setConfirming}\n        amount={summary.amount}\n        recipient={recipient}\n        scheduled={summary.scheduled}\n        onConfirm={send}\n      />\n    </AppShell>\n  );\n}\n"
    },
    {
      "path": "src/blocks/send-payment/payment-facts.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/send-payment/payment-facts.tsx",
      "content": "'use client';\n\nimport { recipientById, recipientLabel, today } from './data';\nimport { type Fact, FactsList } from './facts-list';\nimport { formatDate, formatUsd } from './format';\nimport type { PaymentSummary, PaymentValues } from './payment';\n\ntype PaymentFactsProps = {\n  values: PaymentValues;\n  summary: PaymentSummary;\n  /** The transfer's number, once it is sent: the receipt leads with it. */\n  transferId?: string;\n};\n\n/**\n * The payment read back: who gets it and when, then the money, ending in what leaves the balance.\n * The review and the receipt show the same list, so what was checked is what the receipt says.\n */\nexport function PaymentFacts({ values, summary, transferId }: PaymentFactsProps) {\n  const recipient = recipientById(values.recipientId);\n  const reference = values.reference.trim();\n\n  const details: Fact[] = [\n    ...(transferId ? [{ label: 'Transfer number', value: transferId }] : []),\n    { label: 'To', value: recipient ? recipientLabel(recipient) : '' },\n    // \"Today\" belongs to the review; the receipt is a record, so it gives the date alone.\n    {\n      label: transferId && !summary.scheduled ? 'Sent' : 'Sends',\n      value:\n        summary.scheduled || transferId\n          ? formatDate(summary.sendDate)\n          : `Today, ${formatDate(today)}`,\n    },\n    ...(summary.arrival ? [{ label: 'Arrives', value: `By ${formatDate(summary.arrival)}` }] : []),\n    ...(reference ? [{ label: 'Reference', value: reference }] : []),\n  ];\n\n  const money: Fact[] = [\n    { label: 'Amount', value: formatUsd(summary.amount) },\n    { label: 'Fee', value: formatUsd(summary.fee) },\n    { label: 'Total debited', value: formatUsd(summary.total), strong: true },\n  ];\n\n  return <FactsList groups={[details, money]} />;\n}\n"
    },
    {
      "path": "src/blocks/send-payment/payment-form.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/send-payment/payment-form.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { Card } from '@/components/ui/wideset/card/Card';\nimport { DatePicker } from '@/components/ui/wideset/datepicker/DatePicker';\nimport { FormField } from '@/components/ui/wideset/form-field/FormField';\nimport { RadioButton } from '@/components/ui/wideset/radio-button/RadioButton';\nimport { RadioButtonGroup } from '@/components/ui/wideset/radio-button/RadioButtonGroup';\nimport { Select } from '@/components/ui/wideset/select/Select';\nimport { TextInput } from '@/components/ui/wideset/text-input/TextInput';\nimport type { FormEvent } from 'react';\n\nimport { recipientLabel, recipients, ROUTES, samplePayment, today } from './data';\nimport { formatAmount, formatUsd } from './format';\nimport { parseAmount, type PaymentErrors, type PaymentValues, type When } from './payment';\n\nconst SAMPLE_TODAY = new Date(`${today}T00:00`);\n\nconst RECIPIENT_OPTIONS = recipients.map((recipient) => ({\n  value: recipient.id,\n  label: recipientLabel(recipient),\n}));\n\ntype PaymentFormProps = {\n  /** Prefix of the fields' ids (`<id>-amount`), so the screen can focus the first one in error. */\n  id: string;\n  values: PaymentValues;\n  errors: PaymentErrors;\n  onChange: (patch: Partial<PaymentValues>) => void;\n  /** Called on submit; the screen checks the values and decides whether to go on. */\n  onSubmit: () => void;\n};\n\n/**\n * The payment, in one column and in the order it is thought of: who gets it, how much, when, and\n * the line they will see on their statement. The example balance and fee stand under the amount.\n * The screen holds the values and the errors, and checks the fields on submit.\n */\nexport function PaymentForm({ id, values, errors, onChange, onSubmit }: PaymentFormProps) {\n  const amount = parseAmount(values.amount);\n\n  const submit = (event: FormEvent<HTMLFormElement>) => {\n    event.preventDefault();\n    onSubmit();\n  };\n\n  return (\n    <form noValidate onSubmit={submit}>\n      <Card>\n        {/* Card.Content keeps 10px free on its right for a scrollbar: the padding gives it back. */}\n        <Card.Content contentClassName=\"pr-ws-6\">\n          <div className=\"gap-ws-11 flex flex-col\">\n            <FormField\n              label=\"Recipient\"\n              htmlFor={`${id}-recipientId`}\n              errorText={errors.recipientId}\n            >\n              <Select\n                id={`${id}-recipientId`}\n                name=\"recipient\"\n                size=\"sm\"\n                className=\"w-full\"\n                hasSearch\n                required\n                options={RECIPIENT_OPTIONS}\n                placeholder=\"Choose a recipient\"\n                value={values.recipientId}\n                onValueChange={(recipientId) => onChange({ recipientId })}\n                variant={errors.recipientId ? 'danger' : 'primary'}\n              />\n            </FormField>\n\n            <FormField\n              label=\"Amount\"\n              htmlFor={`${id}-amount`}\n              helperText={`${formatUsd(samplePayment.balance)} example balance. ${formatUsd(samplePayment.fee)} sample fee.`}\n              errorText={errors.amount}\n            >\n              <TextInput\n                id={`${id}-amount`}\n                name=\"amount\"\n                size=\"sm\"\n                required\n                inputMode=\"decimal\"\n                autoComplete=\"off\"\n                placeholder=\"0.00\"\n                variant={errors.amount ? 'danger' : 'primary'}\n                value={values.amount}\n                onChange={(event) =>\n                  onChange({ amount: event.target.value.replace(/[^\\d.,]/g, '') })\n                }\n                // Leaving the field settles what was typed into an amount: 4250 → 4,250.00.\n                onBlur={() => amount > 0 && onChange({ amount: formatAmount(amount) })}\n              >\n                <TextInput.Prefix>$</TextInput.Prefix>\n                <TextInput.Input className=\"tabular-nums\" />\n              </TextInput>\n            </FormField>\n\n            <div className=\"gap-ws-9 grid grid-cols-2 items-start\">\n              <FormField label=\"Send\" id={`${id}-when`} WrapperComponent=\"fieldset\">\n                {/* As tall as the date field beside it, so the two rows share a centre line. */}\n                <RadioButtonGroup\n                  orientation=\"horizontal\"\n                  aria-labelledby={`${id}-when`}\n                  className=\"min-h-ws-14 items-center\"\n                  value={values.when}\n                  onValueChange={(when) => onChange({ when: when as When })}\n                >\n                  <RadioButton value=\"now\" label=\"Now\" />\n                  <RadioButton value=\"date\" label=\"On a date\" />\n                </RadioButtonGroup>\n              </FormField>\n              {values.when === 'date' && (\n                <FormField label=\"Date\" htmlFor={`${id}-date`} errorText={errors.date}>\n                  <DatePicker\n                    id={`${id}-date`}\n                    size=\"sm\"\n                    className=\"w-full\"\n                    dateFormat=\"MMM d, yyyy\"\n                    placeholder=\"Pick a date\"\n                    // The sample's own today, so the calendar agrees with the rest of the screen;\n                    // drop both to follow the clock.\n                    today={SAMPLE_TODAY}\n                    defaultMonth={SAMPLE_TODAY}\n                    selected={values.date}\n                    onSelect={(date) => onChange({ date })}\n                    variant={errors.date ? 'danger' : 'primary'}\n                  />\n                </FormField>\n              )}\n            </div>\n\n            <FormField\n              label=\"Reference\"\n              suffix=\"(optional)\"\n              htmlFor={`${id}-reference`}\n              helperText=\"The recipient sees it on their statement.\"\n            >\n              <TextInput\n                id={`${id}-reference`}\n                name=\"reference\"\n                size=\"sm\"\n                maxLength={60}\n                autoComplete=\"off\"\n                value={values.reference}\n                onChange={(event) => onChange({ reference: event.target.value })}\n              />\n            </FormField>\n          </div>\n        </Card.Content>\n        <Card.Footer className=\"gap-ws-5 justify-end\">\n          <Button asChild size=\"sm\" variant=\"secondary\" preset=\"ghost\">\n            <a href={ROUTES.transfers}>Cancel</a>\n          </Button>\n          <Button type=\"submit\" size=\"sm\">\n            Review payment\n          </Button>\n        </Card.Footer>\n      </Card>\n    </form>\n  );\n}\n"
    },
    {
      "path": "src/blocks/send-payment/payment-receipt.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/send-payment/payment-receipt.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { Card } from '@/components/ui/wideset/card/Card';\n\nimport { ROUTES } from './data';\nimport type { PaymentSummary, PaymentValues } from './payment';\nimport { PaymentFacts } from './payment-facts';\n\ntype PaymentReceiptProps = {\n  values: PaymentValues;\n  summary: PaymentSummary;\n  transferId: string;\n  onSendAnother: () => void;\n};\n\n/**\n * The receipt the page becomes once the payment is out: the list that was reviewed, now led by\n * the transfer's number, and the two ways on. Its status sits beside the page's title.\n */\nexport function PaymentReceipt({\n  values,\n  summary,\n  transferId,\n  onSendAnother,\n}: PaymentReceiptProps) {\n  return (\n    <Card>\n      {/* Card.Content keeps 10px free on its right for a scrollbar: the padding gives it back. */}\n      <Card.Content contentClassName=\"pr-ws-6\">\n        <PaymentFacts values={values} summary={summary} transferId={transferId} />\n      </Card.Content>\n      <Card.Footer className=\"gap-ws-5 justify-end\">\n        <Button size=\"sm\" variant=\"secondary\" preset=\"border\" onClick={onSendAnother}>\n          Send another\n        </Button>\n        <Button asChild size=\"sm\">\n          <a href={ROUTES.transfers}>View transfers</a>\n        </Button>\n      </Card.Footer>\n    </Card>\n  );\n}\n"
    },
    {
      "path": "src/blocks/send-payment/payment-review.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/send-payment/payment-review.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { Card } from '@/components/ui/wideset/card/Card';\n\nimport { formatUsd } from './format';\nimport type { PaymentSummary, PaymentValues } from './payment';\nimport { PaymentFacts } from './payment-facts';\n\ntype PaymentReviewProps = {\n  values: PaymentValues;\n  summary: PaymentSummary;\n  /** While the payment is on its way out: both buttons wait. */\n  sending: boolean;\n  onBack: () => void;\n  onSend: () => void;\n};\n\n/**\n * The step before anything moves: the payment read back, then the way back and the page's one\n * filled button, which names what it does and how much.\n */\nexport function PaymentReview({ values, summary, sending, onBack, onSend }: PaymentReviewProps) {\n  const verb = summary.scheduled ? 'Schedule' : 'Send';\n\n  return (\n    <Card>\n      {/* Card.Content keeps 10px free on its right for a scrollbar: the padding gives it back. */}\n      <Card.Content contentClassName=\"pr-ws-6\">\n        <PaymentFacts values={values} summary={summary} />\n      </Card.Content>\n      <Card.Footer className=\"gap-ws-5 items-center justify-end\">\n        <Button size=\"sm\" variant=\"secondary\" preset=\"border\" disabled={sending} onClick={onBack}>\n          Back\n        </Button>\n        <Button size=\"sm\" disabled={sending} onClick={onSend}>\n          {sending ? 'Sending…' : `${verb} ${formatUsd(summary.amount)}`}\n        </Button>\n      </Card.Footer>\n    </Card>\n  );\n}\n"
    },
    {
      "path": "src/blocks/send-payment/payment.ts",
      "type": "registry:file",
      "target": "blocks/wideset/send-payment/payment.ts",
      "content": "import { samplePayment, today } from './data';\nimport { formatUsd } from './format';\n\nexport type When = 'now' | 'date';\n\n/** The payment as the form holds it. The amount is the text in its field. */\nexport type PaymentValues = {\n  recipientId: string;\n  amount: string;\n  when: When;\n  /** The day to send it, when `when` is `date`. */\n  date?: string;\n  reference: string;\n};\n\nexport type PaymentField = 'recipientId' | 'amount' | 'date';\nexport type PaymentErrors = Partial<Record<PaymentField, string>>;\n\nexport const emptyPayment: PaymentValues = {\n  recipientId: '',\n  amount: '',\n  when: 'now',\n  reference: '',\n};\n\n/** The payment the screen opens with: this quarter's commission for Halcyon Freight. */\nexport const draftPayment: PaymentValues = {\n  recipientId: 'halcyon-freight',\n  amount: '4,250.00',\n  when: 'now',\n  reference: 'Partner commission, Q3 2026',\n};\n\n/** `4,250.5` → 425050 cents. Not a number, or nothing typed: NaN. */\nexport const parseAmount = (text: string) =>\n  text.trim() ? Math.round(Number(text.replace(/,/g, '')) * 100) : NaN;\n\n/** Combine the form values and sample fee for the review and receipt. */\nexport function summarizePayment(values: PaymentValues) {\n  const amount = parseAmount(values.amount);\n  const sendDate = values.when === 'date' && values.date ? values.date : today;\n\n  return {\n    amount,\n    fee: samplePayment.fee,\n    total: amount + samplePayment.fee,\n    sendDate,\n    scheduled: sendDate > today,\n    arrival: sendDate === today ? samplePayment.arrival : undefined,\n  };\n}\n\nexport type PaymentSummary = ReturnType<typeof summarizePayment>;\n\n/** Field errors to illustrate form validation before review. */\nexport function validatePaymentForm(values: PaymentValues): PaymentErrors {\n  const errors: PaymentErrors = {};\n  const amount = parseAmount(values.amount);\n\n  if (!values.recipientId) errors.recipientId = 'Choose who gets the payment.';\n\n  if (!values.amount.trim()) errors.amount = 'Enter an amount.';\n  else if (!Number.isFinite(amount) || amount <= 0)\n    errors.amount = 'Enter an amount above zero, like 250.00.';\n  else if (amount + samplePayment.fee > samplePayment.balance)\n    errors.amount = `Enter ${formatUsd(samplePayment.balance - samplePayment.fee)} or less. The balance has to cover the fee too.`;\n\n  if (values.when === 'date') {\n    if (!values.date) errors.date = 'Pick the day to send it.';\n    else if (values.date < today) errors.date = 'That day has passed. Pick today or later.';\n  }\n\n  return errors;\n}\n"
    },
    {
      "path": "src/blocks/send-payment/people.assets.ts",
      "type": "registry:file",
      "target": "blocks/wideset/send-payment/people.assets.ts",
      "content": "// Portraits of the sample people as small JPEG data URLs (a block ships only .ts and .tsx).\n// Exported from the Wideset Core Figma file by people.cjs: do not edit by hand.\n\n/** A person’s photo by name. People who are not here show their initials. */\nexport const PHOTOS: Record<string, string | undefined> = {\n  'Maya Okafor':\n    'data:image/jpeg;base64,/9j/4AAQSk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FOWJbrKo1LqFiXvYhtJwvjKU44qRdFdTW/Td1ukW5yUx/wBQS0W3XDhG5G7gnwzv/FNk6whCisNYyeOKSRNFzb7cWIMKMt+U+oJQ2kck/wBB6+FO0KoGAoiRZ6dTvuo/aajiSmJrCH4zzbzCxlLjagpKvsRSkVI9NdPGNOaVtdmwlS4rQSpYGMq5Kj7qJNHSNGPhO+O4Ck+Ch3Vsmi2Ia27QW9Tar4T/ABI0mjBxR0q3SoKsPtFIH+ocik4NBII5zbp1UqrxIcj0jzpzT72oJvZoO1hvBdX5DyHqatJmzxrSlLcZlKGsDuHP80RoW3CFp+Orbhb+XVHzz3fjFP7mFpQT5lJrQpUwq56zz/WNRe5rtTB8KnAHzELaQ5jP80oTltQUPeiktlh1SPDvFGnuowmPIjqrppadUuLlMuKgXFf7nWk5Ss+akeP3GDVbS+id8TJQf8FKbTxuS4U59iKvTOPPNe7RYP7iKRr6fQrHiYYPpH7fU7igOFWyPWUOr4fZ90dQqZNjQmU+DSS4r27h75qxNJ9NrBoZClwGC7NcG1cp47nFDyz4D0GKmaipYwSTRak/UPSrULGjQOUG/nK3GoV7gYdtvIbRKIyFHcoZJNKEMJSg4AAr2PqA8AK6+5sVHb/5F01E4ln2pp9gpWgHcOePCqlvlt/Spqmx/lq5TVzSXgqYIoOCEb1HyA/9NVxrVjfHafA+rG/2JoVZAVmto141vcKM+FtjP//Z',\n};\n"
    },
    {
      "path": "src/blocks/send-payment/person-avatar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/send-payment/person-avatar.tsx",
      "content": "'use client';\n\nimport type { AvatarProps } from '@/components/ui/wideset/avatar/Avatar.types';\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\n\nimport { PHOTOS } from './people.assets';\n\ntype PersonAvatarProps = Pick<\n  AvatarProps,\n  'size' | 'shape' | 'status' | 'color' | 'className' | 'title' | 'aria-hidden' | 'aria-label'\n> & {\n  /** The person's full name: the key their photo is filed under. */\n  name: string;\n  initials: string;\n  /** Leave empty beside the person's name; pass the name where the avatar stands alone. */\n  alt?: string;\n};\n\n/**\n * A person's avatar: their photo when the sample people have one, otherwise their initials in\n * their colour. A real product mixes the two, so every place the block draws a person asks here\n * and the choice is made once. The initials stay as the fallback if the image fails to load.\n */\nexport function PersonAvatar({ name, initials, color, alt = '', ...props }: PersonAvatarProps) {\n  const photo = PHOTOS[name];\n  return photo ? (\n    <Avatar src={photo} alt={alt} initials={initials} {...props} />\n  ) : (\n    <Avatar initials={initials} color={color} {...props} />\n  );\n}\n"
    },
    {
      "path": "src/blocks/send-payment/recent-transfers.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/send-payment/recent-transfers.tsx",
      "content": "'use client';\n\n// TODO(custom): transfer row (recipient, date and state, amount); ListItem is a clickable menu row and a Table is too much for four lines.\nimport { useId } from 'react';\n\nimport type { Transfer } from './data';\nimport { formatDayMonth, formatUsd } from './format';\n\n/**\n * The last payments sent, beside the form as a quiet check: who was paid, when and how much. Text\n * only, no lines and no badges, so it never competes with the payment being made. A state is a\n * word here: every one of them is a lifecycle state.\n */\nexport function RecentTransfers({ transfers }: { transfers: Transfer[] }) {\n  const titleId = useId();\n\n  return (\n    <aside aria-labelledby={titleId} className=\"gap-ws-9 flex flex-col\">\n      <h2 id={titleId} className=\"typography-label-strong-md text-ws-static-strong\">\n        Recent transfers\n      </h2>\n      <ul className=\"gap-ws-9 flex flex-col\">\n        {transfers.map((transfer) => (\n          <li key={transfer.id} className=\"gap-ws-9 flex items-baseline justify-between\">\n            <div className=\"flex min-w-0 flex-col\">\n              <span className=\"typography-body-md text-ws-static-base truncate\">\n                {transfer.recipient}\n              </span>\n              <span className=\"typography-caption-md text-ws-static-subtle tabular-nums\">\n                {formatDayMonth(transfer.date)}, {transfer.status.toLowerCase()}\n              </span>\n            </div>\n            <span className=\"typography-body-md text-ws-static-base shrink-0 tabular-nums\">\n              {formatUsd(transfer.amount)}\n            </span>\n          </li>\n        ))}\n      </ul>\n    </aside>\n  );\n}\n"
    },
    {
      "path": "src/blocks/send-payment/sidebar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/send-payment/sidebar.tsx",
      "content": "'use client';\n\n// TODO(custom): workspace switcher and account menu are composed by hand.\nimport {\n  RiAddLine,\n  RiArrowDownSLine,\n  RiLogoutBoxRLine,\n  RiSearchLine,\n  RiSettingsLine,\n} from '@remixicon/react';\nimport { Divider } from '@/components/ui/wideset/divider/Divider';\nimport { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { ListItem } from '@/components/ui/wideset/list-item/ListItem';\nimport { Sidebar } from '@/components/ui/wideset/sidebar/Sidebar';\nimport { type SidebarProps } from '@/components/ui/wideset/sidebar/Sidebar.types';\nimport { TextInput } from '@/components/ui/wideset/text-input/TextInput';\nimport { useState } from 'react';\n\nimport { BrandMark } from './brand-mark';\nimport {\n  account,\n  helpLink,\n  mainLinks,\n  type NavLink,\n  product,\n  settingsLinks,\n  workspace,\n} from './data';\nimport { PersonAvatar } from './person-avatar';\n\n/**\n * The workspace sidebar: switcher, search, the app's pages, settings and the signed-in account.\n * Its toggle sits in the page bar, so the screen holds `collapsed` and passes it down; collapsed,\n * it keeps the mark, the page icons and the avatar.\n */\nexport function SendPaymentSidebar(\n  props: Pick<SidebarProps, 'id' | 'collapsed' | 'onCollapsedChange'>,\n) {\n  const [active, setActive] = useState('payouts');\n\n  const link = ({ id, label, icon, activeIcon }: NavLink) => (\n    <Sidebar.Item\n      key={id}\n      href={`#${id}`}\n      icon={active === id ? (activeIcon ?? icon) : icon}\n      label={label}\n      active={active === id}\n      onClick={() => setActive(id)}\n    />\n  );\n\n  const nav = (\n    <nav aria-label=\"Workspace\" className=\"gap-ws-9 flex flex-col\">\n      <div className=\"flex flex-col\">{mainLinks.map(link)}</div>\n      <Divider weight=\"thin\" />\n      <div role=\"group\" aria-labelledby=\"sidebar-settings\" className=\"gap-ws-2 flex flex-col\">\n        <Sidebar.SectionHeader id=\"sidebar-settings\">Settings</Sidebar.SectionHeader>\n        {settingsLinks.map(link)}\n      </div>\n    </nav>\n  );\n\n  return (\n    <Sidebar {...props}>\n      <Sidebar.Header>\n        <Sidebar.Expanded>\n          <div className=\"gap-ws-9 flex flex-col\">\n            <div className=\"gap-ws-7 pt-ws-3 pb-ws-7 flex items-center\">\n              <BrandMark className=\"size-ws-15\" />\n              <div className=\"flex min-w-0 flex-1 flex-col\">\n                <span className=\"typography-label-strong-sm text-ws-static-strong truncate\">\n                  {workspace.name}\n                </span>\n                <span className=\"typography-caption-md text-ws-static-subtle truncate\">\n                  {product.name}\n                </span>\n              </div>\n              <DropdownMenu>\n                <DropdownMenu.Trigger asChild>\n                  <IconButton\n                    icon={RiArrowDownSLine}\n                    variant=\"secondary\"\n                    preset=\"ghost\"\n                    size=\"xs\"\n                    aria-label=\"Switch workspace\"\n                    className=\"mr-ws-3\"\n                  />\n                </DropdownMenu.Trigger>\n                <DropdownMenu.Content className=\"ws-block-utility\" align=\"end\">\n                  <DropdownMenu.Item data-state=\"checked\">\n                    <ListItem.Content>\n                      <ListItem.Label>{workspace.name}</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                  <DropdownMenu.Separator />\n                  <DropdownMenu.Item>\n                    <ListItem.Prefix>\n                      <RiAddLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>New workspace</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                </DropdownMenu.Content>\n              </DropdownMenu>\n            </div>\n            <TextInput size=\"sm\">\n              <TextInput.Prefix inner>\n                <TextInput.Icon icon={RiSearchLine} />\n              </TextInput.Prefix>\n              <TextInput.Input type=\"search\" placeholder=\"Search\" aria-label=\"Search\" />\n            </TextInput>\n          </div>\n        </Sidebar.Expanded>\n        <Sidebar.Collapsed>\n          <div className=\"pt-ws-3 pb-ws-7 flex justify-center\">\n            <BrandMark className=\"size-ws-15\" />\n          </div>\n        </Sidebar.Collapsed>\n      </Sidebar.Header>\n\n      {/* A section draws only the slot for the state it is in, so the pages go in both. */}\n      <Sidebar.Section scrollable>{nav}</Sidebar.Section>\n\n      <Sidebar.Footer>\n        <div className=\"gap-ws-9 flex flex-col\">\n          <div className=\"flex flex-col\">{link(helpLink)}</div>\n          {/* On the grey ground the line keeps the nav's inset: run edge to edge, it would stop\n              short of the page and read as broken. */}\n          <div className=\"border-ws-static-base pt-ws-5 border-t\">\n            <Sidebar.Expanded>\n              <DropdownMenu>\n                <DropdownMenu.Trigger asChild>\n                  <button\n                    type=\"button\"\n                    className=\"gap-ws-5 px-ws-5 py-ws-3 rounded-ws-control-lg hover:bg-ws-dynamic-tertiary-alpha-strong-default focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default flex w-full items-center text-left\"\n                  >\n                    <PersonAvatar name={account.name} initials={account.initials} color=\"orange\" />\n                    <span className=\"flex min-w-0 flex-1 flex-col\">\n                      <span className=\"typography-label-strong-sm text-ws-static-base truncate\">\n                        {account.name}\n                      </span>\n                      <span className=\"typography-caption-md text-ws-static-subtle truncate\">\n                        {account.email}\n                      </span>\n                    </span>\n                    <RiArrowDownSLine\n                      aria-hidden=\"true\"\n                      className=\"size-ws-9 text-ws-static-strong\"\n                    />\n                  </button>\n                </DropdownMenu.Trigger>\n                <DropdownMenu.Content side=\"top\" align=\"start\" className=\"ws-block-utility w-[14rem]\">\n                  <DropdownMenu.Item>\n                    <ListItem.Prefix>\n                      <RiSettingsLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>Account settings</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                  <DropdownMenu.Separator />\n                  <DropdownMenu.Item variant=\"danger\">\n                    <ListItem.Prefix>\n                      <RiLogoutBoxRLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>Log out</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                </DropdownMenu.Content>\n              </DropdownMenu>\n            </Sidebar.Expanded>\n            <Sidebar.Collapsed>\n              <div className=\"flex justify-center\">\n                <PersonAvatar\n                  name={account.name}\n                  initials={account.initials}\n                  color=\"orange\"\n                  title={account.name}\n                  alt={account.name}\n                />\n              </div>\n            </Sidebar.Collapsed>\n          </div>\n        </div>\n      </Sidebar.Footer>\n    </Sidebar>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "1.1.0",
    "commit": "a734f9f0"
  }
}
