@shortfuse/materialdesignweb 0.3.0 → 0.4.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 (398) hide show
  1. package/.eslintrc.json +136 -30
  2. package/.stylelintrc.json +6 -40
  3. package/.vscode/launch.json +20 -5
  4. package/CHANGELOG.md +24 -0
  5. package/README.md +12 -9
  6. package/adapters/datatable/column.js +82 -74
  7. package/adapters/datatable/index.js +173 -131
  8. package/adapters/dom/index.js +529 -75
  9. package/adapters/list/index.js +25 -12
  10. package/adapters/search/index.js +13 -13
  11. package/components/appbar/_spec.scss +87 -64
  12. package/components/appbar/index.scss +2 -2
  13. package/components/banner/_spec.scss +8 -8
  14. package/components/banner/index.scss +2 -2
  15. package/components/bottomnav/_spec.scss +22 -17
  16. package/components/bottomnav/index.js +61 -52
  17. package/components/bottomnav/index.scss +2 -2
  18. package/components/bottomnav/item.js +44 -25
  19. package/components/button/README.md +14 -14
  20. package/components/button/_spec.scss +23 -22
  21. package/components/button/_theme.scss +37 -21
  22. package/components/button/index.eta +32 -0
  23. package/components/button/index.js +12 -12
  24. package/components/button/index.scss +2 -2
  25. package/components/card/_spec.scss +40 -36
  26. package/components/card/index.scss +2 -2
  27. package/components/chip/_spec.scss +7 -8
  28. package/components/chip/_theme.scss +31 -31
  29. package/components/chip/index.js +3 -2
  30. package/components/chip/index.scss +2 -2
  31. package/components/chip/item.js +1 -16
  32. package/components/datatable/_spec.scss +71 -85
  33. package/components/datatable/_theme.scss +61 -156
  34. package/components/datatable/cell.js +45 -0
  35. package/components/datatable/columnheader.js +47 -0
  36. package/components/datatable/index.js +279 -366
  37. package/components/datatable/index.scss +2 -2
  38. package/components/datatable/row.js +49 -0
  39. package/components/datatable/rowheader.js +18 -0
  40. package/components/dialog/_spec.scss +61 -41
  41. package/components/dialog/index.js +325 -297
  42. package/components/dialog/index.scss +2 -2
  43. package/components/divider/_spec.scss +8 -6
  44. package/components/divider/index.scss +2 -2
  45. package/components/elevation/_spec.scss +2 -2
  46. package/components/elevation/index.scss +2 -2
  47. package/components/fab/_spec.scss +23 -24
  48. package/components/fab/index.js +50 -50
  49. package/components/fab/index.scss +2 -2
  50. package/components/grid/_spec.scss +33 -31
  51. package/components/grid/index.scss +2 -2
  52. package/components/layout/_mixins.scss +5 -5
  53. package/components/layout/_spec.scss +206 -176
  54. package/components/layout/_theme.scss +14 -16
  55. package/components/layout/index.js +181 -153
  56. package/components/layout/index.scss +2 -2
  57. package/components/list/_spec.scss +117 -104
  58. package/components/list/_theme.scss +31 -34
  59. package/components/list/content.js +68 -52
  60. package/components/list/index.js +194 -61
  61. package/components/list/index.scss +2 -2
  62. package/components/list/item.js +136 -12
  63. package/components/list/secondary.js +46 -0
  64. package/components/menu/_spec.scss +32 -19
  65. package/components/menu/index.js +242 -229
  66. package/components/menu/index.scss +2 -2
  67. package/components/menu/item.js +95 -110
  68. package/components/progress/_spec.scss +35 -27
  69. package/components/progress/index.js +21 -0
  70. package/components/progress/index.scss +2 -1
  71. package/components/selection/_spec.scss +242 -224
  72. package/components/selection/_theme.scss +100 -95
  73. package/components/selection/index.eta +60 -0
  74. package/components/selection/index.js +76 -0
  75. package/components/selection/index.pug +15 -8
  76. package/components/selection/index.scss +2 -2
  77. package/components/selection/input.js +56 -0
  78. package/components/selection/radiogroup.js +47 -0
  79. package/components/slider/_spec.scss +10 -8
  80. package/components/slider/index.scss +2 -2
  81. package/components/snackbar/_spec.scss +22 -21
  82. package/components/snackbar/index.js +102 -111
  83. package/components/snackbar/index.scss +2 -2
  84. package/components/tab/_spec.scss +20 -19
  85. package/components/tab/content.js +41 -40
  86. package/components/tab/index.js +192 -99
  87. package/components/tab/index.scss +2 -2
  88. package/components/tab/item.js +38 -55
  89. package/components/tab/list.js +96 -72
  90. package/components/tab/panel.js +12 -13
  91. package/components/template/_theme.scss +11 -11
  92. package/components/textfield/_mixins.scss +52 -0
  93. package/components/textfield/_spec.scss +215 -266
  94. package/components/textfield/_theme.scss +95 -72
  95. package/components/textfield/index.eta +74 -0
  96. package/components/textfield/index.js +63 -57
  97. package/components/textfield/index.scss +2 -2
  98. package/components/tooltip/_spec.scss +27 -25
  99. package/components/tooltip/index.scss +2 -2
  100. package/components/type/_spec.scss +51 -38
  101. package/components/type/index.scss +2 -2
  102. package/core/_breakpoint.scss +75 -91
  103. package/core/_elevation.scss +10 -10
  104. package/core/_length.scss +9 -0
  105. package/core/_motion.scss +14 -14
  106. package/core/_platform.scss +9 -15
  107. package/core/_type.scss +33 -32
  108. package/core/aria/attributes.js +125 -25
  109. package/core/aria/button.js +23 -23
  110. package/core/aria/keyboard.js +93 -0
  111. package/core/aria/rovingtabindex.js +69 -154
  112. package/core/aria/tab.js +31 -28
  113. package/core/color/_theme.scss +240 -280
  114. package/core/color/index.scss +2 -2
  115. package/core/document/index.js +39 -0
  116. package/core/dom.js +12 -12
  117. package/core/overlay/_spec.scss +0 -3
  118. package/core/overlay/_theme.scss +56 -74
  119. package/core/overlay/index.js +49 -18
  120. package/core/overlay/index.scss +2 -2
  121. package/core/ripple/_spec.scss +22 -39
  122. package/core/ripple/_theme.scss +13 -13
  123. package/core/ripple/index.js +137 -134
  124. package/core/ripple/index.scss +2 -2
  125. package/core/theme/_config.scss +2 -0
  126. package/core/theme/_mixins.scss +172 -0
  127. package/core/theme/_palettes.scss +155 -135
  128. package/core/theme/_variables.scss +24 -15
  129. package/core/theme/index.js +50 -0
  130. package/core/throttler.js +1 -1
  131. package/core/transition/index.js +36 -20
  132. package/{docs-src → docs}/_flex.scss +0 -0
  133. package/{docs-src → docs}/_menuoptions.js +21 -34
  134. package/{docs-src → docs}/_mixins.pug +39 -26
  135. package/docs/_partials/_androidnavbar.eta +5 -0
  136. package/docs/_partials/_androidstatusbar.eta +13 -0
  137. package/docs/_partials/_appbar.eta +29 -0
  138. package/docs/_partials/_buttontest.eta +31 -0
  139. package/docs/_partials/_header.eta +149 -0
  140. package/docs/_partials/_navlistitem.eta +16 -0
  141. package/docs/_partials/_target.eta +1 -0
  142. package/{docs-src → docs}/_sample-utils.js +8 -6
  143. package/{docs-src → docs}/_storage.js +0 -0
  144. package/{docs-src → docs}/docs.scss +5 -2
  145. package/docs/index.eta +16 -0
  146. package/{docs-src → docs}/index.js +0 -0
  147. package/docs/pages/appbar.eta +114 -0
  148. package/{docs-src/components → docs/pages}/appbar.js +0 -0
  149. package/{docs-src/components → docs/pages}/appbar.pug +15 -18
  150. package/docs/pages/bottomnav.eta +188 -0
  151. package/{docs-src/components → docs/pages}/bottomnav.js +23 -24
  152. package/{docs-src/components → docs/pages}/bottomnav.pug +4 -4
  153. package/docs/pages/button.eta +124 -0
  154. package/{docs-src/components → docs/pages}/button.js +19 -19
  155. package/{docs-src/components → docs/pages}/button.pug +15 -15
  156. package/docs/pages/card.eta +90 -0
  157. package/{docs-src/components → docs/pages}/card.js +3 -3
  158. package/{docs-src/components → docs/pages}/card.pug +7 -7
  159. package/docs/pages/chip.eta +122 -0
  160. package/{docs-src/components → docs/pages}/chip.js +3 -6
  161. package/{docs-src/components → docs/pages}/chip.pug +2 -2
  162. package/docs/pages/color.eta +143 -0
  163. package/{docs-src/core → docs/pages}/color.js +95 -20
  164. package/docs/pages/color.pug +121 -0
  165. package/docs/pages/datatable.eta +323 -0
  166. package/{docs-src/components → docs/pages}/datatable.js +26 -13
  167. package/docs/pages/datatable.pug +283 -0
  168. package/docs/pages/dialog.eta +186 -0
  169. package/{docs-src/components → docs/pages}/dialog.js +26 -13
  170. package/{docs-src/components → docs/pages}/dialog.pug +46 -28
  171. package/docs/pages/dom.eta +26 -0
  172. package/docs/pages/dom.js +143 -0
  173. package/docs/pages/dom.pug +22 -0
  174. package/docs/pages/elevation.eta +35 -0
  175. package/{docs-src/components → docs/pages}/elevation.js +0 -0
  176. package/{docs-src/components → docs/pages}/elevation.pug +0 -0
  177. package/docs/pages/fab.eta +99 -0
  178. package/{docs-src/components → docs/pages}/fab.js +3 -3
  179. package/{docs-src/components → docs/pages}/fab.pug +2 -2
  180. package/docs/pages/grid.eta +135 -0
  181. package/{docs-src/components → docs/pages}/grid.js +1 -1
  182. package/{docs-src/components → docs/pages}/grid.pug +3 -3
  183. package/docs/pages/layout.eta +8 -0
  184. package/{docs-src/components → docs/pages}/layout.js +0 -0
  185. package/{docs-src/components → docs/pages}/layout.pug +0 -0
  186. package/docs/pages/list.eta +465 -0
  187. package/{docs-src/components → docs/pages}/list.js +2 -2
  188. package/{docs-src/components → docs/pages}/list.pug +7 -14
  189. package/docs/pages/menu.eta +276 -0
  190. package/{docs-src/components → docs/pages}/menu.js +14 -10
  191. package/{docs-src/components → docs/pages}/menu.pug +0 -0
  192. package/docs/pages/overlay.eta +69 -0
  193. package/docs/pages/overlay.js +4 -0
  194. package/{docs-src/core → docs/pages}/overlay.pug +14 -11
  195. package/docs/pages/progress.eta +23 -0
  196. package/{docs-src/components → docs/pages}/progress.js +1 -1
  197. package/{docs-src/components → docs/pages}/progress.pug +1 -1
  198. package/docs/pages/ripple.eta +27 -0
  199. package/docs/pages/ripple.js +4 -0
  200. package/{docs-src/core → docs/pages}/ripple.pug +4 -4
  201. package/docs/pages/search.eta +246 -0
  202. package/{docs-src/components → docs/pages}/search.js +59 -42
  203. package/{docs-src/components → docs/pages}/search.pug +50 -51
  204. package/docs/pages/selection.eta +111 -0
  205. package/docs/pages/selection.js +13 -0
  206. package/docs/pages/selection.pug +74 -0
  207. package/docs/pages/slider.eta +23 -0
  208. package/{docs-src/components → docs/pages}/slider.js +0 -0
  209. package/{docs-src/components → docs/pages}/slider.pug +0 -0
  210. package/docs/pages/snackbar.eta +83 -0
  211. package/{docs-src/components → docs/pages}/snackbar.js +3 -3
  212. package/{docs-src/components → docs/pages}/snackbar.pug +0 -0
  213. package/docs/pages/tab.eta +421 -0
  214. package/{docs-src/components → docs/pages}/tab.js +18 -35
  215. package/{docs-src/components → docs/pages}/tab.pug +4 -4
  216. package/docs/pages/textfield.eta +486 -0
  217. package/{docs-src/components → docs/pages}/textfield.js +3 -4
  218. package/{docs-src/components → docs/pages}/textfield.pug +87 -35
  219. package/docs/pages/tooltip.eta +94 -0
  220. package/{docs-src/components → docs/pages}/tooltip.js +0 -0
  221. package/{docs-src/components → docs/pages}/tooltip.pug +0 -1
  222. package/docs/pages/transition.eta +117 -0
  223. package/{docs-src/core → docs/pages}/transition.js +7 -8
  224. package/{docs-src/core → docs/pages}/transition.pug +0 -0
  225. package/docs/pages/type.eta +31 -0
  226. package/{docs-src/components → docs/pages}/type.js +0 -0
  227. package/{docs-src/components → docs/pages}/type.pug +0 -1
  228. package/docs/postrender.js +39 -0
  229. package/{docs-src → docs}/prerender.js +3 -9
  230. package/docs/pwa/_dialogs.eta +143 -0
  231. package/docs/pwa/_dialogs.pug +96 -0
  232. package/docs/pwa/_menus.eta +16 -0
  233. package/{docs-src → docs}/pwa/_menus.pug +0 -0
  234. package/docs/pwa/pwa-prerender.js +3 -0
  235. package/docs/pwa/pwa.eta +480 -0
  236. package/docs/pwa/pwa.js +306 -0
  237. package/{docs-src → docs}/pwa/pwa.pug +166 -263
  238. package/docs/pwa/pwa.scss +26 -0
  239. package/docs/spec.scss +26 -0
  240. package/docs/themes/_component-themes.scss +26 -0
  241. package/docs/themes/theme-colored-fallbacks.scss +17 -0
  242. package/docs/themes/theme-colored.scss +17 -0
  243. package/docs/themes/theme-default-fallbacks.scss +17 -0
  244. package/docs/themes/theme-default.scss +17 -0
  245. package/jsconfig.json +4 -2
  246. package/package.json +40 -27
  247. package/scripts/deploy-docs.sh +9 -0
  248. package/templates/index.eta +2 -0
  249. package/utils/function.js +3 -0
  250. package/webpack.config.cjs +257 -0
  251. package/_spec.scss +0 -27
  252. package/_theme.scss +0 -27
  253. package/components/list/expander.js +0 -142
  254. package/components/list/itemgroup.js +0 -22
  255. package/core/theme/_builder.scss +0 -116
  256. package/core/theme/index.scss +0 -68
  257. package/docs/appbar.html +0 -1
  258. package/docs/appbar.min.js +0 -2
  259. package/docs/appbar.min.js.map +0 -1
  260. package/docs/bottomnav.html +0 -1
  261. package/docs/bottomnav.min.js +0 -2
  262. package/docs/bottomnav.min.js.map +0 -1
  263. package/docs/button.html +0 -1
  264. package/docs/button.min.js +0 -2
  265. package/docs/button.min.js.map +0 -1
  266. package/docs/card.html +0 -1
  267. package/docs/card.min.js +0 -2
  268. package/docs/card.min.js.map +0 -1
  269. package/docs/chip.html +0 -1
  270. package/docs/chip.min.js +0 -2
  271. package/docs/chip.min.js.map +0 -1
  272. package/docs/color.html +0 -1
  273. package/docs/color.min.js +0 -2
  274. package/docs/color.min.js.map +0 -1
  275. package/docs/datatable.html +0 -1
  276. package/docs/datatable.min.js +0 -2
  277. package/docs/datatable.min.js.map +0 -1
  278. package/docs/default.common.min.js +0 -2
  279. package/docs/default.common.min.js.map +0 -1
  280. package/docs/dialog.html +0 -1
  281. package/docs/dialog.min.js +0 -2
  282. package/docs/dialog.min.js.map +0 -1
  283. package/docs/docs.min.css +0 -1
  284. package/docs/docs.min.js +0 -2
  285. package/docs/docs.min.js.map +0 -1
  286. package/docs/elevation.html +0 -1
  287. package/docs/elevation.min.js +0 -2
  288. package/docs/elevation.min.js.map +0 -1
  289. package/docs/fab.html +0 -1
  290. package/docs/fab.min.js +0 -2
  291. package/docs/fab.min.js.map +0 -1
  292. package/docs/grid.html +0 -1
  293. package/docs/grid.min.js +0 -2
  294. package/docs/grid.min.js.map +0 -1
  295. package/docs/index.html +0 -1
  296. package/docs/index.min.js +0 -2
  297. package/docs/index.min.js.map +0 -1
  298. package/docs/ink.html +0 -1
  299. package/docs/ink.min.js +0 -2
  300. package/docs/ink.min.js.map +0 -1
  301. package/docs/layout.html +0 -1
  302. package/docs/layout.min.js +0 -2
  303. package/docs/layout.min.js.map +0 -1
  304. package/docs/list.html +0 -1
  305. package/docs/list.min.js +0 -2
  306. package/docs/list.min.js.map +0 -1
  307. package/docs/menu.html +0 -1
  308. package/docs/menu.min.js +0 -2
  309. package/docs/menu.min.js.map +0 -1
  310. package/docs/overlay.html +0 -1
  311. package/docs/overlay.min.js +0 -2
  312. package/docs/overlay.min.js.map +0 -1
  313. package/docs/prerender.common.min.js +0 -2
  314. package/docs/prerender.common.min.js.map +0 -1
  315. package/docs/prerender.min.js +0 -2
  316. package/docs/prerender.min.js.map +0 -1
  317. package/docs/progress.html +0 -1
  318. package/docs/progress.min.js +0 -2
  319. package/docs/progress.min.js.map +0 -1
  320. package/docs/pwa-prerender.min.js +0 -2
  321. package/docs/pwa-prerender.min.js.map +0 -1
  322. package/docs/pwa.html +0 -11
  323. package/docs/pwa.min.css +0 -1
  324. package/docs/pwa.min.js +0 -2
  325. package/docs/pwa.min.js.map +0 -1
  326. package/docs/ripple.html +0 -1
  327. package/docs/ripple.min.js +0 -2
  328. package/docs/ripple.min.js.map +0 -1
  329. package/docs/search.html +0 -1
  330. package/docs/search.min.js +0 -2
  331. package/docs/search.min.js.map +0 -1
  332. package/docs/selection.html +0 -1
  333. package/docs/selection.min.js +0 -2
  334. package/docs/selection.min.js.map +0 -1
  335. package/docs/slider.html +0 -1
  336. package/docs/slider.min.js +0 -2
  337. package/docs/slider.min.js.map +0 -1
  338. package/docs/snackbar.html +0 -1
  339. package/docs/snackbar.min.js +0 -2
  340. package/docs/snackbar.min.js.map +0 -1
  341. package/docs/spec.min.css +0 -1
  342. package/docs/spec.min.js +0 -2
  343. package/docs/spec.min.js.map +0 -1
  344. package/docs/surface.html +0 -1
  345. package/docs/surface.min.js +0 -2
  346. package/docs/surface.min.js.map +0 -1
  347. package/docs/tab.html +0 -1
  348. package/docs/tab.min.js +0 -2
  349. package/docs/tab.min.js.map +0 -1
  350. package/docs/textfield.html +0 -2
  351. package/docs/textfield.min.js +0 -2
  352. package/docs/textfield.min.js.map +0 -1
  353. package/docs/theme-colored-fallbacks.min.css +0 -1
  354. package/docs/theme-colored-fallbacks.min.js +0 -2
  355. package/docs/theme-colored-fallbacks.min.js.map +0 -1
  356. package/docs/theme-colored.min.css +0 -1
  357. package/docs/theme-colored.min.js +0 -2
  358. package/docs/theme-colored.min.js.map +0 -1
  359. package/docs/theme-default-fallbacks.min.css +0 -1
  360. package/docs/theme-default-fallbacks.min.js +0 -2
  361. package/docs/theme-default-fallbacks.min.js.map +0 -1
  362. package/docs/theme-default.min.css +0 -1
  363. package/docs/theme-default.min.js +0 -2
  364. package/docs/theme-default.min.js.map +0 -1
  365. package/docs/themes-fallbacks.min.css +0 -1
  366. package/docs/themes-fallbacks.min.js +0 -2
  367. package/docs/themes-fallbacks.min.js.map +0 -1
  368. package/docs/themes.min.css +0 -1
  369. package/docs/themes.min.js +0 -2
  370. package/docs/themes.min.js.map +0 -1
  371. package/docs/tooltip.html +0 -1
  372. package/docs/tooltip.min.js +0 -2
  373. package/docs/tooltip.min.js.map +0 -1
  374. package/docs/transition.html +0 -1
  375. package/docs/transition.min.js +0 -2
  376. package/docs/transition.min.js.map +0 -1
  377. package/docs/type.html +0 -1
  378. package/docs/type.min.js +0 -2
  379. package/docs/type.min.js.map +0 -1
  380. package/docs-src/components/datatable.pug +0 -327
  381. package/docs-src/components/selection.js +0 -9
  382. package/docs-src/components/selection.pug +0 -77
  383. package/docs-src/core/color.pug +0 -201
  384. package/docs-src/core/overlay.js +0 -4
  385. package/docs-src/core/ripple.js +0 -4
  386. package/docs-src/index.pug +0 -9
  387. package/docs-src/pwa/_dialogs.pug +0 -15
  388. package/docs-src/pwa/pwa-prerender.js +0 -3
  389. package/docs-src/pwa/pwa.js +0 -182
  390. package/docs-src/pwa/pwa.scss +0 -25
  391. package/docs-src/spec.scss +0 -1
  392. package/docs-src/themes/theme-colored-fallbacks.scss +0 -14
  393. package/docs-src/themes/theme-colored.scss +0 -14
  394. package/docs-src/themes/theme-default-fallbacks.scss +0 -14
  395. package/docs-src/themes/theme-default.scss +0 -14
  396. package/index.js +0 -51
  397. package/index.scss +0 -2
  398. package/webpack.config.js +0 -187
