@filipgutica/design-system 1.0.26 → 1.0.27

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.
@@ -259,7 +259,7 @@ Every interface built with this language starts minimal: application screens, mo
259
259
  - **One meta line.** Context, such as who ran it, the scope, the size, and liveness ("still running"), sits on one muted line under the title, joined with " · ". Its details sit behind a disclosure on that line.
260
260
  - **One-line rows.** Data rows in a table or list are one line, `--row` tall. Show a direction, trend, or unit as a glyph (↑ or ↓) and put the words in the accessible name. Secondary detail goes in the selected row's detail or a disclosure.
261
261
  - **Mark the exceptions.** Status columns, badges, and status icons show only the values that differ from the default. The default has no mark, and one key line names it. Drop an icon that repeats a badge or label in the same row.
262
- - **Primary action in reach.** A row or card shows its primary next action as a button, plus either one secondary button or, for two or more secondary actions, one overflow menu trigger. A failed or blocked item keeps its recovery action, such as Retry, Resume, or Reconnect, visible.
262
+ - **Primary action in reach.** A row or card shows its primary next action as a button, plus either one secondary button or, for two or more secondary actions, one [overflow menu](components.md#overflow-menu) trigger. A failed or blocked item keeps its recovery action, such as Retry, Resume, or Reconnect, visible.
263
263
  - **Forms.** A field takes a description only for a format, limit, or consequence its label does not state. No intro sentence restates the fields. A sticky action bar sits on the page background with a hairline divider, without a panel or shadow.
264
264
  - **Containers group.** Never nest a panel, card, or well in another. A component's own parts, as its spec draws them, are fine, such as a code block's source panel. So are controls and alerts inside a container or a dialog. A figure is a well, so it sits on the page, not in a card. Grid cells and stat tiles take a fill or nothing, not a border each.
265
265
  - **Explanations on request.** Method notes, "How to read this", and multiple-comparison caveats go in a closed disclosure next to what they explain.
@@ -122,6 +122,37 @@
122
122
  .picker li[aria-selected="true"] { background: var(--color-row-selected); }
123
123
  .picker li[aria-selected="true"]::after { content: "✓"; margin-left: auto; color: var(--color-accent); }
124
124
 
125
+ /* Overflow menu: a quiet-action trigger and a floating list of actions (the WAI-ARIA menu button pattern). */
126
+ .overflow { position: relative; display: inline-flex; }
127
+ .overflow > .quiet-action { width: var(--control-sm); height: var(--control-sm); }
128
+ /* One class, so the quiet action's hover colour wins over the muted rest. */
129
+ :where(.overflow) > .quiet-action { color: var(--color-muted); }
130
+ /* The More icon is three round dots: zero-length strokes with the icon's round caps. */
131
+ .overflow > .quiet-action .icon { stroke-width: 3; }
132
+ :where(.overflow > .quiet-action[aria-expanded="true"]) { background: color-mix(in srgb, currentColor 6%, transparent); }
133
+ .menu-list { position: absolute; z-index: 3; top: 100%; right: 0; display: grid; min-width: 180px; margin-top: var(--space-1); padding: var(--space-1); border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-surface-raised); box-shadow: var(--shadow-dialog); }
134
+ .menu-list.is-static { position: static; margin-top: 0; }
135
+ .menu-list.is-above { top: auto; bottom: 100%; margin: 0 0 var(--space-1); }
136
+ .menu-list [role="menuitem"] { display: flex; align-items: center; gap: var(--space-2); min-height: var(--row); padding: 0 var(--space-3); border: 1px solid transparent; border-radius: calc(var(--radius-panel) - var(--space-1)); background: transparent; color: var(--color-text); font: inherit; text-align: start; cursor: pointer; }
137
+ .menu-list [role="menuitem"].danger { color: light-dark(color-mix(in srgb, var(--color-error) 75%, var(--color-status-ink)), color-mix(in srgb, var(--color-error) 85%, var(--color-status-ink))); }
138
+ .menu-list [role="menuitem"]:is(:focus-visible, .is-highlight) { background: var(--color-row-hover); }
139
+ /* An inset ring, as the project menu's rows draw, so it stays inside the menu and off the next row. */
140
+ .menu-list [role="menuitem"]:focus-visible { outline-offset: calc(var(--focus-width) * -1); }
141
+ @media (hover: hover) { .menu-list [role="menuitem"]:hover:not(:disabled) { background: var(--color-row-hover); } }
142
+ .menu-list [role="menuitem"]:disabled { opacity: 0.58; cursor: not-allowed; }
143
+ .menu-list [role="separator"] { margin: var(--space-1) calc(var(--space-1) * -1); border-top: 1px solid var(--color-border-subtle); }
144
+ /* The live specimen: an item row with the trigger at its end, so the menu opens over the row. */
145
+ .overflow-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); width: 360px; min-height: var(--row); }
146
+ @media (max-width: 800px) {
147
+ .overflow > .quiet-action { width: var(--control-lg); height: var(--control-lg); }
148
+ .menu-list [role="menuitem"] { min-height: var(--control-lg); }
149
+ }
150
+ @media (forced-colors: active) {
151
+ .menu-list [role="menuitem"]:is(:focus-visible, .is-highlight) { forced-color-adjust: none; background: Highlight; color: HighlightText; }
152
+ @media (hover: hover) { .menu-list [role="menuitem"]:hover:not(:disabled) { forced-color-adjust: none; background: Highlight; color: HighlightText; } }
153
+ .menu-list [role="separator"] { border-top-color: CanvasText; }
154
+ }
155
+
125
156
  /* Checkbox and radio: native inputs drawn with tokens. */
