@sarunyu/system-one 4.9.12 → 4.9.18
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/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/src/components/toast.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/llms.txt +16 -14
- package/package.json +1 -1
package/llms.txt
CHANGED
|
@@ -149,7 +149,7 @@ import {
|
|
|
149
149
|
Table, TableRow, TableHeaderCell, TableCell,
|
|
150
150
|
// Feedback
|
|
151
151
|
Alert,
|
|
152
|
-
Toast,
|
|
152
|
+
Toast, Toaster,
|
|
153
153
|
Notification,
|
|
154
154
|
Badge,
|
|
155
155
|
// Overlay
|
|
@@ -757,30 +757,32 @@ Props: `status?` (default `"normal"`), `message` (required), `multiline?` (defau
|
|
|
757
757
|
|
|
758
758
|
---
|
|
759
759
|
|
|
760
|
-
### Toast /
|
|
760
|
+
### Toast / Toaster
|
|
761
761
|
|
|
762
|
-
Transient floating feedback
|
|
762
|
+
Transient floating feedback. **Always use `Toaster` for queued toasts — it handles fixed positioning (top-right desktop, top-center mobile) and auto-dismiss automatically.**
|
|
763
763
|
|
|
764
764
|
```tsx
|
|
765
765
|
type ToastVariant = "default" | "broadcast";
|
|
766
766
|
type ToastStatus = "information" | "success" | "warning" | "critical";
|
|
767
767
|
|
|
768
|
-
//
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
<
|
|
768
|
+
// ✅ Correct — place Toaster once at app root (App.tsx or layout)
|
|
769
|
+
const [toasts, setToasts] = useState<Array<ToastProps & { id: string }>>([]);
|
|
770
|
+
const remove = (id: string) => setToasts(t => t.filter(x => x.id !== id));
|
|
771
|
+
const add = (t: Omit<ToastProps, "onClose"> & { id: string }) =>
|
|
772
|
+
setToasts(p => [...p, t]);
|
|
772
773
|
|
|
773
|
-
|
|
774
|
-
<Toast variant="broadcast" status="information" message="Maintenance window: Saturday 02:00–04:00." />
|
|
774
|
+
<Toaster items={toasts} onRemove={remove} /> // fixed-positioned, auto-dismisses after 4s
|
|
775
775
|
|
|
776
|
-
//
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
776
|
+
// Trigger a toast from anywhere:
|
|
777
|
+
add({ id: crypto.randomUUID(), status: "success", message: "Saved." });
|
|
778
|
+
add({ id: crypto.randomUUID(), status: "warning", message: "Low storage.", actionLabel: "Free up", onActionClick: open });
|
|
779
|
+
|
|
780
|
+
// Broadcast — system-wide banner (no close button, no auto-dismiss)
|
|
781
|
+
<Toast variant="broadcast" status="information" message="Maintenance window: Saturday 02:00–04:00." />
|
|
780
782
|
```
|
|
781
783
|
|
|
784
|
+
Props (Toaster): `items`, `onRemove?`, `duration?` (ms, default 4000 — set 0 to disable auto-dismiss), `renderItem?`, `className`.
|
|
782
785
|
Props (Toast): `variant?` (default `"default"`), `status?` (default `"information"`), `message`, `multiline?`, `actionLabel?`, `onActionClick?`, `onClose?`, `className`.
|
|
783
|
-
Props (ToastStack): `items: (ToastProps & { id: string })[]`, `className`, `renderItem?`.
|
|
784
786
|
|
|
785
787
|
---
|
|
786
788
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarunyu/system-one",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A production-ready React design system built for AI-powered web generation tools (Figma Make, Lovable, V0). Tailwind CSS v4 + CSS custom properties for full theming support.",
|
|
6
6
|
"keywords": [
|