UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

1 lines 902 B
{"version":3,"file":"merge-vars.cjs","names":["filterProps"],"sources":["../../../../../../src/core/styles-api/use-styles/get-style/resolve-vars/merge-vars.ts"],"sourcesContent":["import { CssVariable } from '../../../../Box';\nimport { filterProps } from '../../../../utils';\n\nexport type ResolvedVars = Partial<Record<string, Record<CssVariable, string | undefined>>>;\n\nexport function mergeVars(vars: (ResolvedVars | undefined)[]) {\n return vars.reduce<ResolvedVars>((acc, current) => {\n if (current) {\n Object.keys(current).forEach((key) => {\n acc[key] = { ...acc[key], ...filterProps(current[key]!) };\n });\n }\n\n return acc;\n }, {});\n}\n"],"mappings":";;;AAKA,SAAgB,UAAU,MAAoC;AAC5D,QAAO,KAAK,QAAsB,KAAK,YAAY;AACjD,MAAI,QACF,QAAO,KAAK,QAAQ,CAAC,SAAS,QAAQ;AACpC,OAAI,OAAO;IAAE,GAAG,IAAI;IAAM,GAAGA,qBAAAA,YAAY,QAAQ,KAAM;IAAE;IACzD;AAGJ,SAAO;IACN,EAAE,CAAC"}