@shortfuse/materialdesignweb 0.2.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (416) hide show
  1. package/.browserslistrc +2 -1
  2. package/.eslintrc.json +188 -30
  3. package/.stylelintrc.json +643 -2
  4. package/.vscode/launch.json +20 -5
  5. package/.vscode/settings.json +3 -0
  6. package/CHANGELOG.md +36 -0
  7. package/README.md +82 -2
  8. package/adapters/datatable/column.js +176 -0
  9. package/adapters/datatable/index.js +253 -437
  10. package/adapters/dom/index.js +586 -0
  11. package/adapters/list/index.js +36 -113
  12. package/adapters/search/index.js +153 -180
  13. package/components/appbar/_spec.scss +165 -0
  14. package/components/appbar/_theme.scss +0 -0
  15. package/components/appbar/index.scss +2 -0
  16. package/components/banner/_spec.scss +83 -0
  17. package/components/banner/_theme.scss +0 -0
  18. package/components/banner/index.scss +2 -0
  19. package/components/bottomnav/README.md +4 -4
  20. package/components/bottomnav/_spec.scss +149 -0
  21. package/components/bottomnav/_theme.scss +0 -0
  22. package/components/bottomnav/index.js +100 -120
  23. package/components/bottomnav/index.scss +2 -0
  24. package/components/bottomnav/item.js +88 -0
  25. package/components/button/README.md +16 -22
  26. package/components/button/_spec.scss +162 -0
  27. package/components/button/_theme.scss +42 -0
  28. package/components/button/index.eta +32 -0
  29. package/components/button/index.js +37 -48
  30. package/components/button/index.pug +18 -0
  31. package/components/button/index.scss +2 -0
  32. package/components/card/_spec.scss +241 -0
  33. package/components/card/_theme.scss +0 -0
  34. package/components/card/index.scss +2 -0
  35. package/components/chip/_spec.scss +111 -0
  36. package/components/chip/_theme.scss +105 -0
  37. package/components/chip/index.js +23 -0
  38. package/components/chip/index.scss +2 -0
  39. package/components/chip/item.js +20 -0
  40. package/components/datatable/_spec.scss +225 -0
  41. package/components/datatable/_theme.scss +128 -0
  42. package/components/datatable/cell.js +44 -0
  43. package/components/datatable/columnheader.js +46 -0
  44. package/components/datatable/index.js +339 -443
  45. package/components/datatable/index.scss +2 -0
  46. package/components/datatable/row.js +48 -0
  47. package/components/datatable/rowheader.js +18 -0
  48. package/components/dialog/_spec.scss +203 -0
  49. package/components/dialog/_theme.scss +7 -0
  50. package/components/dialog/index.js +512 -437
  51. package/components/dialog/index.scss +2 -0
  52. package/components/divider/_spec.scss +11 -0
  53. package/components/divider/_theme.scss +0 -0
  54. package/components/divider/index.scss +2 -0
  55. package/components/elevation/_spec.scss +9 -0
  56. package/components/elevation/_theme.scss +0 -0
  57. package/components/elevation/index.scss +2 -0
  58. package/components/fab/{style.scss → _spec.scss} +104 -79
  59. package/components/fab/_theme.scss +0 -0
  60. package/components/fab/index.js +85 -79
  61. package/components/fab/index.scss +2 -0
  62. package/components/grid/_spec.scss +169 -0
  63. package/components/grid/_theme.scss +0 -0
  64. package/components/grid/index.scss +2 -0
  65. package/components/layout/_mixins.scss +11 -0
  66. package/components/layout/_spec.scss +916 -0
  67. package/components/layout/_theme.scss +19 -0
  68. package/components/layout/index.js +454 -0
  69. package/components/layout/index.scss +2 -0
  70. package/components/list/_spec.scss +363 -0
  71. package/components/list/_theme.scss +102 -0
  72. package/components/list/content.js +106 -0
  73. package/components/list/index.js +234 -79
  74. package/components/list/index.scss +2 -0
  75. package/components/list/item.js +167 -0
  76. package/components/list/secondary.js +45 -0
  77. package/components/menu/_spec.scss +329 -0
  78. package/components/menu/_theme.scss +0 -0
  79. package/components/menu/index.js +636 -651
  80. package/components/menu/index.scss +2 -0
  81. package/components/menu/item.js +231 -0
  82. package/components/progress/_spec.scss +156 -0
  83. package/components/progress/_theme.scss +0 -0
  84. package/components/progress/index.js +29 -13
  85. package/components/progress/index.scss +2 -0
  86. package/components/selection/_spec.scss +376 -0
  87. package/components/selection/_theme.scss +134 -0
  88. package/components/selection/index.eta +60 -0
  89. package/components/selection/index.js +70 -0
  90. package/components/selection/index.pug +30 -0
  91. package/components/selection/index.scss +2 -0
  92. package/components/selection/input.js +54 -0
  93. package/components/selection/radiogroup.js +40 -0
  94. package/components/slider/{style.scss → _spec.scss} +31 -34
  95. package/components/slider/_theme.scss +0 -0
  96. package/components/slider/index.scss +2 -0
  97. package/components/snackbar/_spec.scss +150 -0
  98. package/components/snackbar/_theme.scss +0 -0
  99. package/components/snackbar/index.js +293 -206
  100. package/components/snackbar/index.scss +2 -0
  101. package/components/tab/_spec.scss +220 -0
  102. package/components/tab/_theme.scss +0 -0
  103. package/components/tab/content.js +210 -0
  104. package/components/tab/index.js +229 -213
  105. package/components/tab/index.scss +2 -0
  106. package/components/tab/item.js +88 -0
  107. package/components/tab/list.js +196 -0
  108. package/components/tab/panel.js +54 -0
  109. package/components/textfield/README.md +4 -4
  110. package/components/textfield/_spec.scss +763 -0
  111. package/components/textfield/_theme.scss +264 -0
  112. package/components/textfield/index.eta +74 -0
  113. package/components/textfield/index.js +132 -138
  114. package/components/textfield/index.pug +30 -0
  115. package/components/textfield/index.scss +2 -0
  116. package/components/tooltip/_spec.scss +185 -0
  117. package/components/tooltip/_theme.scss +0 -0
  118. package/components/tooltip/index.scss +2 -0
  119. package/components/type/_spec.scss +227 -0
  120. package/components/type/_theme.scss +0 -0
  121. package/components/type/index.scss +2 -0
  122. package/core/_breakpoint.scss +189 -0
  123. package/core/_elevation.scss +78 -0
  124. package/core/_length.scss +8 -0
  125. package/core/_motion.scss +31 -0
  126. package/core/_platform.scss +12 -0
  127. package/core/_type.scss +128 -0
  128. package/core/aria/attributes.js +141 -0
  129. package/core/aria/button.js +49 -0
  130. package/core/aria/keyboard.js +92 -0
  131. package/core/aria/rovingtabindex.js +175 -0
  132. package/core/aria/tab.js +59 -0
  133. package/core/document/index.js +39 -0
  134. package/core/dom.js +180 -0
  135. package/core/overlay/_spec.scss +28 -0
  136. package/core/overlay/_theme.scss +147 -0
  137. package/core/overlay/index.js +95 -0
  138. package/core/overlay/index.scss +2 -0
  139. package/core/ripple/_spec.scss +196 -0
  140. package/core/ripple/_theme.scss +20 -0
  141. package/core/ripple/index.js +286 -0
  142. package/core/ripple/index.scss +2 -0
  143. package/core/theme/_aliases.scss +15 -0
  144. package/core/theme/_config.scss +8 -0
  145. package/core/theme/_functions.scss +22 -0
  146. package/{components/theming/palettes.scss → core/theme/_palettes.scss} +173 -151
  147. package/core/theme/_spec.scss +0 -0
  148. package/core/theme/_theme.scss +268 -0
  149. package/core/theme/index.js +50 -0
  150. package/core/theme/index.scss +4 -0
  151. package/core/throttler.js +42 -0
  152. package/core/transition/index.js +465 -0
  153. package/docs/_flex.scss +28 -0
  154. package/docs/_menuoptions.js +183 -0
  155. package/docs/_partials/_androidnavbar.eta +5 -0
  156. package/docs/_partials/_androidstatusbar.eta +13 -0
  157. package/docs/_partials/_appbar.eta +27 -0
  158. package/docs/_partials/_buttontest.eta +31 -0
  159. package/docs/_partials/_header.eta +146 -0
  160. package/docs/_partials/_navlistitem.eta +16 -0
  161. package/docs/_partials/_target.eta +1 -0
  162. package/docs/_sample-utils.js +88 -0
  163. package/docs/{src/storage.js → _storage.js} +0 -0
  164. package/docs/docs.scss +331 -0
  165. package/docs/framework.scss +26 -0
  166. package/docs/index.eta +12 -0
  167. package/docs/index.js +7 -0
  168. package/docs/pages/appbar.eta +108 -0
  169. package/docs/pages/appbar.js +0 -0
  170. package/docs/pages/bottomnav.eta +188 -0
  171. package/docs/pages/bottomnav.js +118 -0
  172. package/docs/pages/button.eta +124 -0
  173. package/docs/pages/button.js +224 -0
  174. package/docs/pages/card.eta +90 -0
  175. package/docs/pages/card.js +175 -0
  176. package/docs/pages/chip.eta +122 -0
  177. package/docs/pages/chip.js +80 -0
  178. package/docs/pages/color.eta +143 -0
  179. package/docs/pages/color.js +261 -0
  180. package/docs/pages/datatable.eta +323 -0
  181. package/docs/pages/datatable.js +160 -0
  182. package/docs/pages/dialog.eta +184 -0
  183. package/docs/{src/components → pages}/dialog.js +35 -48
  184. package/docs/pages/dom.eta +26 -0
  185. package/docs/pages/dom.js +140 -0
  186. package/docs/pages/elevation.eta +35 -0
  187. package/docs/pages/elevation.js +0 -0
  188. package/docs/pages/fab.eta +99 -0
  189. package/docs/{src/components → pages}/fab.js +6 -13
  190. package/docs/pages/grid.eta +135 -0
  191. package/docs/pages/grid.js +128 -0
  192. package/docs/pages/layout.eta +8 -0
  193. package/docs/pages/layout.js +0 -0
  194. package/docs/pages/list.eta +465 -0
  195. package/docs/pages/list.js +8 -0
  196. package/docs/pages/menu.eta +274 -0
  197. package/docs/{src/components → pages}/menu.js +26 -42
  198. package/docs/pages/overlay.eta +69 -0
  199. package/docs/pages/overlay.js +3 -0
  200. package/docs/pages/progress.eta +23 -0
  201. package/docs/{src/components → pages}/progress.js +2 -4
  202. package/docs/pages/ripple.eta +27 -0
  203. package/docs/pages/ripple.js +3 -0
  204. package/docs/pages/search.eta +242 -0
  205. package/docs/pages/search.js +226 -0
  206. package/docs/pages/selection.eta +107 -0
  207. package/docs/pages/selection.js +12 -0
  208. package/docs/pages/slider.eta +23 -0
  209. package/docs/pages/slider.js +0 -0
  210. package/docs/pages/snackbar.eta +83 -0
  211. package/docs/{src/components → pages}/snackbar.js +31 -36
  212. package/docs/pages/tab.eta +407 -0
  213. package/docs/pages/tab.js +152 -0
  214. package/docs/pages/textfield.eta +487 -0
  215. package/docs/{src/components → pages}/textfield.js +41 -45
  216. package/docs/pages/tooltip.eta +92 -0
  217. package/docs/pages/tooltip.js +0 -0
  218. package/docs/pages/transition.eta +117 -0
  219. package/docs/pages/transition.js +52 -0
  220. package/docs/pages/type.eta +31 -0
  221. package/docs/pages/type.js +0 -0
  222. package/docs/postrender.js +41 -0
  223. package/docs/prerender.js +16 -0
  224. package/docs/pwa/_dialogs.eta +143 -0
  225. package/docs/pwa/_menus.eta +16 -0
  226. package/docs/pwa/pwa-prerender.js +3 -0
  227. package/docs/pwa/pwa.eta +478 -0
  228. package/docs/pwa/pwa.js +298 -0
  229. package/docs/pwa/pwa.scss +31 -0
  230. package/docs/themes/theme-colored.scss +15 -0
  231. package/docs/themes/theme-default.scss +3 -0
  232. package/index.scss +27 -0
  233. package/jsconfig.json +8 -2
  234. package/package.json +54 -27
  235. package/scripts/deploy-docs.sh +9 -0
  236. package/templates/index.eta +2 -0
  237. package/templates/index.pug +3 -0
  238. package/tsconfig.json +16 -0
  239. package/utils/function.js +3 -0
  240. package/webpack.config.js +224 -68
  241. package/_index.scss +0 -4
  242. package/components/all-components.scss +0 -21
  243. package/components/bottomnav/style.scss +0 -190
  244. package/components/bottomnav/theming.scss +0 -76
  245. package/components/button/style.scss +0 -315
  246. package/components/button/theming.scss +0 -134
  247. package/components/card/style.scss +0 -175
  248. package/components/card/theming.scss +0 -43
  249. package/components/common/dom.js +0 -51
  250. package/components/common/functions.scss +0 -174
  251. package/components/common/mixins.scss +0 -122
  252. package/components/common/motion.scss +0 -36
  253. package/components/common/type.scss +0 -104
  254. package/components/common/variables.scss +0 -46
  255. package/components/datatable/style.scss +0 -257
  256. package/components/datatable/theming.scss +0 -119
  257. package/components/dialog/style.scss +0 -159
  258. package/components/dialog/theming.scss +0 -29
  259. package/components/divider/style.scss +0 -7
  260. package/components/divider/theming.scss +0 -20
  261. package/components/elevation/style.scss +0 -32
  262. package/components/layout/style.scss +0 -223
  263. package/components/list/style.scss +0 -358
  264. package/components/list/theming.scss +0 -83
  265. package/components/menu/style.scss +0 -280
  266. package/components/menu/theming.scss +0 -80
  267. package/components/navdrawer/index.js +0 -200
  268. package/components/navdrawer/style.scss +0 -595
  269. package/components/navdrawer/theming.scss +0 -62
  270. package/components/progress/style.scss +0 -136
  271. package/components/ripple/index.js +0 -63
  272. package/components/ripple/ripple.scss +0 -122
  273. package/components/selection/style.scss +0 -320
  274. package/components/selection/theming.scss +0 -98
  275. package/components/snackbar/style.scss +0 -212
  276. package/components/switch/style.scss +0 -3
  277. package/components/tab/style.scss +0 -275
  278. package/components/tab/theming.scss +0 -34
  279. package/components/template/theming.scss +0 -31
  280. package/components/textfield/style.scss +0 -795
  281. package/components/textfield/theming.scss +0 -256
  282. package/components/theming/globals.scss +0 -25
  283. package/components/theming/theming.scss +0 -559
  284. package/components/toolbar/style.scss +0 -190
  285. package/components/toolbar/theming.scss +0 -32
  286. package/components/tooltip/style.scss +0 -135
  287. package/components/type/style.scss +0 -167
  288. package/components/type/theming.scss +0 -25
  289. package/docs/bottomnav.html +0 -1
  290. package/docs/bottomnav.min.js +0 -2
  291. package/docs/bottomnav.min.js.map +0 -1
  292. package/docs/button.html +0 -1
  293. package/docs/button.min.js +0 -2
  294. package/docs/button.min.js.map +0 -1
  295. package/docs/card.html +0 -1
  296. package/docs/card.min.js +0 -2
  297. package/docs/card.min.js.map +0 -1
  298. package/docs/components.min.css +0 -1
  299. package/docs/components.min.js +0 -2
  300. package/docs/components.min.js.map +0 -1
  301. package/docs/datatable.html +0 -1
  302. package/docs/datatable.min.js +0 -2
  303. package/docs/datatable.min.js.map +0 -1
  304. package/docs/dialog.html +0 -1
  305. package/docs/dialog.min.js +0 -2
  306. package/docs/dialog.min.js.map +0 -1
  307. package/docs/docs.min.css +0 -1
  308. package/docs/docs.min.js +0 -2
  309. package/docs/docs.min.js.map +0 -1
  310. package/docs/elevation.html +0 -1
  311. package/docs/elevation.min.js +0 -2
  312. package/docs/elevation.min.js.map +0 -1
  313. package/docs/fab.html +0 -1
  314. package/docs/fab.min.js +0 -2
  315. package/docs/fab.min.js.map +0 -1
  316. package/docs/index.html +0 -1
  317. package/docs/index.min.js +0 -2
  318. package/docs/index.min.js.map +0 -1
  319. package/docs/layout.html +0 -1
  320. package/docs/layout.min.js +0 -2
  321. package/docs/layout.min.js.map +0 -1
  322. package/docs/list.html +0 -1
  323. package/docs/list.min.js +0 -2
  324. package/docs/list.min.js.map +0 -1
  325. package/docs/menu.html +0 -1
  326. package/docs/menu.min.js +0 -2
  327. package/docs/menu.min.js.map +0 -1
  328. package/docs/navdrawer.html +0 -1
  329. package/docs/navdrawer.min.js +0 -2
  330. package/docs/navdrawer.min.js.map +0 -1
  331. package/docs/prerender.min.js +0 -2
  332. package/docs/prerender.min.js.map +0 -1
  333. package/docs/progress.html +0 -1
  334. package/docs/progress.min.js +0 -2
  335. package/docs/progress.min.js.map +0 -1
  336. package/docs/search.html +0 -1
  337. package/docs/search.min.js +0 -2
  338. package/docs/search.min.js.map +0 -1
  339. package/docs/selection.html +0 -1
  340. package/docs/selection.min.js +0 -2
  341. package/docs/selection.min.js.map +0 -1
  342. package/docs/slider.html +0 -1
  343. package/docs/slider.min.js +0 -2
  344. package/docs/slider.min.js.map +0 -1
  345. package/docs/snackbar.html +0 -1
  346. package/docs/snackbar.min.js +0 -2
  347. package/docs/snackbar.min.js.map +0 -1
  348. package/docs/src/components/bottomnav.js +0 -16
  349. package/docs/src/components/bottomnav.pug +0 -112
  350. package/docs/src/components/button.js +0 -156
  351. package/docs/src/components/button.pug +0 -194
  352. package/docs/src/components/card.js +0 -136
  353. package/docs/src/components/card.pug +0 -133
  354. package/docs/src/components/datatable.js +0 -183
  355. package/docs/src/components/datatable.pug +0 -324
  356. package/docs/src/components/dialog.pug +0 -138
  357. package/docs/src/components/elevation.js +0 -3
  358. package/docs/src/components/elevation.pug +0 -17
  359. package/docs/src/components/fab.pug +0 -84
  360. package/docs/src/components/layout.js +0 -116
  361. package/docs/src/components/layout.pug +0 -104
  362. package/docs/src/components/list.js +0 -15
  363. package/docs/src/components/list.pug +0 -293
  364. package/docs/src/components/menu.pug +0 -292
  365. package/docs/src/components/navdrawer.js +0 -112
  366. package/docs/src/components/navdrawer.pug +0 -113
  367. package/docs/src/components/progress.pug +0 -17
  368. package/docs/src/components/search.js +0 -206
  369. package/docs/src/components/search.pug +0 -149
  370. package/docs/src/components/selection.js +0 -6
  371. package/docs/src/components/selection.pug +0 -116
  372. package/docs/src/components/slider.js +0 -3
  373. package/docs/src/components/slider.pug +0 -19
  374. package/docs/src/components/snackbar.pug +0 -145
  375. package/docs/src/components/tab.js +0 -137
  376. package/docs/src/components/tab.pug +0 -329
  377. package/docs/src/components/textfield.pug +0 -416
  378. package/docs/src/components/toolbar.js +0 -6
  379. package/docs/src/components/toolbar.pug +0 -86
  380. package/docs/src/components/tooltip.js +0 -6
  381. package/docs/src/components/tooltip.pug +0 -76
  382. package/docs/src/components/type.js +0 -6
  383. package/docs/src/components/type.pug +0 -34
  384. package/docs/src/components.scss +0 -1
  385. package/docs/src/docs.scss +0 -284
  386. package/docs/src/index.js +0 -3
  387. package/docs/src/index.pug +0 -6
  388. package/docs/src/menuoptions.js +0 -136
  389. package/docs/src/mixins.pug +0 -139
  390. package/docs/src/prerender.js +0 -26
  391. package/docs/src/sample-utils.js +0 -108
  392. package/docs/src/targetHandler.js +0 -50
  393. package/docs/src/theming.ie11.scss +0 -18
  394. package/docs/src/theming.scss +0 -18
  395. package/docs/tab.html +0 -1
  396. package/docs/tab.min.js +0 -2
  397. package/docs/tab.min.js.map +0 -1
  398. package/docs/textfield.html +0 -2
  399. package/docs/textfield.min.js +0 -2
  400. package/docs/textfield.min.js.map +0 -1
  401. package/docs/theming.ie11.min.css +0 -1
  402. package/docs/theming.ie11.min.js +0 -2
  403. package/docs/theming.ie11.min.js.map +0 -1
  404. package/docs/theming.min.css +0 -1
  405. package/docs/theming.min.js +0 -2
  406. package/docs/theming.min.js.map +0 -1
  407. package/docs/toolbar.html +0 -1
  408. package/docs/toolbar.min.js +0 -2
  409. package/docs/toolbar.min.js.map +0 -1
  410. package/docs/tooltip.html +0 -1
  411. package/docs/tooltip.min.js +0 -2
  412. package/docs/tooltip.min.js.map +0 -1
  413. package/docs/type.html +0 -1
  414. package/docs/type.min.js +0 -2
  415. package/docs/type.min.js.map +0 -1
  416. package/index.js +0 -16
