@filipgutica/design-system 1.0.4 → 1.0.6

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.
@@ -71,7 +71,7 @@ Layer: Core. ui: `UiButton`.
71
71
  Layer: Core. ui: the `fg-quiet-action` class.
72
72
 
73
73
  - **Anatomy.** A native `<button>`, or the `<summary>` of a menu. Transparent fill, a transparent 1px border, `--radius-control`, and `--color-muted`. The project trigger overrides the corner with `--radius-field`, because it opens a menu and does not act (see [Site header](#site-header)). The content is centred in the box. An icon-only action holds an SVG icon, never a text glyph such as ×, because a font draws a glyph's ink off the centre of its box. Give the shared recipe zero specificity (`:where()`), so each component sets the action's size, place, and resting colour.
74
- - **States.** Hover turns the text `--color-text` and fills `currentColor` at 12% over transparent. Pressed fills `currentColor` at 18%, with no sink. Focus-visible is the focus ring, inset where the parent clips. An open menu keeps its trigger at the 12% tint, below the press. The code block's Copy keeps the block's text colour on hover. A disabled quiet action follows the shared [disabled](#rules-for-every-control) rule.
74
+ - **States.** Hover turns the text `--color-text` and fills `currentColor` at 6% over transparent, only where the pointer can hover (`@media (hover: hover)`). Pressed fills `currentColor` at 12%, with no sink. Focus-visible is the focus ring, inset where the parent clips. An open menu keeps its trigger at the 6% hover tint, below the press. The code block's Copy is `--color-muted` at rest and takes the block's text colour (`--color-code-text`) on hover and while its tick shows. A disabled quiet action follows the shared [disabled](#rules-for-every-control) rule.
75
75
  - **Do.** Use it for an action inside a component: Copy in a code block or command list, close in a dialog or drawer, Full size on a capture, and the project trigger.
76
76
  - **Don't.** An action that stands on its own in the page, such as Save or Next. That is a button.
77
77
  - **Keyboard and screen reader.** Native button behavior. An icon-only action needs `aria-label`.
@@ -406,15 +406,20 @@ Layer: Core. ui: none yet.
406
406
 
407
407
  Layer: Core. ui: `UiCodeBlock`.
408
408
 
409
- - **Anatomy.** A source code well: `--color-code`, transparent 1px border, `--radius-panel`, `--shadow-surface`. An optional header (at least 40px, `--color-surface-raised`, `--text-xs`, a `--color-border-subtle` rule below) holds the title in semibold, the language in muted text, and a Copy button. The `<pre>` has `--space-4` padding, scrolls in both directions, is at most 32rem tall, and sets `--font-mono` at `--text-code` with a line height of 1.65. Line numbers are muted and right-aligned. Syntax uses the `--color-syntax-*` tokens. A compact variant puts the code and the Copy button on one row, with no header.
409
+ - **Anatomy.** A frame that holds an optional header and the source panel.
410
+ - **Frame.** `--color-surface-raised`, a 1px `--color-border-subtle` border, `--radius-panel`, and `--shadow-surface`. Its padding is `0 var(--space-1) var(--space-1)` under a header, and `var(--space-1)` on every side without one.
411
+ - **Header.** At least 40px and `--text-xs`, on the frame with no fill and no rule below. It holds the title in semibold, the language in muted text, and a Copy button.
412
+ - **Source panel.** The `<pre>`: `--color-code`, a transparent 1px border, and `calc(var(--radius-panel) - var(--space-1))` corners (12px), so its curve is concentric with the frame's. It has `--space-4` padding, scrolls in both directions, is at most 32rem tall, and sets `--font-mono` at `--text-code` with a line height of 1.65. Line numbers are muted and right-aligned. Syntax uses the `--color-syntax-*` tokens.
413
+ - **Compact.** The panel and the Copy button share one row, with no header, and a `--space-1` column gap. The panel fills the row's height, so it sits `--space-1` from the frame and from Copy on every side, and centres its line.
410
414
  - **Phone text.** Set `text-size-adjust: 100%` (and `-webkit-text-size-adjust`) on the block, and align each line's items to the baseline, so iOS Safari does not enlarge one line.
411
- - **Copy.** Copies the code text only: no line numbers or prompts, and one line per row joined with newlines. A [quiet action](#quiet-action) at least 44×44 with an accessible name. Announce the result in a polite live region; in the compact variant the success message is visually hidden.
412
- - **States.** Rest, and focus-visible on Copy and on the `<pre>` when it scrolls. Copy takes the quiet action states and announces "Copied." or a failure.
415
+ - **Copy.** Copies the code text only: no line numbers or prompts, and one line per row joined with newlines. A [quiet action](#quiet-action) at least 44×44 with an accessible name. It is `--color-muted` at rest (7.09:1 on the frame in light, 6.63:1 in dark), and `--color-code-text` on hover and while the tick shows, which the script marks with `data-copied`. Announce the result in a polite live region; in the compact variant the success message is visually hidden.
416
+ - **Copy feedback.** This applies to every copy action: the code block's Copy, a token's Copy, and Copy link. On success, the icon turns into a plain tick (`#i-tick`) for 1.5s and then turns back. A second click within the 1.5s restarts the wait. The visible label, such as Copy, and the accessible name do not change, and no "Copied" text appears. The polite live region announces "Copied." or the failure. On failure, the icon does not change and the failure shows as before: a token's Copy shows "Copy failed" in place of its icon. Under reduced motion nothing changes, because the swap has no animation.
417
+ - **States.** Rest, and focus-visible on Copy and on the `<pre>` when it scrolls. Copy takes the quiet action states, shows the tick after a copy, and announces "Copied." or a failure.
413
418
  - **Do.** Use a code block for source with no live result. When the reader should see the result too, use the variant with a live example.
414
419
  - **Don't.** The same language label on every block of a page. Put useful setup context above the block instead.
415
- - **Keyboard and screen reader.** The `<pre>` is focusable when it scrolls. Its focus ring and the Copy button's ring are inset, because the block clips its content.
420
+ - **Keyboard and screen reader.** The `<pre>` is focusable when it scrolls. Its focus ring and the Copy button's ring are inset, because the block clips its content. The `<pre>` ring follows the panel's 12px corners.
416
421
  - **Motion.** None: the block is static, and Copy changes as a quiet action does.
417
- - **Forced colors.** The shadow drops and the transparent border draws as the system edge. Syntax colours take the system text colour, so code reads as plain text.
422
+ - **Forced colors.** The shadow drops, and the frame's border and the panel's transparent border draw as system edges. Syntax colours take the system text colour, so code reads as plain text.
418
423
 
419
424
  ### With a live example
420
425
 
@@ -423,7 +428,7 @@ ui: `UiExample`.
423
428
  - **Anatomy.** One frame: a `<figure>` with a 1px `--color-border-subtle` edge, `--radius-panel`, no shadow, and its content clipped to the corners. The stage comes first and holds the live preview, centred, at least 8rem tall, with `--space-8` padding. The code block follows directly below the stage, after one `--color-border-subtle` hairline. There is no header row and no language label. An optional caption follows the frame, as a [figure](#figure) caption does.
424
429
  - **Tokens.** Frame edge `--color-border-subtle` and corners `--radius-panel`. Stage `--color-bg`. Hairline `--color-border-subtle`.
425
430
  - **Stage.** The stage sits on the page background, not in a well or a panel. This is a named exception to the container [depth](DESIGN.md#depth) tier: a preview shows each component on the surface it sits on in a page; see [decisions](decisions.md).
426
- - **Source.** Inside the frame the code block has no radius, border, or shadow of its own, and it spans the frame's full width, not `--measure`.
431
+ - **Source.** Inside the frame the code block has no radius, border, padding, or shadow of its own, and it spans the frame's full width, not `--measure`. It takes `--color-code`, and its panel is flush with no corners, so the source fills the frame below the hairline.
427
432
  - **Copy.** Icon-only and named "Copy code", in the source's top right corner. It comes before the `<pre>` in DOM order, so the reader reaches it before the code.
428
433
  - **States.** The frame has no states. Components on the stage show their own states.
429
434
  - **Keyboard and screen reader.** Tab order is the stage's controls, then Copy, then the `<pre>`. Name the `<pre>` for its role, for example "Example source", when it scrolls. Focus rings on Copy and the `<pre>` are inset, because the frame clips its content.
@@ -435,14 +440,14 @@ ui: `UiExample`.
435
440
 
436
441
  Layer: Identity. ui: `UiCodeBlock` with a shell language or the compact variant.
437
442
 
438
- - **Anatomy.** A code block for a shell command, drawn as a dark plate in both themes: `--color-command-bg` with a `--color-command-border` edge (transparent in light). Text, syntax, and the caption all use `--color-terminal-text` or `--color-terminal-caption-text`. Each line starts with a `$ ` prompt in `--color-project-dark`, drawn with `content: "$ " / ""` and `user-select: none`, so copied and spoken text omit it. The plate sets `--color-focus: var(--color-project-dark)`, the dark-theme accent, so every ring on it, Copy's included, reads at 3:1 or more on the dark plate in both page themes.
443
+ - **Anatomy.** A code block for a shell command, drawn as a dark plate in both themes: the frame is `--color-command-bg` with a `--color-command-border` edge (transparent in light). The source panel is the plate darkened, `color-mix(in srgb, var(--color-command-bg) 55%, var(--color-terminal))`, set as the plate's `--color-code`, so it reads as a panel on the plate. Text, syntax, and the caption all use `--color-terminal-text` or `--color-terminal-caption-text`. Each line starts with a `$ ` prompt in `--color-project-dark`, drawn with `content: "$ " / ""` and `user-select: none`, so copied and spoken text omit it. The plate sets `--color-muted: var(--color-terminal-caption-text)`, so Copy at rest takes the caption colour, and `--color-focus: var(--color-project-dark)`, the dark-theme accent, so every ring on it, Copy's included, reads at 3:1 or more on the dark plate in both page themes.
439
444
  - **States.** As for the code block.
440
445
  - **Do.** Use it for a shell command the reader runs, one command per line.
441
446
  - **Don't.** A `$` typed into the command. CSS draws the prompt; a typed one is copied with the command.
442
447
  - **Keyboard and screen reader.** As for the code block.
443
448
  - **Motion.** None: as for the code block.
444
449
  - **Forced colors.** The dark plate drops to the system background, with system text and edge, and the prompt takes the system text colour.
445
- - **Contrast.** Plate text at least 4.5:1 and the prompt at least 3:1 on `--color-command-bg`, for each project hue.
450
+ - **Contrast.** Text at least 4.5:1 and the prompt at least 3:1 on the source panel, and the header text at least 4.5:1 on `--color-command-bg`, for each project hue.
446
451
 
447
452
  ## Terminal capture
448
453
 
@@ -10,7 +10,8 @@ Each entry records a choice this language made, the options it rejected, and why
10
10
  | Danger button | Core | A raised `--color-error-surface` button with danger-tinted text, mixed toward `--color-text` as status badges are. Hover and press deepen the tint, and press sinks it. The label must read at 4.5:1 on all three fills; where the mix misses, it falls back to `--color-text`, black, or white. | A flat button with `--color-text` and a hover border read as a pink secondary button, and pressing it showed nothing. | label contrast on all three fills: `tests/catalogue/catalogue.spec.ts` "contrast: every enabled danger button label reaches 4.5:1"; fills, raise, and sink: no test yet |
11
11
  | Pressed button | Core | Every variant but text sinks 1px, takes `--shadow-sink`, and changes its fill. Press is a button state: other controls show their latched state, and quiet actions tint without sinking. | The sink shadow alone was too faint to show a click, especially on secondary and ghost. | rule present: `tests/design-foundations.test.mjs` "every state rule the guard requires exists in the catalogue"; 1px move, sink, and fill: no test yet |
12
12
  | Busy button | Core | Busy also disables the button, so it takes no hover or press. | A busy button that still hovered and pressed looked ready for a second click. | No test yet |
13
- | Quiet actions | Core | One recipe for Copy, Full size, dialog and drawer close, and the project trigger: transparent, `currentColor` at 12% on hover and 18% pressed, 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: no test yet |
13
+ | Quiet actions | Core | One recipe for Copy, Full size, dialog and drawer close, and the project 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
+ | 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" |
14
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" |
15
16
  | 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 |
16
17
  | Command plate | Identity | A dark plate tinted with the project hue (`--color-command-bg`). Terminal captures keep the neutral plate. | The near-black plate looked too severe. | text and prompt contrast: `tests/catalogue/catalogue.spec.ts` "contrast: the command plate text reaches 4.5:1", "contrast: the command plate prompt reaches 3:1"; plate tint: no test yet |
@@ -21,6 +22,7 @@ Each entry records a choice this language made, the options it rejected, and why
21
22
  | Segmented label | Core | The selected label reads at 4.5:1 on its thumb, and an icon at 3:1 (`--color-segmented-current-text`): `--color-accent`, or the first of `--color-text`, black, and white that reads. | Accent at 3:1 for labels too, which let some hues' text fall below 4.5:1. | label contrast: `tests/catalogue/catalogue.spec.ts` "contrast: every selected segmented label on its thumb reaches 4.5:1"; icon at 3:1: no test yet |
22
23
  | Phone drawer trigger | Core | A page-level contents drawer opens from a soft secondary button with a three-line menu glyph and a label. The no-JavaScript fallback keeps a chevron, because it opens in place. The site shell opens its drawer from the header's icon-only Menu button instead (see Phone header). | A down chevron promised a dropdown, but the trigger opens a side drawer. | No test yet |
23
24
  | Shape follows role | Core | A pill acts, or sets a value in place with every option shown, on one line (`--radius-control`); a select, which opens a list, is a one-line non-action control. Small state marks are pills (`--radius-pill`). Places and picked rows are 6px (`--radius-inline`). Typed fields, controls whose label wraps, and one-line controls that are not actions are 10px (`--radius-field`). Containers are 16px (`--radius-panel`). A pill never holds text that can wrap, and nested rectangles are concentric. The token names predate the rule: they say inline, control, and field, where the uses are rows, pills, and typed fields. The names stay, because a rename breaks every page that uses them. | One shape for every control. All pills put wrapping labels in pills, which the toggle card, fields, and the raised pill row already rejected; all rectangles lose the shape that marks an action. A list of components for each token with no reason: a new component had no rule to pick from, and a reader took a 6px row beside a pill for an error. | rendered corners by role: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one", "the DESIGN.md shape table names each role token with its value"; slider track and thumb, and select picker: `tests/design-foundations.test.mjs` "the slider track, slider thumb, and select picker take their role’s corners"; no literal radius: `tests/design-foundations.test.mjs` "no page or the report stylesheet writes a literal corner radius" |
25
+ | Themes | Core | A theme sets only identity inputs: a hue for light and for dark, and optionally its two fonts. Shape, spacing, states, and status colours stay core, so actions are pills in every theme. Every theme passes the contrast guards in both modes. Graphite Indigo is the default; Pine and Mauve (the quiet theme) ship beside it. | The action shape as a theme input (a pill, the 10px field corner, or the 6px row corner): each rounded choice gives actions another role's shape, a select's at 10px and a tab's or row's at 6px, so shape stops telling an action from a field. Radix Themes and shadcn scale every corner together, and Primer, Carbon, Polaris, and Spectrum keep shape core; revisit it as a whole radius scale when a theme needs one. A grey-blue quiet theme (Slate): it sat beside the muted text and the info blue, so its selection read as metadata and its primary button looked disabled. | Per-theme contrast guards (`tests/design-foundations.test.mjs`), the catalogue's rendered recipes in every theme, and the Themes page tests |
24
26
  | Navigation row corners | Core | Navigation rows, header and strip rows, list-selection rows, collapsible group labels, and tabs take 6px corners (`--radius-inline`), except rows inside a floating menu (see Floating-menu rows). The owner chose the more rectangular rows from the Gate M mockup (2026-11-09). | 10px (`--radius-field`), the previous corners, shared with fields. | 6px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one"; Foundations swatch: `tests/design-foundations.test.mjs` "the Foundations current-row swatch and radius list follow the navigation row radius" |
25
27
  | Floating-menu rows | Core | Rows inside a floating menu, such as the project menu, are concentric with the 16px menu: `calc(var(--radius-panel) - var(--space-1))`, 12px, as select picker rows are. The owner approved it from the DS-3b comparison. | 6px like rail rows: a 6px row inside a 16px panel looks pinched. | 12px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one" |
26
28
  | One-line non-action controls | Core | A one-line control that is not an action takes the 10px field corner (`--radius-field`), as a select does: the select, the project-menu trigger, the labelled contents trigger and its no-JavaScript summary ("On this page"), and the skip link. The project trigger keeps the quiet-action tint. The icon-only Menu button stays round. The owner chose it on 2026-11-10. | The pill (`--radius-control`): a pill means an action, and these controls open a menu or list, pick a value, or move focus. 16px (`--radius-panel`), like the menu and other floating layers: on a one-line control 40 to 44px tall it reads almost as a pill. | 10px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one" |
@@ -44,9 +44,9 @@ p { max-width: var(--measure); color: var(--color-muted); font-size: var(--text-
44
44
  .command pre { min-width: 0; flex: 1; margin: 0; overflow-x: auto; font-size: var(--text-sm); }
45
45
  /* Copy is a quiet action: components.html#quiet-action, unchanged. The page adds its size and colour only. */
46
46
  :where(.quiet-action) { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; font: inherit; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
47
- .quiet-action.is-hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 12%, transparent); }
48
- @media (hover: hover) { .quiet-action:hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 12%, transparent); } }
49
- .quiet-action:is(:active, .is-active):where(:not(:disabled)) { background: color-mix(in srgb, currentColor 18%, transparent); }
47
+ .quiet-action.is-hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 6%, transparent); }
48
+ @media (hover: hover) { .quiet-action:hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 6%, transparent); } }
49
+ .quiet-action:is(:active, .is-active):where(:not(:disabled)) { background: color-mix(in srgb, currentColor 12%, transparent); }
50
50
  .quiet-action:disabled { opacity: 0.58; cursor: not-allowed; }
51
51
  .command button { flex: none; min-width: var(--control-lg); min-height: var(--control-lg); color: var(--color-terminal-caption-text); }
52
52
  .meta, #copy-status { color: var(--color-muted); font-size: var(--text-sm); }
@@ -80,9 +80,9 @@
80
80
  .btn:not(.text):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { --depth: var(--shadow-sink); transform: translateY(1px); }
81
81
  .btn:disabled { --depth: none; opacity: 0.58; cursor: not-allowed; }
82
82
  :where(.quiet-action) { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; font: inherit; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
83
- .quiet-action.is-hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 12%, transparent); }
84
- @media (hover: hover) { .quiet-action:hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 12%, transparent); } }
85
- .quiet-action:is(:active, .is-active):where(:not(:disabled)) { background: color-mix(in srgb, currentColor 18%, transparent); }
83
+ .quiet-action.is-hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 6%, transparent); }
84
+ @media (hover: hover) { .quiet-action:hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 6%, transparent); } }
85
+ .quiet-action:is(:active, .is-active):where(:not(:disabled)) { background: color-mix(in srgb, currentColor 12%, transparent); }
86
86
  .quiet-action:disabled { opacity: 0.58; cursor: not-allowed; }
