@inchurch/matcha-theme 22.6.1 → 22.8.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.
@@ -217,7 +217,7 @@
217
217
  "primary", "accent", "success", "warn", "danger", "info", "disabled";
218
218
 
219
219
  matcha-button-toggle {
220
- display: flex;
220
+ display: inline-flex;
221
221
  @include _colorize-inactive-type-solid-button-toggle-item($theme, $color-functions);
222
222
  @include _colorize-inactive-type-basic-button-toggle-item($theme, $color-functions);
223
223
  @include _colorize-inactive-type-outline-button-toggle-item($theme, $color-functions);
@@ -229,7 +229,10 @@ matcha-button-toggle {
229
229
  a[matcha-button] {
230
230
  &:focus-visible:not([disabled]):not([disabled="true"]) {
231
231
  outline: var(--matcha-state-focus-ring-width, 2px) solid var(--matcha-color-accent);
232
- outline-offset: var(--matcha-state-focus-ring-offset, 2px);
232
+ // Inset (negativo): o .button-group é scroll container (overflow-x)
233
+ // e clipa qualquer outline desenhado FORA do botão — anel interno
234
+ // fica 100% visível mesmo com rolagem.
235
+ outline-offset: calc(-1 * (var(--matcha-state-focus-ring-width, 2px) + var(--matcha-state-focus-ring-offset, 2px)));
233
236
  }
234
237
  }
235
238
  }
@@ -295,7 +298,7 @@ matcha-button-toggle {
295
298
 
296
299
  &:focus-visible {
297
300
  outline: 2px solid CanvasText !important;
298
- outline-offset: 2px;
301
+ outline-offset: -4px; // inset — scroll container clipa outline externo
299
302
  }
300
303
  }
301
304
  }
