@spectrum-web-components/badge 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,6 +6,7 @@
6
6
 
7
7
  [![See it on NPM!](https://img.shields.io/npm/v/@spectrum-web-components/badge?style=for-the-badge)](https://www.npmjs.com/package/@spectrum-web-components/badge)
8
8
  [![How big is this package in your project?](https://img.shields.io/bundlephobia/minzip/@spectrum-web-components/badge?style=for-the-badge)](https://bundlephobia.com/result?p=@spectrum-web-components/badge)
9
+ [![Try it on webcomponents.dev](https://img.shields.io/badge/Try%20it%20on-webcomponents.dev-green?style=for-the-badge)](https://studio.webcomponents.dev/edit/qxPsOTrGAPB92LzPfk4P/src/index.ts?p=stories)
9
10
 
10
11
  ```
11
12
  yarn add @spectrum-web-components/badge
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/badge",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -44,17 +44,17 @@
44
44
  "lit-html"
45
45
  ],
46
46
  "dependencies": {
47
- "@spectrum-web-components/base": "^0.5.6",
48
- "@spectrum-web-components/shared": "^0.14.1",
47
+ "@spectrum-web-components/base": "^0.5.8",
48
+ "@spectrum-web-components/shared": "^0.14.4",
49
49
  "tslib": "^2.0.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@spectrum-css/badge": "^1.0.18"
52
+ "@spectrum-css/badge": "^1.0.20"
53
53
  },
54
54
  "types": "./src/index.d.ts",
55
55
  "customElements": "custom-elements.json",
56
56
  "sideEffects": [
57
57
  "./sp-*.js"
58
58
  ],
59
- "gitHead": "8f5ea3556e160b6e30815edb2414dc5a5999a925"
59
+ "gitHead": "3be62133721efba844cd7032566a2c49ed6d9875"
60
60
  }
package/src/Badge.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sourceRoot":"","sources":["Badge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,EACJ,UAAU,EACV,eAAe,GAElB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAE3E,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAC3F,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAEpC,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,SAAS;IACT,aAAa;IACb,UAAU;IACV,UAAU;IACV,SAAS;IACT,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,SAAS;IACT,QAAQ;CACF,CAAC;AAGX;;;;;GAKG;AACH,MAAM,OAAO,KAAM,SAAQ,UAAU,CAAC,eAAe,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IAA3E;;QAMW,YAAO,GAAiB,aAAa,CAAC;IAUjD,CAAC;IAfU,MAAM,KAAK,MAAM;QACpB,OAAO,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;IAKS,MAAM;QACZ,OAAO,IAAI,CAAA;2CACwB,CAAC,IAAI,CAAC,cAAc;;;;SAItD,CAAC;IACN,CAAC;CACJ;AAVG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCACG","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js';\nimport styles from './badge.css.js';\n\nexport const BADGE_VARIANTS = [\n 'neutral',\n 'informative',\n 'positive',\n 'negative',\n 'fuchsia',\n 'indigo',\n 'magenta',\n 'purple',\n 'seafoam',\n 'yellow',\n] as const;\nexport type BadgeVariant = typeof BADGE_VARIANTS[number];\n\n/**\n * @element sp-badge\n *\n * @slot - Text label of the badge\n * @slot icon - Optional icon that appears to the left of the label\n */\nexport class Badge extends SizedMixin(ObserveSlotText(SpectrumElement, '')) {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: String, reflect: true })\n public variant: BadgeVariant = 'informative';\n\n protected render(): TemplateResult {\n return html`\n <slot name=\"icon\" ?icon-only=${!this.slotHasContent}></slot>\n <div id=\"label\">\n <slot></slot>\n </div>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"Badge.js","sourceRoot":"","sources":["Badge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,EACJ,UAAU,EACV,eAAe,GAElB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAE3E,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAC3F,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAEpC,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,SAAS;IACT,aAAa;IACb,UAAU;IACV,UAAU;IACV,SAAS;IACT,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,SAAS;IACT,QAAQ;CACF,CAAC;AAGX;;;;;GAKG;AACH,MAAM,OAAO,KAAM,SAAQ,UAAU,CAAC,eAAe,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IAA3E;;QAMW,YAAO,GAAiB,aAAa,CAAC;IAUjD,CAAC;IAfU,MAAM,KAAc,MAAM;QAC7B,OAAO,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;IAKkB,MAAM;QACrB,OAAO,IAAI,CAAA;2CACwB,CAAC,IAAI,CAAC,cAAc;;;;SAItD,CAAC;IACN,CAAC;CACJ;AAVG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCACG","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js';\nimport styles from './badge.css.js';\n\nexport const BADGE_VARIANTS = [\n 'neutral',\n 'informative',\n 'positive',\n 'negative',\n 'fuchsia',\n 'indigo',\n 'magenta',\n 'purple',\n 'seafoam',\n 'yellow',\n] as const;\nexport type BadgeVariant = typeof BADGE_VARIANTS[number];\n\n/**\n * @element sp-badge\n *\n * @slot - Text label of the badge\n * @slot icon - Optional icon that appears to the left of the label\n */\nexport class Badge extends SizedMixin(ObserveSlotText(SpectrumElement, '')) {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: String, reflect: true })\n public variant: BadgeVariant = 'informative';\n\n protected override render(): TemplateResult {\n return html`\n <slot name=\"icon\" ?icon-only=${!this.slotHasContent}></slot>\n <div id=\"label\">\n <slot></slot>\n </div>\n `;\n }\n}\n"]}