@sakaniui/react 0.12.0 → 0.13.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/AGENTS.md CHANGED
@@ -259,6 +259,13 @@ lists its other names under `aliases` in `manifest.json`, and `search_components
259
259
  colour you want (`theme="dark"` for a dark surface inside a light page); give markers a `label` and
260
260
  `onMarkerClick` to make them selectable. Choose Map when people need streets and zoom, MapGlobe when the point
261
261
  is global spread.
262
+ - **CommandMenu / CommandMenuTrigger / CommandMenuAnswer** — the ⌘K search and command palette: search pages, people,
263
+ files and actions in one place. Use it instead of building a modal with an `Input` and a list. Pass `groups` of
264
+ `items` and handle `onSelect`; it opens on ⌘K by itself and filters as you type (`filter={false}` for server
265
+ results, with `state="loading"` while you wait). Give every item a `label`, and `shortcut` / `description` / `meta`
266
+ for context. Add `scopes` for tabs, `onAskAI` for ⌘↵, `answer` for an Ask AI answer card, `variant="simple"` for the
267
+ plain version. A `Combobox` is for choosing a value in a form, not for navigating an app. Put a
268
+ `CommandMenuTrigger` in the top bar.
262
269
  - **Avatar / AvatarGroup** — Avatar type is inferred: `src` → image, `initials` → initials, else icon.
263
270
  Prefer a real image when you have one; initials are the fallback, not the default.
264
271
  - **BoardCard / BoardColumn** — kanban pieces. `BoardColumn state="loading"` styles the column; *you* pass
package/CHANGELOG.md CHANGED
@@ -2,6 +2,79 @@
2
2
 
3
3
  All notable changes to `@sakaniui/react` are documented here.
4
4
 
5
+ ## 0.13.0
6
+
7
+ - **New: `CommandMenu`**, a ⌘K search and command palette, built from the new *↳ Command Menu* page in Figma. A search field,
8
+ scope tabs with counts, grouped results with the matched letters in the strong weight, a footer of key hints, and the
9
+ states a real search needs. Also **`CommandMenuTrigger`** (the ⌘K pill for a top bar) and **`CommandMenuAnswer`** (an
10
+ answer card with sources, for the Ask AI state).
11
+ - You pass `groups` of `items` (`label`, `description`, `type`, `icon`, `avatar`, `meta`, `shortcut`, `keywords`, `tags`) and
12
+ handle `onSelect`. It filters as you type unless you pass `filter={false}` (server results); `state="loading"` shows
13
+ skeleton rows and `state="error"` an error with `onRetry`.
14
+ - Keyboard: ⌘K / Ctrl K opens and closes it; ↑ ↓ Home End move one gliding highlight; ↵ chooses; ⌘↵ asks AI (with
15
+ `onAskAI`); Tab and Shift Tab switch scope; ⌫ in an empty field removes the last filter token; typing `team:design`
16
+ and a space makes a token (`filterKeys`); esc clears the query, then closes. Focus returns to where it was.
17
+ - No results is never a dead end: `emptyTitle`, `suggestions` ("Did you mean…", "Remove the filter") and `fallbackGroups`
18
+ ("Try instead"). `answer` takes an answer card or a Chain of Thought; `renderPreview` adds a detail pane beside the list.
19
+ - The No results illustration is alive: the ghost rows flow up without stopping, the top one fading out under a mask while
20
+ the next fades in at the bottom, and a magnifying lens circles slowly over them, showing the rows magnified and clearer
21
+ under the glass (CSS only, the lens uses two registered `@property` lengths). The lens pops in and the title and chips
22
+ rise in. `prefers-reduced-motion` shows the still stack with the lens at rest, as in Figma.
23
+ - The list opens scrolled to the top when its first row is active, so the empty message is never cut off in a short window.
24
+ - The panel no longer resizes as you search. The list area has a fixed height (444px, the Figma No results body) and scrolls
25
+ inside it, so typing, clearing and switching scope never grow or shrink the panel (it still gives way on a short window;
26
+ `variant="simple"` stays as tall as its rows). With `renderPreview` the detail pane is always part of the layout, so
27
+ the width stays 880px whichever row is active; the pane follows the active row after a 140ms rest (so sweeping the
28
+ pointer or holding an arrow key does not flicker through every row), cross-fades, and shows `previewEmpty` when a row
29
+ has nothing to preview.
30
+ - The row highlight no longer lingers as a grey bar over the No results illustration (or the error and loading states) after
31
+ the results disappear; it fades out and comes back with the next result. The preview pane's empty message is centred.
32
+ - The Preview story's detail pane follows the adjusted Figma Command Preview: who (40px avatar, 16/22 name), the Online and
33
+ location badges, a divider, three icon details, a Recent section with times, and two full-width actions pinned to the
34
+ bottom. The answer card, detail pane and footer take Figma's surface/bg-chrome (bg/canvas in Solid; Glass and Liquid keep
35
+ their own), where they were transparent.
36
+ - The detail pane swaps its content in place when the active row changes (no fade or movement), after a 100ms rest on the
37
+ row so sweeping the pointer or holding an arrow key does not flicker through every row.
38
+ - **Ask AI waits to be asked, thinks, then writes the answer.** In the Ask AI scope an empty field shows suggested questions and
39
+ no answer; the answer slot only fills when a question is submitted (↵ on what you typed or on a suggestion, ⌘↵ anywhere).
40
+ It then plays a live Chain of Thought (steps stream in, the working line shimmers, finishing sweeps the rail), which folds
41
+ shut, and the answer card writes itself in word by word. `CommandMenuAnswer` takes `stream` (plain-string children) and
42
+ `onStreamEnd`; its sources and follow-up arrive once the text is written. With an `answer` set, an empty list is no longer
43
+ the "No results" state. The *Live Ask AI* and *Ask AI empty* stories show the whole flow, and Figma has `State=AI empty`
44
+ and `State=AI thinking`.
45
+ - **A soft light runs around the answer card while it is written.** On the card's 1px border, in the brand colour, from the first
46
+ word until the response has fully arrived (the text, then the sources and the follow-up), then it fades out while still moving.
47
+ Reduced motion shows none.
48
+ - **The AI mark is the SakaniUI arc mark on its own**, a circle with no tile, painted in the text colour (white in dark mode,
49
+ near-black in light), on the answer card and on the "Ask AI" rows, replacing the sparkles icon. `SakaniLogo` takes a `color`.
50
+ - New `previewActions`: buttons pinned to the bottom of the detail pane that stay put while the content above (from
51
+ `renderPreview`) changes from row to row. Pass a node, or a function that reads the previewed row.
52
+ - The Preview layout is narrower: 880px (was 960), with a 300px detail pane (was 320). The Figma Preview state and its
53
+ Command Preview part are resized to match.
54
+ - A person's row matches the Figma Leading slot: the 24px Avatar centred in the 28px slot, and the 8px status dot at (18, 17)
55
+ with an inside 1.5px ring (it sat 3px too far out and its ring rendered 1px).
56
+ - The scope tabs (All, Pages, People…) share one pill that glides to the chosen tab (150ms, the same as the row highlight),
57
+ for a click and for Tab / Shift Tab. It opens in place without sliding in, follows tabs that resize when counts appear, and
58
+ stays still with `prefers-reduced-motion`.
59
+ - The hover highlight now follows its row while something above it opens or closes (a Chain of Thought in the Ask AI answer),
60
+ instead of lagging behind and leaving the row without its hover effect. It is placed every frame for the length of the
61
+ transition, with the glide off (shared `useHoverHighlight`, so every flowing-highlight list gets it).
62
+ - Suggestion chips take `emphasis` (a word set in the strong weight, like "invoice" in "Did you mean invoice?") and `iconPosition="end"`.
63
+ - The error state takes `onRetry` ("Try again") and `onReport` (a quieter "Report" beside it), with `retryLabel` / `reportLabel`.
64
+ Scope counts show only for a finished search, not the idle list, loading or an error.
65
+ - `variant="simple"` is the plain version: the field, one group of rows and the key hints.
66
+ - **Changed: `Kbd`** now matches its Figma master: a flat 20px key cap (surface fill, 1px border, 4px radius, 12px text) with no bottom
67
+ shadow. It was heavier before (subtle fill, 6px radius, a 1px bottom shadow). This applies everywhere `Kbd` is used.
68
+ - Reads the Surface tokens, so it re-skins in Glass and Liquid areas; portals to the body like Modal and keeps the theme
69
+ and surface of where it was opened. Accessible: a dialog with a combobox field, a listbox of options, a live
70
+ region announcing the result count, and reduced motion. Text uses `fg/muted` (the Figma file used `fg/subtle` in a few
71
+ places, which is 2.5:1 on white).
72
+ - **New spacing tokens `--space-28` and `--space-36`**
73
+ - **New spacing tokens `--space-28` and `--space-36`**, matching the Figma Spacing collection (`space/28`, `space/36`), so the
74
+ 28px and 36px gaps used in charts, app shells and page covers now come from the scale instead of raw numbers.
75
+ - Manifest: `ChainOfThought.status` no longer reports a default (there is none: no working line unless you pass it), and
76
+ `WorkingIndicator.status` reports its real default, `"working"`.
77
+
5
78
  ## 0.12.0
6
79
 
7
80
  - **New: `ChainOfThought`**, an AI agent's visible work, built from the new *↳ Chain of Thought* page in Figma.