{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "features-lead",
  "title": "Features lead",
  "description": "A landing page’s features led by one: the first in depth beside a large picture of it at work, and the rest in brief under it.",
  "dependencies": [],
  "registryDependencies": [
    "https://kinoui.com/r/animated-number.json",
    "https://kinoui.com/r/avatar.json",
    "https://kinoui.com/r/badge.json",
    "https://kinoui.com/r/button.json",
    "https://kinoui.com/r/command.json",
    "https://kinoui.com/r/feature-parts.json",
    "https://kinoui.com/r/hero-parts.json",
    "https://kinoui.com/r/meter.json",
    "https://kinoui.com/r/scene.json",
    "https://kinoui.com/r/section-heading.json",
    "https://kinoui.com/r/sparkline.json",
    "https://kinoui.com/r/swap.json",
    "https://kinoui.com/r/text-shimmer.json"
  ],
  "files": [
    {
      "path": "registry/components/kino/features-lead/features-lead.tsx",
      "content": "'use client'\n\nimport {\n  type Feature,\n  FeatureIcon,\n  featuresColumnClassName,\n  featuresSectionClassName,\n  FeatureStage,\n  FeatureWords,\n} from '@/registry/lib/feature-parts'\nimport { HeroShot } from '@/registry/lib/hero-parts'\nimport {\n  HEADING_BELOW,\n  SectionHeading,\n  type SectionHeadingLevel,\n} from '@/registry/lib/section-heading'\nimport { type ComponentProps, type ReactNode, useId } from 'react'\n\nimport { cn } from '@/lib/utils'\n\n/*\n * A landing page's features led by one: the first, the one the product is\n * bought for, in depth beside a large picture of it at work, and the rest in\n * brief under it, an icon, a title and a line each, three to a row. It\n * holds a long list as well as a short one.\n *\n *   <FeaturesLead\n *     title='Plan less. Ship more.'\n *     features={[{ value: 'cycles', title: 'Cycles that size themselves', description: '…', picture: <CyclePicture /> }]}\n *   />\n */\n\ninterface FeaturesLeadProps extends Omit<\n  ComponentProps<'section'>,\n  'title' | 'children'\n> {\n  /** The one that leads first, with its `picture`; the rest are told in words, so theirs is left out. */\n  features: Feature[]\n  title: ReactNode\n  eyebrow?: ReactNode\n  description?: ReactNode\n  actions?: ReactNode\n  heading?: SectionHeadingLevel\n}\n\nfunction FeaturesLead({\n  features,\n  title,\n  eyebrow,\n  description,\n  actions,\n  heading = 'h2',\n  className,\n  ...props\n}: FeaturesLeadProps) {\n  const titleId = useId()\n  const Heading = HEADING_BELOW[heading]\n  const [lead, ...rest] = features\n  return (\n    <section\n      data-slot='features-lead'\n      aria-labelledby={titleId}\n      className={cn(featuresSectionClassName, className)}\n      {...props}\n    >\n      <div className={featuresColumnClassName}>\n        <SectionHeading\n          id={titleId}\n          eyebrow={eyebrow}\n          title={title}\n          description={description}\n          heading={heading}\n          align='start'\n        >\n          {actions ? (\n            <div className='mt-3 flex flex-wrap items-center gap-3'>{actions}</div>\n          ) : null}\n        </SectionHeading>\n        {lead ? (\n          <div\n            data-slot='features-lead-feature'\n            className={cn(\n              'grid min-w-0 items-start gap-8',\n              lead.picture &&\n                '@3xl/features:grid-cols-[minmax(0,2fr)_minmax(0,3fr)] @3xl/features:gap-12',\n            )}\n          >\n            <div className='flex min-w-0 flex-col gap-4'>\n              {lead.icon ? <FeatureIcon>{lead.icon}</FeatureIcon> : null}\n              <FeatureWords feature={lead} heading={Heading} size='lead' />\n            </div>\n            {lead.picture ? (\n              <HeroShot decorative className='min-w-0'>\n                <FeatureStage className='aspect-[4/3] @3xl/features:*:data-[slot=feature-picture]:[zoom:1.1]'>\n                  {lead.picture}\n                </FeatureStage>\n              </HeroShot>\n            ) : null}\n          </div>\n        ) : null}\n        {rest.length > 0 ? (\n          <ul\n            data-slot='features-lead-rest'\n            className={cn(\n              'grid min-w-0 gap-x-8 gap-y-8 border-t pt-10 @xl/features:grid-cols-2',\n              COLUMN_CLASSES[briefColumns(rest.length)],\n            )}\n          >\n            {rest.map((feature) => (\n              <li key={feature.value} className='flex min-w-0 flex-col gap-4'>\n                {feature.icon ? <FeatureIcon>{feature.icon}</FeatureIcon> : null}\n                <FeatureWords feature={feature} heading={Heading} />\n              </li>\n            ))}\n          </ul>\n        ) : null}\n      </div>\n    </section>\n  )\n}\n\n/**\n * How many of the brief features sit in a row on a wide screen: all of them\n * up to four, then four or three, whichever leaves the last row fuller.\n */\nfunction briefColumns(count: number): number {\n  if (count <= 4) return count\n  const empty = (columns: number) => (columns - (count % columns)) % columns\n  return empty(3) < empty(4) ? 3 : 4\n}\n\n/** The columns at full width, written out so the classes are in the stylesheet. */\nconst COLUMN_CLASSES: Record<number, string> = {\n  1: '@xl/features:grid-cols-1',\n  2: '@4xl/features:grid-cols-2',\n  3: '@4xl/features:grid-cols-3',\n  4: '@4xl/features:grid-cols-4',\n}\n\nexport { briefColumns, FeaturesLead, type FeaturesLeadProps }\n",
      "type": "registry:component",
      "target": "@components/kino/features-lead/features-lead.tsx"
    }
  ],
  "type": "registry:block"
}