{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "year-calendar",
  "type": "registry:ui",
  "title": "Year Calendar",
  "dependencies": [
    "@base-ui-next/react",
    "class-variance-authority"
  ],
  "registryDependencies": [
    "https://hamur.dev/r/react/utils.json",
    "https://hamur.dev/r/react/button.json"
  ],
  "files": [
    {
      "path": "react/year-calendar.tsx",
      "content": "'use client'\n\nimport * as React from 'react' // base-ui-next/ui year-calendar@0.1.1\nimport { YearCalendar as YearCalendarPrimitive } from '@base-ui-next/react/year-calendar'\nimport type { VariantProps } from 'class-variance-authority'\nimport { cn } from '@/lib/utils'\nimport { buttonVariants } from '@/components/ui/button'\n\nconst yearCalendarClassName =\n  'group/year-calendar w-fit bg-background p-3 in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent in-data-[slot=year-picker-popup]:bg-transparent in-data-[slot=year-range-picker-popup]:bg-transparent'\n\nconst yearCalendarPageClassName = 'relative flex flex-col gap-4'\n\nconst yearCalendarNavClassName =\n  'absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1'\n\nconst yearCalendarNavButtonClassName = 'size-8 p-0 select-none aria-disabled:opacity-50'\n\nconst yearCalendarNavIconClassName = 'size-4 rtl:rotate-180'\n\nconst yearCalendarHeadingClassName =\n  'flex h-8 w-full items-center justify-center px-8 text-sm font-medium select-none'\n\nconst yearCalendarGridClassName = 'w-full border-collapse'\n\nconst yearCalendarRowClassName = 'mt-2 flex w-full first:mt-0'\n\n/** The cell, the focus holder: the range band, the focus ring, the disabled dimming. */\nconst yearCalendarCellClassName =\n  'relative flex h-9 min-w-14 flex-1 items-center justify-center rounded-md p-0 text-center text-sm outline-hidden select-none focus-visible:z-10 focus-visible:ring-[3px] focus-visible:ring-ring/50 data-disabled:opacity-50 data-preview:bg-muted/60 data-preview:not-data-preview-start:rounded-l-none data-preview:not-data-preview-end:rounded-r-none data-in-range:rounded-none data-in-range:bg-muted data-range-start:bg-muted data-range-start:not-data-range-end:rounded-r-none data-range-end:bg-muted data-range-end:not-data-range-start:rounded-l-none'\n\n/** The Year inside the cell: `buttonVariants` ghost plus these. */\nconst yearCalendarYearClassName =\n  'relative size-full cursor-pointer rounded-md px-2 font-normal data-selected:not-data-in-range:bg-primary data-selected:not-data-in-range:text-primary-foreground data-selected:not-data-in-range:hover:bg-primary data-selected:not-data-in-range:hover:text-primary-foreground data-in-range:rounded-none data-unavailable:line-through data-disabled:cursor-default data-current:after:absolute data-current:after:bottom-1 data-current:after:left-1/2 data-current:after:h-0.5 data-current:after:w-4 data-current:after:-translate-x-1/2 data-current:after:rounded-full data-current:after:bg-current'\n\ntype ButtonVariants = VariantProps<typeof buttonVariants>\n\n// lucide's icons, inline and hidden from assistive technology (10 · As built, BN-309).\nfunction SvgIcon({ children, ...props }: React.ComponentProps<'svg'>) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      aria-hidden=\"true\"\n      {...props}\n    >\n      {children}\n    </svg>\n  )\n}\n\ntype YearCalendarContentProps = {\n  buttonVariant?: ButtonVariants['variant']\n}\n\n// No shadcn item: one name per Base UI part (docs/design/log/month-year-picker.md). The header and\n// the grid of the Root, shared by YearRangeCalendar and the year pickers' calendars.\nfunction YearCalendarContent({ buttonVariant = 'ghost' }: YearCalendarContentProps) {\n  return (\n    <div data-slot=\"year-calendar-page\" className={yearCalendarPageClassName}>\n      <div data-slot=\"year-calendar-nav\" className={yearCalendarNavClassName}>\n        <YearCalendarPrevButton variant={buttonVariant} />\n        <YearCalendarNextButton variant={buttonVariant} />\n      </div>\n      <YearCalendarHeading />\n      <YearCalendarYearGrid />\n    </div>\n  )\n}\n\ntype YearCalendarProps<Multiple extends boolean | undefined = false> =\n  YearCalendarPrimitive.Root.Props<Multiple> & YearCalendarContentProps\n\nfunction YearCalendar<Multiple extends boolean | undefined = false>({\n  className,\n  children,\n  buttonVariant,\n  ...props\n}: YearCalendarProps<Multiple>) {\n  return (\n    <YearCalendarPrimitive.Root\n      data-slot=\"year-calendar\"\n      className={cn(yearCalendarClassName, className)}\n      {...props}\n    >\n      {children ?? <YearCalendarContent buttonVariant={buttonVariant} />}\n    </YearCalendarPrimitive.Root>\n  )\n}\n\n/** A ghost button with lucide's ChevronLeft; Base UI names it. */\nfunction YearCalendarPrevButton({\n  className,\n  children,\n  variant = 'ghost',\n  ...props\n}: YearCalendarPrimitive.PrevButton.Props & Pick<ButtonVariants, 'variant'>) {\n  return (\n    <YearCalendarPrimitive.PrevButton\n      data-slot=\"year-calendar-prev-button\"\n      className={cn(buttonVariants({ variant }), yearCalendarNavButtonClassName, className)}\n      {...props}\n    >\n      {children ?? (\n        <SvgIcon className={yearCalendarNavIconClassName}>\n          <path d=\"m15 18-6-6 6-6\" />\n        </SvgIcon>\n      )}\n    </YearCalendarPrimitive.PrevButton>\n  )\n}\n\n/** A ghost button with lucide's ChevronRight; Base UI names it. */\nfunction YearCalendarNextButton({\n  className,\n  children,\n  variant = 'ghost',\n  ...props\n}: YearCalendarPrimitive.NextButton.Props & Pick<ButtonVariants, 'variant'>) {\n  return (\n    <YearCalendarPrimitive.NextButton\n      data-slot=\"year-calendar-next-button\"\n      className={cn(buttonVariants({ variant }), yearCalendarNavButtonClassName, className)}\n      {...props}\n    >\n      {children ?? (\n        <SvgIcon className={yearCalendarNavIconClassName}>\n          <path d=\"m9 18 6-6-6-6\" />\n        </SvgIcon>\n      )}\n    </YearCalendarPrimitive.NextButton>\n  )\n}\n\nfunction YearCalendarHeading({ className, ...props }: YearCalendarPrimitive.Heading.Props) {\n  return (\n    <YearCalendarPrimitive.Heading\n      data-slot=\"year-calendar-heading\"\n      className={cn(yearCalendarHeadingClassName, className)}\n      {...props}\n    />\n  )\n}\n\n/** Without children it draws the page of years, styled, in rows of the Root's `columns`. */\nfunction YearCalendarYearGrid({\n  className,\n  children,\n  ...props\n}: YearCalendarPrimitive.YearGrid.Props) {\n  return (\n    <YearCalendarPrimitive.YearGrid\n      data-slot=\"year-calendar-year-grid\"\n      className={cn(yearCalendarGridClassName, className)}\n      {...props}\n    >\n      {children ??\n        ((grid) => (\n          <YearCalendarGridBody>\n            {grid.rows.map((row, index) => (\n              <YearCalendarGridRow key={index}>\n                {row.map((entry) => (\n                  <YearCalendarCell key={entry.year} year={entry.year}>\n                    <YearCalendarYear />\n                  </YearCalendarCell>\n                ))}\n              </YearCalendarGridRow>\n            ))}\n          </YearCalendarGridBody>\n        ))}\n    </YearCalendarPrimitive.YearGrid>\n  )\n}\n\nfunction YearCalendarGridBody(props: YearCalendarPrimitive.GridBody.Props) {\n  return <YearCalendarPrimitive.GridBody data-slot=\"year-calendar-grid-body\" {...props} />\n}\n\nfunction YearCalendarGridRow({ className, ...props }: YearCalendarPrimitive.GridRow.Props) {\n  return (\n    <YearCalendarPrimitive.GridRow\n      data-slot=\"year-calendar-grid-row\"\n      className={cn(yearCalendarRowClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction YearCalendarCell({ className, ...props }: YearCalendarPrimitive.Cell.Props) {\n  return (\n    <YearCalendarPrimitive.Cell\n      data-slot=\"year-calendar-cell\"\n      className={cn(yearCalendarCellClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction YearCalendarYear({ className, ...props }: YearCalendarPrimitive.Year.Props) {\n  return (\n    <YearCalendarPrimitive.Year\n      data-slot=\"year-calendar-year\"\n      className={cn(buttonVariants({ variant: 'ghost' }), yearCalendarYearClassName, className)}\n      {...props}\n    />\n  )\n}\n\nexport {\n  YearCalendar,\n  YearCalendarCell,\n  YearCalendarContent,\n  YearCalendarGridBody,\n  YearCalendarGridRow,\n  YearCalendarHeading,\n  YearCalendarNextButton,\n  YearCalendarPrevButton,\n  YearCalendarYear,\n  YearCalendarYearGrid,\n}\n",
      "type": "registry:ui",
      "target": "@ui/year-calendar.tsx"
    }
  ],
  "meta": {
    "baseUiNext": {
      "version": "0.1.1",
      "hash": "f57229f85d5c4e24a16101dbdc446d4fbca629a7867c3060cae7a0de23dfae13",
      "files": {
        "@ui/year-calendar.tsx": "e314aca2acfc41d4765abc393636f87773b2193bf56cbf9c04bda6782ea28c58"
      }
    }
  }
}