@@ -1,795 +0,0 @@
1
- // https://material.io/guidelines/components/textfields.html
2
-
3
-
4
- @import '../common/functions.scss';
5
- @import '../common/variables.scss';
6
- @import '../common/motion.scss';
7
- @import '../common/mixins.scss';
8
- @import '../common/type.scss';
9
-
10
- $border-line__height: dp(1);
11
- $border-line__focused__height: dp(2);
12
-
13
- $textarea__padding-horizontal: dp(16);
14
- $textfield__outline-start-width: dp(10);
15
- $textfield__outline-end-width: dp(8);
16
-
17
- // Grid Layout
18
- // 1 | 2 | 3 | 4 | 5 | 6 | 7
19
- // -------------------------------------------------------------
20
- // 1: Gap | | Label ----------------------------------- | Gap
21
- // 1: Gap | Icon | Prefix | Input | Dropdown Button | Suffix | Gap
22
- // 1: Border -----------------------------------------------------
23
- // 2: Gap | | Helper/Error | Gap
24
- // 2: Dropdown ---------------------------------------------------
25
-
26
- .mdw-textfield {
27
- position: relative;
28
- display: grid;
29
- display: -ms-grid;
30
- grid-template-columns: 12px auto auto 1fr auto auto 8px;
31
- -ms-grid-columns: 12px auto auto 1fr auto auto 8px;
32
- grid-template-rows: auto auto;
33
- -ms-grid-rows: auto auto;
34
- &[mdw-solo] {
35
- grid-template-columns: 0 auto auto 1fr auto auto 0;
36
- -ms-grid-columns: 0 auto auto 1fr auto auto 0;
37
- .mdw-textfield__input {
38
- align-self: center;
39
- -ms-grid-row-align: center;
40
- margin: 0;
41
- }
42
- .mdw-textfield__border {
43
- display: none;
44
- }
45
- padding: 0;
46
- }
47
- padding: 8px 0;
48
- align-items: baseline;
49
-
50
- &:not([mdw-solo]) {
51
- @include type-rules('subtitle');
52
- }
53
- transition-timing-function: $motion-easing-standard;
54
- transition-duration: $motion-duration-desktop-default;
55
- @include allHandsets {
56
- transition-duration: $motion-duration-mobile-default;
57
- }
58
- @include allTablets {
59
- transition-duration: $motion-duration-tablet-default;
60
- }
61
- }
62
-
63
- .mdw-textfield::before {
64
- // 20 + 20dp from baseline top
65
- content: "";
66
- display: inline-block;
67
- vertical-align: baseline;
68
- grid-row: 1;
69
- -ms-grid-row: 1;
70
- grid-column: 4;
71
- -ms-grid-column: 4;
72
- height: 1em;
73
- min-height: dp(20);
74
- margin-top: dp(20);
75
- margin-bottom: dp(56 - 20 - 20);
76
- }
77
-
78
- .mdw-textfield[mdw-solo],
79
- .mdw-textfield[mdw-outlined] {
80
- .mdw-textfield__prefix,
81
- .mdw-textfield__suffix,
82
- .mdw-textfield__icon {
83
- align-self: center;
84
- -ms-grid-row-align: center;
85
- margin-top: 0;
86
- margin-bottom: 0;
87
- }
88
- textarea.mdw-textfield__input {
89
- & ~ .mdw-textfield__prefix,
90
- & ~ .mdw-textfield__suffix {
91
- align-self: flex-start;
92
- -ms-grid-row-align: start;
93
- margin-top: dp(8);
94
- margin-bottom: dp(8);
95
- }
96
- }
97
- }
98
-
99
- .mdw-textfield__prefix,
100
- .mdw-textfield__suffix {
101
- grid-row: 1;
102
- -ms-grid-row: 1;
103
- pointer-events: none;
104
- will-change: color;
105
- transition-property: color;
106
- transition-timing-function: $motion-easing-standard;
107
- transition-duration: $motion-duration-desktop-default;
108
- @include allHandsets {
109
- transition-duration: $motion-duration-mobile-default;
110
- }
111
- @include allTablets {
112
- transition-duration: $motion-duration-tablet-default;
113
- }
114
- }
115
- .mdw-textfield__prefix {
116
- grid-column: 3;
117
- -ms-grid-column: 3;
118
- }
119
- .mdw-textfield__suffix {
120
- grid-column: 6;
121
- -ms-grid-column: 6;
122
- }
123
- .mdw-textfield__prefix::after,
124
- .mdw-textfield__suffix::before {
125
- content: '';
126
- display: inline-block;
127
- width: dp(4);
128
- }
129
-
130
- .mdw-textfield__outline-gap {
131
- // Transitioning with transform would require transforming adjacent elements
132
- // to avoid subpixel issues from mixed 2D/3D rendering.
133
-
134
- position: absolute;
135
- grid-column: 2;
136
- -ms-grid-column: 2;
137
- grid-row: 1;
138
- -ms-grid-row: 1;
139
-
140
- top: $border-line__focused__height;
141
- right: dp(12);
142
- bottom: 0;
143
- left: dp(12);
144
-
145
- margin-top: -$border-line__focused__height;
146
- margin-bottom: -$border-line__height;
147
-
148
- &::before,
149
- &::after {
150
- content: none;
151
- position: absolute;
152
- top: 0;
153
- border-top-width: $border-line__height;
154
- border-top-style: solid;
155
- border-color: inherit;
156
-
157
- transform: scaleX(0);
158
- transition-property: transform;
159
- transition-delay: 1ms;
160
- transition-timing-function: $motion-easing-standard;
161
- transition-duration: $motion-duration-desktop-default / 2;
162
- @include allHandsets {
163
- transition-duration: $motion-duration-mobile-default / 2;
164
- }
165
- @include allTablets {
166
- transition-duration: $motion-duration-tablet-default / 2;
167
- }
168
- }
169
- &::before,
170
- html[dir=rtl] &::after {
171
- left: 0;
172
- right: 50%;
173
- transform-origin: left center;
174
- }
175
- &::after,
176
- html[dir=rtl] &::before {
177
- left: 50%;
178
- right: 0;
179
- transform-origin: right center;
180
- }
181
- }
182
-
183
- .mdw-textfield__border {
184
- position: relative;
185
- grid-row: 1;
186
- -ms-grid-row: 1;
187
- align-self: stretch;
188
- -ms-grid-row-align: stretch;
189
- grid-column-start: 1;
190
- -ms-grid-column: 1;
191
- grid-column-end: span 7;
192
- -ms-grid-column-span: 7;
193
- cursor: pointer;
194
-
195
- .mdw-textfield__input:focus ~ & {
196
- pointer-events: none;
197
- }
198
- .mdw-textfield__input:disabled ~ & {
199
- cursor: not-allowed;
200
- }
201
-
202
- display: flex;
203
-
204
- border-top-left-radius: dp(4);
205
- border-top-right-radius: dp(4);
206
- border-bottom-right-radius: 0;
207
- border-bottom-left-radius: 0;
208
-
209
- border-top-style: none;
210
- border-right-style: none;
211
- border-bottom-style: solid;
212
- border-left-style: none;
213
-
214
- border-width: $border-line__height;
215
-
216
- border-top-color: transparent;
217
- border-right-color: transparent;
218
- border-bottom-color: currentColor;
219
- border-left-color: transparent;
220
-
221
- transition-delay: 1ms;
222
- transition-property: color, border-color;
223
- transition-timing-function: $motion-easing-standard;
224
- transition-duration: $motion-duration-desktop-default;
225
- @include allHandsets {
226
- transition-duration: $motion-duration-mobile-default;
227
- }
228
- @include allTablets {
229
- transition-duration: $motion-duration-tablet-default;
230
- }
231
-
232
- &::before,
233
- &::after {
234
- content: "";
235
- position: absolute;
236
- bottom: -$border-line__focused__height;
237
- left: 0;
238
- right: 0;
239
- height: 100%;
240
- transform: scaleX(0) translateY(-$border-line__height/2);
241
-
242
- border-radius: inherit;
243
-
244
- border-bottom-style: solid;
245
-
246
- border-width: $border-line__focused__height;
247
-
248
- color: transparent;
249
-
250
- transition-property: transform;
251
- transition-delay: 1ms;
252
- transition-timing-function: $motion-easing-acceleration;
253
- transition-duration: $motion-duration-desktop-enter;
254
- @include allHandsets {
255
- transition-duration: $motion-duration-mobile-enter;
256
- }
257
- @include allTablets {
258
- transition-duration: $motion-duration-tablet-enter;
259
- }
260
- will-change: transform;
261
- }
262
- }
263
-
264
- .mdw-textfield[mdw-outlined] {
265
- .mdw-textfield__border {
266
- border-bottom-left-radius: dp(4);
267
- border-bottom-right-radius: dp(4);
268
-
269
- border-top-style: solid;
270
- border-right-style: solid;
271
- border-bottom-style: solid;
272
- border-left-style: solid;
273
- transition: none;
274
-
275
- &::before, &::after {
276
- content: '';
277
- position: relative;
278
- top: auto;
279
- bottom: auto;
280
- left: auto;
281
- right: auto;
282
- color: inherit;
283
- transition: none;
284
- transform: none;
285
- will-change: auto;
286
- }
287
- &::after {
288
- flex-grow: 1;
289
- }
290
-
291
- &::before,
292
- html[dir=rtl] &::after {
293
- border-width: inherit;
294
-
295
- border-top-color: currentColor;
296
- border-right-color: transparent;
297
- border-bottom-color: transparent;
298
- border-left-color: currentColor;
299
-
300
- border-top-style: solid;
301
- border-right-style: none;
302
- border-bottom-style: solid;
303
- border-left-style: solid;
304
-
305
- border-top-left-radius: inherit;
306
- border-bottom-left-radius: inherit;
307
- border-top-right-radius: 0;
308
- border-bottom-right-radius: 0;
309
-
310
- margin-top: -$border-line__height;
311
- margin-right: 0;
312
- margin-left: -$border-line__height;
313
-
314
- min-width: $textfield__outline-start-width - $border-line__height;
315
- }
316
-
317
- &::after,
318
- html[dir=rtl] &::before, {
319
- border-width: inherit;
320
-
321
- border-top-color: currentColor;
322
- border-right-color: currentColor;
323
- border-bottom-color: transparent;
324
- border-left-color: transparent;
325
-
326
- border-top-style: solid;
327
- border-bottom-style: solid;
328
- border-right-style: solid;
329
- border-left-style: none;
330
-
331
- border-top-left-radius: 0;
332
- border-top-right-radius: inherit;
333
- border-bottom-right-radius: inherit;
334
- border-bottom-left-radius: 0;
335
-
336
- margin-top: -$border-line__height;
337
- margin-right: -$border-line__height;
338
- margin-left: 0;
339
-
340
- min-width: $textfield__outline-end-width - $border-line__height;
341
- }
342
- .mdw-textfield__outline-gap {
343
- position: relative;
344
- margin-top: -$border-line__height;
345
- margin-bottom: -$border-line__height;
346
- left: auto;
347
- top: auto;
348
- right: auto;
349
- bottom: auto;
350
- color: inherit;
351
- max-width: calc(100% - 24px);
352
- &::before, &::after {
353
- content: '';
354
- border-style: none;
355
- border-radius: 0;
356
- border-top-color: currentColor;
357
- border-top-style: solid;
358
- color: inherit;
359
- }
360
- }
361
- }
362
- .mdw-textfield__input {
363
- align-self: center;
364
- -ms-grid-row-align: center;
365
- border-left: 2px solid transparent;
366
- border-right: none;
367
- margin: 8px 0;
368
- html[dir=rtl] & {
369
- border-right: 2px solid transparent;
370
- border-left: none;
371
- }
372
- }
373
- .mdw-textfield__label {
374
- position: relative; // reflow DOM
375
- @include baseline-top(0);
376
- padding: 0 4px;
377
- top: 0;
378
- transform: translateY(-50%);
379
- }
380
- }
381
-
382
- // IE11 will ignore entire ruleset if ':placeholder-shown' psuedo is used, requiring duplication.
383
- .mdw-textfield[mdw-value-empty] > input.mdw-textfield__input,
384
- .mdw-textfield[mdw-value-empty] > textarea.mdw-textfield__input {
385
- &:not(:focus) ~ .mdw-textfield__border {
386
- & .mdw-textfield__label {
387
- top: 50%;
388
- transform: translateY(-50%);
389
- @include type-rules('subtitle');
390
- }
391
- & .mdw-textfield__outline-gap {
392
- &::before,
393
- &::after {
394
- transform: scaleX(1);
395
- }
396
- }
397
- }
398
- }
399
- .mdw-textfield > input.mdw-textfield__input,
400
- .mdw-textfield > textarea.mdw-textfield__input {
401
- &:not(:focus):placeholder-shown ~ .mdw-textfield__border {
402
- & .mdw-textfield__label {
403
- top: 50%;
404
- transform: translateY(-50%);
405
- @include type-rules('subtitle');
406
- }
407
- & .mdw-textfield__outline-gap {
408
- &::before,
409
- &::after {
410
- transform: scaleX(1);
411
- }
412
- }
413
- }
414
- }
415
-
416
- .mdw-textfield__label {
417
- // Default state is floating
418
- position: absolute;
419
- top: 0;
420
- left: 0;
421
- right: 0;
422
- margin: 0;
423
- padding: 0;
424
- @include baseline-top(20);
425
-
426
- align-self: flex-start;
427
- -ms-grid-row-align: start;
428
-
429
- overflow-x: hidden;
430
- text-overflow: ellipsis;
431
- white-space: nowrap;
432
-
433
- @include type-rules('caption');
434
-
435
- transform: translateY(0);
436
- pointer-events: none; // allow clickthrough
437
- will-change: top, transform, font-size;
438
-
439
- transition-property: top, transform, font-size, color;
440
- transition-timing-function: $motion-easing-standard;
441
- transition-duration: $motion-duration-desktop-default;
442
- @include allHandsets {
443
- transition-duration: $motion-duration-mobile-default;
444
- }
445
- @include allTablets {
446
- transition-duration: $motion-duration-tablet-default;
447
- }
448
- }
449
-
450
- .mdw-textfield__signifier {
451
- grid-column: 2;
452
- -ms-grid-column: 2;
453
- grid-row: 1;
454
- -ms-grid-row: 1;
455
- align-self: center;
456
- -ms-grid-row-align: center;
457
-
458
- margin-top: 8px;
459
- margin-bottom: 8px;
460
- &::after {
461
- content: '';
462
- width: dp(8);
463
- display: inline-block;
464
- }
465
-
466
- & ~ .mdw-textfield__border .mdw-textfield__outline-gap {
467
- margin-left: 24px + 8px;
468
- margin-right: 0;
469
- html[dir=rtl] & {
470
- margin-left: 0;
471
- margin-right: 24px + 8px;
472
- }
473
- }
474
- .mdw-textfield[mdw-outlined] & ~ .mdw-textfield__border {
475
- &::before {
476
- padding-left: 0;
477
- padding-right: 24px + 8px;
478
- html[dir=rtl] & {
479
- padding-left: 24px + 8px;
480
- padding-right: 0;
481
- }
482
- }
483
- .mdw-textfield__outline-gap {
484
- margin-left: 0;
485
- html[dir=rtl] & {
486
- margin-right: 0;
487
- }
488
- max-width: calc(100% - (24px + 24px + 8px));
489
- }
490
- }
491
- }
492
-
493
- .mdw-textfield__input {
494
- z-index: 1;
495
- padding: 0;
496
- margin: 0;
497
- background: none;
498
- border: none;
499
- outline: none;
500
-
501
- grid-row: 1;
502
- -ms-grid-row: 1;
503
- grid-column-start: 4;
504
- -ms-grid-column: 4;
505
- grid-column-end: span 2;
506
- -ms-grid-column-span: 2;
507
- width: 100%;
508
- box-sizing: border-box;
509
-
510
- font-size: inherit;
511
- font-family: inherit;
512
- font-weight: inherit;
513
- line-height: inherit;
514
- letter-spacing: inherit;
515
-
516
- appearance: none;
517
- -moz-appearance: none;
518
- -webkit-appearance: none;
519
- box-shadow: none; // Firefox :invalid styling
520
-
521
- //padding-bottom: dp(8);
522
-
523
- min-width: 0; // Firefox CSS Grid fix
524
-
525
- &:not(:focus) {
526
- cursor: pointer;
527
- }
528
- &:disabled {
529
- cursor: not-allowed;
530
- }
531
-
532
- &::placeholder {
533
- will-change: color;
534
- transition-property: color;
535
- transition-timing-function: $motion-easing-standard;
536
- transition-delay: 1ms;
537
- transition-duration: $motion-duration-desktop-default;
538
- @include allHandsets {
539
- transition-duration: $motion-duration-mobile-default;
540
- }
541
- @include allTablets {
542
- transition-duration: $motion-duration-tablet-default;
543
- }
544
- }
545
- }
546
-
547
- .mdw-textfield__input,
548
- .mdw-textfield__prefix,
549
- .mdw-textfield__suffix,
550
- .mdw-textfield__icon {
551
- // Margins used for textarea
552
- margin-top: dp(20);
553
- margin-bottom: dp(8);
554
- -ms-grid-row-align: center; // IE11 doesn't support baseline alignment
555
- }
556
-
557
- textarea.mdw-textfield__input {
558
- resize: none;
559
- overflow-y: auto;
560
- -ms-overflow-style: -ms-autohiding-scrollbar;
561
- padding-bottom: 0;
562
- // margin: 8px 0;
563
- padding-left: 0;
564
- padding-right: $textarea__padding-horizontal;
565
- [dir=rtl] & {
566
- padding-left: $textarea__padding-horizontal;
567
- padding-right: 0
568
- }
569
- // grid-column-end: span 4;
570
- // -ms-grid-column-span: 4;
571
- .mdw-textfield[mdw-autosize] > & {
572
- min-height: 1em;
573
- }
574
- }
575
-
576
- select.mdw-textfield__input {
577
- cursor: pointer;
578
- -webkit-tap-highlight-color: transparent;
579
- option {
580
- font-size: inherit;
581
- font-family: inherit;
582
- font-weight: inherit;
583
- appearance: none;
584
- -moz-appearance: none;
585
- -webkit-appearance: none;
586
- }
587
- &::-ms-expand {
588
- // Remove IE11 dropdown button
589
- display: none;
590
- }
591
- padding-left: 0;
592
- padding-right: 24px;
593
- [dir=rtl] & {
594
- padding-left: 24px;
595
- padding-right: 0;
596
- }
597
- &:-moz-focusring {
598
- color: black;
599
- text-shadow: none;
600
- }
601
- }
602
-
603
-
604
- .mdw-textfield__error-text {
605
- transform: translateY(-25%);
606
- }
607
-
608
- .mdw-textfield__helper-text,
609
- .mdw-textfield__error-text {
610
- @include type-rules('caption');
611
- @include baseline-top(16);
612
- grid-row: 2;
613
- -ms-grid-row: 2;
614
- grid-column: 3;
615
- -ms-grid-column: 3;
616
- grid-column-end: span 4;
617
- -ms-grid-column-span: 4;
618
- text-overflow: ellipsis;
619
- white-space: nowrap;
620
- overflow: hidden;
621
- }
622
-
623
- .mdw-textfield__icon {
624
- &[mdw-dropdown] {
625
- pointer-events: none;
626
- &::after {
627
- content: "";
628
- width: 0;
629
- border-top: 5px solid currentColor;
630
- border-left: 5px solid transparent;
631
- border-right: 5px solid transparent;
632
- margin-top: 10px;
633
- margin-left: auto;
634
- margin-right: auto;
635
- }
636
- }
637
- grid-row: 1;
638
- -ms-grid-row: 1;
639
- grid-column: 5;
640
- -ms-grid-column: 5;
641
-
642
- margin-top: dp(16);
643
- margin-bottom: dp(16);
644
- width: 24px;
645
- height: 24px;
646
- display: flex;
647
- justify-content: center;
648
- }
649
-
650
- .mdw-textfield__dropdown {
651
- position: absolute;
652
- grid-row: 2;
653
- -ms-grid-row: 2;
654
- margin-top: 0;
655
- margin-bottom: 8px;
656
- grid-column: 1;
657
- -ms-grid-column: 1;
658
- grid-column-end: span 7;
659
- -ms-grid-column-span: 7;
660
- box-shadow: none;
661
- max-height: 0;
662
- overflow: hidden;
663
- z-index: 2;
664
- width: 100%;
665
- max-width: 100%;
666
- border-bottom-left-radius: dp(4);
667
- border-bottom-right-radius: dp(4);
668
- .mdw-textfield[mdw-outlined] & {
669
- margin-top: 8px;
670
- border-top-left-radius: dp(4);
671
- border-top-right-radius: dp(4);
672
- }
673
- transition-property: box-shadow, max-height;
674
- transition-timing-function: $motion-easing-deceleration;
675
- transition-duration: $motion-duration-desktop-leave;
676
- @include allHandsets {
677
- transition-duration: $motion-duration-mobile-leave;
678
- }
679
- @include allTablets {
680
- transition-duration: $motion-duration-tablet-leave;
681
- }
682
- &[mdw-type=list] {
683
- overflow-y: auto;
684
- -ms-overflow-style: -ms-autohiding-scrollbar;
685
- }
686
- &[mdw-show],
687
- &:active,
688
- input:focus ~ & {
689
- &:not([mdw-hide]) {
690
- &[mdw-type=list] {
691
- max-height: calc(300px);
692
- }
693
- transition-timing-function: $motion-easing-acceleration;
694
- transition-duration: $motion-duration-desktop-enter;
695
- @include allHandsets {
696
- transition-duration: $motion-duration-mobile-enter;
697
- }
698
- @include allTablets {
699
- transition-duration: $motion-duration-tablet-enter;
700
- }
701
- box-shadow: elevation(24);
702
- }
703
- }
704
-
705
- }
706
-
707
- .mdw-textfield:active > .mdw-textfield__input:not(:disabled),
708
- .mdw-textfield > .mdw-textfield__input:not(:disabled):focus {
709
- // Invalid
710
- &:invalid {
711
- & ~ .mdw-textfield__border .mdw-textfield__outline-gap {
712
- animation-name: labelShake;
713
- animation-duration: 250ms;
714
- animation-delay: $motion-duration-desktop-default;
715
- @include allHandsets {
716
- animation-delay: $motion-duration-mobile-default;
717
- }
718
- @include allTablets {
719
- animation-delay: $motion-duration-tablet-default;
720
- }
721
- }
722
- }
723
- }
724
-
725
- // Focus
726
- .mdw-textfield:not([mdw-outlined]) {
727
- &:active > .mdw-textfield__input:not(:disabled),
728
- > .mdw-textfield__input:not(:disabled):focus {
729
- & ~ .mdw-textfield__border::before,
730
- &:invalid ~ .mdw-textfield__border::after {
731
- transform: scaleX(1) translateY(-$border-line__height/2);
732
- }
733
- }
734
- }
735
-
736
- // Border change on outlined active or focus
737
- .mdw-textfield[mdw-outlined] {
738
- &:active > .mdw-textfield__input:not(:disabled) ~ .mdw-textfield__border,
739
- .mdw-textfield__input:not(:disabled):focus ~ .mdw-textfield__border {
740
- border-width: $border-line__focused__height;
741
- &::before,
742
- html[dir=rtl] &::after {
743
- margin-top: -$border-line__focused__height;
744
- margin-left: -$border-line__focused__height;
745
- margin-right: 0;
746
- min-width: $textfield__outline-start-width - $border-line__focused__height;
747
- }
748
- &::after,
749
- html[dir=rtl] &::before {
750
- margin-top: -$border-line__focused__height;
751
- margin-left: 0;
752
- margin-right: -$border-line__focused__height;
753
- min-width: $textfield__outline-end-width - $border-line__focused__height;
754
- }
755
- .mdw-textfield__outline-gap {
756
- margin-top: -$border-line__focused__height;
757
- margin-bottom: -$border-line__focused__height;
758
- &::before, &::after {
759
- border-top-width: $border-line__focused__height;
760
- }
761
- }
762
- }
763
- }
764
-
765
- // Invalid
766
- .mdw-textfield__error-text {
767
- .mdw-textfield__input:focus:invalid ~ & {
768
- transform: translateY(0);
769
- will-change: transform, color;
770
- transition-property: transform, color;
771
- transition-timing-function: $motion-easing-standard;
772
- transition-duration: $motion-duration-desktop-default;
773
- @include allHandsets {
774
- transition-duration: $motion-duration-mobile-default;
775
- }
776
- @include allTablets {
777
- transition-duration: $motion-duration-tablet-default;
778
- }
779
- }
780
- }
781
-
782
- @keyframes labelShake {
783
- 0% {
784
- transform: translateX(0);
785
- }
786
- 33% {
787
- transform: translateX(dp(4));
788
- }
789
- 66% {
790
- transform: translateX(dp(-4));
791
- }
792
- 100% {
793
- transform: translateX(0);
794
- }
795
- }