{"version":3,"file":"use-props.cjs","names":["useMantineTheme","filterProps"],"sources":["../../../../src/core/MantineProvider/use-props/use-props.ts"],"sourcesContent":["import { filterProps } from '../../utils';\nimport { useMantineTheme } from '../MantineThemeProvider';\n\nexport function useProps<T extends Record<string, any>, U extends Partial<T> | null = {}>(\n  component: string,\n  defaultProps: U,\n  props: T\n): T &\n  (U extends null | undefined\n    ? {}\n    : {\n        [Key in Extract<keyof T, keyof U>]-?: U[Key] | NonNullable<T[Key]>;\n      }) {\n  const theme = useMantineTheme();\n  const contextPropsPayload = theme.components[component]?.defaultProps;\n  const contextProps =\n    typeof contextPropsPayload === 'function' ? contextPropsPayload(theme) : contextPropsPayload;\n\n  return { ...defaultProps, ...contextProps, ...filterProps(props) };\n}\n"],"mappings":";;;;AAGA,SAAgB,SACd,WACA,cACA,OAMO;CACP,MAAM,QAAQA,6BAAAA,iBAAiB;CAC/B,MAAM,sBAAsB,MAAM,WAAW,YAAY;CACzD,MAAM,eACJ,OAAO,wBAAwB,aAAa,oBAAoB,MAAM,GAAG;AAE3E,QAAO;EAAE,GAAG;EAAc,GAAG;EAAc,GAAGC,qBAAAA,YAAY,MAAM;EAAE"}