@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
@@ -2,6 +2,7 @@
2
2
 
3
3
  @use '../core/styles/common/popup';
4
4
  @use '../core/styles/theming/theming';
5
+ @use '../core/styles/common/tokens' as *;
5
6
 
6
7
 
7
8
  @mixin mc-autocomplete-theme($theme) {
@@ -15,7 +16,7 @@
15
16
  .mc-selected {
16
17
  $popup: map.get(map.get($theme, components), popup);
17
18
 
18
- background-color: map.get($popup, background);
19
+ background-color: mc-css-variable(popup-background, map-get($popup, background));
19
20
  }
20
21
  }
21
22
  }
@@ -90,6 +90,12 @@ export declare class McAutocompleteTrigger implements AfterViewInit, ControlValu
90
90
  /** Stream of keyboard events that can close the panel. */
91
91
  private readonly closeKeyEventStream;
92
92
  constructor(elementRef: ElementRef<HTMLInputElement>, viewContainerRef: ViewContainerRef, changeDetectorRef: ChangeDetectorRef, overlay: Overlay, zone: NgZone, scrollStrategy: any, dir: Directionality, formField: McFormField, document: any, viewportRuler?: ViewportRuler | undefined);
93
+ /**
94
+ * Event handler for input blur events.
95
+ * Determines whether the blur event is triggered outside the specific target
96
+ * @returns A boolean indicating if the blur event happened outside the target element
97
+ */
98
+ onInputBlur: (event: FocusEvent) => boolean;
93
99
  ngAfterViewInit(): void;
94
100
  ngOnDestroy(): void;
95
101
  /** `View -> model callback called when value changes` */
@@ -153,5 +159,5 @@ export declare class McAutocompleteTrigger implements AfterViewInit, ControlValu
153
159
  private resetActiveItem;
154
160
  private canOpen;
155
161
  static ɵfac: i0.ɵɵFactoryDeclaration<McAutocompleteTrigger, [null, null, null, null, null, null, { optional: true; }, { optional: true; host: true; }, { optional: true; }, null]>;
156
- static ɵdir: i0.ɵɵDirectiveDeclaration<McAutocompleteTrigger, "input[mcAutocomplete], textarea[mcAutocomplete]", ["mcAutocompleteTrigger"], { "autocomplete": { "alias": "mcAutocomplete"; "required": false; }; "connectedTo": { "alias": "mcAutocompleteConnectedTo"; "required": false; }; "autocompleteAttribute": { "alias": "autocomplete"; "required": false; }; "autocompleteDisabled": { "alias": "mcAutocompleteDisabled"; "required": false; }; }, {}, never, never, false, never>;
162
+ static ɵdir: i0.ɵɵDirectiveDeclaration<McAutocompleteTrigger, "input[mcAutocomplete], textarea[mcAutocomplete]", ["mcAutocompleteTrigger"], { "autocomplete": { "alias": "mcAutocomplete"; "required": false; }; "connectedTo": { "alias": "mcAutocompleteConnectedTo"; "required": false; }; "autocompleteAttribute": { "alias": "autocomplete"; "required": false; }; "autocompleteDisabled": { "alias": "mcAutocompleteDisabled"; "required": false; }; "onInputBlur": { "alias": "mcAutocompleteOnBlur"; "required": false; }; }, {}, never, never, false, never>;
157
163
  }
@@ -1,7 +1,7 @@
1
1
  @use 'sass:meta';
2
2
  @use 'sass:map';
3
3
 
4
- @use '../core/styles/tokens';
4
+ @use '../core/styles/common/tokens' as *;
5
5
 
6
6
 
7
7
  $tokens: meta.module-variables(tokens) !default;
@@ -24,21 +24,17 @@ $tokens: meta.module-variables(tokens) !default;
24
24
  width: 100%;
25
25
  max-width: none;
26
26
 
27
- max-height: var(--mc-autocomplete-size-panel-max-height, map.get($tokens, autocomplete-size-panel-max-height));
27
+ max-height: mc-css-variable(autocomplete-size-panel-max-height);
28
28
 
