{"version":3,"file":"text-passage.D5-KDZzQ.js","sources":["../../../../../packages/web-components/src/lib/components/text-passage/text-passage.ts"],"sourcesContent":["import { html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { pdsCustomElement as customElement } from '../../decorators/pds-custom-element';\nimport { PdsElement } from '../PdsElement';\nimport '../linelength-container/linelength-container';\nimport lightDomStyles from './text-passage-light-dom.scss?inline';\n\n/**\n * @summary A wrapping element to help apply text styles\n *\n * @slot default Required: The content of the text passage\n */\n@customElement('pds-text-passage', {\n category: 'component',\n type: 'component',\n styles: {},\n})\nexport class PdsTextPassage extends PdsElement {\n /**\n * Add the light dom styles when this component is connected to a page\n */\n connectedCallback() {\n super.connectedCallback();\n const lightDomExists = document.head.querySelector(\n '#pds-text-passage-styles',\n );\n\n if (!lightDomExists) {\n const lightDomStyle = document.createElement('style');\n lightDomStyle.id = 'pds-text-passage-styles';\n lightDomStyle.innerHTML = lightDomStyles.toString();\n document.head.appendChild(lightDomStyle);\n }\n }\n\n protected override firstUpdated() {\n super.firstUpdated();\n }\n\n /**\n * - **default** default linelength cap\n * - **sm** small linelength cap\n * - **none** no linelength cap\n */\n @property()\n lineLength: 'sm' | 'none' | 'default' = 'default';\n\n /**\n * - **default** renders the text-passage with default body text size\n * - **sm** renders the text-passage with body text smaller than the default\n * - **lg** renders the text-passage with body text larger than the default\n */\n @property()\n size: 'sm' | 'lg' | 'default' = 'default';\n\n render() {\n const classes = {\n 'pds-c-text-passage': true,\n [`pds-c-text-passage--${this.size}`]: !!this.size,\n };\n\n return html`
\n ${this.lineLength === 'none'\n ? html``\n : html`\n \n `}\n
`;\n }\n}\n"],"names":["PdsTextPassage","PdsElement","lightDomStyle","lightDomStyles","classes","html","classMap","__decorateClass","property","customElement"],"mappings":";;;;;;;;;AAkBa,IAAAA,IAAN,cAA6BC,EAAW;AAAA,EAAxC,cAAA;AAAA,UAAA,GAAA,SAAA,GA4BmC,KAAA,aAAA,WAQR,KAAA,OAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,EAhChC,oBAAoB;AAMlB,QALA,MAAM,kBAAkB,GAKpB,CAJmB,SAAS,KAAK;AAAA,MACnC;AAAA,IAAA,GAGmB;AACb,YAAAC,IAAgB,SAAS,cAAc,OAAO;AACpD,MAAAA,EAAc,KAAK,2BACLA,EAAA,YAAYC,EAAe,YAChC,SAAA,KAAK,YAAYD,CAAa;AAAA,IACzC;AAAA,EACF;AAAA,EAEmB,eAAe;AAChC,UAAM,aAAa;AAAA,EACrB;AAAA,EAkBA,SAAS;AACP,UAAME,IAAU;AAAA,MACd,sBAAsB;AAAA,MACtB,CAAC,uBAAuB,KAAK,IAAI,EAAE,GAAG,CAAC,CAAC,KAAK;AAAA,IAAA;AAGxC,WAAAC,eAAkBC,EAASF,CAAO,CAAC;AAAA,QACtC,KAAK,eAAe,SAClBC,mBACAA,oCAAuC,KAAK,UAAU;AAAA;AAAA,sCAE1B;AAAA;AAAA,EAEpC;AACF;AAxBEE,EAAA;AAAA,EADCC,EAAS;AAAA,GA3BCR,EA4BX,WAAA,cAAA,CAAA;AAQAO,EAAA;AAAA,EADCC,EAAS;AAAA,GAnCCR,EAoCX,WAAA,QAAA,CAAA;AApCWA,IAANO,EAAA;AAAA,EALNE,EAAc,oBAAoB;AAAA,IACjC,UAAU;AAAA,IACV,MAAM;AAAA,IACN,QAAQ,CAAC;AAAA,EAAA,CACV;AAAA,GACYT,CAAA;"}