{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "date-picker",
  "title": "Date Picker",
  "description": "A field that opens a calendar unfolding from it, with the selected day gliding to its new place.",
  "dependencies": [
    "@ui-sdk/core@0.1.0-beta.2",
    "@ui-sdk/react@0.1.0-beta.2"
  ],
  "registryDependencies": [
    "@keyframery/motion"
  ],
  "files": [
    {
      "path": "registry/components/keyframery/primitives/date-picker.tsx",
      "content": "\"use client\"\n\n/* Animated drop-in for `@ui-sdk/react/date-picker`: same parts, same props. Swap the import and keep your code.\n   This file adds motion only. Colours, radii, shadows and spacing stay yours.\n\n   - Unfold: the calendar pops out of the field from the point the doc gives, on a spring.\n   - Inside it, as the animated calendar: the chosen day's key glides between days (style it with\n     `before:` and `after:` on CalendarGrid), and a new month comes in from the side it was reached from.\n   - Press: the trigger, the month buttons, the days and the presets give under the pointer. */\n\nimport {\n  CalendarDay as CalendarDayPart,\n  CalendarGrid as CalendarGridPart,\n  CalendarHeading,\n  CalendarNext as CalendarNextPart,\n  CalendarPrevious as CalendarPreviousPart,\n  CalendarWeekdays,\n  CalendarWeeks as CalendarWeeksPart,\n  DatePicker as DatePickerRoot,\n  DatePickerContent as DatePickerContentPart,\n  DatePickerInput,\n  DatePickerPreset as DatePickerPresetPart,\n  DatePickerTrigger as DatePickerTriggerPart,\n} from \"@ui-sdk/react/date-picker\"\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport * from \"@ui-sdk/react/date-picker\"\n\n/* What the popup needs from the root: which way the months last turned, and how many show. */\nconst PickerContext = React.createContext<{\n  shown: React.RefObject<string | null>\n  direction: \"next\" | \"previous\" | \"none\"\n  months: number\n} | null>(null)\n\n/* Notes which way the months turn. Opening or closing starts fresh, so a reopened calendar\n   doesn't slide. */\nfunction DatePicker({\n  children,\n  onMonthChange,\n  onOpenChange,\n  ...props\n}: React.ComponentProps<typeof DatePickerRoot>) {\n  const shown = React.useRef<string | null>(null)\n  const [direction, setDirection] = React.useState<\"next\" | \"previous\" | \"none\">(\"none\")\n  const months = Math.max(1, Math.floor(props.months ?? 1) || 1)\n  return (\n    <PickerContext.Provider value={{ shown, direction, months }}>\n      <DatePickerRoot\n        onMonthChange={(month, details) => {\n          setDirection(shown.current && month < shown.current ? \"previous\" : \"next\")\n          onMonthChange?.(month, details)\n        }}\n        onOpenChange={(open, details) => {\n          setDirection(\"none\")\n          onOpenChange?.(open, details)\n        }}\n        {...props}\n      >\n        {children ?? (\n          <>\n            <DatePickerInput />\n            {props.mode === \"range\" && <DatePickerInput end />}\n            <DatePickerTrigger />\n            <DatePickerContent />\n          </>\n        )}\n      </DatePickerRoot>\n    </PickerContext.Provider>\n  )\n}\n\nfunction DatePickerTrigger({ className, ...props }: React.ComponentProps<typeof DatePickerTriggerPart>) {\n  return (\n    <DatePickerTriggerPart\n      className={cn(\n        \"transition-[scale] duration-[calc(200ms*var(--kf-speed,1))] ease-pop active:scale-[0.9] data-disabled:active:scale-100 motion-reduce:transition-none!\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction DatePickerPreset({ className, ...props }: React.ComponentProps<typeof DatePickerPresetPart>) {\n  return (\n    <DatePickerPresetPart\n      className={cn(\n        \"transition-[scale] duration-[calc(200ms*var(--kf-speed,1))] ease-pop active:scale-[0.96] data-disabled:active:scale-100 motion-reduce:transition-none!\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* Unfold: from 0.86 and a 6px blur, 8px toward the field, growing from the point the doc gives;\n   in on a spring, out quickly to 0.96. Without children it lays out a calendar. */\nfunction DatePickerContent({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof DatePickerContentPart>) {\n  const picker = React.useContext(PickerContext)\n  const months = picker?.months ?? 1\n  return (\n    <DatePickerContentPart\n      data-direction={picker?.direction ?? \"none\"}\n      className={cn(\n        \"group/picker-content origin-(--transform-origin)\",\n        \"transition-[opacity,scale,translate,filter] duration-[calc(380ms*var(--kf-speed,1))] ease-spring\",\n        \"data-starting-style:scale-[0.86] data-starting-style:opacity-0 data-starting-style:blur-[6px]\",\n        \"data-ending-style:scale-[0.96] data-ending-style:opacity-0 data-ending-style:blur-[6px] data-ending-style:duration-[calc(150ms*var(--kf-speed,1))] data-ending-style:ease-house\",\n        \"data-[side=bottom]:data-starting-style:-translate-y-2 data-[side=top]:data-starting-style:translate-y-2\",\n        \"data-[side=left]:data-starting-style:translate-x-2 data-[side=right]:data-starting-style:-translate-x-2\",\n        \"motion-reduce:transition-none!\",\n        className,\n      )}\n      {...props}\n    >\n      {children ?? (\n        <>\n          <CalendarPrevious />\n          <CalendarHeading />\n          <CalendarNext />\n          {Array.from({ length: months }, (_, offset) => (\n            <CalendarGrid key={offset} offset={offset} />\n          ))}\n        </>\n      )}\n    </DatePickerContentPart>\n  )\n}\n\n/* The calendar parts, animated as in the calendar primitive. */\n\nconst pressable =\n  \"transition-[scale] duration-[calc(200ms*var(--kf-speed,1))] ease-pop active:scale-[0.92] data-disabled:active:scale-100 motion-reduce:transition-none!\"\n\nfunction CalendarPrevious({ className, ...props }: React.ComponentProps<typeof CalendarPreviousPart>) {\n  return <CalendarPreviousPart className={cn(pressable, className)} {...props} />\n}\n\nfunction CalendarNext({ className, ...props }: React.ComponentProps<typeof CalendarNextPart>) {\n  return <CalendarNextPart className={cn(pressable, className)} {...props} />\n}\n\n/* One month. Its rows are keyed by the month, so a new month arrives as new rows.\n   The keys: neutral surfaces that follow the text colour until you give them your own. They glide\n   on a spring, and fade in late when a month that holds the chosen day arrives, so they land\n   after the weeks have slid in. In \"multiple\" mode there is no single key to glide. */\nfunction CalendarGrid({\n  className,\n  children,\n  offset = 0,\n  ...props\n}: React.ComponentProps<typeof CalendarGridPart>) {\n  const shown = React.useContext(PickerContext)?.shown ?? null\n  return (\n    <CalendarGridPart\n      offset={offset}\n      className={cn(\n        \"relative isolate [anchor-scope:--kf-day-a,--kf-day-b]\",\n        \"before:pointer-events-none before:absolute before:-z-10 before:opacity-0 before:content-[''] before:[position-anchor:--kf-day-a]\",\n        \"before:bg-[color-mix(in_oklch,currentColor_9%,transparent)]\",\n        \"before:top-[anchor(top)] before:right-[anchor(right)] before:bottom-[anchor(bottom)] before:left-[anchor(left)]\",\n        \"before:[transition:top_calc(300ms*var(--kf-speed,1))_var(--ease-spring),right_calc(300ms*var(--kf-speed,1))_var(--ease-spring),bottom_calc(300ms*var(--kf-speed,1))_var(--ease-spring),left_calc(300ms*var(--kf-speed,1))_var(--ease-spring),opacity_calc(220ms*var(--kf-speed,1))_var(--ease-house)_calc(180ms*var(--kf-speed,1))]\",\n        \"motion-reduce:before:[transition:none]!\",\n        \"after:pointer-events-none after:absolute after:-z-10 after:opacity-0 after:content-[''] after:[position-anchor:--kf-day-b]\",\n        \"after:bg-[color-mix(in_oklch,currentColor_9%,transparent)]\",\n        \"after:top-[anchor(top)] after:right-[anchor(right)] after:bottom-[anchor(bottom)] after:left-[anchor(left)]\",\n        \"after:[transition:top_calc(300ms*var(--kf-speed,1))_var(--ease-spring),right_calc(300ms*var(--kf-speed,1))_var(--ease-spring),bottom_calc(300ms*var(--kf-speed,1))_var(--ease-spring),left_calc(300ms*var(--kf-speed,1))_var(--ease-spring),opacity_calc(220ms*var(--kf-speed,1))_var(--ease-house)_calc(180ms*var(--kf-speed,1))]\",\n        \"motion-reduce:after:[transition:none]!\",\n        \"has-[[data-slot=calendar-day][data-selected]:not([data-range-middle]),[data-slot=calendar-day][data-range-start]]:before:opacity-100\",\n        \"has-[[data-slot=calendar-day][data-range-end]]:after:opacity-100\",\n        className,\n      )}\n      {...props}\n    >\n      {(grid) => {\n        if (shown && offset === 0) shown.current = grid.month\n        return (\n          <React.Fragment key={grid.month}>\n            {typeof children === \"function\"\n              ? children(grid)\n              : (children ?? (\n                  <>\n                    <CalendarWeekdays />\n                    <CalendarWeeks />\n                  </>\n                ))}\n          </React.Fragment>\n        )\n      }}\n    </CalendarGridPart>\n  )\n}\n\n/* Direction: the new weeks come 28px from the side the months turned to, blurred, on a spring. */\nfunction CalendarWeeks({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof CalendarWeeksPart>) {\n  return (\n    <CalendarWeeksPart\n      className={cn(\n        \"transition-[opacity,filter,translate] duration-[calc(460ms*var(--kf-speed,1))] ease-spring\",\n        \"starting:opacity-0 starting:blur-[6px]\",\n        \"group-data-[direction=none]/picker-content:starting:opacity-100 group-data-[direction=none]/picker-content:starting:blur-none\",\n        \"group-data-[direction=next]/picker-content:starting:translate-x-7 group-data-[direction=previous]/picker-content:starting:-translate-x-7\",\n        \"motion-reduce:transition-none!\",\n        className,\n      )}\n      {...props}\n    >\n      {children ?? ((cell) => <CalendarDay value={cell.date} />)}\n    </CalendarWeeksPart>\n  )\n}\n\n/* Names itself as the anchor the grid's keys follow, and gives under the pointer. */\nfunction CalendarDay({ className, ...props }: React.ComponentProps<typeof CalendarDayPart>) {\n  return (\n    <CalendarDayPart\n      className={cn(\n        \"data-selected:not-data-range-middle:not-data-range-end:[anchor-name:--kf-day-a] data-range-start:[anchor-name:--kf-day-a]\",\n        \"data-range-end:[anchor-name:--kf-day-b] data-range-start:data-range-end:[anchor-name:--kf-day-a,--kf-day-b]\",\n        \"transition-[scale] duration-[calc(200ms*var(--kf-speed,1))] ease-pop active:scale-[0.9] data-disabled:active:scale-100 motion-reduce:transition-none!\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  CalendarDay,\n  CalendarGrid,\n  CalendarNext,\n  CalendarPrevious,\n  CalendarWeeks,\n  DatePicker,\n  DatePickerContent,\n  DatePickerPreset,\n  DatePickerTrigger,\n}\n",
      "type": "registry:component",
      "target": "components/keyframery/primitives/date-picker.tsx"
    },
    {
      "path": "registry/components/keyframery/date-picker.tsx",
      "content": "\"use client\"\n\n/* Styled date picker: the animated primitive plus the Keyframery look. */\n\nimport * as React from \"react\"\n\nimport {\n  CalendarDay as CalendarDayPrimitive,\n  CalendarGrid as CalendarGridPrimitive,\n  CalendarHeading as CalendarHeadingPrimitive,\n  CalendarMonthSelect as CalendarMonthSelectPrimitive,\n  CalendarNext as CalendarNextPrimitive,\n  CalendarPrevious as CalendarPreviousPrimitive,\n  CalendarWeekday as CalendarWeekdayPrimitive,\n  CalendarWeekdays as CalendarWeekdaysPrimitive,\n  CalendarWeeks as CalendarWeeksPrimitive,\n  CalendarYearSelect as CalendarYearSelectPrimitive,\n  DatePicker as DatePickerPrimitive,\n  DatePickerClear as DatePickerClearPrimitive,\n  DatePickerContent as DatePickerContentPrimitive,\n  DatePickerHint as DatePickerHintPrimitive,\n  DatePickerInput as DatePickerInputPrimitive,\n  DatePickerPreset as DatePickerPresetPrimitive,\n  DatePickerTrigger as DatePickerTriggerPrimitive,\n  createDatePickerController,\n} from \"@/components/keyframery/primitives/date-picker\"\nimport { cn } from \"@/lib/utils\"\n\n/* What the popup needs from the root: how many months show, and the field box to line up with. */\nconst PickerContext = React.createContext<{\n  months: number\n  field: HTMLElement | null\n  setField: (element: HTMLElement | null) => void\n} | null>(null)\n\n/* The field look, as in Input: one hairline variable that hover, focus and invalid change. */\nconst fieldBox =\n  \"rounded-[10px] bg-background text-[13px] \" +\n  \"[--field-line:rgb(0_0_0/0.09)] dark:[--field-line:rgb(255_255_255/0.1)] \" +\n  \"shadow-[0_0_0_1px_var(--field-line),0_1px_2px_rgb(0_0_0/0.05)] dark:shadow-[0_0_0_1px_var(--field-line)] \" +\n  \"transition-[box-shadow,background-color] duration-[calc(150ms*var(--kf-speed,1))] ease-house motion-reduce:transition-none! \" +\n  \"hover:[--field-line:rgb(0_0_0/0.16)] dark:hover:[--field-line:rgb(255_255_255/0.18)]\"\n\n/* A small key: the month buttons. The primitive springs them back after a press. */\nconst stepKey = cn(\n  \"inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-[9px] bg-background text-muted-foreground outline-none select-none [&_svg]:size-4\",\n  \"shadow-[0_0_0_1px_rgb(0_0_0/0.06),0_1px_1px_rgb(0_0_0/0.05),0_3px_6px_-2px_rgb(0_0_0/0.1)]\",\n  \"dark:bg-accent dark:shadow-[0_0_0_1px_rgb(255_255_255/0.07),inset_0_1px_0_rgb(255_255_255/0.08),0_2px_6px_-1px_rgb(0_0_0/0.6)]\",\n  \"hover:text-foreground active:shadow-[0_0_0_1px_rgb(0_0_0/0.08),0_1px_1px_rgb(0_0_0/0.04)]\",\n  \"dark:active:shadow-[0_0_0_1px_rgb(255_255_255/0.07),inset_0_1px_0_rgb(255_255_255/0.05),0_1px_2px_rgb(0_0_0/0.6)]\",\n  \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-popover\",\n  \"data-disabled:pointer-events-none data-disabled:opacity-40\",\n)\n\n/* The native month and year selects, as compact fields. */\nconst selectField = cn(\n  \"h-7 cursor-pointer appearance-none rounded-[8px] bg-background px-2 text-[13px] font-medium text-foreground outline-none\",\n  \"shadow-[0_0_0_1px_rgb(0_0_0/0.09),0_1px_2px_rgb(0_0_0/0.05)] hover:shadow-[0_0_0_1px_rgb(0_0_0/0.16),0_1px_2px_rgb(0_0_0/0.05)]\",\n  \"dark:shadow-[0_0_0_1px_rgb(255_255_255/0.1)] dark:hover:shadow-[0_0_0_1px_rgb(255_255_255/0.16)]\",\n  \"transition-shadow duration-[calc(150ms*var(--kf-speed,1))] focus-visible:shadow-[0_0_0_1px_var(--ring)] focus-visible:ring-[3px] focus-visible:ring-ring/25\",\n  \"dark:focus-visible:shadow-[0_0_0_1px_var(--ring)]\",\n  \"data-disabled:pointer-events-none data-disabled:opacity-40 motion-reduce:transition-none!\",\n)\n\nfunction ChevronLeftIcon() {\n  return (\n    <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n      <path d=\"M9.5 3.5 5 8l4.5 4.5\" />\n    </svg>\n  )\n}\n\nfunction ChevronRightIcon() {\n  return (\n    <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n      <path d=\"M6.5 3.5 11 8l-4.5 4.5\" />\n    </svg>\n  )\n}\n\nfunction CalendarIcon() {\n  return (\n    <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n      <rect x=\"2.5\" y=\"3.5\" width=\"11\" height=\"10\" rx=\"2\" />\n      <path d=\"M2.5 6.75h11M5.5 2v2.5M10.5 2v2.5\" />\n    </svg>\n  )\n}\n\nfunction XIcon() {\n  return (\n    <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n      <path d=\"m4.5 4.5 7 7m0-7-7 7\" />\n    </svg>\n  )\n}\n\n/* The root. The popup lines up with the field box, so the root shares it with the popup. */\nfunction DatePicker({\n  className,\n  children,\n  months = 1,\n  ...props\n}: React.ComponentProps<typeof DatePickerPrimitive>) {\n  const [field, setField] = React.useState<HTMLElement | null>(null)\n  const count = Math.max(1, Math.floor(months) || 1)\n  return (\n    <PickerContext.Provider value={{ months: count, field, setField }}>\n      <DatePickerPrimitive\n        className={cn(\"group/picker flex w-full flex-col gap-1.5\", className)}\n        months={months}\n        {...props}\n      >\n        {children ?? (\n          <>\n            <DatePickerField>\n              <DatePickerInput />\n              {props.mode === \"range\" && (\n                <>\n                  <span aria-hidden className=\"px-1 text-muted-foreground/70\">–</span>\n                  <DatePickerInput end />\n                </>\n              )}\n              <DatePickerTrigger />\n            </DatePickerField>\n            <DatePickerContent />\n          </>\n        )}\n      </DatePickerPrimitive>\n    </PickerContext.Provider>\n  )\n}\n\n/* The field: the typed date and the calendar key sit inside one box, and the ring\n   follows the input's focus or the open calendar. The popup lines up with this box. */\nfunction DatePickerField({ className, ...props }: React.ComponentProps<\"div\">) {\n  const picker = React.useContext(PickerContext)\n  return (\n    <div\n      ref={picker?.setField}\n      data-slot=\"date-picker-field\"\n      className={cn(\n        fieldBox,\n        \"flex h-9 w-full min-w-0 cursor-text items-center gap-1 pr-1 pl-3 text-muted-foreground\",\n        \"has-[input:focus-visible]:ring-[3px] has-[input:focus-visible]:ring-ring/25 has-[input:focus-visible]:[--field-line:var(--ring)] dark:has-[input:focus-visible]:[--field-line:var(--ring)]\",\n        \"group-data-open/picker:[--field-line:var(--ring)] dark:group-data-open/picker:[--field-line:var(--ring)] group-data-open/picker:ring-[3px] group-data-open/picker:ring-ring/25\",\n        \"group-data-invalid/picker:ring-destructive/25! group-data-invalid/picker:[--field-line:var(--destructive)]!\",\n        \"group-data-disabled/picker:cursor-not-allowed group-data-disabled/picker:bg-muted group-data-disabled/picker:[--field-line:rgb(0_0_0/0.06)] dark:group-data-disabled/picker:[--field-line:rgb(255_255_255/0.06)]\",\n        \"group-data-readonly/picker:bg-muted/50\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction DatePickerInput({\n  className,\n  ...props\n}: React.ComponentProps<typeof DatePickerInputPrimitive>) {\n  return (\n    <DatePickerInputPrimitive\n      className={cn(\n        \"h-full w-full min-w-0 flex-1 bg-transparent text-[13px] text-foreground tabular-nums outline-none placeholder:text-muted-foreground/70\",\n        \"data-disabled:cursor-not-allowed data-disabled:text-muted-foreground\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* The calendar key at the end of the field. It stays lit while the calendar is open. */\nfunction DatePickerTrigger({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof DatePickerTriggerPrimitive>) {\n  return (\n    <DatePickerTriggerPrimitive\n      className={cn(\n        \"grid size-7 shrink-0 cursor-pointer place-items-center rounded-[7px] text-muted-foreground outline-none [&_svg]:size-4\",\n        \"transition-[color,background-color,scale] duration-[calc(200ms*var(--kf-speed,1))]\",\n        \"hover:bg-foreground/[0.06] hover:text-foreground\",\n        \"data-open:bg-accent data-open:text-foreground\",\n        \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background\",\n        \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n        className,\n      )}\n      {...props}\n    >\n      {children ?? <CalendarIcon />}\n    </DatePickerTriggerPrimitive>\n  )\n}\n\nfunction DatePickerHint({\n  className,\n  ...props\n}: React.ComponentProps<typeof DatePickerHintPrimitive>) {\n  return (\n    <DatePickerHintPrimitive\n      className={cn(\n        \"px-0.5 text-[12px] text-muted-foreground tabular-nums group-data-invalid/picker:text-destructive\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* Clears the date. It shrinks away while there's nothing to clear. */\nfunction DatePickerClear({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof DatePickerClearPrimitive>) {\n  return (\n    <DatePickerClearPrimitive\n      className={cn(\n        \"grid size-6 shrink-0 cursor-pointer place-items-center rounded-[7px] text-muted-foreground outline-none [&_svg]:size-3.5\",\n        \"transition-[color,background-color,opacity,scale] duration-[calc(150ms*var(--kf-speed,1))] ease-house\",\n        \"hover:bg-foreground/[0.06] hover:text-foreground active:scale-[0.9]\",\n        \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background\",\n        \"data-empty:pointer-events-none data-empty:scale-75 data-empty:opacity-0\",\n        \"data-disabled:pointer-events-none data-disabled:opacity-0 motion-reduce:transition-none!\",\n        className,\n      )}\n      {...props}\n    >\n      {children ?? <XIcon />}\n    </DatePickerClearPrimitive>\n  )\n}\n\n/* A shortcut like \"This weekend\". The chosen one reads as a pressed key. */\nfunction DatePickerPreset({\n  className,\n  ...props\n}: React.ComponentProps<typeof DatePickerPresetPrimitive>) {\n  return (\n    <DatePickerPresetPrimitive\n      className={cn(\n        \"inline-flex h-7 cursor-pointer items-center rounded-[8px] px-2.5 text-[12px] leading-none font-medium whitespace-nowrap text-muted-foreground outline-none select-none\",\n        \"transition-[color,background-color,box-shadow,scale] duration-[calc(200ms*var(--kf-speed,1))]\",\n        \"hover:bg-foreground/[0.05] hover:text-foreground\",\n        \"data-selected:bg-background data-selected:text-foreground data-selected:shadow-[0_0_0_1px_rgb(0_0_0/0.06),0_1px_1px_rgb(0_0_0/0.05),0_3px_6px_-2px_rgb(0_0_0/0.1)]\",\n        \"dark:data-selected:bg-accent dark:data-selected:shadow-[0_0_0_1px_rgb(255_255_255/0.07),inset_0_1px_0_rgb(255_255_255/0.08),0_2px_6px_-1px_rgb(0_0_0/0.6)]\",\n        \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-popover\",\n        \"data-disabled:pointer-events-none data-disabled:opacity-40\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* The sheet. The primitive unfolds it out of the field. Without children it lays out a styled calendar. */\nfunction DatePickerContent({\n  className,\n  children,\n  sideOffset = 6,\n  collisionPadding = 12,\n  anchor,\n  ...props\n}: React.ComponentProps<typeof DatePickerContentPrimitive>) {\n  const picker = React.useContext(PickerContext)\n  const months = picker?.months ?? 1\n  return (\n    <DatePickerContentPrimitive\n      sideOffset={sideOffset}\n      collisionPadding={collisionPadding}\n      anchor={anchor ?? picker?.field ?? undefined}\n      className={cn(\n        \"z-50 flex w-max flex-col gap-2 rounded-[14px] bg-popover p-3 text-popover-foreground outline-none\",\n        \"shadow-[0_0_0_1px_rgb(0_0_0/0.06),0_2px_6px_-2px_rgb(0_0_0/0.08),0_12px_32px_-8px_rgb(0_0_0/0.18)]\",\n        \"dark:shadow-[0_0_0_1px_rgb(255_255_255/0.08),0_12px_32px_-8px_rgb(0_0_0/0.7)]\",\n        /* As a sheet on small touch screens: full width, square at the bottom edge. */\n        \"data-[presentation=sheet]:w-full data-[presentation=sheet]:items-center data-[presentation=sheet]:rounded-b-none data-[presentation=sheet]:pb-6\",\n        className,\n      )}\n      {...props}\n    >\n      {children ?? (\n        <>\n          <CalendarHeader>\n            <CalendarPrevious />\n            <CalendarHeading />\n            <CalendarNext />\n          </CalendarHeader>\n          <div className=\"flex gap-4\">\n            {Array.from({ length: months }, (_, offset) => (\n              <CalendarGrid key={offset} offset={offset} />\n            ))}\n          </div>\n        </>\n      )}\n    </DatePickerContentPrimitive>\n  )\n}\n\n/* The calendar parts, as Calendar styles them, for inside the popup. */\n\n/* The row above the grid. The heading sits first, the month keys after it. */\nfunction CalendarHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"calendar-header\"\n      className={cn(\"flex h-7 items-center gap-1.5\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction CalendarHeading({\n  className,\n  ...props\n}: React.ComponentProps<typeof CalendarHeadingPrimitive>) {\n  return (\n    <CalendarHeadingPrimitive\n      className={cn(\n        \"order-first mr-auto pl-1.5 text-[15px] font-semibold tracking-tight tabular-nums\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction CalendarPrevious({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof CalendarPreviousPrimitive>) {\n  return (\n    <CalendarPreviousPrimitive className={cn(stepKey, className)} {...props}>\n      {children ?? <ChevronLeftIcon />}\n    </CalendarPreviousPrimitive>\n  )\n}\n\nfunction CalendarNext({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof CalendarNextPrimitive>) {\n  return (\n    <CalendarNextPrimitive className={cn(stepKey, className)} {...props}>\n      {children ?? <ChevronRightIcon />}\n    </CalendarNextPrimitive>\n  )\n}\n\nfunction CalendarMonthSelect({\n  className,\n  ...props\n}: React.ComponentProps<typeof CalendarMonthSelectPrimitive>) {\n  return <CalendarMonthSelectPrimitive className={cn(selectField, className)} {...props} />\n}\n\nfunction CalendarYearSelect({\n  className,\n  ...props\n}: React.ComponentProps<typeof CalendarYearSelectPrimitive>) {\n  return (\n    <CalendarYearSelectPrimitive\n      className={cn(selectField, \"tabular-nums\", className)}\n      {...props}\n    />\n  )\n}\n\n/* One month. The primitive draws the chosen day's key here, as `before:` (the date or a range's\n   start) and `after:` (a range's end), and glides it between days. This gives it the primary key look. */\nconst chosenKey = cn(\n  \"before:rounded-[9px] before:bg-primary after:rounded-[9px] after:bg-primary\",\n  \"before:shadow-[inset_0_1px_0_rgb(255_255_255/0.14),0_1px_2px_rgb(0_0_0/0.25)] after:shadow-[inset_0_1px_0_rgb(255_255_255/0.14),0_1px_2px_rgb(0_0_0/0.25)]\",\n  \"dark:before:shadow-[inset_0_1px_0_rgb(255_255_255/0.7),0_1px_2px_rgb(0_0_0/0.5)] dark:after:shadow-[inset_0_1px_0_rgb(255_255_255/0.7),0_1px_2px_rgb(0_0_0/0.5)]\",\n)\n\nfunction CalendarGrid({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof CalendarGridPrimitive>) {\n  return (\n    <CalendarGridPrimitive\n      className={cn(\n        \"border-separate border-spacing-x-0 border-spacing-y-0.5 data-disabled:opacity-50\",\n        chosenKey,\n        className,\n      )}\n      {...props}\n    >\n      {children ?? (\n        <>\n          <CalendarWeekdays />\n          <CalendarWeeks />\n        </>\n      )}\n    </CalendarGridPrimitive>\n  )\n}\n\nfunction CalendarWeekdays({\n  children,\n  ...props\n}: React.ComponentProps<typeof CalendarWeekdaysPrimitive>) {\n  return (\n    <CalendarWeekdaysPrimitive {...props}>\n      {children ?? ((index) => <CalendarWeekday index={index} />)}\n    </CalendarWeekdaysPrimitive>\n  )\n}\n\nfunction CalendarWeekday({\n  className,\n  ...props\n}: React.ComponentProps<typeof CalendarWeekdayPrimitive>) {\n  return (\n    <CalendarWeekdayPrimitive\n      className={cn(\n        \"h-7 w-8 p-0 text-center text-[11px] font-medium text-muted-foreground\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction CalendarWeeks({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof CalendarWeeksPrimitive>) {\n  return (\n    <CalendarWeeksPrimitive\n      className={className}\n      {...props}\n    >\n      {children ?? ((cell) => <CalendarDay value={cell.date} />)}\n    </CalendarWeeksPrimitive>\n  )\n}\n\n/* A day. The chosen key is drawn under it by the grid, so a chosen day only turns its number\n   to the key's text colour. A range is a soft band between the two keys, rounded where a week wraps. */\nfunction CalendarDay({\n  className,\n  ...props\n}: React.ComponentProps<typeof CalendarDayPrimitive>) {\n  return (\n    <CalendarDayPrimitive\n      className={cn(\n        \"relative size-8 cursor-pointer rounded-[9px] p-0 text-center align-middle text-[13px] leading-none font-medium text-foreground tabular-nums outline-none select-none\",\n        \"transition-[color,background-color,scale] duration-[calc(200ms*var(--kf-speed,1))]\",\n        \"not-data-selected:not-data-range-start:not-data-range-end:hover:bg-foreground/[0.06]\",\n        \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\",\n        /* Chosen: the number sits on the primary key. */\n        \"data-selected:not-data-range-middle:text-primary-foreground data-range-start:text-primary-foreground data-range-end:text-primary-foreground\",\n        /* Today: a small dot under the number. */\n        \"data-today:font-semibold data-today:after:absolute data-today:after:bottom-[3px] data-today:after:left-1/2 data-today:after:size-1 data-today:after:-translate-x-1/2 data-today:after:rounded-full data-today:after:bg-foreground\",\n        \"data-selected:not-data-range-middle:after:bg-primary-foreground data-range-start:after:bg-primary-foreground data-range-end:after:bg-primary-foreground\",\n        /* A range: the band between the keys. */\n        \"data-range-middle:rounded-none data-range-middle:bg-accent data-range-middle:text-accent-foreground data-range-middle:first:rounded-l-[9px] data-range-middle:last:rounded-r-[9px]\",\n        \"data-preview:not-data-range-start:not-data-range-end:rounded-none data-preview:not-data-range-start:not-data-range-end:bg-accent/70 data-preview:first:rounded-l-[9px] data-preview:last:rounded-r-[9px]\",\n        \"data-outside:text-muted-foreground/55\",\n        \"data-disabled:cursor-default data-disabled:text-muted-foreground/45 data-disabled:hover:bg-transparent\",\n        \"data-unavailable:line-through\",\n        \"motion-reduce:transition-none!\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  CalendarDay,\n  CalendarGrid,\n  CalendarHeader,\n  CalendarHeading,\n  CalendarMonthSelect,\n  CalendarNext,\n  CalendarPrevious,\n  CalendarWeekday,\n  CalendarWeekdays,\n  CalendarWeeks,\n  CalendarYearSelect,\n  DatePicker,\n  DatePickerClear,\n  DatePickerContent,\n  DatePickerField,\n  DatePickerHint,\n  DatePickerInput,\n  DatePickerPreset,\n  DatePickerTrigger,\n  createDatePickerController,\n}\n",
      "type": "registry:component",
      "target": "components/keyframery/date-picker.tsx"
    }
  ],
  "type": "registry:component"
}