{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "extends": "none",
  "name": "range-calendar",
  "title": "range-calendar",
  "description": "range-calendar",
  "dependencies": [
    "react-aria-components",
    "cn"
  ],
  "registryDependencies": [
    "https://intentui.com/r/calendar"
  ],
  "files": [
    {
      "path": "src/components/ui/range-calendar.tsx",
      "content": "\"use client\"\n\nimport { CalendarCell, CalendarGrid, CalendarGridBody } from \"react-aria-components/Calendar\"\nimport type { DateValue } from \"react-aria-components/DateField\"\nimport {\n  RangeCalendar as RangeCalendarPrimitive,\n  type RangeCalendarProps,\n} from \"react-aria-components/RangeCalendar\"\nimport { twJoin, cn } from \"cn\"\nimport { CalendarGridHeader, CalendarHeader } from \"./calendar\"\n\nexport function RangeCalendar<T extends DateValue>({\n  visibleDuration = { months: 1 },\n  ...props\n}: RangeCalendarProps<T>) {\n  return (\n    <RangeCalendarPrimitive data-slot=\"calendar\" visibleDuration={visibleDuration} {...props}>\n      <CalendarHeader />\n      <div className=\"flex snap-x items-start justify-stretch gap-6 overflow-auto sm:gap-10\">\n        {Array.from({ length: visibleDuration?.months ?? 1 }).map((_, index) => {\n          const id = index + 1\n          return (\n            <CalendarGrid\n              key={index}\n              offset={id >= 2 ? { months: id - 1 } : undefined}\n              className=\"[&_td]:border-collapse [&_td]:px-0 [&_td]:py-0.5\"\n            >\n              <CalendarGridHeader />\n              <CalendarGridBody className=\"snap-start\">\n                {(date) => (\n                  <CalendarCell\n                    date={date}\n                    className={({ isToday }) =>\n                      twJoin(\n                        \"shrink-0 [--cell-foreground:var(--color-primary-subtle-foreground)] [--cell:var(--color-primary-subtle)]\",\n                        \"group/calendar-cell relative size-11 cursor-default leading-[2.286rem] outline-hidden selection-start:rounded-s-lg data-selection-end:rounded-e-lg data-outside-month:text-muted-foreground sm:size-9 sm:text-sm\",\n                        \"selected:bg-(--cell) selected:text-(--cell-foreground)\",\n                        \"selected:after:bg-primary-foreground focus-visible:after:bg-primary-foreground\",\n                        \"invalid:selected:bg-danger-subtle\",\n                        \"[td:first-child_&]:rounded-s-lg [td:last-child_&]:rounded-e-lg\",\n                        \"forced-colors:selected:bg-[Highlight] forced-colors:selected:text-[HighlightText] forced-colors:invalid:selected:bg-[Mark]\",\n                        isToday &&\n                          \"after:pointer-events-none after:absolute after:start-1/2 after:bottom-1 after:z-10 after:size-0.75 after:-translate-x-1/2 after:rounded-full after:bg-primary selected:after:bg-primary-foreground\"\n                      )\n                    }\n                  >\n                    {({\n                      formattedDate,\n                      isSelected,\n                      isSelectionStart,\n                      isSelectionEnd,\n                      isDisabled,\n                    }) => (\n                      <span\n                        className={cn(\n                          \"flex size-full items-center justify-center rounded-lg tabular-nums forced-color-adjust-none\",\n                          isSelected && (isSelectionStart || isSelectionEnd)\n                            ? \"bg-primary text-primary-foreground group-invalid/calendar-cell:bg-danger group-invalid/calendar-cell:text-danger-foreground forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:group-invalid/calendar-cell:bg-[Mark]\"\n                            : isSelected\n                              ? [\n                                  // hover\n                                  \"group-hover/calendar-cell:bg-primary/15\",\n                                  // pressed\n                                  \"group-pressed/calendar-cell:bg-(--cell)\",\n                                  // invalid\n                                  \"group-invalid/calendar-cell:text-danger-subtle-foreground group-invalid/calendar-cell:group-hover/calendar-cell:bg-danger/15 group-invalid/calendar-cell:group-pressed/calendar-cell:bg-danger/30\",\n                                  // forced-colors\n                                  \"forced-colors:text-[HighlightText] forced-colors:group-pressed/calendar-cell:bg-[Highlight] forced-colors:group-hover/calendar-cell:bg-[Highlight] forced-colors:group-invalid/calendar-cell:group-pressed/calendar-cell:bg-[Mark] forced-colors:group-invalid:group-hover/calendar-cell:bg-[Mark]\",\n                                ]\n                              : \"group-hover/calendar-cell:bg-secondary-foreground/15 group-pressed/calendar-cell:bg-secondary-foreground/20 forced-colors:group-pressed/calendar-cell:bg-[Highlight]\",\n                          isDisabled && \"opacity-50 forced-colors:text-[GrayText]\"\n                        )}\n                      >\n                        {formattedDate}\n                      </span>\n                    )}\n                  </CalendarCell>\n                )}\n              </CalendarGridBody>\n            </CalendarGrid>\n          )\n        })}\n      </div>\n    </RangeCalendarPrimitive>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "cssVars": {
    "theme": {
      "color-primary-subtle": "var(--primary-subtle)",
      "color-primary-subtle-foreground": "var(--primary-subtle-foreground)",
      "color-danger-subtle": "var(--danger-subtle)",
      "color-danger-subtle-foreground": "var(--danger-subtle-foreground)"
    },
    "light": {
      "primary-subtle": "oklch(0.623 0.214 259.815 / 0.15)",
      "primary-subtle-foreground": "oklch(0.488 0.243 264.376)",
      "danger-subtle": "oklch(0.637 0.237 25.331 / 0.15)",
      "danger-subtle-foreground": "oklch(0.505 0.213 27.518)"
    },
    "dark": {
      "primary-subtle": "oklch(0.623 0.214 259.815 / 0.1)",
      "primary-subtle-foreground": "oklch(0.707 0.165 254.624)",
      "danger-subtle": "oklch(0.637 0.237 25.331 / 0.1)",
      "danger-subtle-foreground": "oklch(0.704 0.191 22.216)"
    }
  },
  "type": "registry:ui"
}