@sakaniui/react 0.11.2 → 0.12.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
@@ -273,9 +273,19 @@ Many Figma-frame blocks have a fixed design width — put them in a container at
273
273
 
274
274
  ## 6. Moments an AI product needs (compose these today)
275
275
 
276
- The system has no dedicated AI components yet. Until it does, build these moments from existing parts,
277
- and **tell the user when you are composing** rather than implying a dedicated component exists.
278
-
276
+ `ChainOfThought` (with `ChainOfThoughtStep`, `SourceStack` and `WorkingIndicator`) covers showing an agent's
277
+ work. The other moments below have no dedicated component yet: build them from existing parts, and **tell the
278
+ user when you are composing** rather than implying a dedicated component exists.
279
+
280
+ - **Showing the agent's work.** Use `ChainOfThought`: one `ChainOfThoughtStep` per action (an `icon`, a `label`,
281
+ the `query` in monospace, a result `count`, and a `SourceStack` as `sources`). Append a step as the agent starts
282
+ it, mark the active one `status="active"` and finished ones `"done"` (they read muted), and give the container
283
+ `status="working"` with `startedAt` so the timer ticks on its own; switch to `status="done"` and the final
284
+ `elapsed` when the run ends. Give each step a recognisable icon: the site's real logo in its brand colour
285
+ (`icon={sourceLogo('reddit')}`, and the same in the `SourceStack`), or an emoji for steps with no site
286
+ (`EmojiLightBulb` for planning, `EmojiPageFacingUp` for reading). Do not use a generic magnifier for every
287
+ step. It only displays: you stream the steps in. Do not build this from `Stepper` (a
288
+ progress bar for a known sequence) or `ActivityFeed` (a log of past events).
279
289
  - **The model isn't sure.** State uncertainty in words next to the claim, not hidden in colour. Use an
280
290
  `Alert` (`color="info"` or `"warning"`) or a `Badge` ("Low confidence"). Offer the next step: verify,
281
291
  rephrase, or ask for more context.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,39 @@
2
2
 
3
3
  All notable changes to `@sakaniui/react` are documented here.
4
4
 
5
+ ## 0.12.0
6
+
7
+ - **New: `ChainOfThought`**, an AI agent's visible work, built from the new *↳ Chain of Thought* page in Figma.
8
+ A header, steps joined by a tree rail, and a live "Working" line.
9
+ - **`ChainOfThought`**: `title`, `icon`, `open` / `defaultOpen` / `onOpenChange` (the header toggles it, with
10
+ an animated open and close), `status` (`"working"` or `"done"`) with `elapsed` (seconds) or `startedAt`
11
+ (the time then counts up on its own), and `children`.
12
+ - **`SourceLogo`** and **`sourceLogo(name)`**: the real logo of the site a step searched or read, in its brand
13
+ colour, for the `icon` props of a step or a `SourceStack` chip (or `<SourceLogo name="reddit" />` on its own).
14
+ Seventeen sites: Google, X, Reddit, GitHub, LinkedIn, YouTube, Hacker News, Wikipedia, Stack Overflow, Product
15
+ Hunt, Medium, Notion, Substack, arXiv, Bluesky, Perplexity, DuckDuckGo. Black brands draw in the text colour so
16
+ they stay visible in dark mode. Emoji work as step icons too (`icon={EmojiLightBulb}`). A pending step's icon is
17
+ grey until it starts, and the spark that runs into the active step takes the logo's colour.
18
+ - **`ChainOfThoughtStep`**: `status` pending, active (read in full) or done (muted), an `icon`, a `label`, an
19
+ optional monospace `query`, a result `count`, and a `sources` row (add `onSourcesClick` to make it a button
20
+ with a chevron). The rail stops at the last step by itself; screen readers get each step's status.
21
+ - **`SourceStack`**: overlapping site-icon chips from `sources` ({ `label`, `icon` }); three to five read best.
22
+ - **`WorkingIndicator`**: the working line on its own: a living sparkle (in the brand colour, a 1px line) and a shimmering "Working" with the
23
+ elapsed time, or a check and "Worked for 11.2s". The sparkle's three stars move on their own: the big one turns
24
+ a quarter each cycle and breathes while the two small ones twinkle in turn, filling in at their peak, in time with
25
+ the shimmer. Both stop under reduced motion. The Live story has a Dark mode switch.
26
+ - Presentational: you append steps as your agent produces them. Light and dark through the tokens.
27
+ - **Motion**, from the Figma *Chain of Thought · motion* table, reads as ink running down the rail. An appended
28
+ step opens its row while the previous rail flows down into it, turns the corner and the icon lands; the label
29
+ is written in left to right, the query types itself, the count ticks up to its value and the source chips fan
30
+ out. A spark keeps running into the active step and its icon beats as it lands. Results that land later open
31
+ their row instead of jumping in. Finishing sends one sweep down the rail, lighting each icon in turn, and the
32
+ check is drawn when it lands. Opening the panel lets the steps rise in turn. Only what arrives after the first
33
+ render animates, and reduced motion makes all of it instant.
34
+ - Agent contract: the four components are in the manifest with a streaming-run recipe and the aliases *chain of
35
+ thought*, *reasoning steps*, *agent steps*, *tool calls*, *sources*, *favicon stack* and more; the agent guide's
36
+ "moments an AI product needs" now points at `ChainOfThought`.
37
+
5
38
  ## 0.11.2
6
39
 
7
40
  - **Agent guide:** `AGENTS.md` gains a Map section (when to use `Map` or `MapGlobe`, latitude first, tile providers,