@tomny-dev/uzi 0.2.5 → 0.2.6-pr.22.67.1.9e9e57c
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/components/auth-card/AuthCard.d.ts +24 -0
- package/dist/components/auth-card/AuthCard.d.ts.map +1 -0
- package/dist/components/auth-card/AuthCard.test.d.ts +2 -0
- package/dist/components/auth-card/AuthCard.test.d.ts.map +1 -0
- package/dist/index.cjs +67 -1925
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -1858
- package/dist/index10.cjs +26 -0
- package/dist/index10.cjs.map +1 -0
- package/dist/index10.js +19 -0
- package/dist/index10.js.map +1 -0
- package/dist/index11.cjs +22 -0
- package/dist/index11.cjs.map +1 -0
- package/dist/index11.js +22 -0
- package/dist/index11.js.map +1 -0
- package/dist/index12.cjs +22 -0
- package/dist/index12.cjs.map +1 -0
- package/dist/index12.js +41 -0
- package/dist/index12.js.map +1 -0
- package/dist/index13.cjs +56 -0
- package/dist/index13.cjs.map +1 -0
- package/dist/index13.js +84 -0
- package/dist/index13.js.map +1 -0
- package/dist/index14.cjs +87 -0
- package/dist/index14.cjs.map +1 -0
- package/dist/index14.js +17 -0
- package/dist/index14.js.map +1 -0
- package/dist/index15.cjs +22 -0
- package/dist/index15.cjs.map +1 -0
- package/dist/index15.js +16 -0
- package/dist/index15.js.map +1 -0
- package/dist/index16.cjs +16 -0
- package/dist/index16.cjs.map +1 -0
- package/dist/index16.js +45 -0
- package/dist/index16.js.map +1 -0
- package/dist/index17.cjs +64 -0
- package/dist/index17.cjs.map +1 -0
- package/dist/index17.js +435 -0
- package/dist/index17.js.map +1 -0
- package/dist/index18.cjs +438 -0
- package/dist/index18.cjs.map +1 -0
- package/dist/index18.js +7 -0
- package/dist/index18.js.map +1 -0
- package/dist/index19.cjs +8 -0
- package/dist/index19.cjs.map +1 -0
- package/dist/index19.js +18 -0
- package/dist/index19.js.map +1 -0
- package/dist/index2.cjs +23 -0
- package/dist/index20.cjs +20 -0
- package/dist/index20.cjs.map +1 -0
- package/dist/index20.js +7 -0
- package/dist/index20.js.map +1 -0
- package/dist/index21.cjs +8 -0
- package/dist/index21.cjs.map +1 -0
- package/dist/index21.js +15 -0
- package/dist/index21.js.map +1 -0
- package/dist/index22.cjs +17 -0
- package/dist/index22.cjs.map +1 -0
- package/dist/index22.js +7 -0
- package/dist/index22.js.map +1 -0
- package/dist/index23.cjs +8 -0
- package/dist/index23.cjs.map +1 -0
- package/dist/index23.js +18 -0
- package/dist/index23.js.map +1 -0
- package/dist/index24.cjs +20 -0
- package/dist/index24.cjs.map +1 -0
- package/dist/index24.js +41 -0
- package/dist/index24.js.map +1 -0
- package/dist/index25.cjs +58 -0
- package/dist/index25.cjs.map +1 -0
- package/dist/index25.js +123 -0
- package/dist/index25.js.map +1 -0
- package/dist/index26.cjs +126 -0
- package/dist/index26.cjs.map +1 -0
- package/dist/index26.js +29 -0
- package/dist/index26.js.map +1 -0
- package/dist/index27.cjs +40 -0
- package/dist/index27.cjs.map +1 -0
- package/dist/index27.js +110 -0
- package/dist/index27.js.map +1 -0
- package/dist/index28.cjs +113 -0
- package/dist/index28.cjs.map +1 -0
- package/dist/index28.js +26 -0
- package/dist/index28.js.map +1 -0
- package/dist/index29.cjs +28 -0
- package/dist/index29.cjs.map +1 -0
- package/dist/index29.js +29 -0
- package/dist/index29.js.map +1 -0
- package/dist/index3.js +8 -0
- package/dist/index3.js.map +1 -0
- package/dist/index30.cjs +40 -0
- package/dist/index30.cjs.map +1 -0
- package/dist/index30.js +118 -0
- package/dist/index30.js.map +1 -0
- package/dist/index31.cjs +134 -0
- package/dist/index31.cjs.map +1 -0
- package/dist/index31.js +20 -0
- package/dist/index31.js.map +1 -0
- package/dist/index32.cjs +23 -0
- package/dist/index32.cjs.map +1 -0
- package/dist/index32.js +114 -0
- package/dist/index32.js.map +1 -0
- package/dist/index33.cjs +115 -0
- package/dist/index33.cjs.map +1 -0
- package/dist/index33.js +7 -0
- package/dist/index33.js.map +1 -0
- package/dist/index34.cjs +8 -0
- package/dist/index34.cjs.map +1 -0
- package/dist/index34.js +66 -0
- package/dist/index34.js.map +1 -0
- package/dist/index35.cjs +66 -0
- package/dist/index35.cjs.map +1 -0
- package/dist/index35.js +25 -0
- package/dist/index35.js.map +1 -0
- package/dist/index36.cjs +34 -0
- package/dist/index36.cjs.map +1 -0
- package/dist/index36.js +55 -0
- package/dist/index36.js.map +1 -0
- package/dist/index37.cjs +55 -0
- package/dist/index37.cjs.map +1 -0
- package/dist/index37.js +35 -0
- package/dist/index37.js.map +1 -0
- package/dist/index38.cjs +49 -0
- package/dist/index38.cjs.map +1 -0
- package/dist/index38.js +150 -0
- package/dist/index38.js.map +1 -0
- package/dist/index39.cjs +150 -0
- package/dist/index39.cjs.map +1 -0
- package/dist/index39.js +43 -0
- package/dist/index39.js.map +1 -0
- package/dist/index4.cjs +8 -0
- package/dist/index4.cjs.map +1 -0
- package/dist/index4.js +29 -0
- package/dist/index4.js.map +1 -0
- package/dist/index40.cjs +61 -0
- package/dist/index40.cjs.map +1 -0
- package/dist/index40.js +173 -0
- package/dist/index40.js.map +1 -0
- package/dist/index41.cjs +173 -0
- package/dist/index41.cjs.map +1 -0
- package/dist/index41.js +14 -0
- package/dist/index41.js.map +1 -0
- package/dist/index42.cjs +15 -0
- package/dist/index42.cjs.map +1 -0
- package/dist/index42.js +21 -0
- package/dist/index42.js.map +1 -0
- package/dist/index43.cjs +21 -0
- package/dist/index43.cjs.map +1 -0
- package/dist/index43.js +15 -0
- package/dist/index43.js.map +1 -0
- package/dist/index44.cjs +17 -0
- package/dist/index44.cjs.map +1 -0
- package/dist/index44.js +24 -0
- package/dist/index44.js.map +1 -0
- package/dist/index45.cjs +24 -0
- package/dist/index45.cjs.map +1 -0
- package/dist/index45.js +13 -0
- package/dist/index45.js.map +1 -0
- package/dist/index46.cjs +16 -0
- package/dist/index46.cjs.map +1 -0
- package/dist/index46.js +96 -0
- package/dist/index46.js.map +1 -0
- package/dist/index47.cjs +98 -0
- package/dist/index47.cjs.map +1 -0
- package/dist/index47.js +25 -0
- package/dist/index47.js.map +1 -0
- package/dist/index48.cjs +34 -0
- package/dist/index48.cjs.map +1 -0
- package/dist/index48.js +50 -0
- package/dist/index48.js.map +1 -0
- package/dist/index49.cjs +52 -0
- package/dist/index49.cjs.map +1 -0
- package/dist/index5.cjs +40 -0
- package/dist/index5.cjs.map +1 -0
- package/dist/index5.js +45 -0
- package/dist/index5.js.map +1 -0
- package/dist/index6.cjs +47 -0
- package/dist/index6.cjs.map +1 -0
- package/dist/index6.js +17 -0
- package/dist/index6.js.map +1 -0
- package/dist/index7.cjs +20 -0
- package/dist/index7.cjs.map +1 -0
- package/dist/index7.js +30 -0
- package/dist/index7.js.map +1 -0
- package/dist/index8.cjs +35 -0
- package/dist/index8.cjs.map +1 -0
- package/dist/index8.js +18 -0
- package/dist/index8.js.map +1 -0
- package/dist/index9.cjs +20 -0
- package/dist/index9.cjs.map +1 -0
- package/dist/index9.js +26 -0
- package/dist/index9.js.map +1 -0
- package/dist/style.css +84 -0
- package/package.json +1 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index18.cjs
ADDED
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_runtime = require("./index2.cjs");
|
|
3
|
+
const require_cx = require("./index4.cjs");
|
|
4
|
+
const require_toast_module = require("./index17.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let _radix_ui_react_toast = require("@radix-ui/react-toast");
|
|
8
|
+
_radix_ui_react_toast = require_runtime.__toESM(_radix_ui_react_toast, 1);
|
|
9
|
+
//#region src/components/toast/ToastContext.tsx
|
|
10
|
+
/** Default provider configuration. */
|
|
11
|
+
var DEFAULT_CONFIG = {
|
|
12
|
+
position: "top-right",
|
|
13
|
+
maxToasts: 5,
|
|
14
|
+
defaultDuration: 4e3,
|
|
15
|
+
pauseOnHover: true,
|
|
16
|
+
pauseOnFocusLoss: true
|
|
17
|
+
};
|
|
18
|
+
var ToastContext = (0, react.createContext)(void 0);
|
|
19
|
+
var toastIdCounter = 0;
|
|
20
|
+
var generateToastId = () => `toast-${++toastIdCounter}-${Date.now()}`;
|
|
21
|
+
/**
|
|
22
|
+
* Toast notification context provider.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* Wrap your app (or a section) to enable `useToast` calls. Supports configurable placement,
|
|
26
|
+
* maximum visible toasts, and pause behavior on hover or window blur.
|
|
27
|
+
*
|
|
28
|
+
* @param props.children - React subtree that can consume the toast context.
|
|
29
|
+
* @param props.config - Optional provider configuration overrides.
|
|
30
|
+
*/
|
|
31
|
+
function ToastProvider({ children, config }) {
|
|
32
|
+
const [toasts, setToasts] = (0, react.useState)([]);
|
|
33
|
+
const [isPaused, setIsPaused] = (0, react.useState)(false);
|
|
34
|
+
const merged = (0, react.useMemo)(() => ({
|
|
35
|
+
...DEFAULT_CONFIG,
|
|
36
|
+
...config
|
|
37
|
+
}), [config]);
|
|
38
|
+
const push = (0, react.useCallback)((message, options = {}) => {
|
|
39
|
+
const id = generateToastId();
|
|
40
|
+
setToasts((prev) => {
|
|
41
|
+
const next = [...prev, {
|
|
42
|
+
id,
|
|
43
|
+
message,
|
|
44
|
+
type: options.type ?? "info",
|
|
45
|
+
duration: options.duration ?? (options.type === "error" ? 6e3 : merged.defaultDuration),
|
|
46
|
+
dismissible: options.dismissible ?? true,
|
|
47
|
+
copyable: options.copyable ?? false,
|
|
48
|
+
action: options.action
|
|
49
|
+
}];
|
|
50
|
+
if (next.length > merged.maxToasts) next.shift();
|
|
51
|
+
return next;
|
|
52
|
+
});
|
|
53
|
+
return id;
|
|
54
|
+
}, [merged.defaultDuration, merged.maxToasts]);
|
|
55
|
+
const success = (0, react.useCallback)((message, options) => push(message, {
|
|
56
|
+
...options,
|
|
57
|
+
type: "success"
|
|
58
|
+
}), [push]);
|
|
59
|
+
const error = (0, react.useCallback)((message, options) => push(message, {
|
|
60
|
+
copyable: true,
|
|
61
|
+
...options,
|
|
62
|
+
type: "error"
|
|
63
|
+
}), [push]);
|
|
64
|
+
const warning = (0, react.useCallback)((message, options) => push(message, {
|
|
65
|
+
...options,
|
|
66
|
+
type: "warning"
|
|
67
|
+
}), [push]);
|
|
68
|
+
const info = (0, react.useCallback)((message, options) => push(message, {
|
|
69
|
+
...options,
|
|
70
|
+
type: "info"
|
|
71
|
+
}), [push]);
|
|
72
|
+
const dismiss = (0, react.useCallback)((id) => {
|
|
73
|
+
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
74
|
+
}, []);
|
|
75
|
+
const dismissAll = (0, react.useCallback)(() => setToasts([]), []);
|
|
76
|
+
(0, react.useEffect)(() => {
|
|
77
|
+
if (!merged.pauseOnFocusLoss) return;
|
|
78
|
+
const handleVisibility = () => setIsPaused(document.visibilityState !== "visible");
|
|
79
|
+
document.addEventListener("visibilitychange", handleVisibility);
|
|
80
|
+
return () => document.removeEventListener("visibilitychange", handleVisibility);
|
|
81
|
+
}, [merged.pauseOnFocusLoss]);
|
|
82
|
+
const value = (0, react.useMemo)(() => ({
|
|
83
|
+
toasts,
|
|
84
|
+
push,
|
|
85
|
+
success,
|
|
86
|
+
error,
|
|
87
|
+
warning,
|
|
88
|
+
info,
|
|
89
|
+
dismiss,
|
|
90
|
+
dismissAll
|
|
91
|
+
}), [
|
|
92
|
+
toasts,
|
|
93
|
+
push,
|
|
94
|
+
success,
|
|
95
|
+
error,
|
|
96
|
+
warning,
|
|
97
|
+
info,
|
|
98
|
+
dismiss,
|
|
99
|
+
dismissAll
|
|
100
|
+
]);
|
|
101
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastContext.Provider, {
|
|
102
|
+
value,
|
|
103
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_toast.Provider, {
|
|
104
|
+
swipeDirection: "right",
|
|
105
|
+
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastContainer, {
|
|
106
|
+
toasts,
|
|
107
|
+
position: merged.position,
|
|
108
|
+
pauseOnHover: merged.pauseOnHover,
|
|
109
|
+
isPaused,
|
|
110
|
+
onDismiss: dismiss,
|
|
111
|
+
onPauseChange: setIsPaused
|
|
112
|
+
})]
|
|
113
|
+
})
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Hook to access the toast API.
|
|
118
|
+
*
|
|
119
|
+
* @remarks
|
|
120
|
+
* Exposes `push`, intent helpers (`success`, `error`, `warning`, `info`), and dismissal helpers.
|
|
121
|
+
* Must be called within a `ToastProvider`.
|
|
122
|
+
*
|
|
123
|
+
* @throws Error if used outside of a `ToastProvider`.
|
|
124
|
+
*/
|
|
125
|
+
function useToast() {
|
|
126
|
+
const ctx = (0, react.useContext)(ToastContext);
|
|
127
|
+
if (!ctx) throw new Error("useToast must be used within a ToastProvider");
|
|
128
|
+
return ctx;
|
|
129
|
+
}
|
|
130
|
+
/** Renders the positioned toast stack. */
|
|
131
|
+
function ToastContainer({ toasts, position, pauseOnHover, isPaused, onDismiss, onPauseChange }) {
|
|
132
|
+
const posClass = (() => {
|
|
133
|
+
switch (position) {
|
|
134
|
+
case "top-left": return "topLeft";
|
|
135
|
+
case "top-center": return "topCenter";
|
|
136
|
+
case "bottom-right": return "bottomRight";
|
|
137
|
+
case "bottom-left": return "bottomLeft";
|
|
138
|
+
case "bottom-center": return "bottomCenter";
|
|
139
|
+
default: return "topRight";
|
|
140
|
+
}
|
|
141
|
+
})();
|
|
142
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [toasts.map((toast) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastItem, {
|
|
143
|
+
toast,
|
|
144
|
+
isPaused,
|
|
145
|
+
onDismiss
|
|
146
|
+
}, toast.id)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_toast.Viewport, {
|
|
147
|
+
className: require_cx.cx(require_toast_module.default.stack, require_toast_module.default[posClass]),
|
|
148
|
+
label: "Notifications",
|
|
149
|
+
onMouseEnter: () => pauseOnHover && onPauseChange(true),
|
|
150
|
+
onMouseLeave: () => pauseOnHover && onPauseChange(false)
|
|
151
|
+
})] });
|
|
152
|
+
}
|
|
153
|
+
/** Individual toast item with timers and actions. */
|
|
154
|
+
function ToastItem({ toast, isPaused, onDismiss }) {
|
|
155
|
+
const [open, setOpen] = (0, react.useState)(true);
|
|
156
|
+
const [copyState, setCopyState] = (0, react.useState)("idle");
|
|
157
|
+
const copyTimerRef = (0, react.useRef)(null);
|
|
158
|
+
const timerRef = (0, react.useRef)(null);
|
|
159
|
+
const startRef = (0, react.useRef)(0);
|
|
160
|
+
const remainingRef = (0, react.useRef)(toast.duration ?? 0);
|
|
161
|
+
const closingRef = (0, react.useRef)(false);
|
|
162
|
+
const palette = getPalette(toast.type);
|
|
163
|
+
const styleVars = {
|
|
164
|
+
["--toast-bg"]: palette.background,
|
|
165
|
+
["--toast-border"]: palette.border,
|
|
166
|
+
["--toast-accent"]: palette.accent,
|
|
167
|
+
["--toast-text"]: palette.text,
|
|
168
|
+
["--toast-action-bg"]: palette.actionBg,
|
|
169
|
+
["--toast-action-border"]: palette.actionBorder
|
|
170
|
+
};
|
|
171
|
+
const stopTimer = () => {
|
|
172
|
+
if (timerRef.current) {
|
|
173
|
+
window.clearTimeout(timerRef.current);
|
|
174
|
+
timerRef.current = null;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const triggerDismiss = (0, react.useCallback)(() => {
|
|
178
|
+
if (closingRef.current) return;
|
|
179
|
+
closingRef.current = true;
|
|
180
|
+
setOpen(false);
|
|
181
|
+
stopTimer();
|
|
182
|
+
window.setTimeout(() => onDismiss(toast.id), 160);
|
|
183
|
+
}, [onDismiss, toast.id]);
|
|
184
|
+
const schedule = (0, react.useCallback)((delay) => {
|
|
185
|
+
if (!delay || delay <= 0) {
|
|
186
|
+
triggerDismiss();
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
startRef.current = performance.now();
|
|
190
|
+
stopTimer();
|
|
191
|
+
timerRef.current = window.setTimeout(() => triggerDismiss(), delay);
|
|
192
|
+
}, [triggerDismiss]);
|
|
193
|
+
(0, react.useEffect)(() => {
|
|
194
|
+
if (!toast.duration || toast.duration <= 0) return void 0;
|
|
195
|
+
schedule(toast.duration);
|
|
196
|
+
return stopTimer;
|
|
197
|
+
}, [schedule, toast.duration]);
|
|
198
|
+
(0, react.useEffect)(() => {
|
|
199
|
+
if (!toast.duration || toast.duration <= 0) return;
|
|
200
|
+
if (isPaused) {
|
|
201
|
+
const elapsed = performance.now() - startRef.current;
|
|
202
|
+
remainingRef.current = Math.max(0, remainingRef.current - elapsed);
|
|
203
|
+
stopTimer();
|
|
204
|
+
} else schedule(remainingRef.current);
|
|
205
|
+
}, [
|
|
206
|
+
isPaused,
|
|
207
|
+
schedule,
|
|
208
|
+
toast.duration
|
|
209
|
+
]);
|
|
210
|
+
(0, react.useEffect)(() => {
|
|
211
|
+
return () => {
|
|
212
|
+
if (copyTimerRef.current) window.clearTimeout(copyTimerRef.current);
|
|
213
|
+
};
|
|
214
|
+
}, []);
|
|
215
|
+
const handleCopy = (0, react.useCallback)(async () => {
|
|
216
|
+
if (copyTimerRef.current) window.clearTimeout(copyTimerRef.current);
|
|
217
|
+
try {
|
|
218
|
+
if (!navigator.clipboard) throw new Error("Clipboard API unavailable");
|
|
219
|
+
await navigator.clipboard.writeText(toast.message);
|
|
220
|
+
setCopyState("copied");
|
|
221
|
+
} catch {
|
|
222
|
+
setCopyState("failed");
|
|
223
|
+
}
|
|
224
|
+
copyTimerRef.current = window.setTimeout(() => setCopyState("idle"), 1800);
|
|
225
|
+
}, [toast.message]);
|
|
226
|
+
const icon = getIcon(toast.type);
|
|
227
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_toast.Root, {
|
|
228
|
+
open,
|
|
229
|
+
onOpenChange: (nextOpen) => {
|
|
230
|
+
if (!nextOpen) triggerDismiss();
|
|
231
|
+
},
|
|
232
|
+
duration: 2147483647,
|
|
233
|
+
className: require_toast_module.default.toast,
|
|
234
|
+
style: styleVars,
|
|
235
|
+
children: [
|
|
236
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
237
|
+
className: require_toast_module.default.icon,
|
|
238
|
+
"aria-hidden": true,
|
|
239
|
+
children: icon
|
|
240
|
+
}),
|
|
241
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
242
|
+
className: require_toast_module.default.body,
|
|
243
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_toast.Description, {
|
|
244
|
+
className: require_toast_module.default.message,
|
|
245
|
+
children: toast.message
|
|
246
|
+
}), toast.action && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
247
|
+
className: require_toast_module.default.actions,
|
|
248
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_toast.Action, {
|
|
249
|
+
asChild: true,
|
|
250
|
+
altText: toast.action.label,
|
|
251
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
252
|
+
type: "button",
|
|
253
|
+
className: require_toast_module.default.actionButton,
|
|
254
|
+
onClick: () => {
|
|
255
|
+
toast.action?.onClick();
|
|
256
|
+
triggerDismiss();
|
|
257
|
+
},
|
|
258
|
+
children: toast.action.label
|
|
259
|
+
})
|
|
260
|
+
})
|
|
261
|
+
})]
|
|
262
|
+
}),
|
|
263
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
264
|
+
className: require_toast_module.default.controls,
|
|
265
|
+
children: [toast.copyable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
266
|
+
type: "button",
|
|
267
|
+
className: require_cx.cx(require_toast_module.default.iconButton, copyState === "failed" && require_toast_module.default.iconButtonError),
|
|
268
|
+
"aria-label": "Copy message",
|
|
269
|
+
onClick: handleCopy,
|
|
270
|
+
children: copyState === "copied" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
271
|
+
width: "13",
|
|
272
|
+
height: "13",
|
|
273
|
+
viewBox: "0 0 13 13",
|
|
274
|
+
fill: "none",
|
|
275
|
+
"aria-hidden": true,
|
|
276
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
277
|
+
d: "M2 6.5l3 3 6-6",
|
|
278
|
+
stroke: "currentColor",
|
|
279
|
+
strokeWidth: "1.5",
|
|
280
|
+
strokeLinecap: "round",
|
|
281
|
+
strokeLinejoin: "round"
|
|
282
|
+
})
|
|
283
|
+
}) : copyState === "failed" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
284
|
+
width: "13",
|
|
285
|
+
height: "13",
|
|
286
|
+
viewBox: "0 0 13 13",
|
|
287
|
+
fill: "none",
|
|
288
|
+
"aria-hidden": true,
|
|
289
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
290
|
+
d: "M10 3L3 10M3 3l7 7",
|
|
291
|
+
stroke: "currentColor",
|
|
292
|
+
strokeWidth: "1.5",
|
|
293
|
+
strokeLinecap: "round"
|
|
294
|
+
})
|
|
295
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
296
|
+
width: "13",
|
|
297
|
+
height: "13",
|
|
298
|
+
viewBox: "0 0 13 13",
|
|
299
|
+
fill: "none",
|
|
300
|
+
"aria-hidden": true,
|
|
301
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
|
|
302
|
+
x: "4.5",
|
|
303
|
+
y: "1.5",
|
|
304
|
+
width: "7",
|
|
305
|
+
height: "7",
|
|
306
|
+
rx: "1.5",
|
|
307
|
+
stroke: "currentColor",
|
|
308
|
+
strokeWidth: "1.25"
|
|
309
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
310
|
+
d: "M1.5 5.5v5a1.5 1.5 0 001.5 1.5h5",
|
|
311
|
+
stroke: "currentColor",
|
|
312
|
+
strokeWidth: "1.25",
|
|
313
|
+
strokeLinecap: "round"
|
|
314
|
+
})]
|
|
315
|
+
})
|
|
316
|
+
}), toast.dismissible !== false && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_toast.Close, {
|
|
317
|
+
asChild: true,
|
|
318
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
319
|
+
type: "button",
|
|
320
|
+
className: require_toast_module.default.iconButton,
|
|
321
|
+
"aria-label": "Dismiss notification",
|
|
322
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
323
|
+
width: "13",
|
|
324
|
+
height: "13",
|
|
325
|
+
viewBox: "0 0 13 13",
|
|
326
|
+
fill: "none",
|
|
327
|
+
"aria-hidden": true,
|
|
328
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
329
|
+
d: "M10 3L3 10M3 3l7 7",
|
|
330
|
+
stroke: "currentColor",
|
|
331
|
+
strokeWidth: "1.5",
|
|
332
|
+
strokeLinecap: "round"
|
|
333
|
+
})
|
|
334
|
+
})
|
|
335
|
+
})
|
|
336
|
+
})]
|
|
337
|
+
})
|
|
338
|
+
]
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
function getPalette(type) {
|
|
342
|
+
switch (type) {
|
|
343
|
+
case "success": return {
|
|
344
|
+
background: "color-mix(in srgb, var(--success) 12%, var(--popover))",
|
|
345
|
+
border: "color-mix(in srgb, var(--success) 30%, transparent)",
|
|
346
|
+
accent: "var(--success)",
|
|
347
|
+
text: "var(--popover-foreground)",
|
|
348
|
+
actionBg: "color-mix(in srgb, var(--success) 14%, transparent)",
|
|
349
|
+
actionBorder: "color-mix(in srgb, var(--success) 35%, transparent)"
|
|
350
|
+
};
|
|
351
|
+
case "error": return {
|
|
352
|
+
background: "color-mix(in srgb, var(--destructive) 12%, var(--popover))",
|
|
353
|
+
border: "color-mix(in srgb, var(--destructive) 30%, transparent)",
|
|
354
|
+
accent: "var(--destructive)",
|
|
355
|
+
text: "var(--popover-foreground)",
|
|
356
|
+
actionBg: "color-mix(in srgb, var(--destructive) 14%, transparent)",
|
|
357
|
+
actionBorder: "color-mix(in srgb, var(--destructive) 35%, transparent)"
|
|
358
|
+
};
|
|
359
|
+
case "warning": return {
|
|
360
|
+
background: "color-mix(in srgb, var(--warning) 12%, var(--popover))",
|
|
361
|
+
border: "color-mix(in srgb, var(--warning) 30%, transparent)",
|
|
362
|
+
accent: "var(--warning)",
|
|
363
|
+
text: "var(--popover-foreground)",
|
|
364
|
+
actionBg: "color-mix(in srgb, var(--warning) 14%, transparent)",
|
|
365
|
+
actionBorder: "color-mix(in srgb, var(--warning) 35%, transparent)"
|
|
366
|
+
};
|
|
367
|
+
default: return {
|
|
368
|
+
background: "color-mix(in srgb, var(--primary) 12%, var(--popover))",
|
|
369
|
+
border: "color-mix(in srgb, var(--primary) 30%, transparent)",
|
|
370
|
+
accent: "var(--primary)",
|
|
371
|
+
text: "var(--popover-foreground)",
|
|
372
|
+
actionBg: "color-mix(in srgb, var(--primary) 14%, transparent)",
|
|
373
|
+
actionBorder: "color-mix(in srgb, var(--primary) 35%, transparent)"
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
function getIcon(type) {
|
|
378
|
+
switch (type) {
|
|
379
|
+
case "success": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
380
|
+
width: "16",
|
|
381
|
+
height: "16",
|
|
382
|
+
viewBox: "0 0 16 16",
|
|
383
|
+
fill: "none",
|
|
384
|
+
"aria-hidden": true,
|
|
385
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
386
|
+
d: "M3 8l3.5 3.5L13 4.5",
|
|
387
|
+
stroke: "currentColor",
|
|
388
|
+
strokeWidth: "1.75",
|
|
389
|
+
strokeLinecap: "round",
|
|
390
|
+
strokeLinejoin: "round"
|
|
391
|
+
})
|
|
392
|
+
});
|
|
393
|
+
case "error": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
394
|
+
width: "16",
|
|
395
|
+
height: "16",
|
|
396
|
+
viewBox: "0 0 16 16",
|
|
397
|
+
fill: "none",
|
|
398
|
+
"aria-hidden": true,
|
|
399
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
400
|
+
d: "M4 4l8 8M12 4l-8 8",
|
|
401
|
+
stroke: "currentColor",
|
|
402
|
+
strokeWidth: "1.75",
|
|
403
|
+
strokeLinecap: "round"
|
|
404
|
+
})
|
|
405
|
+
});
|
|
406
|
+
case "warning": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
407
|
+
width: "16",
|
|
408
|
+
height: "16",
|
|
409
|
+
viewBox: "0 0 16 16",
|
|
410
|
+
fill: "none",
|
|
411
|
+
"aria-hidden": true,
|
|
412
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
413
|
+
d: "M8 3v6M8 11.5v1",
|
|
414
|
+
stroke: "currentColor",
|
|
415
|
+
strokeWidth: "1.75",
|
|
416
|
+
strokeLinecap: "round"
|
|
417
|
+
})
|
|
418
|
+
});
|
|
419
|
+
default: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
420
|
+
width: "16",
|
|
421
|
+
height: "16",
|
|
422
|
+
viewBox: "0 0 16 16",
|
|
423
|
+
fill: "none",
|
|
424
|
+
"aria-hidden": true,
|
|
425
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
426
|
+
d: "M8 7v5M8 4.5v.5",
|
|
427
|
+
stroke: "currentColor",
|
|
428
|
+
strokeWidth: "1.75",
|
|
429
|
+
strokeLinecap: "round"
|
|
430
|
+
})
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
//#endregion
|
|
435
|
+
exports.ToastProvider = ToastProvider;
|
|
436
|
+
exports.useToast = useToast;
|
|
437
|
+
|
|
438
|
+
//# sourceMappingURL=index18.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index18.cjs","names":[],"sources":["../src/components/toast/ToastContext.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n} from \"react\";\nimport * as ToastPrimitive from \"@radix-ui/react-toast\";\nimport { cx } from \"../../utils/cx\";\nimport type {\n Toast,\n ToastConfig,\n ToastContextValue,\n ToastOptions,\n ToastPosition,\n ToastType,\n} from \"./types\";\nimport styles from \"./toast.module.css\";\n\n/** Default provider configuration. */\nconst DEFAULT_CONFIG: Required<ToastConfig> = {\n position: \"top-right\",\n maxToasts: 5,\n defaultDuration: 4000,\n pauseOnHover: true,\n pauseOnFocusLoss: true,\n};\n\nconst ToastContext = createContext<ToastContextValue | undefined>(undefined);\n\nlet toastIdCounter = 0;\nconst generateToastId = () => `toast-${++toastIdCounter}-${Date.now()}`;\n\n/**\n * Toast notification context provider.\n *\n * @remarks\n * Wrap your app (or a section) to enable `useToast` calls. Supports configurable placement,\n * maximum visible toasts, and pause behavior on hover or window blur.\n *\n * @param props.children - React subtree that can consume the toast context.\n * @param props.config - Optional provider configuration overrides.\n */\nexport function ToastProvider({\n children,\n config,\n}: {\n children: ReactNode;\n config?: ToastConfig;\n}) {\n const [toasts, setToasts] = useState<Toast[]>([]);\n const [isPaused, setIsPaused] = useState(false);\n const merged = useMemo(() => ({ ...DEFAULT_CONFIG, ...config }), [config]);\n\n const push = useCallback(\n (message: string, options: ToastOptions = {}) => {\n const id = generateToastId();\n setToasts((prev) => {\n const next: Toast[] = [\n ...prev,\n {\n id,\n message,\n type: options.type ?? \"info\",\n duration: options.duration ?? (options.type === \"error\" ? 6000 : merged.defaultDuration),\n dismissible: options.dismissible ?? true,\n copyable: options.copyable ?? false,\n action: options.action,\n },\n ];\n if (next.length > merged.maxToasts) next.shift();\n return next;\n });\n return id;\n },\n [merged.defaultDuration, merged.maxToasts],\n );\n\n const success = useCallback(\n (message: string, options?: Omit<ToastOptions, \"type\">) => push(message, { ...options, type: \"success\" }),\n [push],\n );\n const error = useCallback(\n (message: string, options?: Omit<ToastOptions, \"type\">) =>\n push(message, { copyable: true, ...options, type: \"error\" }),\n [push],\n );\n const warning = useCallback(\n (message: string, options?: Omit<ToastOptions, \"type\">) => push(message, { ...options, type: \"warning\" }),\n [push],\n );\n const info = useCallback(\n (message: string, options?: Omit<ToastOptions, \"type\">) => push(message, { ...options, type: \"info\" }),\n [push],\n );\n\n const dismiss = useCallback((id: string) => {\n setToasts((prev) => prev.filter((t) => t.id !== id));\n }, []);\n\n const dismissAll = useCallback(() => setToasts([]), []);\n\n useEffect(() => {\n if (!merged.pauseOnFocusLoss) return;\n const handleVisibility = () => setIsPaused(document.visibilityState !== \"visible\");\n document.addEventListener(\"visibilitychange\", handleVisibility);\n return () => document.removeEventListener(\"visibilitychange\", handleVisibility);\n }, [merged.pauseOnFocusLoss]);\n\n const value = useMemo<ToastContextValue>(\n () => ({ toasts, push, success, error, warning, info, dismiss, dismissAll }),\n [toasts, push, success, error, warning, info, dismiss, dismissAll],\n );\n\n return (\n <ToastContext.Provider value={value}>\n <ToastPrimitive.Provider swipeDirection=\"right\">\n {children}\n <ToastContainer\n toasts={toasts}\n position={merged.position}\n pauseOnHover={merged.pauseOnHover}\n isPaused={isPaused}\n onDismiss={dismiss}\n onPauseChange={setIsPaused}\n />\n </ToastPrimitive.Provider>\n </ToastContext.Provider>\n );\n}\n\n/**\n * Hook to access the toast API.\n *\n * @remarks\n * Exposes `push`, intent helpers (`success`, `error`, `warning`, `info`), and dismissal helpers.\n * Must be called within a `ToastProvider`.\n *\n * @throws Error if used outside of a `ToastProvider`.\n */\nexport function useToast(): ToastContextValue {\n const ctx = useContext(ToastContext);\n if (!ctx) throw new Error(\"useToast must be used within a ToastProvider\");\n return ctx;\n}\n\n/** Renders the positioned toast stack. */\nfunction ToastContainer({\n toasts,\n position,\n pauseOnHover,\n isPaused,\n onDismiss,\n onPauseChange,\n}: {\n toasts: Toast[];\n position: ToastPosition;\n pauseOnHover: boolean;\n isPaused: boolean;\n onDismiss: (id: string) => void;\n onPauseChange: (paused: boolean) => void;\n}) {\n const posClass = (() => {\n switch (position) {\n case \"top-left\":\n return \"topLeft\";\n case \"top-center\":\n return \"topCenter\";\n case \"bottom-right\":\n return \"bottomRight\";\n case \"bottom-left\":\n return \"bottomLeft\";\n case \"bottom-center\":\n return \"bottomCenter\";\n case \"top-right\":\n default:\n return \"topRight\";\n }\n })();\n\n return (\n <>\n {toasts.map((toast) => (\n <ToastItem key={toast.id} toast={toast} isPaused={isPaused} onDismiss={onDismiss} />\n ))}\n <ToastPrimitive.Viewport\n className={cx(styles.stack, styles[posClass])}\n label=\"Notifications\"\n onMouseEnter={() => pauseOnHover && onPauseChange(true)}\n onMouseLeave={() => pauseOnHover && onPauseChange(false)}\n />\n </>\n );\n}\n\n/** Individual toast item with timers and actions. */\nfunction ToastItem({\n toast,\n isPaused,\n onDismiss,\n}: {\n toast: Toast;\n isPaused: boolean;\n onDismiss: (id: string) => void;\n}) {\n const [open, setOpen] = useState(true);\n const [copyState, setCopyState] = useState<\"idle\" | \"copied\" | \"failed\">(\"idle\");\n const copyTimerRef = useRef<number | null>(null);\n const timerRef = useRef<number | null>(null);\n const startRef = useRef<number>(0);\n const remainingRef = useRef<number>(toast.duration ?? 0);\n const closingRef = useRef(false);\n\n const palette = getPalette(toast.type);\n const styleVars: CSSProperties = {\n [\"--toast-bg\" as any]: palette.background,\n [\"--toast-border\" as any]: palette.border,\n [\"--toast-accent\" as any]: palette.accent,\n [\"--toast-text\" as any]: palette.text,\n [\"--toast-action-bg\" as any]: palette.actionBg,\n [\"--toast-action-border\" as any]: palette.actionBorder,\n };\n\n const stopTimer = () => {\n if (timerRef.current) {\n window.clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n };\n\n const triggerDismiss = useCallback(() => {\n if (closingRef.current) return;\n closingRef.current = true;\n setOpen(false);\n stopTimer();\n window.setTimeout(() => onDismiss(toast.id), 160);\n }, [onDismiss, toast.id]);\n\n const schedule = useCallback(\n (delay: number) => {\n if (!delay || delay <= 0) {\n triggerDismiss();\n return;\n }\n startRef.current = performance.now();\n stopTimer();\n timerRef.current = window.setTimeout(() => triggerDismiss(), delay);\n },\n [triggerDismiss],\n );\n\n useEffect(() => {\n if (!toast.duration || toast.duration <= 0) return undefined;\n schedule(toast.duration);\n return stopTimer;\n }, [schedule, toast.duration]);\n\n useEffect(() => {\n if (!toast.duration || toast.duration <= 0) return;\n if (isPaused) {\n const elapsed = performance.now() - startRef.current;\n remainingRef.current = Math.max(0, remainingRef.current - elapsed);\n stopTimer();\n } else {\n schedule(remainingRef.current);\n }\n }, [isPaused, schedule, toast.duration]);\n\n useEffect(() => {\n return () => {\n if (copyTimerRef.current) window.clearTimeout(copyTimerRef.current);\n };\n }, []);\n\n const handleCopy = useCallback(async () => {\n if (copyTimerRef.current) window.clearTimeout(copyTimerRef.current);\n try {\n if (!navigator.clipboard) throw new Error(\"Clipboard API unavailable\");\n await navigator.clipboard.writeText(toast.message);\n setCopyState(\"copied\");\n } catch {\n setCopyState(\"failed\");\n }\n copyTimerRef.current = window.setTimeout(() => setCopyState(\"idle\"), 1800);\n }, [toast.message]);\n\n const icon = getIcon(toast.type);\n\n return (\n <ToastPrimitive.Root\n open={open}\n onOpenChange={(nextOpen: boolean) => {\n if (!nextOpen) triggerDismiss();\n }}\n duration={2147483647}\n className={styles.toast}\n style={styleVars}\n >\n <span className={styles.icon} aria-hidden>\n {icon}\n </span>\n <div className={styles.body}>\n <ToastPrimitive.Description className={styles.message}>\n {toast.message}\n </ToastPrimitive.Description>\n {toast.action && (\n <div className={styles.actions}>\n <ToastPrimitive.Action asChild altText={toast.action.label}>\n <button\n type=\"button\"\n className={styles.actionButton}\n onClick={() => {\n toast.action?.onClick();\n triggerDismiss();\n }}\n >\n {toast.action.label}\n </button>\n </ToastPrimitive.Action>\n </div>\n )}\n </div>\n <div className={styles.controls}>\n {toast.copyable && (\n <button\n type=\"button\"\n className={cx(styles.iconButton, copyState === \"failed\" && styles.iconButtonError)}\n aria-label=\"Copy message\"\n onClick={handleCopy}\n >\n {copyState === \"copied\" ? (\n <svg width=\"13\" height=\"13\" viewBox=\"0 0 13 13\" fill=\"none\" aria-hidden>\n <path d=\"M2 6.5l3 3 6-6\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n ) : copyState === \"failed\" ? (\n <svg width=\"13\" height=\"13\" viewBox=\"0 0 13 13\" fill=\"none\" aria-hidden>\n <path d=\"M10 3L3 10M3 3l7 7\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n ) : (\n <svg width=\"13\" height=\"13\" viewBox=\"0 0 13 13\" fill=\"none\" aria-hidden>\n <rect x=\"4.5\" y=\"1.5\" width=\"7\" height=\"7\" rx=\"1.5\" stroke=\"currentColor\" strokeWidth=\"1.25\" />\n <path d=\"M1.5 5.5v5a1.5 1.5 0 001.5 1.5h5\" stroke=\"currentColor\" strokeWidth=\"1.25\" strokeLinecap=\"round\" />\n </svg>\n )}\n </button>\n )}\n {toast.dismissible !== false && (\n <ToastPrimitive.Close asChild>\n <button\n type=\"button\"\n className={styles.iconButton}\n aria-label=\"Dismiss notification\"\n >\n <svg width=\"13\" height=\"13\" viewBox=\"0 0 13 13\" fill=\"none\" aria-hidden>\n <path d=\"M10 3L3 10M3 3l7 7\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n </button>\n </ToastPrimitive.Close>\n )}\n </div>\n </ToastPrimitive.Root>\n );\n}\n\nfunction getPalette(type: ToastType) {\n switch (type) {\n case \"success\":\n return {\n background: \"color-mix(in srgb, var(--success) 12%, var(--popover))\",\n border: \"color-mix(in srgb, var(--success) 30%, transparent)\",\n accent: \"var(--success)\",\n text: \"var(--popover-foreground)\",\n actionBg: \"color-mix(in srgb, var(--success) 14%, transparent)\",\n actionBorder: \"color-mix(in srgb, var(--success) 35%, transparent)\",\n };\n case \"error\":\n return {\n background: \"color-mix(in srgb, var(--destructive) 12%, var(--popover))\",\n border: \"color-mix(in srgb, var(--destructive) 30%, transparent)\",\n accent: \"var(--destructive)\",\n text: \"var(--popover-foreground)\",\n actionBg: \"color-mix(in srgb, var(--destructive) 14%, transparent)\",\n actionBorder: \"color-mix(in srgb, var(--destructive) 35%, transparent)\",\n };\n case \"warning\":\n return {\n background: \"color-mix(in srgb, var(--warning) 12%, var(--popover))\",\n border: \"color-mix(in srgb, var(--warning) 30%, transparent)\",\n accent: \"var(--warning)\",\n text: \"var(--popover-foreground)\",\n actionBg: \"color-mix(in srgb, var(--warning) 14%, transparent)\",\n actionBorder: \"color-mix(in srgb, var(--warning) 35%, transparent)\",\n };\n case \"info\":\n default:\n return {\n background: \"color-mix(in srgb, var(--primary) 12%, var(--popover))\",\n border: \"color-mix(in srgb, var(--primary) 30%, transparent)\",\n accent: \"var(--primary)\",\n text: \"var(--popover-foreground)\",\n actionBg: \"color-mix(in srgb, var(--primary) 14%, transparent)\",\n actionBorder: \"color-mix(in srgb, var(--primary) 35%, transparent)\",\n };\n }\n}\n\nfunction getIcon(type: ToastType) {\n switch (type) {\n case \"success\":\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden>\n <path d=\"M3 8l3.5 3.5L13 4.5\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n case \"error\":\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden>\n <path d=\"M4 4l8 8M12 4l-8 8\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" />\n </svg>\n );\n case \"warning\":\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden>\n <path d=\"M8 3v6M8 11.5v1\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" />\n </svg>\n );\n case \"info\":\n default:\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden>\n <path d=\"M8 7v5M8 4.5v.5\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" />\n </svg>\n );\n }\n}\n"],"mappings":";;;;;;;;;;AA0BA,IAAM,iBAAwC;CAC5C,UAAU;CACV,WAAW;CACX,iBAAiB;CACjB,cAAc;CACd,kBAAkB;AACpB;AAEA,IAAM,gBAAA,GAAA,MAAA,cAAA,CAA4D,KAAA,CAAS;AAE3E,IAAI,iBAAiB;AACrB,IAAM,wBAAwB,SAAS,EAAE,eAAe,GAAG,KAAK,IAAI;;;;;;;;;;;AAYpE,SAAgB,cAAc,EAC5B,UACA,UAIC;CACD,MAAM,CAAC,QAAQ,cAAA,GAAA,MAAA,SAAA,CAA+B,CAAC,CAAC;CAChD,MAAM,CAAC,UAAU,gBAAA,GAAA,MAAA,SAAA,CAAwB,KAAK;CAC9C,MAAM,UAAA,GAAA,MAAA,QAAA,QAAwB;EAAE,GAAG;EAAgB,GAAG;CAAO,IAAI,CAAC,MAAM,CAAC;CAEzE,MAAM,QAAA,GAAA,MAAA,YAAA,EACH,SAAiB,UAAwB,CAAC,MAAM;EAC/C,MAAM,KAAK,gBAAgB;EAC3B,WAAW,SAAS;GAClB,MAAM,OAAgB,CACpB,GAAG,MACH;IACE;IACA;IACA,MAAM,QAAQ,QAAQ;IACtB,UAAU,QAAQ,aAAa,QAAQ,SAAS,UAAU,MAAO,OAAO;IACxE,aAAa,QAAQ,eAAe;IACpC,UAAU,QAAQ,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AQ,MAAR;EACE,KAAK,WACH,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,OAAM;GAAK,QAAO;GAAK,SAAQ;GAAY,MAAK;GAAO,eAAA;aAC1D,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,GAAE;IAAsB,QAAO;IAAe,aAAY;IAAO,eAAc;IAAQ,gBAAe;GAAS,CAAA;EAClH,CAAA;EAET,KAAK,SACH,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,OAAM;GAAK,QAAO;GAAK,SAAQ;GAAY,MAAK;GAAO,eAAA;aAC1D,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,GAAE;IAAqB,QAAO;IAAe,aAAY;IAAO,eAAc;GAAS,CAAA;EAC1F,CAAA;EAET,KAAK,WACH,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,OAAM;GAAK,QAAO;GAAK,SAAQ;GAAY,MAAK;GAAO,eAAA;aAC1D,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,GAAE;IAAkB,QAAO;IAAe,aAAY;IAAO,eAAc;GAAS,CAAA;EACvF,CAAA;EAGT,SACE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,OAAM;GAAK,QAAO;GAAK,SAAQ;GAAY,MAAK;GAAO,eAAA;aAC1D,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,GAAE;IAAkB,QAAO;IAAe,aAAY;IAAO,eAAc;GAAS,CAAA;EACvF,CAAA;CAEX;AACF"}
|
package/dist/index18.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index18.js","names":[],"sources":["../src/components/input/input.module.css"],"sourcesContent":[".input {\n display: flex;\n width: 100%;\n min-height: 2.25rem;\n border-radius: 0.5rem;\n border: 1px solid var(--ts-input-border, var(--input));\n background: var(--ts-input-bg, var(--background));\n color: var(--ts-input-fg, var(--foreground));\n padding: 0.25rem 0.75rem;\n font-size: 0.875rem;\n line-height: 1.25rem;\n box-shadow: var(--ts-input-shadow, 0 1px 2px rgba(0, 0, 0, 0.04));\n transition: border-color 0.15s ease, background 0.15s ease;\n}\n\n.input::placeholder {\n color: var(--ts-input-placeholder, var(--muted-foreground));\n}\n\n.input:focus-visible {\n outline: var(--focus-ring);\n outline-offset: var(--focus-ring-offset);\n}\n\n.input:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n"],"mappings":""}
|
package/dist/index19.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index19.cjs","names":[],"sources":["../src/components/input/input.module.css"],"sourcesContent":[".input {\n display: flex;\n width: 100%;\n min-height: 2.25rem;\n border-radius: 0.5rem;\n border: 1px solid var(--ts-input-border, var(--input));\n background: var(--ts-input-bg, var(--background));\n color: var(--ts-input-fg, var(--foreground));\n padding: 0.25rem 0.75rem;\n font-size: 0.875rem;\n line-height: 1.25rem;\n box-shadow: var(--ts-input-shadow, 0 1px 2px rgba(0, 0, 0, 0.04));\n transition: border-color 0.15s ease, background 0.15s ease;\n}\n\n.input::placeholder {\n color: var(--ts-input-placeholder, var(--muted-foreground));\n}\n\n.input:focus-visible {\n outline: var(--focus-ring);\n outline-offset: var(--focus-ring-offset);\n}\n\n.input:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n"],"mappings":""}
|
package/dist/index19.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cx } from "./index3.js";
|
|
2
|
+
import input_module_default from "./index18.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/input/Input.tsx
|
|
6
|
+
var Input = React.forwardRef(({ className, type, ...props }, ref) => {
|
|
7
|
+
return /* @__PURE__ */ jsx("input", {
|
|
8
|
+
ref,
|
|
9
|
+
type,
|
|
10
|
+
className: cx(input_module_default.input, className),
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
Input.displayName = "Input";
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Input };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index19.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index19.js","names":[],"sources":["../src/components/input/Input.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport styles from \"./input.module.css\";\n\nexport type InputProps = React.InputHTMLAttributes<HTMLInputElement>;\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n ref={ref}\n type={type}\n className={cx(styles.input, className)}\n {...props}\n />\n );\n },\n);\n\nInput.displayName = \"Input\";\n"],"mappings":";;;;;AAMA,IAAa,QAAQ,MAAM,YACxB,EAAE,WAAW,MAAM,GAAG,SAAS,QAAQ;CACtC,OACE,oBAAC,SAAD;EACO;EACC;EACN,WAAW,GAAG,qBAAO,OAAO,SAAS;EACrC,GAAI;CACL,CAAA;AAEL,CACF;AAEA,MAAM,cAAc"}
|
package/dist/index2.cjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.__toESM = __toESM;
|
package/dist/index20.cjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const require_runtime = require("./index2.cjs");
|
|
2
|
+
const require_cx = require("./index4.cjs");
|
|
3
|
+
const require_input_module = require("./index19.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_runtime.__toESM(react, 1);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
//#region src/components/input/Input.tsx
|
|
8
|
+
var Input = react.forwardRef(({ className, type, ...props }, ref) => {
|
|
9
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10
|
+
ref,
|
|
11
|
+
type,
|
|
12
|
+
className: require_cx.cx(require_input_module.default.input, className),
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
Input.displayName = "Input";
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.Input = Input;
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=index20.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index20.cjs","names":[],"sources":["../src/components/input/Input.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport styles from \"./input.module.css\";\n\nexport type InputProps = React.InputHTMLAttributes<HTMLInputElement>;\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n ref={ref}\n type={type}\n className={cx(styles.input, className)}\n {...props}\n />\n );\n },\n);\n\nInput.displayName = \"Input\";\n"],"mappings":";;;;;;;AAMA,IAAa,QAAQ,MAAM,YACxB,EAAE,WAAW,MAAM,GAAG,SAAS,QAAQ;CACtC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;EACO;EACC;EACN,WAAW,WAAA,GAAG,qBAAA,QAAO,OAAO,SAAS;EACrC,GAAI;CACL,CAAA;AAEL,CACF;AAEA,MAAM,cAAc"}
|
package/dist/index20.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index20.js","names":[],"sources":["../src/components/label/label.module.css"],"sourcesContent":[".label {\n font-size: 0.875rem;\n font-weight: 500;\n line-height: 1.2;\n color: var(--ts-label-fg, inherit);\n}\n"],"mappings":""}
|
package/dist/index21.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index21.cjs","names":[],"sources":["../src/components/label/label.module.css"],"sourcesContent":[".label {\n font-size: 0.875rem;\n font-weight: 500;\n line-height: 1.2;\n color: var(--ts-label-fg, inherit);\n}\n"],"mappings":""}
|
package/dist/index21.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { cx } from "./index3.js";
|
|
2
|
+
import label_module_default from "./index20.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/label/Label.tsx
|
|
6
|
+
var Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("label", {
|
|
7
|
+
ref,
|
|
8
|
+
className: cx(label_module_default.label, className),
|
|
9
|
+
...props
|
|
10
|
+
}));
|
|
11
|
+
Label.displayName = "Label";
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Label };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index21.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index21.js","names":[],"sources":["../src/components/label/Label.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport styles from \"./label.module.css\";\n\nexport type LabelProps = React.LabelHTMLAttributes<HTMLLabelElement>;\n\nexport const Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, ...props }, ref) => (\n <label ref={ref} className={cx(styles.label, className)} {...props} />\n ),\n);\n\nLabel.displayName = \"Label\";\n"],"mappings":";;;;;AAMA,IAAa,QAAQ,MAAM,YACxB,EAAE,WAAW,GAAG,SAAS,QACxB,oBAAC,SAAD;CAAY;CAAK,WAAW,GAAG,qBAAO,OAAO,SAAS;CAAG,GAAI;AAAQ,CAAA,CAEzE;AAEA,MAAM,cAAc"}
|
package/dist/index22.cjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const require_runtime = require("./index2.cjs");
|
|
2
|
+
const require_cx = require("./index4.cjs");
|
|
3
|
+
const require_label_module = require("./index21.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_runtime.__toESM(react, 1);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
//#region src/components/label/Label.tsx
|
|
8
|
+
var Label = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
9
|
+
ref,
|
|
10
|
+
className: require_cx.cx(require_label_module.default.label, className),
|
|
11
|
+
...props
|
|
12
|
+
}));
|
|
13
|
+
Label.displayName = "Label";
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.Label = Label;
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=index22.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index22.cjs","names":[],"sources":["../src/components/label/Label.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport styles from \"./label.module.css\";\n\nexport type LabelProps = React.LabelHTMLAttributes<HTMLLabelElement>;\n\nexport const Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, ...props }, ref) => (\n <label ref={ref} className={cx(styles.label, className)} {...props} />\n ),\n);\n\nLabel.displayName = \"Label\";\n"],"mappings":";;;;;;;AAMA,IAAa,QAAQ,MAAM,YACxB,EAAE,WAAW,GAAG,SAAS,QACxB,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;CAAY;CAAK,WAAW,WAAA,GAAG,qBAAA,QAAO,OAAO,SAAS;CAAG,GAAI;AAAQ,CAAA,CAEzE;AAEA,MAAM,cAAc"}
|