edu-webcomponents 1.15.4 → 1.17.0

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.
@@ -1,28 +1,28 @@
1
- name: Build and Publish Storybook to GitHub Pages
2
-
3
- on:
4
- push:
5
- branches:
6
- - 'main'
7
-
8
- permissions:
9
- contents: read
10
- pages: write
11
- id-token: write
12
-
13
- jobs:
14
- deploy:
15
- runs-on: ubuntu-latest
16
- steps:
17
- - uses: actions/checkout@v4
18
-
19
- - uses: actions/setup-node@v4
20
- with:
21
- node-version: '18.x'
22
-
23
- - uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
24
- with:
25
- install_command: npm install
26
- build_command: npm run build-storybook
27
- path: storybook-static
1
+ name: Build and Publish Storybook to GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - 'main'
7
+
8
+ permissions:
9
+ contents: read
10
+ pages: write
11
+ id-token: write
12
+
13
+ jobs:
14
+ deploy:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - uses: actions/setup-node@v4
20
+ with:
21
+ node-version: '18.x'
22
+
23
+ - uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
24
+ with:
25
+ install_command: npm install
26
+ build_command: npm run build-storybook
27
+ path: storybook-static
28
28
  checkout: false
@@ -1,21 +1,21 @@
1
- name: Publish Package to npmjs
2
- on:
3
- release:
4
- types: [published]
5
- jobs:
6
- build:
7
- runs-on: ubuntu-latest
8
- permissions:
9
- contents: read
10
- id-token: write
11
- steps:
12
- - uses: actions/checkout@v4
13
- - uses: actions/setup-node@v4
14
- with:
15
- node-version: '20.x'
16
- registry-url: 'https://registry.npmjs.org'
17
- - run: npm install -g npm
18
- - run: npm ci
19
- - run: npm publish --provenance --access public
20
- env:
21
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1
+ name: Publish Package to npmjs
2
+ on:
3
+ release:
4
+ types: [published]
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ permissions:
9
+ contents: read
10
+ id-token: write
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-node@v4
14
+ with:
15
+ node-version: '20.x'
16
+ registry-url: 'https://registry.npmjs.org'
17
+ - run: npm install -g npm
18
+ - run: npm ci
19
+ - run: npm publish --provenance --access public
20
+ env:
21
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,19 +1,36 @@
1
- on:
2
- push:
3
- branches:
4
- - main
5
-
6
- jobs:
7
- release-on-merge:
8
- runs-on: ubuntu-latest
9
- permissions:
10
- contents: write
11
- env:
12
- GITHUB_TOKEN: ${{ secrets.RELEASE }}
13
- steps:
14
- - name: release
15
- uses: dexwritescode/release-on-merge-action@v1
16
- with:
17
- version-increment-strategy: minor
18
- initial-version: '1.15.4'
19
- tag-prefix: v
1
+ on:
2
+ push:
3
+ branches:
4
+ - main
5
+
6
+ jobs:
7
+ release:
8
+ runs-on: ubuntu-latest
9
+ permissions:
10
+ contents: write
11
+
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - name: Set up Node
16
+ uses: actions/setup-node@v4
17
+ with:
18
+ node-version: 20
19
+
20
+ - name: Get version from package.json
21
+ id: version
22
+ run: echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
23
+
24
+ - name: Create tag
25
+ run: |
26
+ git config user.name "github-actions"
27
+ git config user.email "github-actions@github.com"
28
+ git tag v${{ steps.version.outputs.version }}
29
+ git push origin v${{ steps.version.outputs.version }}
30
+
31
+ - name: Create GitHub Release
32
+ uses: softprops/action-gh-release@v2
33
+ with:
34
+ tag_name: v${{ steps.version.outputs.version }}
35
+ env:
36
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/CHANGELOG.md CHANGED
@@ -1,61 +1,67 @@
1
- # CHANGELOG
2
-
3
- ## 1.15.4 - 2025-08-02
4
- - Fix versioning of release
5
-
6
- ## 1.15.3 - 2025-08-02
7
- - Fix EduButton is always disabled
8
-
9
- ## 1.15.2 - 2025-08-02
10
- - Fix EduButton is always disabled
11
-
12
- ## 1.15.1 - 2025-08-02
13
- - Fix EduButton is always disabled
14
-
15
- ## 1.15.0 - 2025-08-02
16
- - Improve EduButton component by adding aria-label and type attributes, disabled state and styles
17
-
18
- ## 1.14.0 - 2024-06-21
19
- - Update docs of publishing packages to npm registry with provenance
20
-
21
- ## 1.13.0 - 2024-06-20
22
- - Fix provenance when publishing packages to npm registry
23
-
24
- ## 1.12.0 - 2024-06-20
25
- - Update dependencies
26
-
27
- ## 1.11.0 - 2024-06-19
28
- - Add provenance to packages in npm registry
29
-
30
- ## 1.10.0 - 2024-06-17
31
- - Add keywords to the repository
32
-
33
- ## 1.9.0 - 2024-06-16
34
- - Update dependencies
35
-
36
- ## 1.8.0 - 2024-06-15
37
- - Setup [npm-check-updates](https://www.npmjs.com/package/npm-check-updates) to manage updates of dependencies of package.json
38
-
39
- ## 1.7.0 - 2024-06-02
40
- - Setup GitHub Actions to publish packages in npm registry
41
-
42
- ## 1.6.0 - 2024-06-01
43
- - Setup GitHub Actions to tag and release after merge into main
44
-
45
- ## 1.5.0 - 2024-05-30
46
- - Add docs to enable the deployment of GitHub Actions artifacts into GitHub Pages
47
-
48
- ## 1.4.0 - 2024-05-30
49
- - Setup GitHub Actions to publish Storybook built artifacts in GitHub Pages
50
-
51
- ## 1.3.0 - 2024-05-28
52
- - Setup Storybook
53
-
54
- ## 1.2.0 - 2024-05-27
55
- - Setup the repository to be a library of web components
56
-
57
- ## 1.1.0 - 2024-05-26
58
- - Setup Husky
59
-
60
- ## 1.0.0 - 2024-05-25
1
+ # CHANGELOG
2
+
3
+ ## 1.17.0 - 2025-08-02
4
+ - Make releasing and tagging use the version from package.json
5
+
6
+ ## 1.16.1 - 2025-08-02
7
+ - Fix versioning of release
8
+
9
+ ## 1.15.4 - 2025-08-02
10
+ - Fix versioning of release
11
+
12
+ ## 1.15.3 - 2025-08-02
13
+ - Fix EduButton is always disabled
14
+
15
+ ## 1.15.2 - 2025-08-02
16
+ - Fix EduButton is always disabled
17
+
18
+ ## 1.15.1 - 2025-08-02
19
+ - Fix EduButton is always disabled
20
+
21
+ ## 1.15.0 - 2025-08-02
22
+ - Improve EduButton component by adding aria-label and type attributes, disabled state and styles
23
+
24
+ ## 1.14.0 - 2024-06-21
25
+ - Update docs of publishing packages to npm registry with provenance
26
+
27
+ ## 1.13.0 - 2024-06-20
28
+ - Fix provenance when publishing packages to npm registry
29
+
30
+ ## 1.12.0 - 2024-06-20
31
+ - Update dependencies
32
+
33
+ ## 1.11.0 - 2024-06-19
34
+ - Add provenance to packages in npm registry
35
+
36
+ ## 1.10.0 - 2024-06-17
37
+ - Add keywords to the repository
38
+
39
+ ## 1.9.0 - 2024-06-16
40
+ - Update dependencies
41
+
42
+ ## 1.8.0 - 2024-06-15
43
+ - Setup [npm-check-updates](https://www.npmjs.com/package/npm-check-updates) to manage updates of dependencies of package.json
44
+
45
+ ## 1.7.0 - 2024-06-02
46
+ - Setup GitHub Actions to publish packages in npm registry
47
+
48
+ ## 1.6.0 - 2024-06-01
49
+ - Setup GitHub Actions to tag and release after merge into main
50
+
51
+ ## 1.5.0 - 2024-05-30
52
+ - Add docs to enable the deployment of GitHub Actions artifacts into GitHub Pages
53
+
54
+ ## 1.4.0 - 2024-05-30
55
+ - Setup GitHub Actions to publish Storybook built artifacts in GitHub Pages
56
+
57
+ ## 1.3.0 - 2024-05-28
58
+ - Setup Storybook
59
+
60
+ ## 1.2.0 - 2024-05-27
61
+ - Setup the repository to be a library of web components
62
+
63
+ ## 1.1.0 - 2024-05-26
64
+ - Setup Husky
65
+
66
+ ## 1.0.0 - 2024-05-25
61
67
  - (Initial commit) run npm init @open-wc and select these options: Scaffold a new project, scaffold a Web Component, add Linting (eslint & prettier) and Testing (web-test-runner), do not use typescript, use edu-webcomponents as tag name
package/README.md CHANGED
@@ -1,62 +1,62 @@
1
- # Edu web components library
2
-
3
- This web components library follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm i edu-webcomponents
9
- ```
10
-
11
- ## Usage
12
-
13
- ```html
14
- <script type="module">
15
- import 'edu-webcomponents/index.js';
16
- </script>
17
-
18
- <webcomponent-tagname></webcomponent-tagname>
19
- ```
20
-
21
- ## Linting and formatting
22
-
23
- To scan the project for linting and formatting errors, run
24
-
25
- ```bash
26
- npm run lint
27
- ```
28
-
29
- To automatically fix linting and formatting errors, run
30
-
31
- ```bash
32
- npm run format
33
- ```
34
-
35
- ## Testing with Web Test Runner
36
-
37
- To execute a single test run:
38
-
39
- ```bash
40
- npm run test
41
- ```
42
-
43
- To run the tests in interactive watch mode run:
44
-
45
- ```bash
46
- npm run test:watch
47
- ```
48
-
49
-
50
- ## Tooling configs
51
-
52
- For most of the tools, the configuration is in the `package.json` to minimize the amount of files in your project.
53
-
54
- If you customize the configuration a lot, you can consider moving them to individual files.
55
-
56
- ## Local Demo with `web-dev-server`
57
-
58
- ```bash
59
- npm start
60
- ```
61
-
62
- To run a local development server that serves the basic demo located in `demo/index.html`
1
+ # Edu web components library
2
+
3
+ This web components library follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm i edu-webcomponents
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```html
14
+ <script type="module">
15
+ import 'edu-webcomponents/index.js';
16
+ </script>
17
+
18
+ <webcomponent-tagname></webcomponent-tagname>
19
+ ```
20
+
21
+ ## Linting and formatting
22
+
23
+ To scan the project for linting and formatting errors, run
24
+
25
+ ```bash
26
+ npm run lint
27
+ ```
28
+
29
+ To automatically fix linting and formatting errors, run
30
+
31
+ ```bash
32
+ npm run format
33
+ ```
34
+
35
+ ## Testing with Web Test Runner
36
+
37
+ To execute a single test run:
38
+
39
+ ```bash
40
+ npm run test
41
+ ```
42
+
43
+ To run the tests in interactive watch mode run:
44
+
45
+ ```bash
46
+ npm run test:watch
47
+ ```
48
+
49
+
50
+ ## Tooling configs
51
+
52
+ For most of the tools, the configuration is in the `package.json` to minimize the amount of files in your project.
53
+
54
+ If you customize the configuration a lot, you can consider moving them to individual files.
55
+
56
+ ## Local Demo with `web-dev-server`
57
+
58
+ ```bash
59
+ npm start
60
+ ```
61
+
62
+ To run a local development server that serves the basic demo located in `demo/index.html`
package/demo/index.html CHANGED
@@ -1,29 +1,29 @@
1
- <!doctype html>
2
- <html lang="en-GB">
3
- <head>
4
- <meta charset="utf-8">
5
- <style>
6
- body {
7
- background: #fafafa;
8
- }
9
- </style>
10
- </head>
11
- <body>
12
- <div id="demo"></div>
13
-
14
- <script type="module">
15
- import { html, render } from 'lit';
16
- import '../index.js';
17
-
18
- const textButton = 'This is a button';
19
- render(
20
- html`
21
- <h1>Edu web components library</h1>
22
- <edu-button .text=${textButton}>
23
- </edu-button>
24
- `,
25
- document.querySelector('#demo')
26
- );
27
- </script>
28
- </body>
29
- </html>
1
+ <!doctype html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <style>
6
+ body {
7
+ background: #fafafa;
8
+ }
9
+ </style>
10
+ </head>
11
+ <body>
12
+ <div id="demo"></div>
13
+
14
+ <script type="module">
15
+ import { html, render } from 'lit';
16
+ import '../index.js';
17
+
18
+ const textButton = 'This is a button';
19
+ render(
20
+ html`
21
+ <h1>Edu web components library</h1>
22
+ <edu-button .text=${textButton}>
23
+ </edu-button>
24
+ `,
25
+ document.querySelector('#demo')
26
+ );
27
+ </script>
28
+ </body>
29
+ </html>
@@ -1,4 +1,4 @@
1
- # Deploy Storybook build to GitHub Pages by using GitHub Actions
2
- - Select "GitHub Actions" option as source below "Build and deployment" in your repository's Settings (see Pages in menu)
3
- - Use this workflow: https://storybook.js.org/docs/sharing/publish-storybook#github-pages
4
- - After that, deployment should work when running the ad hoc job
1
+ # Deploy Storybook build to GitHub Pages by using GitHub Actions
2
+ - Select "GitHub Actions" option as source below "Build and deployment" in your repository's Settings (see Pages in menu)
3
+ - Use this workflow: https://storybook.js.org/docs/sharing/publish-storybook#github-pages
4
+ - After that, deployment should work when running the ad hoc job
@@ -1,12 +1,12 @@
1
- # Husky docs
2
-
3
- ## Setup
4
-
5
- ### Required
6
- - Node.js package: https://www.npmjs.com/package/husky
7
- - Version: 9.0.11
8
-
9
- ### How to
10
- - Documentation followed: https://github.com/typicode/husky/blob/main/docs/get-started.md
11
- - Run this command to setup: npx husky init
12
- - Delete content in .husky/pre-commit and write: npm run format
1
+ # Husky docs
2
+
3
+ ## Setup
4
+
5
+ ### Required
6
+ - Node.js package: https://www.npmjs.com/package/husky
7
+ - Version: 9.0.11
8
+
9
+ ### How to
10
+ - Documentation followed: https://github.com/typicode/husky/blob/main/docs/get-started.md
11
+ - Run this command to setup: npx husky init
12
+ - Delete content in .husky/pre-commit and write: npm run format
@@ -1,11 +1,11 @@
1
- # npm-check-updates
2
- npm-check-updates is to manage updates of dependencies of package.json.
3
-
4
- Follow docs in npm registry to install and use: [npm-check-updates](https://www.npmjs.com/package/npm-check-updates).
5
-
6
- Useful commands:
7
- - check: ncu
8
- - check and upgrade: ncu -u
9
-
10
- Config file .ncurc.js:
1
+ # npm-check-updates
2
+ npm-check-updates is to manage updates of dependencies of package.json.
3
+
4
+ Follow docs in npm registry to install and use: [npm-check-updates](https://www.npmjs.com/package/npm-check-updates).
5
+
6
+ Useful commands:
7
+ - check: ncu
8
+ - check and upgrade: ncu -u
9
+
10
+ Config file .ncurc.js:
11
11
  - Hook into npm-check-updates commands to manage, e.g. filtering.
@@ -1,46 +1,46 @@
1
- # Publish packages to npm registry by using GitHub Actions
2
- - Have an account in npm.com and create a PAT with write permissions
3
- - Add PAT created to GitHub secrets
4
- - Use workflow from [here](https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry)
5
-
6
- ## Provenance
7
-
8
- ### What is is?
9
-
10
- You can generate provenance statements for the packages you publish. This allows you to publicly establish where a package was built and who published a package, which can increase supply-chain security for your packages.
11
-
12
- More info: [https://docs.npmjs.com/generating-provenance-statements](https://docs.npmjs.com/generating-provenance-statements).
13
-
14
- ### How to
15
- Add permissions and provenance flag to the workflow job that publishes packages to npm registry, as you can see here:
16
- ```
17
- name: Publish Package to npmjs
18
- on:
19
- release:
20
- types: [published]
21
- jobs:
22
- build:
23
- runs-on: ubuntu-latest
24
- permissions:
25
- contents: read
26
- id-token: write
27
- steps:
28
- - uses: actions/checkout@v4
29
- - uses: actions/setup-node@v4
30
- with:
31
- node-version: '20.x'
32
- registry-url: 'https://registry.npmjs.org'
33
- - run: npm install -g npm
34
- - run: npm ci
35
- - run: npm publish --provenance --access public
36
- env:
37
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
38
- ```
39
-
40
- Add repository object with type and url properties to the package.json, as you can see here:
41
- ```
42
- "repository": {
43
- "type": "git",
44
- "url": "https://github.com/eduardocruzpalacios/edu-webcomponents"
45
- },
46
- ```
1
+ # Publish packages to npm registry by using GitHub Actions
2
+ - Have an account in npm.com and create a PAT with write permissions
3
+ - Add PAT created to GitHub secrets
4
+ - Use workflow from [here](https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry)
5
+
6
+ ## Provenance
7
+
8
+ ### What is is?
9
+
10
+ You can generate provenance statements for the packages you publish. This allows you to publicly establish where a package was built and who published a package, which can increase supply-chain security for your packages.
11
+
12
+ More info: [https://docs.npmjs.com/generating-provenance-statements](https://docs.npmjs.com/generating-provenance-statements).
13
+
14
+ ### How to
15
+ Add permissions and provenance flag to the workflow job that publishes packages to npm registry, as you can see here:
16
+ ```
17
+ name: Publish Package to npmjs
18
+ on:
19
+ release:
20
+ types: [published]
21
+ jobs:
22
+ build:
23
+ runs-on: ubuntu-latest
24
+ permissions:
25
+ contents: read
26
+ id-token: write
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - uses: actions/setup-node@v4
30
+ with:
31
+ node-version: '20.x'
32
+ registry-url: 'https://registry.npmjs.org'
33
+ - run: npm install -g npm
34
+ - run: npm ci
35
+ - run: npm publish --provenance --access public
36
+ env:
37
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
38
+ ```
39
+
40
+ Add repository object with type and url properties to the package.json, as you can see here:
41
+ ```
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "https://github.com/eduardocruzpalacios/edu-webcomponents"
45
+ },
46
+ ```
@@ -1,4 +1,4 @@
1
- # Release and tag to GitHub by using GitHub Actions
2
- Use workflow from [here](https://github.com/marketplace/actions/release-on-merge-action) and:
3
- - Add corresponding inputs
4
- - Create the needed token and add it to GitHub secrets
1
+ # Release and tag to GitHub by using GitHub Actions
2
+ Use workflow from [here](https://github.com/marketplace/actions/release-on-merge-action) and:
3
+ - Add corresponding inputs
4
+ - Create the needed token and add it to GitHub secrets
package/index.js CHANGED
@@ -1 +1 @@
1
- export { EduButton } from './src/EduButton.js';
1
+ export { EduButton } from './src/EduButton.js';
package/package.json CHANGED
@@ -1,73 +1,73 @@
1
- {
2
- "name": "edu-webcomponents",
3
- "description": "Webcomponent edu-webcomponents following open-wc recommendations",
4
- "keywords": [
5
- "web components library",
6
- "web components catalog",
7
- "webcomponents library",
8
- "webcomponents catalog",
9
- "web components",
10
- "webcomponents"
11
- ],
12
- "license": "MIT",
13
- "author": "edu-webcomponents",
14
- "version": "1.15.4",
15
- "repository": {
16
- "type": "git",
17
- "url": "https://github.com/eduardocruzpalacios/edu-webcomponents"
18
- },
19
- "type": "module",
20
- "main": "index.js",
21
- "module": "index.js",
22
- "exports": {
23
- ".": "./index.js"
24
- },
25
- "scripts": {
26
- "analyze": "cem analyze --litelement",
27
- "start": "web-dev-server",
28
- "lint": "eslint --ext .js,.html . --ignore-path .gitignore && prettier \"**/*.js\" --check --ignore-path .gitignore",
29
- "format": "eslint --ext .js,.html . --fix --ignore-path .gitignore && prettier \"**/*.js\" --write --ignore-path .gitignore",
30
- "test": "web-test-runner --coverage",
31
- "test:watch": "web-test-runner --watch",
32
- "prepare": "husky",
33
- "storybook": "storybook dev -p 6006",
34
- "build-storybook": "storybook build"
35
- },
36
- "dependencies": {
37
- "lit": "^2.8.0"
38
- },
39
- "devDependencies": {
40
- "@chromatic-com/storybook": "^1.5.0",
41
- "@custom-elements-manifest/analyzer": "^0.10.2",
42
- "@open-wc/eslint-config": "^9.2.2",
43
- "@open-wc/testing": "^3.2.2",
44
- "@storybook/addon-essentials": "^8.1.10",
45
- "@storybook/addon-links": "^8.1.10",
46
- "@storybook/addon-webpack5-compiler-swc": "^1.0.4",
47
- "@storybook/blocks": "^8.1.10",
48
- "@storybook/test": "^8.1.10",
49
- "@storybook/web-components": "^8.1.10",
50
- "@storybook/web-components-webpack5": "^8.1.10",
51
- "@web/dev-server": "^0.4.5",
52
- "@web/test-runner": "^0.18.2",
53
- "eslint": "^8.57.0",
54
- "eslint-config-prettier": "^8.10.0",
55
- "eslint-plugin-storybook": "^0.8.0",
56
- "husky": "^9.0.11",
57
- "lint-staged": "^10.5.4",
58
- "prettier": "^2.8.8",
59
- "storybook": "^8.1.10"
60
- },
61
- "customElements": "custom-elements.json",
62
- "eslintConfig": {
63
- "extends": [
64
- "@open-wc",
65
- "prettier",
66
- "plugin:storybook/recommended"
67
- ]
68
- },
69
- "prettier": {
70
- "singleQuote": true,
71
- "arrowParens": "avoid"
72
- }
1
+ {
2
+ "name": "edu-webcomponents",
3
+ "description": "Webcomponent edu-webcomponents following open-wc recommendations",
4
+ "keywords": [
5
+ "web components library",
6
+ "web components catalog",
7
+ "webcomponents library",
8
+ "webcomponents catalog",
9
+ "web components",
10
+ "webcomponents"
11
+ ],
12
+ "license": "MIT",
13
+ "author": "edu-webcomponents",
14
+ "version": "1.17.0",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/eduardocruzpalacios/edu-webcomponents"
18
+ },
19
+ "type": "module",
20
+ "main": "index.js",
21
+ "module": "index.js",
22
+ "exports": {
23
+ ".": "./index.js"
24
+ },
25
+ "scripts": {
26
+ "analyze": "cem analyze --litelement",
27
+ "start": "web-dev-server",
28
+ "lint": "eslint --ext .js,.html . --ignore-path .gitignore && prettier \"**/*.js\" --check --ignore-path .gitignore",
29
+ "format": "eslint --ext .js,.html . --fix --ignore-path .gitignore && prettier \"**/*.js\" --write --ignore-path .gitignore",
30
+ "test": "web-test-runner --coverage",
31
+ "test:watch": "web-test-runner --watch",
32
+ "prepare": "husky",
33
+ "storybook": "storybook dev -p 6006",
34
+ "build-storybook": "storybook build"
35
+ },
36
+ "dependencies": {
37
+ "lit": "^2.8.0"
38
+ },
39
+ "devDependencies": {
40
+ "@chromatic-com/storybook": "^1.5.0",
41
+ "@custom-elements-manifest/analyzer": "^0.10.2",
42
+ "@open-wc/eslint-config": "^9.2.2",
43
+ "@open-wc/testing": "^3.2.2",
44
+ "@storybook/addon-essentials": "^8.1.10",
45
+ "@storybook/addon-links": "^8.1.10",
46
+ "@storybook/addon-webpack5-compiler-swc": "^1.0.4",
47
+ "@storybook/blocks": "^8.1.10",
48
+ "@storybook/test": "^8.1.10",
49
+ "@storybook/web-components": "^8.1.10",
50
+ "@storybook/web-components-webpack5": "^8.1.10",
51
+ "@web/dev-server": "^0.4.5",
52
+ "@web/test-runner": "^0.18.2",
53
+ "eslint": "^8.57.0",
54
+ "eslint-config-prettier": "^8.10.0",
55
+ "eslint-plugin-storybook": "^0.8.0",
56
+ "husky": "^9.0.11",
57
+ "lint-staged": "^10.5.4",
58
+ "prettier": "^2.8.8",
59
+ "storybook": "^8.1.10"
60
+ },
61
+ "customElements": "custom-elements.json",
62
+ "eslintConfig": {
63
+ "extends": [
64
+ "@open-wc",
65
+ "prettier",
66
+ "plugin:storybook/recommended"
67
+ ]
68
+ },
69
+ "prettier": {
70
+ "singleQuote": true,
71
+ "arrowParens": "avoid"
72
+ }
73
73
  }
package/src/EduButton.js CHANGED
@@ -1,57 +1,57 @@
1
- import { html, css, LitElement } from 'lit';
2
-
3
- export class EduButton extends LitElement {
4
- static styles = css`
5
- :host {
6
- display: block;
7
- }
8
-
9
- button {
10
- padding: 0.5rem 1rem;
11
- font-size: 1rem;
12
- border: none;
13
- border-radius: 4px;
14
- background-color: #007acc;
15
- color: white;
16
- cursor: pointer;
17
- transition: background-color 0.2s ease-in-out;
18
- }
19
-
20
- button:hover:not(:disabled) {
21
- background-color: #005fa3;
22
- }
23
-
24
- button:disabled {
25
- background-color: #ccc;
26
- cursor: not-allowed;
27
- }
28
- `;
29
-
30
- static properties = {
31
- text: { type: String },
32
- type: { type: String },
33
- ariaLabel: { type: String, attribute: 'aria-label' },
34
- disabled: { type: Boolean, reflect: true },
35
- };
36
-
37
- constructor() {
38
- super();
39
- this.text = 'Default text';
40
- this.type = 'button';
41
- this.ariaLabel = this.text;
42
- }
43
-
44
- render() {
45
- return html`
46
- <button
47
- type=${this.type}
48
- aria-label=${this.ariaLabel}
49
- ?disabled=${this.disabled}
50
- >
51
- ${this.text}
52
- </button>
53
- `;
54
- }
55
- }
56
-
57
- window.customElements.define('edu-button', EduButton);
1
+ import { html, css, LitElement } from 'lit';
2
+
3
+ export class EduButton extends LitElement {
4
+ static styles = css`
5
+ :host {
6
+ display: block;
7
+ }
8
+
9
+ button {
10
+ padding: 0.5rem 1rem;
11
+ font-size: 1rem;
12
+ border: none;
13
+ border-radius: 4px;
14
+ background-color: #007acc;
15
+ color: white;
16
+ cursor: pointer;
17
+ transition: background-color 0.2s ease-in-out;
18
+ }
19
+
20
+ button:hover:not(:disabled) {
21
+ background-color: #005fa3;
22
+ }
23
+
24
+ button:disabled {
25
+ background-color: #ccc;
26
+ cursor: not-allowed;
27
+ }
28
+ `;
29
+
30
+ static properties = {
31
+ text: { type: String },
32
+ type: { type: String },
33
+ ariaLabel: { type: String, attribute: 'aria-label' },
34
+ disabled: { type: Boolean, reflect: true },
35
+ };
36
+
37
+ constructor() {
38
+ super();
39
+ this.text = 'Default text';
40
+ this.type = 'button';
41
+ this.ariaLabel = this.text;
42
+ }
43
+
44
+ render() {
45
+ return html`
46
+ <button
47
+ type=${this.type}
48
+ aria-label=${this.ariaLabel}
49
+ ?disabled=${this.disabled}
50
+ >
51
+ ${this.text}
52
+ </button>
53
+ `;
54
+ }
55
+ }
56
+
57
+ window.customElements.define('edu-button', EduButton);