@depup/angular__material 21.2.2-depup.19

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 (578) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -0
  3. package/_index.scss +145 -0
  4. package/autocomplete/_autocomplete-theme.scss +76 -0
  5. package/autocomplete/_m2-autocomplete.scss +19 -0
  6. package/autocomplete/_m3-autocomplete.scss +26 -0
  7. package/badge/_badge-theme.scss +106 -0
  8. package/badge/_m2-badge.scss +73 -0
  9. package/badge/_m3-badge.scss +52 -0
  10. package/bottom-sheet/_bottom-sheet-theme.scss +76 -0
  11. package/bottom-sheet/_m2-bottom-sheet.scss +24 -0
  12. package/bottom-sheet/_m3-bottom-sheet.scss +25 -0
  13. package/button/_button-theme.scss +113 -0
  14. package/button/_fab-theme.scss +111 -0
  15. package/button/_icon-button-theme.scss +136 -0
  16. package/button/_m2-button.scss +194 -0
  17. package/button/_m2-fab.scss +101 -0
  18. package/button/_m2-icon-button.scss +59 -0
  19. package/button/_m3-button.scss +170 -0
  20. package/button/_m3-fab.scss +92 -0
  21. package/button/_m3-icon-button.scss +54 -0
  22. package/button-toggle/_button-toggle-theme.scss +93 -0
  23. package/button-toggle/_m2-button-toggle.scss +68 -0
  24. package/button-toggle/_m3-button-toggle.scss +72 -0
  25. package/card/_card-theme.scss +76 -0
  26. package/card/_m2-card.scss +39 -0
  27. package/card/_m3-card.scss +44 -0
  28. package/changes.json +10 -0
  29. package/checkbox/_checkbox-theme.scss +105 -0
  30. package/checkbox/_m2-checkbox.scss +78 -0
  31. package/checkbox/_m3-checkbox.scss +68 -0
  32. package/chips/_chips-theme.scss +115 -0
  33. package/chips/_m2-chip.scss +85 -0
  34. package/chips/_m3-chip.scss +81 -0
  35. package/core/_core-theme.scss +125 -0
  36. package/core/_core.scss +50 -0
  37. package/core/_m2-app.scss +24 -0
  38. package/core/_m3-app.scss +44 -0
  39. package/core/color/_all-color.scss +17 -0
  40. package/core/density/private/_all-density.scss +78 -0
  41. package/core/focus-indicators/_private.scss +126 -0
  42. package/core/m2/_index.scss +52 -0
  43. package/core/m2/_palette.scss +748 -0
  44. package/core/m2/_theming.scss +340 -0
  45. package/core/m2/_typography-utils.scss +81 -0
  46. package/core/m2/_typography.scss +388 -0
  47. package/core/option/_m2-optgroup.scss +21 -0
  48. package/core/option/_m2-option.scss +38 -0
  49. package/core/option/_m3-optgroup.scss +25 -0
  50. package/core/option/_m3-option.scss +37 -0
  51. package/core/option/_optgroup-theme.scss +76 -0
  52. package/core/option/_option-theme.scss +103 -0
  53. package/core/ripple/_m2-ripple.scss +17 -0
  54. package/core/ripple/_m3-ripple.scss +17 -0
  55. package/core/ripple/_ripple-theme.scss +75 -0
  56. package/core/ripple/_ripple.scss +56 -0
  57. package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +32 -0
  58. package/core/selection/pseudo-checkbox/_m3-pseudo-checkbox.scss +34 -0
  59. package/core/selection/pseudo-checkbox/_pseudo-checkbox-common.scss +86 -0
  60. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +110 -0
  61. package/core/style/_checkbox-common.scss +11 -0
  62. package/core/style/_elevation.scss +208 -0
  63. package/core/style/_layout-common.scss +8 -0
  64. package/core/style/_private.scss +27 -0
  65. package/core/style/_sass-utils.scss +57 -0
  66. package/core/style/_validation.scss +52 -0
  67. package/core/style/_variables.scss +44 -0
  68. package/core/style/_vendor-prefixes.scss +56 -0
  69. package/core/theming/_all-theme.scss +168 -0
  70. package/core/theming/_color-api-backwards-compatibility.scss +159 -0
  71. package/core/theming/_config-validation.scss +174 -0
  72. package/core/theming/_definition.scss +141 -0
  73. package/core/theming/_inspection.scss +289 -0
  74. package/core/theming/_m2-inspection.scss +243 -0
  75. package/core/theming/_palettes.scss +1036 -0
  76. package/core/theming/_theming.scss +193 -0
  77. package/core/theming/_validation.scss +5 -0
  78. package/core/tokens/_classes.scss +398 -0
  79. package/core/tokens/_m2-utils.scss +25 -0
  80. package/core/tokens/_m3-tokens.scss +126 -0
  81. package/core/tokens/_m3-utils.scss +36 -0
  82. package/core/tokens/_system.scss +398 -0
  83. package/core/tokens/_token-utils.scss +119 -0
  84. package/core/tokens/m2/_index.scss +6 -0
  85. package/core/tokens/m2/_md-sys-color-internal.scss +11 -0
  86. package/core/tokens/m2/_md-sys-color.scss +123 -0
  87. package/core/tokens/m2/_md-sys-elevation.scss +10 -0
  88. package/core/tokens/m2/_md-sys-motion.scss +30 -0
  89. package/core/tokens/m2/_md-sys-shape.scss +16 -0
  90. package/core/tokens/m2/_md-sys-state.scss +8 -0
  91. package/core/tokens/m2/_md-sys-typescale.scss +68 -0
  92. package/core/tokens/m3/_index.scss +7 -0
  93. package/core/tokens/m3/_md-sys-color-internal.scss +11 -0
  94. package/core/tokens/m3/_md-sys-color.scss +118 -0
  95. package/core/tokens/m3/_md-sys-elevation.scss +15 -0
  96. package/core/tokens/m3/_md-sys-motion.scss +35 -0
  97. package/core/tokens/m3/_md-sys-shape.scss +21 -0
  98. package/core/tokens/m3/_md-sys-state.scss +13 -0
  99. package/core/tokens/m3/_md-sys-typescale-internal.scss +5 -0
  100. package/core/tokens/m3/_md-sys-typescale.scss +114 -0
  101. package/core/tokens/m3/_theme.scss +35 -0
  102. package/core/typography/_all-typography.scss +104 -0
  103. package/core/typography/_typography-utils.scss +31 -0
  104. package/core/typography/_typography.scss +269 -0
  105. package/core/typography/_versioning.scss +90 -0
  106. package/datepicker/_datepicker-theme.scss +132 -0
  107. package/datepicker/_m2-datepicker.scss +81 -0
  108. package/datepicker/_m3-datepicker.scss +74 -0
  109. package/dialog/_dialog-legacy-padding.scss +31 -0
  110. package/dialog/_dialog-theme.scss +76 -0
  111. package/dialog/_m2-dialog.scss +43 -0
  112. package/dialog/_m3-dialog.scss +47 -0
  113. package/divider/_divider-theme.scss +75 -0
  114. package/divider/_m2-divider.scss +17 -0
  115. package/divider/_m3-divider.scss +19 -0
  116. package/expansion/_expansion-theme.scss +76 -0
  117. package/expansion/_m2-expansion.scss +64 -0
  118. package/expansion/_m3-expansion.scss +61 -0
  119. package/fesm2022/_animation-chunk.mjs +22 -0
  120. package/fesm2022/_animation-chunk.mjs.map +1 -0
  121. package/fesm2022/_date-formats-chunk.mjs +86 -0
  122. package/fesm2022/_date-formats-chunk.mjs.map +1 -0
  123. package/fesm2022/_date-range-input-harness-chunk.mjs +322 -0
  124. package/fesm2022/_date-range-input-harness-chunk.mjs.map +1 -0
  125. package/fesm2022/_error-options-chunk.mjs +66 -0
  126. package/fesm2022/_error-options-chunk.mjs.map +1 -0
  127. package/fesm2022/_error-state-chunk.mjs +30 -0
  128. package/fesm2022/_error-state-chunk.mjs.map +1 -0
  129. package/fesm2022/_form-field-chunk.mjs +1351 -0
  130. package/fesm2022/_form-field-chunk.mjs.map +1 -0
  131. package/fesm2022/_icon-button-chunk.mjs +268 -0
  132. package/fesm2022/_icon-button-chunk.mjs.map +1 -0
  133. package/fesm2022/_icon-registry-chunk.mjs +368 -0
  134. package/fesm2022/_icon-registry-chunk.mjs.map +1 -0
  135. package/fesm2022/_input-harness-chunk.mjs +67 -0
  136. package/fesm2022/_input-harness-chunk.mjs.map +1 -0
  137. package/fesm2022/_input-value-accessor-chunk.mjs +6 -0
  138. package/fesm2022/_input-value-accessor-chunk.mjs.map +1 -0
  139. package/fesm2022/_internal-form-field-chunk.mjs +67 -0
  140. package/fesm2022/_internal-form-field-chunk.mjs.map +1 -0
  141. package/fesm2022/_line-chunk.mjs +99 -0
  142. package/fesm2022/_line-chunk.mjs.map +1 -0
  143. package/fesm2022/_option-chunk.mjs +385 -0
  144. package/fesm2022/_option-chunk.mjs.map +1 -0
  145. package/fesm2022/_option-harness-chunk.mjs +30 -0
  146. package/fesm2022/_option-harness-chunk.mjs.map +1 -0
  147. package/fesm2022/_option-module-chunk.mjs +48 -0
  148. package/fesm2022/_option-module-chunk.mjs.map +1 -0
  149. package/fesm2022/_pseudo-checkbox-chunk.mjs +88 -0
  150. package/fesm2022/_pseudo-checkbox-chunk.mjs.map +1 -0
  151. package/fesm2022/_pseudo-checkbox-module-chunk.mjs +46 -0
  152. package/fesm2022/_pseudo-checkbox-module-chunk.mjs.map +1 -0
  153. package/fesm2022/_public-api-chunk.mjs +84 -0
  154. package/fesm2022/_public-api-chunk.mjs.map +1 -0
  155. package/fesm2022/_ripple-chunk.mjs +544 -0
  156. package/fesm2022/_ripple-chunk.mjs.map +1 -0
  157. package/fesm2022/_ripple-loader-chunk.mjs +144 -0
  158. package/fesm2022/_ripple-loader-chunk.mjs.map +1 -0
  159. package/fesm2022/_ripple-module-chunk.mjs +46 -0
  160. package/fesm2022/_ripple-module-chunk.mjs.map +1 -0
  161. package/fesm2022/_structural-styles-chunk.mjs +45 -0
  162. package/fesm2022/_structural-styles-chunk.mjs.map +1 -0
  163. package/fesm2022/_tooltip-chunk.mjs +848 -0
  164. package/fesm2022/_tooltip-chunk.mjs.map +1 -0
  165. package/fesm2022/autocomplete-testing.mjs +75 -0
  166. package/fesm2022/autocomplete-testing.mjs.map +1 -0
  167. package/fesm2022/autocomplete.mjs +1068 -0
  168. package/fesm2022/autocomplete.mjs.map +1 -0
  169. package/fesm2022/badge-testing.mjs +48 -0
  170. package/fesm2022/badge-testing.mjs.map +1 -0
  171. package/fesm2022/badge.mjs +357 -0
  172. package/fesm2022/badge.mjs.map +1 -0
  173. package/fesm2022/bottom-sheet-testing.mjs +17 -0
  174. package/fesm2022/bottom-sheet-testing.mjs.map +1 -0
  175. package/fesm2022/bottom-sheet.mjs +390 -0
  176. package/fesm2022/bottom-sheet.mjs.map +1 -0
  177. package/fesm2022/button-testing.mjs +81 -0
  178. package/fesm2022/button-testing.mjs.map +1 -0
  179. package/fesm2022/button-toggle-testing.mjs +87 -0
  180. package/fesm2022/button-toggle-testing.mjs.map +1 -0
  181. package/fesm2022/button-toggle.mjs +789 -0
  182. package/fesm2022/button-toggle.mjs.map +1 -0
  183. package/fesm2022/button.mjs +308 -0
  184. package/fesm2022/button.mjs.map +1 -0
  185. package/fesm2022/card-testing.mjs +29 -0
  186. package/fesm2022/card-testing.mjs.map +1 -0
  187. package/fesm2022/card.mjs +615 -0
  188. package/fesm2022/card.mjs.map +1 -0
  189. package/fesm2022/checkbox-testing.mjs +79 -0
  190. package/fesm2022/checkbox-testing.mjs.map +1 -0
  191. package/fesm2022/checkbox.mjs +551 -0
  192. package/fesm2022/checkbox.mjs.map +1 -0
  193. package/fesm2022/chips-testing.mjs +239 -0
  194. package/fesm2022/chips-testing.mjs.map +1 -0
  195. package/fesm2022/chips.mjs +2663 -0
  196. package/fesm2022/chips.mjs.map +1 -0
  197. package/fesm2022/core-testing.mjs +22 -0
  198. package/fesm2022/core-testing.mjs.map +1 -0
  199. package/fesm2022/core.mjs +408 -0
  200. package/fesm2022/core.mjs.map +1 -0
  201. package/fesm2022/datepicker-testing.mjs +26 -0
  202. package/fesm2022/datepicker-testing.mjs.map +1 -0
  203. package/fesm2022/datepicker.mjs +5015 -0
  204. package/fesm2022/datepicker.mjs.map +1 -0
  205. package/fesm2022/dialog-testing.mjs +123 -0
  206. package/fesm2022/dialog-testing.mjs.map +1 -0
  207. package/fesm2022/dialog.mjs +873 -0
  208. package/fesm2022/dialog.mjs.map +1 -0
  209. package/fesm2022/divider-testing.mjs +17 -0
  210. package/fesm2022/divider-testing.mjs.map +1 -0
  211. package/fesm2022/divider.mjs +132 -0
  212. package/fesm2022/divider.mjs.map +1 -0
  213. package/fesm2022/expansion-testing.mjs +87 -0
  214. package/fesm2022/expansion-testing.mjs.map +1 -0
  215. package/fesm2022/expansion.mjs +749 -0
  216. package/fesm2022/expansion.mjs.map +1 -0
  217. package/fesm2022/form-field-testing-control.mjs +24 -0
  218. package/fesm2022/form-field-testing-control.mjs.map +1 -0
  219. package/fesm2022/form-field-testing.mjs +135 -0
  220. package/fesm2022/form-field-testing.mjs.map +1 -0
  221. package/fesm2022/form-field.mjs +57 -0
  222. package/fesm2022/form-field.mjs.map +1 -0
  223. package/fesm2022/grid-list-testing.mjs +80 -0
  224. package/fesm2022/grid-list-testing.mjs.map +1 -0
  225. package/fesm2022/grid-list.mjs +604 -0
  226. package/fesm2022/grid-list.mjs.map +1 -0
  227. package/fesm2022/icon-testing.mjs +172 -0
  228. package/fesm2022/icon-testing.mjs.map +1 -0
  229. package/fesm2022/icon.mjs +366 -0
  230. package/fesm2022/icon.mjs.map +1 -0
  231. package/fesm2022/input-testing.mjs +73 -0
  232. package/fesm2022/input-testing.mjs.map +1 -0
  233. package/fesm2022/input.mjs +495 -0
  234. package/fesm2022/input.mjs.map +1 -0
  235. package/fesm2022/list-testing.mjs +295 -0
  236. package/fesm2022/list-testing.mjs.map +1 -0
  237. package/fesm2022/list.mjs +1604 -0
  238. package/fesm2022/list.mjs.map +1 -0
  239. package/fesm2022/material.mjs +4 -0
  240. package/fesm2022/material.mjs.map +1 -0
  241. package/fesm2022/menu-testing.mjs +174 -0
  242. package/fesm2022/menu-testing.mjs.map +1 -0
  243. package/fesm2022/menu.mjs +1421 -0
  244. package/fesm2022/menu.mjs.map +1 -0
  245. package/fesm2022/paginator-testing.mjs +69 -0
  246. package/fesm2022/paginator-testing.mjs.map +1 -0
  247. package/fesm2022/paginator.mjs +445 -0
  248. package/fesm2022/paginator.mjs.map +1 -0
  249. package/fesm2022/progress-bar-testing.mjs +20 -0
  250. package/fesm2022/progress-bar-testing.mjs.map +1 -0
  251. package/fesm2022/progress-bar.mjs +247 -0
  252. package/fesm2022/progress-bar.mjs.map +1 -0
  253. package/fesm2022/progress-spinner-testing.mjs +21 -0
  254. package/fesm2022/progress-spinner-testing.mjs.map +1 -0
  255. package/fesm2022/progress-spinner.mjs +258 -0
  256. package/fesm2022/progress-spinner.mjs.map +1 -0
  257. package/fesm2022/radio-testing.mjs +143 -0
  258. package/fesm2022/radio-testing.mjs.map +1 -0
  259. package/fesm2022/radio.mjs +751 -0
  260. package/fesm2022/radio.mjs.map +1 -0
  261. package/fesm2022/select-testing.mjs +92 -0
  262. package/fesm2022/select-testing.mjs.map +1 -0
  263. package/fesm2022/select.mjs +1181 -0
  264. package/fesm2022/select.mjs.map +1 -0
  265. package/fesm2022/sidenav-testing.mjs +80 -0
  266. package/fesm2022/sidenav-testing.mjs.map +1 -0
  267. package/fesm2022/sidenav.mjs +1151 -0
  268. package/fesm2022/sidenav.mjs.map +1 -0
  269. package/fesm2022/slide-toggle-testing.mjs +68 -0
  270. package/fesm2022/slide-toggle-testing.mjs.map +1 -0
  271. package/fesm2022/slide-toggle.mjs +403 -0
  272. package/fesm2022/slide-toggle.mjs.map +1 -0
  273. package/fesm2022/slider-testing.mjs +105 -0
  274. package/fesm2022/slider-testing.mjs.map +1 -0
  275. package/fesm2022/slider.mjs +1720 -0
  276. package/fesm2022/slider.mjs.map +1 -0
  277. package/fesm2022/snack-bar-testing.mjs +47 -0
  278. package/fesm2022/snack-bar-testing.mjs.map +1 -0
  279. package/fesm2022/snack-bar.mjs +820 -0
  280. package/fesm2022/snack-bar.mjs.map +1 -0
  281. package/fesm2022/sort-testing.mjs +55 -0
  282. package/fesm2022/sort-testing.mjs.map +1 -0
  283. package/fesm2022/sort.mjs +470 -0
  284. package/fesm2022/sort.mjs.map +1 -0
  285. package/fesm2022/stepper-testing.mjs +99 -0
  286. package/fesm2022/stepper-testing.mjs.map +1 -0
  287. package/fesm2022/stepper.mjs +900 -0
  288. package/fesm2022/stepper.mjs.map +1 -0
  289. package/fesm2022/table-testing.mjs +152 -0
  290. package/fesm2022/table-testing.mjs.map +1 -0
  291. package/fesm2022/table.mjs +1151 -0
  292. package/fesm2022/table.mjs.map +1 -0
  293. package/fesm2022/tabs-testing.mjs +144 -0
  294. package/fesm2022/tabs-testing.mjs.map +1 -0
  295. package/fesm2022/tabs.mjs +2435 -0
  296. package/fesm2022/tabs.mjs.map +1 -0
  297. package/fesm2022/timepicker-testing.mjs +128 -0
  298. package/fesm2022/timepicker-testing.mjs.map +1 -0
  299. package/fesm2022/timepicker.mjs +1284 -0
  300. package/fesm2022/timepicker.mjs.map +1 -0
  301. package/fesm2022/toolbar-testing.mjs +26 -0
  302. package/fesm2022/toolbar-testing.mjs.map +1 -0
  303. package/fesm2022/toolbar.mjs +182 -0
  304. package/fesm2022/toolbar.mjs.map +1 -0
  305. package/fesm2022/tooltip-testing.mjs +48 -0
  306. package/fesm2022/tooltip-testing.mjs.map +1 -0
  307. package/fesm2022/tooltip.mjs +58 -0
  308. package/fesm2022/tooltip.mjs.map +1 -0
  309. package/fesm2022/tree-testing.mjs +104 -0
  310. package/fesm2022/tree-testing.mjs.map +1 -0
  311. package/fesm2022/tree.mjs +681 -0
  312. package/fesm2022/tree.mjs.map +1 -0
  313. package/form-field/_form-field-theme.scss +96 -0
  314. package/form-field/_m2-form-field.scss +226 -0
  315. package/form-field/_m3-form-field.scss +137 -0
  316. package/grid-list/_grid-list-theme.scss +76 -0
  317. package/grid-list/_m2-grid-list.scss +21 -0
  318. package/grid-list/_m3-grid-list.scss +20 -0
  319. package/icon/_icon-theme.scss +109 -0
  320. package/icon/_m2-icon.scss +15 -0
  321. package/icon/_m3-icon.scss +21 -0
  322. package/input/_input-theme.scss +36 -0
  323. package/list/_list-theme.scss +201 -0
  324. package/list/_m2-list.scss +92 -0
  325. package/list/_m3-list.scss +93 -0
  326. package/menu/_m2-menu.scss +44 -0
  327. package/menu/_m3-menu.scss +42 -0
  328. package/menu/_menu-theme.scss +76 -0
  329. package/package.json +404 -0
  330. package/paginator/_m2-paginator.scss +69 -0
  331. package/paginator/_m3-paginator.scss +46 -0
  332. package/paginator/_paginator-theme.scss +76 -0
  333. package/prebuilt-themes/azure-blue.css +1 -0
  334. package/prebuilt-themes/cyan-orange.css +1 -0
  335. package/prebuilt-themes/deeppurple-amber.css +1 -0
  336. package/prebuilt-themes/indigo-pink.css +1 -0
  337. package/prebuilt-themes/magenta-violet.css +1 -0
  338. package/prebuilt-themes/pink-bluegrey.css +1 -0
  339. package/prebuilt-themes/purple-green.css +1 -0
  340. package/prebuilt-themes/rose-red.css +1 -0
  341. package/progress-bar/_m2-progress-bar.scss +36 -0
  342. package/progress-bar/_m3-progress-bar.scss +29 -0
  343. package/progress-bar/_progress-bar-theme.scss +93 -0
  344. package/progress-spinner/_m2-progress-spinner.scss +25 -0
  345. package/progress-spinner/_m3-progress-spinner.scss +27 -0
  346. package/progress-spinner/_progress-spinner-theme.scss +95 -0
  347. package/radio/_m2-radio.scss +67 -0
  348. package/radio/_m3-radio.scss +65 -0
  349. package/radio/_radio-theme.scss +102 -0
  350. package/schematics/collection.json +55 -0
  351. package/schematics/migration.json +15 -0
  352. package/schematics/ng-add/fonts/material-fonts.d.ts +11 -0
  353. package/schematics/ng-add/fonts/material-fonts.js +41 -0
  354. package/schematics/ng-add/fonts/material-fonts.js.map +1 -0
  355. package/schematics/ng-add/index.d.ts +17 -0
  356. package/schematics/ng-add/index.js +54 -0
  357. package/schematics/ng-add/index.js.map +1 -0
  358. package/schematics/ng-add/package-config.d.ts +12 -0
  359. package/schematics/ng-add/package-config.js +51 -0
  360. package/schematics/ng-add/package-config.js.map +1 -0
  361. package/schematics/ng-add/schema.d.ts +15 -0
  362. package/schematics/ng-add/schema.js +10 -0
  363. package/schematics/ng-add/schema.js.map +1 -0
  364. package/schematics/ng-add/schema.json +43 -0
  365. package/schematics/ng-add/setup-project.d.ts +15 -0
  366. package/schematics/ng-add/setup-project.js +36 -0
  367. package/schematics/ng-add/setup-project.js.map +1 -0
  368. package/schematics/ng-add/theming/create-theme.d.ts +9 -0
  369. package/schematics/ng-add/theming/create-theme.js +58 -0
  370. package/schematics/ng-add/theming/create-theme.js.map +1 -0
  371. package/schematics/ng-add/theming/theming.d.ts +11 -0
  372. package/schematics/ng-add/theming/theming.js +133 -0
  373. package/schematics/ng-add/theming/theming.js.map +1 -0
  374. package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +27 -0
  375. package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +99 -0
  376. package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +38 -0
  377. package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +118 -0
  378. package/schematics/ng-generate/address-form/index.d.ts +14 -0
  379. package/schematics/ng-generate/address-form/index.js +43 -0
  380. package/schematics/ng-generate/address-form/index.js.map +1 -0
  381. package/schematics/ng-generate/address-form/schema.d.ts +10 -0
  382. package/schematics/ng-generate/address-form/schema.js +10 -0
  383. package/schematics/ng-generate/address-form/schema.js.map +1 -0
  384. package/schematics/ng-generate/address-form/schema.json +100 -0
  385. package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +21 -0
  386. package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +26 -0
  387. package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +36 -0
  388. package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +56 -0
  389. package/schematics/ng-generate/dashboard/index.d.ts +14 -0
  390. package/schematics/ng-generate/dashboard/index.js +42 -0
  391. package/schematics/ng-generate/dashboard/index.js.map +1 -0
  392. package/schematics/ng-generate/dashboard/schema.d.ts +10 -0
  393. package/schematics/ng-generate/dashboard/schema.js +10 -0
  394. package/schematics/ng-generate/dashboard/schema.js.map +1 -0
  395. package/schematics/ng-generate/dashboard/schema.json +100 -0
  396. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +17 -0
  397. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +28 -0
  398. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +36 -0
  399. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +42 -0
  400. package/schematics/ng-generate/navigation/index.d.ts +14 -0
  401. package/schematics/ng-generate/navigation/index.js +42 -0
  402. package/schematics/ng-generate/navigation/index.js.map +1 -0
  403. package/schematics/ng-generate/navigation/schema.d.ts +10 -0
  404. package/schematics/ng-generate/navigation/schema.js +10 -0
  405. package/schematics/ng-generate/navigation/schema.js.map +1 -0
  406. package/schematics/ng-generate/navigation/schema.json +105 -0
  407. package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__-datasource.ts.template +111 -0
  408. package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +3 -0
  409. package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +26 -0
  410. package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +32 -0
  411. package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +36 -0
  412. package/schematics/ng-generate/table/index.d.ts +14 -0
  413. package/schematics/ng-generate/table/index.js +40 -0
  414. package/schematics/ng-generate/table/index.js.map +1 -0
  415. package/schematics/ng-generate/table/schema.d.ts +10 -0
  416. package/schematics/ng-generate/table/schema.js +10 -0
  417. package/schematics/ng-generate/table/schema.js.map +1 -0
  418. package/schematics/ng-generate/table/schema.json +100 -0
  419. package/schematics/ng-generate/theme-color/index_bundled.js +6561 -0
  420. package/schematics/ng-generate/theme-color/index_bundled.js.map +6 -0
  421. package/schematics/ng-generate/theme-color/schema.json +55 -0
  422. package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +4 -0
  423. package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +22 -0
  424. package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +32 -0
  425. package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +93 -0
  426. package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/example-data.ts.template +47 -0
  427. package/schematics/ng-generate/tree/index.d.ts +14 -0
  428. package/schematics/ng-generate/tree/index.js +40 -0
  429. package/schematics/ng-generate/tree/index.js.map +1 -0
  430. package/schematics/ng-generate/tree/schema.d.ts +10 -0
  431. package/schematics/ng-generate/tree/schema.js +10 -0
  432. package/schematics/ng-generate/tree/schema.js.map +1 -0
  433. package/schematics/ng-generate/tree/schema.json +100 -0
  434. package/schematics/ng-update/index_bundled.js +204 -0
  435. package/schematics/ng-update/index_bundled.js.map +6 -0
  436. package/schematics/package.json +3 -0
  437. package/select/_m2-select.scss +49 -0
  438. package/select/_m3-select.scss +54 -0
  439. package/select/_select-theme.scss +99 -0
  440. package/sidenav/_m2-sidenav.scss +48 -0
  441. package/sidenav/_m3-sidenav.scss +26 -0
  442. package/sidenav/_sidenav-theme.scss +75 -0
  443. package/slide-toggle/_m2-slide-toggle.scss +134 -0
  444. package/slide-toggle/_m3-slide-toggle.scss +133 -0
  445. package/slide-toggle/_slide-toggle-theme.scss +119 -0
  446. package/slider/_m2-slider.scss +73 -0
  447. package/slider/_m3-slider.scss +69 -0
  448. package/slider/_slider-theme.scss +103 -0
  449. package/snack-bar/_m2-snack-bar.scss +24 -0
  450. package/snack-bar/_m3-snack-bar.scss +26 -0
  451. package/snack-bar/_snack-bar-theme.scss +77 -0
  452. package/sort/_m2-sort.scss +16 -0
  453. package/sort/_m3-sort.scss +20 -0
  454. package/sort/_sort-theme.scss +76 -0
  455. package/stepper/_m2-stepper.scss +65 -0
  456. package/stepper/_m3-stepper.scss +66 -0
  457. package/stepper/_stepper-theme.scss +102 -0
  458. package/table/_m2-table.scss +63 -0
  459. package/table/_m3-table.scss +52 -0
  460. package/table/_table-theme.scss +76 -0
  461. package/tabs/_m2-tabs.scss +68 -0
  462. package/tabs/_m3-tabs.scss +58 -0
  463. package/tabs/_tabs-theme.scss +131 -0
  464. package/timepicker/_m2-timepicker.scss +19 -0
  465. package/timepicker/_m3-timepicker.scss +21 -0
  466. package/timepicker/_timepicker-theme.scss +81 -0
  467. package/toolbar/_m2-toolbar.scss +43 -0
  468. package/toolbar/_m3-toolbar.scss +41 -0
  469. package/toolbar/_toolbar-theme.scss +114 -0
  470. package/tooltip/_m2-tooltip.scss +24 -0
  471. package/tooltip/_m3-tooltip.scss +25 -0
  472. package/tooltip/_tooltip-theme.scss +76 -0
  473. package/tree/_m2-tree.scss +30 -0
  474. package/tree/_m3-tree.scss +37 -0
  475. package/tree/_tree-theme.scss +76 -0
  476. package/types/_badge-chunk.d.ts +100 -0
  477. package/types/_button-toggle-chunk.d.ts +252 -0
  478. package/types/_date-adapter-chunk.d.ts +261 -0
  479. package/types/_date-range-input-harness-chunk.d.ts +284 -0
  480. package/types/_dialog-chunk.d.ts +336 -0
  481. package/types/_error-options-chunk.d.ts +17 -0
  482. package/types/_form-field-chunk.d.ts +375 -0
  483. package/types/_form-field-control-chunk.d.ts +64 -0
  484. package/types/_form-field-control-harness-chunk.d.ts +20 -0
  485. package/types/_form-field-module-chunk.d.ts +18 -0
  486. package/types/_icon-module-chunk.d.ts +162 -0
  487. package/types/_icon-registry-chunk.d.ts +271 -0
  488. package/types/_input-harness-chunk.d.ts +61 -0
  489. package/types/_line-chunk.d.ts +25 -0
  490. package/types/_list-option-types-chunk.d.ts +15 -0
  491. package/types/_option-chunk.d.ts +146 -0
  492. package/types/_option-harness-chunk.d.ts +35 -0
  493. package/types/_option-module-chunk.d.ts +13 -0
  494. package/types/_option-parent-chunk.d.ts +20 -0
  495. package/types/_paginator-chunk.d.ts +184 -0
  496. package/types/_palette-chunk.d.ts +4 -0
  497. package/types/_progress-spinner-chunk.d.ts +91 -0
  498. package/types/_pseudo-checkbox-module-chunk.d.ts +45 -0
  499. package/types/_ripple-chunk.d.ts +256 -0
  500. package/types/_ripple-loader-chunk.d.ts +48 -0
  501. package/types/_ripple-module-chunk.d.ts +11 -0
  502. package/types/_sort-chunk.d.ts +88 -0
  503. package/types/_sort-direction-chunk.d.ts +3 -0
  504. package/types/_tooltip-chunk.d.ts +315 -0
  505. package/types/autocomplete-testing.d.ts +53 -0
  506. package/types/autocomplete.d.ts +420 -0
  507. package/types/badge-testing.d.ts +36 -0
  508. package/types/badge.d.ts +14 -0
  509. package/types/bottom-sheet-testing.d.ts +26 -0
  510. package/types/bottom-sheet.d.ts +192 -0
  511. package/types/button-testing.d.ts +70 -0
  512. package/types/button-toggle-testing.d.ts +97 -0
  513. package/types/button-toggle.d.ts +16 -0
  514. package/types/button.d.ts +210 -0
  515. package/types/card-testing.d.ts +41 -0
  516. package/types/card.d.ts +156 -0
  517. package/types/checkbox-testing.d.ts +86 -0
  518. package/types/checkbox.d.ts +216 -0
  519. package/types/chips-testing.d.ts +270 -0
  520. package/types/chips.d.ts +993 -0
  521. package/types/core-testing.d.ts +32 -0
  522. package/types/core.d.ts +185 -0
  523. package/types/datepicker-testing.d.ts +25 -0
  524. package/types/datepicker.d.ts +1746 -0
  525. package/types/dialog-testing.d.ts +83 -0
  526. package/types/dialog.d.ts +84 -0
  527. package/types/divider-testing.d.ts +15 -0
  528. package/types/divider.d.ts +24 -0
  529. package/types/expansion-testing.d.ts +101 -0
  530. package/types/expansion.d.ts +258 -0
  531. package/types/form-field-testing-control.d.ts +13 -0
  532. package/types/form-field-testing.d.ts +127 -0
  533. package/types/form-field.d.ts +19 -0
  534. package/types/grid-list-testing.d.ts +82 -0
  535. package/types/grid-list.d.ts +207 -0
  536. package/types/icon-testing.d.ts +81 -0
  537. package/types/icon.d.ts +8 -0
  538. package/types/input-testing.d.ts +73 -0
  539. package/types/input.d.ts +208 -0
  540. package/types/list-testing.d.ts +354 -0
  541. package/types/list.d.ts +516 -0
  542. package/types/material.d.ts +3 -0
  543. package/types/menu-testing.d.ts +141 -0
  544. package/types/menu.d.ts +547 -0
  545. package/types/paginator-testing.d.ts +51 -0
  546. package/types/paginator.d.ts +36 -0
  547. package/types/progress-bar-testing.d.ts +24 -0
  548. package/types/progress-bar.d.ts +106 -0
  549. package/types/progress-spinner-testing.d.ts +28 -0
  550. package/types/progress-spinner.d.ts +13 -0
  551. package/types/radio-testing.d.ts +109 -0
  552. package/types/radio.d.ts +295 -0
  553. package/types/select-testing.d.ts +63 -0
  554. package/types/select.d.ts +448 -0
  555. package/types/sidenav-testing.d.ts +122 -0
  556. package/types/sidenav.d.ts +335 -0
  557. package/types/slide-toggle-testing.d.ts +66 -0
  558. package/types/slide-toggle.d.ts +151 -0
  559. package/types/slider-testing.d.ts +90 -0
  560. package/types/slider.d.ts +662 -0
  561. package/types/snack-bar-testing.d.ts +64 -0
  562. package/types/snack-bar.d.ts +328 -0
  563. package/types/sort-testing.d.ts +48 -0
  564. package/types/sort.d.ts +126 -0
  565. package/types/stepper-testing.d.ts +136 -0
  566. package/types/stepper.d.ts +225 -0
  567. package/types/table-testing.d.ts +174 -0
  568. package/types/table.d.ts +302 -0
  569. package/types/tabs-testing.d.ts +145 -0
  570. package/types/tabs.d.ts +890 -0
  571. package/types/timepicker-testing.d.ts +108 -0
  572. package/types/timepicker.d.ts +318 -0
  573. package/types/toolbar-testing.d.ts +33 -0
  574. package/types/toolbar.d.ts +44 -0
  575. package/types/tooltip-testing.d.ts +35 -0
  576. package/types/tooltip.d.ts +17 -0
  577. package/types/tree-testing.d.ts +119 -0
  578. package/types/tree.d.ts +233 -0
