@material/web 2.4.2-nightly.fd17013.0 → 2.5.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.
Files changed (164) hide show
  1. package/custom-elements.json +44986 -0
  2. package/labs/gb/components/badge/_badge-tokens.scss +18 -0
  3. package/labs/gb/components/badge/badge-element.d.ts +15 -0
  4. package/labs/gb/components/badge/badge-element.js +49 -0
  5. package/labs/gb/components/badge/badge-element.js.map +1 -0
  6. package/labs/gb/components/badge/badge.css +4 -0
  7. package/labs/gb/components/badge/badge.css.map +1 -0
  8. package/labs/gb/components/badge/badge.cssresult.d.ts +3 -0
  9. package/labs/gb/components/badge/badge.cssresult.js +14 -0
  10. package/labs/gb/components/badge/badge.cssresult.js.map +1 -0
  11. package/labs/gb/components/badge/badge.d.ts +32 -0
  12. package/labs/gb/components/badge/badge.js +35 -0
  13. package/labs/gb/components/badge/badge.js.map +1 -0
  14. package/labs/gb/components/badge/badge.scss +49 -0
  15. package/labs/gb/components/badge/md-gb-badge.d.ts +12 -0
  16. package/labs/gb/components/badge/md-gb-badge.js +8 -0
  17. package/labs/gb/components/badge/md-gb-badge.js.map +1 -0
  18. package/labs/gb/components/button/_button-tokens.scss +2 -0
  19. package/labs/gb/components/button/{md-button.d.ts → button-element.d.ts} +31 -8
  20. package/labs/gb/components/button/{md-button.js → button-element.js} +119 -20
  21. package/labs/gb/components/button/button-element.js.map +1 -0
  22. package/labs/gb/components/button/button.css.map +1 -1
  23. package/labs/gb/components/button/md-gb-button.d.ts +12 -0
  24. package/labs/gb/components/button/md-gb-button.js +8 -0
  25. package/labs/gb/components/button/md-gb-button.js.map +1 -0
  26. package/labs/gb/components/card/_card-tokens.scss +2 -0
  27. package/labs/gb/components/card/card-element.d.ts +43 -0
  28. package/labs/gb/components/card/card-element.js +169 -0
  29. package/labs/gb/components/card/card-element.js.map +1 -0
  30. package/labs/gb/components/card/card.css.map +1 -1
  31. package/labs/gb/components/card/md-gb-card.d.ts +12 -0
  32. package/labs/gb/components/card/md-gb-card.js +8 -0
  33. package/labs/gb/components/card/md-gb-card.js.map +1 -0
  34. package/labs/gb/components/checkbox/_checkbox-tokens.scss +2 -0
  35. package/labs/gb/components/checkbox/{md-checkbox.d.ts → checkbox-element.d.ts} +15 -7
  36. package/labs/gb/components/checkbox/{md-checkbox.js → checkbox-element.js} +26 -16
  37. package/labs/gb/components/checkbox/checkbox-element.js.map +1 -0
  38. package/labs/gb/components/checkbox/checkbox.css.map +1 -1
  39. package/labs/gb/components/checkbox/md-gb-checkbox.d.ts +12 -0
  40. package/labs/gb/components/checkbox/md-gb-checkbox.js +8 -0
  41. package/labs/gb/components/checkbox/md-gb-checkbox.js.map +1 -0
  42. package/labs/gb/components/divider/_divider-tokens.scss +2 -0
  43. package/labs/gb/components/divider/{md-divider.d.ts → divider-element.d.ts} +5 -7
  44. package/labs/gb/components/divider/{md-divider.js → divider-element.js} +10 -10
  45. package/labs/gb/components/divider/divider-element.js.map +1 -0
  46. package/labs/gb/components/divider/divider.css.map +1 -1
  47. package/labs/gb/components/divider/md-gb-divider.d.ts +12 -0
  48. package/labs/gb/components/divider/md-gb-divider.js +8 -0
  49. package/labs/gb/components/divider/md-gb-divider.js.map +1 -0
  50. package/labs/gb/components/fab/_fab-tokens.scss +2 -0
  51. package/labs/gb/components/fab/fab-element.d.ts +31 -0
  52. package/labs/gb/components/fab/{md-fab.js → fab-element.js} +22 -11
  53. package/labs/gb/components/fab/fab-element.js.map +1 -0
  54. package/labs/gb/components/fab/fab.css.map +1 -1
  55. package/labs/gb/components/fab/md-gb-fab.d.ts +12 -0
  56. package/labs/gb/components/fab/md-gb-fab.js +8 -0
  57. package/labs/gb/components/fab/md-gb-fab.js.map +1 -0
  58. package/labs/gb/components/iconbutton/_icon-button-tokens.scss +2 -0
  59. package/labs/gb/components/iconbutton/{md-icon-button.d.ts → icon-button-element.d.ts} +15 -7
  60. package/labs/gb/components/iconbutton/{md-icon-button.js → icon-button-element.js} +30 -20
  61. package/labs/gb/components/iconbutton/icon-button-element.js.map +1 -0
  62. package/labs/gb/components/iconbutton/icon-button.css.map +1 -1
  63. package/labs/gb/components/iconbutton/md-gb-icon-button.d.ts +12 -0
  64. package/labs/gb/components/iconbutton/md-gb-icon-button.js +8 -0
  65. package/labs/gb/components/iconbutton/md-gb-icon-button.js.map +1 -0
  66. package/labs/gb/components/list/_list-tokens.scss +4 -0
  67. package/labs/gb/components/list/{md-list.d.ts → list-element.d.ts} +6 -7
  68. package/labs/gb/components/list/{md-list.js → list-element.js} +11 -10
  69. package/labs/gb/components/list/list-element.js.map +1 -0
  70. package/labs/gb/components/list/list-item-element.d.ts +77 -0
  71. package/labs/gb/components/list/{md-list-item.js → list-item-element.js} +55 -20
  72. package/labs/gb/components/list/list-item-element.js.map +1 -0
  73. package/labs/gb/components/list/list.css.map +1 -1
  74. package/labs/gb/components/list/md-gb-list-item.d.ts +12 -0
  75. package/labs/gb/components/list/md-gb-list-item.js +8 -0
  76. package/labs/gb/components/list/md-gb-list-item.js.map +1 -0
  77. package/labs/gb/components/list/md-gb-list.d.ts +12 -0
  78. package/labs/gb/components/list/md-gb-list.js +8 -0
  79. package/labs/gb/components/list/md-gb-list.js.map +1 -0
  80. package/labs/gb/components/menu/_menu-tokens.scss +4 -0
  81. package/labs/gb/components/menu/md-gb-menu-group.d.ts +12 -0
  82. package/labs/gb/components/menu/md-gb-menu-group.js +8 -0
  83. package/labs/gb/components/menu/md-gb-menu-group.js.map +1 -0
  84. package/labs/gb/components/menu/md-gb-menu-item.d.ts +12 -0
  85. package/labs/gb/components/menu/md-gb-menu-item.js +8 -0
  86. package/labs/gb/components/menu/md-gb-menu-item.js.map +1 -0
  87. package/labs/gb/components/menu/md-gb-menu.d.ts +12 -0
  88. package/labs/gb/components/menu/md-gb-menu.js +8 -0
  89. package/labs/gb/components/menu/md-gb-menu.js.map +1 -0
  90. package/labs/gb/components/menu/{md-menu.d.ts → menu-element.d.ts} +11 -7
  91. package/labs/gb/components/menu/{md-menu.js → menu-element.js} +16 -10
  92. package/labs/gb/components/menu/menu-element.js.map +1 -0
  93. package/labs/gb/components/menu/{md-menu-group.d.ts → menu-group-element.d.ts} +3 -6
  94. package/labs/gb/components/menu/{md-menu-group.js → menu-group-element.js} +11 -11
  95. package/labs/gb/components/menu/menu-group-element.js.map +1 -0
  96. package/labs/gb/components/menu/menu-item-element.d.ts +56 -0
  97. package/labs/gb/components/menu/{md-menu-item.js → menu-item-element.js} +41 -13
  98. package/labs/gb/components/menu/menu-item-element.js.map +1 -0
  99. package/labs/gb/components/menu/menu.css.map +1 -1
  100. package/labs/gb/components/menu/menu.js +1 -1
  101. package/labs/gb/components/menu/menu.js.map +1 -1
  102. package/labs/gb/components/radio/_radio-tokens.scss +2 -0
  103. package/labs/gb/components/radio/md-gb-radio.d.ts +12 -0
  104. package/labs/gb/components/radio/md-gb-radio.js +8 -0
  105. package/labs/gb/components/radio/md-gb-radio.js.map +1 -0
  106. package/labs/gb/components/radio/{md-radio.d.ts → radio-element.d.ts} +10 -7
  107. package/labs/gb/components/radio/{md-radio.js → radio-element.js} +19 -14
  108. package/labs/gb/components/radio/radio-element.js.map +1 -0
  109. package/labs/gb/components/radio/radio.css.map +1 -1
  110. package/labs/gb/components/splitbutton/_split-button-tokens.scss +4 -0
  111. package/labs/gb/components/splitbutton/md-gb-split-button.d.ts +12 -0
  112. package/labs/gb/components/splitbutton/md-gb-split-button.js +8 -0
  113. package/labs/gb/components/splitbutton/md-gb-split-button.js.map +1 -0
  114. package/labs/gb/components/splitbutton/split-button-element.d.ts +33 -0
  115. package/labs/gb/components/splitbutton/{md-split-button.js → split-button-element.js} +21 -12
  116. package/labs/gb/components/splitbutton/split-button-element.js.map +1 -0
  117. package/labs/gb/components/splitbutton/split-button.css.map +1 -1
  118. package/labs/gb/components/splitbutton/split-button.d.ts +5 -5
  119. package/labs/gb/components/splitbutton/split-button.js +5 -5
  120. package/labs/gb/components/splitbutton/split-button.js.map +1 -1
  121. package/labs/gb/components/switch/_switch-tokens.scss +2 -0
  122. package/labs/gb/components/switch/md-gb-switch.d.ts +12 -0
  123. package/labs/gb/components/switch/md-gb-switch.js +8 -0
  124. package/labs/gb/components/switch/md-gb-switch.js.map +1 -0
  125. package/labs/gb/components/switch/{md-switch.d.ts → switch-element.d.ts} +19 -7
  126. package/labs/gb/components/switch/{md-switch.js → switch-element.js} +28 -14
  127. package/labs/gb/components/switch/switch-element.js.map +1 -0
  128. package/labs/gb/components/switch/switch.css.map +1 -1
  129. package/labs/gb/styles/adopt-styles.js +7 -7
  130. package/labs/gb/styles/adopt-styles.js.map +1 -1
  131. package/labs/gb/styles/icon/{md-icon.d.ts → icon-element.d.ts} +1 -7
  132. package/labs/gb/styles/icon/{md-icon.js → icon-element.js} +8 -10
  133. package/labs/gb/styles/icon/icon-element.js.map +1 -0
  134. package/labs/gb/styles/icon/md-gb-icon.d.ts +12 -0
  135. package/labs/gb/styles/icon/md-gb-icon.js +8 -0
  136. package/labs/gb/styles/icon/md-gb-icon.js.map +1 -0
  137. package/list/internal/listitem/list-item.d.ts +4 -1
  138. package/list/internal/listitem/list-item.js +4 -1
  139. package/list/internal/listitem/list-item.js.map +1 -1
  140. package/menu/internal/submenu/sub-menu.d.ts +5 -1
  141. package/menu/internal/submenu/sub-menu.js +5 -1
  142. package/menu/internal/submenu/sub-menu.js.map +1 -1
  143. package/package.json +22 -3
  144. package/labs/gb/components/button/md-button.js.map +0 -1
  145. package/labs/gb/components/card/md-card.d.ts +0 -30
  146. package/labs/gb/components/card/md-card.js +0 -85
  147. package/labs/gb/components/card/md-card.js.map +0 -1
  148. package/labs/gb/components/checkbox/md-checkbox.js.map +0 -1
  149. package/labs/gb/components/divider/md-divider.js.map +0 -1
  150. package/labs/gb/components/fab/md-fab.d.ts +0 -22
  151. package/labs/gb/components/fab/md-fab.js.map +0 -1
  152. package/labs/gb/components/iconbutton/md-icon-button.js.map +0 -1
  153. package/labs/gb/components/list/md-list-item.d.ts +0 -44
  154. package/labs/gb/components/list/md-list-item.js.map +0 -1
  155. package/labs/gb/components/list/md-list.js.map +0 -1
  156. package/labs/gb/components/menu/md-menu-group.js.map +0 -1
  157. package/labs/gb/components/menu/md-menu-item.d.ts +0 -30
  158. package/labs/gb/components/menu/md-menu-item.js.map +0 -1
  159. package/labs/gb/components/menu/md-menu.js.map +0 -1
  160. package/labs/gb/components/radio/md-radio.js.map +0 -1
  161. package/labs/gb/components/splitbutton/md-split-button.d.ts +0 -26
  162. package/labs/gb/components/splitbutton/md-split-button.js.map +0 -1
  163. package/labs/gb/components/switch/md-switch.js.map +0 -1
  164. package/labs/gb/styles/icon/md-icon.js.map +0 -1
