@ptsecurity/mosaic 17.2.0 → 17.3.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 (128) hide show
  1. package/autocomplete/_autocomplete-theme.scss +2 -2
  2. package/autocomplete/autocomplete.scss +0 -2
  3. package/button/_button-theme.scss +3 -3
  4. package/button-toggle/_button-toggle-theme.scss +2 -2
  5. package/button-toggle/button-toggle.scss +2 -2
  6. package/checkbox/_checkbox-theme.scss +1 -1
  7. package/code-block/_code-block-theme.scss +3 -3
  8. package/core/form-field/form-field-ref.d.ts +13 -0
  9. package/core/form-field/index.d.ts +1 -0
  10. package/core/forms/_forms-theme.scss +3 -3
  11. package/core/option/_optgroup-theme.scss +1 -1
  12. package/core/option/_option-theme.scss +1 -1
  13. package/core/public-api.d.ts +1 -0
  14. package/core/select/common.d.ts +35 -0
  15. package/core/select/index.d.ts +1 -0
  16. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +16 -11
  17. package/core/styles/common/_groups.scss +3 -2
  18. package/core/styles/common/_popup.scss +1 -1
  19. package/core/styles/common/_tokens.scss +33 -14
  20. package/core/styles/theming/_alerts.scss +20 -19
  21. package/core/styles/theming/_badges.scss +38 -36
  22. package/core/styles/theming/_components-theming.scss +13 -13
  23. package/core/styles/theming/_scrollbars.scss +24 -27
  24. package/core/styles/theming/_theming.scss +10 -8
  25. package/core/styles/typography/_typography-utils.scss +1 -1
  26. package/core/styles/typography/_typography.scss +29 -28
  27. package/core/styles/visual/_layout.scss +14 -13
  28. package/datepicker/_datepicker-theme.scss +5 -6
  29. package/divider/_divider-theme.scss +1 -1
  30. package/dl/_dl-theme.scss +9 -9
  31. package/dropdown/_dropdown-theme.scss +4 -4
  32. package/esm2022/button-toggle/button-toggle.component.mjs +2 -2
  33. package/esm2022/core/form-field/form-field-ref.mjs +8 -0
  34. package/esm2022/core/form-field/index.mjs +2 -0
  35. package/esm2022/core/public-api.mjs +2 -1
  36. package/esm2022/core/select/common.mjs +119 -0
  37. package/esm2022/core/select/index.mjs +2 -1
  38. package/esm2022/core/version.mjs +2 -2
  39. package/esm2022/datepicker/calendar-header.component.mjs +1 -1
  40. package/esm2022/file-upload/multiple-file-upload.component.mjs +2 -2
  41. package/esm2022/file-upload/single-file-upload.component.mjs +2 -2
  42. package/esm2022/form-field/form-field.mjs +5 -11
  43. package/esm2022/form-field/password-hint.mjs +5 -4
  44. package/esm2022/modal/modal.component.mjs +2 -2
  45. package/esm2022/navbar/navbar.component.mjs +2 -2
  46. package/esm2022/navbar/vertical-navbar.component.mjs +3 -3
  47. package/esm2022/select/select.component.mjs +17 -113
  48. package/esm2022/select/select.module.mjs +17 -17
  49. package/esm2022/tabs/tab-header.component.mjs +2 -2
  50. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +2 -2
  51. package/esm2022/tags/tag-default-options.mjs +1 -1
  52. package/esm2022/tags/tag-input.mjs +17 -3
  53. package/esm2022/timepicker/timepicker.directive.mjs +10 -2
  54. package/esm2022/timezone/timezone-select.component.mjs +5 -5
  55. package/esm2022/toast/toast.service.mjs +17 -11
  56. package/esm2022/tree-select/tree-select.component.mjs +6 -7
  57. package/fesm2022/ptsecurity-mosaic-button-toggle.mjs +2 -2
  58. package/fesm2022/ptsecurity-mosaic-button-toggle.mjs.map +1 -1
  59. package/fesm2022/ptsecurity-mosaic-core.mjs +125 -4
  60. package/fesm2022/ptsecurity-mosaic-core.mjs.map +1 -1
  61. package/fesm2022/ptsecurity-mosaic-datepicker.mjs +1 -1
  62. package/fesm2022/ptsecurity-mosaic-datepicker.mjs.map +1 -1
  63. package/fesm2022/ptsecurity-mosaic-file-upload.mjs +4 -4
  64. package/fesm2022/ptsecurity-mosaic-file-upload.mjs.map +1 -1
  65. package/fesm2022/ptsecurity-mosaic-form-field.mjs +7 -13
  66. package/fesm2022/ptsecurity-mosaic-form-field.mjs.map +1 -1
  67. package/fesm2022/ptsecurity-mosaic-modal.mjs +2 -2
  68. package/fesm2022/ptsecurity-mosaic-modal.mjs.map +1 -1
  69. package/fesm2022/ptsecurity-mosaic-navbar.mjs +4 -4
  70. package/fesm2022/ptsecurity-mosaic-navbar.mjs.map +1 -1
  71. package/fesm2022/ptsecurity-mosaic-select.mjs +35 -131
  72. package/fesm2022/ptsecurity-mosaic-select.mjs.map +1 -1
  73. package/fesm2022/ptsecurity-mosaic-tabs.mjs +4 -4
  74. package/fesm2022/ptsecurity-mosaic-tabs.mjs.map +1 -1
  75. package/fesm2022/ptsecurity-mosaic-tags.mjs +17 -4
  76. package/fesm2022/ptsecurity-mosaic-tags.mjs.map +1 -1
  77. package/fesm2022/ptsecurity-mosaic-timepicker.mjs +9 -1
  78. package/fesm2022/ptsecurity-mosaic-timepicker.mjs.map +1 -1
  79. package/fesm2022/ptsecurity-mosaic-timezone.mjs +4 -4
  80. package/fesm2022/ptsecurity-mosaic-timezone.mjs.map +1 -1
  81. package/fesm2022/ptsecurity-mosaic-toast.mjs +15 -9
  82. package/fesm2022/ptsecurity-mosaic-toast.mjs.map +1 -1
  83. package/fesm2022/ptsecurity-mosaic-tree-select.mjs +6 -6
  84. package/fesm2022/ptsecurity-mosaic-tree-select.mjs.map +1 -1
  85. package/file-upload/_file-upload-theme.scss +7 -7
  86. package/file-upload/multiple-file-upload.component.scss +9 -9
  87. package/file-upload/single-file-upload.component.scss +3 -3
  88. package/form-field/_form-field-theme.scss +7 -5
  89. package/form-field/form-field.d.ts +1 -7
  90. package/form-field/form-field.scss +1 -1
  91. package/icon/_icon-theme.scss +1 -1
  92. package/input/_input-theme.scss +4 -4
  93. package/link/_link-theme.scss +3 -3
  94. package/list/_list-theme.scss +1 -1
  95. package/loader-overlay/_loader-overlay-theme.scss +2 -2
  96. package/markdown/_markdown-theme.scss +15 -15
  97. package/modal/_modal-theme.scss +4 -4
  98. package/modal/modal.scss +2 -2
  99. package/navbar/_navbar-theme.scss +6 -6
  100. package/navbar/navbar-item.scss +2 -2
  101. package/package.json +5 -5
  102. package/popover/_popover-theme.scss +4 -4
  103. package/prebuilt-themes/dark-theme.css +1 -1
  104. package/prebuilt-themes/default-theme.css +1 -1
  105. package/radio/_radio-theme.scss +2 -2
  106. package/select/_select-theme.scss +4 -4
  107. package/select/select.component.d.ts +2 -32
  108. package/select/select.module.d.ts +1 -1
  109. package/select/select.scss +1 -1
  110. package/sidepanel/_sidepanel-theme.scss +5 -5
  111. package/table/_table-theme.scss +2 -2
  112. package/tabs/_tabs-theme.scss +3 -3
  113. package/tabs/tab-header.scss +16 -12
  114. package/tabs/tab-nav-bar/tab-nav-bar.scss +15 -13
  115. package/tags/_tag-theme.scss +7 -7
  116. package/tags/tag-default-options.d.ts +1 -0
  117. package/tags/tag-input.d.ts +7 -1
  118. package/textarea/_textarea-theme.scss +2 -2
  119. package/timezone/_timezone-option-theme.scss +4 -4
  120. package/timezone/timezone-select.component.d.ts +2 -1
  121. package/toast/_toast-theme.scss +3 -3
  122. package/toast/toast.service.d.ts +8 -4
  123. package/toggle/_toggle-theme.scss +3 -3
  124. package/tooltip/_tooltip-theme.scss +4 -4
  125. package/tree/_tree-theme.scss +1 -1
  126. package/tree-select/_tree-select-theme.scss +1 -1
  127. package/tree-select/tree-select.component.d.ts +1 -2
  128. package/tree-select/tree-select.scss +1 -1
