@ptsecurity/mosaic 17.0.0 → 17.2.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 (201) hide show
  1. package/autocomplete/_autocomplete-theme.scss +2 -1
  2. package/autocomplete/autocomplete-trigger.directive.d.ts +7 -1
  3. package/autocomplete/autocomplete.scss +7 -11
  4. package/button/_button-base.scss +10 -10
  5. package/button/_button-theme.scss +32 -32
  6. package/button/button.scss +9 -15
  7. package/button-toggle/_button-toggle-theme.scss +32 -24
  8. package/button-toggle/button-toggle.scss +18 -57
  9. package/card/_card-theme.scss +23 -20
  10. package/card/card.component.scss +2 -1
  11. package/checkbox/_checkbox-theme.scss +33 -29
  12. package/checkbox/checkbox.scss +7 -6
  13. package/code-block/_code-block-theme.scss +201 -113
  14. package/code-block/actionbar.component.scss +5 -7
  15. package/code-block/code-block.scss +5 -6
  16. package/core/forms/_forms-theme.scss +17 -46
  17. package/core/option/_optgroup-theme.scss +5 -5
  18. package/core/option/_option-action-theme.scss +1 -4
  19. package/core/option/_option-theme.scss +8 -10
  20. package/core/option/option.scss +5 -4
  21. package/core/pop-up/pop-up-trigger.d.ts +3 -1
  22. package/core/styles/_mosaic-theme.scss +3 -3
  23. package/core/styles/common/_popup.scss +4 -3
  24. package/core/styles/common/_tokens.scss +39 -0
  25. package/core/styles/theming/_alerts.scss +16 -24
  26. package/core/styles/theming/_badges.scss +7 -8
  27. package/core/styles/theming/_components-theming.scss +4 -2
  28. package/core/styles/theming/_scrollbars.scss +17 -2
  29. package/datepicker/_datepicker-theme.scss +18 -19
  30. package/datepicker/calendar-body.scss +6 -9
  31. package/datepicker/calendar-header.scss +9 -26
  32. package/datepicker/calendar.scss +5 -16
  33. package/datepicker/datepicker-content.scss +2 -4
  34. package/datepicker/datepicker-input.scss +2 -1
  35. package/datepicker/datepicker-toggle.scss +3 -2
  36. package/divider/_divider-theme.scss +4 -2
  37. package/divider/divider.scss +5 -4
  38. package/dl/_dl-theme.scss +12 -36
  39. package/dl/dl.scss +13 -46
  40. package/dropdown/_dropdown-theme.scss +19 -17
  41. package/dropdown/dropdown-item.scss +7 -6
  42. package/dropdown/dropdown.scss +11 -26
  43. package/ellipsis-center/ellipsis-center.directive.d.ts +3 -2
  44. package/esm2022/autocomplete/autocomplete-trigger.directive.mjs +14 -2
  45. package/esm2022/button/button.component.mjs +2 -2
  46. package/esm2022/code-block/actionbar.component.mjs +2 -2
  47. package/esm2022/code-block/code-block.component.mjs +2 -2
  48. package/esm2022/core/pop-up/pop-up-trigger.mjs +19 -11
  49. package/esm2022/core/version.mjs +2 -2
  50. package/esm2022/dropdown/dropdown-item.component.mjs +2 -2
  51. package/esm2022/dropdown/dropdown.component.mjs +3 -3
  52. package/esm2022/ellipsis-center/ellipsis-center.directive.mjs +7 -5
  53. package/esm2022/file-upload/file-upload.module.mjs +8 -4
  54. package/esm2022/file-upload/multiple-file-upload.component.mjs +15 -34
  55. package/esm2022/file-upload/single-file-upload.component.mjs +15 -34
  56. package/esm2022/form-field/form-field.mjs +2 -2
  57. package/esm2022/input/input-password.mjs +2 -3
  58. package/esm2022/loader-overlay/loader-overlay.component.mjs +2 -2
  59. package/esm2022/markdown/markdown.component.mjs +2 -2
  60. package/esm2022/modal/modal.component.mjs +6 -6
  61. package/esm2022/navbar/navbar-item.component.mjs +9 -9
  62. package/esm2022/progress-spinner/progress-spinner.component.mjs +2 -2
  63. package/esm2022/radio/radio.component.mjs +2 -2
  64. package/esm2022/select/select-option.directive.mjs +7 -5
  65. package/esm2022/select/select.component.mjs +16 -9
  66. package/esm2022/tabs/tab-header.component.mjs +2 -2
  67. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +2 -2
  68. package/esm2022/tags/tag-input.mjs +28 -8
  69. package/esm2022/timezone/timezone-option.directive.mjs +7 -5
  70. package/esm2022/timezone/timezone-select.component.mjs +2 -2
  71. package/esm2022/title/title.directive.mjs +2 -3
  72. package/esm2022/tooltip/tooltip.component.mjs +27 -12
  73. package/esm2022/tree-select/tree-select.component.mjs +21 -8
  74. package/fesm2022/ptsecurity-mosaic-autocomplete.mjs +13 -1
  75. package/fesm2022/ptsecurity-mosaic-autocomplete.mjs.map +1 -1
  76. package/fesm2022/ptsecurity-mosaic-button.mjs +2 -2
  77. package/fesm2022/ptsecurity-mosaic-button.mjs.map +1 -1
  78. package/fesm2022/ptsecurity-mosaic-code-block.mjs +4 -4
  79. package/fesm2022/ptsecurity-mosaic-code-block.mjs.map +1 -1
  80. package/fesm2022/ptsecurity-mosaic-core.mjs +19 -11
  81. package/fesm2022/ptsecurity-mosaic-core.mjs.map +1 -1
  82. package/fesm2022/ptsecurity-mosaic-dropdown.mjs +4 -4
  83. package/fesm2022/ptsecurity-mosaic-dropdown.mjs.map +1 -1
  84. package/fesm2022/ptsecurity-mosaic-ellipsis-center.mjs +5 -4
  85. package/fesm2022/ptsecurity-mosaic-ellipsis-center.mjs.map +1 -1
  86. package/fesm2022/ptsecurity-mosaic-file-upload.mjs +26 -58
  87. package/fesm2022/ptsecurity-mosaic-file-upload.mjs.map +1 -1
  88. package/fesm2022/ptsecurity-mosaic-form-field.mjs +2 -2
  89. package/fesm2022/ptsecurity-mosaic-form-field.mjs.map +1 -1
  90. package/fesm2022/ptsecurity-mosaic-input.mjs +1 -2
  91. package/fesm2022/ptsecurity-mosaic-input.mjs.map +1 -1
  92. package/fesm2022/ptsecurity-mosaic-loader-overlay.mjs +2 -2
  93. package/fesm2022/ptsecurity-mosaic-loader-overlay.mjs.map +1 -1
  94. package/fesm2022/ptsecurity-mosaic-markdown.mjs +2 -2
  95. package/fesm2022/ptsecurity-mosaic-markdown.mjs.map +1 -1
  96. package/fesm2022/ptsecurity-mosaic-modal.mjs +5 -5
  97. package/fesm2022/ptsecurity-mosaic-modal.mjs.map +1 -1
  98. package/fesm2022/ptsecurity-mosaic-navbar.mjs +8 -8
  99. package/fesm2022/ptsecurity-mosaic-navbar.mjs.map +1 -1
  100. package/fesm2022/ptsecurity-mosaic-progress-spinner.mjs +1 -1
  101. package/fesm2022/ptsecurity-mosaic-progress-spinner.mjs.map +1 -1
  102. package/fesm2022/ptsecurity-mosaic-radio.mjs +2 -2
  103. package/fesm2022/ptsecurity-mosaic-radio.mjs.map +1 -1
  104. package/fesm2022/ptsecurity-mosaic-select.mjs +25 -17
  105. package/fesm2022/ptsecurity-mosaic-select.mjs.map +1 -1
  106. package/fesm2022/ptsecurity-mosaic-tabs.mjs +4 -4
  107. package/fesm2022/ptsecurity-mosaic-tabs.mjs.map +1 -1
  108. package/fesm2022/ptsecurity-mosaic-tags.mjs +26 -7
  109. package/fesm2022/ptsecurity-mosaic-tags.mjs.map +1 -1
  110. package/fesm2022/ptsecurity-mosaic-timezone.mjs +7 -6
  111. package/fesm2022/ptsecurity-mosaic-timezone.mjs.map +1 -1
  112. package/fesm2022/ptsecurity-mosaic-title.mjs +1 -2
  113. package/fesm2022/ptsecurity-mosaic-title.mjs.map +1 -1
  114. package/fesm2022/ptsecurity-mosaic-tooltip.mjs +25 -11
  115. package/fesm2022/ptsecurity-mosaic-tooltip.mjs.map +1 -1
  116. package/fesm2022/ptsecurity-mosaic-tree-select.mjs +20 -7
  117. package/fesm2022/ptsecurity-mosaic-tree-select.mjs.map +1 -1
  118. package/file-upload/_file-upload-theme.scss +87 -54
  119. package/file-upload/file-upload.module.d.ts +2 -1
  120. package/file-upload/file-upload.scss +0 -15
  121. package/file-upload/multiple-file-upload.component.d.ts +4 -12
  122. package/file-upload/multiple-file-upload.component.scss +58 -54
  123. package/file-upload/single-file-upload.component.d.ts +4 -12
  124. package/file-upload/single-file-upload.component.scss +15 -24
  125. package/form-field/_form-field-theme.scss +43 -34
  126. package/form-field/form-field.scss +14 -13
  127. package/icon/_icon-theme.scss +26 -25
  128. package/input/_input-base.scss +3 -2
  129. package/input/_input-theme.scss +14 -14
  130. package/input/input-password.d.ts +0 -1
  131. package/input/input.scss +3 -4
  132. package/link/_link-theme.scss +36 -32
  133. package/list/_list-base.scss +4 -3
  134. package/list/_list-theme.scss +8 -8
  135. package/list/list.scss +2 -1
  136. package/loader-overlay/_loader-overlay-theme.scss +8 -8
  137. package/loader-overlay/loader-overlay.scss +7 -12
  138. package/markdown/_markdown-theme.scss +61 -43
  139. package/markdown/markdown.scss +39 -80
  140. package/modal/_modal-confirm.scss +3 -2
  141. package/modal/_modal-theme.scss +20 -21
  142. package/modal/modal.scss +18 -15
  143. package/navbar/_navbar-theme.scss +19 -18
  144. package/navbar/navbar-brand.scss +7 -9
  145. package/navbar/navbar-item.component.d.ts +4 -4
  146. package/navbar/navbar-item.scss +8 -7
  147. package/navbar/vertical-navbar.scss +4 -12
  148. package/package.json +25 -25
  149. package/popover/_popover-theme.scss +35 -35
  150. package/popover/popover.scss +15 -14
  151. package/prebuilt-themes/dark-theme.css +1 -1
  152. package/prebuilt-themes/default-theme.css +1 -1
  153. package/progress-bar/_progress-bar-theme.scss +6 -5
  154. package/progress-bar/progress-bar.scss +2 -1
  155. package/progress-spinner/_progress-spinner-theme.scss +4 -3
  156. package/progress-spinner/progress-spinner.scss +7 -12
  157. package/radio/_radio-theme.scss +32 -24
  158. package/radio/radio.scss +8 -11
  159. package/select/_select-theme.scss +13 -13
  160. package/select/select-option.directive.d.ts +3 -2
  161. package/select/select.component.d.ts +1 -0
  162. package/select/select.scss +19 -42
  163. package/sidepanel/_sidepanel-theme.scss +9 -9
  164. package/sidepanel/sidepanel.scss +11 -10
  165. package/splitter/_splitter-theme.scss +5 -3
  166. package/table/_table-theme.scss +9 -9
  167. package/table/table.scss +11 -14
  168. package/tabs/_tabs-common.scss +15 -14
  169. package/tabs/_tabs-theme.scss +67 -55
  170. package/tabs/tab-group.scss +2 -1
  171. package/tabs/tab-header.scss +16 -3
  172. package/tabs/tab-nav-bar/tab-nav-bar.scss +15 -2
  173. package/tags/_tag-theme.scss +30 -27
  174. package/tags/tag-input.d.ts +9 -4
  175. package/tags/tag-list.scss +4 -3
  176. package/tags/tag.scss +9 -8
  177. package/textarea/_textarea-base.scss +2 -4
  178. package/textarea/_textarea-theme.scss +8 -8
  179. package/textarea/textarea.scss +2 -4
  180. package/timepicker/timepicker.scss +2 -7
  181. package/timezone/_timezone-option-theme.scss +7 -7
  182. package/timezone/timezone-option.component.scss +5 -4
  183. package/timezone/timezone-option.directive.d.ts +3 -2
  184. package/title/title.directive.d.ts +0 -1
  185. package/toast/_toast-theme.scss +13 -16
  186. package/toast/toast-container.component.scss +2 -5
  187. package/toast/toast.component.scss +15 -17
  188. package/toggle/_toggle-theme.scss +22 -21
  189. package/toggle/toggle.scss +19 -21
  190. package/tooltip/_tooltip-theme.scss +26 -31
  191. package/tooltip/tooltip.component.d.ts +12 -8
  192. package/tooltip/tooltip.scss +13 -17
  193. package/tree/_tree-theme.scss +8 -8
  194. package/tree/toggle.scss +3 -5
  195. package/tree/tree-option.scss +5 -4
  196. package/tree-select/_tree-select-theme.scss +9 -9
  197. package/tree-select/tree-select.component.d.ts +1 -0
  198. package/tree-select/tree-select.scss +17 -35
  199. package/_theming.scss +0 -10827
  200. package/_visual.scss +0 -3541
  201. package/prebuilt-visual/default-visual.css +0 -1
