@sakaniui/react 0.11.1 → 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 +27 -3
- package/CHANGELOG.md +44 -0
- package/dist/{TopBar-O_56x94F.js → TopBar-DRGud3JP.js} +223 -223
- package/dist/{TopBar-7GwvQXGS.cjs → TopBar-Dd_xHXBv.cjs} +1 -1
- package/dist/blocks.cjs +2 -2
- package/dist/blocks.mjs +81 -81
- 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/emoji-index.json +1 -1
- package/dist/file-text-B2rmiOJD.cjs +1 -0
- package/dist/{file-text-DSD625_l.js → file-text-CuRYymVv.js} +34 -34
- package/dist/{help-circle-B0koiJUs.js → help-circle-BufsknPE.js} +9 -9
- package/dist/help-circle-C1LENUMu.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 +1 -0
- package/dist/index.mjs +1796 -1317
- package/dist/{logout-BW8ksDGk.js → logout-Mc5-u8cG.js} +10 -4
- package/dist/logout-g8G9uxDa.cjs +1 -0
- package/dist/manifest.json +399 -28
- package/dist/style.css +1 -1
- package/package.json +2 -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
|
@@ -245,6 +245,20 @@ lists its other names under `aliases` in `manifest.json`, and `search_components
|
|
|
245
245
|
row in a list. **Charts** — pick by question: trend over time → Line/Area; compare categories → Bar;
|
|
246
246
|
part of whole → Pie/Donut (few slices only); progress to a target → Radial; compare several measures →
|
|
247
247
|
Radar; drop-off → Funnel; intensity across two dimensions → Heatmap.
|
|
248
|
+
- **Map / MapMarker / MapPopup / MapClusterLayer** — an interactive tile map with no map library. Put `MapMarker`
|
|
249
|
+
(`pin`, `dot`, `cluster`) and `MapPopup` children inside `Map`, placed by `[latitude, longitude]` (latitude
|
|
250
|
+
first). Give every marker a `label`; a marker with `onClick` is a button and `selected` is yours to set. The
|
|
251
|
+
default tiles are OpenStreetMap's, fine for development and light use: for production traffic pass `tileUrl`
|
|
252
|
+
(and `attribution`) from a tile provider. For a live feed keep positions in state and give the markers `glide`
|
|
253
|
+
(about the interval between updates, in ms) so they slide instead of jumping. For more than a few dozen places
|
|
254
|
+
use `MapClusterLayer` (`points`, `renderPoint`) instead of mapping hundreds of `MapMarker`s. Dark mode follows
|
|
255
|
+
`.dark`; `theme="dark"` makes one map dark, `tileUrlDark` supplies a dark tile style. It only draws a map: no
|
|
256
|
+
routing, geocoding or search, and a map is hard to use without a pointer, so list the places beside it.
|
|
257
|
+
**MapGlobe** — a 3D dotted globe for places across the whole world (offices, customers, routes), not for
|
|
258
|
+
navigation: `variant` land or ocean, `markers`, `arcs`. It has no background of its own, so place it on the
|
|
259
|
+
colour you want (`theme="dark"` for a dark surface inside a light page); give markers a `label` and
|
|
260
|
+
`onMarkerClick` to make them selectable. Choose Map when people need streets and zoom, MapGlobe when the point
|
|
261
|
+
is global spread.
|
|
248
262
|
- **Avatar / AvatarGroup** — Avatar type is inferred: `src` → image, `initials` → initials, else icon.
|
|
249
263
|
Prefer a real image when you have one; initials are the fallback, not the default.
|
|
250
264
|
- **BoardCard / BoardColumn** — kanban pieces. `BoardColumn state="loading"` styles the column; *you* pass
|
|
@@ -259,9 +273,19 @@ Many Figma-frame blocks have a fixed design width — put them in a container at
|
|
|
259
273
|
|
|
260
274
|
## 6. Moments an AI product needs (compose these today)
|
|
261
275
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
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).
|
|
265
289
|
- **The model isn't sure.** State uncertainty in words next to the claim, not hidden in colour. Use an
|
|
266
290
|
`Alert` (`color="info"` or `"warning"`) or a `Badge` ("Low confidence"). Offer the next step: verify,
|
|
267
291
|
rephrase, or ask for more context.
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,50 @@
|
|
|
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
|
+
|
|
38
|
+
## 0.11.2
|
|
39
|
+
|
|
40
|
+
- **Agent guide:** `AGENTS.md` gains a Map section (when to use `Map` or `MapGlobe`, latitude first, tile providers,
|
|
41
|
+
`glide` for live feeds, `MapClusterLayer` for many places, dark mode, accessibility), served by the MCP
|
|
42
|
+
server's `get_guide`.
|
|
43
|
+
- **MCP server:** `@sakaniui/mcp` 0.11.2 carries the 0.11 reference, so Map and its parts are found even in a
|
|
44
|
+
project that has no `@sakaniui/react` installed (a project that has it was already answered from its own copy).
|
|
45
|
+
- **Fixed: `since` for `MapControlButton` and `MapControls`** was 0.11.1; they shipped in 0.11.0. The release
|
|
46
|
+
history can now name the commit a version was actually published from (`scripts/manifest/releases.json`).
|
|
47
|
+
- No component or API changes.
|
|
48
|
+
|
|
5
49
|
## 0.11.1
|
|
6
50
|
|
|
7
51
|
- **Fixed: `Map` markers on the server.** Rendered before the map is measured, markers and popups were placed
|