@@ -11,10 +11,10 @@
11
11
  .mc-autocomplete-panel {
12
12
  @include popup.popup-params($theme);
13
13
 
14
- color: theming.mc-color($foreground, text);
14
+ color: mc-css-variable(foreground-text, map.get($foreground, text));
15
15
 
16
16
  .mc-selected {
17
- $popup: map.get(map.get($theme, components), popup);
17
+ $popup: map.get($theme, components, popup);
18
18
 
19
19
  background-color: mc-css-variable(popup-background, map-get($popup, background));
20
20
  }
@@ -4,8 +4,6 @@
4
4
  @use '../core/styles/common/tokens' as *;
5
5
 
6
6
 
7
- $tokens: meta.module-variables(tokens) !default;
8
-
9
7
  .mc-autocomplete-trigger {
10
8
  text-overflow: ellipsis;
11
9
  }
@@ -131,14 +131,14 @@
131
131
  @mixin mc-button-typography($config) {
132
132
  .mc-button,
133
133
  .mc-icon-button {
134
- @include mc-typography-css-variables(button, default);
134
+ @include mc-typography-css-variables($config, button, default);
135
135
 
136
136
  &.mc-primary {
137
- @include mc-typography-css-variables(button, primary);
137
+ @include mc-typography-css-variables($config, button, primary);
138
138
  }
139
139
 
140
140
  &.mc-primary.mc-button_transparent {
141
- @include mc-typography-css-variables(button, primary-transparent);
141
+ @include mc-typography-css-variables($config, button, primary-transparent);
142
142
  }
143
143
  }
144
144
 
@@ -86,11 +86,11 @@
86
86
  $tokens: map.get($config, tokens);
87
87
 
88
88
  .mc-button-toggle {
89
- @include mc-typography-css-variables(button-toggle, default);
89
+ @include mc-typography-css-variables($config, button-toggle, default);
90
90
 
91
91
  > .mc-button,
92
92
  > .mc-icon-button {
93
- @include mc-typography-css-variables(button-toggle, default);
93
+ @include mc-typography-css-variables($config, button-toggle, default);
94
94
  }
95
95
  }
96
96
  }
@@ -14,7 +14,7 @@ $tokens: meta.module-variables(tokens) !default;
14
14
  display: inline-flex;
15
15
  flex-direction: row;
16
16
  align-items: center;
17
- gap: map.get($tokens, size-3xs);
17
+ gap: mc-css-variable(size-3xs);
18
18
 
19
19
  border-width: mc-css-variable(button-toggle-group-size-border-width);
20
20
  border-radius: mc-css-variable(button-toggle-group-size-border-radius);
@@ -63,7 +63,7 @@ $tokens: meta.module-variables(tokens) !default;
63
63
  padding-left: mc-css-variable(button-toggle-size-left-icon-padding);
64
64
 
65
65
  & .mc-icon {
66
- margin-right: map.get($tokens, size-xxs);
66
+ margin-right: mc-css-variable(size-xxs);
67
67
  }
68
68
  }