126
157
  .choices { display: flex; flex-wrap: wrap; gap: var(--space-4); }
127
158
  .check { display: inline-flex; align-items: center; gap: 0.5625rem; min-height: var(--control-md); cursor: pointer; }
@@ -874,6 +905,7 @@
874
905
  <symbol id="i-arrow-right" viewBox="0 0 16 16"><path d="M3.5 8h9M9 4.5l3.5 3.5L9 11.5"/></symbol>
875
906
  <symbol id="i-system" viewBox="0 0 16 16"><rect x="2" y="2.5" width="12" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11v3"/></symbol>
876
907
  <symbol id="i-light" viewBox="0 0 16 16"><circle cx="8" cy="8" r="3"/><path d="M8 1.5v1.5M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1 1M11.6 11.6l1 1M3.4 12.6l1-1M11.6 4.4l1-1"/></symbol>
908
+ <symbol id="i-more" viewBox="0 0 16 16"><path d="M3 8h.01M8 8h.01M13 8h.01"/></symbol>
877
909
  <symbol id="i-dark" viewBox="0 0 16 16"><path d="M13 9.5A5.5 5.5 0 0 1 6.5 3a5.5 5.5 0 1 0 6.5 6.5z"/></symbol>
878
910
  </svg>
879
911
 
@@ -906,7 +938,7 @@
906
938
  </div>
907
939
  <div class="navlist" role="group" aria-labelledby="rail-actions">
908
940
  <span class="group-label" id="rail-actions">Actions</span>
909
- <a href="#button" data-terms="button actions the main action control: primary, secondary, ghost, danger, and text. cta submit link">Button</a><a href="#quiet-action" data-terms="quiet action actions a small transparent action inside a component, such as copy or close. icon button copy close">Quiet action</a>
941
+ <a href="#button" data-terms="button actions the main action control: primary, secondary, ghost, danger, and text. cta submit link">Button</a><a href="#quiet-action" data-terms="quiet action actions a small transparent action inside a component, such as copy or close. icon button copy close">Quiet action</a><a href="#overflow-menu" data-terms="overflow menu actions two or more secondary actions behind a more button. kebab dropdown action menu ellipsis">Overflow menu</a>
910
942
  </div>
911
943
  <div class="navlist" role="group" aria-labelledby="rail-selection">
912
944
  <span class="group-label" id="rail-selection">Selection</span>
@@ -957,7 +989,7 @@
957
989
  <section class="index" id="index" aria-labelledby="index-title">
958
990
  <h2 id="index-title">By purpose</h2>
959
991
  <div class="index-grid">
