{"version":3,"file":"NativeSelect.cjs","names":["factory","useProps","getParsedComboboxData","NativeSelectOption","InputBase","ComboboxChevron"],"sources":["../../../src/components/NativeSelect/NativeSelect.tsx"],"sourcesContent":["import { BoxProps, ElementProps, factory, Factory, StylesApiProps, useProps } from '../../core';\nimport { ComboboxChevron, ComboboxData, getParsedComboboxData } from '../Combobox';\nimport { __BaseInputProps, __InputStylesNames } from '../Input';\nimport { InputBase } from '../InputBase';\nimport { NativeSelectOption } from './NativeSelectOption';\n\nexport interface NativeSelectProps\n  extends\n    BoxProps,\n    Omit<__BaseInputProps, 'pointer'>,\n    StylesApiProps<NativeSelectFactory>,\n    ElementProps<'select', 'size'> {\n  /**\n   * Data used to render options. Accepts strings, objects with label/value,\n   * or grouped options. If `children` prop is provided, `data` will be ignored.\n   */\n  data?: ComboboxData;\n}\n\nexport type NativeSelectFactory = Factory<{\n  props: NativeSelectProps;\n  ref: HTMLSelectElement;\n  stylesNames: __InputStylesNames;\n}>;\n\nconst defaultProps = {\n  rightSectionPointerEvents: 'none',\n} satisfies Partial<NativeSelectProps>;\n\nexport const NativeSelect = factory<NativeSelectFactory>((props) => {\n  const { data, children, size, error, rightSection, unstyled, ...others } = useProps(\n    'NativeSelect',\n    defaultProps,\n    props\n  );\n\n  const options = getParsedComboboxData<string>(data).map((item, index) => (\n    <NativeSelectOption key={index} data={item} />\n  ));\n\n  return (\n    <InputBase\n      component=\"select\"\n      {...others}\n      __staticSelector=\"NativeSelect\"\n      size={size}\n      pointer\n      error={error}\n      unstyled={unstyled}\n      rightSection={\n        rightSection || <ComboboxChevron size={size} error={error} unstyled={unstyled} />\n      }\n    >\n      {children || options}\n    </InputBase>\n  );\n});\n\nNativeSelect.classes = InputBase.classes;\nNativeSelect.displayName = '@mantine/core/NativeSelect';\n"],"mappings":";;;;;;;;;;AAyBA,MAAM,eAAe,EACnB,2BAA2B,QAC5B;AAED,MAAa,eAAeA,gBAAAA,SAA8B,UAAU;CAClE,MAAM,EAAE,MAAM,UAAU,MAAM,OAAO,cAAc,UAAU,GAAG,WAAWC,kBAAAA,SACzE,gBACA,cACA,MACD;CAED,MAAM,UAAUC,iCAAAA,sBAA8B,KAAK,CAAC,KAAK,MAAM,UAC7D,iBAAA,GAAA,kBAAA,KAACC,2BAAAA,oBAAD,EAAgC,MAAM,MAAQ,EAArB,MAAqB,CAC9C;AAEF,QACE,iBAAA,GAAA,kBAAA,KAACC,kBAAAA,WAAD;EACE,WAAU;EACV,GAAI;EACJ,kBAAiB;EACX;EACN,SAAA;EACO;EACG;EACV,cACE,gBAAgB,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,iBAAD;GAAuB;GAAa;GAAiB;GAAY,CAAA;YAGlF,YAAY;EACH,CAAA;EAEd;AAEF,aAAa,UAAUD,kBAAAA,UAAU;AACjC,aAAa,cAAc"}