@m3e/progress-indicator 1.0.0-rc.1

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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 matraic
4
+ Contact: matraic@yahoo.com
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/NOTICE.md ADDED
@@ -0,0 +1,8 @@
1
+ # NOTICE
2
+
3
+ This package includes code adapted from third-party sources under the MIT license:
4
+
5
+ - Angular Material Progress Bar & Spinner
6
+ Source: https://github.com/angular/components
7
+ License: MIT
8
+ Copyright (c) Google LLC
package/README.md ADDED
@@ -0,0 +1,132 @@
1
+ # @m3e/progress-indicator
2
+
3
+ The `m3e-linear-progress-indicator` and `m3e-circular-progress-indicator` components provide accessible, animated progress indicators for tracking the completion of tasks or processes. Both components support multiple modes and are fully customizable via CSS custom properties.
4
+
5
+ > **Part of the [M3E](../../README.md) monorepo**
6
+ > This package is maintained within the unified M3E repository, which provides a suite of Material 3 web components.
7
+
8
+ ## 📦 Installation
9
+
10
+ ```bash
11
+ npm install @m3e/progress-indicator
12
+ ```
13
+
14
+ ## 💻 Editor Integration
15
+
16
+ This package includes a [Custom Elements Manifest](https://github.com/webcomponents/custom-elements-manifest) to support enhanced editor tooling and developer experience.
17
+
18
+ ### Visual Studio Code
19
+
20
+ To enable autocomplete and hover documentation for `@m3e/progress-indicator`, install the [Custom Elements Manifest Language Server](https://marketplace.visualstudio.com/items?itemName=pwrs.cem-language-server-vscode) extension. It will automatically detect the manifest bundled with this package and surface tag names, attributes, slots, and events in supported files.
21
+
22
+ Alternately, you can explicitly reference the `html-custom-data.json` and `css-custom-data.json` in your workspace settings:
23
+
24
+ ```json
25
+ {
26
+ "html.customData": ["./node_modules/@m3e/progress-indicator/dist/html-custom-data.json"],
27
+ "css.customData": ["./node_modules/@m3e/progress-indicator/dist/css-custom-data.json"]
28
+ }
29
+ ```
30
+
31
+ ## 🚀 Browser Usage
32
+
33
+ This package uses [JavaScript Modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#module_specifiers). To use it directly in a browser without a bundler, use a module script similar to the following.
34
+
35
+ ```html
36
+ <script type="module" src="/node_modules/@m3e/progress-indicator/dist/index.js"></script>
37
+ ```
38
+
39
+ In addition, you must use an [import map](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap) to include dependencies.
40
+
41
+ ```html
42
+ <script type="importmap">
43
+ {
44
+ "imports": {
45
+ "lit": "https://cdn.jsdelivr.net/npm/lit@3.3.0/+esm",
46
+ "@m3e/core": "/node_modules/@m3e/core/dist/index.js"
47
+ }
48
+ }
49
+ </script>
50
+ ```
51
+
52
+ > For production, use index.min.js for faster load times.
53
+
54
+ ## 🗂️ Elements
55
+
56
+ - `m3e-linear-progress-indicator` — A horizontal bar for indicating progress and activity.
57
+ - `m3e-circular-progress-indicator` — A circular indicator of progress and activity.
58
+
59
+ ## 🧪 Example
60
+
61
+ The following example illustrates determinate progress indicators.
62
+
63
+ ```html
64
+ <m3e-linear-progress-indicator value="30"></m3e-linear-progress-indicator>
65
+ <m3e-circular-progress-indicator value="30"></m3e-circular-progress-indicator>
66
+ ```
67
+
68
+ The next example illustrates indeterminate progress indicators.
69
+
70
+ ```html
71
+ <m3e-linear-progress-indicator mode="indeterminate"></m3e-linear-progress-indicator>
72
+ <m3e-circular-progress-indicator indeterminate></m3e-circular-progress-indicator>
73
+ ```
74
+
75
+ ## 📖 API Reference
76
+
77
+ ### 🗂️ m3e-linear-progress-indicator
78
+
79
+ This section details the attributes and CSS custom properties available for the `m3e-linear-progress-indicator` component.
80
+
81
+ #### ⚙️ Attributes
82
+
83
+ | Attribute | Type | Default | Description |
84
+ | ------------ | --------------------------------------------------------- | --------------- | -------------------------------------------------------------------- |
85
+ | buffer-value | `number` | `0` | A fractional value, between 0 and `max`, indicating buffer progress. |
86
+ | max | `number` | `100` | The maximum progress value. |
87
+ | mode | `"determinate" \| "indeterminate" \| "buffer" \| "query"` | `"determinate"` | The mode of the progress bar. |
88
+ | value | `number` | `0` | A fractional value, between 0 and `max`, indicating progress. |
89
+
90
+ #### 🎛️ CSS Custom Properties
91
+
92
+ | Property | Description |
93
+ | ------------------------------------------- | ---------------------------------------------------- |
94
+ | `--m3e-linear-progress-indicator-thickness` | Thickness (height) of the progress bar. |
95
+ | `--m3e-linear-progress-indicator-shape` | Border radius of the progress bar. |
96
+ | `--m3e-progress-indicator-track-color` | Track color of the progress bar (background/buffer). |
97
+ | `--m3e-progress-indicator-color` | Color of the progress indicator (foreground). |
98
+
99
+ ### 🗂️ m3e-circular-progress-indicator
100
+
101
+ This section details the attributes, slots, and CSS custom properties available for the `m3e-circular-progress-indicator` component.
102
+
103
+ #### ⚙️ Attributes
104
+
105
+ | Attribute | Type | Default | Description |
106
+ | ------------- | --------- | ------- | ------------------------------------------------------------------ |
107
+ | diameter | `number` | `40` | The diameter, in pixels, of the progress spinner. |
108
+ | indeterminate | `boolean` | `false` | Whether to show something is happening without conveying progress. |
109
+ | max | `number` | `100` | The maximum progress value. |
110
+ | stroke-width | `number` | `10` | The stroke width, in pixels, of the progress spinner. |
111
+ | value | `number` | `0` | A fractional value, between 0 and `max`, indicating progress. |
112
+
113
+ #### 🧩 Slots
114
+
115
+ | Slot | Description |
116
+ | ----------- | -------------------------------------------------- |
117
+ | _(default)_ | Renders the content inside the progress indicator. |
118
+
119
+ #### 🎛️ CSS Custom Properties
120
+
121
+ | Property | Description |
122
+ | -------------------------------------- | ---------------------------------------------------- |
123
+ | `--m3e-progress-indicator-track-color` | Track color of the progress bar (background/buffer). |
124
+ | `--m3e-progress-indicator-color` | Color of the progress indicator (foreground). |
125
+
126
+ ## 🤝 Contributing
127
+
128
+ See the root monorepo `CONTRIBUTING.md` for guidelines on contributing to this package.
129
+
130
+ ## 📄 License
131
+
132
+ This package is licensed under the MIT License.
package/cem.config.mjs ADDED
@@ -0,0 +1,16 @@
1
+ import { customElementVsCodePlugin } from "custom-element-vs-code-integration";
2
+
3
+ export default {
4
+ globs: ["src/**/*.ts"],
5
+ exclude: ["src/**/*.spec.ts"],
6
+ packagejson: true,
7
+ outdir: "dist",
8
+ litelement: true,
9
+ plugins: [
10
+ customElementVsCodePlugin({
11
+ outdir: "dist",
12
+ htmlFileName: "html-custom-data.json",
13
+ cssFileName: "css-custom-data.json",
14
+ }),
15
+ ],
16
+ };
@@ -0,0 +1,53 @@
1
+ <!doctype html>
2
+ <html lang="en" style="overflow-y: auto">
3
+ <head>
4
+ <title>Progress Indicator for M3E</title>
5
+ <meta charset="utf-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ <meta name="description" content="Progress Indicator for M3E" />
8
+ <base href="./" />
9
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
10
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
11
+ <link
12
+ href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap"
13
+ rel="stylesheet"
14
+ />
15
+ <link
16
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0..1,0"
17
+ rel="stylesheet"
18
+ />
19
+ <script type="importmap">
20
+ {
21
+ "imports": {
22
+ "lit": "https://cdn.jsdelivr.net/npm/lit@3.3.0/+esm",
23
+ "@m3e/core": "../../core/dist/index.min.js"
24
+ }
25
+ }
26
+ </script>
27
+ <script type="module" src="../../theme/dist/index.min.js"></script>
28
+ <script type="module" src="../dist/index.min.js"></script>
29
+ <style>
30
+ body {
31
+ font-family: "Roboto";
32
+ }
33
+ *:not(:defined) {
34
+ display: none;
35
+ }
36
+ </style>
37
+ </head>
38
+ <body>
39
+ <m3e-theme strong-focus>
40
+ <m3e-linear-progress-indicator value="20"></m3e-linear-progress-indicator>
41
+ <br />
42
+ <m3e-linear-progress-indicator mode="indeterminate"></m3e-linear-progress-indicator>
43
+ <br />
44
+ <m3e-linear-progress-indicator mode="query"></m3e-linear-progress-indicator>
45
+ <br />
46
+ <m3e-linear-progress-indicator mode="buffer" value="30"></m3e-linear-progress-indicator>
47
+ <br />
48
+ <m3e-circular-progress-indicator value="20"></m3e-circular-progress-indicator>
49
+ <br />
50
+ <m3e-circular-progress-indicator indeterminate></m3e-circular-progress-indicator>
51
+ </m3e-theme>
52
+ </body>
53
+ </html>
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
3
+ "version": 1.1,
4
+ "properties": [
5
+ {
6
+ "name": "--m3e-progress-indicator-track-color",
7
+ "description": "Track color of the progress bar (background/buffer).",
8
+ "values": []
9
+ },
10
+ {
11
+ "name": "--m3e-progress-indicator-color",
12
+ "description": "Color of the progress indicator (foreground).",
13
+ "values": []
14
+ },
15
+ {
16
+ "name": "--m3e-linear-progress-indicator-thickness",
17
+ "description": "Thickness (height) of the progress bar.",
18
+ "values": []
19
+ },
20
+ {
21
+ "name": "--m3e-linear-progress-indicator-shape",
22
+ "description": "Border radius of the progress bar.",
23
+ "values": []
24
+ },
25
+ {
26
+ "name": "--m3e-progress-indicator-track-color",
27
+ "description": "Track color of the progress bar (background/buffer).",
28
+ "values": []
29
+ },
30
+ {
31
+ "name": "--m3e-progress-indicator-color",
32
+ "description": "Color of the progress indicator (foreground).",
33
+ "values": []
34
+ }
35
+ ],
36
+ "pseudoElements": []
37
+ }