@@ -0,0 +1,126 @@
1
+ @use '../style/sass-utils';
2
+ @use './m3';
3
+ @use 'sass:map';
4
+
5
+ /// Generates a set of namespaced tokens for all components.
6
+ /// @param {Map} $systems The MDC system tokens
7
+ /// @param {Boolean} $include-non-systemized Whether to include non-systemized tokens
8
+ /// @param {Boolean} $include-density Whether to include density tokens
9
+ /// @return {Map} A map of namespaced tokens
10
+ @function generate-tokens($systems, $include-non-systemized: false, $include-density: false) {
11
+ $systems: map.merge((
12
+ md-sys-color: (),
13
+ md-sys-elevation: (),
14
+ md-sys-motion: (),
15
+ md-sys-shape: (),
16
+ md-sys-state: (),
17
+ md-sys-typescale: ()
18
+ ), $systems);
19
+ $exclude-hardcoded: not $include-non-systemized;
20
+
21
+ // TODO(mmalerba): Fill in remaining tokens.
22
+ $result: sass-utils.deep-merge-all(
23
+ // Add the system color & typography tokens (so we can give users access via an API).
24
+ (
25
+ (mat, theme): map.get($systems, md-sys-color),
26
+ (mat, typography): map.get($systems, md-sys-typescale),
27
+ ),
28
+ );
29
+
30
+ @return $result;
31
+ }
32
+
33
+ @function create-map($keys, $prefix) {
34
+ $result: ();
35
+ @each $key in $keys {
36
+ $result: map.merge($result, ($key: var(--#{$prefix}-#{$key})));
37
+ }
38
+ @return $result;
39
+ }
40
+
41
+ @function get-sys-color($type, $palettes, $prefix) {
42
+ $sys-color: null;
43
+
44
+ @if ($type == dark) {
45
+ $sys-color: m3.md-sys-color-values-dark($palettes);
46
+ } @else {
47
+ $sys-color: m3.md-sys-color-values-light($palettes);
48
+ }
49
+
50
+ @if (sass-utils.$use-system-color-variables) {
51
+ $var-values: ();
52
+ @each $key in map.keys($sys-color) {
53
+ $var-values: map.set($var-values, $key, var(--#{$prefix}-#{$key}));
54
+ }
55
+ $var-values: map.set($var-values, shadow, map.get($sys-color, shadow));
56
+ @return $var-values;
57
+ }
58
+
59
+ @return $sys-color;
60
+ }
61
+
62
+ @function get-sys-typeface($typography, $prefix) {
63
+ $sys-typography: m3.md-sys-typescale-values($typography);
64
+ @if (sass-utils.$use-system-typography-variables) {
65
+ $var-values: ();
66
+ @each $key in map.keys($sys-typography) {
67
+ $var-values: map.set($var-values, $key, var(--#{$prefix}-#{$key}));
68
+ }
69
+ @return $var-values;
70
+ }
71
+
72
+ @return $sys-typography;
73
+ }
74
+
75
+ /// Generates a set of namespaced color tokens for all components.
76
+ /// @param {String} $type The type of theme system (light or dark)
77
+ /// @param {Map} $primary The primary palette
78
+ /// @param {Map} $tertiary The tertiary palette
79
+ /// @param {Map} $error The error palette
80
+ /// @param {String} $system-variables-prefix The prefix of system tokens
81
+ /// @return {Map} A map of namespaced color tokens
82
+ @function generate-color-tokens($type, $palettes, $system-variables-prefix) {
83
+ $sys-color: get-sys-color($type, $palettes, $system-variables-prefix);
84
+
85
+ @return generate-tokens((
86
+ md-sys-color: $sys-color,
87
+ md-ref-palette: (
88
+ neutral-10: map.get($palettes, neutral, 10),
89
+ neutral-variant20: map.get($palettes, neutral-variant, 20),
90
+ ),
91
+ // Because the elevation values are always combined with color values to create the box shadow,
92
+ // elevation needs to be part of the color dimension.
93
+ md-sys-elevation: m3.md-sys-elevation-values(),
94
+ // Because the state values are sometimes combined with color values to create rgba colors,
95
+ // state needs to be part of color dimension.
96
+ // TODO(mmalerba): If at some point we remove the need for these combined values, we can move
97
+ // state to the base dimension.
98
+ md-sys-state: m3.md-sys-state-values(),
99
+ ));
100
+ }
101
+
102
+ /// Generates a set of namespaced color tokens for all components.
103
+ /// @param {String|List} $brand The brand font-family
104
+ /// @param {String|List} $plain The plain fort-family
105
+ /// @param {String|Number} $bold The bold font-weight
106
+ /// @param {String|Number} $medium The medium font-weight
107
+ /// @param {String|Number} $regular The regular font-weight
108
+ /// @param {String} $system-variables-prefix The prefix of system tokens
109
+ /// @return {Map} A map of namespaced typography tokens
110
+ @function generate-typography-tokens($typography, $system-variables-prefix) {
111
+ $sys-typeface: get-sys-typeface($typography, $system-variables-prefix);
112
+ @return generate-tokens((
113
+ md-sys-typescale: $sys-typeface
114
+ ));
115
+ }
116
+
117
+ /// Generates a set of namespaced tokens not related to color, typography, or density for all
118
+ /// components.
119
+ /// @return {Map} A map of namespaced tokens not related to color, typography, or density
120
+ @function generate-base-tokens() {
121
+ // TODO(mmalerba): Exclude density tokens once implemented.
122
+ @return generate-tokens((
123
+ md-sys-motion: m3.md-sys-motion-values(),
124
+ md-sys-shape: m3.md-sys-shape-values(),
125
+ ), $include-non-systemized: true);
126
+ }
@@ -0,0 +1,36 @@
1
+ @use 'sass:map';
2
+ @use 'sass:meta';
3
+ @use 'sass:string';
4
+
5
+ // Replaces color tokens in the map with those defined as the variant color.
6
+ @function replace-colors-with-variant($system, $color, $variant) {
7
+ $system: map.set($system, on-#{$color}, map.get($system, on-#{$variant}));
8
+ $system: map.set($system, on-#{$color}-container, map.get($system, on-#{$variant}-container));
9
+ $system: map.set($system, #{$color}, map.get($system, #{$variant}));
10
+ $system: map.set($system, #{$color}-container, map.get($system, #{$variant}-container));
11
+ $system: map.set($system, inverse-#{$color}, map.get($system, inverse-#{$variant}));
12
+ @return $system;
13
+ }
14
+
15
+ // Gets the theme's system values as a flat map.
16
+ @function get-system($theme) {
17
+ @return map.get($theme, _mat-system);
18
+ }
19
+
20
+ // Returns the color with an opacity value using color-mix. If the color is a variable name, it
21
+ // will wrap it with `var()`.
22
+ @function color-with-opacity($color, $opacity) {
23
+ @if (meta.type-of($color) == string and string.index($color, '--') == 1) {
24
+ $color: var($color);
25
+ }
26
+
27
+ // Opacity may be a system level value less than 1, instead of the intended
28
+ // whole percentage, e.g. 38%. Remove this support when possible.
29
+ @if (meta.type-of($opacity) == string and string.index($opacity, '--') == 1) {
30
+ $opacity: 'calc(var(#{$opacity}) * 100%)';
31
+ } @else if (meta.type-of($opacity) == number and $opacity < 1) {
32
+ $opacity: '#{$opacity * 100}%';
33
+ }
34
+
35
+ @return color-mix(in srgb, #{$color} #{$opacity}, transparent);
36
+ }
@@ -0,0 +1,398 @@
1
+ @use '../../button-toggle/m3-button-toggle';
2
+ @use '../../button/m3-button';
3
+ @use '../../button/m3-fab';
4
+ @use '../../button/m3-icon-button';
5
+ @use '../../checkbox/m3-checkbox';
6
+ @use '../../chips/m3-chip';
7
+ @use '../../expansion/m3-expansion';
8
+ @use '../../form-field/m3-form-field';
9
+ @use '../../list/m3-list';
10
+ @use '../../paginator/m3-paginator';
11
+ @use '../../radio/m3-radio';
12
+ @use '../../select/m3-select';
13
+ @use '../../stepper/m3-stepper';
14
+ @use '../../table/m3-table';
15
+ @use '../../tabs/m3-tabs';
16
+ @use '../../toolbar/m3-toolbar';
17
+ @use '../../tree/m3-tree';
18
+ @use '../style/elevation';
19
+ @use '../theming/config-validation';
20
+ @use '../theming/definition';
21
+ @use '../theming/inspection';
22
+ @use '../theming/m2-inspection';
23
+ @use '../theming/palettes';
24
+ @use '../style/sass-utils';
25
+ @use './m2';
26
+ @use './m3';
27
+ @use 'sass:list';
28
+ @use 'sass:map';
29
+ @use 'sass:meta';
30
+
31
+ /// Emits necessary CSS variables for Material's system level values for the values defined in the
32
+ /// config map. The config map can have values color, typography, and/or density.
33
+ ///
34
+ /// If the config map's color value is an Angular Material color palette, it will be used as the
35
+ /// primary and tertiary colors with a `color-scheme` theme type. Otherwise if the color value is a
36
+ /// map, it must have a `primary` value containing an Angular Material color palette, and
37
+ /// optionally a different `tertiary` palette (defaults to primary palette) and `theme-type` that
38
+ /// is either `light`, `dark`, or 'color-scheme` (defaults to `color-scheme`). Color variable
39
+ /// definitions will not be emitted if there are no color values in the config.
40
+ ///
41
+ /// If the config map's typography value is a font family string, it will be used as the
42
+ /// plain and brand font family with default bold, medium, and regular weights of 700, 500, and 400,
43
+ /// respectfully. Otherwise if the typography value is a map, it must have a `plain-family` font
44
+ /// family value, and optionally a different `brand-family` font family (defaults to the plain
45
+ /// value) and weights for `bold-weight` (default: 700), `bold-weight` (default: 500), and
46
+ /// `bold-weight` (default: 400). Typography variable definitions will not be emitted if there are
47
+ /// no typography values in the config.
48
+ ///
49
+ /// If the config map's density value is a number, it will be used as the density scale. Otherwise
50
+ /// if the density value is a map, it must have a `scale` value. Density variable definitions will
51
+ /// not be emitted if there are no density values in the config.
52
+ ///
53
+ /// The application variables emitted use the namespace prefix "--mat-sys".
54
+ /// e.g. --mat-sys-surface: #E5E5E5
55
+ ///
56
+ /// @param {Map} $config The color configuration with optional keys color, typography, or density.
57
+ @mixin theme($config, $overrides: ()) {
58
+ $color: map.get($config, color);
59
+ $color-config: null;
60
+ @if ($color) {
61
+ // validate-palette returns null if it is a valid M3 palette
62
+ $is-palette: config-validation.validate-palette($color) == null;
63
+
64
+ // Default to "color-scheme" theme type if the config's color does not provide one.
65
+ @if (not $is-palette and not map.has-key($color, theme-type)) {
66
+ $color: map.set($color, theme-type, color-scheme);
67
+ }
68
+
69
+ $color-config: $color;
70
+ @if ($is-palette) {
71
+ $color: map.set($color, tertiary, $color);
72
+ $color-config: (
73
+ definition.$internals: (
74
+ palettes: (
75
+ primary: map.remove($color, neutral, neutral-variant, secondary),
76
+ secondary: map.get($color, secondary),
77
+ tertiary: map.remove($color, neutral, neutral-variant, secondary, error),
78
+ neutral: map.get($color, neutral),
79
+ neutral-variant: map.get($color, neutral-variant),
80
+ error: map.get($color, error),
81
+ ),
82
+ theme-type: color-scheme,
83
+ )
84
+ );
85
+ } @else {
86
+ $primary: map.get($color, primary) or palettes.$violet-palette;
87
+ $tertiary: map.get($color, tertiary) or $primary;
88
+ $color-config: (
89
+ definition.$internals: (
90
+ palettes: (
91
+ primary: map.remove($primary, neutral, neutral-variant, secondary),
92
+ secondary: map.get($primary, secondary),
93
+ tertiary: map.remove($tertiary, neutral, neutral-variant, secondary, error),
94
+ neutral: map.get($primary, neutral),
95
+ neutral-variant: map.get($primary, neutral-variant),
96
+ error: map.get($primary, error),
97
+ ),
98
+ theme-type: map.get($color, theme-type),
99
+ )
100
+ );
101
+ }
102
+
103
+ @include system-level-colors($color-config, $overrides, definition.$system-fallback-prefix);
104
+ @include system-level-elevation($color-config, $overrides, definition.$system-fallback-prefix);
105
+ }
106
+
107
+ $typography: map.get($config, typography);
108
+ $typography-config: null;
109
+ @if ($typography) {
110
+ $plain: (Roboto, sans-serif);
111
+ $brand: $plain;
112
+ $bold: 700;
113
+ $medium: 500;
114
+ $regular: 400;
115
+ @if (meta.type-of($typography) == map) {
116
+ $plain: map.get($typography, plain-family);
117
+ $brand: map.get($typography, brand-family) or $plain;
118
+ $bold: map.get($typography, bold-weight) or $bold;
119
+ $medium: map.get($typography, medium-weight) or $medium;
120
+ $regular: map.get($typography, regular-weight) or $regular;
121
+ } @else {
122
+ $plain: $typography;
123
+ $brand: $typography;
124
+ }
125
+ $typography-config: (
126
+ definition.$internals: (
127
+ font-definition: (
128
+ plain: $plain,
129
+ brand: $brand,
130
+ bold: $bold,
131
+ medium: $medium,
132
+ regular: $regular,
133
+ )
134
+ )
135
+ );
136
+ @include system-level-typography(
137
+ $typography-config, $overrides, definition.$system-fallback-prefix);
138
+ }
139
+
140
+ $density: map.get($config, density);
141
+ $density-config: null;
142
+ @if ($density) {
143
+ $scale: 0;
144
+ @if (meta.type-of($density) == map) {
145
+ $scale: map.get($density, scale);
146
+ } @else {
147
+ $scale: $density;
148
+ }
149
+ @if ($scale != 0) {
150
+ // Emit component-level density tokens if the scale is lower than 0. The density tokens
151
+ // do not fallback to any system-level values and must be defined if the scale is different.
152
+ $density-tokens: get-density-tokens($scale);
153
+ @each $tokens in $density-tokens {
154
+ @each $token-name, $token-value in $tokens {
155
+ --mat-#{$token-name}: #{$token-value};
156
+ }
157
+ }
158
+ }
159
+ }
160
+
161
+ @include system-level-shape($overrides: $overrides, $prefix: definition.$system-fallback-prefix);
162
+ @include system-level-state($overrides: $overrides, $prefix: definition.$system-fallback-prefix);
163
+ }
164
+
165
+ // Gets all density-related tokens from the components.
166
+ @function get-density-tokens($scale) {
167
+ @return (
168
+ m3-checkbox.get-density-tokens($scale),
169
+ m3-chip.get-density-tokens($scale),
170
+ m3-expansion.get-density-tokens($scale),
171
+ m3-fab.get-density-tokens($scale),
172
+ m3-button.get-density-tokens($scale),
173
+ m3-form-field.get-density-tokens($scale),
174
+ m3-icon-button.get-density-tokens($scale),
175
+ m3-list.get-density-tokens($scale),
176
+ m3-paginator.get-density-tokens($scale),
177
+ m3-radio.get-density-tokens($scale),
178
+ m3-tabs.get-density-tokens($scale),
179
+ m3-select.get-density-tokens($scale),
180
+ m3-button-toggle.get-density-tokens($scale),
181
+ m3-stepper.get-density-tokens($scale),
182
+ m3-table.get-density-tokens($scale),
183
+ m3-toolbar.get-density-tokens($scale),
184
+ m3-tree.get-density-tokens($scale),
185
+ );
186
+ }
187
+
188
+ /// Emits the system-level CSS variables for each of the provided override values. E.g. to
189
+ /// change the primary color to red, use `mat.theme-overrides((primary: red));`
190
+ @mixin theme-overrides($overrides, $prefix: definition.$system-fallback-prefix) {
191
+ $sys-names: map-merge-all(
192
+ m3.md-sys-color-values-light(palettes.$blue-palette),
193
+ m3.md-sys-typescale-values((
194
+ brand: (Roboto),
195
+ plain: (Roboto),
196
+ bold: 700,
197
+ medium: 500,
198
+ regular: 400
199
+ )),
200
+ m3.md-sys-elevation-values(),
201
+ m3.md-sys-shape-values(),
202
+ m3.md-sys-state-values());
203
+
204
+ @include sass-utils.current-selector-or-root {
205
+ @each $name, $value in $overrides {
206
+ @if (map.has-key($sys-names, $name)) {
207
+ --#{$prefix}-#{$name}: #{map.get($overrides, $name)};
208
+ }
209
+ }
210
+ }
211
+ }
212
+
213
+ @mixin system-level-colors($theme, $overrides: (), $prefix: null) {
214
+ $palettes: map.get($theme, definition.$internals, palettes);
215
+ $type: map.get($theme, definition.$internals, theme-type);
216
+
217
+ @if (not $prefix) {
218
+ $prefix: map.get($theme, definition.$internals,
219
+ color-system-variables-prefix) or definition.$system-level-prefix;
220
+ }
221
+
222
+
223
+ $sys-colors: _generate-sys-colors($palettes, $type);
224
+
225
+ // Manually insert a subset of palette values that are used directly by components
226
+ // instead of system variables.
227
+ $sys-colors: map.set($sys-colors, neutral-variant20, map.get($palettes, neutral-variant, 20));
228
+ $sys-colors: map.set($sys-colors, neutral10, map.get($palettes, neutral, 10));
229
+
230
+ @include sass-utils.current-selector-or-root {
231
+ @each $name, $value in $sys-colors {
232
+ --#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
233
+ }
234
+ }
235
+ }
236
+
237
+ @function _generate-sys-colors($palettes, $type) {
238
+ $light-sys-colors: m3.md-sys-color-values-light($palettes);
239
+ @if ($type == light) {
240
+ @return $light-sys-colors;
241
+ }
242
+
243
+ $dark-sys-colors: m3.md-sys-color-values-dark($palettes);
244
+ @if ($type == dark) {
245
+ @return $dark-sys-colors;
246
+ }
247
+
248
+ @if ($type == color-scheme) {
249
+ $light-dark-sys-colors: ();
250
+ @each $name, $light-value in $light-sys-colors {
251
+ $dark-value: map.get($dark-sys-colors, $name);
252
+ $light-dark-sys-colors:
253
+ map.set($light-dark-sys-colors, $name, light-dark($light-value, $dark-value));
254
+ }
255
+ @return $light-dark-sys-colors;
256
+ }
257
+
258
+ @error 'Unknown theme-type provided: #{$type}';
259
+ }
260
+
261
+ @mixin system-level-typography($theme, $overrides: (), $prefix: null) {
262
+ $font-definition: map.get($theme, definition.$internals, font-definition);
263
+
264
+ @if (not $prefix) {
265
+ $prefix: map.get($theme, definition.$internals,
266
+ typography-system-variables-prefix) or definition.$system-level-prefix;
267
+ }
268
+
269
+ @include sass-utils.current-selector-or-root {
270
+ @each $name, $value in m3.md-sys-typescale-values($font-definition) {
271
+ --#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
272
+ }
273
+ }
274
+ }
275
+
276
+ @mixin system-level-elevation($theme, $overrides: (), $prefix: definition.$system-level-prefix) {
277
+ $shadow-color: map.get(
278
+ $theme, definition.$internals, palettes, neutral, 0);
279
+
280
+ @include sass-utils.current-selector-or-root {
281
+ @each $name, $value in m3.md-sys-elevation-values() {
282
+ $level: map.get($overrides, $name) or $value;
283
+ $value: elevation.get-box-shadow($level, $shadow-color);
284
+ --#{$prefix}-#{$name}: #{$value};
285
+ }
286
+ }
287
+ }
288
+
289
+ @mixin system-level-shape($theme: (), $overrides: (), $prefix: definition.$system-level-prefix) {
290
+ @include sass-utils.current-selector-or-root {
291
+ @each $name, $value in m3.md-sys-shape-values() {
292
+ --#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
293
+ }
294
+ }
295
+ }
296
+
297
+ @mixin system-level-state($theme: (), $overrides: (), $prefix: definition.$system-level-prefix) {
298
+ @include sass-utils.current-selector-or-root {
299
+ @each $name, $value in m3.md-sys-state-values() {
300
+ --#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
301
+ }
302
+ }
303
+ }
304
+
305
+ /// Creates a single merged map from the provided variable-length map arguments
306
+ @function map-merge-all($maps...) {
307
+ $result: ();
308
+ @each $map in $maps {
309
+ $result: map.merge($result, $map);
310
+ }
311
+ @return $result;
312
+ }
313
+
314
+ // Defines Angular Material system variables using M2 values provided by
315
+ // an M2 theme config created with `mat.m2-define-light-theme` or `mat.m2-define-dark-theme`.
316
+ //
317
+ // This enables applications to style custom components with system-level CSS
318
+ // variables instead of creating a separate component theme mixin that relies on
319
+ // the theme config.
320
+ //
321
+ // For example, use `var(--mat-sys-primary)` to get a theme's primary color instead of
322
+ // pulling it from the theme with `m2-get-color-from-palette($primary-palette, default)`.
323
+ //
324
+ // Unlike M3's `mat.theme()`, this mixin does not replace the need to call
325
+ // individual component theme mixins for Angular Material components.
326
+ @mixin m2-theme($theme-config, $overrides: ()) {
327
+ @if inspection.get-theme-version($theme-config) == 1 {
328
+ @error '`m2-theme` mixin should only be called for M2 theme ' +
329
+ 'configs created with define-light-theme or define-dark-theme';
330
+ }
331
+
332
+ // Check whether any override keys do not match keys in the theme
333
+ // config system map.
334
+ $invalid-keys: ();
335
+ $config-system: map.get($theme-config, _mat-system);
336
+ @each $key, $value in $overrides {
337
+ @if (not map.has-key($config-system, $key)) {
338
+ $invalid-keys: list.append($invalid-keys, $key);
339
+ }
340
+ }
341
+ @if (list.length($invalid-keys) > 0) {
342
+ @error 'The following overrides are not valid system variables: #{$invalid-keys}. ' +
343
+ 'Valid keys are: #{map.keys($config-system)}';
344
+ }
345
+
346
+ $config: m2-inspection.get-m2-config($theme-config);
347
+
348
+ $color: map.get($config, color);
349
+ @if (m2-inspection.theme-has($theme-config, color)) {
350
+ $system-colors: null;
351
+
352
+ @if (map.get($color, is-dark)) {
353
+ $system-colors: m2.md-sys-color-values-dark($color);
354
+ } @else {
355
+ $system-colors: m2.md-sys-color-values-light($color);
356
+ }
357
+
358
+ @include _define-m2-system-vars($system-colors, $overrides);
359
+
360
+ $shadow: map.get($theme-config, _mat-system, shadow);
361
+ $system-elevations: ();
362
+ @each $name, $value in m2.md-sys-elevation-values() {
363
+ $level: map.get($overrides, $name) or $value;
364
+ $value: elevation.get-box-shadow($level, $shadow);
365
+ $system-elevations: map.set($system-elevations, $name, $value);
366
+ }
367
+ @include _define-m2-system-vars($system-elevations, $overrides);
368
+ }
369
+
370
+ $typography: map.get($config, typography);
371
+ @if ($typography) {
372
+ $system-typography: m2.md-sys-typescale-values($typography);
373
+ @include _define-m2-system-vars($system-typography, $overrides);
374
+ }
375
+
376
+ @include _define-m2-system-vars(m2.md-sys-shape-values(), $overrides);
377
+ @include _define-m2-system-vars(m2.md-sys-state-values(), $overrides);
378
+
379
+ // The icon button's color token is set to `inherit` for M2 and intended to display
380
+ // the color inherited from its parent element. This is crucial because it's unknown
381
+ // whether the icon button sits on a container with background like "surface" or "primary",
382
+ // where both may have different contrast colors like white or black.
383
+ // However, variables set to inherit AND define a fallback will always use the fallback,
384
+ // which is "on-surface-variant". This mixin now defines this value.
385
+ // To avoid this, and continue using `inherit` for the icon button color, set the color explicitly
386
+ // to the token without a fallback.
387
+ .mat-mdc-button-base.mat-mdc-icon-button:not(.mat-mdc-button-disabled) {
388
+ color: var(--mat-icon-button-icon-color);
389
+ }
390
+ }
391
+
392
+ @mixin _define-m2-system-vars($vars, $overrides) {
393
+ @include sass-utils.current-selector-or-root {
394
+ @each $name, $value in $vars {
395
+ --#{definition.$system-fallback-prefix}-#{$name}: #{map.get($overrides, $name) or $value};
396
+ }
397
+ }
398
+ }
@@ -0,0 +1,119 @@
1
+ @use '../style/sass-utils';
2
+ @use 'sass:list';
3
+ @use 'sass:map';
4
+ @use 'sass:string';
5
+
6
+ // Creates a CSS variable, including the fallback if provided.
7
+ @function _create-var($name, $fallback: null) {
8
+ @if ($fallback) {
9
+ @return var($name, $fallback);
10
+ } @else {
11
+ @return var($name);
12
+ }
13
+ }
14
+
15
+ // Returns a list of overrides for the given M3 get-tokens mixin and prefix. Each token has its
16
+ // prefix removed since the overrides API expects its absence. The returned map includes "all" for
17
+ // all override tokens, and also the subsets with keys base, color, typography, and density.
18
+ @function get-overrides($tokens, $prefix) {
19
+ $base: remove-token-prefixes(map.get($tokens, base), $prefix);
20
+ $color: remove-token-prefixes(map.get($tokens, color), $prefix);
21
+ $typography: remove-token-prefixes(map.get($tokens, typography), $prefix);
22
+ $density: remove-token-prefixes(map.get($tokens, density), $prefix);
23
+ $all: ();
24
+ @each $map in ($base, $color, $typography, $density) {
25
+ $all: map.merge($all, $map);
26
+ }
27
+
28
+ @return (
29
+ all: $all,
30
+ base: $base,
31
+ color: $color,
32
+ typography: $typography,
33
+ density: $density,
34
+ );
35
+ }
36
+
37
+ // Removes a prefix from each component token in the provided map of prefixed tokens.
38
+ @function remove-token-prefixes($prefixed-tokens: (), $prefix) {
39
+ $tokens: ();
40
+ @each $prefixed-token, $value in $prefixed-tokens {
41
+ $token: string.slice($prefixed-token, string.length($prefix) + 2);
42
+ $tokens: map.set($tokens, $token, $value);
43
+ }
44
+ @return $tokens;
45
+ }
46
+
47
+ // Returns the token slot value.
48
+ // Accepts an optional fallback parameter to include in the CSS variable.
49
+ // If $fallback is `true`, then use the tokens map to get the fallback.
50
+ @function slot($token, $fallbacks, $fallback: null) {
51
+ // Fallbacks are a map of base, color, typography, and density tokens. To simplify
52
+ // lookup, flatten these token groups into a single map.
53
+ $fallbacks-flattened: ();
54
+ @each $tokens in map.values($fallbacks) {
55
+ @each $token, $value in $tokens {
56
+ $fallbacks-flattened: map.set($fallbacks-flattened, $token, $value);
57
+ }
58
+ }
59
+ @if not map.has-key($fallbacks-flattened, $token) {
60
+ @error 'Token #{$token} does not exist. Configured tokens are:' +
61
+ #{map.keys($fallbacks-flattened)};
62
+ }
63
+
64
+ $sys-fallback: map.get($fallbacks-flattened, $token);
65
+ @if (sass-utils.is-css-var-name($sys-fallback)) {
66
+ $sys-fallback: _create-var($sys-fallback, $fallback);
67
+ }
68
+
69
+ @return _create-var(--mat-#{$token}, $sys-fallback);
70
+ }
71
+
72
+ // Outputs a map of token values as CSS variable definitions.
73
+ @mixin values($tokens) {
74
+ @include sass-utils.current-selector-or-root() {
75
+ @each $key, $value in $tokens {
76
+ @if $value != null {
77
+ --mat-#{$key}: #{$value};
78
+ }
79
+ }
80
+ }
81
+ }
82
+
83
+ /// Emits new token values for the given token overrides.
84
+ /// Verifies that the overrides passed in are valid tokens.
85
+ /// New token values are emitted under the current selector or root.
86
+ @mixin batch-create-token-values($overrides: (), $namespace-configs) {
87
+ @include sass-utils.current-selector-or-root() {
88
+ $prefixed-name-data: ();
89
+ $all-names: ();
90
+
91
+ @each $config in $namespace-configs {
92
+ $namespace: map.get($config, namespace);
93
+ $tokens: map.get(map.get($config, tokens), all);
94
+ $prefix: '';
95
+
96
+ @if (map.has-key($config, prefix)) {
97
+ $prefix: map.get($config, prefix);
98
+ }
99
+
100
+ @each $name, $value in $tokens {
101
+ $prefixed-name: $prefix + $name;
102
+ $all-names: list.append($all-names, $prefixed-name, $separator: comma);
103
+ $prefixed-name-data: map.set($prefixed-name-data, $prefixed-name, ($namespace, $name));
104
+ }
105
+ }
106
+
107
+ @each $name, $value in $overrides {
108
+ @if map.has-key($prefixed-name-data, $name) {
109
+ $data: map.get($prefixed-name-data, $name);
110
+ $namespace: list.nth($data, 1);
111
+ $name: list.nth($data, 2);
112
+ $prefixed-name: $namespace + '-' + $name;
113
+ @include values(($prefixed-name: $value));
114
+ } @else {
115
+ @error #{'Invalid token name `'}#{$name}#{'`. '}#{'Valid tokens are: '}#{$all-names};
116
+ }
117
+ }
118
+ }
119
+ }
@@ -0,0 +1,6 @@
1
+ @forward './md-sys-color';
2
+ @forward './md-sys-elevation';
3
+ @forward './md-sys-motion';
4
+ @forward './md-sys-shape';
5
+ @forward './md-sys-state';
6
+ @forward './md-sys-typescale';