UNPKG

1.97 kBSource Map (JSON)View Raw
1{"version":3,"file":"mergeStyles.js","sourceRoot":"../src/","sources":["mergeStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;GAIG;AACH,MAAM,UAAU,WAAW;IAAC,cAAgE;SAAhE,UAAgE,EAAhE,qBAAgE,EAAhE,IAAgE;QAAhE,yBAAgE;;IAC1F,OAAO,QAAQ,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CACtB,IAAqH,EACrH,OAAuB;IAEvB,IAAM,SAAS,GAAG,IAAI,YAAY,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAClD,IAAA,iCAAmD,EAAjD,oBAAO,EAAE,oBAAwC,CAAC;IAE1D,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;KACxD;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["import { extractStyleParts } from './extractStyleParts';\nimport { IStyle, IStyleBaseArray } from './IStyle';\nimport { IStyleOptions } from './IStyleOptions';\nimport { getStyleOptions } from './StyleOptionsState';\nimport { styleToClassName } from './styleToClassName';\n\n/**\n * Concatenation helper, which can merge class names together. Skips over falsey values.\n *\n * @public\n */\nexport function mergeStyles(...args: (IStyle | IStyleBaseArray | false | null | undefined)[]): string {\n return mergeCss(args, getStyleOptions());\n}\n\n/**\n * Concatenation helper, which can merge class names together. Skips over falsey values.\n * Accepts a set of options that will be used when calculating styles.\n *\n * @public\n */\nexport function mergeCss(\n args: (IStyle | IStyleBaseArray | false | null | undefined) | (IStyle | IStyleBaseArray | false | null | undefined)[],\n options?: IStyleOptions,\n): string {\n const styleArgs = args instanceof Array ? args : [args];\n const { classes, objects } = extractStyleParts(styleArgs);\n\n if (objects.length) {\n classes.push(styleToClassName(options || {}, objects));\n }\n\n return classes.join(' ');\n}\n"]}
\No newline at end of file