Compare commits

..

No commits in common. "main" and "v2.0.3" have entirely different histories.
main ... v2.0.3

6 changed files with 20 additions and 48 deletions

View file

@ -7,7 +7,7 @@ Colored circles that can pulse. That's it. That's the component.
Copy the following to your HTML page: Copy the following to your HTML page:
```html ```html
<script type="module" src="https://esm.sh/@ayo-run/status-indicator@2.1.2/es2022/status-indicator.mjs"></script> <script type="module" src="https://esm.sh/@ayo-run/status-indicator"></script>
<status-indicator pulse status="positive"> <status-indicator pulse status="positive">
All systems operational All systems operational
@ -16,6 +16,9 @@ Copy the following to your HTML page:
See example on CodePen: https://codepen.io/ayo-run/pen/RNorXrK See example on CodePen: https://codepen.io/ayo-run/pen/RNorXrK
> [!NOTE]
> In this example, `esm.sh` bundles the base class together with the component. For most use cases, that is good enough but, still, "it depends". Copying the code will work just fine, but it woudn't hurt to read around about the trade-offs how bundling affects your application.
## Installation via NPM ## Installation via NPM
If you want to install the library as a node module, you can install the [published package](https://npmx.dev/@ayo-run/status-indicator) and the [base class](https://webcomponent.io) via NPM: If you want to install the library as a node module, you can install the [published package](https://npmx.dev/@ayo-run/status-indicator) and the [base class](https://webcomponent.io) via NPM:
@ -83,7 +86,7 @@ You can add the `pulse` attribute to make the circle... pulse
## Result ## Result
![screenshot](https://raw.githubusercontent.com/ayo-run/status-indicator/refs/heads/main/screenshot.png) ![screenshot](./screenshot.png)
--- ---

View file

@ -90,11 +90,8 @@
</section> </section>
<section> <section>
<h3>Quick Start</h3> <h3>Quick Start</h3>
<p>
Copy the following to your HTML page:
</p>
<code><pre> <code><pre>
&lt;script type="module" src="https://esm.sh/@ayo-run/status-indicator@2.1.2/es2022/status-indicator.mjs"&gt;&lt;/script&gt; &lt;script type="module" src="https://esm.sh/@ayo-run/status-indicator"&gt;&lt;/script&gt;
&lt;status-indicator pulse status="positive"&gt; &lt;status-indicator pulse status="positive"&gt;
All systems operational All systems operational

View file

@ -1,6 +1,6 @@
{ {
"name": "@ayo-run/status-indicator", "name": "@ayo-run/status-indicator",
"version": "2.1.2", "version": "2.0.3",
"type": "module", "type": "module",
"description": "Circles with color that can pulse to indicate status", "description": "Circles with color that can pulse to indicate status",
"license": "MIT", "license": "MIT",
@ -11,7 +11,6 @@
}, },
"homepage": "https://status-indicator.webcomponent.io", "homepage": "https://status-indicator.webcomponent.io",
"module": "./dist/status-indicator.js", "module": "./dist/status-indicator.js",
"types": "./dist/status-indicator.d.ts",
"exports": { "exports": {
".": { ".": {
"default": "./dist/status-indicator.js", "default": "./dist/status-indicator.js",
@ -22,7 +21,8 @@
"files": [ "files": [
"dist", "dist",
"README.md", "README.md",
"LICENSE" "LICENSE",
"screenshot.png"
], ],
"scripts": { "scripts": {
"test": "echo \"Warning: no test specified\"", "test": "echo \"Warning: no test specified\"",
@ -35,8 +35,8 @@
"@types/node": "^25.6.2", "@types/node": "^25.6.2",
"eslint": "^10.3.0", "eslint": "^10.3.0",
"husky": "^9.1.7", "husky": "^9.1.7",
"vite": "^8.0.11", "unplugin-dts": "^1.0.0",
"vite-plugin-dts": "^5.0.0" "vite": "^8.0.11"
}, },
"peerDependencies": { "peerDependencies": {
"web-component-base": "^4.1.2" "web-component-base": "^4.1.2"

View file

@ -21,12 +21,12 @@ importers:
husky: husky:
specifier: ^9.1.7 specifier: ^9.1.7
version: 9.1.7 version: 9.1.7
unplugin-dts:
specifier: ^1.0.0
version: 1.0.0(typescript@6.0.3)(vite@8.0.11(@types/node@25.6.2))
vite: vite:
specifier: ^8.0.11 specifier: ^8.0.11
version: 8.0.11(@types/node@25.6.2) version: 8.0.11(@types/node@25.6.2)
vite-plugin-dts:
specifier: ^5.0.0
version: 5.0.0(typescript@6.0.3)(vite@8.0.11(@types/node@25.6.2))
packages: packages:
@ -665,20 +665,6 @@ packages:
uri-js@4.4.1: uri-js@4.4.1:
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
vite-plugin-dts@5.0.0:
resolution: {integrity: sha512-VLNAUttBq7pLxxL/m/ztjd5zj5yiviiC7ijfPFVLK5c45FLcibvieBsdjSka3a4ag1qdrAF9K3OysH4/lW+rPQ==}
peerDependencies:
'@microsoft/api-extractor': '>=7'
rollup: '>=3'
vite: '>=3'
peerDependenciesMeta:
'@microsoft/api-extractor':
optional: true
rollup:
optional: true
vite:
optional: true
vite@8.0.11: vite@8.0.11:
resolution: {integrity: sha512-Jz1mxtUBR5xTT65VOdJZUUeoyLtqljmFkiUXhPTLZka3RDc9vpi/xXkyrnsdRcm2lIi3l3GPMnAidTsEGIj3Ow==} resolution: {integrity: sha512-Jz1mxtUBR5xTT65VOdJZUUeoyLtqljmFkiUXhPTLZka3RDc9vpi/xXkyrnsdRcm2lIi3l3GPMnAidTsEGIj3Ow==}
engines: {node: ^20.19.0 || >=22.12.0} engines: {node: ^20.19.0 || >=22.12.0}
@ -1300,20 +1286,6 @@ snapshots:
dependencies: dependencies:
punycode: 2.3.1 punycode: 2.3.1
vite-plugin-dts@5.0.0(typescript@6.0.3)(vite@8.0.11(@types/node@25.6.2)):
dependencies:
unplugin-dts: 1.0.0(typescript@6.0.3)(vite@8.0.11(@types/node@25.6.2))
optionalDependencies:
vite: 8.0.11(@types/node@25.6.2)
transitivePeerDependencies:
- '@rspack/core'
- '@vue/language-core'
- esbuild
- rolldown
- supports-color
- typescript
- webpack
vite@8.0.11(@types/node@25.6.2): vite@8.0.11(@types/node@25.6.2):
dependencies: dependencies:
lightningcss: 1.32.0 lightningcss: 1.32.0

View file

@ -30,7 +30,6 @@ class StatusIndicator extends WebComponent {
} }
get template(): any { get template(): any {
// @ts-ignore: Needs fixing on the base class
const statusColor = this.#indicatorColor[this.props.status] const statusColor = this.#indicatorColor[this.props.status]
return html` return html`

View file

@ -1,22 +1,23 @@
import { resolve } from 'node:path' import { resolve } from 'node:path'
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import dts from 'vite-plugin-dts' import dts from 'unplugin-dts/vite'
export default defineConfig({ export default defineConfig({
publicDir: false,
build: { build: {
lib: { lib: {
entry: resolve(import.meta.dirname, 'src/status-indicator.ts'), entry: resolve(import.meta.dirname, 'src/status-indicator.js'),
name: 'StatusIndicator', name: 'StatusIndicator',
fileName: 'status-indicator', fileName: 'status-indicator',
formats: ['es']
}, },
rolldownOptions: { rolldownOptions: {
external: ['web-component-base'], external: ['web-component-base'],
output: { output: {
globals: { globals: {
'web-component-base': 'web-component-base', 'WebComponent': 'WebComponent',
'html': 'html'
} }
}, }
} }
}, },
plugins: [dts()] plugins: [dts()]