@porscheinformatik/material-addons 21.0.3 → 22.0.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": "@porscheinformatik/material-addons",
3
- "version": "21.0.3",
3
+ "version": "22.0.0",
4
4
  "description": "Custom theme and components for Angular Material",
5
5
  "homepage": "https://github.com/porscheinformatik/material-addons",
6
6
  "repository": {
@@ -45,7 +45,7 @@
45
45
  "roboto-fontface": "0.10.0",
46
46
  "luxon": "^3.5.0",
47
47
  "material-icons": "^1.13.13",
48
- "uuid": "^10.0.0"
48
+ "uuid": "^13.0.0"
49
49
  },
50
50
  "exports": {
51
51
  "./package.json": {
@@ -0,0 +1,137 @@
1
+ // This file was generated by running 'ng generate @angular/material:theme-color'.
2
+ // Proceed with caution if making changes to this file.
3
+
4
+ @use 'sass:map';
5
+ @use '@angular/material' as mat;
6
+
7
+ // Note: Color palettes are generated from primary: #0072a3, tertiary: #005073, error: #c21d00
8
+ $_palettes: (
9
+ primary: (
10
+ 0: #000000,
11
+ 10: #001e2f,
12
+ 20: #00344d,
13
+ 25: #00405d,
14
+ 30: #004c6e,
15
+ 35: #00587f,
16
+ 40: #006590,
17
+ 50: #207eb0,
18
+ 60: #4498cb,
19
+ 70: #63b3e8,
20
+ 80: #89ceff,
21
+ 90: #c8e6ff,
22
+ 95: #e5f2ff,
23
+ 98: #f6faff,
24
+ 99: #fcfcff,
25
+ 100: #ffffff,
26
+ ),
27
+ secondary: (
28
+ 0: #000000,
29
+ 10: #001e2f,
30
+ 20: #163346,
31
+ 25: #223e51,
32
+ 30: #2e4a5d,
33
+ 35: #3a5569,
34
+ 40: #466276,
35
+ 50: #5f7a8f,
36
+ 60: #7894aa,
37
+ 70: #93afc5,
38
+ 80: #aecae1,
39
+ 90: #c9e6fe,
40
+ 95: #e5f2ff,
41
+ 98: #f6faff,
42
+ 99: #fcfcff,
43
+ 100: #ffffff,
44
+ ),
45
+ tertiary: (
46
+ 0: #000000,
47
+ 10: #001e2e,
48
+ 20: #00344d,
49
+ 25: #00405d,
50
+ 30: #004c6d,
51
+ 35: #12587b,
52
+ 40: #246488,
53
+ 50: #427da2,
54
+ 60: #5d97bd,
55
+ 70: #78b2d9,
56
+ 80: #94cdf6,
57
+ 90: #c8e6ff,
58
+ 95: #e5f2ff,
59
+ 98: #f6faff,
60
+ 99: #fbfcff,
61
+ 100: #ffffff,
62
+ ),
63
+ neutral: (
64
+ 0: #000000,
65
+ 10: #181c1f,
66
+ 20: #2d3134,
67
+ 25: #383c3f,
68
+ 30: #43474b,
69
+ 35: #4f5357,
70
+ 40: #5b5f63,
71
+ 50: #74777b,
72
+ 60: #8e9195,
73
+ 70: #a8abb0,
74
+ 80: #c4c7cb,
75
+ 90: #e0e3e7,
76
+ 95: #eef1f5,
77
+ 98: #f7f9fe,
78
+ 99: #fcfcff,
79
+ 100: #ffffff,
80
+ 4: #0b0f12,
81
+ 6: #101417,
82
+ 12: #1c2023,
83
+ 17: #272a2e,
84
+ 22: #313539,
85
+ 24: #363a3d,
86
+ 87: #d7dade,
87
+ 92: #e6e8ed,
88
+ 94: #ebeef2,
89
+ 96: #f1f4f8,
90
+ ),
91
+ neutral-variant: (
92
+ 0: #000000,
93
+ 10: #141d23,
94
+ 20: #293138,
95
+ 25: #343c43,
96
+ 30: #40484f,
97
+ 35: #4b535b,
98
+ 40: #575f67,
99
+ 50: #707880,
100
+ 60: #89929a,
101
+ 70: #a4acb4,
102
+ 80: #bfc7d0,
103
+ 90: #dbe3ec,
104
+ 95: #eaf2fa,
105
+ 98: #f6faff,
106
+ 99: #fcfcff,
107
+ 100: #ffffff,
108
+ ),
109
+ error: (
110
+ 0: #000000,
111
+ 10: #3f0400,
112
+ 20: #650a00,
113
+ 25: #790e00,
114
+ 30: #8e1300,
115
+ 35: #a41700,
116
+ 40: #ba1b00,
117
+ 50: #e03417,
118
+ 60: #ff5637,
119
+ 70: #ff8a73,
120
+ 80: #ffb4a5,
121
+ 90: #ffdad3,
122
+ 95: #ffede9,
123
+ 98: #fff8f6,
124
+ 99: #fffbff,
125
+ 100: #ffffff,
126
+ ),
127
+ );
128
+
129
+ $_rest: (
130
+ secondary: map.get($_palettes, secondary),
131
+ neutral: map.get($_palettes, neutral),
132
+ neutral-variant: map.get($_palettes, neutral-variant),
133
+ error: map.get($_palettes, error),
134
+ );
135
+
136
+ $primary-palette: map.merge(map.get($_palettes, primary), $_rest);
137
+ $tertiary-palette: map.merge(map.get($_palettes, tertiary), $_rest);
@@ -1,43 +1,43 @@
1
- @use 'sass:map';
2
1
  @use '@angular/material' as mat;
3
2
  @use './common/theme' as theme;
4
3
  @use './common/styles' as common;
5
- @use './common/button';
4
+ @use './common/theme-entry' as theme-entry;
5
+ @use './carcat-palettes' as carcat;
6
6
 
7
- $theme-name: 'poba';
7
+ $theme-name: 'carcat';
8
8
 
9
- $primary-palette: (
10
- 50: #79c6e6,
11
- 100: #64bfe6,
12
- 200: #39b3e8,
13
- 300: #11a6e6,
14
- 400: #078dc6,
15
- 500: #0072a3,
16
- 600: #005579,
17
- 700: #00374f,
18
- 800: #001a25,
19
- 900: black,
20
- A100: #4cb7e6,
21
- A200: #23b7e8,
22
- A400: #0098d9,
23
- A700: #005073,
24
- contrast: common.$contrast,
25
- background-color: #fcfcfc,
9
+ // M3 Theme Configuration
10
+ $primary-color: #0072a3; // Former palette 500 value
11
+ $tertiary-color: #005073; // Info color
12
+ $background-color: #fcfcfc;
13
+
14
+ $custom-colors: (
26
15
  warn-color: #ad7600,
27
16
  error-color: #c21d00,
28
17
  info-color: #005073,
29
18
  success-color: #3c8500,
30
19
  );
31
20
 
32
- @include mat.elevation-classes();
33
- @include mat.app-background();
21
+ // M3 palettes generated from CARCAT brand colors
22
+ $palettes: (
23
+ primary: carcat.$primary-palette,
24
+ tertiary: carcat.$tertiary-palette,
25
+ );
34
26
 
35
- $custom-theme: theme.build-custom-theme($theme-name, $primary-palette, common.$default-palette);
27
+ // Build M3 theme
28
+ $custom-theme: theme.build-custom-theme-m3(
29
+ $theme-name,
30
+ $primary-color,
31
+ $tertiary-color,
32
+ $custom-colors,
33
+ common.$default-palette,
34
+ $background-color,
35
+ $palettes
36
+ );
36
37
 
37
- @include mat.all-component-themes($custom-theme);
38
- @include mat.all-component-typographies($custom-theme);
39
- @include common.theme($theme-name, $custom-theme);
38
+ @include theme-entry.apply-theme($custom-theme);
40
39
 
40
+ // Custom alert density for CARCAT theme (preserved from M2)
41
41
  mad-alert {
42
42
  .alert.small {
43
43
  @include mat.icon-button-density(-3);
@@ -0,0 +1,147 @@
1
+ @use '@angular/material' as mat;
2
+
3
+ @mixin button-theme() {
4
+ @include mat.button-overrides(
5
+ (
6
+ filled-container-shape: var(--container-shape),
7
+ outlined-container-shape: var(--container-shape),
8
+ protected-container-shape: var(--container-shape),
9
+ text-container-shape: var(--container-shape),
10
+ tonal-container-shape: var(--container-shape),
11
+ )
12
+ );
13
+
14
+ .mdc-button.mad-uppercase {
15
+ text-transform: uppercase;
16
+ }
17
+
18
+ .mad-outline.mat-mdc-outlined-button:not(:disabled) {
19
+ --mat-button-outlined-outline-color: var(--mat-button-outlined-label-text-color);
20
+ }
21
+
22
+ // M3 Button Color Classes
23
+ // Filled buttons (mat-flat-button) - these rules are nested inside html{} via theme-styles
24
+ // mixin, so we use background-color directly to override mat.all-component-themes()
25
+ .mat-mdc-unelevated-button.mat-unthemed:not(:disabled):not(.mad-danger),
26
+ .mat-mdc-unelevated-button.mat-primary:not(:disabled) {
27
+ --mat-button-filled-container-color: var(--main-primary);
28
+ --mdc-filled-button-label-text-color: white;
29
+ background-color: var(--main-primary);
30
+ color: white;
31
+ }
32
+
33
+ .mat-mdc-unelevated-button.mad-danger:not(:disabled) {
34
+ --mat-button-filled-container-color: var(--error-color);
35
+ --mdc-filled-button-label-text-color: white;
36
+ background-color: var(--error-color);
37
+ color: white;
38
+ }
39
+
40
+ // Raised buttons (mat-raised-button) - same override pattern as filled buttons
41
+ .mat-mdc-raised-button.mat-primary:not(:disabled) {
42
+ --mat-button-protected-container-color: var(--main-primary);
43
+ --mat-button-protected-label-text-color: white;
44
+ background-color: var(--main-primary);
45
+ color: white;
46
+ }
47
+
48
+ // Outlined buttons (mat-stroked-button) - override M3 --mat-button-* variables
49
+ // Support both mad-primary (library class) and mat-primary (Angular Material class)
50
+ .mat-mdc-outlined-button.mad-primary:not(:disabled),
51
+ .mat-mdc-outlined-button.mat-primary:not(:disabled) {
52
+ --mat-button-outlined-label-text-color: var(--main-primary);
53
+ --mat-button-outlined-outline-color: var(--main-primary);
54
+ }
55
+
56
+ .mat-mdc-outlined-button.mad-accent:not(:disabled) {
57
+ --mat-button-outlined-label-text-color: var(--mat-sys-secondary, #625b71);
58
+ --mat-button-outlined-outline-color: var(--mat-sys-secondary, #625b71);
59
+ }
60
+
61
+ .mat-mdc-outlined-button.mad-warn:not(:disabled) {
62
+ --mat-button-outlined-label-text-color: var(--error-color);
63
+ --mat-button-outlined-outline-color: var(--error-color);
64
+ }
65
+
66
+ // Text buttons (mat-button) - override M3 --mat-button-* variables
67
+ // Support both mad-primary (library class) and mat-primary (Angular Material class)
68
+ .mat-mdc-button.mad-primary:not(:disabled),
69
+ .mat-mdc-button.mat-primary:not(:disabled) {
70
+ --mat-button-text-label-text-color: var(--main-primary);
71
+ }
72
+
73
+ .mat-mdc-button.mad-accent:not(:disabled) {
74
+ --mat-button-text-label-text-color: var(--mat-sys-secondary, #625b71);
75
+ }
76
+
77
+ .mat-mdc-button.mad-warn:not(:disabled) {
78
+ --mat-button-text-label-text-color: var(--error-color);
79
+ }
80
+
81
+ // FAB buttons - M3 defaults to tertiary-container, override to primary
82
+ .mat-mdc-fab.mat-primary:not(:disabled),
83
+ .mat-mdc-fab.mat-unthemed:not(:disabled) {
84
+ --mdc-fab-container-color: var(--main-primary);
85
+ --mat-fab-container-color: var(--main-primary);
86
+ --mat-fab-foreground-color: white;
87
+ --mat-fab-state-layer-color: white;
88
+ }
89
+
90
+ .mat-mdc-mini-fab.mat-primary:not(:disabled),
91
+ .mat-mdc-mini-fab.mat-unthemed:not(:disabled) {
92
+ --mdc-fab-small-container-color: var(--main-primary);
93
+ --mat-fab-small-container-color: var(--main-primary);
94
+ --mat-fab-small-foreground-color: white;
95
+ --mat-fab-small-state-layer-color: white;
96
+ }
97
+
98
+ .mat-mdc-mini-fab.mat-accent:not(:disabled) {
99
+ --mdc-fab-small-container-color: var(--mat-sys-secondary, #625b71);
100
+ --mat-fab-small-container-color: var(--mat-sys-secondary, #625b71);
101
+ --mat-fab-small-foreground-color: white;
102
+ --mat-fab-small-state-layer-color: white;
103
+ }
104
+
105
+ // Icon buttons - M3 no longer applies primary color by default
106
+ .mat-mdc-icon-button.mat-primary:not(:disabled) {
107
+ --mat-icon-button-icon-color: var(--main-primary);
108
+ --mat-icon-button-state-layer-color: var(--main-primary);
109
+ color: var(--main-primary);
110
+ }
111
+
112
+ // Standalone mat-icon with color class (replaces deprecated color input)
113
+ .mat-icon.mat-primary {
114
+ color: var(--main-primary);
115
+ }
116
+
117
+ .mat-icon.mat-accent {
118
+ color: var(--mat-sys-secondary, #625b71);
119
+ }
120
+ }
121
+
122
+ .mad-button-group {
123
+ button,
124
+ a {
125
+ border-left-width: 0;
126
+ border-radius: 0;
127
+
128
+ &:first-child {
129
+ border-left-width: var(--mat-button-outlined-outline-width, 1px);
130
+ border-bottom-left-radius: var(--mat-button-outlined-container-shape, var(--mat-shape-small, 4px));
131
+ border-top-left-radius: var(--mat-button-outlined-container-shape, var(--mat-shape-small, 4px));
132
+ }
133
+
134
+ &:last-child {
135
+ border-bottom-right-radius: var(--mat-button-outlined-container-shape, var(--mat-shape-small, 4px));
136
+ border-top-right-radius: var(--mat-button-outlined-container-shape, var(--mat-shape-small, 4px));
137
+ }
138
+
139
+ &:disabled:has(+ button:not(:disabled)) {
140
+ border-right-width: 0;
141
+ }
142
+
143
+ &:disabled + button:not(:disabled) {
144
+ border-left-width: var(--mat-button-outlined-outline-width, 1px);
145
+ }
146
+ }
147
+ }
@@ -0,0 +1,33 @@
1
+ @mixin component-colors() {
2
+ .clickable-table-row:hover,
3
+ .mat-row-link:hover {
4
+ background-color: var(--table-hover-color);
5
+ }
6
+
7
+ .mat-mdc-form-field-required-marker {
8
+ color: var(--warn-color);
9
+ }
10
+
11
+ .mat-chip.mat-standard-chip.mat-warn {
12
+ color: var(--warn-color);
13
+ border: 1px solid var(--warn-color);
14
+ }
15
+
16
+ .mat-mdc-outlined-button {
17
+ border-color: var(--main-primary) !important;
18
+ }
19
+
20
+ .mat-chip-selected {
21
+ border: 1px solid var(--main-primary) !important;
22
+ color: var(--main-primary) !important;
23
+ background-color: var(--mat-sys-surface) !important;
24
+ }
25
+
26
+ .selected-drag-list {
27
+ border-color: var(--main-primary) !important;
28
+ }
29
+
30
+ .active-column-definition {
31
+ color: var(--main-primary) !important;
32
+ }
33
+ }
@@ -0,0 +1,27 @@
1
+ @mixin flowbar-theme() {
2
+ mad-flowbar {
3
+ .mat-horizontal-stepper-header {
4
+ padding: 0;
5
+ height: auto;
6
+ }
7
+
8
+ .mat-step-header[aria-labelledby='disabled'] {
9
+ pointer-events: none !important;
10
+ cursor: not-allowed;
11
+ }
12
+
13
+ .mat-horizontal-content-container {
14
+ padding: 0 0 10px 0;
15
+ }
16
+
17
+ .mat-stepper-horizontal-line {
18
+ margin: 0 5px;
19
+ border-top-width: 4px;
20
+ border-top-color: var(--step-border-color);
21
+ }
22
+ }
23
+
24
+ mad-flowbar .mat-stepper-horizontal-line {
25
+ border-top-color: var(--step-border-color);
26
+ }
27
+ }
@@ -0,0 +1,44 @@
1
+ @mixin material-overrides() {
2
+ .mat-badge-medium .mat-badge-content {
3
+ width: 22px;
4
+ height: 22px;
5
+ line-height: 22px;
6
+ font-size: 12px;
7
+ --mat-badge-text-size: 12px;
8
+ --mat-badge-container-size: 22px;
9
+ }
10
+
11
+ .mat-badge-primary .mat-badge-content {
12
+ --mat-badge-background-color: var(--main-primary);
13
+ --mat-badge-text-color: white;
14
+ background-color: var(--main-primary);
15
+ color: white;
16
+ }
17
+
18
+ .mat-badge-warn .mat-badge-content {
19
+ --mat-badge-background-color: var(--error-color);
20
+ --mat-badge-text-color: white;
21
+ background-color: var(--error-color);
22
+ color: white;
23
+ }
24
+
25
+ .mat-badge-accent .mat-badge-content {
26
+ --mat-badge-background-color: var(--mat-sys-secondary, #625b71);
27
+ --mat-badge-text-color: white;
28
+ background-color: var(--mat-sys-secondary, #625b71);
29
+ color: white;
30
+ }
31
+
32
+ .mdc-tooltip__surface {
33
+ --mdc-plain-tooltip-container-color: #616161;
34
+ --mdc-plain-tooltip-supporting-text-color: white;
35
+ background-color: #616161;
36
+ color: white;
37
+ }
38
+
39
+ .mat-mdc-form-field {
40
+ --mdc-outlined-text-field-outline-color: var(--mat-sys-outline);
41
+ --mdc-outlined-text-field-focus-outline-color: var(--main-primary);
42
+ --mdc-outlined-text-field-hover-outline-color: var(--mat-sys-on-surface);
43
+ }
44
+ }
@@ -0,0 +1,7 @@
1
+ @mixin readonly-theme() {
2
+ .custom-tooltip {
3
+ font-size: 14px !important;
4
+ word-break: break-all !important;
5
+ white-space: normal !important;
6
+ }
7
+ }
@@ -0,0 +1,6 @@
1
+ @mixin toolbar-theme() {
2
+ .mad-toolbar .mat-badge-content {
3
+ bottom: -7px;
4
+ right: -7px;
5
+ }
6
+ }
@@ -0,0 +1,9 @@
1
+ table {
2
+ width: 100%;
3
+ }
4
+
5
+ app-root {
6
+ display: flex;
7
+ flex-direction: column;
8
+ height: 100vh;
9
+ }
@@ -0,0 +1,16 @@
1
+ @use 'material-icons/iconfont/material-icons.css';
2
+ @use 'roboto-fontface/css/roboto/roboto-fontface.css';
3
+
4
+ html {
5
+ font-family: Roboto, sans-serif;
6
+ }
7
+
8
+ body {
9
+ margin: 0;
10
+ font-family: Roboto, sans-serif;
11
+ }
12
+
13
+ a {
14
+ color: inherit;
15
+ text-decoration: inherit;
16
+ }
@@ -0,0 +1,6 @@
1
+ @mixin typography($theme-name, $theme) {
2
+ body,
3
+ .mat-typography {
4
+ font-size: 14px;
5
+ }
6
+ }