@ng-matero/extensions 16.3.2 → 17.1.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 (251) hide show
  1. package/_index.scss +26 -13
  2. package/alert/_alert-theme.scss +54 -24
  3. package/alert/alert-module.d.ts +3 -3
  4. package/alert/alert.d.ts +4 -7
  5. package/alert/alert.scss +3 -3
  6. package/button/_button-theme.scss +6 -4
  7. package/button/button-loading.d.ts +5 -10
  8. package/button/button-module.d.ts +5 -5
  9. package/checkbox-group/checkbox-group-module.d.ts +6 -6
  10. package/checkbox-group/checkbox-group.d.ts +5 -10
  11. package/colorpicker/_colorpicker-theme.scss +62 -34
  12. package/colorpicker/colorpicker-input.d.ts +2 -4
  13. package/colorpicker/colorpicker-module.d.ts +10 -10
  14. package/colorpicker/colorpicker-toggle.d.ts +4 -5
  15. package/colorpicker/colorpicker.d.ts +8 -9
  16. package/column-resize/column-resize-directives/column-resize-flex.d.ts +1 -1
  17. package/column-resize/column-resize-directives/column-resize.d.ts +1 -1
  18. package/column-resize/column-resize-module.d.ts +1 -1
  19. package/core/color/_all-color.scss +7 -18
  20. package/core/datetime/datetime.module.d.ts +4 -1
  21. package/core/density/_all-density.scss +17 -25
  22. package/core/pipes/is-template-ref.pipe.d.ts +1 -1
  23. package/core/pipes/pipes.module.d.ts +4 -4
  24. package/core/pipes/to-observable.pipe.d.ts +1 -1
  25. package/core/style/_sass-utils.scss +13 -1
  26. package/core/theming/_all-theme.scss +32 -17
  27. package/core/tokens/_token-utils.scss +4 -5
  28. package/core/tokens/m2/mdc/_plain-tooltip.scss +21 -29
  29. package/core/tokens/m2/mtx/_alert.scss +14 -15
  30. package/core/tokens/m2/mtx/_colorpicker.scss +8 -11
  31. package/core/tokens/m2/mtx/_datetimepicker.scss +38 -47
  32. package/core/tokens/m2/mtx/_drawer.scss +9 -10
  33. package/core/tokens/m2/mtx/_grid.scss +23 -22
  34. package/core/tokens/m2/mtx/_loader.scss +6 -6
  35. package/core/tokens/m2/mtx/_popover.scss +10 -11
  36. package/core/tokens/m2/mtx/_progress.scss +18 -17
  37. package/core/tokens/m2/mtx/_select.scss +23 -24
  38. package/core/tokens/m2/mtx/_split.scss +8 -11
  39. package/core/typography/_all-typography.scss +40 -0
  40. package/core/typography/_typography.scss +1 -579
  41. package/datetimepicker/_datetimepicker-theme.scss +75 -48
  42. package/datetimepicker/calendar-body.d.ts +1 -1
  43. package/datetimepicker/calendar.d.ts +8 -15
  44. package/datetimepicker/calendar.scss +16 -4
  45. package/datetimepicker/clock.d.ts +2 -3
  46. package/datetimepicker/datetimepicker-content.scss +3 -3
  47. package/datetimepicker/datetimepicker-input.d.ts +2 -3
  48. package/datetimepicker/datetimepicker-module.d.ts +16 -16
  49. package/datetimepicker/datetimepicker-toggle.d.ts +4 -5
  50. package/datetimepicker/datetimepicker.d.ts +16 -27
  51. package/datetimepicker/month-view.d.ts +2 -2
  52. package/datetimepicker/multi-year-view.d.ts +2 -2
  53. package/datetimepicker/time.d.ts +6 -8
  54. package/datetimepicker/time.scss +2 -2
  55. package/datetimepicker/year-view.d.ts +2 -2
  56. package/dialog/dialog-container.d.ts +1 -1
  57. package/dialog/dialog-module.d.ts +7 -7
  58. package/drawer/_drawer-theme.scss +55 -22
  59. package/drawer/drawer-container.d.ts +1 -1
  60. package/drawer/drawer-container.scss +25 -4
  61. package/drawer/drawer-module.d.ts +5 -5
  62. package/esm2022/alert/alert-module.mjs +6 -7
  63. package/esm2022/alert/alert.mjs +11 -18
  64. package/esm2022/button/button-loading.mjs +13 -23
  65. package/esm2022/button/button-module.mjs +6 -7
  66. package/esm2022/checkbox-group/checkbox-group-module.mjs +6 -7
  67. package/esm2022/checkbox-group/checkbox-group.mjs +19 -31
  68. package/esm2022/colorpicker/colorpicker-input.mjs +14 -14
  69. package/esm2022/colorpicker/colorpicker-module.mjs +20 -19
  70. package/esm2022/colorpicker/colorpicker-toggle.mjs +19 -18
  71. package/esm2022/colorpicker/colorpicker.mjs +46 -44
  72. package/esm2022/column-resize/column-resize-directives/column-resize-flex.mjs +6 -5
  73. package/esm2022/column-resize/column-resize-directives/column-resize.mjs +6 -5
  74. package/esm2022/column-resize/column-resize-module.mjs +6 -6
  75. package/esm2022/column-resize/column-resize-notifier.mjs +7 -7
  76. package/esm2022/column-resize/column-resize.mjs +4 -4
  77. package/esm2022/column-resize/column-size-store.mjs +3 -3
  78. package/esm2022/column-resize/event-dispatcher.mjs +5 -5
  79. package/esm2022/column-resize/overlay-handle.mjs +4 -4
  80. package/esm2022/column-resize/polyfill.mjs +1 -1
  81. package/esm2022/column-resize/resizable.mjs +4 -4
  82. package/esm2022/column-resize/resize-strategy.mjs +14 -14
  83. package/esm2022/core/datetime/datetime-adapter.mjs +1 -1
  84. package/esm2022/core/datetime/datetime.module.mjs +19 -23
  85. package/esm2022/core/datetime/native-datetime-adapter.mjs +6 -6
  86. package/esm2022/core/pipes/is-template-ref.pipe.mjs +5 -5
  87. package/esm2022/core/pipes/pipes.module.mjs +6 -7
  88. package/esm2022/core/pipes/to-observable.pipe.mjs +5 -5
  89. package/esm2022/datetimepicker/calendar-body.mjs +5 -6
  90. package/esm2022/datetimepicker/calendar.mjs +38 -48
  91. package/esm2022/datetimepicker/clock.mjs +11 -11
  92. package/esm2022/datetimepicker/datetimepicker-errors.mjs +4 -3
  93. package/esm2022/datetimepicker/datetimepicker-input.mjs +14 -14
  94. package/esm2022/datetimepicker/datetimepicker-intl.mjs +3 -3
  95. package/esm2022/datetimepicker/datetimepicker-module.mjs +28 -11
  96. package/esm2022/datetimepicker/datetimepicker-toggle.mjs +19 -18
  97. package/esm2022/datetimepicker/datetimepicker.mjs +70 -89
  98. package/esm2022/datetimepicker/month-view.mjs +8 -10
  99. package/esm2022/datetimepicker/multi-year-view.mjs +10 -11
  100. package/esm2022/datetimepicker/time.mjs +19 -24
  101. package/esm2022/datetimepicker/year-view.mjs +10 -11
  102. package/esm2022/dialog/dialog-container.mjs +21 -12
  103. package/esm2022/dialog/dialog-module.mjs +23 -7
  104. package/esm2022/dialog/dialog.mjs +7 -6
  105. package/esm2022/drawer/drawer-container.mjs +7 -8
  106. package/esm2022/drawer/drawer-module.mjs +6 -7
  107. package/esm2022/drawer/drawer-ref.mjs +1 -1
  108. package/esm2022/drawer/drawer.mjs +8 -7
  109. package/esm2022/grid/cell.mjs +36 -14
  110. package/esm2022/grid/column-menu.mjs +31 -15
  111. package/esm2022/grid/column-resize/column-resize-directives/column-resize-flex.mjs +6 -5
  112. package/esm2022/grid/column-resize/column-resize-directives/column-resize.mjs +6 -5
  113. package/esm2022/grid/column-resize/column-resize-module.mjs +14 -14
  114. package/esm2022/grid/column-resize/index.mjs +8 -0
  115. package/esm2022/grid/column-resize/overlay-handle.mjs +7 -6
  116. package/esm2022/grid/column-resize/resizable-directives/resizable.mjs +7 -6
  117. package/esm2022/grid/column-resize/resize-strategy.mjs +5 -5
  118. package/esm2022/grid/expansion-toggle.mjs +6 -5
  119. package/esm2022/grid/grid-module.mjs +39 -37
  120. package/esm2022/grid/grid-pipes.mjs +30 -30
  121. package/esm2022/grid/grid-utils.mjs +7 -6
  122. package/esm2022/grid/grid.mjs +175 -111
  123. package/esm2022/loader/loader-module.mjs +6 -7
  124. package/esm2022/loader/loader.mjs +17 -29
  125. package/esm2022/photoviewer/photoviewer-module.mjs +6 -7
  126. package/esm2022/photoviewer/photoviewer.mjs +8 -7
  127. package/esm2022/popover/popover-content.mjs +10 -9
  128. package/esm2022/popover/popover-module.mjs +22 -7
  129. package/esm2022/popover/popover-target.mjs +6 -5
  130. package/esm2022/popover/popover-trigger.mjs +15 -8
  131. package/esm2022/popover/popover.mjs +54 -139
  132. package/esm2022/progress/progress-module.mjs +6 -7
  133. package/esm2022/progress/progress.mjs +15 -26
  134. package/esm2022/select/option.mjs +12 -17
  135. package/esm2022/select/select-module.mjs +20 -9
  136. package/esm2022/select/select.mjs +19 -19
  137. package/esm2022/select/templates.mjs +56 -56
  138. package/esm2022/split/split-module.mjs +6 -7
  139. package/esm2022/split/split-pane.mjs +6 -5
  140. package/esm2022/split/split.mjs +8 -8
  141. package/esm2022/split/utils.mjs +1 -1
  142. package/esm2022/tooltip/tooltip-module.mjs +24 -7
  143. package/esm2022/tooltip/tooltip.mjs +104 -117
  144. package/fesm2022/mtxAlert.mjs +15 -23
  145. package/fesm2022/mtxAlert.mjs.map +1 -1
  146. package/fesm2022/mtxButton.mjs +17 -28
  147. package/fesm2022/mtxButton.mjs.map +1 -1
  148. package/fesm2022/mtxCheckboxGroup.mjs +22 -37
  149. package/fesm2022/mtxCheckboxGroup.mjs.map +1 -1
  150. package/fesm2022/mtxColorpicker.mjs +479 -474
  151. package/fesm2022/mtxColorpicker.mjs.map +1 -1
  152. package/fesm2022/mtxColumnResize.mjs +51 -49
  153. package/fesm2022/mtxColumnResize.mjs.map +1 -1
  154. package/fesm2022/mtxCore.mjs +36 -41
  155. package/fesm2022/mtxCore.mjs.map +1 -1
  156. package/fesm2022/mtxDatetimepicker.mjs +898 -905
  157. package/fesm2022/mtxDatetimepicker.mjs.map +1 -1
  158. package/fesm2022/mtxDialog.mjs +47 -25
  159. package/fesm2022/mtxDialog.mjs.map +1 -1
  160. package/fesm2022/mtxDrawer.mjs +20 -21
  161. package/fesm2022/mtxDrawer.mjs.map +1 -1
  162. package/fesm2022/mtxGrid.mjs +330 -229
  163. package/fesm2022/mtxGrid.mjs.map +1 -1
  164. package/fesm2022/mtxLoader.mjs +21 -36
  165. package/fesm2022/mtxLoader.mjs.map +1 -1
  166. package/fesm2022/mtxPhotoviewer.mjs +12 -12
  167. package/fesm2022/mtxPhotoviewer.mjs.map +1 -1
  168. package/fesm2022/mtxPopover.mjs +103 -165
  169. package/fesm2022/mtxPopover.mjs.map +1 -1
  170. package/fesm2022/mtxProgress.mjs +19 -32
  171. package/fesm2022/mtxProgress.mjs.map +1 -1
  172. package/fesm2022/mtxSelect.mjs +99 -93
  173. package/fesm2022/mtxSelect.mjs.map +1 -1
  174. package/fesm2022/mtxSplit.mjs +17 -18
  175. package/fesm2022/mtxSplit.mjs.map +1 -1
  176. package/fesm2022/mtxTooltip.mjs +128 -125
  177. package/fesm2022/mtxTooltip.mjs.map +1 -1
  178. package/grid/_grid-theme.scss +58 -29
  179. package/grid/cell.d.ts +1 -1
  180. package/grid/column-menu.d.ts +1 -1
  181. package/grid/column-resize/column-resize-directives/column-resize-flex.d.ts +1 -1
  182. package/grid/column-resize/column-resize-directives/column-resize.d.ts +1 -1
  183. package/grid/column-resize/column-resize-module.d.ts +7 -6
  184. package/grid/column-resize/index.d.ts +7 -0
  185. package/grid/column-resize/overlay-handle.d.ts +1 -1
  186. package/grid/column-resize/resizable-directives/resizable.d.ts +1 -1
  187. package/grid/expansion-toggle.d.ts +1 -1
  188. package/grid/grid-module.d.ts +25 -25
  189. package/grid/grid-pipes.d.ts +7 -7
  190. package/grid/grid.d.ts +57 -25
  191. package/grid/grid.scss +8 -1
  192. package/loader/_loader-theme.scss +55 -22
  193. package/loader/loader-module.d.ts +5 -5
  194. package/loader/loader.d.ts +5 -10
  195. package/loader/loader.scss +1 -1
  196. package/package.json +13 -19
  197. package/photoviewer/photoviewer-module.d.ts +1 -1
  198. package/photoviewer/photoviewer.d.ts +2 -1
  199. package/popover/_popover-theme.scss +55 -22
  200. package/popover/popover-content.d.ts +1 -1
  201. package/popover/popover-module.d.ts +8 -8
  202. package/popover/popover-target.d.ts +1 -1
  203. package/popover/popover-trigger.d.ts +1 -1
  204. package/popover/popover.d.ts +24 -55
  205. package/popover/popover.scss +1 -1
  206. package/prebuilt-themes/deeppurple-amber.css +1 -1
  207. package/prebuilt-themes/indigo-pink.css +1 -1
  208. package/prebuilt-themes/pink-bluegrey.css +1 -1
  209. package/prebuilt-themes/purple-green.css +1 -1
  210. package/progress/_progress-theme.scss +60 -22
  211. package/progress/progress-module.d.ts +3 -3
  212. package/progress/progress.d.ts +5 -10
  213. package/progress/progress.scss +3 -3
  214. package/select/_select-theme.scss +66 -34
  215. package/select/option.d.ts +3 -6
  216. package/select/select-module.d.ts +7 -7
  217. package/select/select.d.ts +2 -4
  218. package/select/select.scss +109 -109
  219. package/select/templates.d.ts +11 -11
  220. package/split/_split-theme.scss +62 -32
  221. package/split/split-module.d.ts +4 -4
  222. package/split/split-pane.d.ts +1 -1
  223. package/split/split.d.ts +1 -1
  224. package/split/split.scss +2 -4
  225. package/tooltip/_tooltip-theme.scss +66 -34
  226. package/tooltip/tooltip-module.d.ts +7 -7
  227. package/tooltip/tooltip.d.ts +30 -44
  228. package/tooltip/tooltip.scss +2 -4
  229. package/_theming.scss +0 -16
  230. package/alert/_alert-theme.import.scss +0 -2
  231. package/button/_button-theme.import.scss +0 -2
  232. package/colorpicker/_colorpicker-theme.import.scss +0 -2
  233. package/core/density/_compatibility.scss +0 -74
  234. package/core/mdc-helpers/_mdc-helpers.scss +0 -242
  235. package/core/style/_elevation.scss +0 -91
  236. package/core/style/_private.scss +0 -32
  237. package/core/style/_variables.scss +0 -44
  238. package/core/style/_vendor-prefixes.scss +0 -46
  239. package/core/theming/_palette.scss +0 -746
  240. package/core/theming/_theming.scss +0 -497
  241. package/core/typography/_typography-utils.scss +0 -101
  242. package/datetimepicker/_datetimepicker-theme.import.scss +0 -4
  243. package/drawer/_drawer-theme.import.scss +0 -2
  244. package/grid/_grid-theme.import.scss +0 -2
  245. package/loader/_loader-theme.import.scss +0 -2
  246. package/popover/_popover-theme.import.scss +0 -2
  247. package/progress/_progress-theme.import.scss +0 -2
  248. package/select/_select-density.scss +0 -68
  249. package/select/_select-theme.import.scss +0 -3
  250. package/split/_split-theme.import.scss +0 -2
  251. package/tooltip/_tooltip-theme.import.scss +0 -1
