{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-spreadsheet",
  "type": "registry:block",
  "title": "Spreadsheet",
  "description": "A table worked in cell by cell under a top bar: view tools, typed columns that sort, a summary under each header, row selection and a status bar.",
  "dependencies": [
    "@remixicon/react@^4.9.0"
  ],
  "registryDependencies": [
    "https://wideset.co/r/app-shell.json",
    "https://wideset.co/r/avatar.json",
    "https://wideset.co/r/block-styles.json",
    "https://wideset.co/r/button.json",
    "https://wideset.co/r/checkbox.json",
    "https://wideset.co/r/dropdown-menu.json",
    "https://wideset.co/r/icon-button.json",
    "https://wideset.co/r/list-item.json",
    "https://wideset.co/r/segmented-control.json",
    "https://wideset.co/r/spreadsheet.json",
    "https://wideset.co/r/status-badge.json",
    "https://wideset.co/r/tag.json",
    "https://wideset.co/r/text-input.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/spreadsheet/brand-mark.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/spreadsheet/brand-mark.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nconst TILE =\n  'M0 16C0 8.45753 0 4.68629 2.34315 2.34315C4.68629 0 8.45753 0 16 0C23.5425 0 27.3137 0 29.6569 2.34315C32 4.68629 32 8.45753 32 16C32 23.5425 32 27.3137 29.6569 29.6569C27.3137 32 23.5425 32 16 32C8.45753 32 4.68629 32 2.34315 29.6569C0 27.3137 0 23.5425 0 16Z';\nconst W =\n  'M21.6907 12C21.6907 12 19.618 17.322 19.5381 17.5183C19.4954 17.4215 17.1775 12 17.1775 12H15.0877C15.0877 12 12.7755 17.5183 12.7413 17.5916C12.7042 17.5157 10.2409 12 10.2409 12H8L11.7434 20H13.8047L16.1483 14.3403H16.1853C16.211 14.3953 18.5802 20 18.5802 20H20.7042C20.7042 20 23.9772 12.0707 24 12.0052L21.6935 12H21.6907Z';\n\n/**\n * The Wideset mark: a W on the inverse tile, Figma's workspace Thumbnail. It takes the size of\n * its place (32px in a sidebar or top bar, 36px in a larger switcher) and inverts in dark mode.\n * Decorative beside the product's name; give it a `label` when it stands alone.\n */\nexport function BrandMark({ className, label }: { className?: string; label?: string }) {\n  return (\n    <svg\n      viewBox=\"0 0 32 32\"\n      role={label ? 'img' : undefined}\n      aria-label={label}\n      aria-hidden={label ? undefined : true}\n      className={cn('size-ws-14 shrink-0', className)}\n    >\n      <path d={TILE} className=\"fill-(--ws-static-fill-inverse-background)\" />\n      <path d={W} className=\"fill-(--ws-static-text-inverse-strong)\" />\n    </svg>\n  );\n}\n"
    },
    {
      "path": "src/blocks/spreadsheet/client-sheet.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/spreadsheet/client-sheet.tsx",
      "content": "'use client';\n\nimport { RiAddLine, RiArrowDownLine, RiArrowUpLine } from '@remixicon/react';\nimport { Checkbox } from '@/components/ui/wideset/checkbox/Checkbox';\nimport { cn } from '@/lib/wideset/utils';\nimport { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { ListItem } from '@/components/ui/wideset/list-item/ListItem';\nimport { Spreadsheet } from '@/components/ui/wideset/spreadsheet/Spreadsheet';\nimport { StatusBadge } from '@/components/ui/wideset/status-badge/StatusBadge';\nimport { Tag } from '@/components/ui/wideset/tag/Tag';\nimport { useState } from 'react';\n\nimport { ColumnSummary } from './column-summary';\nimport { type Client, CLIENTS, type ColumnKey, COLUMNS } from './data';\n\nconst count = new Intl.NumberFormat('en-US');\n// Calendar days (`2023-03-15`) parse as UTC midnight: format them in UTC too.\nconst day = new Intl.DateTimeFormat('en-US', {\n  month: '2-digit',\n  day: '2-digit',\n  year: 'numeric',\n  timeZone: 'UTC',\n});\n\ntype Sort = { key: ColumnKey; direction: 'asc' | 'desc' };\n\nconst SORTS = [\n  { direction: 'asc', label: 'Sort ascending', icon: RiArrowUpLine },\n  { direction: 'desc', label: 'Sort descending', icon: RiArrowDownLine },\n] as const;\n\n/** Tags and badges sort by their label; empty values go last either way. */\nconst byColumn =\n  ({ key, direction }: Sort) =>\n  (a: Client, b: Client) => {\n    const [x, y] = [a[key], b[key]].map((value) =>\n      typeof value === 'object' ? value.label : value,\n    );\n    if (x === undefined || y === undefined) return x === y ? 0 : x === undefined ? 1 : -1;\n    const order = String(x).localeCompare(String(y), 'en', { numeric: true });\n    return direction === 'desc' ? -order : order;\n  };\n\n/**\n * The clients in a Spreadsheet: typed headers whose menus sort, a summary of each column under\n * them, row numbers that turn into checkboxes, and a row and a column to add. The grid is the\n * page's canvas: it fills the window and bleeds 1px past both edges, so its outer lines fall\n * outside the window, as in Figma.\n */\nexport function ClientSheet({ className }: { className?: string }) {\n  const [clients, setClients] = useState(CLIENTS);\n  // Rows keep the table's own order until a header menu sorts them by a column.\n  const [sort, setSort] = useState<Sort | null>(null);\n  const [selected, setSelected] = useState<number[]>([]);\n  const rows = sort ? [...clients].sort(byColumn(sort)) : clients;\n  const all = selected.length === clients.length;\n  const toggle = (id: number) =>\n    setSelected((ids) => (ids.includes(id) ? ids.filter((x) => x !== id) : [...ids, id]));\n\n  return (\n    <Spreadsheet\n      aria-label=\"Clients\"\n      stickyColumns={2}\n      className={cn('bg-ws-static-foreground -mx-ws-1 w-auto', className)}\n    >\n      <Spreadsheet.Head>\n        <Spreadsheet.Row>\n          {/* 46px: its left edge sits 1px past the window, so 45px show. */}\n          <Spreadsheet.ColumnHeader align=\"center\" className=\"w-[2.875rem]\">\n            <Checkbox\n              aria-label=\"Select all clients\"\n              checked={all ? true : selected.length ? 'indeterminate' : false}\n              onCheckedChange={() => setSelected(all ? [] : clients.map((client) => client.id))}\n            />\n          </Spreadsheet.ColumnHeader>\n          {COLUMNS.map(({ key, label, icon }) => (\n            <Spreadsheet.ColumnHeader\n              key={key}\n              className=\"w-[9.5rem]\"\n              sortDirection={sort?.key === key ? sort.direction : null}\n            >\n              <Spreadsheet.ColumnHeaderIcon icon={icon} />\n              {label}\n              <DropdownMenu>\n                <DropdownMenu.Trigger asChild>\n                  <Spreadsheet.ColumnHeaderTrigger aria-label={`${label} options`} />\n                </DropdownMenu.Trigger>\n                <DropdownMenu.Content className=\"ws-block-utility\" align=\"start\">\n                  {SORTS.map((item) => (\n                    <DropdownMenu.Item\n                      key={item.direction}\n                      onSelect={() => setSort({ key, direction: item.direction })}\n                    >\n                      <ListItem.Prefix>\n                        <item.icon className=\"size-ws-9\" />\n                      </ListItem.Prefix>\n                      <ListItem.Content>\n                        <ListItem.Label>{item.label}</ListItem.Label>\n                      </ListItem.Content>\n                    </DropdownMenu.Item>\n                  ))}\n                </DropdownMenu.Content>\n              </DropdownMenu>\n            </Spreadsheet.ColumnHeader>\n          ))}\n          <Spreadsheet.ColumnHeader>\n            <IconButton\n              icon={RiAddLine}\n              size=\"xs\"\n              preset=\"ghost\"\n              variant=\"secondary\"\n              aria-label=\"Add column\"\n            />\n          </Spreadsheet.ColumnHeader>\n        </Spreadsheet.Row>\n\n        <Spreadsheet.Row className=\"h-ws-22\">\n          <Spreadsheet.RowHeader aria-label=\"Summary\" />\n          {COLUMNS.map(({ key, summary }) => (\n            <Spreadsheet.Cell key={key}>\n              <ColumnSummary summary={summary} />\n            </Spreadsheet.Cell>\n          ))}\n          <Spreadsheet.Cell />\n        </Spreadsheet.Row>\n      </Spreadsheet.Head>\n\n      <Spreadsheet.Body>\n        {rows.map((client, index) => (\n          <Spreadsheet.Row key={client.id} className=\"group/row\">\n            <Spreadsheet.RowHeader>\n              {/* The number, or the checkbox: on hover, with focus in the row, or once any is selected. */}\n              <span\n                className={cn(\n                  selected.length\n                    ? 'hidden'\n                    : 'group-focus-within/row:hidden group-hover/row:hidden',\n                )}\n              >\n                {index}\n              </span>\n              <Checkbox\n                aria-label={`Select ${client.name}`}\n                checked={selected.includes(client.id)}\n                onCheckedChange={() => toggle(client.id)}\n                className={cn(\n                  !selected.length && 'hidden group-focus-within/row:flex group-hover/row:flex',\n                )}\n              />\n            </Spreadsheet.RowHeader>\n            {COLUMNS.map(({ key }) => (\n              <ClientCell key={key} client={client} column={key} />\n            ))}\n            <Spreadsheet.Cell />\n          </Spreadsheet.Row>\n        ))}\n        <Spreadsheet.Row>\n          <Spreadsheet.RowHeader>\n            <IconButton\n              icon={RiAddLine}\n              size=\"xs\"\n              preset=\"ghost\"\n              variant=\"secondary\"\n              aria-label=\"Add client\"\n              onClick={() =>\n                setClients((list) => [...list, { id: list.length, name: 'New client' }])\n              }\n            />\n          </Spreadsheet.RowHeader>\n          <Spreadsheet.Cell colSpan={COLUMNS.length + 1} />\n        </Spreadsheet.Row>\n      </Spreadsheet.Body>\n    </Spreadsheet>\n  );\n}\n\n/** One field of a client: numbers to the right, categories as tags, the market as a status. */\nfunction ClientCell({ client, column }: { client: Client; column: ColumnKey }) {\n  switch (column) {\n    case 'customers':\n    case 'employees': {\n      const value = client[column];\n      return (\n        <Spreadsheet.Cell align=\"right\">\n          {value === undefined ? null : count.format(value)}\n        </Spreadsheet.Cell>\n      );\n    }\n    case 'country':\n      return (\n        <Spreadsheet.Cell>\n          {client.country && (\n            <Tag size=\"sm\" color={client.country.color}>\n              {client.country.label}\n            </Tag>\n          )}\n        </Spreadsheet.Cell>\n      );\n    case 'added':\n      return (\n        <Spreadsheet.Cell>{client.added && day.format(new Date(client.added))}</Spreadsheet.Cell>\n      );\n    case 'market':\n      return (\n        <Spreadsheet.Cell>\n          {client.market && (\n            <StatusBadge size=\"sm\" color={client.market.color}>\n              {client.market.label}\n            </StatusBadge>\n          )}\n        </Spreadsheet.Cell>\n      );\n    case 'website':\n      return (\n        <Spreadsheet.Cell>\n          {client.website && (\n            <a\n              href={client.website}\n              title={client.website}\n              target=\"_blank\"\n              rel=\"noreferrer\"\n              className=\"truncate underline\"\n            >\n              {client.website}\n            </a>\n          )}\n        </Spreadsheet.Cell>\n      );\n    default:\n      return <Spreadsheet.Cell>{client[column]}</Spreadsheet.Cell>;\n  }\n}\n"
    },
    {
      "path": "src/blocks/spreadsheet/column-summary.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/spreadsheet/column-summary.tsx",
      "content": "'use client';\n\nimport { RiArrowDropDownFill } from '@remixicon/react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { ColumnSummary as Summary } from './data';\n\nconst BAR = 'bg-ws-non-semantic-brand-subtle';\nconst CHART = 'h-ws-12 gap-ws-1 rounded-ws-control-sm flex overflow-hidden';\n\n/**\n * A column at a glance, in the summary row under its header: the type, a 24px chart of the\n * values and a caption. Screen content composed from tokens; the caption says what the chart\n * shows, so the chart is hidden from screen readers.\n */\nexport function ColumnSummary({ summary: { type, chart, caption } }: { summary: Summary }) {\n  return (\n    <div className=\"typography-caption-sm text-ws-static-subtle gap-ws-3 flex min-w-0 flex-1 flex-col\">\n      <span className=\"gap-ws-2 flex items-center\">\n        {type}\n        <RiArrowDropDownFill aria-hidden className=\"size-ws-9\" />\n      </span>\n      <Chart chart={chart} />\n      {typeof caption === 'string' ? (\n        <span className=\"truncate\">{caption}</span>\n      ) : (\n        <span className=\"flex justify-between\">\n          <span>{caption[0]}</span>\n          <span>{caption[1]}</span>\n        </span>\n      )}\n    </div>\n  );\n}\n\n// Bar heights and segment widths are data, so they are inline sizes, as in any chart.\nfunction Chart({ chart }: { chart: Summary['chart'] }) {\n  if (chart.kind === 'histogram')\n    return (\n      <span aria-hidden className={cn(CHART, 'items-end')}>\n        {chart.bins.map((height, index) => (\n          <span\n            key={index}\n            className={cn(BAR, 'flex-1')}\n            style={{ height: `${(height / 24) * 100}%` }}\n          />\n        ))}\n      </span>\n    );\n\n  if (chart.kind === 'categories')\n    return (\n      <span aria-hidden className={CHART}>\n        {chart.segments.map(({ width, count }, index) => (\n          <span\n            key={index}\n            style={width ? { width } : undefined}\n            className={cn(\n              BAR,\n              'text-ws-non-semantic-indigo-on-subtle px-ws-2 py-ws-3 truncate text-center',\n              width ? 'shrink-0' : 'min-w-0 flex-1',\n            )}\n          >\n            {count}\n          </span>\n        ))}\n        <span className=\"bg-ws-semantic-neutral w-ws-5 shrink-0\" />\n      </span>\n    );\n\n  return (\n    <span aria-hidden className={CHART}>\n      {Array.from({ length: chart.repeated }, (_, index) => (\n        <span key={index} className={cn(BAR, 'w-ws-1 shrink-0')} />\n      ))}\n      <span className=\"bg-ws-static-alpha-base p-ws-3 min-w-0 flex-1 truncate text-center\">\n        Unique\n      </span>\n    </span>\n  );\n}\n"
    },
    {
      "path": "src/blocks/spreadsheet/data.ts",
      "type": "registry:file",
      "target": "blocks/wideset/spreadsheet/data.ts",
      "content": "import {\n  type RemixiconComponentType,\n  RiAlignLeft,\n  RiCalendarLine,\n  RiFileLine,\n  RiHashtag,\n  RiPriceTag3Line,\n  RiShieldKeyholeLine,\n} from '@remixicon/react';\nimport type { AvatarColor } from '@/components/ui/wideset/avatar/Avatar.colors';\nimport type { StatusBadgeProps } from '@/components/ui/wideset/status-badge/StatusBadge.types';\nimport type { TagProps } from '@/components/ui/wideset/tag/Tag.types';\n\nexport const TABLE = 'Clients';\n\n/** The table's pages in the top bar. */\nexport const PAGES = [\n  { label: 'Data', href: '#data' },\n  { label: 'Forms', href: '#forms' },\n  { label: 'Activity Log', href: '#activity' },\n];\n\nexport const ACCOUNT: { name: string; initials: string; color: AvatarColor } = {\n  name: 'Adam Smith',\n  initials: 'AS',\n  color: 'indigo',\n};\n\nexport type Client = {\n  id: number;\n  name: string;\n  customers?: number;\n  country?: { label: string; color: TagProps['color'] };\n  /** A calendar day, `2023-03-15`. */\n  added?: string;\n  employees?: number;\n  market?: { label: string; color: StatusBadgeProps['color'] };\n  website?: string;\n  address?: string;\n};\n\nconst ok = { label: 'No issues', color: 'positive' } as const;\nconst unchecked = { label: 'Unchecked', color: 'neutral' } as const;\n\nconst ROWS: Omit<Client, 'id'>[] = [\n  {\n    name: 'Tech Nova',\n    customers: 23,\n    country: { label: 'Brazil', color: 'pink' },\n    added: '2023-03-15',\n    employees: 58,\n    market: ok,\n    website: 'https://www.technova.com',\n    address: '123 Elm St, Springfield, IL 62701',\n  },\n  {\n    name: 'Eco Solutions',\n    customers: 37,\n    country: { label: 'Japan', color: 'indigo' },\n    added: '2023-07-22',\n    employees: 72,\n    market: ok,\n    website: 'https://www.ecosolutions.com',\n    address: '456 Maple Ave, Denver, CO 80203',\n  },\n  {\n    name: 'Skyline Innovations',\n    customers: 15,\n    country: { label: 'Nigeria', color: 'pink' },\n    added: '2023-11-05',\n    employees: 14,\n    market: ok,\n    website: 'https://www.skyline.com',\n    address: '789 Oak Dr, Austin, TX 73301',\n  },\n  {\n    name: 'Terra Firma',\n    customers: 42,\n    country: { label: 'Canada', color: 'yellow' },\n    added: '2023-01-30',\n    employees: 49,\n    market: ok,\n    website: 'https://www.terrafirma.com',\n    address: '321 Pine Rd, Seattle, WA 98101',\n  },\n  {\n    name: 'Quantum Leap',\n    customers: 29,\n    country: { label: 'Australia', color: 'orange' },\n    added: '2023-09-12',\n    employees: 27,\n    market: ok,\n    website: 'https://www.quantumleap.com',\n    address: '654 Cedar Blvd, Miami, FL 33101',\n  },\n  {\n    name: 'Pinnacle Tech',\n    customers: 8,\n    country: { label: 'India', color: 'cyan' },\n    added: '2023-04-18',\n    employees: 9,\n    market: { label: '2 issues', color: 'negative' },\n    website: 'https://www.pinnacletech.com',\n    address: '987 Birch Ln, Portland, OR 97201',\n  },\n  {\n    name: 'Future Vision',\n    customers: 34,\n    country: { label: 'Germany', color: 'pink' },\n    added: '2023-06-25',\n    employees: 100,\n    market: { label: '4 issues', color: 'negative' },\n    website: 'https://www.futurevision.com',\n    address: '135 Spruce Ct, Boston, MA 02101',\n  },\n  {\n    name: 'Aqua Vista',\n    customers: 11,\n    country: { label: 'Mexico', color: 'brand' },\n    added: '2023-10-09',\n    employees: 18,\n    market: ok,\n    website: 'https://www.aquavista.com',\n  },\n  {\n    name: 'Summit Solutions',\n    customers: 27,\n    country: { label: 'France', color: 'violet' },\n    added: '2023-02-14',\n    employees: 25,\n    market: ok,\n    website: 'https://www.summitsolutions.com',\n  },\n  {\n    name: 'Metro Dynamics',\n    customers: 40,\n    country: { label: 'Italy', color: 'lime' },\n    added: '2023-08-01',\n    employees: 46,\n    market: ok,\n    website: 'https://www.metrodynamics.com',\n  },\n  {\n    name: 'Pure Air Tech',\n    customers: 5,\n    country: { label: 'South Korea', color: 'yellow' },\n    added: '2023-05-27',\n    employees: 6,\n    market: { label: 'Risk found', color: 'notice' },\n    website: 'https://www.pureairtech.com',\n  },\n  {\n    name: 'Sunny Tech',\n    customers: 21,\n    country: { label: 'Argentina', color: 'orange' },\n    added: '2023-12-03',\n    employees: 22,\n    market: unchecked,\n    website: 'https://www.sunnytech.com',\n    address: '852 Palm Blvd, Atlanta, GA 30301',\n  },\n  {\n    name: 'New Horizons',\n    customers: 44,\n    country: { label: 'Spain', color: 'indigo' },\n    added: '2023-03-29',\n    employees: 50,\n    market: ok,\n    website: 'https://www.newhorizons.com',\n    address: '951 Cypress Dr, Dallas, TX 75201',\n  },\n  {\n    name: 'Vivid Life',\n    customers: 19,\n    country: { label: 'Egypt', color: 'violet' },\n    added: '2023-11-11',\n    employees: 20,\n    market: ok,\n    address: '258 Walnut St, Philadelphia, PA 19101',\n  },\n  {\n    name: 'Synergy Works',\n    customers: 32,\n    employees: 35,\n    market: ok,\n    address: '369 Chestnut Ave, Phoenix, AZ 85001',\n  },\n  {\n    name: 'Innovate Now',\n    customers: 3,\n    added: '2023-09-21',\n    employees: 4,\n    website: 'https://www.innovatenow.com',\n    address: '147 Dogwood Ln, Orlando, FL 32801',\n  },\n  {\n    name: 'Spark Creative',\n    country: { label: 'Turkey', color: 'red' },\n    added: '2023-10-30',\n    market: unchecked,\n    website: 'https://www.sparkcreative.com',\n  },\n  {\n    name: 'Unity Group',\n    customers: 36,\n    added: '2023-02-05',\n    employees: 39,\n    market: unchecked,\n    website: 'https://www.unitygroup.com',\n    address: '369 Larch St, Minneapolis, MN 55401',\n  },\n  { name: 'Inspire Ideas', country: { label: 'Netherlands', color: 'green' } },\n];\n\n/** The first rows of the table, in its saved order; an empty field is an empty cell. */\nexport const CLIENTS: Client[] = ROWS.map((client, id) => ({ id, ...client }));\n\n/**\n * What a column holds across the whole table, drawn under its header: the type, a small chart\n * and a caption. `unique`: a 1px bar per value that repeats, then the share of unique values.\n * `histogram`: bar heights out of the 24px chart. `categories`: the most common values, widest\n * first, in px (a segment without a width takes the rest), then the empty values.\n */\nexport type ColumnSummary = {\n  type: 'string' | 'number' | 'status';\n  chart:\n    | { kind: 'unique'; repeated: number }\n    | { kind: 'histogram'; bins: number[] }\n    | { kind: 'categories'; segments: { width?: number; count?: number }[] };\n  /** A count, or the lowest and the highest value. */\n  caption: string | [string, string];\n};\n\nexport type ColumnKey = Exclude<keyof Client, 'id'>;\n\nexport type Column = {\n  key: ColumnKey;\n  label: string;\n  /** The type icon before the label. */\n  icon: RemixiconComponentType;\n  summary: ColumnSummary;\n};\n\nexport const COLUMNS: Column[] = [\n  {\n    key: 'name',\n    label: 'Client name',\n    icon: RiFileLine,\n    summary: { type: 'string', chart: { kind: 'unique', repeated: 11 }, caption: '137 values' },\n  },\n  {\n    key: 'customers',\n    label: 'Customers',\n    icon: RiHashtag,\n    summary: {\n      type: 'number',\n      chart: {\n        kind: 'histogram',\n        bins: [1, 2, 4, 2, 7, 18, 12, 19, 24, 11, 21, 19, 11, 13, 17, 21, 11, 7, 18, 9, 6, 2, 4, 2],\n      },\n      caption: ['0', '45'],\n    },\n  },\n  {\n    key: 'country',\n    label: 'Country',\n    icon: RiPriceTag3Line,\n    summary: {\n      type: 'string',\n      chart: {\n        kind: 'categories',\n        segments: [\n          { width: 29, count: 31 },\n          { width: 19, count: 13 },\n          { width: 13, count: 8 },\n          { width: 11 },\n          { width: 10 },\n          { width: 9 },\n          { width: 7 },\n          { width: 6 },\n          { width: 4 },\n          { width: 2 },\n        ],\n      },\n      caption: '6 unique values',\n    },\n  },\n  {\n    key: 'added',\n    label: 'Date added',\n    icon: RiCalendarLine,\n    summary: { type: 'string', chart: { kind: 'unique', repeated: 52 }, caption: '137 clients' },\n  },\n  {\n    key: 'employees',\n    label: 'Employees',\n    icon: RiHashtag,\n    summary: {\n      type: 'number',\n      chart: {\n        kind: 'histogram',\n        bins: [1, 2, 4, 2, 2, 6, 4, 6, 8, 4, 7, 19, 4, 4, 6, 7, 4, 2, 6, 3, 6, 2, 4, 2],\n      },\n      caption: ['0', '101'],\n    },\n  },\n  {\n    key: 'market',\n    label: 'Market',\n    icon: RiShieldKeyholeLine,\n    summary: {\n      type: 'status',\n      chart: {\n        kind: 'categories',\n        segments: [{ width: 74, count: 106 }, { width: 22, count: 25 }, { count: 6 }],\n      },\n      caption: '2 unique values',\n    },\n  },\n  {\n    key: 'website',\n    label: 'Website',\n    icon: RiAlignLeft,\n    summary: { type: 'string', chart: { kind: 'unique', repeated: 0 }, caption: '76 values' },\n  },\n  {\n    key: 'address',\n    label: 'Address',\n    icon: RiAlignLeft,\n    summary: { type: 'string', chart: { kind: 'unique', repeated: 5 }, caption: '123 values' },\n  },\n];\n\n/** The status bar: figures for the whole table, of which the grid shows the first rows. */\nexport const TOTALS = [\n  { label: 'Total clients', value: '18' },\n  { label: 'Total clients', value: '1,534' },\n  { label: 'Size', value: '831.3MB' },\n  { label: 'Rows', value: '32.3K' },\n  { label: 'Columns', value: '21' },\n];\n\nexport const LATEST_DATA = 'September 30, Saturday, 18:00 AM PST';\n"
    },
    {
      "path": "src/blocks/spreadsheet/index.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/spreadsheet/index.tsx",
      "content": "'use client';\n\nimport '@/styles/wideset-blocks.css';\n\nimport { AppShell } from '@/components/ui/wideset/app-shell/AppShell';\n\nimport { ClientSheet } from './client-sheet';\nimport { StatusBar } from './status-bar';\nimport { Toolbar } from './toolbar';\nimport { TopBar } from './top-bar';\n\n/**\n * Spreadsheet, Flat direction under a top bar: the Clients table with its view tools, the grid as\n * a canvas that fills the window, and a status bar. Top bar and toolbar stay full-bleed.\n */\nexport default function SpreadsheetBlock() {\n  return (\n    <AppShell className=\"ws-block-utility\" direction=\"flat\">\n      <AppShell.Main className=\"flex flex-col\">\n        <TopBar />\n        <Toolbar />\n        <ClientSheet className=\"min-h-0 flex-1\" />\n        <StatusBar />\n      </AppShell.Main>\n    </AppShell>\n  );\n}\n"
    },
    {
      "path": "src/blocks/spreadsheet/status-bar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/spreadsheet/status-bar.tsx",
      "content": "'use client';\n\nimport { Fragment } from 'react';\n\nimport { LATEST_DATA, TOTALS } from './data';\n\n/** Figma's status bar under the grid: the table's totals, and when its data last came in. */\nexport function StatusBar() {\n  return (\n    <footer className=\"bg-ws-static-alpha-subtle typography-body-sm px-ws-11 py-ws-3 flex shrink-0 items-center justify-between\">\n      <div className=\"gap-ws-2 flex items-center\">\n        {TOTALS.map(({ label, value }, index) => (\n          <Fragment key={`${label}-${value}`}>\n            {index > 0 && <span aria-hidden className=\"border-ws-static-base h-ws-12 border-l\" />}\n            <p className=\"h-ws-14 px-ws-5 gap-ws-6 flex items-center\">\n              <span className=\"text-ws-static-subtle\">{label}</span>\n              <span className=\"text-ws-static-base\">{value}</span>\n            </p>\n          </Fragment>\n        ))}\n      </div>\n      <p className=\"h-ws-14 px-ws-5 gap-ws-3 flex items-center\">\n        <span className=\"text-ws-static-subtle\">Latest Data</span>\n        <span className=\"text-ws-static-base\">{LATEST_DATA}</span>\n      </p>\n    </footer>\n  );\n}\n"
    },
    {
      "path": "src/blocks/spreadsheet/toolbar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/spreadsheet/toolbar.tsx",
      "content": "'use client';\n\nimport {\n  RiFilter3Line,\n  RiFolder3Line,\n  RiMoreFill,\n  RiPaletteLine,\n  RiSortDesc,\n} from '@remixicon/react';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { SegmentedControl } from '@/components/ui/wideset/segmented-control/SegmentedControl';\n\n// The grid is always sorted by one field: the table's own order, or the column a header menu set.\nconst TOOLS = [\n  { label: 'Filter', icon: RiFilter3Line },\n  { label: 'Group', icon: RiFolder3Line },\n  { label: 'Sorted by 1 field', icon: RiSortDesc },\n  { label: 'Color', icon: RiPaletteLine },\n  { label: 'More', icon: RiMoreFill },\n];\n\n/**\n * The view's tools over the grid, no line of their own (the grid's top edge is the line): the\n * view switch and what shapes the rows, then sharing.\n */\nexport function Toolbar() {\n  return (\n    <div className=\"h-ws-19 px-ws-11 flex shrink-0 items-center justify-between\">\n      <div className=\"gap-ws-5 flex items-center\">\n        {/* The List view is yours to build; until then the grid stays a table. */}\n        <SegmentedControl size=\"sm\" defaultValue=\"table\" aria-label=\"View\">\n          <SegmentedControl.Item value=\"table\">Table</SegmentedControl.Item>\n          <SegmentedControl.Item value=\"list\">List</SegmentedControl.Item>\n        </SegmentedControl>\n        <div className=\"gap-ws-2 flex items-center\">\n          {TOOLS.map(({ label, icon }) => (\n            <Button key={label} variant=\"secondary\" preset=\"ghost\" size=\"sm\">\n              <Button.Icon icon={icon} />\n              {label}\n            </Button>\n          ))}\n        </div>\n      </div>\n\n      <div className=\"gap-ws-5 flex items-center\">\n        <Button variant=\"secondary\" preset=\"border\" size=\"sm\">\n          Share\n        </Button>\n        <Button variant=\"secondary\" preset=\"border\" size=\"sm\">\n          Export\n        </Button>\n        <IconButton\n          variant=\"secondary\"\n          preset=\"ghost\"\n          size=\"sm\"\n          icon={RiMoreFill}\n          aria-label=\"More actions\"\n        />\n      </div>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/spreadsheet/top-bar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/spreadsheet/top-bar.tsx",
      "content": "'use client';\n\nimport { RiArrowDownSLine, RiNotification3Line, RiSearchLine } from '@remixicon/react';\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\nimport { cn } from '@/lib/wideset/utils';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { TextInput } from '@/components/ui/wideset/text-input/TextInput';\nimport { type AnchorHTMLAttributes, useState } from 'react';\n\nimport { BrandMark } from './brand-mark';\nimport { ACCOUNT, PAGES, TABLE } from './data';\n\n/**\n * Figma's top bar on the white page, a line below it: the product mark, the table and its\n * switcher, the table's pages, then search and the account.\n */\nexport function TopBar() {\n  const [current, setCurrent] = useState(PAGES[0].href);\n\n  return (\n    <header className=\"border-ws-static-base h-ws-19 px-ws-11 flex shrink-0 items-center justify-between border-b\">\n      <div className=\"gap-ws-12 flex items-center\">\n        {/* One mark in every screen: this one has no sidebar, so the top bar carries it. */}\n        <div className=\"gap-ws-7 flex items-center\">\n          <BrandMark label=\"Wideset\" />\n          <div className=\"gap-ws-5 flex items-center\">\n            <h1 className=\"typography-subtitle-xs text-ws-dynamic-secondary-default\">{TABLE}</h1>\n            <IconButton\n              variant=\"secondary\"\n              preset=\"ghost\"\n              size=\"xs\"\n              icon={RiArrowDownSLine}\n              aria-label=\"Switch table\"\n            />\n          </div>\n        </div>\n        <nav aria-label={TABLE} className=\"gap-ws-3 flex items-center\">\n          {PAGES.map((page) => (\n            <PageLink\n              key={page.href}\n              href={page.href}\n              active={page.href === current}\n              onClick={() => setCurrent(page.href)}\n            >\n              {page.label}\n            </PageLink>\n          ))}\n        </nav>\n      </div>\n\n      <div className=\"gap-ws-5 flex items-center\">\n        <TextInput size=\"sm\" className=\"w-[16rem]\">\n          <TextInput.Prefix inner>\n            <TextInput.Icon icon={RiSearchLine} />\n          </TextInput.Prefix>\n          <TextInput.Input type=\"search\" placeholder=\"Search\" aria-label=\"Search clients\" />\n        </TextInput>\n        <Avatar\n          initials={ACCOUNT.initials}\n          color={ACCOUNT.color}\n          status=\"online\"\n          aria-label={ACCOUNT.name}\n        />\n        <IconButton\n          variant=\"secondary\"\n          preset=\"ghost\"\n          size=\"sm\"\n          icon={RiNotification3Line}\n          aria-label=\"Notifications\"\n        />\n      </div>\n    </header>\n  );\n}\n\ntype PageLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & { active: boolean };\n\n/** Figma \"Assets / Navigation Bar Page\": a top-bar link, filled while it is the current page. */\nfunction PageLink({ active, className, children, ...props }: PageLinkProps) {\n  return (\n    <a\n      aria-current={active ? 'page' : undefined}\n      className={cn(\n        'typography-label-strong-sm rounded-ws-control-lg px-ws-5 py-ws-3 min-h-ws-14 flex items-center',\n        'focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default',\n        active\n          ? 'bg-ws-dynamic-tertiary-alpha-strong-default text-ws-static-strong'\n          : 'text-ws-static-base hover:bg-ws-dynamic-tertiary-alpha-strong-default hover:text-ws-static-strong',\n        className,\n      )}\n      {...props}\n    >\n      {children}\n    </a>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "1.1.0",
    "commit": "a734f9f0"
  }
}
