@filipgutica/design-system 2.0.0 → 2.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.
@@ -19,12 +19,16 @@
19
19
  /* Navigation rows: components.html#navigation-list, unchanged. The sidebar adds icons and counts. */
20
20
  .navlist { display: grid; gap: 0.125rem; width: min(100%, 240px); }
21
21
  .navlist .group-label { padding: 0 var(--space-3) var(--space-1); color: var(--color-muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
22
- .navlist a { position: relative; display: flex; align-items: center; min-height: var(--row); padding-inline: var(--space-3); border-radius: var(--radius-field); color: var(--color-muted); font-size: var(--text-sm); text-decoration: none; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
22
+ .navlist a { position: relative; display: flex; align-items: center; min-height: var(--row); padding-inline: var(--space-3); border-radius: var(--radius-inline); color: var(--color-muted); font-size: var(--text-sm); text-decoration: none; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
23
23
  .navlist a:is(:hover, .is-hover) { background: var(--color-row-hover); color: var(--color-text); text-decoration: none; }
24
24
  /* The Foundations specimens share the current-page and location rules, forced colors included. */
25
25
  .navlist a[aria-current="page"], .nav-current-sample { background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); color: var(--color-nav-current-text); font-weight: var(--weight-medium); }
26
26
  .navlist a[aria-current="location"], .pip-sample { color: var(--color-text); font-weight: var(--weight-medium); }
27
27
  .navlist a[aria-current="location"]::before, .pip-sample::before { content: ""; position: absolute; inset-inline-start: var(--space-1); width: 3px; height: 14px; border-radius: var(--radius-pill); background: var(--color-accent); }
28
+ @supports (text-box: trim-both cap alphabetic) {
29
+ .navlist a:not(:has(> *)) { display: block; align-content: center; padding-block: var(--space-2); text-box: trim-both cap alphabetic; }
30
+ .navlist a:not(:has(> *))[aria-current="location"]::before { inset-block: 0; margin-block: auto; }
31
+ }
28
32
  /* Inset: the rail and the drawer scroll. */
29
33
  .navlist a:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
30
34
  /* Fills and shadows drop. The current page takes a system border; the in-page location keeps
@@ -98,11 +102,13 @@
98
102
  kbd { font-size: var(--text-xs); color: var(--color-muted); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-inline); padding: 0 var(--space-1); line-height: 1.125rem; background: var(--color-surface-raised); }
99
103
 
100
104
  /* Tabs, for the Foundations specimens: components.html#tabs, unchanged. */
101
- .tablist { display: flex; width: max-content; max-width: 100%; overflow-x: auto; padding: var(--space-1); }
102
- .tab { flex: none; min-height: var(--control-md); padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-field); background: transparent; color: var(--color-muted); font: var(--weight-medium) var(--text-md) / var(--leading) var(--font-ui); white-space: nowrap; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
105
+ .tablist { --glide-lead: 260ms; --glide-trail: 300ms; display: flex; width: max-content; max-width: 100%; overflow-x: auto; padding: var(--space-1); isolation: isolate; }
106
+ .tab { position: relative; flex: none; min-height: var(--control-md); padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-inline); background: transparent; color: var(--color-muted); font: var(--weight-medium) var(--text-md) / var(--leading) var(--font-ui); white-space: nowrap; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
103
107
  .tab:is(:hover, .is-hover) { background: var(--color-row-hover); color: var(--color-text); }
104
- /* The selected tab takes the navigation row's lifted fill and motion: one selected state for both. */
105
- .tab[aria-selected="true"] { background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); color: var(--color-nav-current-text); }
108
+ /* The selected tab takes the navigation row's lifted fill: one selected state for both. The fill is a
109
+ ::before layer behind the label; in the catalogue it glides between tabs. */
110
+ .tab[aria-selected="true"] { background: transparent; color: var(--color-nav-current-text); }
111
+ .tab[aria-selected="true"]::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); pointer-events: none; }
106
112
  /* Inset: the tab list scrolls sideways, which would clip an outer ring. */
107
113
  .tab:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
108
114
 
