@material/web 0.1.0-alpha.2 → 1.0.0-pre.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/autocomplete/lib/_filled-autocomplete.scss +3 -4
  2. package/autocomplete/lib/_outlined-autocomplete.scss +3 -3
  3. package/autocomplete/lib/_shared.scss +2 -7
  4. package/autocomplete/lib/filled-styles.css.js +1 -1
  5. package/autocomplete/lib/filled-styles.css.js.map +1 -1
  6. package/autocomplete/lib/outlined-styles.css.js +1 -1
  7. package/autocomplete/lib/outlined-styles.css.js.map +1 -1
  8. package/button/lib/_elevated-button.scss +6 -0
  9. package/button/lib/_elevation.scss +30 -28
  10. package/button/lib/_filled-button.scss +6 -0
  11. package/button/lib/_icon.scss +5 -12
  12. package/button/lib/_outlined-button.scss +10 -1
  13. package/button/lib/_shared.scss +16 -6
  14. package/button/lib/_text-button.scss +6 -0
  15. package/button/lib/_tonal-button.scss +6 -0
  16. package/button/lib/button.d.ts +1 -11
  17. package/button/lib/button.js +5 -30
  18. package/button/lib/button.js.map +1 -1
  19. package/button/lib/elevated-styles.css.js +1 -1
  20. package/button/lib/elevated-styles.css.js.map +1 -1
  21. package/button/lib/filled-styles.css.js +1 -1
  22. package/button/lib/filled-styles.css.js.map +1 -1
  23. package/button/lib/outlined-styles.css.js +1 -1
  24. package/button/lib/outlined-styles.css.js.map +1 -1
  25. package/button/lib/shared-elevation-styles.css.js +1 -1
  26. package/button/lib/shared-elevation-styles.css.js.map +1 -1
  27. package/button/lib/shared-styles.css.js +1 -1
  28. package/button/lib/shared-styles.css.js.map +1 -1
  29. package/button/lib/text-styles.css.js +1 -1
  30. package/button/lib/text-styles.css.js.map +1 -1
  31. package/button/lib/tonal-styles.css.js +1 -1
  32. package/button/lib/tonal-styles.css.js.map +1 -1
  33. package/checkbox/lib/_checkbox.scss +4 -0
  34. package/checkbox/lib/checkbox-styles.css.js +1 -1
  35. package/checkbox/lib/checkbox-styles.css.js.map +1 -1
  36. package/chips/chip/lib/_chip-theme.scss +19 -23
  37. package/chips/chip/lib/_chip.scss +0 -2
  38. package/chips/chip/lib/_input-chip-theme.scss +16 -26
  39. package/chips/chip/lib/chip.d.ts +1 -0
  40. package/chips/chip/lib/chip.js +2 -1
  41. package/chips/chip/lib/chip.js.map +1 -1
  42. package/fab/fab-extended.js +1 -2
  43. package/fab/fab-extended.js.map +1 -1
  44. package/fab/fab.js +1 -2
  45. package/fab/fab.js.map +1 -1
  46. package/fab/lib/_shared.scss +11 -9
  47. package/fab/lib/fab-shared-styles.css.js +1 -1
  48. package/fab/lib/fab-shared-styles.css.js.map +1 -1
  49. package/field/lib/filled-styles.css.js +1 -1
  50. package/field/lib/filled-styles.css.js.map +1 -1
  51. package/icon/lib/_icon.scss +8 -5
  52. package/icon/lib/icon-styles.css.js +1 -1
  53. package/icon/lib/icon-styles.css.js.map +1 -1
  54. package/iconbutton/lib/_filled-icon-button.scss +14 -0
  55. package/iconbutton/lib/_filled-tonal-icon-button.scss +14 -0
  56. package/iconbutton/lib/_outlined-icon-button.scss +16 -17
  57. package/iconbutton/lib/_shared.scss +29 -16
  58. package/iconbutton/lib/_standard-icon-button.scss +16 -0
  59. package/iconbutton/lib/filled-styles.css.js +1 -1
  60. package/iconbutton/lib/filled-styles.css.js.map +1 -1
  61. package/iconbutton/lib/filled-tonal-styles.css.js +1 -1
  62. package/iconbutton/lib/filled-tonal-styles.css.js.map +1 -1
  63. package/iconbutton/lib/icon-button-toggle.js +1 -1
  64. package/iconbutton/lib/icon-button-toggle.js.map +1 -1
  65. package/iconbutton/lib/icon-button.js +1 -1
  66. package/iconbutton/lib/icon-button.js.map +1 -1
  67. package/iconbutton/lib/outlined-styles.css.js +1 -1
  68. package/iconbutton/lib/outlined-styles.css.js.map +1 -1
  69. package/iconbutton/lib/shared-styles.css.js +1 -1
  70. package/iconbutton/lib/shared-styles.css.js.map +1 -1
  71. package/iconbutton/lib/standard-styles.css.js +1 -1
  72. package/iconbutton/lib/standard-styles.css.js.map +1 -1
  73. package/list/lib/_list.scss +20 -14
  74. package/list/lib/divider/list-divider.js +2 -0
  75. package/list/lib/divider/list-divider.js.map +1 -1
  76. package/list/lib/list-styles.css.js +1 -1
  77. package/list/lib/list-styles.css.js.map +1 -1
  78. package/list/lib/list.d.ts +1 -0
  79. package/list/lib/list.js +4 -1
  80. package/list/lib/list.js.map +1 -1
  81. package/list/lib/listitem/list-item.js +2 -0
  82. package/list/lib/listitem/list-item.js.map +1 -1
  83. package/menu/lib/_menu.scss +7 -10
  84. package/menu/lib/menu-styles.css.js +1 -1
  85. package/menu/lib/menu-styles.css.js.map +1 -1
  86. package/menusurface/lib/_md-comp-menu-surface.scss +6 -14
  87. package/menusurface/lib/_menu-surface.scss +8 -4
  88. package/menusurface/lib/menu-surface-styles.css.js +1 -1
  89. package/menusurface/lib/menu-surface-styles.css.js.map +1 -1
  90. package/menusurface/lib/menu-surface.d.ts +1 -0
  91. package/menusurface/lib/menu-surface.js +2 -0
  92. package/menusurface/lib/menu-surface.js.map +1 -1
  93. package/navigationdrawer/lib/_navigation-drawer-modal.scss +7 -22
  94. package/navigationdrawer/lib/_navigation-drawer.scss +15 -18
  95. package/navigationdrawer/lib/_shared.scss +2 -7
  96. package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js +1 -1
  97. package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js.map +1 -1
  98. package/navigationdrawer/lib/navigation-drawer-styles.css.js +1 -1
  99. package/navigationdrawer/lib/navigation-drawer-styles.css.js.map +1 -1
  100. package/navigationdrawer/lib/navigation-drawer.d.ts +1 -0
  101. package/navigationdrawer/lib/navigation-drawer.js +3 -2
  102. package/navigationdrawer/lib/navigation-drawer.js.map +1 -1
  103. package/package.json +8 -1
  104. package/radio/_radio.scss +6 -1
  105. package/radio/lib/_radio.scss +127 -91
  106. package/{elevationold/lib/elevation-overlay-styles.css.d.ts → radio/lib/forced-colors-styles.css.d.ts} +0 -0
  107. package/radio/lib/forced-colors-styles.css.js +9 -0
  108. package/radio/lib/forced-colors-styles.css.js.map +1 -0
  109. package/radio/lib/forced-colors-styles.scss +27 -0
  110. package/radio/lib/radio-styles.css.js +1 -1
  111. package/radio/lib/radio-styles.css.js.map +1 -1
  112. package/radio/lib/radio-styles.scss +1 -7
  113. package/radio/lib/radio.d.ts +6 -44
  114. package/radio/lib/radio.js +42 -144
  115. package/radio/lib/radio.js.map +1 -1
  116. package/radio/lib/single-selection-controller.d.ts +51 -138
  117. package/radio/lib/single-selection-controller.js +153 -249
  118. package/radio/lib/single-selection-controller.js.map +1 -1
  119. package/radio/radio.js +2 -1
  120. package/radio/radio.js.map +1 -1
  121. package/textfield/lib/_shared.scss +1 -0
  122. package/textfield/lib/filled-styles.css.js +1 -1
  123. package/textfield/lib/filled-styles.css.js.map +1 -1
  124. package/textfield/lib/shared-styles.css.js +1 -1
  125. package/textfield/lib/shared-styles.css.js.map +1 -1
  126. package/textfield/lib/text-field.js +3 -0
  127. package/textfield/lib/text-field.js.map +1 -1
  128. package/tokens/_index.scss +1 -1
  129. package/tokens/{v0_144 → v0_150}/_index.scss +0 -0
  130. package/tokens/{v0_144 → v0_150}/_md-comp-assist-chip.scss +1 -1
  131. package/tokens/{v0_144 → v0_150}/_md-comp-badge.scss +1 -1
  132. package/tokens/{v0_144 → v0_150}/_md-comp-banner.scss +1 -1
  133. package/tokens/{v0_144 → v0_150}/_md-comp-bottom-app-bar.scss +1 -1
  134. package/tokens/{v0_144 → v0_150}/_md-comp-carousel-item.scss +1 -1
  135. package/tokens/{v0_144 → v0_150}/_md-comp-checkbox.scss +1 -1
  136. package/tokens/{v0_144 → v0_150}/_md-comp-circular-progress-indicator.scss +1 -1
  137. package/tokens/{v0_144 → v0_150}/_md-comp-data-table.scss +1 -1
  138. package/tokens/{v0_144 → v0_150}/_md-comp-date-input-modal.scss +1 -1
  139. package/tokens/{v0_144 → v0_150}/_md-comp-date-picker-docked.scss +1 -1
  140. package/tokens/{v0_144 → v0_150}/_md-comp-date-picker-modal.scss +1 -1
  141. package/tokens/{v0_144 → v0_150}/_md-comp-dialog.scss +1 -1
  142. package/tokens/{v0_144 → v0_150}/_md-comp-divider.scss +1 -1
  143. package/tokens/{v0_144 → v0_150}/_md-comp-elevated-button.scss +1 -1
  144. package/tokens/{v0_144 → v0_150}/_md-comp-elevated-card.scss +1 -1
  145. package/tokens/{v0_144 → v0_150}/_md-comp-extended-fab-branded.scss +1 -1
  146. package/tokens/{v0_144 → v0_150}/_md-comp-extended-fab-primary.scss +1 -1
  147. package/tokens/{v0_144 → v0_150}/_md-comp-extended-fab-secondary.scss +1 -1
  148. package/tokens/{v0_144 → v0_150}/_md-comp-extended-fab-surface.scss +1 -1
  149. package/tokens/{v0_144 → v0_150}/_md-comp-extended-fab-tertiary.scss +1 -1
  150. package/tokens/{v0_144 → v0_150}/_md-comp-fab-branded-large.scss +1 -1
  151. package/tokens/{v0_144 → v0_150}/_md-comp-fab-branded.scss +1 -1
  152. package/tokens/{v0_144 → v0_150}/_md-comp-fab-primary-large.scss +1 -1
  153. package/tokens/{v0_144 → v0_150}/_md-comp-fab-primary-small.scss +1 -1
  154. package/tokens/{v0_144 → v0_150}/_md-comp-fab-primary.scss +1 -1
  155. package/tokens/{v0_144 → v0_150}/_md-comp-fab-secondary-large.scss +1 -1
  156. package/tokens/{v0_144 → v0_150}/_md-comp-fab-secondary-small.scss +1 -1
  157. package/tokens/{v0_144 → v0_150}/_md-comp-fab-secondary.scss +1 -1
  158. package/tokens/{v0_144 → v0_150}/_md-comp-fab-surface-large.scss +1 -1
  159. package/tokens/{v0_144 → v0_150}/_md-comp-fab-surface-small.scss +1 -1
  160. package/tokens/{v0_144 → v0_150}/_md-comp-fab-surface.scss +1 -1
  161. package/tokens/{v0_144 → v0_150}/_md-comp-fab-tertiary-large.scss +1 -1
  162. package/tokens/{v0_144 → v0_150}/_md-comp-fab-tertiary-small.scss +1 -1
  163. package/tokens/{v0_144 → v0_150}/_md-comp-fab-tertiary.scss +1 -1
  164. package/tokens/{v0_144 → v0_150}/_md-comp-filled-autocomplete.scss +1 -1
  165. package/tokens/{v0_144 → v0_150}/_md-comp-filled-button.scss +1 -1
  166. package/tokens/{v0_144 → v0_150}/_md-comp-filled-card.scss +1 -1
  167. package/tokens/{v0_144 → v0_150}/_md-comp-filled-icon-button.scss +1 -1
  168. package/tokens/{v0_144 → v0_150}/_md-comp-filled-menu-button.scss +1 -1
  169. package/tokens/{v0_144 → v0_150}/_md-comp-filled-select.scss +1 -1
  170. package/tokens/{v0_144 → v0_150}/_md-comp-filled-text-field.scss +2 -2
  171. package/tokens/{v0_144 → v0_150}/_md-comp-filled-tonal-button.scss +1 -1
  172. package/tokens/{v0_144 → v0_150}/_md-comp-filled-tonal-icon-button.scss +1 -1
  173. package/tokens/{v0_144 → v0_150}/_md-comp-filter-chip.scss +2 -1
  174. package/tokens/{v0_144 → v0_150}/_md-comp-full-screen-dialog.scss +1 -1
  175. package/tokens/{v0_144 → v0_150}/_md-comp-icon-button.scss +1 -1
  176. package/tokens/{v0_144 → v0_150}/_md-comp-input-chip.scss +1 -1
  177. package/tokens/{v0_144 → v0_150}/_md-comp-linear-progress-indicator.scss +1 -1
  178. package/tokens/{v0_144 → v0_150}/_md-comp-list.scss +1 -1
  179. package/tokens/{v0_144 → v0_150}/_md-comp-menu.scss +1 -1
  180. package/tokens/{v0_144 → v0_150}/_md-comp-navigation-bar.scss +1 -1
  181. package/tokens/{v0_144 → v0_150}/_md-comp-navigation-drawer.scss +1 -1
  182. package/tokens/{v0_144 → v0_150}/_md-comp-navigation-rail.scss +1 -1
  183. package/tokens/{v0_144 → v0_150}/_md-comp-outlined-autocomplete.scss +1 -1
  184. package/tokens/{v0_144 → v0_150}/_md-comp-outlined-button.scss +1 -1
  185. package/tokens/{v0_144 → v0_150}/_md-comp-outlined-card.scss +5 -5
  186. package/tokens/{v0_144 → v0_150}/_md-comp-outlined-icon-button.scss +1 -1
  187. package/tokens/{v0_144 → v0_150}/_md-comp-outlined-menu-button.scss +1 -1
  188. package/tokens/{v0_144 → v0_150}/_md-comp-outlined-segmented-button.scss +1 -1
  189. package/tokens/{v0_144 → v0_150}/_md-comp-outlined-select.scss +1 -1
  190. package/tokens/{v0_144 → v0_150}/_md-comp-outlined-text-field.scss +1 -1
  191. package/tokens/{v0_144 → v0_150}/_md-comp-plain-tooltip.scss +2 -2
  192. package/tokens/{v0_144 → v0_150}/_md-comp-primary-navigation-tab.scss +1 -1
  193. package/tokens/{v0_144 → v0_150}/_md-comp-radio-button.scss +1 -1
  194. package/tokens/{v0_144 → v0_150}/_md-comp-rich-tooltip.scss +1 -1
  195. package/tokens/{v0_144 → v0_150}/_md-comp-scrim.scss +1 -1
  196. package/tokens/{v0_144 → v0_150}/_md-comp-search-bar.scss +1 -1
  197. package/tokens/{v0_144 → v0_150}/_md-comp-search-view.scss +1 -1
  198. package/tokens/{v0_144 → v0_150}/_md-comp-secondary-navigation-tab.scss +1 -1
  199. package/tokens/{v0_144 → v0_150}/_md-comp-sheet-bottom.scss +1 -1
  200. package/tokens/{v0_144 → v0_150}/_md-comp-sheet-floating.scss +1 -1
  201. package/tokens/{v0_144 → v0_150}/_md-comp-sheet-side.scss +1 -1
  202. package/tokens/{v0_144 → v0_150}/_md-comp-slider.scss +1 -1
  203. package/tokens/{v0_144 → v0_150}/_md-comp-snackbar.scss +25 -1
  204. package/tokens/{v0_144 → v0_150}/_md-comp-standard-menu-button.scss +1 -1
  205. package/tokens/{v0_144 → v0_150}/_md-comp-suggestion-chip.scss +6 -6
  206. package/tokens/{v0_144 → v0_150}/_md-comp-switch.scss +1 -1
  207. package/tokens/{v0_144 → v0_150}/_md-comp-text-button.scss +1 -1
  208. package/tokens/{v0_144 → v0_150}/_md-comp-time-input.scss +1 -1
  209. package/tokens/{v0_144 → v0_150}/_md-comp-time-picker.scss +2 -2
  210. package/tokens/{v0_144 → v0_150}/_md-comp-top-app-bar-large.scss +1 -1
  211. package/tokens/{v0_144 → v0_150}/_md-comp-top-app-bar-medium.scss +1 -1
  212. package/tokens/{v0_144 → v0_150}/_md-comp-top-app-bar-small-centered.scss +1 -1
  213. package/tokens/{v0_144 → v0_150}/_md-comp-top-app-bar-small.scss +1 -1
  214. package/tokens/{v0_144 → v0_150}/_md-ref-palette.scss +1 -1
  215. package/tokens/{v0_144 → v0_150}/_md-ref-typeface.scss +1 -1
  216. package/tokens/{v0_144 → v0_150}/_md-sys-color.scss +1 -1
  217. package/tokens/{v0_144 → v0_150}/_md-sys-elevation.scss +1 -1
  218. package/tokens/{v0_144 → v0_150}/_md-sys-motion.scss +1 -1
  219. package/tokens/{v0_144 → v0_150}/_md-sys-shape.scss +1 -1
  220. package/tokens/{v0_144 → v0_150}/_md-sys-state.scss +1 -1
  221. package/tokens/{v0_144 → v0_150}/_md-sys-typescale.scss +1 -1
  222. package/tokens/v0_150/index.test.css.d.ts +1 -0
  223. package/tokens/v0_150/index.test.css.js +9 -0
  224. package/tokens/v0_150/index.test.css.js.map +1 -0
  225. package/tokens/v0_150/index.test.scss +584 -0
  226. package/tokens/v0_150/lib.test.css.d.ts +1 -0
  227. package/tokens/v0_150/lib.test.css.js +9 -0
  228. package/tokens/v0_150/lib.test.css.js.map +1 -0
  229. package/tokens/v0_150/lib.test.scss +663 -0
  230. package/elevationold/lib/_elevation-overlay-theme.scss +0 -31
  231. package/elevationold/lib/_elevation-overlay.scss +0 -18
  232. package/elevationold/lib/_elevation-theme.scss +0 -74
  233. package/elevationold/lib/_surface.scss +0 -15
  234. package/elevationold/lib/elevation-overlay-styles.css.js +0 -9
  235. package/elevationold/lib/elevation-overlay-styles.css.js.map +0 -1
  236. package/elevationold/lib/elevation-overlay-styles.scss +0 -9
  237. package/radio/lib/_radio-theme.scss +0 -377
