@gravitee/ui-particles-angular 11.0.1-fix-pre-angular-17-547a20e → 11.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravitee/ui-particles-angular",
3
- "version": "11.0.1-fix-pre-angular-17-547a20e",
3
+ "version": "11.1.0",
4
4
  "description": "Gravitee.io - UI Particles Angular",
5
5
  "repository": {
6
6
  "type": "git",
@@ -62,10 +62,20 @@ $typography: map.get(theme.$mat-theme, typography);
62
62
  }
63
63
  }
64
64
 
65
+ // TODO(mdc-migration): remove when legacy theme is removed
66
+ .gio-radio-button.mat-radio-checked {
67
+ border: 2px solid mat.get-color-from-palette(palettes.$mat-accent-palette, 'default');
68
+ }
69
+
65
70
  .gio-radio-button.mat-mdc-radio-checked {
66
71
  border: 2px solid mat.get-color-from-palette(palettes.$mat-accent-palette, 'default');
67
72
  }
68
73
 
74
+ // TODO(mdc-migration): remove when legacy theme is removed
75
+ .mat-radio-checked .mat-icon {
76
+ color: mat.get-color-from-palette(palettes.$mat-accent-palette, 'default');
77
+ }
78
+
69
79
  .mat-mdc-radio-checked .mat-icon {
70
80
  color: mat.get-color-from-palette(palettes.$mat-accent-palette, 'default');
71
81
  }
@@ -80,10 +90,20 @@ $typography: map.get(theme.$mat-theme, typography);
80
90
  @include gio-radio-button;
81
91
  }
82
92
 
93
+ // TODO(mdc-migration): remove when legacy theme is removed
94
+ .gio-radio-button.mat-radio-checked {
95
+ border: 2px solid mat.get-color-from-palette(palettes.$mat-accent-palette, 'default');
96
+ }
97
+
83
98
  .gio-radio-button.mat-mdc-radio-checked {
84
99
  border: 2px solid mat.get-color-from-palette(palettes.$mat-accent-palette, 'default');
85
100
  }
86
101
 
102
+ // TODO(mdc-migration): remove when legacy theme is removed
103
+ .gio-radio-button.mat-radio-checked .mat-icon {
104
+ color: mat.get-color-from-palette(palettes.$mat-accent-palette, 'default');
105
+ }
106
+
87
107
  .gio-radio-button.mat-mdc-radio-checked .mat-icon {
88
108
  color: mat.get-color-from-palette(palettes.$mat-accent-palette, 'default');
89
109
  }
