@filipgutica/design-system 1.0.13 → 1.0.14

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.
@@ -1805,10 +1805,13 @@
1805
1805
  });
1806
1806
  });
1807
1807
 
1808
- // Project switcher: Escape closes it and returns focus to the summary.
1808
+ // Project switcher: Escape closes it and returns focus to the summary. Focus moving to an element outside it
1809
+ // closes it, and so does a press outside it. Safari does not focus a link on a click or tap, so a press on a
1810
+ // link moves focus to no element; closing then would hide the link before it gets its click.
1809
1811
  document.querySelectorAll('.projects:not(.is-open)').forEach((menu) => {
1810
1812
  menu.addEventListener('keydown', (e) => { if (e.key === 'Escape' && menu.open) { menu.open = false; menu.querySelector('summary').focus(); } });
1811
- menu.addEventListener('focusout', (e) => { if (!menu.contains(e.relatedTarget)) menu.open = false; });
1813
+ menu.addEventListener('focusout', (e) => { if (e.relatedTarget && !menu.contains(e.relatedTarget)) menu.open = false; });
1814
+ document.addEventListener('pointerdown', (e) => { if (menu.open && !menu.contains(e.target)) menu.open = false; });
1812
1815
  });
1813
1816
 
1814
1817
  // ---------- Catalogue shell: header strip, rail, Find, shortcuts, location, phone drawer ----------
@@ -473,7 +473,7 @@ Layer: Identity.
473
473
  - **Do.** Keep the same header and site links, six at most and in one order, on every page of a personal product site.
474
474
  - **Don't.** The site header on an application screen. An application keeps its own navigation.
475
475
  - **Phone.** At `max-width: 800px` the header is static, with `--space-2` above, below, and between its rows. The first row holds the switcher at the start and the picker at the end. Where both do not fit, as at 320px, the picker wraps to its own row at the start; the project name never truncates. With three or more links, the links take the next row, as a strip that scrolls with its fades. Where the strip clips a link, at least 16px of that link stays in view under the fade: on the narrowest phones (a strip 340px wide or less, by container query) the strip's rows take 6px (`0.375rem`) side padding. One or two links stay on the first row, beside the picker; at `max-width: 640px` they become plain text links after the switcher, 12px (`--space-3`) apart, and the current link takes `--color-accent` text in medium weight, with no fill. A documentation page hides them at that width, because its [footer](#page-type-and-helpers) carries them. A page with a [section rail](#section-rail) puts the rail's labelled trigger `--space-2` below the header.
476
- - **Keyboard and screen reader.** The summary is named "Project: <name>". Escape closes the menu and returns focus to the summary; moving focus out of it closes it.
476
+ - **Keyboard and screen reader.** The summary is named "Project: <name>". Escape closes the menu and returns focus to the summary; moving focus to an element outside it, or a press outside it, closes it. A press on a link inside keeps it open, though Safari does not focus the link.
477
477
  - **Motion.** The chevron turns 180° while the menu is open, over `--duration-fast` with `--ease-out`. The menu itself opens at once.
478
478
  - **Forced colors.** The rule below the header takes the system text colour, and the menu and the site links follow the navigation list rules. A current text link on a phone takes an underline instead of the system border.
479
479
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filipgutica/design-system",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "Filip's design language, tokens, and component catalogue for any framework",
5
5
  "type": "module",
6
6
  "sideEffects": [