@covalent/core 8.1.0-beta.3 → 8.1.0-beta.5

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": "@covalent/core",
3
- "version": "8.1.0-beta.3",
3
+ "version": "8.1.0-beta.5",
4
4
  "exports": {
5
5
  ".": {
6
6
  "sass": "./theming/_all-theme.scss",
@@ -107,7 +107,7 @@
107
107
  "@angular/router": "17.x.x",
108
108
  "@angular/cdk": "17.x.x",
109
109
  "@angular/material": "17.x.x",
110
- "@covalent/core": "8.1.0-beta.3"
110
+ "@covalent/core": "8.1.0-beta.5"
111
111
  },
112
112
  "dependencies": {
113
113
  "tslib": "^2.0.0"
@@ -0,0 +1,543 @@
1
+ @use '@angular/material' as mat;
2
+ @import '../../../libs/tokens/_generated/_index';
3
+
4
+ // Customer Teradata brand palette
5
+ // Define the palettes for your theme using the Material Design palettes available in palette.scss
6
+ // (imported above). For each palette, you can optionally specify a default, lighter, and darker
7
+ // hue.
8
+ $td-theme: map-get($tokens, 'theme');
9
+ $td-theme-dark: map-get($td-theme, 'dark');
10
+ $td-dark-palettes: map-get($td-theme-dark, 'palettes');
11
+ $td-dark-colors: map-get($td-theme-dark, 'colors');
12
+
13
+ $td-theme-light: map-get($td-theme, 'light');
14
+ $td-light-palettes: map-get($td-theme-light, 'palettes');
15
+ $td-light-colors: map-get($td-theme-light, 'colors');
16
+
17
+ // Digital blue
18
+ // Add contrast for angular palette
19
+ $td-digital-blue-light: map-merge(
20
+ (
21
+ '30': map-get($td-light-palettes, 'digital blue 30'),
22
+ '40': map-get($td-light-palettes, 'digital blue 40'),
23
+ '50': map-get($td-light-palettes, 'digital blue 50'),
24
+ '500': map-get($td-light-palettes, 'digital blue 50'),
25
+ '60': map-get($td-light-palettes, 'digital blue 60'),
26
+ '70': map-get($td-light-palettes, 'digital blue 70'),
27
+ '80': map-get($td-light-palettes, 'digital blue 80'),
28
+ '90': map-get($td-light-palettes, 'digital blue 90'),
29
+ ),
30
+ (
31
+ contrast: (
32
+ '30': $light-on-primary,
33
+ '40': $light-on-primary,
34
+ '50': $light-on-primary,
35
+ '500': $light-on-primary,
36
+ '60': $light-on-primary,
37
+ '70': $light-on-primary,
38
+ '80': $light-on-primary,
39
+ '90': $light-on-primary,
40
+ ),
41
+ )
42
+ );
43
+ $td-digital-blue-dark: map-merge(
44
+ (
45
+ '30': map-get($td-dark-palettes, 'digital blue 30'),
46
+ '40': map-get($td-dark-palettes, 'digital blue 40'),
47
+ '50': map-get($td-dark-palettes, 'digital blue 50'),
48
+ '500': map-get($td-dark-palettes, 'digital blue 50'),
49
+ '60': map-get($td-dark-palettes, 'digital blue 60'),
50
+ '70': map-get($td-dark-palettes, 'digital blue 70'),
51
+ '80': map-get($td-dark-palettes, 'digital blue 80'),
52
+ '90': map-get($td-dark-palettes, 'digital blue 90'),
53
+ ),
54
+ (
55
+ contrast: (
56
+ '30': $dark-on-primary,
57
+ '40': $dark-on-primary,
58
+ '50': $dark-on-primary,
59
+ '500': $dark-on-primary,
60
+ '60': $dark-on-primary,
61
+ '70': $dark-on-primary,
62
+ '80': $dark-on-primary,
63
+ '90': $dark-on-primary,
64
+ ),
65
+ )
66
+ );
67
+
68
+ // Secondary
69
+ // Add contrast for angular palette
70
+ $td-secondary-light: map-merge(
71
+ (
72
+ '30': map-get($td-light-palettes, 'secondary 30'),
73
+ '40': map-get($td-light-palettes, 'secondary 40'),
74
+ '50': map-get($td-light-palettes, 'secondary 50'),
75
+ '500': map-get($td-light-palettes, 'secondary 50'),
76
+ '60': map-get($td-light-palettes, 'secondary 60'),
77
+ '70': map-get($td-light-palettes, 'secondary 70'),
78
+ '80': map-get($td-light-palettes, 'secondary 80'),
79
+ '90': map-get($td-light-palettes, 'secondary 90'),
80
+ ),
81
+ (
82
+ contrast: (
83
+ '30': $light-on-secondary,
84
+ '40': $light-on-secondary,
85
+ '50': $light-on-secondary,
86
+ '500': $light-on-secondary,
87
+ '60': $light-on-secondary,
88
+ '70': $light-on-secondary,
89
+ '80': $light-on-secondary,
90
+ '90': $light-on-secondary,
91
+ ),
92
+ )
93
+ );
94
+ $td-secondary-dark: map-merge(
95
+ (
96
+ '30': map-get($td-dark-palettes, 'secondary 30'),
97
+ '40': map-get($td-dark-palettes, 'secondary 40'),
98
+ '50': map-get($td-dark-palettes, 'secondary 50'),
99
+ '500': map-get($td-dark-palettes, 'secondary 50'),
100
+ '60': map-get($td-dark-palettes, 'secondary 60'),
101
+ '70': map-get($td-dark-palettes, 'secondary 70'),
102
+ '80': map-get($td-dark-palettes, 'secondary 80'),
103
+ '90': map-get($td-dark-palettes, 'secondary 90'),
104
+ ),
105
+ (
106
+ contrast: (
107
+ '30': $dark-on-secondary,
108
+ '40': $dark-on-secondary,
109
+ '50': $dark-on-secondary,
110
+ '500': $dark-on-secondary,
111
+ '60': $dark-on-secondary,
112
+ '70': $dark-on-secondary,
113
+ '80': $dark-on-secondary,
114
+ '90': $dark-on-secondary,
115
+ ),
116
+ )
117
+ );
118
+
119
+ // Warn
120
+ // Add contrast for angular palette
121
+ $td-warn-light: map-merge(
122
+ (
123
+ '30': map-get($td-light-palettes, 'negative 30'),
124
+ '40': map-get($td-light-palettes, 'negative 40'),
125
+ '50': map-get($td-light-palettes, 'negative 50'),
126
+ '500': map-get($td-light-palettes, 'negative 50'),
127
+ '60': map-get($td-light-palettes, 'negative 60'),
128
+ '70': map-get($td-light-palettes, 'negative 70'),
129
+ '80': map-get($td-light-palettes, 'negative 80'),
130
+ '90': map-get($td-light-palettes, 'negative 90'),
131
+ ),
132
+ (
133
+ contrast: (
134
+ '30': $theme-light-colors-on-negative,
135
+ '40': $theme-light-colors-on-negative,
136
+ '50': $theme-light-colors-on-negative,
137
+ '500': $theme-light-colors-on-negative,
138
+ '60': $theme-light-colors-on-negative,
139
+ '70': $theme-light-colors-on-negative,
140
+ '80': $theme-light-colors-on-negative,
141
+ '90': $theme-light-colors-on-negative,
142
+ ),
143
+ )
144
+ );
145
+ $td-warn-dark: map-merge(
146
+ (
147
+ '30': map-get($td-dark-palettes, 'negative 30'),
148
+ '40': map-get($td-dark-palettes, 'negative 40'),
149
+ '50': map-get($td-dark-palettes, 'negative 50'),
150
+ '500': map-get($td-dark-palettes, 'negative 50'),
151
+ '60': map-get($td-dark-palettes, 'negative 60'),
152
+ '70': map-get($td-dark-palettes, 'negative 70'),
153
+ '80': map-get($td-dark-palettes, 'negative 80'),
154
+ '90': map-get($td-dark-palettes, 'negative 90'),
155
+ ),
156
+ (
157
+ contrast: (
158
+ '30': $theme-dark-colors-on-negative,
159
+ '40': $theme-dark-colors-on-negative,
160
+ '50': $theme-dark-colors-on-negative,
161
+ '500': $theme-dark-colors-on-negative,
162
+ '60': $theme-dark-colors-on-negative,
163
+ '70': $theme-dark-colors-on-negative,
164
+ '80': $theme-dark-colors-on-negative,
165
+ '90': $theme-dark-colors-on-negative,
166
+ ),
167
+ )
168
+ );
169
+
170
+ $td-primary: $td-digital-blue-light;
171
+ $td-secondary: $td-secondary-light;
172
+ $td-accent: $td-digital-blue-light;
173
+ // The warn palette is optional (defaults to red).
174
+ $td-warn: $td-warn-light;
175
+
176
+ // Dark theme tokens
177
+ $td-primary-dark: $td-digital-blue-dark;
178
+ $td-secondary-dark: $td-secondary-dark;
179
+ $td-accent-dark: $td-digital-blue-dark;
180
+ // The warn palette is optional (defaults to red).
181
+ $td-warn-dark: $td-warn-dark;
182
+
183
+ // Background palette for light themes.
184
+ // todo: need to re-catalog used variables
185
+ $td-light-theme-background: (
186
+ status-bar: $theme-light-colors-surface-container,
187
+ app-bar: $light-surface,
188
+ background: $theme-light-colors-surface,
189
+ canvas: $light-surface-canvas,
190
+ card: $theme-light-colors-surface-container
191
+ /*** card color = surface color ***/,
192
+ dialog: $theme-light-colors-surface-container-high,
193
+ hover: $light-surface-primary-highlight-hover,
194
+ disabled-button: $theme-light-colors-surface-dim,
195
+ disabled-button-toggle: $theme-light-colors-surface-dim,
196
+ disabled-list-option: $theme-light-colors-surface-dim,
197
+ raised-button: $light-surface-primary,
198
+ focused-button: $light-surface-primary-highlight,
199
+ selected-button: $theme-light-colors-surface-dim,
200
+ selected-disabled-button: $theme-light-colors-surface-dim,
201
+ unselected-chip: $theme-light-colors-surface-variant,
202
+ tooltip: $theme-light-colors-surface-container-highest,
203
+ overlay: $theme-light-colors-scrim,
204
+ accent: $light-accent,
205
+ accent-highlight: $light-surface-accent-highlight,
206
+ accent-highlight-hover: $light-surface-accent-highlight-hover,
207
+ emphasis: $light-emphasis,
208
+ emphasis-highlight: $light-surface-emphasis-highlight,
209
+ emphasis-highlight-hover: $light-surface-emphasis-highlight,
210
+ caution: $light-surface-caution,
211
+ caution-highlight: $light-surface-caution-highlight,
212
+ caution-highlight-hover: $light-surface-caution-highlight-hover,
213
+ negative: $light-surface-negative,
214
+ negative-highlight: $light-surface-negative-highlight,
215
+ negative-highlight-hover: $light-surface-negative-highlight-hover,
216
+ neutral: $light-surface-neutral,
217
+ neutral-highlight: $light-surface-neutral-highlight,
218
+ neutral-highlight-hover: $light-surface-neutral-highlight-hover,
219
+ positive: $light-surface-positive,
220
+ positive-highlight: $light-surface-positive-highlight,
221
+ positive-highlight-hover: $light-surface-positive-highlight-hover,
222
+ primary: $light-surface-primary,
223
+ primary-highlight: $light-surface-primary-highlight,
224
+ primary-highlight-hover: $light-surface-primary-highlight-hover,
225
+ );
226
+
227
+ // Foreground palette for light themes.
228
+ // todo: need to re-catalog used variables
229
+ $td-light-theme-foreground: (
230
+ base: $light-on-background,
231
+ divider: $light-divider,
232
+ dividers: $light-divider,
233
+ disabled: $theme-light-colors-on-surface-38,
234
+ disabled-button: $theme-light-colors-on-surface-38,
235
+ disabled-text: $theme-light-colors-on-surface-38,
236
+ elevation: black,
237
+ // todo: need to work out elevation
238
+ hint-text: $theme-light-colors-on-surface-variant,
239
+ secondary-text: $theme-light-colors-on-surface-variant,
240
+ icon: $light-text-icon-on-background,
241
+ icons: $light-text-icon-on-background,
242
+ text: $light-on-surface,
243
+ slider-min: $light-on-surface,
244
+ slider-off: $theme-light-colors-on-surface-8,
245
+ slider-off-active: $theme-light-colors-on-surface-16,
246
+ accent: $theme-light-colors-on-primary,
247
+ emphasis: $theme-light-colors-on-emphasis,
248
+ caution: $theme-light-colors-on-caution,
249
+ negative: $theme-light-colors-on-negative,
250
+ neutral: $light-on-surface,
251
+ // todo: need to work out on-neutral tokens
252
+ positive: $theme-light-colors-on-positive,
253
+ primary: $theme-light-colors-on-primary,
254
+ );
255
+
256
+ // Background palette for dark themes.
257
+ // todo: need to re-catalog used variables
258
+ $td-dark-theme-background: (
259
+ status-bar: $theme-dark-colors-surface-container-lowest,
260
+ app-bar: $theme-dark-colors-surface-container-low,
261
+ background: $theme-dark-colors-surface,
262
+ canvas: $dark-surface-canvas,
263
+ card: $theme-dark-colors-surface-container
264
+ /*** card color = surface color ***/,
265
+ dialog: $theme-dark-colors-surface-container-high,
266
+ hover: $dark-surface-primary-highlight-hover,
267
+ disabled-button: $theme-dark-colors-surface-dim,
268
+ disabled-button-toggle: $theme-dark-colors-surface-dim,
269
+ disabled-list-option: $theme-dark-colors-surface-dim,
270
+ raised-button: $dark-surface-primary,
271
+ focused-button: $dark-surface-primary-highlight,
272
+ selected-button: $theme-dark-colors-surface-dim,
273
+ selected-disabled-button: $theme-dark-colors-surface-dim,
274
+ unselected-chip: $theme-dark-colors-surface-variant,
275
+ tooltip: $theme-dark-colors-surface-container-highest,
276
+ overlay: $theme-dark-colors-scrim,
277
+ accent: $dark-accent,
278
+ accent-highlight: $dark-surface-accent-highlight,
279
+ accent-highlight-hover: $dark-surface-accent-highlight-hover,
280
+ emphasis: $dark-emphasis,
281
+ emphasis-highlight: $dark-surface-emphasis-highlight,
282
+ emphasis-highlight-hover: $dark-surface-emphasis-highlight,
283
+ caution: $dark-surface-caution,
284
+ caution-highlight: $dark-surface-caution-highlight,
285
+ caution-highlight-hover: $dark-surface-caution-highlight-hover,
286
+ negative: $dark-surface-negative,
287
+ negative-highlight: $dark-surface-negative-highlight,
288
+ negative-highlight-hover: $dark-surface-negative-highlight-hover,
289
+ neutral: $dark-surface-neutral,
290
+ neutral-highlight: $dark-surface-neutral-highlight,
291
+ neutral-highlight-hover: $dark-surface-neutral-highlight-hover,
292
+ positive: $dark-surface-positive,
293
+ positive-highlight: $dark-surface-positive-highlight,
294
+ positive-highlight-hover: $dark-surface-positive-highlight-hover,
295
+ primary: $dark-surface-primary,
296
+ primary-highlight: $dark-surface-primary-highlight,
297
+ primary-highlight-hover: $dark-surface-primary-highlight-hover,
298
+ );
299
+
300
+ // Foreground palette for dark themes.
301
+ // todo: need to re-catalog used variables
302
+ $td-dark-theme-foreground: (
303
+ base: $dark-on-background,
304
+ divider: $dark-divider,
305
+ dividers: $dark-divider,
306
+ disabled: $theme-dark-colors-on-surface-38,
307
+ disabled-button: $theme-dark-colors-on-surface-38,
308
+ disabled-text: $theme-dark-colors-on-surface-38,
309
+ elevation: black,
310
+ // todo: need to work out elevation
311
+ hint-text: $theme-dark-colors-on-surface-variant,
312
+ secondary-text: $theme-dark-colors-on-surface-variant,
313
+ icon: $dark-text-icon-on-background,
314
+ icons: $dark-text-icon-on-background,
315
+ text: $dark-on-surface,
316
+ slider-min: $dark-on-surface,
317
+ slider-off: $theme-dark-colors-on-surface-8,
318
+ slider-off-active: $theme-dark-colors-on-surface-16,
319
+ accent: $theme-dark-colors-on-primary,
320
+ emphasis: $theme-dark-colors-on-emphasis,
321
+ caution: $theme-dark-colors-on-caution,
322
+ negative: $theme-dark-colors-on-negative,
323
+ neutral: $dark-on-surface,
324
+ // todo: need to work out on-neutral tokens
325
+ positive: $theme-dark-colors-on-positive,
326
+ primary: $theme-dark-colors-on-primary,
327
+ );
328
+
329
+ // Custom typography
330
+ $td-custom-typography: mat.define-typography-config(
331
+ $button: mat.define-typography-level(14px, 14px, 400),
332
+ );
333
+ $td-custom-toolbar-typography: mat.define-typography-config(
334
+ $headline-6: mat.define-typography-level(20px, 32px, 400),
335
+ );
336
+
337
+ // Create the theme object (a Sass map containing all of the palettes).
338
+ $td-light-theme: mat.define-light-theme(
339
+ (
340
+ color: (
341
+ primary: mat.define-palette($td-primary, '40', '30', '60'),
342
+ secondary: mat.define-palette($td-secondary, '40', '30', '60'),
343
+ accent: mat.define-palette($td-accent, '40', '30', '60'),
344
+ warn: mat.define-palette($td-warn, '40', '30', '60'),
345
+ on-secondary: $light-on-secondary,
346
+ ),
347
+ typography: $td-custom-typography,
348
+ )
349
+ );
350
+ $td-light-theme: mat.private-deep-merge-all(
351
+ $td-light-theme,
352
+ (
353
+ color: (
354
+ background: $td-light-theme-background,
355
+ foreground: $td-light-theme-foreground,
356
+ ),
357
+ )
358
+ );
359
+
360
+ $td-dark-theme: mat.define-dark-theme(
361
+ (
362
+ color: (
363
+ primary: mat.define-palette($td-primary-dark, '80', '70', '90'),
364
+ secondary: mat.define-palette($td-secondary-dark, '80', '70', '90'),
365
+ accent: mat.define-palette($td-accent-dark, '80', '70', '90'),
366
+ warn: mat.define-palette($td-warn-dark, '80', '70', '90'),
367
+ on-secondary: $dark-on-secondary,
368
+ ),
369
+ typography: $td-custom-typography,
370
+ )
371
+ );
372
+ $td-dark-theme: mat.private-deep-merge-all(
373
+ $td-dark-theme,
374
+ (
375
+ color: (
376
+ background: $td-dark-theme-background,
377
+ foreground: $td-dark-theme-foreground,
378
+ ),
379
+ )
380
+ );
381
+
382
+ @mixin teradata-brand($theme) {
383
+ $primary: map-get($theme, primary);
384
+ $accent: map-get($theme, accent);
385
+ $warn: map-get($theme, warn);
386
+ $background: map-get($theme, background);
387
+ $foreground: map-get($theme, foreground);
388
+ $is-dark-theme: map-get($theme, is-dark);
389
+ $accent-highlight: map-get($background, accent-highlight);
390
+ $accent-highlight-hover: map-get($background, accent-highlight-hover);
391
+ $on-primary: map-get($foreground, primary);
392
+ $on-accent: map-get($foreground, accent);
393
+
394
+ .mat-toolbar.mat-primary {
395
+ --mat-toolbar-container-text-color: #{$on-primary};
396
+ }
397
+
398
+ // Logo alignment
399
+ .mat-icon.mat-icon-logo {
400
+ fill: $teradata-orange-500;
401
+ position: relative;
402
+ top: -2px;
403
+
404
+ @if $is-dark-theme {
405
+ fill: #ffffff;
406
+ }
407
+
408
+ // Logo + title alignment
409
+ & + .mat-title,
410
+ & + span {
411
+ position: relative;
412
+ top: 1px;
413
+ text-transform: uppercase;
414
+ }
415
+
416
+ & + .td-navigation-drawer-title {
417
+ top: 2px;
418
+ }
419
+ }
420
+ // Spacing before logo in main toolbar
421
+ .mat-toolbar {
422
+ .mdc-icon-button + .mat-icon-logo,
423
+ .mdc-icon-button + span > .mat-icon-logo {
424
+ margin-left: 10px;
425
+ }
426
+
427
+ .mat-icon-logo {
428
+ margin-right: 16px;
429
+ }
430
+ }
431
+ // Logo in card title alignment
432
+ .mat-card-title {
433
+ .mat-icon-logo {
434
+ margin-right: 8px;
435
+ }
436
+ }
437
+
438
+ // Apply theme for this app
439
+ body::after {
440
+ content: '';
441
+ position: absolute;
442
+ top: 0;
443
+ height: 2px;
444
+ width: 100%;
445
+ z-index: 999;
446
+ background-color: mat-color($accent);
447
+ }
448
+
449
+ // Active icon color in list nav
450
+ .mat-drawer {
451
+ mat-nav-list {
452
+ .mat-list-item {
453
+ &.active {
454
+ font-weight: bold;
455
+ color: $on-accent;
456
+
457
+ .mat-icon.mat-list-avatar {
458
+ background-color: mat-color($accent);
459
+ color: mat-color($accent);
460
+ fill: mat-color($accent);
461
+ }
462
+
463
+ .mat-icon.mat-list-icon {
464
+ color: mat-color($accent);
465
+ fill: mat-color($accent);
466
+ }
467
+ }
468
+ }
469
+
470
+ &[dense] {
471
+ .mat-icon.mat-list-avatar {
472
+ min-width: 36px;
473
+ }
474
+ }
475
+ }
476
+ }
477
+
478
+ // Active icon color in list nav
479
+ mat-nav-list {
480
+ [mat-list-item].active {
481
+ mat-icon[matListItemAvatar] {
482
+ background-color: mat-color($accent);
483
+ color: mat-color($accent);
484
+ }
485
+
486
+ mat-icon[matListIcon] {
487
+ color: mat-color($accent);
488
+ }
489
+ }
490
+ }
491
+
492
+ td-layout-nav {
493
+ mat-toolbar {
494
+ z-index: 2;
495
+ @include mat-elevation(3);
496
+ }
497
+ }
498
+
499
+ // Active top nav
500
+ nav.docs-nav {
501
+ a {
502
+ line-height: 4;
503
+ display: block;
504
+ font-size: 1.1428em;
505
+ letter-spacing: 0.0764em;
506
+ position: relative;
507
+
508
+ &.active {
509
+ &::after {
510
+ content: '';
511
+ position: absolute;
512
+ height: 3px;
513
+ bottom: 0;
514
+ width: 100%;
515
+ background-color: mat-color($accent);
516
+ left: 0;
517
+ }
518
+ }
519
+ }
520
+ }
521
+
522
+ // Active side nav
523
+ .doc-nav a.doc-nav-link {
524
+ &.active::before {
525
+ background-color: $accent-highlight;
526
+ }
527
+ &:hover {
528
+ &::before {
529
+ background-color: $accent-highlight-hover;
530
+ }
531
+ }
532
+ }
533
+
534
+ // Links
535
+ a {
536
+ text-decoration: none;
537
+ color: mat-color($accent);
538
+ }
539
+
540
+ .tc-td-secondary {
541
+ color: map-get($foreground, secondary-text);
542
+ }
543
+ }