@@ -1,28 +1,17 @@
1
- @use '../theming/theming';
1
+ @use '@angular/material' as mat;
2
2
  @use '../theming/all-theme';
3
3
 
4
4
  // Includes all of the color styles.
5
- @mixin all-component-colors($config-or-theme) {
6
- // In case a theme object has been passed instead of a configuration for
7
- // the color system, extract the color config from the theme object.
8
- $config: if(
9
- theming.private-is-theme-object($config-or-theme),
10
- theming.get-color-config($config-or-theme),
11
- $config-or-theme
12
- );
13
-
14
- @if $config == null {
5
+ @mixin all-component-colors($theme) {
6
+ @if not mat.theme-has($theme, color) {
15
7
  @error 'No color configuration specified.';
16
8
  }
17
9
 
18
- @include all-theme.all-component-themes((
19
- color: $config,
20
- typography: null,
21
- density: null,
22
- ));
10
+ @include all-theme.all-component-themes(
11
+ mat.theme-remove($theme, base, typography, density));
23
12
  }
24
13
 
25
14
  // @deprecated Use `all-component-colors`.
26
- @mixin material-extensions-color($config-or-theme) {
27
- @include all-component-colors($config-or-theme);
15
+ @mixin material-extensions-color($theme) {
16
+ @include all-component-colors($theme);
28
17
  }
@@ -1,3 +1,5 @@
1
+ import { Provider } from '@angular/core';
2
+ import { MtxDatetimeFormats } from './datetime-formats';
1
3
  import * as i0 from "@angular/core";
2
4
  import * as i1 from "@angular/material/core";
3
5
  export declare class NativeDatetimeModule {
@@ -5,8 +7,9 @@ export declare class NativeDatetimeModule {
5
7
  static ɵmod: i0.ɵɵNgModuleDeclaration<NativeDatetimeModule, never, [typeof i1.NativeDateModule], never>;
6
8
  static ɵinj: i0.ɵɵInjectorDeclaration<NativeDatetimeModule>;
7
9
  }
10
+ export declare function provideNativeDatetimeAdapter(formats?: MtxDatetimeFormats): Provider[];
8
11
  export declare class MtxNativeDatetimeModule {
9
12
  static ɵfac: i0.ɵɵFactoryDeclaration<MtxNativeDatetimeModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<MtxNativeDatetimeModule, never, [typeof NativeDatetimeModule, typeof i1.MatNativeDateModule], never>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MtxNativeDatetimeModule, never, never, never>;
11
14
  static ɵinj: i0.ɵɵInjectorDeclaration<MtxNativeDatetimeModule>;
12
15
  }
@@ -1,4 +1,4 @@
1
- @use '../theming/theming';
1
+ @use '@angular/material' as mat;
2
2
  @use '../../alert/alert-theme';
3
3
  @use '../../button/button-theme';
4
4
  @use '../../colorpicker/colorpicker-theme';
@@ -13,34 +13,26 @@
13
13
  @use '../../tooltip/tooltip-theme';
14
14
 
15
15
  // Includes all of the density styles.
16
- @mixin all-component-densities($config-or-theme) {
17
- // In case a theme object has been passed instead of a configuration for
18
- // the color system, extract the color config from the theme object.
19
- $config: if(
20
- theming.private-is-theme-object($config-or-theme),
21
- theming.get-color-config($config-or-theme),
22
- $config-or-theme
23
- );
24
-
25
- @if $config == null {
16
+ @mixin all-component-densities($theme) {
17
+ @if not mat.theme-has($theme, density) {
26
18
  @error 'No density configuration specified.';
27
19
  }
28
20
 
29
- @include alert-theme.density($config);
30
- @include button-theme.density($config);
31
- @include colorpicker-theme.density($config);
32
- @include datetimepicker-theme.density($config);
33
- @include drawer-theme.density($config);
34
- @include grid-theme.density($config);
35
- @include loader-theme.density($config);
36
- @include popover-theme.density($config);
37
- @include progress-theme.density($config);
38
- @include select-theme.density($config);
39
- @include split-theme.density($config);
40
- @include tooltip-theme.density($config);
21
+ @include alert-theme.density($theme);
22
+ @include button-theme.density($theme);
23
+ @include colorpicker-theme.density($theme);
24
+ @include datetimepicker-theme.density($theme);
25
+ @include drawer-theme.density($theme);
26
+ @include grid-theme.density($theme);
27
+ @include loader-theme.density($theme);
28
+ @include popover-theme.density($theme);
29
+ @include progress-theme.density($theme);
30
+ @include select-theme.density($theme);
31
+ @include split-theme.density($theme);
32
+ @include tooltip-theme.density($theme);
41
33
  }
42
34
 
43
35
  // @deprecated Use `all-component-densities`.
44
- @mixin material-extensions-density($config-or-theme) {
45
- @include all-component-densities($config-or-theme);
36
+ @mixin material-extensions-density($theme) {
37
+ @include all-component-densities($theme);
46
38
  }
@@ -3,5 +3,5 @@ import * as i0 from "@angular/core";
3
3
  export declare class MtxIsTemplateRefPipe implements PipeTransform {
4
4
  transform(obj: any): boolean;
5
5
  static ɵfac: i0.ɵɵFactoryDeclaration<MtxIsTemplateRefPipe, never>;
6
- static ɵpipe: i0.ɵɵPipeDeclaration<MtxIsTemplateRefPipe, "isTemplateRef", false>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<MtxIsTemplateRefPipe, "isTemplateRef", true>;
7
7
  }
@@ -1,9 +1,9 @@
1
1
  import * as i0 from "@angular/core";
2
- import * as i1 from "./to-observable.pipe";
3
- import * as i2 from "./is-template-ref.pipe";
4
- import * as i3 from "@angular/common";
2
+ import * as i1 from "@angular/common";
3
+ import * as i2 from "./to-observable.pipe";
4
+ import * as i3 from "./is-template-ref.pipe";
5
5
  export declare class MtxPipesModule {
6
6
  static ɵfac: i0.ɵɵFactoryDeclaration<MtxPipesModule, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<MtxPipesModule, [typeof i1.MtxToObservablePipe, typeof i2.MtxIsTemplateRefPipe], [typeof i3.CommonModule], [typeof i1.MtxToObservablePipe, typeof i2.MtxIsTemplateRefPipe]>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MtxPipesModule, never, [typeof i1.CommonModule, typeof i2.MtxToObservablePipe, typeof i3.MtxIsTemplateRefPipe], [typeof i2.MtxToObservablePipe, typeof i3.MtxIsTemplateRefPipe]>;
8
8
  static ɵinj: i0.ɵɵInjectorDeclaration<MtxPipesModule>;
9
9
  }
@@ -4,5 +4,5 @@ import * as i0 from "@angular/core";
4
4
  export declare class MtxToObservablePipe implements PipeTransform {
5
5
  transform(value: Observable<any> | unknown): Observable<any>;
6
6
  static ɵfac: i0.ɵɵFactoryDeclaration<MtxToObservablePipe, never>;
7
- static ɵpipe: i0.ɵɵPipeDeclaration<MtxToObservablePipe, "toObservable", false>;
7
+ static ɵpipe: i0.ɵɵPipeDeclaration<MtxToObservablePipe, "toObservable", true>;
8
8
  }
@@ -1,3 +1,4 @@
1
+ @use 'sass:color';
1
2
  @use 'sass:map';
2
3
  @use 'sass:meta';
3
4
 
@@ -9,9 +10,14 @@
9
10
  /// @content Content to output under the current selector, or root selector if there is no current
10
11
  /// selector.
11
12
  @mixin current-selector-or-root($root: html) {
12
- @at-root #{& or $root} {
13
+ @if & {
13
14
  @content;
14
15
  }
16
+ @else {
17
+ #{$root} {
18
+ @content;
19
+ }
20
+ }
15
21
  }
16
22
 
17
23
  /// A version of the standard `map.merge` function that takes a variable number of arguments.
@@ -47,3 +53,9 @@
47
53
  @function coerce-to-list($value) {
48
54
  @return if(meta.type-of($value) != 'list', ($value,), $value);
49
55
  }
56
+
57
+ /// A version of the Sass `color.change` function that is safe ot use with CSS variables.
58
+ @function safe-color-change($color, $args...) {
59
+ $args: meta.keywords($args);
60
+ @return if(meta.type-of($color) == 'color', color.change($color, $args...), $color);
61
+ }
@@ -1,4 +1,5 @@
1
1
  // Import all the theming functionality.
2
+ @use '@angular/material' as mat;
2
3
  @use '../../alert/alert-theme';
3
4
  @use '../../button/button-theme';
4
5
  @use '../../colorpicker/colorpicker-theme';
@@ -11,28 +12,42 @@
11
12
  @use '../../select/select-theme';
12
13
  @use '../../split/split-theme';
13
14
  @use '../../tooltip/tooltip-theme';
14
- @use './theming';
15
15
 
16
16
  // Create a theme.
17
- @mixin all-component-themes($theme-or-color-config) {
17
+ @mixin all-component-themes($theme) {
18
18
  $dedupe-key: 'angular-material-extensions-theme';
19
- @include theming.private-check-duplicate-theme-styles($theme-or-color-config, $dedupe-key) {
20
- @include alert-theme.theme($theme-or-color-config);
21
- @include button-theme.theme($theme-or-color-config);
22
- @include colorpicker-theme.theme($theme-or-color-config);
23
- @include datetimepicker-theme.theme($theme-or-color-config);
24
- @include drawer-theme.theme($theme-or-color-config);
25
- @include grid-theme.theme($theme-or-color-config);
26
- @include loader-theme.theme($theme-or-color-config);
27
- @include popover-theme.theme($theme-or-color-config);
28
- @include progress-theme.theme($theme-or-color-config);
29
- @include select-theme.theme($theme-or-color-config);
30
- @include split-theme.theme($theme-or-color-config);
31
- @include tooltip-theme.theme($theme-or-color-config);
19
+ @include mat.private-check-duplicate-theme-styles($theme, $dedupe-key) {
20
+ @include alert-theme.theme($theme);
21
+ @include button-theme.theme($theme);
22
+ @include colorpicker-theme.theme($theme);
23
+ @include datetimepicker-theme.theme($theme);
24
+ @include drawer-theme.theme($theme);
25
+ @include grid-theme.theme($theme);
26
+ @include loader-theme.theme($theme);
27
+ @include popover-theme.theme($theme);
28
+ @include progress-theme.theme($theme);
29
+ @include select-theme.theme($theme);
30
+ @include split-theme.theme($theme);
31
+ @include tooltip-theme.theme($theme);
32
32
  }
33
33
  }
34
34
 
35
+ @mixin all-component-bases($theme) {
36
+ @include alert-theme.base($theme);
37
+ @include button-theme.base($theme);
38
+ @include colorpicker-theme.base($theme);
39
+ @include datetimepicker-theme.base($theme);
40
+ @include drawer-theme.base($theme);
41
+ @include grid-theme.base($theme);
42
+ @include loader-theme.base($theme);
43
+ @include popover-theme.base($theme);
44
+ @include progress-theme.base($theme);
45
+ @include select-theme.base($theme);
46
+ @include split-theme.base($theme);
47
+ @include tooltip-theme.base($theme);
48
+ }
49
+
35
50
  // @deprecated Use `all-component-themes`.
36
- @mixin material-extensions-theme($theme-or-color-config) {
37
- @include all-component-themes($theme-or-color-config);
51
+ @mixin material-extensions-theme($theme) {
52
+ @include all-component-themes($theme);
38
53
  }
@@ -3,11 +3,10 @@
3
3
  @use '@material/theme/custom-properties' as mdc-custom-properties;
4
4
  @use '@material/theme/theme' as mdc-theme;
5
5
  @use '@material/theme/keys' as mdc-keys;
6
- @use '../theming/palette';
7
- @use '../theming/theming';
6
+ @use '@angular/material' as mat;
8
7
  @use '../typography/typography';
9
8
 
10
- $_placeholder-color-palette: theming.define-palette(palette.$red-palette);
9
+ $_placeholder-color-palette: mat.define-palette(mat.$red-palette);
11
10
 
12
11
  // Placeholder color config that can be passed to token getter functions when generating token
13
12
  // slots.
@@ -16,8 +15,8 @@ $placeholder-color-config: (
16
15
  accent: $_placeholder-color-palette,
17
16
  warn: $_placeholder-color-palette,
18
17
  is-dark: false,
19
- foreground: palette.$light-theme-foreground-palette,
20
- background: palette.$light-theme-background-palette,
18
+ foreground: mat.$light-theme-foreground-palette,
19
+ background: mat.$light-theme-background-palette,
21
20
  );
22
21
 
23
22
  $_placeholder-typography-level-config: typography.typography-config-level-from-mdc(body1);
@@ -1,7 +1,4 @@
1
- @use 'sass:map';
2
- @use '../../../theming/theming';
3
- @use '../../../typography/typography-utils';
4
- @use '../../../mdc-helpers/mdc-helpers';
1
+ @use '@angular/material' as mat;
5
2
  @use '../../../style/sass-utils';
6
3
  @use '../../token-utils';
7
4
 
@@ -15,7 +12,8 @@ $prefix: (mdc, plain-tooltip);
15
12
  // `null` indicates that we are intentionally choosing not to emit a slot or value for the token in
16
13
  // our CSS.
17
14
  @function get-unthemable-tokens() {
18
- @return ( // Border radius for the tooltip container.
15
+ @return (
16
+ // Border radius for the tooltip container.
19
17
  container-shape: 4px,
20
18
  // Line height of the tooltip text.
21
19
  supporting-text-line-height: 16px,
@@ -25,48 +23,42 @@ $prefix: (mdc, plain-tooltip);
25
23
  }
26
24
 
27
25
  // Tokens that can be configured through Angular Material's color theming API.
28
- @function get-color-tokens($config) {
29
- $background: map.get($config, background);
26
+ @function get-color-tokens($theme) {
30
27
 
31
- @return ( // Color of the tooltip container.
32
- container-color: theming.get-color-from-palette($background, tooltip),
28
+ @return (
29
+ // Color of the tooltip container.
30
+ container-color: mat.get-theme-color($theme, background, tooltip),
33
31
  // Color of the tooltip text.
34
32
  supporting-text-color: #fff,
35
33
  );
36
34
  }
37
35
 
38
36
  // Tokens that can be configured through Angular Material's typography theming API.
39
- @function get-typography-tokens($config) {
40
-
41
- // TODO(amysorto): The earlier implementation of the tooltip used MDC's APIs to create the
42
- // typography tokens. As a result, we unintentionally allowed `null` typography configs to be
43
- // passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
44
- // fallback.
45
- @if ($config ==null) {
46
- $config: mdc-helpers.private-fallback-typography-from-mdc();
47
- }
48
-
49
- @return ( // Font for the tooltip text.
50
- supporting-text-font: typography-utils.font-family($config, caption) or typography-utils.font-family($config),
37
+ @function get-typography-tokens($theme) {
38
+ @return (
39
+ // Font for the tooltip text.
40
+ supporting-text-font: mat.get-theme-typography($theme, caption, font-family),
51
41
  // Font size for the tooltip text.
52
- supporting-text-size: typography-utils.font-size($config, caption),
42
+ supporting-text-size: mat.get-theme-typography($theme, caption, font-size),
53
43
  // Font weight of the tooltip text.
54
- supporting-text-weight: typography-utils.font-weight($config, caption),
44
+ supporting-text-weight: mat.get-theme-typography($theme, caption, font-weight),
55
45
  // Tracking (space between letters) of the tooltip text.
56
- supporting-text-tracking: typography-utils.letter-spacing($config, caption),
46
+ supporting-text-tracking: mat.get-theme-typography($theme, caption, letter-spacing),
57
47
  );
58
48
  }
59
49
 
60
50
  // Tokens that can be configured through Angular Material's density theming API.
61
- @function get-density-tokens($config) {
51
+ @function get-density-tokens($theme) {
62
52
  @return ();
63
53
  }
64
54
 
65
55
  // Combines the tokens generated by the above functions into a single map with placeholder values.
66
56
  // This is used to create token slots.
67
57
  @function get-token-slots() {
68
- @return sass-utils.deep-merge-all(get-unthemable-tokens(),
69
- get-color-tokens(token-utils.$placeholder-color-config),
70
- get-typography-tokens(token-utils.$placeholder-typography-config),
71
- get-density-tokens(token-utils.$placeholder-density-config));
58
+ @return sass-utils.deep-merge-all(
59
+ get-unthemable-tokens(),
60
+ get-color-tokens(token-utils.$placeholder-color-config),
61
+ get-typography-tokens(token-utils.$placeholder-typography-config),
62
+ get-density-tokens(token-utils.$placeholder-density-config)
63
+ );
72
64
  }
@@ -1,8 +1,7 @@
1
1
  @use 'sass:map';
2
+ @use '@angular/material' as mat;
2
3
  @use '../../token-utils';
3
- @use '../../../theming/theming';
4
4
  @use '../../../style/sass-utils';
5
- @use '../../../theming/palette';
6
5
 
7
6
  // The prefix used to generate the fully qualified name for tokens in this file.
8
7
  $prefix: (mtx, alert);
@@ -10,36 +9,36 @@ $prefix: (mtx, alert);
10
9
  // Tokens that can't be configured through Angular Material's current theming API,
11
10
  // but may be in a future version of the theming API.
12
11
  @function get-unthemable-tokens() {
13
- @return ();
12
+ @return (
13
+ container-shape: 4px,
14
+ );
14
15
  }
15
16
 
16
17
  // Tokens that can be configured through Angular Material's color theming API.
17
- @function get-color-tokens($config) {
18
- $foreground: map.get($config, foreground);
19
- $background: map.get($config, background);
20
- $is-dark-theme: map.get($config, is-dark);
18
+ @function get-color-tokens($theme) {
19
+ $is-dark: mat.get-theme-type($theme) == dark;
21
20
 
22
21
  @return (
23
- background-color: theming.get-color-from-palette($background, dialog),
24
- text-color: theming.get-color-from-palette($foreground, text),
25
- info-background-color: theming.get-color-from-palette(palette.$blue-palette, if($is-dark-theme, 900, 500)),
22
+ background-color: mat.get-theme-color($theme, background, dialog),
23
+ text-color: mat.get-theme-color($theme, foreground, text),
24
+ info-background-color: mat.get-color-from-palette(mat.$blue-palette, if($is-dark, 900, 500)),
26
25
  info-text-color: white,
27
- success-background-color: theming.get-color-from-palette(palette.$green-palette, if($is-dark-theme, 900, 500)),
26
+ success-background-color: mat.get-color-from-palette(mat.$green-palette, if($is-dark, 900, 500)),
28
27
  success-text-color: white,
29
- warning-background-color: theming.get-color-from-palette(palette.$orange-palette, if($is-dark-theme, 900, 500)),
28
+ warning-background-color: mat.get-color-from-palette(mat.$orange-palette, if($is-dark, 900, 500)),
30
29
  warning-text-color: white,
31
- danger-background-color: theming.get-color-from-palette(palette.$red-palette, if($is-dark-theme, 900, 500)),
30
+ danger-background-color: mat.get-color-from-palette(mat.$red-palette, if($is-dark, 900, 500)),
32
31
  danger-text-color: white,
33
32
  );
34
33
  }
35
34
 
36
35
  // Tokens that can be configured through Angular Material's typography theming API.
37
- @function get-typography-tokens($config) {
36
+ @function get-typography-tokens($theme) {
38
37
  @return ();
39
38
  }
40
39
 
41
40
  // Tokens that can be configured through Angular Material's density theming API.
42
- @function get-density-tokens($config) {
41
+ @function get-density-tokens($theme) {
43
42
  @return ();
44
43
  }
45
44
 
@@ -1,18 +1,16 @@
1
1
  @use 'sass:color';
2
2
  @use 'sass:map';
3
3
  @use 'sass:meta';
4
+ @use '@angular/material' as mat;
4
5
  @use '../../token-utils';
5
- @use '../../../theming/theming';
6
6
  @use '../../../style/sass-utils';
7
7
 
8
8
  // The prefix used to generate the fully qualified name for tokens in this file.
9
9
  $prefix: (mtx, colorpicker);
10
10
 
11
- @function private-get-toggle-color-palette-color-tokens($config, $palette-name) {
12
- $palette: map.get($config, $palette-name);
13
-
11
+ @function private-get-toggle-color-palette-color-tokens($theme, $palette-name) {
14
12
  @return (
15
- toggle-active-state-icon-color: theming.get-color-from-palette($palette, text),
13
+ toggle-active-state-icon-color: mat.get-theme-color($theme, $palette-name, text),
16
14
  );
17
15
  }
18
16
 
@@ -23,10 +21,9 @@ $prefix: (mtx, colorpicker);
23
21
  }
24
22
 
25
23
  // Tokens that can be configured through Angular Material's color theming API.
26
- @function get-color-tokens($config) {
27
- $foreground: map.get($config, foreground);
28
- $inactive-icon-color: theming.get-color-from-palette($foreground, icon);
29
- $toggle-tokens: private-get-toggle-color-palette-color-tokens($config, primary);
24
+ @function get-color-tokens($theme) {
25
+ $inactive-icon-color: mat.get-theme-color($theme, foreground, icon);
26
+ $toggle-tokens: private-get-toggle-color-palette-color-tokens($theme, primary);
30
27
 
31
28
  @return sass-utils.merge-all($toggle-tokens, (
32
29
  toggle-icon-color: $inactive-icon-color
@@ -34,12 +31,12 @@ $prefix: (mtx, colorpicker);
34
31
  }
35
32
 
36
33
  // Tokens that can be configured through Angular Material's typography theming API.
37
- @function get-typography-tokens($config) {
34
+ @function get-typography-tokens($theme) {
38
35
  @return ();
39
36
  }
40
37
 
41
38
  // Tokens that can be configured through Angular Material's density theming API.
42
- @function get-density-tokens($config) {
39
+ @function get-density-tokens($theme) {
43
40
  @return ();
44
41
  }
45
42
 
@@ -1,10 +1,9 @@
1
1
  @use 'sass:color';
2
2
  @use 'sass:map';
3
3
  @use 'sass:meta';
4
+ @use '@angular/material' as mat;
4
5
  @use '../../token-utils';
5
- @use '../../../theming/theming';
6
6
  @use '../../../style/sass-utils';
7
- @use '../../../typography/typography-utils';
8
7
 
9
8
  // The prefix used to generate the fully qualified name for tokens in this file.
10
9
  $prefix: (mtx, datetimepicker);
@@ -12,20 +11,17 @@ $prefix: (mtx, datetimepicker);
12
11
  $_selected-fade-amount: .6;
13
12
  $_today-fade-amount: .2;
14
13
 
15
- @function private-get-calendar-color-palette-color-tokens($config, $palette-name) {
16
- $foreground: map.get($config, foreground);
17
- $background: map.get($config, background);
18
- $palette: map.get($config, $palette-name);
19
- $palette-color: theming.get-color-from-palette($palette);
20
- $default-contrast: theming.get-color-from-palette($palette, default-contrast);
21
- $active-background-color: theming.get-color-from-palette($palette, .3);
14
+ @function private-get-calendar-color-palette-color-tokens($theme, $palette-name) {
15
+ $palette-color: mat.get-theme-color($theme, $palette-name);
16
+ $default-contrast: mat.get-theme-color($theme, $palette-name, default-contrast);
17
+ $active-background-color: sass-utils.safe-color-change($palette-color, $alpha: .3);
22
18
  $active-disabled-color: null;
23
19
 
24
20
  @if (meta.type-of($palette-color) == color) {
25
21
  $active-disabled-color: color.adjust($palette-color, $alpha: -$_selected-fade-amount);
26
22
  }
27
23
  @else {
28
- $active-disabled-color: theming.get-color-from-palette($foreground, disabled-button);
24
+ $active-disabled-color: mat.get-theme-color($theme, foreground, disabled-button);
29
25
  }
30
26
 
31
27
  @return (
@@ -42,45 +38,40 @@ $_today-fade-amount: .2;
42
38
  clock-cell-selected-state-background-color: $palette-color,
43
39
 
44
40
  time-input-active-state-text-color: $palette-color,
45
- time-input-active-state-background-color: theming.get-color-from-palette($palette, .2),
41
+ time-input-active-state-background-color: sass-utils.safe-color-change($palette-color, $alpha: .2),
46
42
  time-input-focus-state-border-color: $palette-color,
47
- time-input-focus-state-placeholder-text-color: theming.get-color-from-palette($palette, .6),
43
+ time-input-focus-state-placeholder-text-color: sass-utils.safe-color-change($palette-color, $alpha: .6),
48
44
  );
49
45
  }
50
46
 
51
- @function private-get-toggle-color-palette-color-tokens($config, $palette-name) {
52
- $palette: map.get($config, $palette-name);
53
-
47
+ @function private-get-toggle-color-palette-color-tokens($theme, $palette-name) {
54
48
  @return (
55
- toggle-active-state-icon-color: theming.get-color-from-palette($palette, text),
49
+ toggle-active-state-icon-color: mat.get-theme-color($theme, $palette-name, text),
56
50
  );
57
51
  }
58
52
 
59
53
  // Tokens that can't be configured through Angular Material's current theming API,
60
54
  // but may be in a future version of the theming API.
61
55
  @function get-unthemable-tokens() {
62
- @return ();
56
+ @return (
57
+ container-shape: 4px,
58
+ );
63
59
  }
64
60
 
65
61
  // Tokens that can be configured through Angular Material's color theming API.
66
- @function get-color-tokens($config) {
67
- $foreground: map.get($config, foreground);
68
- $background: map.get($config, background);
69
- $primary: map.get($config, primary);
70
- $accent: map.get($config, accent);
71
- $warn: map.get($config, warn);
72
- $inactive-icon-color: theming.get-color-from-palette($foreground, icon);
73
- $text-color: theming.get-color-from-palette($foreground, text);
74
- $secondary-text-color: theming.get-color-from-palette($foreground, secondary-text);
75
- $disabled-text-color: theming.get-color-from-palette($foreground, disabled-text);
76
- $divider-color: theming.get-color-from-palette($foreground, divider);
77
- $hint-text-color: theming.get-color-from-palette($foreground, hint-text);
62
+ @function get-color-tokens($theme) {
63
+ $inactive-icon-color: mat.get-theme-color($theme, foreground, icon);
64
+ $text-color: mat.get-theme-color($theme, foreground, text);
65
+ $secondary-text-color: mat.get-theme-color($theme, foreground, secondary-text);
66
+ $disabled-text-color: mat.get-theme-color($theme, foreground, disabled-text);
67
+ $divider-color: mat.get-theme-color($theme, foreground, divider);
68
+ $hint-text-color: mat.get-theme-color($theme, foreground, hint-text);
78
69
  $preview-outline-color: $divider-color;
79
70
  $today-disabled-outline-color: null;
80
71
 
81
- $primary-color: theming.get-color-from-palette(map.get($config, primary));
82
- $calendar-tokens: private-get-calendar-color-palette-color-tokens($config, primary);
83
- $toggle-tokens: private-get-toggle-color-palette-color-tokens($config, primary);
72
+ $primary-color: mat.get-theme-color($theme, primary);
73
+ $calendar-tokens: private-get-calendar-color-palette-color-tokens($theme, primary);
74
+ $toggle-tokens: private-get-toggle-color-palette-color-tokens($theme, primary);
84
75
 
85
76
  @return sass-utils.merge-all($calendar-tokens, $toggle-tokens, (
86
77
  toggle-icon-color: $inactive-icon-color,
@@ -100,46 +91,46 @@ $_today-fade-amount: .2;
100
91
  calendar-date-disabled-state-text-color: $disabled-text-color,
101
92
  // calendar-date-preview-state-outline-color: $preview-outline-color,
102
93
 
103
- calendar-container-background-color: theming.get-color-from-palette($background, card),
94
+ calendar-container-background-color: mat.get-theme-color($theme, background, card),
104
95
  calendar-container-text-color: $text-color,
105
96
 
106
97
  clock-dial-background-color: $divider-color,
107
98
  clock-cell-text-color: $text-color,
108
- clock-cell-hover-state-background-color: theming.get-color-from-palette($background, hover),
99
+ clock-cell-hover-state-background-color: mat.get-theme-color($theme, background, hover),
109
100
  clock-cell-disabled-state-text-color: $disabled-text-color,
110
101
 
111
102
  time-input-text-color: $text-color,
112
103
  time-input-background-color: $divider-color,
113
- time-input-focus-state-background-color: theming.get-color-from-palette($background, background),
114
- time-input-warn-state-border-color: theming.get-color-from-palette($warn),
115
- time-ampm-text-color: theming.get-color-from-palette($foreground, text, .75),
104
+ time-input-focus-state-background-color: mat.get-theme-color($theme, background, background),
105
+ time-input-warn-state-border-color: mat.get-theme-color($theme, warn),
106
+ time-ampm-text-color: sass-utils.safe-color-change($text-color, $alpha: .75),
116
107
  time-ampm-border-color: $hint-text-color,
117
- time-ampm-selected-state-text-color: theming.get-color-from-palette($foreground, text),
118
- time-ampm-selected-state-background-color: theming.get-color-from-palette($accent, .2),
108
+ time-ampm-selected-state-text-color: $text-color,
109
+ time-ampm-selected-state-background-color: mat.get-theme-color($theme, accent, .2),
119
110
  ));
120
111
  }
121
112
 
122
113
  // Tokens that can be configured through Angular Material's typography theming API.
123
- @function get-typography-tokens($config) {
114
+ @function get-typography-tokens($theme) {
124
115
  @return (
125
- calendar-text-font: typography-utils.font-family($config),
116
+ calendar-text-font: mat.get-theme-typography($theme, body-1, font-family),
126
117
  calendar-text-size: 13px,
127
118
 
128
- calendar-body-label-text-size: typography-utils.font-size($config, button),
129
- calendar-body-label-text-weight: typography-utils.font-weight($config, button),
119
+ calendar-body-label-text-size: mat.get-theme-typography($theme, button, font-size),
120
+ calendar-body-label-text-weight: mat.get-theme-typography($theme, button, font-weight),
130
121
 
131
- calendar-period-button-text-size: typography-utils.font-size($config, button),
132
- calendar-period-button-text-weight: typography-utils.font-weight($config, button),
122
+ calendar-period-button-text-size: mat.get-theme-typography($theme, button, font-size),
123
+ calendar-period-button-text-weight: mat.get-theme-typography($theme, button, font-weight),
133
124
 
134
125
  calendar-table-header-text-size: 11px,
135
- calendar-table-header-text-weight: typography-utils.font-weight($config, body-1),
126
+ calendar-table-header-text-weight: mat.get-theme-typography($theme, body-1, font-weight),
136
127
 
137
128
  clock-text-size: 14px,
138
129
  );
139
130
  }
140
131
 
141
132
  // Tokens that can be configured through Angular Material's density theming API.
142
- @function get-density-tokens($config) {
133
+ @function get-density-tokens($theme) {
143
134
  @return ();
144
135
  }
145
136