@m3e/button-group 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
 
@@ -1128,25 +1128,6 @@
1128
1128
  "kind": "mixin",
1129
1129
  "description": "Mixin that adds support for custom event attributes.",
1130
1130
  "name": "EventAttribute",
1131
- "members": [
1132
- {
1133
- "kind": "method",
1134
- "name": "dispatchEvent",
1135
- "return": {
1136
- "type": {
1137
- "text": "boolean"
1138
- }
1139
- },
1140
- "parameters": [
1141
- {
1142
- "name": "event",
1143
- "type": {
1144
- "text": "Event"
1145
- }
1146
- }
1147
- ]
1148
- }
1149
- ],
1150
1131
  "parameters": [
1151
1132
  {
1152
1133
  "name": "base",
@@ -1444,6 +1425,17 @@
1444
1425
  "description": "Mixin to augment an element with behavior used to submit a form.",
1445
1426
  "name": "FormSubmitter",
1446
1427
  "members": [
1428
+ {
1429
+ "kind": "field",
1430
+ "name": "formAssociated",
1431
+ "type": {
1432
+ "text": "boolean"
1433
+ },
1434
+ "static": true,
1435
+ "readonly": true,
1436
+ "default": "true",
1437
+ "description": "Indicates that this custom element participates in form submission, validation, and form state restoration."
1438
+ },
1447
1439
  {
1448
1440
  "kind": "field",
1449
1441
  "name": "name",
@@ -1980,6 +1972,11 @@
1980
1972
  "kind": "javascript-module",
1981
1973
  "path": "../core/src/shared/mixins/Labelled.ts",
1982
1974
  "declarations": [
1975
+ {
1976
+ "kind": "variable",
1977
+ "name": "updateLabels",
1978
+ "description": "A symbol through which to update labels to reflect a control's current state."
1979
+ },
1983
1980
  {
1984
1981
  "kind": "function",
1985
1982
  "name": "isLabelledMixin",
@@ -2029,16 +2026,6 @@
2029
2026
  },
2030
2027
  "description": "The label elements that the element is associated with.",
2031
2028
  "readonly": true
2032
- },
2033
- {
2034
- "kind": "method",
2035
- "name": "[_updateLabels]",
2036
- "privacy": "private",
2037
- "return": {
2038
- "type": {
2039
- "text": "void"
2040
- }
2041
- }
2042
2029
  }
2043
2030
  ],
2044
2031
  "parameters": [
@@ -2053,6 +2040,14 @@
2053
2040
  }
2054
2041
  ],
2055
2042
  "exports": [
2043
+ {
2044
+ "kind": "js",
2045
+ "name": "updateLabels",
2046
+ "declaration": {
2047
+ "name": "updateLabels",
2048
+ "module": "../core/src/shared/mixins/Labelled.ts"
2049
+ }
2050
+ },
2056
2051
  {
2057
2052
  "kind": "js",
2058
2053
  "name": "isLabelledMixin",
@@ -0,0 +1,98 @@
1
+ import { CSSResultGroup, LitElement, PropertyValues } from "lit";
2
+ import { M3eButtonElement } from "@m3e/button";
3
+ import { M3eIconButtonElement } from "@m3e/icon-button";
4
+ import { ButtonGroupVariant } from "./ButtonGroupVariant";
5
+ import { ButtonGroupSize } from "./ButtonGroupSize";
6
+ declare const M3eButtonGroupElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor & typeof LitElement;
7
+ /**
8
+ * Organizes buttons and adds interactions between them.
9
+ *
10
+ * @description
11
+ * The `m3e-button-group` component arranges multiple buttons into a unified, expressive layout,
12
+ * supporting both `standard` and `connected` variants. It enables seamless, accessible grouping
13
+ * of actions, adapts to various sizes, and ensures consistent spacing, shape, and alignment.
14
+ * Designed according to Material 3 principles, it empowers users to interact with related actions
15
+ * in a visually harmonious and intuitive way.
16
+ *
17
+ * @example
18
+ * The following example illustrates a standard button group.
19
+ * ``` html
20
+ * <m3e-button-group>
21
+ * <m3e-icon-button variant="tonal" toggle><m3e-icon name="format_bold"></m3e-icon></m3e-icon-button>
22
+ * <m3e-icon-button variant="tonal" toggle><m3e-icon name="format_italic"></m3e-icon></m3e-icon-button>
23
+ * <m3e-icon-button variant="tonal" toggle><m3e-icon name="format_underlined"></m3e-icon></m3e-icon-button>
24
+ * </m3e-button-group>
25
+ * ```
26
+ * @example
27
+ * The next example illustrates a connected button group.
28
+ * ```html
29
+ * <m3e-button-group variant="connected">
30
+ * <m3e-button variant="tonal" shape="square" toggle>Start</m3e-button>
31
+ * <m3e-button variant="tonal" shape="square" toggle>Directions</m3e-button>
32
+ * <m3e-button variant="tonal" shape="square" toggle>Share</m3e-button>
33
+ * </m3e-button-group>
34
+ * ```
35
+ *
36
+ * @tag m3e-button-group
37
+ *
38
+ * @slot - Renders the buttons of the group.
39
+ *
40
+ * @attr multi - Whether multiple toggle buttons can be selected.
41
+ * @attr size - The size of the group.
42
+ * @attr variant - The appearance variant of the group.
43
+ *
44
+ * @cssprop --m3e-standard-button-group-extra-small-spacing - Spacing between buttons in standard variant, extra-small size.
45
+ * @cssprop --m3e-standard-button-group-small-spacing - Spacing between buttons in standard variant, small size.
46
+ * @cssprop --m3e-standard-button-group-medium-spacing - Spacing between buttons in standard variant, medium size.
47
+ * @cssprop --m3e-standard-button-group-large-spacing - Spacing between buttons in standard variant, large size.
48
+ * @cssprop --m3e-standard-button-group-extra-large-spacing - Spacing between buttons in standard variant, extra-large size.
49
+ * @cssprop --m3e-connected-button-group-spacing - Spacing between buttons in connected variant.
50
+ * @cssprop --m3e-connected-button-group-extra-small-inner-shape - Corner shape for connected variant, extra-small size.
51
+ * @cssprop --m3e-connected-button-group-extra-small-inner-pressed-shape - Pressed corner shape for connected variant, extra-small size.
52
+ * @cssprop --m3e-connected-button-group-small-inner-shape - Corner shape for connected variant, small size.
53
+ * @cssprop --m3e-connected-button-group-small-inner-pressed-shape - Pressed corner shape for connected variant, small size.
54
+ * @cssprop --m3e-connected-button-group-medium-inner-shape - Corner shape for connected variant, medium size.
55
+ * @cssprop --m3e-connected-button-group-medium-inner-pressed-shape - Pressed corner shape for connected variant, medium size.
56
+ * @cssprop --m3e-connected-button-group-large-inner-shape - Corner shape for connected variant, large size.
57
+ * @cssprop --m3e-connected-button-group-large-inner-pressed-shape - Pressed corner shape for connected variant, large size.
58
+ * @cssprop --m3e-connected-button-group-extra-large-inner-shape - Corner shape for connected variant, extra-large size.
59
+ * @cssprop --m3e-connected-button-group-extra-large-inner-pressed-shape - Pressed corner shape for connected variant, extra-large size.
60
+ */
61
+ export declare class M3eButtonGroupElement extends M3eButtonGroupElement_base {
62
+ #private;
63
+ /** The styles of the element. */
64
+ static styles: CSSResultGroup;
65
+ private readonly _base?;
66
+ /**
67
+ * The appearance variant of the group.
68
+ * @default "standard"
69
+ */
70
+ variant: ButtonGroupVariant;
71
+ /**
72
+ * The size of the group.
73
+ * @default "small"
74
+ */
75
+ size: ButtonGroupSize;
76
+ /**
77
+ * Whether multiple toggle buttons can be selected.
78
+ * @default false
79
+ */
80
+ multi: boolean;
81
+ /** The buttons contained by the group. */
82
+ readonly buttons: ReadonlyArray<M3eButtonElement | M3eIconButtonElement>;
83
+ /** @inheritdoc */
84
+ connectedCallback(): void;
85
+ /** @inheritdoc */
86
+ disconnectedCallback(): void;
87
+ /** @inheritdoc */
88
+ protected update(changedProperties: PropertyValues<this>): void;
89
+ /** @inheritdoc */
90
+ protected render(): unknown;
91
+ }
92
+ declare global {
93
+ interface HTMLElementTagNameMap {
94
+ "m3e-button-group": M3eButtonGroupElement;
95
+ }
96
+ }
97
+ export {};
98
+ //# sourceMappingURL=ButtonGroupElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonGroupElement.d.ts","sourceRoot":"","sources":["../../src/ButtonGroupElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAI5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,qBACa,qBAAsB,SAAQ,0BAAyB;;IAClE,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAuMpC;IAmBc,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAc;IAErD;;;OAGG;IAC0B,OAAO,EAAE,kBAAkB,CAAc;IAEtE;;;OAGG;IAC0B,IAAI,EAAE,eAAe,CAAW;IAE7D;;;OAGG;IAC0B,KAAK,UAAS;IAE3C,0CAA0C;IAE1C,QAAQ,CAAC,OAAO,EAAG,aAAa,CAAC,gBAAgB,GAAG,oBAAoB,CAAC,CAAC;IAE1E,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IAQlC,kBAAkB;IACT,oBAAoB,IAAI,IAAI;IAMrC,kBAAkB;cACC,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAWxE,kBAAkB;cACC,MAAM,IAAI,OAAO;CAqDrC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,qBAAqB,CAAC;KAC3C;CACF"}
@@ -0,0 +1,3 @@
1
+ /** Specifies the possible sizes of a button a group. */
2
+ export type ButtonGroupSize = "extra-small" | "small" | "medium" | "large" | "extra-large";
3
+ //# sourceMappingURL=ButtonGroupSize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonGroupSize.d.ts","sourceRoot":"","sources":["../../src/ButtonGroupSize.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Specifies the possible appearance variants of a button group. */
2
+ export type ButtonGroupVariant = "standard" | "connected";
3
+ //# sourceMappingURL=ButtonGroupVariant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonGroupVariant.d.ts","sourceRoot":"","sources":["../../src/ButtonGroupVariant.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,WAAW,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./ButtonGroupElement";
2
+ export * from "./ButtonGroupSize";
3
+ export * from "./ButtonGroupVariant";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m3e/button-group",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0-rc.4",
4
4
  "description": "Button Group for M3E",
5
5
  "author": "matraic <matraic@yahoo.com>",
6
6
  "license": "MIT",
@@ -29,9 +29,9 @@
29
29
  "clean": "rimraf dist"
30
30
  },
31
31
  "peerDependencies": {
32
- "@m3e/core": "1.0.0-rc.2",
33
- "@m3e/button": "1.0.0-rc.2",
34
- "@m3e/icon-button": "1.0.0-rc.2",
32
+ "@m3e/core": "1.0.0-rc.4",
33
+ "@m3e/button": "1.0.0-rc.4",
34
+ "@m3e/icon-button": "1.0.0-rc.4",
35
35
  "lit": "^3.3.0"
36
36
  },
37
37
  "devDependencies": {