@@ -1,289 +1,193 @@
1
1
  /**
2
2
  * @license
3
- * Copyright 2020 Google LLC
3
+ * Copyright 2022 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- // Style preference for leading underscores.
7
- // tslint:disable:strip-private-property-underscore
8
6
  /**
9
- * Unique symbol for marking roots
10
- */
11
- const selectionController = Symbol('selection controller');
12
- /**
13
- * Set of checkable elements with added metadata
14
- */
15
- export class SingleSelectionSet {
16
- constructor() {
17
- this.selected = null;
18
- this.ordered = null;
19
- this.set = new Set();
20
- }
21
- }
22
- /**
23
- * Controller that provides behavior similar to a native `<input type="radio">`
24
- * group.
25
- *
26
- * Behaviors:
27
- *
28
- * - Selection via key navigation (currently LTR is supported)
29
- * - Deselection of other grouped, checkable controls upon selection
30
- * - Grouping of checkable elements by name
31
- * - Defaults grouping scope to host shadow root
32
- * - Document-wide scoping enabled
33
- * - Land focus only on checked element. Focuses leading element when none
34
- * checked.
7
+ * A `ReactiveController` that provides root node-scoped single selection for
8
+ * elements, similar to native `<input type="radio">` selection.
35
9
  *
36
- * Intended Usage:
10
+ * To use, elements should add the controller and call
11
+ * `selectionController.handleCheckedChange()` in a getter/setter. This must
12
+ * be synchronous to match native behavior.
37
13
  *
38
- * ```ts
39
- * class MyElement extends HTMLElement {
40
- * private selectionController: SingleSelectionController | null = null;
41
- * name = "";
42
- * global = false;
14
+ * @example
15
+ * const CHECKED = Symbol('checked');
43
16
  *
44
- * private _checked = false;
17
+ * class MyToggle extends LitElement {
18
+ * get checked() { return this[CHECKED]; }
45
19
  * set checked(checked: boolean) {
46
- * const oldVal = this._checked;
47
- * if (checked === oldVal) return;
48
- *
49
- * this._checked = checked;
50
- *
51
- * if (this.selectionController) {
52
- * this.selectionController.update(this)
20
+ * const oldValue = this.checked;
21
+ * if (oldValue === checked) {
22
+ * return;
53
23
  * }
54
- * }
55
24
  *
56
- * get checked() {
57
- * return this._checked;
25
+ * this[CHECKED] = checked;
26
+ * this.selectionController.handleCheckedChange();
27
+ * this.requestUpdate('checked', oldValue);
58
28
  * }
59
29
  *
60
- * connectedCallback() {
61
- * this.selectionController = SelectionController.getController(this);
62
- * this.selectionController.register(this);
63
- * this.selectionController.update(this);
64
- * }
30
+ * [CHECKED] = false;
65
31
  *
66
- * disconnectedCallback() {
67
- * this.selectionController!.unregister(this);
68
- * this.selectionController = null;
32
+ * private selectionController = new SingleSelectionController(this);
33
+ *
34
+ * constructor() {
35
+ * super();
36
+ * this.addController(this.selectionController);
69
37
  * }
70
38
  * }
71
- * ```
72
39
  */
