tempest-react-sdk 0.31.0 → 0.31.1

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.
Files changed (2) hide show
  1. package/dist/utilities.css +133 -0
  2. package/package.json +1 -1
@@ -339,8 +339,15 @@
339
339
  * Page pattern — the shell every screen shares
340
340
  * ============================================================ */
341
341
 
342
+ /*
343
+ * `width: 100%` is not decoration: dropped inside a flex **row** — a preview pane,
344
+ * a split view — a page container is a flex item and sizes to its content, so a
345
+ * dashboard inside it collapsed to about 200px while its parent had 500. Only the
346
+ * browser shows that; in normal flow the declaration changes nothing.
347
+ */
342
348
  .tempest-page {
343
349
  display: flex;
350
+ width: 100%;
344
351
  flex-direction: column;
345
352
  gap: var(--tempest-page-gap, var(--tempest-space-6));
346
353
  padding-block: var(--tempest-space-6);
@@ -387,6 +394,132 @@
387
394
  z-index: var(--tempest-z-sticky);
388
395
  }
389
396
 
397
+ /* ============================================================
398
+ * Dashboard — a page of widgets, without a media query per widget
399
+ * ============================================================ */
400
+
401
+ /**
402
+ * Widget grid.
403
+ *
404
+ * Columns come from the **container**, not the viewport: `container-type:
405
+ * inline-size` makes the spans below react to the width the grid actually has, so
406
+ * the same dashboard works full-bleed, inside a sidebar layout, or in a drawer. A
407
+ * media query would give a 320px-wide panel the desktop span, and every widget in
408
+ * it would be one column of squashed text.
409
+ *
410
+ * Tune with `--tempest-dashboard-columns` (default 12) and
411
+ * `--tempest-dashboard-gap`.
412
+ */
413
+ .tempest-dashboard {
414
+ display: grid;
415
+ width: 100%;
416
+ grid-template-columns: repeat(var(--tempest-dashboard-columns, 12), minmax(0, 1fr));
417
+ gap: var(--tempest-dashboard-gap, var(--tempest-space-4));
418
+ container-type: inline-size;
419
+ container-name: tempest-dashboard;
420
+ }
421
+
422
+ /**
423
+ * One widget.
424
+ *
425
+ * Full width by default, because a dashboard read on a phone is a single column
426
+ * and that is the state a widget spends most of its life in. The spans below widen
427
+ * it as the container earns the room.
428
+ */
429
+ .tempest-widget {
430
+ grid-column: 1 / -1;
431
+ min-width: 0;
432
+ }
433
+
434
+ /** Two rows tall — a chart next to a stack of stat tiles. */
435
+ .tempest-widget-tall {
436
+ grid-row: span 2;
437
+ }
438
+
439
+ /*
440
+ * Spans open up in two steps, keyed on the container.
441
+ *
442
+ * 40rem is where two columns of prose stop being cramped; 64rem is where four fit.
443
+ * The `span` values assume the default 12 columns — with a custom
444
+ * `--tempest-dashboard-columns` the widget still lands inside the grid, it just
445
+ * covers a different fraction, which is the tradeoff of using one shared scale
446
+ * instead of a class per column count.
447
+ */
448
+ @container tempest-dashboard (min-width: 40rem) {
449
+ .tempest-widget-half {
450
+ grid-column: span 6;
451
+ }
452
+
453
+ .tempest-widget-third,
454
+ .tempest-widget-quarter {
455
+ grid-column: span 6;
456
+ }
457
+
458
+ .tempest-widget-two-thirds {
459
+ grid-column: span 12;
460
+ }
461
+ }
462
+
463
+ @container tempest-dashboard (min-width: 64rem) {
464
+ .tempest-widget-third {
465
+ grid-column: span 4;
466
+ }
467
+
468
+ .tempest-widget-quarter {
469
+ grid-column: span 3;
470
+ }
471
+
472
+ .tempest-widget-two-thirds {
473
+ grid-column: span 8;
474
+ }
475
+ }
476
+
477
+ /** Row of stat tiles that fits as many as it can, no spans needed. */
478
+ .tempest-stat-row {
479
+ display: grid;
480
+ width: 100%;
481
+ grid-template-columns: repeat(auto-fit, minmax(min(var(--tempest-stat-min, 11rem), 100%), 1fr));
482
+ gap: var(--tempest-dashboard-gap, var(--tempest-space-4));
483
+ }
484
+
485
+ /**
486
+ * A widget's own frame: header on top, body taking the rest.
487
+ *
488
+ * `min-height: 0` on the body is what lets a chart inside it shrink — a grid child
489
+ * defaults to `min-height: auto`, so a canvas that reports a tall intrinsic size
490
+ * pushes the row instead of fitting it, and the dashboard grows a scrollbar nobody
491
+ * asked for.
492
+ */
493
+ .tempest-widget-frame {
494
+ display: flex;
495
+ flex-direction: column;
496
+ gap: var(--tempest-space-3);
497
+ height: 100%;
498
+ padding: var(--tempest-widget-padding, var(--tempest-space-4));
499
+ border: 1px solid var(--tempest-border);
500
+ border-radius: var(--tempest-radius-lg);
501
+ background-color: var(--tempest-bg);
502
+ }
503
+
504
+ .tempest-widget-header {
505
+ display: flex;
506
+ align-items: baseline;
507
+ justify-content: space-between;
508
+ gap: var(--tempest-space-2);
509
+ }
510
+
511
+ .tempest-widget-title {
512
+ margin: 0;
513
+ color: var(--tempest-text);
514
+ font-size: var(--tempest-text-sm);
515
+ font-weight: var(--tempest-weight-semibold);
516
+ }
517
+
518
+ .tempest-widget-body {
519
+ flex: 1 1 auto;
520
+ min-height: 0;
521
+ }
522
+
390
523
  /* ============================================================
391
524
  * Media — fixed ratios without layout shift
392
525
  * ============================================================ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tempest-react-sdk",
3
- "version": "0.31.0",
3
+ "version": "0.31.1",
4
4
  "description": "SDK público da Tempest com componentes, hooks e integrações para projetos React.",
5
5
  "type": "module",
6
6
  "license": "MIT",