@@ -0,0 +1,100 @@
1
+ /*
2
+ * Copyright (C) 2021 The Gravitee team (http://gravitee.io)
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ @use 'sass:map';
17
+ @use '@angular/material' as mat;
18
+
19
+ @use './gio-mat-palettes' as palettes;
20
+
21
+ // Config mat Typography
22
+ $mat-legacy-typography: mat.define-legacy-typography-config(
23
+ $font-family: '"Golos UI", Roboto, "Helvetica Neue", sans-serif',
24
+ $display-4: mat.define-typography-level(112px, 112px, 400, $letter-spacing: -0.05em),
25
+ $display-3: mat.define-typography-level(56px, 56px, 400, $letter-spacing: -0.02em),
26
+ $display-2: mat.define-typography-level(45px, 48px, 400, $letter-spacing: -0.005em),
27
+ $display-1: mat.define-typography-level(60px, 66px, 600, $letter-spacing: -0.5px),
28
+ $headline: mat.define-typography-level(42px, 52px, 600),
29
+ $title: mat.define-typography-level(26px, 36px, 600),
30
+ $subheading-2: mat.define-typography-level(18px, 24px, 600, $letter-spacing: 0.4px),
31
+ $subheading-1: mat.define-typography-level(16px, 24px, 600, $letter-spacing: 0.4px),
32
+ $body-2: mat.define-typography-level(14px, 20px, 600, $letter-spacing: 0.4px),
33
+ $body-1: mat.define-typography-level(14px, 20px, 400, $letter-spacing: 0.4px),
34
+ $caption: mat.define-typography-level(12px, 16px, 400),
35
+ $button: mat.define-typography-level(14px, 14px, 500),
36
+ $input: mat.define-typography-level(inherit, 1.125, 400),
37
+ );
38
+
39
+ // Mat default light theme
40
+ $mat-theme-default: mat.define-light-theme(
41
+ (
42
+ color: (
43
+ primary: palettes.$mat-primary-palette,
44
+ accent: palettes.$mat-accent-palette,
45
+ warn: palettes.$mat-error-palette,
46
+ ),
47
+ typography: $mat-legacy-typography,
48
+ )
49
+ );
50
+
51
+ // Mat default dark theme
52
+ $mat-legacy-theme-dark: mat.define-dark-theme(
53
+ (
54
+ color: (
55
+ primary: palettes.$mat-primary-palette,
56
+ accent: palettes.$mat-accent-palette,
57
+ warn: palettes.$mat-error-palette,
58
+ ),
59
+ typography: $mat-legacy-typography,
60
+ )
61
+ );
62
+
63
+ // Custom mat background & foreground color
64
+ $mat-background: map.get($mat-theme-default, background);
65
+ $mat-foreground: map.get($mat-theme-default, foreground);
66
+
67
+ // Override $light-theme-background-palette config from node_modules/@angular/material/core/theming/_palette.scss
68
+ $gio-background: map.merge(
69
+ $mat-background,
70
+ (
71
+ background: mat.get-color-from-palette(palettes.$mat-dove-palette, default),
72
+ tooltip: mat.get-color-from-palette(palettes.$mat-space-palette, default),
73
+ )
74
+ );
75
+
76
+ // Override $light-theme-foreground-palette config from node_modules/@angular/material/core/theming/_palette.scss
77
+ $gio-foreground: map.merge(
78
+ $mat-foreground,
79
+ (
80
+ text: mat.get-color-from-palette(palettes.$mat-space-palette, default),
81
+ slider-min: mat.get-color-from-palette(palettes.$mat-space-palette, default),
82
+ )
83
+ );
84
+ $gio-background-foreground: (
85
+ background: $gio-background,
86
+ foreground: $gio-foreground,
87
+ );
88
+
89
+ // For backward compatibility with Material Design merge $gio-background-foreground into $mat-theme-default and into $mat-theme-default.color.
90
+ // Otherwise the colors of bg and fg seton partially applied
91
+ $mat-legacy-color: map.merge(map.get($mat-theme-default, color), $gio-background-foreground);
92
+ $mat-legacy-theme: map.merge(
93
+ $mat-theme-default,
94
+ map.merge(
95
+ $gio-background-foreground,
96
+ (
97
+ color: $mat-legacy-color,
98
+ )
99
+ )
100
+ );
@@ -15,28 +15,55 @@
15
15
  */
16
16
  @use '@angular/material' as mat;
17
17
 
18
+ @use './gio-mat-legacy-theme-variable' as legacy-theme-variable;
18
19
  @use './gio-mat-theme-variable' as theme-variable;
19
20
 
20
21
  @use './mat-override' as override;
21
22
 
22
23
  // Config material theme with gio theme