@@ -4,11 +4,13 @@
4
4
  //
5
5
 
6
6
  @mixin root {
7
+ // LINT.IfChange
7
8
  --icon-color: var(--md-sys-color-on-surface-variant);
8
9
  --icon-size: 20px;
9
10
  --state-layer-color: var(--md-sys-color-on-surface);
10
11
  --state-layer-shape: 50%;
11
12
  --state-layer-size: 40px;
13
+ // LINT.ThenChange(md-radio.ts) keep in sync with `@cssprop` jsdoc tags
12
14
  }
13
15
 
14
16
  @mixin hovered {
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { RadioElement } from './radio-element.js';
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ /** A Material Design component. */
10
+ 'md-gb-radio': RadioElement;
11
+ }
12
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { RadioElement } from './radio-element.js';
7
+ customElements.define('md-gb-radio', RadioElement);
8
+ //# sourceMappingURL=md-gb-radio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"md-gb-radio.js","sourceRoot":"","sources":["md-gb-radio.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAShD,cAAc,CAAC,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {RadioElement} from './radio-element.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design component. */\n 'md-gb-radio': RadioElement;\n }\n}\n\ncustomElements.define('md-gb-radio', RadioElement);\n"]}
@@ -7,17 +7,20 @@ import { CSSResultOrNative, LitElement } from 'lit';
7
7
  import { createValidator, getValidityAnchor } from '../../../behaviors/constraint-validation.js';
8
8
  import { getFormState, getFormValue } from '../../../behaviors/form-associated.js';
9
9
  import { RadioValidator } from '../../../behaviors/validators/radio-validator.js';
10
- declare global {
11
- interface HTMLElementTagNameMap {
12
- /** A Material Design radio component. */
13
- 'md-radio': Radio;
14
- }
15
- }
16
10
  declare const radioBaseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<import("@material/web/labs/behaviors/mixin.js").MixinReturn<(abstract new (...args: any[]) => import("../../../behaviors/element-internals.js").WithElementInternals) & (abstract new (...args: any[]) => import("../../../behaviors/focusable.js").Focusable) & typeof LitElement & import("../../../behaviors/form-associated.js").FormAssociatedConstructor, import("../../../behaviors/form-associated.js").FormAssociated>, import("../../../behaviors/constraint-validation.js").ConstraintValidation>;
17
11
  /**
18
12
  * A Material Design radio component.
13
+ *
14
+ * @fires {InputEvent} input - Fired when the radio is checked (but not unchecked). --bubbles --composed
15
+ * @fires {Event} change - Fired when the radio is checked (but not unchecked). --bubbles
16
+ * @csspart radio - The radio's root element.
17
+ * @cssprop --icon-color
18
+ * @cssprop --icon-size
19
+ * @cssprop --state-layer-color
20
+ * @cssprop --state-layer-shape
21
+ * @cssprop --state-layer-size
19
22
  */
