{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pricing-02",
  "title": "One plan with a feature table",
  "description": "A per-seat plan whose seat count and monthly total roll to their new value when changed, beside a grouped table of everything it includes.",
  "dependencies": [],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/button.json",
    "https://ui.ndekocode.dev/r/icons.json",
    "https://ui.ndekocode.dev/r/motion-number.json",
    "https://ui.ndekocode.dev/r/motion-word-roll.json",
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/wash.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/blocks/pricing/pricing-02/index.tsx",
      "content": "'use client';\n\nimport { useState } from 'react';\n\nimport { MotionNumber } from '@/components/core/motion-number';\nimport { WordRoll } from '@/components/core/word-roll';\nimport { MinusIcon, PlusIcon } from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Wash } from '@/registry/ndeko/ui/wash';\n\nimport { PLAN, SECTION } from './data';\nimport { FeatureTable } from './feature-table';\n\nconst PRICE_FORMAT: Intl.NumberFormatOptions = {\n  style: 'currency',\n  currency: 'USD',\n  maximumFractionDigits: 0,\n};\n\nconst PRICE_FORMATTER = new Intl.NumberFormat('en-US', PRICE_FORMAT);\n\nfunction formatPrice(amount: number) {\n  return PRICE_FORMATTER.format(amount);\n}\n\nfunction seatsLabelOf(seats: number) {\n  if (seats === 1) {\n    return 'for 1 seat';\n  }\n  return `for ${seats} seats`;\n}\n\nfunction moreSeatsOf(seats: number) {\n  const next = seats + 1;\n  return Math.min(next, PLAN.maxSeats);\n}\n\nfunction fewerSeatsOf(seats: number) {\n  const next = seats - 1;\n  return Math.max(next, PLAN.minSeats);\n}\n\nexport default function Pricing02() {\n  const [seats, setSeats] = useState(PLAN.defaultSeats);\n  const canRemoveSeat = seats > PLAN.minSeats;\n  const canAddSeat = seats < PLAN.maxSeats;\n  const total = seats * PLAN.pricePerSeat;\n  const seatPrice = formatPrice(PLAN.pricePerSeat);\n  const seatsLabel = seatsLabelOf(seats);\n\n  function addSeat() {\n    setSeats(moreSeatsOf);\n  }\n\n  function removeSeat() {\n    setSeats(fewerSeatsOf);\n  }\n\n  return (\n    <section className='px-4 py-16 sm:px-6 sm:py-24 lg:px-8'>\n      <div className='mx-auto flex max-w-6xl flex-col gap-10 sm:gap-14'>\n        <div className='flex max-w-2xl flex-col gap-3'>\n          <h2 className='text-2xl font-semibold text-balance sm:text-3xl'>\n            {SECTION.title}\n          </h2>\n          <p className='text-muted-foreground text-base text-pretty'>\n            {SECTION.description}\n          </p>\n        </div>\n        <div className='grid items-start gap-10 lg:grid-cols-[22rem_minmax(0,1fr)] lg:gap-16'>\n          <article className='surface-brand relative isolate flex flex-col gap-6 rounded-xl p-6 sm:p-7 lg:sticky lg:top-8'>\n            <Wash />\n            <div className='flex flex-col gap-1.5'>\n              <h3 className='text-sm font-medium'>{PLAN.name}</h3>\n              <p className='text-muted-foreground text-[13px]'>\n                {PLAN.description}\n              </p>\n            </div>\n            <p className='flex items-baseline gap-1.5'>\n              <span className='text-4xl font-semibold tabular-nums'>\n                {seatPrice}\n              </span>\n              <span className='text-muted-foreground text-[13px]'>\n                per seat, per month\n              </span>\n            </p>\n            <div className='flex items-center justify-between gap-4'>\n              <span id='pricing-02-seats' className='text-[13px] font-medium'>\n                Seats\n              </span>\n              <div\n                role='group'\n                aria-labelledby='pricing-02-seats'\n                className='bg-card hairline-ring ring-foreground/12 dark:bg-foreground/[0.04] dark:ring-foreground/15 inline-flex items-center gap-1 rounded-full p-0.5 shadow-[0_1px_2px_rgb(0_0_0/0.05)]'\n              >\n                <Button\n                  variant='ghost'\n                  size='icon-sm'\n                  className='rounded-full'\n                  aria-label='Remove a seat'\n                  disabled={!canRemoveSeat}\n                  focusableWhenDisabled\n                  onClick={removeSeat}\n                >\n                  <MinusIcon />\n                </Button>\n                <MotionNumber\n                  value={seats}\n                  className='min-w-6 justify-center text-[13px] font-medium'\n                />\n                <Button\n                  variant='ghost'\n                  size='icon-sm'\n                  className='rounded-full'\n                  aria-label='Add a seat'\n                  disabled={!canAddSeat}\n                  focusableWhenDisabled\n                  onClick={addSeat}\n                >\n                  <PlusIcon />\n                </Button>\n              </div>\n            </div>\n            <div\n              aria-live='polite'\n              className='bg-foreground/[0.03] flex items-baseline justify-between gap-3 rounded-lg px-3 py-2.5'\n            >\n              <span className='text-muted-foreground text-[13px]'>\n                Total per month\n              </span>\n              <span className='flex items-baseline gap-1.5 text-sm'>\n                <MotionNumber\n                  value={total}\n                  format={PRICE_FORMAT}\n                  className='font-semibold'\n                />\n                <WordRoll\n                  text={seatsLabel}\n                  value={seats}\n                  className='text-muted-foreground text-xs'\n                />\n              </span>\n            </div>\n            <Button size='lg' nativeButton={false} render={<a href='#' />}>\n              {PLAN.action}\n            </Button>\n            <p className='text-muted-foreground text-xs'>{PLAN.footnote}</p>\n          </article>\n          <FeatureTable />\n        </div>\n      </div>\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/pricing-02/index.tsx"
    },
    {
      "path": "registry/ndeko/blocks/pricing/pricing-02/feature-table.tsx",
      "content": "import { FEATURE_GROUPS } from './data';\n\nexport function FeatureTable() {\n  return (\n    <table className='w-full text-[13px]'>\n      <caption className='sr-only'>What the Studio plan includes</caption>\n      <thead>\n        <tr className='hairline-b border-border text-muted-foreground text-xs'>\n          <th scope='col' className='pb-3 text-left font-medium'>\n            Feature\n          </th>\n          <th scope='col' className='pb-3 text-right font-medium'>\n            In the Studio plan\n          </th>\n        </tr>\n      </thead>\n      {FEATURE_GROUPS.map((group) => (\n        <tbody key={group.title}>\n          <tr>\n            <th\n              scope='rowgroup'\n              colSpan={2}\n              className='pt-7 pb-2 text-left text-sm font-medium'\n            >\n              {group.title}\n            </th>\n          </tr>\n          {group.rows.map((row) => (\n            <tr key={row.feature} className='hairline-b border-border'>\n              <th scope='row' className='py-3 pe-4 text-left font-normal'>\n                {row.feature}\n              </th>\n              <td className='text-muted-foreground py-3 text-right'>\n                {row.value}\n              </td>\n            </tr>\n          ))}\n        </tbody>\n      ))}\n    </table>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/pricing-02/feature-table.tsx"
    },
    {
      "path": "registry/ndeko/blocks/pricing/pricing-02/data.ts",
      "content": "export const PLAN = {\n  name: 'Studio plan',\n  description:\n    'One plan with every feature. You pay for each person who sends invoices.',\n  pricePerSeat: 18,\n  minSeats: 1,\n  maxSeats: 50,\n  defaultSeats: 3,\n  action: 'Start a free month',\n  footnote: 'Example prices in US dollars, taxes added at checkout',\n};\n\nexport const SECTION = {\n  title: 'One price per person who sends invoices, every feature included',\n  description:\n    'No feature is held back for a bigger tier. Add a seat when someone new starts sending invoices, remove it when they stop.',\n};\n\nexport type FeatureRow = {\n  feature: string;\n  value: string;\n};\n\nexport type FeatureGroup = {\n  title: string;\n  rows: FeatureRow[];\n};\n\nexport const FEATURE_GROUPS: FeatureGroup[] = [\n  {\n    title: 'Invoicing',\n    rows: [\n      { feature: 'Invoices per month', value: 'Unlimited' },\n      { feature: 'Recurring invoices', value: 'Included' },\n      { feature: 'Currencies', value: 'Any your client pays in' },\n    ],\n  },\n  {\n    title: 'Time',\n    rows: [\n      { feature: 'Timers and timesheets', value: 'Included' },\n      { feature: 'Rates per person or per task', value: 'Included' },\n    ],\n  },\n  {\n    title: 'Getting paid',\n    rows: [\n      { feature: 'Payment links by card or transfer', value: 'Included' },\n      { feature: 'Automatic reminders', value: 'Up to three per invoice' },\n    ],\n  },\n  {\n    title: 'Workspace',\n    rows: [\n      { feature: 'Clients', value: 'Unlimited' },\n      { feature: 'Exports', value: 'CSV and PDF' },\n      { feature: 'Support', value: 'Email, answered by a person' },\n    ],\n  },\n];\n",
      "type": "registry:component",
      "target": "components/blocks/pricing-02/data.ts"
    }
  ],
  "categories": [
    "blocks",
    "pricing"
  ],
  "type": "registry:block"
}