960
- <div><h3><a href="#group-actions">Actions</a></h3><ul><li><a href="#button">Button</a><span>The main action control: primary, secondary, ghost, danger, and text.</span></li><li><a href="#quiet-action">Quiet action</a><span>A small transparent action inside a component, such as Copy or Close.</span></li></ul></div>
992
+ <div><h3><a href="#group-actions">Actions</a></h3><ul><li><a href="#button">Button</a><span>The main action control: primary, secondary, ghost, danger, and text.</span></li><li><a href="#quiet-action">Quiet action</a><span>A small transparent action inside a component, such as Copy or Close.</span></li><li><a href="#overflow-menu">Overflow menu</a><span>Two or more secondary actions behind a More button.</span></li></ul></div>
961
993
  <div><h3><a href="#group-selection">Selection</a></h3><ul><li><a href="#checkbox-and-radio">Checkbox and radio</a><span>Pick several options, or one from a short list.</span></li><li><a href="#radio-card-group">Radio card group</a><span>Pick one option that needs a description.</span></li><li><a href="#switch">Switch</a><span>Turn a setting on or off at once.</span></li><li><a href="#toggle-button">Toggle button</a><span>A labelled card that latches on, with a switch inside.</span></li><li><a href="#segmented-control">Segmented control</a><span>Two to five short options that apply at once.</span></li></ul></div>
962
994
  <div><h3><a href="#group-inputs">Inputs</a></h3><ul><li><a href="#text-input-and-textarea">Text input and textarea</a><span>Type a short value or a longer note.</span></li><li><a href="#select">Select</a><span>Choose from a longer list.</span></li><li><a href="#field-wrapper">Field wrapper</a><span>Label, description, and error text around a field.</span></li><li><a href="#slider">Slider</a><span>Set a value in a range.</span></li></ul></div>
963
995
  <div><h3><a href="#group-feedback">Feedback and status</a></h3><ul><li><a href="#progress">Progress</a><span>Show how far a task has got.</span></li><li><a href="#score">Score</a><span>Show a value out of a maximum.</span></li><li><a href="#badge">Badge</a><span>A short status label.</span></li><li><a href="#alert">Alert</a><span>A real caveat or status message in the page.</span></li></ul></div>
@@ -1027,8 +1059,8 @@
1027
1059
  <section class="component" id="quiet-action" data-layer="Core" data-states="hover pressed focus disabled" aria-labelledby="quiet-action-title">
1028
1060
  <header><h3 id="quiet-action-title">Quiet action</h3><span class="badge">Core</span><a href="components.md#quiet-action">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="quiet-action" aria-label="Copy link to Quiet action" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
1029
1061
  <p class="purpose">A small transparent action inside a component, such as Copy or Close.</p>
1030
- <dl class="guidance"><dt>Do</dt><dd>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.</dd><dt>Don’t</dt><dd>An action that stands on its own in the page, such as Save or Next. That is a button.</dd></dl>
1031
- <p class="note">One recipe for Copy, Full size, dialog and drawer close, and the project trigger. Each component sets only its size and place.</p>
1062
+ <dl class="guidance"><dt>Do</dt><dd>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, the project trigger, and the overflow menu trigger.</dd><dt>Don’t</dt><dd>An action that stands on its own in the page, such as Save or Next. That is a button.</dd></dl>
1063
+ <p class="note">One recipe for Copy, Full size, dialog and drawer close, the project trigger, and the overflow menu trigger. Each component sets only its size and place.</p>
1032
1064
  <div class="row"><h4>Icon</h4><div class="states">
1033
1065
  <div class="state"><button class="quiet-action close" type="button" aria-label="Close"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button><span class="caption">Rest</span></div>
1034
1066
  <div class="state" inert><button class="quiet-action close is-hover" type="button" aria-label="Close"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button><span class="caption">Hover</span></div>
@@ -1044,6 +1076,27 @@
1044
1076
  </div></div>
1045
1077
  </section>
1046
1078
 