73
40
  export class SingleSelectionController {
74
- constructor(element) {
75
- this.sets = {};
76
- this.focusedSet = null;
77
- this.mouseIsDown = false;
78
- element.addEventListener('keydown', (e) => {
79
- this.keyDownHandler(e);
80
- });
81
- element.addEventListener('mousedown', () => {
82
- this.mousedownHandler();
83
- });
84
- element.addEventListener('mouseup', () => {
85
- this.mouseupHandler();
86
- });
87
- }
88
- /**
89
- * Get a controller for the given element. If no controller exists, one will
90
- * be created. Defaults to getting the controller scoped to the element's root
91
- * node shadow root unless `element.global` is true. Then, it will get a
92
- * `window.document`-scoped controller.
93
- *
94
- * @param element Element from which to get / create a SelectionController. If
95
- * `element.global` is true, it gets a selection controller scoped to
96
- * `window.document`.
97
- */
98
- static getController(element) {
99
- const useGlobal = !('global' in element) || ('global' in element && element.global);
100
- const root = useGlobal ? document :
101
- element.getRootNode();
102
- let controller = root[selectionController];
103
- if (controller === undefined) {
104
- controller = new SingleSelectionController(root);
105
- root[selectionController] = controller;
106
- }
107
- return controller;
108
- }
109
- keyDownHandler(e) {
110
- const element = e.target;
111
- if (!('checked' in element)) {
112
- return;
113
- }
114
- if (!this.has(element)) {
115
- return;
116
- }
117
- if (e.key == 'ArrowRight' || e.key == 'ArrowDown') {
118
- this.selectNext(element);
119
- }
120
- else if (e.key == 'ArrowLeft' || e.key == 'ArrowUp') {
121
- this.selectPrevious(element);
41
+ constructor(host) {
42
+ this.host = host;
43
+ this.focused = false;
44
+ this.root = null;
45
+ this.handleFocusIn = () => {
46
+ this.focused = true;
47
+ this.updateTabIndices();
48
+ };
49
+ this.handleFocusOut = () => {
50
+ this.focused = false;
51
+ this.updateTabIndices();
52
+ };
53
+ /**
54
+ * Handles arrow key events from the host. Using the arrow keys will
55
+ * select and check the next or previous sibling with the host's
56
+ * `name` attribute.
57
+ */
58
+ this.handleKeyDown = (event) => {
59
+ const isDown = event.key === 'ArrowDown';
60
+ const isUp = event.key === 'ArrowUp';
61
+ const isLeft = event.key === 'ArrowLeft';
62
+ const isRight = event.key === 'ArrowRight';
63
+ // Ignore non-arrow keys
64
+ if (!isLeft && !isRight && !isDown && !isUp) {
65
+ return;
66
+ }
67
+ // Don't try to select another sibling if there aren't any.
68
+ const siblings = this.getNamedSiblings();
69
+ if (!siblings.length) {
70
+ return;
71
+ }
72
+ // Prevent default interactions on the element for arrow keys,
73
+ // since this controller will introduce new behavior.
74
+ event.preventDefault();
75
+ // Check if moving forwards or backwards
76
+ const isRtl = getComputedStyle(this.host).direction === 'rtl';
77
+ const forwards = isRtl ? isLeft || isDown : isRight || isDown;
78
+ const hostIndex = siblings.indexOf(this.host);
79
+ let nextIndex = forwards ? hostIndex + 1 : hostIndex - 1;
80
+ // Search for the next sibling that is not disabled to select.
81
+ // If we return to the host index, there is nothing to select.
82
+ while (nextIndex !== hostIndex) {
83
+ if (nextIndex >= siblings.length) {
84
+ // Return to start if moving past the last item.
85
+ nextIndex = 0;
86
+ }
87
+ else if (nextIndex < 0) {
88
+ // Go to end if moving before the first item.
89
+ nextIndex = siblings.length - 1;
90
+ }
91
+ // Check if the next sibling is disabled. If so,
92
+ // move the index and continue searching.
93
+ const nextSibling = siblings[nextIndex];
94
+ if (nextSibling.hasAttribute('disabled')) {
95
+ if (forwards) {
96
+ nextIndex++;
97
+ }
98
+ else {
99
+ nextIndex--;
100
+ }
101
+ continue;
102
+ }
103
+ // Uncheck and remove focusability from other siblings.
104
+ for (const sibling of siblings) {
105
+ if (sibling !== nextSibling) {
106
+ sibling.checked = false;
107
+ sibling.tabIndex = -1;
108
+ }
109
+ }
110
+ // The next sibling should be checked and focused.
111
+ nextSibling.checked = true;
112
+ nextSibling.removeAttribute('tabindex');
113
+ nextSibling.focus();
114
+ break;
115
+ }
116
+ };
117
+ }
118
+ hostConnected() {
119
+ this.root = this.host.getRootNode();
120
+ this.host.addEventListener('keydown', this.handleKeyDown);
121
+ this.host.addEventListener('focusin', this.handleFocusIn);
122
+ this.host.addEventListener('focusout', this.handleFocusOut);
123
+ if (this.host.checked) {
124
+ // Uncheck other siblings when attached if already checked. This mimics
125
+ // native <input type="radio"> behavior.
126
+ this.uncheckSiblings();
122
127
  }
128
+ // Update for the newly added host.
129
+ this.updateTabIndices();
123
130
  }
124
- mousedownHandler() {
125
- this.mouseIsDown = true;
126
- }
127
- mouseupHandler() {
128
- this.mouseIsDown = false;
131
+ hostDisconnected() {
132
+ this.host.removeEventListener('keydown', this.handleKeyDown);
133
+ this.host.removeEventListener('focusin', this.handleFocusIn);
134
+ this.host.removeEventListener('focusout', this.handleFocusOut);
135
+ // Update for siblings that are still connected.
136
+ this.updateTabIndices();
137
+ this.root = null;
129
138
  }
130
139
  /**
131
- * Whether or not the controller controls the given element.
132
- *
133
- * @param element element to check
140
+ * Should be called whenever the host's `checked` property changes
141
+ * synchronously.
134
142
  */
135
- has(element) {
136
- const set = this.getSet(element.name);
137
- return set.set.has(element);
138
- }
139
- /**
140
- * Selects and returns the controlled element previous to the given element in
141
- * document position order. See
142
- * [Node.compareDocumentPosition](https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition).
143
- *
144
- * @param element element relative from which preceding element is fetched
145
- */
146
- selectPrevious(element) {
147
- const order = this.getOrdered(element);
148
- const i = order.indexOf(element);
149
- const previous = order[i - 1] || order[order.length - 1];
150
- this.select(previous);
151
- return previous;
152
- }
153
- /**
154
- * Selects and returns the controlled element next to the given element in
155
- * document position order. See
156
- * [Node.compareDocumentPosition](https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition).
157
- *
158
- * @param element element relative from which following element is fetched
159
- */
160
- selectNext(element) {
161
- const order = this.getOrdered(element);
162
- const i = order.indexOf(element);
163
- const next = order[i + 1] || order[0];
164
- this.select(next);
165
- return next;
166
- }
167
- select(element) {
168
- element.click();
169
- }
170
- /**
171
- * Focuses the selected element in the given element's selection set. User's
172
- * mouse selection will override this focus.
173
- *
174
- * @param element Element from which selection set is derived and subsequently
175
- * focused.
176
- * @deprecated update() method now handles focus management by setting
177
- * appropriate tabindex to form element.
178
- */
179
- focus(element) {
180
- // Only manage focus state when using keyboard
181
- if (this.mouseIsDown) {
143
+ handleCheckedChange() {
144
+ if (!this.host.checked) {
182
145
  return;
183
146
  }
184
- const set = this.getSet(element.name);
185
- const currentFocusedSet = this.focusedSet;
186
- this.focusedSet = set;
187
- if (currentFocusedSet != set && set.selected && set.selected != element) {
188
- set.selected.focus();
189
- }
147
+ this.uncheckSiblings();
148
+ this.updateTabIndices();
190
149
  }
191
- /**
192
- * @return Returns true if atleast one radio is selected in the radio group.
193
- */
194
- isAnySelected(element) {
195
- const set = this.getSet(element.name);
196
- for (const e of set.set) {
197
- if (e.checked) {
198
- return true;
150
+ uncheckSiblings() {
151
+ for (const sibling of this.getNamedSiblings()) {
152
+ if (sibling !== this.host) {
153
+ sibling.checked = false;
199
154
  }
200
155
  }
201
- return false;
202
- }
203
- /**
204
- * Returns the elements in the given element's selection set in document
205
- * position order.
206
- * [Node.compareDocumentPosition](https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition).
207
- *
208
- * @param element Element from which selection set is derived and subsequently
209
- * ordered.
210
- */
211
- getOrdered(element) {
212
- const set = this.getSet(element.name);
213
- if (!set.ordered) {
214
- set.ordered = Array.from(set.set);
215
- set.ordered.sort((a, b) => a.compareDocumentPosition(b) == Node.DOCUMENT_POSITION_PRECEDING ?
216
- 1 :
217
- 0);
218
- }
219
- return set.ordered;
220
156
  }
221
157
  /**
222
- * Gets the selection set of the given name and creates one if it does not yet
223
- * exist.
224
- *
225
- * @param name Name of set
158
+ * Updates the `tabindex` of the host and its siblings.
226
159
  */
227
- getSet(name) {
228
- if (!this.sets[name]) {
229
- this.sets[name] = new SingleSelectionSet();
160
+ updateTabIndices() {
161
+ // There are three tabindex states for a group of elements:
162
+ // 1. If any are checked, that element is focusable.
163
+ const siblings = this.getNamedSiblings();
164
+ const checkedSibling = siblings.find(sibling => sibling.checked);
165
+ // 2. If an element is focused, the others are no longer focusable.
166
+ if (checkedSibling || this.focused) {
167
+ const focusable = checkedSibling || this.host;
168
+ focusable.removeAttribute('tabindex');
169
+ for (const sibling of siblings) {
170
+ if (sibling !== focusable) {
171
+ sibling.tabIndex = -1;
172
+ }
173
+ }
174
+ return;
230
175
  }
231
- return this.sets[name];
232
- }
233
- /**
234
- * Register the element in the selection controller.
235
- *
236
- * @param element Element to register. Registers in set of `element.name`.
237
- */
238
- register(element) {
239
- // TODO(b/168546148): Remove accessing 'name' via getAttribute() when new
240
- // base class is created without single selection controller. Component
241
- // maybe booted up after it is connected to DOM in which case properties
242
- // (including `name`) are not updated yet.
243
- const name = element.name || element.getAttribute('name') || '';
244
- const set = this.getSet(name);
245
- set.set.add(element);
246
- set.ordered = null;
247
- }
248
- /**
249
- * Unregister the element from selection controller.
250
- *
251
- * @param element Element to register. Registers in set of `element.name`.
252
- */
253
- unregister(element) {
254
- const set = this.getSet(element.name);
255
- set.set.delete(element);
256
- set.ordered = null;
257
- if (set.selected == element) {
258
- set.selected = null;
176
+ // 3. If none are checked or focused, all are focusable.
177
+ for (const sibling of siblings) {
178
+ sibling.removeAttribute('tabindex');
259
179
  }
260
180
  }
261
181
  /**
262
- * Unselects other elements in element's set if element is checked. Noop
263
- * otherwise.
264
- *
265
- * @param element Element from which to calculate selection controller update.
182
+ * Retrieves all siblings in the host element's root with the same `name`
183
+ * attribute.
266
184
  */
267
- update(element) {
268
- const set = this.getSet(element.name);
269
- if (element.checked) {
270
- for (const e of set.set) {
271
- if (e == element) {
272
- continue;
273
- }
274
- e.checked = false;
275
- }
276
- set.selected = element;
277
- }
278
- // When tabbing through land focus on the checked radio in the group.
279
- if (this.isAnySelected(element)) {
280
- for (const e of set.set) {
281
- if (e.formElementTabIndex === undefined) {
282
- break;
283
- }
284
- e.formElementTabIndex = e.checked ? 0 : -1;
285
- }
185
+ getNamedSiblings() {
186
+ const name = this.host.getAttribute('name');
187
+ if (!name || !this.root) {
188
+ return [];
286
189
  }
190
+ return Array.from(this.root.querySelectorAll(`[name="${name}"]`));
287
191
  }
288
192
  }
289
193
  //# sourceMappingURL=single-selection-controller.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"single-selection-controller.js","sourceRoot":"","sources":["single-selection-controller.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,4CAA4C;AAC5C,mDAAmD;AAEnD;;GAEG;AACH,MAAM,mBAAmB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAE3D;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAA/B;QACE,aAAQ,GAA0B,IAAI,CAAC;QACvC,YAAO,GAA4B,IAAI,CAAC;QAC/B,QAAG,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC7C,CAAC;CAAA;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,OAAO,yBAAyB;IAgCpC,YAAY,OAAa;QA/BR,SAAI,GAAyC,EAAE,CAAC;QAEzD,eAAU,GAA4B,IAAI,CAAC;QAE3C,gBAAW,GAAG,KAAK,CAAC;QA4B1B,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAQ,EAAE,EAAE;YAC/C,IAAI,CAAC,cAAc,CAAC,CAAkB,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,gBAAgB,CAAC,WAAW,EAAE,GAAG,EAAE;YACzC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,GAAG,EAAE;YACvC,IAAI,CAAC,cAAc,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC;IAnCD;;;;;;;;;OASG;IACH,MAAM,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AG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAC5C;SACF;IACH,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Style preference for leading underscores.\n// tslint:disable:strip-private-property-underscore\n\n/**\n * Unique symbol for marking roots\n */\nconst selectionController = Symbol('selection controller');\n\n/**\n * Set of checkable elements with added metadata\n */\nexport class SingleSelectionSet {\n selected: CheckableElement|null = null;\n ordered: CheckableElement[]|null = null;\n readonly set = new Set<CheckableElement>();\n}\n\n/**\n * Element that is checkable consumed by\n * `SingleSelectionController` and `SingleSelectionSet`\n */\nexport type CheckableElement = HTMLElement&{\n name: string;\n checked: boolean;\n formElementTabIndex?: number;\n};\n\n/**\n * Controller that provides behavior similar to a native `<input type=\"radio\">`\n * group.\n *\n * Behaviors:\n *\n * - Selection via key navigation (currently LTR is supported)\n * - Deselection of other grouped, checkable controls upon selection\n * - Grouping of checkable elements by name\n * - Defaults grouping scope to host shadow root\n * - Document-wide scoping enabled\n * - Land focus only on checked element. Focuses leading element when none\n * checked.\n *\n * Intended Usage:\n *\n * ```ts\n * class MyElement extends HTMLElement {\n * private selectionController: SingleSelectionController | null = null;\n * name = \"\";\n * global = false;\n *\n * private _checked = false;\n * set checked(checked: boolean) {\n * const oldVal = this._checked;\n * if (checked === oldVal) return;\n *\n * this._checked = checked;\n *\n * if (this.selectionController) {\n * this.selectionController.update(this)\n * }\n * }\n *\n * get checked() {\n * return this._checked;\n * }\n *\n * connectedCallback() {\n * this.selectionController = SelectionController.getController(this);\n * this.selectionController.register(this);\n * this.selectionController.update(this);\n * }\n *\n * disconnectedCallback() {\n * this.selectionController!.unregister(this);\n * this.selectionController = null;\n * }\n * }\n * ```\n */\nexport class SingleSelectionController {\n private readonly sets: {[name: string]: SingleSelectionSet} = {};\n\n private focusedSet: SingleSelectionSet|null = null;\n\n private mouseIsDown = false;\n\n /**\n * Get a controller for the given element. If no controller exists, one will\n * be created. Defaults to getting the controller scoped to the element's root\n * node shadow root unless `element.global` is true. Then, it will get a\n * `window.document`-scoped controller.\n *\n * @param element Element from which to get / create a SelectionController. If\n * `element.global` is true, it gets a selection controller scoped to\n * `window.document`.\n */\n static getController(element: HTMLElement|HTMLElement&{global: boolean}) {\n const useGlobal =\n !('global' in element) || ('global' in element && element.global);\n const root = useGlobal ? document as Document &\n {[selectionController]?: SingleSelectionController} :\n (element as Element).getRootNode() as Node &\n {[selectionController]?: SingleSelectionController};\n let controller = root[selectionController];\n if (controller === undefined) {\n controller = new SingleSelectionController(root);\n root[selectionController] = controller;\n }\n return controller;\n }\n\n constructor(element: Node) {\n element.addEventListener('keydown', (e: Event) => {\n this.keyDownHandler(e as KeyboardEvent);\n });\n element.addEventListener('mousedown', () => {\n this.mousedownHandler();\n });\n element.addEventListener('mouseup', () => {\n this.mouseupHandler();\n });\n }\n\n protected keyDownHandler(e: KeyboardEvent) {\n const element = e.target as EventTarget | CheckableElement;\n if (!('checked' in element)) {\n return;\n }\n if (!this.has(element)) {\n return;\n }\n if (e.key == 'ArrowRight' || e.key == 'ArrowDown') {\n this.selectNext(element);\n } else if (e.key == 'ArrowLeft' || e.key == 'ArrowUp') {\n this.selectPrevious(element);\n }\n }\n\n protected mousedownHandler() {\n this.mouseIsDown = true;\n }\n\n protected mouseupHandler() {\n this.mouseIsDown = false;\n }\n\n /**\n * Whether or not the controller controls the given element.\n *\n * @param element element to check\n */\n has(element: CheckableElement) {\n const set = this.getSet(element.name);\n return set.set.has(element);\n }\n\n /**\n * Selects and returns the controlled element previous to the given element in\n * document position order. See\n * [Node.compareDocumentPosition](https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition).\n *\n * @param element element relative from which preceding element is fetched\n */\n selectPrevious(element: CheckableElement) {\n const order = this.getOrdered(element);\n const i = order.indexOf(element);\n const previous = order[i - 1] || order[order.length - 1];\n this.select(previous);\n\n return previous;\n }\n\n /**\n * Selects and returns the controlled element next to the given element in\n * document position order. See\n * [Node.compareDocumentPosition](https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition).\n *\n * @param element element relative from which following element is fetched\n */\n selectNext(element: CheckableElement) {\n const order = this.getOrdered(element);\n const i = order.indexOf(element);\n const next = order[i + 1] || order[0];\n this.select(next);\n\n return next;\n }\n\n select(element: CheckableElement) {\n element.click();\n }\n\n /**\n * Focuses the selected element in the given element's selection set. User's\n * mouse selection will override this focus.\n *\n * @param element Element from which selection set is derived and subsequently\n * focused.\n * @deprecated update() method now handles focus management by setting\n * appropriate tabindex to form element.\n */\n focus(element: CheckableElement) {\n // Only manage focus state when using keyboard\n if (this.mouseIsDown) {\n return;\n }\n const set = this.getSet(element.name);\n const currentFocusedSet = this.focusedSet;\n this.focusedSet = set;\n if (currentFocusedSet != set && set.selected && set.selected != element) {\n set.selected.focus();\n }\n }\n\n /**\n * @return Returns true if atleast one radio is selected in the radio group.\n */\n isAnySelected(element: CheckableElement): boolean {\n const set = this.getSet(element.name);\n\n for (const e of set.set) {\n if (e.checked) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Returns the elements in the given element's selection set in document\n * position order.\n * [Node.compareDocumentPosition](https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition).\n *\n * @param element Element from which selection set is derived and subsequently\n * ordered.\n */\n getOrdered(element: CheckableElement) {\n const set = this.getSet(element.name);\n if (!set.ordered) {\n set.ordered = Array.from(set.set);\n set.ordered.sort(\n (a, b) =>\n a.compareDocumentPosition(b) == Node.DOCUMENT_POSITION_PRECEDING ?\n 1 :\n 0);\n }\n return set.ordered;\n }\n\n /**\n * Gets the selection set of the given name and creates one if it does not yet\n * exist.\n *\n * @param name Name of set\n */\n getSet(name: string): SingleSelectionSet {\n if (!this.sets[name]) {\n this.sets[name] = new SingleSelectionSet();\n }\n return this.sets[name];\n }\n\n /**\n * Register the element in the selection controller.\n *\n * @param element Element to register. Registers in set of `element.name`.\n */\n register(element: CheckableElement) {\n // TODO(b/168546148): Remove accessing 'name' via getAttribute() when new\n // base class is created without single selection controller. Component\n // maybe booted up after it is connected to DOM in which case properties\n // (including `name`) are not updated yet.\n const name = element.name || element.getAttribute('name') || '';\n const set = this.getSet(name);\n set.set.add(element);\n set.ordered = null;\n }\n\n /**\n * Unregister the element from selection controller.\n *\n * @param element Element to register. Registers in set of `element.name`.\n */\n unregister(element: CheckableElement) {\n const set = this.getSet(element.name);\n set.set.delete(element);\n set.ordered = null;\n if (set.selected == element) {\n set.selected = null;\n }\n }\n\n /**\n * Unselects other elements in element's set if element is checked. Noop\n * otherwise.\n *\n * @param element Element from which to calculate selection controller update.\n */\n update(element: CheckableElement) {\n const set = this.getSet(element.name);\n if (element.checked) {\n for (const e of set.set) {\n if (e == element) {\n continue;\n }\n e.checked = false;\n }\n set.selected = element;\n }\n\n // When tabbing through land focus on the checked radio in the group.\n if (this.isAnySelected(element)) {\n for (const e of set.set) {\n if (e.formElementTabIndex === undefined) {\n break;\n }\n\n e.formElementTabIndex = e.checked ? 0 : -1;\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"single-selection-controller.js","sourceRoot":"","sources":["single-selection-controller.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,OAAO,yBAAyB;IAIpC,YAA6B,IAA4B;QAA5B,SAAI,GAAJ,IAAI,CAAwB;QAHjD,YAAO,GAAG,KAAK,CAAC;QAChB,SAAI,GAAoB,IAAI,CAAC;QAyCpB,kBAAa,GAAG,GAAG,EAAE;YACpC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACpB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC1B,CAAC,CAAC;QAEe,mBAAc,GAAG,GAAG,EAAE;YACrC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACrB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC1B,CAAC,CAAC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;gBAC9B,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;iBACvB;aACF;YACD,OAAO;SACR;QAED,wDAAwD;QACxD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC9B,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;SACrC;IACH,CAAC;IAED;;;OAGG;IACK,gBAAgB;QACtB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACvB,OAAO,EAAE,CAAC;SACX;QAED,OAAO,KAAK,CAAC,IAAI,CACb,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAyB,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC;IAC9E,CAAC;CAwEF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {ReactiveController} from 'lit';\n\n/**\n * An element that supports single-selection with `SingleSelectionController`.\n */\nexport interface SingleSelectionElement extends HTMLElement {\n /**\n * Whether or not the element is selected.\n */\n checked: boolean;\n}\n\n/**\n * A `ReactiveController` that provides root node-scoped single selection for\n * elements, similar to native `<input type=\"radio\">` selection.\n *\n * To use, elements should add the controller and call\n * `selectionController.handleCheckedChange()` in a getter/setter. This must\n * be synchronous to match native behavior.\n *\n * @example\n * const CHECKED = Symbol('checked');\n *\n * class MyToggle extends LitElement {\n * get checked() { return this[CHECKED]; }\n * set checked(checked: boolean) {\n * const oldValue = this.checked;\n * if (oldValue === checked) {\n * return;\n * }\n *\n * this[CHECKED] = checked;\n * this.selectionController.handleCheckedChange();\n * this.requestUpdate('checked', oldValue);\n * }\n *\n * [CHECKED] = false;\n *\n * private selectionController = new SingleSelectionController(this);\n *\n * constructor() {\n * super();\n * this.addController(this.selectionController);\n * }\n * }\n */\nexport class SingleSelectionController implements ReactiveController {\n private focused = false;\n private root: ParentNode|null = null;\n\n constructor(private readonly host: SingleSelectionElement) {}\n\n hostConnected() {\n this.root = this.host.getRootNode() as ParentNode;\n this.host.addEventListener('keydown', this.handleKeyDown);\n this.host.addEventListener('focusin', this.handleFocusIn);\n this.host.addEventListener('focusout', this.handleFocusOut);\n if (this.host.checked) {\n // Uncheck other siblings when attached if already checked. This mimics\n // native <input type=\"radio\"> behavior.\n this.uncheckSiblings();\n }\n\n // Update for the newly added host.\n this.updateTabIndices();\n }\n\n hostDisconnected() {\n this.host.removeEventListener('keydown', this.handleKeyDown);\n this.host.removeEventListener('focusin', this.handleFocusIn);\n this.host.removeEventListener('focusout', this.handleFocusOut);\n // Update for siblings that are still connected.\n this.updateTabIndices();\n this.root = null;\n }\n\n /**\n * Should be called whenever the host's `checked` property changes\n * synchronously.\n */\n handleCheckedChange() {\n if (!this.host.checked) {\n return;\n }\n\n this.uncheckSiblings();\n this.updateTabIndices();\n }\n\n private readonly handleFocusIn = () => {\n this.focused = true;\n this.updateTabIndices();\n };\n\n private readonly handleFocusOut = () => {\n this.focused = false;\n this.updateTabIndices();\n };\n\n private uncheckSiblings() {\n for (const sibling of this.getNamedSiblings()) {\n if (sibling !== this.host) {\n sibling.checked = false;\n }\n }\n }\n\n /**\n * Updates the `tabindex` of the host and its siblings.\n */\n private updateTabIndices() {\n // There are three tabindex states for a group of elements:\n // 1. If any are checked, that element is focusable.\n const siblings = this.getNamedSiblings();\n const checkedSibling = siblings.find(sibling => sibling.checked);\n // 2. If an element is focused, the others are no longer focusable.\n if (checkedSibling || this.focused) {\n const focusable = checkedSibling || this.host;\n focusable.removeAttribute('tabindex');\n\n for (const sibling of siblings) {\n if (sibling !== focusable) {\n sibling.tabIndex = -1;\n }\n }\n return;\n }\n\n // 3. If none are checked or focused, all are focusable.\n for (const sibling of siblings) {\n sibling.removeAttribute('tabindex');\n }\n }\n\n /**\n * Retrieves all siblings in the host element's root with the same `name`\n * attribute.\n */\n private getNamedSiblings() {\n const name = this.host.getAttribute('name');\n if (!name || !this.root) {\n return [];\n }\n\n return Array.from(\n this.root.querySelectorAll<SingleSelectionElement>(`[name=\"${name}\"]`));\n }\n\n /**\n * Handles arrow key events from the host. Using the arrow keys will\n * select and check the next or previous sibling with the host's\n * `name` attribute.\n */\n private readonly handleKeyDown = (event: KeyboardEvent) => {\n const isDown = event.key === 'ArrowDown';\n const isUp = event.key === 'ArrowUp';\n const isLeft = event.key === 'ArrowLeft';\n const isRight = event.key === 'ArrowRight';\n // Ignore non-arrow keys\n if (!isLeft && !isRight && !isDown && !isUp) {\n return;\n }\n\n // Don't try to select another sibling if there aren't any.\n const siblings = this.getNamedSiblings();\n if (!siblings.length) {\n return;\n }\n\n // Prevent default interactions on the element for arrow keys,\n // since this controller will introduce new behavior.\n event.preventDefault();\n\n // Check if moving forwards or backwards\n const isRtl = getComputedStyle(this.host).direction === 'rtl';\n const forwards = isRtl ? isLeft || isDown : isRight || isDown;\n\n const hostIndex = siblings.indexOf(this.host);\n let nextIndex = forwards ? hostIndex + 1 : hostIndex - 1;\n // Search for the next sibling that is not disabled to select.\n // If we return to the host index, there is nothing to select.\n while (nextIndex !== hostIndex) {\n if (nextIndex >= siblings.length) {\n // Return to start if moving past the last item.\n nextIndex = 0;\n } else if (nextIndex < 0) {\n // Go to end if moving before the first item.\n nextIndex = siblings.length - 1;\n }\n\n // Check if the next sibling is disabled. If so,\n // move the index and continue searching.\n const nextSibling = siblings[nextIndex];\n if (nextSibling.hasAttribute('disabled')) {\n if (forwards) {\n nextIndex++;\n } else {\n nextIndex--;\n }\n\n continue;\n }\n\n // Uncheck and remove focusability from other siblings.\n for (const sibling of siblings) {\n if (sibling !== nextSibling) {\n sibling.checked = false;\n sibling.tabIndex = -1;\n }\n }\n\n // The next sibling should be checked and focused.\n nextSibling.checked = true;\n nextSibling.removeAttribute('tabindex');\n nextSibling.focus();\n break;\n }\n };\n}\n"]}
package/radio/radio.js CHANGED
@@ -5,12 +5,13 @@
5
5
  */
6
6
  import { __decorate } from "tslib";
7
7
  import { customElement } from 'lit/decorators.js';
8
+ import { styles as forcedColorsStyles } from './lib/forced-colors-styles.css.js';
8
9
  import { Radio } from './lib/radio.js';
9
10
  import { styles } from './lib/radio-styles.css.js';
10
11
  /** @soyCompatible */
11
12
  let MdRadio = class MdRadio extends Radio {
12
13
  };
13
- MdRadio.styles = [styles];
14
+ MdRadio.styles = [styles, forcedColorsStyles];
14
15
  MdRadio = __decorate([
15
16
  customElement('md-radio')
16
17
  ], MdRadio);
@@ -1 +1 @@
1
- {"version":3,"file":"radio.js","sourceRoot":"","sources":["radio.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AAQjD,qBAAqB;AAErB,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,KAAK;CAEjC,CAAA;AADiB,cAAM,GAAG,CAAC,MAAM,CAAE,CAAA;AADvB,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAEnB;SAFY,OAAO","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {customElement} from 'lit/decorators.js';\n\nimport {Radio} from './lib/radio.js';\nimport {styles} from './lib/radio-styles.css.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-radio': MdRadio;\n }\n}\n\n/** @soyCompatible */\n@customElement('md-radio')\nexport class MdRadio extends Radio {\n static override styles = [styles];\n}\n"]}
1
+ {"version":3,"file":"radio.js","sourceRoot":"","sources":["radio.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,MAAM,IAAI,kBAAkB,EAAC,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AAQjD,qBAAqB;AAErB,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,KAAK;CAEjC,CAAA;AADiB,cAAM,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAE,CAAA;AAD3C,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAEnB;SAFY,OAAO","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {customElement} from 'lit/decorators.js';\n\nimport {styles as forcedColorsStyles} from './lib/forced-colors-styles.css.js';\nimport {Radio} from './lib/radio.js';\nimport {styles} from './lib/radio-styles.css.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-radio': MdRadio;\n }\n}\n\n/** @soyCompatible */\n@customElement('md-radio')\nexport class MdRadio extends Radio {\n static override styles = [styles, forcedColorsStyles];\n}\n"]}
@@ -17,6 +17,7 @@
17
17
  :host {
18
18
  display: inline-flex;
19
19
  outline: none;
20
+ -webkit-tap-highlight-color: transparent;
20
21
  }
21
22
 
22
23
  .md3-text-field {
@@ -4,6 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { css } from 'lit';
7
- export const styles = css `:host{--_container-shape-start-start: var(--md-filled-text-field-container-shape-start-start, 4px);--_container-shape-start-end: var(--md-filled-text-field-container-shape-start-end, 4px);--_container-shape-end-end: var(--md-filled-text-field-container-shape-end-end, 0px);--_container-shape-end-start: var(--md-filled-text-field-container-shape-end-start, 0px);--_container-padding-horizontal: var(--md-filled-text-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-filled-text-field-container-padding-vertical, 8px);--_input-text-prefix-padding: var(--md-filled-text-field-input-text-prefix-padding, 2px);--_input-text-suffix-padding: var(--md-filled-text-field-input-text-suffix-padding, 2px);--_active-indicator-color: var(--md-filled-text-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-text-field-active-indicator-height, 1px);--_caret-color: var(--md-filled-text-field-caret-color, var(--md-sys-color-primary, #6750a4));--_container-color: var(--md-filled-text-field-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_container-height: var(--md-filled-text-field-container-height, 56px);--_disabled-active-indicator-color: var(--md-filled-text-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-active-indicator-height: var(--md-filled-text-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-text-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-text-field-disabled-container-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-container-opacity: var(--md-filled-text-field-disabled-container-opacity, 0.04);--_disabled-input-text-color: var(--md-filled-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-input-text-opacity: var(--md-filled-text-field-disabled-input-text-opacity, 0.38);--_disabled-label-text-color: var(--md-filled-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-filled-text-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-filled-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-icon-opacity: var(--md-filled-text-field-disabled-leading-icon-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-filled-text-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-filled-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-icon-opacity: var(--md-filled-text-field-disabled-trailing-icon-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-text-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-active-indicator-color: var(--md-filled-text-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-caret-color: var(--md-filled-text-field-error-focus-caret-color, var(--md-sys-color-error, #b3261e));--_error-focus-input-text-color: var(--md-filled-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-label-text-color: var(--md-filled-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-filled-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-filled-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-text-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-input-text-color: var(--md-filled-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-label-text-color: var(--md-filled-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-filled-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-text-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-state-layer-opacity: var(--md-filled-text-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-filled-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-input-text-color: var(--md-filled-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-label-text-color: var(--md-filled-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-filled-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-filled-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-text-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-text-field-focus-active-indicator-height, 2px);--_focus-input-text-color: var(--md-filled-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-label-text-color: var(--md-filled-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-filled-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-filled-text-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-text-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-active-indicator-height: var(--md-filled-text-field-hover-active-indicator-height, 1px);--_hover-input-text-color: var(--md-filled-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-label-text-color: var(--md-filled-text-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-icon-color: var(--md-filled-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-text-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-state-layer-opacity: var(--md-filled-text-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-filled-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-color: var(--md-filled-text-field-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_input-text-font: var(--md-filled-text-field-input-text-font, Roboto);--_input-text-line-height: var(--md-filled-text-field-input-text-line-height, 1.5rem);--_input-text-placeholder-color: var(--md-filled-text-field-input-text-placeholder-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-prefix-color: var(--md-filled-text-field-input-text-prefix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-size: var(--md-filled-text-field-input-text-size, 1rem);--_input-text-suffix-color: var(--md-filled-text-field-input-text-suffix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-tracking: var(--md-filled-text-field-input-text-tracking, 0.031rem);--_input-text-type: var(--md-filled-text-field-input-text-type, 400 1rem / 1.5rem Roboto);--_input-text-weight: var(--md-filled-text-field-input-text-weight, 400);--_label-text-color: var(--md-filled-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-font: var(--md-filled-text-field-label-text-font, Roboto);--_label-text-line-height: var(--md-filled-text-field-label-text-line-height, 1.5rem);--_label-text-populated-line-height: var(--md-filled-text-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-filled-text-field-label-text-populated-size, 0.75rem);--_label-text-size: var(--md-filled-text-field-label-text-size, 1rem);--_label-text-tracking: var(--md-filled-text-field-label-text-tracking, 0.031rem);--_label-text-type: var(--md-filled-text-field-label-text-type, 400 1rem / 1.5rem Roboto);--_label-text-weight: var(--md-filled-text-field-label-text-weight, 400);--_leading-icon-color: var(--md-filled-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-filled-text-field-leading-icon-size, 20px);--_supporting-text-color: var(--md-filled-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-filled-text-field-supporting-text-font, Roboto);--_supporting-text-line-height: var(--md-filled-text-field-supporting-text-line-height, 1rem);--_supporting-text-size: var(--md-filled-text-field-supporting-text-size, 0.75rem);--_supporting-text-tracking: var(--md-filled-text-field-supporting-text-tracking, 0.025rem);--_supporting-text-type: var(--md-filled-text-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_supporting-text-weight: var(--md-filled-text-field-supporting-text-weight, 400);--_trailing-icon-color: var(--md-filled-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-filled-text-field-trailing-icon-size, 24px);--md-filled-field-container-shape-start-start:var(--_container-shape-start-start);--md-filled-field-container-shape-start-end:var(--_container-shape-start-end);--md-filled-field-container-shape-end-end:var(--_container-shape-end-end);--md-filled-field-container-shape-end-start:var(--_container-shape-end-start);--md-filled-field-active-indicator-color:var(--_active-indicator-color);--md-filled-field-active-indicator-height:var(--_active-indicator-height);--md-filled-field-container-color:var(--_container-color);--md-filled-field-container-height:var(--_container-height);--md-filled-field-container-padding-horizontal:var(--_container-padding-horizontal);--md-filled-field-container-padding-vertical:var(--_container-padding-vertical);--md-filled-field-content-color:var(--_input-text-color);--md-filled-field-disabled-active-indicator-color:var(--_disabled-active-indicator-color);--md-filled-field-disabled-active-indicator-height:var(--_disabled-active-indicator-height);--md-filled-field-disabled-active-indicator-opacity:var(--_disabled-active-indicator-opacity);--md-filled-field-disabled-container-color:var(--_disabled-container-color);--md-filled-field-disabled-container-opacity:var(--_disabled-container-opacity);--md-filled-field-disabled-content-color:var(--_disabled-input-text-color);--md-filled-field-disabled-content-opacity:var(--_disabled-input-text-opacity);--md-filled-field-disabled-label-text-color:var(--_disabled-label-text-color);--md-filled-field-disabled-label-text-opacity:var(--_disabled-label-text-opacity);--md-filled-field-disabled-leading-icon-color:var(--_disabled-leading-icon-color);--md-filled-field-disabled-leading-icon-opacity:var(--_disabled-leading-icon-opacity);--md-filled-field-disabled-supporting-text-color:var(--_disabled-supporting-text-color);--md-filled-field-disabled-supporting-text-opacity:var(--_disabled-supporting-text-opacity);--md-filled-field-disabled-trailing-icon-color:var(--_disabled-trailing-icon-color);--md-filled-field-disabled-trailing-icon-opacity:var(--_disabled-trailing-icon-opacity);--md-filled-field-error-active-indicator-color:var(--_error-active-indicator-color);--md-filled-field-error-focus-active-indicator-color:var(--_error-focus-active-indicator-color);--md-filled-field-error-focus-content-color:var(--_error-focus-input-text-color);--md-filled-field-error-focus-label-text-color:var(--_error-focus-label-text-color);--md-filled-field-error-focus-leading-icon-color:var(--_error-focus-leading-icon-color);--md-filled-field-error-focus-supporting-text-color:var(--_error-focus-supporting-text-color);--md-filled-field-error-focus-trailing-icon-color:var(--_error-focus-trailing-icon-color);--md-filled-field-error-hover-active-indicator-color:var(--_error-hover-active-indicator-color);--md-filled-field-error-hover-content-color:var(--_error-hover-input-text-color);--md-filled-field-error-hover-label-text-color:var(--_error-hover-label-text-color);--md-filled-field-error-hover-leading-icon-color:var(--_error-hover-leading-icon-color);--md-filled-field-error-hover-state-layer-color:var(--_error-hover-state-layer-color);--md-filled-field-error-hover-state-layer-opacity:var(--_error-hover-state-layer-opacity);--md-filled-field-error-hover-supporting-text-color:var(--_error-hover-supporting-text-color);--md-filled-field-error-hover-trailing-icon-color:var(--_error-hover-trailing-icon-color);--md-filled-field-error-content-color:var(--_error-input-text-color);--md-filled-field-error-label-text-color:var(--_error-label-text-color);--md-filled-field-error-leading-icon-color:var(--_error-leading-icon-color);--md-filled-field-error-supporting-text-color:var(--_error-supporting-text-color);--md-filled-field-error-trailing-icon-color:var(--_error-trailing-icon-color);--md-filled-field-focus-active-indicator-color:var(--_focus-active-indicator-color);--md-filled-field-focus-active-indicator-height:var(--_focus-active-indicator-height);--md-filled-field-focus-content-color:var(--_focus-input-text-color);--md-filled-field-focus-label-text-color:var(--_focus-label-text-color);--md-filled-field-focus-leading-icon-color:var(--_focus-leading-icon-color);--md-filled-field-focus-supporting-text-color:var(--_focus-supporting-text-color);--md-filled-field-focus-trailing-icon-color:var(--_focus-trailing-icon-color);--md-filled-field-hover-active-indicator-color:var(--_hover-active-indicator-color);--md-filled-field-hover-active-indicator-height:var(--_hover-active-indicator-height);--md-filled-field-hover-content-color:var(--_hover-input-text-color);--md-filled-field-hover-label-text-color:var(--_hover-label-text-color);--md-filled-field-hover-leading-icon-color:var(--_hover-leading-icon-color);--md-filled-field-hover-state-layer-color:var(--_hover-state-layer-color);--md-filled-field-hover-state-layer-opacity:var(--_hover-state-layer-opacity);--md-filled-field-hover-supporting-text-color:var(--_hover-supporting-text-color);--md-filled-field-hover-trailing-icon-color:var(--_hover-trailing-icon-color);--md-filled-field-label-text-color:var(--_label-text-color);--md-filled-field-label-text-font:var(--_label-text-font);--md-filled-field-label-text-line-height:var(--_label-text-line-height);--md-filled-field-label-text-populated-line-height:var(--_label-text-populated-line-height);--md-filled-field-label-text-populated-size:var(--_label-text-populated-size);--md-filled-field-label-text-size:var(--_label-text-size);--md-filled-field-label-text-tracking:var(--_label-text-tracking);--md-filled-field-label-text-weight:var(--_label-text-weight);--md-filled-field-leading-icon-color:var(--_leading-icon-color);--md-filled-field-leading-icon-size:var(--_leading-icon-size);--md-filled-field-supporting-text-color:var(--_supporting-text-color);--md-filled-field-supporting-text-font:var(--_supporting-text-font);--md-filled-field-supporting-text-line-height:var(--_supporting-text-line-height);--md-filled-field-supporting-text-size:var(--_supporting-text-size);--md-filled-field-supporting-text-tracking:var(--_supporting-text-tracking);--md-filled-field-supporting-text-weight:var(--_supporting-text-weight);--md-filled-field-trailing-icon-color:var(--_trailing-icon-color);--md-filled-field-trailing-icon-size:var(--_trailing-icon-size)}/*# sourceMappingURL=filled-styles.css.map */
7
+ export const styles = css `:host{--_container-shape-start-start: var(--md-filled-text-field-container-shape-start-start, 4px);--_container-shape-start-end: var(--md-filled-text-field-container-shape-start-end, 4px);--_container-shape-end-end: var(--md-filled-text-field-container-shape-end-end, 0px);--_container-shape-end-start: var(--md-filled-text-field-container-shape-end-start, 0px);--_container-padding-horizontal: var(--md-filled-text-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-filled-text-field-container-padding-vertical, 8px);--_input-text-prefix-padding: var(--md-filled-text-field-input-text-prefix-padding, 2px);--_input-text-suffix-padding: var(--md-filled-text-field-input-text-suffix-padding, 2px);--_active-indicator-color: var(--md-filled-text-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-text-field-active-indicator-height, 1px);--_caret-color: var(--md-filled-text-field-caret-color, var(--md-sys-color-primary, #6750a4));--_container-color: var(--md-filled-text-field-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_container-height: var(--md-filled-text-field-container-height, 56px);--_disabled-active-indicator-color: var(--md-filled-text-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-active-indicator-height: var(--md-filled-text-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-text-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-text-field-disabled-container-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-container-opacity: var(--md-filled-text-field-disabled-container-opacity, 0.04);--_disabled-input-text-color: var(--md-filled-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-input-text-opacity: var(--md-filled-text-field-disabled-input-text-opacity, 0.38);--_disabled-label-text-color: var(--md-filled-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-filled-text-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-filled-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-icon-opacity: var(--md-filled-text-field-disabled-leading-icon-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-filled-text-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-filled-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-icon-opacity: var(--md-filled-text-field-disabled-trailing-icon-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-text-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-active-indicator-color: var(--md-filled-text-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-caret-color: var(--md-filled-text-field-error-focus-caret-color, var(--md-sys-color-error, #b3261e));--_error-focus-input-text-color: var(--md-filled-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-label-text-color: var(--md-filled-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-filled-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-filled-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-text-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-input-text-color: var(--md-filled-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-label-text-color: var(--md-filled-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-filled-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-text-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-state-layer-opacity: var(--md-filled-text-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-filled-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-input-text-color: var(--md-filled-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-label-text-color: var(--md-filled-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-filled-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-filled-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-text-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-text-field-focus-active-indicator-height, 2px);--_focus-input-text-color: var(--md-filled-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-label-text-color: var(--md-filled-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-filled-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-filled-text-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-text-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-active-indicator-height: var(--md-filled-text-field-hover-active-indicator-height, 1px);--_hover-input-text-color: var(--md-filled-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-label-text-color: var(--md-filled-text-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-icon-color: var(--md-filled-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-text-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-state-layer-opacity: var(--md-filled-text-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-filled-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-color: var(--md-filled-text-field-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_input-text-font: var(--md-filled-text-field-input-text-font, Roboto);--_input-text-line-height: var(--md-filled-text-field-input-text-line-height, 1.5rem);--_input-text-placeholder-color: var(--md-filled-text-field-input-text-placeholder-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-prefix-color: var(--md-filled-text-field-input-text-prefix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-size: var(--md-filled-text-field-input-text-size, 1rem);--_input-text-suffix-color: var(--md-filled-text-field-input-text-suffix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-tracking: var(--md-filled-text-field-input-text-tracking, 0.031rem);--_input-text-type: var(--md-filled-text-field-input-text-type, 400 1rem / 1.5rem Roboto);--_input-text-weight: var(--md-filled-text-field-input-text-weight, 400);--_label-text-color: var(--md-filled-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-font: var(--md-filled-text-field-label-text-font, Roboto);--_label-text-line-height: var(--md-filled-text-field-label-text-line-height, 1.5rem);--_label-text-populated-line-height: var(--md-filled-text-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-filled-text-field-label-text-populated-size, 0.75rem);--_label-text-size: var(--md-filled-text-field-label-text-size, 1rem);--_label-text-tracking: var(--md-filled-text-field-label-text-tracking, 0.031rem);--_label-text-type: var(--md-filled-text-field-label-text-type, 400 1rem / 1.5rem Roboto);--_label-text-weight: var(--md-filled-text-field-label-text-weight, 400);--_leading-icon-color: var(--md-filled-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-filled-text-field-leading-icon-size, 24px);--_supporting-text-color: var(--md-filled-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-filled-text-field-supporting-text-font, Roboto);--_supporting-text-line-height: var(--md-filled-text-field-supporting-text-line-height, 1rem);--_supporting-text-size: var(--md-filled-text-field-supporting-text-size, 0.75rem);--_supporting-text-tracking: var(--md-filled-text-field-supporting-text-tracking, 0.025rem);--_supporting-text-type: var(--md-filled-text-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_supporting-text-weight: var(--md-filled-text-field-supporting-text-weight, 400);--_trailing-icon-color: var(--md-filled-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-filled-text-field-trailing-icon-size, 24px);--md-filled-field-container-shape-start-start:var(--_container-shape-start-start);--md-filled-field-container-shape-start-end:var(--_container-shape-start-end);--md-filled-field-container-shape-end-end:var(--_container-shape-end-end);--md-filled-field-container-shape-end-start:var(--_container-shape-end-start);--md-filled-field-active-indicator-color:var(--_active-indicator-color);--md-filled-field-active-indicator-height:var(--_active-indicator-height);--md-filled-field-container-color:var(--_container-color);--md-filled-field-container-height:var(--_container-height);--md-filled-field-container-padding-horizontal:var(--_container-padding-horizontal);--md-filled-field-container-padding-vertical:var(--_container-padding-vertical);--md-filled-field-content-color:var(--_input-text-color);--md-filled-field-disabled-active-indicator-color:var(--_disabled-active-indicator-color);--md-filled-field-disabled-active-indicator-height:var(--_disabled-active-indicator-height);--md-filled-field-disabled-active-indicator-opacity:var(--_disabled-active-indicator-opacity);--md-filled-field-disabled-container-color:var(--_disabled-container-color);--md-filled-field-disabled-container-opacity:var(--_disabled-container-opacity);--md-filled-field-disabled-content-color:var(--_disabled-input-text-color);--md-filled-field-disabled-content-opacity:var(--_disabled-input-text-opacity);--md-filled-field-disabled-label-text-color:var(--_disabled-label-text-color);--md-filled-field-disabled-label-text-opacity:var(--_disabled-label-text-opacity);--md-filled-field-disabled-leading-icon-color:var(--_disabled-leading-icon-color);--md-filled-field-disabled-leading-icon-opacity:var(--_disabled-leading-icon-opacity);--md-filled-field-disabled-supporting-text-color:var(--_disabled-supporting-text-color);--md-filled-field-disabled-supporting-text-opacity:var(--_disabled-supporting-text-opacity);--md-filled-field-disabled-trailing-icon-color:var(--_disabled-trailing-icon-color);--md-filled-field-disabled-trailing-icon-opacity:var(--_disabled-trailing-icon-opacity);--md-filled-field-error-active-indicator-color:var(--_error-active-indicator-color);--md-filled-field-error-focus-active-indicator-color:var(--_error-focus-active-indicator-color);--md-filled-field-error-focus-content-color:var(--_error-focus-input-text-color);--md-filled-field-error-focus-label-text-color:var(--_error-focus-label-text-color);--md-filled-field-error-focus-leading-icon-color:var(--_error-focus-leading-icon-color);--md-filled-field-error-focus-supporting-text-color:var(--_error-focus-supporting-text-color);--md-filled-field-error-focus-trailing-icon-color:var(--_error-focus-trailing-icon-color);--md-filled-field-error-hover-active-indicator-color:var(--_error-hover-active-indicator-color);--md-filled-field-error-hover-content-color:var(--_error-hover-input-text-color);--md-filled-field-error-hover-label-text-color:var(--_error-hover-label-text-color);--md-filled-field-error-hover-leading-icon-color:var(--_error-hover-leading-icon-color);--md-filled-field-error-hover-state-layer-color:var(--_error-hover-state-layer-color);--md-filled-field-error-hover-state-layer-opacity:var(--_error-hover-state-layer-opacity);--md-filled-field-error-hover-supporting-text-color:var(--_error-hover-supporting-text-color);--md-filled-field-error-hover-trailing-icon-color:var(--_error-hover-trailing-icon-color);--md-filled-field-error-content-color:var(--_error-input-text-color);--md-filled-field-error-label-text-color:var(--_error-label-text-color);--md-filled-field-error-leading-icon-color:var(--_error-leading-icon-color);--md-filled-field-error-supporting-text-color:var(--_error-supporting-text-color);--md-filled-field-error-trailing-icon-color:var(--_error-trailing-icon-color);--md-filled-field-focus-active-indicator-color:var(--_focus-active-indicator-color);--md-filled-field-focus-active-indicator-height:var(--_focus-active-indicator-height);--md-filled-field-focus-content-color:var(--_focus-input-text-color);--md-filled-field-focus-label-text-color:var(--_focus-label-text-color);--md-filled-field-focus-leading-icon-color:var(--_focus-leading-icon-color);--md-filled-field-focus-supporting-text-color:var(--_focus-supporting-text-color);--md-filled-field-focus-trailing-icon-color:var(--_focus-trailing-icon-color);--md-filled-field-hover-active-indicator-color:var(--_hover-active-indicator-color);--md-filled-field-hover-active-indicator-height:var(--_hover-active-indicator-height);--md-filled-field-hover-content-color:var(--_hover-input-text-color);--md-filled-field-hover-label-text-color:var(--_hover-label-text-color);--md-filled-field-hover-leading-icon-color:var(--_hover-leading-icon-color);--md-filled-field-hover-state-layer-color:var(--_hover-state-layer-color);--md-filled-field-hover-state-layer-opacity:var(--_hover-state-layer-opacity);--md-filled-field-hover-supporting-text-color:var(--_hover-supporting-text-color);--md-filled-field-hover-trailing-icon-color:var(--_hover-trailing-icon-color);--md-filled-field-label-text-color:var(--_label-text-color);--md-filled-field-label-text-font:var(--_label-text-font);--md-filled-field-label-text-line-height:var(--_label-text-line-height);--md-filled-field-label-text-populated-line-height:var(--_label-text-populated-line-height);--md-filled-field-label-text-populated-size:var(--_label-text-populated-size);--md-filled-field-label-text-size:var(--_label-text-size);--md-filled-field-label-text-tracking:var(--_label-text-tracking);--md-filled-field-label-text-weight:var(--_label-text-weight);--md-filled-field-leading-icon-color:var(--_leading-icon-color);--md-filled-field-leading-icon-size:var(--_leading-icon-size);--md-filled-field-supporting-text-color:var(--_supporting-text-color);--md-filled-field-supporting-text-font:var(--_supporting-text-font);--md-filled-field-supporting-text-line-height:var(--_supporting-text-line-height);--md-filled-field-supporting-text-size:var(--_supporting-text-size);--md-filled-field-supporting-text-tracking:var(--_supporting-text-tracking);--md-filled-field-supporting-text-weight:var(--_supporting-text-weight);--md-filled-field-trailing-icon-color:var(--_trailing-icon-color);--md-filled-field-trailing-icon-size:var(--_trailing-icon-size)}/*# sourceMappingURL=filled-styles.css.map */
8
8
  `;
9
9
  //# sourceMappingURL=filled-styles.css.js.map