@main-class/template 3.4.8 → 3.5.3

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/theming.scss CHANGED
@@ -1,63 +1,19 @@
1
1
  @use '@angular/material' as mat;
2
2
  @use 'sass:map' as map;
3
3
 
4
- @mixin mcl-menu($config-or-theme) {
5
- $config: mat.m2-get-color-config($config-or-theme);
6
-
7
- mcl-menu {
8
- .content {
9
- button {
10
- transition: 300ms;
11
-
12
- &.profile {
13
- background: mat.m2-get-color-from-palette($config, 50) !important;
14
- color: mat.m2-get-color-from-palette($config, 0) !important;
15
- border-left-color: mat.m2-get-color-from-palette($config, 50) !important;
16
-
17
- mat-icon {
18
- background: mat.m2-get-color-from-palette($config, 100) !important;
19
- color: mat.m2-get-color-from-palette($config, 50) !important;
20
- }
21
- }
22
-
23
- &.active {
24
- color: mat.m2-get-color-from-palette($config, 0) !important;
25
- border-left-color: mat.m2-get-color-from-palette($config, 50) !important;
26
- }
27
- }
28
- }
29
- }
30
- }
31
-
32
- @mixin mcl-acesso($config-or-theme) {
33
- $config: mat.m2-get-color-config($config-or-theme);
34
-
35
- mcl-acesso {
36
- .background {
37
- background-image: map.get($config-or-theme, acessoBackground) !important;
38
- background-size: cover !important;
39
- background-position: center !important;
40
- }
41
-
42
- .content {
43
-
44
- mat-card {
45
- border-top-color: mat.m2-get-color-from-palette($config, 40);
46
- }
47
-
48
- }
49
- }
4
+ /* base.component.scss */
5
+ :host {
6
+ --lib-color-primary: var(--mat-sys-primary);
7
+ --lib-color-on-primary: var(--mat-sys-on-primary);
8
+ --lib-color-secondary: var(--mat-sys-secondary);
9
+ --lib-color-on-secondary: var(--mat-sys-on-secondary);
10
+ --lib-color-surface: var(--mat-sys-surface);
11
+ --lib-color-on-surface: var(--mat-sys-on-surface);
12
+ --lib-color-outline: var(--mat-sys-outline);
13
+ --lib-color-outline-variant: var(--mat-sys-outline-variant);
50
14
  }
51
15
 
52
16
 
53
- @mixin mcl-header($config-or-theme) {
54
- $config: mat.m2-get-color-config($config-or-theme);
55
-
56
- mcl-header {
57
- color: mat.m2-get-color-from-palette($config, 20);
58
- }
59
- }
60
-
61
17
  @mixin mcl-theming($config-or-theme) {
62
18
  $config: mat.m2-get-color-config($config-or-theme);
63
19
 
@@ -65,385 +21,342 @@
65
21
 
66
22
  @include mat.all-component-themes($config-or-theme);
67
23
 
68
- @include mcl-menu($config-or-theme);
69
- @include mcl-acesso($config-or-theme);
70
- @include mcl-header($config-or-theme);
24
+ /* ===============================================
25
+ Angular Material: tema básico alinhado ao portal
26
+ Cores: #3f8634 (estrutural) e #357ea6 (ações)
27
+ Material Design base + personalidade sutil
28
+ ------------------------------------------------
29
+ Como usar (Angular >= v15 com Sass):
30
+ 1) Crie src/styles/_theme.scss com este conteúdo
31
+ 2) Em styles.scss: @use "./styles/theme" as *;
32
+ 3) Garanta que o Angular Material esteja instalado e configurado
33
+ =============================================== */
34
+
35
+ /* --- Variáveis de marca --- */
36
+ :root {
37
+ /* Cores principais */
38
+ --brand-structural: #3f8634; /* verde - áreas estruturais */
39
+ --brand-primary: #357ea6; /* azul - ações principais */
40
+
41
+ /* Neutros de apoio */
42
+ --neutral-0: #ffffff;
43
+ --neutral-50: #fafafa;
44
+ --neutral-100: #f5f5f5;
45
+ --neutral-200: #eeeeee;
46
+ --neutral-300: #e0e0e0;
47
+ --neutral-600: #757575;
48
+ --neutral-800: #424242;
49
+ }
71
50
 
51
+ *, *::before, *::after {
52
+ box-sizing: border-box;
53
+ }
54
+ html {
55
+ -webkit-text-size-adjust: 100%;
56
+ }
72
57
  html, body {
73
58
  height: 100%;
74
59
  }
75
60
 
76
61
  body {
77
- height: 100%;
78
62
  margin: 0;
79
- font-family: Asap, "Roboto", sans-serif;
80
- font-size: 12px;
81
-
82
- .mat-mdc-card:not([class*=mat-elevation-z]) {
83
- box-shadow: none;
84
- border: none;
85
- border-top-left-radius: 8px;
86
- border-bottom-left-radius: 8px;
87
- margin-bottom: 30px;
88
- padding: 30px 80px 30px 30px;
89
- }
90
-
91
- mcl-base {
92
- h2 {
93
- font-weight: lighter;
94
- color: rgba(0, 0, 0, .54);
95
- font-size: 16px;
96
- text-transform: uppercase;
97
- }
98
-
99
- hr {
100
- border: 0;
101
- border-bottom: 1px solid rgba(0, 0, 0, .15);
102
- margin: 0 -20px;
103
- }
104
-
105
- mcl-query-form {
106
- .mat-accordion {
107
- display: block;
108
- margin: -20px -20px 20px;
109
-
110
- }
111
- }
112
-
113
- .mdc-tab .badge {
114
- display: inline-block;
115
- padding: 5px 10px;
116
- border-radius: 5px;
117
- background: mat.m2-get-color-from-palette($config, 60);
118
- color: mat.m2-get-color-from-palette($config, 100);
119
- margin-left: 10px;
120
- }
121
- }
122
-
123
- mcl-table {
124
-
125
- table {
126
- width: calc(100% + 40px) !important;
127
- margin: -20px -20px 0 !important;
128
-
129
- tr {
130
- color: #333;
131
- transition: 300ms;
132
-
133
- &:nth-child(odd) {
134
- background: rgba(0, 0, 0, .05);
135
- }
136
-
137
- &:nth-child(even) {
138
- background: rgba(0, 0, 0, .1);
139
- }
140
-
141
- .mat-cell, .mat-footer {
142
- font-size: 12px;
143
- }
144
-
145
- th {
146
- padding-left: 10px;
147
- padding-right: 10px;
148
- font-weight: bold;
149
- font-size: 12px;
150
- line-height: 14px;
151
- letter-spacing: 0.25px;
152
- text-transform: uppercase;
153
- }
154
-
155
- td {
156
- padding: 5px 10px;
157
- }
158
-
159
- th {
160
- background: mat.m2-get-color-from-palette($config, 100);
161
- border-bottom: 1px solid rgba(0, 0, 0, .15);
63
+ background: var(--app-bg);
64
+ color: var(--app-fg);
65
+ font: 400 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
66
+ -webkit-font-smoothing: antialiased;
67
+ -moz-osx-font-smoothing: grayscale;
68
+ text-rendering: optimizeLegibility;
69
+ }
162
70
 
163
- }
71
+ /* Seleção de texto */
72
+ ::selection {
73
+ background: color-mix(in oklab, var(--app-primary) 30%, transparent);
74
+ color: var(--app-on-primary);
75
+ }
164
76
 
165
- &:hover td {
166
- background-color: mat.m2-get-color-from-palette($config, 50);
167
- color: mat.m2-get-color-from-palette($config, 100);
168
- border-color: mat.m2-get-color-from-palette($config);
77
+ /* Links */
78
+ a {
79
+ color: color-mix(in oklab, var(--app-primary) 96%, #000);
80
+ text-decoration: none;
81
+ }
82
+ a:hover {
83
+ text-decoration: underline;
84
+ }
169
85
 
170
- mat-icon {
171
- color: mat.m2-get-color-from-palette($config, 100);
172
- }
86
+ /* Imagens e mídia responsiva */
87
+ img, svg, video, canvas {
88
+ max-width: 100%;
89
+ height: auto;
90
+ display: block;
91
+ }
173
92
 
174
- &[routerLink], &[click] {
175
- cursor: pointer;
176
- }
177
- }
178
- }
93
+ /* Tabelas (neutral outline) */
94
+ table {
95
+ border-collapse: collapse;
96
+ width: 100%;
97
+ }
98
+ th, td {
99
+ border-bottom: 1px solid var(--app-border);
100
+ padding: 0.5rem 0.75rem;
101
+ }
102
+ thead th {
103
+ color: var(--app-muted);
104
+ font-weight: 600;
105
+ background: color-mix(in oklab, var(--app-border) 18%, transparent);
106
+ }
179
107
 
180
- }
108
+ /* Form fields base (quando não for Angular Material) */
109
+ input, button, textarea, select {
110
+ font: inherit;
111
+ color: inherit;
112
+ }
113
+ button {
114
+ cursor: pointer;
115
+ }
181
116
 
182
- .mat-paginator-page-size mat-form-field {
183
- min-width: 180px;
117
+ /* Focus visible consistente (componentes nativos e estrutura) */
118
+ :where(a, button, [role="button"], input, select, textarea):focus-visible {
119
+ outline: var(--app-focus);
120
+ outline-offset: 2px;
121
+ border-radius: 8px;
122
+ }
184
123
 
185
- .mat-mdc-text-field-wrapper {
186
- border-color: #dddddd;
187
- }
188
- }
124
+ mat-form-field {
125
+ width: 100%;
126
+ display: block; /* evita inline sizing */
127
+ }
128
+ /* --- Overrides rápidos de componentes comuns --- */
189
129
 
190
- .empty-state {
191
- background: #eeeeee;
192
- margin: 0 -20px;
193
- }
194
- }
130
+ /* Header / Toolbar global */
131
+ .mat-toolbar {
132
+ background: var(--neutral-0) !important;
133
+ color: var(--neutral-800) !important;
134
+ border-bottom: 1px solid var(--neutral-200);
135
+ }
195
136
 
196
- mat-form-field {
197
- display: block;
198
- width: 100%;
199
- margin-bottom: 10px;
137
+ /* Sidenav (menu lateral): fundo claro + acentos de marca */
138
+ .mat-sidenav {
139
+ background: var(--neutral-0);
140
+ border-right: 1px solid var(--neutral-200);
141
+ }
142
+ .mat-nav-list .mat-list-item {
143
+ border-radius: 8px;
144
+ }
145
+ .mat-nav-list .mat-list-item:hover {
146
+ background: color-mix(in oklab, var(--brand-primary) 8%, white);
147
+ }
148
+ .mat-nav-list .mat-list-item.mat-list-item-focus,
149
+ .mat-nav-list .mat-list-item.mat-mdc-list-item--activated {
150
+ background: color-mix(in oklab, var(--brand-primary) 12%, white) !important;
151
+ color: var(--brand-primary) !important;
152
+ }
200
153
 
201
- .mat-checkbox-container mat-checkbox {
202
- padding: 0 !important;
154
+ /* Tabs */
155
+ .mat-mdc-tab .mdc-tab__content {
156
+ color: var(--neutral-600);
157
+ }
158
+ .mat-mdc-tab.mdc-tab--active .mdc-tab__content {
159
+ color: var(--brand-primary);
160
+ }
161
+ .mat-mdc-tab-indicator__content--underline {
162
+ border-color: var(--brand-primary) !important;
163
+ }
203
164
 
204
- }
205
- }
165
+ /* Tabelas (listagem) */
166
+ .mat-mdc-table thead tr {
167
+ background: var(--neutral-100);
168
+ }
169
+ .mat-mdc-table thead th {
170
+ color: var(--neutral-600);
171
+ font-weight: 600;
172
+ }
173
+ .mat-mdc-table tbody tr:hover {
174
+ background: var(--neutral-50);
175
+ }
206
176
 
177
+ /* Chips / Badges simples */
178
+ .mdc-evolution-chip--selected,
179
+ .mat-mdc-standard-chip.mat-mdc-chip-selected {
180
+ background: color-mix(in oklab, var(--brand-structural) 12%, white);
181
+ color: var(--brand-structural);
207
182
  }
208
183
 
209
- .text-center {
210
- text-align: center
184
+ /* Paginação */
185
+ .mat-mdc-paginator .mdc-icon-button,
186
+ .mat-mdc-paginator .mat-mdc-select-value {
187
+ color: var(--neutral-800);
188
+ }
189
+ .mat-mdc-paginator .mdc-icon-button:hover {
190
+ color: var(--brand-primary);
211
191
  }
212
192
 
213
- .text-right {
214
- text-align: right
193
+ /* Cards / Containers */
194
+ .mat-mdc-card {
195
+ border: 1px solid var(--neutral-200);
196
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
197
+ border-radius: 14px;
215
198
  }
216
199
 
217
- .text-left {
218
- text-align: left
200
+ /* Tipografia básica (sobriedade) */
201
+ .mat-h1, .mat-h2, .mat-h3, .mat-h4, .mat-h5 {
202
+ color: var(--neutral-800);
203
+ font-weight: 600;
204
+ }
205
+ .mat-body-1, .mat-body-2, .mat-subtitle-2 {
206
+ color: var(--neutral-600);
219
207
  }
220
208
 
221
- .component-loading {
222
- position: relative;
209
+ /* Densidade (opcional): compacta nas listas/tabelas */
210
+ .mat-mdc-table .mdc-data-table__content .mdc-data-table__row > .mdc-data-table__cell,
211
+ .mat-mdc-table .mdc-data-table__header-row > .mdc-data-table__header-cell {
212
+ padding-top: 10px;
213
+ padding-bottom: 10px;
223
214
  }
224
215
 
225
216
  .row {
226
217
  display: flex;
227
- gap: 20px;
228
- align-items: start;
218
+ flex-direction: row;
229
219
  flex-wrap: wrap;
220
+ gap: 16px;
221
+ margin-bottom: 16px;
230
222
 
223
+ // Coluna padrão - ocupa espaço disponível
231
224
  .col {
232
- flex: 1;
225
+ flex: 1 1 0;
226
+ min-width: 0; // Evita overflow
233
227
  }
234
228
 
229
+ // Sistema de colunas de 1 a 12 (baseado em 12 colunas)
235
230
  .col-1 {
236
- flex: 0.08;
231
+ flex: 0 0 calc(8.33333333% - 13.33px); // ~1/12 - gap adjustment
237
232
  }
238
233
 
239
234
  .col-2 {
240
- flex: 0.16;
235
+ flex: 0 0 calc(16.66666667% - 12px); // ~2/12 - gap adjustment
241
236
  }
242
237
 
243
238
  .col-3 {
244
- flex: 0.25;
239
+ flex: 0 0 calc(25% - 12px); // ~3/12 - gap adjustment
245
240
  }
246
241
 
247
242
  .col-4 {
248
- flex: 0.33;
243
+ flex: 0 0 calc(33.33333333% - 10.67px); // ~4/12 - gap adjustment
249
244
  }
250
245
 
251
246
  .col-5 {
252
- flex: 0.4;
247
+ flex: 0 0 calc(41.66666667% - 9.6px); // ~5/12 - gap adjustment
253
248
  }
254
249
 
255
250
  .col-6 {
256
- flex: 0.5;
251
+ flex: 0 0 calc(50% - 8px); // ~6/12 - gap adjustment
257
252
  }
258
253
 
259
254
  .col-7 {
260
- flex: 0.58;
255
+ flex: 0 0 calc(58.33333333% - 6.86px); // ~7/12 - gap adjustment
261
256
  }
262
257
 
263
258
  .col-8 {
264
- flex: 0.66;
259
+ flex: 0 0 calc(66.66666667% - 5.33px); // ~8/12 - gap adjustment
265
260
  }
266
261
 
267
262
  .col-9 {
268
- flex: 0.75;
263
+ flex: 0 0 calc(75% - 4px); // ~9/12 - gap adjustment
269
264
  }
270
265
 
271
266
  .col-10 {
272
- flex: 0.83;
267
+ flex: 0 0 calc(83.33333333% - 2.4px); // ~10/12 - gap adjustment
273
268
  }
274
269
 
275
270
  .col-11 {
276
- flex: 0.91;
271
+ flex: 0 0 calc(91.66666667% - 1.45px); // ~11/12 - gap adjustment
277
272
  }
278
273
 
279
274
  .col-12 {
280
- flex: 1;
275
+ flex: 0 0 100%; // ~12/12 - ocupa toda a largura
281
276
  }
282
- }
283
277
 
284
- .iframe-dialog .mat-mdc-dialog-container .mat-mdc-dialog-content {
285
- margin: 0;
286
- }
287
-
288
- .mat-mdc-dialog-container {
289
- border-radius: 8px;
290
- padding: 0;
291
-
292
- .mat-mdc-dialog-content {
293
- max-width: 800px;
294
- width: 95vw;
295
- min-width: auto;
296
- padding: 0;
297
- margin: 10px 50px;
278
+ // Classes auxiliares para auto-dimensionamento
279
+ .col-auto {
280
+ flex: 0 0 auto;
298
281
  }
299
282
 
300
- .mat-mdc-dialog-title {
301
- font-weight: bold;
302
- font-size: 30px;
303
- line-height: 24px;
304
- letter-spacing: 0.25px;
305
- color: #333333;
306
- padding: 0;
307
- margin: 50px 50px 30px 50px;
308
- }
283
+ // Ajustes para mobile - breakpoint padrão de 768px
284
+ @media (max-width: 768px) {
285
+ flex-direction: column;
286
+ gap: 12px; // Gap menor no mobile
287
+
288
+ // No mobile, todas as colunas ocupam 100% da largura por padrão
289
+ .col,
290
+ .col-1,
291
+ .col-2,
292
+ .col-3,
293
+ .col-4,
294
+ .col-5,
295
+ .col-6,
296
+ .col-7,
297
+ .col-8,
298
+ .col-9,
299
+ .col-10,
300
+ .col-11,
301
+ .col-12 {
302
+ flex: 0 0 100%;
303
+ max-width: 100%;
304
+ }
309
305
 
310
- .mat-mdc-dialog-actions {
311
- padding: 0;
312
- margin: 30px 50px 50px 50px;
313
- }
314
- }
306
+ // Classes específicas para mobile quando necessário manter layout
307
+ .col-mobile-6 {
308
+ flex: 0 0 calc(50% - 6px);
309
+ }
315
310
 
316
- .mat-mdc-dialog-actions, .acoes {
317
- display: flex;
318
- flex-direction: row-reverse;
319
- gap: 20px;
320
- margin: 20px -20px 20px;
321
- border-top: 1px solid #ddd;
322
- padding: 20px 20px 0;
311
+ .col-mobile-4 {
312
+ flex: 0 0 calc(33.33333333% - 4px);
313
+ }
323
314
 
324
- .spacer {
325
- flex: 1 1 auto;
326
- }
327
- }
315
+ .col-mobile-3 {
316
+ flex: 0 0 calc(25% - 3px);
317
+ }
328
318
 
329
- mcl-query-form {
330
- .mat-accordion {
331
-
332
- .mat-expansion-panel {
333
- border-radius: 0 !important;
334
- background: transparent;
335
- box-shadow: none;
336
- border-bottom: 2px solid #ddd;
337
-
338
- .mat-expansion-panel-header {
339
- border-bottom: 1px solid rgba(0, 0, 0, .15);
340
-
341
- .mat-content {
342
- display: flex;
343
- align-items: center;
344
-
345
- .title {
346
- flex: 1 1 auto;
347
- }
348
- }
349
- }
350
-
351
- .mat-expansion-panel-body {
352
- padding: 20px;
353
- display: flex;
354
- gap: 20px;
355
- flex-wrap: wrap;
356
- align-items: center;
357
-
358
- .field {
359
- display: inline-block;
360
- font-size: 10px;
361
-
362
- .value {
363
- font-size: 12px;
364
- font-weight: lighter;
365
- color: mat.m2-get-color-from-palette($config, 100);
366
- background: mat.m2-get-color-from-palette($config, 50);
367
- border-radius: 5px;
368
- padding: 2px 5px;
369
- text-transform: uppercase;
370
- transition: 300ms;
371
-
372
- &:hover {
373
- background: mat.m2-get-color-from-palette($config, 60);
374
- }
375
-
376
- mat-icon {
377
- height: 18px;
378
- width: 18px;
379
- font-size: 18px;
380
- vertical-align: middle;
381
- color: mat.m2-get-color-from-palette($config, 100);
382
- margin-left: 10px;
383
- cursor: pointer;
384
- }
385
- }
386
- }
387
- }
319
+ // Permite manter layout horizontal no mobile quando necessário
320
+ &.row-mobile-horizontal {
321
+ flex-direction: row;
388
322
  }
389
323
  }
390
- }
391
324
 
392
- mcl-input-fileupload .previews {
393
- & > div {
394
- display: flex;
395
- flex-direction: row;
396
- flex-wrap: wrap;
397
- gap: 20px;
325
+ // Breakpoint adicional para tablets
326
+ @media (max-width: 992px) and (min-width: 769px) {
327
+ gap: 14px; // Gap intermediário para tablets
398
328
 
399
- .preview {
400
- .footer {
401
- align-items: center;
329
+ // Classes específicas para tablet
330
+ .col-tablet-6 {
331
+ flex: 0 0 calc(50% - 7px);
332
+ }
402
333
 
403
- mat-icon, a {
404
- flex: none !important;
405
- }
406
- }
334
+ .col-tablet-4 {
335
+ flex: 0 0 calc(33.33333333% - 4.67px);
407
336
  }
408
337
  }
409
338
  }
410
339
 
411
- @media(max-width: 750px) {
340
+ .acoes {
341
+ display: flex;
342
+ flex-direction: row-reverse;
343
+ gap: 10px;
412
344
 
413
345
  .spacer {
414
- flex: 1;
415
- }
416
-
417
- }
418
-
419
- @media (max-width: 1200px) {
420
- body {
421
- .mat-mdc-card:not([class*=mat-elevation-z]) {
422
- padding: 30px;
423
- }
346
+ flex: 1 1 auto;
424
347
  }
425
348
  }
426
349
 
427
- @media (max-width: 800px) {
428
- .row {
429
- flex-direction: column;
430
- gap: 0;
431
-
432
- .col-3, .col-4, .col-5, .col-6, .col-8, .col-9 {
433
- width: 100%;
434
- }
435
- }
350
+ .text-center {
351
+ text-align: center;
436
352
  }
437
353
 
438
- a, a:active {
439
- color: mat.m2-get-color-from-palette($config, 20);
440
- transition: 300ms;
441
- text-decoration: none;
354
+ .text-right {
355
+ text-align: right;
442
356
  }
443
357
 
444
- a:hover, a:hover:active {
445
- color: mat.m2-get-color-from-palette($config, 60);
446
- text-decoration: underline;
358
+ .text-left {
359
+ text-align: left;
447
360
  }
448
361
  }
449
362