@bravura/ui 5.1.1 → 5.2.1

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.
@@ -2,6 +2,10 @@
2
2
  @use '@angular/material' as mat;
3
3
  @use './scrollbar.scss' as scrollbar;
4
4
  @use './bui-card' as card;
5
+ @use './ui-theme-legacy' as legacy;
6
+ @use '../stepper/stepper-theme' as stepper;
7
+ @use '../radio-panel/radio-panel-theme' as radio;
8
+ @use '../selection-panel/selection-panel-theme' as selection;
5
9
 
6
10
  $default-border-color-transition: border-color 100ms cubic-bezier(0.55, 0, 0.55, 0.2);
7
11
  $mat-foreground-extract: (
@@ -17,96 +21,81 @@ $mat-background-extract: (
17
21
  'background': 'body'
18
22
  );
19
23
 
20
- @mixin apply-color($name, $color, $border-color-transition: $default-border-color-transition) {
21
- .bui-border-#{$name} {
22
- border-color: $color !important;
23
- transition: $border-color-transition;
24
- }
25
- .bui-bg-#{$name} {
26
- background-color: $color !important;
27
- }
28
- .bui-color-#{$name} {
29
- color: $color !important;
30
- }
31
- .bui-outline-#{$name} {
32
- outline-color: $color !important;
33
- }
34
- }
24
+ @mixin all-component-colors($theme, $border-color-transition: $default-border-color-transition) {
25
+ @if (mat.get-theme-version($theme) == 1) {
26
+ @include stepper.color($theme);
27
+ @include radio.color($theme);
28
+ @include selection.color($theme);
35
29
 
36
- @mixin apply-colors($theme, $border-color-transition: $default-border-color-transition) {
37
- .bui-border-emphasis:hover {
38
- border-color: currentColor !important;
39
- transition: $border-color-transition;
40
- }
41
-
42
- $color-config: mat.m2-get-color-config($theme);
43
- @if $color-config != null {
44
- @include card.bui-card($color-config);
45
- @each $p in (primary, accent, warn) {
46
- $primary-palette: map.get($color-config, $p);
47
- $c: mat.m2-get-color-from-palette($primary-palette, text);
48
- @include apply-color($p, $c, $border-color-transition);
30
+ .bui-border-emphasis:hover {
31
+ border-color: currentColor !important;
32
+ transition: $border-color-transition;
49
33
  }
50
34
 
51
- $fg-original: map.get($color-config, 'foreground');
52
- $fg: map.merge(
53
- $fg-original,
54
- (
55
- inactive: rgba(map.get($fg-original, base), 0.06)
56
- )
57
- );
58
-
59
- @each $key, $name in $mat-foreground-extract {
60
- $c: map.get($fg, $key);
61
- @include apply-color($name, $c, $border-color-transition);
35
+ // @include card.bui-card($color-config);
36
+ @each $p in (primary, tertiary, secondary, error) {
37
+ $c: mat.get-theme-color($theme, $p);
38
+ @include apply-color($p, $c, $border-color-transition);
62
39
  }
63
40
 
64
41
  .bui-host {
65
- @each $p in (primary, accent, warn) {
66
- $primary-palette: map.get($color-config, $p);
67
- $c: mat.m2-get-color-from-palette($primary-palette, text);
42
+ @each $p in (primary, tertiary, secondary, error) {
43
+ $c: mat.get-theme-color($theme, $p);
68
44
  --bui-color-#{$p}: #{$c};
69
45
  }
70
46
 
71
- @each $key, $name in $mat-foreground-extract {
72
- $c: map.get($fg, $key);
73
- --bui-color-#{$name}: #{$c};
74
- }
75
-
76
- @each $key, $name in $mat-background-extract {
77
- $bg: map.get($color-config, 'background');
78
- $c: map.get($bg, $key);
79
- --bui-bg-#{$name}: #{$c};
80
- }
81
-
82
- @if map.get($color-config, 'is-dark') == false {
47
+ @if mat.get-theme-type($theme) != dark {
83
48
  --bui-color-success: #519602;
84
49
  --bui-color-info: #0dcaf0;
85
50
  --bui-color-warning: #ffc107;
86
51
  --bui-color-error: #dc3545;
87
52
  }
88
53
  }
54
+ } @else {
55
+ @include legacy.apply-colors($theme);
56
+ }
57
+ }
89
58
 
90
- $card-bg: map.get(map.get($color-config, 'background'), 'card');
91
- .iti__country-list {
92
- background-color: $card-bg;
93
- }
59
+ @mixin apply-color($name, $color, $border-color-transition: $default-border-color-transition) {
60
+ .bui-border-#{$name} {
61
+ border-color: $color !important;
62
+ transition: $border-color-transition;
63
+ }
64
+ .bui-bg-#{$name} {
65
+ background-color: $color !important;
66
+ }
67
+ .bui-color-#{$name} {
68
+ color: $color !important;
69
+ }
70
+ .bui-outline-#{$name} {
71
+ outline-color: $color !important;
94
72
  }
95
73
  }
96
74
 
75
+ @mixin apply-colors($theme, $border-color-transition: $default-border-color-transition) {
76
+ @include all-component-colors($theme, $border-color-transition);
77
+ }
78
+
97
79
  @mixin theme($theme, $border-color-transition: $default-border-color-transition) {
98
- @include apply-colors($theme, $border-color-transition);
99
- @include scrollbar.bui-scrollbar;
80
+ @if (mat.get-theme-version($theme) == 1) {
81
+ @include apply-colors($theme, $border-color-transition);
82
+ @include stepper.theme($theme);
83
+ @include radio.theme($theme);
84
+ @include selection.theme($theme);
85
+ @include scrollbar.bui-scrollbar;
100
86
 
101
- .mat-icon {
102
- &.fas,
103
- &.far,
104
- &.fab,
105
- &.fa {
106
- display: inline-flex;
107
- justify-content: center;
108
- align-items: center;
109
- font-size: 20px;
87
+ .mat-icon {
88
+ &.fas,
89
+ &.far,
90
+ &.fab,
91
+ &.fa {
92
+ display: inline-flex;
93
+ justify-content: center;
94
+ align-items: center;
95
+ font-size: 20px;
96
+ }
110
97
  }
98
+ } @else {
99
+ @include legacy.theme($theme);
111
100
  }
112
101
  }