@m3e/badge 1.0.0-rc.2 → 1.0.0-rc.4
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 +1 -1
- package/dist/custom-elements.json +24 -29
- package/dist/src/BadgeElement.d.ts +74 -0
- package/dist/src/BadgeElement.d.ts.map +1 -0
- package/dist/src/BadgePosition.d.ts +3 -0
- package/dist/src/BadgePosition.d.ts.map +1 -0
- package/dist/src/BadgeSize.d.ts +3 -0
- package/dist/src/BadgeSize.d.ts.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ Alternately, you can explicitly reference the `html-custom-data.json` and `css-c
|
|
|
27
27
|
}
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
## 🚀
|
|
30
|
+
## 🚀 Native Module Support
|
|
31
31
|
|
|
32
32
|
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.
|
|
33
33
|
|
|
@@ -1176,25 +1176,6 @@
|
|
|
1176
1176
|
"kind": "mixin",
|
|
1177
1177
|
"description": "Mixin that adds support for custom event attributes.",
|
|
1178
1178
|
"name": "EventAttribute",
|
|
1179
|
-
"members": [
|
|
1180
|
-
{
|
|
1181
|
-
"kind": "method",
|
|
1182
|
-
"name": "dispatchEvent",
|
|
1183
|
-
"return": {
|
|
1184
|
-
"type": {
|
|
1185
|
-
"text": "boolean"
|
|
1186
|
-
}
|
|
1187
|
-
},
|
|
1188
|
-
"parameters": [
|
|
1189
|
-
{
|
|
1190
|
-
"name": "event",
|
|
1191
|
-
"type": {
|
|
1192
|
-
"text": "Event"
|
|
1193
|
-
}
|
|
1194
|
-
}
|
|
1195
|
-
]
|
|
1196
|
-
}
|
|
1197
|
-
],
|
|
1198
1179
|
"parameters": [
|
|
1199
1180
|
{
|
|
1200
1181
|
"name": "base",
|
|
@@ -1492,6 +1473,17 @@
|
|
|
1492
1473
|
"description": "Mixin to augment an element with behavior used to submit a form.",
|
|
1493
1474
|
"name": "FormSubmitter",
|
|
1494
1475
|
"members": [
|
|
1476
|
+
{
|
|
1477
|
+
"kind": "field",
|
|
1478
|
+
"name": "formAssociated",
|
|
1479
|
+
"type": {
|
|
1480
|
+
"text": "boolean"
|
|
1481
|
+
},
|
|
1482
|
+
"static": true,
|
|
1483
|
+
"readonly": true,
|
|
1484
|
+
"default": "true",
|
|
1485
|
+
"description": "Indicates that this custom element participates in form submission, validation, and form state restoration."
|
|
1486
|
+
},
|
|
1495
1487
|
{
|
|
1496
1488
|
"kind": "field",
|
|
1497
1489
|
"name": "name",
|
|
@@ -2028,6 +2020,11 @@
|
|
|
2028
2020
|
"kind": "javascript-module",
|
|
2029
2021
|
"path": "../core/src/shared/mixins/Labelled.ts",
|
|
2030
2022
|
"declarations": [
|
|
2023
|
+
{
|
|
2024
|
+
"kind": "variable",
|
|
2025
|
+
"name": "updateLabels",
|
|
2026
|
+
"description": "A symbol through which to update labels to reflect a control's current state."
|
|
2027
|
+
},
|
|
2031
2028
|
{
|
|
2032
2029
|
"kind": "function",
|
|
2033
2030
|
"name": "isLabelledMixin",
|
|
@@ -2077,16 +2074,6 @@
|
|
|
2077
2074
|
},
|
|
2078
2075
|
"description": "The label elements that the element is associated with.",
|
|
2079
2076
|
"readonly": true
|
|
2080
|
-
},
|
|
2081
|
-
{
|
|
2082
|
-
"kind": "method",
|
|
2083
|
-
"name": "[_updateLabels]",
|
|
2084
|
-
"privacy": "private",
|
|
2085
|
-
"return": {
|
|
2086
|
-
"type": {
|
|
2087
|
-
"text": "void"
|
|
2088
|
-
}
|
|
2089
|
-
}
|
|
2090
2077
|
}
|
|
2091
2078
|
],
|
|
2092
2079
|
"parameters": [
|
|
@@ -2101,6 +2088,14 @@
|
|
|
2101
2088
|
}
|
|
2102
2089
|
],
|
|
2103
2090
|
"exports": [
|
|
2091
|
+
{
|
|
2092
|
+
"kind": "js",
|
|
2093
|
+
"name": "updateLabels",
|
|
2094
|
+
"declaration": {
|
|
2095
|
+
"name": "updateLabels",
|
|
2096
|
+
"module": "../core/src/shared/mixins/Labelled.ts"
|
|
2097
|
+
}
|
|
2098
|
+
},
|
|
2104
2099
|
{
|
|
2105
2100
|
"kind": "js",
|
|
2106
2101
|
"name": "isLabelledMixin",
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { CSSResultGroup, LitElement, PropertyValues } from "lit";
|
|
2
|
+
import { BadgeSize } from "./BadgeSize";
|
|
3
|
+
import { BadgePosition } from "./BadgePosition";
|
|
4
|
+
declare const M3eBadgeElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").HtmlForMixin> & typeof LitElement;
|
|
5
|
+
/**
|
|
6
|
+
* A visual indicator used to label content.
|
|
7
|
+
*
|
|
8
|
+
* @description
|
|
9
|
+
* The `m3e-badge` component is a compact visual indicator used to label content. Designed
|
|
10
|
+
* according to Material Design 3 guidelines, it can display counts, presence, or semantic
|
|
11
|
+
* emphasis, and is attachable to icons, buttons, or other components. Badges support dynamic
|
|
12
|
+
* sizing, color, and shape, ensuring clarity and accessibility while maintaining a consistent,
|
|
13
|
+
* expressive appearance across surfaces.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* The following example illustrates attaching a `m3e-badge` to another element using the `for` attribute.
|
|
17
|
+
* ```html
|
|
18
|
+
* <m3e-button id="button">Button</m3e-button>
|
|
19
|
+
* <m3e-badge for="button">10</m3e-badge>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @tag m3e-badge
|
|
23
|
+
*
|
|
24
|
+
* @slot - Renders the content of the badge.
|
|
25
|
+
*
|
|
26
|
+
* @attr size - The size of the badge.
|
|
27
|
+
*
|
|
28
|
+
* @cssprop --m3e-badge-shape - Corner radius of the badge.
|
|
29
|
+
* @cssprop --m3e-badge-color - Foreground color of badge content.
|
|
30
|
+
* @cssprop --m3e-badge-container-color - Background color of the badge.
|
|
31
|
+
* @cssprop --m3e-badge-small-size - Fixed dimensions for small badge. Used for minimal indicators (e.g. dot).
|
|
32
|
+
* @cssprop --m3e-badge-medium-size - Height and min-width for medium badge.
|
|
33
|
+
* @cssprop --m3e-badge-medium-font-size - Font size for medium badge label.
|
|
34
|
+
* @cssprop --m3e-badge-medium-font-weight - Font weight for medium badge label.
|
|
35
|
+
* @cssprop --m3e-badge-medium-line-height - Line height for medium badge label.
|
|
36
|
+
* @cssprop --m3e-badge-medium-tracking - Letter spacing for medium badge label.
|
|
37
|
+
* @cssprop --m3e-badge-large-size - Height and min-width for large badge.
|
|
38
|
+
* @cssprop --m3e-badge-large-font-size - Font size for large badge label.
|
|
39
|
+
* @cssprop --m3e-badge-large-font-weight - Font weight for large badge label.
|
|
40
|
+
* @cssprop --m3e-badge-large-line-height - Line height for large badge label.
|
|
41
|
+
* @cssprop --m3e-badge-large-tracking - Letter spacing for large badge label.
|
|
42
|
+
*/
|
|
43
|
+
export declare class M3eBadgeElement extends M3eBadgeElement_base {
|
|
44
|
+
#private;
|
|
45
|
+
/** The styles of the element. */
|
|
46
|
+
static styles: CSSResultGroup;
|
|
47
|
+
/**
|
|
48
|
+
* The size of the badge.
|
|
49
|
+
* @default "medium"
|
|
50
|
+
*/
|
|
51
|
+
size: BadgeSize;
|
|
52
|
+
/**
|
|
53
|
+
* The position of the badge, when attached to another element.
|
|
54
|
+
* @default "above-after"
|
|
55
|
+
*/
|
|
56
|
+
position: BadgePosition;
|
|
57
|
+
/** @inheritdoc */
|
|
58
|
+
detach(): void;
|
|
59
|
+
/** @inheritdoc */
|
|
60
|
+
connectedCallback(): void;
|
|
61
|
+
/** @inheritdoc */
|
|
62
|
+
disconnectedCallback(): void;
|
|
63
|
+
/** @inheritdoc */
|
|
64
|
+
protected update(changedProperties: PropertyValues<this>): void;
|
|
65
|
+
/** @inheritdoc */
|
|
66
|
+
protected render(): unknown;
|
|
67
|
+
}
|
|
68
|
+
declare global {
|
|
69
|
+
interface HTMLElementTagNameMap {
|
|
70
|
+
"m3e-badge": M3eBadgeElement;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=BadgeElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadgeElement.d.ts","sourceRoot":"","sources":["../../src/BadgeElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAO5E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBACa,eAAgB,SAAQ,oBAAmB;;IACtD,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAqEpC;IAKF;;;OAGG;IAC0B,IAAI,EAAE,SAAS,CAAY;IAExD;;;OAGG;IAC0B,QAAQ,EAAE,aAAa,CAAiB;IAErE,kBAAkB;IACT,MAAM,IAAI,IAAI;IAKvB,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IAKlC,kBAAkB;IACT,oBAAoB,IAAI,IAAI;IAKrC,kBAAkB;cACC,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAQxE,kBAAkB;cACC,MAAM,IAAI,OAAO;CA0ErC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,eAAe,CAAC;KAC9B;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadgePosition.d.ts","sourceRoot":"","sources":["../../src/BadgePosition.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,MAAM,aAAa,GACrB,aAAa,GACb,cAAc,GACd,cAAc,GACd,aAAa,GACb,QAAQ,GACR,OAAO,GACP,OAAO,GACP,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadgeSize.d.ts","sourceRoot":"","sources":["../../src/BadgeSize.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m3e/badge",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.4",
|
|
4
4
|
"description": "Badge for M3E",
|
|
5
5
|
"author": "matraic <matraic@yahoo.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"clean": "rimraf dist"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@m3e/core": "1.0.0-rc.
|
|
30
|
+
"@m3e/core": "1.0.0-rc.4",
|
|
31
31
|
"lit": "^3.3.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|