{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "date-picker",
  "type": "registry:ui",
  "title": "Date Picker",
  "description": "A date picker component",
  "dependencies": [
    "solid-js",
    "@ark-ui/solid"
  ],
  "registryDependencies": [
    "https://solid-ui.com/r/button.json"
  ],
  "files": [
    {
      "path": "src/registry/ui/date-picker.tsx",
      "content": "import { children, Show, splitProps } from \"solid-js\"\n\nimport { DatePicker as DatePickerPrimitive } from \"@ark-ui/solid\"\n\nimport { cn } from \"~/lib/utils\"\nimport { buttonVariants } from \"~/registry/ui/button\"\n\nconst DatePicker = DatePickerPrimitive.Root\nconst DatePickerLabel = DatePickerPrimitive.Label\nconst DatePickerContext = DatePickerPrimitive.Context\nconst DatePickerTableHead = DatePickerPrimitive.TableHead\nconst DatePickerTableBody = DatePickerPrimitive.TableBody\nconst DatePickerYearSelect = DatePickerPrimitive.YearSelect\nconst DatePickerMonthSelect = DatePickerPrimitive.MonthSelect\nconst DatePickerPositioner = DatePickerPrimitive.Positioner\n\nconst DatePickerControl = (props: DatePickerPrimitive.ControlProps) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <DatePickerPrimitive.Control\n      class={cn(\"inline-flex items-center gap-1\", local.class)}\n      {...others}\n    />\n  )\n}\n\nconst DatePickerInput = (props: DatePickerPrimitive.InputProps) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <DatePickerPrimitive.Input\n      class={cn(\n        \"h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-shadow placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-[1.5px] focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50\",\n        local.class\n      )}\n      {...others}\n    />\n  )\n}\n\nconst DatePickerTrigger = (props: DatePickerPrimitive.TriggerProps) => {\n  const [local, others] = splitProps(props, [\"class\", \"children\"])\n\n  // prevents rendering children twice\n  const resolvedChildren = children(() => local.children)\n  const hasChildren = () => resolvedChildren.toArray().length !== 0\n\n  return (\n    <DatePickerPrimitive.Trigger\n      class={cn(\n        \"flex min-h-9 min-w-9 items-center justify-center rounded-md border border-border bg-background transition-[box-shadow,background-color] hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-[1.5px] focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>svg]:size-4\",\n        local.class\n      )}\n      {...others}\n    >\n      <Show when={!hasChildren()} fallback={resolvedChildren()}>\n        <svg\n          xmlns=\"http://www.w3.org/2000/svg\"\n          viewBox=\"0 0 24 24\"\n          fill=\"none\"\n          stroke=\"currentColor\"\n          stroke-width=\"2\"\n          stroke-linecap=\"round\"\n          stroke-linejoin=\"round\"\n          class=\"size-4\"\n        >\n          <path d=\"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z\" />\n          <path d=\"M16 3v4\" />\n          <path d=\"M8 3v4\" />\n          <path d=\"M4 11h16\" />\n          <path d=\"M11 15h1\" />\n          <path d=\"M12 15v3\" />\n          <title>Calendar</title>\n        </svg>\n      </Show>\n    </DatePickerPrimitive.Trigger>\n  )\n}\n\nconst DatePickerContent = (props: DatePickerPrimitive.ContentProps) => {\n  const [local, others] = splitProps(props, [\"class\", \"children\"])\n\n  return (\n    <DatePickerPrimitive.Content\n      class={cn(\n        \"z-50 rounded-md border bg-popover p-3 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n        local.class\n      )}\n      {...others}\n    >\n      {local.children}\n    </DatePickerPrimitive.Content>\n  )\n}\n\nconst DatePickerView = (props: DatePickerPrimitive.ViewProps) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return <DatePickerPrimitive.View class={cn(\"space-y-4\", local.class)} {...others} />\n}\n\nconst DatePickerViewControl = (props: DatePickerPrimitive.ViewControlProps) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <DatePickerPrimitive.ViewControl\n      class={cn(\"flex items-center justify-between gap-4\", local.class)}\n      {...others}\n    />\n  )\n}\n\nconst DatePickerPrevTrigger = (props: DatePickerPrimitive.PrevTriggerProps) => {\n  const [local, others] = splitProps(props, [\"class\", \"children\"])\n\n  // prevents rendering children twice\n  const resolvedChildren = children(() => local.children)\n  const hasChildren = () => resolvedChildren.toArray().length !== 0\n\n  return (\n    <DatePickerPrimitive.PrevTrigger\n      class={cn(\n        buttonVariants({\n          variant: \"outline\"\n        }),\n        \"size-7 bg-transparent p-0 opacity-50 hover:opacity-100\",\n        local.class\n      )}\n      {...others}\n    >\n      <Show when={!hasChildren()} fallback={resolvedChildren()}>\n        <svg\n          xmlns=\"http://www.w3.org/2000/svg\"\n          viewBox=\"0 0 24 24\"\n          fill=\"none\"\n          stroke=\"currentColor\"\n          stroke-width=\"2\"\n          stroke-linecap=\"round\"\n          stroke-linejoin=\"round\"\n          class=\"size-4\"\n        >\n          <path d=\"M15 6l-6 6l6 6\" />\n          <title>Previous</title>\n        </svg>\n      </Show>\n    </DatePickerPrimitive.PrevTrigger>\n  )\n}\n\nconst DatePickerNextTrigger = (props: DatePickerPrimitive.NextTriggerProps) => {\n  const [local, others] = splitProps(props, [\"class\", \"children\"])\n\n  // prevents rendering children twice\n  const resolvedChildren = children(() => local.children)\n  const hasChildren = () => resolvedChildren.toArray().length !== 0\n\n  return (\n    <DatePickerPrimitive.NextTrigger\n      class={cn(\n        buttonVariants({\n          variant: \"outline\"\n        }),\n        \"size-7 bg-transparent p-0 opacity-50 hover:opacity-100\",\n        local.class\n      )}\n      {...others}\n    >\n      <Show when={!hasChildren()} fallback={resolvedChildren()}>\n        <svg\n          xmlns=\"http://www.w3.org/2000/svg\"\n          viewBox=\"0 0 24 24\"\n          fill=\"none\"\n          stroke=\"currentColor\"\n          stroke-width=\"2\"\n          stroke-linecap=\"round\"\n          stroke-linejoin=\"round\"\n          class=\"size-4\"\n        >\n          <path d=\"M9 6l6 6l-6 6\" />\n          <title>Next</title>\n        </svg>\n      </Show>\n    </DatePickerPrimitive.NextTrigger>\n  )\n}\n\nconst DatePickerViewTrigger = (props: DatePickerPrimitive.ViewTriggerProps) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <DatePickerPrimitive.ViewTrigger\n      class={cn(buttonVariants({ variant: \"ghost\" }), \"h-7\", local.class)}\n      {...others}\n    />\n  )\n}\n\nconst DatePickerRangeText = (props: DatePickerPrimitive.RangeTextProps) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <DatePickerPrimitive.RangeText class={cn(\"text-sm font-medium\", local.class)} {...others} />\n  )\n}\n\nconst DatePickerTable = (props: DatePickerPrimitive.TableProps) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <DatePickerPrimitive.Table\n      class={cn(\"w-full border-collapse space-y-1\", local.class)}\n      {...others}\n    />\n  )\n}\n\nconst DatePickerTableRow = (props: DatePickerPrimitive.TableRowProps) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return <DatePickerPrimitive.TableRow class={cn(\"mt-2 flex w-full\", local.class)} {...others} />\n}\n\nconst DatePickerTableHeader = (props: DatePickerPrimitive.TableHeaderProps) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <DatePickerPrimitive.TableHeader\n      class={cn(\"w-8 flex-1 text-[0.8rem] font-normal text-muted-foreground\", local.class)}\n      {...others}\n    />\n  )\n}\n\nconst DatePickerTableCell = (props: DatePickerPrimitive.TableCellProps) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <DatePickerPrimitive.TableCell\n      class={cn(\n        \"flex-1 p-0 text-center text-sm has-[[data-range-end]]:rounded-r-md has-[[data-range-start]]:rounded-l-md has-[[data-in-range]]:bg-accent has-[[data-outside-range][data-in-range]]:bg-accent/50 has-[[data-in-range]]:first-of-type:rounded-l-md has-[[data-in-range]]:last-of-type:rounded-r-md\",\n        local.class\n      )}\n      {...others}\n    />\n  )\n}\n\nconst DatePickerTableCellTrigger = (props: DatePickerPrimitive.TableCellTriggerProps) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <DatePickerPrimitive.TableCellTrigger\n      class={cn(\n        buttonVariants({ variant: \"ghost\" }),\n        \"size-8 w-full p-0 font-normal data-[selected]:opacity-100\",\n        \"data-[today]:bg-accent data-[today]:text-accent-foreground\",\n        \"[&:is([data-today][data-selected])]:bg-primary [&:is([data-today][data-selected])]:text-primary-foreground\",\n        \"data-[selected]:bg-primary data-[selected]:text-primary-foreground data-[selected]:hover:bg-primary data-[selected]:hover:text-primary-foreground\",\n        \"data-[disabled]:text-muted-foreground data-[disabled]:opacity-50\",\n        \"data-[outside-range]:text-muted-foreground data-[outside-range]:opacity-50\",\n        \"[&:is([data-outside-range][data-in-range])]:bg-accent/50 [&:is([data-outside-range][data-in-range])]:text-muted-foreground [&:is([data-outside-range][data-in-range])]:opacity-30\",\n        local.class\n      )}\n      {...others}\n    />\n  )\n}\n\nexport {\n  DatePicker,\n  DatePickerLabel,\n  DatePickerControl,\n  DatePickerInput,\n  DatePickerTrigger,\n  DatePickerContent,\n  DatePickerView,\n  DatePickerViewControl,\n  DatePickerPrevTrigger,\n  DatePickerNextTrigger,\n  DatePickerViewTrigger,\n  DatePickerRangeText,\n  DatePickerContext,\n  DatePickerTable,\n  DatePickerTableHead,\n  DatePickerTableBody,\n  DatePickerTableRow,\n  DatePickerTableHeader,\n  DatePickerTableCell,\n  DatePickerTableCellTrigger,\n  DatePickerYearSelect,\n  DatePickerMonthSelect,\n  DatePickerPositioner\n}\n",
      "type": "registry:ui"
    }
  ]
}