87
87
  /* .is-focus pins the focus state in the Focus and motion specimens. */
88
88
  .is-focus { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
@@ -245,6 +245,8 @@
245
245
  .detail h2 { font-size: var(--text-md); }
246
246
  /* A code block inside a panel becomes a flush section, not a nested box. */
247
247
  .detail > .code { padding: 0; border: 0; border-radius: 0; border-top: 1px solid var(--color-border-subtle); box-shadow: none; }
248
+ /* Its source spans the section, under one hairline, as a live example's does. */
249
+ .detail > .code > pre { border-width: 1px 0 0; border-color: var(--color-border-subtle); border-radius: 0; }
248
250
 
249
251
  /* Properties */
250
252
  .props { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-4); font-size: var(--text-sm); margin: 0; }
@@ -267,32 +269,38 @@
267
269
  }
268
270
 
269
271
  /* Code block: components.html#code-block, unchanged. */
270
- .code { width: 100%; max-width: var(--measure); min-width: 0; overflow: hidden; border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-code); color: var(--color-code-text); box-shadow: var(--shadow-surface); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
271
- .code-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); min-height: 2.5rem; padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3); border-bottom: 1px solid var(--color-border-subtle); background: var(--color-surface-raised); font-size: var(--text-xs); }
272
+ .code { width: 100%; max-width: var(--measure); min-width: 0; overflow: hidden; padding: var(--space-1); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-panel); background: var(--color-surface-raised); color: var(--color-code-text); box-shadow: var(--shadow-surface); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
273
+ /* The header sits on the frame, so the frame drops its top padding under one. */
274
+ .code:has(> .code-head) { padding-top: 0; }
275
+ .code-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); min-height: 2.5rem; padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3); font-size: var(--text-xs); }
272
276
  .code-head b { font-weight: var(--weight-semibold); }
