{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "calendar",
  "type": "registry:ui",
  "dependencies": [
    "@corvu/calendar"
  ],
  "registryDependencies": [
    "@gc-solid/button"
  ],
  "files": [
    {
      "path": "ui/calendar.tsx",
      "content": "import type { Component, ComponentProps, JSX } from \"solid-js\"\nimport { Show, splitProps, type ValidComponent } from \"solid-js\"\n\nimport type {\n  CellProps,\n  CellTriggerProps,\n  DynamicProps,\n  HeadCellProps,\n  LabelProps,\n  NavProps,\n  TableProps\n} from \"@corvu/calendar\"\nimport CalendarPrimitive, { Root as CalendarPrimitiveRoot } from \"@corvu/calendar\"\n\nimport { cn } from \"@/lib/utils\"\nimport { buttonVariants } from \"@/components/ui/button\"\n\nconst Calendar = CalendarPrimitiveRoot\n\nconst CalendarHead: Component<ComponentProps<\"div\">> = (props) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <div\n      class={cn(\"relative flex w-full items-center justify-between pt-1 pb-4\", local.class)}\n      {...others}\n    />\n  )\n}\n\ntype CalendarTriggerProps<T extends ValidComponent = \"button\"> = Omit<NavProps<T>, \"action\"> & {\n  class?: string | undefined\n  children?: JSX.Element\n}\n\nconst CalendarPrevTrigger = <T extends ValidComponent = \"button\">(\n  props: DynamicProps<T, CalendarTriggerProps<T>>\n) => {\n  const [local, others] = splitProps(props as CalendarTriggerProps, [\"class\", \"children\"])\n  return (\n    <CalendarPrimitive.Nav\n      action=\"prev-month\"\n      aria-label=\"Go to previous month\"\n      class={cn(\n        buttonVariants({ variant: \"outline\" }),\n        \"size-7 bg-transparent p-0 opacity-50 hover:opacity-100\",\n        local.class\n      )}\n      {...others}\n    >\n      <Show\n        fallback={\n          <svg\n            class=\"size-4\"\n            fill=\"none\"\n            stroke=\"currentColor\"\n            stroke-linecap=\"round\"\n            stroke-linejoin=\"round\"\n            stroke-width=\"2\"\n            viewBox=\"0 0 24 24\"\n            xmlns=\"http://www.w3.org/2000/svg\"\n          >\n            <path d=\"M15 6l-6 6l6 6\" />\n          </svg>\n        }\n        when={local.children}\n      >\n        {(children) => children()}\n      </Show>\n    </CalendarPrimitive.Nav>\n  )\n}\n\nconst CalendarNextTrigger = <T extends ValidComponent = \"button\">(\n  props: DynamicProps<T, CalendarTriggerProps<T>>\n) => {\n  const [local, others] = splitProps(props as CalendarTriggerProps, [\"class\", \"children\"])\n  return (\n    <CalendarPrimitive.Nav\n      action=\"next-month\"\n      aria-label=\"Go to next month\"\n      class={cn(\n        buttonVariants({ variant: \"outline\" }),\n        \"size-7 bg-transparent p-0 opacity-50 hover:opacity-100\",\n        local.class\n      )}\n      {...others}\n    >\n      <Show\n        fallback={\n          <svg\n            class=\"size-4\"\n            fill=\"none\"\n            stroke=\"currentColor\"\n            stroke-linecap=\"round\"\n            stroke-linejoin=\"round\"\n            stroke-width=\"2\"\n            viewBox=\"0 0 24 24\"\n            xmlns=\"http://www.w3.org/2000/svg\"\n          >\n            <path d=\"M9 6l6 6l-6 6\" />\n          </svg>\n        }\n        when={local.children}\n      >\n        {(children) => children()}\n      </Show>\n    </CalendarPrimitive.Nav>\n  )\n}\n\ntype CalendarHeadingProps<T extends ValidComponent = \"h2\"> = LabelProps<T> & {\n  class?: string | undefined\n  children?: JSX.Element\n}\n\nconst CalendarHeading = <T extends ValidComponent = \"h2\">(\n  props: DynamicProps<T, CalendarHeadingProps<T>>\n) => {\n  const [local, others] = splitProps(props as CalendarHeadingProps, [\"class\", \"children\"])\n  const ctx = CalendarPrimitive.useContext()\n  const formatMonth = () =>\n    new Intl.DateTimeFormat(\"en-US\", { month: \"long\", year: \"numeric\" }).format(ctx.month())\n  return (\n    <CalendarPrimitive.Label\n      class={cn(\"font-medium text-foreground text-sm\", local.class)}\n      {...others}\n    >\n      {local.children ?? formatMonth()}\n    </CalendarPrimitive.Label>\n  )\n}\n\ntype CalendarGridProps<T extends ValidComponent = \"table\"> = TableProps<T> & {\n  class?: string | undefined\n}\n\nconst CalendarGrid = <T extends ValidComponent = \"table\">(\n  props: DynamicProps<T, CalendarGridProps<T>>\n) => {\n  const [local, others] = splitProps(props as CalendarGridProps, [\"class\"])\n  return (\n    <CalendarPrimitive.Table\n      class={cn(\"w-full border-collapse space-x-1\", local.class)}\n      {...others}\n    />\n  )\n}\n\nconst CalendarGridHead: Component<ComponentProps<\"thead\">> = (props) => <thead {...props} />\n\nconst CalendarGridHeadRow: Component<ComponentProps<\"tr\">> = (props) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return <tr class={cn(\"flex\", local.class)} {...others} />\n}\n\ntype CalendarGridHeadCellProps<T extends ValidComponent = \"th\"> = HeadCellProps<T> & {\n  class?: string | undefined\n}\n\nconst CalendarGridHeadCell = <T extends ValidComponent = \"th\">(\n  props: DynamicProps<T, CalendarGridHeadCellProps<T>>\n) => {\n  const [local, others] = splitProps(props as CalendarGridHeadCellProps, [\"class\"])\n  return (\n    <CalendarPrimitive.HeadCell\n      class={cn(\"w-8 rounded-md font-normal text-[0.8rem] text-muted-foreground\", local.class)}\n      {...others}\n    />\n  )\n}\n\nconst CalendarGridBody: Component<ComponentProps<\"tbody\">> = (props) => <tbody {...props} />\n\nconst CalendarGridBodyRow: Component<ComponentProps<\"tr\">> = (props) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return <tr class={cn(\"mt-2 flex w-full\", local.class)} {...others} />\n}\n\ntype CalendarGridBodyCellProps<T extends ValidComponent = \"td\"> = CellProps<T> & {\n  class?: string | undefined\n}\n\nconst CalendarGridBodyCell = <T extends ValidComponent = \"td\">(\n  props: DynamicProps<T, CalendarGridBodyCellProps<T>>\n) => {\n  const [local, others] = splitProps(props as CalendarGridBodyCellProps, [\"class\"])\n  return (\n    <CalendarPrimitive.Cell\n      class={cn(\n        \"p-0 has-data-range-end:rounded-r-md has-data-range-start:rounded-l-md has-data-in-range:bg-accent has-[[disabled]]:opacity-40 has-data-in-range:last:rounded-r-md has-data-in-range:first:rounded-l-md\",\n        local.class\n      )}\n      {...others}\n    />\n  )\n}\n\ntype CalendarGridBodyCellTriggerProps<T extends ValidComponent = \"button\"> = CellTriggerProps<T> & {\n  class?: string | undefined\n}\n\nconst CalendarGridBodyCellTrigger = <T extends ValidComponent = \"button\">(\n  props: DynamicProps<T, CalendarGridBodyCellTriggerProps<T>>\n) => {\n  const [local, others] = splitProps(props as CalendarGridBodyCellTriggerProps, [\"class\"])\n\n  const ctx = CalendarPrimitive.useContext()\n  return (\n    <CalendarPrimitive.CellTrigger\n      class={cn(\n        buttonVariants({ variant: \"ghost\" }),\n        \"size-8 p-0 font-normal hover:not-data-range-start:not-data-range-end:bg-primary hover:not-data-range-start:not-data-range-end:text-primary-foreground focus-visible:bg-primary focus-visible:text-primary-foreground disabled:pointer-events-none disabled:text-muted-foreground disabled:opacity-50 aria-selected:opacity-100 data-range-end:bg-primary data-range-start:bg-primary data-today:bg-accent data-range-end:text-primary-foreground data-range-start:text-primary-foreground data-today:text-accent-foreground\",\n        ctx.mode() === \"single\" && \"data-selected:bg-primary data-selected:text-primary-foreground\",\n        local.class\n      )}\n      {...others}\n    />\n  )\n}\n\nexport {\n  Calendar,\n  CalendarHead,\n  CalendarPrevTrigger,\n  CalendarNextTrigger,\n  CalendarHeading,\n  CalendarGrid,\n  CalendarGridHead,\n  CalendarGridHeadRow,\n  CalendarGridHeadCell,\n  CalendarGridBody,\n  CalendarGridBodyRow,\n  CalendarGridBodyCell,\n  CalendarGridBodyCellTrigger\n}\n",
      "type": "registry:ui"
    }
  ]
}