UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

1 lines 1.2 kB
{"version":3,"file":"Popover.mjs","names":["Popover: FC<PopoverProps>"],"sources":["../../src/Popover/Popover.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, useContext } from 'react';\n\nimport { PopoverInGroup } from './PopoverInGroup';\nimport { PopoverStandalone } from './PopoverStandalone';\nimport { PopoverGroupHandleContext } from './groupContext';\nimport type { PopoverProps } from './type';\n\nexport { parseTrigger } from './parseTrigger';\n\nconst Popover: FC<PopoverProps> = (props) => {\n const group = useContext(PopoverGroupHandleContext);\n\n // Group mode is driven by trigger interactions; keep standalone behavior for controlled cases.\n const canUseGroup =\n Boolean(group) &&\n props.open === undefined &&\n props.defaultOpen === undefined &&\n !props.standalone;\n\n return canUseGroup ? <PopoverInGroup {...props} /> : <PopoverStandalone {...props} />;\n};\n\nPopover.displayName = 'Popover';\n\nexport default Popover;\n"],"mappings":";;;;;;;;;;AAWA,MAAMA,WAA6B,UAAU;CAC3C,MAAM,QAAQ,WAAW,0BAA0B;AASnD,QALE,QAAQ,MAAM,IACd,MAAM,SAAS,UACf,MAAM,gBAAgB,UACtB,CAAC,MAAM,aAEY,oBAAC,kBAAe,GAAI,QAAS,GAAG,oBAAC,qBAAkB,GAAI,QAAS;;AAGvF,QAAQ,cAAc;AAEtB,sBAAe"}