@setsquare/ui 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/README.md +7 -6
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/lib/keyshortcuts.d.ts +13 -0
  7. package/dist/lib/keyshortcuts.d.ts.map +1 -0
  8. package/dist/lib/keyshortcuts.js +21 -0
  9. package/dist/lib/keyshortcuts.js.map +1 -0
  10. package/dist/lib/rail-name.d.ts +45 -0
  11. package/dist/lib/rail-name.d.ts.map +1 -0
  12. package/dist/lib/rail-name.js +63 -0
  13. package/dist/lib/rail-name.js.map +1 -0
  14. package/dist/lib/search-match.d.ts +31 -0
  15. package/dist/lib/search-match.d.ts.map +1 -0
  16. package/dist/lib/search-match.js +82 -0
  17. package/dist/lib/search-match.js.map +1 -0
  18. package/dist/lib/search-shortcut.d.ts +16 -0
  19. package/dist/lib/search-shortcut.d.ts.map +1 -0
  20. package/dist/lib/search-shortcut.js +49 -0
  21. package/dist/lib/search-shortcut.js.map +1 -0
  22. package/dist/shell/rail.d.ts +5 -1
  23. package/dist/shell/rail.d.ts.map +1 -1
  24. package/dist/shell/rail.js +55 -2
  25. package/dist/shell/rail.js.map +1 -1
  26. package/dist/testing/index.d.ts +6 -1
  27. package/dist/testing/index.d.ts.map +1 -1
  28. package/dist/testing/index.js +14 -1
  29. package/dist/testing/index.js.map +1 -1
  30. package/dist/ui/button.d.ts +3 -2
  31. package/dist/ui/button.d.ts.map +1 -1
  32. package/dist/ui/button.js +7 -4
  33. package/dist/ui/button.js.map +1 -1
  34. package/dist/ui/search.d.ts +19 -3
  35. package/dist/ui/search.d.ts.map +1 -1
  36. package/dist/ui/search.js +55 -23
  37. package/dist/ui/search.js.map +1 -1
  38. package/dist/ui/tree.d.ts +5 -3
  39. package/dist/ui/tree.d.ts.map +1 -1
  40. package/dist/ui/tree.js +4 -2
  41. package/dist/ui/tree.js.map +1 -1
  42. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,83 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.0 — 2026-10-15
4
+
5
+ - **`findClippedText` waits two animation frames before it measures, and returns a Promise.** It applied 1.4.12's
6
+ spacing and measured in the same instant, so a component that adapts in a ResizeObserver was caught halfway: the
7
+ rail's names below spilled for the one frame before they refitted, and the check reported it, though no reader
8
+ would see it. It now measures as a reader sees the page, two frames after the spacing goes on (or after 100ms in a
9
+ hidden document, where frames don't run). **Breaking for a script that calls it synchronously in the page:** it
10
+ returns a Promise now. Through `page.evaluate`, which awaits it, and `expectTextUnclipped`, nothing changes.
11
+ - **Fix: a rail name no longer breaks between two letters without a hyphen.** In Chrome, "Storyboard" at AA showed as
12
+ "Storyboar" / "d". Chromium (and Firefox) never hyphenate an English word that starts with a capital letter, and
13
+ every rail name starts with one, so `hyphens: auto` found no break point and `overflow-wrap: anywhere` split the word
14
+ wherever it ran out of room. en-GB wasn't the cause: Chrome on macOS hyphenates en-GB and en-US alike, and knows
15
+ "storyboard" in lower case. Now:
16
+ - a word too wide for its tile shrinks the whole name, to 11.5px at the least, sized for the bold of the current
17
+ page so an item keeps its shape when it becomes current. In Atkinson Hyperlegible Next, "Storyboard" fits one line
18
+ at 11.75px at AA. 11.5px is the rail's one exception to the 13px floor, and the design-system README says so;
19
+ - a word too wide even at 11.5px breaks with a visible hyphen at 13px: where the browser can hyphenate it (German
20
+ under `lang="de"`, or WebKit), and otherwise at the last letter that fits, three letters either side at least;
21
+ - a soft hyphen (U+00AD) a product writes in a name is where it breaks: "Story\u00ADboard" fits whole where it can,
22
+ and is "Story-" / "board" where it can't. The Rail README says to do this for words a dictionary won't know;
23
+ - the item's accessible name is the plain name, without soft hyphens (Chrome keeps them in a link's name). The name
24
+ seen is now hidden from assistive technology and the name said is a visually hidden copy, with the detail and
25
+ status after it as before;
26
+ - the fit is measured in the browser after the item renders, and again when the rail's width, zoom, text spacing
27
+ or the fonts change. The server's HTML has the name at 13px, unfitted.
28
+ - **Docs.** A RailNames card (long single words, a soft hyphen, German) and the same example on the Rail page of
29
+ ui.setsquare.dev, under the shell frames.
30
+ - **Tests.** Unit tests for the fitting (`src/lib/rail-name.ts`). `test/browser/rail.mjs` renders "Storyboard", "Art
31
+ direction", "Brand kits", "Voiceover", "Settings", "Einstellungen", "Sprachausgabe" and "Story\u00ADboard", plain and
32
+ current, in English and German, in all eight theme and brand combinations: no break inside a word without a hyphen,
33
+ nothing out of its tile, never under 11.5px, two lines at most, the soft hyphen kept and the plain accessible name,
34
+ and again under 1.4.12 text spacing and at 200% zoom. The suite renders in the system font; the outcomes in
35
+ Atkinson Hyperlegible Next were checked by hand in Chrome 155 on macOS.
36
+
37
+ ## 0.8.0 — 2026-10-14
38
+
39
+ - **Search finds items by words that aren't in their label.** `SearchItem` takes `keywords?: string[]`: what people
40
+ call an item rather than its name, so "mp4" or "export" finds "Render the whole video (MP4)". Keywords are matched
41
+ as well as the label, in `AppSearch` and `CommandSearch` alike, and are never shown or made part of the item's
42
+ accessible name. An item without keywords is matched on its label, as before.
43
+ - **A query of several words matches when every word appears**, in the label or the keywords, in any order: "video
44
+ render", "render video" and "render mp4" all find that item. Before, the whole query had to appear in the label as
45
+ typed. Matching is still the locale's, ignoring case and accents (`Intl.Collator` with `sensitivity: 'base'`, as
46
+ `useFilter` was).
47
+ - **Results are ranked within each section.** An item with the words in its label comes before one found through its
48
+ keywords, and one where they start a word before one where they are inside a word; otherwise items keep the order
49
+ given. This can reorder results for items without keywords too: "port" now lists "Portal" before "Import". Sections
50
+ keep their order, and the empty state shows when nothing matches. React Aria's `Autocomplete` can only filter, not
51
+ reorder, so the dialog now holds the field's text and gives the menu the ranked items; `Autocomplete` still moves
52
+ through them from the field, and points it at the first result as you type.
53
+ - **⌘K / Ctrl+K is left alone where something else wants it.** `AppSearch` used to take the key everywhere. It now
54
+ leaves it to a text field, text area or editor being typed in (Ctrl+K deletes to the end of the line on macOS and
55
+ inserts a link in most editors), to a handler that already took it (`preventDefault`), to ⌘⇧K and ⌘⌥K, and to an
56
+ input method composing.
57
+ - **One search on a page has the shortcut.** With two `AppSearch` on a page, ⌘K opened both. Now the first mounted
58
+ that asks has it, which is usually the layout's; when it unmounts, the next takes over. `shortcut={false}` gives it
59
+ up. Only the one with the shortcut shows ⌘K and sets `aria-keyshortcuts`; `SearchTrigger` takes `shortcut` too.
60
+ - **Fix: `aria-keyshortcuts` reaches the element.** React Aria's components pass only the DOM attributes they know,
61
+ and dropped `aria-keyshortcuts`, so it never reached the page: not on the search's trigger, though its README said
62
+ so, nor from a product that passed it. `Button`, `IconButton`, `LinkButton` and `Tree` now take it
63
+ (`KeyshortcutsProps`) and set it on their element after rendering, so it isn't in the server's HTML. This also fixes
64
+ `@setsquare/ui-blocks`, whose Undo and Redo buttons and outline pass it: theirs reach the page from this version on.
65
+ A `ref` given to `Button`, `IconButton` or `LinkButton` still gets the element, now through `useImperativeHandle`.
66
+ - **An item `id` used twice is a console error.** React Aria keys the search's menu by id across all its sections, so
67
+ a repeated one showed the first item twice and hid the other, silently. `CommandSearch` now logs the ids.
68
+ - **Docs.** The AppSearch page's example and the design-system demo's search have keywords. The README says how
69
+ matching and ranking work, and what a product has to get right: unique ids, what a server component can pass,
70
+ the router, the locale, the shortcut, and the sizes checked.
71
+ - **Tests.** Unit tests for the matching (several words in any order, accents, the locale's collation, keyword-only
72
+ matches after label matches, word starts before the middle of words, sections) and browser checks in the dashboard
73
+ shell's search: a keyword finding an item named by its label alone, the ranked order with the field pointing at the
74
+ first result (`aria-activedescendant`), words in any order, and the empty state. Unit tests for the shortcut's
75
+ rules and the duplicate ids. `test/browser/search.mjs` drives the shortcut in Chromium: what opens on ⌘K and Ctrl+K
76
+ and what is left alone, two searches on a page, `shortcut={false}`, `aria-keyshortcuts` on both triggers and on
77
+ `Button`, `IconButton`, `LinkButton` and `Tree` (set, and taken off), and the console error. `blocks-shortcuts`
78
+ checks the builder's Undo, Redo and outline say their keys. `package:verify` renders a search from a server component in a Next.js app, with `href` items,
79
+ element icons and keywords, and checks Ctrl+K opens it and a keyword finds its link.
80
+
3
81
  ## 0.7.0 — 2026-10-13
