@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
1 lines • 1.86 kB
Source Map (JSON)
{"version":3,"file":"ComboboxDropdown.cjs","names":["factory","useProps","useComboboxContext","Popover","classes"],"sources":["../../../../src/components/Combobox/ComboboxDropdown/ComboboxDropdown.tsx"],"sourcesContent":["import { factory, Factory, useProps } from '../../../core';\nimport { Popover, PopoverDropdownProps } from '../../Popover';\nimport { useComboboxContext } from '../Combobox.context';\nimport classes from '../Combobox.module.css';\n\nexport type ComboboxDropdownStylesNames = 'dropdown';\n\nexport interface ComboboxDropdownProps extends PopoverDropdownProps {\n /** Determines whether the dropdown should be hidden, for example, when there are no options to display */\n hidden?: boolean;\n}\n\nexport type ComboboxDropdownFactory = Factory<{\n props: ComboboxDropdownProps;\n ref: HTMLDivElement;\n stylesNames: ComboboxDropdownStylesNames;\n compound: true;\n}>;\n\nexport const ComboboxDropdown = factory<ComboboxDropdownFactory>((props) => {\n const { classNames, styles, className, style, hidden, ...others } = useProps(\n 'ComboboxDropdown',\n null,\n props\n );\n\n const ctx = useComboboxContext();\n\n return (\n <Popover.Dropdown\n {...others}\n role=\"presentation\"\n data-hidden={hidden || undefined}\n {...ctx.getStyles('dropdown', { className, style, classNames, styles })}\n />\n );\n});\n\nComboboxDropdown.classes = classes;\nComboboxDropdown.displayName = '@mantine/core/ComboboxDropdown';\n"],"mappings":";;;;;;;;;AAmBA,MAAa,mBAAmBA,gBAAAA,SAAkC,UAAU;CAC1E,MAAM,EAAE,YAAY,QAAQ,WAAW,OAAO,QAAQ,GAAG,WAAWC,kBAAAA,SAClE,oBACA,MACA,MACD;CAED,MAAM,MAAMC,yBAAAA,oBAAoB;AAEhC,QACE,iBAAA,GAAA,kBAAA,KAACC,gBAAAA,QAAQ,UAAT;EACE,GAAI;EACJ,MAAK;EACL,eAAa,UAAU,KAAA;EACvB,GAAI,IAAI,UAAU,YAAY;GAAE;GAAW;GAAO;GAAY;GAAQ,CAAC;EACvE,CAAA;EAEJ;AAEF,iBAAiB,UAAUC,wBAAAA;AAC3B,iBAAiB,cAAc"}