69
69
  }
@@ -105,6 +105,6 @@
105
105
 
106
106
  @mixin mc-checkbox-typography($config) {
107
107
  .mc-checkbox {
108
- @include mc-typography-css-variables(checkbox, default);
108
+ @include mc-typography-css-variables($config, checkbox, default);
109
109
  }
110
110
  }
@@ -6,7 +6,7 @@
6
6
  @use '../core/styles/common/tokens' as *;
7
7
 
8
8
  @mixin mc-code-block-theme($theme) {
9
- $code-block: map.get(map.get($theme, components), code-block);
9
+ $code-block: map.get($theme, components, code-block);
10
10
 
11
11
  .mc-code-block {
12
12
  background-color: mc-css-variable(code-block-main-background, map-get($code-block, main-background));
@@ -404,7 +404,7 @@
404
404
  $tokens: map.get($config, tokens);
405
405
 
406
406
  .mc-code-block {
407
- @include mc-typography-css-variables(code-block, default);
407
+ @include mc-typography-css-variables($config, code-block, default);
408
408
 
409
409
  & .mc-code-block__code {
410
410
  font: inherit;
@@ -415,7 +415,7 @@
415
415
  }
416
416
 
417
417
  & .hljs-ln-numbers {
418
- @include mc-typography-level-to-styles($config, caption-mono);
418
+ @include mc-typography-level-to-styles_css-variables($config, typography, caption-mono);
419
419
  }
420
420
  }
421
421
  }
@@ -0,0 +1,13 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export interface McFormFieldRef {
3
+ control: any;
4
+ canCleanerClearByEsc: boolean;
5
+ shouldForward(str: string): boolean;
6
+ focusViaKeyboard(): void;
7
+ }
8
+ /**
9
+ * Injection token that can be used to inject an instances of `McFormField`. It serves
10
+ * as alternative token to the actual `McFormField` class which would cause unnecessary
11
+ * retention of the `McFormField` class and its component metadata.
12
+ */
13
+ export declare const MC_FORM_FIELD_REF: InjectionToken<McFormFieldRef>;
@@ -0,0 +1 @@
1
+ export * from './form-field-ref';
@@ -91,7 +91,7 @@
91
91
 
92
92
  $foreground: map.get($theme, foreground);
93
93
 
94
- $forms: map.get(map.get($theme, components), forms);
94
+ $forms: map.get($theme, components, forms);
95
95
 
96
96
  .mc-form__label {
97
97
  color: map.get($forms, label);
@@ -104,10 +104,10 @@
104
104
 
105
105
  @mixin mc-forms-typography($config) {
106
106
  .mc-form__label {
107
- @include mc-typography-css-variables(forms, default-label);
107
+ @include mc-typography-css-variables($config, forms, default-label);
108
108
  }
109
109
 
110
110
  .mc-form__legend {
111
- @include mc-typography-css-variables(forms, default-legend);
111
+ @include mc-typography-css-variables($config, forms, default-legend);
112
112
  }
113
113
  }
@@ -19,6 +19,6 @@
19
19
 
20
20
  @mixin mc-optgroup-typography($config) {
21
21
  .mc-optgroup-label {
22
- @include mc-typography-css-variables(optgroup, default);
22
+ @include mc-typography-css-variables($config, optgroup, default);
23
23
  }
24
24
  }
@@ -36,6 +36,6 @@
36
36
 
37
37
  @mixin mc-option-typography($config) {
38
38
  .mc-option {
39
- @include mc-typography-css-variables(option, default);
39
+ @include mc-typography-css-variables($config, option, default);
40
40
  }
41
41
  }
@@ -4,6 +4,7 @@ export * from './datetime/index';
4
4
  export * from './error/error-options';
5
5
  export * from './formatters/index';
6
6
  export * from './forms/index';
7
+ export * from './form-field/index';
7
8
  export * from './highlight/index';
8
9
  export * from './label/label-options';
9
10
  export * from './line/line';
@@ -0,0 +1,35 @@
1
+ import { AfterContentInit, OnDestroy } from '@angular/core';
2
+ import { Subscription } from 'rxjs';
3
+ import { McFormFieldRef } from '../form-field';
4
+ import * as i0 from "@angular/core";
5
+ export declare class McSelectFooter {
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<McSelectFooter, never>;
7
+ static ɵdir: i0.ɵɵDirectiveDeclaration<McSelectFooter, "mc-select-footer, [mc-select-footer]", never, {}, {}, never, never, true, never>;
8
+ }
9
+ export declare class McSelectSearch implements AfterContentInit, OnDestroy {
10
+ protected formField: McFormFieldRef;
11
+ searchChangesSubscription: Subscription;
12
+ isSearchChanged: boolean;
13
+ get ngControl(): any;
14
+ constructor(formField: McFormFieldRef);
15
+ focus(): void;
16
+ reset(): void;
17
+ value(): any;
18
+ ngAfterContentInit(): void;
19
+ ngOnDestroy(): void;
20
+ handleKeydown(event: KeyboardEvent): void;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<McSelectSearch, [{ optional: true; }]>;
22
+ static ɵdir: i0.ɵɵDirectiveDeclaration<McSelectSearch, "[mcSelectSearch]", ["mcSelectSearch"], {}, {}, never, never, true, never>;
23
+ }
24
+ export declare class McSelectSearchEmptyResult {
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<McSelectSearchEmptyResult, never>;
26
+ static ɵdir: i0.ɵɵDirectiveDeclaration<McSelectSearchEmptyResult, "[mc-select-search-empty-result]", ["mcSelectSearchEmptyResult"], {}, {}, never, never, true, never>;
27
+ }
28
+ export declare class McSelectTrigger {
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<McSelectTrigger, never>;
30
+ static ɵdir: i0.ɵɵDirectiveDeclaration<McSelectTrigger, "mc-select-trigger, [mc-select-trigger]", never, {}, {}, never, never, true, never>;
31
+ }
32
+ export declare class McSelectMatcher {
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<McSelectMatcher, never>;
34
+ static ɵdir: i0.ɵɵDirectiveDeclaration<McSelectMatcher, "mc-select-matcher, [mc-select-matcher]", never, {}, {}, never, never, true, never>;
35
+ }
@@ -1,3 +1,4 @@
1
1
  export * from './events';
2
2
  export * from './errors';
3
3
  export * from './constants';
4
+ export * from './common';
@@ -1,19 +1,23 @@
1
1
  @use 'sass:map';
2
2
 
3
+ @use '../../styles/common/tokens' as *;
3
4
 
4
- @mixin mc-pseudo-checkbox-color($states) {
5
- border-color: map.get($states, border);
5
+
6
+ @mixin mc-pseudo-checkbox-color($component, $style-name) {
7
+ $style: map.get($component, $style-name);
8
+
9
+ border-color: mc-css-variable(checkbox-#{$style-name}-border, map.get($style, border));
6
10
 
7
11
  & .mc-checkbox-checkmark,
8
12
  & .mc-checkbox-mixedmark {
9
- color: map.get($states, color);
13
+ color: mc-css-variable(checkbox-#{$style-name}-color, map.get($style, color));
10
14
  }
11
15
 
12
16
  &.mc-checked,
13
17
  &.mc-indeterminate {
14
- border-color: map.get($states, checked, border);
18
+ border-color: mc-css-variable(checkbox-#{$style-name}-checked-border, map.get($style, checked, border));
15
19
 
16
- background: map.get($states, checked, background);
20
+ background: mc-css-variable(checkbox-#{$style-name}-checked-background, map.get($style, checked, background));
17
21
  }
18
22
  }
19
23
 
@@ -21,27 +25,28 @@
21
25
  $foreground: map.get($theme, foreground);
22
26
  $background: map.get($theme, background);
23
27
 
24
- $checkbox: map.get(map.get($theme, components), checkbox);
28
+ $checkbox: map.get($theme, components, checkbox);
25
29
 
26
30
  .mc-pseudo-checkbox {
27
31
  &.mc-primary {
28
- @include mc-pseudo-checkbox-color(map.get($checkbox, default));
32
+ @include mc-pseudo-checkbox-color($checkbox, default);
29
33
  }
30
34
 
31
35
  &.mc-error {
32
- @include mc-pseudo-checkbox-color(map.get($checkbox, error));
36
+ @include mc-pseudo-checkbox-color($checkbox, error);
33
37
  }
34
38
 
35
39
  &.mc-disabled,
36
40
  &.mc-primary.mc-disabled,
37
41
  &.mc-error.mc-disabled {
38
- border-color: map.get($foreground, border);
42
+ border-color: mc-css-variable(foreground-border, map.get($foreground, border));
39
43
 
40
- background-color: map.get($background, background-disabled);
44
+ background-color: mc-css-variable(
45
+ background-background-disabled, map.get($background, background-disabled));
41
46
 
42
47
  & .mc-checkbox-checkmark,
43
48
  & .mc-checkbox-mixedmark {
44
- color: map.get($foreground, text-disabled);
49
+ color: mc-css-variable(foreground-text-disabled, map.get($foreground, text-disabled));
45
50
  }
46
51
  }
47
52
  }
@@ -2,6 +2,7 @@
2
2
  @use 'sass:map';
3
3
 
4
4
  @use '../tokens';
5
+ @use '../common/tokens' as *;
5
6
 
6
7
 
7
8
  $tokens: meta.module-variables(tokens) !default;
@@ -82,7 +83,7 @@ $tokens: meta.module-variables(tokens) !default;
82
83
  &:first-child:not(:last-child) {
83
84
  @include border-bottom-radius(0);
84
85
 
85
- border-top-right-radius: var(--mc-button-size-border-radius, map.get($tokens, button-size-border-radius));
86
+ border-top-right-radius: mc-css-variable(button-size-border-radius);
86
87
 
87
88
  > .mc-form-field__container {
88
89
  @include border-bottom-radius(0);
@@ -92,7 +93,7 @@ $tokens: meta.module-variables(tokens) !default;
92
93
  &:last-child:not(:first-child) {
93
94
  @include border-top-radius(0);
94
95
 
95
- border-bottom-left-radius: var(--mc-button-size-border-radius, map.get($tokens, button-size-border-radius));
96
+ border-bottom-left-radius: mc-css-variable(button-size-border-radius);
96
97
 
97
98
  > .mc-form-field__container {
98
99
  @include border-top-radius(0);
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
  @mixin popup-params($theme) {
6
- $popup: map.get(map.get($theme, components), popup);
6
+ $popup: map.get($theme, components, popup);
7
7
 
8
8
  box-shadow: mc-css-variable(popup-shadow, map-get($popup, shadow));
9
9
  border-color: mc-css-variable(popup-border, map-get($popup, border));
@@ -6,34 +6,53 @@
6
6
  @use '../tokens';
7
7
 
8
8
 
9
- $tokens: meta.module-variables(tokens);
9
+ $default-tokens: meta.module-variables(tokens);
10
10
 
11
11
 
12
12
  @function mc-css-variable($name, $value: null) {
13
13
  @if $value {
14
14
  @return var(--mc-#{$name}, $value);
15
15
  } @else {
16
- @return var(--mc-#{$name}, map.get($tokens, $name));
16
+ @return var(--mc-#{$name}, map.get($default-tokens, $name));
17
17
  }
18
18
  }
19
19
 
20
20
  @function getToken($name) {
21
- @return map.get($tokens, $name);
21
+ @return map.get($default-tokens, $name);
22
22
  }
23
23
 
24
- @mixin mc-css-font-variable($component, $component-property, $font-property) {
24
+ @mixin mc-css-font-variable($tokens, $component, $component-property, $font-property, $font) {
25
25
  #{$font-property}: var(
26
- --mc-#{$component}-font-#{$component-property}-#{$font-property},
27
- map.get($tokens, #{$component}-font-#{$component-property}-#{$font-property})
26
+ --mc-#{$component}-#{$font}#{$component-property}-#{$font-property},
27
+ map.get($tokens, #{$component}-#{$font}#{$component-property}-#{$font-property})
28
28
  );
29
+ //@debug '_____________________________________________________________';
30
+ //@debug #{$component}-#{$font}#{$component-property}-#{$font-property};
31
+ //@debug '_____________________________________________________________';
32
+ //@debug $tokens;
29
33
  }
30
34
 
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);
35
+ @mixin mc-typography-css-variables($config, $component, $property) {
36
+ //@debug 'mc-typography-css-variables';
37
+ $tokens: map.get($config, tokens);
38
+
39
+ @include mc-css-font-variable($tokens, $component, $property, font-size, font-);
40
+ @include mc-css-font-variable($tokens, $component, $property, font-weight, font-);
41
+ @include mc-css-font-variable($tokens, $component, $property, line-height, font-);
42
+ @include mc-css-font-variable($tokens, $component, $property, font-family, font-);
43
+ @include mc-css-font-variable($tokens, $component, $property, text-transform, font-);
44
+ @include mc-css-font-variable($tokens, $component, $property, font-feature-settings, font-);
45
+ @include mc-css-font-variable($tokens, $component, $property, letter-spacing, font-);
46
+ }
47
+
48
+ @mixin mc-typography-level-to-styles_css-variables($config, $component, $property) {
49
+ $tokens: map.get($config, tokens);
50
+
51
+ @include mc-css-font-variable($tokens, $component, $property, font-size, '');
52
+ @include mc-css-font-variable($tokens, $component, $property, font-weight, '');
53
+ @include mc-css-font-variable($tokens, $component, $property, line-height, '');
54
+ @include mc-css-font-variable($tokens, $component, $property, font-family, '');
55
+ @include mc-css-font-variable($tokens, $component, $property, text-transform, '');
56
+ @include mc-css-font-variable($tokens, $component, $property, font-feature-settings, '');
57
+ @include mc-css-font-variable($tokens, $component, $property, letter-spacing, '');
39
58
  }
@@ -52,50 +52,50 @@
52
52
  }
53
53
  }
54
54
 
55
- @mixin alert-theme($alert) {
56
- background-color: map.get($alert, background);
57
- border-color: map.get($alert, border);
55
+ @mixin alert-theme($component, $style-name) {
56
+ $style: map.get($component, $style-name);
57
+
58
+ background-color: mc-css-variable(alert-#{$style-name}-background, map.get($style, background));
59
+ border-color: mc-css-variable(alert-#{$style-name}-border, map.get($style, border));
58
60
 
59
61
  .mc-icon.mc-alert__icon {
60
- color: map.get($alert, icon);
62
+ color: mc-css-variable(alert-#{$style-name}-icon, map.get($style, icon));
61
63
  }
62
64
  }
63
65
 
64
66
  @mixin mc-alert-theme($theme) {
65
67
  $foreground: map.get($theme, foreground);
66
68
 
67
- $alert: map.get(map.get($theme, components), alert);
68
-
69
- $is-dark: map.get($theme, is-dark);
69
+ $alert: map.get($theme, components, alert);
70
70
 
71
71
  .mc-alert__close:focus {
72
72
  outline: none;
73
73
  }
74
74
 
75
75
  .mc-alert {
76
- color: map.get($foreground, text);
76
+ color: mc-css-variable(foreground-text, map.get($foreground, text));
77
77
 
78
78
  @include mc-alert-geometry(map.get($theme, tokens));
79
79
  }
80
80
 
81
81
  .mc-alert_error {
82
- @include alert-theme(map.get($alert, error));
82
+ @include alert-theme($alert, error);
83
83
  }
84
84
 
85
85
  .mc-alert_warning {
86
- @include alert-theme(map.get($alert, warning));
86
+ @include alert-theme($alert, warning);
87
87
  }
88
88
 
89
89
  .mc-alert_success {
90
- @include alert-theme(map.get($alert, success));
90
+ @include alert-theme($alert, success);
91
91
  }
92
92
 
93
93
  .mc-alert_info {
94
- @include alert-theme(map.get($alert, info));
94
+ @include alert-theme($alert, info);
95
95
  }
96
96
 
97
97
  .mc-alert:not(.mc-alert_error):not(.mc-alert_warning):not(.mc-alert_success):not(.mc-alert_info) {
98
- @include alert-theme(map.get($alert, default));
98
+ @include alert-theme($alert, default);
99
99
  }
100
100
  }
101
101
 
@@ -128,29 +128,30 @@
128
128
 
129
129
  &.mc-alert_dismissible {
130
130
  padding-right: calc(
131
- mc-css-variable(alert-size-right-padding-dismissible) + mc-css-variable(alert-size-horizontal-padding)
131
+ var(--mc-alert-size-right-padding-dismissible, #{map.get($tokens, alert-size-close-button-width)}) +
132
+ var(--mc-alert-size-horizontal-padding, #{map.get($tokens, alert-size-horizontal-padding)})
132
133
  );
133
134
  }
134
135
  }
135
136
 
136
137
  @mixin mc-alert-typography($config) {
137
138
  .mc-alert:not(.mc-alert_small) {
138
- @include mc-typography-css-variables(alert, default-body);
139
+ @include mc-typography-css-variables($config, alert, default-body);
139
140
 
140
141
  header {
141
- @include mc-typography-css-variables(alert, default-header);
142
+ @include mc-typography-css-variables($config, alert, default-header);
142
143
  }
143
144
  }
144
145
 
145
146
  .mc-alert.mc-alert_small {
146
- @include mc-typography-css-variables(alert, small-body);
147
+ @include mc-typography-css-variables($config, alert, small-body);
147
148
 
148
149
  header {
149
- @include mc-typography-css-variables(alert, small-header);
150
+ @include mc-typography-css-variables($config, alert, small-header);
150
151
  }
151
152
 
152
153
  .mc-link__text {
153
- @include mc-typography-css-variables(alert, small-body);
154
+ @include mc-typography-css-variables($config, alert, small-body);
154
155
  }
155
156
  }
156
157
 
@@ -19,19 +19,21 @@
19
19
  }
20
20
 
21
21
 
22
- @mixin mc-badge-color($params) {
23
- color: map.get($params, color);
24
- border-color: map.get($params, border);
25
- background: map.get($params, background);
22
+ @mixin mc-badge-color($component, $style-name) {
23
+ $style: map.get($component, $style-name);
24
+
25
+ color: mc-css-variable(badge-#{$style-name}-color, map.get($style, color));
26
+ border-color: mc-css-variable(badge-#{$style-name}-border, map.get($style, border));
27
+ background: mc-css-variable(badge-#{$style-name}-background, map.get($style, background));
26
28
  }
27
29
 
28
30
  @mixin mc-badge-theme($theme) {
29
31
  $foreground: map.get($theme, foreground);
30
- $badge: map.get(map.get($theme, components), badge);
32
+ $badge: map.get($theme, components, badge);
31
33
 
32
34
  .mc-badge {
33
- color: map.get($foreground, text);
34
- border-color: map.get($foreground, border);
35
+ color: mc-css-variable(foreground-text, map.get($foreground, text));
36
+ border-color: mc-css-variable(foreground-border, map.get($foreground, border));
35
37
 
36
38
  }
37
39
 
@@ -39,57 +41,57 @@
39
41
 
40
42
  .mc-badge_solid {
41
43
  &.mc-badge_primary {
42
- @include mc-badge-color(map.get($badge, primary_solid));
44
+ @include mc-badge-color($badge, solid-primary);
43
45
  }
44
46
 
45
47
  &.mc-badge_second {
46
- @include mc-badge-color(map.get($badge, second_solid));
48
+ @include mc-badge-color($badge, solid-secondary);
47
49
  }
48
50
 
49
51
  &.mc-badge_transparent {
50
- @include mc-badge-color(map.get($badge, transparent_solid));
52
+ @include mc-badge-color($badge, solid-transparent);
51
53
  }
52
54
 
53
55
  &.mc-badge_success {
54
- @include mc-badge-color(map.get($badge, success_solid));
56
+ @include mc-badge-color($badge, solid-success);
55
57
  }
56
58
 
57
59
  &.mc-badge_info {
58
- @include mc-badge-color(map.get($badge, info_solid));
60
+ @include mc-badge-color($badge, solid-info);
59
61
  }
60
62
 
61
63
  &.mc-badge_warning {
62
- @include mc-badge-color(map.get($badge, warning_solid));
64
+ @include mc-badge-color($badge, solid-warning);
63
65
  }
64
66
 
65
67
  &.mc-badge_error {
66
- @include mc-badge-color(map.get($badge, error_solid));
68
+ @include mc-badge-color($badge, solid-error);
67
69
  }
68
70
 
69
71
  &.mc-badge_light {
70
- @include mc-badge-color(map.get($badge, light_solid));
72
+ @include mc-badge-color($badge, solid-light);
71
73
  }
72
74
  }
73
75
 
74
76
  .mc-badge_pastel {
75
77
  &.mc-badge_primary {
76
- @include mc-badge-color(map.get($badge, primary_pastel));
78
+ @include mc-badge-color($badge, pastel-primary);
77
79
  }
78
80
 
79
81
  &.mc-badge_success {
80
- @include mc-badge-color(map.get($badge, success_pastel));
82
+ @include mc-badge-color($badge, pastel-success);
81
83
  }
82
84
 
83
85
  &.mc-badge_info {
84
- @include mc-badge-color(map-get($badge, info_pastel));
86
+ @include mc-badge-color($badge, pastel-info);
85
87
  }
86
88
 
87
89
  &.mc-badge_warning {
88
- @include mc-badge-color(map.get($badge, warning_pastel));
90
+ @include mc-badge-color($badge, pastel-warning);
89
91
  }
90
92
 
91
93
  &.mc-badge_error {
92
- @include mc-badge-color(map.get($badge, error_pastel));
94
+ @include mc-badge-color($badge, pastel-error);
93
95
  }
94
96
  }
95
97
  }
@@ -97,22 +99,22 @@
97
99
  @mixin mc-badges-geometry($tokens) {
98
100
  .mc-badge {
99
101
  &.mc-badge_default {
100
- height: var(--mc-badge-size-default-height, map.get($tokens, badge-size-default-height));
101
- min-width: var(--mc-badge-size-default-min-width, map.get($tokens, badge-size-default-min-width));
102
- padding: var(--mc-badge-size-default-padding, map.get($tokens, badge-size-default-padding));
102
+ height: mc-css-variable(badge-size-default-height);
103
+ min-width: mc-css-variable(badge-size-default-min-width);
104
+ padding: mc-css-variable(badge-size-default-padding);
103
105
  border: {
104
- width: var(--mc-badge-size-default-border-width, map.get($tokens, badge-size-default-border-width));
105
- radius: var(--mc-badge-size-default-border-radius, map.get($tokens, badge-size-default-border-radius));
106
+ width: mc-css-variable(badge-size-default-border-width);
107
+ radius: mc-css-variable(badge-size-default-border-radius);
106
108
  }
107
109
  }
108
110
 
109
111
  &.mc-badge_mini {
110
- height: var(--mc-badge-size-mini-height, map.get($tokens, badge-size-mini-height));
111
- min-width: var(--mc-badge-size-mini-min-width, map.get($tokens, badge-size-mini-min-width));
112
- padding: var(--mc-badge-size-mini-padding, map.get($tokens, badge-size-mini-padding));
112
+ height: mc-css-variable(badge-size-mini-height);
113
+ min-width: mc-css-variable(badge-size-mini-min-width);
114
+ padding: mc-css-variable(badge-size-mini-padding);
113
115
  border: {
114
- width: var(--mc-badge-size-mini-border-width, map.get($tokens, badge-size-mini-border-width));
115
- radius: var(--mc-badge-size-mini-border-radius, map.get($tokens, badge-size-mini-border-radius));
116
+ width: mc-css-variable(badge-size-mini-border-width);
117
+ radius: mc-css-variable(badge-size-mini-border-radius);
116
118
  }
117
119
  }
118
120
  }
@@ -120,26 +122,26 @@
120
122
 
121
123
  @mixin mc-badge-typography($config) {
122
124
  .mc-badge_default {
123
- @include mc-typography-css-variables(badge, default-default);
125
+ @include mc-typography-css-variables($config, badge, default-default);
124
126
 
125
127
  &.mc-badge_caps {
126
- @include mc-typography-css-variables(badge, default-caps);
128
+ @include mc-typography-css-variables($config, badge, default-caps);
127
129
  }
128
130
 
129
131
  &.mc-badge_mono {
130
- @include mc-typography-css-variables(badge, default-mono);
132
+ @include mc-typography-css-variables($config, badge, default-mono);
131
133
  }
132
134
  }
133
135
 
134
136
  .mc-badge_mini {
135
- @include mc-typography-css-variables(badge, mini-default);
137
+ @include mc-typography-css-variables($config, badge, mini-default);
136
138
 
137
139
  &.mc-badge_caps {
138
- @include mc-typography-css-variables(badge, mini-caps);
140
+ @include mc-typography-css-variables($config, badge, mini-caps);
139
141
  }
140
142
 
141
143
  &.mc-badge_mono {
142
- @include mc-typography-css-variables(badge, mini-mono);
144
+ @include mc-typography-css-variables($config, badge, mini-mono);
143
145
  }
144
146
  }
145
147
  }