@inchurch/matcha-theme 22.38.2 → 22.38.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.
Files changed (93) hide show
  1. package/abstracts/_colors.scss +291 -291
  2. package/abstracts/_elevation.scss +108 -108
  3. package/abstracts/_functions.scss +321 -321
  4. package/abstracts/_media-breakpoint.scss +26 -26
  5. package/abstracts/_theme-api.scss +224 -224
  6. package/abstracts/_typography.scss +128 -128
  7. package/base/_reset.scss +487 -487
  8. package/components/app-page-header.scss +260 -260
  9. package/components/matcha-accordion.scss +297 -297
  10. package/components/matcha-audio-player.scss +31 -31
  11. package/components/matcha-autocomplete.scss +145 -145
  12. package/components/matcha-avatar.scss +426 -426
  13. package/components/matcha-badge.scss +120 -120
  14. package/components/matcha-breadcrumb.scss +231 -231
  15. package/components/matcha-button-toggle.scss +484 -484
  16. package/components/matcha-buttons.scss +973 -973
  17. package/components/matcha-calendar.scss +253 -253
  18. package/components/matcha-cards.scss +212 -212
  19. package/components/matcha-chart-card.scss +53 -53
  20. package/components/matcha-checkbox.scss +266 -266
  21. package/components/matcha-chip.scss +311 -311
  22. package/components/matcha-color-pick.scss +34 -34
  23. package/components/matcha-command-palette.scss +316 -316
  24. package/components/matcha-crop.scss +419 -419
  25. package/components/matcha-date.scss +81 -81
  26. package/components/matcha-divider.scss +100 -100
  27. package/components/matcha-draggable.scss +23 -23
  28. package/components/matcha-drawer.scss +376 -376
  29. package/components/matcha-drop-image.scss +14 -14
  30. package/components/matcha-drop-list.scss +430 -430
  31. package/components/matcha-emoji.scss +69 -69
  32. package/components/matcha-empty-state.scss +230 -230
  33. package/components/matcha-file-uploader.scss +650 -637
  34. package/components/matcha-flag.scss +103 -103
  35. package/components/matcha-footer.scss +91 -91
  36. package/components/matcha-form-field.scss +883 -883
  37. package/components/matcha-form-section.scss +100 -100
  38. package/components/matcha-header.scss +135 -135
  39. package/components/matcha-highlight.scss +164 -164
  40. package/components/matcha-hint-text.scss +90 -90
  41. package/components/matcha-horizontal-tree.scss +247 -247
  42. package/components/matcha-icon.scss +111 -111
  43. package/components/matcha-image.scss +60 -60
  44. package/components/matcha-list.scss +211 -211
  45. package/components/matcha-menu.scss +99 -99
  46. package/components/matcha-modal.scss +210 -210
  47. package/components/matcha-nav.scss +770 -770
  48. package/components/matcha-notification.scss +417 -417
  49. package/components/matcha-option.scss +170 -170
  50. package/components/matcha-page-builder.scss +4196 -4196
  51. package/components/matcha-paginator.scss +699 -699
  52. package/components/matcha-panel.scss +216 -216
  53. package/components/matcha-period.scss +174 -174
  54. package/components/matcha-profile-card.scss +50 -50
  55. package/components/matcha-progress-bar.scss +355 -355
  56. package/components/matcha-radio.scss +325 -325
  57. package/components/matcha-ripple.scss +7 -7
  58. package/components/matcha-scrollbar.scss +33 -33
  59. package/components/matcha-scrollbox-shadow.scss +120 -120
  60. package/components/matcha-section.scss +102 -102
  61. package/components/matcha-select-multiple.scss +56 -56
  62. package/components/matcha-select.scss +629 -629
  63. package/components/matcha-skeleton.scss +182 -182
  64. package/components/matcha-slide-toggle.scss +369 -369
  65. package/components/matcha-slider.scss +285 -285
  66. package/components/matcha-snack-bar.scss +259 -259
  67. package/components/matcha-spin.scss +164 -164
  68. package/components/matcha-spinner.scss +97 -97
  69. package/components/matcha-stepper.scss +376 -376
  70. package/components/matcha-table-cell.scss +107 -107
  71. package/components/matcha-table.scss +722 -722
  72. package/components/matcha-tabs.scss +642 -642
  73. package/components/matcha-text-editor.scss +111 -111
  74. package/components/matcha-time.scss +33 -33
  75. package/components/matcha-timepicker.scss +13 -13
  76. package/components/matcha-toolbar.scss +366 -366
  77. package/components/matcha-tooltip.scss +235 -235
  78. package/components/matcha-tree-view.scss +636 -636
  79. package/layout/matcha-page-layout.scss +778 -778
  80. package/main.scss +334 -334
  81. package/package.json +1 -1
  82. package/tokens/_animations-tokens.scss +37 -37
  83. package/tokens/_breakpoints-tokens.scss +35 -35
  84. package/tokens/_color-tokens.scss +288 -288
  85. package/tokens/_elevation-tokens.scss +33 -33
  86. package/tokens/_emit-tokens.scss +329 -329
  87. package/tokens/_material-palette.scss +1149 -1149
  88. package/tokens/_primitives.scss +98 -98
  89. package/tokens/_semantic-aliases.scss +120 -120
  90. package/tokens/_spacing-tokens.scss +94 -94
  91. package/tokens/_static-tokens.scss +137 -137
  92. package/tokens/_typography-tokens.scss +65 -65
  93. package/vendors/charts.scss +90 -90
