@material/web 1.0.0-pre.3 → 1.0.0-pre.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +41 -41
  3. package/controller/form-controller.d.ts +1 -1
  4. package/controller/form-controller.js +21 -29
  5. package/controller/form-controller.js.map +1 -1
  6. package/field/lib/_content.scss +91 -13
  7. package/field/lib/_filled-field.scss +19 -57
  8. package/field/lib/_label.scss +1 -2
  9. package/field/lib/_md-comp-filled-field.scss +123 -64
  10. package/field/lib/_md-comp-outlined-field.scss +100 -59
  11. package/field/lib/_outlined-field.scss +13 -11
  12. package/field/lib/_shared.scss +21 -17
  13. package/field/lib/field.d.ts +2 -1
  14. package/field/lib/field.js +73 -62
  15. package/field/lib/field.js.map +1 -1
  16. package/field/lib/filled-field.d.ts +0 -5
  17. package/field/lib/filled-field.js +2 -41
  18. package/field/lib/filled-field.js.map +1 -1
  19. package/field/lib/filled-styles.css.js +1 -1
  20. package/field/lib/filled-styles.css.js.map +1 -1
  21. package/field/lib/outlined-field.js +1 -1
  22. package/field/lib/outlined-field.js.map +1 -1
  23. package/field/lib/outlined-styles.css.js +1 -1
  24. package/field/lib/outlined-styles.css.js.map +1 -1
  25. package/field/lib/shared-styles.css.js +1 -1
  26. package/field/lib/shared-styles.css.js.map +1 -1
  27. package/icon/lib/_icon.scss +1 -1
  28. package/icon/lib/_md-comp-icon.scss +1 -2
  29. package/icon/lib/icon-styles.css.js +1 -1
  30. package/icon/lib/icon-styles.css.js.map +1 -1
  31. package/list/lib/_list.scss +19 -9
  32. package/list/lib/list-styles.css.js +1 -1
  33. package/list/lib/list-styles.css.js.map +1 -1
  34. package/list/lib/listitem/_list-item.scss +293 -102
  35. package/list/lib/listitem/list-item-styles.css.js +1 -1
  36. package/list/lib/listitem/list-item-styles.css.js.map +1 -1
  37. package/list/lib/listitem/list-item.d.ts +7 -6
  38. package/list/lib/listitem/list-item.js +22 -26
  39. package/list/lib/listitem/list-item.js.map +1 -1
  40. package/list/list-item-link.d.ts +18 -0
  41. package/list/list-item-link.js +19 -2
  42. package/list/list-item-link.js.map +1 -1
  43. package/list/list-item.d.ts +19 -0
  44. package/list/list-item.js +20 -2
  45. package/list/list-item.js.map +1 -1
  46. package/menu/lib/_menu.scss +26 -5
  47. package/menu/lib/menu-styles.css.js +1 -1
  48. package/menu/lib/menu-styles.css.js.map +1 -1
  49. package/menu/lib/menu.js +8 -7
  50. package/menu/lib/menu.js.map +1 -1
  51. package/menu/lib/menuitem/_menu-item.scss +39 -79
  52. package/menu/lib/menuitem/menu-item-styles.css.js +1 -1
  53. package/menu/lib/menuitem/menu-item-styles.css.js.map +1 -1
  54. package/menu/lib/submenuitem/sub-menu-item.d.ts +0 -1
  55. package/menu/lib/submenuitem/sub-menu-item.js +0 -1
  56. package/menu/lib/submenuitem/sub-menu-item.js.map +1 -1
  57. package/menu/menu-item-link.js +1 -2
  58. package/menu/menu-item-link.js.map +1 -1
  59. package/menu/menu-item.js +2 -3
  60. package/menu/menu-item.js.map +1 -1
  61. package/menu/sub-menu-item.js +1 -2
  62. package/menu/sub-menu-item.js.map +1 -1
  63. package/menusurface/lib/_md-comp-menu-surface.scss +1 -1
  64. package/package.json +1 -1
  65. package/textfield/lib/_filled-text-field.scss +98 -96
  66. package/textfield/lib/_icon.scss +11 -55
  67. package/textfield/lib/_input.scss +4 -6
  68. package/textfield/lib/_outlined-text-field.scss +87 -88
  69. package/textfield/lib/filled-styles.css.js +1 -1
  70. package/textfield/lib/filled-styles.css.js.map +1 -1
  71. package/textfield/lib/outlined-styles.css.js +1 -1
  72. package/textfield/lib/outlined-styles.css.js.map +1 -1
  73. package/textfield/lib/shared-styles.css.js +1 -1
  74. package/textfield/lib/shared-styles.css.js.map +1 -1
  75. package/tokens/_index.scss +1 -1
  76. package/tokens/v0_161/_index.scss +107 -0
  77. package/tokens/v0_161/_md-comp-assist-chip.scss +109 -0
  78. package/tokens/v0_161/_md-comp-badge.scss +58 -0
  79. package/tokens/v0_161/_md-comp-banner.scss +75 -0
  80. package/tokens/v0_161/_md-comp-bottom-app-bar.scss +35 -0
  81. package/tokens/v0_161/_md-comp-carousel-item.scss +65 -0
  82. package/tokens/v0_161/_md-comp-checkbox.scss +126 -0
  83. package/tokens/v0_161/_md-comp-circular-progress-indicator.scss +39 -0
  84. package/tokens/v0_161/_md-comp-data-table.scss +96 -0
  85. package/tokens/v0_161/_md-comp-date-input-modal.scss +89 -0
  86. package/tokens/v0_161/_md-comp-date-picker-docked.scss +246 -0
  87. package/tokens/v0_161/_md-comp-date-picker-modal.scss +305 -0
  88. package/tokens/v0_161/_md-comp-dialog.scss +123 -0
  89. package/tokens/v0_161/_md-comp-divider.scss +25 -0
  90. package/tokens/v0_161/_md-comp-elevated-button.scss +91 -0
  91. package/tokens/v0_161/_md-comp-elevated-card.scss +59 -0
  92. package/tokens/v0_161/_md-comp-extended-fab-branded.scss +86 -0
  93. package/tokens/v0_161/_md-comp-extended-fab-primary.scss +94 -0
  94. package/tokens/v0_161/_md-comp-extended-fab-secondary.scss +95 -0
  95. package/tokens/v0_161/_md-comp-extended-fab-surface.scss +90 -0
  96. package/tokens/v0_161/_md-comp-extended-fab-tertiary.scss +95 -0
  97. package/tokens/v0_161/_md-comp-fab-branded-large.scss +60 -0
  98. package/tokens/v0_161/_md-comp-fab-branded.scss +60 -0
  99. package/tokens/v0_161/_md-comp-fab-primary-large.scss +65 -0
  100. package/tokens/v0_161/_md-comp-fab-primary-small.scss +65 -0
  101. package/tokens/v0_161/_md-comp-fab-primary.scss +65 -0
  102. package/tokens/v0_161/_md-comp-fab-secondary-large.scss +66 -0
  103. package/tokens/v0_161/_md-comp-fab-secondary-small.scss +66 -0
  104. package/tokens/v0_161/_md-comp-fab-secondary.scss +66 -0
  105. package/tokens/v0_161/_md-comp-fab-surface-large.scss +64 -0
  106. package/tokens/v0_161/_md-comp-fab-surface-small.scss +64 -0
  107. package/tokens/v0_161/_md-comp-fab-surface.scss +64 -0
  108. package/tokens/v0_161/_md-comp-fab-tertiary-large.scss +66 -0
  109. package/tokens/v0_161/_md-comp-fab-tertiary-small.scss +66 -0
  110. package/tokens/v0_161/_md-comp-fab-tertiary.scss +66 -0
  111. package/tokens/v0_161/_md-comp-filled-autocomplete.scss +267 -0
  112. package/tokens/v0_161/_md-comp-filled-button.scss +89 -0
  113. package/tokens/v0_161/_md-comp-filled-card.scss +58 -0
  114. package/tokens/v0_161/_md-comp-filled-icon-button.scss +79 -0
  115. package/tokens/v0_161/_md-comp-filled-menu-button.scss +98 -0
  116. package/tokens/v0_161/_md-comp-filled-select.scss +272 -0
  117. package/tokens/v0_161/_md-comp-filled-text-field.scss +189 -0
  118. package/tokens/v0_161/_md-comp-filled-tonal-button.scss +99 -0
  119. package/tokens/v0_161/_md-comp-filled-tonal-icon-button.scss +86 -0
  120. package/tokens/v0_161/_md-comp-filter-chip.scss +209 -0
  121. package/tokens/v0_161/_md-comp-full-screen-dialog.scss +111 -0
  122. package/tokens/v0_161/_md-comp-icon-button.scss +70 -0
  123. package/tokens/v0_161/_md-comp-input-chip.scss +184 -0
  124. package/tokens/v0_161/_md-comp-linear-progress-indicator.scss +41 -0
  125. package/tokens/v0_161/_md-comp-list.scss +248 -0
  126. package/tokens/v0_161/_md-comp-menu.scss +37 -0
  127. package/tokens/v0_161/_md-comp-navigation-bar.scss +114 -0
  128. package/tokens/v0_161/_md-comp-navigation-drawer.scss +162 -0
  129. package/tokens/v0_161/_md-comp-navigation-rail.scss +131 -0
  130. package/tokens/v0_161/_md-comp-outlined-autocomplete.scss +257 -0
  131. package/tokens/v0_161/_md-comp-outlined-button.scss +84 -0
  132. package/tokens/v0_161/_md-comp-outlined-card.scss +65 -0
  133. package/tokens/v0_161/_md-comp-outlined-icon-button.scss +79 -0
  134. package/tokens/v0_161/_md-comp-outlined-menu-button.scss +94 -0
  135. package/tokens/v0_161/_md-comp-outlined-segmented-button.scss +112 -0
  136. package/tokens/v0_161/_md-comp-outlined-select.scss +262 -0
  137. package/tokens/v0_161/_md-comp-outlined-text-field.scss +171 -0
  138. package/tokens/v0_161/_md-comp-plain-tooltip.scss +55 -0
  139. package/tokens/v0_161/_md-comp-primary-navigation-tab.scss +121 -0
  140. package/tokens/v0_161/_md-comp-radio-button.scss +68 -0
  141. package/tokens/v0_161/_md-comp-rich-tooltip.scss +121 -0
  142. package/tokens/v0_161/_md-comp-scrim.scss +25 -0
  143. package/tokens/v0_161/_md-comp-search-bar.scss +99 -0
  144. package/tokens/v0_161/_md-comp-search-view.scss +93 -0
  145. package/tokens/v0_161/_md-comp-secondary-navigation-tab.scss +84 -0
  146. package/tokens/v0_161/_md-comp-sheet-bottom.scss +45 -0
  147. package/tokens/v0_161/_md-comp-sheet-floating.scss +34 -0
  148. package/tokens/v0_161/_md-comp-sheet-side.scss +91 -0
  149. package/tokens/v0_161/_md-comp-slider.scss +114 -0
  150. package/tokens/v0_161/_md-comp-snackbar.scss +127 -0
  151. package/tokens/v0_161/_md-comp-standard-menu-button.scss +98 -0
  152. package/tokens/v0_161/_md-comp-suggestion-chip.scss +125 -0
  153. package/tokens/v0_161/_md-comp-switch.scss +136 -0
  154. package/tokens/v0_161/_md-comp-text-button.scss +77 -0
  155. package/tokens/v0_161/_md-comp-time-input.scss +218 -0
  156. package/tokens/v0_161/_md-comp-time-picker.scss +264 -0
  157. package/tokens/v0_161/_md-comp-top-app-bar-large.scss +63 -0
  158. package/tokens/v0_161/_md-comp-top-app-bar-medium.scss +63 -0
  159. package/tokens/v0_161/_md-comp-top-app-bar-small-centered.scss +66 -0
  160. package/tokens/v0_161/_md-comp-top-app-bar-small.scss +64 -0
  161. package/tokens/v0_161/_md-ref-palette.scss +107 -0
  162. package/tokens/v0_161/_md-ref-typeface.scss +21 -0
  163. package/tokens/v0_161/_md-sys-color.scss +904 -0
  164. package/tokens/v0_161/_md-sys-elevation.scss +21 -0
  165. package/tokens/v0_161/_md-sys-motion.scss +53 -0
  166. package/tokens/v0_161/_md-sys-shape.scss +30 -0
  167. package/tokens/v0_161/_md-sys-state.scss +19 -0
  168. package/tokens/v0_161/_md-sys-typescale.scss +284 -0
  169. package/tokens/v0_161/index.test.css.js +9 -0
  170. package/tokens/v0_161/index.test.css.js.map +1 -0
  171. package/tokens/v0_161/index.test.scss +584 -0
  172. package/tokens/v0_161/lib.test.css.js +9 -0
  173. package/tokens/v0_161/lib.test.css.js.map +1 -0
  174. package/tokens/v0_161/lib.test.scss +663 -0
  175. package/controller/foundation.d.ts +0 -24
  176. package/controller/foundation.js +0 -18
  177. package/controller/foundation.js.map +0 -1
  178. package/controller/observer-foundation.d.ts +0 -25
  179. package/controller/observer-foundation.js +0 -37
  180. package/controller/observer-foundation.js.map +0 -1
  181. package/controller/observer.d.ts +0 -52
  182. package/controller/observer.js +0 -149
  183. package/controller/observer.js.map +0 -1
  184. package/decorators/bound.d.ts +0 -40
  185. package/decorators/bound.js +0 -49
  186. package/decorators/bound.js.map +0 -1
  187. package/list/lib/avatar/_list-item-avatar.scss +0 -40
  188. package/list/lib/avatar/list-item-avatar-styles.css.js +0 -9
  189. package/list/lib/avatar/list-item-avatar-styles.css.js.map +0 -1
  190. package/list/lib/avatar/list-item-avatar-styles.scss +0 -10
  191. package/list/lib/avatar/list-item-avatar.d.ts +0 -21
  192. package/list/lib/avatar/list-item-avatar.js +0 -48
  193. package/list/lib/avatar/list-item-avatar.js.map +0 -1
  194. package/list/lib/icon/_list-item-icon.scss +0 -71
  195. package/list/lib/icon/list-item-icon-styles.css.js +0 -9
  196. package/list/lib/icon/list-item-icon-styles.css.js.map +0 -1
  197. package/list/lib/icon/list-item-icon-styles.scss +0 -10
  198. package/list/lib/icon/list-item-icon.d.ts +0 -9
  199. package/list/lib/icon/list-item-icon.js +0 -15
  200. package/list/lib/icon/list-item-icon.js.map +0 -1
  201. package/list/lib/image/_list-item-image.scss +0 -63
  202. package/list/lib/image/list-item-image-styles.css.d.ts +0 -1
  203. package/list/lib/image/list-item-image-styles.css.js +0 -9
  204. package/list/lib/image/list-item-image-styles.css.js.map +0 -1
  205. package/list/lib/image/list-item-image-styles.scss +0 -10
  206. package/list/lib/image/list-item-image.d.ts +0 -21
  207. package/list/lib/image/list-item-image.js +0 -48
  208. package/list/lib/image/list-item-image.js.map +0 -1
  209. package/list/lib/listitem/list-item-private-styles.css.d.ts +0 -1
  210. package/list/lib/listitem/list-item-private-styles.css.js +0 -9
  211. package/list/lib/listitem/list-item-private-styles.css.js.map +0 -1
  212. package/list/lib/listitem/list-item-private-styles.scss +0 -10
  213. package/list/lib/video/_list-item-video.scss +0 -71
  214. package/list/lib/video/list-item-video-styles.css.d.ts +0 -1
  215. package/list/lib/video/list-item-video-styles.css.js +0 -9
  216. package/list/lib/video/list-item-video-styles.css.js.map +0 -1
  217. package/list/lib/video/list-item-video-styles.scss +0 -10
  218. package/list/lib/video/list-item-video.d.ts +0 -53
  219. package/list/lib/video/list-item-video.js +0 -115
  220. package/list/lib/video/list-item-video.js.map +0 -1
  221. package/list/list-item-avatar.d.ts +0 -20
  222. package/list/list-item-avatar.js +0 -23
  223. package/list/list-item-avatar.js.map +0 -1
  224. package/list/list-item-icon.d.ts +0 -20
  225. package/list/list-item-icon.js +0 -23
  226. package/list/list-item-icon.js.map +0 -1
  227. package/list/list-item-image.d.ts +0 -20
  228. package/list/list-item-image.js +0 -23
  229. package/list/list-item-image.js.map +0 -1
  230. package/list/list-item-video.d.ts +0 -20
  231. package/list/list-item-video.js +0 -23
  232. package/list/list-item-video.js.map +0 -1
  233. package/menu/lib/menuitem/menu-item-private-styles.css.d.ts +0 -1
  234. package/menu/lib/menuitem/menu-item-private-styles.css.js +0 -9
  235. package/menu/lib/menuitem/menu-item-private-styles.css.js.map +0 -1
  236. package/menu/lib/menuitem/menu-item-private-styles.scss +0 -10
  237. /package/{list/lib/avatar/list-item-avatar-styles.css.d.ts → tokens/v0_161/index.test.css.d.ts} +0 -0
  238. /package/{list/lib/icon/list-item-icon-styles.css.d.ts → tokens/v0_161/lib.test.css.d.ts} +0 -0