@@ -140,6 +146,7 @@
140
146
  @media (forced-colors: active) {
141
147
  /* The lifted fill drops, so the selected tab takes a system border; the padding absorbs it. */
142
148
  .tab[aria-selected="true"] { border: 2px solid Highlight; padding: calc(var(--space-2) - 2px) calc(var(--space-3) - 2px); }
149
+ .tab[aria-selected="true"]::before { content: none; }
143
150
  .segmented button[aria-pressed="true"] { forced-color-adjust: none; color: HighlightText; }
144
151
  .segmented button[aria-pressed="true"]::before { forced-color-adjust: none; background: Highlight; }
145
152
  /* The pressed option opts out of adjustment, so its ring would keep the accent. The ring sits on the track, so it takes the track's text colour. */
@@ -353,7 +360,7 @@
353
360
  .line-border { display: block; height: 0; border-top: 1px solid var(--color-border); }
354
361
  /* The pip and current-row samples take their state from the navigation row rules above. */
355
362
  .pip-sample { position: relative; display: inline-flex; align-items: center; min-height: var(--row); padding: 0 var(--space-3); font-size: var(--text-sm); }
356
- .nav-current-sample { display: inline-flex; align-items: center; min-height: var(--row); padding: 0 var(--space-3); border-radius: var(--radius-field); font-size: var(--text-sm); }
363
+ .nav-current-sample { display: inline-flex; align-items: center; min-height: var(--row); padding: 0 var(--space-3); border-radius: var(--radius-inline); font-size: var(--text-sm); }
357
364
  .header-rule { display: block; height: 0; border-top: 1px solid var(--color-text); }
358
365
  .elevation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); padding: var(--space-6); border-radius: var(--radius-panel); background: var(--color-bg); }
359
366
  .elevation > div { display: grid; gap: var(--space-1); padding: var(--space-4); border-radius: var(--radius-panel); background: var(--color-surface-raised); font-size: var(--text-sm); }
@@ -427,7 +434,7 @@
427
434
  <aside class="sidebar" aria-label="Workspace">
428
435
  <div class="workspace"><span class="mark" aria-hidden="true">A</span>Analytics</div>
429
436
  <nav class="navlist" aria-label="Main"><span class="group-label">Workspace</span>
430
- <a href="#monitors" aria-current="page"><svg class="icon"><use href="#i-list"/></svg>Monitors<span class="count">6</span></a>
437
+ <a href="reference.html" aria-current="page"><svg class="icon"><use href="#i-list"/></svg>Monitors<span class="count">6</span></a>
431
438
  <a href="components.html"><svg class="icon"><use href="#i-chart"/></svg>Components</a>
432
439
  <a href="#foundations"><svg class="icon"><use href="#i-doc"/></svg>Foundations</a>
433
440
  </nav>
@@ -655,8 +662,8 @@
655
662
  <h3 id="shape-title">Shape</h3>
656
663
  <p class="note">Pill buttons, rounded fields and toggle cards, large-radius panels, and inline corners. Cards never take a pill.</p>
657
664
  <ul class="specs">
658
- <li class="spec" data-token="--radius-inline"><div class="spec-meta"><code>--radius-inline</code><span class="value"></span><span class="use">Inline elements and checkboxes</span></div><i class="shape-box" style="border-radius:var(--radius-inline)"></i></li>
659
- <li class="spec" data-token="--radius-field"><div class="spec-meta"><code>--radius-field</code><span class="value"></span><span class="use">Inputs, selects, textareas, navigation rows, tabs, and toggle cards</span></div><i class="shape-box" style="border-radius:var(--radius-field)"></i></li>
665
+ <li class="spec" data-token="--radius-inline"><div class="spec-meta"><code>--radius-inline</code><span class="value"></span><span class="use">Inline elements, checkboxes, navigation rows, list-selection rows, and tabs</span></div><i class="shape-box" style="border-radius:var(--radius-inline)"></i></li>
666
+ <li class="spec" data-token="--radius-field"><div class="spec-meta"><code>--radius-field</code><span class="value"></span><span class="use">Inputs, selects, textareas, toggle cards, and pager links</span></div><i class="shape-box" style="border-radius:var(--radius-field)"></i></li>
660
667
  <li class="spec" data-token="--radius-control"><div class="spec-meta"><code>--radius-control</code><span class="value"></span><span class="use">Buttons, quiet actions, segmented controls, and their thumbs</span></div><i class="shape-box" style="border-radius:var(--radius-control)"></i></li>
661
668
  <li class="spec" data-token="--radius-panel"><div class="spec-meta"><code>--radius-panel</code><span class="value"></span><span class="use">Wells, plates, panels, radio cards, alerts, and floating layers</span></div><i class="shape-box" style="border-radius:var(--radius-panel)"></i></li>
662
669
  <li class="spec" data-token="--radius-pill"><div class="spec-meta"><code>--radius-pill</code><span class="value"></span><span class="use">Status badges and switch tracks</span></div><i class="shape-box" style="border-radius:var(--radius-pill)"></i></li>
@@ -670,8 +677,8 @@
670
677
  <li class="spec"><div class="spec-meta"><code>1px --color-border-subtle</code><span class="use">Figures, dividers, and the rule above a section heading</span></div><i class="line-subtle"></i></li>
671
678
  <li class="spec"><div class="spec-meta"><code>1px --color-border</code><span class="use">Unchecked checkbox and radio edges</span></div><div class="cluster" inert><label class="check"><input type="checkbox">Unchecked</label><label class="check"><input type="radio" name="border-radio">Radio</label></div></li>
672
679
  <li class="spec"><div class="spec-meta"><code>1px --color-text</code><span class="use">Solid rule below the shared site header</span></div><i class="header-rule"></i></li>
