@zentauri-ui/zentauri-components 0.0.84 → 0.0.91

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.
Files changed (132) hide show
  1. package/README.md +47 -29
  2. package/dist/ui/accordion.cjs +311 -0
  3. package/dist/ui/accordion.cjs.map +1 -0
  4. package/dist/ui/accordion.d.cts +70 -0
  5. package/dist/ui/accordion.d.ts +70 -0
  6. package/dist/ui/accordion.js +286 -0
  7. package/dist/ui/accordion.js.map +1 -0
  8. package/dist/ui/alert.cjs +257 -0
  9. package/dist/ui/alert.cjs.map +1 -0
  10. package/dist/ui/alert.d.cts +66 -0
  11. package/dist/ui/alert.d.ts +66 -0
  12. package/dist/ui/alert.js +224 -0
  13. package/dist/ui/alert.js.map +1 -0
  14. package/dist/ui/badge.cjs +192 -0
  15. package/dist/ui/badge.cjs.map +1 -0
  16. package/dist/ui/badge.d.cts +37 -0
  17. package/dist/ui/badge.d.ts +37 -0
  18. package/dist/ui/badge.js +165 -0
  19. package/dist/ui/badge.js.map +1 -0
  20. package/dist/ui/buttons.cjs +202 -0
  21. package/dist/ui/buttons.cjs.map +1 -0
  22. package/dist/ui/buttons.d.cts +27 -0
  23. package/dist/ui/buttons.d.ts +27 -0
  24. package/dist/ui/buttons.js +176 -0
  25. package/dist/ui/buttons.js.map +1 -0
  26. package/dist/ui/card.cjs +293 -0
  27. package/dist/ui/card.cjs.map +1 -0
  28. package/dist/ui/card.d.cts +77 -0
  29. package/dist/ui/card.d.ts +77 -0
  30. package/dist/ui/card.js +258 -0
  31. package/dist/ui/card.js.map +1 -0
  32. package/dist/ui/divider.cjs +229 -0
  33. package/dist/ui/divider.cjs.map +1 -0
  34. package/dist/ui/divider.d.cts +39 -0
  35. package/dist/ui/divider.d.ts +39 -0
  36. package/dist/ui/divider.js +200 -0
  37. package/dist/ui/divider.js.map +1 -0
  38. package/dist/ui/drawer.cjs +408 -0
  39. package/dist/ui/drawer.cjs.map +1 -0
  40. package/dist/ui/drawer.d.cts +81 -0
  41. package/dist/ui/drawer.d.ts +81 -0
  42. package/dist/ui/drawer.js +383 -0
  43. package/dist/ui/drawer.js.map +1 -0
  44. package/dist/ui/dropdown.cjs +302 -0
  45. package/dist/ui/dropdown.cjs.map +1 -0
  46. package/dist/ui/dropdown.d.cts +50 -0
  47. package/dist/ui/dropdown.d.ts +50 -0
  48. package/dist/ui/dropdown.js +278 -0
  49. package/dist/ui/dropdown.js.map +1 -0
  50. package/dist/ui/empty-state.cjs +186 -0
  51. package/dist/ui/empty-state.cjs.map +1 -0
  52. package/dist/ui/empty-state.d.cts +55 -0
  53. package/dist/ui/empty-state.d.ts +55 -0
  54. package/dist/ui/empty-state.js +154 -0
  55. package/dist/ui/empty-state.js.map +1 -0
  56. package/dist/ui/index.d.cts +27 -1164
  57. package/dist/ui/index.d.ts +27 -1164
  58. package/dist/ui/inputs.cjs +458 -0
  59. package/dist/ui/inputs.cjs.map +1 -0
  60. package/dist/ui/inputs.d.cts +35 -0
  61. package/dist/ui/inputs.d.ts +35 -0
  62. package/dist/ui/inputs.js +432 -0
  63. package/dist/ui/inputs.js.map +1 -0
  64. package/dist/ui/modal.cjs +406 -0
  65. package/dist/ui/modal.cjs.map +1 -0
  66. package/dist/ui/modal.d.cts +84 -0
  67. package/dist/ui/modal.d.ts +84 -0
  68. package/dist/ui/modal.js +384 -0
  69. package/dist/ui/modal.js.map +1 -0
  70. package/dist/ui/pagination.cjs +523 -0
  71. package/dist/ui/pagination.cjs.map +1 -0
  72. package/dist/ui/pagination.d.cts +114 -0
  73. package/dist/ui/pagination.d.ts +114 -0
  74. package/dist/ui/pagination.js +494 -0
  75. package/dist/ui/pagination.js.map +1 -0
  76. package/dist/ui/progress.cjs +268 -0
  77. package/dist/ui/progress.cjs.map +1 -0
  78. package/dist/ui/progress.d.cts +61 -0
  79. package/dist/ui/progress.d.ts +61 -0
  80. package/dist/ui/progress.js +237 -0
  81. package/dist/ui/progress.js.map +1 -0
  82. package/dist/ui/select.cjs +360 -0
  83. package/dist/ui/select.cjs.map +1 -0
  84. package/dist/ui/select.d.cts +73 -0
  85. package/dist/ui/select.d.ts +73 -0
  86. package/dist/ui/select.js +327 -0
  87. package/dist/ui/select.js.map +1 -0
  88. package/dist/ui/skeleton.cjs +576 -0
  89. package/dist/ui/skeleton.cjs.map +1 -0
  90. package/dist/ui/skeleton.d.cts +90 -0
  91. package/dist/ui/skeleton.d.ts +90 -0
  92. package/dist/ui/skeleton.js +544 -0
  93. package/dist/ui/skeleton.js.map +1 -0
  94. package/dist/ui/spinner.cjs +219 -0
  95. package/dist/ui/spinner.cjs.map +1 -0
  96. package/dist/ui/spinner.d.cts +27 -0
  97. package/dist/ui/spinner.d.ts +27 -0
  98. package/dist/ui/spinner.js +193 -0
  99. package/dist/ui/spinner.js.map +1 -0
  100. package/dist/ui/table.cjs +328 -0
  101. package/dist/ui/table.cjs.map +1 -0
  102. package/dist/ui/table.d.cts +81 -0
  103. package/dist/ui/table.d.ts +81 -0
  104. package/dist/ui/table.js +293 -0
  105. package/dist/ui/table.js.map +1 -0
  106. package/dist/ui/tabs.cjs +300 -0
  107. package/dist/ui/tabs.cjs.map +1 -0
  108. package/dist/ui/tabs.d.cts +58 -0
  109. package/dist/ui/tabs.d.ts +58 -0
  110. package/dist/ui/tabs.js +274 -0
  111. package/dist/ui/tabs.js.map +1 -0
  112. package/dist/ui/toast.cjs +285 -0
  113. package/dist/ui/toast.cjs.map +1 -0
  114. package/dist/ui/toast.d.cts +86 -0
  115. package/dist/ui/toast.d.ts +86 -0
  116. package/dist/ui/toast.js +258 -0
  117. package/dist/ui/toast.js.map +1 -0
  118. package/dist/ui/toggle.cjs +185 -0
  119. package/dist/ui/toggle.cjs.map +1 -0
  120. package/dist/ui/toggle.d.cts +37 -0
  121. package/dist/ui/toggle.d.ts +37 -0
  122. package/dist/ui/toggle.js +158 -0
  123. package/dist/ui/toggle.js.map +1 -0
  124. package/dist/ui/tooltip.cjs +242 -0
  125. package/dist/ui/tooltip.cjs.map +1 -0
  126. package/dist/ui/tooltip.d.cts +46 -0
  127. package/dist/ui/tooltip.d.ts +46 -0
  128. package/dist/ui/tooltip.js +214 -0
  129. package/dist/ui/tooltip.js.map +1 -0
  130. package/dist/variants-1Bx3BEeS.d.cts +8 -0
  131. package/dist/variants-1Bx3BEeS.d.ts +8 -0
  132. package/package.json +7 -1
