{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "extends": "none",
  "name": "date-range-picker",
  "title": "date-range-picker",
  "description": "date-range-picker",
  "dependencies": [
    "@heroicons/react",
    "react-aria-components",
    "cn",
    "tailwindcss-react-aria-components"
  ],
  "registryDependencies": [
    "https://intentui.com/r/popover",
    "https://intentui.com/r/date-field",
    "https://intentui.com/r/input",
    "https://intentui.com/r/primitive",
    "https://intentui.com/r/field",
    "https://intentui.com/r/use-mobile",
    "https://intentui.com/r/dialog",
    "https://intentui.com/r/range-calendar"
  ],
  "files": [
    {
      "path": "src/components/ui/date-range-picker.tsx",
      "content": "\"use client\"\n\nimport { CalendarDateRangeIcon } from \"@heroicons/react/24/outline\"\nimport { Button as PrimitiveButton } from \"react-aria-components/Button\"\nimport { type DateValue } from \"react-aria-components/DatePicker\"\nimport {\n  DateRangePicker as DateRangePickerPrimitive,\n  type DateRangePickerProps as DateRangePickerPrimitiveProps,\n} from \"react-aria-components/DateRangePicker\"\nimport { Popover, type PopoverProps } from \"@/components/ui/popover\"\nimport { twJoin } from \"cn\"\nimport { DateInput as PrimitiveDateInput } from \"@/components/ui/date-field\"\nimport { InputGroup } from \"@/components/ui/input\"\nimport { cx } from \"@/lib/primitive\"\nimport { fieldStyles } from \"./field\"\nimport { useIsMobile } from \"@/hooks/use-mobile\"\nimport { Dialog } from \"@/components/ui/dialog\"\nimport { RangeCalendar } from \"@/components/ui/range-calendar\"\n\nexport interface DateRangePickerProps<\n  T extends DateValue,\n> extends DateRangePickerPrimitiveProps<T> {\n  popover?: Omit<PopoverProps, \"children\">\n  rangeCalendar?: React.ComponentProps<typeof RangeCalendar>\n}\n\nexport function DateRangePicker<T extends DateValue>({\n  className,\n  popover,\n  children,\n  rangeCalendar,\n  ...props\n}: DateRangePickerProps<T>) {\n  const isMobile = useIsMobile()\n\n  return (\n    <DateRangePickerPrimitive\n      data-slot=\"control\"\n      className={cx(fieldStyles({ className: \"group/date-range-picker\" }), className)}\n      {...props}\n    >\n      {(values) => (\n        <>\n          {typeof children === \"function\" ? children(values) : children}\n          {isMobile ? (\n            <Dialog aria-label=\"Date picker\" closeButton={false}>\n              <div\n                className={twJoin(\n                  \"flex overflow-auto p-6\",\n                  (rangeCalendar?.numberOfMonths ?? 1) > 1 ? \"justify-start\" : \"justify-center\"\n                )}\n              >\n                <RangeCalendar {...rangeCalendar} />\n              </div>\n            </Dialog>\n          ) : (\n            <Popover placement={popover?.placement ?? \"bottom\"} className=\"p-2\">\n              <RangeCalendar {...rangeCalendar} />\n            </Popover>\n          )}\n        </>\n      )}\n    </DateRangePickerPrimitive>\n  )\n}\n\nexport function DateRangePickerTrigger({\n  className,\n  ...props\n}: React.ComponentProps<typeof InputGroup>) {\n  return (\n    <InputGroup\n      className={cx(\n        \"flex items-center overflow-hidden rounded-lg pe-6\",\n        \"border-input hover:enabled:border-muted-foreground/30 border\",\n        \"group-open/date-range-picker:border-ring/80 group-open/date-range-picker:bg-primary-subtle/5 group-open/date-range-picker:ring-ring/20 group-open/date-range-picker:hover:border-ring group-open/date-range-picker:ring-3 group-open/date-range-picker:outline-hidden\",\n        \"focus-within:border-ring/80 focus-within:bg-primary-subtle/5 focus-within:ring-ring/20 focus-within:enabled:hover:border-ring focus-within:ring-3 focus-within:outline-hidden\",\n        \"invalid:border-danger-subtle-foreground/80 invalid:bg-danger-subtle/5 focus-within:invalid:border-danger-subtle-foreground/80 focus-within:invalid:bg-danger-subtle/5 focus-within:invalid:ring-danger-subtle-foreground/20 invalid:hover:border-danger-subtle-foreground/80 focus-within:invalid:hover:border-danger-subtle-foreground/80\",\n        \"disabled:bg-muted\",\n        className\n      )}\n      {...props}\n    >\n      <DateInput slot=\"start\" />\n      <span\n        aria-hidden=\"true\"\n        className=\"bg-foreground group-disabled/date-range-picker:text-opacity-50 pointer-events-none z-10 -mx-3 block h-0.5 w-2 shrink-0 self-center rounded-full sm:-mx-2 forced-colors:text-[ButtonText] forced-colors:group-disabled/date-range-picker:text-[GrayText]\"\n      />\n      <DateInput slot=\"end\" />\n      <PrimitiveButton\n        data-slot=\"date-picker-trigger\"\n        className=\"touch-target focus-visible:text-foreground pressed:text-foreground text-muted-foreground hover:text-foreground focus-visible:text-foreground grid place-content-center px-[calc(--spacing(3.5)-1px)] py-[calc(--spacing(2.5)-1px)] outline-hidden *:-me-px *:-mt-0.5 *:size-5 sm:px-[calc(--spacing(3)-1px)] sm:py-[calc(--spacing(1.5)-1px)] sm:*:size-4\"\n      >\n        <CalendarDateRangeIcon />\n      </PrimitiveButton>\n    </InputGroup>\n  )\n}\n\nexport function DateInput({\n  className,\n  ...props\n}: React.ComponentProps<typeof PrimitiveDateInput>) {\n  return (\n    <PrimitiveDateInput\n      className={cx(\"rounded-none border-none focus-within:ring-0\", className)}\n      {...props}\n    />\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "cssVars": {
    "theme": {
      "color-primary-subtle": "var(--primary-subtle)",
      "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)",
      "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)",
      "danger-subtle": "oklch(0.637 0.237 25.331 / 0.1)",
      "danger-subtle-foreground": "oklch(0.704 0.191 22.216)"
    }
  },
  "css": {
    "@plugin \"tailwindcss-react-aria-components\"": {}
  },
  "type": "registry:ui"
}