673
- <li class="spec"><div class="spec-meta"><code>--color-nav-current, --shadow-nav-current</code><span class="use">Current page, selected tab, and selected list row: a lifted fill with a faint accent tint, <code>--color-nav-current-text</code>, and no border or underline</span></div><div inert><div class="tablist" role="tablist" aria-label="Selected tab sample"><button class="tab" type="button" role="tab" aria-selected="true">Overview</button><button class="tab" type="button" role="tab" aria-selected="false">Settings</button></div></div></li>
674
- <li class="spec"><div class="spec-meta"><code>3×14 --color-accent pip</code><span class="use">Current location in the page, with medium weight and no fill</span></div><span class="pip-sample">Thresholds</span></li>
680
+ <li class="spec"><div class="spec-meta"><code>--color-nav-current, --shadow-nav-current</code><span class="use">Current page, a section rail's current section, selected tab, and selected list row: a lifted fill with a faint accent tint, <code>--color-nav-current-text</code>, and no border or underline</span></div><div inert><div class="tablist" role="tablist" aria-label="Selected tab sample"><button class="tab" type="button" role="tab" aria-selected="true">Overview</button><button class="tab" type="button" role="tab" aria-selected="false">Settings</button></div></div></li>
681
+ <li class="spec"><div class="spec-meta"><code>3×14 --color-accent pip</code><span class="use">Current location in a strip or contents list, with medium weight and no fill</span></div><span class="pip-sample">Thresholds</span></li>
675
682
  <li class="spec"><div class="spec-meta"><code>1px transparent</code><span class="use">Borderless controls retain a border for forced colors; pressed segmented thumbs raise without a ring</span></div><div inert><div class="segmented" role="group" aria-label="Raised thumb sample"><button type="button" aria-pressed="true">List</button><button type="button" aria-pressed="false">Board</button></div></div></li>
676
683
  <li class="spec"><div class="spec-meta"><code>tint without a visible border</code><span class="use">Alerts keep a transparent 1px border for forced colors</span></div><div class="alert warning"><svg class="icon" aria-hidden="true"><use href="#i-alert"/></svg><p>No data for 42 minutes.</p></div></li>
677
684
  </ul>
@@ -956,14 +963,12 @@
956
963
  // Foundations: resolved token values and contrast.
957
964
  const foundations = document.getElementById('foundations');
958
965
 
959
- // Main navigation: Monitors is the current page until the reader follows a link into Foundations.
960
- // Foundations is a location in this page, so it takes the location pip instead of the page fill.
961
- const monitorsLink = document.querySelector('.navlist a[href="#monitors"]');
966
+ // Main navigation: Monitors links to this page, so it stays the current page (aria-current="page").
967
+ // Foundations is a location in this page, so it takes the location pip while the reader is there.
962
968
  const foundationsLink = document.querySelector('.navlist a[href="#foundations"]');
963
969
  const markLocation = () => {
964
970
  const target = document.getElementById(location.hash.slice(1));
965
971
  const inFoundations = Boolean(target && foundations.contains(target));
966
- if (inFoundations) monitorsLink.removeAttribute('aria-current'); else monitorsLink.setAttribute('aria-current', 'page');
967
972
  if (inFoundations) foundationsLink.setAttribute('aria-current', 'location'); else foundationsLink.removeAttribute('aria-current');
968
973
  };
969
974
  addEventListener('hashchange', markLocation);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filipgutica/design-system",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "Filip's design language, tokens, and component catalogue for any framework",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -34,7 +34,10 @@
34
34
  "tokens:check": "node scripts/build-tokens.mjs --check",
35
35
  "test": "node --test tests/*.test.mjs",
36
36
  "test:react": "tsc -p tests/react-smoke && playwright test -c tests/react-smoke",
37
- "verify": "pnpm tokens:check && pnpm test && pnpm test:react && pnpm pack --dry-run && publint"
37
+ "test:catalogue": "tsc -p tests/catalogue && playwright test -c tests/catalogue",
38
+ "site:build": "node scripts/build-site.mjs",
39
+ "test:site": "pnpm site:build && tsc -p tests/site && playwright test -c tests/site",
40
+ "verify": "pnpm tokens:check && pnpm test && pnpm test:react && pnpm test:catalogue && pnpm test:site && pnpm pack --dry-run && publint"
38
41
  },
39
42
  "engines": {
40
43
  "node": ">=22.12"
@@ -54,6 +57,7 @@
54
57
  },
55
58
  "homepage": "https://github.com/filipgutica/design-system#readme",
56
59
  "devDependencies": {
60
+ "@axe-core/playwright": "^4.14.0",
57
61
  "@commitlint/cli": "^21.2.2",
58
62
  "@commitlint/config-conventional": "^21.2.2",
59
63
  "@playwright/test": "^1.65.0",