4
82
 
5
83
  - **`Rail`, new: layout option C's navigation.** A full-height rail, `--rail-width` wide (72px at AA, 88px at AAA),
package/README.md CHANGED
@@ -332,7 +332,7 @@ test('settings page', async ({ page }) => {
332
332
  - `findInvisibleFocus(page)` focuses every control a keyboard reaches, one at a time, and compares a screenshot of it with focus on it and with focus on another control. Any that didn't change have no visible focus indicator (2.4.7). Tooltips, transitions and the caret are turned off for the comparison. A control that focus can't leave (the only one in a modal) comes back as `trapped` rather than passed. `{ ignore }` leaves controls unchecked, such as parts checked on another page, while focus can still move to them. `expectFocusVisible(page)` throws for the rest.
333
333
  - `findUndistinguishedLinks(options?)` lists links in running text (laid out inline, in a block with words of its own) that nothing but colour marks, at under 3:1 against the text around them — WCAG's F73. An underline or bottom border, bold or italics the surrounding text doesn't have, or 3:1 passes. `{ underline: true }` holds links to this package's rule instead: underlined. `expectLinksDistinguished(page, options?)` throws with them.
334
334
  - `findPageOverflow(options?)` lists everything that reaches past the right edge of the page at the width it is laid out at: `scrolls` when the page scrolls sideways because of it, `clipped` when an `overflow: hidden` or `clip` box at the page's edge cuts off something with words or media in it. Content in a scroller of its own that fits (a `ScrollRegion`, a code block), content clipped inside a component, and fixed-position elements are left out, so a decorative glow bleeding off the edge isn't reported. Set the viewport to 320px for WCAG 1.4.10's reflow width. `expectPageReflows(page, options?)` throws with them.
335
- - `findClippedText(options?)` applies WCAG 1.4.12's four spacing metrics to the page (line height 1.5, 2em after paragraphs, letter spacing 0.12em, word spacing 0.16em) and lists every box whose content now runs out of it further than before: `clipped` for one that hides its overflow or truncates, `overflows` for one with a set size that the text spills out of. Scroll containers are left out, since their content can still be scrolled to, and so is text that runs out of a box inside a scroller that scrolls that way (code in a code block). The spacing comes off again afterwards. `expectTextUnclipped(page, options?)` throws with them.
335
+ - `findClippedText(options?)` applies WCAG 1.4.12's four spacing metrics to the page (line height 1.5, 2em after paragraphs, letter spacing 0.12em, word spacing 0.16em) and lists every box whose content now runs out of it further than before: `clipped` for one that hides its overflow or truncates, `overflows` for one with a set size that the text spills out of. Scroll containers are left out, since their content can still be scrolled to, and so is text that runs out of a box inside a scroller that scrolls that way (code in a code block). It measures two animation frames after the spacing goes on, so a component that adapts in a ResizeObserver (a rail name refitting its tile) is measured as a reader sees it, not halfway; it returns a Promise, which `page.evaluate` awaits. The spacing comes off again afterwards. `expectTextUnclipped(page, options?)` throws with them.
336
336
  - `findEndlessAnimations(options?)` lists what moves for longer than five seconds (`max`), or forever, with nothing to pause it: the CSS animations, CSS transitions and Web Animations running now (`document.getAnimations()`), and playing videos without `controls`, whether or not they are `aria-hidden`. Something is paused by a control when it sits inside an element whose `id` a visible button names in `data-pauses`. It can't see motion drawn with `requestAnimationFrame`, SVG animation, animated images or canvas, and only sees what is running when it is called. A duration comes back as `Infinity` for anything that repeats forever. `expectAnimationsPausable(page, options?)` throws with them.
337
337
  - `findCursorMismatches(page, options?)` hovers every target and reads the cursor at its centre and just inside each corner, so the whole target is checked, not only its paint. Each kind has its expected cursors (`press`: `pointer`; `text`: `text` or `auto`; `drag`: `grab`; `disabled`: `not-allowed`; `pending`: `wait` or `progress`; `readonly` and `current`: `default`); `expect` changes them, and `{ press: ['default'] }` checks a product that keeps the arrow on buttons. `expectCursorsMatch(page, options?)` throws with them.
338
338
 
@@ -344,12 +344,13 @@ The positioning, target, link, reflow, text-spacing and motion scans run in the
344
344
 
345
345
  - **Types:** `tsc` on React 19.
346
346
  - **Lint rules:** ESLint's `RuleTester`, and oxlint loading the built plugin through `jsPlugins`.
347
- - **Unit:** the pagination window: seven slots on every page of an 8-, 20- and 239-page list, and a gap only where two or more pages are left out. The `Rail` and `AppHeader` as the server renders them: with `navigation="rail"`, no collapse toggle and no rule, only the phone's trigger (hidden by a container query until the shell measures, absent at a forced size wider than a phone), and the rail's words over the sidebar's app-wide ones. Live status on `SidebarItem` and `RailItem`: the status label, detail and warning words in the name (after a count), the badges hidden from it, a type error for `status` without `statusLabel`, a custom drawing as the icon, and the collapsed sidebar's tooltip in English and in a product's words.
347
+ - **Unit:** the pagination window: seven slots on every page of an 8-, 20- and 239-page list, and a gap only where two or more pages are left out. The `Rail` and `AppHeader` as the server renders them: with `navigation="rail"`, no collapse toggle and no rule, only the phone's trigger (hidden by a container query until the shell measures, absent at a forced size wider than a phone), and the rail's words over the sidebar's app-wide ones. Live status on `SidebarItem` and `RailItem`: the status label, detail and warning words in the name (after a count), the badges hidden from it, a type error for `status` without `statusLabel`, a custom drawing as the icon, and the collapsed sidebar's tooltip in English and in a product's words. The search's matching: every word of a query in the label or keywords in any order, case and accents ignored by the locale's collation, keyword-only matches after label matches and word starts before the middle of words, within each section. Its shortcut's rules (what counts as ⌘K / Ctrl+K, a field or editor keeping it, the first search to ask having it) and its check for an item id used twice.
348
348
  - **Words:** a lint rule of this repository's (`scripts/lint/words.mjs`) fails English written into the components' JSX, a template that builds a sentence, a list joined in code, and `Intl` formatting in the runtime's locale; its tests fail each way 0.5.0 did it. Unit tests cover the ICU formatter, its development and production fallbacks, `SetsquareLocale`'s layering, and every count label in Polish (one, few, many).
349
349
  - **Contrast:** `scripts/check-contrast.mjs` computes every token pair the usage notes promise, in all four themes. It doesn't check colours a product adds.
350
350
  - **Browser (Chromium only):** the design-system previews on React 19, loaded as the design-system artifact loads them:
351
351
  - axe-core on every preview in all four themes;
352
- - keyboard and focus behaviour for the dashboard shell, forms, feedback states, and the slider, date, file and selection controls;
352
+ - the search's ⌘K / Ctrl+K on a page of its own: left to text fields, text areas, editors and a handler that took the key; one search on a page holding it, showing it and setting `aria-keyshortcuts`, and the next taking over; `shortcut={false}`; the console error for an item id used twice; and `aria-keyshortcuts` reaching the element through `Button`, `IconButton`, `LinkButton` and `Tree`, which React Aria's own components drop, and the page builder's Undo, Redo and outline saying their keys;
353
+ - keyboard and focus behaviour for the dashboard shell (with its search finding by keyword, in ranked order), forms, feedback states, and the slider, date, file and selection controls;
353
354
  - the site shell: the phone menu opening, pushing the page down and closing on Escape from the panel or the button; the current page's weight and marker; one order for the header, the phone menu and the footer; a sticky header covering no focused control; and the header fitting at seven widths from 320px to 1280px, either side of `lg` among them;
354
355
  - the motion rule on the Hero card's media: the motion check exempts it only for its visible pause control, Pause stops it, reduced motion never starts it, and nothing waits hidden for it;
355
356
  - code blocks copying, announcing a second copy, a terminal copying its commands only, and a refused copy; the theme switcher's choice, System following the operating system, the level, and the theme script running under a CSP that allows only its published hash;
@@ -360,7 +361,7 @@ The positioning, target, link, reflow, text-spacing and motion scans run in the
360
361
  - every control a keyboard reaches visibly changing when it takes focus, in two themes;
361
362
  - every link in running text underlined, and every target showing the cursor the rule gives it, across its whole area;
362
363
  - toasts measured against the focused control;
363
- - the `Rail`, in all four themes and two brands: `--rail-width` at AA and AAA, every target at least `--target-min`, "Art direction" and "Brand kits" in two lines or fewer (in the system face the suites render with: they load no web fonts), no name cut off, the current page's weight, fill, edge, and icon and name in brand, groups named by hidden headings with a rule between them, the footer pinned while the items scroll, no transition or animation on hover or focus but a working badge's pulse, the current page's marker in `Highlight` under Chromium's emulated forced colours, no collapse toggle at 1280px and 768px, the phone's Sheet from the menu button with the items as rows and focus back on the button after Escape, and the Sidebar's shell keeping its toggle;
364
+ - the `Rail`, in all four themes and two brands: `--rail-width` at AA and AAA, every target at least `--target-min`, "Art direction" and "Brand kits" in two lines or fewer (in the system face the suites render with: they load no web fonts), no name cut off; long single words ("Storyboard", "Einstellungen", "Sprachausgabe", and "Story\u00ADboard" with a soft hyphen), plain and current, in English and German, never broken between two letters without a hyphen, never under 11.5px, two lines at most and named without the soft hyphen, again under text spacing and at 200% zoom; the current page's weight, fill, edge, and icon and name in brand, groups named by hidden headings with a rule between them, the footer pinned while the items scroll, no transition or animation on hover or focus but a working badge's pulse, the current page's marker in `Highlight` under Chromium's emulated forced colours, no collapse toggle at 1280px and 768px, the phone's Sheet from the menu button with the items as rows and focus back on the button after Escape, and the Sidebar's shell keeping its toggle;
364
365
  - the current page marked alike in a `Rail`, a `SidebarItem` and a `SidebarDisclosure`'s page: the fill, the 3px edge, and the name in brand at 700, the same when hovered, and a bar in `Highlight` under emulated forced colours;
365
366
  - live status on nav items, in all four themes and two brands: working a hollow ring and attention a dot in a ring, each in its colour, with a cut-out that matches the ground at rest, hovered, current and current while hovered; working pulsing three times at AA and not at all at AAA or under reduced motion, attention never moving, and nothing on a badge moving after five seconds; names with the status, detail and warning words; details in tabular numbers, under the name in a rail and right-aligned with a count in the sidebar, the warning one with its icon and colour; a product's own drawing as the icon at 20px; the collapsed sidebar's tooltips and badges; and both badges in `CanvasText` and `Highlight` under Chromium's emulated forced colours;
366
367
  - tabs: the arrow keys in a row and a rail, Home and End, names with counts and badges, tooltips on hover (after 500ms, hoverable, closed by Escape and by a press) and on keyboard focus, the rail becoming a row below 480px, the three `hiddenPanels` modes (a draft surviving, a hidden panel's effects stopping, a Suspense read loading while pre-rendered), an important badge's pulse ending inside five seconds and replaying when its count rises, clear-on-open calling `onBadgeClear`, only opacity and colour changing at AAA, nothing animating under reduced motion, and no badge, ring or halo over any text in all three displays at full width and 360px;
@@ -368,8 +369,8 @@ The positioning, target, link, reflow, text-spacing and motion scans run in the
368
369
  - nothing on any preview running off its width, no text cut off or spilling with WCAG 1.4.12's spacing applied, and nothing but a loading indicator moving past five seconds, at AA and AAA;
369
370
  - every preview inside `SetsquareLocale` at `locale="ar"` with every word pseudo-translated, failing on any of the package's English left in text, hidden text or names, with a control run that leaves the words in English and has to find them. It reads what a card shows as it loads, not what it shows after it's used;
370
371
  - the page checks above, each also run on a page built to fail.
371
- - **Packaging:** `pnpm package:verify` packs the tarball and installs it into a new Next.js app. It builds the app, loads it in both levels, and runs the page checks and the lint plugin from the installed package. It also follows a sidebar link on the freshly started app, to check the templates' page transition runs with its `nav-forward` type. The root layout's `ThemeScript` is checked to put a stored dark theme on `<html>` before any of the page's own JavaScript runs, and the footer's `ThemeSwitcher` to change it for the next page load. A route on the site templates is checked too: the current page, reflow at 320px, the Menu as a link to the footer's navigation with JavaScript off, and the swap to the Menu button when the page hydrates, in the same place and keeping focus. `@setsquare/ui-blocks`' `ContentBuilder` is rendered from a Next.js page and checked to hydrate with no console errors, with the browser on a different platform from the server's.
372
- - **The docs site** (`apps/docs`): `pnpm test:site` loads every page of its production build in all four themes at 1280px, and at AA and AAA at 390px (and each component the Playground shows). Each run has axe, positioning, targets, underlined links, sideways overflow and console errors. The dark run puts the browser on a different platform from the server's (Windows beside a Mac server, a Mac beside any other), so anything rendered differently on the two shows up as a hydration error. Visible focus runs in three of them (light, dark AAA and 390px AAA: both themes, both levels, both layouts) and cursors in three (light, light AAA and 390px AAA), and both check the sidebar and header, which are the same on every page, on the home page only; a check fails if that selector ever leaves out a control in a page's content. It also fails on console errors, sideways overflow, and any internal link to a page it doesn't check, and it follows a sidebar link, in Chromium and in WebKit, to check that the navigation stays client-side, runs the page transition, and covers the old page while it leaves. It also tries a shadcn/ui theme from the Playground: that it reaches every page, lasts through a reload without a flash, resets, and that a paste can set nothing but valid token values. The findings it accepts are listed in `test/site/pages.mjs`, each with its reason. The site brings its own palette, so its build runs the contrast audit against those colours.
372
+ - **Packaging:** `pnpm package:verify` packs the tarball and installs it into a new Next.js app. It builds the app, loads it in both levels, and runs the page checks and the lint plugin from the installed package. It also follows a sidebar link on the freshly started app, to check the templates' page transition runs with its `nav-forward` type. An `AppSearch` rendered from a server component, with `href` items, element icons and keywords, is checked to open on Ctrl+K and find its link by a keyword. The root layout's `ThemeScript` is checked to put a stored dark theme on `<html>` before any of the page's own JavaScript runs, and the footer's `ThemeSwitcher` to change it for the next page load. A route on the site templates is checked too: the current page, reflow at 320px, the Menu as a link to the footer's navigation with JavaScript off, and the swap to the Menu button when the page hydrates, in the same place and keeping focus. `@setsquare/ui-blocks`' `ContentBuilder` is rendered from a Next.js page and checked to hydrate with no console errors, with the browser on a different platform from the server's.
373
+ - **The docs site** (`apps/docs`): `pnpm test:site` loads every page of its production build in all four themes at 1280px, and at AA and AAA at 390px (and each component the Playground shows). Each run has axe, positioning, targets, underlined links, sideways overflow and console errors. The dark run puts the browser on a different platform from the server's (Windows beside a Mac server, a Mac beside any other), so anything rendered differently on the two shows up as a hydration error. Visible focus runs in three of them (light, dark AAA and 390px AAA: both themes, both levels, both layouts) and cursors in three (light, light AAA and 390px AAA), and both check the sidebar and header, which are the same on every page, on the home page only; a check fails if that selector ever leaves out a control in a page's content. It also fails on console errors, sideways overflow, and any internal link to a page it doesn't check, and it follows a sidebar link, in Chromium and in WebKit, to check that the navigation stays client-side, runs the page transition, and covers the old page while it leaves. It also tries a shadcn/ui theme from the Playground: that it reaches every page, lasts through a reload without a flash, resets, and that a paste can set nothing but valid token values. It searches from the header by keyword ("modal" finds Dialog, "tap target" finds `--target-min`) and by names read from the repository (`ConfirmDialog`, a page's heading, a lint rule, a page check). The site's build fails if a page, component or token search lists has no keywords in `apps/docs/lib/search-keywords.ts`, if keywords are left for one that's gone, or if anything `@setsquare/ui` exports finds nothing. The findings it accepts are listed in `test/site/pages.mjs`, each with its reason. The site brings its own palette, so its build runs the contrast audit against those colours.
373
374
  - **Not tested:** other browsers; real screen readers (VoiceOver, NVDA and JAWS haven't been run on these components); Windows High Contrast; pasting files into the drop zone; everything that depends on a product's content.
374
375
 
375
376
  ## Developing
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export type { SetsquareLocaleProps, SetsquareLabels } from './lib/locale.js';
11
11
  export { useElementWidth } from './lib/use-element-width.js';
12
12
  export { Button, LinkButton } from './ui/button.js';
13
13
  export type { ButtonProps, LinkButtonProps } from './ui/button.js';
14
+ export type { KeyshortcutsProps } from './lib/keyshortcuts.js';
14
15
  export { buttonTargetStyles, buttonVisualStyles } from './ui/button-styles.js';
15
16
  export type { ButtonVariant, ButtonVisualSize } from './ui/button-styles.js';
16
17
  export { TextLink } from './ui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AAM,cAAc,CAAC;AAQ3F,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEvF,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAOvD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOhE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AASvF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAQ9D,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type Ref, type RefObject } from 'react';
2
+ /** `aria-keyshortcuts`, as a prop this package's components take and pass on. */
3
+ export interface KeyshortcutsProps {
4
+ /** The keys that press or move to it, in ARIA's form: "Meta+K Control+K". Set on the element. */
5
+ 'aria-keyshortcuts'?: string;
6
+ }
7
+ /**
8
+ * React Aria's components pass only the DOM attributes they know, and drop `aria-keyshortcuts`. Give the component
9
+ * the ref this returns: the attribute is set on its element (or taken off when `keys` is empty) after each render,
10
+ * and the element is handed on to `ref`.
11
+ */
12
+ export declare function useKeyshortcuts<T extends Element>(keys: string | undefined, ref?: Ref<T>): RefObject<T | null>;
13
+ //# sourceMappingURL=keyshortcuts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyshortcuts.d.ts","sourceRoot":"","sources":["../../src/lib/keyshortcuts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgD,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE/F,iFAAiF;AACjF,MAAM,WAAW,iBAAiB;IAChC,iGAAiG;IACjG,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,OAAO,EAC/C,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,GACX,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,CASrB"}
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+ import { useImperativeHandle, useLayoutEffect, useRef } from 'react';
3
+ /**
4
+ * React Aria's components pass only the DOM attributes they know, and drop `aria-keyshortcuts`. Give the component
5
+ * the ref this returns: the attribute is set on its element (or taken off when `keys` is empty) after each render,
6
+ * and the element is handed on to `ref`.
7
+ */
8
+ export function useKeyshortcuts(keys, ref) {
9
+ const element = useRef(null);
10
+ useImperativeHandle(ref, () => element.current);
11
+ useLayoutEffect(() => {
12
+ if (!element.current)
13
+ return;
14
+ if (keys)
15
+ element.current.setAttribute('aria-keyshortcuts', keys);
16
+ else
17
+ element.current.removeAttribute('aria-keyshortcuts');
18
+ });
19
+ return element;
20
+ }
21
+ //# sourceMappingURL=keyshortcuts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyshortcuts.js","sourceRoot":"","sources":["../../src/lib/keyshortcuts.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,EAA4B,MAAM,OAAO,CAAC;AAQ/F;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAwB,EACxB,GAAY;IAEZ,MAAM,OAAO,GAAG,MAAM,CAAI,IAAI,CAAC,CAAC;IAChC,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAY,CAAC,CAAC;IACrD,eAAe,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE,OAAO;QAC7B,IAAI,IAAI;YAAE,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;;YAC7D,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * How a rail name fits its tile: whole words on at most two lines, shrunk no further than a floor, and a word that
3
+ * still doesn't fit broken with a visible hyphen, never between two letters without one.
4
+ *
5
+ * Why it can't be left to `hyphens: auto`: Chromium never hyphenates a capitalised word in English (it takes it for
6
+ * a proper noun; `Hyphenation::ShouldHyphenateWord`), and Firefox doesn't either, so "Storyboard" gets no break
7
+ * point at all. `overflow-wrap: anywhere` then split it as "Storyboar" / "d".
8
+ */
9
+ export declare const SOFT_HYPHEN = "\u00AD";
10
+ /** The name as said and as matched: a product's soft hyphens taken out. */
11
+ export declare const plainName: (name: string) => string;
12
+ /** The size the name is set in, and the floor it may shrink to: the rail's one exception to the 13px rule. */
13
+ export declare const RAIL_NAME_SIZE = 13;
14
+ export declare const RAIL_NAME_FLOOR = 11.5;
15
+ /**
16
+ * A soft hyphen at every place in `word` with at least three letters either side, so the browser breaks it, with a
17
+ * hyphen, at the last place that fits whatever the width, spacing or zoom. A word that already has one of a
18
+ * product's is left as it is.
19
+ */
20
+ export declare function hyphenateEverywhere(word: string): string;
21
+ /** What laying the name out would give: whether a word runs out of the box, and how many lines it takes. */
22
+ export interface NameLayout {
23
+ overflows: boolean;
24
+ lines: number;
25
+ }
26
+ /**
27
+ * Lays `text` out at `size` px in the name's box and says how it went. `whole`: words never break inside (soft
28
+ * hyphens taken out, no hyphenation), so it answers "do the words fit whole?". `hyphenate`: as the page sets it,
29
+ * with the browser's own hyphenation and any soft hyphens in `text`.
30
+ */
31
+ export type MeasureName = (size: number, text: string, mode: 'whole' | 'hyphenate') => NameLayout;
32
+ export interface FittedName {
33
+ /** The font size in px. */
34
+ size: number;
35
+ /** The text to show: the name, with soft hyphens added to any word that has to break. */
36
+ text: string;
37
+ }
38
+ /**
39
+ * The largest size from 13px down to the floor at which every word fits whole on at most two lines. Failing that,
40
+ * the largest at which every word fits whole, on more lines. Failing that, a word is too long at any size allowed:
41
+ * back to 13px (shrinking doesn't save the break), broken where the browser can (its dictionary, a product's soft
42
+ * hyphen), and otherwise at the last place that fits.
43
+ */
44
+ export declare function fitRailName(name: string, measure: MeasureName): FittedName;
45
+ //# sourceMappingURL=rail-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rail-name.d.ts","sourceRoot":"","sources":["../../src/lib/rail-name.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAO,MAAM,WAAW,WAAM,CAAC;AAE/B,2EAA2E;AAC3E,eAAO,MAAM,SAAS,SAAU,MAAM,WAAqC,CAAC;AAE5E,8GAA8G;AAC9G,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,eAAe,OAAO,CAAC;AAMpC;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOxD;AAED,4GAA4G;AAC5G,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,WAAW,KAAK,UAAU,CAAC;AAElG,MAAM,WAAW,UAAU;IACzB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,UAAU,CAqB1E"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * How a rail name fits its tile: whole words on at most two lines, shrunk no further than a floor, and a word that
3
+ * still doesn't fit broken with a visible hyphen, never between two letters without one.
4
+ *
5
+ * Why it can't be left to `hyphens: auto`: Chromium never hyphenates a capitalised word in English (it takes it for
6
+ * a proper noun; `Hyphenation::ShouldHyphenateWord`), and Firefox doesn't either, so "Storyboard" gets no break
7
+ * point at all. `overflow-wrap: anywhere` then split it as "Storyboar" / "d".
8
+ */
9
+ export const SOFT_HYPHEN = '­';
10
+ /** The name as said and as matched: a product's soft hyphens taken out. */
11
+ export const plainName = (name) => name.replaceAll(SOFT_HYPHEN, '');
12
+ /** The size the name is set in, and the floor it may shrink to: the rail's one exception to the 13px rule. */
13
+ export const RAIL_NAME_SIZE = 13;
14
+ export const RAIL_NAME_FLOOR = 11.5;
15
+ const STEP = 0.25;
16
+ const MAX_LINES = 2;
17
+ /** The fewest letters either side of a hyphen this adds. */
18
+ const EDGE = 3;
19
+ /**
20
+ * A soft hyphen at every place in `word` with at least three letters either side, so the browser breaks it, with a
21
+ * hyphen, at the last place that fits whatever the width, spacing or zoom. A word that already has one of a
22
+ * product's is left as it is.
23
+ */
24
+ export function hyphenateEverywhere(word) {
25
+ if (word.includes(SOFT_HYPHEN))
26
+ return word;
27
+ const letters = [...word];
28
+ if (letters.length < EDGE * 2)
29
+ return word;
30
+ return letters
31
+ .map((letter, i) => (i >= EDGE && i <= letters.length - EDGE ? SOFT_HYPHEN : '') + letter)
32
+ .join('');
33
+ }
34
+ /**
35
+ * The largest size from 13px down to the floor at which every word fits whole on at most two lines. Failing that,
36
+ * the largest at which every word fits whole, on more lines. Failing that, a word is too long at any size allowed:
37
+ * back to 13px (shrinking doesn't save the break), broken where the browser can (its dictionary, a product's soft
38
+ * hyphen), and otherwise at the last place that fits.
39
+ */
40
+ export function fitRailName(name, measure) {
41
+ const plain = plainName(name);
42
+ let wholeOnMoreLines;
43
+ for (let size = RAIL_NAME_SIZE; size >= RAIL_NAME_FLOOR - 1e-9; size -= STEP) {
44
+ const at = measure(size, plain, 'whole');
45
+ if (at.overflows)
46
+ continue;
47
+ if (at.lines <= MAX_LINES)
48
+ return { size, text: name };
49
+ wholeOnMoreLines ??= size;
50
+ }
51
+ if (wholeOnMoreLines !== undefined)
52
+ return { size: wholeOnMoreLines, text: name };
53
+ if (!measure(RAIL_NAME_SIZE, name, 'hyphenate').overflows)
54
+ return { size: RAIL_NAME_SIZE, text: name };
55
+ const text = name
56
+ .split(' ')
57
+ .map((word) => measure(RAIL_NAME_SIZE, plainName(word), 'whole').overflows
58
+ ? hyphenateEverywhere(word)
59
+ : word)
60
+ .join(' ');
61
+ return { size: RAIL_NAME_SIZE, text };
62
+ }
63
+ //# sourceMappingURL=rail-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rail-name.js","sourceRoot":"","sources":["../../src/lib/rail-name.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC;AAE/B,2EAA2E;AAC3E,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,EAA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AE,IAAI,EAAE,IAAI,EAAE,CAAC;QACvD,gBAAgB,KAAK,IAAI,CAAC;IAC5B,CAAC;IACD,IAAI,gBAAgB,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAClF,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,SAAS;QACvD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9C,MAAM,IAAI,GAAG,IAAI;SACd,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACZ,OAAO,CAAC,cAAc,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS;QACzD,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC;QAC3B,CAAC,CAAC,IAAI,CACT;SACA,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;AACxC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { SearchItem, SearchSection } from '../ui/search.js';
2
+ /**
3
+ * The collator search matches with: the locale's, ignoring case and accents. The same options as React Aria's
4
+ * `useFilter({ sensitivity: 'base' })`, which the search used before it ranked.
5
+ */
6
+ export declare const searchCollator: (locale: string) => Intl.Collator;
7
+ /** How an item matched a query, or null if it didn't. Lower sorts first, compared in this order. */
8
+ export interface SearchRank {
9
+ /** The query's words found only in the keywords, not the label. */
10
+ inKeywords: number;
11
+ /** The query's words found only in the middle of a word. */
12
+ midWord: number;
13
+ }
14
+ /** The query's words: split on white space, so their order doesn't matter. */
15
+ export declare const searchWords: (query: string) => string[];
16
+ /**
17
+ * Every word must appear in the label or a keyword. A word counts where it is found best: in the label before
18
+ * the keywords, and at the start of a word before the middle of one.
19
+ */
20
+ export declare function rankSearchItem(item: Pick<SearchItem, 'label' | 'keywords'>, words: string[], collator: Intl.Collator): SearchRank | null;
21
+ /**
22
+ * The sections with only the items that match, best first within each section and otherwise in their given
23
+ * order. Sections keep their order, and one with nothing left is dropped. An empty query keeps everything.
24
+ */
25
+ export declare function searchSections(sections: SearchSection[], query: string, collator: Intl.Collator): SearchSection[];
26
+ /**
27
+ * Item ids used more than once across all the sections. React Aria keys the whole menu by id, so a repeated one
28
+ * shows the first item in the second's place and hides the second.
29
+ */
30
+ export declare function duplicateIds(sections: SearchSection[]): string[];
31
+ //# sourceMappingURL=search-match.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-match.d.ts","sourceRoot":"","sources":["../../src/lib/search-match.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,cAAc,WAAY,MAAM,KAAG,IAAI,CAAC,QACgB,CAAC;AAkBtE,oGAAoG;AACpG,MAAM,WAAW,UAAU;IACzB,mEAAmE;IACnE,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,8EAA8E;AAC9E,eAAO,MAAM,WAAW,UAAW,MAAM,KAAG,MAAM,EACW,CAAC;AAE9D;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,CAAC,EAC5C,KAAK,EAAE,MAAM,EAAE,EACf,QAAQ,EAAE,IAAI,CAAC,QAAQ,GACtB,UAAU,GAAG,IAAI,CAoBnB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,aAAa,EAAE,EACzB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,IAAI,CAAC,QAAQ,GACtB,aAAa,EAAE,CAgBjB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,CAMhE"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * The collator search matches with: the locale's, ignoring case and accents. The same options as React Aria's
3
+ * `useFilter({ sensitivity: 'base' })`, which the search used before it ranked.
4
+ */
5
+ export const searchCollator = (locale) => new Intl.Collator(locale, { usage: 'search', sensitivity: 'base' });
6
+ /** A letter, digit or mark before a match puts it in the middle of a word. */
7
+ const WORD_CHARACTER = /[\p{L}\p{N}\p{M}]/u;
8
+ /** Where `word` first appears in `text` at the start of a word, else anywhere, else null. Both already NFC. */
9
+ function find(text, word, collator) {
10
+ let found = null;
11
+ for (let at = 0; at + word.length <= text.length; at++) {
12
+ if (collator.compare(text.slice(at, at + word.length), word) !== 0)
13
+ continue;
14
+ if (at === 0 || !WORD_CHARACTER.test(text.charAt(at - 1)))
15
+ return 'start';
16
+ found = 'middle';
17
+ }
18
+ return found;
19
+ }
20
+ /** The query's words: split on white space, so their order doesn't matter. */
21
+ export const searchWords = (query) => query.normalize('NFC').trim().split(/\s+/u).filter(Boolean);
22
+ /**
23
+ * Every word must appear in the label or a keyword. A word counts where it is found best: in the label before
24
+ * the keywords, and at the start of a word before the middle of one.
25
+ */
26
+ export function rankSearchItem(item, words, collator) {
27
+ const label = item.label.normalize('NFC');
28
+ const keywords = item.keywords?.map((k) => k.normalize('NFC')) ?? [];
29
+ const rank = { inKeywords: 0, midWord: 0 };
30
+ for (const word of words) {
31
+ const inLabel = find(label, word, collator);
32
+ if (inLabel) {
33
+ if (inLabel === 'middle')
34
+ rank.midWord++;
35
+ continue;
36
+ }
37
+ let inKeyword = null;
38
+ for (const keyword of keywords) {
39
+ inKeyword = find(keyword, word, collator) ?? inKeyword;
40
+ if (inKeyword === 'start')
41
+ break;
42
+ }
43
+ if (!inKeyword)
44
+ return null;
45
+ rank.inKeywords++;
46
+ if (inKeyword === 'middle')
47
+ rank.midWord++;
48
+ }
49
+ return rank;
50
+ }
51
+ /**
52
+ * The sections with only the items that match, best first within each section and otherwise in their given
53
+ * order. Sections keep their order, and one with nothing left is dropped. An empty query keeps everything.
54
+ */
55
+ export function searchSections(sections, query, collator) {
56
+ const words = searchWords(query);
57
+ if (words.length === 0)
58
+ return sections;
59
+ return sections.flatMap((section) => {
60
+ const items = section.items
61
+ .map((item, index) => ({ item, index, rank: rankSearchItem(item, words, collator) }))
62
+ .filter((m) => m.rank !== null)
63
+ .sort((a, b) => a.rank.inKeywords - b.rank.inKeywords ||
64
+ a.rank.midWord - b.rank.midWord ||
65
+ a.index - b.index)
66
+ .map((m) => m.item);
67
+ return items.length > 0 ? [{ ...section, items }] : [];
68
+ });
69
+ }
70
+ /**
71
+ * Item ids used more than once across all the sections. React Aria keys the whole menu by id, so a repeated one
72
+ * shows the first item in the second's place and hides the second.
73
+ */
74
+ export function duplicateIds(sections) {
75
+ const seen = new Set();
76
+ const repeated = new Set();
77
+ for (const { items } of sections)
78
+ for (const { id } of items)
79
+ (seen.has(id) ? repeated : seen).add(id);
80
+ return [...repeated];
81
+ }
82
+ //# sourceMappingURL=search-match.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-match.js","sourceRoot":"","sources":["../../src/lib/search-match.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAc,EAAiB,EAAE,CAC9D,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC;AAItE,8EAA8E;AAC9E,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAE5C,+GAA+G;AAC/G,SAAS,IAAI,CAAC,IAAY,EAAE,IAAY,EAAE,QAAuB;IAC/D,IAAI,KAAK,GAAU,IAAI,CAAC;IACxB,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC;QACvD,IAAI,QAAQ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AC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,QAAyB;IACpD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,KAAK,MAAM,EAAE,KAAK,EAAE,IAAI,QAAQ;QAC9B,KAAK,MAAM,EAAE,EAAE,EAAE,IAAI,KAAK;YAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACvE,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;AACvB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * ⌘K / Ctrl+K for `AppSearch`. One search on a page has the shortcut: the first mounted that asks for it, usually
3
+ * the layout's, which outlives the pages under it. The key is left alone when something else wants it: a handler
4
+ * that already took it (`preventDefault`), a field or editor being typed in (Ctrl+K deletes to the end of the line
5
+ * in a macOS text field, and inserts a link in most editors), or an input method composing.
6
+ */
7
+ /** Asks for the shortcut; the first to ask has it until it lets go. Returns the letting go. */
8
+ export declare function claimSearchShortcut(id: string): () => void;
9
+ export declare const subscribeSearchShortcut: (listener: () => void) => () => void;
10
+ /** Whether `id` has the shortcut. Before anything has asked (the first render), each one that will ask has it. */
11
+ export declare const hasSearchShortcut: (id: string) => boolean;
12
+ /** A field or editor that takes typing, where Ctrl+K and ⌘K may already mean something. */
13
+ export declare function isTextEntry(target: EventTarget | null): boolean;
14
+ /** ⌘K or Ctrl+K, alone, that nothing else has claimed. */
15
+ export declare function isSearchShortcut(e: KeyboardEvent): boolean;
16
+ //# sourceMappingURL=search-shortcut.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-shortcut.d.ts","sourceRoot":"","sources":["../../src/lib/search-shortcut.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,+FAA+F;AAC/F,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,IAAI,CAQ1D;AAED,eAAO,MAAM,uBAAuB,aAAc,MAAM,IAAI,eAK3D,CAAC;AAEF,kHAAkH;AAClH,eAAO,MAAM,iBAAiB,OAAQ,MAAM,YAA4C,CAAC;AAIzF,2FAA2F;AAC3F,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAK/D;AAED,0DAA0D;AAC1D,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO,CAU1D"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * ⌘K / Ctrl+K for `AppSearch`. One search on a page has the shortcut: the first mounted that asks for it, usually
3
+ * the layout's, which outlives the pages under it. The key is left alone when something else wants it: a handler
4
+ * that already took it (`preventDefault`), a field or editor being typed in (Ctrl+K deletes to the end of the line
5
+ * in a macOS text field, and inserts a link in most editors), or an input method composing.
6
+ */
7
+ const owners = [];
8
+ const listeners = new Set();
9
+ const notify = () => listeners.forEach((l) => l());
10
+ /** Asks for the shortcut; the first to ask has it until it lets go. Returns the letting go. */
11
+ export function claimSearchShortcut(id) {
12
+ owners.push(id);
13
+ notify();
14
+ return () => {
15
+ const at = owners.indexOf(id);
16
+ if (at >= 0)
17
+ owners.splice(at, 1);
18
+ notify();
19
+ };
20
+ }
21
+ export const subscribeSearchShortcut = (listener) => {
22
+ listeners.add(listener);
23
+ return () => {
24
+ listeners.delete(listener);
25
+ };
26
+ };
27
+ /** Whether `id` has the shortcut. Before anything has asked (the first render), each one that will ask has it. */
28
+ export const hasSearchShortcut = (id) => owners.length === 0 || owners[0] === id;
29
+ const TEXT_INPUT = new Set(['text', 'search', 'email', 'url', 'tel', 'password', 'number']);
30
+ /** A field or editor that takes typing, where Ctrl+K and ⌘K may already mean something. */
31
+ export function isTextEntry(target) {
32
+ if (!target || typeof target.tagName !== 'string')
33
+ return false;
34
+ const el = target;
35
+ if (el.isContentEditable || el.tagName === 'TEXTAREA')
36
+ return true;
37
+ return el.tagName === 'INPUT' && TEXT_INPUT.has(el.type);
38
+ }
39
+ /** ⌘K or Ctrl+K, alone, that nothing else has claimed. */
40
+ export function isSearchShortcut(e) {
41
+ return ((e.metaKey || e.ctrlKey) &&
42
+ !e.altKey &&
43
+ !e.shiftKey &&
44
+ e.key.toLowerCase() === 'k' &&
45
+ !e.defaultPrevented &&
46
+ !e.isComposing &&
47
+ !isTextEntry(e.composedPath?.()[0] ?? e.target));
48
+ }
49
+ //# sourceMappingURL=search-shortcut.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-shortcut.js","sourceRoot":"","sources":["../../src/lib/search-shortcut.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,GAAa,EAAE,CAAC;AAC5B,MAAM,SAAS,GAAG,IAAI,GAAG,EAAc,CAAC;AACxC,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AAEnD,+FAA+F;AAC/F,MAAM,UAAU,mBAAmB,CAAC,EAAU;IAC5C,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChB,MAAM,EAAE,CAAC;IACT,OAAO,GAAG,EAAE;QACV,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,EAAE,IAAI,CAAC;YAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAClC,MAAM,EAAE,CAAC;IACX,CAAC,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