@setsquare/ui 0.6.0 → 0.8.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.
- package/CHANGELOG.md +102 -0
- package/README.md +9 -5
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/cn.d.ts.map +1 -1
- package/dist/lib/cn.js +1 -0
- package/dist/lib/cn.js.map +1 -1
- package/dist/lib/english.d.ts.map +1 -1
- package/dist/lib/english.js +2 -0
- package/dist/lib/english.js.map +1 -1
- package/dist/lib/keyshortcuts.d.ts +13 -0
- package/dist/lib/keyshortcuts.d.ts.map +1 -0
- package/dist/lib/keyshortcuts.js +21 -0
- package/dist/lib/keyshortcuts.js.map +1 -0
- package/dist/lib/locale.d.ts +4 -1
- package/dist/lib/locale.d.ts.map +1 -1
- package/dist/lib/locale.js.map +1 -1
- package/dist/lib/search-match.d.ts +31 -0
- package/dist/lib/search-match.d.ts.map +1 -0
- package/dist/lib/search-match.js +82 -0
- package/dist/lib/search-match.js.map +1 -0
- package/dist/lib/search-shortcut.d.ts +16 -0
- package/dist/lib/search-shortcut.d.ts.map +1 -0
- package/dist/lib/search-shortcut.js +49 -0
- package/dist/lib/search-shortcut.js.map +1 -0
- package/dist/shell/app-header.d.ts +4 -1
- package/dist/shell/app-header.d.ts.map +1 -1
- package/dist/shell/app-header.js +6 -3
- package/dist/shell/app-header.js.map +1 -1
- package/dist/shell/dashboard-shell.d.ts +13 -2
- package/dist/shell/dashboard-shell.d.ts.map +1 -1
- package/dist/shell/dashboard-shell.js +5 -2
- package/dist/shell/dashboard-shell.js.map +1 -1
- package/dist/shell/nav-status.d.ts +46 -0
- package/dist/shell/nav-status.d.ts.map +1 -0
- package/dist/shell/nav-status.js +26 -0
- package/dist/shell/nav-status.js.map +1 -0
- package/dist/shell/rail.d.ts +73 -0
- package/dist/shell/rail.d.ts.map +1 -0
- package/dist/shell/rail.js +87 -0
- package/dist/shell/rail.js.map +1 -0
- package/dist/shell/sidebar.d.ts +31 -6
- package/dist/shell/sidebar.d.ts.map +1 -1
- package/dist/shell/sidebar.js +45 -8
- package/dist/shell/sidebar.js.map +1 -1
- package/dist/styles/theme.css +78 -0
- package/dist/styles/tokens.css +4 -4
- package/dist/tokens.json +4 -4
- package/dist/ui/button.d.ts +3 -2
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +7 -4
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/search.d.ts +19 -3
- package/dist/ui/search.d.ts.map +1 -1
- package/dist/ui/search.js +55 -23
- package/dist/ui/search.js.map +1 -1
- package/dist/ui/tree.d.ts +5 -3
- package/dist/ui/tree.d.ts.map +1 -1
- package/dist/ui/tree.js +4 -2
- package/dist/ui/tree.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,107 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.0 — 2026-10-14
|
|
4
|
+
|
|
5
|
+
- **Search finds items by words that aren't in their label.** `SearchItem` takes `keywords?: string[]`: what people
|
|
6
|
+
call an item rather than its name, so "mp4" or "export" finds "Render the whole video (MP4)". Keywords are matched
|
|
7
|
+
as well as the label, in `AppSearch` and `CommandSearch` alike, and are never shown or made part of the item's
|
|
8
|
+
accessible name. An item without keywords is matched on its label, as before.
|
|
9
|
+
- **A query of several words matches when every word appears**, in the label or the keywords, in any order: "video
|
|
10
|
+
render", "render video" and "render mp4" all find that item. Before, the whole query had to appear in the label as
|
|
11
|
+
typed. Matching is still the locale's, ignoring case and accents (`Intl.Collator` with `sensitivity: 'base'`, as
|
|
12
|
+
`useFilter` was).
|
|
13
|
+
- **Results are ranked within each section.** An item with the words in its label comes before one found through its
|
|
14
|
+
keywords, and one where they start a word before one where they are inside a word; otherwise items keep the order
|
|
15
|
+
given. This can reorder results for items without keywords too: "port" now lists "Portal" before "Import". Sections
|
|
16
|
+
keep their order, and the empty state shows when nothing matches. React Aria's `Autocomplete` can only filter, not
|
|
17
|
+
reorder, so the dialog now holds the field's text and gives the menu the ranked items; `Autocomplete` still moves
|
|
18
|
+
through them from the field, and points it at the first result as you type.
|
|
19
|
+
- **⌘K / Ctrl+K is left alone where something else wants it.** `AppSearch` used to take the key everywhere. It now
|
|
20
|
+
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
|
|
21
|
+
inserts a link in most editors), to a handler that already took it (`preventDefault`), to ⌘⇧K and ⌘⌥K, and to an
|
|
22
|
+
input method composing.
|
|
23
|
+
- **One search on a page has the shortcut.** With two `AppSearch` on a page, ⌘K opened both. Now the first mounted
|
|
24
|
+
that asks has it, which is usually the layout's; when it unmounts, the next takes over. `shortcut={false}` gives it
|
|
25
|
+
up. Only the one with the shortcut shows ⌘K and sets `aria-keyshortcuts`; `SearchTrigger` takes `shortcut` too.
|
|
26
|
+
- **Fix: `aria-keyshortcuts` reaches the element.** React Aria's components pass only the DOM attributes they know,
|
|
27
|
+
and dropped `aria-keyshortcuts`, so it never reached the page: not on the search's trigger, though its README said
|
|
28
|
+
so, nor from a product that passed it. `Button`, `IconButton`, `LinkButton` and `Tree` now take it
|
|
29
|
+
(`KeyshortcutsProps`) and set it on their element after rendering, so it isn't in the server's HTML. This also fixes
|
|
30
|
+
`@setsquare/ui-blocks`, whose Undo and Redo buttons and outline pass it: theirs reach the page from this version on.
|
|
31
|
+
A `ref` given to `Button`, `IconButton` or `LinkButton` still gets the element, now through `useImperativeHandle`.
|
|
32
|
+
- **An item `id` used twice is a console error.** React Aria keys the search's menu by id across all its sections, so
|
|
33
|
+
a repeated one showed the first item twice and hid the other, silently. `CommandSearch` now logs the ids.
|
|
34
|
+
- **Docs.** The AppSearch page's example and the design-system demo's search have keywords. The README says how
|
|
35
|
+
matching and ranking work, and what a product has to get right: unique ids, what a server component can pass,
|
|
36
|
+
the router, the locale, the shortcut, and the sizes checked.
|
|
37
|
+
- **Tests.** Unit tests for the matching (several words in any order, accents, the locale's collation, keyword-only
|
|
38
|
+
matches after label matches, word starts before the middle of words, sections) and browser checks in the dashboard
|
|
39
|
+
shell's search: a keyword finding an item named by its label alone, the ranked order with the field pointing at the
|
|
40
|
+
first result (`aria-activedescendant`), words in any order, and the empty state. Unit tests for the shortcut's
|
|
41
|
+
rules and the duplicate ids. `test/browser/search.mjs` drives the shortcut in Chromium: what opens on ⌘K and Ctrl+K
|
|
42
|
+
and what is left alone, two searches on a page, `shortcut={false}`, `aria-keyshortcuts` on both triggers and on
|
|
43
|
+
`Button`, `IconButton`, `LinkButton` and `Tree` (set, and taken off), and the console error. `blocks-shortcuts`
|
|
44
|
+
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,
|
|
45
|
+
element icons and keywords, and checks Ctrl+K opens it and a keyword finds its link.
|
|
46
|
+
|
|
47
|
+
## 0.7.0 — 2026-10-13
|
|
48
|
+
|
|
49
|
+
- **`Rail`, new: layout option C's navigation.** A full-height rail, `--rail-width` wide (72px at AA, 88px at AAA),
|
|
50
|
+
used in a `DashboardShell` instead of `Sidebar`, for a product that needs every destination visible but can't give
|
|
51
|
+
up the sidebar's 256px. Each item shows its icon over its name, always; names are 13px and wrap inside the tile,
|
|
52
|
+
hyphenating where the browser can and breaking a word that still doesn't fit rather than cutting it off. It never
|
|
53
|
+
collapses or expands. Its parts mirror the Sidebar's: `Rail`, `RailHeader`, `RailContent` (a positioned scroller),
|
|
54
|
+
`RailGroup` (named by a visually hidden heading, with a rule above each one after the first), `RailList`,
|
|
55
|
+
`RailFooter` (pinned to the bottom) and `RailItem` (`href` or `onPress`, `icon`, its name, `isCurrent`). Items are
|
|
56
|
+
in three layers like `SidebarItem`. The current page has the `brand-subtle` fill, a 3px `sidebar-primary` edge along
|
|
57
|
+
the tile's start that follows its rounded corners, and its icon and name in `brand` at weight 700; in forced colours
|
|
58
|
+
a bar in `Highlight` takes the edge's place. Nothing in the rail transitions or animates, at AA or AAA. On phones it is the Sidebar's Sheet,
|
|
59
|
+
with the items as rows.
|
|
60
|
+
- **`DashboardShell` takes `navigation`**: `'sidebar'` (the default) or `'rail'`, and `useShell()` returns it. With
|
|
61
|
+
`'rail'`, `AppHeader` shows no collapse toggle and no rule after it, only the phone's menu button, which a container
|
|
62
|
+
query hides from `bp-md` up until the shell has measured itself. It's a prop rather than something the Rail
|
|
63
|
+
registers, so the server renders the right header. A `Rail` in a shell without it logs an error to the console.
|
|
64
|
+
- **Words:** `RailLabels` (`primary`, `navigation`), and `SetsquareLabels.rail`, laid over `SetsquareLabels.sidebar`,
|
|
65
|
+
so a product that switches keeps its translations.
|
|
66
|
+
- **Live status on `SidebarItem` and `RailItem`.** `status` (`'working'` or `'attention'`) puts a badge on the icon,
|
|
67
|
+
in the tab badges' language, with a cut-out in the row's own ground: working is a hollow `brand` ring, attention a
|
|
68
|
+
`destructive` dot inside a ring, so the two differ in shape as well as colour. Working pulses three times in 4.5s as
|
|
69
|
+
it appears and then holds still, inside the five seconds 2.2.2 allows for motion people can't stop; it never
|
|
70
|
+
pulses at AAA or under reduced motion. Attention never moves. `statusLabel` is required with `status` (a type
|
|
71
|
+
error without it, and a console error from plain JavaScript): it is said after the name and any count, and is in
|
|
72
|
+
the collapsed sidebar's tooltip. `detail` is a short value ("4/8", "$1.20"), right-aligned in the sidebar and under
|
|
73
|
+
the name in a rail, in tabular numbers and read as part of the name; `detailTone="warning"` adds a warning icon,
|
|
74
|
+
the `warning` colour and words in the name ("Spend, $1.20, warning"). In forced colours the badges are drawn in
|
|
75
|
+
`CanvasText` and `Highlight`. `count` works as before, and is read before the detail and status.
|
|
76
|
+
- **An item's icon can be a drawing of the product's own**, such as a progress ring: `IconProp` already took an
|
|
77
|
+
element, and the item now wraps the icon in a box that carries its colour, so a drawing in `currentColor` turns
|
|
78
|
+
`brand` on the current page even if it ignores `className`.
|
|
79
|
+
- **Words:** `SidebarLabels` gains `detail`, `detailWarning`, `status`, `tipDetail`, `tipDetailWarning` and
|
|
80
|
+
`tipStatus`; `RailLabels` gains `detail`, `detailWarning` and `status`. New types: `NavStatus`, `NavDetailTone`,
|
|
81
|
+
`NavItemLiveProps`; `SidebarItemProps` is exported, and it and `RailItemProps` are now type aliases (an
|
|
82
|
+
intersection with `NavItemLiveProps`), so code that `extends` either interface needs a `type` instead.
|
|
83
|
+
- **Contrast:** the audit promises the pairs the status uses: `brand`, `destructive` and `warning` on `sidebar` and
|
|
84
|
+
`sidebar-accent` at 3:1, `warning` on `brand-subtle` at 3:1, `warning` text on `sidebar`, `sidebar-accent` and
|
|
85
|
+
`brand-subtle`, and `muted-foreground` on `sidebar-accent` (a count or detail on the hovered row).
|
|
86
|
+
- **The Sidebar's current page is marked as the Rail's is.** `SidebarItem` and a `SidebarDisclosure`'s pages had a
|
|
87
|
+
rounded bar inset from the top and bottom and the name in `foreground`; they now have a 3px `sidebar-primary` edge
|
|
88
|
+
along the row's start, drawn as an inset shadow so it follows the rounded corners, and the icon and name in
|
|
89
|
+
`brand`. Hovered, a current item kept the hover ground before, which under brand text would be a pair the contrast
|
|
90
|
+
audit doesn't promise; in both components it now keeps its `brand-subtle` fill. In forced colours the Sidebar's
|
|
91
|
+
marker used to disappear (forced colours drop the background it was drawn with); like the Rail's, it is now a bar in
|
|
92
|
+
`Highlight`.
|
|
93
|
+
- **`brand-subtle` is stronger**, so a current nav item, a selected row or tab, an info alert or a brand badge stands
|
|
94
|
+
off its ground: against the sidebar it was 1.07:1 in light, 1.11:1 in light AAA, 1.19:1 in dark and 1.25:1 in dark
|
|
95
|
+
AAA, and is now 1.24, 1.22, 1.37 and 1.35 (`#dadef5`, `#dcdff0`, `#242c55`, `#20274f`). Every pair on it still clears
|
|
96
|
+
its floor; the tightest are muted text in light (4.64:1), warning text in light AAA (7.31:1) and brand text in dark
|
|
97
|
+
AAA (7.96:1). Everything that uses it looks a little deeper. A product with its own palette is unaffected.
|
|
98
|
+
- `w-rail` (`--spacing-rail`) is a utility, and `cn()` merges it.
|
|
99
|
+
- **Docs.** A Rail page on ui.setsquare.dev, and the DashboardShell page shows the shell with a Rail under the shell
|
|
100
|
+
with a Sidebar, at each size. The Sidebar and Rail pages' frames and cards show live status and details. Design-system cards: Rail, DashboardShellRail, DashboardShellRailTablet and
|
|
101
|
+
DashboardShellRailMobileNav.
|
|
102
|
+
- **Tests.** `test/browser/rail.mjs` and `test/browser/nav-status.mjs`, in all four themes and two brands, and unit
|
|
103
|
+
tests for what the server renders and for the collapsed sidebar's tooltip (see What is tested in the README).
|
|
104
|
+
|
|
3
105
|
## 0.6.0 — 2026-10-13
|
|
4
106
|
|
|
5
107
|
Breaking: every word is an ICU MessageFormat template, and the package writes no sentence in code. None of 0.5's
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ Controls are built in three layers, so the switch changes targets without changi
|
|
|
18
18
|
pnpm add @setsquare/ui react-aria-components @internationalized/date
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
It needs React 19.2 or later, React Aria Components 1.21 or later, and Tailwind CSS 4 in the app. A module is a client component (`'use client'`) only when it needs to be: React Aria, a hook, a context or an event handler. The rest — `StatusBadge`, `Avatar`, `ProductMark`, `Kbd`, `EmptyState`, `IconButton`, `PageHeader`, `PageContent`, the site shell's `SiteShell`, `SiteMain`, `SiteHeader`, `SiteNav`, `SiteFooter` and `SiteFooterGroup`, the content components `Section`, `SectionHeader`, `Container`, `Eyebrow`, `Hero`, `HeroHighlight`, `Card`, `CardGrid`, `Prose`, `Steps`, `Step`, `Split`, `Tag`, `StatList` and `Stat`, `CodeBlock`, `ThemeScript`, `buttonTargetStyles()` and `buttonVisualStyles()` — have no directive, so a server component uses them without shipping them to the browser. Server components can render either kind. A server component that gives a client component an icon (`Alert`, `MenuItem`, `SidebarItem`, a search item) passes the element, `icon={<Folder />}`: a component can't cross into a client component.
|
|
21
|
+
It needs React 19.2 or later, React Aria Components 1.21 or later, and Tailwind CSS 4 in the app. A module is a client component (`'use client'`) only when it needs to be: React Aria, a hook, a context or an event handler. The rest — `StatusBadge`, `Avatar`, `ProductMark`, `Kbd`, `EmptyState`, `IconButton`, `PageHeader`, `PageContent`, the site shell's `SiteShell`, `SiteMain`, `SiteHeader`, `SiteNav`, `SiteFooter` and `SiteFooterGroup`, the content components `Section`, `SectionHeader`, `Container`, `Eyebrow`, `Hero`, `HeroHighlight`, `Card`, `CardGrid`, `Prose`, `Steps`, `Step`, `Split`, `Tag`, `StatList` and `Stat`, `CodeBlock`, `ThemeScript`, `buttonTargetStyles()` and `buttonVisualStyles()` — have no directive, so a server component uses them without shipping them to the browser. Server components can render either kind. A server component that gives a client component an icon (`Alert`, `MenuItem`, `SidebarItem`, `RailItem`, a search item) passes the element, `icon={<Folder />}`: a component can't cross into a client component.
|
|
22
22
|
|
|
23
23
|
In the app's global stylesheet, after Tailwind:
|
|
24
24
|
|
|
@@ -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.
|
|
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
|
-
-
|
|
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,13 +361,16 @@ 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;
|
|
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, 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;
|
|
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;
|
|
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;
|
|
363
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;
|
|
364
368
|
- pagination: the tiers at 1, 4, 7, 8, 20, 21 and 239 pages, a row that never changes length, the names of page links and arrows, hrefs that keep the query and never use `meta.links`, rows per page keeping the first row in view, focus after paging, the page field's validation and alert, the pending mark and its message after 400ms (and the mark stopping inside five seconds), and motion at AA, AAA and under reduced motion;
|
|
365
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;
|
|
366
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;
|
|
367
371
|
- the page checks above, each also run on a page built to fail.
|
|
368
|
-
- **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.
|
|
369
|
-
- **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.
|
|
370
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.
|
|
371
375
|
|
|
372
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/text-link.js';
|
|
@@ -40,10 +41,13 @@ export type { SheetLabels } from './ui/sheet.js';
|
|
|
40
41
|
export { AppSearch, CommandSearch, SearchTrigger } from './ui/search.js';
|
|
41
42
|
export type { SearchItem, SearchSection, SearchLabels } from './ui/search.js';
|
|
42
43
|
export { DashboardShell, ShellInset, ShellBody, ShellMain, useShell, useOptionalShell, } from './shell/dashboard-shell.js';
|
|
43
|
-
export type { ShellSize, PanelMode, DashboardShellProps } from './shell/dashboard-shell.js';
|
|
44
|
+
export type { ShellSize, PanelMode, ShellNavigation, DashboardShellProps, } from './shell/dashboard-shell.js';
|
|
44
45
|
export type { ShellLabels, SiteNavLabels } from './shell/landmarks.js';
|
|
45
46
|
export { Sidebar, SidebarHeader, SidebarContent, SidebarFooter, SidebarGroup, SidebarList, SidebarItem, SidebarDisclosure, SidebarSwitcher, SidebarTrigger, useSidebarCollapsed, } from './shell/sidebar.js';
|
|
46
|
-
export type { SidebarLabels, SidebarTriggerLabels, SidebarDisclosureProps, SidebarSubItem, } from './shell/sidebar.js';
|
|
47
|
+
export type { SidebarItemProps, SidebarLabels, SidebarTriggerLabels, SidebarDisclosureProps, SidebarSubItem, } from './shell/sidebar.js';
|
|
48
|
+
export { Rail, RailHeader, RailContent, RailFooter, RailGroup, RailList, RailItem, } from './shell/rail.js';
|
|
49
|
+
export type { RailProps, RailLabels, RailItemProps } from './shell/rail.js';
|
|
50
|
+
export type { NavStatus, NavDetailTone, NavItemLiveProps } from './shell/nav-status.js';
|
|
47
51
|
export { AppHeader } from './shell/app-header.js';
|
|
48
52
|
export { SiteShell, SiteMain } from './shell/site-shell.js';
|
|
49
53
|
export type { SiteShellProps, SiteMainProps } from './shell/site-shell.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACnE,YAAY,EAAE,iBAAiB,E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C;AACvF,YAAY,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC9D,YAAY,EACV,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC3D,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACvE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -29,6 +29,7 @@ export { Sheet } from './ui/sheet.js';
|
|
|
29
29
|
export { AppSearch, CommandSearch, SearchTrigger } from './ui/search.js';
|
|
30
30
|
export { DashboardShell, ShellInset, ShellBody, ShellMain, useShell, useOptionalShell, } from './shell/dashboard-shell.js';
|
|
31
31
|
export { Sidebar, SidebarHeader, SidebarContent, SidebarFooter, SidebarGroup, SidebarList, SidebarItem, SidebarDisclosure, SidebarSwitcher, SidebarTrigger, useSidebarCollapsed, } from './shell/sidebar.js';
|
|
32
|
+
export { Rail, RailHeader, RailContent, RailFooter, RailGroup, RailList, RailItem, } from './shell/rail.js';
|
|
32
33
|
export { AppHeader } from './shell/app-header.js';
|
|
33
34
|
// The site shell, for public pages. SiteShell, SiteMain, SiteHeader, SiteNav, SiteFooter and SiteFooterGroup
|
|
34
35
|
// have no 'use client'; SiteMenu and SiteNavLink do.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGpD,yFAAyF;AACzF,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC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d.ts","sourceRoot":"","sources":["../../src/lib/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAyD7C,4EAA4E;AAC5E,wBAAgB,EAAE,CAAC,GAAG,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,CAEjD"}
|
package/dist/lib/cn.js
CHANGED
package/dist/lib/cn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cn.js","sourceRoot":"","sources":["../../src/lib/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD;;;GAGG;AACH,MAAM,KAAK,GAAG,mBAAmB,CAA6D;IAC5F,MAAM,EAAE;QACN,4FAA4F;QAC5F,KAAK,EAAE;YACL,OAAO,EAAE;gBACP,QAAQ;gBACR,gBAAgB;gBAChB,SAAS;gBACT,YAAY;gBACZ,YAAY;gBACZ,UAAU;gBACV,QAAQ;gBACR,SAAS;gBACT,mBAAmB;gBACnB,OAAO;gBACP,QAAQ;aACT;SACF;QACD,WAAW,EAAE;YACX,+FAA+F;YAC/F,WAAW,EAAE;gBACX;oBACE,IAAI,EAAE;wBACJ,SAAS;wBACT,cAAc;wBACd,iBAAiB;wBACjB,MAAM;wBACN,OAAO;wBACP,SAAS;wBACT,YAAY;wBACZ,MAAM;wBACN,IAAI;wBACJ,WAAW;wBACX,SAAS;wBACT,gBAAgB;wBAChB,MAAM;qBACP;iBACF;aACF;YACD,YAAY,EAAE,CAAC,YAAY,EAAE,kBAAkB,CAAC;YAChD,+FAA+F;YAC/F,aAAa,EAAE,CAAC,aAAa,CAAC;YAC9B,aAAa,EAAE,CAAC,aAAa,CAAC;YAC9B,gGAAgG;YAChG,WAAW,EAAE,CAAC,WAAW,CAAC;SAC3B;KACF;CACF,CAAC,CAAC;AAEH,4EAA4E;AAC5E,MAAM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"english.d.ts","sourceRoot":"","sources":["../../src/lib/english.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"english.d.ts","sourceRoot":"","sources":["../../src/lib/english.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA6BnD,kHAAkH;AAClH,eAAO,MAAM,aAAa,EAAE;KACzB,CAAC,IAAI,MAAM,eAAe,CAAC,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;CAsC1E,CAAC"}
|
package/dist/lib/english.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { shellLabels, siteNavLabels } from '../shell/landmarks.js';
|
|
2
|
+
import { railLabels } from '../shell/rail.js';
|
|
2
3
|
import { rightPanelLabels } from '../shell/right-panel.js';
|
|
3
4
|
import { sidebarLabels, sidebarTriggerLabels } from '../shell/sidebar.js';
|
|
4
5
|
import { siteMenuLabels } from '../shell/site-menu.js';
|
|
@@ -47,6 +48,7 @@ export const englishLabels = {
|
|
|
47
48
|
fileUpload: fileUploadLabels,
|
|
48
49
|
offlineAlert: offlineAlertLabels,
|
|
49
50
|
pagination: paginationLabels,
|
|
51
|
+
rail: railLabels,
|
|
50
52
|
rangeSlider: rangeSliderLabels,
|
|
51
53
|
rightPanel: rightPanelLabels,
|
|
52
54
|
search: searchLabels,
|
package/dist/lib/english.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"english.js","sourceRoot":"","sources":["../../src/lib/english.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAA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EAAE,aAAa;CACvB,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"}
|
package/dist/lib/locale.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type LabelValues } from './labels.js';
|
|
3
3
|
import type { ShellLabels, SiteNavLabels } from '../shell/landmarks.js';
|
|
4
|
+
import type { RailLabels } from '../shell/rail.js';
|
|
4
5
|
import type { RightPanelLabels } from '../shell/right-panel.js';
|
|
5
6
|
import type { SidebarLabels, SidebarTriggerLabels } from '../shell/sidebar.js';
|
|
6
7
|
import type { SiteMenuLabels } from '../shell/site-menu.js';
|
|
@@ -40,9 +41,9 @@ export interface SetsquareLabels {
|
|
|
40
41
|
comboBox?: Partial<Omit<ComboBoxLabels, keyof FieldLabels>>;
|
|
41
42
|
confirmDialog?: Partial<ConfirmDialogLabels>;
|
|
42
43
|
copyButton?: Partial<CopyButtonLabels>;
|
|
43
|
-
/** DateField, TimeField, DatePicker and DateRangePicker, over `field`. */
|
|
44
44
|
/** DashboardShell's skip link. */
|
|
45
45
|
dashboardShell?: Partial<ShellLabels>;
|
|
46
|
+
/** DateField, TimeField, DatePicker and DateRangePicker, over `field`. */
|
|
46
47
|
dateField?: Partial<Omit<DateFieldLabels, keyof FieldLabels>>;
|
|
47
48
|
dialog?: Partial<DialogLabels>;
|
|
48
49
|
errorState?: Partial<ErrorStateLabels>;
|
|
@@ -54,6 +55,8 @@ export interface SetsquareLabels {
|
|
|
54
55
|
fileUpload?: Partial<FileUploadLabels>;
|
|
55
56
|
offlineAlert?: Partial<OfflineAlertLabels>;
|
|
56
57
|
pagination?: Partial<PaginationLabels>;
|
|
58
|
+
/** Rail, the navigation of layout option C, laid over `sidebar`'s words for the same keys. */
|
|
59
|
+
rail?: Partial<RailLabels>;
|
|
57
60
|
rangeSlider?: Partial<RangeSliderLabels>;
|
|
58
61
|
/** RightPanel and PanelToggle. */
|
|
59
62
|
rightPanel?: Partial<RightPanelLabels>;
|
package/dist/lib/locale.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../src/lib/locale.tsx"],"names":[],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,CAAC;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CAClC;AASD,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,oBAAoB,+BAajF;AAED,iHAAiH;AACjH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,MAAM,CAAC;AAEnF;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EACxC,KAAK,EAAE,MAAM,eAAe,GAAG,CAAC,MAAM,eAAe,CAAC,EAAE,EACxD,QAAQ,EAAE,CAAC,EACX,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,GAC5B,SAAS,CAAC,CAAC,CAAC,CAad"}
|
package/dist/lib/locale.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/lib/locale.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAoB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/lib/locale.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,O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Q,YAAG,QAAQ,GAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC;AACzF,CAAC;AAKD;;;GAGG;AACH,MAAM,UAAU,SAAS,CACvB,KAAwD,EACxD,QAAW,EACX,KAA6B;IAE7B,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IACtD,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/B,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CACzD,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAA2B,CAClD,CAAC;IACF,gHAAgH;IAChH,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,EAAE,GAAG,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;IACrE,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAA2B,CAAC;QAC3D,MAAM,OAAO,GAAG,QAAkC,CAAC;QACnD,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1E,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAChC,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,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,E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;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"}
|