@inchurch/matcha-theme 22.38.2 → 22.38.4
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/abstracts/_colors.scss +291 -291
- package/abstracts/_elevation.scss +108 -108
- package/abstracts/_functions.scss +321 -321
- package/abstracts/_media-breakpoint.scss +26 -26
- package/abstracts/_theme-api.scss +224 -224
- package/abstracts/_typography.scss +128 -128
- package/base/_reset.scss +487 -487
- package/components/app-page-header.scss +260 -260
- package/components/matcha-accordion.scss +297 -297
- package/components/matcha-audio-player.scss +31 -31
- package/components/matcha-autocomplete.scss +145 -145
- package/components/matcha-avatar.scss +426 -426
- package/components/matcha-badge.scss +120 -120
- package/components/matcha-breadcrumb.scss +231 -231
- package/components/matcha-button-toggle.scss +484 -484
- package/components/matcha-buttons.scss +973 -973
- package/components/matcha-calendar.scss +253 -253
- package/components/matcha-cards.scss +212 -212
- package/components/matcha-chart-card.scss +53 -53
- package/components/matcha-checkbox.scss +266 -266
- package/components/matcha-chip.scss +311 -311
- package/components/matcha-color-pick.scss +34 -34
- package/components/matcha-command-palette.scss +316 -316
- package/components/matcha-crop.scss +419 -419
- package/components/matcha-date.scss +81 -81
- package/components/matcha-divider.scss +100 -100
- package/components/matcha-draggable.scss +23 -23
- package/components/matcha-drawer.scss +376 -376
- package/components/matcha-drop-image.scss +14 -14
- package/components/matcha-drop-list.scss +430 -430
- package/components/matcha-emoji.scss +69 -69
- package/components/matcha-empty-state.scss +230 -230
- package/components/matcha-file-uploader.scss +650 -637
- package/components/matcha-flag.scss +103 -103
- package/components/matcha-footer.scss +91 -91
- package/components/matcha-form-field.scss +883 -883
- package/components/matcha-form-section.scss +100 -100
- package/components/matcha-header.scss +135 -135
- package/components/matcha-highlight.scss +164 -164
- package/components/matcha-hint-text.scss +90 -90
- package/components/matcha-horizontal-tree.scss +247 -247
- package/components/matcha-icon.scss +111 -111
- package/components/matcha-image.scss +60 -60
- package/components/matcha-list.scss +211 -211
- package/components/matcha-menu.scss +99 -99
- package/components/matcha-modal.scss +210 -210
- package/components/matcha-nav.scss +770 -770
- package/components/matcha-notification.scss +417 -417
- package/components/matcha-option.scss +170 -170
- package/components/matcha-page-builder.scss +4196 -4196
- package/components/matcha-paginator.scss +699 -699
- package/components/matcha-panel.scss +216 -216
- package/components/matcha-period.scss +174 -174
- package/components/matcha-profile-card.scss +50 -50
- package/components/matcha-progress-bar.scss +355 -355
- package/components/matcha-radio.scss +325 -325
- package/components/matcha-ripple.scss +7 -7
- package/components/matcha-scrollbar.scss +33 -33
- package/components/matcha-scrollbox-shadow.scss +120 -120
- package/components/matcha-section.scss +102 -102
- package/components/matcha-select-multiple.scss +56 -56
- package/components/matcha-select.scss +629 -629
- package/components/matcha-skeleton.scss +182 -182
- package/components/matcha-slide-toggle.scss +369 -369
- package/components/matcha-slider.scss +285 -285
- package/components/matcha-snack-bar.scss +259 -259
- package/components/matcha-spin.scss +164 -164
- package/components/matcha-spinner.scss +97 -97
- package/components/matcha-stepper.scss +376 -376
- package/components/matcha-table-cell.scss +107 -107
- package/components/matcha-table.scss +722 -722
- package/components/matcha-tabs.scss +642 -642
- package/components/matcha-text-editor.scss +111 -111
- package/components/matcha-time.scss +33 -33
- package/components/matcha-timepicker.scss +13 -13
- package/components/matcha-toolbar.scss +366 -366
- package/components/matcha-tooltip.scss +235 -235
- package/components/matcha-tree-view.scss +636 -636
- package/layout/matcha-page-layout.scss +778 -778
- package/main.scss +334 -334
- package/package.json +1 -1
- package/tokens/_animations-tokens.scss +37 -37
- package/tokens/_breakpoints-tokens.scss +35 -35
- package/tokens/_color-tokens.scss +288 -288
- package/tokens/_elevation-tokens.scss +33 -33
- package/tokens/_emit-tokens.scss +329 -329
- package/tokens/_material-palette.scss +1149 -1149
- package/tokens/_primitives.scss +98 -98
- package/tokens/_semantic-aliases.scss +120 -120
- package/tokens/_spacing-tokens.scss +94 -94
- package/tokens/_static-tokens.scss +137 -137
- package/tokens/_typography-tokens.scss +65 -65
- package/vendors/charts.scss +90 -90
|
@@ -1,484 +1,484 @@
|
|
|
1
|
-
@use "matcha-buttons" as *;
|
|
2
|
-
@mixin _colorize-inactive-type-solid-button-toggle-item($theme, $color-functions) {
|
|
3
|
-
|
|
4
|
-
&:not([inactivetype]),
|
|
5
|
-
&[inactivetype="solid"] {
|
|
6
|
-
@each $colorName in $color-functions {
|
|
7
|
-
&[inactivecolor="#{'' + $colorName}"] {
|
|
8
|
-
.button-group {
|
|
9
|
-
|
|
10
|
-
button[matcha-button],
|
|
11
|
-
a[matcha-button] {
|
|
12
|
-
&:not([active]) {
|
|
13
|
-
background: var(--matcha-color-#{$colorName});
|
|
14
|
-
color: var(--matcha-color-#{$colorName}-contrast);
|
|
15
|
-
box-shadow: 0 0 0 0px inset;
|
|
16
|
-
|
|
17
|
-
.ripple {
|
|
18
|
-
background: var(--matcha-color-#{$colorName}-contrast-alpha); // ok: legacy ripple color token
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&[disabled],
|
|
27
|
-
&[disabled]:not([disabled="false"]),
|
|
28
|
-
&[disabled="true"] {
|
|
29
|
-
.button-group {
|
|
30
|
-
|
|
31
|
-
button[matcha-button],
|
|
32
|
-
a[matcha-button] {
|
|
33
|
-
&:not([active]) {
|
|
34
|
-
@include disabled-solid-button($theme);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@mixin _colorize-inactive-type-basic-button-toggle-item($theme, $color-functions) {
|
|
43
|
-
&[inactivetype="basic"] {
|
|
44
|
-
@each $colorName in $color-functions {
|
|
45
|
-
&[inactivecolor="#{'' + $colorName}"] {
|
|
46
|
-
.button-group {
|
|
47
|
-
|
|
48
|
-
button[matcha-button],
|
|
49
|
-
a[matcha-button] {
|
|
50
|
-
&:not([active]) {
|
|
51
|
-
background: var(--matcha-color-surface);
|
|
52
|
-
color: var(--matcha-color-#{$colorName});
|
|
53
|
-
box-shadow: 0 0 0 0px inset;
|
|
54
|
-
|
|
55
|
-
.ripple {
|
|
56
|
-
background: var(--matcha-color-#{$colorName}-alpha); // ok: legacy ripple color token
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
&[disabled],
|
|
65
|
-
&[disabled]:not([disabled="false"]),
|
|
66
|
-
&[disabled="true"] {
|
|
67
|
-
.button-group {
|
|
68
|
-
|
|
69
|
-
button[matcha-button],
|
|
70
|
-
a[matcha-button] {
|
|
71
|
-
&:not([active]) {
|
|
72
|
-
@include disabled-basic-button($theme);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@mixin _colorize-inactive-type-outline-button-toggle-item($theme, $color-functions) {
|
|
81
|
-
&[inactivetype="outline"] {
|
|
82
|
-
|
|
83
|
-
//disabled false
|
|
84
|
-
&:not([disabled="true"]) {
|
|
85
|
-
|
|
86
|
-
// Default do componente (inactiveColor='basic') — não é cor de paleta
|
|
87
|
-
// (--matcha-color-basic não existe): inativo neutro com tokens de
|
|
88
|
-
// superfície/texto. Sem este branch, o toggle "pelado" (sem
|
|
89
|
-
// inactiveColor) não casava com regra nenhuma e o inativo ficava
|
|
90
|
-
// filled da própria cor, indistinguível do ativo.
|
|
91
|
-
&[inactivecolor="basic"] {
|
|
92
|
-
.button-group {
|
|
93
|
-
|
|
94
|
-
button[matcha-button],
|
|
95
|
-
a[matcha-button] {
|
|
96
|
-
&:not([active]) {
|
|
97
|
-
color: var(--matcha-color-text-secondary);
|
|
98
|
-
background: transparent;
|
|
99
|
-
box-shadow: 0 0 0 2px var(--matcha-color-surface-border) inset;
|
|
100
|
-
|
|
101
|
-
.ripple {
|
|
102
|
-
background: var(--matcha-color-fg-alpha); // ok: legacy ripple color token
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
@each $colorName in $color-functions {
|
|
110
|
-
&[inactivecolor="#{'' + $colorName}"] {
|
|
111
|
-
.button-group {
|
|
112
|
-
|
|
113
|
-
button[matcha-button],
|
|
114
|
-
a[matcha-button] {
|
|
115
|
-
|
|
116
|
-
//botão não ativo
|
|
117
|
-
&:not([active]) {
|
|
118
|
-
color: var(--matcha-color-#{$colorName});
|
|
119
|
-
background: transparent;
|
|
120
|
-
box-shadow: 0 0 0 2px var(--matcha-color-#{$colorName}) inset;
|
|
121
|
-
|
|
122
|
-
.ripple {
|
|
123
|
-
background: var(--matcha-color-#{$colorName}-alpha); // ok: legacy ripple color token
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
//disabled true
|
|
133
|
-
&[disabled],
|
|
134
|
-
&[disabled]:not([disabled="false"]),
|
|
135
|
-
&[disabled="true"] {
|
|
136
|
-
.button-group {
|
|
137
|
-
|
|
138
|
-
button[matcha-button],
|
|
139
|
-
a[matcha-button] {
|
|
140
|
-
|
|
141
|
-
//botão não ativo
|
|
142
|
-
&:not([active]) {
|
|
143
|
-
@include disabled-outline-button($theme);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
@mixin _colorize-inactive-type-alpha-button-toggle-item($theme, $color-functions) {
|
|
152
|
-
&[inactivetype="alpha"] {
|
|
153
|
-
@each $colorName in $color-functions {
|
|
154
|
-
&[inactivecolor="#{'' + $colorName}"] {
|
|
155
|
-
.button-group {
|
|
156
|
-
|
|
157
|
-
button[matcha-button],
|
|
158
|
-
a[matcha-button] {
|
|
159
|
-
&:not([active]) {
|
|
160
|
-
color: var(--matcha-color-#{$colorName});
|
|
161
|
-
background: var(--matcha-color-#{$colorName}-alpha);
|
|
162
|
-
box-shadow: 0 0 0 0px;
|
|
163
|
-
|
|
164
|
-
.ripple {
|
|
165
|
-
background: var(--matcha-color-#{$colorName}-contrast-alpha) // ok: legacy ripple color token
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
&[disabled],
|
|
174
|
-
&[disabled]:not([disabled="false"]),
|
|
175
|
-
&[disabled="true"] {
|
|
176
|
-
.button-group {
|
|
177
|
-
|
|
178
|
-
button[matcha-button],
|
|
179
|
-
a[matcha-button] {
|
|
180
|
-
|
|
181
|
-
//botão não ativo
|
|
182
|
-
&:not([active]) {
|
|
183
|
-
@include disabled-alpha-button($theme);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
@mixin _colorize-inactive-type-link-button-toggle-item($theme, $color-functions) {
|
|
192
|
-
|
|
193
|
-
&[inactivetype="link"] {
|
|
194
|
-
@each $colorName in $color-functions {
|
|
195
|
-
&[inactivecolor="#{'' + $colorName}"] {
|
|
196
|
-
.button-group {
|
|
197
|
-
|
|
198
|
-
button[matcha-button],
|
|
199
|
-
a[matcha-button] {
|
|
200
|
-
&:not([active]) {
|
|
201
|
-
|
|
202
|
-
background: transparent;
|
|
203
|
-
color: var(--matcha-color-#{$colorName});
|
|
204
|
-
box-shadow: 0 0 0 0px;
|
|
205
|
-
|
|
206
|
-
.ripple {
|
|
207
|
-
background: var(--matcha-color-#{$colorName}-alpha); // ok: legacy ripple color token
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
&[disabled],
|
|
217
|
-
&[disabled]:not([disabled="false"]),
|
|
218
|
-
&[disabled="true"] {
|
|
219
|
-
.button-group {
|
|
220
|
-
|
|
221
|
-
button[matcha-button],
|
|
222
|
-
a[matcha-button] {
|
|
223
|
-
|
|
224
|
-
//botão não ativo
|
|
225
|
-
&:not([active]) {
|
|
226
|
-
@include disabled-link-button($theme);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
@mixin matcha-button-toggle($theme) {
|
|
238
|
-
// Nomes de cor (semânticas + paleta). Cores vêm de var(--matcha-color-*) — sem getRed/$theme.
|
|
239
|
-
$color-functions: "red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue", "cyan", "teal",
|
|
240
|
-
"green", "light-green", "lime", "yellow", "amber", "orange", "deep-orange", "brown", "grey", "blue-grey",
|
|
241
|
-
"primary", "accent", "success", "warn", "danger", "info", "disabled";
|
|
242
|
-
|
|
243
|
-
matcha-button-toggle {
|
|
244
|
-
display: inline-flex;
|
|
245
|
-
@include _colorize-inactive-type-solid-button-toggle-item($theme, $color-functions);
|
|
246
|
-
@include _colorize-inactive-type-basic-button-toggle-item($theme, $color-functions);
|
|
247
|
-
@include _colorize-inactive-type-outline-button-toggle-item($theme, $color-functions);
|
|
248
|
-
@include _colorize-inactive-type-alpha-button-toggle-item($theme, $color-functions);
|
|
249
|
-
@include _colorize-inactive-type-link-button-toggle-item($theme, $color-functions);
|
|
250
|
-
|
|
251
|
-
.button-group {
|
|
252
|
-
button[matcha-button],
|
|
253
|
-
a[matcha-button] {
|
|
254
|
-
&:focus-visible:not([disabled]):not([disabled="true"]) {
|
|
255
|
-
outline: var(--matcha-state-focus-ring-width, 2px) solid var(--matcha-color-accent);
|
|
256
|
-
// Inset (negativo): o .button-group é scroll container (overflow-x)
|
|
257
|
-
// e clipa qualquer outline desenhado FORA do botão — anel interno
|
|
258
|
-
// fica 100% visível mesmo com rolagem.
|
|
259
|
-
outline-offset: calc(-1 * (var(--matcha-state-focus-ring-width, 2px) + var(--matcha-state-focus-ring-offset, 2px)));
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
&[disabled],
|
|
265
|
-
&[disabled]:not([disabled="false"]),
|
|
266
|
-
&[disabled="true"] {
|
|
267
|
-
.button-group {
|
|
268
|
-
|
|
269
|
-
button[matcha-button],
|
|
270
|
-
a[matcha-button] {
|
|
271
|
-
&[active] {
|
|
272
|
-
@include disabled-solid-button($theme);
|
|
273
|
-
|
|
274
|
-
&[outline],
|
|
275
|
-
&[outline]:not([outline="false"]),
|
|
276
|
-
&[outline="true"] {
|
|
277
|
-
@include disabled-outline-button($theme);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
&[basic],
|
|
281
|
-
&[basic]:not([basic="false"]),
|
|
282
|
-
&[basic="true"] {
|
|
283
|
-
@include disabled-basic-button($theme);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
&[alpha],
|
|
287
|
-
&[alpha]:not([alpha="false"]),
|
|
288
|
-
&[alpha="true"] {
|
|
289
|
-
@include disabled-alpha-button($theme);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
&[link],
|
|
293
|
-
&[link]:not([link="false"]),
|
|
294
|
-
&[link="true"] {
|
|
295
|
-
@include disabled-link-button($theme);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// =============================================================================
|
|
306
|
-
// A11y / modernity media queries
|
|
307
|
-
// =============================================================================
|
|
308
|
-
|
|
309
|
-
// Forced colors (Windows High Contrast) — borders/bg podem sumir,
|
|
310
|
-
// SelectedItem/CanvasText são tokens system sempre visíveis.
|
|
311
|
-
@media (forced-colors: active) {
|
|
312
|
-
matcha-button-toggle .button-group {
|
|
313
|
-
button[matcha-button],
|
|
314
|
-
a[matcha-button] {
|
|
315
|
-
border: 1px solid CanvasText;
|
|
316
|
-
|
|
317
|
-
&[active] {
|
|
318
|
-
background: SelectedItem !important;
|
|
319
|
-
color: SelectedItemText !important;
|
|
320
|
-
border-color: SelectedItem;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
&:focus-visible {
|
|
324
|
-
outline: 2px solid CanvasText !important;
|
|
325
|
-
outline-offset: -4px; // inset — scroll container clipa outline externo
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
// Reduced motion — mata transitions de hover/active state.
|
|
332
|
-
@media (prefers-reduced-motion: reduce) {
|
|
333
|
-
matcha-button-toggle .button-group {
|
|
334
|
-
button[matcha-button],
|
|
335
|
-
a[matcha-button] {
|
|
336
|
-
transition: none !important;
|
|
337
|
-
animation: none !important;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
// Print — controles de UI somem em impressão.
|
|
343
|
-
@media print {
|
|
344
|
-
matcha-button-toggle {
|
|
345
|
-
display: none !important;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
// =============================================================================
|
|
350
|
-
// Structural rules — aligned with Figma matcha/button-toggle:
|
|
351
|
-
// Gap=Segmented: buttons share borders (1px hairline between, 2px thin outside)
|
|
352
|
-
// Gap=Separated: buttons stand apart with gap=space/200 and full radius-lg each
|
|
353
|
-
// Width: hug content by default (Figma); [stretched] opta pelo fill 100%
|
|
354
|
-
// com botões dividindo a largura igualmente.
|
|
355
|
-
// =============================================================================
|
|
356
|
-
matcha-button-toggle {
|
|
357
|
-
display: inline-flex;
|
|
358
|
-
max-width: 100%;
|
|
359
|
-
|
|
360
|
-
// ── Label projetado (<matcha-label>) — empilha ACIMA do grupo (stacked,
|
|
361
|
-
// igual matcha-form-field). Gated por :has(> matcha-label): sem label, o
|
|
362
|
-
// host continua inline-flex row EXATAMENTE como antes (zero regressão).
|
|
363
|
-
&:has(> matcha-label) {
|
|
364
|
-
flex-direction: column;
|
|
365
|
-
align-items: flex-start;
|
|
366
|
-
gap: var(--matcha-space-075, 6px); // mesmo gap label↔box do matcha-form-field
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
.button-group {
|
|
370
|
-
display: flex;
|
|
371
|
-
align-items: stretch;
|
|
372
|
-
max-width: 100%;
|
|
373
|
-
|
|
374
|
-
// ── Overflow: botão NUNCA é esmagado — no pior caso, rola ─────────
|
|
375
|
-
// flex-shrink default (1) comprimia o conteúdo dos botões quando o
|
|
376
|
-
// container aperta. Botões mantêm largura natural (flex: 0 0 auto +
|
|
377
|
-
// nowrap) e o grupo cria rolagem horizontal.
|
|
378
|
-
overflow-x: auto;
|
|
379
|
-
overflow-y: hidden;
|
|
380
|
-
-webkit-overflow-scrolling: touch;
|
|
381
|
-
|
|
382
|
-
// Scrollbar fino e temado (mesmo padrão do matcha-form-field) —
|
|
383
|
-
// só aparece quando há overflow real.
|
|
384
|
-
scrollbar-width: thin; // Firefox
|
|
385
|
-
scrollbar-color: var(--matcha-color-text-placeholder) transparent;
|
|
386
|
-
&::-webkit-scrollbar { height: 6px; }
|
|
387
|
-
&::-webkit-scrollbar-track { background: transparent; }
|
|
388
|
-
&::-webkit-scrollbar-thumb {
|
|
389
|
-
background: var(--matcha-color-text-placeholder);
|
|
390
|
-
border-radius: 3px;
|
|
391
|
-
}
|
|
392
|
-
&::-webkit-scrollbar-thumb:hover { background: var(--matcha-color-text-secondary); }
|
|
393
|
-
|
|
394
|
-
> button[matcha-button],
|
|
395
|
-
> a[matcha-button] {
|
|
396
|
-
flex: 0 0 auto;
|
|
397
|
-
white-space: nowrap;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
// ── Stretched (opt-in via [stretched]) — fill 100% do container ───────
|
|
402
|
-
// Era o default até a 20.x; agora requer a propriedade.
|
|
403
|
-
&[stretched]:not([stretched="false"]) {
|
|
404
|
-
display: flex;
|
|
405
|
-
width: 100%;
|
|
406
|
-
|
|
407
|
-
.button-group {
|
|
408
|
-
width: 100%;
|
|
409
|
-
|
|
410
|
-
// Children flex-share — each button takes equal width across the row.
|
|
411
|
-
// O piso de encolhimento é o `min-width` do size do próprio botão
|
|
412
|
-
// (matcha-buttons.scss) — NÃO o min-content: o botão tem
|
|
413
|
-
// `overflow: hidden`, o que anula a automatic minimum size do
|
|
414
|
-
// flexbox. Quando nem esse piso cabe, o overflow-x do grupo rola.
|
|
415
|
-
> button[matcha-button],
|
|
416
|
-
> a[matcha-button] {
|
|
417
|
-
flex: 1 1 0;
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
.button-group {
|
|
423
|
-
// ── Separated (default: gap = space/200) ──────────────────────────
|
|
424
|
-
// Each button keeps its own full radius and border-thin (2px).
|
|
425
|
-
// gap already handled by flex gap via [gap] binding in TS.
|
|
426
|
-
|
|
427
|
-
// ── Segmented (gap = 0): box-shadows dos outline overlappam ───────
|
|
428
|
-
// matcha-button usa box-shadow inset (não border), então usamos
|
|
429
|
-
// margin-left negativo pra sobrepor a borda do vizinho.
|
|
430
|
-
&.gap-0 {
|
|
431
|
-
gap: 0 !important;
|
|
432
|
-
|
|
433
|
-
button[matcha-button],
|
|
434
|
-
a[matcha-button] {
|
|
435
|
-
position: relative;
|
|
436
|
-
border-radius: 0;
|
|
437
|
-
|
|
438
|
-
// First: radius só no lado esquerdo
|
|
439
|
-
&:first-child {
|
|
440
|
-
border-top-left-radius: var(--matcha-radius-lg, 8px);
|
|
441
|
-
border-bottom-left-radius: var(--matcha-radius-lg, 8px);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
// Last: radius só no lado direito
|
|
445
|
-
&:last-child {
|
|
446
|
-
border-top-right-radius: var(--matcha-radius-lg, 8px);
|
|
447
|
-
border-bottom-right-radius: var(--matcha-radius-lg, 8px);
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
// Overlap de 2px com vizinho anterior pra fundir bordas
|
|
451
|
-
&:not(:first-child) {
|
|
452
|
-
margin-left: calc(-1 * var(--matcha-border-thin, 2px));
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
// Active (filled) fica no topo pra borda não ser recortada
|
|
456
|
-
&[active]:not([active="false"]),
|
|
457
|
-
&:not([outline]):not([basic]):not([ghost])[color] {
|
|
458
|
-
z-index: 1;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
// =============================================================================
|
|
466
|
-
// Readonly — seleção legível, clique inerte
|
|
467
|
-
// =============================================================================
|
|
468
|
-
// NENHUMA troca de cor aqui, e é isso que separa `readonly` de `disabled`: o bloco
|
|
469
|
-
// `&[disabled]` acima aplica os mixins `disabled-*-button` nos botões inativos, apagando
|
|
470
|
-
// justamente o contraste que diz qual opção está selecionada. Numa tela cujo propósito é LER
|
|
471
|
-
// esse estado, apagá-lo é o oposto do que se quer.
|
|
472
|
-
//
|
|
473
|
-
// O que muda é só a promessa de interação: o ponteiro deixa de sugerir clique. A inércia em si
|
|
474
|
-
// mora no `onSelect` do componente, não aqui — CSS não deve ser a trava.
|
|
475
|
-
matcha-button-toggle[readonly] {
|
|
476
|
-
|
|
477
|
-
.button-group {
|
|
478
|
-
|
|
479
|
-
button[matcha-button],
|
|
480
|
-
a[matcha-button] {
|
|
481
|
-
cursor: default;
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
}
|
|
1
|
+
@use "matcha-buttons" as *;
|
|
2
|
+
@mixin _colorize-inactive-type-solid-button-toggle-item($theme, $color-functions) {
|
|
3
|
+
|
|
4
|
+
&:not([inactivetype]),
|
|
5
|
+
&[inactivetype="solid"] {
|
|
6
|
+
@each $colorName in $color-functions {
|
|
7
|
+
&[inactivecolor="#{'' + $colorName}"] {
|
|
8
|
+
.button-group {
|
|
9
|
+
|
|
10
|
+
button[matcha-button],
|
|
11
|
+
a[matcha-button] {
|
|
12
|
+
&:not([active]) {
|
|
13
|
+
background: var(--matcha-color-#{$colorName});
|
|
14
|
+
color: var(--matcha-color-#{$colorName}-contrast);
|
|
15
|
+
box-shadow: 0 0 0 0px inset;
|
|
16
|
+
|
|
17
|
+
.ripple {
|
|
18
|
+
background: var(--matcha-color-#{$colorName}-contrast-alpha); // ok: legacy ripple color token
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&[disabled],
|
|
27
|
+
&[disabled]:not([disabled="false"]),
|
|
28
|
+
&[disabled="true"] {
|
|
29
|
+
.button-group {
|
|
30
|
+
|
|
31
|
+
button[matcha-button],
|
|
32
|
+
a[matcha-button] {
|
|
33
|
+
&:not([active]) {
|
|
34
|
+
@include disabled-solid-button($theme);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@mixin _colorize-inactive-type-basic-button-toggle-item($theme, $color-functions) {
|
|
43
|
+
&[inactivetype="basic"] {
|
|
44
|
+
@each $colorName in $color-functions {
|
|
45
|
+
&[inactivecolor="#{'' + $colorName}"] {
|
|
46
|
+
.button-group {
|
|
47
|
+
|
|
48
|
+
button[matcha-button],
|
|
49
|
+
a[matcha-button] {
|
|
50
|
+
&:not([active]) {
|
|
51
|
+
background: var(--matcha-color-surface);
|
|
52
|
+
color: var(--matcha-color-#{$colorName});
|
|
53
|
+
box-shadow: 0 0 0 0px inset;
|
|
54
|
+
|
|
55
|
+
.ripple {
|
|
56
|
+
background: var(--matcha-color-#{$colorName}-alpha); // ok: legacy ripple color token
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&[disabled],
|
|
65
|
+
&[disabled]:not([disabled="false"]),
|
|
66
|
+
&[disabled="true"] {
|
|
67
|
+
.button-group {
|
|
68
|
+
|
|
69
|
+
button[matcha-button],
|
|
70
|
+
a[matcha-button] {
|
|
71
|
+
&:not([active]) {
|
|
72
|
+
@include disabled-basic-button($theme);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@mixin _colorize-inactive-type-outline-button-toggle-item($theme, $color-functions) {
|
|
81
|
+
&[inactivetype="outline"] {
|
|
82
|
+
|
|
83
|
+
//disabled false
|
|
84
|
+
&:not([disabled="true"]) {
|
|
85
|
+
|
|
86
|
+
// Default do componente (inactiveColor='basic') — não é cor de paleta
|
|
87
|
+
// (--matcha-color-basic não existe): inativo neutro com tokens de
|
|
88
|
+
// superfície/texto. Sem este branch, o toggle "pelado" (sem
|
|
89
|
+
// inactiveColor) não casava com regra nenhuma e o inativo ficava
|
|
90
|
+
// filled da própria cor, indistinguível do ativo.
|
|
91
|
+
&[inactivecolor="basic"] {
|
|
92
|
+
.button-group {
|
|
93
|
+
|
|
94
|
+
button[matcha-button],
|
|
95
|
+
a[matcha-button] {
|
|
96
|
+
&:not([active]) {
|
|
97
|
+
color: var(--matcha-color-text-secondary);
|
|
98
|
+
background: transparent;
|
|
99
|
+
box-shadow: 0 0 0 2px var(--matcha-color-surface-border) inset;
|
|
100
|
+
|
|
101
|
+
.ripple {
|
|
102
|
+
background: var(--matcha-color-fg-alpha); // ok: legacy ripple color token
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@each $colorName in $color-functions {
|
|
110
|
+
&[inactivecolor="#{'' + $colorName}"] {
|
|
111
|
+
.button-group {
|
|
112
|
+
|
|
113
|
+
button[matcha-button],
|
|
114
|
+
a[matcha-button] {
|
|
115
|
+
|
|
116
|
+
//botão não ativo
|
|
117
|
+
&:not([active]) {
|
|
118
|
+
color: var(--matcha-color-#{$colorName});
|
|
119
|
+
background: transparent;
|
|
120
|
+
box-shadow: 0 0 0 2px var(--matcha-color-#{$colorName}) inset;
|
|
121
|
+
|
|
122
|
+
.ripple {
|
|
123
|
+
background: var(--matcha-color-#{$colorName}-alpha); // ok: legacy ripple color token
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
//disabled true
|
|
133
|
+
&[disabled],
|
|
134
|
+
&[disabled]:not([disabled="false"]),
|
|
135
|
+
&[disabled="true"] {
|
|
136
|
+
.button-group {
|
|
137
|
+
|
|
138
|
+
button[matcha-button],
|
|
139
|
+
a[matcha-button] {
|
|
140
|
+
|
|
141
|
+
//botão não ativo
|
|
142
|
+
&:not([active]) {
|
|
143
|
+
@include disabled-outline-button($theme);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@mixin _colorize-inactive-type-alpha-button-toggle-item($theme, $color-functions) {
|
|
152
|
+
&[inactivetype="alpha"] {
|
|
153
|
+
@each $colorName in $color-functions {
|
|
154
|
+
&[inactivecolor="#{'' + $colorName}"] {
|
|
155
|
+
.button-group {
|
|
156
|
+
|
|
157
|
+
button[matcha-button],
|
|
158
|
+
a[matcha-button] {
|
|
159
|
+
&:not([active]) {
|
|
160
|
+
color: var(--matcha-color-#{$colorName});
|
|
161
|
+
background: var(--matcha-color-#{$colorName}-alpha);
|
|
162
|
+
box-shadow: 0 0 0 0px;
|
|
163
|
+
|
|
164
|
+
.ripple {
|
|
165
|
+
background: var(--matcha-color-#{$colorName}-contrast-alpha) // ok: legacy ripple color token
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&[disabled],
|
|
174
|
+
&[disabled]:not([disabled="false"]),
|
|
175
|
+
&[disabled="true"] {
|
|
176
|
+
.button-group {
|
|
177
|
+
|
|
178
|
+
button[matcha-button],
|
|
179
|
+
a[matcha-button] {
|
|
180
|
+
|
|
181
|
+
//botão não ativo
|
|
182
|
+
&:not([active]) {
|
|
183
|
+
@include disabled-alpha-button($theme);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
@mixin _colorize-inactive-type-link-button-toggle-item($theme, $color-functions) {
|
|
192
|
+
|
|
193
|
+
&[inactivetype="link"] {
|
|
194
|
+
@each $colorName in $color-functions {
|
|
195
|
+
&[inactivecolor="#{'' + $colorName}"] {
|
|
196
|
+
.button-group {
|
|
197
|
+
|
|
198
|
+
button[matcha-button],
|
|
199
|
+
a[matcha-button] {
|
|
200
|
+
&:not([active]) {
|
|
201
|
+
|
|
202
|
+
background: transparent;
|
|
203
|
+
color: var(--matcha-color-#{$colorName});
|
|
204
|
+
box-shadow: 0 0 0 0px;
|
|
205
|
+
|
|
206
|
+
.ripple {
|
|
207
|
+
background: var(--matcha-color-#{$colorName}-alpha); // ok: legacy ripple color token
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
&[disabled],
|
|
217
|
+
&[disabled]:not([disabled="false"]),
|
|
218
|
+
&[disabled="true"] {
|
|
219
|
+
.button-group {
|
|
220
|
+
|
|
221
|
+
button[matcha-button],
|
|
222
|
+
a[matcha-button] {
|
|
223
|
+
|
|
224
|
+
//botão não ativo
|
|
225
|
+
&:not([active]) {
|
|
226
|
+
@include disabled-link-button($theme);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
@mixin matcha-button-toggle($theme) {
|
|
238
|
+
// Nomes de cor (semânticas + paleta). Cores vêm de var(--matcha-color-*) — sem getRed/$theme.
|
|
239
|
+
$color-functions: "red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue", "cyan", "teal",
|
|
240
|
+
"green", "light-green", "lime", "yellow", "amber", "orange", "deep-orange", "brown", "grey", "blue-grey",
|
|
241
|
+
"primary", "accent", "success", "warn", "danger", "info", "disabled";
|
|
242
|
+
|
|
243
|
+
matcha-button-toggle {
|
|
244
|
+
display: inline-flex;
|
|
245
|
+
@include _colorize-inactive-type-solid-button-toggle-item($theme, $color-functions);
|
|
246
|
+
@include _colorize-inactive-type-basic-button-toggle-item($theme, $color-functions);
|
|
247
|
+
@include _colorize-inactive-type-outline-button-toggle-item($theme, $color-functions);
|
|
248
|
+
@include _colorize-inactive-type-alpha-button-toggle-item($theme, $color-functions);
|
|
249
|
+
@include _colorize-inactive-type-link-button-toggle-item($theme, $color-functions);
|
|
250
|
+
|
|
251
|
+
.button-group {
|
|
252
|
+
button[matcha-button],
|
|
253
|
+
a[matcha-button] {
|
|
254
|
+
&:focus-visible:not([disabled]):not([disabled="true"]) {
|
|
255
|
+
outline: var(--matcha-state-focus-ring-width, 2px) solid var(--matcha-color-accent);
|
|
256
|
+
// Inset (negativo): o .button-group é scroll container (overflow-x)
|
|
257
|
+
// e clipa qualquer outline desenhado FORA do botão — anel interno
|
|
258
|
+
// fica 100% visível mesmo com rolagem.
|
|
259
|
+
outline-offset: calc(-1 * (var(--matcha-state-focus-ring-width, 2px) + var(--matcha-state-focus-ring-offset, 2px)));
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
&[disabled],
|
|
265
|
+
&[disabled]:not([disabled="false"]),
|
|
266
|
+
&[disabled="true"] {
|
|
267
|
+
.button-group {
|
|
268
|
+
|
|
269
|
+
button[matcha-button],
|
|
270
|
+
a[matcha-button] {
|
|
271
|
+
&[active] {
|
|
272
|
+
@include disabled-solid-button($theme);
|
|
273
|
+
|
|
274
|
+
&[outline],
|
|
275
|
+
&[outline]:not([outline="false"]),
|
|
276
|
+
&[outline="true"] {
|
|
277
|
+
@include disabled-outline-button($theme);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
&[basic],
|
|
281
|
+
&[basic]:not([basic="false"]),
|
|
282
|
+
&[basic="true"] {
|
|
283
|
+
@include disabled-basic-button($theme);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
&[alpha],
|
|
287
|
+
&[alpha]:not([alpha="false"]),
|
|
288
|
+
&[alpha="true"] {
|
|
289
|
+
@include disabled-alpha-button($theme);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
&[link],
|
|
293
|
+
&[link]:not([link="false"]),
|
|
294
|
+
&[link="true"] {
|
|
295
|
+
@include disabled-link-button($theme);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// =============================================================================
|
|
306
|
+
// A11y / modernity media queries
|
|
307
|
+
// =============================================================================
|
|
308
|
+
|
|
309
|
+
// Forced colors (Windows High Contrast) — borders/bg podem sumir,
|
|
310
|
+
// SelectedItem/CanvasText são tokens system sempre visíveis.
|
|
311
|
+
@media (forced-colors: active) {
|
|
312
|
+
matcha-button-toggle .button-group {
|
|
313
|
+
button[matcha-button],
|
|
314
|
+
a[matcha-button] {
|
|
315
|
+
border: 1px solid CanvasText;
|
|
316
|
+
|
|
317
|
+
&[active] {
|
|
318
|
+
background: SelectedItem !important;
|
|
319
|
+
color: SelectedItemText !important;
|
|
320
|
+
border-color: SelectedItem;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
&:focus-visible {
|
|
324
|
+
outline: 2px solid CanvasText !important;
|
|
325
|
+
outline-offset: -4px; // inset — scroll container clipa outline externo
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// Reduced motion — mata transitions de hover/active state.
|
|
332
|
+
@media (prefers-reduced-motion: reduce) {
|
|
333
|
+
matcha-button-toggle .button-group {
|
|
334
|
+
button[matcha-button],
|
|
335
|
+
a[matcha-button] {
|
|
336
|
+
transition: none !important;
|
|
337
|
+
animation: none !important;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// Print — controles de UI somem em impressão.
|
|
343
|
+
@media print {
|
|
344
|
+
matcha-button-toggle {
|
|
345
|
+
display: none !important;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// =============================================================================
|
|
350
|
+
// Structural rules — aligned with Figma matcha/button-toggle:
|
|
351
|
+
// Gap=Segmented: buttons share borders (1px hairline between, 2px thin outside)
|
|
352
|
+
// Gap=Separated: buttons stand apart with gap=space/200 and full radius-lg each
|
|
353
|
+
// Width: hug content by default (Figma); [stretched] opta pelo fill 100%
|
|
354
|
+
// com botões dividindo a largura igualmente.
|
|
355
|
+
// =============================================================================
|
|
356
|
+
matcha-button-toggle {
|
|
357
|
+
display: inline-flex;
|
|
358
|
+
max-width: 100%;
|
|
359
|
+
|
|
360
|
+
// ── Label projetado (<matcha-label>) — empilha ACIMA do grupo (stacked,
|
|
361
|
+
// igual matcha-form-field). Gated por :has(> matcha-label): sem label, o
|
|
362
|
+
// host continua inline-flex row EXATAMENTE como antes (zero regressão).
|
|
363
|
+
&:has(> matcha-label) {
|
|
364
|
+
flex-direction: column;
|
|
365
|
+
align-items: flex-start;
|
|
366
|
+
gap: var(--matcha-space-075, 6px); // mesmo gap label↔box do matcha-form-field
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.button-group {
|
|
370
|
+
display: flex;
|
|
371
|
+
align-items: stretch;
|
|
372
|
+
max-width: 100%;
|
|
373
|
+
|
|
374
|
+
// ── Overflow: botão NUNCA é esmagado — no pior caso, rola ─────────
|
|
375
|
+
// flex-shrink default (1) comprimia o conteúdo dos botões quando o
|
|
376
|
+
// container aperta. Botões mantêm largura natural (flex: 0 0 auto +
|
|
377
|
+
// nowrap) e o grupo cria rolagem horizontal.
|
|
378
|
+
overflow-x: auto;
|
|
379
|
+
overflow-y: hidden;
|
|
380
|
+
-webkit-overflow-scrolling: touch;
|
|
381
|
+
|
|
382
|
+
// Scrollbar fino e temado (mesmo padrão do matcha-form-field) —
|
|
383
|
+
// só aparece quando há overflow real.
|
|
384
|
+
scrollbar-width: thin; // Firefox
|
|
385
|
+
scrollbar-color: var(--matcha-color-text-placeholder) transparent;
|
|
386
|
+
&::-webkit-scrollbar { height: 6px; }
|
|
387
|
+
&::-webkit-scrollbar-track { background: transparent; }
|
|
388
|
+
&::-webkit-scrollbar-thumb {
|
|
389
|
+
background: var(--matcha-color-text-placeholder);
|
|
390
|
+
border-radius: 3px;
|
|
391
|
+
}
|
|
392
|
+
&::-webkit-scrollbar-thumb:hover { background: var(--matcha-color-text-secondary); }
|
|
393
|
+
|
|
394
|
+
> button[matcha-button],
|
|
395
|
+
> a[matcha-button] {
|
|
396
|
+
flex: 0 0 auto;
|
|
397
|
+
white-space: nowrap;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// ── Stretched (opt-in via [stretched]) — fill 100% do container ───────
|
|
402
|
+
// Era o default até a 20.x; agora requer a propriedade.
|
|
403
|
+
&[stretched]:not([stretched="false"]) {
|
|
404
|
+
display: flex;
|
|
405
|
+
width: 100%;
|
|
406
|
+
|
|
407
|
+
.button-group {
|
|
408
|
+
width: 100%;
|
|
409
|
+
|
|
410
|
+
// Children flex-share — each button takes equal width across the row.
|
|
411
|
+
// O piso de encolhimento é o `min-width` do size do próprio botão
|
|
412
|
+
// (matcha-buttons.scss) — NÃO o min-content: o botão tem
|
|
413
|
+
// `overflow: hidden`, o que anula a automatic minimum size do
|
|
414
|
+
// flexbox. Quando nem esse piso cabe, o overflow-x do grupo rola.
|
|
415
|
+
> button[matcha-button],
|
|
416
|
+
> a[matcha-button] {
|
|
417
|
+
flex: 1 1 0;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.button-group {
|
|
423
|
+
// ── Separated (default: gap = space/200) ──────────────────────────
|
|
424
|
+
// Each button keeps its own full radius and border-thin (2px).
|
|
425
|
+
// gap already handled by flex gap via [gap] binding in TS.
|
|
426
|
+
|
|
427
|
+
// ── Segmented (gap = 0): box-shadows dos outline overlappam ───────
|
|
428
|
+
// matcha-button usa box-shadow inset (não border), então usamos
|
|
429
|
+
// margin-left negativo pra sobrepor a borda do vizinho.
|
|
430
|
+
&.gap-0 {
|
|
431
|
+
gap: 0 !important;
|
|
432
|
+
|
|
433
|
+
button[matcha-button],
|
|
434
|
+
a[matcha-button] {
|
|
435
|
+
position: relative;
|
|
436
|
+
border-radius: 0;
|
|
437
|
+
|
|
438
|
+
// First: radius só no lado esquerdo
|
|
439
|
+
&:first-child {
|
|
440
|
+
border-top-left-radius: var(--matcha-radius-lg, 8px);
|
|
441
|
+
border-bottom-left-radius: var(--matcha-radius-lg, 8px);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// Last: radius só no lado direito
|
|
445
|
+
&:last-child {
|
|
446
|
+
border-top-right-radius: var(--matcha-radius-lg, 8px);
|
|
447
|
+
border-bottom-right-radius: var(--matcha-radius-lg, 8px);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// Overlap de 2px com vizinho anterior pra fundir bordas
|
|
451
|
+
&:not(:first-child) {
|
|
452
|
+
margin-left: calc(-1 * var(--matcha-border-thin, 2px));
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
// Active (filled) fica no topo pra borda não ser recortada
|
|
456
|
+
&[active]:not([active="false"]),
|
|
457
|
+
&:not([outline]):not([basic]):not([ghost])[color] {
|
|
458
|
+
z-index: 1;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
// =============================================================================
|
|
466
|
+
// Readonly — seleção legível, clique inerte
|
|
467
|
+
// =============================================================================
|
|
468
|
+
// NENHUMA troca de cor aqui, e é isso que separa `readonly` de `disabled`: o bloco
|
|
469
|
+
// `&[disabled]` acima aplica os mixins `disabled-*-button` nos botões inativos, apagando
|
|
470
|
+
// justamente o contraste que diz qual opção está selecionada. Numa tela cujo propósito é LER
|
|
471
|
+
// esse estado, apagá-lo é o oposto do que se quer.
|
|
472
|
+
//
|
|
473
|
+
// O que muda é só a promessa de interação: o ponteiro deixa de sugerir clique. A inércia em si
|
|
474
|
+
// mora no `onSelect` do componente, não aqui — CSS não deve ser a trava.
|
|
475
|
+
matcha-button-toggle[readonly] {
|
|
476
|
+
|
|
477
|
+
.button-group {
|
|
478
|
+
|
|
479
|
+
button[matcha-button],
|
|
480
|
+
a[matcha-button] {
|
|
481
|
+
cursor: default;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|