{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "footer-parts",
  "title": "Footer parts",
  "description": "What the Footer blocks share: the links they take, the groups of links under their headings, the service’s status, the social links, and the legal line with the theme switch.",
  "dependencies": [],
  "registryDependencies": [
    "https://kinoui.com/r/badge.json",
    "https://kinoui.com/r/hero-parts.json",
    "https://kinoui.com/r/notice.json",
    "https://kinoui.com/r/theme.json",
    "https://kinoui.com/r/theme-switcher.json"
  ],
  "files": [
    {
      "path": "registry/lib/footer-parts.tsx",
      "content": "'use client'\n\nimport { Badge } from '@/registry/components/kino/badge'\nimport { ThemeSegmentedControl } from '@/registry/components/kino/theme-switcher'\nimport { pageColumnClassName } from '@/registry/lib/hero-parts'\nimport { NoticeGlyph } from '@/registry/lib/notice'\nimport type { ComponentProps, ReactNode } from 'react'\n\nimport { cn } from '@/lib/utils'\n\n/*\n * What the Footer blocks share: the links they take, the groups of links\n * under their headings, the status of the service, the social links, the\n * legal line and the theme switch, so every footer reads and moves the same.\n */\n\n/** A page the footer links to. */\ninterface FooterLink {\n  label: string\n  href: string\n  /** A word beside the label, such as Hiring or New. */\n  badge?: ReactNode\n  /** Opens in a new tab, and says so to a screen reader. */\n  external?: boolean\n  /** The page the visitor is on: marked for them and for screen readers. */\n  current?: boolean\n}\n\n/** A group of links under a heading, such as Product. */\ninterface FooterGroup {\n  label: string\n  links: FooterLink[]\n}\n\n/** A social profile: its icon, named for screen readers by `label`. */\ninterface FooterSocialLink {\n  label: string\n  href: string\n  icon: ReactNode\n}\n\n/** How the service is doing, from the status page. */\ntype FooterStatusState = 'operational' | 'degraded' | 'outage'\n\ninterface FooterStatus {\n  state: FooterStatusState\n  /** The status page. */\n  href: string\n  /** What it says; each state has its own words by default. */\n  label?: string\n}\n\n/** The levels a group's heading takes: `h2` under the page's sections, unless the footer sits lower. */\ntype FooterHeading = 'h2' | 'h3' | 'h4'\n\n/** What every Footer block takes. */\ninterface FooterBaseProps extends Omit<ComponentProps<'footer'>, 'children'> {\n  /** A link to the home page, around the logo. */\n  logo: ReactNode\n  /** The company's line, such as © 2026 Kino Labs, Inc. Given, not worked out, so a page built once never shows a stale year. */\n  copyright: ReactNode\n  /** Privacy, Terms and the like, on the legal line. */\n  legal?: FooterLink[]\n  social?: FooterSocialLink[]\n  status?: FooterStatus\n  /** Light, dark or the device's own, at the end of the legal line. */\n  themeSwitcher?: boolean\n  /** The links' name for screen readers. */\n  label?: string\n}\n\n/** The footer's column: the Hero's and the Site header's, so their edges line up. */\nconst footerColumnClassName = pageColumnClassName\n\n/** A link's look: quiet until it is hovered, with room enough to be pressed. */\nconst footerLinkClassName =\n  'text-muted-foreground hover:text-foreground aria-[current=page]:text-foreground inline-flex min-h-6 max-w-full items-center gap-2 rounded-(--control-radius-xs) text-sm transition-[color,box-shadow] duration-(--motion-press-duration) ease-(--motion-press-fade-easing) focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-hidden aria-[current=page]:font-medium'\n\n/** A link of the footer's, with its badge, and a word for screen readers when it opens a new tab. */\nfunction FooterLinkItem({ link, className }: { link: FooterLink; className?: string }) {\n  return (\n    <a\n      href={link.href}\n      aria-current={link.current ? 'page' : undefined}\n      {...(link.external ? { target: '_blank', rel: 'noreferrer' } : {})}\n      className={cn(footerLinkClassName, className)}\n    >\n      <bdi className='min-w-0 wrap-break-word'>{link.label}</bdi>\n      {/* In the text colour: a tint of the link's quieter one leaves its word under 4.5:1. */}\n      {link.badge ? (\n        <Badge variant='secondary' className='text-foreground'>\n          {link.badge}\n        </Badge>\n      ) : null}\n      {link.external ? <span className='sr-only'>(opens in a new tab)</span> : null}\n    </a>\n  )\n}\n\n/** Every group side by side once there is room, up to five. */\nconst COLUMNS = {\n  2: '',\n  3: '@md/groups:grid-cols-3',\n  4: '@xl/groups:grid-cols-4',\n  5: '@xl/groups:grid-cols-3 @3xl/groups:grid-cols-5',\n} as const\n\n/**\n * The groups of links, each a heading over its list, in one labelled\n * navigation. Two to a row in a phone's column, and up to five side by\n * side once there is room for them.\n */\nfunction FooterGroups({\n  groups,\n  label = 'Footer',\n  heading = 'h2',\n  className,\n}: {\n  groups: FooterGroup[]\n  /** The navigation's name for screen readers. */\n  label?: string\n  heading?: FooterHeading\n  className?: string\n}) {\n  const Heading = heading\n  return (\n    <nav\n      aria-label={label}\n      data-slot='footer-groups'\n      className={cn('@container/groups min-w-0', className)}\n    >\n      <div\n        className={cn(\n          'grid min-w-0 grid-cols-2 gap-x-6 gap-y-10',\n          COLUMNS[Math.min(Math.max(groups.length, 2), 5) as keyof typeof COLUMNS],\n        )}\n      >\n        {groups.map((group) => (\n          <div key={group.label} className='flex min-w-0 flex-col gap-3'>\n            <Heading className='text-sm font-medium'>\n              <bdi>{group.label}</bdi>\n            </Heading>\n            <ul className='flex flex-col gap-1.5'>\n              {group.links.map((link) => (\n                <li key={link.href} className='flex min-w-0'>\n                  <FooterLinkItem link={link} />\n                </li>\n              ))}\n            </ul>\n          </div>\n        ))}\n      </div>\n    </nav>\n  )\n}\n\n/** Each state's own words and the icon beside them, so it never relies on colour alone. */\nconst STATUS = {\n  operational: { label: 'All systems normal', notice: 'success' },\n  degraded: { label: 'Some systems degraded', notice: 'warning' },\n  outage: { label: 'Major outage', notice: 'error' },\n} as const satisfies Record<FooterStatusState, { label: string; notice: string }>\n\n/** How the service is doing, as a link to the status page. */\nfunction FooterStatusLink({ status }: { status: FooterStatus }) {\n  const { label, notice } = STATUS[status.state]\n  return (\n    <a\n      href={status.href}\n      data-slot='footer-status'\n      data-state={status.state}\n      className={cn(footerLinkClassName, 'w-fit')}\n    >\n      <NoticeGlyph type={notice} />\n      <bdi className='min-w-0 wrap-break-word'>{status.label ?? label}</bdi>\n    </a>\n  )\n}\n\n/** The social profiles, as icon links named for screen readers. */\nfunction FooterSocial({\n  social,\n  className,\n}: {\n  social: FooterSocialLink[]\n  className?: string\n}) {\n  return (\n    <ul\n      data-slot='footer-social'\n      className={cn('-mx-1.5 flex flex-wrap items-center', className)}\n    >\n      {social.map((link) => (\n        <li key={link.href}>\n          <a\n            href={link.href}\n            aria-label={link.label}\n            target='_blank'\n            rel='noreferrer'\n            className=\"text-muted-foreground hover:text-foreground hover:bg-muted flex size-8 items-center justify-center rounded-(--control-radius-sm) transition-[color,background-color,box-shadow] duration-(--motion-press-duration) ease-(--motion-press-fade-easing) focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-hidden [&_svg:not([class*='size-'])]:size-4\"\n          >\n            {link.icon}\n            <span className='sr-only'>(opens in a new tab)</span>\n          </a>\n        </li>\n      ))}\n    </ul>\n  )\n}\n\n/**\n * The line at the foot: the company, the legal links and, at its end, the\n * theme switch. It wraps onto a second line where there's no room.\n */\nfunction FooterLegal({\n  copyright,\n  legal,\n  themeSwitcher,\n  start,\n  className,\n}: {\n  copyright: ReactNode\n  legal?: FooterLink[]\n  themeSwitcher?: boolean\n  /** Before the company's line, such as the social links. */\n  start?: ReactNode\n  className?: string\n}) {\n  return (\n    <div\n      data-slot='footer-legal'\n      className={cn(\n        'flex min-w-0 flex-col gap-4 @2xl/footer:flex-row @2xl/footer:items-center',\n        className,\n      )}\n    >\n      <div className='flex min-w-0 flex-1 flex-wrap items-center gap-x-6 gap-y-2'>\n        {start}\n        <p className='text-muted-foreground text-sm'>\n          <bdi>{copyright}</bdi>\n        </p>\n        {legal?.length ? (\n          <nav aria-label='Legal'>\n            <ul className='flex flex-wrap gap-x-5 gap-y-1'>\n              {legal.map((link) => (\n                <li key={link.href} className='flex'>\n                  <FooterLinkItem link={link} />\n                </li>\n              ))}\n            </ul>\n          </nav>\n        ) : null}\n      </div>\n      {themeSwitcher ? (\n        <ThemeSegmentedControl iconOnly className='w-fit shrink-0' />\n      ) : null}\n    </div>\n  )\n}\n\nexport {\n  footerColumnClassName,\n  FooterGroups,\n  FooterLegal,\n  footerLinkClassName,\n  FooterLinkItem,\n  FooterSocial,\n  FooterStatusLink,\n  STATUS as footerStatusLabels,\n}\nexport type {\n  FooterBaseProps,\n  FooterGroup,\n  FooterHeading,\n  FooterLink,\n  FooterSocialLink,\n  FooterStatus,\n  FooterStatusState,\n}\n",
      "type": "registry:lib",
      "target": "@lib/footer-parts.tsx"
    }
  ],
  "type": "registry:lib"
}