273
277
  .code-head .lang { color: var(--color-muted); }
274
278
  /* Copy is a quiet action; this sets its size and place. */
275
279
  .copy { display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; min-width: var(--control-lg); min-height: var(--control-lg); margin-left: auto; padding: var(--space-1) 0.375rem; color: inherit; }
276
- /* The code block has its own palette, so its Copy keeps the plate's text colour on hover. */
277
- .code .copy.is-hover:where(:not(:disabled)) { color: inherit; }
278
- @media (hover: hover) { .code .copy:hover:where(:not(:disabled)) { color: inherit; } }
280
+ /* Copy is muted at rest. The code block has its own palette, so on hover and while the tick shows it takes the block's text colour. */
281
+ .code .copy { color: var(--color-muted); }
282
+ .code .copy[data-copied] { color: var(--color-code-text); }
283
+ .code .copy.is-hover:where(:not(:disabled)) { color: var(--color-code-text); }
284
+ @media (hover: hover) { .code .copy:hover:where(:not(:disabled)) { color: var(--color-code-text); } }
279
285
  /* Inset: the code block clips its content. */
280
286
  .code pre:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
281
287
  .code .copy.quiet-action:is(:focus-visible, .is-focus) { outline-offset: calc(var(--focus-width) * -1); }
282
- .code pre { margin: 0; padding: var(--space-4); overflow: auto; max-height: 32rem; font-size: var(--text-code); line-height: 1.65; tab-size: 2; }
288
+ /* The source is an inset panel. It sits --space-1 inside the frame, so its corners are concentric with the frame's. */
289
+ .code pre { margin: 0; padding: var(--space-4); overflow: auto; max-height: 32rem; border: 1px solid transparent; border-radius: calc(var(--radius-panel) - var(--space-1)); background: var(--color-code); font-size: var(--text-code); line-height: 1.65; tab-size: 2; }
283
290
  /* Each line is a baseline-aligned row, so a prompt or line number sits on the text's baseline. */