@@ -323,23 +326,65 @@ matcha-button-toggle {
323
326
  // Structural rules — aligned with Figma matcha/button-toggle:
324
327
  // Gap=Segmented: buttons share borders (1px hairline between, 2px thin outside)
325
328
  // Gap=Separated: buttons stand apart with gap=space/200 and full radius-lg each
329
+ // Width: hug content by default (Figma); [stretched] opta pelo fill 100%
330
+ // com botões dividindo a largura igualmente.
326
331
  // =============================================================================
327
332
  matcha-button-toggle {
328
- display: block;
329
- width: 100%;
333
+ display: inline-flex;
334
+ max-width: 100%;
330
335
 
331
336
  .button-group {
332
337
  display: flex;
333
- width: 100%;
334
338
  align-items: stretch;
339
+ max-width: 100%;
340
+
341
+ // ── Overflow: botão NUNCA é esmagado — no pior caso, rola ─────────
342
+ // flex-shrink default (1) comprimia o conteúdo dos botões quando o
343
+ // container aperta. Botões mantêm largura natural (flex: 0 0 auto +
344
+ // nowrap) e o grupo cria rolagem horizontal.
345
+ overflow-x: auto;
346
+ overflow-y: hidden;
347
+ -webkit-overflow-scrolling: touch;
348
+
349
+ // Scrollbar fino e temado (mesmo padrão do matcha-form-field) —
350
+ // só aparece quando há overflow real.
351
+ scrollbar-width: thin; // Firefox
352
+ scrollbar-color: var(--matcha-color-text-placeholder) transparent;
353
+ &::-webkit-scrollbar { height: 6px; }
354
+ &::-webkit-scrollbar-track { background: transparent; }
355
+ &::-webkit-scrollbar-thumb {
356
+ background: var(--matcha-color-text-placeholder);
357
+ border-radius: 3px;
358
+ }
359
+ &::-webkit-scrollbar-thumb:hover { background: var(--matcha-color-text-secondary); }
335
360
 
336
- // Children flex-share — each button takes equal width across the row
337
361
  > button[matcha-button],
338
362
  > a[matcha-button] {
339
- flex: 1 1 0;
340
- min-width: 0;
363
+ flex: 0 0 auto;
364
+ white-space: nowrap;
365
+ }
366
+ }
367
+
368
+ // ── Stretched (opt-in via [stretched]) — fill 100% do container ───────
369
+ // Era o default até a 20.x; agora requer a propriedade.
370
+ &[stretched]:not([stretched="false"]) {
371
+ display: flex;
372
+ width: 100%;
373
+
374
+ .button-group {
375
+ width: 100%;
376
+
377
+ // Children flex-share — each button takes equal width across the row.
378
+ // SEM min-width: 0 — o botão nunca encolhe abaixo do conteúdo
379
+ // (min-content); quando nem isso cabe, o overflow-x do grupo rola.
380
+ > button[matcha-button],
381
+ > a[matcha-button] {
382
+ flex: 1 1 0;
383
+ }
341
384
  }
385
+ }
342
386
 
387
+ .button-group {
343
388
  // ── Separated (default: gap = space/200) ──────────────────────────
344
389
  // Each button keeps its own full radius and border-thin (2px).
345
390
  // gap already handled by flex gap via [gap] binding in TS.
@@ -476,12 +476,14 @@ a[matcha-link] {
476
476
 
477
477
  // ── Touch targets (WCAG 2.5.5: 44x44 mínimo em coarse pointers) ──
478
478
  // XS (28), SM (32), MD (40) ficam abaixo de 44px — expande hit area invisível.
479
+ // NÃO re-declarar `position` aqui: o bloco estrutural acima já garante botão
480
+ // positioned (relative), e o ::after ancora em qualquer positioned. Re-assertar
481
+ // com [size] sobe a especificidade pra (0,2,1) e quebra consumidores que
482
+ // reposicionam o botão com absolute (close mobile do notification/banner).
479
483
  @media (pointer: coarse) {
480
484
  &[size="xs"],
481
485
  &[size="sm"], &[size="tiny"],
482
486
  &[size="md"], &[size="small"] {
483
- position: relative;
484
-
485
487
  &::after {
486
488
  content: '';
487
489
  position: absolute;
@@ -16,8 +16,15 @@
16
16
  }
17
17
 
18
18
  // ── Header ──────────────────────────────────────────────
19
- .matcha-calendar-header-label {
20
- color: var(--matcha-color-text-primary, var(--matcha-color-fg));
19
+ // Fundo accent-alpha em repouso (não só no hover) — sinaliza de cara que o
20
+ // label do mês/ano é clicável (abre view ano/década), não só um título.
21
+ // Seletor com o pai (.matcha-calendar-header) — precisa de +especificidade
22
+ // que o próprio `all: unset` da célula, que carrega DEPOIS (CSS de
23
+ // componente ViewEncapsulation.None sempre entra depois do CSS global do
24
+ // tema) e tem a mesma especificidade se for só a classe sozinha.
25
+ .matcha-calendar-header .matcha-calendar-header-label {
26
+ color: var(--matcha-color-accent);
27
+ background-color: var(--matcha-color-accent-alpha);
21
28
 
22
29
  &:hover {
23
30
  background-color: var(--matcha-color-surface-hover, rgba(255, 255, 255, 0.08));
@@ -104,6 +111,24 @@
104
111
  background-color: transparent;
105
112
  box-shadow: none;
106
113
  }
114
+
115
+ // Marcador de dia (dot). is-selected é outlined (não filled, ver acima) então
116
+ // convive sem ajuste; range anchors SÃO filled com --matcha-color-accent — mesma
117
+ // cor invisibilizaria o dot, por isso o contraste-swap abaixo.
118
+ &.is-marked::after {
119
+ background-color: var(--matcha-color-calendar-marker-bg, var(--matcha-color-accent));
120
+ }
121
+
122
+ &.is-range-start.is-marked::after,
123
+ &.is-range-end.is-marked::after {
124
+ background-color: var(--matcha-color-calendar-marker-contrast-bg, var(--matcha-color-accent-contrast));
125
+ box-shadow: 0 0 0 1px var(--matcha-color-accent);
126
+ }
127
+
128
+ &.is-disabled.is-marked::after,
129
+ &.is-other-month.is-marked::after {
130
+ background-color: var(--matcha-color-interaction-disabled-fg);
131
+ }
107
132
  }
108
133
 
109
134
  // ── Grid views (Year / Decade) ──────────────────────────
@@ -163,7 +188,7 @@
163
188
  border: 1px solid CanvasText;
164
189
  background: Canvas;
165
190
 
166
- .matcha-calendar-day-cell {
191
+ .matcha-calendar-cell {
167
192
  border: 1px solid transparent;
168
193
 
169
194
  &.is-selected {
@@ -182,6 +207,11 @@
182
207
  color: GrayText !important;
183
208
  }
184
209
 
210
+ &.is-marked::after {
211
+ background: CanvasText !important;
212
+ forced-color-adjust: none;
213
+ }
214
+
185
215
  &:focus-visible {
186
216
  outline: 2px solid CanvasText !important;
187
217
  outline-offset: -2px;
@@ -214,5 +244,10 @@
214
244
  box-shadow: none !important;
215
245
  border: 1px solid currentColor;
216
246
  break-inside: avoid;
247
+
248
+ .matcha-calendar-cell.is-marked::after {
249
+ background: CanvasText;
250
+ box-shadow: none;
251
+ }
217
252
  }
218
253
  }
@@ -299,7 +299,7 @@
299
299
  &:active:not([disabled])::before { opacity: var(--matcha-state-active, 0.12); }
300
300
  }
301
301
 
302
- // ── Mobile (≤599px) ─────────────────────────────────────────────────────
302
+ // ── Mobile (xs, 479px) ─────────────────────────────────────────────────
303
303
  // Stack vertical (mesmo padrão do matcha-banner mobile):
304
304
  // [icon na 1ª linha (align-self start)]
305
305
  // → [body (title + description)]
@@ -296,8 +296,10 @@ matcha-tabs {
296
296
  }
297
297
 
298
298
  // ── Underline Tab (1:1 Figma DSV3 — border per item) ──────────────────
299
- // Cada item tem bg surface-card + border-bottom 4px (surface-border default,
300
- // accent selected). Container não tem border próprio (canon Figma).
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).
301
303
  // Sliding indicator absoluto desliza entre tabs (Material 3 style).
302
304
  // Sempre horizontal (vertical não é canon).
303
305
  .matcha-tab-underline {
@@ -340,7 +342,7 @@ matcha-tabs {
340
342
  // Border bottom 2px — per item (track surface-border, slider sobrepõe accent)
341
343
  border-bottom: var(--matcha-border-thin, 2px) solid
342
344
  var(--matcha-color-surface-border);
343
- background: var(--matcha-color-surface-card);
345
+ background: transparent;
344
346
  cursor: pointer;
345
347
  position: relative;
346
348
  overflow: hidden;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inchurch/matcha-theme",
3
- "version": "22.6.1",
3
+ "version": "22.8.0",
4
4
  "description": "Themes for matcha-design-system",
5
5
  "main": "main.scss",
6
6
  "scripts": {