@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,578 +1,579 @@
|
|
|
1
|
-
@use "sass:map";
|
|
2
|
-
|
|
3
|
-
// =============================================================================
|
|
4
|
-
// matcha-table — `<table matcha-table>` directive (1:1 Figma DSV3 15641:275)
|
|
5
|
-
//
|
|
6
|
-
// API canon:
|
|
7
|
-
// <table matcha-table size="comfortable" striped hover bordered stickyHeader
|
|
8
|
-
// [stickyStart]="N" [stickyEnd]="N" [loading]="isLoading">
|
|
9
|
-
// <thead><tr><th>...</th></tr></thead>
|
|
10
|
-
// <tbody><tr><td>...</td></tr></tbody>
|
|
11
|
-
// </table>
|
|
12
|
-
//
|
|
13
|
-
// Companion directives (a11y automática):
|
|
14
|
-
// [matcha-table-sortable] em <th> — aria-sort + tabindex + keyboard
|
|
15
|
-
// [matcha-table-clickable] em <tr> — tabindex + Enter/Space + (rowClick)
|
|
16
|
-
//
|
|
17
|
-
// Helpers CSS-only:
|
|
18
|
-
// td.numeric → tabular-nums
|
|
19
|
-
// td.truncate → ellipsis (text overflow)
|
|
20
|
-
// td[data-
|
|
21
|
-
// tr.equal/.plus/.minus → variant semantic accent (cor via CSS var)
|
|
22
|
-
// tr.child-item → indent + accent esmaecido
|
|
23
|
-
// tr.is-selected → highlight
|
|
24
|
-
// =============================================================================
|
|
25
|
-
|
|
26
|
-
@mixin matcha-table-modern($theme) {
|
|
27
|
-
|
|
28
|
-
// ═══════════════════════════════════════════════════════════════════════
|
|
29
|
-
// CSS vars do componente — única fonte de verdade. ZERO literal hardcoded
|
|
30
|
-
// fora deste bloco. Consumer override qualquer um no escopo do <table>.
|
|
31
|
-
// ═══════════════════════════════════════════════════════════════════════
|
|
32
|
-
table.matcha-table {
|
|
33
|
-
// ── Dimensions ────────────────────────────────────────────────────────
|
|
34
|
-
// Calibrado pra density moderna (Stripe/Linear/Notion). Comfortable era 52
|
|
35
|
-
// antes — apertado em telas wide. 58px equilibra densidade × respiro.
|
|
36
|
-
--matcha-table-cell-height-compact: var(--matcha-space-500, 40px);
|
|
37
|
-
--matcha-table-cell-height-comfortable: 58px;
|
|
38
|
-
--matcha-table-cell-height-spacious: var(--matcha-space-800, 64px);
|
|
39
|
-
// Padding uniforme L/R — assimétrico cria sensação de "primeira coluna
|
|
40
|
-
// afastada do resto". 16px ambos lados é canon moderno.
|
|
41
|
-
--matcha-table-cell-padding-x-left: var(--matcha-space-200, 16px);
|
|
42
|
-
--matcha-table-cell-padding-x-right: var(--matcha-space-200, 16px);
|
|
43
|
-
--matcha-table-cell-min-width: var(--matcha-space-1500, 120px);
|
|
44
|
-
--matcha-table-paginator-spacing: var(--matcha-space-300, 24px);
|
|
45
|
-
|
|
46
|
-
// ── Typography (modern density Stripe/Linear) ─────────────────────────
|
|
47
|
-
--matcha-table-font-size: 13px;
|
|
48
|
-
--matcha-table-font-line-height: 18px;
|
|
49
|
-
--matcha-table-header-font-size: var(--matcha-text-body-sm, 12px);
|
|
50
|
-
--matcha-table-header-font-line-height: var(--matcha-leading-body-sm, 16px);
|
|
51
|
-
--matcha-table-header-letter-spacing: 0.04em;
|
|
52
|
-
|
|
53
|
-
// ── Borders / radius ──────────────────────────────────────────────────
|
|
54
|
-
--matcha-table-border-color: var(--matcha-color-interaction-disabled-border);
|
|
55
|
-
--matcha-table-border-header: var(--matcha-border-thin, 2px);
|
|
56
|
-
--matcha-table-border-row: var(--matcha-border-hairline, 1px);
|
|
57
|
-
--matcha-table-bordered-radius: var(--matcha-radius-md, 4px);
|
|
58
|
-
|
|
59
|
-
// ── Surface colors ────────────────────────────────────────────────────
|
|
60
|
-
--matcha-table-cell-bg: var(--matcha-color-surface-card);
|
|
61
|
-
--matcha-table-row-bg-selected: var(--matcha-color-accent-alpha-12,
|
|
62
|
-
rgba(var(--matcha-color-accent), 0.12));
|
|
63
|
-
--matcha-table-row-bg-striped: var(--matcha-color-surface-card-alt,
|
|
64
|
-
rgba(var(--matcha-color-fg), 0.02));
|
|
65
|
-
// Hover NÃO usa surface-table-row-hover token (tá próximo demais de surface-card
|
|
66
|
-
// em dark e fica imperceptível). Calibrado pra delta visível mesmo sobre stripe.
|
|
67
|
-
// CSS custom property values são TEXTO LITERAL pro Sass — fn calls Sass
|
|
68
|
-
// dentro NÃO são avaliadas. Precisa interpolação `#{}` pra forçar Sass a
|
|
69
|
-
// evaluar `var(--matcha-color-fg)` ANTES do output. Sem isso, o valor sai
|
|
70
|
-
// literal no bundle (ex: `rgba(var(--matcha-color-fg), 0.12)`) e o browser
|
|
71
|
-
// descarta como invalid CSS (= chevron invisível, hover sem cor, etc).
|
|
72
|
-
--matcha-table-row-bg-hover: rgba(var(--matcha-color-fg), 0.12);
|
|
73
|
-
--matcha-table-row-bg-hover-striped: rgba(var(--matcha-color-fg), 0.18);
|
|
74
|
-
--matcha-table-header-bg-hover: rgba(var(--matcha-color-fg), 0.10);
|
|
75
|
-
|
|
76
|
-
// ── Sort indicator colors ─────────────────────────────────────────────
|
|
77
|
-
// Inactive usa alpha 0.45 no foreground — claramente VISÍVEL como "ali tem
|
|
78
|
-
// sort", sem competir com texto do header. Hover/ativo passa pra accent full.
|
|
79
|
-
--matcha-table-sort-icon-color: rgba(var(--matcha-color-fg), 0.45);
|
|
80
|
-
--matcha-table-sort-icon-color-active: var(--matcha-color-accent);
|
|
81
|
-
--matcha-table-sort-icon-size: var(--matcha-space-250, 20px);
|
|
82
|
-
|
|
83
|
-
// ── Empty cell placeholder ────────────────────────────────────────────
|
|
84
|
-
--matcha-table-empty-cell-text: var(--matcha-color-text-muted,
|
|
85
|
-
rgba(var(--matcha-color-fg), 0.5));
|
|
86
|
-
|
|
87
|
-
// ── Variant accent (semantic row) ─────────────────────────────────────
|
|
88
|
-
--matcha-table-variant-accent-width: var(--matcha-space-050, 4px);
|
|
89
|
-
--matcha-table-row-accent-child-opacity: 0.5;
|
|
90
|
-
--matcha-table-selected-accent-width: var(--matcha-border-thin, 2px);
|
|
91
|
-
--matcha-table-selected-accent-color: var(--matcha-color-accent);
|
|
92
|
-
|
|
93
|
-
// ── Column width hints (utility classes col-*) ────────────────────────
|
|
94
|
-
--matcha-table-col-checkbox-width: var(--matcha-space-600, 48px);
|
|
95
|
-
--matcha-table-col-id-width: var(--matcha-space-1000, 80px);
|
|
96
|
-
--matcha-table-col-narrow-width: var(--matcha-space-1500, 120px);
|
|
97
|
-
--matcha-table-col-medium-width: var(--matcha-space-2500, 200px);
|
|
98
|
-
|
|
99
|
-
// ── States / animations ───────────────────────────────────────────────
|
|
100
|
-
--matcha-table-disabled-opacity: var(--matcha-state-disabled-opacity, 0.5);
|
|
101
|
-
--matcha-table-loading-pulse-duration: var(--matcha-duration-slow, 1500ms);
|
|
102
|
-
--matcha-table-loading-pulse-opacity-min: 0.5;
|
|
103
|
-
--matcha-table-transition-duration: var(--matcha-duration-instant, 80ms);
|
|
104
|
-
--matcha-table-focus-ring-width: var(--matcha-state-focus-ring-width, 2px);
|
|
105
|
-
--matcha-table-focus-ring-color: var(--matcha-color-accent);
|
|
106
|
-
|
|
107
|
-
// ── Empty state row (matcha-table-empty directive) ────────────────────
|
|
108
|
-
--matcha-table-empty-padding-y: var(--matcha-space-500, 40px);
|
|
109
|
-
--matcha-table-empty-padding-x: var(--matcha-space-300, 24px);
|
|
110
|
-
|
|
111
|
-
// ── Resize handle (matcha-table-resizable directive) ──────────────────
|
|
112
|
-
--matcha-table-resize-handle-width: var(--matcha-space-100, 8px);
|
|
113
|
-
--matcha-table-resize-indicator-width: var(--matcha-border-hairline, 1px);
|
|
114
|
-
--matcha-table-resize-indicator-height: 50%;
|
|
115
|
-
--matcha-table-resize-indicator-top: 25%;
|
|
116
|
-
|
|
117
|
-
// ── Sticky cols shadow ────────────────────────────────────────────────
|
|
118
|
-
--matcha-table-sticky-shadow-offset: var(--matcha-space-100, 8px);
|
|
119
|
-
--matcha-table-sticky-shadow-blur: var(--matcha-space-200, 16px);
|
|
120
|
-
--matcha-table-sticky-shadow-color: var(--matcha-color-elevation-shadow, #000);
|
|
121
|
-
--matcha-table-sticky-shadow-alpha: 16%;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// ── Base — display table nativo + typography via vars ─────────────────
|
|
125
|
-
table.matcha-table {
|
|
126
|
-
display: table;
|
|
127
|
-
width: 100%;
|
|
128
|
-
border-collapse: collapse;
|
|
129
|
-
border-spacing: 0;
|
|
130
|
-
font-family: var(--matcha-font-family);
|
|
131
|
-
font-size: var(--matcha-table-font-size);
|
|
132
|
-
line-height: var(--matcha-table-font-line-height);
|
|
133
|
-
font-weight: var(--matcha-weight-regular, 400);
|
|
134
|
-
color: var(--matcha-color-text-secondary,
|
|
135
|
-
color-mix(in srgb, var(--matcha-color-fg) 70%, transparent));
|
|
136
|
-
|
|
137
|
-
// ── Header cells (text/primary, border-bottom 2px, height 64) ────────
|
|
138
|
-
thead th {
|
|
139
|
-
box-sizing: border-box;
|
|
140
|
-
height: var(--matcha-table-cell-height-comfortable);
|
|
141
|
-
min-width: var(--matcha-table-cell-min-width);
|
|
142
|
-
padding: 0
|
|
143
|
-
var(--matcha-table-cell-padding-x-right)
|
|
144
|
-
0
|
|
145
|
-
var(--matcha-table-cell-padding-x-left);
|
|
146
|
-
background: var(--matcha-table-cell-bg);
|
|
147
|
-
color: var(--matcha-color-text-primary,
|
|
148
|
-
var(--matcha-color-fg));
|
|
149
|
-
// Header menor que body — hierarquia "metadado" vs "conteúdo".
|
|
150
|
-
font-size: var(--matcha-table-header-font-size);
|
|
151
|
-
line-height: var(--matcha-table-header-font-line-height);
|
|
152
|
-
font-weight: var(--matcha-weight-semibold, 600);
|
|
153
|
-
letter-spacing: var(--matcha-table-header-letter-spacing);
|
|
154
|
-
text-align: left;
|
|
155
|
-
vertical-align: middle;
|
|
156
|
-
border-bottom: var(--matcha-table-border-header) solid
|
|
157
|
-
var(--matcha-table-border-color);
|
|
158
|
-
|
|
159
|
-
// Alinhamento —
|
|
160
|
-
|
|
161
|
-
&[data-alinhamento="
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
//
|
|
175
|
-
//
|
|
176
|
-
//
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
//
|
|
180
|
-
//
|
|
181
|
-
//
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
//
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
//
|
|
205
|
-
//
|
|
206
|
-
//
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
padding-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
&[data-alinhamento="
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
font-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
&.col-
|
|
287
|
-
&.col-
|
|
288
|
-
&.col-
|
|
289
|
-
|
|
290
|
-
//
|
|
291
|
-
// lado
|
|
292
|
-
//
|
|
293
|
-
//
|
|
294
|
-
//
|
|
295
|
-
//
|
|
296
|
-
//
|
|
297
|
-
//
|
|
298
|
-
//
|
|
299
|
-
//
|
|
300
|
-
//
|
|
301
|
-
//
|
|
302
|
-
//
|
|
303
|
-
//
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
>
|
|
311
|
-
>
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
//
|
|
325
|
-
//
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
//
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
&.matcha-table-striped
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
//
|
|
365
|
-
//
|
|
366
|
-
//
|
|
367
|
-
//
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
--matcha-table-row-bg-hover
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
//
|
|
378
|
-
//
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
//
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
&[data-size="compact"]
|
|
413
|
-
&[data-size="
|
|
414
|
-
&[data-size="spacious"]
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
//
|
|
418
|
-
//
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
&[data-sticky-start]
|
|
458
|
-
&[data-sticky-
|
|
459
|
-
&[data-sticky-end]
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
//
|
|
463
|
-
//
|
|
464
|
-
//
|
|
465
|
-
tr
|
|
466
|
-
tr.
|
|
467
|
-
tr.
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
tbody tr
|
|
471
|
-
tbody tr.
|
|
472
|
-
tbody tr.
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
//
|
|
507
|
-
|
|
508
|
-
tbody
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
//
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
//
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
//
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
//
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
table.matcha-table
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
}
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// matcha-table — `<table matcha-table>` directive (1:1 Figma DSV3 15641:275)
|
|
5
|
+
//
|
|
6
|
+
// API canon:
|
|
7
|
+
// <table matcha-table size="comfortable" striped hover bordered stickyHeader
|
|
8
|
+
// [stickyStart]="N" [stickyEnd]="N" [loading]="isLoading">
|
|
9
|
+
// <thead><tr><th>...</th></tr></thead>
|
|
10
|
+
// <tbody><tr><td>...</td></tr></tbody>
|
|
11
|
+
// </table>
|
|
12
|
+
//
|
|
13
|
+
// Companion directives (a11y automática):
|
|
14
|
+
// [matcha-table-sortable] em <th> — aria-sort + tabindex + keyboard
|
|
15
|
+
// [matcha-table-clickable] em <tr> — tabindex + Enter/Space + (rowClick)
|
|
16
|
+
//
|
|
17
|
+
// Helpers CSS-only:
|
|
18
|
+
// td.numeric → tabular-nums
|
|
19
|
+
// td.truncate → ellipsis (text overflow)
|
|
20
|
+
// td[data-align] → alinhamento (data-alinhamento / td.text-{center,right} deprecated)
|
|
21
|
+
// tr.equal/.plus/.minus → variant semantic accent (cor via CSS var)
|
|
22
|
+
// tr.child-item → indent + accent esmaecido
|
|
23
|
+
// tr.is-selected → highlight
|
|
24
|
+
// =============================================================================
|
|
25
|
+
|
|
26
|
+
@mixin matcha-table-modern($theme) {
|
|
27
|
+
|
|
28
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
29
|
+
// CSS vars do componente — única fonte de verdade. ZERO literal hardcoded
|
|
30
|
+
// fora deste bloco. Consumer override qualquer um no escopo do <table>.
|
|
31
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
32
|
+
table.matcha-table {
|
|
33
|
+
// ── Dimensions ────────────────────────────────────────────────────────
|
|
34
|
+
// Calibrado pra density moderna (Stripe/Linear/Notion). Comfortable era 52
|
|
35
|
+
// antes — apertado em telas wide. 58px equilibra densidade × respiro.
|
|
36
|
+
--matcha-table-cell-height-compact: var(--matcha-space-500, 40px);
|
|
37
|
+
--matcha-table-cell-height-comfortable: 58px;
|
|
38
|
+
--matcha-table-cell-height-spacious: var(--matcha-space-800, 64px);
|
|
39
|
+
// Padding uniforme L/R — assimétrico cria sensação de "primeira coluna
|
|
40
|
+
// afastada do resto". 16px ambos lados é canon moderno.
|
|
41
|
+
--matcha-table-cell-padding-x-left: var(--matcha-space-200, 16px);
|
|
42
|
+
--matcha-table-cell-padding-x-right: var(--matcha-space-200, 16px);
|
|
43
|
+
--matcha-table-cell-min-width: var(--matcha-space-1500, 120px);
|
|
44
|
+
--matcha-table-paginator-spacing: var(--matcha-space-300, 24px);
|
|
45
|
+
|
|
46
|
+
// ── Typography (modern density Stripe/Linear) ─────────────────────────
|
|
47
|
+
--matcha-table-font-size: 13px;
|
|
48
|
+
--matcha-table-font-line-height: 18px;
|
|
49
|
+
--matcha-table-header-font-size: var(--matcha-text-body-sm, 12px);
|
|
50
|
+
--matcha-table-header-font-line-height: var(--matcha-leading-body-sm, 16px);
|
|
51
|
+
--matcha-table-header-letter-spacing: 0.04em;
|
|
52
|
+
|
|
53
|
+
// ── Borders / radius ──────────────────────────────────────────────────
|
|
54
|
+
--matcha-table-border-color: var(--matcha-color-interaction-disabled-border);
|
|
55
|
+
--matcha-table-border-header: var(--matcha-border-thin, 2px);
|
|
56
|
+
--matcha-table-border-row: var(--matcha-border-hairline, 1px);
|
|
57
|
+
--matcha-table-bordered-radius: var(--matcha-radius-md, 4px);
|
|
58
|
+
|
|
59
|
+
// ── Surface colors ────────────────────────────────────────────────────
|
|
60
|
+
--matcha-table-cell-bg: var(--matcha-color-surface-card);
|
|
61
|
+
--matcha-table-row-bg-selected: var(--matcha-color-accent-alpha-12,
|
|
62
|
+
rgba(var(--matcha-color-accent), 0.12));
|
|
63
|
+
--matcha-table-row-bg-striped: var(--matcha-color-surface-card-alt,
|
|
64
|
+
rgba(var(--matcha-color-fg), 0.02));
|
|
65
|
+
// Hover NÃO usa surface-table-row-hover token (tá próximo demais de surface-card
|
|
66
|
+
// em dark e fica imperceptível). Calibrado pra delta visível mesmo sobre stripe.
|
|
67
|
+
// CSS custom property values são TEXTO LITERAL pro Sass — fn calls Sass
|
|
68
|
+
// dentro NÃO são avaliadas. Precisa interpolação `#{}` pra forçar Sass a
|
|
69
|
+
// evaluar `var(--matcha-color-fg)` ANTES do output. Sem isso, o valor sai
|
|
70
|
+
// literal no bundle (ex: `rgba(var(--matcha-color-fg), 0.12)`) e o browser
|
|
71
|
+
// descarta como invalid CSS (= chevron invisível, hover sem cor, etc).
|
|
72
|
+
--matcha-table-row-bg-hover: rgba(var(--matcha-color-fg), 0.12);
|
|
73
|
+
--matcha-table-row-bg-hover-striped: rgba(var(--matcha-color-fg), 0.18);
|
|
74
|
+
--matcha-table-header-bg-hover: rgba(var(--matcha-color-fg), 0.10);
|
|
75
|
+
|
|
76
|
+
// ── Sort indicator colors ─────────────────────────────────────────────
|
|
77
|
+
// Inactive usa alpha 0.45 no foreground — claramente VISÍVEL como "ali tem
|
|
78
|
+
// sort", sem competir com texto do header. Hover/ativo passa pra accent full.
|
|
79
|
+
--matcha-table-sort-icon-color: rgba(var(--matcha-color-fg), 0.45);
|
|
80
|
+
--matcha-table-sort-icon-color-active: var(--matcha-color-accent);
|
|
81
|
+
--matcha-table-sort-icon-size: var(--matcha-space-250, 20px);
|
|
82
|
+
|
|
83
|
+
// ── Empty cell placeholder ────────────────────────────────────────────
|
|
84
|
+
--matcha-table-empty-cell-text: var(--matcha-color-text-muted,
|
|
85
|
+
rgba(var(--matcha-color-fg), 0.5));
|
|
86
|
+
|
|
87
|
+
// ── Variant accent (semantic row) ─────────────────────────────────────
|
|
88
|
+
--matcha-table-variant-accent-width: var(--matcha-space-050, 4px);
|
|
89
|
+
--matcha-table-row-accent-child-opacity: 0.5;
|
|
90
|
+
--matcha-table-selected-accent-width: var(--matcha-border-thin, 2px);
|
|
91
|
+
--matcha-table-selected-accent-color: var(--matcha-color-accent);
|
|
92
|
+
|
|
93
|
+
// ── Column width hints (utility classes col-*) ────────────────────────
|
|
94
|
+
--matcha-table-col-checkbox-width: var(--matcha-space-600, 48px);
|
|
95
|
+
--matcha-table-col-id-width: var(--matcha-space-1000, 80px);
|
|
96
|
+
--matcha-table-col-narrow-width: var(--matcha-space-1500, 120px);
|
|
97
|
+
--matcha-table-col-medium-width: var(--matcha-space-2500, 200px);
|
|
98
|
+
|
|
99
|
+
// ── States / animations ───────────────────────────────────────────────
|
|
100
|
+
--matcha-table-disabled-opacity: var(--matcha-state-disabled-opacity, 0.5);
|
|
101
|
+
--matcha-table-loading-pulse-duration: var(--matcha-duration-slow, 1500ms);
|
|
102
|
+
--matcha-table-loading-pulse-opacity-min: 0.5;
|
|
103
|
+
--matcha-table-transition-duration: var(--matcha-duration-instant, 80ms);
|
|
104
|
+
--matcha-table-focus-ring-width: var(--matcha-state-focus-ring-width, 2px);
|
|
105
|
+
--matcha-table-focus-ring-color: var(--matcha-color-accent);
|
|
106
|
+
|
|
107
|
+
// ── Empty state row (matcha-table-empty directive) ────────────────────
|
|
108
|
+
--matcha-table-empty-padding-y: var(--matcha-space-500, 40px);
|
|
109
|
+
--matcha-table-empty-padding-x: var(--matcha-space-300, 24px);
|
|
110
|
+
|
|
111
|
+
// ── Resize handle (matcha-table-resizable directive) ──────────────────
|
|
112
|
+
--matcha-table-resize-handle-width: var(--matcha-space-100, 8px);
|
|
113
|
+
--matcha-table-resize-indicator-width: var(--matcha-border-hairline, 1px);
|
|
114
|
+
--matcha-table-resize-indicator-height: 50%;
|
|
115
|
+
--matcha-table-resize-indicator-top: 25%;
|
|
116
|
+
|
|
117
|
+
// ── Sticky cols shadow ────────────────────────────────────────────────
|
|
118
|
+
--matcha-table-sticky-shadow-offset: var(--matcha-space-100, 8px);
|
|
119
|
+
--matcha-table-sticky-shadow-blur: var(--matcha-space-200, 16px);
|
|
120
|
+
--matcha-table-sticky-shadow-color: var(--matcha-color-elevation-shadow, #000);
|
|
121
|
+
--matcha-table-sticky-shadow-alpha: 16%;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// ── Base — display table nativo + typography via vars ─────────────────
|
|
125
|
+
table.matcha-table {
|
|
126
|
+
display: table;
|
|
127
|
+
width: 100%;
|
|
128
|
+
border-collapse: collapse;
|
|
129
|
+
border-spacing: 0;
|
|
130
|
+
font-family: var(--matcha-font-family);
|
|
131
|
+
font-size: var(--matcha-table-font-size);
|
|
132
|
+
line-height: var(--matcha-table-font-line-height);
|
|
133
|
+
font-weight: var(--matcha-weight-regular, 400);
|
|
134
|
+
color: var(--matcha-color-text-secondary,
|
|
135
|
+
color-mix(in srgb, var(--matcha-color-fg) 70%, transparent));
|
|
136
|
+
|
|
137
|
+
// ── Header cells (text/primary, border-bottom 2px, height 64) ────────
|
|
138
|
+
thead th {
|
|
139
|
+
box-sizing: border-box;
|
|
140
|
+
height: var(--matcha-table-cell-height-comfortable);
|
|
141
|
+
min-width: var(--matcha-table-cell-min-width);
|
|
142
|
+
padding: 0
|
|
143
|
+
var(--matcha-table-cell-padding-x-right)
|
|
144
|
+
0
|
|
145
|
+
var(--matcha-table-cell-padding-x-left);
|
|
146
|
+
background: var(--matcha-table-cell-bg);
|
|
147
|
+
color: var(--matcha-color-text-primary,
|
|
148
|
+
var(--matcha-color-fg));
|
|
149
|
+
// Header menor que body — hierarquia "metadado" vs "conteúdo".
|
|
150
|
+
font-size: var(--matcha-table-header-font-size);
|
|
151
|
+
line-height: var(--matcha-table-header-font-line-height);
|
|
152
|
+
font-weight: var(--matcha-weight-semibold, 600);
|
|
153
|
+
letter-spacing: var(--matcha-table-header-letter-spacing);
|
|
154
|
+
text-align: left;
|
|
155
|
+
vertical-align: middle;
|
|
156
|
+
border-bottom: var(--matcha-table-border-header) solid
|
|
157
|
+
var(--matcha-table-border-color);
|
|
158
|
+
|
|
159
|
+
// Alinhamento — data-align é o canon DSV3; data-alinhamento + utility
|
|
160
|
+
// classes seguem aceitos (deprecated, remoção em ciclo futuro)
|
|
161
|
+
&[data-align="center"], &[data-alinhamento="center"], &.text-center { text-align: center; }
|
|
162
|
+
&[data-align="right"], &[data-alinhamento="right"], &.text-right { text-align: right; }
|
|
163
|
+
|
|
164
|
+
// ── Sortable hint ([matcha-table-sortable] directive seta os attrs) ──
|
|
165
|
+
&[data-sortable] {
|
|
166
|
+
cursor: pointer;
|
|
167
|
+
user-select: none;
|
|
168
|
+
// SEMPRE reserva espaço pro chevron (mesmo inativo) — chevron entra/sai
|
|
169
|
+
// só via opacity. Sem padding condicional → texto NÃO desloca no hover.
|
|
170
|
+
padding-right: calc(var(--matcha-table-cell-padding-x-right) +
|
|
171
|
+
var(--matcha-table-sort-icon-size));
|
|
172
|
+
position: relative;
|
|
173
|
+
|
|
174
|
+
// Hover NÃO muda bg do header — bg-change era o que fazia o user
|
|
175
|
+
// perceber "movimento" quando o chevron entrava ao mesmo tempo.
|
|
176
|
+
// Manter header estático no hover, só chevron aparece com opacity.
|
|
177
|
+
// Cursor pointer + chevron fade já comunicam interatividade.
|
|
178
|
+
|
|
179
|
+
// Sort indicators — SVG 1:1 com `matcha/icon/arrow` (figma-icons.ts).
|
|
180
|
+
// Estado inativo (none) = INVISÍVEL (opacity 0). Aparece no hover do header
|
|
181
|
+
// com opacity faded, full quando ativo (asc/desc). Pattern canon Stripe/Linear:
|
|
182
|
+
// sortable em todas as colunas, mas indicador só na que tá ordenando.
|
|
183
|
+
&::after {
|
|
184
|
+
content: '';
|
|
185
|
+
position: absolute;
|
|
186
|
+
right: var(--matcha-table-cell-padding-x-right);
|
|
187
|
+
top: 50%;
|
|
188
|
+
transform: translateY(-50%);
|
|
189
|
+
width: var(--matcha-table-sort-icon-size);
|
|
190
|
+
height: var(--matcha-table-sort-icon-size);
|
|
191
|
+
background: var(--matcha-table-sort-icon-color);
|
|
192
|
+
transition: background-color var(--matcha-table-transition-duration) linear;
|
|
193
|
+
mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M11 7.82499L6.1 12.725C5.9 12.925 5.66667 13.0208 5.4 13.0125C5.13333 13.0042 4.9 12.9 4.7 12.7C4.51667 12.5 4.42083 12.2667 4.4125 12C4.40417 11.7333 4.5 11.5 4.7 11.3L11.3 4.69999C11.4 4.59999 11.5083 4.52915 11.625 4.48749C11.7417 4.44582 11.8667 4.42499 12 4.42499C12.1333 4.42499 12.2583 4.44582 12.375 4.48749C12.4917 4.52915 12.6 4.59999 12.7 4.69999L19.3 11.3C19.4833 11.4833 19.575 11.7125 19.575 11.9875C19.575 12.2625 19.4833 12.5 19.3 12.7C19.1 12.9 18.8625 13 18.5875 13C18.3125 13 18.075 12.9 17.875 12.7L13 7.82499V19C13 19.2833 12.9042 19.5208 12.7125 19.7125C12.5208 19.9042 12.2833 20 12 20C11.7167 20 11.4792 19.9042 11.2875 19.7125C11.0958 19.5208 11 19.2833 11 19V7.82499Z'/></svg>")
|
|
194
|
+
center/contain no-repeat;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Hover no header — chevron escurece pra foreground full (já visível
|
|
198
|
+
// muted antes via alpha 0.45). Reforça que tá interativo.
|
|
199
|
+
&:hover::after {
|
|
200
|
+
background: var(--matcha-color-text-primary,
|
|
201
|
+
var(--matcha-color-fg));
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Padding-right SEMPRE reserva espaço pro chevron. Antes ajustava
|
|
205
|
+
// condicionalmente (sem padding extra no inativo) — causava text
|
|
206
|
+
// "dançar" 20px ao hover quando padding crescia pra acomodar arrow.
|
|
207
|
+
// Mantém estável: chevron entra via opacity, sem reflow do texto.
|
|
208
|
+
|
|
209
|
+
&[data-sort-direction="asc"]::after {
|
|
210
|
+
mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M11 7.82499L6.1 12.725C5.9 12.925 5.66667 13.0208 5.4 13.0125C5.13333 13.0042 4.9 12.9 4.7 12.7C4.51667 12.5 4.42083 12.2667 4.4125 12C4.40417 11.7333 4.5 11.5 4.7 11.3L11.3 4.69999C11.4 4.59999 11.5083 4.52915 11.625 4.48749C11.7417 4.44582 11.8667 4.42499 12 4.42499C12.1333 4.42499 12.2583 4.44582 12.375 4.48749C12.4917 4.52915 12.6 4.59999 12.7 4.69999L19.3 11.3C19.4833 11.4833 19.575 11.7125 19.575 11.9875C19.575 12.2625 19.4833 12.5 19.3 12.7C19.1 12.9 18.8625 13 18.5875 13C18.3125 13 18.075 12.9 17.875 12.7L13 7.82499V19C13 19.2833 12.9042 19.5208 12.7125 19.7125C12.5208 19.9042 12.2833 20 12 20C11.7167 20 11.4792 19.9042 11.2875 19.7125C11.0958 19.5208 11 19.2833 11 19V7.82499Z'/></svg>")
|
|
211
|
+
center/contain no-repeat;
|
|
212
|
+
background: var(--matcha-table-sort-icon-color-active);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&[data-sort-direction="desc"]::after {
|
|
216
|
+
mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M11 16.175V5C11 4.71667 11.0958 4.47917 11.2875 4.2875C11.4792 4.09583 11.7167 4 12 4C12.2833 4 12.5208 4.09583 12.7125 4.2875C12.9042 4.47917 13 4.71667 13 5V16.175L17.9 11.275C18.1 11.075 18.3333 10.9792 18.6 10.9875C18.8667 10.9958 19.1 11.1 19.3 11.3C19.4833 11.5 19.5792 11.7333 19.5875 12C19.5958 12.2667 19.5 12.5 19.3 12.7L12.7 19.3C12.6 19.4 12.4917 19.4708 12.375 19.5125C12.2583 19.5542 12.1333 19.575 12 19.575C11.8667 19.575 11.7417 19.5542 11.625 19.5125C11.5083 19.4708 11.4 19.4 11.3 19.3L4.7 12.7C4.51667 12.5167 4.425 12.2875 4.425 12.0125C4.425 11.7375 4.51667 11.5 4.7 11.3C4.9 11.1 5.1375 11 5.4125 11C5.6875 11 5.925 11.1 6.125 11.3L11 16.175Z'/></svg>")
|
|
217
|
+
center/contain no-repeat;
|
|
218
|
+
background: var(--matcha-table-sort-icon-color-active);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Header right-aligned com sort — chevron vem ANTES do texto (canon).
|
|
222
|
+
&[data-align="right"], &[data-alinhamento="right"], &.text-right {
|
|
223
|
+
padding-right: var(--matcha-table-cell-padding-x-right);
|
|
224
|
+
padding-left: calc(var(--matcha-table-cell-padding-x-left) +
|
|
225
|
+
var(--matcha-table-sort-icon-size));
|
|
226
|
+
|
|
227
|
+
&::after {
|
|
228
|
+
right: auto;
|
|
229
|
+
left: var(--matcha-table-cell-padding-x-left);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Focus ring quando keyboard-navigated (tabindex via directive).
|
|
234
|
+
&:focus-visible {
|
|
235
|
+
outline: var(--matcha-table-focus-ring-width) solid
|
|
236
|
+
var(--matcha-table-focus-ring-color);
|
|
237
|
+
outline-offset: calc(-1 * var(--matcha-table-focus-ring-width));
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// ── Body cells ────────────────────────────────────────────────────────
|
|
243
|
+
tbody td {
|
|
244
|
+
box-sizing: border-box;
|
|
245
|
+
height: var(--matcha-table-cell-height-comfortable);
|
|
246
|
+
min-width: var(--matcha-table-cell-min-width);
|
|
247
|
+
padding: 0
|
|
248
|
+
var(--matcha-table-cell-padding-x-right)
|
|
249
|
+
0
|
|
250
|
+
var(--matcha-table-cell-padding-x-left);
|
|
251
|
+
background: var(--matcha-table-cell-bg);
|
|
252
|
+
color: var(--matcha-color-text-secondary,
|
|
253
|
+
color-mix(in srgb, var(--matcha-color-fg) 70%, transparent));
|
|
254
|
+
vertical-align: middle;
|
|
255
|
+
border-bottom: var(--matcha-table-border-row) solid
|
|
256
|
+
var(--matcha-table-border-color);
|
|
257
|
+
transition: background-color var(--matcha-table-transition-duration) linear;
|
|
258
|
+
|
|
259
|
+
&[data-align="center"], &[data-alinhamento="center"], &.text-center { text-align: center; }
|
|
260
|
+
&[data-align="right"], &[data-alinhamento="right"], &.text-right { text-align: right; }
|
|
261
|
+
|
|
262
|
+
// Helper: tabular-nums (alinha decimais)
|
|
263
|
+
&[data-numeric], &.numeric {
|
|
264
|
+
font-variant-numeric: tabular-nums;
|
|
265
|
+
font-feature-settings: 'tnum';
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Helper: ellipsis (texto longo)
|
|
269
|
+
&[data-truncate], &.truncate {
|
|
270
|
+
max-width: 0;
|
|
271
|
+
white-space: nowrap;
|
|
272
|
+
overflow: hidden;
|
|
273
|
+
text-overflow: ellipsis;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// Helper: cells vazias preenchidas com "—" muted (canon moderno).
|
|
277
|
+
&:empty::after {
|
|
278
|
+
content: '—';
|
|
279
|
+
color: var(--matcha-table-empty-cell-text);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// ── Column width hints (aplicar em <th> — <td> herda pela coluna) ─────
|
|
284
|
+
thead th,
|
|
285
|
+
tbody td {
|
|
286
|
+
&.col-checkbox { width: var(--matcha-table-col-checkbox-width); text-align: center; }
|
|
287
|
+
&.col-id { width: var(--matcha-table-col-id-width); }
|
|
288
|
+
&.col-narrow { width: var(--matcha-table-col-narrow-width); }
|
|
289
|
+
&.col-medium { width: var(--matcha-table-col-medium-width); }
|
|
290
|
+
// Actions / icon-buttons — shrink-to-content (1% truque de table layout).
|
|
291
|
+
// Children inline horizontal right-aligned (canon Figma: edit/delete lado a
|
|
292
|
+
// lado, não stackados).
|
|
293
|
+
//
|
|
294
|
+
// Importante: `.matcha-button` tem `display: flex` (block-level) que faria
|
|
295
|
+
// os icon-buttons empilharem verticalmente. Override via selector descendant
|
|
296
|
+
// com specificity maior pra forçar inline-flex no contexto de actions cell.
|
|
297
|
+
//
|
|
298
|
+
// Padding-right ZERO no body — icon-button já tem click target padding
|
|
299
|
+
// interno; somar padding ao td empurraria os botões pra ESQUERDA do edge
|
|
300
|
+
// do header "Ações". Alinhamento perfeito: button box-right = cell-right.
|
|
301
|
+
// Actions / icon-buttons — shrink-to-content (1% truque de table layout).
|
|
302
|
+
// Children inline horizontal LEFT-aligned (header text "Ações" alinha
|
|
303
|
+
// naturalmente acima do primeiro ícone). Padding uniforme L/R com resto
|
|
304
|
+
// da table.
|
|
305
|
+
&.col-actions {
|
|
306
|
+
width: 1%;
|
|
307
|
+
white-space: nowrap;
|
|
308
|
+
text-align: left;
|
|
309
|
+
|
|
310
|
+
> .matcha-button,
|
|
311
|
+
> button[matcha-icon-button],
|
|
312
|
+
> * {
|
|
313
|
+
display: inline-flex;
|
|
314
|
+
vertical-align: middle;
|
|
315
|
+
}
|
|
316
|
+
> * + * {
|
|
317
|
+
margin-left: var(--matcha-space-050, 4px);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
// Greedy = espaço residual (default, classe explícita pra documentação).
|
|
321
|
+
&.col-greedy { width: auto; }
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// ── Paginator alinhado após table (convention) ────────────────────────
|
|
325
|
+
// Sem margin-top — paginator gruda no border-bottom da última row.
|
|
326
|
+
// Spacing visual vem dos paddings internos do próprio matcha-paginator.
|
|
327
|
+
.matcha-table-paginator,
|
|
328
|
+
& + matcha-paginator {
|
|
329
|
+
display: block;
|
|
330
|
+
margin-top: 0;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// ── Row clickable ([matcha-table-clickable] directive seta tabindex) ─
|
|
334
|
+
tbody tr.is-clickable {
|
|
335
|
+
cursor: pointer;
|
|
336
|
+
|
|
337
|
+
&:hover td {
|
|
338
|
+
--matcha-table-cell-bg: var(--matcha-table-row-bg-hover);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
&:focus-visible {
|
|
342
|
+
outline: var(--matcha-table-focus-ring-width) solid
|
|
343
|
+
var(--matcha-table-focus-ring-color);
|
|
344
|
+
outline-offset: calc(-1 * var(--matcha-table-focus-ring-width));
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// ── Modifiers via host classes (Angular bind quando striped/hover/etc) ─
|
|
349
|
+
// Striped usa :where() pra dropar specificity do :nth-child — hover vence.
|
|
350
|
+
&.matcha-table-striped tbody tr:where(:nth-child(even)) td {
|
|
351
|
+
--matcha-table-cell-bg: var(--matcha-table-row-bg-striped);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
&.matcha-table-hover tbody tr:hover td {
|
|
355
|
+
--matcha-table-cell-bg: var(--matcha-table-row-bg-hover);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// Stripe-aware hover: row PAR ganha alpha mais forte pra preservar stripe.
|
|
359
|
+
&.matcha-table-striped tbody tr:where(:nth-child(even)).is-clickable:hover td,
|
|
360
|
+
&.matcha-table-striped.matcha-table-hover tbody tr:where(:nth-child(even)):hover td {
|
|
361
|
+
--matcha-table-cell-bg: var(--matcha-table-row-bg-hover-striped);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// Variante de hover accent (input `rowHover="accent"` → classe host
|
|
365
|
+
// `matcha-table-hover-accent`). Rebinda a var de hover no PRÓPRIO `<table>`,
|
|
366
|
+
// com especificidade acima do default — dispensa o consumer de furar o
|
|
367
|
+
// encapsulamento com `::ng-deep`. Substitui o override manual repetido em
|
|
368
|
+
// members/visitors/history/datas-comemorativas.
|
|
369
|
+
&.matcha-table-hover-accent {
|
|
370
|
+
--matcha-table-row-bg-hover: var(--matcha-color-accent-surface-hover);
|
|
371
|
+
--matcha-table-row-bg-hover-striped: var(--matcha-color-accent-surface-hover);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
tbody tr.is-selected td {
|
|
375
|
+
--matcha-table-cell-bg: var(--matcha-table-row-bg-selected);
|
|
376
|
+
}
|
|
377
|
+
// Selected row ganha border-left accent — affordance canon Linear/Notion.
|
|
378
|
+
// No <tr> → não some com stickyStart. Usa ::after pra coexistir com
|
|
379
|
+
// ::before do variant accent sem conflito.
|
|
380
|
+
tbody tr.is-selected {
|
|
381
|
+
position: relative;
|
|
382
|
+
|
|
383
|
+
&::after {
|
|
384
|
+
content: '';
|
|
385
|
+
position: absolute;
|
|
386
|
+
top: 0;
|
|
387
|
+
left: 0;
|
|
388
|
+
width: var(--matcha-table-selected-accent-width);
|
|
389
|
+
height: 100%;
|
|
390
|
+
background: var(--matcha-table-selected-accent-color);
|
|
391
|
+
pointer-events: none;
|
|
392
|
+
z-index: 2; // acima do variant accent (z-index 1)
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// Bordered — box-shadow inset em vez de border real (não clipa shadows
|
|
397
|
+
// externos das sticky cols, que projetam pra fora da <table>).
|
|
398
|
+
&.matcha-table-bordered {
|
|
399
|
+
box-shadow: inset 0 0 0 var(--matcha-table-border-row)
|
|
400
|
+
var(--matcha-table-border-color);
|
|
401
|
+
border-radius: var(--matcha-table-bordered-radius);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
// Sticky header (vertical scroll)
|
|
405
|
+
&.matcha-table-sticky-header thead th {
|
|
406
|
+
position: sticky;
|
|
407
|
+
top: 0;
|
|
408
|
+
z-index: 1;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
// Size variants (data-size cascateia altura)
|
|
412
|
+
&[data-size="compact"] thead th,
|
|
413
|
+
&[data-size="compact"] tbody td { height: var(--matcha-table-cell-height-compact); }
|
|
414
|
+
&[data-size="spacious"] thead th,
|
|
415
|
+
&[data-size="spacious"] tbody td { height: var(--matcha-table-cell-height-spacious); }
|
|
416
|
+
|
|
417
|
+
// ── Sticky columns (start/end) — canon scroll horizontal ──────────────
|
|
418
|
+
// Shadow scroll-edge via color-mix() pra tokenizar — funciona em light
|
|
419
|
+
// E dark. Offsets/blur/cor todos via var.
|
|
420
|
+
@for $i from 1 through 4 {
|
|
421
|
+
&[data-sticky-start="#{$i}"] {
|
|
422
|
+
thead th:nth-child(-n+#{$i}),
|
|
423
|
+
tbody tr td:nth-child(-n+#{$i}) {
|
|
424
|
+
position: sticky;
|
|
425
|
+
z-index: 2;
|
|
426
|
+
background: var(--matcha-table-cell-bg);
|
|
427
|
+
}
|
|
428
|
+
// Última cell do grupo sticky-start projeta shadow scroll-edge.
|
|
429
|
+
thead th:nth-child(#{$i}),
|
|
430
|
+
tbody tr td:nth-child(#{$i}) {
|
|
431
|
+
box-shadow: var(--matcha-table-sticky-shadow-offset) 0
|
|
432
|
+
var(--matcha-table-sticky-shadow-blur)
|
|
433
|
+
calc(-1 * var(--matcha-table-sticky-shadow-offset))
|
|
434
|
+
color-mix(in srgb, var(--matcha-table-sticky-shadow-color)
|
|
435
|
+
var(--matcha-table-sticky-shadow-alpha), transparent);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
&[data-sticky-end="#{$i}"] {
|
|
440
|
+
thead th:nth-last-child(-n+#{$i}),
|
|
441
|
+
tbody tr td:nth-last-child(-n+#{$i}) {
|
|
442
|
+
position: sticky;
|
|
443
|
+
z-index: 2;
|
|
444
|
+
background: var(--matcha-table-cell-bg);
|
|
445
|
+
}
|
|
446
|
+
thead th:nth-last-child(#{$i}),
|
|
447
|
+
tbody tr td:nth-last-child(#{$i}) {
|
|
448
|
+
box-shadow: calc(-1 * var(--matcha-table-sticky-shadow-offset)) 0
|
|
449
|
+
var(--matcha-table-sticky-shadow-blur)
|
|
450
|
+
calc(-1 * var(--matcha-table-sticky-shadow-offset))
|
|
451
|
+
color-mix(in srgb, var(--matcha-table-sticky-shadow-color)
|
|
452
|
+
var(--matcha-table-sticky-shadow-alpha), transparent);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
&[data-sticky-start] thead th:first-child,
|
|
458
|
+
&[data-sticky-start] tbody tr td:first-child { left: 0; }
|
|
459
|
+
&[data-sticky-end] thead th:last-child,
|
|
460
|
+
&[data-sticky-end] tbody tr td:last-child { right: 0; }
|
|
461
|
+
|
|
462
|
+
// ── Variant accent (semantic row coloring) ────────────────────────────
|
|
463
|
+
// Defaults canon Figma DSV3: equal=info, plus=success, minus=danger.
|
|
464
|
+
// Accent vive no <tr> → NÃO some com stickyStart.
|
|
465
|
+
// `position: relative` em <tr> suportado em Chrome 80+, FF 87+, Safari 14+.
|
|
466
|
+
tr.equal { --matcha-table-row-accent-color: var(--matcha-color-info); }
|
|
467
|
+
tr.plus { --matcha-table-row-accent-color: var(--matcha-color-success); }
|
|
468
|
+
tr.minus { --matcha-table-row-accent-color: var(--matcha-color-danger); }
|
|
469
|
+
|
|
470
|
+
tbody tr[data-variant],
|
|
471
|
+
tbody tr.equal,
|
|
472
|
+
tbody tr.plus,
|
|
473
|
+
tbody tr.minus {
|
|
474
|
+
position: relative;
|
|
475
|
+
|
|
476
|
+
&::before {
|
|
477
|
+
content: '';
|
|
478
|
+
position: absolute;
|
|
479
|
+
top: 0;
|
|
480
|
+
left: 0;
|
|
481
|
+
width: var(--matcha-table-variant-accent-width);
|
|
482
|
+
height: 100%;
|
|
483
|
+
background: var(--matcha-table-row-accent-color, transparent);
|
|
484
|
+
pointer-events: none;
|
|
485
|
+
z-index: 1; // acima do bg da cell, abaixo do sticky shadow
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// Child row (indent + accent esmaecido) — pattern tree/hierarquia.
|
|
490
|
+
tbody tr.child-item::before {
|
|
491
|
+
opacity: var(--matcha-table-row-accent-child-opacity);
|
|
492
|
+
}
|
|
493
|
+
tbody tr.child-item td:first-child {
|
|
494
|
+
padding-left: calc(var(--matcha-table-cell-padding-x-left) +
|
|
495
|
+
var(--matcha-space-200, 16px));
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
// ── Loading state global — pulse + aria-busy ─────────────────────────
|
|
499
|
+
&.matcha-table-loading tbody tr {
|
|
500
|
+
animation: matcha-table-loading-pulse
|
|
501
|
+
var(--matcha-table-loading-pulse-duration)
|
|
502
|
+
ease-in-out infinite;
|
|
503
|
+
pointer-events: none;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// ── Disabled state — row/cell ─────────────────────────────────────────
|
|
507
|
+
// Pattern canon Material/Polaris. A11y: também aplicar aria-disabled.
|
|
508
|
+
tbody tr[disabled], tbody tr.is-disabled,
|
|
509
|
+
tbody td[disabled], tbody td.is-disabled {
|
|
510
|
+
opacity: var(--matcha-table-disabled-opacity);
|
|
511
|
+
pointer-events: none;
|
|
512
|
+
cursor: not-allowed;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
// ── Per-row loading (matcha-table-loading directive) ─────────────────
|
|
516
|
+
// Pulse só naquela row — optimistic save/delete sem bloquear a tabela.
|
|
517
|
+
tbody tr.is-loading {
|
|
518
|
+
animation: matcha-table-loading-pulse
|
|
519
|
+
var(--matcha-table-loading-pulse-duration)
|
|
520
|
+
ease-in-out infinite;
|
|
521
|
+
pointer-events: none;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// ── Empty state row (matcha-table-empty directive) ────────────────────
|
|
525
|
+
// Container pra <matcha-empty-state>. Directive seta colspan automático.
|
|
526
|
+
tbody tr.is-empty td {
|
|
527
|
+
padding: var(--matcha-table-empty-padding-y) var(--matcha-table-empty-padding-x);
|
|
528
|
+
text-align: center;
|
|
529
|
+
background: var(--matcha-table-cell-bg);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// ── Resizable column (matcha-table-resizable directive) ───────────────
|
|
533
|
+
// Handle invisível na borda direita. Hover mostra cursor + barra discreta.
|
|
534
|
+
thead th.is-resizable {
|
|
535
|
+
position: relative;
|
|
536
|
+
|
|
537
|
+
&::before {
|
|
538
|
+
content: '';
|
|
539
|
+
position: absolute;
|
|
540
|
+
top: var(--matcha-table-resize-indicator-top);
|
|
541
|
+
right: 0;
|
|
542
|
+
width: var(--matcha-table-resize-indicator-width);
|
|
543
|
+
height: var(--matcha-table-resize-indicator-height);
|
|
544
|
+
background: var(--matcha-table-border-color);
|
|
545
|
+
opacity: 0;
|
|
546
|
+
transition: opacity var(--matcha-table-transition-duration) linear;
|
|
547
|
+
}
|
|
548
|
+
&:hover::before { opacity: 1; }
|
|
549
|
+
}
|
|
550
|
+
thead th.is-resizable::after {
|
|
551
|
+
// Override do ::after do sort-indicator: handle de resize ocupa a borda.
|
|
552
|
+
// Col sortable + resizable é raro — consumer escolhe uma.
|
|
553
|
+
content: '';
|
|
554
|
+
position: absolute;
|
|
555
|
+
top: 0;
|
|
556
|
+
right: calc(-1 * var(--matcha-table-resize-handle-width) / 2);
|
|
557
|
+
width: var(--matcha-table-resize-handle-width);
|
|
558
|
+
height: 100%;
|
|
559
|
+
cursor: col-resize;
|
|
560
|
+
z-index: 3;
|
|
561
|
+
background: transparent;
|
|
562
|
+
mask: none;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
@keyframes matcha-table-loading-pulse {
|
|
567
|
+
0%, 100% { opacity: 1; }
|
|
568
|
+
50% { opacity: var(--matcha-table-loading-pulse-opacity-min); }
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
// ── Reduced motion ────────────────────────────────────────────────────
|
|
572
|
+
@media (prefers-reduced-motion: reduce) {
|
|
573
|
+
table.matcha-table tbody td,
|
|
574
|
+
table.matcha-table.matcha-table-loading tbody tr {
|
|
575
|
+
transition: none;
|
|
576
|
+
animation: none;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|