20
- export declare class Radio extends radioBaseClass {
23
+ export declare class RadioElement extends radioBaseClass {
21
24
  static styles: CSSResultOrNative[];
22
25
  /**
23
26
  * Whether or not the radio is selected.
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { __decorate } from "tslib";
7
7
  import { css, html, isServer, LitElement } from 'lit';
8
- import { customElement, property, query, state } from 'lit/decorators.js';
8
+ import { property, query, state } from 'lit/decorators.js';
9
9
  import { afterDispatch, setupDispatchHooks, } from '../../../../internal/events/dispatch-hooks.js';
10
10
  import { SingleSelectionController } from '../../../../radio/internal/single-selection-controller.js';
11
11
  import { createValidator, getValidityAnchor, mixinConstraintValidation, } from '../../../behaviors/constraint-validation.js';
@@ -24,8 +24,17 @@ import { radio } from './radio.js';
24
24
  const radioBaseClass = mixinConstraintValidation(mixinFormAssociated(mixinElementInternals(mixinFocusable(LitElement))));
25
25
  /**
26
26
  * A Material Design radio component.
27
+ *
28
+ * @fires {InputEvent} input - Fired when the radio is checked (but not unchecked). --bubbles --composed
29
+ * @fires {Event} change - Fired when the radio is checked (but not unchecked). --bubbles
30
+ * @csspart radio - The radio's root element.
31
+ * @cssprop --icon-color
32
+ * @cssprop --icon-size
33
+ * @cssprop --state-layer-color
34
+ * @cssprop --state-layer-shape
35
+ * @cssprop --state-layer-size
27
36
  */
28
- let Radio = class Radio extends radioBaseClass {
37
+ export class RadioElement extends radioBaseClass {
29
38
  /**
30
39
  * Whether or not the radio is selected.
31
40
  */
@@ -149,8 +158,8 @@ let Radio = class Radio extends radioBaseClass {
149
158
  [getValidityAnchor]() {
150
159
  return this.radio;
151
160
  }
152
- };
153
- Radio.styles = [
161
+ }
162
+ RadioElement.styles = [
154
163
  focusRingStyles,
155
164
  rippleStyles,
156
165
  radioStyles,
@@ -166,21 +175,17 @@ Radio.styles = [
166
175
  ];
167
176
  __decorate([
168
177
  property({ type: Boolean })
169
- ], Radio.prototype, "checked", null);
178
+ ], RadioElement.prototype, "checked", null);
170
179
  __decorate([
171
180
  property({ type: Boolean })
172
- ], Radio.prototype, "required", void 0);
181
+ ], RadioElement.prototype, "required", void 0);
173
182
  __decorate([
174
183
  property()
175
- ], Radio.prototype, "value", void 0);
184
+ ], RadioElement.prototype, "value", void 0);
176
185
  __decorate([
177
186
  query('.radio', true)
178
- ], Radio.prototype, "radio", void 0);
187
+ ], RadioElement.prototype, "radio", void 0);
179
188
  __decorate([
180
189
  state()
181
- ], Radio.prototype, "isFocused", void 0);
182
- Radio = __decorate([
183
- customElement('md-radio')
184
- ], Radio);
185
- export { Radio };
186
- //# sourceMappingURL=md-radio.js.map
190
+ ], RadioElement.prototype, "isFocused", void 0);
191
+ //# sourceMappingURL=radio-element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio-element.js","sourceRoot":"","sources":["radio-element.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AACvE,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,aAAa,EACb,kBAAkB,GACnB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAC,yBAAyB,EAAC,MAAM,2DAA2D,CAAC;AACpG,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,SAAS,EACT,qBAAqB,GACtB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,mBAAmB,GACpB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAC,cAAc,EAAC,MAAM,kDAAkD,CAAC;AAEhF,OAAO,eAAe,MAAM,yBAAyB,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AACxF,kFAAkF;AAClF,OAAO,YAAY,MAAM,sBAAsB,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AAClF,4EAA4E;AAC5E,OAAO,WAAW,MAAM,aAAa,CA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B,EAAE,CAAC;gBAC9B,sEAAsE;gBACtE,2DAA2D;gBAC3D,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC;YAED,OAAO,IAAI,CAAC,mBAAmB,CAAC,QAG/B,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAEQ,CAAC,iBAAiB,CAAC;QAC1B,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;;AArKe,mBAAM,GAAwB;IAC5C,eAAe;IACf,YAAY;IACZ,WAAW;IACX,GAAG,CAAA;;;;;;;;KAQF;CACF,AAbqB,CAapB;AAMF;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;2CAGzB;AA0B0B;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;8CAAkB;AAKhC;IAAX,QAAQ,EAAE;2CAAc;AAEe;IAAvC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;2CAAsC;AAU3C;IAAhB,KAAK,EAAE;+CAA2B","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {css, CSSResultOrNative, html, isServer, LitElement} from 'lit';\nimport {property, query, state} from 'lit/decorators.js';\nimport {\n afterDispatch,\n setupDispatchHooks,\n} from '../../../../internal/events/dispatch-hooks.js';\nimport {SingleSelectionController} from '../../../../radio/internal/single-selection-controller.js';\nimport {\n createValidator,\n getValidityAnchor,\n mixinConstraintValidation,\n} from '../../../behaviors/constraint-validation.js';\nimport {\n internals,\n mixinElementInternals,\n} from '../../../behaviors/element-internals.js';\nimport {mixinFocusable} from '../../../behaviors/focusable.js';\nimport {\n getFormState,\n getFormValue,\n mixinFormAssociated,\n} from '../../../behaviors/form-associated.js';\nimport {RadioValidator} from '../../../behaviors/validators/radio-validator.js';\n\nimport focusRingStyles from '../focus/focus-ring.css' with {type: 'css'}; // github-only\n// import focusRingStyles from '../focus/focus-ring.cssresult.js'; // google3-only\nimport rippleStyles from '../ripple/ripple.css' with {type: 'css'}; // github-only\n// import rippleStyles from '../ripple/ripple.cssresult.js'; // google3-only\nimport radioStyles from './radio.css' with {type: 'css'}; // github-only\n// import {styles as radioStyles} from './radio.cssresult.js'; // google3-only\n\nimport {radio} from './radio.js';\n\n// Separate variable needed for closure.\nconst radioBaseClass = mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(mixinFocusable(LitElement))),\n);\n\n/**\n * A Material Design radio component.\n *\n * @fires {InputEvent} input - Fired when the radio is checked (but not unchecked). --bubbles --composed\n * @fires {Event} change - Fired when the radio is checked (but not unchecked). --bubbles\n * @csspart radio - The radio's root element.\n * @cssprop --icon-color\n * @cssprop --icon-size\n * @cssprop --state-layer-color\n * @cssprop --state-layer-shape\n * @cssprop --state-layer-size\n */\nexport class RadioElement extends radioBaseClass {\n static override styles: CSSResultOrNative[] = [\n focusRingStyles,\n rippleStyles,\n radioStyles,\n css`\n :host {\n display: inline-flex;\n outline: none;\n }\n .radio {\n flex: 1;\n }\n `,\n ];\n\n /**\n * Whether or not the radio is selected.\n */\n @property({type: Boolean})\n get checked() {\n return this[internals].ariaChecked === 'true';\n }\n set checked(checked: boolean) {\n const wasChecked = this.checked;\n if (wasChecked === checked) {\n return;\n }\n\n this[internals].ariaChecked = String(checked);\n this.requestUpdate('checked', wasChecked);\n this.selectionController.handleCheckedChange();\n }\n\n /**\n * The default checked state of the radio.\n */\n get defaultChecked(): boolean {\n return this.hasAttribute('checked');\n }\n set defaultChecked(value: boolean) {\n this.toggleAttribute('checked', value || false);\n }\n\n /**\n * Whether or not the radio is required. If any radio is required in a group,\n * all radios are implicitly required.\n */\n @property({type: Boolean}) required = false;\n\n /**\n * The element value to use in form submission when checked.\n */\n @property() value = 'on';\n\n @query('.radio', true) private readonly radio!: HTMLElement;\n private readonly selectionController = new SingleSelectionController(this);\n /**\n * Mimics the behavior of <input> dirty checkedness, where the `checked`\n * attribute only updates the checked state if the radio has not been\n * interacted with.\n *\n * @see https://html.spec.whatwg.org/multipage/input.html#concept-input-checked-dirty-flag\n */\n private dirtyCheckedness = false;\n @state() private isFocused = false;\n\n constructor() {\n super();\n if (isServer) return;\n this[internals].role = 'radio';\n this.addController(this.selectionController);\n setupDispatchHooks(this, 'click', 'keydown');\n this.addEventListener('click', (event) => {\n // Return if disabled, or already checked since clicking on a checked\n // radio does not dispatch events.\n if (this.disabled || this.checked) return;\n afterDispatch(event, () => {\n if (event.defaultPrevented) return;\n // Per spec, clicking on a radio input always selects it.\n this.checked = true;\n this.dirtyCheckedness = true;\n this.dispatchEvent(new Event('change', {bubbles: true}));\n this.dispatchEvent(\n new InputEvent('input', {bubbles: true, composed: true}),\n );\n });\n });\n\n this.addEventListener('keydown', (event) => {\n afterDispatch(event, () => {\n if (event.key !== ' ' || event.defaultPrevented) {\n return;\n }\n\n this.click();\n });\n });\n\n this.addEventListener('focus', () => {\n this.isFocused = true;\n });\n\n this.addEventListener('blur', () => {\n this.isFocused = false;\n });\n }\n\n protected override render() {\n return html`<div\n part=\"radio\"\n class=\"ripple-host focus-ring-host ${radio({\n checked: this.checked,\n disabled: this.disabled,\n focus: this.isFocused,\n })}\"></div>`;\n }\n\n override attributeChangedCallback(\n name: string,\n oldValue: string | null,\n newValue: string | null,\n ) {\n if (name === 'checked' && this.dirtyCheckedness) {\n // The 'checked' attribute does not update radios that have been\n // interacted with.\n return;\n }\n\n super.attributeChangedCallback(name, oldValue, newValue);\n }\n\n override [getFormValue]() {\n return this.checked ? this.value : null;\n }\n\n override [getFormState]() {\n return String(this.checked);\n }\n\n override formResetCallback() {\n this.dirtyCheckedness = false;\n this.checked = this.defaultChecked;\n }\n\n override formStateRestoreCallback(state: string) {\n this.checked = state === 'true';\n }\n\n override [createValidator]() {\n return new RadioValidator(() => {\n if (!this.selectionController) {\n // Validation runs on superclass construction, so selection controller\n // might not actually be ready until this class constructs.\n return [this];\n }\n\n return this.selectionController.controls as [\n RadioElement,\n ...RadioElement[],\n ];\n });\n }\n\n override [getValidityAnchor]() {\n return this.radio;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["radio.scss","_radio-tokens.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA,GASA,kDACA,qBAEI,OCNF,qDACA,kBACA,oDACA,yBACA,yBDKI,4BCDJ,6CDII,gFAGA,8BCCJ,iDDGE,6BCCF,0CACA,iDDCI,oDCGJ,oDDCE,+BCGF,mEDCE,OACE,gBACA,kBACA,oBACA,mBACA,uBACA,WACA,YACA,sBACA,aACA,iCAEA,eACE,oBACA,wBACA,4CACA,uBACA,eAEF,qCACE,+BAEF,cACE,WACA,kBACA,eACA,+BACA,+BACA,8BACA,uCACA,kCACA,wCACA,oCACA","file":"radio.css"}
1
+ {"version":3,"sourceRoot":"","sources":["radio.scss","_radio-tokens.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA,GASA,kDACA,qBAEI,OCLF,qDACA,kBACA,oDACA,yBACA,yBDII,4BCCJ,6CDEI,mCCEJ,6CDCI,8BCGJ,iDDCE,6BCGF,0CACA,iDDDI,oDCKJ,oDDDE,+BCKF,mEDDE,OACE,gBACA,kBACA,oBACA,mBACA,uBACA,WACA,YACA,sBACA,aACA,iCAEA,eACE,oBACA,wBACA,4CACA,uBACA,eAEF,qCACE,+BAEF,cACE,WACA,kBACA,eACA,+BACA,+BACA,8BACA,uCACA,kCACA,wCACA,oCACA","file":"radio.css"}
@@ -4,15 +4,19 @@
4
4
  //
5
5
 
6
6
  @mixin root {
7
+ // LINT.IfChange
7
8
  --between-space: 2px;
9
+ // LINT.ThenChange(md-split-button.ts) keep in sync with `@cssprop` jsdoc tags
8
10
  }
9
11
 
10
12
  @mixin button {
13
+ // LINT.IfChange
11
14
  --icon-size: 0;
12
15
  --inner-corner-size: 0;
13
16
  --outer-corner-size: calc(var(--container-height) / 2);
14
17
  --leading-space: 0;
15
18
  --trailing-space: 0;
19
+ // LINT.ThenChange(md-split-button.ts) keep in sync with `@cssprop` jsdoc tags
16
20
  }
17
21
 
18
22
  @mixin button-xs {
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { SplitButtonElement } from './split-button-element.js';
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ /** A Material Design component. */
10
+ 'md-gb-split-button': SplitButtonElement;
11
+ }
12
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { SplitButtonElement } from './split-button-element.js';
7
+ customElements.define('md-gb-split-button', SplitButtonElement);
8
+ //# sourceMappingURL=md-gb-split-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"md-gb-split-button.js","sourceRoot":"","sources":["md-gb-split-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAS7D,cAAc,CAAC,MAAM,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {SplitButtonElement} from './split-button-element.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design component. */\n 'md-gb-split-button': SplitButtonElement;\n }\n}\n\ncustomElements.define('md-gb-split-button', SplitButtonElement);\n"]}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { CSSResultOrNative, LitElement } from 'lit';
7
+ import { type SplitButtonColor, type SplitButtonSize } from './split-button.js';
8
+ /**
9
+ * A Material Design split button component.
10
+ *
11
+ * @slot leading - Requires a `<button>` for the main action.
12
+ * @slot trailing - Requires a `<button>` for the menu action. Use `popovertarget` to display a menu.
13
+ * @slot - Used to render the trailing button's popover menu.
14
+ * @csspart split-btn - The split button's root element.
15
+ * @csspart leading-btn - The split button's main action.
16
+ * @csspart trailing-btn - The split button's menu action.
17
+ * @cssprop --between-space
18
+ * @cssprop --icon-size
19
+ * @cssprop --inner-corner-size
20
+ * @cssprop --outer-corner-size
21
+ * @cssprop --leading-space
22
+ * @cssprop --trailing-space
23
+ */
24
+ export declare class SplitButtonElement extends LitElement {
25
+ static styles: CSSResultOrNative[];
26
+ color: SplitButtonColor;
27
+ size: SplitButtonSize;
28
+ selected: boolean;
29
+ protected render(): import("lit-html").TemplateResult<1>;
30
+ private updateSlotFocusVisible;
31
+ private cleanupToggleListener?;
32
+ private handleTrailingSlotchange;
33
+ }
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { __decorate } from "tslib";
7
7
  import { css, html, LitElement } from 'lit';
8
- import { customElement, property } from 'lit/decorators.js';
8
+ import { property } from 'lit/decorators.js';
9
9
  import { button } from '../button/button.js';
10
10
  import focusRingStyles from '../focus/focus-ring.css' with { type: 'css' }; // github-only
11
11
  // import focusRingStyles from '../focus/focus-ring.cssresult.js'; // google3-only
@@ -18,8 +18,21 @@ import splitButtonStyles from './split-button.css' with { type: 'css' }; // gith
18
18
  import { splitButton, } from './split-button.js';
19
19
  /**
20
20
  * A Material Design split button component.
21
+ *
22
+ * @slot leading - Requires a `<button>` for the main action.
23
+ * @slot trailing - Requires a `<button>` for the menu action. Use `popovertarget` to display a menu.
24
+ * @slot - Used to render the trailing button's popover menu.
25
+ * @csspart split-btn - The split button's root element.
26
+ * @csspart leading-btn - The split button's main action.
27
+ * @csspart trailing-btn - The split button's menu action.
28
+ * @cssprop --between-space
29
+ * @cssprop --icon-size
30
+ * @cssprop --inner-corner-size
31
+ * @cssprop --outer-corner-size
32
+ * @cssprop --leading-space
33
+ * @cssprop --trailing-space
21
34
  */
22
- let SplitButton = class SplitButton extends LitElement {
35
+ export class SplitButtonElement extends LitElement {
23
36
  constructor() {
24
37
  super(...arguments);
25
38
  this.color = 'filled';
@@ -70,8 +83,8 @@ let SplitButton = class SplitButton extends LitElement {
70
83
  this.selected = event.newState === 'open';
71
84
  }, { signal: this.cleanupToggleListener.signal });
72
85
  }
73
- };
74
- SplitButton.styles = [
86
+ }
87
+ SplitButtonElement.styles = [
75
88
  focusRingStyles,
76
89
  rippleStyles,
77
90
  buttonStyles,
@@ -105,15 +118,11 @@ SplitButton.styles = [
105
118
  ];
106
119
  __decorate([
107
120
  property()
108
- ], SplitButton.prototype, "color", void 0);
121
+ ], SplitButtonElement.prototype, "color", void 0);
109
122
  __decorate([
110
123
  property()
111
- ], SplitButton.prototype, "size", void 0);
124
+ ], SplitButtonElement.prototype, "size", void 0);
112
125
  __decorate([
113
126
  property({ type: Boolean })
114
- ], SplitButton.prototype, "selected", void 0);
115
- SplitButton = __decorate([
116
- customElement('md-split-button')
117
- ], SplitButton);
118
- export { SplitButton };
119
- //# sourceMappingURL=md-split-button.js.map
127
+ ], SplitButtonElement.prototype, "selected", void 0);
128
+ //# sourceMappingURL=split-button-element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split-button-element.js","sourceRoot":"","sources":["split-button-element.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AAC7D,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAE3C,OAAO,eAAe,MAAM,yBAAyB,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AACxF,kFAAkF;AAClF,OAAO,YAAY,MAAM,sBAAsB,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AAClF,4EAA4E;AAC5E,OAAO,YAAY,MAAM,sBAAsB,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AAClF,4EAA4E;AAC5E,OAAO,i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AyB,CAAC;QAC7C,MAAM,cAAc,GAAG,IAAI;aACxB,gBAAgB,EAAE;aAClB,IAAI,CAAC,CAAC,EAAE,EAA2B,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,cAAc,EAAE,oBAAoB;YAAE,OAAO;QAClD,cAAc,CAAC,oBAAoB,CAAC,gBAAgB,CAClD,QAAQ,EACR,CAAC,KAAY,EAAE,EAAE;YACf,IAAI,CAAC,QAAQ,GAAI,KAAqB,CAAC,QAAQ,KAAK,MAAM,CAAC;QAC7D,CAAC,EACD,EAAC,MAAM,EAAE,IAAI,CAAC,qBAAqB,CAAC,MAAM,EAAC,CAC5C,CAAC;IACJ,CAAC;;AAvFe,yBAAM,GAAwB;IAC5C,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;KAyBF;CACF,AA/BqB,CA+BpB;AAEU;IAAX,QAAQ,EAAE;iDAAoC;AACnC;IAAX,QAAQ,EAAE;gDAA8B;AACd;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;oDAAkB","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {css, CSSResultOrNative, html, LitElement} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {button} from '../button/button.js';\n\nimport focusRingStyles from '../focus/focus-ring.css' with {type: 'css'}; // github-only\n// import focusRingStyles from '../focus/focus-ring.cssresult.js'; // google3-only\nimport rippleStyles from '../ripple/ripple.css' with {type: 'css'}; // github-only\n// import rippleStyles from '../ripple/ripple.cssresult.js'; // google3-only\nimport buttonStyles from '../button/button.css' with {type: 'css'}; // github-only\n// import buttonStyles from '../button/button.cssresult.js'; // google3-only\nimport splitButtonStyles from './split-button.css' with {type: 'css'}; // github-only\n// import {styles as splitButtonStyles} from './split-button.cssresult.js'; // google3-only\n\nimport {\n splitButton,\n type SplitButtonColor,\n type SplitButtonSize,\n} from './split-button.js';\n\n/**\n * A Material Design split button component.\n *\n * @slot leading - Requires a `<button>` for the main action.\n * @slot trailing - Requires a `<button>` for the menu action. Use `popovertarget` to display a menu.\n * @slot - Used to render the trailing button's popover menu.\n * @csspart split-btn - The split button's root element.\n * @csspart leading-btn - The split button's main action.\n * @csspart trailing-btn - The split button's menu action.\n * @cssprop --between-space\n * @cssprop --icon-size\n * @cssprop --inner-corner-size\n * @cssprop --outer-corner-size\n * @cssprop --leading-space\n * @cssprop --trailing-space\n */\nexport class SplitButtonElement extends LitElement {\n static override styles: CSSResultOrNative[] = [\n focusRingStyles,\n rippleStyles,\n buttonStyles,\n splitButtonStyles,\n css`\n :host {\n display: inline-flex;\n }\n .split-btn {\n flex: 1;\n }\n [name='leading'] {\n display: contents;\n &::slotted(button) {\n all: inherit;\n display: flex;\n }\n }\n [name='trailing'] {\n position: relative;\n &::slotted(button) {\n position: absolute;\n inset: 0;\n appearance: none;\n background: none;\n border: none;\n outline: none;\n }\n }\n `,\n ];\n\n @property() color: SplitButtonColor = 'filled';\n @property() size: SplitButtonSize = 'sm';\n @property({type: Boolean}) selected = false;\n\n protected override render() {\n const buttonConfig = {\n color: this.color,\n size: this.size,\n };\n\n return html`<div part=\"split-btn\" class=\"${splitButton(this)}\">\n <slot\n name=\"leading\"\n part=\"leading-btn\"\n class=\"${button(buttonConfig)}\"\n @focusin=${this.updateSlotFocusVisible}\n @focusout=${this.updateSlotFocusVisible}>\n </slot>\n <slot\n name=\"trailing\"\n part=\"trailing-btn\"\n class=\"${button(buttonConfig)}\"\n @focusin=${this.updateSlotFocusVisible}\n @focusout=${this.updateSlotFocusVisible}\n @slotchange=${this.handleTrailingSlotchange}>\n </slot>\n <slot></slot>\n </div>`;\n }\n\n private updateSlotFocusVisible(event: Event) {\n const slot = event.currentTarget as HTMLSlotElement;\n const hasFocusVisible = slot\n .assignedElements()\n .some((el) => el.matches(':focus-visible,:has(:focus-visible)'));\n slot.classList.toggle('focus-visible', hasFocusVisible);\n }\n\n private cleanupToggleListener?: AbortController;\n private handleTrailingSlotchange(event: Event) {\n this.cleanupToggleListener?.abort();\n this.cleanupToggleListener = new AbortController();\n const slot = event.target as HTMLSlotElement;\n const trailingButton = slot\n .assignedElements()\n .find((el): el is HTMLButtonElement => el.matches('button'));\n if (!trailingButton?.popoverTargetElement) return;\n trailingButton.popoverTargetElement.addEventListener(\n 'toggle',\n (event: Event) => {\n this.selected = (event as ToggleEvent).newState === 'open';\n },\n {signal: this.cleanupToggleListener.signal},\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["split-button.scss","_split-button-tokens.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA,GASA,kEACA,4BACE,WCLA,qBDQE,gBCJF,eACA,uBACA,uDACA,mBACA,oBDIE,qCCCF,mDDEI,gDCEJ,sBACA,uBDCI,qDCGJ,sBACA,+DAIA,6FAIA,mDDCE,mBCGF,kBACA,mDDDI,gDCKJ,sBACA,uBDFI,qDCMJ,sBACA,uBDHI,wCCOJ,mDDHI,0CCOJ,mDDFE,mBCMF,kBACA,mDDJI,gDCQJ,sBACA,uBDLI,qDCSJ,sBACA,uBDNI,wCCUJ,mDDNI,0CCUJ,mDDLE,mBCSF,kBACA,mDDPI,gDCWJ,sBACA,uBDRI,qDCYJ,sBACA,uBDTI,wCCaJ,6DDTI,0CCaJ,6DDRE,mBCYF,kBACA,mDDVI,gDCcJ,sBACA,uBDXI,qDCeJ,sBACA,uBDZI,wCCgBJ,6DDZI,0CCgBJ,6DDVI,kFCcJ,uDDPE,WACE,oBACA,mBACA,yBAGF,iCACE,mDACA,iDACA,iDACA,+CAGF,sCACE,mDACA,iDACA,iDACA,+CAEA,8CACE,0BACA,6CACA,aACA,mBACA,eACA,0BACA,gBAIJ,0FAEE,yBACA","file":"split-button.css"}
1
+ {"version":3,"sourceRoot":"","sources":["split-button.scss","_split-button-tokens.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA,GASA,kEACA,4BACE,WCJA,qBDOE,gBCDF,eACA,uBACA,uDACA,mBACA,oBDCE,mBCIF,kBACA,mDDFI,gDCMJ,sBACA,uBDHI,qDCOJ,sBACA,uBDJI,wCCQJ,mDDJI,0CCQJ,mDDHE,mBCOF,kBACA,mDDLI,gDCSJ,sBACA,uBDNI,qDCUJ,sBACA,uBDPI,wCCWJ,mDDPI,0CCWJ,mDDNE,mBCUF,kBACA,mDDRI,gDCYJ,sBACA,uBDTI,qDCaJ,sBACA,uBDVI,wCCcJ,mDDVI,0CCcJ,mDDTE,mBCaF,kBACA,mDDXI,gDCeJ,sBACA,uBDZI,qDCgBJ,sBACA,uBDbI,wCCiBJ,6DDbI,0CCiBJ,6DDZE,mBCgBF,kBACA,mDDdI,gDCkBJ,sBACA,uBDfI,qDCmBJ,sBACA,uBDhBI,wCCoBJ,6DDhBI,0CCoBJ,6DDdI,kFCkBJ,uDDXE,WACE,oBACA,mBACA,yBAGF,iCACE,mDACA,iDACA,iDACA,+CAGF,sCACE,mDACA,iDACA,iDACA,+CAEA,8CACE,0BACA,6CACA,aACA,mBACA,eACA,0BACA,gBAIJ,0FAEE,yBACA","file":"split-button.css"}
@@ -36,12 +36,12 @@ export declare function splitButtonClasses({ selected, }?: SplitButtonClassesSta
36
36
  * <div class="${splitButton()}">
37
37
  * <button class="${button({color: 'filled'})}">Label</button>
38
38
  * <button class="${button({color: 'filled'})}" popovertarget="menu"></button>
39
- * <md-menu id="menu">
40
- * <md-menu-item>Option 1</md-menu-item>
41
- * <md-menu-item>Option 2</md-menu-item>
42
- * </md-menu>
39
+ * <md-gb-menu id="menu">
40
+ * <md-gb-menu-item>Option 1</md-gb-menu-item>
41
+ * <md-gb-menu-item>Option 2</md-gb-menu-item>
42
+ * </md-gb-menu>
43
43
  * </div>
44
44
  * `;
45
45
  * ```
46
46
  */
47
- export declare const splitButton: (state?: SplitButtonClassesState & import("@material/web/labs/gb/components/shared/directives.js").AdditionalClasses) => import("lit-html/directive.js").DirectiveResult;
47
+ export declare const splitButton: (state?: SplitButtonClassesState & import("../shared/directives.js").AdditionalClasses) => import("lit-html/directive.js").DirectiveResult;
@@ -3,7 +3,7 @@
3
3
  * Copyright 2026 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { createClassMapDirective } from '@material/web/labs/gb/components/shared/directives.js';
6
+ import { createClassMapDirective } from '../shared/directives.js';
7
7
  /** Split Button classes. */
8
8
  export const SPLIT_BUTTON_CLASSES = {
9
9
  splitButton: 'split-btn',
@@ -32,10 +32,10 @@ export function splitButtonClasses({ selected = false, } = {}) {
32
32
  * <div class="${splitButton()}">
33
33
  * <button class="${button({color: 'filled'})}">Label</button>
34
34
  * <button class="${button({color: 'filled'})}" popovertarget="menu"></button>
35
- * <md-menu id="menu">
36
- * <md-menu-item>Option 1</md-menu-item>
37
- * <md-menu-item>Option 2</md-menu-item>
38
- * </md-menu>
35
+ * <md-gb-menu id="menu">
36
+ * <md-gb-menu-item>Option 1</md-gb-menu-item>
37
+ * <md-gb-menu-item>Option 2</md-gb-menu-item>
38
+ * </md-gb-menu>
39
39
  * </div>
40
40
  * `;
41
41
  * ```
@@ -1 +1 @@
1
- {"version":3,"file":"split-button.js","sourceRoot":"","sources":["split-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,uBAAuB,EAAC,MAAM,uDAAuD,CAAC;AAS9F,4BAA4B;AAC5B,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EAAE,WAAW;IACxB,mBAAmB,EAAE,oBAAoB;CACjC,CAAC;AAQX;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,QAAQ,GAAG,KAAK,MACW,EAAE;IAC7B,OAAO;QACL,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE,IAAI;QACxC,CAAC,oBAAoB,CAAC,mBAAmB,CAAC,EAAE,QAAQ;KACrD,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,uBAAuB,CAAC;IACjD,UAAU,EAAE,kBAAkB;CAC/B,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {createClassMapDirective} from '@material/web/labs/gb/components/shared/directives.js';\nimport {type ClassInfo} from 'lit/directives/class-map.js';\n\n/** Split Button color configuration types. */\nexport type SplitButtonColor = 'filled' | 'elevated' | 'tonal' | 'outlined';\n\n/** Split Button size configuration types. */\nexport type SplitButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/** Split Button classes. */\nexport const SPLIT_BUTTON_CLASSES = {\n splitButton: 'split-btn',\n splitButtonSelected: 'split-btn-selected',\n} as const;\n\n/** The state provided to the `splitButtonClasses()` function. */\nexport interface SplitButtonClassesState {\n /** Whether the split trailing button is selected. */\n selected?: boolean;\n}\n\n/**\n * Returns the split button classes to apply to an element based on the given\n * state.\n *\n * @param state The state of the split button.\n * @return An object of class names and truthy values if they apply.\n */\nexport function splitButtonClasses({\n selected = false,\n}: SplitButtonClassesState = {}): ClassInfo {\n return {\n [SPLIT_BUTTON_CLASSES.splitButton]: true,\n [SPLIT_BUTTON_CLASSES.splitButtonSelected]: selected,\n };\n}\n\n/**\n * A Lit directive that adds split button styling and functionality to its\n * element.\n *\n * @example\n * ```ts\n * html`\n * <div class=\"${splitButton()}\">\n * <button class=\"${button({color: 'filled'})}\">Label</button>\n * <button class=\"${button({color: 'filled'})}\" popovertarget=\"menu\"></button>\n * <md-menu id=\"menu\">\n * <md-menu-item>Option 1</md-menu-item>\n * <md-menu-item>Option 2</md-menu-item>\n * </md-menu>\n * </div>\n * `;\n * ```\n */\nexport const splitButton = createClassMapDirective({\n getClasses: splitButtonClasses,\n});\n"]}
1
+ {"version":3,"file":"split-button.js","sourceRoot":"","sources":["split-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAC,uBAAuB,EAAC,MAAM,yBAAyB,CAAC;AAQhE,4BAA4B;AAC5B,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EAAE,WAAW;IACxB,mBAAmB,EAAE,oBAAoB;CACjC,CAAC;AAQX;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,QAAQ,GAAG,KAAK,MACW,EAAE;IAC7B,OAAO;QACL,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE,IAAI;QACxC,CAAC,oBAAoB,CAAC,mBAAmB,CAAC,EAAE,QAAQ;KACrD,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,uBAAuB,CAAC;IACjD,UAAU,EAAE,kBAAkB;CAC/B,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {type ClassInfo} from 'lit/directives/class-map.js';\nimport {createClassMapDirective} from '../shared/directives.js';\n\n/** Split Button color configuration types. */\nexport type SplitButtonColor = 'filled' | 'elevated' | 'tonal' | 'outlined';\n\n/** Split Button size configuration types. */\nexport type SplitButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/** Split Button classes. */\nexport const SPLIT_BUTTON_CLASSES = {\n splitButton: 'split-btn',\n splitButtonSelected: 'split-btn-selected',\n} as const;\n\n/** The state provided to the `splitButtonClasses()` function. */\nexport interface SplitButtonClassesState {\n /** Whether the split trailing button is selected. */\n selected?: boolean;\n}\n\n/**\n * Returns the split button classes to apply to an element based on the given\n * state.\n *\n * @param state The state of the split button.\n * @return An object of class names and truthy values if they apply.\n */\nexport function splitButtonClasses({\n selected = false,\n}: SplitButtonClassesState = {}): ClassInfo {\n return {\n [SPLIT_BUTTON_CLASSES.splitButton]: true,\n [SPLIT_BUTTON_CLASSES.splitButtonSelected]: selected,\n };\n}\n\n/**\n * A Lit directive that adds split button styling and functionality to its\n * element.\n *\n * @example\n * ```ts\n * html`\n * <div class=\"${splitButton()}\">\n * <button class=\"${button({color: 'filled'})}\">Label</button>\n * <button class=\"${button({color: 'filled'})}\" popovertarget=\"menu\"></button>\n * <md-gb-menu id=\"menu\">\n * <md-gb-menu-item>Option 1</md-gb-menu-item>\n * <md-gb-menu-item>Option 2</md-gb-menu-item>\n * </md-gb-menu>\n * </div>\n * `;\n * ```\n */\nexport const splitButton = createClassMapDirective({\n getClasses: splitButtonClasses,\n});\n"]}
@@ -4,6 +4,7 @@
4
4
  //
5
5
 
6
6
  @mixin root {
7
+ // LINT.IfChange
7
8
  --handle-color: var(--md-sys-color-outline);
8
9
  --handle-size: 16px;
9
10
  --with-icon-handle-size: 24px;
@@ -16,6 +17,7 @@
16
17
  --track-outline-color: var(--md-sys-color-outline);
17
18
  --track-outline-width: 2px;
18
19
  --track-width: 52px;
20
+ // LINT.ThenChange(md-switch.ts) keep in sync with `@cssprop` jsdoc tags
19
21
  }
20
22
 
21
23
  @mixin hovered {
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { SwitchElement } from './switch-element.js';
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ /** A Material Design component. */
10
+ 'md-gb-switch': SwitchElement;
11
+ }
12
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { SwitchElement } from './switch-element.js';
7
+ customElements.define('md-gb-switch', SwitchElement);
8
+ //# sourceMappingURL=md-gb-switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"md-gb-switch.js","sourceRoot":"","sources":["md-gb-switch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AASlD,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {SwitchElement} from './switch-element.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design component. */\n 'md-gb-switch': SwitchElement;\n }\n}\n\ncustomElements.define('md-gb-switch', SwitchElement);\n"]}
@@ -7,17 +7,29 @@ import { CSSResultOrNative, LitElement } from 'lit';
7
7
  import { createValidator, getValidityAnchor } from '../../../behaviors/constraint-validation.js';
8
8
  import { getFormState, getFormValue } from '../../../behaviors/form-associated.js';
9
9
  import { CheckboxValidator } from '../../../behaviors/validators/checkbox-validator.js';
10
- declare global {
11
- interface HTMLElementTagNameMap {
12
- /** A Material Design switch component. */
13
- 'md-switch': Switch;
14
- }
15
- }
16
10
  declare const baseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<import("@material/web/labs/behaviors/mixin.js").MixinReturn<import("@material/web/labs/behaviors/mixin.js").MixinReturn<(abstract new (...args: any[]) => import("../../../behaviors/custom-state-set.js").WithCustomStateSet) & (abstract new (...args: any[]) => import("../../../behaviors/element-internals.js").WithElementInternals) & typeof LitElement & import("../../../behaviors/form-associated.js").FormAssociatedConstructor, import("../../../behaviors/form-associated.js").FormAssociated>, import("../../../behaviors/constraint-validation.js").ConstraintValidation>>;
17
11
  /**
18
12
  * A Material Design switch component.
13
+ *
14
+ * @slot off-icon - Used to show an icon when the switch is unselected.
15
+ * @slot on-icon - Used to show an icon when the switch is selected.
16
+ * @fires {InputEvent} input - Fired when the switch is selected or unselected. --bubbles --composed
17
+ * @fires {Event} change - Fired when the switch is selected or unselected. --bubbles
18
+ * @csspart switch - The switch's root element.
19
+ * @cssprop --handle-color
20
+ * @cssprop --handle-size
21
+ * @cssprop --with-icon-handle-size
22
+ * @cssprop --icon-color
23
+ * @cssprop --icon-size
24
+ * @cssprop --state-layer-color
25
+ * @cssprop --state-layer-size
26
+ * @cssprop --track-color
27
+ * @cssprop --track-height
28
+ * @cssprop --track-outline-color
29
+ * @cssprop --track-outline-width
30
+ * @cssprop --track-width
19
31
  */
20
- export declare class Switch extends baseClass {
32
+ export declare class SwitchElement extends baseClass {
21
33
  /** @nocollapse */
22
34
  static shadowRootOptions: ShadowRootInit;
23
35
  static styles: CSSResultOrNative[];
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { __decorate } from "tslib";
7
7
  import { css, html, LitElement, nothing } from 'lit';
8
- import { customElement, property, query } from 'lit/decorators.js';
8
+ import { property, query } from 'lit/decorators.js';
9
9
  import { mixinDelegatesAria } from '../../../../internal/aria/delegate.js';
10
10
  import { redispatchEvent } from '../../../../internal/events/redispatch-event.js';
11
11
  import { createValidator, getValidityAnchor, mixinConstraintValidation, } from '../../../behaviors/constraint-validation.js';
@@ -25,8 +25,26 @@ import { switchToggle } from './switch.js';
25
25
  const baseClass = mixinDelegatesAria(mixinConstraintValidation(mixinFormAssociated(mixinCustomStateSet(mixinElementInternals(LitElement)))));
26
26
  /**
27
27
  * A Material Design switch component.
28
+ *
29
+ * @slot off-icon - Used to show an icon when the switch is unselected.
30
+ * @slot on-icon - Used to show an icon when the switch is selected.
31
+ * @fires {InputEvent} input - Fired when the switch is selected or unselected. --bubbles --composed
32
+ * @fires {Event} change - Fired when the switch is selected or unselected. --bubbles
33
+ * @csspart switch - The switch's root element.
34
+ * @cssprop --handle-color
35
+ * @cssprop --handle-size
36
+ * @cssprop --with-icon-handle-size
37
+ * @cssprop --icon-color
38
+ * @cssprop --icon-size
39
+ * @cssprop --state-layer-color
40
+ * @cssprop --state-layer-size
41
+ * @cssprop --track-color
42
+ * @cssprop --track-height
43
+ * @cssprop --track-outline-color
44
+ * @cssprop --track-outline-width
45
+ * @cssprop --track-width
28
46
  */
29
- let Switch = class Switch extends baseClass {
47
+ export class SwitchElement extends baseClass {
30
48
  constructor() {
31
49
  super(...arguments);
32
50
  /**
@@ -121,13 +139,13 @@ let Switch = class Switch extends baseClass {
121
139
  [getValidityAnchor]() {
122
140
  return this.button;
123
141
  }
124
- };
142
+ }
125
143
  /** @nocollapse */
126
- Switch.shadowRootOptions = {
144
+ SwitchElement.shadowRootOptions = {
127
145
  mode: 'open',
128
146
  delegatesFocus: true,
129
147
  };
130
- Switch.styles = [
148
+ SwitchElement.styles = [
131
149
  focusRingStyles,
132
150
  rippleStyles,
133
151
  switchStyles,
@@ -145,18 +163,14 @@ Switch.styles = [
145
163
  ];
146
164
  __decorate([
147
165
  property({ type: Boolean })
148
- ], Switch.prototype, "selected", null);
166
+ ], SwitchElement.prototype, "selected", null);
149
167
  __decorate([
150
168
  property({ type: Boolean })
151
- ], Switch.prototype, "required", void 0);
169
+ ], SwitchElement.prototype, "required", void 0);
152
170
  __decorate([
153
171
  property()
154
- ], Switch.prototype, "value", void 0);
172
+ ], SwitchElement.prototype, "value", void 0);
155
173
  __decorate([
156
174
  query('button', true)
157
- ], Switch.prototype, "button", void 0);
158
- Switch = __decorate([
159
- customElement('md-switch')
160
- ], Switch);
161
- export { Switch };
162
- //# sourceMappingURL=md-switch.js.map
175
+ ], SwitchElement.prototype, "button", void 0);
176
+ //# sourceMappingURL=switch-element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch-element.js","sourceRoot":"","sources":["switch-element.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AACtE,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAC,kBAAkB,EAAC,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAC,eAAe,EAAC,MAAM,iDAAiD,CAAC;AAChF,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,QAAQ,EACR,mBAAmB,EACnB,WAAW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AEQ,iBAAiB;QACxB,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC;IACvC,CAAC;IAEQ,wBAAwB,CAAC,KAAa;QAC7C,IAAI,CAAC,QAAQ,GAAG,KAAK,KAAK,MAAM,CAAC;IACnC,CAAC;IAEQ,CAAC,eAAe,CAAC;QACxB,OAAO,IAAI,iBAAiB,CAAC,GAAG,EAAE,CAAC,CAAC;YAClC,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC,CAAC;IACN,CAAC;IAEQ,CAAC,iBAAiB,CAAC;QAC1B,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;;AAvID,kBAAkB;AACF,+BAAiB,GAAmB;IAClD,IAAI,EAAE,MAAM;IACZ,cAAc,EAAE,IAAI;CACrB,AAHgC,CAG/B;AAEc,oBAAM,GAAwB;IAC5C,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,GAAG,CAAA;;;;;;;;;;KAUF;CACF,AAfqB,CAepB;AAOF;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;6CAGzB;AAqB0B;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;+CAAkB;AAMhC;IAAX,QAAQ,EAAE;4CAAc;AAGR;IADhB,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;6CAC6B","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {css, CSSResultOrNative, html, LitElement, nothing} from 'lit';\nimport {property, query} from 'lit/decorators.js';\nimport {ARIAMixinStrict} from '../../../../internal/aria/aria.js';\nimport {mixinDelegatesAria} from '../../../../internal/aria/delegate.js';\nimport {redispatchEvent} from '../../../../internal/events/redispatch-event.js';\nimport {\n createValidator,\n getValidityAnchor,\n mixinConstraintValidation,\n} from '../../../behaviors/constraint-validation.js';\nimport {\n hasState,\n mixinCustomStateSet,\n toggleState,\n} from '../../../behaviors/custom-state-set.js';\nimport {mixinElementInternals} from '../../../behaviors/element-internals.js';\nimport {\n getFormState,\n getFormValue,\n mixinFormAssociated,\n} from '../../../behaviors/form-associated.js';\nimport {CheckboxValidator} from '../../../behaviors/validators/checkbox-validator.js';\nimport {hasSlotted} from '../shared/has-slotted.js';\n\nimport focusRingStyles from '../focus/focus-ring.css' with {type: 'css'}; // github-only\n// import focusRingStyles from '../focus/focus-ring.cssresult.js'; // google3-only\nimport rippleStyles from '../ripple/ripple.css' with {type: 'css'}; // github-only\n// import rippleStyles from '../ripple/ripple.cssresult.js'; // google3-only\nimport switchStyles from './switch.css' with {type: 'css'}; // github-only\n// import switchStyles from './switch.cssresult.js'; // google3-only\n\nimport {switchToggle} from './switch.js';\n\n// Separate variable needed for closure.\nconst baseClass = mixinDelegatesAria(\n mixinConstraintValidation(\n mixinFormAssociated(mixinCustomStateSet(mixinElementInternals(LitElement))),\n ),\n);\n\n/**\n * A Material Design switch component.\n *\n * @slot off-icon - Used to show an icon when the switch is unselected.\n * @slot on-icon - Used to show an icon when the switch is selected.\n * @fires {InputEvent} input - Fired when the switch is selected or unselected. --bubbles --composed\n * @fires {Event} change - Fired when the switch is selected or unselected. --bubbles\n * @csspart switch - The switch's root element.\n * @cssprop --handle-color\n * @cssprop --handle-size\n * @cssprop --with-icon-handle-size\n * @cssprop --icon-color\n * @cssprop --icon-size\n * @cssprop --state-layer-color\n * @cssprop --state-layer-size\n * @cssprop --track-color\n * @cssprop --track-height\n * @cssprop --track-outline-color\n * @cssprop --track-outline-width\n * @cssprop --track-width\n */\nexport class SwitchElement extends baseClass {\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n static override styles: CSSResultOrNative[] = [\n focusRingStyles,\n rippleStyles,\n switchStyles,\n css`\n :host {\n display: inline-flex;\n }\n .switch {\n flex: 1;\n }\n ::slotted(*) {\n grid-area: handle;\n }\n `,\n ];\n\n /**\n * Puts the switch in the selected state and sets the form submission value to\n * the `value` property.\n */\n @property({type: Boolean})\n get selected() {\n return this[hasState]('selected');\n }\n set selected(value: boolean) {\n this[toggleState]('selected', value);\n }\n\n /**\n * The default selected state of the switch.\n */\n get defaultSelected(): boolean {\n return this.hasAttribute('selected');\n }\n set defaultSelected(value: boolean) {\n this.toggleAttribute('selected', value || false);\n }\n\n /**\n * When true, require the switch to be selected when participating in\n * form submission.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#validation\n */\n @property({type: Boolean}) required = false;\n\n /**\n * The value associated with this switch on form submission. `null` is\n * submitted when `selected` is `false`.\n */\n @property() value = 'on';\n\n @query('button', true)\n private readonly button!: HTMLButtonElement | null;\n\n /**\n * Mimics the behavior of <input> dirty checkedness, where the `checked`\n * attribute only updates the checked state if the checkbox has not been\n * interacted with.\n *\n * @see https://html.spec.whatwg.org/multipage/input.html#concept-input-checked-dirty-flag\n */\n private dirtyCheckedness = false;\n\n protected override render() {\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`\n <button\n role=\"switch\"\n part=\"switch\"\n class=\"${switchToggle()}\"\n aria-checked=\"${this.selected ? 'true' : 'false'}\"\n aria-label=${ariaLabel || nothing}\n ?disabled=${this.disabled}\n @change=${this.handleChange}>\n <slot name=\"off-icon\" class=\"switch-icon-off\" ${hasSlotted()}></slot>\n <slot name=\"on-icon\" class=\"switch-icon-on\"></slot>\n </button>\n `;\n }\n\n private handleChange(event: Event) {\n this.dirtyCheckedness = true;\n this.selected = this.button?.ariaChecked === 'true';\n // Change event is not composed, re-dispatch it.\n redispatchEvent(this, event);\n }\n\n override attributeChangedCallback(\n name: string,\n oldValue: string | null,\n newValue: string | null,\n ) {\n if (name === 'selected' && this.dirtyCheckedness) {\n // The 'selected' attribute does not update switches that have been\n // interacted with.\n return;\n }\n\n super.attributeChangedCallback(name, oldValue, newValue);\n }\n\n override [getFormValue]() {\n return this.selected ? this.value : null;\n }\n\n override [getFormState]() {\n return String(this.selected);\n }\n\n override formResetCallback() {\n this.dirtyCheckedness = false;\n this.selected = this.defaultSelected;\n }\n\n override formStateRestoreCallback(state: string) {\n this.selected = state === 'true';\n }\n\n override [createValidator]() {\n return new CheckboxValidator(() => ({\n checked: this.selected,\n required: this.required,\n }));\n }\n\n override [getValidityAnchor]() {\n return this.button;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["switch.scss","_switch-tokens.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA,GASA,kDACA,sBAEI,QCNF,4CACA,oBACA,8BACA,4DACA,kBACA,oDACA,yBACA,6DACA,qBACA,mDACA,2BACA,oBDFE,0BCMF,uDDHE,kDCOF,2CACA,mCACA,+CACA,oBACA,uDACA,iDDVI,uECcJ,sDDVE,6DCcF,oBDXE,gCCeF,qEACA,qFAGA,8EDjBI,6ECuBJ,4CACA,mEACA,oEDpBE,QACE,oBACA,mDACA,mBACA,gBACA,8BACA,mEACA,0CACA,yBACA,2BACA,SACA,UACA,mEACA,kBACA,kBACA,wBACA,iCACA,WAEA,kDACE,0CAGF,gBACE,0HAIA,oBACA,6CACA,aACA,mBACA,WACA,iBACA,eACA,YACA,gDACA,uDACA,kBACA,+BAGF,eACE,WACA,WACA,kBACA,iBACA,+BACA,eACA,8BACA,kBACA,+BACA,oCACA,kCAIJ,qEACE,YAKA,8IAEE,iBAIJ,sIAEE","file":"switch.css"}
1
+ {"version":3,"sourceRoot":"","sources":["switch.scss","_switch-tokens.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA,GASA,kDACA,sBAEI,QCLF,4CACA,oBACA,8BACA,4DACA,kBACA,oDACA,yBACA,6DACA,qBACA,mDACA,2BACA,oBDHE,0BCQF,uDDLE,kDCSF,2CACA,mCACA,+CACA,oBACA,uDACA,iDDZI,uECgBJ,sDDZE,6DCgBF,oBDbE,gCCiBF,qEACA,qFAGA,8EDnBI,6ECyBJ,4CACA,mEACA,oEDtBE,QACE,oBACA,mDACA,mBACA,gBACA,8BACA,mEACA,0CACA,yBACA,2BACA,SACA,UACA,mEACA,kBACA,kBACA,wBACA,iCACA,WAEA,kDACE,0CAGF,gBACE,0HAIA,oBACA,6CACA,aACA,mBACA,WACA,iBACA,eACA,YACA,gDACA,uDACA,kBACA,+BAGF,eACE,WACA,WACA,kBACA,iBACA,+BACA,eACA,8BACA,kBACA,+BACA,oCACA,kCAIJ,qEACE,YAKA,8IAEE,iBAIJ,sIAEE","file":"switch.css"}
@@ -37,9 +37,7 @@ export function adoptStyles(owner, styles) {
37
37
  if (!owner)
38
38
  return;
39
39
  styles = Array.isArray(styles) ? styles : [styles];
40
- const stylesheets = styles.map((cssResultOrNative) => isCSSResult(cssResultOrNative)
41
- ? cssResultOrNative.styleSheet
42
- : cssResultOrNative);
40
+ const stylesheets = styles.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
43
41
  if (adopt(owner, stylesheets)) {
44
42
  // Styles adopted directly on the owner document or shadow root.
45
43
  return;
@@ -51,12 +49,14 @@ export function adoptStyles(owner, styles) {
51
49
  }
52
50
  function adopt(node, stylesheets) {
53
51
  if (node && 'adoptedStyleSheets' in node) {
54
- node.adoptedStyleSheets = Array.from(new Set([...node.adoptedStyleSheets, ...stylesheets]));
52
+ const unadopted = stylesheets.filter((stylesheet) => !node.adoptedStyleSheets.includes(stylesheet));
53
+ if (!unadopted.length) {
54
+ // All styles are already adopted.
55
+ return true;
56
+ }
57
+ node.adoptedStyleSheets = Array.from(new Set([...node.adoptedStyleSheets, ...unadopted]));
55
58
  return true;
56
59
  }
57
60
  return false;
58
61
  }
59
- function isCSSResult(style) {
60
- return 'styleSheet' in style;
61
- }
62
62
  //# sourceMappingURL=adopt-styles.js.map