@m3e/checkbox 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 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
- ## 🚀 Browser Usage
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
 
@@ -253,20 +253,6 @@
253
253
  "module": "../core/src/shared/mixins/FormAssociated.ts"
254
254
  }
255
255
  },
256
- {
257
- "kind": "method",
258
- "name": "[_updateLabels]",
259
- "privacy": "private",
260
- "return": {
261
- "type": {
262
- "text": "void"
263
- }
264
- },
265
- "inheritedFrom": {
266
- "name": "Labelled",
267
- "module": "../core/src/shared/mixins/Labelled.ts"
268
- }
269
- },
270
256
  {
271
257
  "kind": "field",
272
258
  "name": "dirty",
@@ -1790,25 +1776,6 @@
1790
1776
  "kind": "mixin",
1791
1777
  "description": "Mixin that adds support for custom event attributes.",
1792
1778
  "name": "EventAttribute",
1793
- "members": [
1794
- {
1795
- "kind": "method",
1796
- "name": "dispatchEvent",
1797
- "return": {
1798
- "type": {
1799
- "text": "boolean"
1800
- }
1801
- },
1802
- "parameters": [
1803
- {
1804
- "name": "event",
1805
- "type": {
1806
- "text": "Event"
1807
- }
1808
- }
1809
- ]
1810
- }
1811
- ],
1812
1779
  "parameters": [
1813
1780
  {
1814
1781
  "name": "base",
@@ -2106,6 +2073,17 @@
2106
2073
  "description": "Mixin to augment an element with behavior used to submit a form.",
2107
2074
  "name": "FormSubmitter",
2108
2075
  "members": [
2076
+ {
2077
+ "kind": "field",
2078
+ "name": "formAssociated",
2079
+ "type": {
2080
+ "text": "boolean"
2081
+ },
2082
+ "static": true,
2083
+ "readonly": true,
2084
+ "default": "true",
2085
+ "description": "Indicates that this custom element participates in form submission, validation, and form state restoration."
2086
+ },
2109
2087
  {
2110
2088
  "kind": "field",
2111
2089
  "name": "name",
@@ -2642,6 +2620,11 @@
2642
2620
  "kind": "javascript-module",
2643
2621
  "path": "../core/src/shared/mixins/Labelled.ts",
2644
2622
  "declarations": [
2623
+ {
2624
+ "kind": "variable",
2625
+ "name": "updateLabels",
2626
+ "description": "A symbol through which to update labels to reflect a control's current state."
2627
+ },
2645
2628
  {
2646
2629
  "kind": "function",
2647
2630
  "name": "isLabelledMixin",
@@ -2691,16 +2674,6 @@
2691
2674
  },
2692
2675
  "description": "The label elements that the element is associated with.",
2693
2676
  "readonly": true
2694
- },
2695
- {
2696
- "kind": "method",
2697
- "name": "[_updateLabels]",
2698
- "privacy": "private",
2699
- "return": {
2700
- "type": {
2701
- "text": "void"
2702
- }
2703
- }
2704
2677
  }
2705
2678
  ],
2706
2679
  "parameters": [
@@ -2715,6 +2688,14 @@
2715
2688
  }
2716
2689
  ],
2717
2690
  "exports": [
2691
+ {
2692
+ "kind": "js",
2693
+ "name": "updateLabels",
2694
+ "declaration": {
2695
+ "name": "updateLabels",
2696
+ "module": "../core/src/shared/mixins/Labelled.ts"
2697
+ }
2698
+ },
2718
2699
  {
2719
2700
  "kind": "js",
2720
2701
  "name": "isLabelledMixin",
@@ -0,0 +1,100 @@
1
+ import { CSSResultGroup, LitElement, PropertyValues } from "lit";
2
+ import { formValue } from "@m3e/core";
3
+ declare const M3eCheckboxElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").LabelledMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").RequiredConstraintValidationMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").DirtyMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").TouchedMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").RequiredMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").ConstraintValidationMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").CheckedIndeterminateMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").FormAssociatedMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").DisabledMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").AttachInternalsMixin> & typeof LitElement;
4
+ /**
5
+ * A checkbox that allows a user to select one or more options from a limited number of choices.
6
+ *
7
+ * @description
8
+ * The `m3e-checkbox` component enables users to select one or more options from a set. It supports selected,
9
+ * unselected, and indeterminate states, and communicates selection through visual cues and accessible semantics.
10
+ * This component reflects user intent, form participation, and validation feedback, adapting to disabled and
11
+ * required contexts. It emits `input` and `change` events to signal state transitions and integrates with form
12
+ * submission via `name` and `value`.
13
+ *
14
+ * @example
15
+ * The following example illustrates wrapping a `m3e-checkbox` within a `label`.
16
+ * ```html
17
+ * <label>
18
+ * <m3e-checkbox></m3e-checkbox>
19
+ * Checkbox label
20
+ * </label>
21
+ * ```
22
+ * @example
23
+ * The next example illustrates use of the `for` attribute to label a checkbox.
24
+ * ```html
25
+ * <m3e-checkbox id="chk"></m3e-checkbox>
26
+ * <label for="chk">Checkbox label </label>
27
+ * ```
28
+ *
29
+ * @tag m3e-checkbox
30
+ *
31
+ * @attr checked - Whether the element is checked.
32
+ * @attr disabled - Whether the element is disabled.
33
+ * @attr indeterminate - Whether the element's checked state is indeterminate.
34
+ * @attr name - The name that identifies the element when submitting the associated form.
35
+ * @attr required - Whether the element is required.
36
+ * @attr value - A string representing the value of the checkbox.
37
+ *
38
+ * @fires input - Emitted when the checked state changes.
39
+ * @fires invalid - Emitted when a form is submitted and the element fails constraint validation.
40
+ * @fires change - Emitted when the checked state changes.
41
+ * @fires click - Emitted when the element is clicked.
42
+ *
43
+ * @cssprop --m3e-checkbox-icon-size - Size of the checkbox icon inside the container.
44
+ * @cssprop --m3e-checkbox-container-size - Base size of the checkbox container.
45
+ * @cssprop --m3e-checkbox-container-shape - Border radius of the icon container.
46
+ * @cssprop --m3e-checkbox-unselected-outline-thickness - Border thickness for unselected state.
47
+ * @cssprop --m3e-checkbox-unselected-outline-color - Border color for unselected state.
48
+ * @cssprop --m3e-checkbox-unselected-hover-outline-color - Border color on hover when unselected.
49
+ * @cssprop --m3e-checkbox-unselected-disabled-outline-color - Base color for disabled unselected outline.
50
+ * @cssprop --m3e-checkbox-unselected-disabled-outline-opacity - Opacity for disabled unselected outline.
51
+ * @cssprop --m3e-checkbox-unselected-error-outline-color - Border color for invalid unselected state.
52
+ * @cssprop --m3e-checkbox-selected-container-color - Background color for selected container.
53
+ * @cssprop --m3e-checkbox-selected-icon-color - Icon color for selected state.
54
+ * @cssprop --m3e-checkbox-selected-disabled-container-color - Base color for disabled selected container.
55
+ * @cssprop --m3e-checkbox-selected-disabled-container-opacity - Opacity for disabled selected container.
56
+ * @cssprop --m3e-checkbox-selected-disabled-icon-color - Base color for disabled selected icon.
57
+ * @cssprop --m3e-checkbox-selected-disabled-icon-opacity - Opacity for disabled selected icon.
58
+ * @cssprop --m3e-checkbox-unselected-hover-color - Ripple hover color for unselected state.
59
+ * @cssprop --m3e-checkbox-unselected-focus-color - Ripple focus color for unselected state.
60
+ * @cssprop --m3e-checkbox-unselected-ripple-color - Ripple base color for unselected state.
61
+ * @cssprop --m3e-checkbox-selected-hover-color - Ripple hover color for selected state.
62
+ * @cssprop --m3e-checkbox-selected-focus-color - Ripple focus color for selected state.
63
+ * @cssprop --m3e-checkbox-selected-ripple-color - Ripple base color for selected state.
64
+ * @cssprop --m3e-checkbox-unselected-error-hover-color - Ripple hover color for invalid unselected state.
65
+ * @cssprop --m3e-checkbox-unselected-error-focus-color - Ripple focus color for invalid unselected state.
66
+ * @cssprop --m3e-checkbox-unselected-error-ripple-color - Ripple base color for invalid unselected state.
67
+ * @cssprop --m3e-checkbox-selected-error-hover-color - Ripple hover color for invalid selected state.
68
+ * @cssprop --m3e-checkbox-selected-error-focus-color - Ripple focus color for invalid selected state.
69
+ * @cssprop --m3e-checkbox-selected-error-ripple-color - Ripple base color for invalid selected state.
70
+ */
71
+ export declare class M3eCheckboxElement extends M3eCheckboxElement_base {
72
+ #private;
73
+ /** The styles of the element. */
74
+ static styles: CSSResultGroup;
75
+ /** @private */ private readonly _focusRing?;
76
+ /** @private */ private readonly _stateLayer?;
77
+ /** @private */ private readonly _ripple?;
78
+ /**
79
+ * A string representing the value of the checkbox.
80
+ * @default "on"
81
+ */
82
+ value: string;
83
+ /** @inheritdoc @private */
84
+ get [formValue](): string | File | FormData | null;
85
+ /** @inheritdoc */
86
+ connectedCallback(): void;
87
+ /** @inheritdoc */
88
+ disconnectedCallback(): void;
89
+ /** @inheritdoc */
90
+ protected firstUpdated(_changedProperties: PropertyValues<this>): void;
91
+ /** @inheritdoc */
92
+ protected render(): unknown;
93
+ }
94
+ declare global {
95
+ interface HTMLElementTagNameMap {
96
+ "m3e-checkbox": M3eCheckboxElement;
97
+ }
98
+ }
99
+ export {};
100
+ //# sourceMappingURL=CheckboxElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckboxElement.d.ts","sourceRoot":"","sources":["../../src/CheckboxElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAW,cAAc,EAAE,MAAM,KAAK,CAAC;AAGrF,OAAO,EAQL,SAAS,EAaV,MAAM,WAAW,CAAC;;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,qBACa,kBAAmB,SAAQ,uBAcvC;;IACC,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAwIpC;IAEF,eAAe,CAAuB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAsB;IACxF,eAAe,CAAwB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAuB;IAC3F,eAAe,CAAmB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAmB;IA4B9E;;;OAGG;IACS,KAAK,SAAQ;IAEzB,2BAA2B;IAC3B,IAAa,CAAC,SAAS,CAAC,IAAI,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,CAE1D;IAED,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IAUlC,kBAAkB;IACT,oBAAoB,IAAI,IAAI;IAUrC,kBAAkB;cACC,YAAY,CAAC,kBAAkB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAK/E,kBAAkB;cACC,MAAM,IAAI,OAAO;CAuCrC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,kBAAkB,CAAC;KACpC;CACF"}
@@ -0,0 +1,2 @@
1
+ export * from "./CheckboxElement";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m3e/checkbox",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0-rc.4",
4
4
  "description": "Checkbox 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.2",
30
+ "@m3e/core": "1.0.0-rc.4",
31
31
  "lit": "^3.3.0"
32
32
  },
33
33
  "devDependencies": {