{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "scheduler",
  "type": "registry:ui",
  "title": "Scheduler",
  "dependencies": [
    "@base-ui-next/react",
    "class-variance-authority"
  ],
  "registryDependencies": [
    "https://hamur.dev/r/react/utils.json",
    "https://hamur.dev/r/react/button.json"
  ],
  "files": [
    {
      "path": "react/scheduler.tsx",
      "content": "'use client'\n\nimport type * as React from 'react' // base-ui-next/ui scheduler@0.1.0\nimport { Scheduler as SchedulerPrimitive } from '@base-ui-next/react/scheduler'\nimport type { VariantProps } from 'class-variance-authority'\nimport { cn } from '@/lib/utils'\nimport { buttonVariants } from '@/components/ui/button'\n\nconst schedulerClassName =\n  'group/scheduler flex w-full flex-col gap-3 text-sm [--scheduler-gutter:--spacing(16)] [--scheduler-slot-height:--spacing(8)]'\n\nconst schedulerHeadingClassName = 'text-base leading-none font-medium'\n\n/** PrevButton, NextButton and TodayButton: `buttonVariants` plus these. */\nconst schedulerNavigationButtonClassName =\n  'aria-disabled:pointer-events-none aria-disabled:opacity-50'\n\n/** Lucide's ChevronLeft and ChevronRight, turned in right-to-left text. */\nconst schedulerNavigationIconClassName = 'rtl:rotate-180'\n\nconst schedulerGridClassName =\n  'relative isolate w-full scroll-pt-20 overflow-auto rounded-lg border bg-background aria-disabled:opacity-50'\n\nconst schedulerGridHeaderClassName = 'sticky top-0 z-40 border-b bg-background'\n\nconst schedulerGridBodyClassName = 'relative'\n\nconst schedulerGridRowClassName = 'flex border-b last:border-b-0'\n\n/** A day's or a weekday's header; the empty corner (no `abbr`) is as wide as the row headers. */\nconst schedulerHeaderCellClassName =\n  'flex min-w-0 flex-1 basis-0 items-center justify-center border-s px-1 py-2 text-xs font-normal text-muted-foreground select-none first:border-s-0 data-today:font-medium data-today:text-foreground [&:not([abbr])]:w-(--scheduler-gutter) [&:not([abbr])]:flex-none'\n\nconst schedulerRowHeaderClassName =\n  'flex w-(--scheduler-gutter) shrink-0 items-start justify-end px-2 pt-1 text-xs leading-none text-muted-foreground tabular-nums select-none in-data-[slot=scheduler-grid-header]:items-center in-data-[slot=scheduler-grid-header]:pt-0'\n\n/** A timed slot; the all-day cells and the month's day cells grow with their events. */\nconst schedulerSlotClassName =\n  'relative h-(--scheduler-slot-height) min-w-0 flex-1 basis-0 border-s outline-none select-none first:border-s-0 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset data-weekend:bg-muted/30 data-outside-month:bg-muted/50 data-outside-month:text-muted-foreground data-unavailable:bg-muted data-preview:bg-accent data-selected:bg-accent in-data-[slot=scheduler-grid-header]:flex in-data-[slot=scheduler-grid-header]:h-auto in-data-[slot=scheduler-grid-header]:min-h-8 in-data-[slot=scheduler-grid-header]:flex-col in-data-[slot=scheduler-grid-header]:gap-0.5 in-data-[slot=scheduler-grid-header]:p-0.5 in-data-[view=month]:flex in-data-[view=month]:h-auto in-data-[view=month]:min-h-24 in-data-[view=month]:flex-col in-data-[view=month]:gap-0.5 in-data-[view=month]:p-1'\n\n/** A timed segment's box in its day column; a chip in the all-day row, the month and the agenda. */\nconst schedulerEventClassName =\n  'absolute start-[calc(var(--scheduler-event-column)/var(--scheduler-event-columns)*100%)] top-[calc(var(--scheduler-event-offset)*100%)] z-10 flex h-[calc(var(--scheduler-event-span)*100%)] min-h-5 w-[calc(100%/var(--scheduler-event-columns))] flex-col overflow-hidden rounded-md border border-background bg-primary px-1.5 py-1 text-start text-xs leading-tight font-medium text-primary-foreground outline-none select-none focus-visible:z-20 focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:opacity-50 data-clipped-end:rounded-b-none data-clipped-start:rounded-t-none data-moving:opacity-50 data-past:opacity-60 data-resizing:opacity-50 data-all-day:static data-all-day:h-auto data-all-day:w-auto data-all-day:py-0.5 in-data-[view=agenda]:static in-data-[view=agenda]:h-auto in-data-[view=agenda]:w-auto in-data-[view=agenda]:px-3 in-data-[view=agenda]:py-2 in-data-[view=agenda]:text-sm in-data-[view=month]:static in-data-[view=month]:h-auto in-data-[view=month]:w-auto in-data-[view=month]:py-0.5'\n\n/** A grip at the inline end of the event's top edge, shown while the event is hovered or focused. */\nconst schedulerMoveHandleClassName =\n  'absolute start-[calc((var(--scheduler-event-column)_+_1)/var(--scheduler-event-columns)*100%_-_1.25rem_-_2px)] top-[calc(var(--scheduler-event-offset)*100%_+_2px)] z-20 flex size-5 cursor-grab touch-none items-center justify-center rounded-sm text-primary-foreground opacity-0 outline-none hover:bg-primary-foreground/20 focus-visible:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50 data-disabled:cursor-not-allowed data-focused:opacity-100 data-grabbed:cursor-grabbing data-grabbed:bg-primary-foreground/20 data-grabbed:opacity-100 data-hovered:opacity-100 data-disabled:[&_svg]:opacity-50'\n\nconst schedulerMoveHandleIconClassName = 'size-3.5'\n\n/** A bar across the event's top (`start`) or bottom (`end`) edge with a pill in its middle. */\nconst schedulerResizeHandleClassName =\n  'absolute start-[calc(var(--scheduler-event-column)/var(--scheduler-event-columns)*100%)] z-20 h-2 w-[calc(100%/var(--scheduler-event-columns))] cursor-ns-resize touch-none rounded-sm opacity-0 outline-none after:absolute after:inset-x-0 after:top-1/2 after:mx-auto after:h-1 after:w-6 after:-translate-y-1/2 after:rounded-full after:bg-primary-foreground/70 focus-visible:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50 data-disabled:cursor-not-allowed data-disabled:after:opacity-50 data-focused:opacity-100 data-grabbed:opacity-100 data-hovered:opacity-100 data-[edge=end]:top-[calc((var(--scheduler-event-offset)_+_var(--scheduler-event-span))*100%_-_0.5rem)] data-[edge=start]:top-[calc(var(--scheduler-event-offset)*100%)]'\n\nconst schedulerPlaceholderClassName =\n  'pointer-events-none absolute inset-x-0 top-[calc(var(--scheduler-event-offset)*100%)] z-30 h-[calc(var(--scheduler-event-span)*100%)] rounded-md border-2 border-dashed border-primary bg-primary/10 data-invalid:border-destructive data-invalid:bg-destructive/10 data-[kind=select]:border-solid data-[kind=select]:border-ring data-[kind=select]:bg-ring/10'\n\nconst schedulerNowIndicatorClassName =\n  'pointer-events-none absolute inset-x-0 top-[calc(var(--scheduler-now-offset)*var(--scheduler-slot-count)*100%)] z-20 h-0.5 -translate-y-1/2 bg-destructive before:absolute before:-start-1 before:top-1/2 before:size-2 before:-translate-y-1/2 before:rounded-full before:bg-destructive'\n\nconst schedulerMoreButtonClassName =\n  'inline-flex h-5 w-fit shrink-0 items-center rounded-sm px-1 text-xs font-medium text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50'\n\nconst schedulerAgendaClassName = 'flex w-full flex-col gap-4'\n\nconst schedulerAgendaDayClassName =\n  'flex flex-col gap-2 border-b pb-4 last:border-b-0 last:pb-0'\n\nconst schedulerAgendaHeadingClassName = 'text-sm leading-none font-medium'\n\nconst schedulerEmptyClassName =\n  'flex min-h-24 items-center justify-center rounded-lg border border-dashed p-6 text-center text-sm text-muted-foreground'\n\ntype ButtonVariants = VariantProps<typeof buttonVariants>\n\nfunction SvgIcon({ children, ...props }: React.ComponentProps<'svg'>) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      aria-hidden=\"true\"\n      {...props}\n    >\n      {children}\n    </svg>\n  )\n}\n\nfunction Scheduler({ className, ...props }: SchedulerPrimitive.Root.Props) {\n  return (\n    <SchedulerPrimitive.Root\n      data-slot=\"scheduler\"\n      className={cn(schedulerClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerHeading({ className, ...props }: SchedulerPrimitive.Heading.Props) {\n  return (\n    <SchedulerPrimitive.Heading\n      data-slot=\"scheduler-heading\"\n      className={cn(schedulerHeadingClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerPrevButton({\n  className,\n  variant = 'outline',\n  size = 'icon-sm',\n  children,\n  ...props\n}: SchedulerPrimitive.PrevButton.Props & ButtonVariants) {\n  return (\n    <SchedulerPrimitive.PrevButton\n      data-slot=\"scheduler-prev-button\"\n      className={cn(\n        buttonVariants({ variant, size }),\n        schedulerNavigationButtonClassName,\n        className,\n      )}\n      {...props}\n    >\n      {children ?? (\n        <SvgIcon className={schedulerNavigationIconClassName}>\n          <path d=\"m15 18-6-6 6-6\" />\n        </SvgIcon>\n      )}\n    </SchedulerPrimitive.PrevButton>\n  )\n}\n\nfunction SchedulerNextButton({\n  className,\n  variant = 'outline',\n  size = 'icon-sm',\n  children,\n  ...props\n}: SchedulerPrimitive.NextButton.Props & ButtonVariants) {\n  return (\n    <SchedulerPrimitive.NextButton\n      data-slot=\"scheduler-next-button\"\n      className={cn(\n        buttonVariants({ variant, size }),\n        schedulerNavigationButtonClassName,\n        className,\n      )}\n      {...props}\n    >\n      {children ?? (\n        <SvgIcon className={schedulerNavigationIconClassName}>\n          <path d=\"m9 18 6-6-6-6\" />\n        </SvgIcon>\n      )}\n    </SchedulerPrimitive.NextButton>\n  )\n}\n\nfunction SchedulerTodayButton({\n  className,\n  variant = 'outline',\n  size = 'sm',\n  ...props\n}: SchedulerPrimitive.TodayButton.Props & ButtonVariants) {\n  return (\n    <SchedulerPrimitive.TodayButton\n      data-slot=\"scheduler-today-button\"\n      className={cn(\n        buttonVariants({ variant, size }),\n        schedulerNavigationButtonClassName,\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerGrid({ className, ...props }: SchedulerPrimitive.Grid.Props) {\n  return (\n    <SchedulerPrimitive.Grid\n      data-slot=\"scheduler-grid\"\n      className={cn(schedulerGridClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerGridHeader({ className, ...props }: SchedulerPrimitive.GridHeader.Props) {\n  return (\n    <SchedulerPrimitive.GridHeader\n      data-slot=\"scheduler-grid-header\"\n      className={cn(schedulerGridHeaderClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerGridBody({ className, ...props }: SchedulerPrimitive.GridBody.Props) {\n  return (\n    <SchedulerPrimitive.GridBody\n      data-slot=\"scheduler-grid-body\"\n      className={cn(schedulerGridBodyClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerGridRow({ className, ...props }: SchedulerPrimitive.GridRow.Props) {\n  return (\n    <SchedulerPrimitive.GridRow\n      data-slot=\"scheduler-grid-row\"\n      className={cn(schedulerGridRowClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerHeaderCell({ className, ...props }: SchedulerPrimitive.HeaderCell.Props) {\n  return (\n    <SchedulerPrimitive.HeaderCell\n      data-slot=\"scheduler-header-cell\"\n      className={cn(schedulerHeaderCellClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerRowHeader({ className, ...props }: SchedulerPrimitive.RowHeader.Props) {\n  return (\n    <SchedulerPrimitive.RowHeader\n      data-slot=\"scheduler-row-header\"\n      className={cn(schedulerRowHeaderClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerSlot({ className, ...props }: SchedulerPrimitive.Slot.Props) {\n  return (\n    <SchedulerPrimitive.Slot\n      data-slot=\"scheduler-slot\"\n      className={cn(schedulerSlotClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerEvent({ className, ...props }: SchedulerPrimitive.Event.Props) {\n  return (\n    <SchedulerPrimitive.Event\n      data-slot=\"scheduler-event\"\n      className={cn(schedulerEventClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerMoveHandle({\n  className,\n  children,\n  ...props\n}: SchedulerPrimitive.MoveHandle.Props) {\n  return (\n    <SchedulerPrimitive.MoveHandle\n      data-slot=\"scheduler-move-handle\"\n      className={cn(schedulerMoveHandleClassName, className)}\n      {...props}\n    >\n      {children ?? (\n        <SvgIcon className={schedulerMoveHandleIconClassName}>\n          <circle cx=\"9\" cy=\"12\" r=\"1\" />\n          <circle cx=\"9\" cy=\"5\" r=\"1\" />\n          <circle cx=\"9\" cy=\"19\" r=\"1\" />\n          <circle cx=\"15\" cy=\"12\" r=\"1\" />\n          <circle cx=\"15\" cy=\"5\" r=\"1\" />\n          <circle cx=\"15\" cy=\"19\" r=\"1\" />\n        </SvgIcon>\n      )}\n    </SchedulerPrimitive.MoveHandle>\n  )\n}\n\nfunction SchedulerResizeHandle({ className, ...props }: SchedulerPrimitive.ResizeHandle.Props) {\n  return (\n    <SchedulerPrimitive.ResizeHandle\n      data-slot=\"scheduler-resize-handle\"\n      className={cn(schedulerResizeHandleClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerPlaceholder({ className, ...props }: SchedulerPrimitive.Placeholder.Props) {\n  return (\n    <SchedulerPrimitive.Placeholder\n      data-slot=\"scheduler-placeholder\"\n      className={cn(schedulerPlaceholderClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerNowIndicator({ className, ...props }: SchedulerPrimitive.NowIndicator.Props) {\n  return (\n    <SchedulerPrimitive.NowIndicator\n      data-slot=\"scheduler-now-indicator\"\n      className={cn(schedulerNowIndicatorClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerMoreButton({ className, ...props }: SchedulerPrimitive.MoreButton.Props) {\n  return (\n    <SchedulerPrimitive.MoreButton\n      data-slot=\"scheduler-more-button\"\n      className={cn(schedulerMoreButtonClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerAgenda({ className, ...props }: SchedulerPrimitive.Agenda.Props) {\n  return (\n    <SchedulerPrimitive.Agenda\n      data-slot=\"scheduler-agenda\"\n      className={cn(schedulerAgendaClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerAgendaDay({ className, ...props }: SchedulerPrimitive.AgendaDay.Props) {\n  return (\n    <SchedulerPrimitive.AgendaDay\n      data-slot=\"scheduler-agenda-day\"\n      className={cn(schedulerAgendaDayClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerAgendaHeading({ className, ...props }: SchedulerPrimitive.AgendaHeading.Props) {\n  return (\n    <SchedulerPrimitive.AgendaHeading\n      data-slot=\"scheduler-agenda-heading\"\n      className={cn(schedulerAgendaHeadingClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction SchedulerEmpty({ className, ...props }: SchedulerPrimitive.Empty.Props) {\n  return (\n    <SchedulerPrimitive.Empty\n      data-slot=\"scheduler-empty\"\n      className={cn(schedulerEmptyClassName, className)}\n      {...props}\n    />\n  )\n}\n\nexport {\n  Scheduler,\n  SchedulerAgenda,\n  SchedulerAgendaDay,\n  SchedulerAgendaHeading,\n  SchedulerEmpty,\n  SchedulerEvent,\n  SchedulerGrid,\n  SchedulerGridBody,\n  SchedulerGridHeader,\n  SchedulerGridRow,\n  SchedulerHeaderCell,\n  SchedulerHeading,\n  SchedulerMoreButton,\n  SchedulerMoveHandle,\n  SchedulerNextButton,\n  SchedulerNowIndicator,\n  SchedulerPlaceholder,\n  SchedulerPrevButton,\n  SchedulerResizeHandle,\n  SchedulerRowHeader,\n  SchedulerSlot,\n  SchedulerTodayButton,\n}\n",
      "type": "registry:ui",
      "target": "@ui/scheduler.tsx"
    }
  ],
  "meta": {
    "baseUiNext": {
      "version": "0.1.0",
      "hash": "831a304a400b5f45f33b8a7c25996661c39abe0eba734359c5d967f526205e52",
      "files": {
        "@ui/scheduler.tsx": "1ae9b5c8eddedf7ea06c88730b4e828aa2bbcdc838483c0d143c3a017fb188a2"
      }
    }
  }
}