284
291
  .code .line { display: flex; align-items: baseline; min-height: 1.65em; }
285
292
  .code .line > span { white-space: pre; }
286
293
  .code .ln { min-width: 2.5em; padding-right: 1em; flex: none; text-align: right; color: var(--color-muted); user-select: none; }
287
294
  .code .k { color: var(--color-syntax-keyword); } .code .s { color: var(--color-syntax-string); } .code .n { color: var(--color-syntax-number); } .code .c { color: var(--color-syntax-comment); }
288
- .code.compact { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
289
- .code.compact pre { padding: var(--space-2) var(--space-3); }
290
- .code.compact .copy { margin: var(--space-1); }
295
+ /* The panel fills the row beside Copy, so it sits --space-1 from the frame and from Copy on every side, and centres its line. */
296
+ .code.compact { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-1); }
297
+ .code.compact pre { align-content: center; padding: var(--space-2) var(--space-3); }
291
298
 
292
299
  /* Command plate: components.html#command-plate, unchanged. */
293
- /* The plate is dark in both themes, so its focus ring takes the dark-theme accent, which reaches 3:1 on it. */
294
- .code.command { --color-code-text: var(--color-terminal-text); --color-focus: var(--color-project-dark); border-color: var(--color-command-border); background: var(--color-command-bg); color: var(--color-terminal-text); }
295
- .code.command .code-head { border-color: var(--color-command-border); background: transparent; color: var(--color-terminal-caption-text); }
300
+ /* The plate is dark in both themes, so its focus ring takes the dark-theme accent, which reaches 3:1 on it,
301
+ and muted text, such as Copy at rest, takes the caption colour. */
302
+ .code.command { --color-code: color-mix(in srgb, var(--color-command-bg) 55%, var(--color-terminal)); --color-code-text: var(--color-terminal-text); --color-muted: var(--color-terminal-caption-text); --color-focus: var(--color-project-dark); border-color: var(--color-command-border); background: var(--color-command-bg); color: var(--color-terminal-text); }
303
+ .code.command .code-head { color: var(--color-terminal-caption-text); }
296
304
  .code.command .code-head .lang { color: var(--color-terminal-caption-text); }
