@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,325 +1,325 @@
|
|
|
1
|
-
// =============================================================================
|
|
2
|
-
// matcha-radio.scss — Figma DSV3 matcha/radio (14354:184)
|
|
3
|
-
//
|
|
4
|
-
// Estrutura visual (1:1 com Figma):
|
|
5
|
-
// .matcha-radio-wrapper (label) — flex row + gap 8px
|
|
6
|
-
// .matcha-radio-touch (span) — 36×36 pillshape, state-layer, hover bg
|
|
7
|
-
// .matcha-radio-input (input radio) — 18×18 native, ring+dot via box-shadow inset
|
|
8
|
-
// .matcha-radio-text (span) — coluna label + desc + hint
|
|
9
|
-
//
|
|
10
|
-
// Ring/dot via 3 camadas de box-shadow inset (anel 2px, gap --matcha-color-surface,
|
|
11
|
-
// dot central ~8×8) numa única caixa — não border + ::after posicionado. Duas
|
|
12
|
-
// caixas separadas (input + pseudo-elemento absolutamente posicionado) arredondam
|
|
13
|
-
// pixel de forma independente em escalas fracionadas de tela (ex.: 125%), o que
|
|
14
|
-
// descentralizava o dot ("zarolho"); box-shadow inset é uma pintura só, sempre
|
|
15
|
-
// simétrica em relação ao próprio elemento. Mesma técnica do master (getSurface),
|
|
16
|
-
// só trocando a cor fixa pelo token DSV3 --matcha-color-surface.
|
|
17
|
-
// (Camada do gap PRECISA ser opaca — "transparent" não oclui a camada de baixo,
|
|
18
|
-
// só deixa o dot vazar até a borda e vira bolão sólido.)
|
|
19
|
-
//
|
|
20
|
-
// Color system: accent (default) + 6 semânticas (primary/success/warn/danger/info).
|
|
21
|
-
// Paleta legacy Material 1 (red/pink/purple/blue/...) REMOVIDA — DSV3 não suporta.
|
|
22
|
-
// =============================================================================
|
|
23
|
-
|
|
24
|
-
// ── Estrutural ─────────────────────────────────────────────────────────────
|
|
25
|
-
|
|
26
|
-
matcha-radio {
|
|
27
|
-
display: inline-flex;
|
|
28
|
-
align-items: center;
|
|
29
|
-
gap: var(--matcha-space-100, 8px);
|
|
30
|
-
cursor: pointer;
|
|
31
|
-
font-family: var(--matcha-font-family);
|
|
32
|
-
|
|
33
|
-
// Disabled — pointer/cursor only (cores via tokens semânticos no mixin)
|
|
34
|
-
&[disabled] {
|
|
35
|
-
pointer-events: none;
|
|
36
|
-
cursor: default;
|
|
37
|
-
|
|
38
|
-
.matcha-radio-wrapper { cursor: default; }
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Movimento reduzido (WCAG 2.3.3)
|
|
42
|
-
@media (prefers-reduced-motion: reduce) {
|
|
43
|
-
.matcha-radio-input,
|
|
44
|
-
.matcha-radio-touch::before { transition: none; }
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.matcha-radio-wrapper {
|
|
49
|
-
display: inline-flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
gap: var(--matcha-space-100, 8px);
|
|
52
|
-
cursor: pointer;
|
|
53
|
-
user-select: none;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Quando há descrição/hint (multi-linha), volta pra align-items: flex-start
|
|
57
|
-
// pra evitar que o glyph fique no meio do bloco texto.
|
|
58
|
-
matcha-radio:has(.matcha-radio-description),
|
|
59
|
-
matcha-radio:has(.matcha-radio-hint) {
|
|
60
|
-
.matcha-radio-wrapper { align-items: flex-start; }
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// ── Touch target — 36×36 pillshape (Figma DSV3) ─────────────────────────────
|
|
64
|
-
// Container circular grande pra área clicável extendida (WCAG 2.5.5).
|
|
65
|
-
// Glyph visual continua 18×18 dentro, mas hover/click cobre 36×36.
|
|
66
|
-
.matcha-radio-touch {
|
|
67
|
-
position: relative;
|
|
68
|
-
display: inline-flex;
|
|
69
|
-
align-items: center;
|
|
70
|
-
justify-content: center;
|
|
71
|
-
width: var(--matcha-radio-touch-size, 36px);
|
|
72
|
-
height: var(--matcha-radio-touch-size, 36px);
|
|
73
|
-
flex-shrink: 0;
|
|
74
|
-
border-radius: var(--matcha-radius-pill, 9999px);
|
|
75
|
-
overflow: hidden;
|
|
76
|
-
|
|
77
|
-
// State layer — segue padrão DSV3 (currentColor + opacity tokenizada).
|
|
78
|
-
// currentColor herda do .matcha-radio-touch que recebe color por variante (mixin).
|
|
79
|
-
&::before {
|
|
80
|
-
content: '';
|
|
81
|
-
position: absolute;
|
|
82
|
-
inset: 0;
|
|
83
|
-
background: currentColor;
|
|
84
|
-
opacity: 0;
|
|
85
|
-
border-radius: inherit;
|
|
86
|
-
pointer-events: none;
|
|
87
|
-
transition: opacity var(--matcha-duration-instant, 80ms) linear;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// Hover/active state-layer — só quando NÃO disabled
|
|
92
|
-
matcha-radio:not([disabled]) .matcha-radio-touch:hover::before { opacity: var(--matcha-state-hover, 0.08); }
|
|
93
|
-
matcha-radio:not([disabled]) .matcha-radio-touch:active::before { opacity: var(--matcha-state-active, 0.12); }
|
|
94
|
-
|
|
95
|
-
// ── Input radio nativo — vector 18×18 ────────────────────────────────────
|
|
96
|
-
.matcha-radio-input {
|
|
97
|
-
appearance: none;
|
|
98
|
-
-webkit-appearance: none;
|
|
99
|
-
width: var(--matcha-radio-size, 18px);
|
|
100
|
-
height: var(--matcha-radio-size, 18px);
|
|
101
|
-
padding: 0;
|
|
102
|
-
margin: 0;
|
|
103
|
-
border-radius: 50%;
|
|
104
|
-
cursor: pointer;
|
|
105
|
-
position: relative;
|
|
106
|
-
box-sizing: border-box;
|
|
107
|
-
transition: box-shadow var(--matcha-duration-fast, 200ms) var(--matcha-easing-standard, ease);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// ── Coluna texto (label + description + hint) ────────────────────────────
|
|
111
|
-
.matcha-radio-text {
|
|
112
|
-
display: flex;
|
|
113
|
-
flex-direction: column;
|
|
114
|
-
gap: var(--matcha-space-025, 2px);
|
|
115
|
-
min-width: 0;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// Em multi-linha (com desc/hint), aplica padding-top no text pra alinhar
|
|
119
|
-
// o label com o centro vertical do glyph (touch 36px, glyph centro em 18px;
|
|
120
|
-
// label-sm height 16px → padding-top 10px alinha label-center com glyph-center).
|
|
121
|
-
matcha-radio:has(.matcha-radio-description) .matcha-radio-text,
|
|
122
|
-
matcha-radio:has(.matcha-radio-hint) .matcha-radio-text {
|
|
123
|
-
padding-top: var(--matcha-space-150, 10px);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// Label — Figma matcha/text/label-sm (12/500/16) — não body-sm que é regular
|
|
127
|
-
.matcha-radio-label {
|
|
128
|
-
display: inline-flex;
|
|
129
|
-
align-items: center;
|
|
130
|
-
gap: var(--matcha-space-050, 4px);
|
|
131
|
-
font-family: var(--matcha-font-family);
|
|
132
|
-
font-size: var(--matcha-text-label-sm, 12px);
|
|
133
|
-
font-weight: var(--matcha-weight-medium, 500);
|
|
134
|
-
line-height: var(--matcha-leading-label-sm, 16px);
|
|
135
|
-
color: var(--matcha-radio-label-color, var(--matcha-color-text-primary));
|
|
136
|
-
cursor: pointer;
|
|
137
|
-
user-select: none;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// Asterisco required — danger
|
|
141
|
-
.matcha-radio-required {
|
|
142
|
-
color: var(--matcha-color-danger);
|
|
143
|
-
font-weight: var(--matcha-weight-medium, 500);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// Description — caption 11/14 letter-spacing 0.3 (Figma DSV3)
|
|
147
|
-
.matcha-radio-description {
|
|
148
|
-
font-family: var(--matcha-font-family);
|
|
149
|
-
font-size: var(--matcha-text-p-tiny, 11px);
|
|
150
|
-
line-height: var(--matcha-leading-p-tiny, 14px);
|
|
151
|
-
letter-spacing: 0.3px;
|
|
152
|
-
color: var(--matcha-color-text-secondary);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// Hint (só em error) — danger
|
|
156
|
-
.matcha-radio-hint {
|
|
157
|
-
font-family: var(--matcha-font-family);
|
|
158
|
-
font-size: var(--matcha-text-p-tiny, 11px);
|
|
159
|
-
line-height: var(--matcha-leading-p-tiny, 14px);
|
|
160
|
-
letter-spacing: 0.3px;
|
|
161
|
-
color: var(--matcha-color-danger);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// =============================================================================
|
|
165
|
-
// Theme mixin — cores por variante (accent default + 6 semânticas DSV3)
|
|
166
|
-
// Paleta Material 1 (red/pink/purple/...) REMOVIDA — não faz parte do DSV3.
|
|
167
|
-
// =============================================================================
|
|
168
|
-
|
|
169
|
-
@mixin matcha-radio($theme) {
|
|
170
|
-
matcha-radio {
|
|
171
|
-
|
|
172
|
-
// ── Default (sem [color]) e [color="accent"] = accent ─────────────────
|
|
173
|
-
&:not([color]),
|
|
174
|
-
&[color="accent"] {
|
|
175
|
-
.matcha-radio-touch {
|
|
176
|
-
color: var(--matcha-color-accent);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.matcha-radio-input {
|
|
180
|
-
box-shadow: 0 0 0 2px var(--matcha-color-text-label) inset;
|
|
181
|
-
|
|
182
|
-
&:checked {
|
|
183
|
-
box-shadow: 0 0 0 2px var(--matcha-color-accent) inset,
|
|
184
|
-
0 0 0 5px var(--matcha-color-surface) inset,
|
|
185
|
-
0 0 0 9px var(--matcha-color-accent) inset;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
// ── primary ────────────────────────────────────────────────────────
|
|
191
|
-
&[color="primary"] {
|
|
192
|
-
.matcha-radio-touch { color: var(--matcha-color-primary); }
|
|
193
|
-
.matcha-radio-input {
|
|
194
|
-
box-shadow: 0 0 0 2px var(--matcha-color-text-label) inset;
|
|
195
|
-
&:checked {
|
|
196
|
-
box-shadow: 0 0 0 2px var(--matcha-color-primary) inset,
|
|
197
|
-
0 0 0 5px var(--matcha-color-surface) inset,
|
|
198
|
-
0 0 0 9px var(--matcha-color-primary) inset;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// ── success ────────────────────────────────────────────────────────
|
|
204
|
-
&[color="success"] {
|
|
205
|
-
.matcha-radio-touch { color: var(--matcha-color-success); }
|
|
206
|
-
.matcha-radio-input {
|
|
207
|
-
box-shadow: 0 0 0 2px var(--matcha-color-text-label) inset;
|
|
208
|
-
&:checked {
|
|
209
|
-
box-shadow: 0 0 0 2px var(--matcha-color-success) inset,
|
|
210
|
-
0 0 0 5px var(--matcha-color-surface) inset,
|
|
211
|
-
0 0 0 9px var(--matcha-color-success) inset;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// ── warn ───────────────────────────────────────────────────────────
|
|
217
|
-
&[color="warn"] {
|
|
218
|
-
.matcha-radio-touch { color: var(--matcha-color-warn); }
|
|
219
|
-
.matcha-radio-input {
|
|
220
|
-
box-shadow: 0 0 0 2px var(--matcha-color-text-label) inset;
|
|
221
|
-
&:checked {
|
|
222
|
-
box-shadow: 0 0 0 2px var(--matcha-color-warn) inset,
|
|
223
|
-
0 0 0 5px var(--matcha-color-surface) inset,
|
|
224
|
-
0 0 0 9px var(--matcha-color-warn) inset;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
// ── danger ─────────────────────────────────────────────────────────
|
|
230
|
-
&[color="danger"] {
|
|
231
|
-
.matcha-radio-touch { color: var(--matcha-color-danger); }
|
|
232
|
-
.matcha-radio-input {
|
|
233
|
-
box-shadow: 0 0 0 2px var(--matcha-color-text-label) inset;
|
|
234
|
-
&:checked {
|
|
235
|
-
box-shadow: 0 0 0 2px var(--matcha-color-danger) inset,
|
|
236
|
-
0 0 0 5px var(--matcha-color-surface) inset,
|
|
237
|
-
0 0 0 9px var(--matcha-color-danger) inset;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// ── info ───────────────────────────────────────────────────────────
|
|
243
|
-
&[color="info"] {
|
|
244
|
-
.matcha-radio-touch { color: var(--matcha-color-info); }
|
|
245
|
-
.matcha-radio-input {
|
|
246
|
-
box-shadow: 0 0 0 2px var(--matcha-color-text-label) inset;
|
|
247
|
-
&:checked {
|
|
248
|
-
box-shadow: 0 0 0 2px var(--matcha-color-info) inset,
|
|
249
|
-
0 0 0 5px var(--matcha-color-surface) inset,
|
|
250
|
-
0 0 0 9px var(--matcha-color-info) inset;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// ── Error state (Figma DSV3 State=Error) — sobrescreve cor do glyph ──
|
|
256
|
-
&.matcha-radio-error,
|
|
257
|
-
&[error="true"] {
|
|
258
|
-
.matcha-radio-input {
|
|
259
|
-
box-shadow: 0 0 0 2px var(--matcha-color-danger) inset !important;
|
|
260
|
-
|
|
261
|
-
&:checked {
|
|
262
|
-
box-shadow: 0 0 0 2px var(--matcha-color-danger) inset,
|
|
263
|
-
0 0 0 5px var(--matcha-color-surface) inset,
|
|
264
|
-
0 0 0 9px var(--matcha-color-danger) inset !important;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// ── Disabled (Figma DSV3 opacity 0.5) ────────────────────────────────
|
|
270
|
-
&[disabled] {
|
|
271
|
-
opacity: var(--matcha-opacity-option-disabled, 0.5);
|
|
272
|
-
|
|
273
|
-
.matcha-radio-input {
|
|
274
|
-
box-shadow: 0 0 0 2px var(--matcha-color-interaction-disabled-fg) inset;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
.matcha-radio-label,
|
|
278
|
-
.matcha-radio-description,
|
|
279
|
-
.matcha-radio-hint {
|
|
280
|
-
color: var(--matcha-color-interaction-disabled-fg);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
// ── Focused — outline 2px primary no touch (não desloca layout) ──────
|
|
285
|
-
.matcha-radio-input:focus-visible {
|
|
286
|
-
outline: none;
|
|
287
|
-
}
|
|
288
|
-
.matcha-radio-touch:has(.matcha-radio-input:focus-visible) {
|
|
289
|
-
outline: var(--matcha-state-focus-ring-width, 2px) solid var(--matcha-color-primary);
|
|
290
|
-
outline-offset: calc(-1 * var(--matcha-state-focus-ring-width, 2px));
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
// ── Forced colors ──
|
|
296
|
-
@media (forced-colors: active) {
|
|
297
|
-
matcha-radio {
|
|
298
|
-
.matcha-radio-circle {
|
|
299
|
-
border: 1px solid CanvasText !important;
|
|
300
|
-
background: Canvas !important;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
&.is-checked .matcha-radio-circle::after,
|
|
304
|
-
&[checked] .matcha-radio-circle::after {
|
|
305
|
-
background: Highlight !important;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
.matcha-radio-touch:has(.matcha-radio-input:focus-visible) {
|
|
309
|
-
outline: 2px solid CanvasText !important;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
&.is-disabled,
|
|
313
|
-
&[disabled] {
|
|
314
|
-
opacity: 0.5;
|
|
315
|
-
.matcha-radio-circle { border-color: GrayText !important; }
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
// ── Print ──
|
|
321
|
-
@media print {
|
|
322
|
-
matcha-radio .matcha-radio-circle {
|
|
323
|
-
border: 1px solid currentColor !important;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// matcha-radio.scss — Figma DSV3 matcha/radio (14354:184)
|
|
3
|
+
//
|
|
4
|
+
// Estrutura visual (1:1 com Figma):
|
|
5
|
+
// .matcha-radio-wrapper (label) — flex row + gap 8px
|
|
6
|
+
// .matcha-radio-touch (span) — 36×36 pillshape, state-layer, hover bg
|
|
7
|
+
// .matcha-radio-input (input radio) — 18×18 native, ring+dot via box-shadow inset
|
|
8
|
+
// .matcha-radio-text (span) — coluna label + desc + hint
|
|
9
|
+
//
|
|
10
|
+
// Ring/dot via 3 camadas de box-shadow inset (anel 2px, gap --matcha-color-surface,
|
|
11
|
+
// dot central ~8×8) numa única caixa — não border + ::after posicionado. Duas
|
|
12
|
+
// caixas separadas (input + pseudo-elemento absolutamente posicionado) arredondam
|
|
13
|
+
// pixel de forma independente em escalas fracionadas de tela (ex.: 125%), o que
|
|
14
|
+
// descentralizava o dot ("zarolho"); box-shadow inset é uma pintura só, sempre
|
|
15
|
+
// simétrica em relação ao próprio elemento. Mesma técnica do master (getSurface),
|
|
16
|
+
// só trocando a cor fixa pelo token DSV3 --matcha-color-surface.
|
|
17
|
+
// (Camada do gap PRECISA ser opaca — "transparent" não oclui a camada de baixo,
|
|
18
|
+
// só deixa o dot vazar até a borda e vira bolão sólido.)
|
|
19
|
+
//
|
|
20
|
+
// Color system: accent (default) + 6 semânticas (primary/success/warn/danger/info).
|
|
21
|
+
// Paleta legacy Material 1 (red/pink/purple/blue/...) REMOVIDA — DSV3 não suporta.
|
|
22
|
+
// =============================================================================
|
|
23
|
+
|
|
24
|
+
// ── Estrutural ─────────────────────────────────────────────────────────────
|
|
25
|
+
|
|
26
|
+
matcha-radio {
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: var(--matcha-space-100, 8px);
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
font-family: var(--matcha-font-family);
|
|
32
|
+
|
|
33
|
+
// Disabled — pointer/cursor only (cores via tokens semânticos no mixin)
|
|
34
|
+
&[disabled] {
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
cursor: default;
|
|
37
|
+
|
|
38
|
+
.matcha-radio-wrapper { cursor: default; }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Movimento reduzido (WCAG 2.3.3)
|
|
42
|
+
@media (prefers-reduced-motion: reduce) {
|
|
43
|
+
.matcha-radio-input,
|
|
44
|
+
.matcha-radio-touch::before { transition: none; }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.matcha-radio-wrapper {
|
|
49
|
+
display: inline-flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: var(--matcha-space-100, 8px);
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
user-select: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Quando há descrição/hint (multi-linha), volta pra align-items: flex-start
|
|
57
|
+
// pra evitar que o glyph fique no meio do bloco texto.
|
|
58
|
+
matcha-radio:has(.matcha-radio-description),
|
|
59
|
+
matcha-radio:has(.matcha-radio-hint) {
|
|
60
|
+
.matcha-radio-wrapper { align-items: flex-start; }
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// ── Touch target — 36×36 pillshape (Figma DSV3) ─────────────────────────────
|
|
64
|
+
// Container circular grande pra área clicável extendida (WCAG 2.5.5).
|
|
65
|
+
// Glyph visual continua 18×18 dentro, mas hover/click cobre 36×36.
|
|
66
|
+
.matcha-radio-touch {
|
|
67
|
+
position: relative;
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
width: var(--matcha-radio-touch-size, 36px);
|
|
72
|
+
height: var(--matcha-radio-touch-size, 36px);
|
|
73
|
+
flex-shrink: 0;
|
|
74
|
+
border-radius: var(--matcha-radius-pill, 9999px);
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
|
|
77
|
+
// State layer — segue padrão DSV3 (currentColor + opacity tokenizada).
|
|
78
|
+
// currentColor herda do .matcha-radio-touch que recebe color por variante (mixin).
|
|
79
|
+
&::before {
|
|
80
|
+
content: '';
|
|
81
|
+
position: absolute;
|
|
82
|
+
inset: 0;
|
|
83
|
+
background: currentColor;
|
|
84
|
+
opacity: 0;
|
|
85
|
+
border-radius: inherit;
|
|
86
|
+
pointer-events: none;
|
|
87
|
+
transition: opacity var(--matcha-duration-instant, 80ms) linear;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Hover/active state-layer — só quando NÃO disabled
|
|
92
|
+
matcha-radio:not([disabled]) .matcha-radio-touch:hover::before { opacity: var(--matcha-state-hover, 0.08); }
|
|
93
|
+
matcha-radio:not([disabled]) .matcha-radio-touch:active::before { opacity: var(--matcha-state-active, 0.12); }
|
|
94
|
+
|
|
95
|
+
// ── Input radio nativo — vector 18×18 ────────────────────────────────────
|
|
96
|
+
.matcha-radio-input {
|
|
97
|
+
appearance: none;
|
|
98
|
+
-webkit-appearance: none;
|
|
99
|
+
width: var(--matcha-radio-size, 18px);
|
|
100
|
+
height: var(--matcha-radio-size, 18px);
|
|
101
|
+
padding: 0;
|
|
102
|
+
margin: 0;
|
|
103
|
+
border-radius: 50%;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
position: relative;
|
|
106
|
+
box-sizing: border-box;
|
|
107
|
+
transition: box-shadow var(--matcha-duration-fast, 200ms) var(--matcha-easing-standard, ease);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// ── Coluna texto (label + description + hint) ────────────────────────────
|
|
111
|
+
.matcha-radio-text {
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-direction: column;
|
|
114
|
+
gap: var(--matcha-space-025, 2px);
|
|
115
|
+
min-width: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Em multi-linha (com desc/hint), aplica padding-top no text pra alinhar
|
|
119
|
+
// o label com o centro vertical do glyph (touch 36px, glyph centro em 18px;
|
|
120
|
+
// label-sm height 16px → padding-top 10px alinha label-center com glyph-center).
|
|
121
|
+
matcha-radio:has(.matcha-radio-description) .matcha-radio-text,
|
|
122
|
+
matcha-radio:has(.matcha-radio-hint) .matcha-radio-text {
|
|
123
|
+
padding-top: var(--matcha-space-150, 10px);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Label — Figma matcha/text/label-sm (12/500/16) — não body-sm que é regular
|
|
127
|
+
.matcha-radio-label {
|
|
128
|
+
display: inline-flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
gap: var(--matcha-space-050, 4px);
|
|
131
|
+
font-family: var(--matcha-font-family);
|
|
132
|
+
font-size: var(--matcha-text-label-sm, 12px);
|
|
133
|
+
font-weight: var(--matcha-weight-medium, 500);
|
|
134
|
+
line-height: var(--matcha-leading-label-sm, 16px);
|
|
135
|
+
color: var(--matcha-radio-label-color, var(--matcha-color-text-primary));
|
|
136
|
+
cursor: pointer;
|
|
137
|
+
user-select: none;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Asterisco required — danger
|
|
141
|
+
.matcha-radio-required {
|
|
142
|
+
color: var(--matcha-color-danger);
|
|
143
|
+
font-weight: var(--matcha-weight-medium, 500);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Description — caption 11/14 letter-spacing 0.3 (Figma DSV3)
|
|
147
|
+
.matcha-radio-description {
|
|
148
|
+
font-family: var(--matcha-font-family);
|
|
149
|
+
font-size: var(--matcha-text-p-tiny, 11px);
|
|
150
|
+
line-height: var(--matcha-leading-p-tiny, 14px);
|
|
151
|
+
letter-spacing: 0.3px;
|
|
152
|
+
color: var(--matcha-color-text-secondary);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Hint (só em error) — danger
|
|
156
|
+
.matcha-radio-hint {
|
|
157
|
+
font-family: var(--matcha-font-family);
|
|
158
|
+
font-size: var(--matcha-text-p-tiny, 11px);
|
|
159
|
+
line-height: var(--matcha-leading-p-tiny, 14px);
|
|
160
|
+
letter-spacing: 0.3px;
|
|
161
|
+
color: var(--matcha-color-danger);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// =============================================================================
|
|
165
|
+
// Theme mixin — cores por variante (accent default + 6 semânticas DSV3)
|
|
166
|
+
// Paleta Material 1 (red/pink/purple/...) REMOVIDA — não faz parte do DSV3.
|
|
167
|
+
// =============================================================================
|
|
168
|
+
|
|
169
|
+
@mixin matcha-radio($theme) {
|
|
170
|
+
matcha-radio {
|
|
171
|
+
|
|
172
|
+
// ── Default (sem [color]) e [color="accent"] = accent ─────────────────
|
|
173
|
+
&:not([color]),
|
|
174
|
+
&[color="accent"] {
|
|
175
|
+
.matcha-radio-touch {
|
|
176
|
+
color: var(--matcha-color-accent);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.matcha-radio-input {
|
|
180
|
+
box-shadow: 0 0 0 2px var(--matcha-color-text-label) inset;
|
|
181
|
+
|
|
182
|
+
&:checked {
|
|
183
|
+
box-shadow: 0 0 0 2px var(--matcha-color-accent) inset,
|
|
184
|
+
0 0 0 5px var(--matcha-color-surface) inset,
|
|
185
|
+
0 0 0 9px var(--matcha-color-accent) inset;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// ── primary ────────────────────────────────────────────────────────
|
|
191
|
+
&[color="primary"] {
|
|
192
|
+
.matcha-radio-touch { color: var(--matcha-color-primary); }
|
|
193
|
+
.matcha-radio-input {
|
|
194
|
+
box-shadow: 0 0 0 2px var(--matcha-color-text-label) inset;
|
|
195
|
+
&:checked {
|
|
196
|
+
box-shadow: 0 0 0 2px var(--matcha-color-primary) inset,
|
|
197
|
+
0 0 0 5px var(--matcha-color-surface) inset,
|
|
198
|
+
0 0 0 9px var(--matcha-color-primary) inset;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// ── success ────────────────────────────────────────────────────────
|
|
204
|
+
&[color="success"] {
|
|
205
|
+
.matcha-radio-touch { color: var(--matcha-color-success); }
|
|
206
|
+
.matcha-radio-input {
|
|
207
|
+
box-shadow: 0 0 0 2px var(--matcha-color-text-label) inset;
|
|
208
|
+
&:checked {
|
|
209
|
+
box-shadow: 0 0 0 2px var(--matcha-color-success) inset,
|
|
210
|
+
0 0 0 5px var(--matcha-color-surface) inset,
|
|
211
|
+
0 0 0 9px var(--matcha-color-success) inset;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// ── warn ───────────────────────────────────────────────────────────
|
|
217
|
+
&[color="warn"] {
|
|
218
|
+
.matcha-radio-touch { color: var(--matcha-color-warn); }
|
|
219
|
+
.matcha-radio-input {
|
|
220
|
+
box-shadow: 0 0 0 2px var(--matcha-color-text-label) inset;
|
|
221
|
+
&:checked {
|
|
222
|
+
box-shadow: 0 0 0 2px var(--matcha-color-warn) inset,
|
|
223
|
+
0 0 0 5px var(--matcha-color-surface) inset,
|
|
224
|
+
0 0 0 9px var(--matcha-color-warn) inset;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// ── danger ─────────────────────────────────────────────────────────
|
|
230
|
+
&[color="danger"] {
|
|
231
|
+
.matcha-radio-touch { color: var(--matcha-color-danger); }
|
|
232
|
+
.matcha-radio-input {
|
|
233
|
+
box-shadow: 0 0 0 2px var(--matcha-color-text-label) inset;
|
|
234
|
+
&:checked {
|
|
235
|
+
box-shadow: 0 0 0 2px var(--matcha-color-danger) inset,
|
|
236
|
+
0 0 0 5px var(--matcha-color-surface) inset,
|
|
237
|
+
0 0 0 9px var(--matcha-color-danger) inset;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// ── info ───────────────────────────────────────────────────────────
|
|
243
|
+
&[color="info"] {
|
|
244
|
+
.matcha-radio-touch { color: var(--matcha-color-info); }
|
|
245
|
+
.matcha-radio-input {
|
|
246
|
+
box-shadow: 0 0 0 2px var(--matcha-color-text-label) inset;
|
|
247
|
+
&:checked {
|
|
248
|
+
box-shadow: 0 0 0 2px var(--matcha-color-info) inset,
|
|
249
|
+
0 0 0 5px var(--matcha-color-surface) inset,
|
|
250
|
+
0 0 0 9px var(--matcha-color-info) inset;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// ── Error state (Figma DSV3 State=Error) — sobrescreve cor do glyph ──
|
|
256
|
+
&.matcha-radio-error,
|
|
257
|
+
&[error="true"] {
|
|
258
|
+
.matcha-radio-input {
|
|
259
|
+
box-shadow: 0 0 0 2px var(--matcha-color-danger) inset !important;
|
|
260
|
+
|
|
261
|
+
&:checked {
|
|
262
|
+
box-shadow: 0 0 0 2px var(--matcha-color-danger) inset,
|
|
263
|
+
0 0 0 5px var(--matcha-color-surface) inset,
|
|
264
|
+
0 0 0 9px var(--matcha-color-danger) inset !important;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// ── Disabled (Figma DSV3 opacity 0.5) ────────────────────────────────
|
|
270
|
+
&[disabled] {
|
|
271
|
+
opacity: var(--matcha-opacity-option-disabled, 0.5);
|
|
272
|
+
|
|
273
|
+
.matcha-radio-input {
|
|
274
|
+
box-shadow: 0 0 0 2px var(--matcha-color-interaction-disabled-fg) inset;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.matcha-radio-label,
|
|
278
|
+
.matcha-radio-description,
|
|
279
|
+
.matcha-radio-hint {
|
|
280
|
+
color: var(--matcha-color-interaction-disabled-fg);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// ── Focused — outline 2px primary no touch (não desloca layout) ──────
|
|
285
|
+
.matcha-radio-input:focus-visible {
|
|
286
|
+
outline: none;
|
|
287
|
+
}
|
|
288
|
+
.matcha-radio-touch:has(.matcha-radio-input:focus-visible) {
|
|
289
|
+
outline: var(--matcha-state-focus-ring-width, 2px) solid var(--matcha-color-primary);
|
|
290
|
+
outline-offset: calc(-1 * var(--matcha-state-focus-ring-width, 2px));
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// ── Forced colors ──
|
|
296
|
+
@media (forced-colors: active) {
|
|
297
|
+
matcha-radio {
|
|
298
|
+
.matcha-radio-circle {
|
|
299
|
+
border: 1px solid CanvasText !important;
|
|
300
|
+
background: Canvas !important;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
&.is-checked .matcha-radio-circle::after,
|
|
304
|
+
&[checked] .matcha-radio-circle::after {
|
|
305
|
+
background: Highlight !important;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.matcha-radio-touch:has(.matcha-radio-input:focus-visible) {
|
|
309
|
+
outline: 2px solid CanvasText !important;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
&.is-disabled,
|
|
313
|
+
&[disabled] {
|
|
314
|
+
opacity: 0.5;
|
|
315
|
+
.matcha-radio-circle { border-color: GrayText !important; }
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// ── Print ──
|
|
321
|
+
@media print {
|
|
322
|
+
matcha-radio .matcha-radio-circle {
|
|
323
|
+
border: 1px solid currentColor !important;
|
|
324
|
+
}
|
|
325
|
+
}
|