{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-import",
  "type": "registry:block",
  "title": "Import",
  "description": "Importing customers from a CSV file in steps on a raised page: the file, matching its columns to fields, a review of what will change with a choice for duplicates, then the result in place, with exporting from the header.",
  "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/checkbox.json",
    "https://wideset.co/r/divider.json",
    "https://wideset.co/r/dropdown-menu.json",
    "https://wideset.co/r/file-item.json",
    "https://wideset.co/r/file-upload.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/modal.json",
    "https://wideset.co/r/progress-stepper.json",
    "https://wideset.co/r/radio-button.json",
    "https://wideset.co/r/select.json",
    "https://wideset.co/r/sidebar.json",
    "https://wideset.co/r/table.json",
    "https://wideset.co/r/text-input.json",
    "https://wideset.co/r/toast.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/import/brand-mark.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/import/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/import/code.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/import/code.tsx",
      "content": "'use client';\n\n// TODO(custom): code in text, inline; Wideset has no Code component.\nimport type { ReactNode } from 'react';\n\n/** A name to type exactly as written (a column, a field), in the monospace face of its line. */\nexport function Code({ children }: { children: ReactNode }) {\n  return <code className=\"text-ws-static-strong font-ws-mono\">{children}</code>;\n}\n"
    },
    {
      "path": "src/blocks/import/csv-href.ts",
      "type": "registry:file",
      "target": "blocks/wideset/import/csv-href.ts",
      "content": "/**\n * A CSV file as a link's target, the way a spreadsheet opens it: every cell quoted, quotes inside\n * doubled. With `download` on the link the browser saves it; nothing is sent anywhere. A real\n * screen links to the file on the server instead.\n */\nexport const csvHref = (rows: (string | number)[][]) =>\n  `data:text/csv;charset=utf-8,${encodeURIComponent(\n    rows\n      .map((row) => row.map((cell) => `\"${String(cell).replace(/\"/g, '\"\"')}\"`).join(','))\n      .join('\\n'),\n  )}`;\n"
    },
    {
      "path": "src/blocks/import/data.ts",
      "type": "registry:file",
      "target": "blocks/wideset/import/data.ts",
      "content": "import {\n  type RemixiconComponentType,\n  RiBankCardLine,\n  RiContactsBook3Fill,\n  RiContactsBook3Line,\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/*\n  Maya imports the customers her team gathered this quarter from a CSV file, the way the help\n  article \"Import customers from a CSV file\" explains it: the same columns (only `name` is\n  required, `domain` finds duplicates), the same limits (5,000 rows, 10 MB). Today is\n  10 November 2026; Lumen Studio has 1,284 customers in Orbit before the import. The file is\n  simulated: whatever is chosen stands for customers-q4.csv, 248 rows, read as below.\n*/\n\n/** The product is Orbit; the workspace using it 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\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  {\n    id: 'customers',\n    label: 'Customers',\n    icon: RiContactsBook3Line,\n    activeIcon: RiContactsBook3Fill,\n  },\n  { id: 'deals', label: 'Deals', icon: RiHandCoinLine },\n  { id: 'revenue', label: 'Revenue', icon: RiLineChartLine },\n  { id: 'reports', label: 'Reports', icon: RiPieChart2Line },\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\nexport const TODAY = '2026-11-10';\n\n/** What one import takes, as the help article states it. */\nexport const LIMITS = { rows: 5000, megabytes: 10 };\n\n/** The help article this screen follows. */\nexport const guide = { title: 'Import customers from a CSV file', href: '#import-customers-csv' };\n\n/** The customers in Orbit before this import. */\nexport const CUSTOMERS_BEFORE = 1284;\n\n/** The Orbit fields a column can fill, named after the columns the article lists. */\nexport const fields = [\n  { value: 'name', label: 'Name', column: 'name', required: true, holds: 'The company’s name' },\n  { value: 'domain', label: 'Domain', column: 'domain', holds: 'Its website, to find duplicates' },\n  {\n    value: 'owner_email',\n    label: 'Owner e-mail',\n    column: 'owner_email',\n    holds: 'The teammate who owns it',\n  },\n  { value: 'stage', label: 'Stage', column: 'stage', holds: 'Lead, Prospect, Customer or Churned' },\n  {\n    value: 'annual_value',\n    label: 'Annual value',\n    column: 'annual_value',\n    holds: 'Expected revenue a year, in dollars',\n  },\n];\n\n/** The choice that leaves a column out. */\nexport const SKIP = 'skip';\n\n/** The file as Orbit read it. */\nexport const file = { name: 'customers-q4.csv', rows: 248, size: '38 KB' };\n\nexport type FileColumn = {\n  id: string;\n  /** The column's name in the file's first row. */\n  header: string;\n  /** Its value in the first customer's row. */\n  sample: string;\n  /** The field Orbit chose: the same name matches; an ID column is left out; else nothing. */\n  match: string | null;\n  /** Why Orbit chose as it did, in a few words. */\n  note?: string;\n};\n\nexport const fileColumns: FileColumn[] = [\n  { id: 'company', header: 'Company', sample: 'Halcyon Freight', match: null },\n  {\n    id: 'domain',\n    header: 'domain',\n    sample: 'halcyonfreight.com',\n    match: 'domain',\n    note: 'Matched by name',\n  },\n  {\n    id: 'owner_email',\n    header: 'owner_email',\n    sample: 'jonas@lumenstudio.co',\n    match: 'owner_email',\n    note: 'Matched by name',\n  },\n  {\n    id: 'record_id',\n    header: 'Record ID',\n    sample: '40118',\n    match: SKIP,\n    note: 'Orbit gives customers its own IDs',\n  },\n];\n\n/** What the rows come to: new companies, ones Orbit has by domain, and rows it cannot read. */\nexport const counts = { fresh: 212, existing: 31, invalid: 5 };\n\nexport type Duplicates = 'update' | 'skip' | 'create';\n\n/** What happens to the 31 rows whose domain Orbit already has. */\nexport const duplicateChoices: { value: Duplicates; label: string; description: string }[] = [\n  {\n    value: 'update',\n    label: 'Update them',\n    description: 'The file’s values replace the ones in Orbit. This can’t be undone.',\n  },\n  {\n    value: 'skip',\n    label: 'Skip them',\n    description: 'The customers in Orbit stay as they are.',\n  },\n  {\n    value: 'create',\n    label: 'Create them anyway',\n    description: 'Adds a second customer with the same domain.',\n  },\n];\n\n/** What an import does with each kind of row, for the figures and the button. */\nexport function outcome(duplicates: Duplicates) {\n  const { fresh, existing, invalid } = counts;\n  return {\n    added: duplicates === 'create' ? fresh + existing : fresh,\n    updated: duplicates === 'update' ? existing : 0,\n    skipped: duplicates === 'skip' ? invalid + existing : invalid,\n  };\n}\n\nexport type SkippedRow = {\n  /** The row's line in the file, counting the column names as line 1. */\n  row: number;\n  name: string;\n  domain: string;\n  reason: string;\n};\n\n/** The rows Orbit cannot read, and why. A row without a name is not a customer. */\nexport const skippedRows: SkippedRow[] = [\n  { row: 17, name: '', domain: 'brightline.io', reason: 'No name' },\n  {\n    row: 42,\n    name: 'Orchid Labs',\n    domain: 'orchidlabs.com',\n    reason: 'Owner e-mail is incomplete',\n  },\n  { row: 88, name: '', domain: 'westgate-logistics.com', reason: 'No name' },\n  {\n    row: 131,\n    name: 'Fernhill Dental',\n    domain: 'fernhilldental.co.uk',\n    reason: 'Owner e-mail is incomplete',\n  },\n  { row: 203, name: '', domain: 'sablepoint.com', reason: 'No name' },\n];\n\nexport type PastImport = {\n  id: string;\n  file: string;\n  /** The calendar day it ran. */\n  date: string;\n  by: string;\n  added: number;\n  updated: number;\n  skipped: number;\n};\n\n/** The imports before this one, newest first. */\nexport const pastImports: PastImport[] = [\n  {\n    id: 'q3',\n    file: 'customers-q3.csv',\n    date: '2026-08-04',\n    by: 'Jonas Weber',\n    added: 186,\n    updated: 12,\n    skipped: 3,\n  },\n  {\n    id: 'hubspot',\n    file: 'hubspot-companies.csv',\n    date: '2026-05-21',\n    by: 'Maya Okafor',\n    added: 1040,\n    updated: 0,\n    skipped: 14,\n  },\n];\n\n/** The first lines of the sample file: every column, one customer. */\nexport const sampleCsv = [\n  fields.map((field) => field.column),\n  ['Halcyon Freight', 'halcyonfreight.com', 'jonas@lumenstudio.co', 'Customer', '48000'],\n];\n\n/** The customers the signed-in person owns, for an export of only hers. */\nexport const OWNED_BY_ME = 162;\n\n/**\n * A few of the customers an export writes, in the columns an import reads, so a file can go out,\n * be edited and come back in. A real export writes every customer chosen.\n */\nexport const exportSample = [\n  ['Halcyon Freight', 'halcyonfreight.com', 'jonas@lumenstudio.co', 'Customer', 48000],\n  ['Northwind Health', 'northwindhealth.com', 'priya@lumenstudio.co', 'Customer', 96000],\n  ['Kestrel Analytics', 'kestrelanalytics.io', 'maya@lumenstudio.co', 'Prospect', 36000],\n  ['Atlas Robotics', 'atlasrobotics.com', 'tom@lumenstudio.co', 'Customer', 72000],\n  ['Cobalt Security', 'cobaltsecurity.com', 'elena@lumenstudio.co', 'Lead', 24000],\n  ['Juniper Legal', 'juniperlegal.co.uk', 'daniel@lumenstudio.co', 'Customer', 30000],\n  ['Marlow & Finch', 'marlowfinch.com', 'maya@lumenstudio.co', 'Customer', 54000],\n  ['Tidewater Energy', 'tidewaterenergy.com', 'leo@lumenstudio.co', 'Churned', 0],\n];\n"
    },
    {
      "path": "src/blocks/import/export-dialog.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/import/export-dialog.tsx",
      "content": "'use client';\n\nimport { RiDownload2Line } from '@remixicon/react';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { Checkbox } from '@/components/ui/wideset/checkbox/Checkbox';\nimport { CheckboxGroup } from '@/components/ui/wideset/checkbox/CheckboxGroup';\nimport { FormField } from '@/components/ui/wideset/form-field/FormField';\nimport { Modal } from '@/components/ui/wideset/modal/Modal';\nimport { RadioButton } from '@/components/ui/wideset/radio-button/RadioButton';\nimport { RadioButtonGroup } from '@/components/ui/wideset/radio-button/RadioButtonGroup';\nimport { useId, useState } from 'react';\n\nimport { csvHref } from './csv-href';\nimport { account, exportSample, fields, OWNED_BY_ME } from './data';\nimport { customers } from './format';\n\ntype Scope = 'all' | 'mine';\n\ntype ExportFormProps = {\n  /** The customers in Orbit now, imports included. */\n  total: number;\n  onExport: (count: number) => void;\n};\n\n/**\n * The dialog's content. It mounts with the dialog, so every opening starts from all customers\n * and every field. The name is always in the file: without it a row cannot come back in.\n */\nfunction ExportForm({ total, onExport }: ExportFormProps) {\n  const id = useId();\n  const [scope, setScope] = useState<Scope>('all');\n  const [chosen, setChosen] = useState(fields.map((field) => field.value));\n\n  const count = scope === 'all' ? total : OWNED_BY_ME;\n  const columns = fields.filter((field) => chosen.includes(field.value));\n  const rows = exportSample.filter((row) => scope === 'all' || row[2] === account.email);\n  const href = csvHref([\n    columns.map((field) => field.column),\n    ...rows.map((row) => columns.map((field) => row[fields.indexOf(field)])),\n  ]);\n\n  return (\n    <>\n      <Modal.Header>\n        <Modal.Title>Export customers</Modal.Title>\n        <Modal.Description>\n          A CSV file in the columns an import reads, so it can be edited and brought back in.\n        </Modal.Description>\n      </Modal.Header>\n      <Modal.Body className=\"gap-ws-11 flex flex-col\">\n        <FormField label=\"Customers\" id={`${id}-scope`} WrapperComponent=\"fieldset\">\n          <RadioButtonGroup\n            aria-labelledby={`${id}-scope`}\n            value={scope}\n            onValueChange={(value) => setScope(value as Scope)}\n          >\n            <RadioButton value=\"all\" label=\"All customers\" description={customers(total)} />\n            <RadioButton\n              value=\"mine\"\n              label=\"Customers I own\"\n              description={customers(OWNED_BY_ME)}\n            />\n          </RadioButtonGroup>\n        </FormField>\n        <FormField label=\"Fields\" id={`${id}-fields`} WrapperComponent=\"fieldset\">\n          <CheckboxGroup aria-labelledby={`${id}-fields`} className=\"grid grid-cols-2\">\n            {fields.map((field) => (\n              <Checkbox\n                key={field.value}\n                label={field.label}\n                disabled={field.required}\n                checked={chosen.includes(field.value)}\n                onCheckedChange={(on) =>\n                  setChosen(\n                    on === true\n                      ? [...chosen, field.value]\n                      : chosen.filter((value) => value !== field.value),\n                  )\n                }\n              />\n            ))}\n          </CheckboxGroup>\n        </FormField>\n      </Modal.Body>\n      <Modal.Footer>\n        <Modal.Close asChild>\n          <Button variant=\"secondary\" preset=\"border\">\n            Cancel\n          </Button>\n        </Modal.Close>\n        <Button asChild>\n          <a href={href} download=\"customers.csv\" onClick={() => onExport(count)}>\n            <Button.Icon icon={RiDownload2Line} />\n            {/* Under asChild the label's inset is ours to give, as Button gives its own. */}\n            <span className=\"px-ws-2\">{`Export ${customers(count)}`}</span>\n          </a>\n        </Button>\n      </Modal.Footer>\n    </>\n  );\n}\n\ntype ExportDialogProps = ExportFormProps & {\n  open: boolean;\n  onOpenChange: (open: boolean) => void;\n};\n\n/**\n * Exporting customers, the other half of Import & Export: who goes in the file and which fields.\n * The format is not a choice, because CSV is the one an import reads back.\n */\nexport function ExportDialog({ open, onOpenChange, total, onExport }: ExportDialogProps) {\n  return (\n    <Modal open={open} onOpenChange={onOpenChange}>\n      <Modal.Content className=\"ws-block-utility\">\n        <ExportForm total={total} onExport={onExport} />\n      </Modal.Content>\n    </Modal>\n  );\n}\n"
    },
    {
      "path": "src/blocks/import/file-guide.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/import/file-guide.tsx",
      "content": "'use client';\n\nimport { Card } from '@/components/ui/wideset/card/Card';\nimport { useId } from 'react';\n\nimport { Code } from './code';\nimport { fields, guide } from './data';\nimport { TextLink } from './text-link';\n\n/**\n * Beside the steps: the columns Orbit reads, as the help article lists them, so the file can be\n * checked without leaving the page, and the article for the rest. A card like the step beside it,\n * so the row keeps one treatment; it holds plain text and no action, so the step stays the heavier.\n */\nexport function FileGuide() {\n  const titleId = useId();\n\n  return (\n    <section aria-labelledby={titleId}>\n      <Card>\n        <Card.Header>\n          <div className=\"gap-ws-2 flex flex-col\">\n            <h2 id={titleId} className=\"typography-label-strong-md text-ws-static-strong\">\n              Columns Orbit reads\n            </h2>\n            <p className=\"typography-body-md text-ws-static-subtle\">\n              Only name is required. Any other column can be matched to a field or left out.\n            </p>\n          </div>\n        </Card.Header>\n        {/* Card.Content keeps room on its right for a scrollbar; this puts the text back in line. */}\n        <Card.Content contentClassName=\"pr-ws-6 gap-ws-11 flex flex-col\">\n          <dl className=\"gap-ws-7 flex flex-col\">\n            {fields.map((field) => (\n              <div key={field.value} className=\"gap-ws-2 flex flex-col\">\n                <dt className=\"typography-label-sm\">\n                  <Code>{field.column}</Code>\n                  {field.required && <span className=\"text-ws-static-subtle\">, required</span>}\n                </dt>\n                <dd className=\"typography-label-sm text-ws-static-subtle\">{field.holds}</dd>\n              </div>\n            ))}\n          </dl>\n          <p className=\"typography-body-md text-ws-static-subtle\">\n            More in <TextLink href={guide.href}>{guide.title}</TextLink>.\n          </p>\n        </Card.Content>\n      </Card>\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/import/format.ts",
      "type": "registry:file",
      "target": "blocks/wideset/import/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);\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});\n\n/** 1284 → 1,284. */\nexport const formatCount = (value: number) => count.format(value);\n/** Nov 10, 2026. */\nexport const formatDate = (iso: string) => date.format(new Date(iso));\n/** 1 customer, 243 customers. */\nexport const customers = (value: number) =>\n  `${formatCount(value)} ${value === 1 ? 'customer' : 'customers'}`;\n/** 38912 → 38 KB. */\nexport const formatSize = (bytes: number) =>\n  `${formatCount(Math.max(1, Math.round(bytes / 1024)))} KB`;\n"
    },
    {
      "path": "src/blocks/import/import-result.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/import/import-result.tsx",
      "content": "'use client';\n\nimport { RiCheckboxCircleFill } from '@remixicon/react';\nimport { Button } from '@/components/ui/wideset/button/Button';\n\nimport { account, file } from './data';\nimport { customers } from './format';\nimport { OutcomeFigures } from './outcome-figures';\n\ntype ImportResultProps = {\n  /** The heading's id: focus lands on it when the import ends. */\n  id: string;\n  result: { added: number; updated: number; skipped: number };\n  onImportAnother: () => void;\n  /** A dialog holds the filled button: View customers steps back to a bordered one. */\n  quiet?: boolean;\n};\n\n/**\n * The last step: the result where the steps were. A small mark in the positive colour, the only\n * colour on it, since a finished import is good news; what came in, as the same figures the review\n * promised; and the two ways on, to the customers or to another file.\n */\nexport function ImportResult({ id, result, onImportAnother, quiet }: ImportResultProps) {\n  return (\n    <section aria-labelledby={id} className=\"gap-ws-12 flex flex-col\">\n      <div className=\"gap-ws-7 flex flex-col\">\n        <RiCheckboxCircleFill aria-hidden=\"true\" className=\"size-ws-12 text-ws-semantic-positive\" />\n        <div className=\"gap-ws-2 flex flex-col\">\n          <h2\n            id={id}\n            tabIndex={-1}\n            className=\"typography-subtitle-xs text-ws-static-strong outline-none\"\n          >\n            {customers(result.added + result.updated)} imported\n          </h2>\n          <p className=\"typography-body-md text-ws-static-subtle\">\n            From {file.name}. New customers carry Import as their source, so you can filter for\n            them; a summary is on its way to {account.email}.\n          </p>\n        </div>\n      </div>\n      <OutcomeFigures {...result} />\n      <div className=\"gap-ws-5 flex\">\n        <Button\n          size=\"sm\"\n          variant={quiet ? 'secondary' : 'primary'}\n          preset={quiet ? 'border' : 'filled'}\n          asChild\n        >\n          <a href=\"#customers\">\n            <span className=\"px-ws-2\">View customers</span>\n          </a>\n        </Button>\n        <Button size=\"sm\" variant=\"secondary\" preset=\"border\" onClick={onImportAnother}>\n          Import another file\n        </Button>\n      </div>\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/import/index.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/import/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 { Button } from '@/components/ui/wideset/button/Button';\nimport { Card } from '@/components/ui/wideset/card/Card';\nimport { cn } from '@/lib/wideset/utils';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { ProgressStepper } from '@/components/ui/wideset/progress-stepper/ProgressStepper';\nimport { ToastProvider, useToast } from '@/components/ui/wideset/toast/Toast.context';\nimport { useEffect, useId, useRef, useState } from 'react';\n\nimport {\n  account,\n  CUSTOMERS_BEFORE,\n  type Duplicates,\n  file,\n  outcome,\n  type PastImport,\n  pastImports,\n  TODAY,\n} from './data';\nimport { ExportDialog } from './export-dialog';\nimport { FileGuide } from './file-guide';\nimport { customers } from './format';\nimport { ImportResult } from './import-result';\nimport { initialMapping, type Mapping, MatchStep } from './match-step';\nimport { PageHeader } from './page-header';\nimport { RecentImports } from './recent-imports';\nimport { ReviewStep } from './review-step';\nimport { ImportSidebar } from './sidebar';\nimport { UploadStep } from './upload-step';\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\nconst STEPS = [\n  { title: 'Upload' },\n  { title: 'Match columns' },\n  { title: 'Review' },\n  { title: 'Done' },\n];\nconst [UPLOAD, MATCH, REVIEW, DONE] = [0, 1, 2, 3];\n\ntype PageProps = { collapsed: boolean; onToggleSidebar: () => void; sidebarId: string };\n\n/**\n * The page inside the toast provider. The screen holds the import: the step, how the columns are\n * matched and what happens to duplicates, so going back keeps every choice. Steps already done\n * can be clicked to return to; once the import has run, the stepper only reports.\n */\nfunction ImportPage({ collapsed, onToggleSidebar, sidebarId }: PageProps) {\n  const { showToast } = useToast();\n  const resultId = useId();\n\n  const [step, setStep] = useState(UPLOAD);\n  const [chosen, setChosen] = useState<File>();\n  const [mapping, setMapping] = useState<Mapping>(initialMapping);\n  const [duplicates, setDuplicates] = useState<Duplicates>('update');\n  const [importing, setImporting] = useState(false);\n  const [imports, setImports] = useState<PastImport[]>(pastImports);\n  const [exportOpen, setExportOpen] = useState(false);\n\n  const result = outcome(duplicates);\n  const nameMatched = Object.values(mapping).includes('name');\n  // The customers in Orbit now: those before this visit and what its imports added.\n  const total = imports\n    .slice(0, -pastImports.length)\n    .reduce((sum, entry) => sum + entry.added, CUSTOMERS_BEFORE);\n\n  function start() {\n    setChosen(undefined);\n    setMapping(initialMapping);\n    setDuplicates('update');\n    setStep(UPLOAD);\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 import; a real one runs on the server and the page can be left\n  // while it does, as the help article says.\n  function runImport() {\n    setImporting(true);\n    timer.current = window.setTimeout(() => {\n      setImporting(false);\n      setImports([\n        { id: `q4-${imports.length}`, file: file.name, date: TODAY, by: account.name, ...result },\n        ...imports,\n      ]);\n      setStep(DONE);\n      // The steps' content is replaced by the result: take focus to its heading.\n      requestAnimationFrame(() => document.getElementById(resultId)?.focus());\n    }, 900);\n  }\n\n  // What the step's card ends in: what is left to do, then Back and the way on, the filled button.\n  const footer =\n    step === UPLOAD\n      ? {\n          hint: chosen\n            ? 'Nothing changes in Orbit until the last step.'\n            : 'Choose a CSV file to continue.',\n          label: 'Continue',\n          disabled: !chosen,\n          onClick: () => setStep(MATCH),\n        }\n      : step === MATCH\n        ? {\n            hint: nameMatched\n              ? 'Nothing changes in Orbit until the last step.'\n              : 'Choose the column that holds the name to continue.',\n            label: 'Continue',\n            disabled: !nameMatched,\n            onClick: () => setStep(REVIEW),\n          }\n        : step === REVIEW\n          ? {\n              hint: 'Nothing changes in Orbit until you import.',\n              label: importing\n                ? 'Importing…'\n                : `Import ${customers(result.added + result.updated)}`,\n              disabled: importing,\n              onClick: runImport,\n            }\n          : null;\n\n  return (\n    <main className=\"bg-ws-static-foreground rounded-ws-container-lg shadow-ws-low my-ws-7 mr-ws-7 ml-ws-5 flex min-w-0 flex-1 flex-col overflow-hidden\">\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={onToggleSidebar}\n            className=\"-ml-ws-5\"\n          />\n          <Breadcrumbs separator=\"arrow\">\n            <Breadcrumbs.Item asChild>\n              <a href=\"#customers\">Customers</a>\n            </Breadcrumbs.Item>\n            <Breadcrumbs.Item>Import</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-14 pt-ws-14 pb-ws-16 flex flex-col')}>\n          <PageHeader\n            title=\"Import customers\"\n            description=\"Bring customers in from a CSV file, or take them out as one.\"\n          >\n            <Button\n              size=\"sm\"\n              variant=\"secondary\"\n              preset=\"border\"\n              onClick={() => setExportOpen(true)}\n            >\n              Export customers\n            </Button>\n          </PageHeader>\n\n          <div className=\"gap-ws-12 grid grid-cols-1 items-start lg:grid-cols-[minmax(0,1fr)_20rem]\">\n            <div className=\"gap-ws-12 flex min-w-0 flex-col\">\n              {/* The import is the page's job, so it is the card: the steps as its header, the\n                  step's question, then what is left to do and the way on at its foot. */}\n              <Card>\n                <Card.Header>\n                  <ProgressStepper\n                    aria-label=\"Import steps\"\n                    steps={STEPS}\n                    activeStep={step === DONE ? STEPS.length : step}\n                    disabled={step === DONE || importing}\n                    onStepChange={(index) => index < step && setStep(index)}\n                  />\n                </Card.Header>\n                <div className=\"p-ws-11 flex flex-col\">\n                  {step === UPLOAD && (\n                    <UploadStep\n                      file={chosen}\n                      onFile={setChosen}\n                      onRemove={() => setChosen(undefined)}\n                    />\n                  )}\n                  {step === MATCH && <MatchStep mapping={mapping} onChange={setMapping} />}\n                  {step === REVIEW && (\n                    <ReviewStep duplicates={duplicates} onDuplicatesChange={setDuplicates} />\n                  )}\n                  {step === DONE && (\n                    <ImportResult\n                      id={resultId}\n                      result={imports[0]}\n                      quiet={exportOpen}\n                      onImportAnother={start}\n                    />\n                  )}\n                </div>\n\n                {footer && (\n                  <Card.Footer className=\"gap-ws-5 items-center\">\n                    <p className=\"typography-body-md text-ws-static-subtle min-w-0 flex-1\">\n                      {footer.hint}\n                    </p>\n                    {step !== UPLOAD && (\n                      <Button\n                        size=\"sm\"\n                        variant=\"secondary\"\n                        preset=\"border\"\n                        disabled={importing}\n                        onClick={() => setStep(step - 1)}\n                      >\n                        Back\n                      </Button>\n                    )}\n                    {/* While the export dialog holds the filled button, this one steps back. */}\n                    <Button\n                      size=\"sm\"\n                      variant={exportOpen ? 'secondary' : 'primary'}\n                      preset={exportOpen ? 'border' : 'filled'}\n                      disabled={footer.disabled}\n                      onClick={footer.onClick}\n                    >\n                      {footer.label}\n                    </Button>\n                  </Card.Footer>\n                )}\n              </Card>\n\n              {step === UPLOAD && <RecentImports imports={imports} />}\n            </div>\n\n            <aside aria-label=\"About the file\">\n              <FileGuide />\n            </aside>\n          </div>\n        </div>\n      </div>\n\n      <ExportDialog\n        open={exportOpen}\n        onOpenChange={setExportOpen}\n        total={total}\n        onExport={(count) => {\n          setExportOpen(false);\n          showToast({\n            status: 'success',\n            content: `${customers(count)} exported to customers.csv`,\n          });\n        }}\n      />\n    </main>\n  );\n}\n\n/**\n * Import (Inset direction): bringing customers in from a CSV file, in steps, on the raised page\n * beside the workspace sidebar. One bordered card holds the work: the stepper as its header, the\n * step's one question (the file, where its columns go, what happens to duplicates), and a foot with\n * what is left to do, Back and Continue, so the way on is always in sight; the result lands in the\n * same card. The columns Orbit reads sit in a card beside it, and Export, the other way round, in\n * the header.\n */\nexport default function Import() {\n  const sidebarId = useId();\n  const [collapsed, setCollapsed] = useState(false);\n\n  return (\n    <ToastProvider position=\"bottom-center\">\n      <AppShell className=\"ws-block-utility\" direction=\"inset\">\n        <ImportSidebar id={sidebarId} collapsed={collapsed} onCollapsedChange={setCollapsed} />\n        <ImportPage\n          collapsed={collapsed}\n          onToggleSidebar={() => setCollapsed(!collapsed)}\n          sidebarId={sidebarId}\n        />\n      </AppShell>\n    </ToastProvider>\n  );\n}\n"
    },
    {
      "path": "src/blocks/import/match-step.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/import/match-step.tsx",
      "content": "'use client';\n\nimport { RiCheckLine } from '@remixicon/react';\nimport { Select } from '@/components/ui/wideset/select/Select';\nimport { Table } from '@/components/ui/wideset/table/Table';\n\nimport { Code } from './code';\nimport { fields, file, fileColumns, SKIP } from './data';\nimport { formatCount } from './format';\nimport { Section } from './section';\n\n/** The field each of the file's columns goes to, by column id; '' while none is chosen. */\nexport type Mapping = Record<string, string>;\n\n/** Where every column starts: what Orbit matched on its own. */\nexport const initialMapping: Mapping = Object.fromEntries(\n  fileColumns.map((column) => [column.id, column.match ?? '']),\n);\n\ntype MatchStepProps = {\n  mapping: Mapping;\n  onChange: (mapping: Mapping) => void;\n};\n\n/**\n * One row a column of the file: its name as the file writes it, the value in the first row so\n * the user sees what it holds, and the Orbit field it fills. A field goes to one column only, so\n * a field already taken is off the list. Where Orbit chose by itself, a quiet note says why; it\n * goes as soon as the user changes the choice.\n */\nexport function MatchStep({ mapping, onChange }: MatchStepProps) {\n  const taken = new Set(Object.values(mapping));\n\n  return (\n    <Section\n      title=\"Match columns\"\n      description={`${file.name} has ${formatCount(file.rows)} rows and ${fileColumns.length} columns. Choose the Orbit field each column fills.`}\n    >\n      {/* The step sits in a card: the table runs to its edges, its outer columns take the card's\n          20px inset so they line up with the title, and the last row leaves its line to the\n          footer's. */}\n      <Table size=\"sm\" aria-label=\"Columns in the file\" className=\"-mx-ws-11 w-[calc(100%+2.5rem)]\">\n        <Table.Head>\n          <Table.Row>\n            <Table.Header className=\"pl-ws-11\">Column</Table.Header>\n            <Table.Header>First row</Table.Header>\n            <Table.Header>Orbit field</Table.Header>\n            <Table.Header className=\"pr-ws-11 w-full\">\n              <span className=\"sr-only\">Note</span>\n            </Table.Header>\n          </Table.Row>\n        </Table.Head>\n        <Table.Body className=\"[&>tr:last-child>td]:border-b-0\">\n          {fileColumns.map((column) => {\n            const value = mapping[column.id];\n            const auto = column.note && value === column.match;\n            return (\n              <Table.Row key={column.id}>\n                <Table.Cell className=\"pl-ws-11 whitespace-nowrap\">\n                  <Code>{column.header}</Code>\n                </Table.Cell>\n                <Table.Cell className=\"text-ws-static-subtle whitespace-nowrap\">\n                  {column.sample}\n                </Table.Cell>\n                <Table.Cell>\n                  <Select\n                    size=\"sm\"\n                    preset=\"border\"\n                    className=\"w-[13rem]\"\n                    aria-label={`Orbit field for ${column.header}`}\n                    placeholder=\"Choose a field\"\n                    options={[\n                      ...fields.map((field) => ({\n                        value: field.value,\n                        label: field.label,\n                        disabled: taken.has(field.value) && value !== field.value,\n                      })),\n                      { value: SKIP, label: 'Don’t import' },\n                    ]}\n                    value={value}\n                    onValueChange={(next) => onChange({ ...mapping, [column.id]: next })}\n                  />\n                </Table.Cell>\n                <Table.Cell className=\"pr-ws-11\">\n                  {auto && (\n                    <span className=\"gap-ws-3 typography-label-sm text-ws-static-subtle flex items-center\">\n                      {column.match !== SKIP && (\n                        <RiCheckLine aria-hidden=\"true\" className=\"size-ws-9 shrink-0\" />\n                      )}\n                      {column.note}\n                    </span>\n                  )}\n                </Table.Cell>\n              </Table.Row>\n            );\n          })}\n        </Table.Body>\n      </Table>\n    </Section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/import/outcome-figures.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/import/outcome-figures.tsx",
      "content": "'use client';\n\n// TODO(custom): a row of plain key figures (label above a 24px number); no stat or KeyFigure component in Wideset.\nimport { formatCount } from './format';\n\ntype OutcomeFiguresProps = { added: number; updated: number; skipped: number };\n\n/**\n * What an import does, as three plain figures in a row: new customers, updated ones and rows\n * left out. No colour and no bars: the numbers are the whole message, and the same row reads\n * before the import (what will happen) and after it (what did).\n */\nexport function OutcomeFigures({ added, updated, skipped }: OutcomeFiguresProps) {\n  const figures = [\n    { label: 'New customers', value: added },\n    { label: 'Updated', value: updated },\n    { label: 'Skipped', value: skipped },\n  ];\n\n  return (\n    <dl className=\"gap-ws-12 grid grid-cols-3\">\n      {figures.map(({ label, value }) => (\n        <div key={label} className=\"gap-ws-3 flex flex-col\">\n          <dt className=\"typography-label-sm text-ws-static-subtle\">{label}</dt>\n          <dd className=\"typography-title-sm text-ws-static-strong tabular-nums\">\n            {formatCount(value)}\n          </dd>\n        </div>\n      ))}\n    </dl>\n  );\n}\n"
    },
    {
      "path": "src/blocks/import/page-header.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/import/page-header.tsx",
      "content": "'use client';\n\n// TODO(custom): page header (title, a line of description, the actions on the right); no PageHeader in Wideset.\nimport type { ReactNode } from 'react';\n\n/** The page's title, one line saying what it is for, and its actions on the right. */\nexport function PageHeader({\n  title,\n  description,\n  children,\n}: {\n  title: string;\n  description: string;\n  children?: ReactNode;\n}) {\n  return (\n    <header className=\"gap-ws-12 flex flex-wrap items-center justify-between\">\n      <div className=\"gap-ws-2 flex min-w-0 flex-col\">\n        <h1 className=\"typography-title-md text-ws-static-strong\">{title}</h1>\n        <p className=\"typography-body-md text-ws-static-subtle\">{description}</p>\n      </div>\n      {children && <div className=\"gap-ws-5 flex items-center\">{children}</div>}\n    </header>\n  );\n}\n"
    },
    {
      "path": "src/blocks/import/people.assets.ts",
      "type": "registry:file",
      "target": "blocks/wideset/import/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/4AAQSkZJRgABAQAAAQABAAD/4gHYSUNDX1BST0ZJTEUAAQEAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADb/2wBDAAQDAwQDAwQEBAQFBQQFBwsHBwYGBw4KCggLEA4RERAOEA8SFBoWEhMYEw8QFh8XGBsbHR0dERYgIh8cIhocHRz/2wBDAQUFBQcGBw0HBw0cEhASHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBz/wAARCABgAGADASIAAhEBAxEB/8QAHQAAAAcBAQEAAAAAAAAAAAAAAgMEBQYHCAEACf/EADUQAAEDAwMBBgUDAgcAAAAAAAECAwQABREGEiEHEzFBUWGBCBQicaEVMpHB0SQzQkNTseH/xAAbAQACAwEBAQAAAAAAAAA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yf+SSo5Fbb0nboktXnQ3D5CwHD6pPcV5zgIxXHWZ6BS3Nezg/76y03SFdZiRGtF1bbc3Jy85DwlKc84BVycdOKlW4SYmWQre6sgKcIAK1EAZ4/OnTS2YbJPTA4J717isKWpuS4CCpQ2A+/Wpqi2WqmPcTTdYURiD7SYSkAACloor0SIkWkpe1JQmQopCcU6ZgOvDJBAqFlyV+oyQUnxGilpQMqIAqj+Ierp+n7A7KtUcLdCkpLricpQCcbgO/OOvrWyV2xCUkkZI9aj5mmmLpaVxZCAtDqFIUMdR/NVmp1ljqVq6+Z001orAv2JyE3aH5eZKcl0kqV9TV30PAuT8gtR5QY3cEFPWrTJ0NJ0xK2uNlyMThLoHBH7H6VMWexIjSQ6BtTnckgdKTmDBuLCN6urKGQyzWuxmMEGU+qQ6O6ug+1Ss07UI28FJGKSMc9Dkipq3WJ66KBIKGe6yOPt61urRmOK/M0WWKo5WHqYolslyLeJZbGNxG0HqB3/zTZQKSQoEEdQa2KGW48dDLYwhAwBUTNtrEnO5I3eo6036fVOihbe/mKdiqzEoMCVCipGVZ3mAVN5cR7c1HEEHB4NWCOrjKmaSCPMkLfbsLStw7lK6VOpaCUnjpTRJS06Gx/tvJwP7VdP4+1SBO2Ups9CKos5OTOqMHRsWfQ1nbbHlp4xjmsbqC7IS2Oxyad42rKfpWCZPHkMvoKHmwpJ4PGQfcVh/01bVjCWEAeiDj9KztnBPvTpODQatX9QzCtjp6TiYIWnrdDVuSyCf7yT+lS+8JGEgAU0QOay1JEVOlGJF3ZzlzmelJ3ck14DaQoDFZB0xWMnhSvsKlIw2AjoOairpZkSG1uIGHEjIx3qWzhzHZCayK/Dj1qSMVORAe5//Z',\n};\n"
    },
    {
      "path": "src/blocks/import/person-avatar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/import/person-avatar.tsx",
      "content": "'use client';\n\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\nimport { type AvatarProps } from '@/components/ui/wideset/avatar/Avatar.types';\n\nimport { PHOTOS } from './people.assets';\n\ntype PersonAvatarProps = Pick<\n  AvatarProps,\n  'size' | 'shape' | 'status' | 'color' | 'className' | 'style' | 'title' | 'aria-hidden'\n> & {\n  name: string;\n  initials: string;\n  /** The photo's text: empty beside the person's name, their name where the avatar stands alone. */\n  alt?: string;\n};\n\n/**\n * A person's avatar: their photo when `people.assets.ts` has one, with the initials as its\n * fallback, otherwise the initials on their colour. Every place that draws a person uses it, so\n * someone has the same face across the screen and photos mix with initials as in a real product.\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/import/recent-imports.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/import/recent-imports.tsx",
      "content": "'use client';\n\nimport { Card } from '@/components/ui/wideset/card/Card';\nimport { Table } from '@/components/ui/wideset/table/Table';\nimport { useId } from 'react';\n\nimport type { PastImport } from './data';\nimport { formatCount, formatDate } from './format';\n\n/**\n * The imports run before, newest first, in a card of their own under the step: which file, when,\n * by whom and what each did, the figures right-aligned so they compare down the column. The table\n * sits straight in the card, so its lines run edge to edge; the outer columns take the card's\n * 20px inset, so the first lines up with the title, and the card's border closes the last row.\n */\nexport function RecentImports({ imports }: { imports: PastImport[] }) {\n  const titleId = useId();\n\n  return (\n    <section aria-labelledby={titleId}>\n      <Card>\n        <Card.Header>\n          <div className=\"gap-ws-2 flex flex-col\">\n            <h2 id={titleId} className=\"typography-label-strong-md text-ws-static-strong\">\n              Recent imports\n            </h2>\n            <p className=\"typography-body-md text-ws-static-subtle\">\n              What earlier files added to Orbit.\n            </p>\n          </div>\n        </Card.Header>\n        <Table size=\"sm\" aria-labelledby={titleId} className=\"w-full\">\n          <Table.Head>\n            <Table.Row>\n              <Table.Header className=\"pl-ws-11 w-full\">File</Table.Header>\n              <Table.Header>Date</Table.Header>\n              <Table.Header>By</Table.Header>\n              <Table.Header align=\"right\">Added</Table.Header>\n              <Table.Header align=\"right\">Updated</Table.Header>\n              <Table.Header align=\"right\" className=\"pr-ws-11\">\n                Skipped\n              </Table.Header>\n            </Table.Row>\n          </Table.Head>\n          <Table.Body className=\"[&>tr:last-child>td]:border-b-0\">\n            {imports.map((entry) => (\n              <Table.Row key={entry.id}>\n                <Table.Cell className=\"text-ws-static-strong pl-ws-11\">{entry.file}</Table.Cell>\n                <Table.Cell className=\"whitespace-nowrap tabular-nums\">\n                  {formatDate(entry.date)}\n                </Table.Cell>\n                <Table.Cell className=\"whitespace-nowrap\">{entry.by}</Table.Cell>\n                <Table.Cell align=\"right\" className=\"tabular-nums\">\n                  {formatCount(entry.added)}\n                </Table.Cell>\n                <Table.Cell align=\"right\" className=\"tabular-nums\">\n                  {formatCount(entry.updated)}\n                </Table.Cell>\n                <Table.Cell align=\"right\" className=\"pr-ws-11 tabular-nums\">\n                  {formatCount(entry.skipped)}\n                </Table.Cell>\n              </Table.Row>\n            ))}\n          </Table.Body>\n        </Table>\n      </Card>\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/import/review-step.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/import/review-step.tsx",
      "content": "'use client';\n\nimport { RiDownload2Line } from '@remixicon/react';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { RadioButton } from '@/components/ui/wideset/radio-button/RadioButton';\nimport { RadioButtonGroup } from '@/components/ui/wideset/radio-button/RadioButtonGroup';\nimport { Table } from '@/components/ui/wideset/table/Table';\n\nimport { csvHref } from './csv-href';\nimport {\n  counts,\n  duplicateChoices,\n  type Duplicates,\n  file,\n  outcome,\n  type SkippedRow,\n  skippedRows,\n} from './data';\nimport { formatCount } from './format';\nimport { OutcomeFigures } from './outcome-figures';\nimport { Section } from './section';\n\ntype ReviewStepProps = {\n  duplicates: Duplicates;\n  onDuplicatesChange: (duplicates: Duplicates) => void;\n};\n\n/** The skipped rows as a file to correct and import again, in the file's own columns. */\nconst skippedFile = csvHref([\n  ['row', 'name', 'domain', 'reason'],\n  ...skippedRows.map((row: SkippedRow) => [row.row, row.name, row.domain, row.reason]),\n]);\n\n/**\n * The last look before anything changes: what the import will do as three figures, the one\n * decision left (customers Orbit already has, found by domain), and the rows it cannot read with\n * the reason for each and a way to take them away and fix them. The figures follow the decision.\n */\nexport function ReviewStep({ duplicates, onDuplicatesChange }: ReviewStepProps) {\n  return (\n    <div className=\"gap-ws-14 flex flex-col\">\n      <Section\n        title=\"What the import will do\"\n        description={`From the ${formatCount(file.rows)} rows in ${file.name}.`}\n      >\n        <OutcomeFigures {...outcome(duplicates)} />\n      </Section>\n\n      <Section\n        title=\"Customers already in Orbit\"\n        description={`${formatCount(counts.existing)} rows have the domain of a customer Orbit already has.`}\n      >\n        <RadioButtonGroup\n          aria-label=\"Customers already in Orbit\"\n          value={duplicates}\n          onValueChange={(value) => onDuplicatesChange(value as Duplicates)}\n        >\n          {duplicateChoices.map((choice) => (\n            <RadioButton\n              key={choice.value}\n              value={choice.value}\n              label={choice.label}\n              description={choice.description}\n            />\n          ))}\n        </RadioButtonGroup>\n      </Section>\n\n      <Section\n        title=\"Rows that can’t be imported\"\n        description=\"Fix them in the file and import it again. The rest are not imported twice.\"\n        action={\n          <Button size=\"sm\" variant=\"secondary\" preset=\"border\" asChild>\n            <a href={skippedFile} download=\"customers-q4-skipped.csv\">\n              <Button.Icon icon={RiDownload2Line} />\n              {/* Under asChild the label's inset is ours to give, as Button gives its own. */}\n              <span className=\"px-ws-2\">Download skipped rows</span>\n            </a>\n          </Button>\n        }\n      >\n        {/* Edge to edge in the step's card, the outer columns in line with the title. */}\n        <Table\n          size=\"sm\"\n          aria-label=\"Rows that can’t be imported\"\n          className=\"-mx-ws-11 w-[calc(100%+2.5rem)]\"\n        >\n          <Table.Head>\n            <Table.Row>\n              <Table.Header align=\"right\" className=\"pl-ws-11\">\n                Row\n              </Table.Header>\n              <Table.Header>Name</Table.Header>\n              <Table.Header>Domain</Table.Header>\n              <Table.Header className=\"pr-ws-11 w-full\">Reason</Table.Header>\n            </Table.Row>\n          </Table.Head>\n          <Table.Body className=\"[&>tr:last-child>td]:border-b-0\">\n            {skippedRows.map((row) => (\n              <Table.Row key={row.row}>\n                <Table.Cell align=\"right\" className=\"pl-ws-11 tabular-nums\">\n                  {row.row}\n                </Table.Cell>\n                <Table.Cell className=\"whitespace-nowrap\">\n                  {row.name || <span className=\"text-ws-static-subtle\">Empty</span>}\n                </Table.Cell>\n                <Table.Cell className=\"whitespace-nowrap\">{row.domain}</Table.Cell>\n                <Table.Cell className=\"pr-ws-11\">{row.reason}</Table.Cell>\n              </Table.Row>\n            ))}\n          </Table.Body>\n        </Table>\n      </Section>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/import/section.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/import/section.tsx",
      "content": "'use client';\n\n// TODO(custom): section title and one line above its content; Wideset has no Section or PageSection.\nimport { cn } from '@/lib/wideset/utils';\nimport { type ReactNode, useId } from 'react';\n\n/**\n * One part of a step: a 16px title, one line saying what it is for, then its content. Sections\n * follow each other split by a line, not boxed, so the page stays one sheet; the first has no\n * line above it. The title names the region; an action for the whole section sits at its right.\n */\nexport function Section({\n  title,\n  description,\n  action,\n  children,\n  className,\n}: {\n  title: string;\n  description: ReactNode;\n  /** One small button for the whole section, at the right of its title. */\n  action?: ReactNode;\n  children: ReactNode;\n  className?: string;\n}) {\n  const id = useId();\n\n  return (\n    <section\n      aria-labelledby={id}\n      className={cn(\n        'gap-ws-11 border-ws-static-subtle pt-ws-14 first:pt-ws-0 flex flex-col border-t first:border-t-0',\n        className,\n      )}\n    >\n      <div className=\"gap-ws-9 flex items-end justify-between\">\n        <div className=\"gap-ws-2 flex min-w-0 flex-col\">\n          <h2 id={id} className=\"typography-label-strong-md text-ws-static-strong\">\n            {title}\n          </h2>\n          <p className=\"typography-body-md text-ws-static-subtle\">{description}</p>\n        </div>\n        {action}\n      </div>\n      {children}\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/import/sidebar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/import/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 ImportSidebar(props: Pick<SidebarProps, 'id' | 'collapsed' | 'onCollapsedChange'>) {\n  const [active, setActive] = useState('customers');\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                  alt={account.name}\n                  title={account.name}\n                />\n              </div>\n            </Sidebar.Collapsed>\n          </div>\n        </div>\n      </Sidebar.Footer>\n    </Sidebar>\n  );\n}\n"
    },
    {
      "path": "src/blocks/import/text-link.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/import/text-link.tsx",
      "content": "'use client';\n\n// TODO(custom): a link inside a sentence; Wideset has no inline text link (LinkButton is a control with its own padding and height).\nimport { cn } from '@/lib/wideset/utils';\nimport type { AnchorHTMLAttributes } from 'react';\n\n/**\n * A link inside a sentence, as Figma draws the terms link: the sentence's own type in the primary\n * colour. The underline comes on hover and focus.\n */\nexport function TextLink({\n  className,\n  children,\n  ...props\n}: AnchorHTMLAttributes<HTMLAnchorElement>) {\n  return (\n    <a\n      className={cn(\n        'text-ws-dynamic-primary-default hover:text-ws-dynamic-primary-hover active:text-ws-dynamic-primary-pressed rounded-ws-control-sm focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default decoration-from-font hover:underline focus-visible:underline',\n        className,\n      )}\n      {...props}\n    >\n      {children}\n    </a>\n  );\n}\n"
    },
    {
      "path": "src/blocks/import/upload-step.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/import/upload-step.tsx",
      "content": "'use client';\n\nimport { FileItem } from '@/components/ui/wideset/file-upload/FileItem';\nimport { FileUpload } from '@/components/ui/wideset/file-upload/FileUpload';\nimport { type DragEvent, useRef, useState } from 'react';\n\nimport { csvHref } from './csv-href';\nimport { LIMITS, sampleCsv } from './data';\nimport { formatCount, formatSize } from './format';\nimport { Section } from './section';\nimport { TextLink } from './text-link';\n\ntype UploadStepProps = {\n  /** The file chosen so far, if any. */\n  file?: File;\n  onFile: (file: File) => void;\n  onRemove: () => void;\n};\n\n/**\n * The first step: one drop zone with a Browse button for the file, and under it the limits and a\n * sample to start from, in one line. A chosen file takes the zone's place as a row that can be\n * removed, so the user sees what goes in before Continue, under the card, moves on. With no file\n * library to hand, the zone opens the hidden input FileUpload renders and takes drops itself.\n */\nexport function UploadStep({ file, onFile, onRemove }: UploadStepProps) {\n  const upload = useRef<HTMLDivElement>(null);\n  const [dragging, setDragging] = useState(false);\n\n  const drop = {\n    onDragOver: (event: DragEvent<HTMLElement>) => {\n      event.preventDefault();\n      setDragging(true);\n    },\n    onDragLeave: () => setDragging(false),\n    onDrop: (event: DragEvent<HTMLElement>) => {\n      event.preventDefault();\n      setDragging(false);\n      const dropped = event.dataTransfer.files[0];\n      if (dropped) onFile(dropped);\n    },\n  };\n\n  return (\n    <Section\n      title=\"Choose a file\"\n      description=\"A CSV file whose first row names its columns, one customer a row after it.\"\n    >\n      <div className=\"gap-ws-7 flex flex-col\">\n        {file ? (\n          <FileItem onRemove={onRemove}>\n            <FileItem.Thumbnail name={file.name} />\n            <FileItem.Title>{file.name}</FileItem.Title>\n            <FileItem.Description>{formatSize(file.size)}</FileItem.Description>\n          </FileItem>\n        ) : (\n          <FileUpload\n            ref={upload}\n            browse\n            labels={{\n              dropzoneBrowse: 'Drop a CSV file here, or',\n              dropzoneActive: 'Drop the file here',\n            }}\n            isDragActive={dragging}\n            zoneProps={drop}\n            inputProps={{\n              accept: '.csv,text/csv',\n              onChange: (event) => {\n                const chosen = event.target.files?.[0];\n                event.target.value = '';\n                if (chosen) onFile(chosen);\n              },\n            }}\n            onBrowse={() => upload.current?.querySelector('input')?.click()}\n          />\n        )}\n        <p className=\"typography-body-md text-ws-static-subtle tabular-nums\">\n          One file, up to {formatCount(LIMITS.rows)} rows and {LIMITS.megabytes} MB.{' '}\n          <TextLink href={csvHref(sampleCsv)} download=\"customers-sample.csv\">\n            Download a sample CSV\n          </TextLink>\n        </p>\n      </div>\n    </Section>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "1.1.0",
    "commit": "a734f9f0"
  }
}
