@ng-matero/extensions 19.4.0 → 20.0.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 (282) hide show
  1. package/_index.scss +1 -1
  2. package/alert/_alert-theme.scss +26 -31
  3. package/alert/_m2-alert.scss +59 -0
  4. package/alert/_m3-alert.scss +41 -0
  5. package/alert/alert.scss +27 -31
  6. package/alert/index.d.ts +30 -5
  7. package/button/index.d.ts +31 -5
  8. package/checkbox-group/index.d.ts +117 -5
  9. package/colorpicker/_colorpicker-theme.scss +31 -36
  10. package/{core/tokens/m2/mtx/_colorpicker.scss → colorpicker/_m2-colorpicker.scss} +6 -10
  11. package/colorpicker/_m3-colorpicker.scss +23 -0
  12. package/colorpicker/colorpicker-toggle.scss +4 -9
  13. package/colorpicker/index.d.ts +285 -3
  14. package/column-resize/index.d.ts +456 -3
  15. package/core/index.d.ts +147 -5
  16. package/core/theming/_color-api-backwards-compatibility.scss +8 -15
  17. package/core/theming/_definition.scss +81 -75
  18. package/core/theming/_palettes.scss +1036 -0
  19. package/core/tokens/{m2/_index.scss → _m2-tokens.scss} +22 -22
  20. package/core/tokens/_m2-utils.scss +108 -0
  21. package/core/tokens/_m3-system.scss +128 -106
  22. package/core/tokens/_m3-tokens.scss +36 -282
  23. package/core/tokens/_m3-utils.scss +48 -0
  24. package/core/tokens/_token-utils.scss +67 -239
  25. package/core/tokens/m3/_index.scss +7 -0
  26. package/core/tokens/m3/_md-sys-color.scss +156 -0
  27. package/core/tokens/m3/_md-sys-elevation.scss +15 -0
  28. package/core/tokens/m3/_md-sys-motion.scss +35 -0
  29. package/core/tokens/m3/_md-sys-shape.scss +21 -0
  30. package/core/tokens/m3/_md-sys-state.scss +13 -0
  31. package/core/tokens/m3/_md-sys-typescale.scss +128 -0
  32. package/core/tokens/m3/_theme.scss +47 -0
  33. package/datetimepicker/_datetimepicker-theme.scss +29 -39
  34. package/datetimepicker/_m2-datetimepicker.scss +149 -0
  35. package/datetimepicker/_m3-datetimepicker.scss +81 -0
  36. package/datetimepicker/calendar-body.scss +31 -56
  37. package/datetimepicker/calendar.scss +43 -79
  38. package/datetimepicker/clock.scss +28 -47
  39. package/datetimepicker/datetimepicker-content.scss +9 -15
  40. package/datetimepicker/datetimepicker-toggle.scss +4 -9
  41. package/datetimepicker/index.d.ts +1208 -3
  42. package/datetimepicker/time-view.scss +26 -32
  43. package/dialog/index.d.ts +54 -5
  44. package/drawer/_drawer-theme.scss +25 -30
  45. package/{core/tokens/m2/mtx/_drawer.scss → drawer/_m2-drawer.scss} +9 -12
  46. package/drawer/_m3-drawer.scss +24 -0
  47. package/drawer/drawer-container.scss +13 -24
  48. package/drawer/index.d.ts +221 -3
  49. package/fesm2022/mtxAlert.mjs +7 -7
  50. package/fesm2022/mtxAlert.mjs.map +1 -1
  51. package/fesm2022/mtxButton.mjs +7 -7
  52. package/fesm2022/mtxCheckboxGroup.mjs +7 -7
  53. package/fesm2022/mtxColorpicker.mjs +21 -21
  54. package/fesm2022/mtxColorpicker.mjs.map +1 -1
  55. package/fesm2022/mtxColumnResize.mjs +232 -103
  56. package/fesm2022/mtxColumnResize.mjs.map +1 -1
  57. package/fesm2022/mtxCore.mjs +21 -21
  58. package/fesm2022/mtxDatetimepicker.mjs +63 -63
  59. package/fesm2022/mtxDatetimepicker.mjs.map +1 -1
  60. package/fesm2022/mtxDialog.mjs +10 -10
  61. package/fesm2022/mtxDialog.mjs.map +1 -1
  62. package/fesm2022/mtxDrawer.mjs +10 -10
  63. package/fesm2022/mtxGrid.mjs +78 -77
  64. package/fesm2022/mtxGrid.mjs.map +1 -1
  65. package/fesm2022/mtxLoader.mjs +7 -7
  66. package/fesm2022/mtxPhotoviewer.mjs +7 -7
  67. package/fesm2022/mtxPopover.mjs +24 -25
  68. package/fesm2022/mtxPopover.mjs.map +1 -1
  69. package/fesm2022/mtxProgress.mjs +7 -7
  70. package/fesm2022/mtxSelect.mjs +54 -54
  71. package/fesm2022/mtxSelect.mjs.map +1 -1
  72. package/fesm2022/mtxSplit.mjs +10 -10
  73. package/fesm2022/mtxTooltip.mjs +13 -13
  74. package/fesm2022/mtxTooltip.mjs.map +1 -1
  75. package/grid/_grid-theme.scss +22 -35
  76. package/grid/_m2-grid.scss +66 -0
  77. package/grid/_m3-grid.scss +35 -0
  78. package/grid/column-menu.scss +6 -23
  79. package/grid/column-resize/_column-resize.scss +35 -30
  80. package/grid/grid.scss +41 -73
  81. package/grid/index.d.ts +799 -3
  82. package/index.d.ts +2 -5
  83. package/loader/_loader-theme.scss +26 -31
  84. package/{core/tokens/m2/mtx/_loader.scss → loader/_m2-loader.scss} +5 -10
  85. package/loader/_m3-loader.scss +20 -0
  86. package/loader/index.d.ts +43 -5
  87. package/loader/loader.scss +4 -5
  88. package/package.json +29 -29
  89. package/photoviewer/index.d.ts +26 -5
  90. package/{core/tokens/m2/mtx/_popover.scss → popover/_m2-popover.scss} +9 -12
  91. package/popover/_m3-popover.scss +26 -0
  92. package/popover/_popover-theme.scss +26 -31
  93. package/popover/index.d.ts +399 -3
  94. package/popover/popover.scss +23 -29
  95. package/prebuilt-themes/azure-blue.css +1 -1
  96. package/prebuilt-themes/cyan-orange.css +1 -1
  97. package/prebuilt-themes/deeppurple-amber.css +1 -1
  98. package/prebuilt-themes/indigo-pink.css +1 -1
  99. package/prebuilt-themes/magenta-violet.css +1 -1
  100. package/prebuilt-themes/pink-bluegrey.css +1 -1
  101. package/prebuilt-themes/purple-green.css +1 -1
  102. package/prebuilt-themes/rose-red.css +1 -1
  103. package/progress/_m2-progress.scss +53 -0
  104. package/progress/_m3-progress.scss +33 -0
  105. package/progress/_progress-theme.scss +22 -34
  106. package/progress/index.d.ts +35 -5
  107. package/progress/progress.scss +28 -43
  108. package/select/_m2-select.scss +79 -0
  109. package/select/_m3-select.scss +46 -0
  110. package/select/_select-theme.scss +27 -37
  111. package/select/index.d.ts +381 -3
  112. package/select/select.scss +189 -205
  113. package/{core/tokens/m2/mtx/_split.scss → split/_m2-split.scss} +6 -9
  114. package/split/_m3-split.scss +23 -0
  115. package/split/_split-theme.scss +31 -34
  116. package/split/index.d.ts +255 -3
  117. package/split/split.scss +8 -11
  118. package/tooltip/_m2-tooltip.scss +50 -0
  119. package/tooltip/_m3-tooltip.scss +28 -0
  120. package/tooltip/_tooltip-theme.scss +23 -47
  121. package/tooltip/index.d.ts +345 -3
  122. package/tooltip/tooltip.scss +11 -15
  123. package/alert/alert-module.d.ts +0 -8
  124. package/alert/alert.d.ts +0 -19
  125. package/alert/public-api.d.ts +0 -2
  126. package/button/button-loading.d.ts +0 -19
  127. package/button/button-module.d.ts +0 -10
  128. package/button/public-api.d.ts +0 -2
  129. package/checkbox-group/checkbox-group-module.d.ts +0 -11
  130. package/checkbox-group/checkbox-group.d.ts +0 -86
  131. package/checkbox-group/interfaces.d.ts +0 -17
  132. package/checkbox-group/public-api.d.ts +0 -3
  133. package/colorpicker/colorpicker-animations.d.ts +0 -9
  134. package/colorpicker/colorpicker-input.d.ts +0 -88
  135. package/colorpicker/colorpicker-module.d.ts +0 -15
  136. package/colorpicker/colorpicker-toggle.d.ts +0 -39
  137. package/colorpicker/colorpicker.d.ts +0 -140
  138. package/colorpicker/public-api.d.ts +0 -5
  139. package/column-resize/column-resize-directives/column-resize-flex.d.ts +0 -29
  140. package/column-resize/column-resize-directives/column-resize.d.ts +0 -29
  141. package/column-resize/column-resize-directives/constants.d.ts +0 -10
  142. package/column-resize/column-resize-module.d.ts +0 -12
  143. package/column-resize/column-resize-notifier.d.ts +0 -48
  144. package/column-resize/column-resize.d.ts +0 -39
  145. package/column-resize/column-size-store.d.ts +0 -12
  146. package/column-resize/event-dispatcher.d.ts +0 -35
  147. package/column-resize/overlay-handle.d.ts +0 -43
  148. package/column-resize/polyfill.d.ts +0 -9
  149. package/column-resize/public-api.d.ts +0 -12
  150. package/column-resize/resizable.d.ts +0 -63
  151. package/column-resize/resize-ref.d.ts +0 -17
  152. package/column-resize/resize-strategy.d.ts +0 -84
  153. package/column-resize/selectors.d.ts +0 -10
  154. package/core/datetime/datetime-adapter.d.ts +0 -45
  155. package/core/datetime/datetime-formats.d.ts +0 -22
  156. package/core/datetime/datetime.module.d.ts +0 -15
  157. package/core/datetime/index.d.ts +0 -5
  158. package/core/datetime/native-datetime-adapter.d.ts +0 -40
  159. package/core/datetime/native-datetime-formats.d.ts +0 -2
  160. package/core/pipes/index.d.ts +0 -3
  161. package/core/pipes/is-template-ref.pipe.d.ts +0 -7
  162. package/core/pipes/pipes.module.d.ts +0 -9
  163. package/core/pipes/to-observable.pipe.d.ts +0 -8
  164. package/core/public-api.d.ts +0 -2
  165. package/core/theming/_inspection.scss +0 -38
  166. package/core/theming/_validation.scss +0 -5
  167. package/core/tokens/_density.scss +0 -49
  168. package/core/tokens/_format-tokens.scss +0 -5
  169. package/core/tokens/_token-definition.scss +0 -271
  170. package/core/tokens/m2/mdc/_plain-tooltip.scss +0 -63
  171. package/core/tokens/m2/mtx/_alert.scss +0 -62
  172. package/core/tokens/m2/mtx/_datetimepicker.scss +0 -152
  173. package/core/tokens/m2/mtx/_grid.scss +0 -69
  174. package/core/tokens/m2/mtx/_progress.scss +0 -56
  175. package/core/tokens/m2/mtx/_select.scss +0 -82
  176. package/core/tokens/m3/definitions/_index.scss +0 -9
  177. package/core/tokens/m3/definitions/_md-comp-plain-tooltip.scss +0 -51
  178. package/core/tokens/m3/definitions/_md-ref-palette.scss +0 -100
  179. package/core/tokens/m3/definitions/_md-ref-typeface.scss +0 -14
  180. package/core/tokens/m3/definitions/_md-sys-color.scss +0 -126
  181. package/core/tokens/m3/definitions/_md-sys-elevation.scss +0 -15
  182. package/core/tokens/m3/definitions/_md-sys-motion.scss +0 -46
  183. package/core/tokens/m3/definitions/_md-sys-shape.scss +0 -24
  184. package/core/tokens/m3/definitions/_md-sys-state.scss +0 -13
  185. package/core/tokens/m3/definitions/_md-sys-typescale.scss +0 -308
  186. package/core/tokens/m3/index.scss +0 -47
  187. package/core/tokens/m3/mdc/_plain-tooltip.scss +0 -15
  188. package/core/tokens/m3/mtx/_alert.scss +0 -41
  189. package/core/tokens/m3/mtx/_colorpicker.scss +0 -19
  190. package/core/tokens/m3/mtx/_datetimepicker.scss +0 -140
  191. package/core/tokens/m3/mtx/_drawer.scss +0 -22
  192. package/core/tokens/m3/mtx/_grid.scss +0 -32
  193. package/core/tokens/m3/mtx/_loader.scss +0 -22
  194. package/core/tokens/m3/mtx/_popover.scss +0 -25
  195. package/core/tokens/m3/mtx/_progress.scss +0 -32
  196. package/core/tokens/m3/mtx/_select.scss +0 -76
  197. package/core/tokens/m3/mtx/_split.scss +0 -30
  198. package/datetimepicker/calendar-body.d.ts +0 -66
  199. package/datetimepicker/calendar.d.ts +0 -157
  200. package/datetimepicker/clock.d.ts +0 -101
  201. package/datetimepicker/datetimepicker-actions.d.ts +0 -36
  202. package/datetimepicker/datetimepicker-animations.d.ts +0 -11
  203. package/datetimepicker/datetimepicker-errors.d.ts +0 -2
  204. package/datetimepicker/datetimepicker-filtertype.d.ts +0 -5
  205. package/datetimepicker/datetimepicker-input.d.ts +0 -105
  206. package/datetimepicker/datetimepicker-intl.d.ts +0 -53
  207. package/datetimepicker/datetimepicker-module.d.ts +0 -22
  208. package/datetimepicker/datetimepicker-toggle.d.ts +0 -42
  209. package/datetimepicker/datetimepicker-types.d.ts +0 -6
  210. package/datetimepicker/datetimepicker.d.ts +0 -274
  211. package/datetimepicker/month-view.d.ts +0 -80
  212. package/datetimepicker/multi-year-view.d.ts +0 -86
  213. package/datetimepicker/public-api.d.ts +0 -16
  214. package/datetimepicker/time-view.d.ts +0 -147
  215. package/datetimepicker/year-view.d.ts +0 -68
  216. package/dialog/dialog-config.d.ts +0 -17
  217. package/dialog/dialog-container.d.ts +0 -11
  218. package/dialog/dialog-module.d.ts +0 -12
  219. package/dialog/dialog.d.ts +0 -15
  220. package/dialog/public-api.d.ts +0 -4
  221. package/drawer/drawer-animations.d.ts +0 -8
  222. package/drawer/drawer-config.d.ts +0 -63
  223. package/drawer/drawer-container.d.ts +0 -35
  224. package/drawer/drawer-module.d.ts +0 -10
  225. package/drawer/drawer-ref.d.ts +0 -53
  226. package/drawer/drawer.d.ts +0 -59
  227. package/drawer/public-api.d.ts +0 -6
  228. package/grid/cell.d.ts +0 -32
  229. package/grid/column-menu.d.ts +0 -39
  230. package/grid/column-resize/column-resize-directives/column-resize-flex.d.ts +0 -24
  231. package/grid/column-resize/column-resize-directives/column-resize.d.ts +0 -24
  232. package/grid/column-resize/column-resize-directives/common.d.ts +0 -13
  233. package/grid/column-resize/column-resize-module.d.ts +0 -17
  234. package/grid/column-resize/index.d.ts +0 -7
  235. package/grid/column-resize/overlay-handle.d.ts +0 -32
  236. package/grid/column-resize/resizable-directives/common.d.ts +0 -19
  237. package/grid/column-resize/resizable-directives/resizable.d.ts +0 -32
  238. package/grid/column-resize/resize-strategy.d.ts +0 -20
  239. package/grid/expansion-toggle.d.ts +0 -17
  240. package/grid/grid-module.d.ts +0 -31
  241. package/grid/grid-pipes.d.ts +0 -39
  242. package/grid/grid-utils.d.ts +0 -33
  243. package/grid/grid.d.ts +0 -268
  244. package/grid/interfaces.d.ts +0 -180
  245. package/grid/public-api.d.ts +0 -17
  246. package/grid/selectable-cell.d.ts +0 -16
  247. package/loader/loader-module.d.ts +0 -10
  248. package/loader/loader.d.ts +0 -30
  249. package/loader/public-api.d.ts +0 -2
  250. package/photoviewer/photoviewer-module.d.ts +0 -7
  251. package/photoviewer/photoviewer.d.ts +0 -17
  252. package/photoviewer/public-api.d.ts +0 -2
  253. package/popover/popover-animations.d.ts +0 -11
  254. package/popover/popover-content.d.ts +0 -43
  255. package/popover/popover-errors.d.ts +0 -14
  256. package/popover/popover-interfaces.d.ts +0 -50
  257. package/popover/popover-module.d.ts +0 -13
  258. package/popover/popover-target.d.ts +0 -7
  259. package/popover/popover-trigger.d.ts +0 -132
  260. package/popover/popover-types.d.ts +0 -10
  261. package/popover/popover.d.ts +0 -147
  262. package/popover/public-api.d.ts +0 -8
  263. package/progress/progress-module.d.ts +0 -8
  264. package/progress/progress.d.ts +0 -24
  265. package/progress/public-api.d.ts +0 -2
  266. package/public-api.d.ts +0 -2
  267. package/select/option.d.ts +0 -21
  268. package/select/public-api.d.ts +0 -5
  269. package/select/select-intl.d.ts +0 -18
  270. package/select/select-module.d.ts +0 -12
  271. package/select/select.d.ts +0 -270
  272. package/select/templates.d.ts +0 -67
  273. package/split/interfaces.d.ts +0 -52
  274. package/split/public-api.d.ts +0 -5
  275. package/split/split-module.d.ts +0 -9
  276. package/split/split-pane.d.ts +0 -53
  277. package/split/split.d.ts +0 -133
  278. package/split/utils.d.ts +0 -13
  279. package/tooltip/public-api.d.ts +0 -3
  280. package/tooltip/tooltip-animations.d.ts +0 -9
  281. package/tooltip/tooltip-module.d.ts +0 -13
  282. package/tooltip/tooltip.d.ts +0 -321
