{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "year-range-picker",
  "type": "registry:ui",
  "title": "Year Range 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/year-picker.json",
    "https://hamur.dev/r/react/popover.json"
  ],
  "files": [
    {
      "path": "react/year-range-picker.tsx",
      "content": "'use client'\n\nimport type * as React from 'react' // base-ui-next/ui year-range-picker@0.1.0\nimport { YearRangePicker as YearRangePickerPrimitive } from '@base-ui-next/react/year-range-picker'\nimport { cn } from '@/lib/utils'\nimport { buttonVariants } from '@/components/ui/button'\nimport { YearCalendarContent } from '@/components/ui/year-calendar'\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 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 yearRangePickerControlClassName = 'w-fit'\n\nconst yearRangePickerInputClassName = 'flex flex-none items-center'\n\nconst yearRangePickerSeparatorClassName = 'px-1 text-muted-foreground'\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 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 YearRangePicker({ ...props }: YearRangePickerPrimitive.Root.Props) {\n  return <YearRangePickerPrimitive.Root {...props} />\n}\n\nfunction YearRangePickerControl({ className, ...props }: YearRangePickerPrimitive.Control.Props) {\n  return (\n    <YearRangePickerPrimitive.Control\n      data-slot=\"year-range-picker-control\"\n      className={cn(yearPickerControlClassName, yearRangePickerControlClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction YearRangePickerInput({\n  className,\n  children,\n  ...props\n}: YearRangePickerPrimitive.Input.Props) {\n  return (\n    <YearRangePickerPrimitive.Input\n      data-slot=\"year-range-picker-input\"\n      className={cn(yearRangePickerInputClassName, className)}\n      {...props}\n    >\n      {children ??\n        (({ segments }) =>\n          segments.map((segment) => (\n            <YearRangePickerSegment key={segment.index} segment={segment} />\n          )))}\n    </YearRangePickerPrimitive.Input>\n  )\n}\n\nfunction YearRangePickerSegment({ className, ...props }: YearRangePickerPrimitive.Segment.Props) {\n  return (\n    <YearRangePickerPrimitive.Segment\n      data-slot=\"year-range-picker-segment\"\n      className={cn(yearPickerSegmentClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction YearRangePickerSeparator({\n  className,\n  children,\n  ...props\n}: YearRangePickerPrimitive.Separator.Props) {\n  return (\n    <YearRangePickerPrimitive.Separator\n      data-slot=\"year-range-picker-separator\"\n      className={cn(yearRangePickerSeparatorClassName, className)}\n      {...props}\n    >\n      {children ?? '–'}\n    </YearRangePickerPrimitive.Separator>\n  )\n}\n\nfunction YearRangePickerClear({\n  className,\n  children,\n  ...props\n}: YearRangePickerPrimitive.Clear.Props) {\n  return (\n    <YearRangePickerPrimitive.Clear\n      data-slot=\"year-range-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    </YearRangePickerPrimitive.Clear>\n  )\n}\n\nfunction YearRangePickerTrigger({\n  className,\n  children,\n  ...props\n}: YearRangePickerPrimitive.Trigger.Props) {\n  return (\n    <YearRangePickerPrimitive.Trigger\n      data-slot=\"year-range-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    </YearRangePickerPrimitive.Trigger>\n  )\n}\n\nfunction YearRangePickerPortal({ ...props }: YearRangePickerPrimitive.Portal.Props) {\n  return <YearRangePickerPrimitive.Portal {...props} />\n}\n\nfunction YearRangePickerPositioner({\n  className,\n  align = 'start',\n  sideOffset = 4,\n  ...props\n}: YearRangePickerPrimitive.Positioner.Props) {\n  return (\n    <YearRangePickerPrimitive.Positioner\n      data-slot=\"year-range-picker-positioner\"\n      align={align}\n      sideOffset={sideOffset}\n      className={cn(popoverContentPositionerClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction YearRangePickerPopup({ className, ...props }: YearRangePickerPrimitive.Popup.Props) {\n  return (\n    <YearRangePickerPrimitive.Popup\n      data-slot=\"year-range-picker-popup\"\n      className={cn(popoverContentClassName, yearPickerPopupClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction YearRangePickerCalendar({\n  className,\n  children,\n  buttonVariant,\n  ...props\n}: YearRangePickerPrimitive.Calendar.Props & React.ComponentProps<typeof YearCalendarContent>) {\n  return (\n    <YearRangePickerPrimitive.Calendar\n      data-slot=\"year-range-picker-calendar\"\n      className={cn(yearCalendarClassName, className)}\n      {...props}\n    >\n      {children ?? <YearCalendarContent buttonVariant={buttonVariant} />}\n    </YearRangePickerPrimitive.Calendar>\n  )\n}\n\nfunction YearRangePickerPreset({ className, ...props }: YearRangePickerPrimitive.Preset.Props) {\n  return (\n    <YearRangePickerPrimitive.Preset\n      data-slot=\"year-range-picker-preset\"\n      className={cn(\n        buttonVariants({ variant: 'ghost', size: 'sm' }),\n        yearPickerPresetClassName,\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction YearRangePickerClose({ className, ...props }: YearRangePickerPrimitive.Close.Props) {\n  return (\n    <YearRangePickerPrimitive.Close\n      data-slot=\"year-range-picker-close\"\n      className={cn(\n        buttonVariants({ variant: 'outline', size: 'sm' }),\n        yearPickerCloseClassName,\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  YearRangePicker,\n  YearRangePickerCalendar,\n  YearRangePickerClear,\n  YearRangePickerClose,\n  YearRangePickerControl,\n  YearRangePickerInput,\n  YearRangePickerPopup,\n  YearRangePickerPortal,\n  YearRangePickerPositioner,\n  YearRangePickerPreset,\n  YearRangePickerSegment,\n  YearRangePickerSeparator,\n  YearRangePickerTrigger,\n}\n",
      "type": "registry:ui",
      "target": "@ui/year-range-picker.tsx"
    }
  ],
  "meta": {
    "baseUiNext": {
      "version": "0.1.0",
      "hash": "0cb2f47c6d391ee3e92364432daa973d5998de24a99a509b2004e7179e13dff7",
      "files": {
        "@ui/year-range-picker.tsx": "684e708ddeef230080394dc634d7f3605f32ff0d4336daac4ced962371baa24e"
      }
    }
  }
}
