{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "base-drawer",
  "title": "Base Drawer",
  "description": "A base-drawer component.",
  "dependencies": [
    "@hugeicons/react",
    "@hugeicons/core-free-icons"
  ],
  "registryDependencies": [
    "@cubby-ui/button",
    "@cubby-ui/scroll-area",
    "@cubby-ui/switch",
    "@cubby-ui/elevated"
  ],
  "files": [
    {
      "path": "registry/default/base-drawer/base-drawer.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\";\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { Radio as RadioPrimitive } from \"@base-ui/react/radio\";\nimport { RadioGroup as RadioGroupPrimitive } from \"@base-ui/react/radio-group\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"@/registry/default/button/button\";\nimport {\n  INNER_EDGE_FROM_ATTACH_SIDE,\n  elevatedSurface,\n  flushSurface,\n  type SurfaceLevel,\n} from \"@/registry/default/lib/elevated\";\nimport { ScrollArea } from \"@/registry/default/scroll-area/scroll-area\";\nimport {\n  SwitchVisual,\n  type SwitchVisualProps,\n} from \"@/registry/default/switch/switch\";\n\nimport { HugeiconsIcon } from \"@hugeicons/react\";\nimport {\n  Cancel01Icon,\n  CheckIcon,\n  ChevronRightIcon,\n} from \"@hugeicons/core-free-icons\";\n\n// The check draws itself in. `pathLength` restates the path as 1 unit\n// long, so the dash values are fractions of the stroke and survive a HugeIcons\n// reshape. Deriving the icon array is the only way to reach the path.\nconst checkIcon = CheckIcon.map(([tag, attrs]) => [\n  tag,\n  { ...attrs, pathLength: 1 },\n]) as typeof CheckIcon;\n\nconst checkmarkClasses =\n  \"[&_path]:ease-out-expo [&_path]:transition-[stroke-dashoffset] [&_path]:duration-150 [&_path]:[stroke-dasharray:1] in-data-checked:[&_path]:[stroke-dashoffset:0] in-data-unchecked:[&_path]:[stroke-dashoffset:1] motion-reduce:[&_path]:transition-none\" +\n  // Fade the unchecked mark out to hide the round-cap dot an undrawn dash leaves.\n  \" transition-opacity duration-150 ease-out in-data-unchecked:opacity-0 motion-reduce:transition-none\";\n\ntype DrawerPosition = \"right\" | \"left\" | \"top\" | \"bottom\";\n\nconst DrawerContext = React.createContext<{ position: DrawerPosition }>({\n  position: \"bottom\",\n});\n\nconst directionMap: Record<\n  DrawerPosition,\n  DrawerPrimitive.Root.Props[\"swipeDirection\"]\n> = {\n  bottom: \"down\",\n  left: \"left\",\n  right: \"right\",\n  top: \"up\",\n};\n\nconst createBaseDrawerHandle: typeof DrawerPrimitive.createHandle =\n  DrawerPrimitive.createHandle;\n\nfunction BaseDrawer({\n  swipeDirection,\n  position = \"bottom\",\n  ...props\n}: DrawerPrimitive.Root.Props & {\n  position?: DrawerPosition;\n}) {\n  return (\n    <DrawerContext.Provider value={{ position }}>\n      <DrawerPrimitive.Root\n        swipeDirection={swipeDirection ?? directionMap[position]}\n        {...props}\n      />\n    </DrawerContext.Provider>\n  );\n}\n\nconst BaseDrawerPortal: typeof DrawerPrimitive.Portal = DrawerPrimitive.Portal;\n\nfunction BaseDrawerTrigger(\n  props: DrawerPrimitive.Trigger.Props,\n): React.ReactElement {\n  return <DrawerPrimitive.Trigger data-slot=\"base-drawer-trigger\" {...props} />;\n}\n\nfunction BaseDrawerClose(\n  props: DrawerPrimitive.Close.Props,\n): React.ReactElement {\n  return <DrawerPrimitive.Close data-slot=\"base-drawer-close\" {...props} />;\n}\n\nconst BaseDrawerContent: typeof DrawerPrimitive.Content =\n  DrawerPrimitive.Content;\n\nfunction BaseDrawerProvider({ ...props }: DrawerPrimitive.Provider.Props) {\n  return <DrawerPrimitive.Provider {...props} />;\n}\n\nfunction BaseDrawerIndent({\n  className,\n  ...props\n}: DrawerPrimitive.Indent.Props) {\n  return (\n    <DrawerPrimitive.Indent\n      data-slot=\"base-drawer-indent\"\n      className={cn(\n        \"transition-[transform,border-radius] duration-400 ease-[cubic-bezier(.32,.72,0,1)]\",\n        // The page recedes behind an open drawer; with reduced motion it\n        // stays put and the backdrop alone marks the drawer.\n        \"data-active:overflow-hidden motion-safe:data-active:scale-[0.94] motion-safe:data-active:rounded-lg\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nfunction BaseDrawerIndentBackground({\n  className,\n  ...props\n}: DrawerPrimitive.IndentBackground.Props) {\n  return (\n    <DrawerPrimitive.IndentBackground\n      data-slot=\"base-drawer-indent-background\"\n      className={cn(\"fixed inset-0 bg-black\", className)}\n      {...props}\n    />\n  );\n}\n\nfunction BaseDrawerSwipeArea({\n  className,\n  position: positionProp,\n  ...props\n}: DrawerPrimitive.SwipeArea.Props & {\n  position?: DrawerPosition;\n}) {\n  const { position: contextPosition } = React.useContext(DrawerContext);\n  const position = positionProp ?? contextPosition;\n\n  return (\n    <DrawerPrimitive.SwipeArea\n      className={cn(\n        \"fixed z-50 touch-none\",\n        position === \"bottom\" && \"inset-x-0 bottom-0 h-8\",\n        position === \"top\" && \"inset-x-0 top-0 h-8\",\n        position === \"left\" && \"inset-y-0 left-0 w-8\",\n        position === \"right\" && \"inset-y-0 right-0 w-8\",\n        className,\n      )}\n      data-slot=\"base-drawer-swipe-area\"\n      {...props}\n    />\n  );\n}\n\nfunction BaseDrawerBackdrop({\n  className,\n  ...props\n}: DrawerPrimitive.Backdrop.Props) {\n  return (\n    <DrawerPrimitive.Backdrop\n      className={cn(\n        \"fixed inset-0 z-50 min-h-dvh bg-black/40 opacity-[calc(1-var(--drawer-swipe-progress))] backdrop-blur-sm transition-opacity duration-300 data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*300ms)] data-starting-style:opacity-0 data-swiping:duration-0 supports-[-webkit-touch-callout:none]:absolute\",\n        className,\n      )}\n      data-slot=\"base-drawer-backdrop\"\n      {...props}\n    />\n  );\n}\n\nfunction BaseDrawerViewport({\n  className,\n  position,\n  variant = \"default\",\n  ...props\n}: DrawerPrimitive.Viewport.Props & {\n  position?: DrawerPosition;\n  variant?: \"default\" | \"floating\";\n}) {\n  return (\n    <DrawerPrimitive.Viewport\n      className={cn(\n        \"fixed inset-0 z-50 [--bleed:3rem] [--inset:0px]\",\n        // Android Chrome: env(safe-area-inset-bottom) on a fixed element brings\n        // back its gesture-bar chin, and removing it leaves the layout viewport\n        // stuck at the URL-bar-shown height. Only read the inset on iOS.\n        \"[--safe-bottom:0px] supports-[-webkit-touch-callout:none]:[--safe-bottom:env(safe-area-inset-bottom,0px)]\",\n        \"touch-none\",\n        position === \"bottom\" && \"grid grid-rows-[1fr_auto] pt-12\",\n        position === \"top\" && \"grid grid-rows-[auto_1fr] pb-12\",\n        position === \"left\" && \"flex justify-start\",\n        position === \"right\" && \"flex justify-end\",\n        variant === \"floating\" && \"px-(--inset) [--inset:1rem]\",\n        variant === \"floating\" && position !== \"bottom\" && \"pt-(--inset)\",\n        variant === \"floating\" && position !== \"top\" && \"pb-(--inset)\",\n        className,\n      )}\n      data-slot=\"base-drawer-viewport\"\n      {...props}\n    />\n  );\n}\n\nfunction BaseDrawerPopup({\n  className,\n  children,\n  showCloseButton = false,\n  position: positionProp,\n  variant = \"default\",\n  showBar = false,\n  level = 5,\n  shadowLevel = 5,\n  ...props\n}: DrawerPrimitive.Popup.Props & {\n  showCloseButton?: boolean;\n  position?: DrawerPosition;\n  variant?: \"default\" | \"floating\";\n  showBar?: boolean;\n  /** Surface elevation level (1-8). Defaults to 5 — the dialog/sheet/drawer tier. */\n  level?: SurfaceLevel;\n  /** Shadow weight (1-8). Pinned to 5 by default. */\n  shadowLevel?: SurfaceLevel;\n}) {\n  const { position: contextPosition } = React.useContext(DrawerContext);\n  const position = positionProp ?? contextPosition;\n\n  const portal = (\n    <BaseDrawerPortal>\n      <BaseDrawerBackdrop />\n      <BaseDrawerViewport position={position} variant={variant}>\n        <DrawerPrimitive.Popup\n          className={cn(\n            // Base layout\n            \"text-popover-foreground relative flex max-h-full min-h-0 w-full min-w-0 flex-col will-change-transform outline-none\",\n            // Surface elevation — floating variants get the full 4-edge rim\n            // overlay; flush (`default`) variants get a single-edge rim only\n            // on the inner-facing edge so the other edges don't show a 1px\n            // line at the viewport boundary.\n            variant === \"floating\"\n              ? elevatedSurface(level, shadowLevel)\n              : flushSurface(level, INNER_EDGE_FROM_ATTACH_SIDE[position]),\n            // Transition\n            \"transition-[transform,box-shadow,height,background-color] duration-400 ease-[cubic-bezier(.32,.72,0,1)]\",\n            \"touch-none\",\n            // Stack calculation variables\n            \"[--peek:1.5rem] [--stack-step:0.05]\",\n            \"[--stack-progress:clamp(0,var(--drawer-swipe-progress),1)]\",\n            \"[--scale-base:calc(max(0,1-(var(--nested-drawers)*var(--stack-step))))]\",\n            \"[--scale:clamp(0,calc(var(--scale-base)+(var(--stack-step)*var(--stack-progress))),1)]\",\n            \"[--shrink:calc(1-var(--scale))]\",\n            \"[--stack-peek-offset:max(0px,calc((var(--nested-drawers)-var(--stack-progress))*var(--peek)))]\",\n            // Bleed pseudo (fills gap when dragged past edge) — uses ::before so ::after stays free for the rim overlay\n            \"before:pointer-events-none before:absolute before:bg-(--popup-surface,var(--popover))\",\n            // States\n            \"data-swiping:select-none\",\n            \"data-nested-drawer-open:overflow-hidden\",\n            \"data-ending-style:shadow-transparent data-starting-style:shadow-transparent\",\n            \"data-ending-style:duration-[calc(var(--drawer-swipe-strength)*300ms)]\",\n            // --- Position: bottom ---\n            position === \"bottom\" &&\n              cn(\n                \"row-start-2\",\n                // Transform\n                \"transform-[translateY(calc(var(--drawer-snap-point-offset)+var(--drawer-swipe-movement-y)))]\",\n                \"data-starting-style:transform-[translateY(calc(100%+var(--safe-bottom)+var(--inset)))]\",\n                \"data-ending-style:transform-[translateY(calc(100%+var(--safe-bottom)+var(--inset)))]\",\n                // Dynamic bleed: adjusts for snap points automatically\n                \"-mb-[max(0px,calc(var(--drawer-snap-point-offset,0px)+clamp(0,1,var(--drawer-snap-point-offset,0px)/1px)*var(--drawer-swipe-movement-y,0px)))]\",\n                \"pb-[max(0px,calc(var(--safe-bottom)+var(--drawer-snap-point-offset,0px)+clamp(0,1,var(--drawer-snap-point-offset,0px)/1px)*var(--drawer-swipe-movement-y,0px)))]\",\n                \"data-ending-style:mb-0 data-starting-style:mb-0\",\n                \"data-ending-style:pb-0 data-starting-style:pb-0\",\n                // Transition includes margin/padding for snap changes but not enter/exit\n                \"not-data-starting-style:not-data-ending-style:transition-[transform,box-shadow,height,background-color,margin,padding]\",\n                // Bleed pseudo\n                \"before:inset-x-0 before:top-full before:h-(--bleed)\",\n                // Bar support\n                \"has-data-[slot=base-drawer-bar]:pt-2\",\n                // Nested stacking\n                \"h-(--drawer-height,auto)\",\n                \"[--height:max(0px,calc(var(--drawer-frontmost-height,var(--drawer-height))))]\",\n                \"data-nested-drawer-open:h-(--height)\",\n                \"origin-[50%_calc(100%-var(--inset))]\",\n                \"data-nested-drawer-open:transform-[translateY(calc(var(--drawer-swipe-movement-y)-var(--stack-peek-offset)-(var(--shrink)*var(--height))))_scale(var(--scale))]\",\n              ),\n            // --- Position: top ---\n            position === \"top\" &&\n              cn(\n                \"transform-[translateY(var(--drawer-swipe-movement-y))]\",\n                \"data-starting-style:transform-[translateY(calc(-100%-var(--inset)))]\",\n                \"data-ending-style:transform-[translateY(calc(-100%-var(--inset)))]\",\n                \"before:inset-x-0 before:bottom-full before:h-(--bleed)\",\n                \"has-data-[slot=base-drawer-bar]:pb-2\",\n                // Nested stacking\n                \"h-(--drawer-height,auto)\",\n                \"[--height:max(0px,calc(var(--drawer-frontmost-height,var(--drawer-height))))]\",\n                \"data-nested-drawer-open:h-(--height)\",\n                \"origin-[50%_var(--inset)]\",\n                \"data-nested-drawer-open:transform-[translateY(calc(var(--drawer-swipe-movement-y)+var(--stack-peek-offset)+(var(--shrink)*var(--height))))_scale(var(--scale))]\",\n              ),\n            // --- Position: left ---\n            position === \"left\" &&\n              cn(\n                \"w-[calc(100%-3rem)] max-w-md\",\n                \"transform-[translateX(var(--drawer-swipe-movement-x))]\",\n                \"data-starting-style:transform-[translateX(calc(-100%-var(--inset)))]\",\n                \"data-ending-style:transform-[translateX(calc(-100%-var(--inset)))]\",\n                \"before:inset-y-0 before:end-full before:w-(--bleed)\",\n                \"has-data-[slot=base-drawer-bar]:pe-2\",\n                \"origin-right\",\n                \"data-nested-drawer-open:transform-[translateX(calc(var(--drawer-swipe-movement-x)+var(--stack-peek-offset)))_scale(var(--scale))]\",\n              ),\n            // --- Position: right ---\n            position === \"right\" &&\n              cn(\n                \"w-[calc(100%-3rem)] max-w-md\",\n                \"transform-[translateX(var(--drawer-swipe-movement-x))]\",\n                \"data-starting-style:transform-[translateX(calc(100%+var(--inset)))]\",\n                \"data-ending-style:transform-[translateX(calc(100%+var(--inset)))]\",\n                \"before:inset-y-0 before:start-full before:w-(--bleed)\",\n                \"has-data-[slot=base-drawer-bar]:ps-2\",\n                \"origin-left\",\n                \"data-nested-drawer-open:transform-[translateX(calc(var(--drawer-swipe-movement-x)-var(--stack-peek-offset)))_scale(var(--scale))]\",\n              ),\n            // --- Variant: rounded corners ---\n            variant !== \"floating\"\n              ? cn(\n                  position === \"bottom\" && \"rounded-t-2xl\",\n                  position === \"top\" && \"rounded-b-2xl\",\n                )\n              : cn(\n                  position === \"bottom\" && \"rounded-t-2xl\",\n                  position === \"top\" && \"rounded-b-2xl\",\n                  position === \"left\" && \"rounded-e-2xl\",\n                  position === \"right\" && \"rounded-s-2xl\",\n                  \"rounded-2xl before:bg-transparent\",\n                ),\n            className,\n          )}\n          data-slot=\"base-drawer-popup\"\n          data-level={level}\n          {...props}\n        >\n          {children}\n          {showCloseButton && (\n            <DrawerPrimitive.Close\n              aria-label=\"Close\"\n              className=\"absolute end-2 top-2\"\n              render={<Button size=\"icon_sm\" variant=\"ghost\" />}\n            >\n              <HugeiconsIcon icon={Cancel01Icon} strokeWidth={2} />\n            </DrawerPrimitive.Close>\n          )}\n          {showBar && <BaseDrawerBar />}\n        </DrawerPrimitive.Popup>\n      </BaseDrawerViewport>\n    </BaseDrawerPortal>\n  );\n\n  // Bottom sheets scroll focused fields clear of the software keyboard and\n  // expose --drawer-keyboard-inset while it's open.\n  if (position !== \"bottom\") return portal;\n\n  return (\n    <DrawerPrimitive.VirtualKeyboardProvider>\n      {portal}\n    </DrawerPrimitive.VirtualKeyboardProvider>\n  );\n}\n\nfunction BaseDrawerHeader({\n  className,\n  allowSelection = false,\n  render,\n  ...props\n}: useRender.ComponentProps<\"div\"> & {\n  allowSelection?: boolean;\n}) {\n  const defaultProps = {\n    className: cn(\n      \"flex flex-col gap-2 p-6 in-[[data-slot=base-drawer-popup]:has([data-slot=base-drawer-panel])]:pb-3 max-sm:pb-4\",\n      !allowSelection && \"cursor-default\",\n      className,\n    ),\n    \"data-slot\": \"base-drawer-header\",\n  };\n\n  return useRender({\n    defaultTagName: \"div\",\n    props: mergeProps<\"div\">(defaultProps, props),\n    render: allowSelection ? <BaseDrawerContent render={render} /> : render,\n  });\n}\n\nfunction BaseDrawerFooter({\n  className,\n  variant = \"default\",\n  allowSelection = true,\n  render,\n  ...props\n}: useRender.ComponentProps<\"div\"> & {\n  variant?: \"default\" | \"inset\";\n  allowSelection?: boolean;\n}) {\n  const defaultProps = {\n    className: cn(\n      \"mt-auto flex flex-col-reverse gap-2 px-6 sm:flex-row sm:justify-end\",\n      // Bottom inset under the footer content. While a field in the footer has\n      // the software keyboard open, it becomes the keyboard inset: the\n      // (auto-height) popup grows so the footer sits above the keyboard, and\n      // the panel scrolls once the popup hits max height.\n      \"[--footer-bottom:var(--safe-bottom,0px)]\",\n      \"focus-within:[--footer-bottom:max(var(--safe-bottom,0px),var(--drawer-keyboard-inset,0px))]\",\n      \"transition-[padding] duration-260 ease-[cubic-bezier(.32,.72,0,1)] motion-reduce:transition-none\",\n      !allowSelection && \"cursor-default\",\n      variant === \"default\" &&\n        \"in-[[data-slot=base-drawer-popup]:has([data-slot=base-drawer-panel])]:pt-3 pt-4 pb-[calc(var(--footer-bottom)+1.5rem)]\",\n      variant === \"inset\" &&\n        \"border-t bg-muted pt-4 pb-[calc(var(--footer-bottom)+1rem)]\",\n      className,\n    ),\n    \"data-slot\": \"base-drawer-footer\",\n  };\n\n  return useRender({\n    defaultTagName: \"div\",\n    props: mergeProps<\"div\">(defaultProps, props),\n    render: allowSelection ? <BaseDrawerContent render={render} /> : render,\n  });\n}\n\nfunction BaseDrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n  return (\n    <DrawerPrimitive.Title\n      className={cn(\n        \"text-lg leading-none font-semibold tracking-tight\",\n        className,\n      )}\n      data-slot=\"base-drawer-title\"\n      {...props}\n    />\n  );\n}\n\nfunction BaseDrawerDescription({\n  className,\n  ...props\n}: DrawerPrimitive.Description.Props) {\n  return (\n    <DrawerPrimitive.Description\n      className={cn(\"text-muted-foreground text-sm\", className)}\n      data-slot=\"base-drawer-description\"\n      {...props}\n    />\n  );\n}\n\nfunction BaseDrawerPanel({\n  className,\n  scrollFade = false,\n  scrollable = true,\n  allowSelection = true,\n  render,\n  ...props\n}: useRender.ComponentProps<\"div\"> & {\n  scrollFade?: boolean;\n  scrollable?: boolean;\n  allowSelection?: boolean;\n}) {\n  const defaultProps = {\n    className: cn(\n      \"p-6 in-[[data-slot=base-drawer-popup]:has([data-slot=base-drawer-header])]:pt-1 in-[[data-slot=base-drawer-popup]:has([data-slot=base-drawer-footer]:not(.border-t))]:pb-1\",\n      !allowSelection && \"cursor-default\",\n      className,\n    ),\n    \"data-slot\": \"base-drawer-panel\",\n  };\n\n  const content = useRender({\n    defaultTagName: \"div\",\n    props: mergeProps<\"div\">(defaultProps, props),\n    render: allowSelection ? <BaseDrawerContent render={render} /> : render,\n  });\n\n  if (scrollable) {\n    return (\n      <ScrollArea className=\"touch-auto\" fadeEdges={scrollFade}>\n        {content}\n      </ScrollArea>\n    );\n  }\n\n  return content;\n}\n\nfunction BaseDrawerBar({\n  className,\n  position: positionProp,\n  render,\n  ...props\n}: useRender.ComponentProps<\"div\"> & {\n  position?: DrawerPosition;\n}) {\n  const { position: contextPosition } = React.useContext(DrawerContext);\n  const position = positionProp ?? contextPosition;\n  const horizontal = position === \"left\" || position === \"right\";\n\n  const defaultProps = {\n    \"aria-hidden\": true as const,\n    className: cn(\n      \"absolute flex touch-none items-center justify-center p-3 before:rounded-full before:bg-muted-foreground/30\",\n      horizontal\n        ? \"inset-y-0 before:h-12 before:w-1\"\n        : \"inset-x-0 before:h-1 before:w-12\",\n      position === \"top\" && \"bottom-0\",\n      position === \"bottom\" && \"top-0\",\n      position === \"left\" && \"right-0\",\n      position === \"right\" && \"left-0\",\n      className,\n    ),\n    \"data-slot\": \"base-drawer-bar\",\n  };\n\n  return useRender({\n    defaultTagName: \"div\",\n    props: mergeProps<\"div\">(defaultProps, props),\n    render,\n  });\n}\n\nfunction BaseDrawerMenu({\n  className,\n  render,\n  ...props\n}: useRender.ComponentProps<\"nav\">) {\n  const defaultProps = {\n    className: cn(\"-m-2 flex flex-col\", className),\n    \"data-slot\": \"base-drawer-menu\",\n  };\n\n  return useRender({\n    defaultTagName: \"nav\",\n    props: mergeProps<\"nav\">(defaultProps, props),\n    render,\n  });\n}\n\nfunction BaseDrawerMenuItem({\n  className,\n  variant = \"default\",\n  render,\n  disabled,\n  ...props\n}: useRender.ComponentProps<\"button\"> & {\n  variant?: \"default\" | \"destructive\";\n}) {\n  const defaultProps = {\n    className: cn(\n      \"flex min-h-9 w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-base text-foreground outline-none focus-visible:outline-ring/50 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-solid hover:bg-surface-hover hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-60 data-[variant=destructive]:text-destructive-foreground sm:not-pointer-coarse:min-h-8 sm:text-sm [&>svg:not([class*='opacity-'])]:opacity-80 [&>svg:not([class*='size-'])]:size-4.5 sm:not-pointer-coarse:[&>svg:not([class*='size-'])]:size-4 [&>svg]:pointer-events-none [&>svg]:-mx-0.5 [&>svg]:shrink-0\",\n      className,\n    ),\n    \"data-slot\": \"base-drawer-menu-item\",\n    \"data-variant\": variant,\n    disabled,\n    type: \"button\" as const,\n  };\n\n  return useRender({\n    defaultTagName: \"button\",\n    props: mergeProps<\"button\">(defaultProps, props),\n    render,\n  });\n}\n\nfunction BaseDrawerMenuSeparator({\n  className,\n  render,\n  ...props\n}: useRender.ComponentProps<\"div\">) {\n  const defaultProps = {\n    className: cn(\"mx-2 my-1 h-px bg-border\", className),\n    \"data-slot\": \"base-drawer-menu-separator\",\n  };\n\n  return useRender({\n    defaultTagName: \"div\",\n    props: mergeProps<\"div\">(defaultProps, props),\n    render,\n  });\n}\n\nfunction BaseDrawerMenuGroup({\n  className,\n  render,\n  ...props\n}: useRender.ComponentProps<\"div\">) {\n  const defaultProps = {\n    className: cn(\"flex flex-col\", className),\n    \"data-slot\": \"base-drawer-menu-group\",\n  };\n\n  return useRender({\n    defaultTagName: \"div\",\n    props: mergeProps<\"div\">(defaultProps, props),\n    render,\n  });\n}\n\nfunction BaseDrawerMenuGroupLabel({\n  className,\n  render,\n  ...props\n}: useRender.ComponentProps<\"div\">) {\n  const defaultProps = {\n    className: cn(\n      \"px-2 py-1.5 font-medium text-muted-foreground text-xs\",\n      className,\n    ),\n    \"data-slot\": \"base-drawer-menu-group-label\",\n  };\n\n  return useRender({\n    defaultTagName: \"div\",\n    props: mergeProps<\"div\">(defaultProps, props),\n    render,\n  });\n}\n\nfunction BaseDrawerMenuTrigger({\n  className,\n  children,\n  ...props\n}: DrawerPrimitive.Trigger.Props) {\n  return (\n    <BaseDrawerTrigger\n      className={cn(\n        \"text-foreground hover:bg-surface-hover hover:text-accent-foreground focus-visible:outline-ring/50 flex min-h-9 w-full cursor-default items-center gap-2 rounded-sm px-2 py-1 text-base outline-none select-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-solid sm:text-sm sm:not-pointer-coarse:min-h-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4.5 sm:not-pointer-coarse:[&_svg:not([class*='size-'])]:size-4\",\n        className,\n      )}\n      data-slot=\"base-drawer-menu-trigger\"\n      {...props}\n    >\n      {children}\n      <HugeiconsIcon\n        icon={ChevronRightIcon}\n        className=\"ms-auto -me-0.5 opacity-80\"\n        strokeWidth={2}\n      />\n    </BaseDrawerTrigger>\n  );\n}\n\nfunction BaseDrawerMenuCheckboxItem({\n  className,\n  children,\n  checked,\n  defaultChecked,\n  onCheckedChange,\n  indicator = \"check\",\n  switchColor = \"primary\",\n  switchShape = \"circle\",\n  switchSize = \"sm\",\n  switchMotion = \"default\",\n  disabled,\n  render,\n  ...props\n}: CheckboxPrimitive.Root.Props & {\n  /** Which indicator sits in the right-hand column. `\"switch\"` is visual only. */\n  indicator?: \"check\" | \"switch\";\n  /** Checked track colour, when `indicator=\"switch\"`. */\n  switchColor?: SwitchVisualProps[\"color\"];\n  /** Thumb silhouette, when `indicator=\"switch\"`. */\n  switchShape?: SwitchVisualProps[\"shape\"];\n  /** Thumb size, when `indicator=\"switch\"`. Defaults to `sm` for the drawer's taller touch rows. */\n  switchSize?: SwitchVisualProps[\"size\"];\n  /** How the thumb travels, when `indicator=\"switch\"`. */\n  switchMotion?: SwitchVisualProps[\"motion\"];\n  render?: React.ReactElement;\n}) {\n  return (\n    <CheckboxPrimitive.Root\n      checked={checked}\n      className={cn(\n        \"text-foreground hover:bg-surface-hover hover:text-accent-foreground focus-visible:outline-ring/50 grid min-h-9 w-full cursor-default items-center gap-2 rounded-sm px-2 py-1 text-base outline-none select-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-solid data-disabled:pointer-events-none data-disabled:opacity-60 sm:text-sm sm:not-pointer-coarse:min-h-8 [&_svg]:pointer-events-none [&_svg]:-mx-0.5 [&_svg]:shrink-0 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:not-pointer-coarse:[&_svg:not([class*='size-'])]:size-4\",\n        // `group/switch` lets a switch indicator pick up the row's press\n        // state, so the whole row behaves as the control rather than just the\n        // switch. Named, so an unrelated `.group` on an ancestor cannot.\n        \"group/switch\",\n        indicator === \"switch\"\n          ? \"grid-cols-[1fr_auto] gap-4 pe-1.5\"\n          : \"grid-cols-[1fr_1.125rem] pe-2 sm:not-pointer-coarse:grid-cols-[1fr_1rem]\",\n        className,\n      )}\n      data-slot=\"base-drawer-menu-checkbox-item\"\n      defaultChecked={defaultChecked}\n      disabled={disabled}\n      onCheckedChange={onCheckedChange}\n      render={render}\n      {...props}\n    >\n      <span className=\"col-start-1 flex min-w-0 items-center gap-2\">\n        {children}\n      </span>\n      {indicator === \"switch\" ? (\n        <SwitchVisual\n          color={switchColor}\n          shape={switchShape}\n          size={switchSize}\n          motion={switchMotion}\n          // Touch-sized on mobile, matching the taller drawer rows; drops to\n          // the same 14px thumb the desktop menus use (`size=\"xs\"`) from `sm`\n          // up. Responsive sizing can't come from the cva variant.\n          className=\"col-start-2 sm:not-pointer-coarse:[--thumb-size:--spacing(3.5)]\"\n          // Checkbox.Indicator does not inject aria-hidden the way the menu\n          // primitives do, and this span sits inside the row's accessible name.\n          aria-hidden\n          render={<CheckboxPrimitive.Indicator keepMounted />}\n        />\n      ) : (\n        <CheckboxPrimitive.Indicator\n          className=\"col-start-2 flex items-center justify-center\"\n          aria-hidden\n          keepMounted\n        >\n          <HugeiconsIcon\n            icon={checkIcon}\n            strokeWidth={2.5}\n            className={cn(\n              \"size-4.5 sm:not-pointer-coarse:size-4\",\n              checkmarkClasses,\n            )}\n          />\n        </CheckboxPrimitive.Indicator>\n      )}\n    </CheckboxPrimitive.Root>\n  );\n}\n\nfunction BaseDrawerMenuRadioGroup({\n  className,\n  ...props\n}: RadioGroupPrimitive.Props) {\n  return (\n    <RadioGroupPrimitive\n      className={cn(\"flex flex-col\", className)}\n      data-slot=\"base-drawer-menu-radio-group\"\n      {...props}\n    />\n  );\n}\n\nfunction BaseDrawerMenuRadioItem({\n  className,\n  children,\n  value,\n  disabled,\n  render,\n  ...props\n}: RadioPrimitive.Root.Props & {\n  value: string;\n  render?: React.ReactElement;\n}) {\n  return (\n    <RadioPrimitive.Root\n      className={cn(\n        \"text-foreground hover:bg-surface-hover hover:text-accent-foreground focus-visible:outline-ring/50 grid min-h-9 w-full cursor-default items-center gap-2 rounded-sm px-2 py-1 text-base outline-none select-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-solid data-disabled:pointer-events-none data-disabled:opacity-60 sm:text-sm sm:not-pointer-coarse:min-h-8 [&_svg]:pointer-events-none [&_svg]:-mx-0.5 [&_svg]:shrink-0 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:not-pointer-coarse:[&_svg:not([class*='size-'])]:size-4\",\n        \"grid-cols-[1fr_1.125rem] items-center pe-2 sm:not-pointer-coarse:grid-cols-[1fr_1rem]\",\n        className,\n      )}\n      data-slot=\"base-drawer-menu-radio-item\"\n      disabled={disabled}\n      render={render}\n      value={value}\n      {...props}\n    >\n      <span className=\"col-start-1 flex min-w-0 items-center gap-2\">\n        {children}\n      </span>\n      {/* Radio.Indicator, like Checkbox.Indicator, leaves aria-hidden to us. */}\n      <RadioPrimitive.Indicator\n        className=\"col-start-2 flex items-center justify-center\"\n        aria-hidden\n        keepMounted\n      >\n        <HugeiconsIcon\n          icon={checkIcon}\n          strokeWidth={2.5}\n          className={cn(\n            \"size-4.5 sm:not-pointer-coarse:size-4\",\n            checkmarkClasses,\n          )}\n        />\n      </RadioPrimitive.Indicator>\n    </RadioPrimitive.Root>\n  );\n}\n\nexport {\n  BaseDrawer,\n  BaseDrawerBackdrop,\n  BaseDrawerBar,\n  BaseDrawerClose,\n  BaseDrawerContent,\n  BaseDrawerDescription,\n  BaseDrawerFooter,\n  BaseDrawerHeader,\n  BaseDrawerIndent,\n  BaseDrawerIndentBackground,\n  BaseDrawerMenu,\n  BaseDrawerMenuCheckboxItem,\n  BaseDrawerMenuItem,\n  BaseDrawerMenuGroup,\n  BaseDrawerMenuGroupLabel,\n  BaseDrawerMenuRadioGroup,\n  BaseDrawerMenuRadioItem,\n  BaseDrawerMenuSeparator,\n  BaseDrawerMenuTrigger,\n  BaseDrawerPanel,\n  BaseDrawerPopup,\n  BaseDrawerPortal,\n  BaseDrawerProvider,\n  BaseDrawerSwipeArea,\n  BaseDrawerTitle,\n  BaseDrawerTrigger,\n  BaseDrawerViewport,\n  createBaseDrawerHandle,\n  DrawerPrimitive,\n};\n\nexport type { DrawerPosition };\n",
      "type": "registry:ui",
      "target": "components/ui/cubby-ui/base-drawer.tsx"
    }
  ],
  "type": "registry:ui"
}