@inchurch/matcha-theme 21.3.3 → 22.0.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.
- package/abstracts/_colors.scss +236 -229
- package/abstracts/_elevation.scss +108 -108
- package/abstracts/_functions.scss +321 -321
- package/abstracts/_media-breakpoint.scss +26 -26
- package/abstracts/_theme-api.scss +219 -219
- package/abstracts/_typography.scss +128 -128
- package/base/_reset.scss +445 -432
- package/components/app-page-header.scss +260 -260
- package/components/matcha-accordion.scss +293 -293
- package/components/matcha-audio-player.scss +31 -31
- package/components/matcha-autocomplete.scss +145 -145
- package/components/matcha-avatar.scss +440 -301
- package/components/matcha-badge.scss +120 -120
- package/components/matcha-breadcrumb.scss +231 -231
- package/components/matcha-button-toggle.scss +384 -384
- package/components/matcha-buttons.scss +913 -913
- package/components/matcha-calendar.scss +218 -218
- package/components/matcha-cards.scss +230 -230
- package/components/matcha-chart-card.scss +53 -53
- package/components/matcha-checkbox.scss +255 -255
- package/components/matcha-chip.scss +292 -292
- package/components/matcha-color-pick.scss +34 -34
- package/components/matcha-command-palette.scss +316 -316
- package/components/matcha-crop.scss +406 -406
- 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 +471 -471
- package/components/matcha-flag.scss +103 -103
- package/components/matcha-footer.scss +91 -91
- package/components/matcha-form-field.scss +606 -606
- 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 +316 -316
- package/components/matcha-icon.scss +98 -98
- package/components/matcha-image.scss +61 -61
- 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 +581 -581
- package/components/matcha-notification.scss +413 -413
- package/components/matcha-option.scss +170 -170
- package/components/matcha-page-builder.scss +4196 -4196
- package/components/matcha-paginator.scss +689 -689
- package/components/matcha-panel.scss +194 -194
- package/components/matcha-profile-card.scss +50 -50
- package/components/matcha-progress-bar.scss +313 -313
- package/components/matcha-radio.scss +320 -320
- 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 +667 -667
- package/components/matcha-skeleton.scss +155 -155
- 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-status-pill.scss +38 -18
- package/components/matcha-stepper.scss +376 -376
- package/components/matcha-table-cell.scss +74 -41
- package/components/matcha-table.scss +579 -578
- package/components/matcha-tabs.scss +600 -600
- package/components/matcha-text-editor.scss +105 -105
- package/components/matcha-time.scss +33 -33
- package/components/matcha-timepicker.scss +13 -13
- package/components/matcha-toolbar.scss +359 -359
- package/components/matcha-tooltip.scss +224 -224
- package/components/matcha-tree-view.scss +257 -212
- package/layout/matcha-page-layout.scss +778 -778
- package/main.scss +329 -329
- package/package.json +1 -1
- package/tokens/_animations-tokens.scss +37 -37
- package/tokens/_breakpoints-tokens.scss +35 -35
- package/tokens/_color-tokens.scss +274 -261
- package/tokens/_elevation-tokens.scss +33 -33
- package/tokens/_emit-tokens.scss +324 -324
- 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,376 +1,376 @@
|
|
|
1
|
-
@use "sass:map";
|
|
2
|
-
|
|
3
|
-
// =============================================================================
|
|
4
|
-
// matcha-drawer.scss — Drawer / Sidenav (over, push, side)
|
|
5
|
-
// =============================================================================
|
|
6
|
-
|
|
7
|
-
// ── Animations ──────────────────────────────────────────────────────────────
|
|
8
|
-
|
|
9
|
-
@keyframes matcha-drawer-backdrop-in {
|
|
10
|
-
from { opacity: 0; }
|
|
11
|
-
to { opacity: 1; }
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@keyframes matcha-drawer-backdrop-out {
|
|
15
|
-
from { opacity: 1; }
|
|
16
|
-
to { opacity: 0; }
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Shake feedback — disparado quando ESC/backdrop click são bloqueados por
|
|
20
|
-
// disableClose=true. Sinaliza visualmente que a ação foi capturada mas
|
|
21
|
-
// bloqueada (em vez de silent fail).
|
|
22
|
-
@keyframes matcha-drawer-shake {
|
|
23
|
-
0%, 100% { transform: translate3d(0, 0, 0); }
|
|
24
|
-
20% { transform: translate3d(-8px, 0, 0); }
|
|
25
|
-
40% { transform: translate3d(8px, 0, 0); }
|
|
26
|
-
60% { transform: translate3d(-4px, 0, 0); }
|
|
27
|
-
80% { transform: translate3d(4px, 0, 0); }
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@media (prefers-reduced-motion: reduce) {
|
|
31
|
-
matcha-drawer,
|
|
32
|
-
.matcha-drawer-backdrop,
|
|
33
|
-
matcha-drawer-content {
|
|
34
|
-
animation: none !important;
|
|
35
|
-
transition: none !important;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// ── Forced colors (Windows High Contrast) ──
|
|
40
|
-
// rgba/blur/shadow somem; usar Canvas/CanvasText/SelectedItem.
|
|
41
|
-
@media (forced-colors: active) {
|
|
42
|
-
matcha-drawer {
|
|
43
|
-
border: 1px solid CanvasText !important;
|
|
44
|
-
background: Canvas !important;
|
|
45
|
-
box-shadow: none !important;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.matcha-drawer-backdrop {
|
|
49
|
-
background: rgba(0, 0, 0, 0.7) !important;
|
|
50
|
-
backdrop-filter: none !important;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
matcha-drawer:focus-visible {
|
|
54
|
-
outline: 2px solid CanvasText !important;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// ── Reduced transparency ──
|
|
59
|
-
// Backdrop blur 4px → solid 85% pra usuários com dificuldade de ler sobre blur.
|
|
60
|
-
@media (prefers-reduced-transparency: reduce) {
|
|
61
|
-
.matcha-drawer-backdrop {
|
|
62
|
-
background: rgba(0, 0, 0, 0.85) !important;
|
|
63
|
-
backdrop-filter: none !important;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// ── Print ──
|
|
68
|
-
// Drawer + chrome flutuante somem em impressão.
|
|
69
|
-
@media print {
|
|
70
|
-
matcha-drawer,
|
|
71
|
-
.matcha-drawer-backdrop {
|
|
72
|
-
display: none !important;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
matcha-drawer-content {
|
|
76
|
-
margin: 0 !important;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// =============================================================================
|
|
81
|
-
// Theme mixin
|
|
82
|
-
// =============================================================================
|
|
83
|
-
|
|
84
|
-
@mixin matcha-drawer-theme($theme) {
|
|
85
|
-
|
|
86
|
-
// ── Container ──
|
|
87
|
-
matcha-drawer-container {
|
|
88
|
-
display: block;
|
|
89
|
-
position: relative;
|
|
90
|
-
z-index: 1;
|
|
91
|
-
box-sizing: border-box;
|
|
92
|
-
-webkit-overflow-scrolling: touch;
|
|
93
|
-
overflow: hidden;
|
|
94
|
-
background-color: var(--matcha-color-bg);
|
|
95
|
-
color: var(--matcha-color-fg);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// ── Backdrop ──
|
|
99
|
-
.matcha-drawer-backdrop {
|
|
100
|
-
position: absolute;
|
|
101
|
-
inset: 0;
|
|
102
|
-
z-index: 3;
|
|
103
|
-
display: block;
|
|
104
|
-
visibility: hidden;
|
|
105
|
-
cursor: pointer;
|
|
106
|
-
// Figma matcha/overlay Type=Drawer: scrim 30% + blur 4px
|
|
107
|
-
background-color: var(--matcha-scrim-drawer, rgba(0, 0, 0, 0.3));
|
|
108
|
-
backdrop-filter: blur(var(--matcha-scrim-drawer-blur, 4px));
|
|
109
|
-
opacity: 0;
|
|
110
|
-
transition: opacity var(--matcha-duration-normal, 200ms) ease,
|
|
111
|
-
visibility var(--matcha-duration-normal, 200ms) ease;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// Backdrop visible
|
|
115
|
-
matcha-drawer-container.matcha-drawer-container-has-open .matcha-drawer-backdrop {
|
|
116
|
-
visibility: visible;
|
|
117
|
-
opacity: 1;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// ── Content container ──
|
|
121
|
-
.matcha-drawer-content-container {
|
|
122
|
-
position: relative;
|
|
123
|
-
z-index: 0;
|
|
124
|
-
display: block;
|
|
125
|
-
height: 100%;
|
|
126
|
-
overflow: auto;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// ── Drawer ──
|
|
130
|
-
matcha-drawer {
|
|
131
|
-
display: flex;
|
|
132
|
-
flex-direction: column;
|
|
133
|
-
position: absolute;
|
|
134
|
-
top: 0;
|
|
135
|
-
bottom: 0;
|
|
136
|
-
// Default position=start ancora à esquerda. End/bottom override via .matcha-drawer-end/.matcha-drawer-bottom.
|
|
137
|
-
// Sem o explícito, layouts que usam o drawer dentro de containers flexíveis renderizam fora da posição esperada.
|
|
138
|
-
left: 0;
|
|
139
|
-
z-index: 10;
|
|
140
|
-
outline: 0;
|
|
141
|
-
box-sizing: border-box;
|
|
142
|
-
// Drawer raiz não scrolla — só o body slot scrolla (overflow-y:auto).
|
|
143
|
-
// Header/footer são flex-shrink:0 e ficam fixos.
|
|
144
|
-
overflow: hidden;
|
|
145
|
-
// Defensivo: drawer nunca extrapola viewport mesmo com [width] absurdo.
|
|
146
|
-
max-width: 100vw;
|
|
147
|
-
transform: translate3d(-100%, 0, 0);
|
|
148
|
-
visibility: hidden;
|
|
149
|
-
// Width inclusa pra animar resize dinâmico (responsive token, [width] bound).
|
|
150
|
-
transition: transform var(--matcha-duration-normal, 200ms) cubic-bezier(0.16, 1, 0.3, 1),
|
|
151
|
-
visibility var(--matcha-duration-normal, 200ms) ease,
|
|
152
|
-
width var(--matcha-duration-normal, 200ms) cubic-bezier(0.16, 1, 0.3, 1);
|
|
153
|
-
background-color: var(--matcha-color-surface);
|
|
154
|
-
color: var(--matcha-color-fg);
|
|
155
|
-
pointer-events: auto;
|
|
156
|
-
|
|
157
|
-
// Shadow inline (3 stacked) — Figma DSV3 spec exato pro drawer.
|
|
158
|
-
// Não usa --matcha-shadow-3 token porque o Figma drawer também usa inline
|
|
159
|
-
// (não bound a um effect style). Side/push modes removem via override.
|
|
160
|
-
box-shadow:
|
|
161
|
-
0 0 1px rgba(0, 0, 0, 0.08),
|
|
162
|
-
0 4px 16px rgba(0, 0, 0, 0.12),
|
|
163
|
-
0 16px 48px rgba(0, 0, 0, 0.16);
|
|
164
|
-
|
|
165
|
-
// Borda da edge só aparece no dark (var = 0/transparent no light, sem mudar layout).
|
|
166
|
-
border-right: var(--matcha-drawer-border);
|
|
167
|
-
|
|
168
|
-
// Position end (right) — overrides left:0 default
|
|
169
|
-
&.matcha-drawer-end {
|
|
170
|
-
left: auto;
|
|
171
|
-
right: 0;
|
|
172
|
-
transform: translate3d(100%, 0, 0);
|
|
173
|
-
|
|
174
|
-
border-right: 0 solid transparent;
|
|
175
|
-
border-left: var(--matcha-drawer-border);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// Position bottom (bottom sheet)
|
|
179
|
-
&.matcha-drawer-bottom {
|
|
180
|
-
top: auto;
|
|
181
|
-
left: 0;
|
|
182
|
-
right: 0;
|
|
183
|
-
bottom: 0;
|
|
184
|
-
width: 100%;
|
|
185
|
-
// 90% do container (relative ao matcha-drawer-container parent).
|
|
186
|
-
// Em produção (container = viewport via 100vh), == 90vh efetivo.
|
|
187
|
-
// Em playground/embed (container 360px), == 324px e respeita o frame.
|
|
188
|
-
// min() com fallback 90vh garante comportamento se parent for auto.
|
|
189
|
-
max-height: min(90vh, 90%);
|
|
190
|
-
border-radius: var(--matcha-radius-xl, 16px) var(--matcha-radius-xl, 16px) 0 0;
|
|
191
|
-
transform: translate3d(0, 100%, 0);
|
|
192
|
-
|
|
193
|
-
border-right: 0 solid transparent;
|
|
194
|
-
border-top: var(--matcha-drawer-border);
|
|
195
|
-
|
|
196
|
-
// safe-area-inset-bottom — iPhone X+ home indicator não cobre footer.
|
|
197
|
-
// Aplicado no slot footer porque é onde botões/CTAs ficam.
|
|
198
|
-
.matcha-drawer__slot--footer {
|
|
199
|
-
padding-block-end: max(var(--drawer-pad-y), env(safe-area-inset-bottom, var(--drawer-pad-y)));
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// ── Drag handle (bottom sheet drag-to-dismiss) ──
|
|
204
|
-
// Real elemento (não pseudo) pra capturar pointer events. Renderiza só
|
|
205
|
-
// em position=bottom. 32×4 visual + 32×24 hit area via pad pra touch.
|
|
206
|
-
.matcha-drawer__handle {
|
|
207
|
-
display: none;
|
|
208
|
-
flex-shrink: 0;
|
|
209
|
-
width: 100%;
|
|
210
|
-
padding: var(--matcha-space-100, 8px) 0;
|
|
211
|
-
cursor: grab;
|
|
212
|
-
touch-action: none; // bloqueia scroll-pan vertical default no handle
|
|
213
|
-
user-select: none;
|
|
214
|
-
|
|
215
|
-
&::before {
|
|
216
|
-
content: '';
|
|
217
|
-
display: block;
|
|
218
|
-
width: 32px;
|
|
219
|
-
height: 4px;
|
|
220
|
-
margin: 0 auto;
|
|
221
|
-
border-radius: var(--matcha-radius-sm, 2px);
|
|
222
|
-
background: var(--matcha-color-hint, var(--matcha-color-text-muted));
|
|
223
|
-
opacity: 0.3;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
&:active {
|
|
227
|
-
cursor: grabbing;
|
|
228
|
-
|
|
229
|
-
&::before { opacity: 0.5; }
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
&.matcha-drawer-bottom .matcha-drawer__handle {
|
|
234
|
-
display: block;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// Drag em andamento — desabilita transition pra seguir o dedo 1:1.
|
|
238
|
-
&.matcha-drawer--dragging {
|
|
239
|
-
transition: none !important;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// Opened state
|
|
243
|
-
&.matcha-drawer-opened {
|
|
244
|
-
transform: translate3d(0, 0, 0);
|
|
245
|
-
visibility: visible;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// Mode: over — floats above content with shadow
|
|
249
|
-
&.matcha-drawer-over {
|
|
250
|
-
z-index: 15;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// Mode: side — fixed, no shadow, border via surface-border token (DSV3 canônico).
|
|
254
|
-
&.matcha-drawer-side {
|
|
255
|
-
z-index: 10;
|
|
256
|
-
border-right: var(--matcha-border-hairline, 1px) solid var(--matcha-color-surface-border, var(--matcha-color-border));
|
|
257
|
-
box-shadow: none;
|
|
258
|
-
|
|
259
|
-
&.matcha-drawer-end {
|
|
260
|
-
border-right: none;
|
|
261
|
-
border-left: var(--matcha-border-hairline, 1px) solid var(--matcha-color-surface-border, var(--matcha-color-border));
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
// Mode: push — pushes content, border only.
|
|
266
|
-
&.matcha-drawer-push {
|
|
267
|
-
border-right: var(--matcha-border-hairline, 1px) solid var(--matcha-color-surface-border, var(--matcha-color-border));
|
|
268
|
-
box-shadow: none;
|
|
269
|
-
|
|
270
|
-
&.matcha-drawer-end {
|
|
271
|
-
border-right: none;
|
|
272
|
-
border-left: var(--matcha-border-hairline, 1px) solid var(--matcha-color-surface-border, var(--matcha-color-border));
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
// Shake state — feedback visual quando ESC/backdrop bloqueados por disableClose.
|
|
277
|
-
// Animation roda 400ms, sobrepondo o transform: translate3d(0,0,0) do .matcha-drawer-opened.
|
|
278
|
-
// Após terminar, transform volta pro estado .matcha-drawer-opened normal.
|
|
279
|
-
&.matcha-drawer-shake {
|
|
280
|
-
animation: matcha-drawer-shake 400ms ease-in-out;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
// ── Slot architecture (header / body / footer) ──
|
|
284
|
-
//
|
|
285
|
-
// CSS vars (consumer override sem !important):
|
|
286
|
-
// --drawer-pad-x / --drawer-pad-y → padding uniforme de cada slot
|
|
287
|
-
// --drawer-divider → border entre slots (default mostra)
|
|
288
|
-
//
|
|
289
|
-
// Cada slot tem padding UNIFORME (não asymmetric). Header e footer
|
|
290
|
-
// ganham border-bottom/top respectivamente — separação visual clara
|
|
291
|
-
// sem depender de gaps assimétricos. Pattern canônico Material/Antd.
|
|
292
|
-
//
|
|
293
|
-
// Defaults simétricos 20/20 (calibração 2026-05-08): alinha com card md
|
|
294
|
-
// e segue padrão DS moderno (Material 16, shadcn 24, Notion 16 — 20 é o
|
|
295
|
-
// sweet spot). Antes era 24/20 assimétrico — quirky e sem motivo claro.
|
|
296
|
-
--drawer-pad-x: var(--matcha-space-250, 20px);
|
|
297
|
-
--drawer-pad-y: var(--matcha-space-250, 20px);
|
|
298
|
-
--drawer-divider: var(--matcha-border-hairline, 1px) solid var(--matcha-color-surface-border, rgba(255, 255, 255, 0.12));
|
|
299
|
-
|
|
300
|
-
.matcha-drawer__slot {
|
|
301
|
-
display: flex;
|
|
302
|
-
flex-direction: column;
|
|
303
|
-
min-width: 0;
|
|
304
|
-
|
|
305
|
-
// Hide vazio (Chrome 105+/Safari 15.4+/FF 121+).
|
|
306
|
-
&:not(:has(*)) {
|
|
307
|
-
display: none;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
// Header — fixo no topo (não scrolla com body). Border-bottom separa do body.
|
|
312
|
-
// Elemento projetado pelo consumer recebe flex row via `> *`.
|
|
313
|
-
.matcha-drawer__slot--header {
|
|
314
|
-
flex: 0 0 auto;
|
|
315
|
-
padding: var(--drawer-pad-y) var(--drawer-pad-x);
|
|
316
|
-
border-bottom: var(--drawer-divider);
|
|
317
|
-
color: var(--matcha-color-fg);
|
|
318
|
-
|
|
319
|
-
> * {
|
|
320
|
-
display: flex;
|
|
321
|
-
flex-direction: row;
|
|
322
|
-
align-items: center;
|
|
323
|
-
justify-content: space-between;
|
|
324
|
-
gap: var(--matcha-space-150, 12px);
|
|
325
|
-
width: 100%;
|
|
326
|
-
min-width: 0;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
// Body — cresce e scrolla quando overflow.
|
|
331
|
-
.matcha-drawer__slot--body {
|
|
332
|
-
flex: 1 1 auto;
|
|
333
|
-
overflow-y: auto;
|
|
334
|
-
overflow-x: hidden;
|
|
335
|
-
padding: var(--drawer-pad-y) var(--drawer-pad-x);
|
|
336
|
-
color: var(--matcha-color-fg);
|
|
337
|
-
-webkit-overflow-scrolling: touch;
|
|
338
|
-
gap: var(--matcha-space-150, 12px);
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
// Footer — fixo no bottom. Border-top separa do body.
|
|
342
|
-
.matcha-drawer__slot--footer {
|
|
343
|
-
flex: 0 0 auto;
|
|
344
|
-
padding: var(--drawer-pad-y) var(--drawer-pad-x);
|
|
345
|
-
border-top: var(--drawer-divider);
|
|
346
|
-
|
|
347
|
-
> * {
|
|
348
|
-
display: flex;
|
|
349
|
-
flex-direction: row;
|
|
350
|
-
align-items: center;
|
|
351
|
-
justify-content: flex-end;
|
|
352
|
-
gap: var(--matcha-space-150, 12px);
|
|
353
|
-
width: 100%;
|
|
354
|
-
min-width: 0;
|
|
355
|
-
flex-wrap: wrap;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
// ── Drawer content (main page) ──
|
|
362
|
-
matcha-drawer-content {
|
|
363
|
-
position: relative;
|
|
364
|
-
z-index: 1;
|
|
365
|
-
display: block;
|
|
366
|
-
height: 100%;
|
|
367
|
-
overflow: auto;
|
|
368
|
-
transition: margin var(--matcha-duration-normal, 200ms) cubic-bezier(0.16, 1, 0.3, 1);
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
// ── Focus ring ──
|
|
372
|
-
matcha-drawer:focus-visible {
|
|
373
|
-
outline: var(--matcha-state-focus-ring-width, 2px) solid var(--matcha-color-accent);
|
|
374
|
-
outline-offset: var(--matcha-state-focus-ring-offset, 2px);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// matcha-drawer.scss — Drawer / Sidenav (over, push, side)
|
|
5
|
+
// =============================================================================
|
|
6
|
+
|
|
7
|
+
// ── Animations ──────────────────────────────────────────────────────────────
|
|
8
|
+
|
|
9
|
+
@keyframes matcha-drawer-backdrop-in {
|
|
10
|
+
from { opacity: 0; }
|
|
11
|
+
to { opacity: 1; }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@keyframes matcha-drawer-backdrop-out {
|
|
15
|
+
from { opacity: 1; }
|
|
16
|
+
to { opacity: 0; }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Shake feedback — disparado quando ESC/backdrop click são bloqueados por
|
|
20
|
+
// disableClose=true. Sinaliza visualmente que a ação foi capturada mas
|
|
21
|
+
// bloqueada (em vez de silent fail).
|
|
22
|
+
@keyframes matcha-drawer-shake {
|
|
23
|
+
0%, 100% { transform: translate3d(0, 0, 0); }
|
|
24
|
+
20% { transform: translate3d(-8px, 0, 0); }
|
|
25
|
+
40% { transform: translate3d(8px, 0, 0); }
|
|
26
|
+
60% { transform: translate3d(-4px, 0, 0); }
|
|
27
|
+
80% { transform: translate3d(4px, 0, 0); }
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media (prefers-reduced-motion: reduce) {
|
|
31
|
+
matcha-drawer,
|
|
32
|
+
.matcha-drawer-backdrop,
|
|
33
|
+
matcha-drawer-content {
|
|
34
|
+
animation: none !important;
|
|
35
|
+
transition: none !important;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// ── Forced colors (Windows High Contrast) ──
|
|
40
|
+
// rgba/blur/shadow somem; usar Canvas/CanvasText/SelectedItem.
|
|
41
|
+
@media (forced-colors: active) {
|
|
42
|
+
matcha-drawer {
|
|
43
|
+
border: 1px solid CanvasText !important;
|
|
44
|
+
background: Canvas !important;
|
|
45
|
+
box-shadow: none !important;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.matcha-drawer-backdrop {
|
|
49
|
+
background: rgba(0, 0, 0, 0.7) !important;
|
|
50
|
+
backdrop-filter: none !important;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
matcha-drawer:focus-visible {
|
|
54
|
+
outline: 2px solid CanvasText !important;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// ── Reduced transparency ──
|
|
59
|
+
// Backdrop blur 4px → solid 85% pra usuários com dificuldade de ler sobre blur.
|
|
60
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
61
|
+
.matcha-drawer-backdrop {
|
|
62
|
+
background: rgba(0, 0, 0, 0.85) !important;
|
|
63
|
+
backdrop-filter: none !important;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ── Print ──
|
|
68
|
+
// Drawer + chrome flutuante somem em impressão.
|
|
69
|
+
@media print {
|
|
70
|
+
matcha-drawer,
|
|
71
|
+
.matcha-drawer-backdrop {
|
|
72
|
+
display: none !important;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
matcha-drawer-content {
|
|
76
|
+
margin: 0 !important;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// =============================================================================
|
|
81
|
+
// Theme mixin
|
|
82
|
+
// =============================================================================
|
|
83
|
+
|
|
84
|
+
@mixin matcha-drawer-theme($theme) {
|
|
85
|
+
|
|
86
|
+
// ── Container ──
|
|
87
|
+
matcha-drawer-container {
|
|
88
|
+
display: block;
|
|
89
|
+
position: relative;
|
|
90
|
+
z-index: 1;
|
|
91
|
+
box-sizing: border-box;
|
|
92
|
+
-webkit-overflow-scrolling: touch;
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
background-color: var(--matcha-color-bg);
|
|
95
|
+
color: var(--matcha-color-fg);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// ── Backdrop ──
|
|
99
|
+
.matcha-drawer-backdrop {
|
|
100
|
+
position: absolute;
|
|
101
|
+
inset: 0;
|
|
102
|
+
z-index: 3;
|
|
103
|
+
display: block;
|
|
104
|
+
visibility: hidden;
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
// Figma matcha/overlay Type=Drawer: scrim 30% + blur 4px
|
|
107
|
+
background-color: var(--matcha-scrim-drawer, rgba(0, 0, 0, 0.3));
|
|
108
|
+
backdrop-filter: blur(var(--matcha-scrim-drawer-blur, 4px));
|
|
109
|
+
opacity: 0;
|
|
110
|
+
transition: opacity var(--matcha-duration-normal, 200ms) ease,
|
|
111
|
+
visibility var(--matcha-duration-normal, 200ms) ease;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Backdrop visible
|
|
115
|
+
matcha-drawer-container.matcha-drawer-container-has-open .matcha-drawer-backdrop {
|
|
116
|
+
visibility: visible;
|
|
117
|
+
opacity: 1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// ── Content container ──
|
|
121
|
+
.matcha-drawer-content-container {
|
|
122
|
+
position: relative;
|
|
123
|
+
z-index: 0;
|
|
124
|
+
display: block;
|
|
125
|
+
height: 100%;
|
|
126
|
+
overflow: auto;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// ── Drawer ──
|
|
130
|
+
matcha-drawer {
|
|
131
|
+
display: flex;
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
position: absolute;
|
|
134
|
+
top: 0;
|
|
135
|
+
bottom: 0;
|
|
136
|
+
// Default position=start ancora à esquerda. End/bottom override via .matcha-drawer-end/.matcha-drawer-bottom.
|
|
137
|
+
// Sem o explícito, layouts que usam o drawer dentro de containers flexíveis renderizam fora da posição esperada.
|
|
138
|
+
left: 0;
|
|
139
|
+
z-index: 10;
|
|
140
|
+
outline: 0;
|
|
141
|
+
box-sizing: border-box;
|
|
142
|
+
// Drawer raiz não scrolla — só o body slot scrolla (overflow-y:auto).
|
|
143
|
+
// Header/footer são flex-shrink:0 e ficam fixos.
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
// Defensivo: drawer nunca extrapola viewport mesmo com [width] absurdo.
|
|
146
|
+
max-width: 100vw;
|
|
147
|
+
transform: translate3d(-100%, 0, 0);
|
|
148
|
+
visibility: hidden;
|
|
149
|
+
// Width inclusa pra animar resize dinâmico (responsive token, [width] bound).
|
|
150
|
+
transition: transform var(--matcha-duration-normal, 200ms) cubic-bezier(0.16, 1, 0.3, 1),
|
|
151
|
+
visibility var(--matcha-duration-normal, 200ms) ease,
|
|
152
|
+
width var(--matcha-duration-normal, 200ms) cubic-bezier(0.16, 1, 0.3, 1);
|
|
153
|
+
background-color: var(--matcha-color-surface);
|
|
154
|
+
color: var(--matcha-color-fg);
|
|
155
|
+
pointer-events: auto;
|
|
156
|
+
|
|
157
|
+
// Shadow inline (3 stacked) — Figma DSV3 spec exato pro drawer.
|
|
158
|
+
// Não usa --matcha-shadow-3 token porque o Figma drawer também usa inline
|
|
159
|
+
// (não bound a um effect style). Side/push modes removem via override.
|
|
160
|
+
box-shadow:
|
|
161
|
+
0 0 1px rgba(0, 0, 0, 0.08),
|
|
162
|
+
0 4px 16px rgba(0, 0, 0, 0.12),
|
|
163
|
+
0 16px 48px rgba(0, 0, 0, 0.16);
|
|
164
|
+
|
|
165
|
+
// Borda da edge só aparece no dark (var = 0/transparent no light, sem mudar layout).
|
|
166
|
+
border-right: var(--matcha-drawer-border);
|
|
167
|
+
|
|
168
|
+
// Position end (right) — overrides left:0 default
|
|
169
|
+
&.matcha-drawer-end {
|
|
170
|
+
left: auto;
|
|
171
|
+
right: 0;
|
|
172
|
+
transform: translate3d(100%, 0, 0);
|
|
173
|
+
|
|
174
|
+
border-right: 0 solid transparent;
|
|
175
|
+
border-left: var(--matcha-drawer-border);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Position bottom (bottom sheet)
|
|
179
|
+
&.matcha-drawer-bottom {
|
|
180
|
+
top: auto;
|
|
181
|
+
left: 0;
|
|
182
|
+
right: 0;
|
|
183
|
+
bottom: 0;
|
|
184
|
+
width: 100%;
|
|
185
|
+
// 90% do container (relative ao matcha-drawer-container parent).
|
|
186
|
+
// Em produção (container = viewport via 100vh), == 90vh efetivo.
|
|
187
|
+
// Em playground/embed (container 360px), == 324px e respeita o frame.
|
|
188
|
+
// min() com fallback 90vh garante comportamento se parent for auto.
|
|
189
|
+
max-height: min(90vh, 90%);
|
|
190
|
+
border-radius: var(--matcha-radius-xl, 16px) var(--matcha-radius-xl, 16px) 0 0;
|
|
191
|
+
transform: translate3d(0, 100%, 0);
|
|
192
|
+
|
|
193
|
+
border-right: 0 solid transparent;
|
|
194
|
+
border-top: var(--matcha-drawer-border);
|
|
195
|
+
|
|
196
|
+
// safe-area-inset-bottom — iPhone X+ home indicator não cobre footer.
|
|
197
|
+
// Aplicado no slot footer porque é onde botões/CTAs ficam.
|
|
198
|
+
.matcha-drawer__slot--footer {
|
|
199
|
+
padding-block-end: max(var(--drawer-pad-y), env(safe-area-inset-bottom, var(--drawer-pad-y)));
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// ── Drag handle (bottom sheet drag-to-dismiss) ──
|
|
204
|
+
// Real elemento (não pseudo) pra capturar pointer events. Renderiza só
|
|
205
|
+
// em position=bottom. 32×4 visual + 32×24 hit area via pad pra touch.
|
|
206
|
+
.matcha-drawer__handle {
|
|
207
|
+
display: none;
|
|
208
|
+
flex-shrink: 0;
|
|
209
|
+
width: 100%;
|
|
210
|
+
padding: var(--matcha-space-100, 8px) 0;
|
|
211
|
+
cursor: grab;
|
|
212
|
+
touch-action: none; // bloqueia scroll-pan vertical default no handle
|
|
213
|
+
user-select: none;
|
|
214
|
+
|
|
215
|
+
&::before {
|
|
216
|
+
content: '';
|
|
217
|
+
display: block;
|
|
218
|
+
width: 32px;
|
|
219
|
+
height: 4px;
|
|
220
|
+
margin: 0 auto;
|
|
221
|
+
border-radius: var(--matcha-radius-sm, 2px);
|
|
222
|
+
background: var(--matcha-color-hint, var(--matcha-color-text-muted));
|
|
223
|
+
opacity: 0.3;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
&:active {
|
|
227
|
+
cursor: grabbing;
|
|
228
|
+
|
|
229
|
+
&::before { opacity: 0.5; }
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
&.matcha-drawer-bottom .matcha-drawer__handle {
|
|
234
|
+
display: block;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Drag em andamento — desabilita transition pra seguir o dedo 1:1.
|
|
238
|
+
&.matcha-drawer--dragging {
|
|
239
|
+
transition: none !important;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// Opened state
|
|
243
|
+
&.matcha-drawer-opened {
|
|
244
|
+
transform: translate3d(0, 0, 0);
|
|
245
|
+
visibility: visible;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Mode: over — floats above content with shadow
|
|
249
|
+
&.matcha-drawer-over {
|
|
250
|
+
z-index: 15;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Mode: side — fixed, no shadow, border via surface-border token (DSV3 canônico).
|
|
254
|
+
&.matcha-drawer-side {
|
|
255
|
+
z-index: 10;
|
|
256
|
+
border-right: var(--matcha-border-hairline, 1px) solid var(--matcha-color-surface-border, var(--matcha-color-border));
|
|
257
|
+
box-shadow: none;
|
|
258
|
+
|
|
259
|
+
&.matcha-drawer-end {
|
|
260
|
+
border-right: none;
|
|
261
|
+
border-left: var(--matcha-border-hairline, 1px) solid var(--matcha-color-surface-border, var(--matcha-color-border));
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Mode: push — pushes content, border only.
|
|
266
|
+
&.matcha-drawer-push {
|
|
267
|
+
border-right: var(--matcha-border-hairline, 1px) solid var(--matcha-color-surface-border, var(--matcha-color-border));
|
|
268
|
+
box-shadow: none;
|
|
269
|
+
|
|
270
|
+
&.matcha-drawer-end {
|
|
271
|
+
border-right: none;
|
|
272
|
+
border-left: var(--matcha-border-hairline, 1px) solid var(--matcha-color-surface-border, var(--matcha-color-border));
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// Shake state — feedback visual quando ESC/backdrop bloqueados por disableClose.
|
|
277
|
+
// Animation roda 400ms, sobrepondo o transform: translate3d(0,0,0) do .matcha-drawer-opened.
|
|
278
|
+
// Após terminar, transform volta pro estado .matcha-drawer-opened normal.
|
|
279
|
+
&.matcha-drawer-shake {
|
|
280
|
+
animation: matcha-drawer-shake 400ms ease-in-out;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// ── Slot architecture (header / body / footer) ──
|
|
284
|
+
//
|
|
285
|
+
// CSS vars (consumer override sem !important):
|
|
286
|
+
// --drawer-pad-x / --drawer-pad-y → padding uniforme de cada slot
|
|
287
|
+
// --drawer-divider → border entre slots (default mostra)
|
|
288
|
+
//
|
|
289
|
+
// Cada slot tem padding UNIFORME (não asymmetric). Header e footer
|
|
290
|
+
// ganham border-bottom/top respectivamente — separação visual clara
|
|
291
|
+
// sem depender de gaps assimétricos. Pattern canônico Material/Antd.
|
|
292
|
+
//
|
|
293
|
+
// Defaults simétricos 20/20 (calibração 2026-05-08): alinha com card md
|
|
294
|
+
// e segue padrão DS moderno (Material 16, shadcn 24, Notion 16 — 20 é o
|
|
295
|
+
// sweet spot). Antes era 24/20 assimétrico — quirky e sem motivo claro.
|
|
296
|
+
--drawer-pad-x: var(--matcha-space-250, 20px);
|
|
297
|
+
--drawer-pad-y: var(--matcha-space-250, 20px);
|
|
298
|
+
--drawer-divider: var(--matcha-border-hairline, 1px) solid var(--matcha-color-surface-border, rgba(255, 255, 255, 0.12));
|
|
299
|
+
|
|
300
|
+
.matcha-drawer__slot {
|
|
301
|
+
display: flex;
|
|
302
|
+
flex-direction: column;
|
|
303
|
+
min-width: 0;
|
|
304
|
+
|
|
305
|
+
// Hide vazio (Chrome 105+/Safari 15.4+/FF 121+).
|
|
306
|
+
&:not(:has(*)) {
|
|
307
|
+
display: none;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Header — fixo no topo (não scrolla com body). Border-bottom separa do body.
|
|
312
|
+
// Elemento projetado pelo consumer recebe flex row via `> *`.
|
|
313
|
+
.matcha-drawer__slot--header {
|
|
314
|
+
flex: 0 0 auto;
|
|
315
|
+
padding: var(--drawer-pad-y) var(--drawer-pad-x);
|
|
316
|
+
border-bottom: var(--drawer-divider);
|
|
317
|
+
color: var(--matcha-color-fg);
|
|
318
|
+
|
|
319
|
+
> * {
|
|
320
|
+
display: flex;
|
|
321
|
+
flex-direction: row;
|
|
322
|
+
align-items: center;
|
|
323
|
+
justify-content: space-between;
|
|
324
|
+
gap: var(--matcha-space-150, 12px);
|
|
325
|
+
width: 100%;
|
|
326
|
+
min-width: 0;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// Body — cresce e scrolla quando overflow.
|
|
331
|
+
.matcha-drawer__slot--body {
|
|
332
|
+
flex: 1 1 auto;
|
|
333
|
+
overflow-y: auto;
|
|
334
|
+
overflow-x: hidden;
|
|
335
|
+
padding: var(--drawer-pad-y) var(--drawer-pad-x);
|
|
336
|
+
color: var(--matcha-color-fg);
|
|
337
|
+
-webkit-overflow-scrolling: touch;
|
|
338
|
+
gap: var(--matcha-space-150, 12px);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// Footer — fixo no bottom. Border-top separa do body.
|
|
342
|
+
.matcha-drawer__slot--footer {
|
|
343
|
+
flex: 0 0 auto;
|
|
344
|
+
padding: var(--drawer-pad-y) var(--drawer-pad-x);
|
|
345
|
+
border-top: var(--drawer-divider);
|
|
346
|
+
|
|
347
|
+
> * {
|
|
348
|
+
display: flex;
|
|
349
|
+
flex-direction: row;
|
|
350
|
+
align-items: center;
|
|
351
|
+
justify-content: flex-end;
|
|
352
|
+
gap: var(--matcha-space-150, 12px);
|
|
353
|
+
width: 100%;
|
|
354
|
+
min-width: 0;
|
|
355
|
+
flex-wrap: wrap;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
// ── Drawer content (main page) ──
|
|
362
|
+
matcha-drawer-content {
|
|
363
|
+
position: relative;
|
|
364
|
+
z-index: 1;
|
|
365
|
+
display: block;
|
|
366
|
+
height: 100%;
|
|
367
|
+
overflow: auto;
|
|
368
|
+
transition: margin var(--matcha-duration-normal, 200ms) cubic-bezier(0.16, 1, 0.3, 1);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// ── Focus ring ──
|
|
372
|
+
matcha-drawer:focus-visible {
|
|
373
|
+
outline: var(--matcha-state-focus-ring-width, 2px) solid var(--matcha-color-accent);
|
|
374
|
+
outline-offset: var(--matcha-state-focus-ring-offset, 2px);
|
|
375
|
+
}
|
|
376
|
+
}
|