@@ -5,9 +5,9 @@
5
5
  */
6
6
  import { __decorate, __metadata } from "tslib";
7
7
  import { html, LitElement, nothing } from 'lit';
8
- import { property, queryAsync, state } from 'lit/decorators.js';
8
+ import { property, query, state } from 'lit/decorators.js';
9
9
  import { classMap } from 'lit/directives/class-map.js';
10
- import { createAnimationSignal, EASING } from '../../motion/animation.js';
10
+ import { EASING } from '../../motion/animation.js';
11
11
  /**
12
12
  * A field component.
13
13
  */
@@ -18,6 +18,7 @@ export class Field extends LitElement {
18
18
  this.error = false;
19
19
  this.focused = false;
20
20
  this.populated = false;
21
+ this.resizable = false;
21
22
  this.required = false;
22
23
  /**
23
24
  * Whether or not the field has leading content.
@@ -28,7 +29,6 @@ export class Field extends LitElement {
28
29
  */
29
30
  this.hasEnd = false;
30
31
  this.isAnimating = false;
31
- this.labelAnimationSignal = createAnimationSignal();
32
32
  }
33
33
  update(props) {
34
34
  // Client-side property updates
@@ -55,27 +55,30 @@ export class Field extends LitElement {
55
55
  'with-start': this.hasStart,
56
56
  'with-end': this.hasEnd,
57
57
  'populated': this.populated,
58
+ 'resizable': this.resizable,
58
59
  'required': this.required,
59
60
  'no-label': !this.label,
60
61
  };
61
62
  return html `
62
63
  <div class="field ${classMap(classes)}">
63
- <div class="container">
64
+ <div class="container-overflow">
65
+ ${outline}
64
66
  ${this.renderBackground?.()}
65
67
  ${this.renderIndicator?.()}
66
- ${outline}
67
- <div class="start">
68
- <slot name="start"></slot>
69
- </div>
70
- <div class="middle">
71
- ${restingLabel}
72
- ${outline ? nothing : floatingLabel}
73
- <div class="content">
74
- <slot></slot>
68
+ <div class="container">
69
+ <div class="start">
70
+ <slot name="start"></slot>
71
+ </div>
72
+ <div class="middle">
73
+ ${restingLabel}
74
+ ${outline ? nothing : floatingLabel}
75
+ <div class="content">
76
+ <slot></slot>
77
+ </div>
78
+ </div>
79
+ <div class="end">
80
+ <slot name="end"></slot>
75
81
  </div>
76
- </div>
77
- <div class="end">
78
- <slot name="end"></slot>
79
82
  </div>
80
83
  </div>
81
84
 
@@ -93,13 +96,13 @@ export class Field extends LitElement {
93
96
  renderLabel(isFloating) {
94
97
  let visible;
95
98
  if (isFloating) {
96
- // Floating label is visible when focused/populated. It is never visible
97
- // while animating.
98
- visible = (this.focused || this.populated) && !this.isAnimating;
99
+ // Floating label is visible when focused/populated or when animating.
100
+ visible = this.focused || this.populated || this.isAnimating;
99
101
  }
100
102
  else {
101
- // Resting label is visible when unfocused or while animating.
102
- visible = !(this.focused || this.populated) || this.isAnimating;
103
+ // Resting label is visible when unfocused. It is never visible while
104
+ // animating.
105
+ visible = !this.focused && !this.populated && !this.isAnimating;
103
106
  }
104
107
  const classes = {
105
108
  'hidden': !visible,
@@ -115,7 +118,7 @@ export class Field extends LitElement {
115
118
  >${labelText}</span>
116
119
  `;
117
120
  }