@@ -1,23 +1,22 @@
1
1
  @use '../core/tokens/token-utils';
2
- @use '../core/tokens/m2/mtx/progress' as tokens-mtx-progress;
2
+ @use './m3-progress';
3
+
4
+ $fallbacks: m3-progress.get-tokens();
3
5
 
4
6
  $progress-height: 16px !default;
5
7
  $progress-fill-animation-timing: 1s linear infinite !default;
6
8
 
7
- $_tokens: tokens-mtx-progress.$prefix, tokens-mtx-progress.get-token-slots();
8
-
9
- @mixin gradient-striped($color: rgba(white, .15), $angle: 45deg) {
10
- background-image:
11
- linear-gradient(
12
- $angle,
13
- $color 25%,
14
- transparent 25%,
15
- transparent 50%,
16
- $color 50%,
17
- $color 75%,
18
- transparent 75%,
19
- transparent
20
- );
9
+ @mixin gradient-striped($color: rgba(white, 0.15), $angle: 45deg) {
10
+ background-image: linear-gradient(
11
+ $angle,
12
+ $color 25%,
13
+ transparent 25%,
14
+ transparent 50%,
15
+ $color 50%,
16
+ $color 75%,
17
+ transparent 75%,
18
+ transparent
19
+ );
21
20
  }
22
21
 
23
22
  .mtx-progress {
@@ -25,12 +24,9 @@ $_tokens: tokens-mtx-progress.$prefix, tokens-mtx-progress.get-token-slots();
25
24
  height: $progress-height;
26
25
  margin: 8px 0;
27
26
  overflow: hidden;
28
-
29
- @include token-utils.use-tokens($_tokens...) {
30
- @include token-utils.create-token-slot(font-size, text-size);
31
- @include token-utils.create-token-slot(border-radius, container-shape);
32
- @include token-utils.create-token-slot(background-color, track-color);
33
- }
27
+ font-size: token-utils.slot(progress-text-size, $fallbacks);
28
+ border-radius: token-utils.slot(progress-container-shape, $fallbacks);
29
+ background-color: token-utils.slot(progress-track-color, $fallbacks);
34
30
  }
35
31
 
36
32
  .mtx-progress-fill {
@@ -38,40 +34,29 @@ $_tokens: tokens-mtx-progress.$prefix, tokens-mtx-progress.get-token-slots();
38
34
  flex-direction: column;
39
35
  justify-content: center;
40
36
  text-align: center;
41
- transition: width .6s ease;
42
-
43
- @include token-utils.use-tokens($_tokens...) {
44
- @include token-utils.create-token-slot(background-color, indicator-color);
45
- @include token-utils.create-token-slot(color, text-color);
46
- }
37
+ transition: width 0.6s ease;
38
+ background-color: token-utils.slot(progress-indicator-color, $fallbacks);
39
+ color: token-utils.slot(progress-text-color, $fallbacks);
47
40
  }
48
41
 
49
42
  .mtx-progress-fill-info {
50
- @include token-utils.use-tokens($_tokens...) {
51
- @include token-utils.create-token-slot(background-color, info-indicator-color);
52
- @include token-utils.create-token-slot(color, info-text-color);
53
- }
43
+ background-color: token-utils.slot(progress-info-indicator-color, $fallbacks);
44
+ color: token-utils.slot(progress-info-text-color, $fallbacks);
54
45
  }
55
46
 
56
47
  .mtx-progress-fill-success {
57
- @include token-utils.use-tokens($_tokens...) {
58
- @include token-utils.create-token-slot(background-color, success-indicator-color);
59
- @include token-utils.create-token-slot(color, success-text-color);
60
- }
48
+ background-color: token-utils.slot(progress-success-indicator-color, $fallbacks);
49
+ color: token-utils.slot(progress-success-text-color, $fallbacks);
61
50
  }
62
51
 
63
52
  .mtx-progress-fill-warning {
64
- @include token-utils.use-tokens($_tokens...) {
65
- @include token-utils.create-token-slot(background-color, warning-indicator-color);
66
- @include token-utils.create-token-slot(color, warning-text-color);
67
- }
53
+ background-color: token-utils.slot(progress-warning-indicator-color, $fallbacks);
54
+ color: token-utils.slot(progress-warning-text-color, $fallbacks);
68
55
  }
69
56
 
70
57
  .mtx-progress-fill-danger {
71
- @include token-utils.use-tokens($_tokens...) {
72
- @include token-utils.create-token-slot(background-color, danger-indicator-color);
73
- @include token-utils.create-token-slot(color, danger-text-color);
74
- }
58
+ background-color: token-utils.slot(progress-danger-indicator-color, $fallbacks);
59
+ color: token-utils.slot(progress-danger-text-color, $fallbacks);
75
60
  }
76
61
 
77
62
  .mtx-progress-fill-striped {
@@ -0,0 +1,79 @@
1
+ @use 'sass:map';
2
+ @use 'sass:math';
3
+ @use '@angular/material' as mat;
4
+ @use '../core/tokens/m2-utils';
5
+ @use '../core/style/elevation';
6
+
7
+ // Generates the tokens used to theme the option based on a palette.
8
+ @function private-get-color-palette-color-tokens($theme, $palette-name) {
9
+ @return (
10
+ select-option-selected-state-text-color: mat.get-theme-color($theme, $palette-name),
11
+ );
12
+ }
13
+
14
+ // Tokens that can't be configured through Angular Material's current theming API,
15
+ // but may be in a future version of the theming API.
16
+ @function get-unthemable-tokens() {
17
+ @return (
18
+ select-container-shape: 4px,
19
+ select-container-elevation-shadow: elevation.get-box-shadow(8),
20
+ );
21
+ }
22
+
23
+ // Tokens that can be configured through Angular Material's color theming API.
24
+ @function get-color-tokens($theme) {
25
+ $text-color: mat.get-theme-color($theme, foreground, text);
26
+ $hint-text-color: mat.get-theme-color($theme, foreground, hint-text);
27
+ $secondary-text-color: mat.get-theme-color($theme, foreground, secondary-text);
28
+ $disabled-text-color: mat.get-theme-color($theme, foreground, disabled-text);
29
+ $divider-color: mat.get-theme-color($theme, foreground, divider);
30
+ $hover-color: mat.get-theme-color($theme, background, hover);
31
+ $palette-tokens: private-get-color-palette-color-tokens($theme, primary);
32
+
33
+ @return map.merge($palette-tokens, (
34
+ select-container-text-color: $text-color,
35
+ select-placeholder-text-color: $hint-text-color,
36
+ select-disabled-text-color: $hint-text-color,
37
+
38
+ select-multiple-value-background-color: mat.get-theme-color($theme, background, unselected-chip),
39
+ select-multiple-value-outline-color: $divider-color,
40
+ select-multiple-value-disabled-outline-color: mat.get-theme-color($theme, foreground, divider, 0.06),
41
+ select-multiple-value-icon-hover-background-color: $divider-color,
42
+
43
+ select-clear-icon-color: $secondary-text-color,
44
+ select-clear-icon-hover-color: mat.get-theme-color($theme, warn),
45
+
46
+ select-enabled-arrow-color: $secondary-text-color,
47
+ select-disabled-arrow-color: $disabled-text-color,
48
+ select-invalid-arrow-color: mat.get-theme-color($theme, warn),
49
+
50
+ select-panel-background-color: mat.get-theme-color($theme, background, card),
51
+ select-panel-divider-color: $divider-color,
52
+ select-optgroup-label-text-color: $secondary-text-color,
53
+ select-option-label-text-color: $text-color,
54
+ select-option-selected-state-background-color: $hover-color,
55
+ select-option-hover-state-background-color: $hover-color,
56
+ select-option-disabled-state-text-color: $hint-text-color,
57
+ ));
58
+ }
59
+
60
+ // Tokens that can be configured through Angular Material's typography theming API.
61
+ @function get-typography-tokens($theme) {
62
+ @return ();
63
+ }
64
+
65
+ // Tokens that can be configured through Angular Material's density theming API.
66
+ @function get-density-tokens($theme) {
67
+ @return ();
68
+ }
69
+
70
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
71
+ // This is used to create token slots.
72
+ @function get-token-slots() {
73
+ @return mat.private-deep-merge-all(
74
+ get-unthemable-tokens(),
75
+ get-color-tokens(m2-utils.$placeholder-color-config),
76
+ get-typography-tokens(m2-utils.$placeholder-typography-config),
77
+ get-density-tokens(m2-utils.$placeholder-density-config)
78
+ );
79
+ }
@@ -0,0 +1,46 @@
1
+ @use 'sass:map';
2
+ @use '@angular/material' as mat;
3
+ @use '../core/tokens/m3-utils';
4
+ @use '../core/tokens/m3';
5
+ @use '../core/style/elevation';
6
+
7
+ /// Generates custom tokens for the mtx-select.
8
+ @function get-tokens($theme: m3.$sys-theme, $color-variant: null) {
9
+ $system: m3-utils.get-system($theme);
10
+ @if $color-variant {
11
+ $system: m3-utils.replace-colors-with-variant($system, secondary, $color-variant);
12
+ }
13
+
14
+ $tokens: (
15
+ base: (
16
+ select-container-shape: map.get($system, corner-extra-small),
17
+ select-container-elevation-shadow: elevation.get-box-shadow(2),
18
+ ),
19
+ color: (
20
+ select-container-text-color: map.get($system, on-surface),
21
+ select-placeholder-text-color: m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
22
+ select-disabled-text-color: m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
23
+ select-multiple-value-background-color: transparent,
24
+ select-multiple-value-outline-color: map.get($system, outline),
25
+ select-multiple-value-disabled-outline-color: m3-utils.color-with-opacity(map.get($system, outline), 38%),
26
+ select-multiple-value-icon-hover-background-color: map.get($system, outline-variant),
27
+ select-clear-icon-color: map.get($system, on-surface),
28
+ select-clear-icon-hover-color: map.get($system, error),
29
+ select-enabled-arrow-color: map.get($system, on-surface),
30
+ select-disabled-arrow-color: m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
31
+ select-invalid-arrow-color: map.get($system, error),
32
+ select-panel-background-color: map.get($system, surface-container),
33
+ select-panel-divider-color: map.get($system, outline),
34
+ select-optgroup-label-text-color: map.get($system, on-surface),
35
+ select-option-label-text-color: map.get($system, on-surface),
36
+ select-option-selected-state-background-color: map.get($system, secondary-container),
37
+ select-option-selected-state-text-color: map.get($system, on-surface),
38
+ select-option-hover-state-background-color: m3-utils.color-with-opacity(map.get($system, on-surface), map.get($system,hover-state-layer-opacity)),
39
+ select-option-disabled-state-text-color: m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
40
+ ),
41
+ typography: (),
42
+ density: (),
43
+ );
44
+
45
+ @return $tokens;
46
+ }
@@ -1,45 +1,38 @@
1
1
  @use 'sass:map';
2
2
  @use '@angular/material' as mat;
3
- @use '../core/theming/inspection';
4
- @use '../core/theming/validation';
5
3
  @use '../core/tokens/token-utils';
6
- @use '../core/tokens/m2/mtx/select' as tokens-mtx-select;
4
+ @use './m2-select';
5
+ @use './m3-select';
7
6
 
8
7
  @mixin base($theme) {
9
8
  @if mat.get-theme-version($theme) == 1 {
10
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
9
+ @include token-utils.create-token-values(map.get(m3-select.get-tokens($theme), base));
11
10
  }
12
11
  @else {
13
12
  @include mat.private-current-selector-or-root() {
14
- @include token-utils.create-token-values(
15
- tokens-mtx-select.$prefix,
16
- tokens-mtx-select.get-unthemable-tokens()
17
- );
13
+ @include token-utils.create-token-values-mixed(m2-select.get-unthemable-tokens());
18
14
  }
19
15
  }
20
16
  }
21
17
 
22
- @mixin color($theme, $options...) {
18
+ @mixin color($theme, $color-variant: null) {
23
19
  @if mat.get-theme-version($theme) == 1 {
24
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...);
20
+ @include token-utils.create-token-values(map.get(m3-select.get-tokens($theme, $color-variant), color));
25
21
  }
26
22
  @else {
27
23
  @include mat.private-current-selector-or-root() {
28
- @include token-utils.create-token-values(
29
- tokens-mtx-select.$prefix,
30
- tokens-mtx-select.get-color-tokens($theme)
31
- );
24
+ @include token-utils.create-token-values-mixed(m2-select.get-color-tokens($theme));
32
25
  }
33
26
 
34
27
  .ng-dropdown-panel {
35
28
  &.mat-accent {
36
- $accent-tokens: tokens-mtx-select.private-get-color-palette-color-tokens($theme, accent);
37
- @include token-utils.create-token-values(tokens-mtx-select.$prefix, $accent-tokens);
29
+ $accent-tokens: m2-select.private-get-color-palette-color-tokens($theme, accent);
30
+ @include token-utils.create-token-values-mixed($accent-tokens);
38
31
  }
39
32
 
40
33
  &.mat-warn {
41
- $warn-tokens: tokens-mtx-select.private-get-color-palette-color-tokens($theme, warn);
42
- @include token-utils.create-token-values(tokens-mtx-select.$prefix, $warn-tokens);
34
+ $warn-tokens: m2-select.private-get-color-palette-color-tokens($theme, warn);
35
+ @include token-utils.create-token-values-mixed($warn-tokens);
43
36
  }
44
37
  }
45
38
  }
@@ -47,21 +40,22 @@
47
40
 
48
41
  @mixin typography($theme) {
49
42
  @if mat.get-theme-version($theme) == 1 {
50
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
43
+ @include token-utils.create-token-values(map.get(m3-select.get-tokens($theme), typography));
44
+ }
45
+ @else {
46
+ @include mat.private-current-selector-or-root() {
47
+ @include token-utils.create-token-values-mixed(m2-select.get-typography-tokens($theme));
48
+ }
51
49
  }
52
- @else {}
53
50
  }
54
51
 
55
52
  @mixin density($theme) {
56
53
  @if mat.get-theme-version($theme) == 1 {
57
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
54
+ @include token-utils.create-token-values(map.get(m3-select.get-tokens($theme), density));
58
55
  }
59
56
  @else {
60
57
  @include mat.private-current-selector-or-root() {
61
- @include token-utils.create-token-values(
62
- tokens-mtx-select.$prefix,
63
- tokens-mtx-select.get-density-tokens($theme)
64
- );
58
+ @include token-utils.create-token-values-mixed(m2-select.get-density-tokens($theme));
65
59
  }
66
60
  }
67
61
  }
@@ -70,20 +64,23 @@
70
64
  @function _define-overrides() {
71
65
  @return (
72
66
  (
73
- namespace: tokens-mtx-select.$prefix,
74
- tokens: tokens-mtx-select.get-token-slots(),
67
+ namespace: select,
68
+ tokens: token-utils.get-overrides(m3-select.get-tokens(), select),
75
69
  ),
76
70
  );
77
71
  }
78
72
 
79
73
  @mixin overrides($tokens: ()) {
80
- @include token-utils.batch-create-token-values($tokens, _define-overrides()...);
74
+ @include token-utils.batch-create-token-values($tokens, _define-overrides());
81
75
  }
82
76
 
83
- @mixin theme($theme, $options...) {
77
+ @mixin theme($theme, $color-variant: null) {
84
78
  @include mat.private-check-duplicate-theme-styles($theme, 'mtx-select') {
85
79
  @if mat.get-theme-version($theme) == 1 {
86
- @include _theme-from-tokens(inspection.get-theme-tokens($theme), $options...);
80
+ @include base($theme);
81
+ @include color($theme, $color-variant);
82
+ @include density($theme);
83
+ @include typography($theme);
87
84
  }
88
85
  @else {
89
86
  @include base($theme);
@@ -99,10 +96,3 @@
99
96
  }
100
97
  }
101
98
  }
102
-
103
- @mixin _theme-from-tokens($tokens, $options...) {
104
- @include validation.selector-defined(
105
- 'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector');
106
- $mtx-select-tokens: token-utils.get-tokens-for($tokens, tokens-mtx-select.$prefix, $options...);
107
- @include token-utils.create-token-values(tokens-mtx-select.$prefix, $mtx-select-tokens);
108
- }