23
- @mixin mat-theme {
24
+ @mixin mat-theme($legacy: false) {
25
+ // TODO(v15): As of v15 mat.legacy-core no longer includes default typography styles.
26
+ // The following line adds:
27
+ // 1. Default typography styles for all components
28
+ // 2. Styles for typography hierarchy classes (e.g. .mat-headline-1)
29
+ // If you specify typography styles for the components you use elsewhere, you should delete this line.
30
+ // If you don't need the default component typographies but still want the hierarchy styles,
31
+ // you can delete this line and instead use:
32
+ // `@include mat.legacy-typography-hierarchy(theme-variable.$mat-typography);`
33
+
34
+ /*
35
+ TODO(mdc-migration): Remove all-legacy-component-typographies once all legacy components are migrated
36
+ */
37
+ @include mat.all-legacy-component-typographies(legacy-theme-variable.$mat-legacy-typography);
24
38
  @include mat.all-component-typographies(theme-variable.$mat-typography);
25
39
 
40
+ /*
41
+ TODO(mdc-migration): Remove legacy-core once all legacy components are migrated
42
+ */
43
+ @include mat.legacy-core;
26
44
  @include mat.core;
27
45
 
46
+ /*
47
+ TODO(mdc-migration): Remove all-legacy-component-themes once all legacy components are migrated
48
+ */
49
+ @include mat.all-legacy-component-themes(legacy-theme-variable.$mat-legacy-theme);
28
50
  @include mat.all-component-themes(theme-variable.$mat-theme);
29
51
 
30
- @include mat.typography-hierarchy(theme-variable.$mat-typography);
52
+ @if $legacy {
53
+ @include mat.legacy-typography-hierarchy(legacy-theme-variable.$mat-legacy-typography);
54
+ } @else {
55
+ @include mat.typography-hierarchy(theme-variable.$mat-typography);
56
+ }
31
57
 
32
- // Gio overrides
33
58
  @include mat.form-field-density(-1);
34
59
 
60
+ // Gio overrides
35
61
  @include override.mat-h5;
36
62
  @include override.mat-form-field;
37
63
  @include override.mat-table;
38
64
  @include override.mat-card;
39
65
  @include override.mat-list;
66
+ @include override.mat-tabs;
40
67
  @include override.mat-option;
41
68
  @include override.mat-button;
42
69
  }
@@ -22,6 +22,7 @@
22
22
  @forward './theme/typography/gio-typography' show subtitle-typography, code-typography, link-typography, caption-2;
23
23
 
24
24
  @forward './gio-mat-theme-variable' show $mat-theme, $mat-typography, $mat-theme-dark;
25
+ @forward './gio-mat-legacy-theme-variable' show $mat-legacy-theme, $mat-legacy-typography, $mat-legacy-theme-dark;
25
26
 
26
27
  @forward './gio-fonts' show import-fonts;
27
28
 
@@ -18,5 +18,6 @@
18
18
  @forward 'mat-card';
19
19
  @forward 'mat-list' show mat-list;
20
20
  @forward 'mat-h5';
21
+ @forward 'mat-tabs';
21
22
  @forward 'mat-option';
22
23
  @forward 'mat-button';
@@ -14,6 +14,77 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  @mixin mat-button() {
17
+ // Legacy mat-button
18
+ .mat-button.mat-button-base,
19
+ .mat-stroked-button.mat-button-base,
20
+ .mat-raised-button.mat-button-base,
21
+ .mat-flat-button.mat-button-base {
22
+ border-radius: 8px;
23
+
24
+ &:hover {
25
+ filter: brightness(115%);
26
+ transition: all 0.3s linear;
27
+ }
28
+ }
29
+
30
+ .mat-icon-button.mat-button-base:hover {
31
+ filter: brightness(115%);
32
+ transition: all 0.3s linear;
33
+ }
34
+
35
+ .mat-button,
36
+ .mat-raised-button,
37
+ .mat-flat-button,
38
+ .mat-stroked-button {
39
+ .mat-icon {
40
+ width: 18px;
41
+ height: 18px;
42
+ margin-top: -2px; // Center horizontally icon with text. 18 for icon 14 for text so up with -2px
43
+ margin-right: 8px;
44
+ line-height: 18px;
45
+ }
46
+
47
+ .mat-icon.mat-icon-right {
48
+ margin-right: 0;
49
+ margin-left: 8px;
50
+ }
51
+ }
52
+
53
+ .mat-icon-button {
54
+ .mat-icon:has(svg) {
55
+ margin-top: -2px; // Center horizontally icon
56
+ }
57
+ }
58
+
59
+ .mat-button.mat-icon-button {
60
+ width: 36px;
61
+ height: 36px;
62
+ line-height: 24px;
63
+
64
+ .mat-icon {
65
+ width: 24px;
66
+ height: 24px;
67
+ margin-right: 0;
68
+ line-height: 24px;
69
+ }
70
+ }
71
+
72
+ .mat-flat-button.mat-icon-button,
73
+ .mat-stroked-button.mat-icon-button {
74
+ width: 36px;
75
+ height: 36px;
76
+ line-height: 18px;
77
+
78
+ .mat-icon {
79
+ width: 18px;
80
+ height: 18px;
81
+ margin-right: 0;
82
+ margin-left: 0;
83
+ line-height: 18px;
84
+ }
85
+ }
86
+
87
+ // MDC mat-button
17
88
  .mdc-button {
18
89
  &:has(.mdc-button__label:empty) {
19
90
  min-width: 36px;
@@ -16,6 +16,11 @@
16
16
  @use '@angular/material' as mat;
17
17
 
18
18
  @mixin mat-card() {
19
+ // Legacy mat-card
20
+ .mat-card:not(.mat-card .mat-card, [class*='mat-elevation-z']) {
21
+ @include mat.elevation(3);
22
+ }
23
+
19
24
  // Mat card MDC
20
25
  .mat-mdc-card:not(.mat-mdc-card .mat-mdc-card, [class*='mat-mdc-elevation-z'], [class*='mat-elevation-z'], [appearance='outlined']) {
21
26
  @include mat.elevation(3);
@@ -20,6 +20,38 @@
20
20
  @use '../gio-mat-palettes' as palettes;
21
21
 
22
22
  @mixin mat-form-field() {
23
+ // Legacy mat-form-field
24
+ .mat-form-field:not([class*='mat-paginator']) {
25
+ // Increase default padding to have space for two lines of hint & error bellow the input
26
+ padding-bottom: 16px;
27
+
28
+ .mat-hint,
29
+ .mat-error {
30
+ font-size: mat.font-size(theme.$mat-typography, caption);
31
+ }
32
+ }
33
+
34
+ .mat-form-field-disabled * {
35
+ cursor: not-allowed !important;
36
+ }
37
+
38
+ .mat-form-field-prefix {
39
+ // Apply same margin as the one on the left of the prefix
40
+ margin-right: 0.75em;
41
+ color: mat.get-color-from-palette(palettes.$mat-space-palette, 'lighter30');
42
+ }
43
+
44
+ .mat-form-field-appearance-outline .mat-form-field-prefix,
45
+ .mat-form-field-appearance-outline .mat-form-field-suffix {
46
+ place-self: center;
47
+ }
48
+
49
+ .mat-form-field-appearance-outline .mat-form-field-infix {
50
+ padding-top: 0.8em;
51
+ }
52
+
53
+ // MDC mat-form-field
54
+
23
55
  .mat-mdc-form-field {
24
56
  margin: 0.45em 0;
25
57
  }
@@ -21,6 +21,26 @@
21
21
  $background: map.get(theme.$mat-theme, background);
22
22
 
23
23
  @mixin mat-list() {
24
+ // Legacy mat-list
25
+
26
+ /**
27
+ * When a Mat List is inside a Mat Card then set a negative to balance default padding of the Mat Card
28
+ */
29
+ .mat-card > .mat-list {
30
+ margin: -16px;
31
+ }
32
+
33
+ /**
34
+ * Change background color of each list item on hover
35
+ */
36
+ .mat-list-item {
37
+ &:hover {
38
+ background-color: mat.get-color-from-palette($background, hover);
39
+ }
40
+ }
41
+
42
+ // MDC mat-list
43
+
24
44
  /**
25
45
  * Change background color of each list item on hover
26
46
  */
@@ -16,9 +16,19 @@
16
16
 
17
17
  @use '@angular/material' as mat;
18
18
 
19
+ @use '../gio-mat-legacy-theme-variable' as theme-legacy;
19
20
  @use '../gio-mat-theme-variable' as theme;
20
21
 
21
22
  @mixin mat-option() {
23
+ // Legacy mat-option
24
+ .mat-option,
25
+ .mat-typography .mat-option {
26
+ height: 40px;
27
+ font-size: mat.font-size(theme-legacy.$mat-legacy-typography, input);
28
+ line-height: mat.line-height(theme-legacy.$mat-legacy-typography, input);
29
+ }
30
+
31
+ // MDC mat-option
22
32
  .mat-typography .mat-mdc-option {
23
33
  min-height: 40px;
24
34
  @include mat.typography-level(theme.$mat-typography, 'body-2');
@@ -21,6 +21,37 @@
21
21
  $background: map.get(theme.$mat-theme, background);
22
22
 
23
23
  @mixin mat-table() {
24
+ // Legacy mat-table
25
+ .mat-table {
26
+ tbody tr:hover {
27
+ background-color: mat.get-color-from-palette($background, hover);
28
+ }
29
+
30
+ // Remove bottom padding on mat-form-field inside mat-cell
31
+ // Note: In Angular 15, we should be able to use SubscriptSizing option for that
32
+ .mat-cell {
33
+ // appearance=outline
34
+ .mat-form-field.mat-form-field-appearance-outline:not(:has(mat-hint), :has(mat-error)) {
35
+ padding-bottom: 0;
36
+
37
+ .mat-form-field-wrapper {
38
+ padding-bottom: 0;
39
+ }
40
+ }
41
+
42
+ // appearance=standard
43
+ .mat-form-field.mat-form-field-appearance-standard:not(:has(mat-hint), :has(mat-error)) {
44
+ padding-bottom: 0;
45
+
46
+ .mat-form-field-wrapper {
47
+ // stylelint-disable-next-line number-max-precision
48
+ margin-bottom: -1.34375em;
49
+ }
50
+ }
51
+ }
52
+ }
53
+
54
+ // MDC mat-table
24
55
  .mat-mdc-table {
25
56
  tbody tr.mat-mdc-row:hover {
26
57
  background-color: mat.get-color-from-palette($background, hover);
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright (C) 2022 The Gravitee team (http://gravitee.io)
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ @mixin mat-tabs() {
17
+ // Legacy mat-tabs
18
+ .mat-tab-group {
19
+ .mat-tab-label {
20
+ min-width: unset;
21
+ }
22
+ }
23
+ }