@sakaniui/react 0.11.2 → 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 +20 -3
- package/CHANGELOG.md +106 -0
- package/dist/{TopBar-O_56x94F.js → TopBar-BcXAB1mf.js} +540 -514
- package/dist/TopBar-DeBSl4rq.cjs +1 -0
- package/dist/blocks.cjs +2 -2
- package/dist/blocks.mjs +2053 -2053
- package/dist/building-warehouse-BUtjAEPH.cjs +1 -0
- package/dist/{file-text-DSD625_l.js → building-warehouse-_n8EvYUt.js} +33 -39
- package/dist/components/ChainOfThought/ChainOfThought.d.ts +72 -0
- package/dist/components/ChainOfThought/SourceLogo.d.ts +13 -0
- package/dist/components/ChainOfThought/index.d.ts +6 -0
- package/dist/components/ChainOfThought/logoData.d.ts +93 -0
- package/dist/components/ChainOfThought/logoIcons.d.ts +11 -0
- package/dist/components/CommandMenu/CommandMenu.d.ts +175 -0
- package/dist/components/CommandMenu/index.d.ts +2 -0
- package/dist/emoji-index.json +1 -1
- package/dist/{help-circle-B0koiJUs.js → help-circle-qEEVeIea.js} +15 -9
- package/dist/help-circle-rtL4juBJ.cjs +1 -0
- package/dist/icon-index.json +1 -1
- package/dist/icons.cjs +1 -1
- package/dist/icons.mjs +3932 -3938
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +2944 -1529
- package/dist/lib/SakaniLogo.d.ts +2 -0
- package/dist/{logout-BW8ksDGk.js → logout-BLSXL3qV.js} +10 -4
- package/dist/logout-pQUABnfO.cjs +1 -0
- package/dist/manifest.json +1046 -98
- package/dist/style.css +1 -1
- package/dist/tokens.css +2 -0
- package/package.json +2 -1
- package/dist/TopBar-7GwvQXGS.cjs +0 -1
- package/dist/file-text-DEGE-_aO.cjs +0 -1
- package/dist/help-circle-0qi1skw5.cjs +0 -1
- package/dist/logout-DkdFsC2P.cjs +0 -1
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
|
|
@@ -273,9 +280,19 @@ Many Figma-frame blocks have a fixed design width — put them in a container at
|
|
|
273
280
|
|
|
274
281
|
## 6. Moments an AI product needs (compose these today)
|
|
275
282
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
283
|
+
`ChainOfThought` (with `ChainOfThoughtStep`, `SourceStack` and `WorkingIndicator`) covers showing an agent's
|
|
284
|
+
work. The other moments below have no dedicated component yet: build them from existing parts, and **tell the
|
|
285
|
+
user when you are composing** rather than implying a dedicated component exists.
|
|
286
|
+
|
|
287
|
+
- **Showing the agent's work.** Use `ChainOfThought`: one `ChainOfThoughtStep` per action (an `icon`, a `label`,
|
|
288
|
+
the `query` in monospace, a result `count`, and a `SourceStack` as `sources`). Append a step as the agent starts
|
|
289
|
+
it, mark the active one `status="active"` and finished ones `"done"` (they read muted), and give the container
|
|
290
|
+
`status="working"` with `startedAt` so the timer ticks on its own; switch to `status="done"` and the final
|
|
291
|
+
`elapsed` when the run ends. Give each step a recognisable icon: the site's real logo in its brand colour
|
|
292
|
+
(`icon={sourceLogo('reddit')}`, and the same in the `SourceStack`), or an emoji for steps with no site
|
|
293
|
+
(`EmojiLightBulb` for planning, `EmojiPageFacingUp` for reading). Do not use a generic magnifier for every
|
|
294
|
+
step. It only displays: you stream the steps in. Do not build this from `Stepper` (a
|
|
295
|
+
progress bar for a known sequence) or `ActivityFeed` (a log of past events).
|
|
279
296
|
- **The model isn't sure.** State uncertainty in words next to the claim, not hidden in colour. Use an
|
|
280
297
|
`Alert` (`color="info"` or `"warning"`) or a `Badge` ("Low confidence"). Offer the next step: verify,
|
|
281
298
|
rephrase, or ask for more context.
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,112 @@
|
|
|
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
|
+
|
|
78
|
+
## 0.12.0
|
|
79
|
+
|
|
80
|
+
- **New: `ChainOfThought`**, an AI agent's visible work, built from the new *↳ Chain of Thought* page in Figma.
|
|
81
|
+
A header, steps joined by a tree rail, and a live "Working" line.
|
|
82
|
+
- **`ChainOfThought`**: `title`, `icon`, `open` / `defaultOpen` / `onOpenChange` (the header toggles it, with
|
|
83
|
+
an animated open and close), `status` (`"working"` or `"done"`) with `elapsed` (seconds) or `startedAt`
|
|
84
|
+
(the time then counts up on its own), and `children`.
|
|
85
|
+
- **`SourceLogo`** and **`sourceLogo(name)`**: the real logo of the site a step searched or read, in its brand
|
|
86
|
+
colour, for the `icon` props of a step or a `SourceStack` chip (or `<SourceLogo name="reddit" />` on its own).
|
|
87
|
+
Seventeen sites: Google, X, Reddit, GitHub, LinkedIn, YouTube, Hacker News, Wikipedia, Stack Overflow, Product
|
|
88
|
+
Hunt, Medium, Notion, Substack, arXiv, Bluesky, Perplexity, DuckDuckGo. Black brands draw in the text colour so
|
|
89
|
+
they stay visible in dark mode. Emoji work as step icons too (`icon={EmojiLightBulb}`). A pending step's icon is
|
|
90
|
+
grey until it starts, and the spark that runs into the active step takes the logo's colour.
|
|
91
|
+
- **`ChainOfThoughtStep`**: `status` pending, active (read in full) or done (muted), an `icon`, a `label`, an
|
|
92
|
+
optional monospace `query`, a result `count`, and a `sources` row (add `onSourcesClick` to make it a button
|
|
93
|
+
with a chevron). The rail stops at the last step by itself; screen readers get each step's status.
|
|
94
|
+
- **`SourceStack`**: overlapping site-icon chips from `sources` ({ `label`, `icon` }); three to five read best.
|
|
95
|
+
- **`WorkingIndicator`**: the working line on its own: a living sparkle (in the brand colour, a 1px line) and a shimmering "Working" with the
|
|
96
|
+
elapsed time, or a check and "Worked for 11.2s". The sparkle's three stars move on their own: the big one turns
|
|
97
|
+
a quarter each cycle and breathes while the two small ones twinkle in turn, filling in at their peak, in time with
|
|
98
|
+
the shimmer. Both stop under reduced motion. The Live story has a Dark mode switch.
|
|
99
|
+
- Presentational: you append steps as your agent produces them. Light and dark through the tokens.
|
|
100
|
+
- **Motion**, from the Figma *Chain of Thought · motion* table, reads as ink running down the rail. An appended
|
|
101
|
+
step opens its row while the previous rail flows down into it, turns the corner and the icon lands; the label
|
|
102
|
+
is written in left to right, the query types itself, the count ticks up to its value and the source chips fan
|
|
103
|
+
out. A spark keeps running into the active step and its icon beats as it lands. Results that land later open
|
|
104
|
+
their row instead of jumping in. Finishing sends one sweep down the rail, lighting each icon in turn, and the
|
|
105
|
+
check is drawn when it lands. Opening the panel lets the steps rise in turn. Only what arrives after the first
|
|
106
|
+
render animates, and reduced motion makes all of it instant.
|
|
107
|
+
- Agent contract: the four components are in the manifest with a streaming-run recipe and the aliases *chain of
|
|
108
|
+
thought*, *reasoning steps*, *agent steps*, *tool calls*, *sources*, *favicon stack* and more; the agent guide's
|
|
109
|
+
"moments an AI product needs" now points at `ChainOfThought`.
|
|
110
|
+
|
|
5
111
|
## 0.11.2
|
|
6
112
|
|
|
7
113
|
- **Agent guide:** `AGENTS.md` gains a Map section (when to use `Map` or `MapGlobe`, latitude first, tile providers,
|