{"version":3,"file":"MentionsControl.cjs","names":["use","InputWrapperContext"],"sources":["../../../src/components/Mentions/MentionsControl.tsx"],"sourcesContent":["import { use } from 'react';\nimport { InputWrapperContext } from '../Input/InputWrapper.context';\n\nexport interface MentionsControlProps extends React.ComponentPropsWithoutRef<'textarea'> {\n  singleLine: boolean;\n  controlRef: React.Ref<HTMLTextAreaElement | HTMLInputElement>;\n  interactive: boolean;\n  dropdownOpened: boolean;\n  listId: string | null;\n  activeDescendant: string | undefined;\n  popupVisible: boolean;\n}\n\nexport function MentionsControl({\n  singleLine,\n  controlRef,\n  interactive,\n  dropdownOpened,\n  listId,\n  activeDescendant,\n  popupVisible,\n  ...others\n}: MentionsControlProps) {\n  const ctx = use(InputWrapperContext);\n  const sharedProps = {\n    ref: controlRef as any,\n    id: ctx.inputId,\n    'aria-describedby': ctx.describedBy,\n    ...others,\n    role: singleLine ? 'combobox' : undefined,\n    'aria-autocomplete': interactive ? ('list' as const) : undefined,\n    'aria-haspopup': interactive ? ('listbox' as const) : undefined,\n    'aria-expanded': singleLine ? dropdownOpened : undefined,\n    'aria-controls': dropdownOpened ? (listId ?? undefined) : undefined,\n    'aria-activedescendant': activeDescendant,\n    'data-mantine-stop-propagation': dropdownOpened || popupVisible || undefined,\n  };\n\n  return singleLine ? (\n    <input {...(sharedProps as React.ComponentPropsWithoutRef<'input'>)} />\n  ) : (\n    <textarea {...sharedProps} />\n  );\n}\n\nMentionsControl.displayName = '@mantine/core/MentionsControl';\n"],"mappings":";;;;;AAaA,SAAgB,gBAAgB,EAC9B,YACA,YACA,aACA,gBACA,QACA,kBACA,cACA,GAAG,UACoB;CACvB,MAAM,OAAA,GAAMA,MAAAA,IAAAA,CAAIC,6BAAAA,mBAAmB;CACnC,MAAM,cAAc;EAClB,KAAK;EACL,IAAI,IAAI;EACR,oBAAoB,IAAI;EACxB,GAAG;EACH,MAAM,aAAa,aAAa,KAAA;EAChC,qBAAqB,cAAe,SAAmB,KAAA;EACvD,iBAAiB,cAAe,YAAsB,KAAA;EACtD,iBAAiB,aAAa,iBAAiB,KAAA;EAC/C,iBAAiB,iBAAkB,UAAU,KAAA,IAAa,KAAA;EAC1D,yBAAyB;EACzB,iCAAiC,kBAAkB,gBAAgB,KAAA;CACrE;CAEA,OAAO,aACL,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD,EAAO,GAAK,YAA0D,CAAA,IAEtE,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAD,EAAU,GAAI,YAAc,CAAA;AAEhC;AAEA,gBAAgB,cAAc"}