29
29
  border: {
30
30
  width: 1px;
31
31
  style: solid;
32
32
  }
33
33
 
34
- border-bottom-left-radius: var(
35
- --mc-autocomplete-size-panel-border-radius, map.get($tokens, autocomplete-size-panel-border-radius)
36
- );
37
- border-bottom-right-radius: var(
38
- --mc-autocomplete-size-panel-border-radius, map.get($tokens, autocomplete-size-panel-border-radius)
39
- );
34
+ border-bottom-left-radius: mc-css-variable(autocomplete-size-panel-border-radius);
35
+ border-bottom-right-radius: mc-css-variable(autocomplete-size-panel-border-radius);
40
36
 
41
- padding: var(--mc-autocomplete-size-panel-padding, map.get($tokens, autocomplete-size-panel-padding));
37
+ padding: mc-css-variable(autocomplete-size-panel-padding);
42
38
 
43
39
  &.mc-autocomplete_visible {
44
40
  visibility: visible;
@@ -50,8 +46,8 @@ $tokens: meta.module-variables(tokens) !default;
50
46
 
51
47
  .mc-autocomplete-panel-above & {
52
48
  border-radius:
53
- var(--mc-autocomplete-size-panel-border-radius, map.get($tokens, autocomplete-size-panel-border-radius))
54
- var(--mc-autocomplete-size-panel-border-radius, map.get($tokens, autocomplete-size-panel-border-radius))
49
+ mc-css-variable(autocomplete-size-panel-border-radius)
50
+ mc-css-variable(autocomplete-size-panel-border-radius)
55
51
  0 0;
56
52
  }
57
53
 
@@ -2,6 +2,7 @@
2
2
  @use 'sass:map';
3
3
 
4
4
  @use '../core/styles/common/button';
5
+ @use '../core/styles/common/tokens' as *;
5
6
 
6
7
  @use '../core/styles/tokens';
7
8
 
@@ -21,8 +22,8 @@ $tokens: meta.module-variables(tokens) !default;
21
22
 
22
23
  margin: 0; /* Safari */
23
24
 
24
- height: var(--mc-button-size-height, map.get($tokens, button-size-height));
25
- min-height: var(--mc-button-size-height, map.get($tokens, button-size-height));
25
+ height: mc-css-variable(button-size-height);
26
+ min-height: mc-css-variable(button-size-height);
26
27
 
27
28
  white-space: nowrap;
28
29
 
@@ -31,8 +32,11 @@ $tokens: meta.module-variables(tokens) !default;
31
32
 
32
33
  vertical-align: baseline;
33
34
 
34
- border: var(--mc-button-size-border-width, map.get($tokens, button-size-border-width)) solid transparent;
35
- border-radius: var(--mc-button-size-border-radius, map.get($tokens, button-size-border-radius));
35
+ border-width: mc-css-variable(button-size-border-width);
36
+ border-style: solid;
37
+ border-color: transparent;
38
+
39
+ border-radius: mc-css-variable(button-size-border-radius);
36
40
 
37
41
  &::-moz-focus-inner {
38
42
  border: 0;
@@ -56,14 +60,10 @@ $tokens: meta.module-variables(tokens) !default;
56
60
  }
57
61
 
58
62
  & .mc-icon_left {
59
- margin-right: var(
60
- --mc-icon-button-size-left-icon-padding, map.get($tokens, icon-button-size-left-icon-padding)
61
- );
63
+ margin-right: mc-css-variable(icon-button-size-left-icon-padding);
62
64
  }
63
65
 
64
66
  & .mc-icon_right {
65
- margin-left: var(
66
- --mc-icon-button-size-left-icon-padding, map.get($tokens, icon-button-size-left-icon-padding)
67
- );
67
+ margin-left: mc-css-variable(icon-button-size-left-icon-padding);
68
68
  }
69
69
  }