1079
+ <section class="component" id="overflow-menu" data-layer="Core" data-states="hover pressed focus disabled" aria-labelledby="overflow-title">
1080
+ <header><h3 id="overflow-title">Overflow menu</h3><span class="badge">Core</span><a href="components.md#overflow-menu">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="overflow-menu" aria-label="Copy link to Overflow menu" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
1081
+ <p class="purpose">Two or more secondary actions behind a More button.</p>
1082
+ <dl class="guidance"><dt>Do</dt><dd>Use it for two or more secondary actions of a row, card, or toolbar, ordered by how often they are used. Put a destructive action last, after a separator, and confirm it in a dialog.</dd><dt>Don’t</dt><dd>The item’s primary action, a recovery action such as Retry on a failed item, a menu with one action, or links to other pages. Those stay buttons or links.</dd></dl>
1083
+ <p class="note">The trigger is a quiet action, and the menu is a floating layer with concentric rows. The live trigger follows the menu button pattern: arrows, Home, End, a first letter, Escape, and Tab.</p>
1084
+ <div class="row"><h4>Trigger</h4><div class="states">
1085
+ <div class="state" inert><div class="overflow"><button class="quiet-action" type="button" aria-label="More actions" aria-haspopup="menu" aria-expanded="false"><svg class="icon" aria-hidden="true"><use href="#i-more"/></svg></button></div><span class="caption">Rest</span></div>
1086
+ <div class="state" inert><div class="overflow"><button class="quiet-action is-hover" type="button" aria-label="More actions" aria-haspopup="menu" aria-expanded="false"><svg class="icon" aria-hidden="true"><use href="#i-more"/></svg></button></div><span class="caption">Hover</span></div>
1087
+ <div class="state" inert><div class="overflow"><button class="quiet-action is-focus" type="button" aria-label="More actions" aria-haspopup="menu" aria-expanded="false"><svg class="icon" aria-hidden="true"><use href="#i-more"/></svg></button></div><span class="caption">Focus visible</span></div>
1088
+ <div class="state" inert><div class="overflow"><button class="quiet-action is-active" type="button" aria-label="More actions" aria-haspopup="menu" aria-expanded="false"><svg class="icon" aria-hidden="true"><use href="#i-more"/></svg></button></div><span class="caption">Pressed</span></div>
1089
+ <div class="state" inert><div class="overflow"><button class="quiet-action" type="button" aria-label="More actions" aria-haspopup="menu" aria-expanded="true"><svg class="icon" aria-hidden="true"><use href="#i-more"/></svg></button></div><span class="caption">Open</span></div>
1090
+ <div class="state"><div class="overflow"><button class="quiet-action" type="button" aria-label="More actions" aria-haspopup="menu" aria-expanded="false" disabled><svg class="icon" aria-hidden="true"><use href="#i-more"/></svg></button></div><span class="caption">Disabled, live</span></div>
1091
+ </div></div>
1092
+ <div class="row"><h4>Live</h4><div class="states">
1093
+ <div class="state wide"><div class="overflow-row"><span>API latency</span><div class="overflow"><button class="quiet-action" type="button" aria-label="More actions for API latency" aria-haspopup="menu" aria-expanded="false" aria-controls="overflow-live"><svg class="icon" aria-hidden="true"><use href="#i-more"/></svg></button><div class="menu-list" id="overflow-live" role="menu" aria-label="Actions for API latency" hidden><button type="button" role="menuitem" tabindex="-1">Rename</button><button type="button" role="menuitem" tabindex="-1">Duplicate</button><button type="button" role="menuitem" tabindex="-1" disabled>Export</button><div role="separator"></div><button type="button" role="menuitem" tabindex="-1" class="danger" data-confirm="live-dialog">Delete…</button></div></div></div><span class="caption">Rest, live, at the end of an item row</span></div>
1094
+ </div></div>
1095
+ <div class="row"><h4>Menu</h4><div class="states">
1096
+ <div class="state wide" inert><div class="menu-list is-static" role="menu" aria-label="Actions"><button type="button" role="menuitem" tabindex="-1" class="is-highlight">Rename</button><button type="button" role="menuitem" tabindex="-1">Duplicate</button><button type="button" role="menuitem" tabindex="-1" disabled>Export</button><div role="separator"></div><button type="button" role="menuitem" tabindex="-1" class="danger">Delete…</button></div><span class="caption">Open: the first item highlighted, Export disabled, and Delete last after a separator</span></div>
1097
+ </div></div>
1098
+ </section>
1099
+
1047
1100
  <section class="layer-head" id="group-selection" aria-labelledby="group-selection-title">
1048
1101
  <h2 id="group-selection-title">Selection</h2>
1049
1102
  <p>Choose options or turn something on.</p>
@@ -1531,6 +1584,7 @@
1531
1584
  <tbody>
1532
1585
  <tr data-for="button"><th scope="row"><a href="#button">Button</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
1533
1586
  <tr data-for="quiet-action"><th scope="row"><a href="#quiet-action">Quiet action</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
1587
+ <tr data-for="overflow-menu"><th scope="row"><a href="#overflow-menu">Overflow menu</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
1534
1588
  <tr data-for="checkbox-and-radio"><th scope="row"><a href="#checkbox-and-radio">Checkbox and radio</a></th><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
