{"version":3,"file":"static/js/9839.358fe4ed.chunk.js","mappings":"gLAWaA,EAAiB,SAACC,GAC7B,IAAKA,EACH,MAAO,CAAEC,KAAM,CAAC,GAGlB,IAAIC,EASEC,GAPJD,EADkB,kBAATF,EACFI,KAAKC,MAAML,GAEdM,OAAAC,OAAA,GACCP,IAIgBQ,MAEvB,cADON,EAAKM,MACL,CAAEC,UAASN,EAAEF,KAAIC,EAC1B,C,qGCpBaQ,EAAY,W,0DAEE,W,aACa,U,2CAItCC,EAAAC,UAAAC,OAAA,WACQ,IAAAF,GAAsBZ,EAAAA,EAAAA,GAAee,KAAKC,MAAxCZ,EAASQ,EAAAF,UAAEO,EAAIL,EAAAV,KAEjBgB,EAAU,CAAC,cAEI,YAAjBH,KAAKI,QACPD,EAAQE,KAAK,2BAEbF,EAAQE,KAAK,kBAGXL,KAAKM,OACPH,EAAQE,KAAK,eAAAE,OAAeP,KAAKM,QAE/BN,KAAKQ,MACPL,EAAQE,KAAK,eAAAE,OAAeP,KAAKQ,OAE/BnB,GACFc,EAAQE,KAAKhB,GAEf,IAAMD,EAAae,EAAQM,KAAK,KAEhC,OACEC,EAAAA,EAAAA,GAAA,IAAAlB,OAAAC,OAAA,GAAOS,EAAI,CAAER,MAAON,IACjBY,KAAKW,O,IA/BW,G,QCRK,+tyB","sources":["../node_modules/@patentstyret/designsystem/dist/esm-es5/src/utils/parse-helper.ts","../node_modules/@patentstyret/designsystem/dist/esm-es5/src/components/material-icon/material-icon.tsx","../node_modules/@patentstyret/designsystem/dist/esm-es5/src/components/material-icon/material-icon.styles.scss?tag=ps-material-icon"],"sourcesContent":["import { RootProps } from '../types/entities';\r\n\r\n/**\r\n *\r\n * @param args\r\n * Vanilla web components are restricted to string attributes,\r\n * while React and Angular can use object literals as arguments\r\n * \r\n * @returns rootClass: for overwriting the default styles of the component\r\n * @returns attr: attributes which are added to the root element\r\n */\r\nexport const parseRootProps = (args?: RootProps | string): { rootClass?: string; attr: RootProps } => {\r\n if (!args) {\r\n return { attr: {} };\r\n }\r\n\r\n let attr: RootProps;\r\n if (typeof args === 'string') {\r\n attr = JSON.parse(args) as RootProps;\r\n } else {\r\n attr = {\r\n ...args, // immutable\r\n };\r\n }\r\n\r\n const rootClass = attr.class;\r\n delete attr.class;\r\n return { rootClass, attr };\r\n};\r\n","import { h, Component, Prop } from '@stencil/core';\r\nimport { IconSize, Root } from '../../types/entities';\r\nimport { parseRootProps } from '../../utils/parse-helper';\r\n\r\n@Component({\r\n tag: 'ps-material-icon',\r\n styleUrl: 'material-icon.styles.scss',\r\n})\r\nexport class MaterialIcon {\r\n @Prop() color: 'black' | 'white';\r\n @Prop() size: IconSize = 'standard';\r\n @Prop() variant: 'fill' | 'outline' = 'outline';\r\n @Prop() symbol: string;\r\n @Prop() root?: Root;\r\n\r\n render() {\r\n const { rootClass, attr } = parseRootProps(this.root);\r\n\r\n const classes = ['ds-ma-icon'];\r\n\r\n if (this.variant === 'outline') {\r\n classes.push('material-icons-outlined');\r\n } else {\r\n classes.push('material-icons');\r\n }\r\n\r\n if (this.color) {\r\n classes.push(`ds-ma-icon__${this.color}`);\r\n }\r\n if (this.size) {\r\n classes.push(`ds-ma-icon--${this.size}`);\r\n }\r\n if (rootClass) {\r\n classes.push(rootClass);\r\n }\r\n const classNames = classes.join(' ');\r\n\r\n return (\r\n \r\n {this.symbol}\r\n \r\n );\r\n }\r\n}\r\n",".ds-ma-icon {\r\n \r\n vertical-align: middle;\r\n\r\n color: inherit;\r\n\r\n &__black {\r\n color: $ds-color-black;\r\n }\r\n\r\n &__white {\r\n color: $ds-color-white;\r\n }\r\n}\r\n\r\n/************ SIZES ************/\r\n\r\n.ds-ma-icon.ds-ma-icon {\r\n\r\n &--xs {\r\n font-size: 16px;\r\n }\r\n \r\n &--sm {\r\n font-size: 24px;\r\n }\r\n \r\n &--md {\r\n font-size: 32px;\r\n }\r\n\r\n &--lg {\r\n font-size: 48px;\r\n }\r\n \r\n &--xl {\r\n font-size: 64px;\r\n }\r\n \r\n &--xxl {\r\n font-size: 128px;\r\n }\r\n\r\n /* responsive size; used with text */\r\n &--standard {\r\n margin-bottom: 0.1rem;\r\n font-size: 1.25rem;\r\n @media (min-width: breakpoint(md)) {\r\n font-size: 1.5rem;\r\n }\r\n }\r\n}\r\n"],"names":["parseRootProps","r","attr","s","t","JSON","parse","Object","assign","class","rootClass","MaterialIcon","o","prototype","render","this","root","f","n","variant","push","color","concat","size","join","h","symbol"],"sourceRoot":""}