297
305
  /* The prompt is drawn by CSS, so copied and spoken text omit it. */
298
306
  .code.command .line::before { content: "$ " / ""; flex: none; white-space: pre; color: var(--color-project-dark); user-select: none; }
@@ -436,6 +444,7 @@
436
444
  <symbol id="i-circle" viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.5"/></symbol>
437
445
  <symbol id="i-alert" viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.5"/><path d="M8 5v3.5M8 10.8v.2"/></symbol>
438
446
  <symbol id="i-check" viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.5"/><path d="M5.8 8.2l1.5 1.5 2.9-3"/></symbol>
447
+ <symbol id="i-tick" viewBox="0 0 16 16"><path d="M3.5 8.5l3 3 6-7"/></symbol>
439
448
  <symbol id="i-dash" viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.5" stroke-dasharray="2 2"/></symbol>
440
449
  <symbol id="i-help" viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.5"/><path d="M6.6 6.4a1.5 1.5 0 1 1 2 1.4c-.4.2-.6.5-.6.9M8 10.8v.2"/></symbol>
441
450
  <symbol id="i-search" viewBox="0 0 16 16"><circle cx="7" cy="7" r="4.5"/><path d="M10.5 10.5 14 14"/></symbol>
@@ -499,6 +508,7 @@
499
508
  </div>