118
- async animateLabelIfNeeded({ wasFocused, wasPopulated }) {
121
+ animateLabelIfNeeded({ wasFocused, wasPopulated }) {
119
122
  if (!this.label) {
120
123
  return;
121
124
  }
@@ -127,18 +130,12 @@ export class Field extends LitElement {
127
130
  return;
128
131
  }
129
132
  this.isAnimating = true;
130
- const signal = this.labelAnimationSignal.start();
133
+ this.labelAnimation?.cancel();
131
134
  // Only one label is visible at a time for clearer text rendering.
132
- // The resting label is visible and used during animation. At the end of the
133
- // animation, it will either remain visible (if resting) or hide and the
134
- // floating label will be shown.
135
- const labelEl = await this.restingLabelEl;
136
- const keyframes = await this.getLabelKeyframes();
137
- if (signal.aborted) {
138
- // Don't animate if this animation was requested to stop while getting
139
- // the label element or calculating keyframes
140
- return;
141
- }
135
+ // The floating label is visible and used during animation. At the end of
136
+ // the animation, it will either remain visible (if floating) or hide and
137
+ // the resting label will be shown.
138
+ //
142
139
  // We don't use forward filling because if the dimensions of the text field
143
140
  // change (leading icon removed, density changes, etc), then the animation
144
141
  // will be inaccurate.
@@ -146,42 +143,52 @@ export class Field extends LitElement {
146
143
  // Re-calculating the animation each time will prevent any visual glitches
147
144
  // from appearing.
148
145
  // TODO(b/241113345): use animation tokens
149
- const animation = labelEl.animate(keyframes, { duration: 150, easing: EASING.STANDARD });
150
- signal.addEventListener('abort', () => {
151
- // Cancel if requested (another animation starts playing).
152
- animation.cancel();
153
- });
154
- animation.addEventListener('finish', () => {
146
+ this.labelAnimation = this.floatingLabelEl?.animate(this.getLabelKeyframes(), { duration: 150, easing: EASING.STANDARD });
147
+ this.labelAnimation?.addEventListener('finish', () => {
155
148
  // At the end of the animation, update the visible label.
156
149
  this.isAnimating = false;
157
- this.labelAnimationSignal.finish();
158
150
  });
159
151
  }
160
- async getLabelKeyframes() {
161
- const floatingLabelEl = await this.floatingLabelEl;
162
- const restingLabelEl = await this.restingLabelEl;
163
- const { x: floatingX, y: floatingY, width: floatingWidth, height: floatingHeight } = floatingLabelEl.getBoundingClientRect();
164
- const { x: restingX, y: restingY, width: restingWidth, height: restingHeight } = restingLabelEl.getBoundingClientRect();
152
+ getLabelKeyframes() {
153
+ const { floatingLabelEl, restingLabelEl } = this;
154
+ if (!floatingLabelEl || !restingLabelEl) {
155
+ return [];
156
+ }
157
+ const { x: floatingX, y: floatingY, height: floatingHeight } = floatingLabelEl.getBoundingClientRect();
158
+ const { x: restingX, y: restingY, height: restingHeight } = restingLabelEl.getBoundingClientRect();
159
+ const floatingScrollWidth = floatingLabelEl.scrollWidth;
160
+ const restingScrollWidth = restingLabelEl.scrollWidth;
165
161
  // Scale by width ratio instead of font size since letter-spacing will scale
166
162
  // incorrectly. Using the width we can better approximate the adjusted
167
- // scale and compensate for tracking.
168
- const scale = floatingWidth / restingWidth;
169
- const xDelta = floatingX - restingX;
163
+ // scale and compensate for tracking and overflow.
164
+ // (use scrollWidth instead of width to account for clipped labels)
165
+ const scale = restingScrollWidth / floatingScrollWidth;
166
+ const xDelta = restingX - floatingX;
170
167
  // The line-height of the resting and floating label are different. When
171
- // we move the resting label up to the floating label's position, it won't
168
+ // we move the floating label down to the resting label's position, it won't
172
169
  // exactly match because of this. We need to adjust by half of what the
173
- // final scaled resting label's height will be.
174
- const yDelta = floatingY - restingY +
175
- Math.round((floatingHeight - restingHeight * scale) / 2);
176
- // Create the two transforms: resting to floating (using the calculations
177
- // above), and floating to resting (re-setting the transform to initial
170
+ // final scaled floating label's height will be.
171
+ const yDelta = restingY - floatingY +
172
+ Math.round((restingHeight - floatingHeight * scale) / 2);
173
+ // Create the two transforms: floating to resting (using the calculations
174
+ // above), and resting to floating (re-setting the transform to initial
178
175
  // values).
179
- const floatTransform = `translateX(${xDelta}px) translateY(calc(-50% + ${yDelta}px)) scale(${scale})`;
180
- const restTransform = `translateX(0) translateY(-50%) scale(1)`;
176
+ const restTransform = `translateX(${xDelta}px) translateY(${yDelta}px) scale(${scale})`;
177
+ const floatTransform = `translateX(0) translateY(0) scale(1)`;
178
+ // Constrain the floating labels width to a scaled percentage of the
179
+ // resting label's width. This will prevent long clipped labels from
180
+ // overflowing the container.
181
+ const restingClientWidth = restingLabelEl.clientWidth;
182
+ const isRestingClipped = restingScrollWidth > restingClientWidth;
183
+ const width = isRestingClipped ? `${restingClientWidth / scale}px` : '';
181
184
  if (this.focused || this.populated) {
182
- return [{ transform: restTransform }, { transform: floatTransform }];
185
+ return [
186
+ { transform: restTransform, width }, { transform: floatTransform, width }
187
+ ];
183
188
  }
184
- return [{ transform: floatTransform }, { transform: restTransform }];
189
+ return [
190
+ { transform: floatTransform, width }, { transform: restTransform, width }
191
+ ];
185
192
  }
186
193
  }
187
194
  __decorate([
@@ -204,6 +211,10 @@ __decorate([
204
211
  property({ type: Boolean }),
205
212
  __metadata("design:type", Object)
206
213
  ], Field.prototype, "populated", void 0);
214
+ __decorate([
215
+ property({ type: Boolean }),
216
+ __metadata("design:type", Object)
217
+ ], Field.prototype, "resizable", void 0);
207
218
  __decorate([
208
219
  property({ type: Boolean }),
209
220
  __metadata("design:type", Object)
@@ -221,11 +232,11 @@ __decorate([
221
232
  __metadata("design:type", Object)
222
233
  ], Field.prototype, "isAnimating", void 0);
223
234
  __decorate([
224
- queryAsync('.label.floating'),
225
- __metadata("design:type", Promise)
235
+ query('.label.floating'),
236
+ __metadata("design:type", HTMLElement)
226
237
  ], Field.prototype, "floatingLabelEl", void 0);
227
238
  __decorate([
228
- queryAsync('.label.resting'),
229
- __metadata("design:type", Promise)
239
+ query('.label.resting'),
240
+ __metadata("design:type", HTMLElement)
230
241
  ], Field.prototype, "restingLabelEl", void 0);
231
242
  //# sourceMappingURL=field.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"field.js","sourceRoot":"","sources":["field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiC,MAAM,KAAK,CAAC;AAC9E,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,qBAAqB,EAAE,MAAM,EAAC,MAAM,2BAA2B,CAAC;AAExE;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,UAAU;IAArC;;QAC6B,aAAQ,GAAG,KAAK,CAAC;QACjB,UAAK,GAAG,KAAK,CAAC;QACd,YAAO,GAAG,KAAK,CAAC;QAEhB,cAAS,GAAG,KAAK,CAAC;QAClB,aAAQ,GAAG,KAAK,CAAC;QAE5C;;WAEG;QACwB,aAAQ,GAAG,KAAK,CAAC;QAE5C;;WAEG;QACwB,WAAM,GAAG,KAAK,CAAC;QAEzB,gBAAW,GAAG,KAAK,CAAC;QACpB,yBAAoB,GAAG,qBAAqB,EAAE,CAAC;IAqMlE,CAAC;IA/LoB,MAAM,CAAC,KAA4B;QACpD,+BAA+B;QAE/B,kDAAkD;QAClD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE;YACjC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;YAC3B,IAAI,CAAC,OAAO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AC,IAAI,EAAE,OAAO,EAAC,CAAC;;uCAAkB;AAK5C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;qCAAgB;AAE1C;IAAC,KAAK,EAAE;;0CAA6B;AAErC;IAAC,UAAU,CAAC,iBAAiB,CAAC;;8CAC0B;AACxD;IAAC,UAAU,CAAC,gBAAgB,CAAC;;6CAC0B","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement, nothing, PropertyValues, TemplateResult} from 'lit';\nimport {property, queryAsync, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {createAnimationSignal, EASING} from '../../motion/animation.js';\n\n/**\n * A field component.\n */\nexport class Field extends LitElement {\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean}) error = false;\n @property({type: Boolean}) focused = false;\n @property({type: String}) label?: string;\n @property({type: Boolean}) populated = false;\n @property({type: Boolean}) required = false;\n\n /**\n * Whether or not the field has leading content.\n */\n @property({type: Boolean}) hasStart = false;\n\n /**\n * Whether or not the field has trailing content.\n */\n @property({type: Boolean}) hasEnd = false;\n\n @state() private isAnimating = false;\n private readonly labelAnimationSignal = createAnimationSignal();\n @queryAsync('.label.floating')\n private readonly floatingLabelEl!: Promise<HTMLElement>;\n @queryAsync('.label.resting')\n private readonly restingLabelEl!: Promise<HTMLElement>;\n\n protected override update(props: PropertyValues<Field>) {\n // Client-side property updates\n\n // When disabling, remove focus styles if focused.\n if (this.disabled && this.focused) {\n props.set('focused', true);\n this.focused = false;\n }\n\n // Animate if focused or populated change.\n this.animateLabelIfNeeded({\n wasFocused: props.get('focused'),\n wasPopulated: props.get('populated')\n });\n\n super.update(props);\n }\n\n protected override render() {\n const floatingLabel = this.renderLabel(/*isFloating*/ true);\n const restingLabel = this.renderLabel(/*isFloating*/ false);\n const outline = this.renderOutline?.(floatingLabel);\n const classes = {\n 'disabled': this.disabled,\n 'error': this.error && !this.disabled,\n 'focused': this.focused,\n 'with-start': this.hasStart,\n 'with-end': this.hasEnd,\n 'populated': this.populated,\n 'required': this.required,\n 'no-label': !this.label,\n };\n\n return html`\n <div class=\"field ${classMap(classes)}\">\n <div class=\"container\">\n ${this.renderBackground?.()}\n ${this.renderIndicator?.()}\n ${outline}\n <div class=\"start\">\n <slot name=\"start\"></slot>\n </div>\n <div class=\"middle\">\n ${restingLabel}\n ${outline ? nothing : floatingLabel}\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n <div class=\"end\">\n <slot name=\"end\"></slot>\n </div>\n </div>\n\n <div class=\"supporting-text\">\n <div class=\"supporting-text-start\">\n <slot name=\"supporting-text\"></slot>\n </div>\n <div class=\"supporting-text-end\">\n <slot name=\"supporting-text-end\"></slot>\n </div>\n </div>\n </div>\n `;\n }\n\n protected renderBackground?(): TemplateResult;\n protected renderIndicator?(): TemplateResult;\n protected renderOutline?(floatingLabel: TemplateResult): TemplateResult;\n\n private renderLabel(isFloating: boolean) {\n let visible: boolean;\n if (isFloating) {\n // Floating label is visible when focused/populated. It is never visible\n // while animating.\n visible = (this.focused || this.populated) && !this.isAnimating;\n } else {\n // Resting label is visible when unfocused or while animating.\n visible = !(this.focused || this.populated) || this.isAnimating;\n }\n\n const classes = {\n 'hidden': !visible,\n 'floating': isFloating,\n 'resting': !isFloating,\n };\n\n let labelText = this.label ?? '';\n // Add '*' if a label is present and the field is required\n labelText += this.required && labelText ? '*' : '';\n\n return html`\n <span class=\"label ${classMap(classes)}\"\n aria-hidden=${!visible}\n >${labelText}</span>\n `;\n }\n\n private async animateLabelIfNeeded({wasFocused, wasPopulated}: {\n wasFocused?: boolean,\n wasPopulated?: boolean\n }) {\n if (!this.label) {\n return;\n }\n\n wasFocused ??= this.focused;\n wasPopulated ??= this.populated;\n const wasFloating = wasFocused || wasPopulated;\n const shouldBeFloating = this.focused || this.populated;\n if (wasFloating === shouldBeFloating) {\n return;\n }\n\n this.isAnimating = true;\n const signal = this.labelAnimationSignal.start();\n\n // Only one label is visible at a time for clearer text rendering.\n // The resting label is visible and used during animation. At the end of the\n // animation, it will either remain visible (if resting) or hide and the\n // floating label will be shown.\n const labelEl = await this.restingLabelEl;\n const keyframes = await this.getLabelKeyframes();\n if (signal.aborted) {\n // Don't animate if this animation was requested to stop while getting\n // the label element or calculating keyframes\n return;\n }\n\n // We don't use forward filling because if the dimensions of the text field\n // change (leading icon removed, density changes, etc), then the animation\n // will be inaccurate.\n //\n // Re-calculating the animation each time will prevent any visual glitches\n // from appearing.\n // TODO(b/241113345): use animation tokens\n const animation =\n labelEl.animate(keyframes, {duration: 150, easing: EASING.STANDARD});\n\n signal.addEventListener('abort', () => {\n // Cancel if requested (another animation starts playing).\n animation.cancel();\n });\n\n animation.addEventListener('finish', () => {\n // At the end of the animation, update the visible label.\n this.isAnimating = false;\n this.labelAnimationSignal.finish();\n });\n }\n\n private async getLabelKeyframes() {\n const floatingLabelEl = await this.floatingLabelEl;\n const restingLabelEl = await this.restingLabelEl;\n const {\n x: floatingX,\n y: floatingY,\n width: floatingWidth,\n height: floatingHeight\n } = floatingLabelEl.getBoundingClientRect();\n const {\n x: restingX,\n y: restingY,\n width: restingWidth,\n height: restingHeight\n } = restingLabelEl.getBoundingClientRect();\n // Scale by width ratio instead of font size since letter-spacing will scale\n // incorrectly. Using the width we can better approximate the adjusted\n // scale and compensate for tracking.\n const scale = floatingWidth / restingWidth;\n const xDelta = floatingX - restingX;\n // The line-height of the resting and floating label are different. When\n // we move the resting label up to the floating label's position, it won't\n // exactly match because of this. We need to adjust by half of what the\n // final scaled resting label's height will be.\n const yDelta = floatingY - restingY +\n Math.round((floatingHeight - restingHeight * scale) / 2);\n\n // Create the two transforms: resting to floating (using the calculations\n // above), and floating to resting (re-setting the transform to initial\n // values).\n const floatTransform = `translateX(${xDelta}px) translateY(calc(-50% + ${\n yDelta}px)) scale(${scale})`;\n const restTransform = `translateX(0) translateY(-50%) scale(1)`;\n\n if (this.focused || this.populated) {\n return [{transform: restTransform}, {transform: floatTransform}];\n }\n\n return [{transform: floatTransform}, {transform: restTransform}];\n }\n}\n"]}
1
+ {"version":3,"file":"field.js","sourceRoot":"","sources":["field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiC,MAAM,KAAK,CAAC;AAC9E,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AAEjD;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,UAAU;IAArC;;QAC6B,aAAQ,GAAG,KAAK,CAAC;QACjB,UAAK,GAAG,KAAK,CAAC;QACd,YAAO,GAAG,KAAK,CAAC;QAEhB,cAAS,GAAG,KAAK,CAAC;QAClB,cAAS,GAAG,KAAK,CAAC;QAClB,aAAQ,GAAG,KAAK,CAAC;QAE5C;;WAEG;QACwB,aAAQ,GAAG,KAAK,CAAC;QAE5C;;WAEG;QACwB,WAAM,GAAG,KAAK,CAAC;QAEzB,gBAAW,GAAG,KAAK,CAAC;IAkMvC,CAAC;IA7LoB,MAAM,CAAC,KAA4B;QACpD,+BAA+B;QAE/B,kDAAkD;QAClD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE;YACjC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;YAC3B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;SACtB;QAED,0CAA0C;QAC1C,IAAI,CAAC,oBAAoB,CAAC;YACxB,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC;YAChC,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;SACrC,CAAC,CAAC;QAEH,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;I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gB;AAE1C;IAAC,KAAK,EAAE;;0CAA6B;AAErC;IAAC,KAAK,CAAC,iBAAiB,CAAC;8BAAoC,WAAW;8CAAM;AAC9E;IAAC,KAAK,CAAC,gBAAgB,CAAC;8BAAmC,WAAW;6CAAM","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement, nothing, PropertyValues, TemplateResult} from 'lit';\nimport {property, query, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {EASING} from '../../motion/animation.js';\n\n/**\n * A field component.\n */\nexport class Field extends LitElement {\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean}) error = false;\n @property({type: Boolean}) focused = false;\n @property({type: String}) label?: string;\n @property({type: Boolean}) populated = false;\n @property({type: Boolean}) resizable = false;\n @property({type: Boolean}) required = false;\n\n /**\n * Whether or not the field has leading content.\n */\n @property({type: Boolean}) hasStart = false;\n\n /**\n * Whether or not the field has trailing content.\n */\n @property({type: Boolean}) hasEnd = false;\n\n @state() private isAnimating = false;\n private labelAnimation?: Animation;\n @query('.label.floating') private readonly floatingLabelEl!: HTMLElement|null;\n @query('.label.resting') private readonly restingLabelEl!: HTMLElement|null;\n\n protected override update(props: PropertyValues<Field>) {\n // Client-side property updates\n\n // When disabling, remove focus styles if focused.\n if (this.disabled && this.focused) {\n props.set('focused', true);\n this.focused = false;\n }\n\n // Animate if focused or populated change.\n this.animateLabelIfNeeded({\n wasFocused: props.get('focused'),\n wasPopulated: props.get('populated')\n });\n\n super.update(props);\n }\n\n protected override render() {\n const floatingLabel = this.renderLabel(/*isFloating*/ true);\n const restingLabel = this.renderLabel(/*isFloating*/ false);\n const outline = this.renderOutline?.(floatingLabel);\n const classes = {\n 'disabled': this.disabled,\n 'error': this.error && !this.disabled,\n 'focused': this.focused,\n 'with-start': this.hasStart,\n 'with-end': this.hasEnd,\n 'populated': this.populated,\n 'resizable': this.resizable,\n 'required': this.required,\n 'no-label': !this.label,\n };\n\n return html`\n <div class=\"field ${classMap(classes)}\">\n <div class=\"container-overflow\">\n ${outline}\n ${this.renderBackground?.()}\n ${this.renderIndicator?.()}\n <div class=\"container\">\n <div class=\"start\">\n <slot name=\"start\"></slot>\n </div>\n <div class=\"middle\">\n ${restingLabel}\n ${outline ? nothing : floatingLabel}\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n <div class=\"end\">\n <slot name=\"end\"></slot>\n </div>\n </div>\n </div>\n\n <div class=\"supporting-text\">\n <div class=\"supporting-text-start\">\n <slot name=\"supporting-text\"></slot>\n </div>\n <div class=\"supporting-text-end\">\n <slot name=\"supporting-text-end\"></slot>\n </div>\n </div>\n </div>\n `;\n }\n\n protected renderBackground?(): TemplateResult;\n protected renderIndicator?(): TemplateResult;\n protected renderOutline?(floatingLabel: TemplateResult): TemplateResult;\n\n private renderLabel(isFloating: boolean) {\n let visible: boolean;\n if (isFloating) {\n // Floating label is visible when focused/populated or when animating.\n visible = this.focused || this.populated || this.isAnimating;\n } else {\n // Resting label is visible when unfocused. It is never visible while\n // animating.\n visible = !this.focused && !this.populated && !this.isAnimating;\n }\n\n const classes = {\n 'hidden': !visible,\n 'floating': isFloating,\n 'resting': !isFloating,\n };\n\n let labelText = this.label ?? '';\n // Add '*' if a label is present and the field is required\n labelText += this.required && labelText ? '*' : '';\n\n return html`\n <span class=\"label ${classMap(classes)}\"\n aria-hidden=${!visible}\n >${labelText}</span>\n `;\n }\n\n private animateLabelIfNeeded({wasFocused, wasPopulated}: {\n wasFocused?: boolean,\n wasPopulated?: boolean\n }) {\n if (!this.label) {\n return;\n }\n\n wasFocused ??= this.focused;\n wasPopulated ??= this.populated;\n const wasFloating = wasFocused || wasPopulated;\n const shouldBeFloating = this.focused || this.populated;\n if (wasFloating === shouldBeFloating) {\n return;\n }\n\n this.isAnimating = true;\n this.labelAnimation?.cancel();\n\n // Only one label is visible at a time for clearer text rendering.\n // The floating label is visible and used during animation. At the end of\n // the animation, it will either remain visible (if floating) or hide and\n // the resting label will be shown.\n //\n // We don't use forward filling because if the dimensions of the text field\n // change (leading icon removed, density changes, etc), then the animation\n // will be inaccurate.\n //\n // Re-calculating the animation each time will prevent any visual glitches\n // from appearing.\n // TODO(b/241113345): use animation tokens\n this.labelAnimation = this.floatingLabelEl?.animate(\n this.getLabelKeyframes(), {duration: 150, easing: EASING.STANDARD});\n\n this.labelAnimation?.addEventListener('finish', () => {\n // At the end of the animation, update the visible label.\n this.isAnimating = false;\n });\n }\n\n private getLabelKeyframes() {\n const {floatingLabelEl, restingLabelEl} = this;\n if (!floatingLabelEl || !restingLabelEl) {\n return [];\n }\n\n const {x: floatingX, y: floatingY, height: floatingHeight} =\n floatingLabelEl.getBoundingClientRect();\n const {x: restingX, y: restingY, height: restingHeight} =\n restingLabelEl.getBoundingClientRect();\n const floatingScrollWidth = floatingLabelEl.scrollWidth;\n const restingScrollWidth = restingLabelEl.scrollWidth;\n // Scale by width ratio instead of font size since letter-spacing will scale\n // incorrectly. Using the width we can better approximate the adjusted\n // scale and compensate for tracking and overflow.\n // (use scrollWidth instead of width to account for clipped labels)\n const scale = restingScrollWidth / floatingScrollWidth;\n const xDelta = restingX - floatingX;\n // The line-height of the resting and floating label are different. When\n // we move the floating label down to the resting label's position, it won't\n // exactly match because of this. We need to adjust by half of what the\n // final scaled floating label's height will be.\n const yDelta = restingY - floatingY +\n Math.round((restingHeight - floatingHeight * scale) / 2);\n\n // Create the two transforms: floating to resting (using the calculations\n // above), and resting to floating (re-setting the transform to initial\n // values).\n const restTransform =\n `translateX(${xDelta}px) translateY(${yDelta}px) scale(${scale})`;\n const floatTransform = `translateX(0) translateY(0) scale(1)`;\n\n // Constrain the floating labels width to a scaled percentage of the\n // resting label's width. This will prevent long clipped labels from\n // overflowing the container.\n const restingClientWidth = restingLabelEl.clientWidth;\n const isRestingClipped = restingScrollWidth > restingClientWidth;\n const width = isRestingClipped ? `${restingClientWidth / scale}px` : '';\n if (this.focused || this.populated) {\n return [\n {transform: restTransform, width}, {transform: floatTransform, width}\n ];\n }\n\n return [\n {transform: floatTransform, width}, {transform: restTransform, width}\n ];\n }\n}\n"]}
@@ -3,16 +3,11 @@
3
3
  * Copyright 2021 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { PropertyValues } from 'lit';
7
6
  import { Field } from './field.js';
8
7
  /**
9
8
  * A filled field component.
10
9
  */
11
10
  export declare class FilledField extends Field {
12
- private strokeTransformOrigin;
13
- constructor();
14
11
  protected renderBackground(): import("lit-html").TemplateResult<1>;
15
12
  protected renderIndicator(): import("lit-html").TemplateResult<1>;
16
- protected update(props: PropertyValues<FilledField>): void;
17
- private updateStrokeTransformOrigin;
18
13
  }
@@ -3,59 +3,20 @@
3
3
  * Copyright 2021 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { __decorate, __metadata } from "tslib";
7
6
  import { html } from 'lit';
8
- import { state } from 'lit/decorators.js';
9
- import { styleMap } from 'lit/directives/style-map.js';
10
7
  import { Field } from './field.js';
11
8
  /**
12
9
  * A filled field component.
13
10
  */
14
11
  export class FilledField extends Field {
15
- constructor() {
16
- super();
17
- this.strokeTransformOrigin = '';
18
- this.addEventListener('click', event => {
19
- if (!this.disabled) {
20
- this.updateStrokeTransformOrigin(event);
21
- }
22
- });
23
- }
24
12
  renderBackground() {
25
13
  return html `
14
+ <div class="background"></div>
26
15
  <div class="state-layer"></div>
27
16
  `;
28
17
  }
29
18
  renderIndicator() {
30
- const strokeStyle = { transformOrigin: this.strokeTransformOrigin };
31
- return html `
32
- <div class="active-indicator" style="${styleMap(strokeStyle)}"></div>
33
- `;
34
- }
35
- update(props) {
36
- // Upon losing focus, the stroke resets to expanding from the center, such
37
- // as when re-focusing with a keyboard.
38
- const unfocusing = props.has('focused') && !this.focused;
39
- if (unfocusing) {
40
- this.updateStrokeTransformOrigin();
41
- }
42
- super.update(props);
43
- }
44
- updateStrokeTransformOrigin(event) {
45
- let transformOrigin = '';
46
- if (event) {
47
- // Can't use instanceof TouchEvent since Firefox does not provide the
48
- // constructor globally.
49
- const isTouchEvent = 'touches' in event;
50
- const eventX = isTouchEvent ? event.touches[0].clientX : event.clientX;
51
- const rootRect = this.getBoundingClientRect();
52
- transformOrigin = `${eventX - rootRect.x}px`;
53
- }
54
- this.strokeTransformOrigin = transformOrigin;
19
+ return html `<div class="active-indicator"></div>`;
55
20
  }
56
21
  }
57
- __decorate([
58
- state(),
59
- __metadata("design:type", Object)
60
- ], FilledField.prototype, "strokeTransformOrigin", void 0);
61
22
  //# sourceMappingURL=filled-field.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filled-field.js","sourceRoot":"","sources":["filled-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAiB,MAAM,KAAK,CAAC;AACzC,OAAO,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEjC;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IAGpC;QACE,KAAK,EAAE,CAAC;QAHO,0BAAqB,GAAG,EAAE,CAAC;QAI1C,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;YACrC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAClB,IAAI,CAAC,2BAA2B,CAAC,KAAK,CAAC,CAAC;aACzC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAEkB,gBAAgB;QACjC,OAAO,IAAI,CAAA;;KAEV,CAAC;IACJ,CAAC;IAEkB,eAAe;QAChC,MAAM,WAAW,GAAG,EAAC,eAAe,EAAE,IAAI,CAAC,qBAAqB,EAAC,CAAC;QAClE,OAAO,IAAI,CAAA;6CAC8B,QAAQ,CAAC,WAAW,CAAC;KAC7D,CAAC;IACJ,CAAC;IAEkB,MAAM,CAAC,KAAkC;QAC1D,0EAA0E;QAC1E,uCAAuC;QACvC,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;QACzD,IAAI,UAAU,EAAE;YACd,IAAI,CAAC,2BAA2B,EAAE,CAAC;SACpC;QAED,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAEO,2BAA2B,CAAC,KAA6B;QAC/D,IAAI,eAAe,GAAG,EAAE,CAAC;QACzB,IAAI,KAAK,EAAE;YACT,qEAAqE;YACrE,wBAAwB;YACxB,MAAM,YAAY,GAAG,SAAS,IAAI,KAAK,CAAC;YACxC,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;YACvE,MAAM,QAAQ,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAC9C,eAAe,GAAG,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC;SAC9C;QAED,IAAI,CAAC,qBAAqB,GAAG,eAAe,CAAC;IAC/C,CAAC;CACF;AAhDC;IAAC,KAAK,EAAE;;0DAAoC","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, PropertyValues} from 'lit';\nimport {state} from 'lit/decorators.js';\nimport {styleMap} from 'lit/directives/style-map.js';\n\nimport {Field} from './field.js';\n\n/**\n * A filled field component.\n */\nexport class FilledField extends Field {\n @state() private strokeTransformOrigin = '';\n\n constructor() {\n super();\n this.addEventListener('click', event => {\n if (!this.disabled) {\n this.updateStrokeTransformOrigin(event);\n }\n });\n }\n\n protected override renderBackground() {\n return html`\n <div class=\"state-layer\"></div>\n `;\n }\n\n protected override renderIndicator() {\n const strokeStyle = {transformOrigin: this.strokeTransformOrigin};\n return html`\n <div class=\"active-indicator\" style=\"${styleMap(strokeStyle)}\"></div>\n `;\n }\n\n protected override update(props: PropertyValues<FilledField>) {\n // Upon losing focus, the stroke resets to expanding from the center, such\n // as when re-focusing with a keyboard.\n const unfocusing = props.has('focused') && !this.focused;\n if (unfocusing) {\n this.updateStrokeTransformOrigin();\n }\n\n super.update(props);\n }\n\n private updateStrokeTransformOrigin(event?: MouseEvent|TouchEvent) {\n let transformOrigin = '';\n if (event) {\n // Can't use instanceof TouchEvent since Firefox does not provide the\n // constructor globally.\n const isTouchEvent = 'touches' in event;\n const eventX = isTouchEvent ? event.touches[0].clientX : event.clientX;\n const rootRect = this.getBoundingClientRect();\n transformOrigin = `${eventX - rootRect.x}px`;\n }\n\n this.strokeTransformOrigin = transformOrigin;\n }\n}\n"]}
1
+ {"version":3,"file":"filled-field.js","sourceRoot":"","sources":["filled-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEjC;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACjB,gBAAgB;QACjC,OAAO,IAAI,CAAA;;;KAGV,CAAC;IACJ,CAAC;IAEkB,eAAe;QAChC,OAAO,IAAI,CAAA,sCAAsC,CAAC;IACpD,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html} from 'lit';\n\nimport {Field} from './field.js';\n\n/**\n * A filled field component.\n */\nexport class FilledField extends Field {\n protected override renderBackground() {\n return html`\n <div class=\"background\"></div>\n <div class=\"state-layer\"></div>\n `;\n }\n\n protected override renderIndicator() {\n return html`<div class=\"active-indicator\"></div>`;\n }\n}\n"]}
@@ -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-field-container-shape-start-start, var(--md-filled-field-container-shape, 4px));--_container-shape-start-end: var(--md-filled-field-container-shape-start-end, var(--md-filled-field-container-shape, 4px));--_container-shape-end-end: var(--md-filled-field-container-shape-end-end, var(--md-filled-field-container-shape, 0px));--_container-shape-end-start: var(--md-filled-field-container-shape-end-start, var(--md-filled-field-container-shape, 0px));--_active-indicator-color: var(--md-filled-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-field-active-indicator-height, 1px);--_container-color: var(--md-filled-field-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_disabled-active-indicator-color: var(--md-filled-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-active-indicator-height: var(--md-filled-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-field-disabled-container-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-container-opacity: var(--md-filled-field-disabled-container-opacity, 0.04);--_disabled-label-text-color: var(--md-filled-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-filled-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-filled-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-icon-opacity: var(--md-filled-field-disabled-leading-icon-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-filled-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-filled-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-icon-opacity: var(--md-filled-field-disabled-trailing-icon-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-active-indicator-color: var(--md-filled-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-label-text-color: var(--md-filled-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-filled-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-filled-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-label-text-color: var(--md-filled-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-filled-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-state-layer-opacity: var(--md-filled-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-filled-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-filled-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-filled-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-filled-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-field-focus-active-indicator-height, 2px);--_focus-label-text-color: var(--md-filled-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-filled-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-filled-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-active-indicator-height: var(--md-filled-field-hover-active-indicator-height, 1px);--_hover-label-text-color: var(--md-filled-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-icon-color: var(--md-filled-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-state-layer-opacity: var(--md-filled-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-filled-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-filled-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-populated-line-height: var(--md-filled-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-filled-field-label-text-populated-size, 0.75rem);--_label-text-type: var(--md-filled-field-label-text-type, 400 1rem / 1.5rem Roboto);--_leading-icon-color: var(--md-filled-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-filled-field-leading-icon-size, 24px);--_supporting-text-color: var(--md-filled-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-type: var(--md-filled-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_trailing-icon-color: var(--md-filled-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-filled-field-trailing-icon-size, 24px);--_container-padding-horizontal: var(--md-filled-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-filled-field-container-padding-vertical, 16px);--_content-color: var(--md-filled-field-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-color: var(--md-filled-field-disabled-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-opacity: var(--md-filled-field-disabled-content-opacity, 0.38);--_error-content-color: var(--md-filled-field-error-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-content-color: var(--md-filled-field-error-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-content-color: var(--md-filled-field-error-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-content-color: var(--md-filled-field-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-content-color: var(--md-filled-field-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_supporting-text-padding: var(--md-filled-field-supporting-text-padding, 16px);--_supporting-text-padding-top: var(--md-filled-field-supporting-text-padding-top, 4px);--_with-label-container-padding-vertical: var(--md-filled-field-with-label-container-padding-vertical, 8px)}.container{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);overflow:hidden;z-index:0}.container::before{background:var(--_container-color)}.container::after{visibility:hidden}.container::before,.container::after{border-radius:inherit;content:"";display:flex;height:100%;position:absolute;width:100%;z-index:-1}.label.floating{position:absolute;top:0}.state-layer{border-radius:inherit;height:100%;position:absolute;width:100%;visibility:hidden;z-index:-1}.field:not(.disabled):hover .state-layer{visibility:visible}.active-indicator{inset:auto 0 0 0;pointer-events:none;position:absolute;width:100%}.active-indicator::before,.active-indicator::after{border-bottom:var(--_active-indicator-height) solid var(--_active-indicator-color);inset:auto 0 0 0;content:"";position:absolute;width:100%}.active-indicator::after{opacity:0;transform:scaleX(0);transform-origin:inherit;transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1),transform 0s ease 150ms}.focused .active-indicator::after{opacity:1;transform:scaleX(1);transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1)}.field:not(.with-start) .start{padding-inline-start:var(--_container-padding-horizontal)}.field:not(.with-end) .end{padding-inline-end:var(--_container-padding-horizontal)}.field:not(.no-label) .container{padding-bottom:var(--_with-label-container-padding-vertical);padding-top:var(--_with-label-container-padding-vertical)}.field:not(.no-label) .middle{padding-top:var(--_label-text-populated-line-height)}:hover .active-indicator::before{border-bottom-color:var(--_hover-active-indicator-color);border-bottom-width:var(--_hover-active-indicator-height)}.active-indicator::after{border-bottom-color:var(--_focus-active-indicator-color);border-bottom-width:var(--_focus-active-indicator-height)}:hover .state-layer{background:var(--_hover-state-layer-color);opacity:var(--_hover-state-layer-opacity)}.disabled .active-indicator::before{border-bottom-color:var(--_disabled-active-indicator-color);border-bottom-width:var(--_disabled-active-indicator-height);opacity:var(--_disabled-active-indicator-opacity)}.disabled .container::before{background:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}.error .active-indicator::before{border-bottom-color:var(--_error-active-indicator-color)}.error:hover .active-indicator::before{border-bottom-color:var(--_error-hover-active-indicator-color)}.error:hover .state-layer{background:var(--_error-hover-state-layer-color);opacity:var(--_error-hover-state-layer-opacity)}.error .active-indicator::after{border-bottom-color:var(--_error-focus-active-indicator-color)}/*# sourceMappingURL=filled-styles.css.map */
7
+ export const styles = css `:host{--_container-shape-start-start: var(--md-filled-field-container-shape-start-start, var(--md-filled-field-container-shape, 4px));--_container-shape-start-end: var(--md-filled-field-container-shape-start-end, var(--md-filled-field-container-shape, 4px));--_container-shape-end-end: var(--md-filled-field-container-shape-end-end, var(--md-filled-field-container-shape, 0px));--_container-shape-end-start: var(--md-filled-field-container-shape-end-start, var(--md-filled-field-container-shape, 0px));--_active-indicator-color: var(--md-filled-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-field-active-indicator-height, 1px);--_container-color: var(--md-filled-field-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_container-padding-horizontal: var(--md-filled-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-filled-field-container-padding-vertical, 16px);--_content-color: var(--md-filled-field-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_content-type: var(--md-filled-field-content-type, 400 1rem / 1.5rem Roboto);--_disabled-active-indicator-color: var(--md-filled-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-active-indicator-height: var(--md-filled-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-field-disabled-container-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-container-opacity: var(--md-filled-field-disabled-container-opacity, 0.04);--_disabled-content-color: var(--md-filled-field-disabled-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-opacity: var(--md-filled-field-disabled-content-opacity, 0.38);--_disabled-label-text-color: var(--md-filled-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-filled-field-disabled-label-text-opacity, 0.38);--_disabled-leading-content-color: var(--md-filled-field-disabled-leading-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-content-opacity: var(--md-filled-field-disabled-leading-content-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-filled-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-content-color: var(--md-filled-field-disabled-trailing-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-content-opacity: var(--md-filled-field-disabled-trailing-content-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-content-color: var(--md-filled-field-error-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-active-indicator-color: var(--md-filled-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-content-color: var(--md-filled-field-error-focus-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-label-text-color: var(--md-filled-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-content-color: var(--md-filled-field-error-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-content-color: var(--md-filled-field-error-focus-trailing-content-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-content-color: var(--md-filled-field-error-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-label-text-color: var(--md-filled-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-content-color: var(--md-filled-field-error-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-state-layer-opacity: var(--md-filled-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-content-color: var(--md-filled-field-error-hover-trailing-content-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-filled-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-content-color: var(--md-filled-field-error-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-content-color: var(--md-filled-field-error-trailing-content-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-field-focus-active-indicator-height, 2px);--_focus-content-color: var(--md-filled-field-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-label-text-color: var(--md-filled-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-content-color: var(--md-filled-field-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-content-color: var(--md-filled-field-focus-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-active-indicator-height: var(--md-filled-field-hover-active-indicator-height, 1px);--_hover-content-color: var(--md-filled-field-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-label-text-color: var(--md-filled-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-content-color: var(--md-filled-field-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-state-layer-opacity: var(--md-filled-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-content-color: var(--md-filled-field-hover-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-filled-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-populated-line-height: var(--md-filled-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-filled-field-label-text-populated-size, 0.75rem);--_label-text-type: var(--md-filled-field-label-text-type, 400 1rem / 1.5rem Roboto);--_leading-content-color: var(--md-filled-field-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-color: var(--md-filled-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-padding: var(--md-filled-field-supporting-text-padding, 16px);--_supporting-text-padding-top: var(--md-filled-field-supporting-text-padding-top, 4px);--_supporting-text-type: var(--md-filled-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_trailing-content-color: var(--md-filled-field-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_with-label-container-padding-vertical: var(--md-filled-field-with-label-container-padding-vertical, 8px)}.background,.state-layer{border-radius:inherit;inset:0;pointer-events:none;position:absolute}.background{background:var(--_container-color)}.state-layer{visibility:hidden}.field:not(.disabled):hover .state-layer{visibility:visible}.label.floating{position:absolute;top:0}.active-indicator{inset:auto 0 0 0;pointer-events:none;position:absolute;width:100%}.active-indicator::before,.active-indicator::after{border-bottom:var(--_active-indicator-height) solid var(--_active-indicator-color);inset:auto 0 0 0;content:"";position:absolute;width:100%}.active-indicator::after{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .active-indicator::after{opacity:1}.field:not(.with-start) .start{padding-inline-start:var(--_container-padding-horizontal)}.field:not(.with-end) .end{padding-inline-end:var(--_container-padding-horizontal)}.field:not(.no-label) .container{padding-bottom:var(--_with-label-container-padding-vertical);padding-top:var(--_with-label-container-padding-vertical)}.field:not(.no-label) .middle{padding-top:var(--_label-text-populated-line-height)}:hover .active-indicator::before{border-bottom-color:var(--_hover-active-indicator-color);border-bottom-width:var(--_hover-active-indicator-height)}.active-indicator::after{border-bottom-color:var(--_focus-active-indicator-color);border-bottom-width:var(--_focus-active-indicator-height)}:hover .state-layer{background:var(--_hover-state-layer-color);opacity:var(--_hover-state-layer-opacity)}.disabled .active-indicator::before{border-bottom-color:var(--_disabled-active-indicator-color);border-bottom-width:var(--_disabled-active-indicator-height);opacity:var(--_disabled-active-indicator-opacity)}.disabled .background{background:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}.error .active-indicator::before{border-bottom-color:var(--_error-active-indicator-color)}.error:hover .active-indicator::before{border-bottom-color:var(--_error-hover-active-indicator-color)}.error:hover .state-layer{background:var(--_error-hover-state-layer-color);opacity:var(--_error-hover-state-layer-opacity)}.error .active-indicator::after{border-bottom-color:var(--_error-focus-active-indicator-color)}/*# sourceMappingURL=filled-styles.css.map */
8
8
  `;
9
9
  //# sourceMappingURL=filled-styles.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filled-styles.css.js","sourceRoot":"","sources":["filled-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--_container-shape-start-start: var(--md-filled-field-container-shape-start-start, var(--md-filled-field-container-shape, 4px));--_container-shape-start-end: var(--md-filled-field-container-shape-start-end, var(--md-filled-field-container-shape, 4px));--_container-shape-end-end: var(--md-filled-field-container-shape-end-end, var(--md-filled-field-container-shape, 0px));--_container-shape-end-start: var(--md-filled-field-container-shape-end-start, var(--md-filled-field-container-shape, 0px));--_active-indicator-color: var(--md-filled-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-field-active-indicator-height, 1px);--_container-color: var(--md-filled-field-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_disabled-active-indicator-color: var(--md-filled-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-active-indicator-height: var(--md-filled-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-field-disabled-container-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-container-opacity: var(--md-filled-field-disabled-container-opacity, 0.04);--_disabled-label-text-color: var(--md-filled-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-filled-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-filled-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-icon-opacity: var(--md-filled-field-disabled-leading-icon-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-filled-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-filled-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-icon-opacity: var(--md-filled-field-disabled-trailing-icon-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-active-indicator-color: var(--md-filled-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-label-text-color: var(--md-filled-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-filled-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-filled-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-label-text-color: var(--md-filled-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-filled-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-state-layer-opacity: var(--md-filled-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-filled-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-filled-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-filled-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-filled-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-field-focus-active-indicator-height, 2px);--_focus-label-text-color: var(--md-filled-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-filled-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-filled-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-active-indicator-height: var(--md-filled-field-hover-active-indicator-height, 1px);--_hover-label-text-color: var(--md-filled-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-icon-color: var(--md-filled-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-state-layer-opacity: var(--md-filled-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-filled-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-filled-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-populated-line-height: var(--md-filled-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-filled-field-label-text-populated-size, 0.75rem);--_label-text-type: var(--md-filled-field-label-text-type, 400 1rem / 1.5rem Roboto);--_leading-icon-color: var(--md-filled-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-filled-field-leading-icon-size, 24px);--_supporting-text-color: var(--md-filled-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-type: var(--md-filled-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_trailing-icon-color: var(--md-filled-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-filled-field-trailing-icon-size, 24px);--_container-padding-horizontal: var(--md-filled-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-filled-field-container-padding-vertical, 16px);--_content-color: var(--md-filled-field-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-color: var(--md-filled-field-disabled-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-opacity: var(--md-filled-field-disabled-content-opacity, 0.38);--_error-content-color: var(--md-filled-field-error-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-content-color: var(--md-filled-field-error-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-content-color: var(--md-filled-field-error-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-content-color: var(--md-filled-field-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-content-color: var(--md-filled-field-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_supporting-text-padding: var(--md-filled-field-supporting-text-padding, 16px);--_supporting-text-padding-top: var(--md-filled-field-supporting-text-padding-top, 4px);--_with-label-container-padding-vertical: var(--md-filled-field-with-label-container-padding-vertical, 8px)}.container{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);overflow:hidden;z-index:0}.container::before{background:var(--_container-color)}.container::after{visibility:hidden}.container::before,.container::after{border-radius:inherit;content:\"\";display:flex;height:100%;position:absolute;width:100%;z-index:-1}.label.floating{position:absolute;top:0}.state-layer{border-radius:inherit;height:100%;position:absolute;width:100%;visibility:hidden;z-index:-1}.field:not(.disabled):hover .state-layer{visibility:visible}.active-indicator{inset:auto 0 0 0;pointer-events:none;position:absolute;width:100%}.active-indicator::before,.active-indicator::after{border-bottom:var(--_active-indicator-height) solid var(--_active-indicator-color);inset:auto 0 0 0;content:\"\";position:absolute;width:100%}.active-indicator::after{opacity:0;transform:scaleX(0);transform-origin:inherit;transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1),transform 0s ease 150ms}.focused .active-indicator::after{opacity:1;transform:scaleX(1);transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1)}.field:not(.with-start) .start{padding-inline-start:var(--_container-padding-horizontal)}.field:not(.with-end) .end{padding-inline-end:var(--_container-padding-horizontal)}.field:not(.no-label) .container{padding-bottom:var(--_with-label-container-padding-vertical);padding-top:var(--_with-label-container-padding-vertical)}.field:not(.no-label) .middle{padding-top:var(--_label-text-populated-line-height)}:hover .active-indicator::before{border-bottom-color:var(--_hover-active-indicator-color);border-bottom-width:var(--_hover-active-indicator-height)}.active-indicator::after{border-bottom-color:var(--_focus-active-indicator-color);border-bottom-width:var(--_focus-active-indicator-height)}:hover .state-layer{background:var(--_hover-state-layer-color);opacity:var(--_hover-state-layer-opacity)}.disabled .active-indicator::before{border-bottom-color:var(--_disabled-active-indicator-color);border-bottom-width:var(--_disabled-active-indicator-height);opacity:var(--_disabled-active-indicator-opacity)}.disabled .container::before{background:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}.error .active-indicator::before{border-bottom-color:var(--_error-active-indicator-color)}.error:hover .active-indicator::before{border-bottom-color:var(--_error-hover-active-indicator-color)}.error:hover .state-layer{background:var(--_error-hover-state-layer-color);opacity:var(--_error-hover-state-layer-opacity)}.error .active-indicator::after{border-bottom-color:var(--_error-focus-active-indicator-color)}/*# sourceMappingURL=filled-styles.css.map */\n`;\n "]}
1
+ {"version":3,"file":"filled-styles.css.js","sourceRoot":"","sources":["filled-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--_container-shape-start-start: var(--md-filled-field-container-shape-start-start, var(--md-filled-field-container-shape, 4px));--_container-shape-start-end: var(--md-filled-field-container-shape-start-end, var(--md-filled-field-container-shape, 4px));--_container-shape-end-end: var(--md-filled-field-container-shape-end-end, var(--md-filled-field-container-shape, 0px));--_container-shape-end-start: var(--md-filled-field-container-shape-end-start, var(--md-filled-field-container-shape, 0px));--_active-indicator-color: var(--md-filled-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-field-active-indicator-height, 1px);--_container-color: var(--md-filled-field-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_container-padding-horizontal: var(--md-filled-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-filled-field-container-padding-vertical, 16px);--_content-color: var(--md-filled-field-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_content-type: var(--md-filled-field-content-type, 400 1rem / 1.5rem Roboto);--_disabled-active-indicator-color: var(--md-filled-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-active-indicator-height: var(--md-filled-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-field-disabled-container-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-container-opacity: var(--md-filled-field-disabled-container-opacity, 0.04);--_disabled-content-color: var(--md-filled-field-disabled-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-opacity: var(--md-filled-field-disabled-content-opacity, 0.38);--_disabled-label-text-color: var(--md-filled-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-filled-field-disabled-label-text-opacity, 0.38);--_disabled-leading-content-color: var(--md-filled-field-disabled-leading-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-content-opacity: var(--md-filled-field-disabled-leading-content-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-filled-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-content-color: var(--md-filled-field-disabled-trailing-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-content-opacity: var(--md-filled-field-disabled-trailing-content-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-content-color: var(--md-filled-field-error-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-active-indicator-color: var(--md-filled-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-content-color: var(--md-filled-field-error-focus-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-label-text-color: var(--md-filled-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-content-color: var(--md-filled-field-error-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-content-color: var(--md-filled-field-error-focus-trailing-content-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-content-color: var(--md-filled-field-error-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-label-text-color: var(--md-filled-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-content-color: var(--md-filled-field-error-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-state-layer-opacity: var(--md-filled-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-content-color: var(--md-filled-field-error-hover-trailing-content-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-filled-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-content-color: var(--md-filled-field-error-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-content-color: var(--md-filled-field-error-trailing-content-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-field-focus-active-indicator-height, 2px);--_focus-content-color: var(--md-filled-field-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-label-text-color: var(--md-filled-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-content-color: var(--md-filled-field-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-content-color: var(--md-filled-field-focus-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-active-indicator-height: var(--md-filled-field-hover-active-indicator-height, 1px);--_hover-content-color: var(--md-filled-field-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-label-text-color: var(--md-filled-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-content-color: var(--md-filled-field-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-state-layer-opacity: var(--md-filled-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-content-color: var(--md-filled-field-hover-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-filled-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-populated-line-height: var(--md-filled-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-filled-field-label-text-populated-size, 0.75rem);--_label-text-type: var(--md-filled-field-label-text-type, 400 1rem / 1.5rem Roboto);--_leading-content-color: var(--md-filled-field-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-color: var(--md-filled-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-padding: var(--md-filled-field-supporting-text-padding, 16px);--_supporting-text-padding-top: var(--md-filled-field-supporting-text-padding-top, 4px);--_supporting-text-type: var(--md-filled-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_trailing-content-color: var(--md-filled-field-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_with-label-container-padding-vertical: var(--md-filled-field-with-label-container-padding-vertical, 8px)}.background,.state-layer{border-radius:inherit;inset:0;pointer-events:none;position:absolute}.background{background:var(--_container-color)}.state-layer{visibility:hidden}.field:not(.disabled):hover .state-layer{visibility:visible}.label.floating{position:absolute;top:0}.active-indicator{inset:auto 0 0 0;pointer-events:none;position:absolute;width:100%}.active-indicator::before,.active-indicator::after{border-bottom:var(--_active-indicator-height) solid var(--_active-indicator-color);inset:auto 0 0 0;content:\"\";position:absolute;width:100%}.active-indicator::after{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .active-indicator::after{opacity:1}.field:not(.with-start) .start{padding-inline-start:var(--_container-padding-horizontal)}.field:not(.with-end) .end{padding-inline-end:var(--_container-padding-horizontal)}.field:not(.no-label) .container{padding-bottom:var(--_with-label-container-padding-vertical);padding-top:var(--_with-label-container-padding-vertical)}.field:not(.no-label) .middle{padding-top:var(--_label-text-populated-line-height)}:hover .active-indicator::before{border-bottom-color:var(--_hover-active-indicator-color);border-bottom-width:var(--_hover-active-indicator-height)}.active-indicator::after{border-bottom-color:var(--_focus-active-indicator-color);border-bottom-width:var(--_focus-active-indicator-height)}:hover .state-layer{background:var(--_hover-state-layer-color);opacity:var(--_hover-state-layer-opacity)}.disabled .active-indicator::before{border-bottom-color:var(--_disabled-active-indicator-color);border-bottom-width:var(--_disabled-active-indicator-height);opacity:var(--_disabled-active-indicator-opacity)}.disabled .background{background:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}.error .active-indicator::before{border-bottom-color:var(--_error-active-indicator-color)}.error:hover .active-indicator::before{border-bottom-color:var(--_error-hover-active-indicator-color)}.error:hover .state-layer{background:var(--_error-hover-state-layer-color);opacity:var(--_error-hover-state-layer-opacity)}.error .active-indicator::after{border-bottom-color:var(--_error-focus-active-indicator-color)}/*# sourceMappingURL=filled-styles.css.map */\n`;\n "]}
@@ -16,7 +16,7 @@ export class OutlinedField extends Field {
16
16
  <div class="outline-notch">
17
17
  <div class="outline-panel-inactive"></div>
18
18
  <div class="outline-panel-active"></div>
19
- ${floatingLabel}
19
+ <div class="outline-label">${floatingLabel}</div>
20
20
  </div>
21
21
  <div class="outline-end"></div>
22
22
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"outlined-field.js","sourceRoot":"","sources":["outlined-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,IAAI,EAAiB,MAAM,KAAK,CAAC;AAEzC,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEjC;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACnB,aAAa,CAAC,aAA6B;QAC5D,OAAO,IAAI,CAAA;;;;;;YAMH,aAAa;;;;KAIpB,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, TemplateResult} from 'lit';\n\nimport {Field} from './field.js';\n\n/**\n * An outlined field component.\n */\nexport class OutlinedField extends Field {\n protected override renderOutline(floatingLabel: TemplateResult) {\n return html`\n <div class=\"outline\">\n <div class=\"outline-start\"></div>\n <div class=\"outline-notch\">\n <div class=\"outline-panel-inactive\"></div>\n <div class=\"outline-panel-active\"></div>\n ${floatingLabel}\n </div>\n <div class=\"outline-end\"></div>\n </div>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"outlined-field.js","sourceRoot":"","sources":["outlined-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,IAAI,EAAiB,MAAM,KAAK,CAAC;AAEzC,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEjC;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACnB,aAAa,CAAC,aAA6B;QAC5D,OAAO,IAAI,CAAA;;;;;;uCAMwB,aAAa;;;;KAI/C,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, TemplateResult} from 'lit';\n\nimport {Field} from './field.js';\n\n/**\n * An outlined field component.\n */\nexport class OutlinedField extends Field {\n protected override renderOutline(floatingLabel: TemplateResult) {\n return html`\n <div class=\"outline\">\n <div class=\"outline-start\"></div>\n <div class=\"outline-notch\">\n <div class=\"outline-panel-inactive\"></div>\n <div class=\"outline-panel-active\"></div>\n <div class=\"outline-label\">${floatingLabel}</div>\n </div>\n <div class=\"outline-end\"></div>\n </div>\n `;\n }\n}\n"]}
@@ -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-outlined-field-container-shape-start-start, var(--md-outlined-field-container-shape, 4px));--_container-shape-start-end: var(--md-outlined-field-container-shape-start-end, var(--md-outlined-field-container-shape, 4px));--_container-shape-end-end: var(--md-outlined-field-container-shape-end-end, var(--md-outlined-field-container-shape, 4px));--_container-shape-end-start: var(--md-outlined-field-container-shape-end-start, var(--md-outlined-field-container-shape, 4px));--_disabled-label-text-color: var(--md-outlined-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-outlined-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-outlined-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-icon-opacity: var(--md-outlined-field-disabled-leading-icon-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-field-disabled-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-outline-opacity: var(--md-outlined-field-disabled-outline-opacity, 0.12);--_disabled-outline-width: var(--md-outlined-field-disabled-outline-width, 1px);--_disabled-supporting-text-color: var(--md-outlined-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-outlined-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-outlined-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-icon-opacity: var(--md-outlined-field-disabled-trailing-icon-opacity, 0.38);--_error-focus-label-text-color: var(--md-outlined-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-outlined-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-outline-color: var(--md-outlined-field-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_error-focus-supporting-text-color: var(--md-outlined-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-outlined-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-label-text-color: var(--md-outlined-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-outlined-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-outline-color: var(--md-outlined-field-error-hover-outline-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-supporting-text-color: var(--md-outlined-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-outlined-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-outlined-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-outlined-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-outline-color: var(--md-outlined-field-error-outline-color, var(--md-sys-color-error, #b3261e));--_error-supporting-text-color: var(--md-outlined-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-outlined-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-label-text-color: var(--md-outlined-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-outlined-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-outline-color: var(--md-outlined-field-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_focus-outline-width: var(--md-outlined-field-focus-outline-width, 2px);--_focus-supporting-text-color: var(--md-outlined-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-outlined-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-label-text-color: var(--md-outlined-field-hover-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-leading-icon-color: var(--md-outlined-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-outline-color: var(--md-outlined-field-hover-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-outline-width: var(--md-outlined-field-hover-outline-width, 1px);--_hover-supporting-text-color: var(--md-outlined-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-outlined-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-outlined-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-populated-line-height: var(--md-outlined-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-outlined-field-label-text-populated-size, 0.75rem);--_label-text-type: var(--md-outlined-field-label-text-type, 400 1rem / 1.5rem Roboto);--_leading-icon-color: var(--md-outlined-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-outlined-field-leading-icon-size, 24px);--_outline-color: var(--md-outlined-field-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-field-outline-width, 1px);--_supporting-text-color: var(--md-outlined-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-type: var(--md-outlined-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_trailing-icon-color: var(--md-outlined-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-outlined-field-trailing-icon-size, 24px);--_container-padding-horizontal: var(--md-outlined-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-outlined-field-container-padding-vertical, 16px);--_content-color: var(--md-outlined-field-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-color: var(--md-outlined-field-disabled-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-opacity: var(--md-outlined-field-disabled-content-opacity, 0.38);--_error-content-color: var(--md-outlined-field-error-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-content-color: var(--md-outlined-field-error-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-content-color: var(--md-outlined-field-error-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-content-color: var(--md-outlined-field-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-content-color: var(--md-outlined-field-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_label-text-padding-bottom: var(--md-outlined-field-label-text-padding-bottom, 8px);--_outline-label-padding: var(--md-outlined-field-outline-label-padding, 4px);--_supporting-text-padding: var(--md-outlined-field-supporting-text-padding, 16px);--_supporting-text-padding-top: var(--md-outlined-field-supporting-text-padding-top, 4px)}.outline{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);border-color:var(--_outline-color);color:var(--_outline-color);display:flex;pointer-events:none;height:100%;position:absolute;width:100%}.outline-start::before,.outline-start::after,.outline-panel-inactive::before,.outline-panel-inactive::after,.outline-panel-active::before,.outline-panel-active::after,.outline-end::before,.outline-end::after{border:inherit;content:"";inset:0;position:absolute}.outline-start,.outline-end{border:inherit;border-radius:inherit;box-sizing:border-box;position:relative}.outline-start::before,.outline-start::after,.outline-end::before,.outline-end::after{border-bottom-style:solid;border-top-style:solid}.outline-start::after,.outline-end::after{opacity:0;transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.focused .outline-start::after,.focused .outline-end::after{opacity:1}.outline-start::before,.outline-start::after{border-inline-start-style:solid;border-inline-end-style:none;border-start-start-radius:inherit;border-start-end-radius:0;border-end-start-radius:inherit;border-end-end-radius:0;margin-inline-end:var(--_outline-label-padding)}.outline-end{flex-grow:1;margin-inline-start:calc(-1*var(--_outline-label-padding))}.outline-end::before,.outline-end::after{border-inline-start-style:none;border-inline-end-style:solid;border-start-start-radius:0;border-start-end-radius:inherit;border-end-start-radius:0;border-end-end-radius:inherit}.outline-notch{align-items:flex-start;border:inherit;display:flex;margin-inline-start:calc(-1*var(--_outline-label-padding));margin-inline-end:var(--_outline-label-padding);max-width:calc(100% - 2*var(--_container-padding-horizontal));padding:0 var(--_outline-label-padding);position:relative}.no-label .outline-notch{display:none}.outline-panel-inactive,.outline-panel-active{border:inherit;border-bottom-style:solid;inset:0;position:absolute}.outline-panel-inactive::before,.outline-panel-inactive::after,.outline-panel-active::before,.outline-panel-active::after{border-top-style:solid;border-bottom:none;bottom:auto;transform:scaleX(1);transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1)}.outline-panel-inactive::before,.outline-panel-active::before{right:50%;transform-origin:top left}.outline-panel-inactive::after,.outline-panel-active::after{left:50%;transform-origin:top right}.populated .outline-panel-inactive::before,.populated .outline-panel-inactive::after,.populated .outline-panel-active::before,.populated .outline-panel-active::after,.focused .outline-panel-inactive::before,.focused .outline-panel-inactive::after,.focused .outline-panel-active::before,.focused .outline-panel-active::after{transform:scaleX(0)}.outline-panel-active{opacity:0;transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.focused .outline-panel-active{opacity:1}.label.floating{transform:translateY(calc(-100% + var(--_label-text-padding-bottom)))}.outline-start,.field:not(.with-start) .start{padding-inline-start:max(var(--_container-padding-horizontal),max(var(--_container-shape-start-start),var(--_container-shape-end-start)) + var(--_outline-label-padding))}.field:not(.with-end) .end{padding-inline-end:max(var(--_container-padding-horizontal),max(var(--_container-shape-start-end),var(--_container-shape-end-end)))}.outline-start::before,.outline-end::before,.outline-panel-inactive,.outline-panel-inactive::before,.outline-panel-inactive::after{border-width:var(--_outline-width)}:hover .outline{border-color:var(--_hover-outline-color);color:var(--_hover-outline-color)}:hover .outline-start::before,:hover .outline-end::before,:hover .outline-panel-inactive,:hover .outline-panel-inactive::before,:hover .outline-panel-inactive::after{border-width:var(--_hover-outline-width)}.focused .outline{border-color:var(--_focus-outline-color);color:var(--_focus-outline-color)}.outline-start::after,.outline-end::after,.outline-panel-active,.outline-panel-active::before,.outline-panel-active::after{border-width:var(--_focus-outline-width)}.disabled .outline{border-color:var(--_disabled-outline-color);color:var(--_disabled-outline-color)}.disabled .outline-start,.disabled .outline-end,.disabled .outline-panel-inactive{opacity:var(--_disabled-outline-opacity)}.disabled .outline-start::before,.disabled .outline-end::before,.disabled .outline-panel-inactive,.disabled .outline-panel-inactive::before,.disabled .outline-panel-inactive::after{border-width:var(--_disabled-outline-width)}.error .outline{border-color:var(--_error-outline-color);color:var(--_error-outline-color)}.error:hover .outline{border-color:var(--_error-hover-outline-color);color:var(--_error-hover-outline-color)}.error.focused .outline{border-color:var(--_error-focus-outline-color);color:var(--_error-focus-outline-color)}/*# sourceMappingURL=outlined-styles.css.map */
7
+ export const styles = css `:host{--_container-shape-start-start: var(--md-outlined-field-container-shape-start-start, var(--md-outlined-field-container-shape, 4px));--_container-shape-start-end: var(--md-outlined-field-container-shape-start-end, var(--md-outlined-field-container-shape, 4px));--_container-shape-end-end: var(--md-outlined-field-container-shape-end-end, var(--md-outlined-field-container-shape, 4px));--_container-shape-end-start: var(--md-outlined-field-container-shape-end-start, var(--md-outlined-field-container-shape, 4px));--_container-padding-horizontal: var(--md-outlined-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-outlined-field-container-padding-vertical, 16px);--_content-color: var(--md-outlined-field-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_content-type: var(--md-outlined-field-content-type, 400 1rem / 1.5rem Roboto);--_disabled-content-color: var(--md-outlined-field-disabled-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-opacity: var(--md-outlined-field-disabled-content-opacity, 0.38);--_disabled-label-text-color: var(--md-outlined-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-outlined-field-disabled-label-text-opacity, 0.38);--_disabled-leading-content-color: var(--md-outlined-field-disabled-leading-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-content-opacity: var(--md-outlined-field-disabled-leading-content-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-field-disabled-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-outline-opacity: var(--md-outlined-field-disabled-outline-opacity, 0.12);--_disabled-outline-width: var(--md-outlined-field-disabled-outline-width, 1px);--_disabled-supporting-text-color: var(--md-outlined-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-outlined-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-content-color: var(--md-outlined-field-disabled-trailing-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-content-opacity: var(--md-outlined-field-disabled-trailing-content-opacity, 0.38);--_error-content-color: var(--md-outlined-field-error-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-content-color: var(--md-outlined-field-error-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-label-text-color: var(--md-outlined-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-content-color: var(--md-outlined-field-error-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-outline-color: var(--md-outlined-field-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_error-focus-supporting-text-color: var(--md-outlined-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-content-color: var(--md-outlined-field-error-focus-trailing-content-color, var(--md-sys-color-error, #b3261e));--_error-hover-content-color: var(--md-outlined-field-error-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-label-text-color: var(--md-outlined-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-content-color: var(--md-outlined-field-error-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-outline-color: var(--md-outlined-field-error-hover-outline-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-supporting-text-color: var(--md-outlined-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-content-color: var(--md-outlined-field-error-hover-trailing-content-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-outlined-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-content-color: var(--md-outlined-field-error-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-outline-color: var(--md-outlined-field-error-outline-color, var(--md-sys-color-error, #b3261e));--_error-supporting-text-color: var(--md-outlined-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-content-color: var(--md-outlined-field-error-trailing-content-color, var(--md-sys-color-error, #b3261e));--_focus-content-color: var(--md-outlined-field-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-label-text-color: var(--md-outlined-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-content-color: var(--md-outlined-field-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-outline-color: var(--md-outlined-field-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_focus-outline-width: var(--md-outlined-field-focus-outline-width, 2px);--_focus-supporting-text-color: var(--md-outlined-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-content-color: var(--md-outlined-field-focus-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-content-color: var(--md-outlined-field-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-label-text-color: var(--md-outlined-field-hover-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-leading-content-color: var(--md-outlined-field-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-outline-color: var(--md-outlined-field-hover-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-outline-width: var(--md-outlined-field-hover-outline-width, 1px);--_hover-supporting-text-color: var(--md-outlined-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-content-color: var(--md-outlined-field-hover-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-outlined-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-padding-bottom: var(--md-outlined-field-label-text-padding-bottom, 8px);--_label-text-populated-line-height: var(--md-outlined-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-outlined-field-label-text-populated-size, 0.75rem);--_label-text-type: var(--md-outlined-field-label-text-type, 400 1rem / 1.5rem Roboto);--_leading-content-color: var(--md-outlined-field-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_outline-color: var(--md-outlined-field-outline-color, var(--md-sys-color-outline, #79747e));--_outline-label-padding: var(--md-outlined-field-outline-label-padding, 4px);--_outline-width: var(--md-outlined-field-outline-width, 1px);--_supporting-text-color: var(--md-outlined-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-padding: var(--md-outlined-field-supporting-text-padding, 16px);--_supporting-text-padding-top: var(--md-outlined-field-supporting-text-padding-top, 4px);--_supporting-text-type: var(--md-outlined-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_trailing-content-color: var(--md-outlined-field-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f))}.outline{border-color:var(--_outline-color);border-radius:inherit;color:var(--_outline-color);display:flex;pointer-events:none;height:100%;position:absolute;width:100%}.outline-start::before,.outline-start::after,.outline-panel-inactive::before,.outline-panel-inactive::after,.outline-panel-active::before,.outline-panel-active::after,.outline-end::before,.outline-end::after{border:inherit;content:"";inset:0;position:absolute}.outline-start,.outline-end{border:inherit;border-radius:inherit;box-sizing:border-box;position:relative}.outline-start::before,.outline-start::after,.outline-end::before,.outline-end::after{border-bottom-style:solid;border-top-style:solid}.outline-start::after,.outline-end::after{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .outline-start::after,.focused .outline-end::after{opacity:1}.outline-start::before,.outline-start::after{border-inline-start-style:solid;border-inline-end-style:none;border-start-start-radius:inherit;border-start-end-radius:0;border-end-start-radius:inherit;border-end-end-radius:0;margin-inline-end:var(--_outline-label-padding)}.outline-end{flex-grow:1;margin-inline-start:calc(-1*var(--_outline-label-padding))}.outline-end::before,.outline-end::after{border-inline-start-style:none;border-inline-end-style:solid;border-start-start-radius:0;border-start-end-radius:inherit;border-end-start-radius:0;border-end-end-radius:inherit}.outline-notch{align-items:flex-start;border:inherit;display:flex;margin-inline-start:calc(-1*var(--_outline-label-padding));margin-inline-end:var(--_outline-label-padding);max-width:calc(100% - 2*var(--_container-padding-horizontal));padding:0 var(--_outline-label-padding);position:relative}.no-label .outline-notch{display:none}.outline-panel-inactive,.outline-panel-active{border:inherit;border-bottom-style:solid;inset:0;position:absolute}.outline-panel-inactive::before,.outline-panel-inactive::after,.outline-panel-active::before,.outline-panel-active::after{border-top-style:solid;border-bottom:none;bottom:auto;transform:scaleX(1);transition:transform 150ms cubic-bezier(0.2, 0, 0, 1)}.outline-panel-inactive::before,.outline-panel-active::before{right:50%;transform-origin:top left}.outline-panel-inactive::after,.outline-panel-active::after{left:50%;transform-origin:top right}.populated .outline-panel-inactive::before,.populated .outline-panel-inactive::after,.populated .outline-panel-active::before,.populated .outline-panel-active::after,.focused .outline-panel-inactive::before,.focused .outline-panel-inactive::after,.focused .outline-panel-active::before,.focused .outline-panel-active::after{transform:scaleX(0)}.outline-panel-active{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .outline-panel-active{opacity:1}.outline-label{display:flex;max-width:100%;transform:translateY(calc(-100% + var(--_label-text-padding-bottom)))}.outline-start,.field:not(.with-start) .start{padding-inline-start:max(var(--_container-padding-horizontal),max(var(--_container-shape-start-start),var(--_container-shape-end-start)) + var(--_outline-label-padding))}.field:not(.with-end) .end{padding-inline-end:max(var(--_container-padding-horizontal),max(var(--_container-shape-start-end),var(--_container-shape-end-end)))}.outline-start::before,.outline-end::before,.outline-panel-inactive,.outline-panel-inactive::before,.outline-panel-inactive::after{border-width:var(--_outline-width)}:hover .outline{border-color:var(--_hover-outline-color);color:var(--_hover-outline-color)}:hover .outline-start::before,:hover .outline-end::before,:hover .outline-panel-inactive,:hover .outline-panel-inactive::before,:hover .outline-panel-inactive::after{border-width:var(--_hover-outline-width)}.focused .outline{border-color:var(--_focus-outline-color);color:var(--_focus-outline-color)}.outline-start::after,.outline-end::after,.outline-panel-active,.outline-panel-active::before,.outline-panel-active::after{border-width:var(--_focus-outline-width)}.disabled .outline{border-color:var(--_disabled-outline-color);color:var(--_disabled-outline-color)}.disabled .outline-start,.disabled .outline-end,.disabled .outline-panel-inactive{opacity:var(--_disabled-outline-opacity)}.disabled .outline-start::before,.disabled .outline-end::before,.disabled .outline-panel-inactive,.disabled .outline-panel-inactive::before,.disabled .outline-panel-inactive::after{border-width:var(--_disabled-outline-width)}.error .outline{border-color:var(--_error-outline-color);color:var(--_error-outline-color)}.error:hover .outline{border-color:var(--_error-hover-outline-color);color:var(--_error-hover-outline-color)}.error.focused .outline{border-color:var(--_error-focus-outline-color);color:var(--_error-focus-outline-color)}/*# sourceMappingURL=outlined-styles.css.map */
8
8
  `;
9
9
  //# sourceMappingURL=outlined-styles.css.js.map