@sakaniui/mcp 0.8.13 → 0.9.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.
@@ -468,8 +468,10 @@ function checkCode(source) {
468
468
  if (imp.def) errors.push({ line: imp.line, message: `${entry} has no default export; use a named import: import { ${imp.def} } from '${entry}';` });
469
469
  for (const n of imp.names) {
470
470
  if (n.typeOnly) continue;
471
- const c = byName.get(n.imported.toLowerCase());
472
- const isUtility = manifest.utilities?.some((u) => u.name === n.imported);
471
+ const util = manifest.utilities?.find((u) => u.name === n.imported);
472
+ const isUtility = !!util;
473
+ // an exact helper name (toast) is not a mis-cased component (Toast)
474
+ const c = isUtility ? undefined : byName.get(n.imported.toLowerCase());
473
475
  if (entry === '@sakaniui/react/icons') {
474
476
  if (!iconNames.has(n.imported) && !iconOtherExports.has(n.imported)) {
475
477
  const hint = searchIcons(n.imported, 3).map((i) => i.name);
@@ -489,6 +491,7 @@ function checkCode(source) {
489
491
  errors.push({ line: imp.line, message: `${n.imported} is not exported by @sakaniui/react.${aliasHint(n.imported)}${near.length ? ` Did you mean: ${near.join(', ')}?` : ''} Use search_components.` });
490
492
  }
491
493
  if (c && inInstalled(c) === false) errors.push({ line: imp.line, message: `${c.name} was added in ${c.since}; the project has ${projectVersion}.` });
494
+ if (util && inInstalled(util) === false) errors.push({ line: imp.line, message: `${util.name} was added in ${util.since}; the project has ${projectVersion}.` });
492
495
  }
493
496
  }
494
497
 
package/data/AGENTS.md CHANGED
@@ -78,7 +78,7 @@ import { Button, Card } from '@sakaniui/react';
78
78
  (`aria-label`, or `label` on `socialLinks`). Status changes use live regions (`Alert`, `Toast`,
79
79
  `Spinner`, `EmptyState` are `role="status"`/`alert`). Never remove focus rings.
80
80
  7. **Don't fake what the system doesn't do.** `Toast` is presentational — you own queueing and
81
- positioning. `Menu` is a surface — you own anchoring (pair it with `Popover`). Dragging is a
81
+ positioning (for a ready-made stack, use `Toaster` and `toast()`). `Menu` is a surface — you own anchoring (pair it with `Popover`). Dragging is a
82
82
  look, not a behaviour. Check "Behaviour you must supply" in the table below before assuming.
83
83
  8. **Compose in slots, don't fork.** Components expose slots (`leading`, `trailing`, `meta`,
84
84
  `assignees`, `icon`, `actions`). Fill a slot with other system components rather than copying a
@@ -153,7 +153,7 @@ CSS of a component into your own file.
153
153
  Format: **Use for** · **Why it is built this way** · **Not for / instead**.
154
154
 
155
155
  **Looking for a component by another name?** SakaniUI uses its own names. A *dialog* or *alert dialog* is
156
- `Modal`; a *snackbar* is `Toast`; a *dropdown menu* is `Menu`; a *navbar* or *app bar* is `TopBar`; a
156
+ `Modal`; a *snackbar* is `Toast` (or `Toaster` + `toast()` for a managed stack); a *dropdown menu* is `Menu`; a *navbar* or *app bar* is `TopBar`; a
157
157
  *date picker* is `Calendar`; a *loader* is `Spinner`; a *toggle* is `Switch`; a *banner* is `Announcement`;
158
158
  *autocomplete* is `Combobox`. There is no `Dialog`, `AlertDialog`, `Snackbar` or `Navbar`. Each component
159
159
  lists its other names under `aliases` in `manifest.json`, and `search_components` understands them.
@@ -174,6 +174,11 @@ lists its other names under `aliases` in `manifest.json`, and `search_components
174
174
  - **Toast** — Use for short-lived confirmation or error after an action. *Why:* presentational only;
175
175
  queueing and positioning are the app's job, so it fits any notification system. *Not for* anything the user
176
176
  must act on — a toast disappears.
177
+ - **Toaster + toast()** — Use for notifications you trigger from code: mount one `<Toaster />`, call
178
+ `toast.success('Saved')` from anywhere. *Why:* it owns queueing, position (6), the 4s timer, the pile that
179
+ spreads on hover and swipe-to-dismiss, so the app does not. `toast.promise` turns one toast from loading
180
+ into success or error. *Not for* anything the user must act on — a toast disappears; a plain static card
181
+ → `Toast`. Needs `Toaster` mounted once, and `toast()` is a function, not a component.
177
182
  - **Badge** — Use for a short status, category or count. *Why:* 6 colours × subtle/solid, no sizes, no
178
183
  borders — it is a label, not a control. *Not for* clickable filters → `FilterChip`.
179
184
  - **Tooltip** — Use for brief supplementary text on hover/focus. *Why:* pure CSS, so it works with
@@ -261,7 +266,8 @@ and **tell the user when you are composing** rather than implying a dedicated co
261
266
 
262
267
  | Component | You own |
263
268
  |---|---|
264
- | Toast | queueing, positioning, auto-dismiss timing |
269
+ | Toast | queueing, positioning, auto-dismiss timing (or use `Toaster`) |
270
+ | Toaster | mounting it once; it handles the rest |
265
271
  | Menu | anchoring/positioning (pair with Popover) |
266
272
  | BoardCard `dragging` | drag-and-drop logic and drop targets |
267
273
  | BoardColumn `loading` | the skeleton cards inside it |
package/data/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  All notable changes to `@sakaniui/react` are documented here.
4
4
 
5
+ ## 0.9.0
6
+
7
+ - **New: `Toaster` and `toast()`**, a managed toast stack (Sonner-style) built from the new *↳ Sonner* page in Figma.
8
+ Mount one `<Toaster />`, then call `toast()`, `toast.success()`, `.info()`, `.warning()`, `.error()`,
9
+ `.loading()`, `.promise()` and `.dismiss()` from anywhere.
10
+ - New toasts rise in from the edge; older ones pile up behind the newest (lifted 14px, shrunk 5% per level,
11
+ content hidden, three visible). Hover or focus spreads the pile into a list and pauses the 4s timers;
12
+ leaving folds it back. Swipe a toast towards its edge to dismiss it (past 45px, or a quick flick, it flies
13
+ out in 200ms; otherwise it springs back in 400ms). Motion is 400ms `ease`.
14
+ - Options per toast: `description`, `icon`, `action`, `cancel`, `closeButton`, `duration`, `dismissible`,
15
+ `richColors`, `id` (update in place), `onDismiss`, `onAutoClose`. On `Toaster`: `position` (six),
16
+ `richColors`, `closeButton`, `expand`, `visibleToasts`, `duration`, `gap`, `offset`, `mobileOffset`,
17
+ `hotkey` (alt+T focuses the stack; Escape folds it).
18
+ - Light, dark and glass surfaces through the existing tokens; reduced motion keeps the fades only; errors
19
+ are announced assertively.
20
+ - The existing `Toast` is unchanged: it stays the static, presentational card.
21
+ - Agent contract: `Toaster` is in the manifest with recipes (show a toast, a promise toast) and the aliases
22
+ *sonner*, *toast stack*, *toast provider*. (`toaster` now means this component, not `Toast`.)
23
+
5
24
  ## 0.8.13
6
25
 
7
26
  A user reported the MCP server "didn't work". Reproduced: on a Node older than 16.9 the server connected