@@ -1,7 +1,10 @@
1
1
  @use 'sass:meta';
2
2
  @use 'sass:map';
3
3
 
4
- @use '../styles/typography' as *;
4
+ @use '../styles/typography/typography' as *;
5
+ @use '../styles/typography/typography-utils' as *;
6
+ @use '../styles/common/tokens' as *;
7
+
5
8
 
6
9
  @mixin mc-form-geometry($tokens) {
7
10
  .mc-form {
@@ -24,34 +27,22 @@
24
27
  $label-padding-top: calc(($form-field-size-height - $line-height) / 2);
25
28
 
26
29
  & .mc-form-row_margin {
27
- margin-bottom: var(
28
- --mc-forms-size-horizontal-row-margin-bottom,
29
- #{map.get($tokens, forms-size-horizontal-row-margin-bottom)}
30
- );
30
+ margin-bottom: mc-css-variable(forms-size-horizontal-row-margin-bottom);
31
31
  }
32
32
 
33
33
  & .mc-form__label {
34
- padding-top: var(--mc-forms-size-horizontal-label-padding-top, #{$label-padding-top});
34
+ padding-top: mc-css-variable(forms-size-horizontal-label-padding-top, #{$label-padding-top});
35
35
 
36
36
  text-align: start;
37
37
  }
38
38
 
39
39
  & .mc-form__control {
40
- padding-left: var(
41
- --mc-forms-size-horizontal-control-padding-left,
42
- #{map.get($tokens, forms-size-horizontal-control-padding-left)}
43
- );
40
+ padding-left: mc-css-variable(forms-size-horizontal-control-padding-left);
44
41
  }
45
42
 
46
43
  & .mc-form__legend {
47
- margin-top: var(
48
- --mc-forms-size-horizontal-legend-margin-top,
49
- #{map.get($tokens, forms-size-horizontal-legend-margin-top)}
50
- );
51
- margin-bottom: var(
52
- --mc-forms-size-horizontal-legend-margin-bottom,
53
- #{map.get($tokens, forms-size-horizontal-legend-margin-bottom)}
54
- );
44
+ margin-top: mc-css-variable(forms-size-horizontal-legend-margin-top);
45
+ margin-bottom: mc-css-variable(forms-size-horizontal-legend-margin-bottom);
55
46
  }
56
47
  }
57
48
 
@@ -61,21 +52,12 @@
61
52
  }
62
53
 
63
54
  & .mc-form-row_margin {
64
- margin-bottom: var(
65
- --mc-forms-size-vertical-row-margin-bottom,
66
- #{map.get($tokens, forms-size-vertical-row-margin-bottom)}
67
- );
55
+ margin-bottom: mc-css-variable(forms-size-vertical-row-margin-bottom);
68
56
  }
69
57
 
70
58
  & .mc-form__label {
71
- padding-top: var(
72
- --mc-forms-size-vertical-label-padding-top,
73
- #{map.get($tokens, forms-size-vertical-label-padding-top)}
74
- );
75
- padding-bottom: var(
76
- --mc-forms-size-vertical-label-padding-bottom,
77
- #{map.get($tokens, forms-size-vertical-label-padding-bottom)}
78
- );
59
+ padding-top: mc-css-variable(forms-size-vertical-label-padding-top);
60
+ padding-bottom: mc-css-variable(forms-size-vertical-label-padding-bottom);
79
61
 
80
62
  text-align: start;
81
63
  }
@@ -85,14 +67,8 @@
85
67
  }
86
68
 
87
69
  & .mc-form__legend {
88
- margin-top: var(
89
- --mc-forms-size-vertical-legend-margin-top,
90
- #{map.get($tokens, forms-size-vertical-legend-margin-top)}
91
- );
92
- margin-bottom: var(
93
- --mc-forms-size-vertical-legend-margin-bottom,
94
- #{map.get($tokens, forms-size-vertical-legend-margin-bottom)}
95
- );
70
+ margin-top: mc-css-variable(forms-size-vertical-legend-margin-top);
71
+ margin-bottom: mc-css-variable(forms-size-vertical-legend-margin-bottom);
96
72
  }
97
73
  }
