@happyvertical/smrt-reports 0.60.16 → 0.60.17

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.
@@ -113,13 +113,13 @@ function decline() {
113
113
  </script>
114
114
 
115
115
  <section data-smrt-component="ReportConfirmation" aria-label={t(M['reports.confirm_title'])}>
116
- <h3 class="report-confirmation-title">{valid ? proposal.spec.title : t(M['reports.confirm_title'])}</h3>
116
+ <h3 class="smrt-report-confirmation__title" data-smrt-part="title">{valid ? proposal.spec.title : t(M['reports.confirm_title'])}</h3>
117
117
  {#if !valid}
118
118
  <p role="alert">{t(M['reports.invalid'])}</p>
119
119
  {:else}
120
- {#if proposal.spec.description}<p class="report-confirmation-description">{proposal.spec.description}</p>{/if}
120
+ {#if proposal.spec.description}<p class="smrt-report-confirmation__description" data-smrt-part="meta">{proposal.spec.description}</p>{/if}
121
121
  {#if description}
122
- <dl class="report-confirmation-facts">
122
+ <dl class="smrt-report-confirmation__facts" data-smrt-part="meta">
123
123
  <div><dt>{t(M['reports.source'])}</dt><dd>{description.source}</dd></div>
124
124
  <div><dt>{t(M['reports.groupings'])}</dt><dd>{description.groupings || t(M['reports.none'])}</dd></div>
125
125
  {#if description.period}
@@ -136,12 +136,12 @@ function decline() {
136
136
  {/if}
137
137
  <ReportResult result={proposal.preview} {locale} {currency} />
138
138
  {#if answered?.status === 'saved'}
139
- <p class="report-confirmation-outcome" role="status">{t(M['reports.saved'])} · <a href={reportHref(answered.report.id)}>{t(M['reports.open'])}</a></p>
139
+ <p class="smrt-report-confirmation__outcome" data-smrt-part="message" role="status">{t(M['reports.saved'])} · <a href={reportHref(answered.report.id)}>{t(M['reports.open'])}</a></p>
140
140
  {:else if answered?.status === 'declined'}
141
- <p class="report-confirmation-outcome" role="status">{t(M['reports.declined'])}</p>
141
+ <p class="smrt-report-confirmation__outcome" data-smrt-part="message" role="status">{t(M['reports.declined'])}</p>
142
142
  {:else}
143
143
  {#if error}<p role="alert">{t(M[error])}</p>{/if}
144
- <div class="report-confirmation-actions">
144
+ <div class="smrt-report-confirmation__actions" data-smrt-part="actions">
145
145
  <Button variant="secondary" disabled={status === 'saving'} onclick={decline}>{t(M['reports.decline'])}</Button>
146
146
  <Button disabled={status === 'saving'} aria-busy={status === 'saving'} onclick={approve}>{t(M[status === 'saving' ? 'reports.saving' : 'reports.approve'])}</Button>
147
147
  </div>
@@ -151,22 +151,85 @@ function decline() {
151
151
 
152
152
  <style>
153
153
  @layer smrt.reset, smrt.structure, smrt.theme;
154
- @layer smrt.theme {
155
- [data-smrt-component='ReportConfirmation'] { display: grid; gap: var(--smrt-spacing-3); inline-size: 100%; min-inline-size: 0; box-sizing: border-box; padding: var(--smrt-spacing-3); border: var(--smrt-hairline); border-radius: var(--smrt-radius-large); background: var(--smrt-color-surface-container); color: var(--smrt-color-on-surface); container-type: inline-size; }
156
- .report-confirmation-title { margin: 0; font: var(--smrt-typography-title-medium-font); overflow-wrap: anywhere; }
157
- .report-confirmation-description { margin: 0; color: var(--smrt-color-on-surface-variant); font-size: var(--smrt-typography-body-small-size); }
158
- .report-confirmation-facts { display: grid; gap: var(--smrt-spacing-1); margin: 0; font-size: var(--smrt-typography-body-small-size); }
159
- .report-confirmation-facts > div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: var(--smrt-spacing-2); align-items: baseline; }
160
- .report-confirmation-facts dt { color: var(--smrt-color-on-surface-variant); }
161
- .report-confirmation-facts dd { margin: 0; overflow-wrap: anywhere; }
162
- .report-confirmation-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--smrt-spacing-2); }
154
+ @layer smrt.structure {
155
+ [data-smrt-component='ReportConfirmation'] {
156
+ display: grid;
157
+ gap: var(--smrt-spacing-3);
158
+ inline-size: 100%;
159
+ min-inline-size: 0;
160
+ box-sizing: border-box;
161
+ padding: var(--smrt-spacing-3);
162
+ container-type: inline-size;
163
+ }
164
+ .smrt-report-confirmation__title {
165
+ margin: 0;
166
+ overflow-wrap: anywhere;
167
+ }
168
+ .smrt-report-confirmation__description {
169
+ margin: 0;
170
+ }
171
+ .smrt-report-confirmation__facts {
172
+ display: grid;
173
+ gap: var(--smrt-spacing-1);
174
+ margin: 0;
175
+ }
176
+ .smrt-report-confirmation__facts > div {
177
+ display: grid;
178
+ grid-template-columns: 5.5rem minmax(0, 1fr);
179
+ gap: var(--smrt-spacing-2);
180
+ align-items: baseline;
181
+ }
182
+ .smrt-report-confirmation__facts dd {
183
+ margin: 0;
184
+ overflow-wrap: anywhere;
185
+ }
186
+ .smrt-report-confirmation__actions {
187
+ display: flex;
188
+ flex-wrap: wrap;
189
+ justify-content: flex-end;
190
+ gap: var(--smrt-spacing-2);
191
+ }
163
192
  /* A narrow dock: labels over values, and the actions share the row. */
164
193
  @container (max-width: 12rem) {
165
- .report-confirmation-facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
194
+ .smrt-report-confirmation__facts > div {
195
+ grid-template-columns: minmax(0, 1fr);
196
+ gap: 0;
197
+ }
166
198
  }
167
199
  @container (max-width: 22rem) {
168
- .report-confirmation-actions > :global(*) { flex: 1 1 0; }
200
+ .smrt-report-confirmation__actions > :global(*) {
201
+ flex: 1 1 0;
202
+ }
203
+ }
204
+ .smrt-report-confirmation__outcome {
205
+ margin: 0;
169
206
  }
170
- .report-confirmation-outcome { margin: 0; color: var(--smrt-color-on-surface-variant); font-size: var(--smrt-typography-body-small-size); }
171
207
  }
208
+
209
+ @layer smrt.theme {
210
+ [data-smrt-component='ReportConfirmation'] {
211
+ border: var(--smrt-hairline);
212
+ border-radius: var(--smrt-radius-large);
213
+ background: var(--smrt-color-surface-container);
214
+ color: var(--smrt-color-on-surface);
215
+ }
216
+ .smrt-report-confirmation__title {
217
+ font: var(--smrt-typography-title-medium-font);
218
+ }
219
+ .smrt-report-confirmation__description {
220
+ color: var(--smrt-color-on-surface-variant);
221
+ font-size: var(--smrt-typography-body-small-size);
222
+ }
223
+ .smrt-report-confirmation__facts {
224
+ font-size: var(--smrt-typography-body-small-size);
225
+ }
226
+ .smrt-report-confirmation__facts dt {
227
+ color: var(--smrt-color-on-surface-variant);
228
+ }
229
+ .smrt-report-confirmation__outcome {
230
+ color: var(--smrt-color-on-surface-variant);
231
+ font-size: var(--smrt-typography-body-small-size);
232
+ }
233
+ }
234
+
172
235
  </style>
@@ -219,22 +219,22 @@ const menu = $derived([
219
219
 
220
220
  <section
221
221
  bind:this={root}
222
- class="report-detail"
222
+ class="smrt-report-detail__root"
223
223
  data-smrt-component="ReportDetail"
224
224
  data-report-id={id}
225
225
  aria-label={report?.title ?? t(M['reports.title'])}
226
226
  >
227
- <header class="report-detail__head">
228
- <div class="report-detail__heading">
229
- <div class="report-detail__title-row">
230
- <h1 class="report-detail__title">{report?.title ?? t(M['reports.title'])}</h1>
227
+ <header class="smrt-report-detail__header" data-smrt-part="header">
228
+ <div class="smrt-report-detail__heading" data-smrt-part="body">
229
+ <div class="smrt-report-detail__title-row" data-smrt-part="header">
230
+ <h1 class="smrt-report-detail__title" data-smrt-part="title">{report?.title ?? t(M['reports.title'])}</h1>
231
231
  {#if archived}<Badge>{t(M['reports.archived_badge'])}</Badge>{/if}
232
232
  </div>
233
- {#if description}<p class="report-detail__line">{description.line}</p>{/if}
234
- {#if report?.description}<p class="report-detail__description">{report.description}</p>{/if}
233
+ {#if description}<p class="smrt-report-detail__line" data-smrt-part="meta">{description.line}</p>{/if}
234
+ {#if report?.description}<p class="smrt-report-detail__description" data-smrt-part="description">{report.description}</p>{/if}
235
235
  </div>
236
236
  {#if client && report}
237
- <div class="report-detail__actions">
237
+ <div class="smrt-report-detail__actions" data-smrt-part="actions">
238
238
  {#if archived}
239
239
  {#if report.canArchive}<Button variant="primary" disabled={archiving} onclick={() => setArchived(false)}>{t(M['reports.restore'])}</Button>{/if}
240
240
  {:else if error}
@@ -252,14 +252,14 @@ const menu = $derived([
252
252
  {/if}
253
253
  </header>
254
254
  {#if !client}
255
- <p class="report-detail__note">{t(M['reports.unavailable'])}</p>
255
+ <p class="smrt-report-detail__note" data-smrt-part="description">{t(M['reports.unavailable'])}</p>
256
256
  {:else}
257
257
  {#if description}
258
- <dl class="report-detail__facts" aria-label={t(M['reports.details'])}>
258
+ <dl class="smrt-report-detail__facts" data-smrt-part="meta" aria-label={t(M['reports.details'])}>
259
259
  <div><dt>{t(M['reports.source'])}</dt><dd>{description.source}</dd></div>
260
260
  <div><dt>{t(M['reports.groupings'])}</dt><dd>{description.groupings || t(M['reports.none'])}</dd></div>
261
261
  {#if description.period}
262
- <div><dt>{t(M['reports.period'])}</dt><dd>{description.period.range}<span class="report-detail__aside">{' · '}{description.period.field}</span></dd></div>
262
+ <div><dt>{t(M['reports.period'])}</dt><dd>{description.period.range}<span class="smrt-report-detail__aside" data-smrt-part="group">{' · '}{description.period.field}</span></dd></div>
263
263
  {/if}
264
264
  <div><dt>{t(M['reports.measures'])}</dt><dd>{description.measures.join(', ')}</dd></div>
265
265
  {#if description.filters.length}
@@ -269,15 +269,15 @@ const menu = $derived([
269
269
  <div><dt>{t(M['reports.having'])}</dt><dd>{description.having.join('; ')}</dd></div>
270
270
  {/if}
271
271
  {#if savedText || ranText}
272
- <div class="report-detail__meta"><dt class="report-detail__sr">{t(M['reports.author'])}</dt><dd>{[savedText, ranText].filter(Boolean).join(' · ')}</dd></div>
272
+ <div class="smrt-report-detail__meta" data-smrt-part="meta"><dt class="smrt-report-detail__visually-hidden" data-smrt-part="label">{t(M['reports.author'])}</dt><dd>{[savedText, ranText].filter(Boolean).join(' · ')}</dd></div>
273
273
  {/if}
274
274
  </dl>
275
275
  {/if}
276
- {#if askNote}<p class="report-detail__note" role="status">{t(M['reports.ask_where'])}</p>{/if}
277
- {#if loading && !result}<p class="report-detail__note" role="status">{t(M['reports.running'])}</p>{/if}
278
- {#if error}<p class="report-detail__error" role="alert">{t(M[error])}</p>{/if}
276
+ {#if askNote}<p class="smrt-report-detail__note" data-smrt-part="description" role="status">{t(M['reports.ask_where'])}</p>{/if}
277
+ {#if loading && !result}<p class="smrt-report-detail__note" data-smrt-part="description" role="status">{t(M['reports.running'])}</p>{/if}
278
+ {#if error}<p class="smrt-report-detail__error" data-smrt-part="error" role="alert">{t(M[error])}</p>{/if}
279
279
  {#if result && report}
280
- <div class="report-detail__result">
280
+ <div class="smrt-report-detail__result" data-smrt-part="status">
281
281
  <ReportResult {result} spec={report.spec} variant="full" bind:view {locale} {currency} />
282
282
  </div>
283
283
  {/if}
@@ -296,25 +296,132 @@ const menu = $derived([
296
296
 
297
297
  <style>
298
298
  @layer smrt.reset, smrt.structure, smrt.theme;
299
+ @layer smrt.structure {
300
+ .smrt-report-detail__root {
301
+ display: grid;
302
+ gap: var(--smrt-spacing-5);
303
+ min-inline-size: 0;
304
+ }
305
+ .smrt-report-detail__header {
306
+ display: flex;
307
+ flex-wrap: wrap;
308
+ align-items: flex-start;
309
+ justify-content: space-between;
310
+ gap: var(--smrt-spacing-3) var(--smrt-spacing-5);
311
+ }
312
+ .smrt-report-detail__heading {
313
+ display: grid;
314
+ gap: var(--smrt-spacing-1);
315
+ flex: 1 1 20rem;
316
+ min-inline-size: 0;
317
+ }
318
+ .smrt-report-detail__title-row {
319
+ display: flex;
320
+ flex-wrap: wrap;
321
+ align-items: center;
322
+ gap: var(--smrt-spacing-2);
323
+ }
324
+ .smrt-report-detail__title {
325
+ margin: 0;
326
+ overflow-wrap: anywhere;
327
+ }
328
+ .smrt-report-detail__line {
329
+ margin: 0;
330
+ }
331
+ .smrt-report-detail__description {
332
+ margin: 0;
333
+ max-inline-size: 65ch;
334
+ }
335
+ .smrt-report-detail__actions {
336
+ display: flex;
337
+ flex-wrap: nowrap;
338
+ align-items: center;
339
+ gap: var(--smrt-spacing-2);
340
+ }
341
+ .smrt-report-detail__facts {
342
+ display: grid;
343
+ grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
344
+ gap: var(--smrt-spacing-3) var(--smrt-spacing-5);
345
+ margin: 0;
346
+ padding: var(--smrt-spacing-4);
347
+ }
348
+ .smrt-report-detail__facts > div {
349
+ display: grid;
350
+ gap: var(--smrt-spacing-1);
351
+ min-inline-size: 0;
352
+ }
353
+ .smrt-report-detail__facts dd {
354
+ margin: 0;
355
+ overflow-wrap: anywhere;
356
+ }
357
+ .smrt-report-detail__meta {
358
+ grid-column: 1 / -1;
359
+ padding-block-start: var(--smrt-spacing-3);
360
+ }
361
+ .smrt-report-detail__visually-hidden {
362
+ position: absolute;
363
+ inline-size: 1px;
364
+ block-size: 1px;
365
+ overflow: hidden;
366
+ clip: rect(0 0 0 0);
367
+ clip-path: inset(50%);
368
+ white-space: nowrap;
369
+ }
370
+ .smrt-report-detail__note {
371
+ margin: 0;
372
+ }
373
+ .smrt-report-detail__error {
374
+ margin: 0;
375
+ }
376
+ .smrt-report-detail__result {
377
+ padding: var(--smrt-spacing-4);
378
+ }
379
+ }
380
+
299
381
  @layer smrt.theme {
300
- .report-detail { display: grid; gap: var(--smrt-spacing-5); min-inline-size: 0; }
301
- .report-detail__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--smrt-spacing-3) var(--smrt-spacing-5); }
302
- .report-detail__heading { display: grid; gap: var(--smrt-spacing-1); flex: 1 1 20rem; min-inline-size: 0; }
303
- .report-detail__title-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--smrt-spacing-2); }
304
- .report-detail__title { margin: 0; font: var(--smrt-typography-headline-medium-font); overflow-wrap: anywhere; }
305
- .report-detail__line { margin: 0; color: var(--smrt-color-on-surface-variant); font-size: var(--smrt-typography-body-medium-size); }
306
- .report-detail__description { margin: 0; max-inline-size: 65ch; font-size: var(--smrt-typography-body-medium-size); }
307
- .report-detail__actions { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--smrt-spacing-2); }
308
- .report-detail__facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: var(--smrt-spacing-3) var(--smrt-spacing-5); margin: 0; padding: var(--smrt-spacing-4); border: var(--smrt-hairline); border-radius: var(--smrt-radius-large); background: var(--smrt-color-surface-container-low); }
309
- .report-detail__facts > div { display: grid; gap: var(--smrt-spacing-1); min-inline-size: 0; }
310
- .report-detail__facts dt { color: var(--smrt-color-on-surface-variant); font-size: var(--smrt-typography-label-medium-size); }
311
- .report-detail__facts dd { margin: 0; overflow-wrap: anywhere; font-size: var(--smrt-typography-body-medium-size); }
312
- .report-detail__meta { grid-column: 1 / -1; padding-block-start: var(--smrt-spacing-3); border-block-start: var(--smrt-hairline); }
313
- .report-detail__meta dd { color: var(--smrt-color-on-surface-variant); font-size: var(--smrt-typography-body-small-size); }
314
- .report-detail__aside { color: var(--smrt-color-on-surface-variant); }
315
- .report-detail__sr { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
316
- .report-detail__note { margin: 0; color: var(--smrt-color-on-surface-variant); }
317
- .report-detail__error { margin: 0; color: var(--smrt-color-error); }
318
- .report-detail__result { padding: var(--smrt-spacing-4); border: var(--smrt-hairline); border-radius: var(--smrt-radius-large); background: var(--smrt-color-surface); }
382
+ .smrt-report-detail__title {
383
+ font: var(--smrt-typography-headline-medium-font);
384
+ }
385
+ .smrt-report-detail__line {
386
+ color: var(--smrt-color-on-surface-variant);
387
+ font-size: var(--smrt-typography-body-medium-size);
388
+ }
389
+ .smrt-report-detail__description {
390
+ font-size: var(--smrt-typography-body-medium-size);
391
+ }
392
+ .smrt-report-detail__facts {
393
+ border: var(--smrt-hairline);
394
+ border-radius: var(--smrt-radius-large);
395
+ background: var(--smrt-color-surface-container-low);
396
+ }
397
+ .smrt-report-detail__facts dt {
398
+ color: var(--smrt-color-on-surface-variant);
399
+ font-size: var(--smrt-typography-label-medium-size);
400
+ }
401
+ .smrt-report-detail__facts dd {
402
+ font-size: var(--smrt-typography-body-medium-size);
403
+ }
404
+ .smrt-report-detail__meta {
405
+ border-block-start: var(--smrt-hairline);
406
+ }
407
+ .smrt-report-detail__meta dd {
408
+ color: var(--smrt-color-on-surface-variant);
409
+ font-size: var(--smrt-typography-body-small-size);
410
+ }
411
+ .smrt-report-detail__aside {
412
+ color: var(--smrt-color-on-surface-variant);
413
+ }
414
+ .smrt-report-detail__note {
415
+ color: var(--smrt-color-on-surface-variant);
416
+ }
417
+ .smrt-report-detail__error {
418
+ color: var(--smrt-color-error);
419
+ }
420
+ .smrt-report-detail__result {
421
+ border: var(--smrt-hairline);
422
+ border-radius: var(--smrt-radius-large);
423
+ background: var(--smrt-color-surface);
424
+ }
319
425
  }
426
+
320
427
  </style>
@@ -71,7 +71,7 @@ $effect(() => {
71
71
  });
72
72
  </script>
73
73
 
74
- <div class="report-picker" data-smrt-component="ReportPicker">
74
+ <div class="smrt-report-picker__root" data-smrt-component="ReportPicker">
75
75
  {#if !client}<p>{t(M['reports.unavailable'])}</p>
76
76
  {:else}
77
77
  {#if loading}<p role="status">{t(M['reports.loading'])}</p>{/if}
@@ -99,8 +99,21 @@ $effect(() => {
99
99
 
100
100
  <style>
101
101
  @layer smrt.reset, smrt.structure, smrt.theme;
102
+ @layer smrt.structure {
103
+ .smrt-report-picker__root {
104
+ display: grid;
105
+ gap: var(--smrt-spacing-3);
106
+ }
107
+ .smrt-report-picker__root > p {
108
+ margin: 0;
109
+ }
110
+ }
111
+
102
112
  @layer smrt.theme {
103
- .report-picker { display: grid; gap: var(--smrt-spacing-3); }
104
- .report-picker > p { margin: 0; color: var(--smrt-color-on-surface-variant); font-size: var(--smrt-typography-body-small-size); }
113
+ .smrt-report-picker__root > p {
114
+ color: var(--smrt-color-on-surface-variant);
115
+ font-size: var(--smrt-typography-body-small-size);
116
+ }
105
117
  }
118
+
106
119
  </style>
@@ -125,14 +125,14 @@ const measureOptions = $derived(
125
125
  );
126
126
  </script>
127
127
 
128
- <div class="report-result" data-smrt-component="ReportResult" data-variant={variant}>
128
+ <div class="smrt-report-result__root" data-smrt-component="ReportResult" data-variant={variant}>
129
129
  {#if !valid}
130
130
  <p role="alert">{t(M['reports.invalid'])}</p>
131
131
  {:else if result.rows.length === 0}
132
- <p class="report-result__empty">{t(M['reports.no_rows'])}</p>
132
+ <p class="smrt-report-result__empty" data-smrt-part="empty">{t(M['reports.no_rows'])}</p>
133
133
  {:else}
134
134
  {#if variant === 'full'}
135
- <div class="report-result__controls">
135
+ <div class="smrt-report-result__controls" data-smrt-part="actions">
136
136
  {#if !tableOnly}
137
137
  <SegmentedControl
138
138
  label={t(M['reports.view'])}
@@ -164,28 +164,28 @@ const measureOptions = $derived(
164
164
  {/if}
165
165
  </div>
166
166
  {#if figures.length > 0 && !showTable}
167
- <dl class="report-result__figures" aria-label={t(M['reports.figures'])}>
167
+ <dl class="smrt-report-result__figures" data-smrt-part="list" aria-label={t(M['reports.figures'])}>
168
168
  {#each figures as figure (figure.label)}
169
- <div class="report-result__figure">
170
- <dt>{figure.label}{#if figure.detail}<span class="report-result__figure-detail">{' · '}{figure.detail}</span>{/if}</dt>
171
- <dd><span class="report-result__figure-value">{figure.value}</span></dd>
169
+ <div class="smrt-report-result__figure" data-smrt-part="value">
170
+ <dt>{figure.label}{#if figure.detail}<span class="smrt-report-result__figure-detail" data-smrt-part="description">{' · '}{figure.detail}</span>{/if}</dt>
171
+ <dd><span class="smrt-report-result__figure-value" data-smrt-part="value">{figure.value}</span></dd>
172
172
  </div>
173
173
  {/each}
174
174
  </dl>
175
175
  {/if}
176
176
  {:else if !tableOnly}
177
- <div class="report-result__toggle">
177
+ <div class="smrt-report-result__toggle" data-smrt-part="trigger">
178
178
  <Button type="button" variant="ghost" size="sm" aria-pressed={view === 'table'} onclick={() => (view = view === 'table' ? 'chart' : 'table')}>{t(M[view === 'table' ? 'reports.chart' : 'reports.table'])}</Button>
179
179
  </div>
180
180
  {/if}
181
181
  {#if showTable}
182
- <div class="report-result__table">
182
+ <div class="smrt-report-result__table" data-smrt-part="table">
183
183
  <table>
184
184
  <caption>{result.title}</caption>
185
185
  <thead>
186
186
  <tr>
187
187
  {#each result.columns as column (column.id)}
188
- <th scope="col" class:report-result__num={numeric(column)}>{column.label}</th>
188
+ <th scope="col" class:smrt-report-result__num={numeric(column)} data-smrt-part="cell">{column.label}</th>
189
189
  {/each}
190
190
  </tr>
191
191
  </thead>
@@ -193,7 +193,7 @@ const measureOptions = $derived(
193
193
  {#each result.rows as row, i (i)}
194
194
  <tr>
195
195
  {#each result.columns as column (column.id)}
196
- <td class:report-result__num={numeric(column)}>{cell(row[column.id], column)}</td>
196
+ <td class:smrt-report-result__num={numeric(column)} data-smrt-part="cell">{cell(row[column.id], column)}</td>
197
197
  {/each}
198
198
  </tr>
199
199
  {/each}
@@ -202,7 +202,7 @@ const measureOptions = $derived(
202
202
  </div>
203
203
  {:else if measure && chartData}
204
204
  {#if variant === 'full' || measures.length > 1}
205
- <p class="report-result__series">{seriesLabel}</p>
205
+ <p class="smrt-report-result__series" data-smrt-part="meta">{seriesLabel}</p>
206
206
  {/if}
207
207
  <Chart
208
208
  title={measure.label}
@@ -214,37 +214,135 @@ const measureOptions = $derived(
214
214
  data={chartData}
215
215
  />
216
216
  {#if variant === 'compact' && measures.length > 1}
217
- <p class="report-result__more">
217
+ <p class="smrt-report-result__more" data-smrt-part="description">
218
218
  {measures.slice(1).map((c) => c.label).join(', ')} · {t(M['reports.table']).toLowerCase()}
219
219
  </p>
220
220
  {/if}
221
221
  {/if}
222
- {#if result.truncated}<p class="report-result__empty">{t(M['reports.truncated'])}</p>{/if}
222
+ {#if result.truncated}<p class="smrt-report-result__empty" data-smrt-part="empty">{t(M['reports.truncated'])}</p>{/if}
223
223
  {/if}
224
224
  </div>
225
225
 
226
226
  <style>
227
227
  @layer smrt.reset, smrt.structure, smrt.theme;
228
+ @layer smrt.structure {
229
+ .smrt-report-result__root {
230
+ display: grid;
231
+ gap: var(--smrt-spacing-3);
232
+ inline-size: 100%;
233
+ min-inline-size: 0;
234
+ }
235
+ .smrt-report-result__root[data-variant='full'] {
236
+ gap: var(--smrt-spacing-4);
237
+ }
238
+ .smrt-report-result__controls {
239
+ display: flex;
240
+ flex-wrap: wrap;
241
+ align-items: center;
242
+ justify-content: space-between;
243
+ gap: var(--smrt-spacing-2) var(--smrt-spacing-4);
244
+ }
245
+ .smrt-report-result__toggle {
246
+ display: flex;
247
+ justify-content: flex-end;
248
+ }
249
+ .smrt-report-result__empty, .smrt-report-result__more {
250
+ margin: 0;
251
+ }
252
+ .smrt-report-result__series {
253
+ margin: 0;
254
+ }
255
+ .smrt-report-result__figures {
256
+ display: grid;
257
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
258
+ gap: var(--smrt-spacing-3);
259
+ margin: 0;
260
+ }
261
+ .smrt-report-result__figure {
262
+ display: grid;
263
+ gap: var(--smrt-spacing-1);
264
+ padding: var(--smrt-spacing-3) var(--smrt-spacing-4);
265
+ }
266
+ .smrt-report-result__figure dd {
267
+ display: grid;
268
+ margin: 0;
269
+ }
270
+ .smrt-report-result__figure-value {
271
+ overflow-wrap: anywhere;
272
+ }
273
+ .smrt-report-result__table {
274
+ overflow-x: auto;
275
+ }
276
+ table {
277
+ inline-size: 100%;
278
+ }
279
+ caption {
280
+ position: absolute;
281
+ inline-size: 1px;
282
+ block-size: 1px;
283
+ overflow: hidden;
284
+ clip: rect(0 0 0 0);
285
+ clip-path: inset(50%);
286
+ white-space: nowrap;
287
+ }
288
+ th, td {
289
+ padding: var(--smrt-spacing-2) var(--smrt-spacing-3);
290
+ white-space: nowrap;
291
+ }
292
+ .smrt-report-result__root[data-variant='compact'] th, .smrt-report-result__root[data-variant='compact'] td {
293
+ padding: var(--smrt-spacing-1) var(--smrt-spacing-2);
294
+ }
295
+ }
296
+
228
297
  @layer smrt.theme {
229
- .report-result { display: grid; gap: var(--smrt-spacing-3); inline-size: 100%; min-inline-size: 0; }
230
- .report-result[data-variant='full'] { gap: var(--smrt-spacing-4); }
231
- .report-result__controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--smrt-spacing-2) var(--smrt-spacing-4); }
232
- .report-result__toggle { display: flex; justify-content: flex-end; }
233
- .report-result__empty, .report-result__more { margin: 0; color: var(--smrt-color-on-surface-variant); font-size: var(--smrt-typography-body-small-size); }
234
- .report-result__series { margin: 0; color: var(--smrt-color-on-surface-variant); font: var(--smrt-typography-label-large-font); }
235
- .report-result__figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: var(--smrt-spacing-3); margin: 0; }
236
- .report-result__figure { display: grid; gap: var(--smrt-spacing-1); padding: var(--smrt-spacing-3) var(--smrt-spacing-4); border: var(--smrt-hairline); border-radius: var(--smrt-radius-medium); background: var(--smrt-color-surface-container-low); }
237
- .report-result__figure dt { color: var(--smrt-color-on-surface-variant); font-size: var(--smrt-typography-label-medium-size); }
238
- .report-result__figure dd { display: grid; margin: 0; }
239
- .report-result__figure-value { font: var(--smrt-typography-headline-small-font); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
240
- .report-result__figure-detail { color: var(--smrt-color-on-surface-variant); }
241
- .report-result__table { overflow-x: auto; border: var(--smrt-hairline); border-radius: var(--smrt-radius-medium); }
242
- table { border-collapse: collapse; inline-size: 100%; font-size: var(--smrt-typography-body-small-size); }
243
- caption { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
244
- th, td { padding: var(--smrt-spacing-2) var(--smrt-spacing-3); border-block-end: var(--smrt-hairline); text-align: start; white-space: nowrap; }
245
- thead th { background: var(--smrt-surface-sunken); color: var(--smrt-color-on-surface-variant); font-weight: var(--smrt-typography-label-large-weight); }
246
- tbody tr:last-child td { border-block-end: none; }
247
- .report-result__num { text-align: end; font-variant-numeric: tabular-nums; }
248
- .report-result[data-variant='compact'] th, .report-result[data-variant='compact'] td { padding: var(--smrt-spacing-1) var(--smrt-spacing-2); }
298
+ .smrt-report-result__empty, .smrt-report-result__more {
299
+ color: var(--smrt-color-on-surface-variant);
300
+ font-size: var(--smrt-typography-body-small-size);
301
+ }
302
+ .smrt-report-result__series {
303
+ color: var(--smrt-color-on-surface-variant);
304
+ font: var(--smrt-typography-label-large-font);
305
+ }
306
+ .smrt-report-result__figure {
307
+ border: var(--smrt-hairline);
308
+ border-radius: var(--smrt-radius-medium);
309
+ background: var(--smrt-color-surface-container-low);
310
+ }
311
+ .smrt-report-result__figure dt {
312
+ color: var(--smrt-color-on-surface-variant);
313
+ font-size: var(--smrt-typography-label-medium-size);
314
+ }
315
+ .smrt-report-result__figure-value {
316
+ font: var(--smrt-typography-headline-small-font);
317
+ font-variant-numeric: tabular-nums;
318
+ }
319
+ .smrt-report-result__figure-detail {
320
+ color: var(--smrt-color-on-surface-variant);
321
+ }
322
+ .smrt-report-result__table {
323
+ border: var(--smrt-hairline);
324
+ border-radius: var(--smrt-radius-medium);
325
+ }
326
+ table {
327
+ border-collapse: collapse;
328
+ font-size: var(--smrt-typography-body-small-size);
329
+ }
330
+ th, td {
331
+ border-block-end: var(--smrt-hairline);
332
+ text-align: start;
333
+ }
334
+ thead th {
335
+ background: var(--smrt-surface-sunken);
336
+ color: var(--smrt-color-on-surface-variant);
337
+ font-weight: var(--smrt-typography-label-large-weight);
338
+ }
339
+ tbody tr:last-child td {
340
+ border-block-end: none;
341
+ }
342
+ .smrt-report-result__num {
343
+ text-align: end;
344
+ font-variant-numeric: tabular-nums;
345
+ }
249
346
  }
347
+
250
348
  </style>
@@ -42,7 +42,7 @@ function save() {
42
42
  }
43
43
  </script>
44
44
 
45
- <div class="report-widget-options" data-smrt-component="RuntimeReportWidgetOptions">
45
+ <div class="smrt-runtime-report-widget-options__root" data-smrt-component="RuntimeReportWidgetOptions">
46
46
  <ReportPicker
47
47
  {client}
48
48
  reportId={value.reportId}
@@ -59,8 +59,20 @@ function save() {
59
59
 
60
60
  <style>
61
61
  @layer smrt.reset, smrt.structure, smrt.theme;
62
+ @layer smrt.structure {
63
+ .smrt-runtime-report-widget-options__root {
64
+ display: grid;
65
+ gap: var(--smrt-spacing-4);
66
+ }
67
+ .smrt-runtime-report-widget-options__root > p {
68
+ margin: 0;
69
+ }
70
+ }
71
+
62
72
  @layer smrt.theme {
63
- .report-widget-options { display: grid; gap: var(--smrt-spacing-4); }
64
- .report-widget-options > p { margin: 0; color: var(--smrt-color-error); }
73
+ .smrt-runtime-report-widget-options__root > p {
74
+ color: var(--smrt-color-error);
75
+ }
65
76
  }
77
+
66
78
  </style>