carbon-custom-elements
Version:
A Carbon Design System variant that's as easy to use as native HTML elements, with no framework tax, no framework silo.
1 lines • 1.77 kB
Source Map (JSON)
{"version":3,"sources":["components/skeleton-text/skeleton-text.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAiC,UAAU,EAAE,MAAM,aAAa,CAAC;AAMxE;;GAEG;AACH,oBAAY,kBAAkB;IAC5B;;OAEG;IACH,OAAO,KAAK;IAEZ;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,IAAI,SAAS;CACd;AAED;;;GAGG;AACH,cACM,cAAe,SAAQ,UAAU;IACrC;;OAEG;IAEH,IAAI,qBAA8B;IAElC,MAAM;IAWN,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,cAAc,CAAC","file":"skeleton-text.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2020\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit-html/directives/class-map';\nimport { html, property, customElement, LitElement } from 'lit-element';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport styles from './skeleton-text.scss';\n\nconst { prefix } = settings;\n\n/**\n * Skeleton text types.\n */\nexport enum SKELETON_TEXT_TYPE {\n /**\n * Regular variant.\n */\n REGULAR = '',\n\n /**\n * Heading variant.\n */\n HEADING = 'heading',\n\n /**\n * Line variant.\n */\n LINE = 'line',\n}\n\n/**\n * Skeleton text.\n * @element bx-skeleton-text\n */\n@customElement(`${prefix}-skeleton-text`)\nclass BXSkeletonText extends LitElement {\n /**\n * The type of skeleton text.\n */\n @property({ reflect: true })\n type = SKELETON_TEXT_TYPE.REGULAR;\n\n render() {\n const { type } = this;\n const classes = classMap({\n [`${prefix}--skeleton__text`]: true,\n [`${prefix}--skeleton__heading`]: type === SKELETON_TEXT_TYPE.HEADING,\n });\n return html`\n <p class=\"${classes}\"></p>\n `;\n }\n\n static styles = styles;\n}\n\nexport default BXSkeletonText;\n"]}