98
74
 
@@ -105,10 +81,7 @@
105
81
  flex-direction: row;
106
82
 
107
83
  & .mc-form__row:not(:first-child) {
108
- padding-left: var(
109
- --mc-forms-size-vertical-control-padding-left,
110
- #{map.get($tokens, forms-size-vertical-control-padding-left)}
111
- );
84
+ padding-left: mc-css-variable(forms-size-vertical-control-padding-left);
112
85
  }
113
86
  }
114
87
  }
@@ -130,13 +103,11 @@
130
103
  }
131
104
 
132
105
  @mixin mc-forms-typography($config) {
133
- $tokens: map.get($config, tokens);
134
-
135
106
  .mc-form__label {
136
- @include mc-typography-level-to-styles($config, map.get($tokens, forms-font-default-label));
107
+ @include mc-typography-css-variables(forms, default-label);
137
108
  }
138
109
 
139
110
  .mc-form__legend {
140
- @include mc-typography-level-to-styles($config, map.get($tokens, forms-font-default-legend));
111
+ @include mc-typography-css-variables(forms, default-legend);
141
112
  }
142
113
  }
@@ -2,23 +2,23 @@
2
2
  @use 'sass:map';
3
3
 
4
4
  @use '../styles/typography' as *;
5
+ @use '../styles/common/tokens' as *;
6
+
5
7
 
