{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dropdown-menu",
  "type": "registry:ui",
  "title": "DropdownMenu",
  "description": "DropdownMenu is a floating menu anchored to a trigger that presents a short list of contextual actions or commands.",
  "dependencies": [
    "@radix-ui/react-dropdown-menu@^2.1.16",
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "https://wideset.co/r/list-item.json",
    "https://wideset.co/r/motion.json",
    "https://wideset.co/r/styles.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/components/dropdown/DropdownMenu.context.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/dropdown/DropdownMenu.context.ts",
      "content": "'use client';\n\nimport { createContext, useContext } from 'react';\n\ntype DropdownMenuContextValue = {\n  motion?: boolean;\n};\n\nexport const DropdownMenuContext = createContext<DropdownMenuContextValue>({});\n\nexport const useDropdownMenuContext = () => useContext(DropdownMenuContext);\n\n/** True inside `DropdownMenu.Portal`: `DropdownMenu.Content` then renders into it instead of its own portal. */\nexport const DropdownMenuPortalContext = createContext(false);\n"
    },
    {
      "path": "src/components/dropdown/DropdownMenu.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/dropdown/DropdownMenu.tsx",
      "content": "'use client';\n\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport * as React from 'react';\n\nimport { DropdownMenuContent } from './DropdownMenuContent';\nimport { DropdownMenuItem } from './DropdownMenuItem';\nimport { DropdownMenuLabel } from './DropdownMenuLabel';\nimport { DropdownMenuPortal } from './DropdownMenuPortal';\nimport { DropdownMenuSeparator } from './DropdownMenuSeparator';\nimport { DropdownMenuTrigger } from './DropdownMenuTrigger';\n\nconst DropdownMenu = ((props: DropdownMenuPrimitive.DropdownMenuProps) => (\n  <DropdownMenuPrimitive.Root {...props} />\n)) as React.FC<DropdownMenuPrimitive.DropdownMenuProps> & {\n  Content: typeof DropdownMenuContent;\n  Group: typeof DropdownMenuGroup;\n  Item: typeof DropdownMenuItem;\n  Label: typeof DropdownMenuLabel;\n  Portal: typeof DropdownMenuPortal;\n  RadioGroup: typeof DropdownMenuRadioGroup;\n  Separator: typeof DropdownMenuSeparator;\n  Trigger: typeof DropdownMenuTrigger;\n  CheckboxItem: typeof DropdownMenuCheckboxItem;\n  ItemIndicator: typeof DropdownMenuItemIndicator;\n  Sub: typeof DropdownMenuPrimitive.Sub;\n  SubTrigger: typeof DropdownMenuSubTrigger;\n  SubContent: typeof DropdownMenuSubContent;\n  RadioItem: typeof DropdownMenuRadioItem;\n};\n\nDropdownMenu.Content = DropdownMenuContent;\nexport const DropdownMenuGroup = React.forwardRef<\n  React.ComponentRef<typeof DropdownMenuPrimitive.Group>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Group>\n>((props, ref) => (\n  <DropdownMenuPrimitive.Group ref={ref} data-slot=\"dropdown-menu-group\" {...props} />\n));\nDropdownMenuGroup.displayName = 'DropdownMenu.Group';\nDropdownMenu.Group = DropdownMenuGroup;\nDropdownMenu.Item = DropdownMenuItem;\nDropdownMenu.Label = DropdownMenuLabel;\nDropdownMenu.Portal = DropdownMenuPortal;\nexport const DropdownMenuRadioGroup = React.forwardRef<\n  React.ComponentRef<typeof DropdownMenuPrimitive.RadioGroup>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioGroup>\n>((props, ref) => (\n  <DropdownMenuPrimitive.RadioGroup ref={ref} data-slot=\"dropdown-menu-radio-group\" {...props} />\n));\nDropdownMenuRadioGroup.displayName = 'DropdownMenu.RadioGroup';\nDropdownMenu.RadioGroup = DropdownMenuRadioGroup;\nDropdownMenu.Separator = DropdownMenuSeparator;\nDropdownMenu.Trigger = DropdownMenuTrigger;\nexport const DropdownMenuCheckboxItem = React.forwardRef<\n  React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>((props, ref) => (\n  <DropdownMenuPrimitive.CheckboxItem\n    ref={ref}\n    data-slot=\"dropdown-menu-checkbox-item\"\n    {...props}\n  />\n));\nDropdownMenuCheckboxItem.displayName = 'DropdownMenu.CheckboxItem';\nDropdownMenu.CheckboxItem = DropdownMenuCheckboxItem;\nexport const DropdownMenuItemIndicator = React.forwardRef<\n  React.ComponentRef<typeof DropdownMenuPrimitive.ItemIndicator>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.ItemIndicator>\n>((props, ref) => (\n  <DropdownMenuPrimitive.ItemIndicator\n    ref={ref}\n    data-slot=\"dropdown-menu-item-indicator\"\n    {...props}\n  />\n));\nDropdownMenuItemIndicator.displayName = 'DropdownMenu.ItemIndicator';\nDropdownMenu.ItemIndicator = DropdownMenuItemIndicator;\nexport const DropdownMenuSub = DropdownMenuPrimitive.Sub;\nDropdownMenu.Sub = DropdownMenuSub;\nexport const DropdownMenuSubTrigger = React.forwardRef<\n  React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger>\n>((props, ref) => (\n  <DropdownMenuPrimitive.SubTrigger ref={ref} data-slot=\"dropdown-menu-sub-trigger\" {...props} />\n));\nDropdownMenuSubTrigger.displayName = 'DropdownMenu.SubTrigger';\nDropdownMenu.SubTrigger = DropdownMenuSubTrigger;\nexport const DropdownMenuSubContent = React.forwardRef<\n  React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>((props, ref) => (\n  <DropdownMenuPrimitive.SubContent ref={ref} data-slot=\"dropdown-menu-sub-content\" {...props} />\n));\nDropdownMenuSubContent.displayName = 'DropdownMenu.SubContent';\nDropdownMenu.SubContent = DropdownMenuSubContent;\nexport const DropdownMenuRadioItem = React.forwardRef<\n  React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>((props, ref) => (\n  <DropdownMenuPrimitive.RadioItem ref={ref} data-slot=\"dropdown-menu-radio-item\" {...props} />\n));\nDropdownMenuRadioItem.displayName = 'DropdownMenu.RadioItem';\nDropdownMenu.RadioItem = DropdownMenuRadioItem;\n\nDropdownMenu.displayName = 'DropdownMenu';\n\nexport { DropdownMenu, DropdownMenuPortal };\n"
    },
    {
      "path": "src/components/dropdown/DropdownMenu.types.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/dropdown/DropdownMenu.types.ts",
      "content": "import type * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport type * as React from 'react';\n\nimport type { MotionProps } from '@/lib/wideset/motion/Motion.types';\nimport type { ListItemProps } from '../list-item/ListItem.types';\n\n/** An anchored menu of contextual actions. */\nexport type DropdownMenuProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root>;\n\n/** The control that opens or toggles the associated content. */\nexport type DropdownMenuTriggerProps = React.ComponentPropsWithoutRef<\n  typeof DropdownMenuPrimitive.Trigger\n>;\n\n/** The content surface rendered within `DropdownMenu`. */\nexport type DropdownMenuContentProps = React.ComponentPropsWithoutRef<\n  typeof DropdownMenuPrimitive.Content\n> &\n  MotionProps & {\n    /** DOM node to portal the content into. Defaults to `document.body`. */\n    portalContainer?: Element | DocumentFragment | null;\n  };\n\n/** An individual item within `DropdownMenu`. */\nexport type DropdownMenuItemProps = React.ComponentPropsWithoutRef<\n  typeof DropdownMenuPrimitive.Item\n> &\n  ListItemProps;\n\n/** The text label associated with `DropdownMenu`. */\nexport type DropdownMenuLabelProps = React.ComponentPropsWithoutRef<\n  typeof DropdownMenuPrimitive.Label\n> & {\n  /** Indents the label so it aligns with item text in menus that have a leading icon or checkmark slot. */\n  inset?: boolean;\n};\n\n/** A visual separator between groups of items. */\nexport type DropdownMenuSeparatorProps = React.ComponentPropsWithoutRef<\n  typeof DropdownMenuPrimitive.Separator\n>;\n\n/** A container grouping related items. */\nexport type DropdownMenuGroupProps = React.ComponentPropsWithoutRef<\n  typeof DropdownMenuPrimitive.Group\n>;\n\n/** The portal destination for floating content. */\nexport type DropdownMenuPortalProps = React.ComponentPropsWithoutRef<\n  typeof DropdownMenuPrimitive.Portal\n>;\n\n/** A group of mutually exclusive radio options. */\nexport type DropdownMenuRadioGroupProps = React.ComponentPropsWithoutRef<\n  typeof DropdownMenuPrimitive.RadioGroup\n>;\n"
    },
    {
      "path": "src/components/dropdown/DropdownMenu.variants.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/dropdown/DropdownMenu.variants.ts",
      "content": "import { cva } from 'class-variance-authority';\nimport { cn } from '@/lib/wideset/utils';\n\nexport const dropdownMenuContentMotionVariants = cva('', {\n  variants: {\n    enabled: {\n      true: cn(\n        'origin-radix-dropdown-menu',\n        'transition-none',\n        'data-[state=open]:animate-in data-[state=closed]:animate-out',\n        'data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0',\n        'data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95',\n        'data-[side=bottom]:ws-slide-in-from-top-2',\n        'data-[side=left]:slide-in-from-right-ws-2',\n        'data-[side=right]:ws-slide-in-from-left-2',\n        'data-[side=top]:slide-in-from-bottom-ws-2',\n        'ease-(--ws-motion-ease-smooth-out) data-[state=open]:duration-(--ws-motion-duration-fast)',\n        'data-[state=closed]:duration-(--ws-motion-duration-quick)',\n      ),\n      false: '',\n    },\n  },\n  defaultVariants: { enabled: true },\n});\n"
    },
    {
      "path": "src/components/dropdown/DropdownMenuContent.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/dropdown/DropdownMenuContent.tsx",
      "content": "'use client';\n\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { useDefaultMotion } from '@/lib/wideset/motion/MotionProvider';\nimport { DropdownMenuContext, DropdownMenuPortalContext } from './DropdownMenu.context';\nimport type { DropdownMenuContentProps } from './DropdownMenu.types';\nimport { dropdownMenuContentMotionVariants } from './DropdownMenu.variants';\n\nexport const DropdownMenuContent = React.forwardRef<\n  React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n  DropdownMenuContentProps\n>(\n  (\n    {\n      className,\n      sideOffset = 4,\n      onCloseAutoFocus,\n      onPointerDown,\n      portalContainer,\n      defaultMotion,\n      ...props\n    },\n    ref,\n  ) => {\n    const motion = useDefaultMotion(defaultMotion);\n    const insidePortal = React.useContext(DropdownMenuPortalContext);\n    // Prevent focus return to trigger after closing with mouse click, to not show the outline on the trigger\n    const lastPointerTime = React.useRef(0);\n\n    const handlePointerDown = (event: React.PointerEvent<HTMLDivElement>) => {\n      lastPointerTime.current = Date.now();\n      onPointerDown?.(event);\n    };\n\n    const handleCloseAutoFocus = (event: Event) => {\n      if (Date.now() - lastPointerTime.current < 300) {\n        event.preventDefault();\n      }\n\n      onCloseAutoFocus?.(event);\n    };\n\n    const content = (\n      // Reset for descendants (a Select inside the menu): the flag only applies to the Content\n      // placed directly in a Portal.\n      <DropdownMenuPortalContext.Provider value={false}>\n        <DropdownMenuPrimitive.Content\n          ref={ref}\n          data-slot=\"dropdown-menu-content\"\n          sideOffset={sideOffset}\n          onCloseAutoFocus={handleCloseAutoFocus}\n          onPointerDown={handlePointerDown}\n          className={cn(\n            // Hard rule for floating menus: never narrower than Size/28 (10rem —\n            // Bootstrap's floor; shadcn uses 8rem, Material 112dp). Trigger-matching\n            // popovers (Select/MultiSelect) override the floor with\n            // max(trigger, Size/28).\n            'min-w-ws-28',\n            'rounded-ws-container-sm p-ws-3 outline-hidden',\n            'bg-ws-static-overlay text-ws-dynamic-secondary-default shadow-ws-medium z-ws-popout',\n            dropdownMenuContentMotionVariants({ enabled: motion }),\n            className,\n          )}\n          {...props}\n        />\n      </DropdownMenuPortalContext.Provider>\n    );\n\n    // Portals to document.body by default, like Select.Content: rendered in place the menu is\n    // clipped by a Modal / Sidepanel and trapped in their stacking context, below z-ws-popout.\n    // Inside DropdownMenu.Portal it renders into that one, so the wrapper's container and\n    // forceMount win. The Portal gates mounting on its own forceMount, so Content forceMount\n    // must reach it too.\n    return (\n      <DropdownMenuContext.Provider value={{ motion }}>\n        {insidePortal ? (\n          content\n        ) : (\n          <DropdownMenuPrimitive.Portal\n            container={portalContainer ?? undefined}\n            forceMount={props.forceMount}\n          >\n            {content}\n          </DropdownMenuPrimitive.Portal>\n        )}\n      </DropdownMenuContext.Provider>\n    );\n  },\n);\n\nDropdownMenuContent.displayName = 'DropdownMenu.Content';\n"
    },
    {
      "path": "src/components/dropdown/DropdownMenuItem.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/dropdown/DropdownMenuItem.tsx",
      "content": "'use client';\n\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { ListItem } from '../list-item/ListItem';\nimport { useDropdownMenuContext } from './DropdownMenu.context';\nimport type { DropdownMenuItemProps } from './DropdownMenu.types';\n\nexport const DropdownMenuItem = React.forwardRef<\n  React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n  DropdownMenuItemProps\n>(({ className, children, onSelect, variant, defaultMotion, ...props }, ref) => {\n  const { motion } = useDropdownMenuContext();\n\n  return (\n    <DropdownMenuPrimitive.Item\n      ref={ref}\n      data-slot=\"dropdown-menu-item\"\n      // Figma pins the menu row's min-height to `Size/14` (32px); ListItem's\n      // padding (Gap/3 + 20px content + Gap/3) only reaches 28px on its own.\n      className={cn('min-h-ws-14 outline-hidden', className)}\n      {...props}\n      asChild\n      onSelect={onSelect}\n    >\n      <ListItem variant={variant} defaultMotion={defaultMotion ?? motion}>\n        {children}\n      </ListItem>\n    </DropdownMenuPrimitive.Item>\n  );\n});\n\nDropdownMenuItem.displayName = 'DropdownMenu.Item';\n"
    },
    {
      "path": "src/components/dropdown/DropdownMenuLabel.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/dropdown/DropdownMenuLabel.tsx",
      "content": "'use client';\n\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { DropdownMenuLabelProps } from './DropdownMenu.types';\n\nexport const DropdownMenuLabel = React.forwardRef<\n  React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n  DropdownMenuLabelProps\n>(({ className, inset, ...props }, ref) => (\n  <DropdownMenuPrimitive.Label\n    ref={ref}\n    data-slot=\"dropdown-menu-label\"\n    className={cn(\n      // Padding follows Figma's `Group` variant (Gap/7 on top, Gap/5 elsewhere) so the label\n      // lines up with item text. Typography and colour deliberately differ from the shared\n      // Figma Group component (Caption/Strong/Medium, Static/Text/Subtle).\n      'typography-label-sm text-ws-dynamic-secondary-default pt-ws-7 pr-ws-5 pb-ws-5 pl-ws-5',\n      inset && 'pl-ws-8',\n      className,\n    )}\n    {...props}\n  />\n));\n\nDropdownMenuLabel.displayName = 'DropdownMenu.Label';\n"
    },
    {
      "path": "src/components/dropdown/DropdownMenuPortal.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/dropdown/DropdownMenuPortal.tsx",
      "content": "'use client';\n\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { DropdownMenuPortalContext } from './DropdownMenu.context';\nimport type { DropdownMenuPortalProps } from './DropdownMenu.types';\n\n// DropdownMenu.Content portals itself, so this wrapper is optional. When it is used, its\n// `container` and `forceMount` must win: Content sees the flag and skips its own Portal.\nexport const DropdownMenuPortal = (props: DropdownMenuPortalProps) => (\n  <DropdownMenuPortalContext.Provider value>\n    <DropdownMenuPrimitive.Portal {...props} />\n  </DropdownMenuPortalContext.Provider>\n);\n\nDropdownMenuPortal.displayName = 'DropdownMenu.Portal';\n"
    },
    {
      "path": "src/components/dropdown/DropdownMenuSeparator.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/dropdown/DropdownMenuSeparator.tsx",
      "content": "'use client';\n\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { DropdownMenuSeparatorProps } from './DropdownMenu.types';\n\nexport const DropdownMenuSeparator = React.forwardRef<\n  React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n  DropdownMenuSeparatorProps\n>(({ className, ...props }, ref) => (\n  <DropdownMenuPrimitive.Separator\n    ref={ref}\n    data-slot=\"dropdown-menu-separator\"\n    className={cn('border-ws-static-base -mx-ws-3 my-ws-4 border-t', className)}\n    {...props}\n  />\n));\n\nDropdownMenuSeparator.displayName = 'DropdownMenu.Separator';\n"
    },
    {
      "path": "src/components/dropdown/DropdownMenuTrigger.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/dropdown/DropdownMenuTrigger.tsx",
      "content": "'use client';\n\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { DropdownMenuTriggerProps } from './DropdownMenu.types';\n\nexport const DropdownMenuTrigger = React.forwardRef<\n  React.ComponentRef<typeof DropdownMenuPrimitive.Trigger>,\n  DropdownMenuTriggerProps\n>(({ className, asChild, ...props }, ref) => (\n  <DropdownMenuPrimitive.Trigger\n    ref={ref}\n    data-slot=\"dropdown-menu-trigger\"\n    className={cn(\n      'cursor-pointer',\n      !asChild && 'focus-visible:wds-focus-visible focus-visible:wds-outline',\n      className,\n    )}\n    asChild={asChild}\n    {...props}\n  />\n));\n\nDropdownMenuTrigger.displayName = 'DropdownMenu.Trigger';\n"
    }
  ],
  "meta": {
    "version": "1.0.0",
    "commit": "8bb3627"
  }
}
