{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "year-picker",
  "type": "registry:ui",
  "title": "Year Picker",
  "dependencies": [
    "@base-ui-next/react"
  ],
  "registryDependencies": [
    "https://hamur.dev/r/react/utils.json",
    "https://hamur.dev/r/react/button.json",
    "https://hamur.dev/r/react/year-calendar.json",
    "https://hamur.dev/r/react/popover.json"
  ],
  "files": [
    {
      "path": "react/year-picker.tsx",
      "content": "'use client'\n\nimport type * as React from 'react' // base-ui-next/ui year-picker@0.1.1\nimport { YearPicker as YearPickerPrimitive } from '@base-ui-next/react/year-picker'\nimport { cn } from '@/lib/utils'\nimport { buttonVariants } from '@/components/ui/button'\nimport { YearCalendarContent } from '@/components/ui/year-calendar'\n\nconst popoverContentPositionerClassName = 'isolate z-50'\n\nconst popoverContentClassName =\n  'z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95'\n\nconst yearPickerControlClassName =\n  'flex h-9 w-fit min-w-0 items-center gap-0.5 rounded-md border border-input bg-transparent pr-1 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-invalid:border-destructive data-invalid:focus-within:ring-destructive/20 dark:bg-input/30 dark:data-invalid:border-destructive/50 dark:data-invalid:focus-within:ring-destructive/40'\n\nconst yearPickerInputClassName = 'flex min-w-0 flex-1 items-center'\n\nconst yearPickerSegmentClassName =\n  'm-0 h-6 w-[calc(2ch+4px)] min-w-0 rounded-sm border-0 bg-transparent p-0 text-center tabular-nums caret-transparent outline-hidden selection:bg-transparent placeholder:text-muted-foreground focus:bg-primary focus:text-primary-foreground focus:placeholder:text-primary-foreground data-invalid:text-destructive data-invalid:underline data-invalid:decoration-dashed data-[type=literal]:w-auto data-[type=literal]:px-px data-[type=literal]:text-muted-foreground data-[type=literal]:whitespace-pre data-[type=year]:w-[calc(4ch+4px)]'\n\nconst yearPickerClearClassName = 'data-empty:invisible'\n\nconst yearPickerTriggerClassName = 'shrink-0'\n\nconst yearPickerPopupClassName = 'w-auto gap-0 p-0'\n\nconst yearPickerPresetClassName =\n  'justify-start data-selected:bg-muted data-selected:font-medium'\n\nconst yearPickerCloseClassName = 'm-3 mt-0 self-end'\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\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\n// No shadcn item: one name per Base UI part (docs/design/log/month-year-picker.md).\nfunction YearPicker({ ...props }: YearPickerPrimitive.Root.Props) {\n  return <YearPickerPrimitive.Root {...props} />\n}\n\nfunction YearPickerControl({ className, ...props }: YearPickerPrimitive.Control.Props) {\n  return (\n    <YearPickerPrimitive.Control\n      data-slot=\"year-picker-control\"\n      className={cn(yearPickerControlClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction YearPickerInput({ className, children, ...props }: YearPickerPrimitive.Input.Props) {\n  return (\n    <YearPickerPrimitive.Input\n      data-slot=\"year-picker-input\"\n      className={cn(yearPickerInputClassName, className)}\n      {...props}\n    >\n      {children ??\n        (({ segments }) =>\n          segments.map((segment) => <YearPickerSegment key={segment.index} segment={segment} />))}\n    </YearPickerPrimitive.Input>\n  )\n}\n\nfunction YearPickerSegment({ className, ...props }: YearPickerPrimitive.Segment.Props) {\n  return (\n    <YearPickerPrimitive.Segment\n      data-slot=\"year-picker-segment\"\n      className={cn(yearPickerSegmentClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction YearPickerClear({ className, children, ...props }: YearPickerPrimitive.Clear.Props) {\n  return (\n    <YearPickerPrimitive.Clear\n      data-slot=\"year-picker-clear\"\n      className={cn(\n        buttonVariants({ variant: 'ghost', size: 'icon-xs' }),\n        yearPickerClearClassName,\n        className,\n      )}\n      {...props}\n    >\n      {children ?? (\n        <SvgIcon>\n          <path d=\"M18 6 6 18\" />\n          <path d=\"m6 6 12 12\" />\n        </SvgIcon>\n      )}\n    </YearPickerPrimitive.Clear>\n  )\n}\n\nfunction YearPickerTrigger({ className, children, ...props }: YearPickerPrimitive.Trigger.Props) {\n  return (\n    <YearPickerPrimitive.Trigger\n      data-slot=\"year-picker-trigger\"\n      className={cn(\n        buttonVariants({ variant: 'ghost', size: 'icon-sm' }),\n        yearPickerTriggerClassName,\n        className,\n      )}\n      {...props}\n    >\n      {children ?? (\n        <SvgIcon>\n          <path d=\"M8 2v4\" />\n          <path d=\"M16 2v4\" />\n          <rect width=\"18\" height=\"18\" x=\"3\" y=\"4\" rx=\"2\" />\n          <path d=\"M3 10h18\" />\n        </SvgIcon>\n      )}\n    </YearPickerPrimitive.Trigger>\n  )\n}\n\nfunction YearPickerPortal({ ...props }: YearPickerPrimitive.Portal.Props) {\n  return <YearPickerPrimitive.Portal {...props} />\n}\n\nfunction YearPickerPositioner({\n  className,\n  align = 'start',\n  sideOffset = 4,\n  ...props\n}: YearPickerPrimitive.Positioner.Props) {\n  return (\n    <YearPickerPrimitive.Positioner\n      data-slot=\"year-picker-positioner\"\n      align={align}\n      sideOffset={sideOffset}\n      className={cn(popoverContentPositionerClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction YearPickerPopup({ className, ...props }: YearPickerPrimitive.Popup.Props) {\n  return (\n    <YearPickerPrimitive.Popup\n      data-slot=\"year-picker-popup\"\n      className={cn(popoverContentClassName, yearPickerPopupClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction YearPickerCalendar({\n  className,\n  children,\n  buttonVariant,\n  ...props\n}: YearPickerPrimitive.Calendar.Props & React.ComponentProps<typeof YearCalendarContent>) {\n  return (\n    <YearPickerPrimitive.Calendar\n      data-slot=\"year-picker-calendar\"\n      className={cn(yearCalendarClassName, className)}\n      {...props}\n    >\n      {children ?? <YearCalendarContent buttonVariant={buttonVariant} />}\n    </YearPickerPrimitive.Calendar>\n  )\n}\n\nfunction YearPickerPreset({ className, ...props }: YearPickerPrimitive.Preset.Props) {\n  return (\n    <YearPickerPrimitive.Preset\n      data-slot=\"year-picker-preset\"\n      className={cn(\n        buttonVariants({ variant: 'ghost', size: 'sm' }),\n        yearPickerPresetClassName,\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction YearPickerClose({ className, ...props }: YearPickerPrimitive.Close.Props) {\n  return (\n    <YearPickerPrimitive.Close\n      data-slot=\"year-picker-close\"\n      className={cn(\n        buttonVariants({ variant: 'outline', size: 'sm' }),\n        yearPickerCloseClassName,\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  YearPicker,\n  YearPickerCalendar,\n  YearPickerClear,\n  YearPickerClose,\n  YearPickerControl,\n  YearPickerInput,\n  YearPickerPopup,\n  YearPickerPortal,\n  YearPickerPositioner,\n  YearPickerPreset,\n  YearPickerSegment,\n  YearPickerTrigger,\n}\n",
      "type": "registry:ui",
      "target": "@ui/year-picker.tsx"
    }
  ],
  "meta": {
    "baseUiNext": {
      "version": "0.1.1",
      "hash": "1229e3505fbf1a104f82abae42d0ba024b390b540d2a92ade4eb7444af060d42",
      "files": {
        "@ui/year-picker.tsx": "699ced1853f58f36970d188cafbd4d0c240cd7552eda946b55efb3ec36065370"
      }
    }
  }
}