@@ -1,27 +1,31 @@
1
1
  // https://material.io/design/components/cards.html#specs
2
2
 
3
- @import '../../core/_breakpoint.scss';
4
- @import '../../core/_elevation.scss';
5
- @import '../../core/_motion.scss';
6
- @import '../../core/_platform.scss';
7
- @import '../../core/_type.scss';
3
+ @use "sass:math";
8
4
 
9
- $mdw-card__horizontal-padding: dp(16) !default;
5
+ @use '../../core/_breakpoint.scss' as breakpoint;
6
+ @use '../../core/_elevation.scss' as elevation;
7
+ @use '../../core/_length.scss' as *;
8
+ @use '../../core/_motion.scss' as motion;
9
+ @use '../../core/_platform.scss' as platform;
10
+ @use '../../core/_type.scss' as type;
11
+
12
+
13
+ $horizontalPadding: dp(16) !default;
10
14
 
11
15
  .mdw-card {
12
- @include type-rules('body-2');
16
+ @include type.addRules('body-2');
13
17
 
14
18
  display: block;
15
19
  position: relative;
16
20
 
17
21
  outline: none;
18
22
 
19
- transition-duration: $mdw-motion__shape-change-duration;
23
+ transition-duration: motion.$shapeChangeDuration;
20
24
  transition-property: box-shadow;
21
- transition-timing-function: $mdw-motion__standard-easing;
25
+ transition-timing-function: motion.$standardEasing;
22
26
 
23
27
  border-radius: dp(4);
24
- box-shadow: mdwElevation(0);
28
+ box-shadow: elevation.boxShadow(0);
25
29
 
26
30
  &::before {
27
31
  // Outline is behind content, not around it
@@ -41,9 +45,9 @@ $mdw-card__horizontal-padding: dp(16) !default;
41
45
  border-radius: inherit;
42
46
  }
43
47
 
44
- @include mdw-breakpoint__tablet-device__max() {
48
+ @include breakpoint.maxTabletDevice() {
45
49
  &:not([mdw-elevation]) {
46
- box-shadow: mdwElevation(1);
50
+ box-shadow: elevation.boxShadow(1);
47
51
 
48
52
  &::before {
49
53
  border-color: transparent;
@@ -52,14 +56,14 @@ $mdw-card__horizontal-padding: dp(16) !default;
52
56
  }
53
57
 
54
58
  &[mdw-elevation="1"] {
55
- box-shadow: mdwElevation(1);
59
+ box-shadow: elevation.boxShadow(1);
56
60
  }
57
61
 
58
62
  &[mdw-elevation="8"],
59
63
  &[mdw-raised~="hover"]:hover,
60
64
  &[mdw-raised~="focus"]:focus,
61
65
  &[mdw-raised~="focus-within"]:focus-within {
62
- box-shadow: mdwElevation(8);
66
+ box-shadow: elevation.boxShadow(8);
63
67
  }
64
68
 
65
69
  &[mdw-elevation="1"],
@@ -84,25 +88,25 @@ $mdw-card__horizontal-padding: dp(16) !default;
84
88
  .mdw-card__subheader,
85
89
  .mdw-card__supporting-text,
86
90
  .mdw-card__content {
87
- padding: 0 $mdw-card__horizontal-padding;
91
+ padding: 0 $horizontalPadding;
88
92
  }
89
93
 
90
94
  .mdw-card__supporting-text {
91
- @include texttop-to-top(14);
92
- @include baseline-bottom(16);
95
+ @include type.textTopToTop(14);
96
+ @include type.baselineToBottom(16);
93
97
  }
94
98
 
95
99
  .mdw-card > .mdw-divider {
96
- width: calc(100% - #{$mdw-card__horizontal-padding * 2});
97
- margin-right: $mdw-card__horizontal-padding;
98
- margin-left: $mdw-card__horizontal-padding;
100
+ width: calc(100% - #{$horizontalPadding * 2});
101
+ margin-right: $horizontalPadding;
102
+ margin-left: $horizontalPadding;
99
103
  }
100
104
 
101
105
  .mdw-card__thumbnail {
102
106
  margin-top: dp(16);
103
- margin-right: $mdw-card__horizontal-padding;
107
+ margin-right: $horizontalPadding;
104
108
  margin-bottom: 0;
105
- margin-left: $mdw-card__horizontal-padding;
109
+ margin-left: $horizontalPadding;
106
110
  }
107
111
 
108
112
  .mdw-card__start {
@@ -149,19 +153,19 @@ $mdw-card__horizontal-padding: dp(16) !default;
149
153
  }
150
154
 
151
155
  &[mdw-ratio="16:9"]::after {
152
- padding-bottom: calc(100% / 16 * 9);
156
+ padding-bottom: #{math.div(100%, 16) * 9};
153
157
  }
154
158
 
155
159
  &[mdw-ratio="3:2"]::after {
156
- padding-bottom: calc(100% / 3 * 2);
160
+ padding-bottom: #{math.div(100%, 3) * 2};
157
161
  }
158
162
 
159
163
  &[mdw-ratio="4:3"]::after {
160
- padding-bottom: calc(100% / 4 * 3);
164
+ padding-bottom: #{math.div(100%, 4) * 3};
161
165
  }
162
166
 
163
167
  &[mdw-ratio="1:1"]::after {
164
- padding-bottom: calc(100% / 1 * 1);
168
+ padding-bottom: #{math.div(100%, 1) * 1};
165
169
  }
166
170
  }
167
171
 
@@ -170,12 +174,12 @@ $mdw-card__horizontal-padding: dp(16) !default;
170
174
 
171
175
  min-height: dp(40);
172
176
  min-width: dp(40);
173
- margin-right: $mdw-card__horizontal-padding;
177
+ margin-right: $horizontalPadding;
174
178
  margin-left: 0;
175
179
 
176
180
  :root[dir="rtl"] & {
177
181
  margin-right: 0;
178
- margin-left: $mdw-card__horizontal-padding;
182
+ margin-left: $horizontalPadding;
179
183
  }
180
184
  }
181
185
 
@@ -184,24 +188,24 @@ $mdw-card__horizontal-padding: dp(16) !default;
184
188
  }
185
189
 
186
190
  h5.mdw-card__header {
187
- @include texttop-to-top(16);
188
- @include type-rules('h5');
189
- @include baseline-bottom(28);
191
+ @include type.textTopToTop(16);
192
+ @include type.addRules('h5');
193
+ @include type.baselineToBottom(28);
190
194
  margin-bottom: dp(-28);
191
195
  }
192
196
 
193
197
  h6.mdw-card__header {
194
- @include texttop-to-top(14);
195
- @include type-rules('h6');
198
+ @include type.textTopToTop(14);
199
+ @include type.addRules('h6');
196
200
  }
197
201
 
198
202
  .mdw-card__header[mdw-two-line] {
199
- @include baseline-bottom(22);
203
+ @include type.baselineToBottom(22);
200
204
  margin-bottom: dp(-22);
201
205
 
202
206
  & ~ .mdw-card__subheader {
203
- @include texttop-to-top(8);
204
- @include baseline-bottom(16);
207
+ @include type.textTopToTop(8);
208
+ @include type.baselineToBottom(16);
205
209
  }
206
210
  }
207
211
 
@@ -1,2 +1,2 @@
1
- @import './_spec.scss';
2
- @import './_theme.scss';
1
+ @forward './_spec.scss';
2
+ @forward './_theme.scss';
@@ -1,9 +1,8 @@
1
1
  // https://material.io/design/components/chips.html
2
2
 
3
- @import '../../core/_platform.scss';
4
- @import '../../core/_breakpoint.scss';
3
+ @use '../../core/_length.scss' as *;
5
4
 
6
- $mdw-chip__border-width: dp(1) !default;
5
+ $borderWidth: dp(1) !default;
7
6
 
8
7
  .mdw-chip {
9
8
  margin: 0 0 dp(-8) dp(-8);
@@ -62,7 +61,7 @@ $mdw-chip__border-width: dp(1) !default;
62
61
  width: 100%;
63
62
  margin: 0;
64
63
  border-style: solid;
65
- border-width: $mdw-chip__border-width;
64
+ border-width: $borderWidth;
66
65
 
67
66
  -moz-appearance: none;
68
67
  -webkit-appearance: none;
@@ -80,10 +79,10 @@ $mdw-chip__border-width: dp(1) !default;
80
79
  content: '';
81
80
 
82
81
  position: absolute;
83
- top: -$mdw-chip__border-width;
84
- right: -$mdw-chip__border-width;
85
- bottom: -$mdw-chip__border-width;
86
- left: -$mdw-chip__border-width;
82
+ top: -$borderWidth;
83
+ right: -$borderWidth;
84
+ bottom: -$borderWidth;
85
+ left: -$borderWidth;
87
86
 
88
87
  transition: inherit;
89
88
  transition-property: background-color, opacity;
@@ -2,9 +2,9 @@
2
2
  // https://material.io/design/components/chips.html
3
3
  // https://material.io/design/iconography/system-icons.html#color
4
4
 
5
- @import '../../core/theme/index.scss';
5
+ @use '../../core/theme/_mixins.scss' as theme;
6
6
 
7
- $mdw-chip__theme-values: (
7
+ $themeValues: (
8
8
  text-color: (('foreground-light', 0.87), ('foreground-dark', 1.00)),
9
9
  background-color: (('foreground-light', 0.12), ('foreground-dark', 0.24)),
10
10
 
@@ -53,24 +53,24 @@ $mdw-chip__theme-values: (
53
53
 
54
54
  ) !default;
55
55
 
56
- @function mdwChipThemeValue($key, $type) {
57
- @return mdwGetThemeValue('chip', $mdw-chip__theme-values, $key, $type);
56
+ @function getThemeValue($key, $type) {
57
+ @return theme.getThemeValue('chip', $themeValues, $key, $type);
58
58
  }
59
59
 
60
- @mixin mdw-chip__theme-rules($type: 'var') {
60
+ @mixin addThemeRules($type: 'var') {
61
61
  .mdw-chip__thumbnail,
62
62
  .mdw-chip__remove,
63
63
  .mdw-chip__text {
64
- color: mdwChipThemeValue("text-color", $type);
64
+ color: RGBA(getThemeValue("text-color", $type));
65
65
  }
66
66
 
67
67
  .mdw-chip__input {
68
68
  color: inherit;
69
69
 
70
70
  &::before {
71
- opacity: mdwChipThemeValue("default-opacity", $type);
71
+ opacity: getThemeValue("default-opacity", $type);
72
72
 
73
- background-color: mdwChipThemeValue("overlay-color", $type);
73
+ background-color: RGBA(getThemeValue("overlay-color", $type));
74
74
  }
75
75
 
76
76
  &:checked::before {
@@ -78,20 +78,20 @@ $mdw-chip__theme-values: (
78
78
  }
79
79
 
80
80
  &:hover::before {
81
- opacity: mdwChipThemeValue("hover-opacity", $type);
81
+ opacity: getThemeValue("hover-opacity", $type);
82
82
  }
83
83
 
84
84
  &:focus::before {
85
- opacity: mdwChipThemeValue("focus-opacity", $type);
85
+ opacity: getThemeValue("focus-opacity", $type);
86
86
  }
87
87
 
88
88
  &:hover:focus::before {
89
- opacity: mdwChipThemeValue("hover-focus-opacity", $type);
89
+ opacity: getThemeValue("hover-focus-opacity", $type);
90
90
  }
91
91
 
92
92
  &:checked {
93
93
  & ~ .mdw-chip__text {
94
- color: mdwChipThemeValue("activated-text-color", $type);
94
+ color: RGBA(getThemeValue("activated-text-color", $type));
95
95
  }
96
96
 
97
97
  &[type="radio"] {
@@ -102,61 +102,61 @@ $mdw-chip__theme-values: (
102
102
 
103
103
  &[type="checkbox"] {
104
104
  &::before {
105
- opacity: mdwChipThemeValue("selected-opacity", $type);
105
+ opacity: getThemeValue("selected-opacity", $type);
106
106
  }
107
107
 
108
108
  &:hover::before {
109
- opacity: mdwChipThemeValue("selected-hover-opacity", $type);
109
+ opacity: getThemeValue("selected-hover-opacity", $type);
110
110
  }
111
111
 
112
112
  &:focus::before {
113
- opacity: mdwChipThemeValue("selected-focus-opacity", $type);
113
+ opacity: getThemeValue("selected-focus-opacity", $type);
114
114
  }
115
115
 
116
116
  &:hover:focus::before {
117
- opacity: mdwChipThemeValue("selected-hover-focus-opacity", $type);
117
+ opacity: getThemeValue("selected-hover-focus-opacity", $type);
118
118
  }
119
119
  }
120
120
  }
121
121
  }
122
122
 
123
123
  .mdw-chip[mdw-outlined] .mdw-chip__input {
124
- border-color: mdwChipThemeValue('outline-color', $type);
124
+ border-color: RGBA(getThemeValue('outline-color', $type));
125
125
 
126
126
  &:not(:checked) {
127
127
  &::before {
128
- opacity: mdwChipThemeValue("outlined-opacity", $type);
128
+ opacity: getThemeValue("outlined-opacity", $type);
129
129
  }
130
130
 
131
131
  &:hover::before {
132
- opacity: mdwChipThemeValue("outlined-hover-opacity", $type);
132
+ opacity: getThemeValue("outlined-hover-opacity", $type);
133
133
  }
134
134
 
135
135
  &:focus::before {
136
- opacity: mdwChipThemeValue("outlined-focus-opacity", $type);
136
+ opacity: getThemeValue("outlined-focus-opacity", $type);
137
137
  }
138
138
 
139
139
  &:hover:focus::before {
140
- opacity: mdwChipThemeValue("outlined-hover-focus-opacity", $type);
140
+ opacity: getThemeValue("outlined-hover-focus-opacity", $type);
141
141
  }
142
142
  }
143
143
 
144
144
  &:checked {
145
145
  &[type="checkbox"] {
146
146
  &::before {
147
- opacity: mdwChipThemeValue("outlined-selected-opacity", $type);
147
+ opacity: getThemeValue("outlined-selected-opacity", $type);
148
148
  }
149
149
 
150
150
  &:hover::before {
151
- opacity: mdwChipThemeValue("outlined-selected-hover-opacity", $type);
151
+ opacity: getThemeValue("outlined-selected-hover-opacity", $type);
152
152
  }
153
153
 
154
154
  &:focus::before {
155
- opacity: mdwChipThemeValue("outlined-selected-focus-opacity", $type);
155
+ opacity: getThemeValue("outlined-selected-focus-opacity", $type);
156
156
  }
157
157
 
158
158
  &:hover:focus::before {
159
- opacity: mdwChipThemeValue("outlined-selected-hover-focus-opacity", $type);
159
+ opacity: getThemeValue("outlined-selected-hover-focus-opacity", $type);
160
160
  }
161
161
  }
162
162
  }
@@ -164,14 +164,14 @@ $mdw-chip__theme-values: (
164
164
  }
165
165
 
166
166
 
167
- @include mdw-theme__add-component-fallback-rules('light') {
168
- @include mdw-chip__theme-rules('light');
167
+ @include theme.addComponentFallbackRules('light') {
168
+ @include addThemeRules('light');
169
169
  }
170
170
 
171
- @include mdw-theme__add-component-fallback-rules('dark') {
172
- @include mdw-chip__theme-rules('dark');
171
+ @include theme.addComponentFallbackRules('dark') {
172
+ @include addThemeRules('dark');
173
173
  }
174
174
 
175
- @include mdw-theme__add-component-variable-rules('chip', $mdw-chip__theme-values) {
176
- @include mdw-chip__theme-rules();
175
+ @include theme.addComponentCSSVariableRules('chip', $themeValues) {
176
+ @include addThemeRules();
177
177
  }
@@ -1,7 +1,8 @@
1
1
  // https://www.w3.org/TR/wai-aria-practices/#Listbox
2
2
 
3
- import { iterateArrayLike } from '../../core/dom';
4
- import * as ChipItem from './item';
3
+ import { iterateArrayLike } from '../../core/dom.js';
4
+
5
+ import * as ChipItem from './item.js';
5
6
 
6
7
  /**
7
8
  * @param {Element} element
@@ -1,2 +1,2 @@
1
- @import './_spec.scss';
2
- @import './_theme.scss';
1
+ @forward './_spec.scss';
2
+ @forward './_theme.scss';
@@ -1,6 +1,6 @@
1
1
  // https://www.w3.org/TR/wai-aria-practices/#Listbox
2
2
 
3
- import * as Ripple from '../../core/ripple/index';
3
+ import * as Ripple from '../../core/ripple/index.js';
4
4
 
5
5
  /**
6
6
  * @param {Element} element
@@ -9,27 +9,12 @@ import * as Ripple from '../../core/ripple/index';
9
9
  export function attach(element) {
10
10
  element.classList.add('mdw-ripple');
11
11
  Ripple.attach(element);
12
-
13
- attachCore(element);
14
12
  }
15
13
 
16
- /**
17
- * @param {Element} element
18
- * @return {void}
19
- */
20
- export function attachCore(element) {}
21
-
22
- /**
23
- * @param {Element} element
24
- * @return {void}
25
- */
26
- export function detachCore(element) {}
27
-
28
14
  /**
29
15
  * @param {Element} element
30
16
  * @return {void}
31
17
  */
32
18
  export function detach(element) {
33
- detachCore(element);
34
19
  Ripple.detach(element);
35
20
  }
@@ -1,12 +1,12 @@
1
1
  // https://material.io/guidelines/components/data-tables.html
2
2
  // https://material.io/guidelines/patterns/selection.html#selection-item-selection
3
3
 
4
- @import '../../core/_platform.scss';
5
- @import '../../core/_motion.scss';
6
- @import '../../core/_breakpoint.scss';
7
- @import '../../core/_type.scss';
4
+ @use '../../core/_length.scss' as *;
5
+ @use '../../core/_motion.scss' as motion;
6
+ @use '../../core/_platform.scss' as platform;
7
+ @use '../../core/_type.scss' as type;
8
8
 
9
- $mdw-datatable__icon-size: dp(16) !default;
9
+ $iconSize: dp(16) !default;
10
10
 
11
11
  .mdw-datatable {
12
12
  display: flex;
@@ -23,7 +23,7 @@ $mdw-datatable__icon-size: dp(16) !default;
23
23
 
24
24
  .mdw-datatable caption,
25
25
  .mdw-datatable__header {
26
- @include type-rules('h6');
26
+ @include type.addRules('h6');
27
27
  min-height: dp(64);
28
28
  }
29
29
 
@@ -85,28 +85,65 @@ $mdw-datatable__icon-size: dp(16) !default;
85
85
 
86
86
 
87
87
  .mdw-datatable td {
88
- @include type-rules('body-2');
89
- //text-align: left;
88
+ @include type.addRules('body-2');
89
+ // text-align: left;
90
90
  // Expected line-height is 20dp. Support two lines within 48dp
91
91
  padding-top: dp(4);
92
92
  padding-bottom: dp(4 - 1); // Remove bottom border width
93
93
 
94
94
  outline: none;
95
95
 
96
- &[mdw-selector] + td {
97
- padding-right: dp(16);
98
- padding-left: dp(12);
96
+ }
97
+
98
+ .mdw-datatable th {
99
+ @include type.addRules('caption');
100
+ white-space: nowrap;
101
+ }
102
+
103
+ .mdw-datatable th,
104
+ .mdw-datatable td {
105
+ padding-right: dp(16);
106
+ padding-left: dp(16);
107
+
108
+ text-align: center;
109
+
110
+ &[mdw-checkbox] {
111
+ line-height: 0;
112
+ }
113
+
114
+ &[mdw-text] {
115
+ text-align: left;
116
+ text-align: start;
117
+
118
+ :root[dir="rtl"] & {
119
+ text-align: right;
120
+ text-align: start;
121
+ }
122
+ }
123
+
124
+ &[mdw-number] {
125
+ text-align: right;
126
+ text-align: end;
99
127
 
100
128
  :root[dir="rtl"] & {
101
- padding-right: dp(12);
102
- padding-left: dp(16);
129
+ text-align: left;
130
+ text-align: end;
131
+ }
132
+ }
133
+
134
+ &[mdw-primary-column] {
135
+ width: 100%;
136
+ border-right-style: solid;
137
+ border-width: dp(1);
138
+
139
+ :root[dir="rtl"] & {
140
+ border-right-style: none;
141
+ border-left-style: solid;
103
142
  }
104
143
  }
105
-
106
144
  }
107
145
 
108
- .mdw-datatable th[mdw-selector],
109
- .mdw-datatable td[mdw-selector] {
146
+ .mdw-datatable th[mdw-selector] {
110
147
  width: dp(24);
111
148
  padding-right: 0;
112
149
  padding-left: dp(16);
@@ -115,13 +152,9 @@ $mdw-datatable__icon-size: dp(16) !default;
115
152
  padding-right: dp(16);
116
153
  padding-left: 0;
117
154
  }
118
- }
119
-
120
- .mdw-datatable th {
121
- @include type-rules('caption');
122
- white-space: nowrap;
123
155
 
124
- &[mdw-selector] + th {
156
+ & + td,
157
+ & + th {
125
158
  padding-right: dp(16);
126
159
  padding-left: dp(12);
127
160
 
@@ -132,53 +165,28 @@ $mdw-datatable__icon-size: dp(16) !default;
132
165
  }
133
166
  }
134
167
 
135
-
136
- .mdw-datatable th,
137
- .mdw-datatable td {
138
- padding-right: dp(16);
139
- padding-left: dp(16);
140
-
141
- text-align: center;
142
-
143
- .mdw-selection__input {
144
- // Remove ripple
145
- visibility: hidden;
146
- }
147
- }
148
-
149
- .mdw-datatable th[mdw-primary-column],
150
- .mdw-datatable td[mdw-primary-column] {
151
- width: 100%;
152
- border-right-style: solid;
153
- border-width: dp(1);
154
-
155
- :root[dir="rtl"] & {
156
- border-right-style: none;
157
- border-left-style: solid;
158
- }
159
- }
160
-
161
168
  .mdw-datatable__sort-icon {
162
169
  display: inline-block;
163
- vertical-align: bottom;
170
+ vertical-align: text-bottom;
164
171
 
165
172
  max-width: 0;
166
173
 
167
- transition-duration: $mdw-motion__shape-change-duration;
174
+ transition-duration: motion.$shapeChangeDuration;
168
175
  transition-property: transform;
169
- transition-timing-function: $mdw-motion__standard-easing;
176
+ transition-timing-function: motion.$standardEasing;
170
177
 
171
- transform: translateX(-$mdw-datatable__icon-size) rotate(180deg);
172
- transform-origin: ($mdw-datatable__icon-size / 2) ($mdw-datatable__icon-size / 2);
178
+ transform: translateX(-$iconSize) rotate(180deg);
179
+ transform-origin: ($iconSize * 0.5) ($iconSize * 0.5);
173
180
 
174
181
  color: transparent;
175
182
 
183
+ /* stylelint-disable-next-line selector-class-pattern */
176
184
  &.material-icons {
177
- font-size: $mdw-datatable__icon-size;
185
+ font-size: $iconSize;
178
186
  }
179
187
  }
180
188
 
181
- .mdw-datatable th[mdw-sortable] {
189
+ .mdw-datatable th[aria-sort] {
182
190
  cursor: pointer;
183
191
  -webkit-tap-highlight-color: transparent;
184
192
  -moz-user-select: none;
@@ -187,42 +195,20 @@ $mdw-datatable__icon-size: dp(16) !default;
187
195
  user-select: none;
188
196
 
189
197
  &:hover,
190
- &[mdw-sorted] {
198
+ &[aria-sort="ascending"] {
191
199
  .mdw-datatable__sort-icon {
192
- transform: translateX(-$mdw-datatable__icon-size) rotate(180deg);
200
+ transform: translateX(-$iconSize) rotate(180deg);
193
201
 
194
202
  color: inherit;
195
203
  }
196
204
  }
197
205
 
198
- &[mdw-sorted="desc"] {
206
+ &[aria-sort="descending"] {
199
207
  .mdw-datatable__sort-icon {
200
- transform: translateX(-$mdw-datatable__icon-size) rotate(0deg);
201
- }
202
- }
203
- }
204
-
205
-
206
-
207
- .mdw-datatable th[data-type="text"],
208
- .mdw-datatable td[data-type="text"] {
209
- text-align: left;
210
- text-align: start;
211
-
212
- :root[dir="rtl"] & {
213
- text-align: right;
214
- text-align: start;
215
- }
216
- }
208
+ transform: translateX(-$iconSize) rotate(0deg);
217
209
 
218
- .mdw-datatable th[data-type="number"],
219
- .mdw-datatable td[data-type="number"] {
220
- text-align: right;
221
- text-align: end;
222
-
223
- :root[dir="rtl"] & {
224
- text-align: left;
225
- text-align: end;
210
+ color: inherit;
211
+ }
226
212
  }
227
213
  }
228
214
 
@@ -231,7 +217,7 @@ $mdw-datatable__icon-size: dp(16) !default;
231
217
  }
232
218
 
233
219
  .mdw-datatable__footer {
234
- @include type-rules('caption');
220
+ @include type.addRules('caption');
235
221
  display: flex;
236
222
  align-items: center;
237
223
  flex-direction: row;
@@ -243,7 +229,7 @@ $mdw-datatable__icon-size: dp(16) !default;
243
229
 
244
230
  .mdw-datatable__header,
245
231
  .mdw-datatable__footer {
246
- @include mdw-platform__ie() {
232
+ @include platform.ifIE() {
247
233
  // Fix IE min-height flexbug
248
234
  &::after {
249
235
  content: '';