6
8
  @mixin mc-optgroup-theme($theme) {
7
9
  $foreground: map.get($theme, foreground);
8
10
 
9
11
  .mc-optgroup-label {
10
- color: map.get($foreground, text);
12
+ color: mc-css-variable(foreground-text, map.get($foreground, text));
11
13
  }
12
14
 
13
15
  .mc-disabled .mc-optgroup-label {
14
- color: map.get($foreground, text-disabled);
16
+ color: mc-css-variable(foreground-text-disabled, map.get($foreground, text-disabled));
15
17
  }
16
18
  }
17
19
 
18
20
  @mixin mc-optgroup-typography($config) {
19
- $tokens: map.get($config, tokens);
20
-
21
21
  .mc-optgroup-label {
22
- @include mc-typography-level-to-styles($config, map.get($tokens, optgroup-font-default));
22
+ @include mc-typography-css-variables(optgroup, default);
23
23
  }
24
24
  }
@@ -5,16 +5,13 @@
5
5
 
6
6
 
7
7
  @mixin mc-option-action-theme($theme) {
8
- $foreground: map.get($theme, foreground);
9
- $background: map.get($theme, background);
10
-
11
8
  $secondary: map.get($theme, secondary);
12
9
 
13
10
  $is-dark: map.get($theme, is-dark);
14
11
 
15
12
  .mc-option-action {
16
13
  &.cdk-keyboard-focused {
17
- border-color: map.get(map.get($theme, states), focused-color);
14
+ border-color: map.get($theme, states, focused-color);
18
15
  }
19
16
 
20
17
  &:active,
@@ -2,42 +2,40 @@
2
2
  @use 'sass:map';
3
3
 
4
4
  @use '../styles/typography' as *;
5
+ @use '../styles/common/tokens' as *;
6
+
5
7
 
6
8
  @mixin mc-option-theme($theme) {
7
9
  $foreground: map.get($theme, foreground);
8
10
  $background: map.get($theme, background);
9
11
 
10
- $primary: map.get($theme, primary);
11
-
12
12
  .mc-option {
13
- color: map.get($foreground, text);
13
+ color: mc-css-variable(foreground-text, map.get($foreground, text));
14
14
 
15
15
  &:hover:not(.mc-disabled) {
16
16
  .mc-option-overlay {
17
- background: map.get($background, overlay-hover);
17
+ background: mc-css-variable(background-overlay-hover, map.get($background, overlay-hover));
18
18
  }
19
19
  }
20
20
 
21
21
  &.mc-active {
22
- border-color: map.get(map.get($theme, states), focused-color);
22
+ border-color: mc-css-variable(states-focused-color, map.get($theme, states, focused-color));
23
23
  }
24
24
 
25
25
  &.mc-selected {
26
- background: map.get(map.get($theme, states), selected-color);
26
+ background: mc-css-variable(states-selected-color, map.get($theme, states, selected-color));
27
27
  }
28
28
 
29
29
  &.mc-disabled {
30
30
  background: transparent;
31
31
 
32
- color: map.get($foreground, text-disabled);
32
+ color: mc-css-variable(foreground-text-disabled, map.get($foreground, text-disabled));
33
33
  }
34
34
  }
35
35
  }
36
36
 
37
37
  @mixin mc-option-typography($config) {
38
- $tokens: map.get($config, tokens);
39
-
40
38
  .mc-option {
41
- @include mc-typography-level-to-styles($config, map.get($tokens, option-font-default));
39
+ @include mc-typography-css-variables(option, default);
42
40
  }
43
41
  }
@@ -2,6 +2,7 @@
2
2
  @use 'sass:map';
3
3
 
4
4
  @use '../styles/tokens';
5
+ @use '../styles/common/tokens' as *;
5
6
 
6
7
 
7
8
  $tokens: meta.module-variables(tokens) !default;
@@ -17,16 +18,16 @@ $tokens: meta.module-variables(tokens) !default;
17
18
 
18
19
  max-width: 100%;
19
20
 
20
- height: var(--mc-option-size-height, map.get($tokens, option-size-height));
21
+ height: mc-css-variable(option-size-height);
21
22
 
22
- border: var(--mc-option-size-border-width, map.get($tokens, option-size-border-width)) solid transparent;
23
+ border: mc-css-variable(option-size-border-width) solid transparent;
23
24
 
24
25
  cursor: pointer;
25
26
 
26
27
  outline: none;
27
28
 
28
- padding-left: var(--mc-option-size-horizontal-padding, map.get($tokens, option-size-horizontal-padding));
29
- padding-right: var(--mc-option-size-horizontal-padding, map.get($tokens, option-size-horizontal-padding));
29
+ padding-left: mc-css-variable(option-size-horizontal-padding);
30
+ padding-right: mc-css-variable(option-size-horizontal-padding);
30
31
 
31
32
  -webkit-tap-highlight-color: transparent;
32
33
 
@@ -33,12 +33,13 @@ export declare abstract class McPopUpTrigger<T> {
33
33
  protected overlayRef: OverlayRef | null;
34
34
  protected portal: ComponentPortal<T>;
35
35
  protected instance: any | null;
36
- protected listeners: Map<string, EventListenerOrEventListenerObject>;
36
+ protected listeners: Map<string, EventListener>;
37
37
  protected closingActionsSubscription: Subscription;
38
38
  protected readonly availablePositions: {
39
39
  [key: string]: ConnectionPositionPair;
40
40
  };
41
41
  protected readonly destroyed: Subject<void>;
42
+ protected triggerName: string;
42
43
  protected constructor(overlay: Overlay, elementRef: ElementRef, ngZone: NgZone, scrollDispatcher: ScrollDispatcher, hostView: ViewContainerRef, scrollStrategy: any, direction?: Directionality | undefined);
43
44
  abstract updateClassMap(newPlacement?: string): void;
44
45
  abstract updateData(): void;
@@ -63,6 +64,7 @@ export declare abstract class McPopUpTrigger<T> {
63
64
  protected getPriorityPlacementStrategy(value: string | string[]): ConnectionPositionPair[];
64
65
  protected getPrioritizedPositions(): ConnectionPositionPair[];
65
66
  protected clearListeners(): void;
67
+ private createListener;
66
68
  private addEventListener;
67
69
  private removeEventListener;
68
70
  private subscribeOnClosingActions;
@@ -102,13 +102,13 @@
102
102
  }
103
103
 
104
104
 
105
- @mixin mosaic-typography($config: null, $md-config: null) {
105
+ @mixin mosaic-typography($tokens, $config: null, $md-config: null) {
106
106
  @if $config == null {
107
- $config: mc-typography-config();
107
+ $config: mc-typography-config($tokens);
108
108
  }
109
109
 
110
110
  @if $md-config == null {
111
- $md-config: mc-markdown-typography-config();
111
+ $md-config: mc-markdown-typography-config($tokens);
112
112
  }
113
113
 
114
114
  @include mc-base-typography($config);
@@ -1,11 +1,12 @@
1
1
  @use 'sass:map';
2
+ @use '../common/tokens' as *;
2
3
 
3
4
 
4
5
  @mixin popup-params($theme) {
5
6
  $popup: map.get(map.get($theme, components), popup);
6
7
 
7
- box-shadow: map.get($popup, shadow);
8
- border-color: map.get($popup, border);
8
+ box-shadow: mc-css-variable(popup-shadow, map-get($popup, shadow));
9
+ border-color: mc-css-variable(popup-border, map-get($popup, border));
9
10
 
10
- background-color: map.get($popup, background);
11
+ background-color: mc-css-variable(popup-background, map-get($popup, background));
11
12
  }
@@ -0,0 +1,39 @@
1
+ @use 'sass:map';
2
+ @use 'sass:meta';
3
+ @use 'sass:string';
4
+ @use 'sass:list';
5
+
6
+ @use '../tokens';
7
+
8
+
9
+ $tokens: meta.module-variables(tokens);
10
+
11
+
12
+ @function mc-css-variable($name, $value: null) {
13
+ @if $value {
14
+ @return var(--mc-#{$name}, $value);
15
+ } @else {
16
+ @return var(--mc-#{$name}, map.get($tokens, $name));
17
+ }
18
+ }
19
+
20
+ @function getToken($name) {
21
+ @return map.get($tokens, $name);
22
+ }
23
+
24
+ @mixin mc-css-font-variable($component, $component-property, $font-property) {
25
+ #{$font-property}: var(
26
+ --mc-#{$component}-font-#{$component-property}-#{$font-property},
27
+ map.get($tokens, #{$component}-font-#{$component-property}-#{$font-property})
28
+ );
29
+ }
30
+
31
+ @mixin mc-typography-css-variables($component, $property) {
32
+ @include mc-css-font-variable($component, $property, font-size);
33
+ @include mc-css-font-variable($component, $property, font-weight);
34
+ @include mc-css-font-variable($component, $property, line-height);
35
+ @include mc-css-font-variable($component, $property, font-family);
36
+ @include mc-css-font-variable($component, $property, text-transform);
37
+ @include mc-css-font-variable($component, $property, font-feature-settings);
38
+ @include mc-css-font-variable($component, $property, letter-spacing);
39
+ }
@@ -2,6 +2,7 @@
2
2
  @use 'sass:map';
3
3
 
4
4
  @use '../typography/typography-utils' as *;
5
+ @use '../common/tokens' as *;
5
6
 
6
7
  .mc-alert {
7
8
  display: flex;
@@ -99,66 +100,57 @@
99
100
  }
100
101
 
101
102
  @mixin mc-alert-geometry($tokens) {
102
- border: var(--mc-alert-size-border-width, map.get($tokens, alert-size-border-width)) solid transparent;
103
- border-radius: var(--mc-alert-size-border-radius, map.get($tokens, alert-size-border-radius));
103
+ border: mc-css-variable(alert-size-border-width) solid transparent;
104
+ border-radius: mc-css-variable(alert-size-border-radius);
104
105
 
105
106
  .mc-alert__icon {
106
- margin-right: var(--mc-alert-size-icon-margin, map.get($tokens, alert-size-icon-margin));
107
+ margin-right: mc-css-variable(alert-size-icon-margin);
107
108
  }
108
109
 
109
110
  padding: {
110
- right: calc(
111
- var(--mc-alert-size-horizontal-padding, #{map.get($tokens, alert-size-horizontal-padding)}) -
112
- var(--mc-alert-size-border-width, #{map.get($tokens, alert-size-border-width)})
113
- );
114
- left: calc(
115
- var(--mc-alert-size-horizontal-padding, #{map.get($tokens, alert-size-horizontal-padding)}) -
116
- var(--mc-alert-size-border-width, #{map.get($tokens, alert-size-border-width)})
117
- );
111
+ right: mc-css-variable(alert-size-horizontal-padding);
112
+ left: mc-css-variable(alert-size-horizontal-padding);
118
113
  };
119
114
 
120
115
  &:not(.mc-alert_small) {
121
116
  padding: {
122
- top: var(--mc-alert-size-vertical-padding, map.get($tokens, alert-size-vertical-padding));
123
- bottom: var(--mc-alert-size-vertical-padding, map.get($tokens, alert-size-vertical-padding));
117
+ top: mc-css-variable(alert-size-vertical-padding);
118
+ bottom: mc-css-variable(alert-size-vertical-padding);
124
119
  };
125
120
  }
126
121
 
127
122
  &.mc-alert_small {
128
123
  padding: {
129
- top: var(--mc-alert-size-small-vertical-padding, map.get($tokens, alert-size-small-vertical-padding));
130
- bottom: var(--mc-alert-size-small-vertical-padding, map.get($tokens, alert-size-small-vertical-padding));
124
+ top: mc-css-variable(alert-size-small-vertical-padding);
125
+ bottom: mc-css-variable(alert-size-small-vertical-padding);
131
126
  };
132
127
  }
133
128
 
134
129
  &.mc-alert_dismissible {
135
130
  padding-right: calc(
136
- var(--mc-alert-size-right-padding-dismissible, #{map.get($tokens, alert-size-close-button-width)}) +
137
- var(--mc-alert-size-horizontal-padding, #{map.get($tokens, alert-size-horizontal-padding)})
131
+ mc-css-variable(alert-size-right-padding-dismissible) + mc-css-variable(alert-size-horizontal-padding)
138
132
  );
139
133
  }
140
134
  }
141
135
 
142
136
  @mixin mc-alert-typography($config) {
143
- $tokens: map-get($config, tokens);
144
-
145
137
  .mc-alert:not(.mc-alert_small) {
146
- @include mc-typography-level-to-styles($config, map.get($tokens, alert-font-default-body));
138
+ @include mc-typography-css-variables(alert, default-body);
147
139
 
148
140
  header {
149
- @include mc-typography-level-to-styles($config, map.get($tokens, alert-font-default-header));
141
+ @include mc-typography-css-variables(alert, default-header);
150
142
  }
151
143
  }
152
144
 
153
145
  .mc-alert.mc-alert_small {
154
- @include mc-typography-level-to-styles($config, map.get($tokens, alert-font-small-body));
146
+ @include mc-typography-css-variables(alert, small-body);
155
147
 
156
148
  header {
157
- @include mc-typography-level-to-styles($config, map.get($tokens, alert-font-small-header));
149
+ @include mc-typography-css-variables(alert, small-header);
158
150
  }
159
151
 
160
152
  .mc-link__text {
161
- @include mc-typography-level-to-styles($config, map.get($tokens, alert-font-small-body));
153
+ @include mc-typography-css-variables(alert, small-body);
162
154
  }
163
155
  }
164
156
 
@@ -2,6 +2,7 @@
2
2
  @use 'sass:map';
3
3
 
4
4
  @use '../typography/typography-utils' as *;
5
+ @use '../common/tokens' as *;
5
6
 
6
7
  .mc-badge {
7
8
  display: inline-flex;
@@ -118,29 +119,27 @@
118
119
  }
119
120
 
120
121
  @mixin mc-badge-typography($config) {
121
- $tokens: map-get($config, tokens);
122
-
123
122
  .mc-badge_default {
124
- @include mc-typography-level-to-styles($config, map.get($tokens, badge-font-default-default));
123
+ @include mc-typography-css-variables(badge, default-default);
125
124
 
126
125
  &.mc-badge_caps {
127
- @include mc-typography-level-to-styles($config, map.get($tokens, badge-font-default-caps));
126
+ @include mc-typography-css-variables(badge, default-caps);
128
127
  }
129
128
 
130
129
  &.mc-badge_mono {
131
- @include mc-typography-level-to-styles($config, map.get($tokens, badge-font-default-mono));
130
+ @include mc-typography-css-variables(badge, default-mono);
132
131
  }
133
132
  }
134
133
 
135
134
  .mc-badge_mini {
136
- @include mc-typography-level-to-styles($config, map.get($tokens, badge-font-mini-default));
135
+ @include mc-typography-css-variables(badge, mini-default);
137
136
 
138
137
  &.mc-badge_caps {
139
- @include mc-typography-level-to-styles($config, map.get($tokens, badge-font-mini-caps));
138
+ @include mc-typography-css-variables(badge, mini-caps);
140
139
  }
141
140
 
142
141
  &.mc-badge_mono {
143
- @include mc-typography-level-to-styles($config, map.get($tokens, badge-font-mini-mono));
142
+ @include mc-typography-css-variables(badge, mini-mono);
144
143
  }
145
144
  }
146
145
  }
@@ -407,7 +407,8 @@
407
407
  ),
408
408
  disabled: (
409
409
  background: map-get($tokens, 'file-upload-#{$scheme}-single-states-disable-background'),
410
- border: map-get($tokens, 'file-upload-#{$scheme}-single-states-disable-border')
410
+ border: map-get($tokens, 'file-upload-#{$scheme}-single-states-disable-border'),
411
+ text: map-get($tokens, 'file-upload-#{$scheme}-single-states-disable-text')
411
412
  )
412
413
  )
413
414
  ),
@@ -431,7 +432,8 @@
431
432
  ),
432
433
  disabled: (
433
434
  background: map-get($tokens, 'file-upload-#{$scheme}-multiple-states-disable-background'),
434
- border: map-get($tokens, 'file-upload-#{$scheme}-multiple-states-disable-border')
435
+ border: map-get($tokens, 'file-upload-#{$scheme}-multiple-states-disable-border'),
436
+ text: map-get($tokens, 'file-upload-#{$scheme}-multiple-states-disable-text')
435
437
  )
436
438
  )
437
439
  )
@@ -97,9 +97,16 @@
97
97
  // webkit
98
98
  &::-webkit-scrollbar,
99
99
  ::-webkit-scrollbar {
100
- width: var(--mc-scrollbar-size-track-width, map.get($tokens, scrollbar-size-track-width));
100
+ &:vertical {
101
+ width: var(--mc-scrollbar-size-track-dimension, map.get($tokens, scrollbar-size-track-dimension));
102
+ }
103
+
104
+ &:horizontal {
105
+ height: var(--mc-scrollbar-size-track-dimension, map.get($tokens, scrollbar-size-track-dimension));
106
+ }
101
107
  }
102
108
 
109
+ /* stylelint-disable no-descending-specificity */
103
110
  &::-webkit-scrollbar-thumb,
104
111
  ::-webkit-scrollbar-thumb {
105
112
  width: var(--mc-scrollbar-size-thumb-width, map.get($tokens, scrollbar-size-thumb-width));
@@ -111,7 +118,15 @@
111
118
  --mc-scrollbar-size-thumb-inset-border-radius,
112
119
  map.get($tokens, scrollbar-size-thumb-border-radius)
113
120
  );
114
- min-height: 20px;
121
+
122
+ // these props are used to set the user-friendly thumb for long content.
123
+ &:vertical {
124
+ min-height: var(--mc-scrollbar-size-thumb-min-size, map.get($tokens, scrollbar-size-thumb-min-size));
125
+ }
126
+
127
+ &:horizontal {
128
+ min-width: var(--mc-scrollbar-size-thumb-min-size, map.get($tokens, scrollbar-size-thumb-min-size));
129
+ }
115
130
  }
116
131
 
117
132
  &::-webkit-scrollbar-button,
@@ -4,9 +4,8 @@
4
4
  @use '../core/styles/common/popup';
5
5
  @use '../core/styles/theming/theming';
6
6
  @use '../core/styles/typography/typography-utils' as *;
7
+ @use '../core/styles/common/tokens' as *;
7
8
 
8
- $mc-datepicker-selected-fade-amount: 0.6;
9
- $mc-datepicker-today-fade-amount: 0.2;
10
9
 
11
10
  @mixin mc-datepicker-theme($theme) {
12
11
  $foreground: map.get($theme, foreground);
@@ -28,28 +27,28 @@ $mc-datepicker-today-fade-amount: 0.2;
28
27
  opacity: 1;
29
28
 
30
29
  .mc-icon {
31
- color: theming.mc-color($foreground, icon);
30
+ color: mc-css-variable(foreground-icon, map-get($foreground, icon));
32
31
  }
33
32
  }
34
33
 
35
34
  .mc-calendar__table-header-divider::after {
36
- background: map.get($foreground, divider);
35
+ background: mc-css-variable(foreground-divider, map-get($foreground, divider));
37
36
  }
38
37
 
39
38
  .mc-calendar__body-cell-content {
40
- color: map.get($foreground, text);
39
+ color: mc-css-variable(foreground-text, map-get($foreground, text));
41
40
  border-color: transparent;
42
41
  }
43
42
 
44
43
  .mc-calendar__body_disabled > .mc-calendar__body-cell-content:not(.mc-selected) {
45
- color: map.get($foreground, text-disabled);
44
+ color: mc-css-variable(foreground-text-disabled, map-get($foreground, text-disabled));
46
45
  }
47
46
 
48
47
  .cdk-keyboard-focused .mc-calendar__body_active,
49
48
  .cdk-program-focused .mc-calendar__body_active {
50
49
  & > .mc-calendar__body-cell-content {
51
- border-color: map.get(map.get($theme, states), focused-color);
52
- box-shadow: 0 0 0 1px map.get(map.get($theme, states), focused-color);
50
+ border-color: map-get($theme, states, focused-color);
51
+ box-shadow: 0 0 0 1px map-get($theme, states, focused-color);
53
52
  }
54
53
  }
55
54
 
@@ -60,43 +59,43 @@ $mc-datepicker-today-fade-amount: 0.2;
60
59
  }
61
60
 
62
61
  .mc-calendar__body-today {
63
- color: map.get($datepicker, state-today-color);
62
+ color: mc-css-variable(datepicker-state-today-color, map-get($datepicker, state-today-color));
64
63
  // now tokens have wrong color for dark theme
65
64
  //background: map.get($datepicker, state-today-background);
66
65
  }
67
66
 
68
67
  .mc-calendar__body_disabled > .mc-calendar__body-today:not(.mc-selected) {
69
- border-color: map.get($background, background-disabled);
68
+ border-color: mc-css-variable(background-background-disabled, map-get($background, background-disabled));
70
69
  }
71
70
 
72
71
  .mc-calendar__body-cell-content.mc-selected {
73
- color: map.get($datepicker, state-selected-color);
74
- background: map.get($datepicker, state-selected-background);
72
+ color: mc-css-variable(datepicker-state-selected-color, map-get($datepicker, state-selected-color));
73
+ background: mc-css-variable(
74
+ datepicker-state-selected-background, map-get($datepicker, state-selected-background));
75
75
  }
76
76
 
77
77
  .mc-calendar__body_disabled > .mc-selected {
78
- background-color: map.get($datepicker, state-selected-background);
78
+ background-color: mc-css-variable(
79
+ datepicker-state-selected-background, map-get($datepicker, state-selected-background));
79
80
  }
80
81
 
81
82
  .mc-datepicker__content {
82
83
  @include popup.popup-params($theme);
83
84
 
84
- color: map.get($foreground, text);
85
+ color: mc-css-variable(foreground-text, map-get($foreground, text));
85
86
  }
86
87
  }
87
88
 
88
89
  @mixin mc-datepicker-typography($config) {
89
- $tokens: map.get($config, tokens);
90
-
91
90
  .mc-calendar {
92
- @include mc-typography-level-to-styles($config, map.get($tokens, datepicker-calendar-font-default));
91
+ @include mc-typography-css-variables(datepicker-calendar, default);
93
92
  }
94
93
 
95
94
  .mc-calendar__table-header th {
96
- @include mc-typography-level-to-styles($config, map.get($tokens, datepicker-calendar-font-header));
95
+ @include mc-typography-css-variables(datepicker-calendar, header);
97
96
  }
98
97
 
99
98
  .mc-calendar__body-today {
100
- @include mc-typography-level-to-styles($config, map.get($tokens, datepicker-body-font-today));
99
+ @include mc-typography-css-variables(datepicker-body, today);
101
100
  }
102
101
  }