500
509
  </div>
501
510
  <aside class="panel detail" id="detail" aria-live="polite"></aside>
511
+ <p class="sr-only" role="status" id="copy-status"></p>
502
512
  </div>
503
513
 
504
514
  <div class="doc">
@@ -775,6 +785,7 @@
775
785
  MONITORS.forEach((m, i) => { m.data = series(m, 11 + i * 7); });
776
786
 
777
787
  const icon = (id) => `<svg class="icon" aria-hidden="true"><use href="#${id}"/></svg>`;
788
+ const copyStatus = document.getElementById('copy-status');
778
789
  const esc = (s) => String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;');
779
790
 
780
791
  const pathFor = (data, w, h, max, pad = 0) => {
@@ -891,10 +902,20 @@
891
902
  </div>
892
903
  <div class="cluster"><button class="btn secondary" type="button" data-size="sm">Open in explorer</button><button class="btn ghost" type="button" data-size="sm">Mute</button></div>`;
893
904
  const copy = detail.querySelector('.copy');
894
- copy.addEventListener('click', () => {
895
- const label = copy.lastElementChild;
896
- const done = (text) => { label.textContent = text; setTimeout(() => { label.textContent = 'Copy'; }, 1400); };
897
- try { navigator.clipboard.writeText(code).then(() => done('Copied'), () => done('Copy failed')); } catch (e) { done('Copy failed'); }
905
+ // A copy shows a tick for 1.5s and announces the result. Each completed copy restarts the wait, so copies
906
+ // still in flight do not stack timers; a failure puts the copy icon back at once.
907
+ const use = copy.querySelector('use');
908
+ const restore = () => { use.setAttribute('href', '#i-copy'); delete copy.dataset.copied; };
909
+ let wait;
910
+ copy.addEventListener('click', async () => {
911
+ let ok = true;
912
+ try { await navigator.clipboard.writeText(code); } catch (e) { ok = false; }
913
+ clearTimeout(wait);
914
+ copyStatus.textContent = ok ? 'Copied.' : 'Copy failed. Select the query instead.';
915
+ if (!ok) { restore(); return; }
916
+ use.setAttribute('href', '#i-tick');
917
+ copy.dataset.copied = '';
918
+ wait = setTimeout(restore, 1500);
898
919
  });
899
920
  };
900
921
 
@@ -1,11 +1,13 @@
1
1
  /*
2
- * Design language tokens. Generated from tokens/graphite-indigo.json by scripts/build-tokens.mjs in
3
- * @filipgutica/design-system: edit the JSON and run `pnpm tokens:build`. Do not edit this file.
2
+ * Design language tokens. Generated from tokens/core.json and tokens/themes/graphite-indigo.json
3
+ * by scripts/build-tokens.mjs in @filipgutica/design-system: edit the JSON and run
4
+ * `pnpm tokens:build`. Do not edit this file.
4
5
  * DESIGN.md names these tokens; it never repeats their values.
5
6
  *
6
- * Two layers. The identity block at the top of :root is the project's own: its hue
7
- * pair and fonts. A new project keeps this file unchanged and sets those lines on
8
- * :root in its own stylesheet, loaded after this one. The dark blocks switch
7
+ * Two layers. The identity block at the top of :root is the theme's own: its hue
8
+ * pair and fonts. This file carries the default theme. Another theme keeps this file
9
+ * unchanged and loads its themes/<id>.css after it, on :root; a new project can set
10
+ * those lines on :root in its own stylesheet the same way. The dark blocks switch
9
11
  * --color-project to --color-project-dark, so the override needs no dark rule. Check
10
12
  * --color-accent-text at 4.5:1 on the new hue and override it too when it falls short.
11
13
  * The terminal plate tokens also belong to the identity layer; every other line is core.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filipgutica/design-system",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Filip's design language, tokens, and component catalogue for any framework",
5
5
  "type": "module",
6
6
  "sideEffects": [