@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,315 +0,0 @@
1
- // https://material.io/guidelines/components/buttons.html#buttons-raised-buttons
2
- // https://material.io/guidelines/style/icons.html#
3
-
4
- @import '../common/functions.scss';
5
- @import '../common/motion.scss';
6
- @import '../common/mixins.scss';
7
- @import '../ripple/ripple.scss';
8
- @import '../common//type.scss';
9
-
10
- $button__external-padding: dp(8);
11
- $button__minimum-click-target: dp(48);
12
- $button__background-color-pressed: rgba(#999, 0.40);
13
- $button__focus-animation-delay: 1667ms;
14
- $button__focus-animation-duration: 1667ms;
15
- $button__long-press-timeout: 500ms;
16
- $button__click-timeout: 100ms;
17
- $button__outline-size: dp(1);
18
-
19
- .mdw-button {
20
- position: relative;
21
- min-width: dp(64);
22
- min-height: dp(36);
23
- padding: 0 dp(8);
24
-
25
- &[mdw-outline],
26
- &[mdw-theme-fill] {
27
- padding: 0 dp(16);
28
- }
29
-
30
- margin: 0 dp(8);
31
- border-radius: dp(4);
32
-
33
- cursor: pointer;
34
- -webkit-tap-highlight-color: transparent;
35
- &[disabled] {
36
- cursor: not-allowed;
37
- }
38
-
39
- overflow: hidden;
40
- transition-property: box-shadow, background-color;
41
- transition-duration: $button__click-timeout, $button__long-press-timeout;
42
- transition-delay: 0s;
43
- transition-timing-function: $motion-easing-acceleration;
44
- &:active {
45
- transition-duration: $button__click-timeout, $button__long-press-timeout - $button__click-timeout;
46
- transition-delay: 0s, $button__click-timeout;
47
- transition-timing-function: $motion-easing-deceleration;
48
- }
49
- z-index: 0;
50
-
51
- // Override browser button defaults
52
- box-sizing: border-box;
53
- outline: none;
54
- appearance: none;
55
- -moz-appearance: none;
56
- -webkit-appearance: none;
57
- border: none;
58
- text-decoration: none;
59
- &:not([mdw-theme-fill]) {
60
- background-color: transparent;
61
- }
62
-
63
- // Remove Firefox inner
64
- &::-moz-focus-inner {
65
- border: 0;
66
- }
67
-
68
- // Support any HTMLElement (not just HTMLButtonElement)
69
- user-select: none;
70
- -moz-user-select: none;
71
- -ms-user-select: none;
72
- -webkit-user-select: none;
73
- display: inline-flex;
74
- text-align: center;
75
- justify-content: center;
76
- align-items: center;
77
-
78
- // Don't override font icon properties
79
- &:not([mdw-icon]) {
80
- font-family: inherit;
81
- word-spacing: normal;
82
- @include type-rules('button');
83
- }
84
-
85
- &[mdw-outline] {
86
- border-width: $button__outline-size;
87
- border-style: solid;
88
- &::before,
89
- & > .mdw-ripple {
90
- margin-left: -$button__outline-size;
91
- margin-top: -$button__outline-size;
92
- padding-right: 2 * $button__outline-size;
93
- padding-bottom: 2 * $button__outline-size;
94
- }
95
- }
96
-
97
- // Icon properties
98
- &[mdw-icon] {
99
- border-radius: 50%;
100
- min-height: 1em;
101
- min-width: 1em;
102
- padding: dp(8);
103
- font-size: dp(24); // Internal padding provided by font
104
- box-sizing: content-box;
105
- user-select: none;
106
- -moz-user-select: none;
107
- -ms-user-select: none;
108
- -webkit-user-select: none;
109
- }
110
-
111
- &[mdw-image] {
112
- border-radius: 50%;
113
- min-height: dp(24);
114
- min-width: dp(24);
115
- padding: 0;
116
- margin: 0;
117
- box-sizing: content-box;
118
- user-select: none;
119
- -moz-user-select: none;
120
- -ms-user-select: none;
121
- -webkit-user-select: none;
122
- > * {
123
- position: absolute;
124
- left: 0;
125
- top: 0;
126
- width: auto;
127
- height: 100%;
128
- // z-index: -1; // Safari has a negative z-index bug
129
- }
130
- }
131
-
132
- // Button Animations
133
- // Ripple doesn't appear until mouse-up
134
- // Background color transitions from hover to press
135
-
136
- // ::before - focus and press background
137
- // ::after - ripple
138
-
139
- &[disabled] > .mdw-ripple,
140
- &[disabled] > .mdw-button__focus-ring,
141
- &[disabled]::before,
142
- &[disabled]::after {
143
- content: none;
144
- display: none;
145
- }
146
-
147
-
148
- }
149
-
150
- .mdw-button {
151
- &::before {
152
- content: '';
153
- position: absolute;
154
- width: 100%;
155
- height: 100%;
156
- top: 0;
157
- left: 0;
158
- // Safari has a negative z-index bug
159
- // Might be related to display rule
160
- z-index: -1;
161
- border-radius: inherit;
162
- user-select: none;
163
- -moz-user-select: none;
164
- -ms-user-select: none;
165
- -webkit-user-select: none;
166
- pointer-events: none;
167
- background-color: currentColor;
168
- color: rgba(0, 0, 0, 0.12);
169
- opacity: 0;
170
- transition-property: opacity, transform;
171
- transform: scale(1);
172
- transition-duration: 200ms;
173
- }
174
- &:focus::before {
175
- opacity: 1;
176
- }
177
- }
178
-
179
- // Fix anchor line-height on IE11
180
- @include IEOnly {
181
- a.mdw-button:not([mdw-icon]) {
182
- line-height: 2.5em !important;
183
- }
184
- }
185
-
186
- // Extended touch target
187
- @mixin mdw-button__touch-target {
188
- @media (any-pointer: coarse) {
189
- content: "";
190
- position: absolute;
191
- width: 100%;
192
- height: $button__minimum-click-target;
193
- left: 0;
194
- top: 50%;
195
- transform: translateY(-50%);
196
- }
197
- }
198
-
199
- .mdw-button__focus-ring {
200
- overflow: hidden;
201
- // z-index: -1; // Safari has a negative z-index bug
202
- &,
203
- &::after {
204
- position: absolute;
205
- width: 100%;
206
- height: 100%;
207
- top: 0;
208
- left: 0;
209
- user-select: none;
210
- -moz-user-select: none;
211
- -ms-user-select: none;
212
- -webkit-user-select: none;
213
- pointer-events: none;
214
- }
215
-
216
- &::after {
217
- content: '';
218
- // Background-size does not animate smoothly.
219
- // Focus circle: inner-radius - 10% - fully transparent
220
- // Scale up by 10.0 to become 100% when not focused
221
- background-position: center center;
222
- transform: scale(10); // 10.0 has subpixel rendering issues
223
- transition-property: transform;
224
- transition-duration: 200ms;
225
- transition-delay: 5ms;
226
- transition-timing-function: $motion-easing-standard;
227
- background-image: radial-gradient(
228
- circle at center,
229
- transparent 10%,
230
- currentColor 10.0001%);
231
- color: black;
232
- opacity: 0;
233
- .mdw-button:focus:not(:active) > & {
234
- transform: scale(7.5);
235
- transition-delay: $button__focus-animation-delay;
236
- transition-duration: $button__focus-animation-delay;
237
- animation-duration: $button__focus-animation-duration;
238
- animation-timing-function: $motion-easing-standard;
239
- animation-delay: $button__focus-animation-delay * 2;
240
- animation-iteration-count: infinite;
241
- animation-direction: alternate;
242
- animation-name: focus-pulse;
243
- opacity: 0.12;
244
- }
245
- }
246
- }
247
-
248
- .mdw-button[mdw-ripple] {
249
- overflow: visible;
250
- &::after {
251
- // If using custom ripple, destroy ::after object
252
- content: none;
253
- }
254
- }
255
-
256
- .mdw-button > .mdw-ripple {
257
- @include mdw-ripple__container;
258
- }
259
-
260
- .mdw-button {
261
- & > .mdw-ripple > .mdw-ripple__inner,
262
- &::after {
263
- @include mdw-ripple__inner;
264
- }
265
-
266
- & > .mdw-ripple:active > .mdw-ripple__inner,
267
- &:active::after {
268
- @include mdw-ripple__active;
269
- }
270
- }
271
-
272
- // Raised
273
- .mdw-button[mdw-raised]:not([disabled]) {
274
- box-shadow: elevation(2);
275
- &:active {
276
- box-shadow: elevation(8);
277
- }
278
- @media (any-pointer: fine) {
279
- &:not([mdw-raised="always"]) {
280
- box-shadow: elevation(0);
281
- &:hover {
282
- box-shadow: elevation(2);
283
- }
284
- &:active,
285
- &:hover:active {
286
- box-shadow: elevation(8);
287
- }
288
- }
289
- }
290
- }
291
-
292
- @keyframes focus-pulse {
293
- from { transform: scale(7.5); }
294
- to { transform: scale(8.0) }
295
- }
296
-
297
- .mdw-button[mdw-theme-color] {
298
- &::before {
299
- color: inherit;
300
- }
301
- &:focus::before {
302
- opacity: 0.12;
303
- }
304
- &:active::before {
305
- // Colored buttons have undocumented press color
306
- opacity: 0.26;
307
- transition-delay: $button__click-timeout;
308
- transition-duration: $button__long-press-timeout - $button__click-timeout;
309
- transition-timing-function: $motion-easing-deceleration;
310
- }
311
- &:focus:not(:active) > .mdw-button__focus-ring::after {
312
- color: inherit;
313
- opacity: 0.26;
314
- }
315
- }
@@ -1,134 +0,0 @@
1
- // https://material.io/guidelines/components/buttons.html
2
- // https://material.io/guidelines/style/icons.html
3
-
4
- @import '../common/functions.scss';
5
- @import '../common/mixins.scss';
6
-
7
- $buttonColors: (
8
- text-color: ((#000, 0.87), (#fff, 1.00)),
9
- active-color__focus: ((#000, 0.87), (#fff, 1.00)),
10
- active-color: ((#000, 0.54), (#fff, 0.70)),
11
- inactive-color: ((#000, 0.38), (#fff, 0.50)),
12
-
13
- press-color__transparent: ((#999, 0.40), (#CCC, 0.25)),
14
- ripple-color: ( #000 , #fff ),
15
- ripple-opacity: ( 0.12 , 0.30, 0.20),
16
-
17
- icon-press-opacity: ( 0.12 , 0.30, 0.20),
18
- //icon-ripple-opacity: ( 0.36 , 0.90, 0.60), // 3x for visibility
19
- icon-ripple-color: ( #000 , #fff ),
20
- transparent-focus-overlay: ((#000, 0.12), (#fff, 0.12)),
21
- disabled-text-color: ((#000, 0.26), (#fff, 0.30)),
22
- disabled-background-color: ((#000, 0.12), (#fff, 0.12)),
23
- outline-color: ((#000, 0.12), (#fff, 0.12)),
24
- filled-press-primary-color: (('primary', '700', 1.0), ('primary', '700', 1.0)),
25
- filled-press-accent-color: (('accent', '700', 1.0), ('accent', '700', 1.0)),
26
- filled-press-warn-color: (('warn', '700', 1.0), ('warn', '700', 1.0))
27
- );
28
-
29
- @function buttonThemeValue($key, $type, $theme) {
30
- @return themeValue('button', $buttonColors, $key, $type, $theme);
31
- }
32
-
33
- @mixin buttonThemeVariables($color, $lightness) {
34
- @include themeVariables('button', $buttonColors, $color, $lightness);
35
- }
36
-
37
- @mixin internalButtonContrastRules($type, $theme: null) {
38
- @at-root {
39
- #{&}.mdw-button {
40
- // Disabled
41
- &[disabled] {
42
- color: buttonThemeValue("disabled-text-color", $type, $theme);
43
- &[mdw-theme-fill] {
44
- // Disabled filled buttons use parent's theming context
45
- @if ($type == 'var') {
46
- --button__disabled-text-color: inherit;
47
- --button__disabled-background-color: inherit;
48
- color: buttonThemeValue("disabled-text-color", 'var', $theme);
49
- background-color: buttonThemeValue("disabled-background-color", 'var', $theme);
50
- } @else {
51
- // Average color and opacity
52
- color: mix(
53
- buttonThemeValue("disabled-text-color", 'light', $theme),
54
- buttonThemeValue("disabled-text-color", 'dark', $theme)
55
- );
56
- background-color: mix(
57
- buttonThemeValue("disabled-background-color", 'light', $theme),
58
- buttonThemeValue("disabled-background-color", 'dark', $theme)
59
- );
60
- }
61
- }
62
- }
63
-
64
- // Foreground Color
65
- &:not([mdw-theme-color]):not([disabled]) {
66
- color: buttonThemeValue("text-color", $type, $theme);
67
- }
68
- &[mdw-inactive]:not([disabled]) {
69
- color: buttonThemeValue("inactive-color", $type, $theme);
70
- }
71
- &[mdw-active]:not([mdw-theme-color]):not([disabled]) {
72
- color: buttonThemeValue("active-color", $type, $theme);
73
- &:focus {
74
- color: buttonThemeValue("active-color__focus", $type, $theme);
75
- }
76
- }
77
-
78
- // Focus and press colors
79
- &:not([mdw-theme-color]):not([mdw-theme-fill]) {
80
- &::before {
81
- background-color: buttonThemeValue("transparent-focus-overlay", $type, $theme);
82
- }
83
- &:active::before {
84
- background-color: buttonThemeValue("press-color__transparent", $type, $theme);
85
- }
86
- .mdw-button__focus-ring {
87
- color: buttonThemeValue("transparent-focus-overlay", $type, $theme);
88
- }
89
- }
90
-
91
- // Can be overridden by theme-color
92
- &:not([mdw-theme-color]) {
93
- & > .mdw-ripple > .mdw-ripple__inner,
94
- &:after {
95
- opacity: buttonThemeValue("ripple-opacity", $type, $theme);
96
- color: buttonThemeValue("ripple-color", $type, $theme);
97
- }
98
- }
99
-
100
- // Outline colors
101
- &[mdw-outline] {
102
- border-color: buttonThemeValue('outline-color', $type, $theme);
103
- }
104
- }
105
- }
106
- }
107
-
108
- // Vary by contrast
109
- @mixin buttonContrastRules($type: 'var', $theme: null) {
110
- @include internalButtonContrastRules($type, $theme);
111
- @if ($type != 'var') {
112
- :not([mdw-theme-fill]) {
113
- @include internalButtonContrastRules($type, $theme);
114
- }
115
- }
116
- }
117
-
118
- // Varies by theme
119
- @mixin buttonThemeRules($theme: null) {
120
- .mdw-button[mdw-theme-fill~=dark]:not([disabled]):active {
121
- &[mdw-theme-fill~="primary"],
122
- &[mdw-theme-fill|="primary"] {
123
- background-color: buttonThemeValue("filled-press-primary-color", null, $theme);
124
- }
125
- &[mdw-theme-fill~="accent"],
126
- &[mdw-theme-fill|="accent"] {
127
- background-color: buttonThemeValue("filled-press-accent-color", null, $theme);
128
- }
129
- &[mdw-theme-fill~="warn"],
130
- &[mdw-theme-fill|="warn"] {
131
- background-color: buttonThemeValue("filled-press-warn-color", null, $theme);
132
- }
133
- }
134
- }
@@ -1,175 +0,0 @@
1
- // https://material.io/guidelines/components/cards.html
2
-
3
- @import '../common/functions.scss';
4
- @import '../common/motion.scss';
5
- @import '../common/variables.scss';
6
-
7
- .mdw-card {
8
- box-shadow: elevation(0);
9
- display: block;
10
- outline: none;
11
- @include type-rules('body-2');
12
-
13
- position: relative;
14
-
15
- &::before {
16
- // Outline is behind content, not around it
17
- content: "";
18
- position: absolute;
19
- top: 0;
20
- left: 0;
21
- right: 0;
22
- bottom: 0;
23
- border-radius: inherit;
24
- border: solid dp(1);
25
- border-color: inherit;
26
- }
27
-
28
- @include allHandsetsAndTablets() {
29
- box-shadow: elevation(1);
30
- &::before {
31
- border-color: transparent;
32
- }
33
- }
34
-
35
- &[mdw-elevation="1"] {
36
- box-shadow: elevation(1);
37
- &::before {
38
- border-color: transparent;
39
- }
40
- }
41
-
42
- &:hover,
43
- &:focus,
44
- &:focus-within,
45
- &[mdw-raised] {
46
- box-shadow: elevation(8);
47
- }
48
-
49
- transition-property: box-shadow;
50
- transition-timing-function: $motion-easing-standard;
51
- transition-duration: $motion-duration-desktop-default;
52
- @include allHandsets {
53
- transition-duration: $motion-duration-mobile-default;
54
- }
55
- @include allTablets {
56
- transition-duration: $motion-duration-tablet-default;
57
- }
58
- }
59
-
60
-
61
-
62
- .mdw-card__supporting-text,
63
- .mdw-card > .mdw-divider {
64
- padding: 0 dp(16);
65
- }
66
-
67
- .mdw-card__thumbnail {
68
- margin-top: dp(16);
69
- margin-bottom: 0;
70
- margin-right: dp(16);
71
- margin-left: dp(16);
72
- float: left;
73
- html[dir=rtl] & {
74
- float: right;
75
- }
76
- }
77
-
78
- .mdw-card__image {
79
- width: 100%;
80
- height: auto;
81
- }
82
-
83
- .mdw-card__media {
84
- // In front of outline
85
- line-height: 0;
86
- z-index: 1;
87
- position: relative;
88
- &[mdw-ratio] > .mdw-card__image {
89
- position: absolute;
90
- height: 100%;
91
- object-fit: cover;
92
- }
93
- &[mdw-ratio]::after {
94
- content: '';
95
- display: inline-block;
96
- width: auto;
97
- height: 0;
98
- }
99
- &[mdw-ratio="16:9"]::after {
100
- padding-bottom: calc(100% / 16 * 9);
101
- }
102
- &[mdw-ratio="3:2"]::after {
103
- padding-bottom: calc(100% / 3 * 2);
104
- }
105
- &[mdw-ratio="4:3"]::after {
106
- padding-bottom: calc(100% / 4 * 3);
107
- }
108
- &[mdw-ratio="1:1"]::after {
109
- padding-bottom: calc(100% / 1 * 1);
110
- }
111
- }
112
-
113
- .mdw-card__header-thumbnail {
114
- align-self: center;
115
- min-height: 40px;
116
- min-width: 40px;
117
- margin-left: 0;
118
- margin-right: dp(16);
119
- html[dir=rtl] & {
120
- margin-left: dp(16);
121
- margin-right: 0;
122
- }
123
- }
124
-
125
- .mdw-card__header {
126
- white-space: nowrap;
127
- margin: 0;
128
- }
129
-
130
- h5.mdw-card__header {
131
- @include baseline-top(40);
132
- @include type-rules('h5');
133
- @include baseline-bottom(28);
134
- margin-bottom: dp(-28);
135
- }
136
-
137
- h6.mdw-card__header {
138
- @include baseline-top(34);
139
- @include type-rules('h6');
140
- }
141
-
142
- .mdw-card__header[mdw-two-line] {
143
- @include baseline-bottom(22);
144
- margin-bottom: dp(-22);
145
- & ~ .mdw-card__subheader {
146
- @include baseline-top(22);
147
- @include baseline-bottom(16);
148
- }
149
- }
150
-
151
- .mdw-card__supporting-text {
152
- @include baseline-top(28);
153
- @include baseline-bottom(16);
154
- }
155
-
156
- .mdw-card__actions {
157
- display: flex;
158
- padding-top: dp(8);
159
- padding-right: dp(4);
160
- padding-left: dp(4);
161
-
162
- > .mdw-button {
163
- margin: 0 dp(4);
164
- }
165
- > span {
166
- flex: 1;
167
- }
168
- }
169
-
170
- .mdw-card__actions,
171
- .mdw-card__supporting-text {
172
- &:last-child {
173
- padding-bottom: dp(8);
174
- }
175
- }
@@ -1,43 +0,0 @@
1
- @import '../common/functions.scss';
2
- @import '../common/mixins.scss';
3
-
4
- $cardColors: (
5
- background: ((#fff, 1.00), ('background', '800', 1.00)),
6
- text-color: ((#000, 0.87), (#fff, 1.00)),
7
- border-color: ((#000, 0.12), (#fff, 0.12)),
8
- focus-color: ((#000, 0.06), (#fff, 0.10)),
9
- );
10
-
11
- @function cardThemeValue($key, $type, $theme) {
12
- @return themeValue('card', $cardColors, $key, $type, $theme);
13
- }
14
-
15
- @mixin cardThemeVariables($color, $lightness) {
16
- @include themeVariables('card', $cardColors, $color, $lightness);
17
- }
18
-
19
- @mixin internalCardContrastRules($type, $theme: null) {
20
- @at-root {
21
- #{&}.mdw-card{
22
- &:not([mdw-theme-fill]) {
23
- background-color: cardThemeValue("background", $type, $theme);
24
- }
25
- &:not([mdw-theme-color]) {
26
- color: cardThemeValue("text-color", $type, $theme);
27
- }
28
- border-color: cardThemeValue("border-color", $type, $theme);
29
- &:focus::before {
30
- background-color: cardThemeValue("focus-color", $type, $theme);
31
- }
32
- }
33
- }
34
- }
35
- // Vary by contrast or theme
36
- @mixin cardContrastRules($type: 'var', $theme: null) {
37
- @include internalCardContrastRules($type, $theme);
38
- @if ($type != 'var') {
39
- :not([mdw-theme-fill]) {
40
- @include internalCardContrastRules($type, $theme);
41
- }
42
- }
43
- }
@@ -1,51 +0,0 @@
1
- /**
2
- * @param {Element} element
3
- * @param {string} className
4
- * @return {Element}
5
- */
6
- export function getChildElementByClass(element, className) {
7
- const child = element.getElementsByClassName(className)[0];
8
- if (child && child.parentElement !== element) {
9
- return null;
10
- }
11
- return child;
12
- }
13
-
14
- /**
15
- * @param {Element} element
16
- * @param {string} className
17
- * @param {boolean=} [includeSelf=true]
18
- * @return {Element}
19
- */
20
- export function findElementParentByClassName(element, className, includeSelf) {
21
- /** @type {Element} */
22
- let el;
23
- if (includeSelf === false) {
24
- el = element.parentElement;
25
- } else {
26
- el = element;
27
- }
28
- while (el != null && !el.classList.contains(className)) {
29
- el = el.parentElement;
30
- }
31
- return el;
32
- }
33
-
34
- /** @return {boolean} */
35
- export function isRtl() {
36
- return document.documentElement.hasAttribute('dir')
37
- && document.documentElement.getAttribute('dir').toLowerCase() === 'rtl';
38
- }
39
-
40
- /**
41
- * @param {Element} element
42
- * @param {string} type
43
- * @return {boolean}
44
- */
45
- export function dispatchDomEvent(element, type) {
46
- const event = document.createEvent('Event');
47
- event.initEvent(type, true, true);
48
- return element.dispatchEvent(event);
49
- }
50
-
51
- export const nextTick = window.requestAnimationFrame || (cb => setTimeout(cb, 17));