@still-void/ui 3.0.1 → 3.2.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/dist/style.css CHANGED
@@ -40,35 +40,87 @@ body.sv-body {
40
40
  display: flex;
41
41
  align-items: center;
42
42
  gap: var(--sv-space-5);
43
- /* Lets the row shrink below its content width so overflow-x can scroll
44
- it instead of the whole header wrapping or forcing the page wider. */
43
+ /* Lets the row shrink below its content width, and is what the mobile
44
+ dropdown panel below overrides to lay its links out as a column. */
45
45
  min-width: 0;
46
46
  }
47
- /* No distinct mobile nav pattern by design — a wrapping/collapsing nav adds
48
- a second layout to maintain. Below the point where items stop fitting,
49
- the row scrolls horizontally instead of overflowing the viewport. */
47
+ /* <details> wraps <nav> so the mobile disclosure needs zero JavaScript: the
48
+ summary is the tap target, the browser's own open/close state drives it. */
49
+ .sv-header__nav-toggle {
50
+ position: relative;
51
+ }
52
+ .sv-header__nav-summary {
53
+ /* The browser renders <summary> like a <li> with a marker; this system
54
+ draws its own disclosure affordance instead. */
55
+ list-style: none;
56
+ display: none;
57
+ }
58
+ .sv-header__nav-summary::-webkit-details-marker {
59
+ display: none;
60
+ }
61
+ .sv-header__nav-summary::marker {
62
+ content: '';
63
+ }
64
+ @media (min-width: 641px) {
65
+ /* Above the breakpoint <details> is a no-op wrapper: the nav always
66
+ renders regardless of the native open/closed state, and there is
67
+ nothing to toggle. Newer browsers project non-summary content through
68
+ a ::details-content pseudo-element that the UA stylesheet sets to
69
+ `content-visibility: hidden` (plus a collapsed block-size) while
70
+ closed — overriding `display` on .sv-header__nav alone doesn't reach
71
+ past that ancestor, so it has to be reset here too. Older browsers
72
+ without ::details-content support just skip this rule; the `display`
73
+ override below is what reaches their `details:not([open]) > *` UA
74
+ rule instead. */
75
+ .sv-header__nav-toggle::details-content {
76
+ content-visibility: visible !important;
77
+ block-size: auto !important;
78
+ overflow: visible !important;
79
+ }
80
+ .sv-header__nav-toggle .sv-header__nav {
81
+ display: flex !important;
82
+ }
83
+ }
50
84
  @media (max-width: 640px) {
51
- .sv-header__nav {
52
- overflow-x: auto;
53
- flex-wrap: nowrap;
54
- scrollbar-width: none;
55
- -webkit-mask-image: linear-gradient(
56
- to right,
57
- transparent 0,
58
- black var(--sv-space-2),
59
- black calc(100% - var(--sv-space-2)),
60
- transparent 100%
61
- );
62
- mask-image: linear-gradient(
63
- to right,
64
- transparent 0,
65
- black var(--sv-space-2),
66
- black calc(100% - var(--sv-space-2)),
67
- transparent 100%
68
- );
85
+ .sv-header__nav-summary {
86
+ display: inline-flex;
87
+ align-items: center;
88
+ justify-content: center;
89
+ width: var(--sv-space-10);
90
+ height: var(--sv-space-10);
91
+ border: 1px solid var(--sv-border);
92
+ border-radius: var(--sv-radius-sm);
93
+ color: var(--sv-text-2);
94
+ cursor: pointer;
95
+ }
96
+ .sv-header__nav-summary:hover {
97
+ color: var(--sv-text);
98
+ border-color: var(--sv-border-strong);
69
99
  }
70
- .sv-header__nav::-webkit-scrollbar {
71
- display: none;
100
+ .sv-header__nav-summary:focus-visible {
101
+ outline: 2px solid var(--sv-accent-ink);
102
+ outline-offset: 2px;
103
+ }
104
+ /* Closed is the native default (no [open] attribute): the browser hides
105
+ everything here but <summary> without any rule of ours. Open state
106
+ turns the nav into a dropdown panel instead of the horizontal row. */
107
+ .sv-header__nav-toggle[open] .sv-header__nav {
108
+ position: absolute;
109
+ top: calc(100% + var(--sv-space-2));
110
+ right: 0;
111
+ flex-direction: column;
112
+ align-items: stretch;
113
+ gap: var(--sv-space-1);
114
+ min-width: 180px;
115
+ padding: var(--sv-space-2);
116
+ border: 1px solid var(--sv-border);
117
+ border-radius: var(--sv-radius-md);
118
+ background: var(--sv-surface);
119
+ }
120
+ .sv-header__nav-toggle[open] .sv-header__link {
121
+ padding: var(--sv-space-2) var(--sv-space-3);
122
+ /* WCAG 2.5.8 (AA) touch target, generous for a coarse pointer. */
123
+ min-height: 44px;
72
124
  }
73
125
  }
74
126
  .sv-header__link {
@@ -628,6 +680,14 @@ body.sv-body {
628
680
  cursor: not-allowed;
629
681
  opacity: 0.5;
630
682
  }
683
+ /* Invalid state reads the native aria-invalid attribute, not a boolean prop
684
+ — Input/Textarea/NativeSelect/FileInput need no change to support it. */
685
+ .sv-field[aria-invalid='true'] {
686
+ border-color: var(--sv-danger-ink);
687
+ }
688
+ .sv-field[aria-invalid='true']:focus-visible {
689
+ outline-color: var(--sv-danger-ink);
690
+ }
631
691
 
632
692
  .sv-field--textarea {
633
693
  height: auto;
@@ -666,6 +726,19 @@ body.sv-body {
666
726
  cursor: pointer;
667
727
  }
668
728
 
729
+ /* Helper/error text sat under a field, associated via aria-describedby. */
730
+ .sv-field-message {
731
+ display: block;
732
+ margin-top: var(--sv-space-2);
733
+ color: var(--sv-text-2);
734
+ font-family: var(--sv-font-body);
735
+ font-size: var(--sv-text-sm);
736
+ line-height: 1.5;
737
+ }
738
+ .sv-field-message--error {
739
+ color: var(--sv-danger-ink);
740
+ }
741
+
669
742
  /* No appearance:none — the native check/radio chrome follows color-scheme
670
743
  from theme.css, and accent-color tints it with the system accent. */
671
744
  .sv-check,
@@ -1369,6 +1442,149 @@ body.sv-body {
1369
1442
  outline-offset: 2px;
1370
1443
  }
1371
1444
 
1445
+ /* ---------- Separator ---------- */
1446
+ /* A hairline in the flat sense (Elevation section, DESIGN.md): a 1px slab of
1447
+ the same border color the rest of the system uses, never a shadow. Sizing
1448
+ is opposite on each axis by design — horizontal fills the inline
1449
+ direction and is a fixed 1px tall; vertical fills the block direction
1450
+ (the parent must give it a height) and is a fixed 1px wide. */
1451
+ .sv-separator {
1452
+ flex-shrink: 0;
1453
+ background: var(--sv-border);
1454
+ height: 1px;
1455
+ width: 100%;
1456
+ }
1457
+ .sv-separator--vertical {
1458
+ height: 100%;
1459
+ width: 1px;
1460
+ }
1461
+
1462
+ /* ---------- Progress ---------- */
1463
+ /* A track and a fill, same tonal pair the rest of the system uses for a
1464
+ surface-on-surface relationship: Surface 2 (one step up from Void) under
1465
+ the accent fill, never a shadow to suggest depth. The indicator's width is
1466
+ the one value in this component that cannot come from a token — it is
1467
+ `value`/`max` at render time — so it is the sole inline `style` in the
1468
+ server-safe catalog. */
1469
+ .sv-progress {
1470
+ position: relative;
1471
+ overflow: hidden;
1472
+ width: 100%;
1473
+ height: var(--sv-space-2);
1474
+ border-radius: var(--sv-radius-full);
1475
+ background: var(--sv-surface-2);
1476
+ }
1477
+ .sv-progress__indicator {
1478
+ height: 100%;
1479
+ background: var(--sv-accent);
1480
+ border-radius: var(--sv-radius-full);
1481
+ transition: width var(--sv-duration-fast) var(--sv-ease-hover);
1482
+ }
1483
+
1484
+ /* ---------- Pagination ---------- */
1485
+ /* A row of pill-shaped controls, same border/radius/surface vocabulary as
1486
+ the rest of the catalog — no shadow, one active state (Accent), one hover
1487
+ state (Surface 2). PaginationLink is deliberately NOT built on `.sv-btn`:
1488
+ it needs the active/current styling `.sv-btn` has no variant for, and
1489
+ reusing it would drag button-specific states (disabled opacity, size
1490
+ scale) into a control this system's own doc doesn't ask for. */
1491
+ .sv-pagination {
1492
+ display: flex;
1493
+ width: 100%;
1494
+ justify-content: center;
1495
+ }
1496
+ .sv-pagination__content {
1497
+ display: flex;
1498
+ flex-direction: row;
1499
+ align-items: center;
1500
+ gap: var(--sv-space-1);
1501
+ list-style: none;
1502
+ margin: 0;
1503
+ padding: 0;
1504
+ }
1505
+ .sv-pagination__item {
1506
+ display: flex;
1507
+ }
1508
+ .sv-pagination__link {
1509
+ display: inline-flex;
1510
+ align-items: center;
1511
+ justify-content: center;
1512
+ gap: var(--sv-space-1);
1513
+ min-width: var(--sv-space-10);
1514
+ height: var(--sv-space-10);
1515
+ padding: 0 var(--sv-space-3);
1516
+ border: 1px solid transparent;
1517
+ border-radius: var(--sv-radius-sm);
1518
+ background: transparent;
1519
+ color: var(--sv-text-2);
1520
+ font-family: var(--sv-font-body);
1521
+ font-size: var(--sv-text-base);
1522
+ text-decoration: none;
1523
+ cursor: pointer;
1524
+ transition:
1525
+ background var(--sv-duration-fast) var(--sv-ease-hover),
1526
+ color var(--sv-duration-fast) var(--sv-ease-hover),
1527
+ border-color var(--sv-duration-fast) var(--sv-ease-hover);
1528
+ }
1529
+ .sv-pagination__link:hover {
1530
+ background: var(--sv-surface-2);
1531
+ color: var(--sv-text);
1532
+ }
1533
+ .sv-pagination__link:focus-visible {
1534
+ outline: 2px solid var(--sv-accent-ink);
1535
+ outline-offset: 2px;
1536
+ }
1537
+ .sv-pagination__link--active {
1538
+ border-color: var(--sv-border);
1539
+ background: var(--sv-surface);
1540
+ color: var(--sv-text);
1541
+ }
1542
+ .sv-pagination__link--previous,
1543
+ .sv-pagination__link--next {
1544
+ padding: 0 var(--sv-space-4);
1545
+ }
1546
+
1547
+ .sv-pagination__ellipsis {
1548
+ display: inline-flex;
1549
+ align-items: center;
1550
+ justify-content: center;
1551
+ min-width: var(--sv-space-10);
1552
+ height: var(--sv-space-10);
1553
+ color: var(--sv-text-3);
1554
+ }
1555
+
1556
+ /* ---------- Chart ---------- */
1557
+ /* Visual geometry only — no scale engine, see design.md. `overflow: visible`
1558
+ is the one non-default here: an axis label sitting exactly at the SVG's
1559
+ own edge (a common case — the last tick on a bottom axis) must not be
1560
+ clipped by the viewBox the way an ordinary <svg> would clip it. Series
1561
+ color (line stroke, bar fill) is a caller prop, not a class, because the
1562
+ three series tokens (--sv-accent-ink/--sv-info-ink/--sv-warning-ink) are
1563
+ assigned per-series by the consumer, not fixed by the primitive. */
1564
+ .sv-chart {
1565
+ overflow: visible;
1566
+ font-family: var(--sv-font-mono);
1567
+ }
1568
+ .sv-chart__grid-line {
1569
+ stroke: var(--sv-border);
1570
+ stroke-width: 1;
1571
+ }
1572
+ .sv-chart__axis {
1573
+ stroke: var(--sv-text-2);
1574
+ stroke-width: 1;
1575
+ }
1576
+ .sv-chart__axis-label {
1577
+ fill: var(--sv-text-2);
1578
+ font-size: var(--sv-text-xs);
1579
+ }
1580
+ .sv-chart__line {
1581
+ stroke-linecap: round;
1582
+ stroke-linejoin: round;
1583
+ }
1584
+ .sv-chart__bar {
1585
+ shape-rendering: crispEdges;
1586
+ }
1587
+
1372
1588
  /* ---------- Reduced motion ---------- */
1373
1589
  /* This block lives here, at the end of style.css, and not in theme.css, for a
1374
1590
  cascade reason: `@media` adds no specificity, and README documents the
@@ -1394,7 +1610,9 @@ body.sv-body {
1394
1610
  .sv-badge,
1395
1611
  .sv-dialog__close,
1396
1612
  .sv-menu-item,
1397
- .sv-tabs__trigger {
1613
+ .sv-tabs__trigger,
1614
+ .sv-progress__indicator,
1615
+ .sv-pagination__link {
1398
1616
  transition: none;
1399
1617
  }
1400
1618
  /* AD-009 lets the portal family fade because open/closed carries state, but
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@still-void/ui",
3
- "version": "3.0.1",
3
+ "version": "3.2.0",
4
4
  "description": "Still Void design system — React/Next.js design system with a server-safe entry and a client-only entry, built on shadcn/ui.",
5
5
  "license": "MIT",
6
6
  "author": "Kalleo Pinheiro",