@@ -2,32 +2,35 @@
2
2
  @use 'sass:map';
3
3
 
4
4
  @use '../core/styles/typography/typography-utils' as *;
5
+ @use '../core/styles/common/tokens' as *;
5
6
 
6
- @mixin mc-button-color($params) {
7
- color: map.get($params, color);
8
- border-color: map.get($params, border);
9
- background: map.get($params, background);
7
+
8
+ @mixin mc-button-color($component, $style-name) {
9
+ $style: map-get($component, $style-name);
10
+
11
+ color: mc-css-variable(button-#{$style-name}-color, map-get($style, color));
12
+ border-color: mc-css-variable(button-#{$style-name}-border, map-get($style, border));
13
+ background: mc-css-variable(button-#{$style-name}-background, map-get($style, background));
10
14
 
11
15
  .mc-icon {
12
- color: map.get($params, icon);
16
+ color: mc-css-variable(button-#{$style-name}-icon, map-get($style, icon));
13
17
  }
14
18
 
15
19
  &:active:not([disabled]),
16
20
  &.mc-active:not([disabled]) {
17
- border-color: map.get($params, active_border);
18
- background: map.get($params, active_background);
21
+ border-color: mc-css-variable(button-#{$style-name}-states-active-border, map-get($style, active_border));
22
+ background: mc-css-variable(button-#{$style-name}-states-active-background, map-get($style, active_background));
19
23
  }
20
-
21
24
  }
22
25
 
23
26
  @mixin mc-button_transparent($theme) {
24
- $background: map.get($theme, background);
27
+ $background: map-get($theme, background);
25
28
 
26
29
  border-color: transparent;
27
30
  background-color: transparent;
28
31
 
29
32
  &:hover:not([disabled]) {
30
- background-color: map.get($background, overlay-hover);
33
+ background-color: mc-css-variable(background-overlay-hover, map-get($background, overlay-hover));
31
34
 
32
35
  & .mc-button-overlay {
33
36
  background-color: transparent;
@@ -37,7 +40,7 @@
37
40
  &:active:not([disabled]),
38
41
  &.mc-active:not([disabled]) {
39
42
  border-color: transparent;
40
- background-color: map.get($background, overlay-active);
43
+ background-color: mc-css-variable(background-overlay-active, map-get($background, overlay-active));
41
44
  box-shadow: none;
42
45
 
43
46
  & .mc-button-overlay {
@@ -52,10 +55,11 @@
52
55
  }
53
56
 
54
57
  @mixin mc-button-theme($theme) {
55
- $background: map.get($theme, background);
56
- $primary: map.get($theme, primary);
58
+ $background: map-get($theme, background);
59
+ $theme-states: map-get($theme, states);
57
60
 
58
- $button: map.get(map.get($theme, components), button);
61
+ $button: map-get($theme, components, button);
62
+ $primary_transparent: map-get($button, primary_transparent);
59
63
 
60
64
  .mc-button-overlay {
61
65
  background: transparent;
@@ -66,23 +70,21 @@
66
70
  -webkit-font-smoothing: antialiased;
67
71
 
68
72
  &.mc-primary {
69
- @include mc-button-color(map.get($button, primary));
73
+ @include mc-button-color($button, primary);
70
74
 
71
75
  &.mc-button_transparent {
72
76
  @include mc-button_transparent($theme);
73
77
 
74
- $primary_transparent: map.get($button, primary_transparent);
75
-
76
- color: map.get($primary_transparent, color);
78
+ color: mc-css-variable(button-primary_transparent-color, map-get($primary_transparent, color));
77
79
 
78
80
  & .mc-icon {
79
- color: map.get($primary_transparent, icon);
81
+ color: mc-css-variable(button-primary_transparent-icon, map-get($primary_transparent, icon));
80
82
  }
81
83
  }
82
84
  }
83
85
 
84
86
  &.mc-secondary {
85
- @include mc-button-color(map.get($button, secondary));
87
+ @include mc-button-color($button, secondary);
86
88
 
87
89
  &.mc-button_transparent {
88
90
  @include mc-button_transparent($theme);
@@ -90,7 +92,7 @@
90
92
  }
91
93
 
92
94
  &.mc-error {
93
- @include mc-button-color(map.get($button, error));
95
+ @include mc-button-color($button, error);
94
96
 
95
97
  &.mc-button_transparent {
96
98
  @include mc-button_transparent($theme);
@@ -99,46 +101,44 @@
99
101
 
100
102
  &:hover:not([disabled]) {
101
103
  & .mc-button-overlay {
102
- background: map.get($background, overlay-hover);
104
+ background: mc-css-variable(background-overlay-hover, map-get($background, overlay-hover));
103
105
  }
104
106
  }
105
107
 
106
108
  &:active:not([disabled]),
107
109
  &.mc-active:not([disabled]) {
108
- box-shadow: map.get($button, active-shadow);
110
+ box-shadow: mc-css-variable(button-active-shadow, map-get($button, active-shadow));
109
111
  }
110
112
 
111
113
  &.mc-primary,
112
114
  &.mc-secondary,
113
115
  &.mc-error {
114
116
  &.cdk-keyboard-focused {
115
- border-color: map.get(map.get($theme, states), focused-color);
117
+ border-color: mc-css-variable(states-focused-color, map-get($theme-states, focused-color));
116
118
  box-shadow:
117
- inset 0 0 0 1px map.get($background, background),
118
- 0 0 0 1px map.get(map.get($theme, states), focused-color);
119
+ inset 0 0 0 1px mc-css-variable(background-background, map-get($background, background)),
120
+ 0 0 0 1px mc-css-variable(states-focused-color, map-get($theme-states, focused-color));
119
121
  }
120
122
  }
121
123
 
122
124
  &.mc-disabled,
123
125
  &[disabled] {
124
- opacity: map.get(map.get($theme, states), disabled-opacity);
126
+ opacity: mc-css-variable(states-disabled-opacity, map-get($theme-states, disabled-opacity));
125
127
  }
126
128
  }
127
129
  }
128
130
 
129
131
  @mixin mc-button-typography($config) {
130
- $tokens: map.get($config, tokens);
131
-
132
132
  .mc-button,
133
133
  .mc-icon-button {
134
- @include mc-typography-level-to-styles($config, map.get($tokens, button-font-default));
134
+ @include mc-typography-css-variables(button, default);
135
135
 
136
136
  &.mc-primary {
137
- @include mc-typography-level-to-styles($config, map.get($tokens, button-font-primary));
137
+ @include mc-typography-css-variables(button, primary);
138
138
  }
139
139
 
140
140
  &.mc-primary.mc-button_transparent {
141
- @include mc-typography-level-to-styles($config, map.get($tokens, button-font-primary-transparent));
141
+ @include mc-typography-css-variables(button, primary-transparent);
142
142
  }
143
143
  }
144
144
 
@@ -3,6 +3,7 @@
3
3
 
4
4
  @use 'button-base' as *;
5
5
 
6
+ @use '../core/styles/common/tokens' as *;
6
7
  @use '../core/styles/tokens';
7
8
 
8
9
 
@@ -11,8 +12,8 @@ $tokens: meta.module-variables(tokens) !default;
11
12
  .mc-button {
12
13
  @extend %mc-button-base;
13
14
 
14
- padding-left: var(--mc-button-size-horizontal-padding, map.get($tokens, button-size-horizontal-padding));
15
- padding-right: var(--mc-button-size-horizontal-padding, map.get($tokens, button-size-horizontal-padding));
15
+ padding-left: mc-css-variable(button-size-horizontal-padding);
16
+ padding-right: mc-css-variable(button-size-horizontal-padding);
16
17
  }
17
18
 
18
19
  .mc-light-button {
@@ -22,24 +23,17 @@ $tokens: meta.module-variables(tokens) !default;
22
23
  .mc-icon-button {
23
24
  @extend %mc-button-base;
24
25
 
25
- padding-left: calc(
26
- var(--mc-icon-button-size-horizontal-padding, map.get($tokens, icon-button-size-horizontal-padding)) -
27
- var(--mc-button-size-border-width, map.get($tokens, button-size-border-width))
28
- );
29
-
30
- padding-right: calc(
31
- var(--mc-icon-button-size-horizontal-padding, map.get($tokens, icon-button-size-horizontal-padding)) -
32
- var(--mc-button-size-border-width, map.get($tokens, button-size-border-width))
33
- );
26
+ padding-left: mc-css-variable(icon-button-size-horizontal-padding);
27
+ padding-right: mc-css-variable(icon-button-size-horizontal-padding);
34
28
  }
35
29
 
36
30
  .mc-button-overlay {
37
31
  position: absolute;
38
32
 
39
- top: -#{map.get($tokens, button-size-border-width)};
40
- left: -#{map.get($tokens, button-size-border-width)};
41
- right: -#{map.get($tokens, button-size-border-width)};
42
- bottom: -#{map.get($tokens, button-size-border-width)};
33
+ top: -#{getToken(button-size-border-width)};
34
+ left: -#{getToken(button-size-border-width)};
35
+ right: -#{getToken(button-size-border-width)};
36
+ bottom: -#{getToken(button-size-border-width)};
43
37
 
44
38
  border-radius: inherit;
45
39
  }
@@ -2,36 +2,41 @@
2
2
  @use 'sass:map';
3
3
 
4
4
  @use '../core/styles/typography/typography-utils' as *;
5
+ @use '../core/styles/common/tokens' as *;
6
+
7
+
8
+ @mixin mc-button-toggle-color($component, $state-name) {
9
+ $state: map-get(map-get($component, states), $state-name);
5
10
 
6
- @mixin mc-button-toggle-color($state) {
7
11
  & .mc-button-overlay {
8
- background: map.get($state, background);
9
- border-color: map.get($state, background);
12
+ background: mc-css-variable(button-toggle-states-#{$state-name}-background, map-get($state, background));
10
13
  }
11
14
 
12
15
  & .mc-icon {
13
- color: map.get($state, icon);
16
+ color: mc-css-variable(button-toggle-states-#{$state-name}-icon, map-get($state, icon));
14
17
  }
15
18
  }
16
19
 
17
20
  @mixin mc-button-toggle-theme($theme) {
18
- $button-toggle-group: map.get(map.get(map.get($theme, components), button-toggle), button-toggle-group);
19
- $button-toggle: map.get(map.get(map.get($theme, components), button-toggle), button-toggle);
20
- $states: map.get($button-toggle, states);
21
+ $theme-states: map-get($theme, states);
22
+
23
+ $button-toggle-group: map-get(map-get(map-get($theme, components), button-toggle), button-toggle-group);
24
+ $button-toggle: map-get(map-get(map-get($theme, components), button-toggle), button-toggle);
25
+ $states: map-get($button-toggle, states);
21
26
 
22
27
  .mc-button-toggle-group {
23
- background: map.get($button-toggle-group, background);
24
- border-color: map.get($button-toggle-group, border);
28
+ background: mc-css-variable(button-toggle-group-background, map-get($button-toggle-group, background));
29
+ border-color: mc-css-variable(button-toggle-group-border, map-get($button-toggle-group, border));
25
30
 
26
31
  .mc-button-toggle {
27
- & > .mc-button,
28
- & > .mc-icon-button {
29
- color: map.get($button-toggle, color);
30
- border-color: map.get($button-toggle-group, background);
32
+ > .mc-button,
33
+ > .mc-icon-button {
34
+ color: mc-css-variable(button-toggle-color, map-get($button-toggle, color));
35
+ border-color: mc-css-variable(button-toggle-group-border, map-get($button-toggle-group, border));
31
36
  background: inherit;
32
37
 
33
38
  & .mc-icon {
34
- color: map.get($button-toggle, icon);
39
+ color: mc-css-variable(button-toggle-icon, map-get($button-toggle, icon));
35
40
  }
36
41
 
37
42
  .mc-button-overlay {
@@ -39,27 +44,30 @@
39
44
  }
40
45
 
41
46
  &:hover:not([disabled], .mc-active) {
42
- @include mc-button-toggle-color(map.get($states, hover));
47
+ @include mc-button-toggle-color($button-toggle, hover);
43
48
  }
44
49
 
45
50
  &:active:not([disabled], .mc-active) {
46
- @include mc-button-toggle-color(map.get($states, active));
51
+ @include mc-button-toggle-color($button-toggle, active);
47
52
  }
48
53
 
49
54
  &.mc-active {
50
- $state: map.get($states, pressed);
55
+ $state: map-get($states, pressed);
51
56
 
52
- background: map.get($state, background);
53
- border-color: map.get($state, background);
57
+ background: mc-css-variable(button-toggle-states-pressed-background, map-get($state, background));
58
+ border-color: mc-css-variable(button-toggle-states-pressed-background, map-get($state, background));
54
59
 
55
60
  & .mc-icon {
56
- color: map.get($state, icon);
61
+ color: mc-css-variable(button-toggle-states-pressed-icon, map-get($state, icon));
57
62
  }
58
63
  }
59
64
 
60
65
  &.mc-disabled,
61
66
  &[disabled] {
62
- opacity: map.get(map.get($states, disabled), opacity);
67
+ opacity: mc-css-variable(
68
+ button-toggle-states-disabled-icon,
69
+ map-get(map-get($states, disabled), opacity)
70
+ );
63
71
  }
64
72
 
65
73
  &.cdk-keyboard-focused {
@@ -68,7 +76,7 @@
68
76
  }
69
77
 
70
78
  &.cdk-keyboard-focused {
71
- box-shadow: 0 0 0 2px map-get(map-get($theme, states), focused-color);
79
+ box-shadow: 0 0 0 2px mc-css-variable(states-focused-color, map-get($theme-states, focused-color));
72
80
  }
73
81
  }
74
82
  }
@@ -78,11 +86,11 @@
78
86
  $tokens: map.get($config, tokens);
79
87
 
80
88
  .mc-button-toggle {
81
- @include mc-typography-level-to-styles($config, map.get($tokens, button-toggle-font-default));
89
+ @include mc-typography-css-variables(button-toggle, default);
82
90
 
83
91
  > .mc-button,
84
92
  > .mc-icon-button {
85
- @include mc-typography-level-to-styles($config, map.get($tokens, button-toggle-font-default));
93
+ @include mc-typography-css-variables(button-toggle, default);
86
94
  }
87
95
  }
88
96
  }
@@ -4,6 +4,7 @@
4
4
  @use '../core/styles/common';
5
5
 
6
6
  @use '../core/styles/tokens';
7
+ @use '../core/styles/common/tokens' as *;
7
8
 
8
9
 
9
10
  $tokens: meta.module-variables(tokens) !default;
@@ -15,53 +16,28 @@ $tokens: meta.module-variables(tokens) !default;
15
16
  align-items: center;
16
17
  gap: map.get($tokens, size-3xs);
17
18
 
18
- border-width: var(
19
- --mc-button-toggle-group-size-border-width,
20
- map.get($tokens, button-toggle-group-size-border-width)
21
- );
22
- border-radius: var(
23
- --mc-button-toggle-group-size-border-radius,
24
- map.get($tokens, button-toggle-group-size-border-radius)
25
- );
19
+ border-width: mc-css-variable(button-toggle-group-size-border-width);
20
+ border-radius: mc-css-variable(button-toggle-group-size-border-radius);
26
21
  border-style: solid;
27
- padding: var(
28
- --mc-button-toggle-group-size-padding,
29
- map.get($tokens, button-toggle-group-size-padding)
30
- );
22
+ padding: mc-css-variable(button-toggle-group-size-padding);
31
23
 
32
24
  .mc-button-toggle {
33
25
  display: flex;
34
26
  overflow: hidden;
35
27
  justify-content: flex-start;
36
28
 
37
- border-radius: var(
38
- --mc-button-toggle-size-border-radius,
39
- map.get($tokens, button-toggle-size-border-radius)
40
- );
29
+ border-radius: mc-css-variable(button-toggle-size-border-radius);
41
30
 
42
31
  > .mc-button,
43
32
  > .mc-icon-button {
44
33
  border: none;
45
- border-width: var(
46
- --mc-button-toggle-size-border-width,
47
- map.get($tokens, button-toggle-size-border-width)
48
- );
49
- border-radius: var(
50
- --mc-button-toggle-size-border-radius,
51
- map.get($tokens, button-toggle-size-border-radius)
52
- );
53
- min-width: var(
54
- --mc-button-toggle-size-min-width,
55
- map.get($tokens, button-toggle-size-min-width)
56
- );
57
- padding-left: var(
58
- --mc-button-toggle-size-horizontal-padding,
59
- map.get($tokens, button-toggle-size-horizontal-padding)
60
- );
61
- padding-right: var(
62
- --mc-button-toggle-size-horizontal-padding,
63
- map.get($tokens, button-toggle-size-horizontal-padding)
64
- );
34
+ border-width: mc-css-variable(button-toggle-size-border-width);
35
+ border-radius: mc-css-variable(button-toggle-size-border-radius);
36
+
37
+ min-width: mc-css-variable(button-toggle-size-min-width);
38
+
39
+ padding-left: mc-css-variable(button-toggle-size-horizontal-padding);
40
+ padding-right: mc-css-variable(button-toggle-size-horizontal-padding);
65
41
 
66
42
  & .mc-button-wrapper {
67
43
  width: 100%;
@@ -84,10 +60,7 @@ $tokens: meta.module-variables(tokens) !default;
84
60
  &.mc-button-toggle-icon-text {
85
61
  > .mc-button,
86
62
  > .mc-icon-button {
87
- padding-left: var(
88
- --mc-button-toggle-size-left-icon-padding,
89
- map.get($tokens, button-toggle-size-left-icon-padding)
90
- );
63
+ padding-left: mc-css-variable(button-toggle-size-left-icon-padding);
91
64
 
92
65
  & .mc-icon {
93
66
  margin-right: map.get($tokens, size-xxs);
@@ -111,17 +84,11 @@ $tokens: meta.module-variables(tokens) !default;
111
84
  }
112
85
 
113
86
  &.mc-button-toggle-icon {
114
- width: var(
115
- --mc-icon-button-toggle-size-width,
116
- map.get($tokens, icon-button-toggle-size-width)
117
- );
87
+ width: mc-css-variable(icon-button-toggle-size-width);
118
88
 
119
89
  > .mc-button,
120
90
  > .mc-icon-button {
121
- width: var(
122
- --mc-icon-button-toggle-size-width,
123
- map.get($tokens, icon-button-toggle-size-width)
124
- );
91
+ width: mc-css-variable(icon-button-toggle-size-width);
125
92
  }
126
93
  }
127
94
  }
@@ -143,15 +110,9 @@ $tokens: meta.module-variables(tokens) !default;
143
110
  > .mc-button,
144
111
  > .mc-icon-button {
145
112
  width: 100%;
146
- border-width: var(
147
- --mc-button-toggle-size-border-width,
148
- map.get($tokens, button-toggle-size-border-width)
149
- );
150
-
151
- border-radius: var(
152
- --mc-button-toggle-size-border-radius,
153
- map.get($tokens, button-toggle-size-border-radius)
154
- );
113
+ border-width: mc-css-variable(button-toggle-size-border-width);
114
+
115
+ border-radius: mc-css-variable(button-toggle-size-border-radius);
155
116
  }
156
117
  }
157
118
  }