@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,98 +0,0 @@
1
- @import '../common/functions.scss';
2
- @import '../common/mixins.scss';
3
-
4
- $selectionColors: (
5
- text-color: ((#000, 0.87), (#fff, 1.00)),
6
- color: ((#000, 0.54), (#fff, 0.70)),
7
- ripple-color: ( #000 , #fff ),
8
- ripple-opacity: ( 0.12 , 0.30 , 0.20),
9
- disabled-color: ((#000, 0.26), (#fff, 0.30)),
10
- thumb-on-color: ( currentColor , currentColor ),
11
- thumb-disabled-color: ( #BDBDBD , #424242 ),
12
- thumb-off-color: ( #FAFAFA , #BDBDBD ),
13
-
14
- track-on-color: ( currentColor , currentColor ),
15
- track-on-opacity: ( 0.50 , 0.50 ),
16
-
17
- track-off-color: ( #000000 , #FFFFFF ),
18
- track-off-opacity: ( 0.38 , 0.30 ),
19
-
20
- track-disabled-color: ( #000000 , #FFFFFF ),
21
- track-disabled-opacity: ( 0.12 , 0.10 ),
22
- );
23
-
24
- @function selectionThemeValue($key, $type, $theme) {
25
- @return themeValue('selection', $selectionColors, $key, $type, $theme);
26
- }
27
-
28
- @mixin selectionThemeVariables($color, $lightness) {
29
- @include themeVariables('selection', $selectionColors, $color, $lightness);
30
- }
31
-
32
- // Vary by contrast
33
- @mixin selectionContrastRules($type: 'var', $theme: null) {
34
- .mdw-selection__input {
35
- color: selectionThemeValue("ripple-color", $type, $theme);
36
- &:active:not(:disabled),
37
- &:focus {
38
- opacity: selectionThemeValue("ripple-opacity", $type, $theme);
39
- }
40
- &[type="checkbox"]:not(:checked) ~ .mdw-selection__icon,
41
- &[type="checkbox"]:active:not(:disabled) ~ .mdw-selection__icon {
42
- color: selectionThemeValue("color", $type, $theme);
43
- }
44
-
45
- &[type="radio"]:not(:checked) ~ .mdw-selection__icon {
46
- color: selectionThemeValue("color", $type, $theme);
47
- }
48
- &[type="checkbox"]:checked ~ .mdw-selection__icon::after {
49
- // Checkbox color is based on currently filled background-color
50
- @if($type == 'var') {
51
- border-color: unquote("rgb(var(--background-color))");
52
- } @else {
53
- // IE11 Fallback
54
- border-color: white;
55
- }
56
- }
57
- &:disabled ~ .mdw-selection__label,
58
- &:disabled ~ .mdw-selection__icon,
59
- &:disabled ~ .mdw-selection__icon::before {
60
- color: selectionThemeValue("disabled-color", $type, $theme);
61
- }
62
- }
63
- .mdw-selection__label,
64
- .mdw-selection[mdw-theme-color] .mdw-selection__input:not(:disabled) ~ .mdw-selection__label {
65
- color: selectionThemeValue("text-color", $type, $theme);
66
- }
67
- .mdw-selection[mdw-switch] .mdw-selection__input[type="checkbox"] {
68
-
69
- & ~ .mdw-selection__icon {
70
- &::before {
71
- background-color: selectionThemeValue("thumb-off-color", $type, $theme);
72
- }
73
- &::after {
74
- background-color: selectionThemeValue("track-off-color", $type, $theme);
75
- opacity: selectionThemeValue("track-off-opacity", $type, $theme);
76
- }
77
- }
78
- &:checked ~ .mdw-selection__icon {
79
- &::before {
80
- background-color: selectionThemeValue("thumb-on-color", $type, $theme);
81
- }
82
- &::after {
83
- background-color: selectionThemeValue("track-on-color", $type, $theme);
84
- }
85
- }
86
- &:disabled ~ .mdw-selection__icon {
87
- &::before {
88
- background-color: selectionThemeValue("thumb-disabled-color", $type, $theme);
89
- }
90
- &::after {
91
- background-color: selectionThemeValue("track-disabled-color", $type, $theme);
92
- opacity: selectionThemeValue("track-disabled-opacity", $type, $theme);
93
- }
94
- }
95
-
96
-
97
- }
98
- }
@@ -1,212 +0,0 @@
1
- // https://material.io/design/components/snackbars.html#spec
2
-
3
- // Guidelines conflict stating a background should be fully opaque
4
- // But says spec says to use #000000 with 87% opacity
5
- // Calculated against white, opaque value is #212121 (Grey-900)
6
-
7
- $snackbar__background-color: #212121;
8
- $snackbar__color: rgba(255, 255, 255, 0.87);
9
- $snackbar__scale-up__from: 0.85;
10
-
11
- .mdw-snackbar__wrapper {
12
- position: relative;
13
- z-index: 6;
14
- }
15
-
16
- .mdw-snackbar__container {
17
- position: absolute;
18
- display: flex;
19
- flex-direction: row;
20
- z-index: 6;
21
- left: 0;
22
- bottom: 0;
23
- right: 0;
24
- justify-content: flex-start;
25
- &[mdw-position="end"] {
26
- justify-content: flex-end;
27
- }
28
- &[mdw-position="center"] {
29
- justify-content: center;
30
- }
31
- }
32
-
33
- .mdw-snackbar {
34
- position: absolute;
35
- bottom: 0;
36
- padding: 0 dp(16);
37
- min-height: dp(48);
38
- max-width: 100%;
39
- border-radius: dp(4);
40
-
41
- box-shadow: elevation(6);
42
-
43
- background: $snackbar__background-color;
44
- color: $snackbar__color;
45
-
46
- @include type-rules('body-2');
47
-
48
- display: flex;
49
- align-items: center;
50
- justify-content: space-between;
51
-
52
- // Default state is shown
53
- opacity: 1;
54
- transform: scale(1);
55
- will-change: opacity, transform;
56
- transition-property: opacity, transform;
57
- transition-timing-function: $motion-easing-deceleration;
58
- transition-delay: 0s, 0s;
59
- transition-duration: $motion-duration-desktop-enter;
60
- @include allHandsets {
61
- transition-duration: $motion-duration-mobile-enter;
62
- }
63
- @include allTablets {
64
- transition-duration: $motion-duration-tablet-enter;
65
- }
66
-
67
- // Disable animations with explicit visibility
68
- &[mdw-autohide] {
69
- animation-fill-mode: forwards;
70
- animation-name: showSnackbar, hideSnackbar;
71
- animation-timing-function: $motion-easing-deceleration, $motion-easing-acceleration;
72
- animation-delay: 0s, 4s;
73
- animation-duration: $motion-duration-desktop-enter, $motion-duration-desktop-leave;
74
- @include allHandsets {
75
- animation-duration: $motion-duration-mobile-enter, $motion-duration-mobile-leave;
76
- }
77
- @include allTablets {
78
- animation-duration: $motion-duration-tablet-enter, $motion-duration-tablet-leave;
79
- }
80
- }
81
-
82
- // Disable animation with explicit visibility
83
- &[mdw-show],
84
- &[mdw-hide] {
85
- animation-name: none;
86
- }
87
-
88
- &[mdw-consecutive]:not([mdw-hide]) {
89
- // Delay showing consecutive snackbar equal to previous snackbar's leave time
90
- transition-delay: $motion-duration-desktop-leave;
91
- @include allHandsets {
92
- transition-delay: $motion-duration-mobile-leave;
93
- }
94
- @include allTablets {
95
- transition-delay: $motion-duration-tablet-leave;
96
- }
97
- }
98
-
99
- &[mdw-hide] {
100
- opacity: 0;
101
- transform: scale($snackbar__scale-up__from);
102
-
103
- transition-timing-function: $motion-easing-acceleration;
104
- transition-duration: $motion-duration-desktop-leave;
105
- transition-delay: 0s, $motion-duration-desktop-leave;
106
- @include allHandsets {
107
- transition-duration: $motion-duration-mobile-leave;
108
- transition-delay: 0s, $motion-duration-mobile-leave;
109
- }
110
- @include allTablets {
111
- transition-duration: $motion-duration-tablet-leave;
112
- transition-delay: 0s, $motion-duration-tablet-leave;
113
- }
114
- }
115
-
116
- @for $seconds from 5 to 11 {
117
- &[mdw-autohide="#{$seconds}"] {
118
- animation-delay: 0s, #{$seconds}s;
119
- }
120
- }
121
-
122
- }
123
-
124
- @keyframes hideSnackbar {
125
- from {
126
- opacity: 1;
127
- }
128
- to {
129
- opacity: 0;
130
- }
131
- }
132
-
133
- @keyframes showSnackbar {
134
- from {
135
- opacity: 0;
136
- }
137
- to {
138
- opacity: 1;
139
- }
140
- }
141
-
142
- .mdw-snackbar .mdw-button {
143
- order: 1;
144
- margin-top: dp(6);
145
- margin-bottom: dp(6);
146
- margin-left: dp(8);
147
- margin-right: dp(-8);
148
- html[dir=rtl] & {
149
- margin-left: dp(-8);
150
- margin-right: dp(8);
151
- }
152
- }
153
-
154
- .mdw-snackbar > span {
155
- white-space: pre-line;
156
- @include baseline-top(30);
157
- @include baseline-bottom(48 - 30);
158
- }
159
-
160
- @media screen and (max-width: $breakpoint-portrait-handset-max) {
161
- .mdw-snackbar {
162
- left: 0;
163
- right: 0;
164
- &[mdw-stacked] {
165
- flex-direction: column;
166
- align-items: flex-end;
167
- justify-content: center;
168
- > span {
169
- width: 100%;
170
- }
171
- .mdw-button {
172
- margin-top: dp(2);
173
- margin-bottom: dp(8);
174
- }
175
- }
176
- }
177
- }
178
-
179
- @include IEOnly() {
180
- // Fix IE flexbug
181
- .mdw-snackbar {
182
- &::after {
183
- content: '';
184
- min-width: 0;
185
- min-height: inherit;
186
- }
187
- }
188
- .mdw-snackbar__container[mdw-position="center"] {
189
- .mdw-snackbar {
190
- transform: translateX(-50%);
191
- &[mdw-hide] {
192
- transform: translateX(-50%) scale($snackbar__scale-up__from);
193
- }
194
- html[dir=rtl] & {
195
- transform: translateX(50%);
196
- &[mdw-hide] {
197
- transform: translateX(50%) scale($snackbar__scale-up__from);
198
- }
199
- }
200
- }
201
- }
202
- .mdw-snackbar__container[mdw-position="end"] {
203
- .mdw-snackbar {
204
- right: 0;
205
- html[dir=rtl] & {
206
- left: 0;
207
- right: auto;
208
- }
209
- }
210
- }
211
-
212
- }
@@ -1,3 +0,0 @@
1
- // https://material.io/guidelines/components/selection-controls.html#
2
- // https://material.io/guidelines/patterns/selection.html#selection-item-selection
3
-
@@ -1,275 +0,0 @@
1
- // https://material.io/design/components/tabs.html#spec
2
-
3
- @import '../common/functions.scss';
4
- @import '../common/motion.scss';
5
-
6
- $tab__icon-size: 24;
7
- $tab__icon-margin-top: 12;
8
- $tab__icon-to-label-baseline: 20;
9
- $tab__icon-with-label-height: 72;
10
-
11
- .mdw-tab {
12
- display: flex;
13
- flex-direction: column;
14
- }
15
-
16
- .mdw-tab__items {
17
- overflow-y: hidden;
18
- position: relative;
19
-
20
- flex: none;
21
-
22
- display: flex; // IE11 doesn't support grid-auto-columns
23
- display: grid;
24
-
25
- grid-auto-columns: 1fr;
26
-
27
- justify-content: flex-start;
28
- flex-direction: row;
29
- &[mdw-scrollable] {
30
- display: flex;
31
- overflow-x: auto;
32
- box-sizing: border-box;
33
- > .mdw-tab__item {
34
- min-width: dp(90);
35
- max-width: 100%;
36
- flex: none;
37
- }
38
- > .mdw-tab__indicator {
39
- margin-left: dp(52);
40
- }
41
- &::before,
42
- &::after {
43
- // Ensures 52dp blank space at end
44
- content: "";
45
- min-width: dp(52);
46
- }
47
- }
48
- }
49
-
50
- .mdw-tab__indicator {
51
- position: absolute;
52
- bottom: 0;
53
- height: 2px;
54
- width: 0;
55
- left: 0;
56
- right: auto;
57
- html[dir=rtl] & {
58
- right: 0;
59
- left: auto;
60
- }
61
- background-color: currentColor;
62
- transform-origin: left center;
63
- transition-property: transform;
64
- transition-timing-function: $motion-easing-standard;
65
- transition-duration: $motion-duration-desktop-default;
66
- @include allHandsets {
67
- transition-duration: $motion-duration-mobile-default;
68
- }
69
- @include allTablets {
70
- transition-duration: $motion-duration-tablet-default;
71
- }
72
- // Indicator width
73
- // Element position = 2 * number of input elements + 1 (itself)
74
- // Width = 100% / number of input elements
75
- @for $j from 1 through 8 {
76
- &:nth-child(#{$j + 1}) {
77
- width: #{100% / $j};
78
- }
79
- }
80
- // Indicator offset
81
- @for $i from 1 through 8 {
82
- .mdw-tab__input:checked:nth-of-type(#{$i}) ~ .mdw-tab__items > &,
83
- .mdw-tab__input:checked:nth-of-type(#{$i}) ~ .mdw-tab__items-wrapper .mdw-tab__items > &,
84
- .mdw-tab__item[mdw-selected]:nth-of-type(#{$i}) ~ & {
85
- transform: translateX(#{100% * ($i - 1)});
86
- }
87
- html[dir=rtl] .mdw-tab__input:checked:nth-of-type(#{$i}) ~ .mdw-tab__items > &,
88
- html[dir=rtl] .mdw-tab__input:checked:nth-of-type(#{$i}) ~ .mdw-tab__items-wrapper .mdw-tab__items > &,
89
- html[dir=rtl] .mdw-tab__item[mdw-selected]:nth-of-type(#{$i}) ~ & {
90
- transform: translateX(#{-100% * ($i - 1)});
91
- }
92
- }
93
-
94
- &[mdw-js-indicator] {
95
- width: 1px;
96
- transform: translateX(0);
97
- }
98
- }
99
-
100
- .mdw-tab__item {
101
- min-height: dp(48); // Redundant but needed for IE11
102
- position: relative;
103
- display: flex;
104
- flex: auto;
105
- flex-direction: column;
106
- align-items: center;
107
-
108
- grid-row: 1;
109
-
110
- box-shadow: none;
111
- box-sizing: content-box;
112
- border-radius: 0;
113
- z-index: 0;
114
- overflow: hidden;
115
- cursor: pointer;
116
- user-select: none;
117
- -moz-user-select: none;
118
- -ms-user-select: none;
119
- -webkit-user-select: none;
120
- -webkit-tap-highlight-color: transparent;
121
- .mdw-tab__input:checked + & {
122
- cursor: default;
123
- }
124
-
125
- > .mdw-ripple {
126
- @include mdw-ripple__container;
127
- }
128
-
129
- & > .mdw-ripple > .mdw-ripple__inner,
130
- &::after {
131
- @include mdw-ripple__inner;
132
- }
133
-
134
- & > .mdw-ripple:active > .mdw-ripple__inner,
135
- &:active::after {
136
- @include mdw-ripple__active;
137
- }
138
-
139
- &[mdw-ripple] {
140
- overflow: visible;
141
- &::after {
142
- // If using custom ripple, destroy ::after object
143
- content: none;
144
- }
145
- }
146
- }
147
-
148
- .mdw-tab__icon {
149
- margin-top: dp($tab__icon-margin-top);
150
- @include baseline-bottom($tab__icon-to-label-baseline);
151
- margin-bottom: dp(-$tab__icon-to-label-baseline);
152
- pointer-events: none;
153
- transition-property: color;
154
- transition-timing-function: $motion-easing-standard;
155
- transition-duration: $motion-duration-desktop-default;
156
- @include allHandsets {
157
- transition-duration: $motion-duration-mobile-default;
158
- }
159
- @include allTablets {
160
- transition-duration: $motion-duration-tablet-default;
161
- }
162
- }
163
-
164
- .mdw-tab__label {
165
- @include type-rules('button');
166
-
167
- box-sizing: border-box;
168
- margin-top: auto;
169
- margin-bottom: auto;
170
- pointer-events: none;
171
- padding: 0 dp(16);
172
-
173
- text-align: center;
174
- transition-property: color;
175
- transition-timing-function: $motion-easing-standard;
176
- transition-duration: $motion-duration-desktop-default;
177
- @include allHandsets {
178
- transition-duration: $motion-duration-mobile-default;
179
- }
180
- @include allTablets {
181
- transition-duration: $motion-duration-tablet-default;
182
- }
183
-
184
- .mdw-tab__icon ~ & {
185
- margin: 0;
186
- min-height: 0;
187
- display: block;
188
- @include baseline-top($tab__icon-to-label-baseline);
189
- @include baseline-bottom($tab__icon-with-label-height
190
- - $tab__icon-margin-top
191
- - $tab__icon-size
192
- - $tab__icon-to-label-baseline
193
- );
194
- }
195
- }
196
-
197
- .mdw-tab__input {
198
- display: inline-block;
199
- height: 0;
200
- width: 0;
201
- margin: 0;
202
- padding: 0;
203
-
204
- outline: none;
205
- pointer-events: none;
206
- -moz-appearance: none;
207
- -webkit-appearance: none;
208
- }
209
-
210
- .mdw-tab__item[mdw-selected] > .mdw-tab__icon,
211
- .mdw-tab__item[mdw-selected] > .mdw-tab__label {
212
- color: inherit;
213
- }
214
- @for $i from 1 through 8 {
215
- .mdw-tab__input:checked:nth-of-type(#{$i}) ~ .mdw-tab__items,
216
- .mdw-tab__input:checked:nth-of-type(#{$i}) ~ .mdw-tab__items-wrapper .mdw-tab__items {
217
- & > .mdw-tab__item:nth-child(#{$i}) {
218
- > .mdw-tab__icon,
219
- > .mdw-tab__label {
220
- color: inherit;
221
- }
222
- }
223
- }
224
- }
225
-
226
- .mdw-tab__content {
227
- display: flex;
228
- flex-direction: row;
229
- flex-grow: 1;
230
- align-items: stretch;
231
- overflow-x: hidden;
232
- position: relative;
233
- }
234
-
235
- .mdw-tab__content-item {
236
- max-width: 100%;
237
- visibility: hidden;
238
- flex-basis: 100%;
239
- flex-shrink: 0;
240
- transition-property: transform, visibility;
241
- transition-timing-function: $motion-easing-standard;
242
- transition-duration: $motion-duration-desktop-default, 0s;
243
- transition-delay: 0s, $motion-duration-desktop-default;
244
- @include allHandsets {
245
- transition-duration: $motion-duration-mobile-default, 0s;
246
- transition-delay: 0s, $motion-duration-mobile-default;
247
- }
248
- @include allTablets {
249
- transition-duration: $motion-duration-tablet-default, 0s;
250
- transition-delay: 0s, $motion-duration-tablet-default;
251
- }
252
- @for $j from 1 through 8 {
253
- .mdw-tab__content[mdw-selected-index="#{$j - 1}"] > &,
254
- .mdw-tab__input:checked:nth-of-type(#{$j}) ~ .mdw-tab__content > & {
255
- transform: translateX(#{-100% * ($j - 1)});
256
- &:nth-child(#{$j}) {
257
- visibility: visible;
258
- transition-delay: 0s, 0s;
259
- }
260
- }
261
- html[dir=rtl] .mdw-tab__content[mdw-selected-index="#{$j - 1}"] > &,
262
- html[dir=rtl] .mdw-tab__input:checked:nth-of-type(#{$j}) ~ .mdw-tab__content > & {
263
- transform: translateX(#{100% * ($j - 1)});
264
- }
265
- }
266
- }
267
-
268
- .mdw-tab__content[mdw-scrollsnap] {
269
- scroll-snap-type: x mandatory;
270
- -ms-scroll-snap-type: x mandatory;
271
- overflow-x: scroll;
272
- .mdw-tab__content-item {
273
- scroll-snap-align: start none;
274
- }
275
- }
@@ -1,34 +0,0 @@
1
- @import '../common/functions.scss';
2
- @import '../common/mixins.scss';
3
-
4
- $tabColors: (
5
- active-color: ((#000, 0.87), (#fff, 1.00)),
6
- inactive-color: ((#000, 0.54), (#fff, 0.70)),
7
- ripple-opacity: ( 0.26 , 0.30),
8
- );
9
-
10
- @function tabThemeValue($key, $type, $theme) {
11
- @return themeValue('tab', $tabColors, $key, $type, $theme);
12
- }
13
-
14
- @mixin tabThemeVariables($color, $lightness) {
15
- @include themeVariables('tab', $tabColors, $color, $lightness);
16
- }
17
-
18
- // Vary by contrast
19
- @mixin tabContrastRules($type: 'var', $theme: null) {
20
- .mdw-tab__items:not([mdw-theme-color]) {
21
- color: tabThemeValue("active-color", $type, $theme);
22
- }
23
- .mdw-tab__icon,
24
- .mdw-tab__label {
25
- color: tabThemeValue("inactive-color", $type, $theme);
26
- }
27
-
28
- .mdw-tab__item {
29
- & > .mdw-ripple > .mdw-ripple__inner,
30
- &::after {
31
- opacity: tabThemeValue("ripple-opacity", $type, $theme);
32
- }
33
- }
34
- }
@@ -1,31 +0,0 @@
1
- @import '../common/functions.scss';
2
- @import '../common/mixins.scss';
3
-
4
- $templateColors: (
5
- text-color: ((#000, 0.54), (#fff, 0.87), (#fff, 1.00)),
6
- border-color: (('primary', '700', 0.87), ('primary', '200', 1.0)),
7
- );
8
-
9
- @function templateThemeValue($key, $type, $theme) {
10
- @return themeValue('template', $templateColors, $key, $type, $theme);
11
- }
12
-
13
- @mixin templateThemeVariables($color, $lightness) {
14
- @include themeVariables('template', $templateColors, $color, $lightness);
15
- }
16
-
17
- // Vary by contrast
18
- @mixin templateContrastRules($type: 'var', $theme: null) {
19
- @at-root {
20
- #{&}.mdw-template {
21
- color: templateThemeValue("text-color", $type, $theme);
22
- }
23
- }
24
- }
25
-
26
- // Varies by theme
27
- @mixin templateThemeRules($theme: null) {
28
- .mdw-template[mdw-theme-fill] {
29
- border-color: templateThemeValue('border-color', null, $theme);
30
- }
31
- }