1535
1589
  <tr data-for="radio-card-group"><th scope="row"><a href="#radio-card-group">Radio card group</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
1536
1590
  <tr data-for="switch"><th scope="row"><a href="#switch">Switch</a></th><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
@@ -1839,6 +1893,61 @@
1839
1893
  document.addEventListener('pointerdown', (e) => { if (menu.open && !menu.contains(e.target)) menu.open = false; });
1840
1894
  });
1841
1895
 
1896
+ // Overflow menu: the WAI-ARIA menu button pattern. The trigger opens the menu on Enter, Space, or Down Arrow
1897
+ // (first item) and Up Arrow (last item). Items are one Tab stop: arrows, Home, End, and a first letter move
1898
+ // focus. Escape closes the menu and returns focus to the trigger; Tab, focus moving out, or a press outside
1899
+ // closes it. Running an item closes the menu and focuses the trigger first, so a confirming dialog opened
1900
+ // after that returns focus to the trigger.
1901
+ document.querySelectorAll('.overflow').forEach((wrap) => {
1902
+ const trigger = wrap.querySelector('[aria-haspopup="menu"]');
1903
+ const menu = wrap.querySelector('[role="menu"]');
1904
+ if (!menu || trigger.disabled) return;
1905
+ const items = () => [...menu.querySelectorAll('[role="menuitem"]:not(:disabled)')];
1906
+ // The menu opens below the trigger, or above it when the viewport has no room below and there is room above,
1907
+ // as the headless libraries do. If neither fits, the page scrolls just enough to show the whole menu.
1908
+ const open = (index) => {
1909
+ menu.hidden = false;
1910
+ menu.classList.remove('is-above');
1911
+ const room = menu.getBoundingClientRect();
1912
+ if (room.bottom > innerHeight && trigger.getBoundingClientRect().top - room.height - 4 >= 0) menu.classList.add('is-above');
1913
+ menu.scrollIntoView({ block: 'nearest' });
1914
+ trigger.setAttribute('aria-expanded', 'true');
1915
+ items().at(index)?.focus();
1916
+ };
1917
+ const close = (refocus) => {
1918
+ if (menu.hidden) return;
1919
+ menu.hidden = true;
1920
+ trigger.setAttribute('aria-expanded', 'false');
1921
+ if (refocus) trigger.focus();
1922
+ };
1923
+ trigger.addEventListener('click', () => (menu.hidden ? open(0) : close(true)));
1924
+ trigger.addEventListener('keydown', (e) => {
1925
+ if (e.key !== 'ArrowDown' && e.key !== 'ArrowUp') return;
1926
+ e.preventDefault();
1927
+ open(e.key === 'ArrowDown' ? 0 : -1);
1928
+ });
1929
+ menu.addEventListener('keydown', (e) => {
1930
+ const list = items();
1931
+ const at = list.indexOf(document.activeElement);
1932
+ const next = { ArrowDown: at + 1, ArrowUp: at - 1, Home: 0, End: list.length - 1 }[e.key];
1933
+ if (next !== undefined) { e.preventDefault(); list[(next + list.length) % list.length].focus(); return; }
1934
+ if (e.key === 'Escape') { e.preventDefault(); close(true); return; }
1935
+ if (e.key === 'Tab') { close(false); return; }
1936
+ if (e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey) {
1937
+ const key = e.key.toLowerCase();
1938
+ [...list.slice(at + 1), ...list.slice(0, at + 1)].find((item) => item.textContent.trim().toLowerCase().startsWith(key))?.focus();
1939
+ }
1940
+ });
1941
+ menu.addEventListener('click', (e) => {
1942
+ const item = e.target.closest('[role="menuitem"]:not(:disabled)');
1943
+ if (!item) return;
1944
+ close(true);
1945
+ if (item.dataset.confirm) document.getElementById(item.dataset.confirm).showModal();
1946
+ });
1947
+ wrap.addEventListener('focusout', (e) => { if (e.relatedTarget && !wrap.contains(e.relatedTarget)) close(false); });
1948
+ document.addEventListener('pointerdown', (e) => { if (!wrap.contains(e.target)) close(false); });
1949
+ });
1950
+
1842
1951
  // ---------- Catalogue shell: header strip, rail, Find, shortcuts, location, phone drawer ----------
1843
1952
  // Header strip: start scrolled to the current page, and fade only the edges that hide links.
