UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

1 lines 957 B
{"version":3,"file":"get-style-object.cjs","names":[],"sources":["../../../../src/core/Box/get-style-object/get-style-object.ts"],"sourcesContent":["import type { MantineTheme } from '../../MantineProvider';\nimport type { MantineStyleProp } from '../Box.types';\n\nexport function getStyleObject(\n style: MantineStyleProp | undefined,\n theme: MantineTheme\n): React.CSSProperties {\n if (Array.isArray(style)) {\n return [...style].reduce<Record<string, any>>(\n (acc, item) => ({ ...acc, ...getStyleObject(item, theme) }),\n {}\n );\n }\n\n if (typeof style === 'function') {\n return style(theme);\n }\n\n if (style == null) {\n return {};\n }\n\n return style;\n}\n"],"mappings":";;AAGA,SAAgB,eACd,OACA,OACqB;AACrB,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,CAAC,GAAG,MAAM,CAAC,QACf,KAAK,UAAU;EAAE,GAAG;EAAK,GAAG,eAAe,MAAM,MAAM;EAAE,GAC1D,EAAE,CACH;AAGH,KAAI,OAAO,UAAU,WACnB,QAAO,MAAM,MAAM;AAGrB,KAAI,SAAS,KACX,QAAO,EAAE;AAGX,QAAO"}