@@ -1,642 +1,642 @@
1
- @use "matcha-buttons" as *;
2
- @use "sass:map";
3
-
4
- @mixin _colorize-inactive-type-basic($theme, $color-functions) {
5
- &[inactivetype="basic"] {
6
- @each $colorName in $color-functions {
7
- &[inactivecolor="#{'' + $colorName}"] {
8
- .button-group matcha-tab-item {
9
-
10
- button[matcha-button],
11
- a[matcha-button] {
12
- &:not([active-item="true"]) {
13
- background: var(--matcha-color-surface);
14
- color: var(--matcha-color-#{$colorName});
15
- box-shadow: 0 0 0 0px inset;
16
-
17
- .ripple {
18
- background: var(--matcha-color-#{$colorName}-alpha); // ok: legacy ripple color token
19
- }
20
- }
21
- }
22
- }
23
- }
24
- }
25
-
26
- &[disabled],
27
- &[disabled]:not([disabled="false"]),
28
- &[disabled="true"] {
29
- &:not([active-item="true"]) {
30
- .button-group matcha-tab-item {
31
-
32
- button[matcha-button],
33
- a[matcha-button] {
34
- @include disabled-basic-button($theme);
35
- }
36
- }
37
- }
38
- }
39
- }
40
- }
41
-
42
- @mixin _colorize-inactive-type-outline($theme, $color-functions) {
43
- &[inactivetype="outline"] {
44
-
45
- //disabled false
46
- &:not([disabled="true"]) {
47
- @each $colorName in $color-functions {
48
- &[inactivecolor="#{'' + $colorName}"] {
49
- .button-group matcha-tab-item {
50
-
51
- button[matcha-button],
52
- a[matcha-button] {
53
-
54
- //botão não ativo
55
- &:not([active-item="true"]) {
56
- color: var(--matcha-color-#{$colorName});
57
- background: transparent;
58
- box-shadow: 0 0 0 2px var(--matcha-color-#{$colorName}) inset;
59
-
60
- .ripple {
61
- background: var(--matcha-color-#{$colorName}-alpha); // ok: legacy ripple color token
62
- }
63
- }
64
- }
65
- }
66
- }
67
- }
68
- }
69
-
70
- //disabled true
71
- &[disabled],
72
- &[disabled]:not([disabled="false"]),
73
- &[disabled="true"] {
74
- >.button-group matcha-tab-item {
75
-
76
- button[matcha-button],
77
- a[matcha-button] {
78
-
79
- //botão não ativo
80
- &:not([active-item="true"]) {
81
- @include disabled-outline-button($theme);
82
- }
83
- }
84
- }
85
- }
86
- }
87
- }
88
-
89
- @mixin _colorize-inactive-type-alpha($theme, $color-functions) {
90
- &[inactivetype="alpha"] {
91
- @each $colorName in $color-functions {
92
- &[inactivecolor="#{'' + $colorName}"] {
93
- .button-group matcha-tab-item {
94
-
95
- button[matcha-button],
96
- a[matcha-button] {
97
- &:not([active-item="true"]) {
98
- color: var(--matcha-color-#{$colorName});
99
- background: var(--matcha-color-#{$colorName}-alpha);
100
- box-shadow: 0 0 0 0px;
101
-
102
- .ripple {
103
- background: var(--matcha-color-#{$colorName}-contrast-alpha); // ok: legacy ripple color token
104
- }
105
- }
106
- }
107
- }
108
- }
109
- }
110
-
111
- &[disabled],
112
- &[disabled]:not([disabled="false"]),
113
- &[disabled="true"] {
114
- .button-group matcha-tab-item {
115
-
116
- button[matcha-button],
117
- a[matcha-button] {
118
-
119
- //botão não ativo
120
- &:not([active-item="true"]) {
121
- @include disabled-alpha-button($theme);
122
- }
123
- }
124
- }
125
- }
126
- }
127
- }
128
-
129
- @mixin _colorize-inactive-type-link($theme, $color-functions) {
130
-
131
- &[inactivetype="link"] {
132
- @each $colorName in $color-functions {
133
- &[inactivecolor="#{'' + $colorName}"] {
134
- .button-group matcha-tab-item {
135
-
136
- button[matcha-button],
137
- a[matcha-button] {
138
- &:not([active-item="true"]) {
139
-
140
- background: transparent;
141
- color: var(--matcha-color-#{$colorName});
142
- box-shadow: 0 0 0 0px;
143
-
144
- .ripple {
145
- background: var(--matcha-color-#{$colorName}-alpha); // ok: legacy ripple color token
146
- }
147
-
148
- }
149
- }
150
- }
151
- }
152
- }
153
-
154
- &[disabled],
155
- &[disabled]:not([disabled="false"]),
156
- &[disabled="true"] {
157
- .button-group matcha-tab-item {
158
-
159
- button[matcha-button],
160
- a[matcha-button] {
161
-
162
- //botão não ativo
163
- &:not([active-item="true"]) {
164
- @include disabled-link-button($theme);
165
- }
166
- }
167
- }
168
- }
169
- }
170
- }
171
-
172
-
173
-
174
-
175
- @mixin matcha-tabs($theme) {
176
- // Nomes de cor (semânticas + paleta). As cores vêm de var(--matcha-color-*)
177
- // emitidas no tema — sem getRed/$theme compile-time. Value-preserving.
178
- $color-functions: "red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue", "cyan", "teal",
179
- "green", "light-green", "lime", "yellow", "amber", "orange", "deep-orange", "brown", "grey", "blue-grey",
180
- "primary", "accent", "success", "warn", "danger", "info", "disabled";
181
-
182
- matcha-tabs {
183
- display: flex;
184
- @include _colorize-inactive-type-basic($theme, $color-functions);
185
- @include _colorize-inactive-type-outline($theme, $color-functions);
186
- @include _colorize-inactive-type-alpha($theme, $color-functions);
187
- @include _colorize-inactive-type-link($theme, $color-functions);
188
-
189
- .button-group matcha-tab-item {
190
- button[matcha-button],
191
- a[matcha-button] {
192
- &:focus-visible:not([disabled]):not([disabled="true"]) {
193
- outline: var(--matcha-state-focus-ring-width, 2px) solid var(--matcha-color-accent);
194
- outline-offset: var(--matcha-state-focus-ring-offset, 2px);
195
- }
196
- }
197
- }
198
-
199
- &[disabled],
200
- &[disabled]:not([disabled="false"]),
201
- &[disabled="true"] {
202
- .button-group matcha-tab-item {
203
-
204
- button[matcha-button],
205
- a[matcha-button] {
206
- &[active-item="true"] {
207
-
208
- &[outline],
209
- &[outline]:not([outline="false"]),
210
- &[outline="true"] {
211
- @include disabled-outline-button($theme);
212
- }
213
-
214
- &[basic],
215
- &[basic]:not([basic="false"]),
216
- &[basic="true"] {
217
- @include disabled-basic-button($theme);
218
- }
219
-
220
- &[alpha],
221
- &[alpha]:not([alpha="false"]),
222
- &[alpha="true"] {
223
- @include disabled-alpha-button($theme);
224
- }
225
-
226
- &[link],
227
- &[link]:not([link="false"]),
228
- &[link="true"] {
229
- @include disabled-link-button($theme);
230
- }
231
- }
232
- }
233
- }
234
-
235
- }
236
- }
237
- }
238
-
239
- .button-group {
240
- &.gap-0 {
241
- gap: 0 !important;
242
-
243
- // Ajuste border-radius quando gap = 0
244
- matcha-tab-item:first-child button[matcha-button] {
245
- border-top-right-radius: 0;
246
- border-bottom-right-radius: 0;
247
- }
248
-
249
- matcha-tab-item:last-child button[matcha-button] {
250
- border-top-left-radius: 0;
251
- border-bottom-left-radius: 0;
252
- }
253
-
254
- matcha-tab-item:not(:first-child):not(:last-child) button[matcha-button] {
255
- border-radius: 0;
256
- }
257
- }
258
- }
259
-
260
- // =============================================================================
261
- // MODERNIZED TAB STYLES — 1:1 Figma DSV3 matcha/tabs/tab (15768:76)
262
- // Tipo: Underline (só horizontal) · Card (horizontal + vertical)
263
- // Estado: Default · Selecionado · Disabled
264
- // Ícone: opcional
265
- // =============================================================================
266
-
267
- @mixin matcha-tabs-modern($theme) {
268
-
269
- // ── Component-level tokens (overridable pelo consumer via CSS vars) ───
270
- matcha-tabs {
271
- --matcha-tab-min-width-underline: var(--matcha-space-1500, 120px);
272
- --matcha-tab-min-width-card-horizontal: 107px;
273
- --matcha-tab-min-width-card-vertical: var(--matcha-space-1100, 88px);
274
- --matcha-tab-close-size: var(--matcha-icon-size-xs, 14px);
275
- --matcha-tab-state-opacity-hover: var(--matcha-state-hover, 0.08);
276
- --matcha-tab-state-opacity-active: var(--matcha-state-active, 0.12);
277
- --matcha-tab-state-opacity-disabled: var(--matcha-state-opacity-disabled, 0.5);
278
- --matcha-tab-focus-halo: 4px;
279
- --matcha-tab-focus-halo-alpha: 0.16;
280
-
281
- // Layout do host — canon WAI-ARIA tablist:
282
- // horizontal → nav em cima, content embaixo (column)
283
- // vertical → nav à esquerda, content à direita (row, sidenav-like)
284
- // Override do legacy `matcha-tabs { display: flex }` que assumia row sempre
285
- // (legado button-group). Aria-orientation vem do host binding do component.
286
- flex-direction: column;
287
- // 24px (space-300) é o vertical rhythm canon entre blocos no painel —
288
- // mesmo gap entre seções dentro do content. Evita "tab↔content maior que
289
- // section↔section" que rompe a hierarquia visual.
290
- gap: var(--matcha-space-300, 24px);
291
-
292
- &[aria-orientation="vertical"] {
293
- flex-direction: row;
294
- gap: var(--matcha-space-300, 24px);
295
- }
296
- }
297
-
298
- // ── Underline Tab (1:1 Figma DSV3 — border per item) ──────────────────
299
- // Item transparente + border-bottom (surface-border default, accent
300
- // selected) — sem bg próprio: o retângulo de surface-card destoava quando
301
- // o tablist ficava sobre superfície de outro tom (painel, jul/2026).
302
- // Container não tem border próprio (canon Figma).
303
- // Sliding indicator absoluto desliza entre tabs (Material 3 style).
304
- // Sempre horizontal (vertical não é canon).
305
- .matcha-tab-underline {
306
- display: flex;
307
- align-items: stretch;
308
- background: transparent;
309
- position: relative;
310
-
311
- // ── Scroll horizontal é o DEFAULT do underline (desktop e mobile) ─────
312
- // A linha de tabs nunca deve vazar do container: quando não cabe, rola.
313
- // O input `scrollable` continua existindo (compat) mas virou no-op — o
314
- // comportamento que ele ligava agora é o padrão.
315
- // Exceção: com [responsiveGrid] ativo o nav vira grid multi-linha abaixo de
316
- // 1024px e precisa de overflow visível pra crescer em altura — quem manda
317
- // no overflow nesse caso é a regra de `.tabs-nav-responsive-grid`
318
- // (matcha-components/.../tabs/tabs.component.scss).
319
- &:not(.tabs-nav-responsive-grid) {
320
- overflow-x: auto;
321
- overflow-y: hidden;
322
- -webkit-overflow-scrolling: touch;
323
- }
324
-
325
- // ── Sliding indicator (Material 3 magic underline) ──
326
- // Cantos retos + 2px de altura (canon Figma — sem rounded).
327
- .matcha-tab-indicator {
328
- position: absolute;
329
- bottom: 0;
330
- left: var(--matcha-tab-indicator-left, 0);
331
- width: var(--matcha-tab-indicator-width, 0);
332
- height: var(--matcha-border-thin, 2px);
333
- background: var(--matcha-color-accent);
334
- border-radius: 0;
335
- transition:
336
- left var(--matcha-duration-fast, 200ms) var(--matcha-easing-emphasized, cubic-bezier(0.2, 0, 0, 1)),
337
- width var(--matcha-duration-fast, 200ms) var(--matcha-easing-emphasized, cubic-bezier(0.2, 0, 0, 1));
338
- pointer-events: none;
339
- z-index: 1;
340
- }
341
-
342
- .matcha-tab-item {
343
- display: flex;
344
- align-items: center;
345
- justify-content: center;
346
- gap: var(--matcha-space-100, 8px);
347
- padding: var(--matcha-space-200, 16px) var(--matcha-space-500, 40px);
348
- border: none;
349
- // Border bottom 2px — per item (track surface-border, slider sobrepõe accent)
350
- border-bottom: var(--matcha-border-thin, 2px) solid
351
- var(--matcha-color-surface-border);
352
- background: transparent;
353
- cursor: pointer;
354
- position: relative;
355
- overflow: hidden;
356
- font-family: var(--matcha-font-family);
357
- font-size: var(--matcha-text-body-lg, 16px);
358
- font-weight: var(--matcha-weight-regular, 400);
359
- line-height: var(--matcha-leading-body-lg, 24px);
360
- color: var(--matcha-color-text-secondary,
361
- color-mix(in srgb, var(--matcha-color-fg) 70%, transparent));
362
- white-space: nowrap;
363
- flex-shrink: 0;
364
- min-width: var(--matcha-tab-min-width-underline);
365
- transition:
366
- color var(--matcha-duration-fast, 200ms) var(--matcha-easing-standard, cubic-bezier(0.4, 0, 0.2, 1)),
367
- border-bottom-color var(--matcha-duration-fast, 200ms) var(--matcha-easing-standard, cubic-bezier(0.4, 0, 0.2, 1)),
368
- font-weight var(--matcha-duration-fast, 200ms) ease;
369
-
370
- // State layer (hover + active visual feedback)
371
- &::before {
372
- content: '';
373
- position: absolute;
374
- inset: 0;
375
- background: currentColor;
376
- opacity: 0;
377
- pointer-events: none;
378
- transition: opacity var(--matcha-duration-instant, 80ms) linear;
379
- }
380
- &:hover:not(:disabled)::before { opacity: var(--matcha-tab-state-opacity-hover); }
381
- &:active:not(:disabled)::before { opacity: var(--matcha-tab-state-opacity-active); }
382
-
383
- // ── Selecionado (border-bottom muda pra accent ALÉM do sliding indicator
384
- // — cobre 100% mesmo com subpixel mismatch do indicator) ──
385
- &.active,
386
- &[aria-selected="true"] {
387
- color: var(--matcha-color-accent);
388
- font-weight: var(--matcha-weight-semibold, 600);
389
- line-height: var(--matcha-leading-title-sm, 22px);
390
- border-bottom-color: var(--matcha-color-accent);
391
- // Ícone acompanha o label no Underline. matcha-icon não herda
392
- // currentColor por design — resolve `--matcha-icon-color`, então o
393
- // override é via CSS var (pattern documentado em matcha-icon.scss).
394
- // Card NÃO faz isso: lá o selected é text-primary, não accent.
395
- --matcha-icon-color: var(--matcha-color-accent);
396
- }
397
-
398
- // ── Disabled ──
399
- &:disabled,
400
- &[disabled] {
401
- opacity: var(--matcha-tab-state-opacity-disabled);
402
- pointer-events: none;
403
- cursor: default;
404
- }
405
-
406
- // ── Focus ring polido (offset 4px + halo 16% alpha) ──
407
- &:focus-visible {
408
- outline: var(--matcha-state-focus-ring-width, 2px) solid
409
- var(--matcha-color-accent);
410
- outline-offset: var(--matcha-state-focus-ring-offset, 4px);
411
- border-radius: var(--matcha-radius-sm, 4px);
412
- box-shadow: 0 0 0 var(--matcha-tab-focus-halo)
413
- color-mix(in srgb, var(--matcha-color-accent) calc(var(--matcha-tab-focus-halo-alpha) * 100%), transparent);
414
- }
415
- }
416
- }
417
-
418
- // ── Card Tab (canon Figma) ────────────────────────────────────────────
419
- // Card 2px border accent quando selected · texto e ícone accent também
420
- // (decisão de Design 2026-08-04 — antes era text-primary).
421
- // Suporta horizontal (default) e vertical (icon stacked).
422
- .matcha-tab-card {
423
- display: flex;
424
- // Tamanho natural por item — stretch vertical antes esticava cards quando
425
- // pai tinha altura expandida (bug reportado em pages com page-content flex-fill).
426
- align-items: flex-start;
427
- gap: var(--matcha-space-100, 8px);
428
- flex-wrap: wrap;
429
-
430
- // Equal-width layout — cada tab ocupa fatia igual da row (paginador-like).
431
- // Habilitado via prop `equalWidth` no consumer. Icon stacked acima do label
432
- // (look canon de paginator), independente de orientation do host.
433
- &.matcha-tab-equal-width {
434
- flex-wrap: nowrap;
435
-
436
- .matcha-tab-item {
437
- flex: 1 1 0;
438
- min-width: 0;
439
- flex-direction: column;
440
- text-align: center;
441
- padding: var(--matcha-space-150, 12px) var(--matcha-space-200, 16px);
442
- }
443
- }
444
-
445
- // Vertical layout — empilha icon + label
446
- &.matcha-tab-vertical .matcha-tab-item {
447
- flex-direction: column;
448
- min-width: var(--matcha-tab-min-width-card-vertical);
449
- padding: var(--matcha-space-100, 8px) var(--matcha-space-200, 16px);
450
- text-align: center;
451
- }
452
-
453
- .matcha-tab-item {
454
- display: flex;
455
- align-items: center;
456
- justify-content: center;
457
- gap: var(--matcha-space-100, 8px);
458
- padding: var(--matcha-space-150, 12px) var(--matcha-space-200, 16px);
459
- border: var(--matcha-border-thin, 1px) solid transparent;
460
- // radius-lg (8px) escala 1:2 com cards (xl=16px) — hierarquia visual
461
- // canon: atom interativo / container. Antes era md (4px), o que dava
462
- // disparidade 1:4 e quebrava a leitura conjunta tabs + cards.
463
- border-radius: var(--matcha-radius-lg, 8px);
464
- background: var(--matcha-color-surface-card);
465
- cursor: pointer;
466
- position: relative;
467
- overflow: hidden;
468
- font-family: var(--matcha-font-family);
469
- font-size: var(--matcha-text-body-md, 14px);
470
- font-weight: var(--matcha-weight-regular, 400);
471
- line-height: var(--matcha-leading-body-md, 20px);
472
- color: var(--matcha-color-text-secondary,
473
- color-mix(in srgb, var(--matcha-color-fg) 70%, transparent));
474
- flex-shrink: 0;
475
- min-width: var(--matcha-tab-min-width-card-horizontal);
476
- transition:
477
- border-color var(--matcha-duration-fast, 200ms) var(--matcha-easing-standard, cubic-bezier(0.4, 0, 0.2, 1)),
478
- color var(--matcha-duration-fast, 200ms) var(--matcha-easing-standard, cubic-bezier(0.4, 0, 0.2, 1)),
479
- transform var(--matcha-duration-instant, 80ms) ease;
480
-
481
- // State layer
482
- &::before {
483
- content: '';
484
- position: absolute;
485
- inset: 0;
486
- background: currentColor;
487
- opacity: 0;
488
- border-radius: inherit;
489
- pointer-events: none;
490
- transition: opacity var(--matcha-duration-instant, 80ms) linear;
491
- }
492
- &:hover:not(:disabled) {
493
- &::before { opacity: var(--matcha-tab-state-opacity-hover); }
494
- transform: translateY(calc(-1 * var(--matcha-border-hairline, 1px)));
495
- }
496
- &:active:not(:disabled)::before { opacity: var(--matcha-tab-state-opacity-active); }
497
-
498
- // ── Selecionado (border + texto + ícone accent) ──
499
- // Decisão de Design 2026-08-04: o selected do Card passa a ser accent no
500
- // texto e no ícone também, não só na border — antes o texto era
501
- // text-primary (canon Figma antigo). Figma `matcha/tabs` pendente de
502
- // atualização; até lá o código é a fonte da verdade deste estado.
503
- &.active,
504
- &[aria-selected="true"] {
505
- border-color: var(--matcha-color-accent);
506
- color: var(--matcha-color-accent);
507
- font-weight: var(--matcha-weight-medium, 500);
508
- // matcha-icon não herda currentColor — override via CSS var.
509
- --matcha-icon-color: var(--matcha-color-accent);
510
- }
511
-
512
- // ── Disabled ──
513
- &:disabled,
514
- &[disabled] {
515
- opacity: var(--matcha-tab-state-opacity-disabled);
516
- pointer-events: none;
517
- cursor: default;
518
- }
519
-
520
- // ── Focus ring polido ──
521
- &:focus-visible {
522
- outline: var(--matcha-state-focus-ring-width, 2px) solid
523
- var(--matcha-color-accent);
524
- outline-offset: var(--matcha-border-thin, 2px);
525
- box-shadow: 0 0 0 var(--matcha-tab-focus-halo)
526
- color-mix(in srgb, var(--matcha-color-accent) calc(var(--matcha-tab-focus-halo-alpha) * 100%), transparent);
527
- }
528
- }
529
- }
530
-
531
- // ── Icon inside tab items ──
532
- .matcha-tab-underline,
533
- .matcha-tab-card {
534
- .matcha-tab-item matcha-icon { flex-shrink: 0; }
535
- }
536
-
537
- // ── Scrollbar do tablist que rola ─────────────────────────────────────
538
- // Fonte única da APARÊNCIA do scroll horizontal — vale pro `scrollable` e
539
- // pro grid responsivo no desktop, que só declaram o overflow. A barra
540
- // nativa do OS (grossa, com setas) competia visualmente com as tabs.
541
- // Propriedades são inertes quando não há overflow, então podem ficar nos
542
- // dois tipos sem condicional.
543
- .matcha-tab-underline,
544
- .matcha-tab-card {
545
- scrollbar-width: thin;
546
- scrollbar-color: var(--matcha-color-surface-border) transparent;
547
-
548
- &::-webkit-scrollbar {
549
- height: var(--matcha-space-050, 4px);
550
- }
551
-
552
- &::-webkit-scrollbar-track {
553
- background: transparent;
554
- }
555
-
556
- &::-webkit-scrollbar-thumb {
557
- background: var(--matcha-color-surface-border);
558
- border-radius: var(--matcha-radius-pill, 9999px);
559
- }
560
- }
561
-
562
- // ── Badge (notificações, contagens) ───────────────────────────────────
563
- .matcha-tab-item__badge {
564
- display: inline-flex;
565
- align-items: center;
566
- justify-content: center;
567
- min-width: var(--matcha-space-250, 20px);
568
- height: var(--matcha-space-250, 20px);
569
- padding: 0 var(--matcha-space-075, 6px);
570
- background: var(--matcha-color-accent);
571
- color: var(--matcha-color-accent-text-on,
572
- var(--matcha-color-accent-contrast));
573
- border-radius: var(--matcha-radius-pill, 9999px);
574
- font-size: var(--matcha-text-body-xs, 11px);
575
- font-weight: var(--matcha-weight-semibold, 600);
576
- line-height: 1;
577
- flex-shrink: 0;
578
- }
579
-
580
- // ── Close button (closable tabs) ──────────────────────────────────────
581
- .matcha-tab-item__close {
582
- display: inline-flex;
583
- align-items: center;
584
- justify-content: center;
585
- width: var(--matcha-space-300, 24px);
586
- height: var(--matcha-space-300, 24px);
587
- border-radius: 50%;
588
- color: var(--matcha-color-text-secondary,
589
- color-mix(in srgb, var(--matcha-color-fg) 70%, transparent));
590
- transition:
591
- background-color var(--matcha-duration-instant, 80ms) ease,
592
- color var(--matcha-duration-instant, 80ms) ease;
593
- flex-shrink: 0;
594
- cursor: pointer;
595
- margin-left: var(--matcha-space-050, 4px);
596
-
597
- &:hover {
598
- background: var(--matcha-color-surface-hover,
599
- color-mix(in srgb, var(--matcha-color-fg) 8%, transparent));
600
- color: var(--matcha-color-fg);
601
- }
602
-
603
- &:focus-visible {
604
- outline: var(--matcha-state-focus-ring-width, 2px) solid
605
- var(--matcha-color-accent);
606
- outline-offset: var(--matcha-border-thin, 2px);
607
- }
608
-
609
- svg {
610
- display: block;
611
- width: var(--matcha-tab-close-size, 14px);
612
- height: var(--matcha-tab-close-size, 14px);
613
- }
614
- }
615
- }
616
-
617
- // ── Mobile: reset min-width pra evitar overflow + auto-scroll ───────────
618
- @media (max-width: 639px) {
619
- .matcha-tab-underline .matcha-tab-item,
620
- .matcha-tab-card .matcha-tab-item {
621
- min-width: auto;
622
- }
623
- }
624
-
625
- // (Antes havia aqui um bloco @media (max-width: 639px) ligando overflow-x no
626
- // underline "não scrollable" — redundante desde que o scroll virou o default do
627
- // tipo em qualquer viewport.)
628
-
629
- // ── Reduced motion (WCAG 2.2.2) ─────────────────────────────────────────
630
- @media (prefers-reduced-motion: reduce) {
631
- .matcha-tab-underline .matcha-tab-item,
632
- .matcha-tab-underline .matcha-tab-item::before,
633
- .matcha-tab-card .matcha-tab-item,
634
- .matcha-tab-card .matcha-tab-item::before,
635
- .matcha-tab-indicator,
636
- .matcha-tab-item__close {
637
- transition: none;
638
- }
639
- .matcha-tab-card .matcha-tab-item:hover {
640
- transform: none;
641
- }
642
- }
1
+ @use "matcha-buttons" as *;
2
+ @use "sass:map";
3
+
4
+ @mixin _colorize-inactive-type-basic($theme, $color-functions) {
5
+ &[inactivetype="basic"] {
6
+ @each $colorName in $color-functions {
7
+ &[inactivecolor="#{'' + $colorName}"] {
8
+ .button-group matcha-tab-item {
9
+
10
+ button[matcha-button],
11
+ a[matcha-button] {
12
+ &:not([active-item="true"]) {
13
+ background: var(--matcha-color-surface);
14
+ color: var(--matcha-color-#{$colorName});
15
+ box-shadow: 0 0 0 0px inset;
16
+
17
+ .ripple {
18
+ background: var(--matcha-color-#{$colorName}-alpha); // ok: legacy ripple color token
19
+ }
20
+ }
21
+ }
22
+ }
23
+ }
24
+ }
25
+
26
+ &[disabled],
27
+ &[disabled]:not([disabled="false"]),
28
+ &[disabled="true"] {
29
+ &:not([active-item="true"]) {
30
+ .button-group matcha-tab-item {
31
+
32
+ button[matcha-button],
33
+ a[matcha-button] {
34
+ @include disabled-basic-button($theme);
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+
42
+ @mixin _colorize-inactive-type-outline($theme, $color-functions) {
43
+ &[inactivetype="outline"] {
44
+
45
+ //disabled false
46
+ &:not([disabled="true"]) {
47
+ @each $colorName in $color-functions {
48
+ &[inactivecolor="#{'' + $colorName}"] {
49
+ .button-group matcha-tab-item {
50
+
51
+ button[matcha-button],
52
+ a[matcha-button] {
53
+
54
+ //botão não ativo
55
+ &:not([active-item="true"]) {
56
+ color: var(--matcha-color-#{$colorName});
57
+ background: transparent;
58
+ box-shadow: 0 0 0 2px var(--matcha-color-#{$colorName}) inset;
59
+
60
+ .ripple {
61
+ background: var(--matcha-color-#{$colorName}-alpha); // ok: legacy ripple color token
62
+ }
63
+ }
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+
70
+ //disabled true
71
+ &[disabled],
72
+ &[disabled]:not([disabled="false"]),
73
+ &[disabled="true"] {
74
+ >.button-group matcha-tab-item {
75
+
76
+ button[matcha-button],
77
+ a[matcha-button] {
78
+
79
+ //botão não ativo
80
+ &:not([active-item="true"]) {
81
+ @include disabled-outline-button($theme);
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+
89
+ @mixin _colorize-inactive-type-alpha($theme, $color-functions) {
90
+ &[inactivetype="alpha"] {
91
+ @each $colorName in $color-functions {
92
+ &[inactivecolor="#{'' + $colorName}"] {
93
+ .button-group matcha-tab-item {
94
+
95
+ button[matcha-button],
96
+ a[matcha-button] {
97
+ &:not([active-item="true"]) {
98
+ color: var(--matcha-color-#{$colorName});
99
+ background: var(--matcha-color-#{$colorName}-alpha);
100
+ box-shadow: 0 0 0 0px;
101
+
102
+ .ripple {
103
+ background: var(--matcha-color-#{$colorName}-contrast-alpha); // ok: legacy ripple color token
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
110
+
111
+ &[disabled],
112
+ &[disabled]:not([disabled="false"]),
113
+ &[disabled="true"] {
114
+ .button-group matcha-tab-item {
115
+
116
+ button[matcha-button],
117
+ a[matcha-button] {
118
+
119
+ //botão não ativo
120
+ &:not([active-item="true"]) {
121
+ @include disabled-alpha-button($theme);
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+
129
+ @mixin _colorize-inactive-type-link($theme, $color-functions) {
130
+
131
+ &[inactivetype="link"] {
132
+ @each $colorName in $color-functions {
133
+ &[inactivecolor="#{'' + $colorName}"] {
134
+ .button-group matcha-tab-item {
135
+
136
+ button[matcha-button],
137
+ a[matcha-button] {
138
+ &:not([active-item="true"]) {
139
+
140
+ background: transparent;
141
+ color: var(--matcha-color-#{$colorName});
142
+ box-shadow: 0 0 0 0px;
143
+
144
+ .ripple {
145
+ background: var(--matcha-color-#{$colorName}-alpha); // ok: legacy ripple color token
146
+ }
147
+
148
+ }
149
+ }
150
+ }
151
+ }
152
+ }
153
+
154
+ &[disabled],
155
+ &[disabled]:not([disabled="false"]),
156
+ &[disabled="true"] {
157
+ .button-group matcha-tab-item {
158
+
159
+ button[matcha-button],
160
+ a[matcha-button] {
161
+
162
+ //botão não ativo
163
+ &:not([active-item="true"]) {
164
+ @include disabled-link-button($theme);
165
+ }
166
+ }
167
+ }
168
+ }
169
+ }
170
+ }
171
+
172
+
173
+
174
+
175
+ @mixin matcha-tabs($theme) {
176
+ // Nomes de cor (semânticas + paleta). As cores vêm de var(--matcha-color-*)
177
+ // emitidas no tema — sem getRed/$theme compile-time. Value-preserving.
178
+ $color-functions: "red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue", "cyan", "teal",
179
+ "green", "light-green", "lime", "yellow", "amber", "orange", "deep-orange", "brown", "grey", "blue-grey",
180
+ "primary", "accent", "success", "warn", "danger", "info", "disabled";
181
+
182
+ matcha-tabs {
183
+ display: flex;
184
+ @include _colorize-inactive-type-basic($theme, $color-functions);
185
+ @include _colorize-inactive-type-outline($theme, $color-functions);
186
+ @include _colorize-inactive-type-alpha($theme, $color-functions);
187
+ @include _colorize-inactive-type-link($theme, $color-functions);
188
+
189
+ .button-group matcha-tab-item {
190
+ button[matcha-button],
191
+ a[matcha-button] {
192
+ &:focus-visible:not([disabled]):not([disabled="true"]) {
193
+ outline: var(--matcha-state-focus-ring-width, 2px) solid var(--matcha-color-accent);
194
+ outline-offset: var(--matcha-state-focus-ring-offset, 2px);
195
+ }
196
+ }
197
+ }
198
+
199
+ &[disabled],
200
+ &[disabled]:not([disabled="false"]),
201
+ &[disabled="true"] {
202
+ .button-group matcha-tab-item {
203
+
204
+ button[matcha-button],
205
+ a[matcha-button] {
206
+ &[active-item="true"] {
207
+
208
+ &[outline],
209
+ &[outline]:not([outline="false"]),
210
+ &[outline="true"] {
211
+ @include disabled-outline-button($theme);
212
+ }
213
+
214
+ &[basic],
215
+ &[basic]:not([basic="false"]),
216
+ &[basic="true"] {
217
+ @include disabled-basic-button($theme);
218
+ }
219
+
220
+ &[alpha],
221
+ &[alpha]:not([alpha="false"]),
222
+ &[alpha="true"] {
223
+ @include disabled-alpha-button($theme);
224
+ }
225
+
226
+ &[link],
227
+ &[link]:not([link="false"]),
228
+ &[link="true"] {
229
+ @include disabled-link-button($theme);
230
+ }
231
+ }
232
+ }
233
+ }
234
+
235
+ }
236
+ }
237
+ }
238
+
239
+ .button-group {
240
+ &.gap-0 {
241
+ gap: 0 !important;
242
+
243
+ // Ajuste border-radius quando gap = 0
244
+ matcha-tab-item:first-child button[matcha-button] {
245
+ border-top-right-radius: 0;
246
+ border-bottom-right-radius: 0;
247
+ }
248
+
249
+ matcha-tab-item:last-child button[matcha-button] {
250
+ border-top-left-radius: 0;
251
+ border-bottom-left-radius: 0;
252
+ }
253
+
254
+ matcha-tab-item:not(:first-child):not(:last-child) button[matcha-button] {
255
+ border-radius: 0;
256
+ }
257
+ }
258
+ }
259
+
260
+ // =============================================================================
261
+ // MODERNIZED TAB STYLES — 1:1 Figma DSV3 matcha/tabs/tab (15768:76)
262
+ // Tipo: Underline (só horizontal) · Card (horizontal + vertical)
263
+ // Estado: Default · Selecionado · Disabled
264
+ // Ícone: opcional
265
+ // =============================================================================
266
+
267
+ @mixin matcha-tabs-modern($theme) {
268
+
269
+ // ── Component-level tokens (overridable pelo consumer via CSS vars) ───
270
+ matcha-tabs {
271
+ --matcha-tab-min-width-underline: var(--matcha-space-1500, 120px);
272
+ --matcha-tab-min-width-card-horizontal: 107px;
273
+ --matcha-tab-min-width-card-vertical: var(--matcha-space-1100, 88px);
274
+ --matcha-tab-close-size: var(--matcha-icon-size-xs, 14px);
275
+ --matcha-tab-state-opacity-hover: var(--matcha-state-hover, 0.08);
276
+ --matcha-tab-state-opacity-active: var(--matcha-state-active, 0.12);
277
+ --matcha-tab-state-opacity-disabled: var(--matcha-state-opacity-disabled, 0.5);
278
+ --matcha-tab-focus-halo: 4px;
279
+ --matcha-tab-focus-halo-alpha: 0.16;
280
+
281
+ // Layout do host — canon WAI-ARIA tablist:
282
+ // horizontal → nav em cima, content embaixo (column)
283
+ // vertical → nav à esquerda, content à direita (row, sidenav-like)
284
+ // Override do legacy `matcha-tabs { display: flex }` que assumia row sempre
285
+ // (legado button-group). Aria-orientation vem do host binding do component.
286
+ flex-direction: column;
287
+ // 24px (space-300) é o vertical rhythm canon entre blocos no painel —
288
+ // mesmo gap entre seções dentro do content. Evita "tab↔content maior que
289
+ // section↔section" que rompe a hierarquia visual.
290
+ gap: var(--matcha-space-300, 24px);
291
+
292
+ &[aria-orientation="vertical"] {
293
+ flex-direction: row;
294
+ gap: var(--matcha-space-300, 24px);
295
+ }
296
+ }
297
+
298
+ // ── Underline Tab (1:1 Figma DSV3 — border per item) ──────────────────
299
+ // Item transparente + border-bottom (surface-border default, accent
300
+ // selected) — sem bg próprio: o retângulo de surface-card destoava quando
301
+ // o tablist ficava sobre superfície de outro tom (painel, jul/2026).
302
+ // Container não tem border próprio (canon Figma).
303
+ // Sliding indicator absoluto desliza entre tabs (Material 3 style).
304
+ // Sempre horizontal (vertical não é canon).
305
+ .matcha-tab-underline {
306
+ display: flex;
307
+ align-items: stretch;
308
+ background: transparent;
309
+ position: relative;
310
+
311
+ // ── Scroll horizontal é o DEFAULT do underline (desktop e mobile) ─────
312
+ // A linha de tabs nunca deve vazar do container: quando não cabe, rola.
313
+ // O input `scrollable` continua existindo (compat) mas virou no-op — o
314
+ // comportamento que ele ligava agora é o padrão.
315
+ // Exceção: com [responsiveGrid] ativo o nav vira grid multi-linha abaixo de
316
+ // 1024px e precisa de overflow visível pra crescer em altura — quem manda
317
+ // no overflow nesse caso é a regra de `.tabs-nav-responsive-grid`
318
+ // (matcha-components/.../tabs/tabs.component.scss).
319
+ &:not(.tabs-nav-responsive-grid) {
320
+ overflow-x: auto;
321
+ overflow-y: hidden;
322
+ -webkit-overflow-scrolling: touch;
323
+ }
324
+
325
+ // ── Sliding indicator (Material 3 magic underline) ──
326
+ // Cantos retos + 2px de altura (canon Figma — sem rounded).
327
+ .matcha-tab-indicator {
328
+ position: absolute;
329
+ bottom: 0;
330
+ left: var(--matcha-tab-indicator-left, 0);
331
+ width: var(--matcha-tab-indicator-width, 0);
332
+ height: var(--matcha-border-thin, 2px);
333
+ background: var(--matcha-color-accent);
334
+ border-radius: 0;
335
+ transition:
336
+ left var(--matcha-duration-fast, 200ms) var(--matcha-easing-emphasized, cubic-bezier(0.2, 0, 0, 1)),
337
+ width var(--matcha-duration-fast, 200ms) var(--matcha-easing-emphasized, cubic-bezier(0.2, 0, 0, 1));
338
+ pointer-events: none;
339
+ z-index: 1;
340
+ }
341
+
342
+ .matcha-tab-item {
343
+ display: flex;
344
+ align-items: center;
345
+ justify-content: center;
346
+ gap: var(--matcha-space-100, 8px);
347
+ padding: var(--matcha-space-200, 16px) var(--matcha-space-500, 40px);
348
+ border: none;
349
+ // Border bottom 2px — per item (track surface-border, slider sobrepõe accent)
350
+ border-bottom: var(--matcha-border-thin, 2px) solid
351
+ var(--matcha-color-surface-border);
352
+ background: transparent;
353
+ cursor: pointer;
354
+ position: relative;
355
+ overflow: hidden;
356
+ font-family: var(--matcha-font-family);
357
+ font-size: var(--matcha-text-body-lg, 16px);
358
+ font-weight: var(--matcha-weight-regular, 400);
359
+ line-height: var(--matcha-leading-body-lg, 24px);
360
+ color: var(--matcha-color-text-secondary,
361
+ color-mix(in srgb, var(--matcha-color-fg) 70%, transparent));
362
+ white-space: nowrap;
363
+ flex-shrink: 0;
364
+ min-width: var(--matcha-tab-min-width-underline);
365
+ transition:
366
+ color var(--matcha-duration-fast, 200ms) var(--matcha-easing-standard, cubic-bezier(0.4, 0, 0.2, 1)),
367
+ border-bottom-color var(--matcha-duration-fast, 200ms) var(--matcha-easing-standard, cubic-bezier(0.4, 0, 0.2, 1)),
368
+ font-weight var(--matcha-duration-fast, 200ms) ease;
369
+
370
+ // State layer (hover + active visual feedback)
371
+ &::before {
372
+ content: '';
373
+ position: absolute;
374
+ inset: 0;
375
+ background: currentColor;
376
+ opacity: 0;
377
+ pointer-events: none;
378
+ transition: opacity var(--matcha-duration-instant, 80ms) linear;
379
+ }
380
+ &:hover:not(:disabled)::before { opacity: var(--matcha-tab-state-opacity-hover); }
381
+ &:active:not(:disabled)::before { opacity: var(--matcha-tab-state-opacity-active); }
382
+
383
+ // ── Selecionado (border-bottom muda pra accent ALÉM do sliding indicator
384
+ // — cobre 100% mesmo com subpixel mismatch do indicator) ──
385
+ &.active,
386
+ &[aria-selected="true"] {
387
+ color: var(--matcha-color-accent);
388
+ font-weight: var(--matcha-weight-semibold, 600);
389
+ line-height: var(--matcha-leading-title-sm, 22px);
390
+ border-bottom-color: var(--matcha-color-accent);
391
+ // Ícone acompanha o label no Underline. matcha-icon não herda
392
+ // currentColor por design — resolve `--matcha-icon-color`, então o
393
+ // override é via CSS var (pattern documentado em matcha-icon.scss).
394
+ // Card NÃO faz isso: lá o selected é text-primary, não accent.
395
+ --matcha-icon-color: var(--matcha-color-accent);
396
+ }
397
+
398
+ // ── Disabled ──
399
+ &:disabled,
400
+ &[disabled] {
401
+ opacity: var(--matcha-tab-state-opacity-disabled);
402
+ pointer-events: none;
403
+ cursor: default;
404
+ }
405
+
406
+ // ── Focus ring polido (offset 4px + halo 16% alpha) ──
407
+ &:focus-visible {
408
+ outline: var(--matcha-state-focus-ring-width, 2px) solid
409
+ var(--matcha-color-accent);
410
+ outline-offset: var(--matcha-state-focus-ring-offset, 4px);
411
+ border-radius: var(--matcha-radius-sm, 4px);
412
+ box-shadow: 0 0 0 var(--matcha-tab-focus-halo)
413
+ color-mix(in srgb, var(--matcha-color-accent) calc(var(--matcha-tab-focus-halo-alpha) * 100%), transparent);
414
+ }
415
+ }
416
+ }
417
+
418
+ // ── Card Tab (canon Figma) ────────────────────────────────────────────
419
+ // Card 2px border accent quando selected · texto e ícone accent também
420
+ // (decisão de Design 2026-08-04 — antes era text-primary).
421
+ // Suporta horizontal (default) e vertical (icon stacked).
422
+ .matcha-tab-card {
423
+ display: flex;
424
+ // Tamanho natural por item — stretch vertical antes esticava cards quando
425
+ // pai tinha altura expandida (bug reportado em pages com page-content flex-fill).
426
+ align-items: flex-start;
427
+ gap: var(--matcha-space-100, 8px);
428
+ flex-wrap: wrap;
429
+
430
+ // Equal-width layout — cada tab ocupa fatia igual da row (paginador-like).
431
+ // Habilitado via prop `equalWidth` no consumer. Icon stacked acima do label
432
+ // (look canon de paginator), independente de orientation do host.
433
+ &.matcha-tab-equal-width {
434
+ flex-wrap: nowrap;
435
+
436
+ .matcha-tab-item {
437
+ flex: 1 1 0;
438
+ min-width: 0;
439
+ flex-direction: column;
440
+ text-align: center;
441
+ padding: var(--matcha-space-150, 12px) var(--matcha-space-200, 16px);
442
+ }
443
+ }
444
+
445
+ // Vertical layout — empilha icon + label
446
+ &.matcha-tab-vertical .matcha-tab-item {
447
+ flex-direction: column;
448
+ min-width: var(--matcha-tab-min-width-card-vertical);
449
+ padding: var(--matcha-space-100, 8px) var(--matcha-space-200, 16px);
450
+ text-align: center;
451
+ }
452
+
453
+ .matcha-tab-item {
454
+ display: flex;
455
+ align-items: center;
456
+ justify-content: center;
457
+ gap: var(--matcha-space-100, 8px);
458
+ padding: var(--matcha-space-150, 12px) var(--matcha-space-200, 16px);
459
+ border: var(--matcha-border-thin, 1px) solid transparent;
460
+ // radius-lg (8px) escala 1:2 com cards (xl=16px) — hierarquia visual
461
+ // canon: atom interativo / container. Antes era md (4px), o que dava
462
+ // disparidade 1:4 e quebrava a leitura conjunta tabs + cards.
463
+ border-radius: var(--matcha-radius-lg, 8px);
464
+ background: var(--matcha-color-surface-card);
465
+ cursor: pointer;
466
+ position: relative;
467
+ overflow: hidden;
468
+ font-family: var(--matcha-font-family);
469
+ font-size: var(--matcha-text-body-md, 14px);
470
+ font-weight: var(--matcha-weight-regular, 400);
471
+ line-height: var(--matcha-leading-body-md, 20px);
472
+ color: var(--matcha-color-text-secondary,
473
+ color-mix(in srgb, var(--matcha-color-fg) 70%, transparent));
474
+ flex-shrink: 0;
475
+ min-width: var(--matcha-tab-min-width-card-horizontal);
476
+ transition:
477
+ border-color var(--matcha-duration-fast, 200ms) var(--matcha-easing-standard, cubic-bezier(0.4, 0, 0.2, 1)),
478
+ color var(--matcha-duration-fast, 200ms) var(--matcha-easing-standard, cubic-bezier(0.4, 0, 0.2, 1)),
479
+ transform var(--matcha-duration-instant, 80ms) ease;
480
+
481
+ // State layer
482
+ &::before {
483
+ content: '';
484
+ position: absolute;
485
+ inset: 0;
486
+ background: currentColor;
487
+ opacity: 0;
488
+ border-radius: inherit;
489
+ pointer-events: none;
490
+ transition: opacity var(--matcha-duration-instant, 80ms) linear;
491
+ }
492
+ &:hover:not(:disabled) {
493
+ &::before { opacity: var(--matcha-tab-state-opacity-hover); }
494
+ transform: translateY(calc(-1 * var(--matcha-border-hairline, 1px)));
495
+ }
496
+ &:active:not(:disabled)::before { opacity: var(--matcha-tab-state-opacity-active); }
497
+
498
+ // ── Selecionado (border + texto + ícone accent) ──
499
+ // Decisão de Design 2026-08-04: o selected do Card passa a ser accent no
500
+ // texto e no ícone também, não só na border — antes o texto era
501
+ // text-primary (canon Figma antigo). Figma `matcha/tabs` pendente de
502
+ // atualização; até lá o código é a fonte da verdade deste estado.
503
+ &.active,
504
+ &[aria-selected="true"] {
505
+ border-color: var(--matcha-color-accent);
506
+ color: var(--matcha-color-accent);
507
+ font-weight: var(--matcha-weight-medium, 500);
508
+ // matcha-icon não herda currentColor — override via CSS var.
509
+ --matcha-icon-color: var(--matcha-color-accent);
510
+ }
511
+
512
+ // ── Disabled ──
513
+ &:disabled,
514
+ &[disabled] {
515
+ opacity: var(--matcha-tab-state-opacity-disabled);
516
+ pointer-events: none;
517
+ cursor: default;
518
+ }
519
+
520
+ // ── Focus ring polido ──
521
+ &:focus-visible {
522
+ outline: var(--matcha-state-focus-ring-width, 2px) solid
523
+ var(--matcha-color-accent);
524
+ outline-offset: var(--matcha-border-thin, 2px);
525
+ box-shadow: 0 0 0 var(--matcha-tab-focus-halo)
526
+ color-mix(in srgb, var(--matcha-color-accent) calc(var(--matcha-tab-focus-halo-alpha) * 100%), transparent);
527
+ }
528
+ }
529
+ }
530
+
531
+ // ── Icon inside tab items ──
532
+ .matcha-tab-underline,
533
+ .matcha-tab-card {
534
+ .matcha-tab-item matcha-icon { flex-shrink: 0; }
535
+ }
536
+
537
+ // ── Scrollbar do tablist que rola ─────────────────────────────────────
538
+ // Fonte única da APARÊNCIA do scroll horizontal — vale pro `scrollable` e
539
+ // pro grid responsivo no desktop, que só declaram o overflow. A barra
540
+ // nativa do OS (grossa, com setas) competia visualmente com as tabs.
541
+ // Propriedades são inertes quando não há overflow, então podem ficar nos
542
+ // dois tipos sem condicional.
543
+ .matcha-tab-underline,
544
+ .matcha-tab-card {
545
+ scrollbar-width: thin;
546
+ scrollbar-color: var(--matcha-color-surface-border) transparent;
547
+
548
+ &::-webkit-scrollbar {
549
+ height: var(--matcha-space-050, 4px);
550
+ }
551
+
552
+ &::-webkit-scrollbar-track {
553
+ background: transparent;
554
+ }
555
+
556
+ &::-webkit-scrollbar-thumb {
557
+ background: var(--matcha-color-surface-border);
558
+ border-radius: var(--matcha-radius-pill, 9999px);
559
+ }
560
+ }
561
+
562
+ // ── Badge (notificações, contagens) ───────────────────────────────────
563
+ .matcha-tab-item__badge {
564
+ display: inline-flex;
565
+ align-items: center;
566
+ justify-content: center;
567
+ min-width: var(--matcha-space-250, 20px);
568
+ height: var(--matcha-space-250, 20px);
569
+ padding: 0 var(--matcha-space-075, 6px);
570
+ background: var(--matcha-color-accent);
571
+ color: var(--matcha-color-accent-text-on,
572
+ var(--matcha-color-accent-contrast));
573
+ border-radius: var(--matcha-radius-pill, 9999px);
574
+ font-size: var(--matcha-text-body-xs, 11px);
575
+ font-weight: var(--matcha-weight-semibold, 600);
576
+ line-height: 1;
577
+ flex-shrink: 0;
578
+ }
579
+
580
+ // ── Close button (closable tabs) ──────────────────────────────────────
581
+ .matcha-tab-item__close {
582
+ display: inline-flex;
583
+ align-items: center;
584
+ justify-content: center;
585
+ width: var(--matcha-space-300, 24px);
586
+ height: var(--matcha-space-300, 24px);
587
+ border-radius: 50%;
588
+ color: var(--matcha-color-text-secondary,
589
+ color-mix(in srgb, var(--matcha-color-fg) 70%, transparent));
590
+ transition:
591
+ background-color var(--matcha-duration-instant, 80ms) ease,
592
+ color var(--matcha-duration-instant, 80ms) ease;
593
+ flex-shrink: 0;
594
+ cursor: pointer;
595
+ margin-left: var(--matcha-space-050, 4px);
596
+
597
+ &:hover {
598
+ background: var(--matcha-color-surface-hover,
599
+ color-mix(in srgb, var(--matcha-color-fg) 8%, transparent));
600
+ color: var(--matcha-color-fg);
601
+ }
602
+
603
+ &:focus-visible {
604
+ outline: var(--matcha-state-focus-ring-width, 2px) solid
605
+ var(--matcha-color-accent);
606
+ outline-offset: var(--matcha-border-thin, 2px);
607
+ }
608
+
609
+ svg {
610
+ display: block;
611
+ width: var(--matcha-tab-close-size, 14px);
612
+ height: var(--matcha-tab-close-size, 14px);
613
+ }
614
+ }
615
+ }
616
+
617
+ // ── Mobile: reset min-width pra evitar overflow + auto-scroll ───────────
618
+ @media (max-width: 639px) {
619
+ .matcha-tab-underline .matcha-tab-item,
620
+ .matcha-tab-card .matcha-tab-item {
621
+ min-width: auto;
622
+ }
623
+ }
624
+
625
+ // (Antes havia aqui um bloco @media (max-width: 639px) ligando overflow-x no
626
+ // underline "não scrollable" — redundante desde que o scroll virou o default do
627
+ // tipo em qualquer viewport.)
628
+
629
+ // ── Reduced motion (WCAG 2.2.2) ─────────────────────────────────────────
630
+ @media (prefers-reduced-motion: reduce) {
631
+ .matcha-tab-underline .matcha-tab-item,
632
+ .matcha-tab-underline .matcha-tab-item::before,
633
+ .matcha-tab-card .matcha-tab-item,
634
+ .matcha-tab-card .matcha-tab-item::before,
635
+ .matcha-tab-indicator,
636
+ .matcha-tab-item__close {
637
+ transition: none;
638
+ }
639
+ .matcha-tab-card .matcha-tab-item:hover {
640
+ transform: none;
641
+ }
642
+ }