1844
1953
  const strip = document.querySelector('.page-head .navlist.strip');
@@ -19,7 +19,7 @@ The sections follow the catalogue's purpose groups, in this order. Each componen
19
19
 
20
20
  | Group | Components |
21
21
  | --- | --- |
22
- | Actions | Button, quiet action |
22
+ | Actions | Button, quiet action, overflow menu |
23
23
  | Selection | Checkbox and radio, radio card group, switch, toggle button, segmented control |
24
24
  | Inputs | Text input and textarea, select, field wrapper, slider |
25
25
  | Feedback and status | Progress, score, badge, alert |
@@ -72,12 +72,25 @@ Layer: Core.
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
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
- - **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.
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, the project trigger, and the overflow menu 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`.
78
78
  - **Motion.** Fill and colour change over `--duration-fast` with `--ease-out`.
79
79
  - **Forced colors.** The transparent border draws as the system edge.
80
80
 
81
+ ## Overflow menu
82
+
83
+ Layer: Core.
84
+
85
+ - **Anatomy.** A trigger and a menu of actions. The trigger is an icon-only [quiet action](#quiet-action), `--control-sm` square, holding the SVG "more" icon (three dots, never a text glyph). Its `aria-label` names the item it acts on, such as "More actions for API latency", and it carries `aria-haspopup="menu"` and `aria-expanded`. The menu is a floating layer, as the project menu is: `--color-surface-raised`, a transparent 1px border, `--radius-panel`, `--shadow-dialog`, and `--space-1` padding, at least 180px wide, opening `--space-1` below the trigger, or above it when the viewport has no room below, and aligned to its end edge, so the trigger sits at the end of its row, card, or toolbar. Each item is a `<button role="menuitem">`, `--row` tall with `--space-3` side padding, in `--color-text`, with corners concentric with the menu, `calc(var(--radius-panel) - var(--space-1))`, and an optional 16px leading icon. Its focus ring is inset, as on the project menu's rows. A destructive item comes last, after a separator (`role="separator"`, a 1px `--color-border-subtle` line), with the danger button's text colour.
86
+ - **States.** The trigger takes the quiet action's hover, press, focus-visible, and disabled states; while the menu is open it keeps the 6% hover tint, below the press, and `aria-expanded="true"`. An item is highlighted while a pointer hovers it or it has keyboard focus: it takes `--color-row-hover`, and keyboard focus also draws the focus ring. A disabled item uses the native `disabled` attribute, opacity 0.58, and no hover fill, and the arrow keys skip it, as reka-ui's DropdownMenu does.
87
+ - **Do.** Use it for two or more secondary actions of a row, card, or toolbar, ordered by how often they are used. Put a destructive action last, after a separator, and confirm it in a dialog.
88
+ - **Don't.** The item's primary action, a recovery action such as Retry on a failed item, a menu with one action, or links to other pages. Those stay buttons or links.
89
+ - **Keyboard and screen reader.** The WAI-ARIA menu button pattern. Enter, Space, or Down Arrow on the trigger opens the menu and focuses the first item; Up Arrow opens it on the last. Down and Up Arrow move between items and wrap, Home and End go to the first and last, and a printable character moves to the next item that starts with it. Enter or Space runs the item and closes the menu. Escape closes it and returns focus to the trigger; Tab closes it and moves on; a press outside closes it. After an item runs, focus returns to the trigger, unless the action opens a dialog, which returns focus to the trigger when it closes. Items take `tabindex="-1"`, so the menu adds no Tab stops.
90
+ - **Motion.** None: the menu opens and closes at once, as the project menu does.
91
+ - **Forced colors.** The trigger and menu borders draw as system edges. A highlighted item, from a pointer or keyboard focus, opts out of adjustment and takes `Highlight` with `HighlightText`; the separator takes `CanvasText`.
92
+ - **Touch.** At tablet width (`max-width: 800px`) the trigger and each item grow to `--control-lg`.
93
+
81
94
  ## Checkbox and radio
82
95
 
83
96
  Layer: Core.
@@ -10,11 +10,12 @@ 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 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%" |
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
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. | No test yet |
17
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 test yet |
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" |
18
19
  | 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 |
19
20
  | 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` |
20
21
  | 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filipgutica/design-system",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "Filip's design language, tokens, and component catalogue for any framework",
5
5
  "type": "module",
6
6
  "sideEffects": [