@@ -0,0 +1,285 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/ui/toast/index.ts
21
+ var toast_exports = {};
22
+ __export(toast_exports, {
23
+ Toast: () => Toast,
24
+ ToastAction: () => ToastAction,
25
+ ToastClose: () => ToastClose,
26
+ ToastDescription: () => ToastDescription,
27
+ ToastProvider: () => ToastProvider,
28
+ ToastTitle: () => ToastTitle,
29
+ ToastViewport: () => ToastViewport,
30
+ toast: () => toast,
31
+ toastAnimationPresets: () => toastAnimationPresets,
32
+ toastRootVariants: () => toastRootVariants,
33
+ toastViewportVariants: () => toastViewportVariants,
34
+ useToast: () => useToast
35
+ });
36
+ module.exports = __toCommonJS(toast_exports);
37
+
38
+ // src/ui/toast/toast.tsx
39
+ var import_framer_motion = require("framer-motion");
40
+ var import_react = require("react");
41
+ var import_react_dom = require("react-dom");
42
+
43
+ // src/lib/utils.ts
44
+ var import_clsx = require("clsx");
45
+ var import_tailwind_merge = require("tailwind-merge");
46
+ function cn(...inputs) {
47
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
48
+ }
49
+
50
+ // src/ui/toast/animations.ts
51
+ var toastAnimationPresets = {
52
+ none: {},
53
+ slide: {
54
+ initial: { opacity: 0, x: 24 },
55
+ animate: { opacity: 1, x: 0 },
56
+ exit: { opacity: 0, x: 16 },
57
+ transition: { type: "spring", stiffness: 380, damping: 28 }
58
+ },
59
+ fade: {
60
+ initial: { opacity: 0 },
61
+ animate: { opacity: 1 },
62
+ exit: { opacity: 0 },
63
+ transition: { duration: 0.18 }
64
+ }
65
+ };
66
+
67
+ // src/ui/toast/variants.ts
68
+ var import_class_variance_authority = require("class-variance-authority");
69
+ var toastViewportVariants = (0, import_class_variance_authority.cva)("fixed z-[60] flex max-h-screen flex-col gap-2 p-4", {
70
+ variants: {
71
+ position: {
72
+ "top-left": "left-0 top-0 items-start",
73
+ "top-center": "left-1/2 top-0 -translate-x-1/2 items-center",
74
+ "top-right": "right-0 top-0 items-end",
75
+ "bottom-left": "bottom-0 left-0 items-start",
76
+ "bottom-center": "bottom-0 left-1/2 -translate-x-1/2 items-center",
77
+ "bottom-right": "bottom-0 right-0 items-end"
78
+ }
79
+ },
80
+ defaultVariants: {
81
+ position: "bottom-right"
82
+ }
83
+ });
84
+ var toastRootVariants = (0, import_class_variance_authority.cva)(
85
+ "pointer-events-auto w-[min(100vw-2rem,380px)] rounded-xl border border-white/10 bg-slate-950 p-4 text-slate-50 shadow-[0_18px_48px_rgba(15,23,42,0.45)]",
86
+ {
87
+ variants: {
88
+ appearance: {
89
+ default: "bg-slate-950",
90
+ success: "border-emerald-500/40 bg-emerald-950",
91
+ warning: "border-amber-500/40 bg-amber-950",
92
+ error: "border-rose-500/50 bg-rose-950",
93
+ info: "border-sky-500/40 bg-sky-950",
94
+ ghost: "border-transparent bg-transparent text-slate-200",
95
+ purple: "border-purple-600 bg-purple-950/70 backdrop-blur-xl",
96
+ pink: "border-pink-600 bg-pink-950/70 backdrop-blur-xl",
97
+ orange: "border-orange-600 bg-orange-950/70 backdrop-blur-xl",
98
+ yellow: "border-yellow-600 bg-yellow-950/70 backdrop-blur-xl",
99
+ teal: "border-teal-600 bg-teal-950/70 backdrop-blur-xl",
100
+ indigo: "border-indigo-600 bg-indigo-950/70 backdrop-blur-xl",
101
+ emerald: "border-emerald-600 bg-emerald-950/70 backdrop-blur-xl",
102
+ gray: "border-gray-600 bg-gray-950/70 backdrop-blur-xl",
103
+ amber: "border-amber-600 bg-amber-950/70 backdrop-blur-xl",
104
+ violet: "border-violet-600 bg-violet-950/70 backdrop-blur-xl",
105
+ "gradient-blue": "border-gradient-to-r from-blue-600 to-purple-600 bg-gradient-to-r from-blue-950/70 to-purple-950/70 backdrop-blur-xl",
106
+ "gradient-green": "border-gradient-to-r from-green-600 to-lime-600 bg-gradient-to-r from-green-950/70 to-lime-950/70 backdrop-blur-xl",
107
+ "gradient-red": "border-gradient-to-r from-red-600 to-pink-600 bg-gradient-to-r from-red-950/70 to-pink-950/70 backdrop-blur-xl",
108
+ "gradient-yellow": "border-gradient-to-r from-yellow-600 to-orange-600 bg-gradient-to-r from-yellow-950/70 to-orange-950/70 backdrop-blur-xl",
109
+ "gradient-purple": "border-gradient-to-r from-purple-600 to-pink-600 bg-gradient-to-r from-purple-950/70 to-pink-950/70 backdrop-blur-xl",
110
+ "gradient-teal": "border-gradient-to-r from-teal-600 to-cyan-600 bg-gradient-to-r from-teal-950/70 to-cyan-950/70 backdrop-blur-xl",
111
+ "gradient-indigo": "border-gradient-to-r from-indigo-600 to-purple-600 bg-gradient-to-r from-indigo-950/70 to-purple-950/70 backdrop-blur-xl",
112
+ "gradient-pink": "border-gradient-to-r from-pink-600 to-rose-600 bg-gradient-to-r from-pink-950/70 to-rose-950/70 backdrop-blur-xl",
113
+ "gradient-orange": "border-gradient-to-r from-orange-600 to-red-600 bg-gradient-to-r from-orange-950/70 to-red-950/70 backdrop-blur-xl"
114
+ },
115
+ size: {
116
+ sm: "p-3 text-xs",
117
+ md: "p-4 text-sm",
118
+ lg: "p-5 text-base"
119
+ }
120
+ },
121
+ defaultVariants: {
122
+ appearance: "default",
123
+ size: "md"
124
+ }
125
+ }
126
+ );
127
+
128
+ // src/ui/toast/toast.tsx
129
+ var import_jsx_runtime = require("react/jsx-runtime");
130
+ var ToastStoreContext = (0, import_react.createContext)(null);
131
+ var toastDispatcher = null;
132
+ function toast(input) {
133
+ if (!toastDispatcher) {
134
+ return "";
135
+ }
136
+ return toastDispatcher(input);
137
+ }
138
+ function useToast() {
139
+ const ctx = (0, import_react.useContext)(ToastStoreContext);
140
+ if (!ctx) {
141
+ throw new Error("useToast must be used within <ToastProvider>");
142
+ }
143
+ return { toast: ctx.push, dismiss: ctx.dismiss };
144
+ }
145
+ function ToastProvider({ children }) {
146
+ const [toasts, setToasts] = (0, import_react.useState)([]);
147
+ const timers = (0, import_react.useRef)(/* @__PURE__ */ new Map());
148
+ const dismiss = (0, import_react.useCallback)((id) => {
149
+ const timerId = timers.current.get(id);
150
+ if (timerId) {
151
+ window.clearTimeout(timerId);
152
+ timers.current.delete(id);
153
+ }
154
+ setToasts((prev) => prev.filter((toastItem) => toastItem.id !== id));
155
+ }, []);
156
+ const push = (0, import_react.useCallback)(
157
+ (input) => {
158
+ const id = input.id ?? `toast-${Math.random().toString(16).slice(2)}`;
159
+ const durationMs = input.durationMs ?? 4500;
160
+ const record = {
161
+ ...input,
162
+ id,
163
+ durationMs,
164
+ animation: input.animation ?? "slide"
165
+ };
166
+ setToasts((prev) => [...prev, record]);
167
+ const timerId = window.setTimeout(() => dismiss(id), durationMs);
168
+ timers.current.set(id, timerId);
169
+ return id;
170
+ },
171
+ [dismiss]
172
+ );
173
+ const ctx = (0, import_react.useMemo)(
174
+ () => ({
175
+ toasts,
176
+ push,
177
+ dismiss
178
+ }),
179
+ [dismiss, push, toasts]
180
+ );
181
+ (0, import_react.useEffect)(() => {
182
+ toastDispatcher = push;
183
+ return () => {
184
+ toastDispatcher = null;
185
+ };
186
+ }, [push]);
187
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToastStoreContext.Provider, { value: ctx, children });
188
+ }
189
+ ToastProvider.displayName = "ToastProvider";
190
+ function ToastViewport({ position = "bottom-right", className }) {
191
+ const ctx = (0, import_react.useContext)(ToastStoreContext);
192
+ if (!ctx) {
193
+ throw new Error("ToastViewport must be used within <ToastProvider>");
194
+ }
195
+ const portalTarget = typeof document !== "undefined" ? document.body : null;
196
+ if (!portalTarget) {
197
+ return null;
198
+ }
199
+ return (0, import_react_dom.createPortal)(
200
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn(toastViewportVariants({ position }), className), "data-slot": "toast-viewport", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.AnimatePresence, { children: ctx.toasts.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
201
+ Toast,
202
+ {
203
+ toastId: item.id,
204
+ appearance: item.appearance,
205
+ size: item.size,
206
+ animation: item.animation,
207
+ children: [
208
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToastTitle, { children: item.title }),
209
+ item.description ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToastDescription, { children: item.description }) : null,
210
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToastClose, { onClick: () => ctx.dismiss(item.id) })
211
+ ]
212
+ },
213
+ item.id
214
+ )) }) }),
215
+ portalTarget
216
+ );
217
+ }
218
+ ToastViewport.displayName = "ToastViewport";
219
+ function Toast({ toastId: _toastId, appearance, size, animation = "slide", className, children }) {
220
+ const motionProps = toastAnimationPresets[animation];
221
+ const live = appearance === "error" ? "assertive" : "polite";
222
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
223
+ import_framer_motion.motion.div,
224
+ {
225
+ layout: true,
226
+ "data-slot": "toast",
227
+ role: appearance === "error" ? "alert" : "status",
228
+ "aria-live": live,
229
+ "aria-atomic": "true",
230
+ className: cn("relative", toastRootVariants({ appearance, size }), className),
231
+ initial: animation === "none" ? false : motionProps.initial,
232
+ animate: animation === "none" ? void 0 : motionProps.animate,
233
+ exit: animation === "none" ? void 0 : motionProps.exit,
234
+ transition: motionProps.transition,
235
+ children
236
+ }
237
+ );
238
+ }
239
+ Toast.displayName = "Toast";
240
+ function ToastTitle({ className, children }) {
241
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "data-slot": "toast-title", className: cn("font-semibold", className), children });
242
+ }
243
+ ToastTitle.displayName = "ToastTitle";
244
+ function ToastDescription({ className, children }) {
245
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "data-slot": "toast-description", className: cn("text-sm text-slate-300", className), children });
246
+ }
247
+ ToastDescription.displayName = "ToastDescription";
248
+ function ToastAction({ className, children }) {
249
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "data-slot": "toast-action", className: cn("mt-3", className), children });
250
+ }
251
+ ToastAction.displayName = "ToastAction";
252
+ function ToastClose({ className, children, onClick, ...rest }) {
253
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
254
+ "button",
255
+ {
256
+ type: "button",
257
+ "data-slot": "toast-close",
258
+ "aria-label": "Dismiss notification",
259
+ className: cn(
260
+ "absolute right-3 top-3 inline-flex size-8 items-center justify-center rounded-md text-slate-200 transition hover:bg-white/10",
261
+ className
262
+ ),
263
+ onClick,
264
+ ...rest,
265
+ children: children ?? "\xD7"
266
+ }
267
+ );
268
+ }
269
+ ToastClose.displayName = "ToastClose";
270
+ // Annotate the CommonJS export names for ESM import in node:
271
+ 0 && (module.exports = {
272
+ Toast,
273
+ ToastAction,
274
+ ToastClose,
275
+ ToastDescription,
276
+ ToastProvider,
277
+ ToastTitle,
278
+ ToastViewport,
279
+ toast,
280
+ toastAnimationPresets,
281
+ toastRootVariants,
282
+ toastViewportVariants,
283
+ useToast
284
+ });
285
+ //# sourceMappingURL=toast.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/ui/toast/index.ts","../../src/ui/toast/toast.tsx","../../src/lib/utils.ts","../../src/ui/toast/animations.ts","../../src/ui/toast/variants.ts"],"sourcesContent":["export {\n Toast,\n ToastAction,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n toast,\n useToast,\n} from \"./toast\";\nexport type {\n ToastAnimation,\n ToastContextValue,\n ToastInput,\n ToastPosition,\n ToastProps,\n ToastProviderProps,\n ToastSectionProps,\n ToastViewportProps,\n} from \"./types\";\nexport { toastAnimationPresets } from \"./animations\";\nexport { toastRootVariants, toastViewportVariants } from \"./variants\";\n","\"use client\";\n\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { cn } from \"../../lib/utils\";\n\nimport { toastAnimationPresets } from \"./animations\";\nimport type {\n ToastContextValue,\n ToastInput,\n ToastProps,\n ToastProviderProps,\n ToastSectionProps,\n ToastViewportProps,\n} from \"./types\";\nimport { toastRootVariants, toastViewportVariants } from \"./variants\";\n\ntype InternalToast = Required<Pick<ToastInput, \"id\">> &\n Omit<ToastInput, \"id\"> & {\n durationMs: number;\n animation: NonNullable<ToastInput[\"animation\"]>;\n };\n\ntype ToastStoreContextValue = {\n toasts: InternalToast[];\n push: (input: ToastInput) => string;\n dismiss: (id: string) => void;\n};\n\nconst ToastStoreContext = createContext<ToastStoreContextValue | null>(null);\n\nlet toastDispatcher: ToastStoreContextValue[\"push\"] | null = null;\n\nexport function toast(input: ToastInput) {\n if (!toastDispatcher) {\n return \"\";\n }\n return toastDispatcher(input);\n}\n\nexport function useToast(): ToastContextValue {\n const ctx = useContext(ToastStoreContext);\n if (!ctx) {\n throw new Error(\"useToast must be used within <ToastProvider>\");\n }\n return { toast: ctx.push, dismiss: ctx.dismiss };\n}\n\nexport function ToastProvider({ children }: ToastProviderProps) {\n const [toasts, setToasts] = useState<InternalToast[]>([]);\n const timers = useRef<Map<string, number>>(new Map());\n\n const dismiss = useCallback((id: string) => {\n const timerId = timers.current.get(id);\n if (timerId) {\n window.clearTimeout(timerId);\n timers.current.delete(id);\n }\n setToasts((prev) => prev.filter((toastItem) => toastItem.id !== id));\n }, []);\n\n const push = useCallback(\n (input: ToastInput) => {\n const id = input.id ?? `toast-${Math.random().toString(16).slice(2)}`;\n const durationMs = input.durationMs ?? 4500;\n const record: InternalToast = {\n ...input,\n id,\n durationMs,\n animation: input.animation ?? \"slide\",\n };\n setToasts((prev) => [...prev, record]);\n const timerId = window.setTimeout(() => dismiss(id), durationMs);\n timers.current.set(id, timerId);\n return id;\n },\n [dismiss],\n );\n\n const ctx = useMemo(\n () => ({\n toasts,\n push,\n dismiss,\n }),\n [dismiss, push, toasts],\n );\n\n useEffect(() => {\n toastDispatcher = push;\n return () => {\n toastDispatcher = null;\n };\n }, [push]);\n\n return <ToastStoreContext.Provider value={ctx}>{children}</ToastStoreContext.Provider>;\n}\n\nToastProvider.displayName = \"ToastProvider\";\n\nexport function ToastViewport({ position = \"bottom-right\", className }: ToastViewportProps) {\n const ctx = useContext(ToastStoreContext);\n if (!ctx) {\n throw new Error(\"ToastViewport must be used within <ToastProvider>\");\n }\n\n const portalTarget = typeof document !== \"undefined\" ? document.body : null;\n if (!portalTarget) {\n return null;\n }\n\n return createPortal(\n <div className={cn(toastViewportVariants({ position }), className)} data-slot=\"toast-viewport\">\n <AnimatePresence>\n {ctx.toasts.map((item) => (\n <Toast\n key={item.id}\n toastId={item.id}\n appearance={item.appearance}\n size={item.size}\n animation={item.animation}\n >\n <ToastTitle>{item.title}</ToastTitle>\n {item.description ? <ToastDescription>{item.description}</ToastDescription> : null}\n <ToastClose onClick={() => ctx.dismiss(item.id)} />\n </Toast>\n ))}\n </AnimatePresence>\n </div>,\n portalTarget,\n );\n}\n\nToastViewport.displayName = \"ToastViewport\";\n\nexport function Toast({ toastId: _toastId, appearance, size, animation = \"slide\", className, children }: ToastProps) {\n const motionProps = toastAnimationPresets[animation];\n const live = appearance === \"error\" ? \"assertive\" : \"polite\";\n\n return (\n <motion.div\n layout\n data-slot=\"toast\"\n role={appearance === \"error\" ? \"alert\" : \"status\"}\n aria-live={live}\n aria-atomic=\"true\"\n className={cn(\"relative\", toastRootVariants({ appearance, size }), className)}\n initial={animation === \"none\" ? false : motionProps.initial}\n animate={animation === \"none\" ? undefined : motionProps.animate}\n exit={animation === \"none\" ? undefined : motionProps.exit}\n transition={motionProps.transition}\n >\n {children}\n </motion.div>\n );\n}\n\nToast.displayName = \"Toast\";\n\nexport function ToastTitle({ className, children }: ToastSectionProps) {\n return <div data-slot=\"toast-title\" className={cn(\"font-semibold\", className)}>{children}</div>;\n}\n\nToastTitle.displayName = \"ToastTitle\";\n\nexport function ToastDescription({ className, children }: ToastSectionProps) {\n return (\n <div data-slot=\"toast-description\" className={cn(\"text-sm text-slate-300\", className)}>\n {children}\n </div>\n );\n}\n\nToastDescription.displayName = \"ToastDescription\";\n\nexport function ToastAction({ className, children }: ToastSectionProps) {\n return <div data-slot=\"toast-action\" className={cn(\"mt-3\", className)}>{children}</div>;\n}\n\nToastAction.displayName = \"ToastAction\";\n\nexport function ToastClose({ className, children, onClick, ...rest }: ToastSectionProps & { onClick?: () => void }) {\n return (\n <button\n type=\"button\"\n data-slot=\"toast-close\"\n aria-label=\"Dismiss notification\"\n className={cn(\n \"absolute right-3 top-3 inline-flex size-8 items-center justify-center rounded-md text-slate-200 transition hover:bg-white/10\",\n className,\n )}\n onClick={onClick}\n {...rest}\n >\n {children ?? \"×\"}\n </button>\n );\n}\n\nToastClose.displayName = \"ToastClose\";\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}","import type { HTMLMotionProps } from \"framer-motion\";\n\nexport type ToastAnimation = \"none\" | \"slide\" | \"fade\";\n\ntype ToastPresetMotionProps = Pick<\n HTMLMotionProps<\"div\">,\n \"initial\" | \"animate\" | \"exit\" | \"transition\"\n>;\n\nexport type ToastAnimationPresets = Record<ToastAnimation, ToastPresetMotionProps>;\n\nexport const toastAnimationPresets: ToastAnimationPresets = {\n none: {},\n slide: {\n initial: { opacity: 0, x: 24 },\n animate: { opacity: 1, x: 0 },\n exit: { opacity: 0, x: 16 },\n transition: { type: \"spring\", stiffness: 380, damping: 28 },\n },\n fade: {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n transition: { duration: 0.18 },\n },\n};\n","import { cva } from \"class-variance-authority\";\n\nexport const toastViewportVariants = cva(\"fixed z-[60] flex max-h-screen flex-col gap-2 p-4\", {\n variants: {\n position: {\n \"top-left\": \"left-0 top-0 items-start\",\n \"top-center\": \"left-1/2 top-0 -translate-x-1/2 items-center\",\n \"top-right\": \"right-0 top-0 items-end\",\n \"bottom-left\": \"bottom-0 left-0 items-start\",\n \"bottom-center\": \"bottom-0 left-1/2 -translate-x-1/2 items-center\",\n \"bottom-right\": \"bottom-0 right-0 items-end\",\n },\n },\n defaultVariants: {\n position: \"bottom-right\",\n },\n});\n\nexport const toastRootVariants = cva(\n \"pointer-events-auto w-[min(100vw-2rem,380px)] rounded-xl border border-white/10 bg-slate-950 p-4 text-slate-50 shadow-[0_18px_48px_rgba(15,23,42,0.45)]\",\n {\n variants: {\n appearance: {\n default: \"bg-slate-950\",\n success: \"border-emerald-500/40 bg-emerald-950\",\n warning: \"border-amber-500/40 bg-amber-950\",\n error: \"border-rose-500/50 bg-rose-950\",\n info: \"border-sky-500/40 bg-sky-950\",\n ghost: \"border-transparent bg-transparent text-slate-200\",\n purple: \"border-purple-600 bg-purple-950/70 backdrop-blur-xl\",\n pink: \"border-pink-600 bg-pink-950/70 backdrop-blur-xl\",\n orange: \"border-orange-600 bg-orange-950/70 backdrop-blur-xl\",\n yellow: \"border-yellow-600 bg-yellow-950/70 backdrop-blur-xl\",\n teal: \"border-teal-600 bg-teal-950/70 backdrop-blur-xl\",\n indigo: \"border-indigo-600 bg-indigo-950/70 backdrop-blur-xl\",\n emerald: \"border-emerald-600 bg-emerald-950/70 backdrop-blur-xl\",\n gray: \"border-gray-600 bg-gray-950/70 backdrop-blur-xl\",\n amber: \"border-amber-600 bg-amber-950/70 backdrop-blur-xl\",\n violet: \"border-violet-600 bg-violet-950/70 backdrop-blur-xl\",\n \"gradient-blue\": \"border-gradient-to-r from-blue-600 to-purple-600 bg-gradient-to-r from-blue-950/70 to-purple-950/70 backdrop-blur-xl\",\n \"gradient-green\": \"border-gradient-to-r from-green-600 to-lime-600 bg-gradient-to-r from-green-950/70 to-lime-950/70 backdrop-blur-xl\",\n \"gradient-red\": \"border-gradient-to-r from-red-600 to-pink-600 bg-gradient-to-r from-red-950/70 to-pink-950/70 backdrop-blur-xl\",\n \"gradient-yellow\": \"border-gradient-to-r from-yellow-600 to-orange-600 bg-gradient-to-r from-yellow-950/70 to-orange-950/70 backdrop-blur-xl\",\n \"gradient-purple\": \"border-gradient-to-r from-purple-600 to-pink-600 bg-gradient-to-r from-purple-950/70 to-pink-950/70 backdrop-blur-xl\",\n \"gradient-teal\": \"border-gradient-to-r from-teal-600 to-cyan-600 bg-gradient-to-r from-teal-950/70 to-cyan-950/70 backdrop-blur-xl\",\n \"gradient-indigo\": \"border-gradient-to-r from-indigo-600 to-purple-600 bg-gradient-to-r from-indigo-950/70 to-purple-950/70 backdrop-blur-xl\",\n \"gradient-pink\": \"border-gradient-to-r from-pink-600 to-rose-600 bg-gradient-to-r from-pink-950/70 to-rose-950/70 backdrop-blur-xl\",\n \"gradient-orange\": \"border-gradient-to-r from-orange-600 to-red-600 bg-gradient-to-r from-orange-950/70 to-red-950/70 backdrop-blur-xl\",\n },\n size: {\n sm: \"p-3 text-xs\",\n md: \"p-4 text-sm\",\n lg: \"p-5 text-base\",\n },\n },\n defaultVariants: {\n appearance: \"default\",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AAW,GAAG,0BAA0B,SAAS,GACjF,UACH;AAEJ;AAEA,iBAAiB,cAAc;AAExB,SAAS,YAAY,EAAE,WAAW,SAAS,GAAsB;AACtE,SAAO,4CAAC,SAAI,aAAU,gBAAe,WAAW,GAAG,QAAQ,SAAS,GAAI,UAAS;AACnF;AAEA,YAAY,cAAc;AAEnB,SAAS,WAAW,EAAE,WAAW,UAAU,SAAS,GAAG,KAAK,GAAiD;AAClH,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,aAAU;AAAA,MACV,cAAW;AAAA,MACX,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEH,sBAAY;AAAA;AAAA,EACf;AAEJ;AAEA,WAAW,cAAc;","names":[]}
@@ -0,0 +1,86 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+ import { VariantProps } from 'class-variance-authority';
5
+ import { HTMLMotionProps } from 'framer-motion';
6
+ import * as class_variance_authority_types from 'class-variance-authority/types';
7
+
8
+ type ToastAnimation = "none" | "slide" | "fade";
9
+ type ToastPresetMotionProps = Pick<HTMLMotionProps<"div">, "initial" | "animate" | "exit" | "transition">;
10
+ type ToastAnimationPresets = Record<ToastAnimation, ToastPresetMotionProps>;
11
+ declare const toastAnimationPresets: ToastAnimationPresets;
12
+
13
+ declare const toastViewportVariants: (props?: ({
14
+ position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | null | undefined;
15
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
16
+ declare const toastRootVariants: (props?: ({
17
+ appearance?: "default" | "ghost" | "purple" | "pink" | "orange" | "yellow" | "teal" | "indigo" | "emerald" | "gradient-blue" | "gradient-green" | "gradient-red" | "gradient-yellow" | "gradient-purple" | "gradient-teal" | "gradient-indigo" | "gradient-pink" | "gradient-orange" | "success" | "warning" | "error" | "info" | "gray" | "violet" | "amber" | null | undefined;
18
+ size?: "sm" | "md" | "lg" | null | undefined;
19
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
20
+
21
+ type ToastViewportVariantProps = VariantProps<typeof toastViewportVariants>;
22
+ type ToastRootVariantProps = VariantProps<typeof toastRootVariants>;
23
+ type ToastPosition = NonNullable<ToastViewportVariantProps["position"]>;
24
+ type ToastInput = ToastRootVariantProps & {
25
+ id?: string;
26
+ title?: ReactNode;
27
+ description?: ReactNode;
28
+ durationMs?: number;
29
+ animation?: ToastAnimation;
30
+ };
31
+ type ToastContextValue = {
32
+ toast: (input: ToastInput) => string;
33
+ dismiss: (id: string) => void;
34
+ };
35
+ type ToastProviderProps = {
36
+ children?: ReactNode;
37
+ };
38
+ type ToastViewportProps = ToastViewportVariantProps & {
39
+ className?: string;
40
+ };
41
+ type ToastProps = ToastRootVariantProps & {
42
+ toastId: string;
43
+ animation?: ToastAnimation;
44
+ className?: string;
45
+ children?: ReactNode;
46
+ };
47
+ type ToastSectionProps = {
48
+ className?: string;
49
+ children?: ReactNode;
50
+ onClick?: () => void;
51
+ };
52
+
53
+ declare function toast(input: ToastInput): string;
54
+ declare function useToast(): ToastContextValue;
55
+ declare function ToastProvider({ children }: ToastProviderProps): react_jsx_runtime.JSX.Element;
56
+ declare namespace ToastProvider {
57
+ var displayName: string;
58
+ }
59
+ declare function ToastViewport({ position, className }: ToastViewportProps): react.ReactPortal | null;
60
+ declare namespace ToastViewport {
61
+ var displayName: string;
62
+ }
63
+ declare function Toast({ toastId: _toastId, appearance, size, animation, className, children }: ToastProps): react_jsx_runtime.JSX.Element;
64
+ declare namespace Toast {
65
+ var displayName: string;
66
+ }
67
+ declare function ToastTitle({ className, children }: ToastSectionProps): react_jsx_runtime.JSX.Element;
68
+ declare namespace ToastTitle {
69
+ var displayName: string;
70
+ }
71
+ declare function ToastDescription({ className, children }: ToastSectionProps): react_jsx_runtime.JSX.Element;
72
+ declare namespace ToastDescription {
73
+ var displayName: string;
74
+ }
75
+ declare function ToastAction({ className, children }: ToastSectionProps): react_jsx_runtime.JSX.Element;
76
+ declare namespace ToastAction {
77
+ var displayName: string;
78
+ }
79
+ declare function ToastClose({ className, children, onClick, ...rest }: ToastSectionProps & {
80
+ onClick?: () => void;
81
+ }): react_jsx_runtime.JSX.Element;
82
+ declare namespace ToastClose {
83
+ var displayName: string;
84
+ }
85
+
86
+ export { Toast, ToastAction, type ToastAnimation, ToastClose, type ToastContextValue, ToastDescription, type ToastInput, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, type ToastSectionProps, ToastTitle, ToastViewport, type ToastViewportProps, toast, toastAnimationPresets, toastRootVariants, toastViewportVariants, useToast };
@@ -0,0 +1,86 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+ import { VariantProps } from 'class-variance-authority';
5
+ import { HTMLMotionProps } from 'framer-motion';
6
+ import * as class_variance_authority_types from 'class-variance-authority/types';
7
+
8
+ type ToastAnimation = "none" | "slide" | "fade";
9
+ type ToastPresetMotionProps = Pick<HTMLMotionProps<"div">, "initial" | "animate" | "exit" | "transition">;
10
+ type ToastAnimationPresets = Record<ToastAnimation, ToastPresetMotionProps>;
11
+ declare const toastAnimationPresets: ToastAnimationPresets;
12
+
13
+ declare const toastViewportVariants: (props?: ({
14
+ position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | null | undefined;
15
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
16
+ declare const toastRootVariants: (props?: ({
17
+ appearance?: "default" | "ghost" | "purple" | "pink" | "orange" | "yellow" | "teal" | "indigo" | "emerald" | "gradient-blue" | "gradient-green" | "gradient-red" | "gradient-yellow" | "gradient-purple" | "gradient-teal" | "gradient-indigo" | "gradient-pink" | "gradient-orange" | "success" | "warning" | "error" | "info" | "gray" | "violet" | "amber" | null | undefined;
18
+ size?: "sm" | "md" | "lg" | null | undefined;
19
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
20
+
21
+ type ToastViewportVariantProps = VariantProps<typeof toastViewportVariants>;
22
+ type ToastRootVariantProps = VariantProps<typeof toastRootVariants>;
23
+ type ToastPosition = NonNullable<ToastViewportVariantProps["position"]>;
24
+ type ToastInput = ToastRootVariantProps & {
25
+ id?: string;
26
+ title?: ReactNode;
27
+ description?: ReactNode;
28
+ durationMs?: number;
29
+ animation?: ToastAnimation;
30
+ };
31
+ type ToastContextValue = {
32
+ toast: (input: ToastInput) => string;
33
+ dismiss: (id: string) => void;
34
+ };
35
+ type ToastProviderProps = {
36
+ children?: ReactNode;
37
+ };
38
+ type ToastViewportProps = ToastViewportVariantProps & {
39
+ className?: string;
40
+ };
41
+ type ToastProps = ToastRootVariantProps & {
42
+ toastId: string;
43
+ animation?: ToastAnimation;
44
+ className?: string;
45
+ children?: ReactNode;
46
+ };
47
+ type ToastSectionProps = {
48
+ className?: string;
49
+ children?: ReactNode;
50
+ onClick?: () => void;
51
+ };
52
+
53
+ declare function toast(input: ToastInput): string;
54
+ declare function useToast(): ToastContextValue;
55
+ declare function ToastProvider({ children }: ToastProviderProps): react_jsx_runtime.JSX.Element;
56
+ declare namespace ToastProvider {
57
+ var displayName: string;
58
+ }
59
+ declare function ToastViewport({ position, className }: ToastViewportProps): react.ReactPortal | null;
60
+ declare namespace ToastViewport {
61
+ var displayName: string;
62
+ }
63
+ declare function Toast({ toastId: _toastId, appearance, size, animation, className, children }: ToastProps): react_jsx_runtime.JSX.Element;
64
+ declare namespace Toast {
65
+ var displayName: string;
66
+ }
67
+ declare function ToastTitle({ className, children }: ToastSectionProps): react_jsx_runtime.JSX.Element;
68
+ declare namespace ToastTitle {
69
+ var displayName: string;
70
+ }
71
+ declare function ToastDescription({ className, children }: ToastSectionProps): react_jsx_runtime.JSX.Element;
72
+ declare namespace ToastDescription {
73
+ var displayName: string;
74
+ }
75
+ declare function ToastAction({ className, children }: ToastSectionProps): react_jsx_runtime.JSX.Element;
76
+ declare namespace ToastAction {
77
+ var displayName: string;
78
+ }
79
+ declare function ToastClose({ className, children, onClick, ...rest }: ToastSectionProps & {
80
+ onClick?: () => void;
81
+ }): react_jsx_runtime.JSX.Element;
82
+ declare namespace ToastClose {
83
+ var displayName: string;
84
+ }
85
+
86
+ export { Toast, ToastAction, type ToastAnimation, ToastClose, type ToastContextValue, ToastDescription, type ToastInput, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, type ToastSectionProps, ToastTitle, ToastViewport, type ToastViewportProps, toast, toastAnimationPresets, toastRootVariants, toastViewportVariants, useToast };