@filipgutica/design-system 1.0.27 → 1.0.29
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/language/decisions.md
CHANGED
|
@@ -13,9 +13,10 @@ Each entry records a choice this language made, the options it rejected, and why
|
|
|
13
13
|
| Quiet actions | Core | One recipe for Copy, Full size, dialog and drawer close, the project trigger, and the overflow menu trigger: transparent, `currentColor` at 6% on hover and 12% pressed (see Quiet action fill), no sink, and the control ring. The project trigger keeps the tint but takes the field corner (see One-line non-action controls). | Each had its own hover (`--color-row-hover`, a colour change only, or a 12% tint), so the same kind of action behaved differently. | rule present: `tests/design-foundations.test.mjs` "every state rule the guard requires exists in the catalogue"; tint recipe: `tests/catalogue/catalogue.spec.ts` "a hovering pointer adds a 6% fill, and a press 12%" |
|
|
14
14
|
| Quiet action fill | Core | `currentColor` at 6% under a hovering pointer and 12% pressed, a faint overlay after Astryx's ghost button overlay (the idea only; no code copied). The user approved it from rendered demos. | 12% hover and 18% pressed, the previous values, replaced by the fainter overlay the user chose. No fill on hover, with only the icon brightening: it hides the hit target, so the reader cannot see what a click will reach. | hover and press alpha: `tests/catalogue/catalogue.spec.ts` "a hovering pointer adds a 6% fill, and a press 12%"; no fill after a tap: "a tap leaves no fill behind" |
|
|
15
15
|
| One source per control | Core | Each control comes from the owning library's component or class, including a link styled as a button. | Local copies built from the same tokens drifted: a docs button had no raise and only faded when pressed. | copied rules unchanged: `tests/design-foundations.test.mjs` "example pages copy the catalogue rules for the shared controls and components they use unchanged" |
|
|
16
|
-
| Minimal by default | Core | Every interface starts minimal: the subtraction rules in [Minimal by default](DESIGN.md#minimal-by-default) for status, meta lines, rows, marks, actions, forms, boxes, and explanations, with a never-cut list, and words, boxes, and controls counted before and after each change. Prose keeps the copy rules. Taken from the PluginBench redesign, where cutting to these rules took Results from 412 to 306 words and 12 to 7 boxes, Queue from 34 to 28 controls, and New eval from 221 to 148 words (whole-page counts at 1280px). | A minimal pass per project: PluginBench needed two rounds of "less" before it got there. A fixed word or box budget: the right count depends on the task, and a budget would punish real data. Counting screen-reader-only text: it would reward cutting accessible names. The same rules for lessons and product prose: they need their explanation. |
|
|
17
|
-
| Status in one sentence | Core | A view's summary sentence carries the status, its numbers, and a status icon. An alert holds only a caveat or action the summary cannot carry, one per view at most. | A banner above the summary that repeats it: PluginBench's Results had both, and the banner added a box and a second reading of the same fact. | No
|
|
16
|
+
| Minimal by default | Core | Every interface starts minimal: the subtraction rules in [Minimal by default](DESIGN.md#minimal-by-default) for status, meta lines, rows, marks, actions, forms, boxes, and explanations, with a never-cut list, and words, boxes, and controls counted before and after each change. Prose keeps the copy rules. Taken from the PluginBench redesign, where cutting to these rules took Results from 412 to 306 words and 12 to 7 boxes, Queue from 34 to 28 controls, and New eval from 221 to 148 words (whole-page counts at 1280px). | A minimal pass per project: PluginBench needed two rounds of "less" before it got there. A fixed word or box budget: the right count depends on the task, and a budget would punish real data. Counting screen-reader-only text: it would reward cutting accessible names. The same rules for lessons and product prose: they need their explanation. | `tests/catalogue/minimal.spec.ts` "the console keeps the minimal rules with the … filter": one alert per view and none that repeats a badge, one-line rows, two visible actions per row at most, no shadow on a sticky bar, and no box in a box, on the application example |
|
|
17
|
+
| Status in one sentence | Core | A view's summary sentence carries the status, its numbers, and a status icon. An alert holds only a caveat or action the summary cannot carry, one per view at most. | A banner above the summary that repeats it: PluginBench's Results had both, and the banner added a box and a second reading of the same fact. | `tests/catalogue/minimal.spec.ts` "the No data monitor states its status in one sentence, with no badge or alert"; "the console keeps the minimal rules with the … filter" |
|
|
18
18
|
| Overflow menu | Core | Two or more secondary actions sit behind an icon-only quiet action with an SVG "more" icon, in a floating menu with concentric rows: the WAI-ARIA menu button pattern, which reka-ui's DropdownMenu and ui-sdk's Menu both follow. A destructive item comes last, after a separator, and confirms in a dialog. The primary action and a recovery action stay visible. | A `<details>` disclosure, as the project menu uses for links: an action menu built that way would behave differently from both headless libraries an implementation builds on. A `⋯` text glyph, as the PluginBench mockup used: a font draws its ink off the centre of its box (see Quiet actions). A menu for a single secondary action: it hides one action behind two presses. | keyboard path: `tests/catalogue/catalogue.spec.ts` "the overflow menu follows the menu button pattern"; corners: "each component renders the corner radius of its role, and no other part has one"; danger item contrast: "contrast: every danger menu item reaches 4.5:1" |
|
|
19
|
+
| Faint uncertainty | Core | In a chart, every point, line, and label stays at full strength; the intervals of the points that are not selected fade to about 20% opacity, and the selected point keeps strong intervals and an accent ring. Matrix cells show a value and an icon, with the verdict word only on cells with a clear result and the full words in every accessible name, and one key line under the chart. Taken from the PluginBench Results scatter and overview grid. | Strong intervals on every point: with three efforts and two packages, six pairs of intervals crossed and hid the selected one. Fading whole points: the data the reader compares would drop below non-text contrast. Hiding unselected intervals: it removes the uncertainty a reader needs to judge any point. A verdict word and a border on every cell: six boxes and six repeated words where only the clear results needed a word. | No test yet |
|
|
19
20
|
| Section mark | Identity | The `##` mark goes only on the page-level section headings (h2) of documentation, CLI tool, article, and product pages, which are mono with a `--color-border-subtle` rule above. Application and inline-visualization section headings are plain `--font-ui` semibold at `--text-xl` or smaller, with no mark and no rule. h3 and lower never take it. | The mark on every section heading: on a dense screen, such as a metrics dashboard with six sections, it repeated down the page and competed with the data. The mark on h2 and h3: deeper levels repeat more often. A per-page opt-out class: every application page would need to remember it. Dropping the mark: reading pages lose the folio identity that ties them to the `~/name` header. Mono application section headings without the mark: the mono face alone still reads as a document heading among compact sans rows. | No test yet |
|
|
20
21
|
| Command plate | Identity | Owner decision, 2026-11-15: a shell command uses the normal code block and its source well in light and dark, with a CSS-drawn `$ ` prompt in `--color-accent`. Header, Copy, compact layout, and focus follow the code block. Keep `--color-command-bg` and `--color-command-border` as compatibility aliases for `--color-code` and `--color-border-subtle`. Terminal captures stay unchanged. | A: the dark, hue-tinted plate in both modes. On a light page it was the darkest element and looked mismatched beside light source blocks; the owner noticed it on every site. B: a pale hue-tinted plate in light mode. It followed the mode but added a second tinted surface and still differed from source code; the owner preferred one consistent code surface (option C). | `tests/catalogue/catalogue.spec.ts`: "contrast: shell command text on the code well reaches 4.5:1", "contrast: the accent shell prompt on the code well reaches 3:1"; compatibility aliases and DS-1 exceptions: `tests/token-values.test.mjs`; shared code recipes: `tests/design-foundations.test.mjs`; imported-theme failures: `tests/theme-mapper.test.mjs` |
|
|
21
22
|
| Terminal colours | Identity | Owner decision, 2026-11-14: the 16 ANSI colours that terminal captures use are design-system tokens, `--color-terminal-ansi-0` to `-15`, plus `--color-terminal-ansi-4-bg` for a blue background that terminal text reads on. They keep the values `@filipgutica/ui` drew before, so no capture changes. Colours 1 to 15 reach 4.5:1 on `--color-terminal`; black (colour 0) is a background only, and dim text reads colour 8. | Literal defaults in `@filipgutica/ui`: colour data outside the design system, which breaks the rule that the design system owns colours and component libraries only apply them. One token per colour role, such as a success green: terminal programs choose the slot, so the palette must name slots. | contrast: the core `ansi` check in `theme-mapper/engine.js`, which `tests/site/site.spec.ts` "Themes: every contrast check passes" runs for every theme; parity with the 1.x token set: `tests/token-values.test.mjs` |
|
package/language/reference.html
CHANGED
|
@@ -243,6 +243,10 @@
|
|
|
243
243
|
.detail > * { padding: var(--space-4); }
|
|
244
244
|
.detail > * + * { border-top: 1px solid var(--color-border-subtle); }
|
|
245
245
|
.detail h2 { font-size: var(--text-md); }
|
|
246
|
+
/* A status the badge cannot carry is one sentence under the title, with the status's own icon and colour from
|
|
247
|
+
the list, instead of a badge and an alert. */
|
|
248
|
+
.status-line { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; font-size: var(--text-sm); }
|
|
249
|
+
.status-line .icon { margin-top: 0.125rem; }
|
|
246
250
|
/* A code block inside a panel becomes a flush section, not a nested box. */
|
|
247
251
|
.detail > .code { padding: 0; border: 0; border-radius: 0; border-top: 1px solid var(--color-border-subtle); box-shadow: none; }
|
|
248
252
|
/* Its source spans the section, under one hairline, as a live example's does. */
|
|
@@ -904,12 +908,13 @@
|
|
|
904
908
|
<div style="display:grid;gap:var(--space-2)">
|
|
905
909
|
<span class="caption mono">${m.id}</span>
|
|
906
910
|
<h2>${esc(m.name)}</h2>
|
|
907
|
-
|
|
911
|
+
${m.status === 'nodata'
|
|
912
|
+
? `<p class="status-line"><span class="st-${m.status}" aria-hidden="true">${icon(st.icon)}</span><span>No data for 42 minutes. Check ingestion before you trust this monitor.</span></p>`
|
|
913
|
+
: `<div><span class="badge ${st.badge}">${st.label}</span></div>`}
|
|
908
914
|
</div>
|
|
909
915
|
<figure class="chart-wrap">${chart(m)}
|
|
910
916
|
<figcaption class="caption">Last 24 hours. The dashed line is the threshold.</figcaption>
|
|
911
917
|
</figure>
|
|
912
|
-
${m.status === 'nodata' ? `<div class="alert warning">${icon('i-alert')}<p>No data for 42 minutes. Check ingestion before you trust this monitor.</p></div>` : ''}
|
|
913
918
|
<dl class="props">
|
|
914
919
|
<dt>Current</dt><dd class="mono num">${m.value}</dd>
|
|
915
920
|
<dt>Condition</dt><dd class="mono">${m.op} ${m.threshold} ${m.unit} for 10m</dd>
|
|
@@ -146,7 +146,7 @@ export async function renderReport(snapshot, { mode = 'inline', tokens = '' } =
|
|
|
146
146
|
const other = snapshot.categories.some((c) => c.key === 'other') ? `<p class="ov-muted">Other = categories outside ${snapshot.categories.filter((c) => c.key !== 'other').map((c) => escapeHtml(c.label)).join(', ')}.</p>` : ''
|
|
147
147
|
return `<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${escapeHtml(snapshot.title)}</title><style>${standalone}\n${css}\n${standaloneFields}</style></head><body><main id="ov-report" class="ov-report">
|
|
148
148
|
<header><h1>${escapeHtml(snapshot.title)}</h1><div class="ov-controls"><label for="ov-region">${escapeHtml(snapshot.filterLabel || 'Group')}</label><select id="ov-region">${options([['', 'All'], ...regions.map((r) => [r, r])])}</select><label for="ov-window">Time</label><select id="ov-window">${snapshot.windows.map((w) => `<option value="${escapeHtml(w.key)}"${w.key === snapshot.defaultWindow ? ' selected' : ''}>${escapeHtml(w.label)}</option>`).join('')}</select></div></header>
|
|
149
|
-
<p
|
|
149
|
+
<p class="ov-muted"><span id="ov-caption">${escapeHtml(view.caption)}</span> · ${escapeHtml(snapshot.source.provider)} · ${escapeHtml(snapshot.source.basis)} · ${escapeHtml(snapshot.source.sampling)}</p>
|
|
150
150
|
<div id="ov-summary" class="ov-summary" role="group" aria-label="Overall counts and percentages">${view.summary}</div><svg id="ov-bars" viewBox="0 0 100 6" preserveAspectRatio="none" role="img" aria-label="Category shares; exact counts and percentages are listed above">${view.bars}</svg>
|
|
151
151
|
<div class="ov-table-heading"><h2>By ${escapeHtml((snapshot.dimensionLabel || 'Item').toLowerCase())}</h2><span class="ov-muted">Count (% of row total)</span></div><div class="ov-scroll"><table><thead><tr><th>${escapeHtml(snapshot.dimensionLabel || 'Item')}</th><th>Total</th>${headers}</tr></thead><tbody id="ov-rows">${view.table}</tbody></table></div><section id="ov-mobile" class="ov-mobile" aria-label="${escapeHtml(snapshot.dimensionLabel || 'Item')} breakdown">${view.mobile}</section>
|
|
152
152
|
${other}<p id="ov-announcement" class="ov-sr-only" aria-live="polite">${escapeHtml(view.announcement)}</p><footer class="ov-muted"><p>${link}All percentages use ${escapeHtml(snapshot.source.unit)} in the selected population. No auto-refresh.</p><p id="ov-reference">${view.reference}</p><details><summary>Measurement and scope</summary><p>${escapeHtml(snapshot.source.dataset)} · ${escapeHtml(snapshot.source.scope)}</p><pre>${escapeHtml(snapshot.source.query)}</pre><p>Captured ${escapeHtml(snapshot.capturedAt)}. Each item in this view is counted once. The category counts add up to Total.</p></details></footer>
|
|
@@ -26,6 +26,17 @@ node <language>/visualizations/build-count-report.mjs snapshot.json report.html
|
|
|
26
26
|
|
|
27
27
|
Choose readable density for the actual number of items. Keep the overview and requested detail together without hiding important categories on narrow screens. The count-table layout and responsive behavior are described in the snapshot contract. Exact codes and category classes must have different labels.
|
|
28
28
|
|
|
29
|
+
## Keep the view minimal
|
|
30
|
+
|
|
31
|
+
Charts follow [Minimal by default](DESIGN.md#minimal-by-default): the data carries the view, and every mark, label, and line of text earns its place.
|
|
32
|
+
|
|
33
|
+
- **Emphasise the selection.** Every point, line, and label stays at full strength. Only the intervals of the points that are not selected fade, to about 20% opacity; the selected point keeps strong intervals and an accent ring, so colour is not its only cue. Never remove an interval, a provisional mark, or a sample size to quiet the view.
|
|
34
|
+
- **Cells carry a value and an icon.** In a matrix or heatmap, each cell shows its value and a direction or status icon, on a fill or nothing, not a border of its own. The verdict word, such as Better or Worse, shows only on cells with a clear result, the ones that take a status fill; an unclear cell shows the icon alone. Every cell's accessible name holds the full words: the row, the column, the value, and the verdict.
|
|
35
|
+
- **One key line.** Name the icons, line styles, and states on one line under the chart, not in a legend box, as [Mark the exceptions](DESIGN.md#minimal-by-default) asks.
|
|
36
|
+
- **Short captions.** Start with how to read the chart, such as "Up and left is better", in one or two sentences. Method notes and multiple-comparison caveats go in a closed disclosure beside the chart.
|
|
37
|
+
- **Direct labels.** Label points and series beside their marks, and move a label that would overlap another.
|
|
38
|
+
- **Bigger, not busier.** Give the space these cuts free to the chart and its key values.
|
|
39
|
+
|
|
29
40
|
## Verify and deliver
|
|
30
41
|
|
|
31
42
|
Read [delivery guidance](visualizations/delivery.md) for inline rendering, portable export, and the Claude UX brief.
|