{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-reviews",
  "type": "registry:block",
  "title": "Reviews",
  "description": "Customer reviews on a raised page: the average and its spread, the reviews to filter, sort and answer, and a dialog to request one.",
  "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/dropdown-menu.json",
    "https://wideset.co/r/filter-button.json",
    "https://wideset.co/r/form-field.json",
    "https://wideset.co/r/icon-button.json",
    "https://wideset.co/r/illustration.json",
    "https://wideset.co/r/list-item.json",
    "https://wideset.co/r/modal.json",
    "https://wideset.co/r/select.json",
    "https://wideset.co/r/sidebar.json",
    "https://wideset.co/r/text-input.json",
    "https://wideset.co/r/textarea.json",
    "https://wideset.co/r/toast.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/reviews/brand-mark.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/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/reviews/data.ts",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/data.ts",
      "content": "import {\n  type RemixiconComponentType,\n  RiBankCardLine,\n  RiContactsBook3Line,\n  RiHandCoinLine,\n  RiHome5Line,\n  RiInbox2Line,\n  RiKey2Line,\n  RiLineChartLine,\n  RiPieChart2Line,\n  RiPlugLine,\n  RiQuestionLine,\n  RiSettings3Line,\n  RiStarFill,\n  RiStarLine,\n  RiTeamLine,\n} from '@remixicon/react';\n\n/*\n  What Lumen Studio's customers say after a deal closes. Orbit asks the deal's contact for a\n  rating and a few words; the summary counts all 128 answers, the list holds the latest. The\n  average is worked out from the spread: (5×92 + 4×24 + 3×7 + 2×3 + 1×2) / 128 = 4.57.\n*/\n\n/** The product is Orbit; the workspace is Lumen Studio. */\nexport const product = { name: 'Orbit' };\nexport const workspace = { name: 'Lumen Studio', initials: 'LS' };\nexport const account = { name: 'Maya Okafor', email: 'maya@lumenstudio.co', initials: 'MO' };\n\n/** The sample is frozen on this day; a reply written on the page is written today. */\nexport const TODAY = '2026-11-10';\n\nexport type NavLink = {\n  id: string;\n  label: string;\n  icon: RemixiconComponentType;\n  /** The icon while the page is open (a line icon swaps for its fill). */\n  activeIcon?: RemixiconComponentType;\n};\n\nexport const mainLinks: NavLink[] = [\n  { id: 'home', label: 'Home', icon: RiHome5Line },\n  { id: 'inbox', label: 'Inbox', icon: RiInbox2Line },\n  { id: 'customers', label: 'Customers', icon: RiContactsBook3Line },\n  { id: 'deals', label: 'Deals', icon: RiHandCoinLine },\n  { id: 'reviews', label: 'Reviews', icon: RiStarLine, activeIcon: RiStarFill },\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 type Rating = 1 | 2 | 3 | 4 | 5;\nexport const RATINGS: Rating[] = [5, 4, 3, 2, 1];\n\n/** How many reviews gave each rating, over every review Lumen Studio has. */\nexport const spread: Record<Rating, number> = { 5: 92, 4: 24, 3: 7, 2: 3, 1: 2 };\nexport const total = RATINGS.reduce((sum, rating) => sum + spread[rating], 0);\nexport const average = RATINGS.reduce((sum, rating) => sum + rating * spread[rating], 0) / total;\n\nexport type Reply = {\n  /** Who answered for Lumen Studio. */\n  author: string;\n  /** A calendar day. */\n  date: string;\n  text: string;\n};\n\nexport type Review = {\n  id: string;\n  rating: Rating;\n  /** The review in one line. */\n  title: string;\n  text: string;\n  customer: string;\n  /** Who wrote it: the contact on the deal. */\n  person: string;\n  role: string;\n  /** A calendar day. */\n  date: string;\n  /** The deal it followed. */\n  deal: string;\n  reply?: Reply;\n};\n\n/** The latest reviews, newest first. */\nexport const reviews: Review[] = [\n  {\n    id: 'tidewater',\n    rating: 5,\n    title: 'Clear pricing and no surprises in the contract',\n    text: 'We compared three vendors. Lumen Studio was the only one that sent a full quote after the first call, and the contract matched it line for line. Onboarding started the week we signed.',\n    customer: 'Tidewater Energy',\n    person: 'Grace Okonkwo',\n    role: 'Procurement lead',\n    date: '2026-11-06',\n    deal: 'Team plan, 60 seats',\n  },\n  {\n    id: 'marlow',\n    rating: 4,\n    title: 'Good product, slow start on the paperwork',\n    text: 'The demo answered every question we had and Jonas knew our business. The security questionnaire took two weeks to come back, which pushed our start date.',\n    customer: 'Marlow & Finch',\n    person: 'Theo Marlow',\n    role: 'Partner',\n    date: '2026-11-03',\n    deal: 'Two-year renewal',\n    reply: {\n      author: account.name,\n      date: '2026-11-04',\n      text: 'Thank you, Theo. Two weeks is too long, and a different team handles questionnaires now. The next one will reach you within three working days.',\n    },\n  },\n  {\n    id: 'cobalt',\n    rating: 2,\n    title: 'Sold one thing, delivered another',\n    text: 'We were told single sign-on was part of our plan. It was an add-on, and we found out after signing. Support corrected the invoice, but it cost us a month.',\n    customer: 'Cobalt Security',\n    person: 'Farah Qureshi',\n    role: 'Head of security',\n    date: '2026-10-28',\n    deal: 'Annual plan, 45 seats',\n  },\n  {\n    id: 'northwind',\n    rating: 5,\n    title: 'They understood a regulated buyer',\n    text: 'Priya brought the compliance documents to the second meeting without being asked. The rollout across four clinics was planned with our IT team, not handed to us.',\n    customer: 'Northwind Health',\n    person: 'Samuel Adeyemi',\n    role: 'IT director',\n    date: '2026-10-21',\n    deal: 'Annual plan, 120 seats',\n    reply: {\n      author: account.name,\n      date: '2026-10-22',\n      text: 'Thank you, Samuel. I have passed this on to Priya and to the onboarding team.',\n    },\n  },\n  {\n    id: 'halcyon',\n    rating: 5,\n    title: 'Fast, careful, and honest about what they could not do',\n    text: 'Two features we asked for were not on the roadmap and we were told so in the first week. Everything that was promised arrived on the dates in the plan.',\n    customer: 'Halcyon Freight',\n    person: 'Dana Whitfield',\n    role: 'Head of operations',\n    date: '2026-10-14',\n    deal: 'Annual plan, 80 seats',\n  },\n  {\n    id: 'kestrel',\n    rating: 4,\n    title: 'A straightforward purchase',\n    text: 'Three calls from first contact to signature. We would have liked a trial with our own data before committing, but the pilot terms made up for it.',\n    customer: 'Kestrel Analytics',\n    person: 'Ines Duarte',\n    role: 'Operations director',\n    date: '2026-10-09',\n    deal: 'Team plan, 30 seats',\n  },\n  {\n    id: 'juniper',\n    rating: 3,\n    title: 'Fine, once we got past procurement',\n    text: 'The team was helpful, but the order form went through four versions before legal on both sides agreed. A standard set of terms for firms like ours would have saved weeks.',\n    customer: 'Juniper Legal',\n    person: 'Claire Monroe',\n    role: 'Managing partner',\n    date: '2026-09-30',\n    deal: 'Annual plan, 25 seats',\n    reply: {\n      author: account.name,\n      date: '2026-10-01',\n      text: 'That is fair, Claire. We now start legal firms on a standard order form, and yours was the reason.',\n    },\n  },\n];\n\nexport type SortKey = 'newest' | 'highest' | 'lowest';\n\nexport const sortOptions: { value: SortKey; label: string }[] = [\n  { value: 'newest', label: 'Newest' },\n  { value: 'highest', label: 'Highest' },\n  { value: 'lowest', label: 'Lowest' },\n];\n\n/** A deal that closed and has not been asked about yet. */\nexport type ReviewRequest = {\n  id: string;\n  customer: string;\n  /** The contact on the deal: who the request goes to. */\n  person: string;\n  deal: string;\n  /** The day the deal closed. */\n  closed: string;\n};\n\nexport const reviewRequests: ReviewRequest[] = [\n  {\n    id: 'atlas',\n    customer: 'Atlas Robotics',\n    person: 'Henrik Lund',\n    deal: 'Team plan, 45 seats',\n    closed: '2026-11-05',\n  },\n  {\n    id: 'halcyon-expansion',\n    customer: 'Halcyon Freight',\n    person: 'Dana Whitfield',\n    deal: 'Expansion, 40 seats',\n    closed: '2026-11-02',\n  },\n  {\n    id: 'northwind-clinics',\n    customer: 'Northwind Health',\n    person: 'Samuel Adeyemi',\n    deal: 'Two new clinics, 30 seats',\n    closed: '2026-10-29',\n  },\n];\n"
    },
    {
      "path": "src/blocks/reviews/empty-state.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/empty-state.tsx",
      "content": "'use client';\n\n// TODO(custom): empty state (drawing, title, line, actions); Wideset has no EmptyState.\nimport { Illustration } from '@/components/ui/wideset/illustration/Illustration';\nimport { type IllustrationName } from '@/components/ui/wideset/illustration/Illustration.types';\nimport type { ReactNode } from 'react';\n\n/*\n  The prototype for a Wideset EmptyState: one design for every region with nothing to show, copied\n  byte for byte into each block that needs one. A first run (nothing here yet) takes a drawing and\n  the ways in; a state the user caused (no search results) takes no drawing and the one way back.\n*/\n\ntype EmptyStateProps = {\n  /** A drawing, only for a first run: nothing has been added yet. */\n  illustration?: IllustrationName;\n  /** What is missing, in a few words: \"No customers yet\". */\n  title: ReactNode;\n  /** One sentence: what will appear here, or why nothing does. */\n  description: ReactNode;\n  /** One or two `size=\"sm\"` buttons: the ways in, or the way back. */\n  children?: ReactNode;\n};\n\n/** What a region shows with nothing in it: centred in the region, the text read first. */\nexport function EmptyState({ illustration, title, description, children }: EmptyStateProps) {\n  return (\n    <div className=\"gap-ws-12 flex flex-col items-center text-center\">\n      {illustration && <Illustration illustration={illustration} size=\"sm\" />}\n      {/* Announced when it replaces the rows, as after a search. */}\n      <div role=\"status\" className=\"gap-ws-3 flex max-w-[26rem] flex-col\">\n        <h2 className=\"typography-label-strong-md text-ws-static-strong\">{title}</h2>\n        <p className=\"typography-body-md text-ws-static-base\">{description}</p>\n      </div>\n      {children && <div className=\"gap-ws-5 flex flex-wrap justify-center\">{children}</div>}\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/reviews/format.ts",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/format.ts",
      "content": "// One locale for the whole screen; swap it for the user's.\nconst LOCALE = 'en-US';\n\n// Dates are calendar days (`2026-11-06`), parsed as UTC midnight: format them in UTC too.\nconst date = new Intl.DateTimeFormat(LOCALE, {\n  day: 'numeric',\n  month: 'short',\n  year: 'numeric',\n  timeZone: 'UTC',\n});\nconst count = new Intl.NumberFormat(LOCALE);\nconst average = new Intl.NumberFormat(LOCALE, {\n  minimumFractionDigits: 1,\n  maximumFractionDigits: 1,\n});\nconst share = new Intl.NumberFormat(LOCALE, { style: 'percent', maximumFractionDigits: 0 });\n\n/** Nov 6, 2026. */\nexport const formatDate = (iso: string) => date.format(new Date(iso));\nexport const formatCount = (value: number) => count.format(value);\n/** A rating to one decimal: 4.6. */\nexport const formatAverage = (value: number) => average.format(value);\n/** A share of the whole: 72%. */\nexport const formatShare = (value: number) => share.format(value);\n"
    },
    {
      "path": "src/blocks/reviews/index.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/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 { cn } from '@/lib/wideset/utils';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { ToastProvider, useToast } from '@/components/ui/wideset/toast/Toast.context';\nimport { useId, useState } from 'react';\n\nimport {\n  account,\n  type Review,\n  type ReviewRequest,\n  reviewRequests,\n  reviews as reviewsAtStart,\n  type SortKey,\n  TODAY,\n} from './data';\nimport { EmptyState } from './empty-state';\nimport { PageHeader } from './page-header';\nimport { RatingSummary } from './rating-summary';\nimport { RequestReviewModal } from './request-review-modal';\nimport { ReviewFilters } from './review-filters';\nimport { ReviewItem } from './review-item';\nimport { ReviewsSidebar } from './sidebar';\n\n/** One column of the page: the header and the body share its edges. */\nconst COLUMN = 'px-ws-14 mx-auto w-full max-w-[80rem]';\n/** The summary and every review share two columns: who (or the average) left, what right. */\nconst ROW = 'gap-x-ws-16 gap-y-ws-7 grid grid-cols-1 lg:grid-cols-[18rem_minmax(0,1fr)]';\n/** How many reviews the list shows before \"Show more\". */\nconst PAGE = 5;\n\nconst newest = (a: Review, b: Review) => b.date.localeCompare(a.date);\nconst ORDER: Record<SortKey, (a: Review, b: Review) => number> = {\n  newest,\n  highest: (a, b) => b.rating - a.rating || newest(a, b),\n  lowest: (a, b) => a.rating - b.rating || newest(a, b),\n};\n\n/** The page: the summary, then the reviews to filter, sort and answer. */\nfunction ReviewsPage() {\n  const sidebarId = useId();\n  const { showToast } = useToast();\n  const [collapsed, setCollapsed] = useState(false);\n  const [reviews, setReviews] = useState(reviewsAtStart);\n  const [requests, setRequests] = useState(reviewRequests);\n  const [ratings, setRatings] = useState<string[]>([]);\n  const [sort, setSort] = useState<SortKey>('newest');\n  const [shown, setShown] = useState(PAGE);\n  const [requesting, setRequesting] = useState(false);\n\n  const matching = reviews\n    .filter((review) => ratings.length === 0 || ratings.includes(String(review.rating)))\n    .sort(ORDER[sort]);\n\n  // Anything that changes the rows goes back to the first few.\n  const filter = (next: string[]) => {\n    setRatings(next);\n    setShown(PAGE);\n  };\n\n  const reply = (id: string, text: string) =>\n    setReviews((all) =>\n      all.map((review) =>\n        review.id === id\n          ? { ...review, reply: { author: account.name, date: TODAY, text } }\n          : review,\n      ),\n    );\n\n  // A customer is asked once: the deal leaves the list the request is picked from.\n  const send = (request: ReviewRequest) => {\n    setRequests((all) => all.filter((item) => item.id !== request.id));\n    setRequesting(false);\n    showToast({\n      status: 'success',\n      content: `Review request sent to ${request.customer}`,\n    });\n  };\n\n  const copyLink = (id: string) => {\n    const { origin, pathname, search } = window.location;\n    void navigator.clipboard?.writeText(`${origin}${pathname}${search}#${id}`).catch(() => {});\n    showToast({ content: 'Link copied' });\n  };\n\n  return (\n    <AppShell className=\"ws-block-utility\" direction=\"inset\">\n      <ReviewsSidebar id={sidebarId} collapsed={collapsed} onCollapsedChange={setCollapsed} />\n      <AppShell.Main>\n        <div className=\"h-ws-18 border-ws-static-base flex shrink-0 items-center border-b\">\n          {/* The bar belongs to the surround: it runs edge to edge. The sidebar's toggle is pulled\n              left so its glyph, not its box, sits 20px from the edge; the crumbs follow it. */}\n          <div className=\"gap-ws-5 px-ws-11 flex w-full items-center\">\n            <IconButton\n              icon={RiSideBarLine}\n              variant=\"secondary\"\n              preset=\"ghost\"\n              size=\"sm\"\n              iconClassName=\"text-ws-static-subtle size-ws-9\"\n              aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}\n              aria-expanded={!collapsed}\n              aria-controls={sidebarId}\n              onClick={() => setCollapsed(!collapsed)}\n              className=\"-ml-ws-5\"\n            />\n            <Breadcrumbs separator=\"arrow\">\n              <Breadcrumbs.Item>Reviews</Breadcrumbs.Item>\n            </Breadcrumbs>\n          </div>\n        </div>\n\n        {/* The page scrolls inside the card, so the card's corners stay put. */}\n        <div className=\"ws-scrollbar min-h-0 flex-1 overflow-y-auto\">\n          <div className={cn(COLUMN, 'gap-ws-12 pt-ws-14 pb-ws-16 flex flex-col')}>\n            <PageHeader canRequest={requests.length > 0} onRequest={() => setRequesting(true)} />\n\n            <div className=\"gap-ws-14 flex flex-col\">\n              <RatingSummary className={ROW} />\n\n              <section aria-label=\"Reviews\" className=\"gap-ws-7 flex flex-col\">\n                <ReviewFilters\n                  ratings={ratings}\n                  onRatingsChange={filter}\n                  sort={sort}\n                  onSortChange={setSort}\n                />\n                {/* Rows on the white, split by lines: no card around the list or around a row. */}\n                <div className=\"flex flex-col\">\n                  {matching.slice(0, shown).map((review) => (\n                    <ReviewItem\n                      key={review.id}\n                      review={review}\n                      className={cn(ROW, 'border-ws-static-subtle py-ws-12 border-t')}\n                      onReply={(text) => reply(review.id, text)}\n                      onCopyLink={() => copyLink(review.id)}\n                      onReport={() =>\n                        showToast({\n                          content: 'Review reported. Orbit will check it against the review rules.',\n                        })\n                      }\n                    />\n                  ))}\n                  {matching.length === 0 && (\n                    <div className=\"border-ws-static-subtle py-ws-16 border-t\">\n                      <EmptyState\n                        title=\"No reviews with this rating\"\n                        description=\"None of the latest reviews match the ratings you picked.\"\n                      >\n                        <Button\n                          size=\"sm\"\n                          variant=\"secondary\"\n                          preset=\"border\"\n                          onClick={() => filter([])}\n                        >\n                          Clear filter\n                        </Button>\n                      </EmptyState>\n                    </div>\n                  )}\n                  {matching.length > shown && (\n                    <div className=\"border-ws-static-subtle pt-ws-9 border-t\">\n                      <Button\n                        size=\"sm\"\n                        variant=\"secondary\"\n                        preset=\"border\"\n                        onClick={() => setShown(shown + PAGE)}\n                      >\n                        Show more reviews\n                      </Button>\n                    </div>\n                  )}\n                </div>\n              </section>\n            </div>\n          </div>\n        </div>\n      </AppShell.Main>\n\n      <RequestReviewModal\n        open={requesting}\n        onOpenChange={setRequesting}\n        requests={requests}\n        onSend={send}\n      />\n    </AppShell>\n  );\n}\n\n/**\n * Reviews (Inset direction): what customers say about the company after a deal closes, on the\n * raised page beside the workspace sidebar. The summary comes first, the average and its spread;\n * under it the reviews to filter, sort and answer, as rows on the white. The summary and the rows\n * share two columns, so the page reads down two edges: who, and what they said.\n */\nexport default function Reviews() {\n  return (\n    <ToastProvider position=\"bottom-center\">\n      <ReviewsPage />\n    </ToastProvider>\n  );\n}\n"
    },
    {
      "path": "src/blocks/reviews/page-header.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/page-header.tsx",
      "content": "'use client';\n\n// TODO(custom): page header (title, a line of description, the action on the right); no PageHeader in Wideset.\nimport { RiMailSendLine } from '@remixicon/react';\nimport { Button } from '@/components/ui/wideset/button/Button';\n\nimport { workspace } from './data';\n\n/**\n * The page's title, what it holds, and its one action. Asking for a review is something the page\n * offers, not what it is for (that is reading and answering), so the button is secondary.\n */\nexport function PageHeader({\n  canRequest,\n  onRequest,\n}: {\n  /** Whether a closed deal is still waiting to be asked about. */\n  canRequest: boolean;\n  onRequest: () => void;\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\">Reviews</h1>\n        <p className=\"typography-body-md text-ws-static-subtle\">\n          What customers say about {workspace.name} after a deal closes.\n        </p>\n      </div>\n      <Button\n        variant=\"secondary\"\n        preset=\"border\"\n        size=\"sm\"\n        disabled={!canRequest}\n        onClick={onRequest}\n      >\n        <Button.Icon icon={RiMailSendLine} />\n        Request a review\n      </Button>\n    </header>\n  );\n}\n"
    },
    {
      "path": "src/blocks/reviews/people.assets.ts",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/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/xAAbAQACAwEBAQAAAAAAAAAAAAADBAACBQYHAf/EAC0RAAIBAwIDBwMFAAAAAAAAAAECAAMEEQUhEjFBBhMiUWFxwRSB0UKRobHw/9oADAMBAAIRAxEAPwC1q4a8a4TWTPW57PFFvPoYbU44sJQkZJPcBTJqXVts0vDekT5KEFtG/swfrUPQVlHqb1tm6peUxbluxISNyRhWFKzwc49Ksqk7CI3l/StVy538pou+dZtK2IoLs4PIUM7mQVf9U56d6mab1Sy65bbglfZcqSsFKgPPBr5/PTVhWFOKPGQCa5Gub8Z0mO841vG1W1RGaN3JxOfHaN+PdRib1kdX9KRZD0dy5tdsz+4DkYz357van2yazsmoW90C4sOkDJSFjcPuK+dfzqlrUdyj4Z9aXQb1NtryHoshxlxBBCkrINfDRMunaI8XiTafSNKwoZB4oYNY+6cfELPtDvyl43zWXXEpSveAWxnnjxrWtvns3GI1JjuodZdTuStCgpJHoRQmUjYzfs72ldLxUzFua9Qa7mqxycoCjQiaIfXsbUrBOATgVJJlX4j9XMTr2i0tIV2kMbXCDwSeRWfXlFec/Tjwz31MuqNxkTtXXV99stqLysJIOcZ4znmoElDkh5Ccnk45pykuFzPPNTrmrcsT54gm23Zb6Go7SlvHgADJNS6F0x1HMjl3sAgAbglR5NW90w6bR4MSNLebCpLwCio87ftV6vaWYjRE7U7jisy41JlJFIco/aaMrKGrnc9BMN3TQ17sjZckRiWs7lFBzUdCt6yMKHofCtl6nsjJjuJKOCD4VnDXekUwQqbGQUAfuSBwaJZ6gavhqDBgdQ0n6ccdI5EgpKm1EgAYPePCtT/DV1OVLZOlrg6N7Q3RVHjjxTWUfqJ27gfE1YvRi6R7Try2uSWnFoUsNpUjjaVcc/zin6q5WL6TcNRuVwdjsZv9Ksih0naV9Io4Gk56HOGiXP2n7UaqilipJiYF6uPyHdbXYvqbJDpA7PuA/vUZ0jFFx1RbI6uUOPJBHp31eXxMaOmM3Ru/gMCA8lLASjO8L5JJHdzVa9ILKq539ExAyYL7ZUnHgoK5/H5oz1AlAt6Tgrq1cah3Z6nP25zTNraucSJ20NUBpmOkbW5BO5YH27hUmtGtHrw04idDYZW14sKKkke9Q6/9LHtRIVKbdfy8jZtS+UJQPTg8092CwJ0owuOdqn1oyoH6vAjjNc87KKYIO/tOiRXNU5G3v8Rk1TqGbcZK4tmhMOqA+tTyiAn+KqbV7E4RXWJ6Yit6TzHUSB6EGpvBgm7yr1BQgrkvhSQQraU5GNw9RUYuXTd/TcZciRIWsFO3YVlQ4Hf3DmiUSiAb7+0DXWq5O23v8Ymc0JUl1eOcEjBq5Phx+XX1BZblR+23NqLeRlKFjkE+2aqa5NCLNwk5DmVfb6iP6VqT4aNHzrZGfvMhplUaYnDaik9ogg8+1dFVcFM+cwtHt2a8UD9O5mj2+6jxRDdHilJ384aAqhmgqqSSK650mxrPT0q1PrLaXcELAyUkHNZQs0af0o1rIiTrW98lcSI7S1EDnf8AQ57c1tRQqK610TB1pbDDlKUy4FBSJDQG9BBzwTUIDKVPIzOvbEVyKqbOvL8SF3PqXLbtcSyMvNxFPklUhzADaRgE58TyMCnCJdFspkSbe9EfZaZwe1ALiiR3leef4pok2Bm23dq33ENyEhIKVlPeDx7cirGtOobNbLcqPebbbJBQkIQp+NjcnuzuAIyB4EZ9axxSUnhY4IizF0JwP9/Uzk9qKfbL0Lg6/EjOtuFeWedwPgTnke1LdZa2dvNoaVs2pcBUPIjHeD5U+dU7rZtRzEt2+0wY0flSwwyEpwCT3+Pf5AUzaT0eOpUuRHU/8tb4DSEr2D6iFE8DyztVzRloqzDEADVJNMczKr6caEk6/wBWxnpUB/8ARpW9HbI5DZQnOCfA/wB62/Z7WzaLexDYTtbaSEjnP58aR6b0xbdKW8QLYwGY+7eUg5yogAn8U+JrUZszR0+wW0QjOWPMwxAo0UWmjBVZoTlBNdNDZjPS19mw0txfkkZqAZlWYKMsdonVRSlBIJJwAMk+Qqa2rQT8gpcnOdkg/wC2jlR9+4fmnTW3T2FdtFyoUCMkSmFJkIAGVOlOcpJ7zkE49cUU0X4SwHKYtxr1tTcU0PET16D7/iZp1C9Hvt5cVHcC2m0BtLie4qGTwfek1x1OiHblRbhHSVDgrI4PrTobN8oFFoYCfDHNNd8jolxwHGwSR5VzT1uJiWHOFOWJbrKo1LqFiXvYhtJwvjKU44qRdFdTW/Td1ukW5yUx/wBQS0W3XDhG5G7gnwzv/FNk6whCisNYyeOKSRNFzb7cWIMKMt+U+oJQ2kck/wBB6+FO0KoGAoiRZ6dTvuo/aajiSmJrCH4zzbzCxlLjagpKvsRSkVI9NdPGNOaVtdmwlS4rQSpYGMq5Kj7qJNHSNGPhO+O4Ck+Ch3Vsmi2Ia27QW9Tar4T/ABI0mjBxR0q3SoKsPtFIH+ocik4NBII5zbp1UqrxIcj0jzpzT72oJvZoO1hvBdX5DyHqatJmzxrSlLcZlKGsDuHP80RoW3CFp+Orbhb+XVHzz3fjFP7mFpQT5lJrQpUwq56zz/WNRe5rtTB8KnAHzELaQ5jP80oTltQUPeiktlh1SPDvFGnuowmPIjqrppadUuLlMuKgXFf7nWk5Ss+akeP3GDVbS+id8TJQf8FKbTxuS4U59iKvTOPPNe7RYP7iKRr6fQrHiYYPpH7fU7igOFWyPWUOr4fZ90dQqZNjQmU+DSS4r27h75qxNJ9NrBoZClwGC7NcG1cp47nFDyz4D0GKmaipYwSTRak/UPSrULGjQOUG/nK3GoV7gYdtvIbRKIyFHcoZJNKEMJSg4AAr2PqA8AK6+5sVHb/5F01E4ln2pp9gpWgHcOePCqlvlt/Spqmx/lq5TVzSXgqYIoOCEb1HyA/9NVxrVjfHafA+rG/2JoVZAVmto141vcKM+FtjP//Z',\n};\n"
    },
    {
      "path": "src/blocks/reviews/person-avatar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/person-avatar.tsx",
      "content": "'use client';\n\nimport type { AvatarProps } from '@/components/ui/wideset/avatar/Avatar.types';\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\n\nimport { PHOTOS } from './people.assets';\n\ntype PersonAvatarProps = Pick<\n  AvatarProps,\n  'size' | 'shape' | 'status' | 'color' | 'className' | 'title' | 'aria-hidden' | 'aria-label'\n> & {\n  /** The person's full name: the key their photo is filed under. */\n  name: string;\n  initials: string;\n  /** Leave empty beside the person's name; pass the name where the avatar stands alone. */\n  alt?: string;\n};\n\n/**\n * A person's avatar: their photo when the sample people have one, otherwise their initials in\n * their colour. A real product mixes the two, so every place the block draws a person asks here\n * and the choice is made once. The initials stay as the fallback if the image fails to load.\n */\nexport function PersonAvatar({ name, initials, color, alt = '', ...props }: PersonAvatarProps) {\n  const photo = PHOTOS[name];\n  return photo ? (\n    <Avatar src={photo} alt={alt} initials={initials} {...props} />\n  ) : (\n    <Avatar initials={initials} color={color} {...props} />\n  );\n}\n"
    },
    {
      "path": "src/blocks/reviews/rating-spread.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/rating-spread.tsx",
      "content": "'use client';\n\n// TODO(custom): bar list (label, a 4px bar, the share); no BarList in Wideset.\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { Rating } from './data';\nimport { formatShare } from './format';\n\ntype RatingSpreadProps = {\n  /** How many reviews gave each rating. */\n  counts: Record<Rating, number>;\n  /** The ratings in the order to list them: five stars first. */\n  ratings: Rating[];\n  className?: string;\n};\n\n/**\n * How the ratings spread, from five stars to one: each row is a rating, its share of all reviews\n * as a bar on a track, and the share in figures. The label is words, not stars: the stars are the\n * average's visual and the bar is this row's. Bars are neutral and 4px, the thickness and track\n * of `ProgressBar`, and a low rating's bar is the same grey as a high one's.\n */\nexport function RatingSpread({ counts, ratings, className }: RatingSpreadProps) {\n  const total = ratings.reduce((sum, rating) => sum + counts[rating], 0) || 1;\n\n  return (\n    <ul aria-label=\"Reviews by rating\" className={cn('gap-ws-5 flex flex-col', className)}>\n      {ratings.map((rating) => {\n        const share = counts[rating] / total;\n        return (\n          <li key={rating} className=\"typography-label-sm gap-ws-7 flex items-center\">\n            <span className=\"text-ws-static-base w-[3.25rem] shrink-0\">\n              {rating} {rating === 1 ? 'star' : 'stars'}\n            </span>\n            <svg aria-hidden className=\"h-ws-3 min-w-0 flex-1\">\n              <rect\n                width=\"100%\"\n                height=\"100%\"\n                rx=\"2\"\n                className=\"fill-(--ws-dynamic-stroke-secondary-default)\"\n              />\n              <rect\n                width={`${share * 100}%`}\n                height=\"100%\"\n                rx=\"2\"\n                className=\"fill-(--ws-semantic-stroke-neutral)\"\n              />\n            </svg>\n            <span className=\"text-ws-static-strong w-[2.5rem] shrink-0 text-right tabular-nums\">\n              {formatShare(share)}\n            </span>\n          </li>\n        );\n      })}\n    </ul>\n  );\n}\n"
    },
    {
      "path": "src/blocks/reviews/rating-summary.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/rating-summary.tsx",
      "content": "'use client';\n\nimport { average, RATINGS, spread, total } from './data';\nimport { formatAverage, formatCount } from './format';\nimport { RatingSpread } from './rating-spread';\nimport { StarRating } from './star-rating';\n\n/**\n * The summary over the list: the average on the left, the spread beside it, in the list's own two\n * columns so the figure stands over the customers and the bars over the reviews. One visual per\n * value: the average has its stars, each share has its bar, and nothing is boxed.\n */\nexport function RatingSummary({ className }: { className?: string }) {\n  return (\n    <section aria-label=\"Rating summary\" className={className}>\n      <div className=\"gap-ws-3 flex flex-col\">\n        <div className=\"gap-ws-7 flex items-center\">\n          <p className=\"typography-title-md text-ws-static-strong tabular-nums\">\n            {formatAverage(average)}\n          </p>\n          <StarRating value={average} size=\"md\" />\n        </div>\n        <p className=\"typography-body-md text-ws-static-subtle tabular-nums\">\n          from {formatCount(total)} reviews\n        </p>\n      </div>\n      <RatingSpread counts={spread} ratings={RATINGS} className=\"max-w-[28rem]\" />\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/reviews/reply-form.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/reply-form.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { Textarea } from '@/components/ui/wideset/textarea/Textarea';\nimport { type FormEvent, useEffect, useRef, useState } from 'react';\n\ntype ReplyFormProps = {\n  /** Who wrote the review: the reply is addressed to them. */\n  to: string;\n  onReply: (text: string) => void;\n  onCancel: () => void;\n};\n\n/**\n * The reply field that opens under a review, in place of its Reply button. It takes the caret as\n * it opens; Esc or Cancel puts the button back. Post reply is filled, the only filled button on\n * the page while a reply is open, and disabled until there is something to post.\n */\nexport function ReplyForm({ to, onReply, onCancel }: ReplyFormProps) {\n  const field = useRef<HTMLTextAreaElement>(null);\n  const [text, setText] = useState('');\n  const empty = !text.trim();\n\n  useEffect(() => field.current?.focus(), []);\n\n  const post = (event: FormEvent) => {\n    event.preventDefault();\n    if (!empty) onReply(text.trim());\n  };\n\n  return (\n    <form onSubmit={post} className=\"gap-ws-5 flex max-w-[40rem] flex-col\">\n      <Textarea\n        ref={field}\n        size=\"sm\"\n        rows={3}\n        resize=\"none\"\n        aria-label={`Reply to ${to}`}\n        placeholder={`Reply to ${to.split(' ')[0]}`}\n        value={text}\n        onChange={(event) => setText(event.target.value)}\n        onKeyDown={(event) => {\n          if (event.key === 'Escape') onCancel();\n        }}\n      />\n      <div className=\"gap-ws-5 flex items-center\">\n        <p className=\"typography-body-md text-ws-static-subtle min-w-0 flex-1\">\n          Replies are public and show under the review.\n        </p>\n        <Button size=\"sm\" variant=\"secondary\" preset=\"ghost\" onClick={onCancel}>\n          Cancel\n        </Button>\n        <Button type=\"submit\" size=\"sm\" disabled={empty}>\n          Post reply\n        </Button>\n      </div>\n    </form>\n  );\n}\n"
    },
    {
      "path": "src/blocks/reviews/request-form.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/request-form.tsx",
      "content": "'use client';\n\nimport { FormField } from '@/components/ui/wideset/form-field/FormField';\nimport { Select } from '@/components/ui/wideset/select/Select';\nimport { Textarea } from '@/components/ui/wideset/textarea/Textarea';\nimport { type FormEvent, useState } from 'react';\n\nimport type { ReviewRequest } from './data';\nimport { formatDate } from './format';\nimport { RequestPreview } from './request-preview';\n\ntype RequestFormProps = {\n  /** The form's id: the submit button sits in the modal's footer and points at it with `form`. */\n  id: string;\n  /** The closed deals nobody has been asked about yet. */\n  requests: ReviewRequest[];\n  /** Called with the chosen deal and the note once a customer is picked. */\n  onSend: (request: ReviewRequest, message: string) => void;\n};\n\n/**\n * Asking for a review: pick the customer, add a note or not, see what they will get. The customer\n * is the one thing it cannot go without: sending without one says so at the field. Under the\n * field, who the request goes to, so nobody has to open the deal to check.\n */\nexport function RequestForm({ id, requests, onSend }: RequestFormProps) {\n  const [requestId, setRequestId] = useState('');\n  const [message, setMessage] = useState('');\n  const [error, setError] = useState<string>();\n  const request = requests.find((item) => item.id === requestId);\n\n  const send = (event: FormEvent) => {\n    event.preventDefault();\n    if (request) onSend(request, message.trim());\n    else {\n      setError('Choose a customer.');\n      document.getElementById(`${id}-customer`)?.focus();\n    }\n  };\n\n  return (\n    <form id={id} noValidate onSubmit={send} className=\"gap-ws-11 flex flex-col\">\n      <FormField\n        label=\"Customer\"\n        htmlFor={`${id}-customer`}\n        errorText={error}\n        helperText={\n          request\n            ? `Goes to ${request.person}, the contact on ${request.deal}, closed ${formatDate(request.closed)}.`\n            : 'Customers with a closed deal and no review yet.'\n        }\n      >\n        <Select\n          id={`${id}-customer`}\n          name=\"customer\"\n          className=\"w-full\"\n          options={requests.map((item) => ({ value: item.id, label: item.customer }))}\n          placeholder=\"Choose a customer\"\n          required\n          value={requestId}\n          onValueChange={(value) => {\n            setRequestId(value);\n            setError(undefined);\n          }}\n          variant={error ? 'danger' : 'primary'}\n        />\n      </FormField>\n      <FormField label=\"Message\" suffix=\"(optional)\" htmlFor={`${id}-message`}>\n        <Textarea\n          id={`${id}-message`}\n          name=\"message\"\n          rows={3}\n          resize=\"none\"\n          placeholder=\"Add a line of your own\"\n          value={message}\n          onChange={(event) => setMessage(event.target.value)}\n        />\n      </FormField>\n      <FormField label=\"What the customer sees\">\n        <RequestPreview message={message} />\n      </FormField>\n    </form>\n  );\n}\n"
    },
    {
      "path": "src/blocks/reviews/request-preview.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/request-preview.tsx",
      "content": "'use client';\n\n// TODO(custom): an outlined frame on the modal's surface; Card paints the page's container fill, which in dark mode is a step darker than a modal.\nimport { useId, useState } from 'react';\n\nimport { workspace } from './data';\nimport { StarRatingInput } from './star-rating';\n\n/**\n * What the customer gets: the question, the note when there is one, and the stars to answer with.\n * The stars work, so whoever sends the request can try what they are asking for; the rating picked\n * here stays here. One outline and no fill: the only frame inside the modal.\n */\nexport function RequestPreview({ message }: { message: string }) {\n  const name = useId();\n  const [rating, setRating] = useState(0);\n  const question = `How was working with ${workspace.name}?`;\n\n  return (\n    <div className=\"border-ws-static-base rounded-ws-container-md gap-ws-7 p-ws-9 flex flex-col border\">\n      <div className=\"gap-ws-3 flex flex-col\">\n        <p className=\"typography-label-strong-md text-ws-static-strong\">{question}</p>\n        {message.trim() && (\n          <p className=\"typography-body-md text-ws-static-base whitespace-pre-line\">\n            {message.trim()}\n          </p>\n        )}\n      </div>\n      {/* Pulled left by the stars' own padding, so the first star sits on the text's edge. */}\n      <StarRatingInput\n        name={name}\n        label={question}\n        value={rating}\n        onValueChange={setRating}\n        className=\"-ml-ws-1 self-start\"\n      />\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/reviews/request-review-modal.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/request-review-modal.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { Modal } from '@/components/ui/wideset/modal/Modal';\nimport { useId } from 'react';\n\nimport { type ReviewRequest, workspace } from './data';\nimport { RequestForm } from './request-form';\n\ntype RequestReviewModalProps = {\n  open: boolean;\n  onOpenChange: (open: boolean) => void;\n  requests: ReviewRequest[];\n  onSend: (request: ReviewRequest, message: string) => void;\n};\n\n/**\n * \"Request a review\": a short form over the page. The form lives in the body and the actions in\n * the footer, the submit button pointing at the form by id; the modal's one filled button names\n * what it does. The form is unmounted with the modal, so it opens empty every time.\n */\nexport function RequestReviewModal({\n  open,\n  onOpenChange,\n  requests,\n  onSend,\n}: RequestReviewModalProps) {\n  const formId = useId();\n\n  return (\n    <Modal open={open} onOpenChange={onOpenChange}>\n      <Modal.Content className=\"ws-block-utility\">\n        <Modal.Header>\n          <Modal.Title>Request a review</Modal.Title>\n          <Modal.Description>\n            Orbit e-mails the contact on the deal a link to rate {workspace.name} and write a few\n            words.\n          </Modal.Description>\n        </Modal.Header>\n        <Modal.Body>\n          <RequestForm id={formId} requests={requests} onSend={onSend} />\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 type=\"submit\" form={formId}>\n            Send request\n          </Button>\n        </Modal.Footer>\n      </Modal.Content>\n    </Modal>\n  );\n}\n"
    },
    {
      "path": "src/blocks/reviews/review-filters.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/review-filters.tsx",
      "content": "'use client';\n\nimport { FilterButton } from '@/components/ui/wideset/filter-button/FilterButton';\nimport { Select } from '@/components/ui/wideset/select/Select';\n\nimport { RATINGS, type SortKey, sortOptions } from './data';\n\nconst ratingOptions = RATINGS.map((rating) => ({\n  value: String(rating),\n  label: `${rating} ${rating === 1 ? 'star' : 'stars'}`,\n}));\n\ntype ReviewFiltersProps = {\n  /** The ratings to show, as the filter holds them; none means all. */\n  ratings: string[];\n  onRatingsChange: (ratings: string[]) => void;\n  sort: SortKey;\n  onSortChange: (sort: SortKey) => void;\n};\n\n/**\n * The bar over the list: narrow by rating on the left, order on the right. The sort is a bordered\n * `Select` so its chevron shows at rest: a ghost one hides it until hover.\n */\nexport function ReviewFilters({\n  ratings,\n  onRatingsChange,\n  sort,\n  onSortChange,\n}: ReviewFiltersProps) {\n  return (\n    <div className=\"gap-ws-5 flex flex-wrap items-center\">\n      <FilterButton\n        label=\"Rating\"\n        placeholder=\"Rating\"\n        options={ratingOptions}\n        value={ratings}\n        onChange={onRatingsChange}\n        clearFilterAriaLabel=\"Clear rating filter\"\n      />\n      <Select\n        size=\"sm\"\n        preset=\"border\"\n        aria-label=\"Sort reviews\"\n        options={sortOptions}\n        value={sort}\n        onValueChange={(value) => onSortChange(value as SortKey)}\n        className=\"ml-auto w-auto\"\n      />\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/reviews/review-item.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/review-item.tsx",
      "content": "'use client';\n\n// TODO(custom): review (who wrote it and after which deal, the stars, a title, the text, the reply); Wideset has no Review or Comment component.\nimport { RiHandCoinLine, RiReplyLine } from '@remixicon/react';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { useId, useState } from 'react';\n\nimport type { Review } from './data';\nimport { formatDate } from './format';\nimport { ReplyForm } from './reply-form';\nimport { ReviewMenu } from './review-menu';\nimport { ReviewReply } from './review-reply';\nimport { StarRating } from './star-rating';\n\ntype ReviewItemProps = {\n  review: Review;\n  /** The row's columns: the same grid as the summary over the list. */\n  className?: string;\n  onReply: (text: string) => void;\n  onCopyLink: () => void;\n  onReport: () => void;\n};\n\n/**\n * One review, on the page's white with a line above it. Who wrote it and the deal it followed\n * stand in the left column; the review itself reads in the right one: the stars and the day, a\n * one-line title, the text. Under it either the company's reply, or Reply, which opens the reply\n * field in its place. Every rating is drawn the same: a low one is not painted red.\n */\nexport function ReviewItem({ review, className, onReply, onCopyLink, onReport }: ReviewItemProps) {\n  const titleId = useId();\n  const [replying, setReplying] = useState(false);\n\n  return (\n    <article id={review.id} aria-labelledby={titleId} className={className}>\n      <div className=\"gap-ws-1 flex min-w-0 flex-col\">\n        <p className=\"typography-label-strong-sm text-ws-static-strong\">{review.customer}</p>\n        <p className=\"typography-label-sm text-ws-static-subtle\">\n          {review.person}, {review.role}\n        </p>\n        <a\n          href=\"#deal\"\n          className=\"typography-label-sm text-ws-static-subtle gap-ws-3 hover:text-ws-static-strong rounded-ws-control-sm focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default mt-ws-3 flex items-center self-start hover:underline\"\n        >\n          <RiHandCoinLine aria-hidden=\"true\" className=\"size-ws-9 shrink-0\" />\n          {review.deal}\n        </a>\n      </div>\n\n      <div className=\"gap-ws-7 flex min-w-0 flex-col\">\n        <div className=\"gap-ws-3 flex flex-col\">\n          {/* The ⋯ is pulled out of the line's height, so the stars sit level with the name. */}\n          <div className=\"h-ws-11 gap-ws-7 flex items-center\">\n            <StarRating value={review.rating} />\n            <time\n              dateTime={review.date}\n              className=\"typography-label-sm text-ws-static-subtle tabular-nums\"\n            >\n              {formatDate(review.date)}\n            </time>\n            <ReviewMenu\n              customer={review.customer}\n              onCopyLink={onCopyLink}\n              onReport={onReport}\n              className=\"-my-ws-4 ml-auto\"\n            />\n          </div>\n          <h2 id={titleId} className=\"typography-label-strong-md text-ws-static-strong\">\n            {review.title}\n          </h2>\n          <p className=\"typography-body-md text-ws-static-base max-w-[40rem]\">{review.text}</p>\n        </div>\n\n        {review.reply ? (\n          <ReviewReply reply={review.reply} />\n        ) : replying ? (\n          <ReplyForm\n            to={review.person}\n            onCancel={() => setReplying(false)}\n            onReply={(text) => {\n              onReply(text);\n              setReplying(false);\n            }}\n          />\n        ) : (\n          <Button\n            size=\"sm\"\n            variant=\"secondary\"\n            preset=\"ghost\"\n            className=\"-my-ws-4 -ml-ws-6 self-start\"\n            onClick={() => setReplying(true)}\n          >\n            <Button.Icon icon={RiReplyLine} />\n            Reply\n          </Button>\n        )}\n      </div>\n    </article>\n  );\n}\n"
    },
    {
      "path": "src/blocks/reviews/review-menu.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/review-menu.tsx",
      "content": "'use client';\n\nimport { RiFlagLine, RiLinkM, RiMoreFill } from '@remixicon/react';\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';\n\ntype ReviewMenuProps = {\n  /** Whose review it is, for the button's name. */\n  customer: string;\n  onCopyLink: () => void;\n  onReport: () => void;\n  className?: string;\n};\n\n/**\n * What else a review can do, behind the ⋯ at the end of its first line: copy its link, or report\n * it to Orbit when it breaks the rules. Reporting sits under a line: it is the one that tells\n * someone.\n */\nexport function ReviewMenu({ customer, onCopyLink, onReport, className }: ReviewMenuProps) {\n  return (\n    <DropdownMenu>\n      <DropdownMenu.Trigger asChild>\n        <IconButton\n          icon={RiMoreFill}\n          size=\"sm\"\n          variant=\"secondary\"\n          preset=\"ghost\"\n          aria-label={`More actions for ${customer}’s review`}\n          className={className}\n        />\n      </DropdownMenu.Trigger>\n      <DropdownMenu.Content align=\"end\" className=\"ws-block-utility w-[14rem]\">\n        <DropdownMenu.Item onSelect={onCopyLink}>\n          <ListItem.Prefix>\n            <RiLinkM className=\"size-ws-9\" />\n          </ListItem.Prefix>\n          <ListItem.Content>\n            <ListItem.Label>Copy link</ListItem.Label>\n          </ListItem.Content>\n        </DropdownMenu.Item>\n        <DropdownMenu.Separator />\n        <DropdownMenu.Item onSelect={onReport}>\n          <ListItem.Prefix>\n            <RiFlagLine className=\"size-ws-9\" />\n          </ListItem.Prefix>\n          <ListItem.Content>\n            <ListItem.Label>Report</ListItem.Label>\n          </ListItem.Content>\n        </DropdownMenu.Item>\n      </DropdownMenu.Content>\n    </DropdownMenu>\n  );\n}\n"
    },
    {
      "path": "src/blocks/reviews/review-reply.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/review-reply.tsx",
      "content": "'use client';\n\n// TODO(custom): a reply under a review (who answered, when, the text, set in behind a line); no Comment or quote component in Wideset.\nimport { type Reply, workspace } from './data';\nimport { formatDate } from './format';\n\n/**\n * The company's answer under a review: set in behind a line and a tone quieter than the review,\n * so the customer's words stay the loudest thing in the row.\n */\nexport function ReviewReply({ reply }: { reply: Reply }) {\n  return (\n    <div className=\"border-ws-static-base gap-ws-2 pl-ws-9 flex max-w-[40rem] flex-col border-l\">\n      <p className=\"typography-label-sm text-ws-static-subtle\">\n        <span className=\"typography-label-strong-sm text-ws-static-base\">{workspace.name}</span>\n        {` · ${reply.author} · `}\n        <time dateTime={reply.date}>{formatDate(reply.date)}</time>\n      </p>\n      <p className=\"typography-body-md text-ws-static-subtle\">{reply.text}</p>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/reviews/sidebar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/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 ReviewsSidebar(\n  props: Pick<SidebarProps, 'id' | 'collapsed' | 'onCollapsedChange'>,\n) {\n  const [active, setActive] = useState('reviews');\n\n  const link = ({ id, label, icon, activeIcon }: NavLink) => (\n    <Sidebar.Item\n      key={id}\n      href={`#${id}`}\n      icon={active === id ? (activeIcon ?? icon) : icon}\n      label={label}\n      active={active === id}\n      onClick={() => setActive(id)}\n    />\n  );\n\n  const nav = (\n    <nav aria-label=\"Workspace\" className=\"gap-ws-9 flex flex-col\">\n      <div className=\"flex flex-col\">{mainLinks.map(link)}</div>\n      <Divider weight=\"thin\" />\n      <div role=\"group\" aria-labelledby=\"sidebar-settings\" className=\"gap-ws-2 flex flex-col\">\n        <Sidebar.SectionHeader id=\"sidebar-settings\">Settings</Sidebar.SectionHeader>\n        {settingsLinks.map(link)}\n      </div>\n    </nav>\n  );\n\n  return (\n    <Sidebar {...props}>\n      <Sidebar.Header>\n        <Sidebar.Expanded>\n          <div className=\"gap-ws-9 flex flex-col\">\n            <div className=\"gap-ws-7 pt-ws-3 pb-ws-7 flex items-center\">\n              <BrandMark className=\"size-ws-15\" />\n              <div className=\"flex min-w-0 flex-1 flex-col\">\n                <span className=\"typography-label-strong-sm text-ws-static-strong truncate\">\n                  {workspace.name}\n                </span>\n                <span className=\"typography-caption-md text-ws-static-subtle truncate\">\n                  {product.name}\n                </span>\n              </div>\n              <DropdownMenu>\n                <DropdownMenu.Trigger asChild>\n                  <IconButton\n                    icon={RiArrowDownSLine}\n                    variant=\"secondary\"\n                    preset=\"ghost\"\n                    size=\"xs\"\n                    aria-label=\"Switch workspace\"\n                    className=\"mr-ws-3\"\n                  />\n                </DropdownMenu.Trigger>\n                <DropdownMenu.Content className=\"ws-block-utility\" align=\"end\">\n                  <DropdownMenu.Item data-state=\"checked\">\n                    <ListItem.Content>\n                      <ListItem.Label>{workspace.name}</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                  <DropdownMenu.Separator />\n                  <DropdownMenu.Item>\n                    <ListItem.Prefix>\n                      <RiAddLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>New workspace</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                </DropdownMenu.Content>\n              </DropdownMenu>\n            </div>\n            <TextInput size=\"sm\">\n              <TextInput.Prefix inner>\n                <TextInput.Icon icon={RiSearchLine} />\n              </TextInput.Prefix>\n              <TextInput.Input type=\"search\" placeholder=\"Search\" aria-label=\"Search\" />\n            </TextInput>\n          </div>\n        </Sidebar.Expanded>\n        <Sidebar.Collapsed>\n          <div className=\"pt-ws-3 pb-ws-7 flex justify-center\">\n            <BrandMark className=\"size-ws-15\" />\n          </div>\n        </Sidebar.Collapsed>\n      </Sidebar.Header>\n\n      {/* A section draws only the slot for the state it is in, so the pages go in both. */}\n      <Sidebar.Section scrollable>{nav}</Sidebar.Section>\n\n      <Sidebar.Footer>\n        <div className=\"gap-ws-9 flex flex-col\">\n          <div className=\"flex flex-col\">{link(helpLink)}</div>\n          {/* On the grey ground the line keeps the nav's inset: run edge to edge, it would stop\n              short of the page and read as broken. */}\n          <div className=\"border-ws-static-base pt-ws-5 border-t\">\n            <Sidebar.Expanded>\n              <DropdownMenu>\n                <DropdownMenu.Trigger asChild>\n                  <button\n                    type=\"button\"\n                    className=\"gap-ws-5 px-ws-5 py-ws-3 rounded-ws-control-lg hover:bg-ws-dynamic-tertiary-alpha-strong-default focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default flex w-full items-center text-left\"\n                  >\n                    <PersonAvatar name={account.name} initials={account.initials} color=\"orange\" />\n                    <span className=\"flex min-w-0 flex-1 flex-col\">\n                      <span className=\"typography-label-strong-sm text-ws-static-base truncate\">\n                        {account.name}\n                      </span>\n                      <span className=\"typography-caption-md text-ws-static-subtle truncate\">\n                        {account.email}\n                      </span>\n                    </span>\n                    <RiArrowDownSLine\n                      aria-hidden=\"true\"\n                      className=\"size-ws-9 text-ws-static-strong\"\n                    />\n                  </button>\n                </DropdownMenu.Trigger>\n                <DropdownMenu.Content side=\"top\" align=\"start\" className=\"ws-block-utility w-[14rem]\">\n                  <DropdownMenu.Item>\n                    <ListItem.Prefix>\n                      <RiSettingsLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>Account settings</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                  <DropdownMenu.Separator />\n                  <DropdownMenu.Item variant=\"danger\">\n                    <ListItem.Prefix>\n                      <RiLogoutBoxRLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>Log out</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                </DropdownMenu.Content>\n              </DropdownMenu>\n            </Sidebar.Expanded>\n            <Sidebar.Collapsed>\n              <div className=\"flex justify-center\">\n                <PersonAvatar\n                  name={account.name}\n                  initials={account.initials}\n                  color=\"orange\"\n                  title={account.name}\n                  alt={account.name}\n                />\n              </div>\n            </Sidebar.Collapsed>\n          </div>\n        </div>\n      </Sidebar.Footer>\n    </Sidebar>\n  );\n}\n"
    },
    {
      "path": "src/blocks/reviews/star-rating.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/reviews/star-rating.tsx",
      "content": "'use client';\n\n// TODO(custom): star rating, read-only and as an input; Wideset has no Rating component.\nimport { RiStarFill } from '@remixicon/react';\nimport { cn } from '@/lib/wideset/utils';\nimport { useState } from 'react';\n\n/*\n  The prototype for a Wideset Rating: five Remix stars, read-only (`StarRating`) and as an input\n  (`StarRatingInput`), drawn the same way so a rating looks the same where it is given and where\n  it is read.\n\n  Colour: filled stars are yellow, as people expect a rating to be; the notice fill\n  (`--ws-semantic-fill-inverse-notice`, amber) is the token for it, through a raw variable since\n  Wideset has no text class for that fill. An empty star is the same shape in a quiet stroke\n  colour, so five stars always have one outline and the weight is the rating. A low rating is not\n  painted red: the count of yellow stars says it.\n*/\n\nconst STARS = [1, 2, 3, 4, 5] as const;\nconst FILLED = 'text-(--ws-semantic-fill-inverse-notice)';\nconst SIZES = { sm: 'size-ws-9', md: 'size-ws-11', lg: 'size-ws-12' } as const;\ntype Size = keyof typeof SIZES;\n\n/**\n * One star: empty, half or full. A half is the full star clipped to its left side over the pale\n * one: Remix's own half star keeps a dark outline round the empty side, which an empty star here\n * does not have.\n */\nfunction Star({ fill, size }: { fill: 0 | 0.5 | 1; size: Size }) {\n  return (\n    <span aria-hidden=\"true\" className={cn('relative block shrink-0', SIZES[size])}>\n      <RiStarFill\n        className={cn('size-full', fill === 1 ? FILLED : 'text-(--ws-static-stroke-strong)')}\n      />\n      {fill === 0.5 && (\n        <RiStarFill\n          className={cn(FILLED, 'absolute inset-0 size-full [clip-path:inset(0_50%_0_0)]')}\n        />\n      )}\n    </span>\n  );\n}\n\ntype StarRatingProps = {\n  /** The rating, 0 to 5. Stars show the nearest half; the text alternative keeps one decimal. */\n  value: number;\n  /** 16px in a list (default), 20px beside a figure, 24px for an input. */\n  size?: Size;\n  className?: string;\n};\n\n/** A rating as five stars, read-only: one image whose text alternative is \"4 out of 5\". */\nexport function StarRating({ value, size = 'sm', className }: StarRatingProps) {\n  const shown = Math.round(value * 2) / 2;\n\n  return (\n    <span\n      role=\"img\"\n      aria-label={`${Number(value.toFixed(1))} out of 5`}\n      className={cn('gap-ws-1 inline-flex', className)}\n    >\n      {STARS.map((star) => (\n        <Star key={star} size={size} fill={shown >= star ? 1 : shown >= star - 0.5 ? 0.5 : 0} />\n      ))}\n    </span>\n  );\n}\n\ntype StarRatingInputProps = {\n  /** The group's name for the form and for screen readers' grouping. */\n  name: string;\n  /** What is being rated: the group's accessible name. */\n  label: string;\n  /** The chosen rating, or 0 for none yet. */\n  value: number;\n  onValueChange: (value: number) => void;\n  size?: Size;\n  className?: string;\n};\n\n/**\n * A rating to give: five native radios, so arrow keys move the choice and a screen reader reads\n * \"4 out of 5, radio, 4 of 5\". The stars fill up to the one under the pointer, then settle on the\n * one chosen.\n */\nexport function StarRatingInput({\n  name,\n  label,\n  value,\n  onValueChange,\n  size = 'lg',\n  className,\n}: StarRatingInputProps) {\n  const [hovered, setHovered] = useState(0);\n  const shown = hovered || value;\n\n  return (\n    <div\n      role=\"radiogroup\"\n      aria-label={label}\n      className={cn('inline-flex', className)}\n      onPointerLeave={() => setHovered(0)}\n    >\n      {STARS.map((star) => (\n        <label\n          key={star}\n          className=\"p-ws-1 rounded-ws-control-sm has-focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default cursor-pointer\"\n          onPointerEnter={() => setHovered(star)}\n        >\n          <input\n            type=\"radio\"\n            name={name}\n            value={star}\n            checked={value === star}\n            onChange={() => onValueChange(star)}\n            aria-label={`${star} out of 5`}\n            className=\"sr-only\"\n          />\n          <Star size={size} fill={star <= shown ? 1 : 0} />\n        </label>\n      ))}\n    </div>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "1.1.0",
    "commit": "a734f9f0"
  }
}
