{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-kanban",
  "type": "registry:block",
  "title": "Kanban",
  "description": "A project board: workspace sidebar, breadcrumbs and view tabs, filters, and columns of task cards.",
  "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/divider.json",
    "https://wideset.co/r/filter-button.json",
    "https://wideset.co/r/icon-button.json",
    "https://wideset.co/r/select.json",
    "https://wideset.co/r/sidebar.json",
    "https://wideset.co/r/status-badge.json",
    "https://wideset.co/r/tabs.json",
    "https://wideset.co/r/tag.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/kanban/board.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/kanban/board.tsx",
      "content": "'use client';\n\nimport { RiAddLine, RiAttachment2, RiChat2Line, RiLinkM, RiMoreFill } from '@remixicon/react';\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { cn } from '@/lib/wideset/utils';\nimport { Divider } from '@/components/ui/wideset/divider/Divider';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { StatusBadge } from '@/components/ui/wideset/status-badge/StatusBadge';\nimport { Tag } from '@/components/ui/wideset/tag/Tag';\n\nimport type { Badge, Column, Task, TaskGroup } from './data';\n\nconst isGroup = (item: Task | TaskGroup): item is TaskGroup => 'tasks' in item;\n\nfunction TaskMenu({ label }: { label: string }) {\n  return (\n    <IconButton\n      icon={RiMoreFill}\n      size=\"xs\"\n      variant=\"secondary\"\n      preset=\"ghost\"\n      aria-label={`Actions for ${label}`}\n    />\n  );\n}\n\nfunction TaskBadge({ badge }: { badge: Badge }) {\n  if (badge.kind === 'tag') {\n    return (\n      <Tag size=\"sm\" color={badge.color}>\n        {badge.label}\n      </Tag>\n    );\n  }\n  return (\n    <StatusBadge size=\"sm\" color={badge.color}>\n      {badge.icon ? <StatusBadge.Icon icon={badge.icon} /> : null}\n      <StatusBadge.Label>{badge.label}</StatusBadge.Label>\n    </StatusBadge>\n  );\n}\n\n/**\n * One task. On the column it is raised (Static/Fill/Overlay, Elevation/Low); inside a stack it lies\n * flat on Static/Fill/Container and drops the header row, since the stack names the person.\n */\nfunction TaskCard({ task, nested = false }: { task: Task; nested?: boolean }) {\n  const { assignee, date, details, title, badges, comments, attachments, link } = task;\n  const name = title ?? assignee?.name ?? 'Unassigned task';\n  const hasHeader = assignee !== undefined;\n\n  return (\n    <article\n      className={cn(\n        'p-ws-5 gap-ws-5 flex flex-col',\n        // Figma's card casts one 1px shadow (0 1 1, 10%), no outline and no style; the closest\n        // token without an outline is forms-base. Elevation/Low adds a ring and two blurs.\n        nested ? 'bg-ws-static-container rounded-ws-container-sm' : 'shadow-ws-forms-base',\n        !nested &&\n          (task.highlighted\n            ? 'bg-ws-dynamic-primary-alpha-strong-default rounded-ws-container-md'\n            : 'bg-ws-static-overlay rounded-ws-container-sm'),\n      )}\n    >\n      {hasHeader ? (\n        <div className=\"p-ws-3 gap-ws-4 flex flex-col\">\n          <div className=\"gap-ws-5 flex items-center\">\n            {assignee ? (\n              <Avatar\n                size=\"sm\"\n                initials={assignee.initials}\n                color={assignee.color}\n                status={assignee.online ? 'online' : undefined}\n              />\n            ) : (\n              <Avatar size=\"sm\" shape=\"square\" />\n            )}\n            <p className=\"typography-label-sm text-ws-static-strong min-w-0 flex-1 truncate\">\n              {assignee?.name ?? 'Unknown'}\n            </p>\n            <TaskMenu label={name} />\n          </div>\n          {date ? <p className=\"typography-label-sm text-ws-static-base\">{date}</p> : null}\n          {details ? (\n            <div className=\"mt-ws-4 gap-ws-7 flex flex-col\">\n              <Divider weight=\"thin\" emphasis=\"subtle\" className=\"-mx-ws-7 w-auto\" />\n              <ul className=\"gap-ws-3 flex flex-col\">\n                {details.map(({ icon: Icon, label }) => (\n                  <li key={label} className=\"gap-ws-5 flex items-center\">\n                    <span className=\"size-ws-12 flex shrink-0 items-center justify-center\">\n                      <Icon\n                        aria-hidden=\"true\"\n                        className=\"size-ws-9 text-ws-dynamic-secondary-default\"\n                      />\n                    </span>\n                    <span className=\"typography-label-sm text-ws-static-base truncate\">\n                      {label}\n                    </span>\n                  </li>\n                ))}\n              </ul>\n            </div>\n          ) : null}\n        </div>\n      ) : null}\n\n      {!hasHeader && date ? (\n        <p className=\"p-ws-3 typography-label-sm text-ws-static-base\">{date}</p>\n      ) : null}\n\n      {title ? (\n        <div className=\"p-ws-3 gap-ws-5 flex items-start\">\n          <p className=\"typography-body-md text-ws-static-base min-w-0 flex-1\">{title}</p>\n          {hasHeader ? null : <TaskMenu label={name} />}\n        </div>\n      ) : null}\n\n      {badges || comments ? (\n        <div className=\"p-ws-3 gap-ws-3 flex items-center\">\n          {badges?.map((badge) => (\n            <TaskBadge key={badge.label} badge={badge} />\n          ))}\n          {comments ? (\n            <StatusBadge size=\"sm\" className=\"ml-auto\">\n              <StatusBadge.Icon icon={RiChat2Line} />\n              <StatusBadge.Label>\n                {comments}\n                <span className=\"sr-only\"> comments</span>\n              </StatusBadge.Label>\n            </StatusBadge>\n          ) : null}\n        </div>\n      ) : null}\n\n      {attachments || link ? (\n        <div className=\"border-ws-static-subtle rounded-ws-control-md h-ws-15 px-ws-5 gap-ws-5 flex items-center border\">\n          <span className=\"size-ws-11 flex shrink-0 items-center justify-center\">\n            {attachments ? (\n              <RiAttachment2 aria-hidden=\"true\" className=\"size-ws-9 text-ws-static-subtle\" />\n            ) : (\n              <RiLinkM aria-hidden=\"true\" className=\"size-ws-9 text-ws-static-subtle\" />\n            )}\n          </span>\n          <span\n            className={cn(\n              'typography-label-sm truncate',\n              attachments ? 'text-ws-static-subtle' : 'text-ws-static-base',\n            )}\n          >\n            {attachments ? `${attachments} attachments` : link}\n          </span>\n        </div>\n      ) : null}\n    </article>\n  );\n}\n\n/** A person's tasks stacked under their name, with the count of those left out. */\nfunction TaskStack({ group }: { group: TaskGroup }) {\n  return (\n    <div className=\"bg-ws-static-alpha-subtle rounded-ws-container-md p-ws-3 gap-ws-4 flex flex-col\">\n      <div className=\"px-ws-5 py-ws-3 gap-ws-5 flex items-center\">\n        <Avatar\n          size=\"sm\"\n          initials={group.assignee.initials}\n          color={group.assignee.color}\n          status={group.assignee.online ? 'online' : undefined}\n        />\n        <p className=\"typography-label-sm text-ws-static-strong min-w-0 flex-1 truncate\">\n          {group.assignee.name}\n        </p>\n        {group.age ? (\n          <span className=\"typography-label-strong-sm text-ws-static-subtle\">{group.age}</span>\n        ) : null}\n      </div>\n      <div className=\"gap-ws-3 flex flex-col\">\n        {group.tasks.map((task) => (\n          <TaskCard key={task.id} task={task} nested />\n        ))}\n      </div>\n      {group.hidden ? (\n        <p className=\"p-ws-3 typography-label-sm text-ws-static-strong\">View +{group.hidden}</p>\n      ) : null}\n    </div>\n  );\n}\n\n/** A status column: its label and count, the cards, and a button that adds a task. */\nexport function KanbanColumn({ column }: { column: Column }) {\n  return (\n    <section\n      aria-label={column.title}\n      className=\"bg-ws-static-alpha-subtle rounded-ws-container-md p-ws-5 gap-ws-4 ws-scrollbar flex w-[22.125rem] shrink-0 flex-col overflow-y-auto\"\n    >\n      <div className=\"p-ws-3 flex items-center justify-between\">\n        <div className=\"gap-ws-4 flex items-center\">\n          <Tag color={column.color}>\n            {column.icon ? <Tag.Icon icon={column.icon} /> : null}\n            {column.title}\n          </Tag>\n          <Tag color={column.color}>{column.count}</Tag>\n          <IconButton\n            icon={RiMoreFill}\n            size=\"xs\"\n            variant=\"secondary\"\n            preset=\"ghost\"\n            aria-label={`${column.title} actions`}\n          />\n        </div>\n        <IconButton\n          icon={RiAddLine}\n          size=\"xs\"\n          variant=\"secondary\"\n          preset=\"ghost\"\n          aria-label={`Add a task to ${column.title}`}\n        />\n      </div>\n      {column.items.map((item) =>\n        isGroup(item) ? (\n          <TaskStack key={item.id} group={item} />\n        ) : (\n          <TaskCard key={item.id} task={item} />\n        ),\n      )}\n      <Button variant=\"secondary\" preset=\"ghost\" size=\"sm\" className=\"shrink-0\">\n        <Button.Icon icon={RiAddLine} />\n        New task\n      </Button>\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/kanban/brand-mark.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/kanban/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/kanban/data.ts",
      "type": "registry:file",
      "target": "blocks/wideset/kanban/data.ts",
      "content": "import {\n  type RemixiconComponentType,\n  RiCalendarLine,\n  RiDashboardFill,\n  RiInformationLine,\n  RiMapPin2Line,\n  RiMoreFill,\n  RiProgress2Line,\n  RiProgress4Line,\n  RiProgress6Line,\n  RiStarLine,\n  RiTimer2Line,\n} from '@remixicon/react';\nimport type { AvatarColor } from '@/components/ui/wideset/avatar/Avatar.colors';\nimport type { FilterButtonProps } from '@/components/ui/wideset/filter-button/FilterButton.types';\nimport type { StatusBadgeProps } from '@/components/ui/wideset/status-badge/StatusBadge.types';\nimport type { TagProps } from '@/components/ui/wideset/tag/Tag.types';\n\nexport type Person = {\n  name: string;\n  initials: string;\n  /** Pins the avatar's hue; left out, it follows from the initials. */\n  color?: AvatarColor;\n  online?: boolean;\n};\n\n/** A status (`StatusBadge`) or a category (`Tag`) on a card. */\nexport type Badge =\n  | {\n      kind: 'status';\n      label: string;\n      color?: StatusBadgeProps['color'];\n      icon?: RemixiconComponentType;\n    }\n  | { kind: 'tag'; label: string; color: TagProps['color'] };\n\nexport type Task = {\n  id: string;\n  /** The card's header row. `null` is a task nobody has picked up yet. */\n  assignee?: Person | null;\n  date?: string;\n  /** Icon rows under a line: where, when, what else. */\n  details?: { icon: RemixiconComponentType; label: string }[];\n  title?: string;\n  badges?: Badge[];\n  comments?: number;\n  attachments?: number;\n  link?: string;\n  /** Draws the card on the brand tint, for the task in focus. */\n  highlighted?: boolean;\n};\n\n/** Several tasks of one person, stacked under their name. */\nexport type TaskGroup = {\n  id: string;\n  assignee: Person;\n  /** How long the oldest task has waited, e.g. `6d`. */\n  age?: string;\n  tasks: Task[];\n  /** Tasks left out of the stack, shown as \"View +N\". */\n  hidden?: number;\n};\n\nexport type Column = {\n  id: string;\n  title: string;\n  icon?: RemixiconComponentType;\n  color: TagProps['color'];\n  /** Tasks in the column, including those not loaded yet. */\n  count: number;\n  items: (Task | TaskGroup)[];\n};\n\nexport type SpaceColor = 'purple' | 'indigo' | 'blue' | 'cyan' | 'teal' | 'green';\n\nexport const workspace = { name: 'Widelab', seats: 31 };\n\nexport const account: Person & { email: string } = {\n  name: 'Adam Smith',\n  initials: 'AS',\n  email: 'hello@wideset.co',\n  online: true,\n};\n\nexport const navigation = [\n  { id: 'explore', label: 'Explore', icon: RiDashboardFill },\n  { id: 'recent', label: 'Recent', icon: RiTimer2Line },\n  { id: 'starred', label: 'Starred', icon: RiStarLine },\n];\n\nexport const spaceGroups: {\n  id: string;\n  label: string;\n  spaces: { id: string; label: string; color: SpaceColor }[];\n}[] = [\n  {\n    id: 'pinned-spaces',\n    label: 'Pinned Spaces',\n    spaces: [\n      { id: 'kick-off', label: 'Project Kick-off', color: 'purple' },\n      { id: 'research', label: 'Research & Discovery', color: 'indigo' },\n      { id: 'ideas', label: 'Ideas & Concepts', color: 'blue' },\n    ],\n  },\n  {\n    id: 'spaces',\n    label: 'Spaces',\n    spaces: [\n      { id: 'design', label: 'Design', color: 'cyan' },\n      { id: 'handoff', label: 'Development Handoff', color: 'teal' },\n      { id: 'feedback', label: 'Feedback & Iteration', color: 'green' },\n    ],\n  },\n];\n\nexport const breadcrumbs = ['Teams', 'Projects', 'Design Analysis 2024'];\n\nexport const views = [\n  { value: 'board', label: 'Board' },\n  { value: 'list', label: 'List' },\n  { value: 'calendar', label: 'Calendar' },\n  { value: 'table', label: 'Table' },\n  { value: 'gantt', label: 'Gantt' },\n];\n\nexport const teamOptions: FilterButtonProps['options'] = [\n  { value: 'design', label: 'Design' },\n  { value: 'development', label: 'Development' },\n  { value: 'strategy', label: 'Strategy' },\n];\n\nconst andrew: Person = { name: 'Andrew Tang', initials: 'AT', online: true };\nconst ryan: Person = { name: 'Ryan Gosling', initials: 'RG', online: true };\nconst jake: Person = { name: 'Jake Gyllenhaal', initials: 'JG', color: 'brand', online: true };\nconst michael: Person = { name: 'Michael Corleone', initials: 'MC', color: 'brand', online: true };\n\nexport const assigneeOptions: FilterButtonProps['options'] = [andrew, ryan, jake, michael].map(\n  ({ name }) => ({ value: name, label: name }),\n);\n\nexport const sortOptions = [\n  { value: 'newest', label: 'Sort by newest' },\n  { value: 'oldest', label: 'Sort by oldest' },\n  { value: 'priority', label: 'Sort by priority' },\n];\n\nexport const columns: Column[] = [\n  {\n    id: 'backlog',\n    title: 'Backlog',\n    icon: RiProgress6Line,\n    color: 'teal',\n    count: 3,\n    items: [\n      {\n        id: 'site-visit',\n        assignee: null,\n        details: [\n          { icon: RiMapPin2Line, label: 'California, USA' },\n          { icon: RiCalendarLine, label: '21/01/2025' },\n          { icon: RiMoreFill, label: 'More information' },\n        ],\n        badges: [{ kind: 'status', label: 'Medium' }],\n      },\n      {\n        id: 'andrew-backlog',\n        assignee: andrew,\n        age: '6d',\n        hidden: 4,\n        tasks: [\n          {\n            id: 'workflow',\n            title: 'Optimize team workflow to improve efficiency and reduce bottlenecks.',\n            badges: [\n              { kind: 'status', label: '254', icon: RiInformationLine },\n              { kind: 'status', label: 'Medium' },\n            ],\n            comments: 254,\n          },\n          {\n            id: 'satisfaction',\n            title: 'Enhance client satisfaction',\n            badges: [{ kind: 'tag', label: 'Requires Creative Input', color: 'purple' }],\n          },\n        ],\n      },\n    ],\n  },\n  {\n    id: 'partial',\n    title: 'Partial support',\n    icon: RiProgress4Line,\n    color: 'blue',\n    count: 2,\n    items: [\n      {\n        id: 'menu-redesign',\n        assignee: ryan,\n        date: '21/01/2025',\n        title: 'Incorporate client feedback on a multi-location restaurant menu redesign',\n      },\n      {\n        id: 'scheduling-prototype',\n        assignee: jake,\n        title: 'Build a click-through prototype of a scheduling tool for usability testing',\n        badges: [{ kind: 'status', label: 'High Priority', color: 'negative' }],\n        attachments: 4,\n      },\n    ],\n  },\n  {\n    id: 'started',\n    title: 'Started',\n    icon: RiProgress2Line,\n    color: 'indigo',\n    count: 3,\n    items: [\n      {\n        id: 'health-homepage',\n        assignee: michael,\n        date: '21/01/2025',\n        title: 'Redesign the homepage of a health-tech app',\n        highlighted: true,\n      },\n      {\n        id: 'andrew-started',\n        assignee: { ...andrew, online: false },\n        tasks: [\n          {\n            id: 'workflow-review',\n            date: '21/01/2025',\n            title: 'Optimize team workflow to improve efficiency and reduce bottlenecks.',\n            link: 'Figma Link',\n          },\n          {\n            id: 'saas-layouts',\n            title: 'Map out responsive layouts for a SaaS dashboard',\n            badges: [{ kind: 'tag', label: 'Client Approved', color: 'lime' }],\n          },\n        ],\n      },\n    ],\n  },\n  {\n    id: 'review',\n    title: 'Review',\n    color: 'red',\n    count: 13,\n    items: [\n      {\n        id: 'health-conversion',\n        assignee: { ...michael, online: false },\n        date: '21/01/2025',\n        title:\n          'Redesign the homepage of a health-tech app with a focus on increasing conversion rates (target: 10%).',\n      },\n    ],\n  },\n];\n"
    },
    {
      "path": "src/blocks/kanban/header.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/kanban/header.tsx",
      "content": "'use client';\n\nimport {\n  RiArrowDownSLine,\n  RiChat1Line,\n  RiEditLine,\n  RiFilter3Line,\n  RiFolder3Fill,\n  RiSearchLine,\n  RiSettings3Line,\n} from '@remixicon/react';\nimport { Breadcrumbs } from '@/components/ui/wideset/breadcrumbs/Breadcrumbs';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { Tabs } from '@/components/ui/wideset/tabs/Tabs';\n\nimport { breadcrumbs, views } from './data';\n\n/** The page header: where the board sits and its actions, then the view tabs. Render inside `Tabs`. */\nexport function PageHeader() {\n  return (\n    <header className=\"border-ws-static-subtle shrink-0 border-b\">\n      <div className=\"border-ws-static-subtle h-ws-18 px-ws-11 flex items-center justify-between border-b\">\n        <Breadcrumbs separator=\"arrow\">\n          {breadcrumbs.map((crumb, index) => (\n            <Breadcrumbs.Item key={crumb}>\n              {index === 0 ? <RiFolder3Fill aria-hidden=\"true\" className=\"size-ws-9\" /> : null}\n              {crumb}\n            </Breadcrumbs.Item>\n          ))}\n        </Breadcrumbs>\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            <Button.Icon icon={RiSettings3Line} />\n            Settings\n          </Button>\n          <IconButton\n            icon={RiChat1Line}\n            variant=\"secondary\"\n            preset=\"ghost\"\n            size=\"sm\"\n            aria-label=\"Comments\"\n          />\n        </div>\n      </div>\n      <div className=\"px-ws-11 flex items-center justify-between\">\n        <Tabs.List aria-label=\"Views\">\n          {views.map((view) => (\n            // Only the board has a view so far; the others stay visible but disabled until they do.\n            <Tabs.Item key={view.value} value={view.value} disabled={view.value !== 'board'}>\n              <Tabs.Label>{view.label}</Tabs.Label>\n            </Tabs.Item>\n          ))}\n        </Tabs.List>\n        <div className=\"gap-ws-5 flex items-center\">\n          <Button variant=\"secondary\" preset=\"ghost\" size=\"sm\">\n            <Button.Icon icon={RiSearchLine} />\n            Search\n          </Button>\n          <Button variant=\"secondary\" preset=\"ghost\" size=\"sm\">\n            <Button.Icon icon={RiFilter3Line} />\n            Filter\n          </Button>\n          <Button variant=\"secondary\" preset=\"ghost\" size=\"sm\">\n            <Button.Icon icon={RiEditLine} />\n            Customize\n          </Button>\n          <IconButton\n            icon={RiArrowDownSLine}\n            variant=\"secondary\"\n            preset=\"ghost\"\n            size=\"sm\"\n            aria-label=\"More view options\"\n          />\n        </div>\n      </div>\n    </header>\n  );\n}\n"
    },
    {
      "path": "src/blocks/kanban/index.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/kanban/index.tsx",
      "content": "'use client';\n\nimport '@/styles/wideset-blocks.css';\n\nimport { RiAddLine } from '@remixicon/react';\nimport { AppShell } from '@/components/ui/wideset/app-shell/AppShell';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { FilterButton } from '@/components/ui/wideset/filter-button/FilterButton';\nimport { Select } from '@/components/ui/wideset/select/Select';\nimport { Tabs } from '@/components/ui/wideset/tabs/Tabs';\nimport { useState } from 'react';\n\nimport { KanbanColumn } from './board';\nimport { assigneeOptions, columns, sortOptions, teamOptions } from './data';\nimport { PageHeader } from './header';\nimport { KanbanSidebar } from './sidebar';\n\n/** Kanban: a project board in the Flat direction, the sidebar and the page on one white surface. */\nexport default function Kanban() {\n  const [teams, setTeams] = useState<string[]>([]);\n  const [assignees, setAssignees] = useState<string[]>([]);\n  // \"Assigned to\" narrows every column to the chosen people; a stack keeps its tasks with its person.\n  const visibleColumns =\n    assignees.length === 0\n      ? columns\n      : columns.map((column) => {\n          const items = column.items.filter(\n            (item) => item.assignee != null && assignees.includes(item.assignee.name),\n          );\n          // The count is of tasks, a stack's hidden ones included, as in the unfiltered column.\n          const count = items.reduce(\n            (total, item) => total + ('tasks' in item ? item.tasks.length + (item.hidden ?? 0) : 1),\n            0,\n          );\n          return { ...column, items, count };\n        });\n  const [sort, setSort] = useState('newest');\n\n  return (\n    <AppShell className=\"ws-block-utility\" direction=\"flat\">\n      <KanbanSidebar />\n      <AppShell.Main className=\"flex flex-col\">\n        <Tabs defaultValue=\"board\" divider={false} className=\"min-h-0 flex-1\">\n          <PageHeader />\n          <Tabs.Content value=\"board\" className=\"gap-ws-9 py-ws-7 flex min-h-0 flex-1 flex-col\">\n            <div className=\"gap-ws-5 px-ws-11 flex items-center\">\n              <FilterButton\n                label=\"Team\"\n                placeholder=\"Team\"\n                options={teamOptions}\n                value={teams}\n                onChange={setTeams}\n              />\n              <FilterButton\n                label=\"Assigned to\"\n                placeholder=\"Assigned to\"\n                options={assigneeOptions}\n                value={assignees}\n                onChange={setAssignees}\n              />\n              <Select\n                size=\"sm\"\n                preset=\"ghost\"\n                aria-label=\"Sort tasks\"\n                options={sortOptions}\n                value={sort}\n                onValueChange={setSort}\n                className=\"w-auto\"\n              />\n              <Button variant=\"secondary\" preset=\"border\" size=\"sm\" className=\"ml-auto\">\n                <Button.Icon icon={RiAddLine} />\n                Create\n              </Button>\n            </div>\n            <div className=\"gap-ws-9 px-ws-11 ws-scrollbar flex min-h-0 flex-1 overflow-x-auto\">\n              {visibleColumns.map((column) => (\n                <KanbanColumn key={column.id} column={column} />\n              ))}\n            </div>\n          </Tabs.Content>\n        </Tabs>\n      </AppShell.Main>\n    </AppShell>\n  );\n}\n"
    },
    {
      "path": "src/blocks/kanban/sidebar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/kanban/sidebar.tsx",
      "content": "'use client';\n\nimport { type RemixiconComponentType, RiArrowDownSLine, RiFlashlightFill } from '@remixicon/react';\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\nimport { cn } from '@/lib/wideset/utils';\nimport { Sidebar } from '@/components/ui/wideset/sidebar/Sidebar';\nimport { useState } from 'react';\n\nimport { BrandMark } from './brand-mark';\nimport { account, navigation, type SpaceColor, spaceGroups, workspace } from './data';\n\nconst TILE: Record<SpaceColor, string> = {\n  purple: 'bg-ws-non-semantic-purple-strong text-ws-non-semantic-purple-on-strong',\n  indigo: 'bg-ws-non-semantic-indigo-strong text-ws-non-semantic-indigo-on-strong',\n  blue: 'bg-ws-non-semantic-blue-strong text-ws-non-semantic-blue-on-strong',\n  cyan: 'bg-ws-non-semantic-cyan-strong text-ws-non-semantic-cyan-on-strong',\n  teal: 'bg-ws-non-semantic-teal-strong text-ws-non-semantic-teal-on-strong',\n  green: 'bg-ws-non-semantic-green-strong text-ws-non-semantic-green-on-strong',\n};\n\n/** Figma's Sidebar Item `Type=Thumbnail`: a 20px colour tile with a white glyph, as the item icon. */\nconst spaceTile = (color: SpaceColor): RemixiconComponentType => {\n  const SpaceTile = () => (\n    <span\n      aria-hidden=\"true\"\n      className={cn(\n        'rounded-ws-control-md size-ws-11 flex shrink-0 items-center justify-center',\n        TILE[color],\n      )}\n    >\n      <RiFlashlightFill className=\"size-ws-7\" />\n    </span>\n  );\n  return SpaceTile;\n};\n\nconst SPACE_ICON: Record<SpaceColor, RemixiconComponentType> = {\n  purple: spaceTile('purple'),\n  indigo: spaceTile('indigo'),\n  blue: spaceTile('blue'),\n  cyan: spaceTile('cyan'),\n  teal: spaceTile('teal'),\n  green: spaceTile('green'),\n};\n\n/** The workspace sidebar: brand, workspace switcher, pages, spaces and the signed-in account. */\nexport function KanbanSidebar() {\n  const [active, setActive] = useState('explore');\n\n  const links = (\n    <nav aria-label=\"Workspace\" className=\"gap-ws-11 flex flex-col\">\n      <div className=\"flex flex-col\">\n        {navigation.map((item) => (\n          <Sidebar.Item\n            key={item.id}\n            href={`#${item.id}`}\n            icon={item.icon}\n            label={item.label}\n            active={active === item.id}\n            onClick={() => setActive(item.id)}\n          />\n        ))}\n      </div>\n      {spaceGroups.map((group) => (\n        <div\n          key={group.id}\n          role=\"group\"\n          aria-labelledby={`sidebar-${group.id}`}\n          className=\"gap-ws-2 flex flex-col\"\n        >\n          <Sidebar.SectionHeader id={`sidebar-${group.id}`}>{group.label}</Sidebar.SectionHeader>\n          {group.spaces.map((space) => (\n            <Sidebar.Item\n              key={space.id}\n              href={`#${space.id}`}\n              icon={SPACE_ICON[space.color]}\n              label={space.label}\n              active={active === space.id}\n              onClick={() => setActive(space.id)}\n            />\n          ))}\n        </div>\n      ))}\n    </nav>\n  );\n\n  return (\n    <Sidebar>\n      <Sidebar.Header>\n        <Sidebar.Expanded>\n          <div className=\"gap-ws-7 flex flex-col\">\n            <div className=\"gap-ws-7 py-ws-3 pl-ws-5 flex items-center\">\n              <BrandMark />\n              <span className=\"typography-label-strong-sm text-ws-dynamic-secondary-default min-w-0 flex-1 truncate\">\n                Wideset\n              </span>\n              <Sidebar.Trigger />\n            </div>\n            <button\n              type=\"button\"\n              className=\"border-ws-dynamic-secondary-default bg-ws-static-highlight-base shadow-ws-forms-base rounded-ws-control-lg h-ws-19 px-ws-7 hover:border-ws-dynamic-secondary-hover focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default flex w-full items-center border text-left\"\n            >\n              <span className=\"flex min-w-0 flex-1 flex-col\">\n                <span className=\"typography-label-strong-sm text-ws-dynamic-secondary-default truncate\">\n                  {workspace.name}\n                </span>\n                <span className=\"typography-label-sm text-ws-static-subtle truncate\">\n                  {workspace.seats} seats\n                </span>\n              </span>\n              <span className=\"size-ws-11 flex shrink-0 items-center justify-center\">\n                <RiArrowDownSLine aria-hidden=\"true\" className=\"size-ws-9 text-ws-static-strong\" />\n              </span>\n            </button>\n          </div>\n        </Sidebar.Expanded>\n        <Sidebar.Collapsed>\n          <div className=\"py-ws-3 flex items-center\">\n            <Sidebar.Trigger />\n          </div>\n        </Sidebar.Collapsed>\n      </Sidebar.Header>\n\n      <Sidebar.Section scrollable>{links}</Sidebar.Section>\n\n      <Sidebar.Footer>\n        <Sidebar.Expanded>\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            <Avatar initials={account.initials} status=\"online\" />\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-label-sm text-ws-static-subtle truncate\">\n                {account.email}\n              </span>\n            </span>\n            <span className=\"size-ws-11 flex shrink-0 items-center justify-center\">\n              <RiArrowDownSLine aria-hidden=\"true\" className=\"size-ws-9 text-ws-static-strong\" />\n            </span>\n          </button>\n        </Sidebar.Expanded>\n        <Sidebar.Collapsed>\n          <Avatar initials={account.initials} status=\"online\" title={account.name} />\n        </Sidebar.Collapsed>\n      </Sidebar.Footer>\n    </Sidebar>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "1.1.0",
    "commit": "a734f9f0"
  }
}
