@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.2.27 → 0.2.29
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/CHANGELOG.md +1 -1
- package/dist/components/ui/feedback/index.d.ts +4 -1
- package/dist/components/ui/feedback/index.d.ts.map +1 -1
- package/dist/components/ui/feedback/index.esm.js +4 -1
- package/dist/components/ui/feedback/index.js +4 -1
- package/dist/components/ui/feedback/toast-context.d.ts +27 -0
- package/dist/components/ui/feedback/toast-context.d.ts.map +1 -0
- package/dist/components/ui/feedback/toast-context.esm.js +95 -0
- package/dist/components/ui/feedback/toast-context.js +95 -0
- package/dist/components/ui/feedback/toast-example.d.ts +4 -0
- package/dist/components/ui/feedback/toast-example.d.ts.map +1 -0
- package/dist/components/ui/feedback/toast-example.esm.js +40 -0
- package/dist/components/ui/feedback/toast-example.js +40 -0
- package/dist/components/ui/feedback/toast-renderer.d.ts +11 -0
- package/dist/components/ui/feedback/toast-renderer.d.ts.map +1 -0
- package/dist/components/ui/feedback/toast-renderer.esm.js +23 -0
- package/dist/components/ui/feedback/toast-renderer.js +23 -0
- package/dist/components/ui/feedback/toast.d.ts.map +1 -1
- package/dist/components/ui/feedback/toast.esm.js +3 -3
- package/dist/components/ui/feedback/toast.js +3 -3
- package/dist/components/ui/feedback/types.d.ts +2 -3
- package/dist/components/ui/feedback/types.d.ts.map +1 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +22 -1
- package/dist/index.js +22 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/ui/feedback/index.ts +11 -1
- package/src/components/ui/feedback/toast-context.tsx +145 -0
- package/src/components/ui/feedback/toast-example.tsx +65 -0
- package/src/components/ui/feedback/toast-renderer.tsx +61 -0
- package/src/components/ui/feedback/toast.tsx +7 -5
- package/src/components/ui/feedback/types.ts +2 -3
- package/src/index.ts +22 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export { Alert } from './alert';
|
|
2
2
|
export { Progress } from './progress';
|
|
3
|
-
export { Toast } from './toast';
|
|
3
|
+
export { Toast, ToastContainer } from './toast';
|
|
4
4
|
export { Skeleton } from './skeleton';
|
|
5
|
+
export { ToastProvider, useToast, useToastHelpers } from './toast-context';
|
|
6
|
+
export { ToastRenderer, GlobalToastRenderer } from './toast-renderer';
|
|
5
7
|
export type { AlertProps, AlertAction, StatusAlertData, ToastProps, ToastAction, ToastContainerProps, ProgressProps, ProgressStep, SkeletonProps, SkeletonTextProps, SkeletonAvatarProps, SkeletonButtonProps, FeedbackBaseProps } from './types';
|
|
8
|
+
export type { ToastInstance, ToastContextValue, ToastProviderProps } from './toast-context';
|
|
6
9
|
export { statusAlertExamples } from './status-alert-example';
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/feedback/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/feedback/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGtE,YAAY,EACV,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// Feedback Components - Main Export
|
|
2
2
|
export { Alert } from './alert';
|
|
3
3
|
export { Progress } from './progress';
|
|
4
|
-
export { Toast } from './toast';
|
|
4
|
+
export { Toast, ToastContainer } from './toast';
|
|
5
5
|
export { Skeleton } from './skeleton';
|
|
6
|
+
// Toast Management
|
|
7
|
+
export { ToastProvider, useToast, useToastHelpers } from './toast-context';
|
|
8
|
+
export { ToastRenderer, GlobalToastRenderer } from './toast-renderer';
|
|
6
9
|
// Examples
|
|
7
10
|
export { statusAlertExamples } from './status-alert-example';
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// Feedback Components - Main Export
|
|
2
2
|
export { Alert } from './alert';
|
|
3
3
|
export { Progress } from './progress';
|
|
4
|
-
export { Toast } from './toast';
|
|
4
|
+
export { Toast, ToastContainer } from './toast';
|
|
5
5
|
export { Skeleton } from './skeleton';
|
|
6
|
+
// Toast Management
|
|
7
|
+
export { ToastProvider, useToast, useToastHelpers } from './toast-context';
|
|
8
|
+
export { ToastRenderer, GlobalToastRenderer } from './toast-renderer';
|
|
6
9
|
// Examples
|
|
7
10
|
export { statusAlertExamples } from './status-alert-example';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ToastProps } from './types.js';
|
|
3
|
+
export interface ToastInstance extends Omit<ToastProps, 'id'> {
|
|
4
|
+
id: string;
|
|
5
|
+
createdAt: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ToastContextValue {
|
|
8
|
+
toasts: ToastInstance[];
|
|
9
|
+
addToast: (toast: Omit<ToastInstance, 'id' | 'createdAt'>) => string;
|
|
10
|
+
removeToast: (id: string) => void;
|
|
11
|
+
clearAllToasts: () => void;
|
|
12
|
+
}
|
|
13
|
+
export interface ToastProviderProps {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
maxToasts?: number;
|
|
16
|
+
defaultDuration?: number;
|
|
17
|
+
defaultPosition?: ToastProps['position'];
|
|
18
|
+
}
|
|
19
|
+
export declare const ToastProvider: React.FC<ToastProviderProps>;
|
|
20
|
+
export declare const useToast: () => ToastContextValue;
|
|
21
|
+
export declare const useToastHelpers: () => {
|
|
22
|
+
showSuccess: (message: string, title?: string, options?: Partial<ToastInstance>) => string;
|
|
23
|
+
showError: (message: string, title?: string, options?: Partial<ToastInstance>) => string;
|
|
24
|
+
showWarning: (message: string, title?: string, options?: Partial<ToastInstance>) => string;
|
|
25
|
+
showInfo: (message: string, title?: string, options?: Partial<ToastInstance>) => string;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=toast-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast-context.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/feedback/toast-context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,CAAC,KAAK,MAAM,CAAC;IACrE,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAID,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;CAC1C;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAkFtD,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,iBAM3B,CAAC;AAEF,eAAO,MAAM,eAAe;2BAGgB,MAAM,UAAU,MAAM,YAAY,OAAO,CAAC,aAAa,CAAC;yBAI1D,MAAM,UAAU,MAAM,YAAY,OAAO,CAAC,aAAa,CAAC;2BAItD,MAAM,UAAU,MAAM,YAAY,OAAO,CAAC,aAAa,CAAC;wBAI3D,MAAM,UAAU,MAAM,YAAY,OAAO,CAAC,aAAa,CAAC;CAUhG,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext, useState, useCallback, useRef } from 'react';
|
|
4
|
+
;
|
|
5
|
+
const ToastContext = createContext(undefined);
|
|
6
|
+
export const ToastProvider = ({ children, maxToasts = 5, defaultDuration = 5000, defaultPosition = 'top-right' }) => {
|
|
7
|
+
const [toasts, setToasts] = useState([]);
|
|
8
|
+
const timeoutRefs = useRef(new Map());
|
|
9
|
+
const removeToast = useCallback((id) => {
|
|
10
|
+
setToasts(prev => prev.filter(toast => toast.id !== id));
|
|
11
|
+
const timeoutId = timeoutRefs.current.get(id);
|
|
12
|
+
if (timeoutId) {
|
|
13
|
+
clearTimeout(timeoutId);
|
|
14
|
+
timeoutRefs.current.delete(id);
|
|
15
|
+
}
|
|
16
|
+
}, []);
|
|
17
|
+
const addToast = useCallback((toastData) => {
|
|
18
|
+
const id = `toast-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
19
|
+
const toast = {
|
|
20
|
+
...toastData,
|
|
21
|
+
id,
|
|
22
|
+
createdAt: Date.now(),
|
|
23
|
+
duration: toastData.duration ?? defaultDuration,
|
|
24
|
+
position: toastData.position ?? defaultPosition,
|
|
25
|
+
autoClose: toastData.autoClose ?? true,
|
|
26
|
+
pauseOnHover: toastData.pauseOnHover ?? true,
|
|
27
|
+
closable: toastData.closable ?? true,
|
|
28
|
+
showIcon: toastData.showIcon ?? true,
|
|
29
|
+
size: toastData.size ?? 'md',
|
|
30
|
+
variant: toastData.variant ?? 'default'
|
|
31
|
+
};
|
|
32
|
+
setToasts(prev => {
|
|
33
|
+
const newToasts = [toast, ...prev];
|
|
34
|
+
if (newToasts.length > maxToasts) {
|
|
35
|
+
const toastsToRemove = newToasts.slice(maxToasts);
|
|
36
|
+
toastsToRemove.forEach(t => {
|
|
37
|
+
const timeoutId = timeoutRefs.current.get(t.id);
|
|
38
|
+
if (timeoutId) {
|
|
39
|
+
clearTimeout(timeoutId);
|
|
40
|
+
timeoutRefs.current.delete(t.id);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return newToasts.slice(0, maxToasts);
|
|
44
|
+
}
|
|
45
|
+
return newToasts;
|
|
46
|
+
});
|
|
47
|
+
if (toast.autoClose && toast.duration && toast.duration > 0) {
|
|
48
|
+
const timeoutId = setTimeout(() => {
|
|
49
|
+
removeToast(id);
|
|
50
|
+
}, toast.duration);
|
|
51
|
+
timeoutRefs.current.set(id, timeoutId);
|
|
52
|
+
}
|
|
53
|
+
return id;
|
|
54
|
+
}, [defaultDuration, defaultPosition, maxToasts, removeToast]);
|
|
55
|
+
const clearAllToasts = useCallback(() => {
|
|
56
|
+
timeoutRefs.current.forEach(timeoutId => clearTimeout(timeoutId));
|
|
57
|
+
timeoutRefs.current.clear();
|
|
58
|
+
setToasts([]);
|
|
59
|
+
}, []);
|
|
60
|
+
const contextValue = {
|
|
61
|
+
toasts,
|
|
62
|
+
addToast,
|
|
63
|
+
removeToast,
|
|
64
|
+
clearAllToasts
|
|
65
|
+
};
|
|
66
|
+
return (_jsx(ToastContext.Provider, { value: contextValue, children: children }));
|
|
67
|
+
};
|
|
68
|
+
export const useToast = () => {
|
|
69
|
+
const context = useContext(ToastContext);
|
|
70
|
+
if (!context) {
|
|
71
|
+
throw new Error('useToast must be used within a ToastProvider');
|
|
72
|
+
}
|
|
73
|
+
return context;
|
|
74
|
+
};
|
|
75
|
+
export const useToastHelpers = () => {
|
|
76
|
+
const { addToast } = useToast();
|
|
77
|
+
const showSuccess = useCallback((message, title, options) => {
|
|
78
|
+
return addToast({ type: 'success', message, title, ...options });
|
|
79
|
+
}, [addToast]);
|
|
80
|
+
const showError = useCallback((message, title, options) => {
|
|
81
|
+
return addToast({ type: 'error', message, title, ...options });
|
|
82
|
+
}, [addToast]);
|
|
83
|
+
const showWarning = useCallback((message, title, options) => {
|
|
84
|
+
return addToast({ type: 'warning', message, title, ...options });
|
|
85
|
+
}, [addToast]);
|
|
86
|
+
const showInfo = useCallback((message, title, options) => {
|
|
87
|
+
return addToast({ type: 'info', message, title, ...options });
|
|
88
|
+
}, [addToast]);
|
|
89
|
+
return {
|
|
90
|
+
showSuccess,
|
|
91
|
+
showError,
|
|
92
|
+
showWarning,
|
|
93
|
+
showInfo
|
|
94
|
+
};
|
|
95
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext, useState, useCallback, useRef } from 'react';
|
|
4
|
+
;
|
|
5
|
+
const ToastContext = createContext(undefined);
|
|
6
|
+
export const ToastProvider = ({ children, maxToasts = 5, defaultDuration = 5000, defaultPosition = 'top-right' }) => {
|
|
7
|
+
const [toasts, setToasts] = useState([]);
|
|
8
|
+
const timeoutRefs = useRef(new Map());
|
|
9
|
+
const removeToast = useCallback((id) => {
|
|
10
|
+
setToasts(prev => prev.filter(toast => toast.id !== id));
|
|
11
|
+
const timeoutId = timeoutRefs.current.get(id);
|
|
12
|
+
if (timeoutId) {
|
|
13
|
+
clearTimeout(timeoutId);
|
|
14
|
+
timeoutRefs.current.delete(id);
|
|
15
|
+
}
|
|
16
|
+
}, []);
|
|
17
|
+
const addToast = useCallback((toastData) => {
|
|
18
|
+
const id = `toast-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
19
|
+
const toast = {
|
|
20
|
+
...toastData,
|
|
21
|
+
id,
|
|
22
|
+
createdAt: Date.now(),
|
|
23
|
+
duration: toastData.duration ?? defaultDuration,
|
|
24
|
+
position: toastData.position ?? defaultPosition,
|
|
25
|
+
autoClose: toastData.autoClose ?? true,
|
|
26
|
+
pauseOnHover: toastData.pauseOnHover ?? true,
|
|
27
|
+
closable: toastData.closable ?? true,
|
|
28
|
+
showIcon: toastData.showIcon ?? true,
|
|
29
|
+
size: toastData.size ?? 'md',
|
|
30
|
+
variant: toastData.variant ?? 'default'
|
|
31
|
+
};
|
|
32
|
+
setToasts(prev => {
|
|
33
|
+
const newToasts = [toast, ...prev];
|
|
34
|
+
if (newToasts.length > maxToasts) {
|
|
35
|
+
const toastsToRemove = newToasts.slice(maxToasts);
|
|
36
|
+
toastsToRemove.forEach(t => {
|
|
37
|
+
const timeoutId = timeoutRefs.current.get(t.id);
|
|
38
|
+
if (timeoutId) {
|
|
39
|
+
clearTimeout(timeoutId);
|
|
40
|
+
timeoutRefs.current.delete(t.id);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return newToasts.slice(0, maxToasts);
|
|
44
|
+
}
|
|
45
|
+
return newToasts;
|
|
46
|
+
});
|
|
47
|
+
if (toast.autoClose && toast.duration && toast.duration > 0) {
|
|
48
|
+
const timeoutId = setTimeout(() => {
|
|
49
|
+
removeToast(id);
|
|
50
|
+
}, toast.duration);
|
|
51
|
+
timeoutRefs.current.set(id, timeoutId);
|
|
52
|
+
}
|
|
53
|
+
return id;
|
|
54
|
+
}, [defaultDuration, defaultPosition, maxToasts, removeToast]);
|
|
55
|
+
const clearAllToasts = useCallback(() => {
|
|
56
|
+
timeoutRefs.current.forEach(timeoutId => clearTimeout(timeoutId));
|
|
57
|
+
timeoutRefs.current.clear();
|
|
58
|
+
setToasts([]);
|
|
59
|
+
}, []);
|
|
60
|
+
const contextValue = {
|
|
61
|
+
toasts,
|
|
62
|
+
addToast,
|
|
63
|
+
removeToast,
|
|
64
|
+
clearAllToasts
|
|
65
|
+
};
|
|
66
|
+
return (_jsx(ToastContext.Provider, { value: contextValue, children: children }));
|
|
67
|
+
};
|
|
68
|
+
export const useToast = () => {
|
|
69
|
+
const context = useContext(ToastContext);
|
|
70
|
+
if (!context) {
|
|
71
|
+
throw new Error('useToast must be used within a ToastProvider');
|
|
72
|
+
}
|
|
73
|
+
return context;
|
|
74
|
+
};
|
|
75
|
+
export const useToastHelpers = () => {
|
|
76
|
+
const { addToast } = useToast();
|
|
77
|
+
const showSuccess = useCallback((message, title, options) => {
|
|
78
|
+
return addToast({ type: 'success', message, title, ...options });
|
|
79
|
+
}, [addToast]);
|
|
80
|
+
const showError = useCallback((message, title, options) => {
|
|
81
|
+
return addToast({ type: 'error', message, title, ...options });
|
|
82
|
+
}, [addToast]);
|
|
83
|
+
const showWarning = useCallback((message, title, options) => {
|
|
84
|
+
return addToast({ type: 'warning', message, title, ...options });
|
|
85
|
+
}, [addToast]);
|
|
86
|
+
const showInfo = useCallback((message, title, options) => {
|
|
87
|
+
return addToast({ type: 'info', message, title, ...options });
|
|
88
|
+
}, [addToast]);
|
|
89
|
+
return {
|
|
90
|
+
showSuccess,
|
|
91
|
+
showError,
|
|
92
|
+
showWarning,
|
|
93
|
+
showInfo
|
|
94
|
+
};
|
|
95
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast-example.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/feedback/toast-example.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqD/B,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAOhC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
;
|
|
4
|
+
import { ToastProvider, useToastHelpers, GlobalToastRenderer } from './index.js';
|
|
5
|
+
const ToastDemo = () => {
|
|
6
|
+
const { showSuccess, showError, showWarning, showInfo } = useToastHelpers();
|
|
7
|
+
const handleSuccess = () => {
|
|
8
|
+
showSuccess('Operation completed successfully!', 'Success');
|
|
9
|
+
};
|
|
10
|
+
const handleError = () => {
|
|
11
|
+
showError('Something went wrong. Please try again.', 'Error');
|
|
12
|
+
};
|
|
13
|
+
const handleWarning = () => {
|
|
14
|
+
showWarning('This action cannot be undone.', 'Warning');
|
|
15
|
+
};
|
|
16
|
+
const handleInfo = () => {
|
|
17
|
+
showInfo('New update available.', 'Information');
|
|
18
|
+
};
|
|
19
|
+
const handleCustomAction = () => {
|
|
20
|
+
showSuccess('File uploaded successfully!', 'Upload Complete', {
|
|
21
|
+
actions: [
|
|
22
|
+
{
|
|
23
|
+
label: 'View File',
|
|
24
|
+
onClick: () => console.log('View file clicked'),
|
|
25
|
+
variant: 'primary'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: 'Share',
|
|
29
|
+
onClick: () => console.log('Share clicked'),
|
|
30
|
+
variant: 'secondary'
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
return (_jsxs("div", { style: { padding: '20px' }, children: [_jsx("h2", { children: "Toast Component Test" }), _jsxs("div", { style: { display: 'flex', gap: '10px', flexWrap: 'wrap' }, children: [_jsx("button", { onClick: handleSuccess, children: "Show Success" }), _jsx("button", { onClick: handleError, children: "Show Error" }), _jsx("button", { onClick: handleWarning, children: "Show Warning" }), _jsx("button", { onClick: handleInfo, children: "Show Info" }), _jsx("button", { onClick: handleCustomAction, children: "Show With Actions" })] })] }));
|
|
36
|
+
};
|
|
37
|
+
export const ToastExample = () => {
|
|
38
|
+
return (_jsxs(ToastProvider, { maxToasts: 5, defaultDuration: 5000, children: [_jsx(ToastDemo, {}), _jsx(GlobalToastRenderer, {})] }));
|
|
39
|
+
};
|
|
40
|
+
export default ToastExample;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
;
|
|
4
|
+
import { ToastProvider, useToastHelpers, GlobalToastRenderer } from './index.js';
|
|
5
|
+
const ToastDemo = () => {
|
|
6
|
+
const { showSuccess, showError, showWarning, showInfo } = useToastHelpers();
|
|
7
|
+
const handleSuccess = () => {
|
|
8
|
+
showSuccess('Operation completed successfully!', 'Success');
|
|
9
|
+
};
|
|
10
|
+
const handleError = () => {
|
|
11
|
+
showError('Something went wrong. Please try again.', 'Error');
|
|
12
|
+
};
|
|
13
|
+
const handleWarning = () => {
|
|
14
|
+
showWarning('This action cannot be undone.', 'Warning');
|
|
15
|
+
};
|
|
16
|
+
const handleInfo = () => {
|
|
17
|
+
showInfo('New update available.', 'Information');
|
|
18
|
+
};
|
|
19
|
+
const handleCustomAction = () => {
|
|
20
|
+
showSuccess('File uploaded successfully!', 'Upload Complete', {
|
|
21
|
+
actions: [
|
|
22
|
+
{
|
|
23
|
+
label: 'View File',
|
|
24
|
+
onClick: () => console.log('View file clicked'),
|
|
25
|
+
variant: 'primary'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: 'Share',
|
|
29
|
+
onClick: () => console.log('Share clicked'),
|
|
30
|
+
variant: 'secondary'
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
return (_jsxs("div", { style: { padding: '20px' }, children: [_jsx("h2", { children: "Toast Component Test" }), _jsxs("div", { style: { display: 'flex', gap: '10px', flexWrap: 'wrap' }, children: [_jsx("button", { onClick: handleSuccess, children: "Show Success" }), _jsx("button", { onClick: handleError, children: "Show Error" }), _jsx("button", { onClick: handleWarning, children: "Show Warning" }), _jsx("button", { onClick: handleInfo, children: "Show Info" }), _jsx("button", { onClick: handleCustomAction, children: "Show With Actions" })] })] }));
|
|
36
|
+
};
|
|
37
|
+
export const ToastExample = () => {
|
|
38
|
+
return (_jsxs(ToastProvider, { maxToasts: 5, defaultDuration: 5000, children: [_jsx(ToastDemo, {}), _jsx(GlobalToastRenderer, {})] }));
|
|
39
|
+
};
|
|
40
|
+
export default ToastExample;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ToastProps } from './types.js';
|
|
3
|
+
export interface ToastRendererProps {
|
|
4
|
+
position?: ToastProps['position'];
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const ToastRenderer: React.FC<ToastRendererProps>;
|
|
8
|
+
export declare const GlobalToastRenderer: React.FC<{
|
|
9
|
+
className?: string;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=toast-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast-renderer.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/feedback/toast-renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAyBtD,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAuBhE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
;
|
|
3
|
+
import { Toast, ToastContainer } from './toast.js';
|
|
4
|
+
import { useToast } from './toast-context.js';
|
|
5
|
+
export const ToastRenderer = ({ position = 'top-right', className = '' }) => {
|
|
6
|
+
const { toasts, removeToast } = useToast();
|
|
7
|
+
const positionToasts = toasts.filter(toast => (toast.position || 'top-right') === position);
|
|
8
|
+
if (positionToasts.length === 0) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return (_jsx(ToastContainer, { position: position, className: className, children: positionToasts.map((toast) => (_jsx(Toast, { ...toast, onClose: () => removeToast(toast.id) }, toast.id))) }));
|
|
12
|
+
};
|
|
13
|
+
export const GlobalToastRenderer = ({ className = '' }) => {
|
|
14
|
+
const positions = [
|
|
15
|
+
'top-left',
|
|
16
|
+
'top-center',
|
|
17
|
+
'top-right',
|
|
18
|
+
'bottom-left',
|
|
19
|
+
'bottom-center',
|
|
20
|
+
'bottom-right'
|
|
21
|
+
];
|
|
22
|
+
return (_jsx(_Fragment, { children: positions.map(position => (_jsx(ToastRenderer, { position: position, className: className }, position))) }));
|
|
23
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
;
|
|
3
|
+
import { Toast, ToastContainer } from './toast.js';
|
|
4
|
+
import { useToast } from './toast-context.js';
|
|
5
|
+
export const ToastRenderer = ({ position = 'top-right', className = '' }) => {
|
|
6
|
+
const { toasts, removeToast } = useToast();
|
|
7
|
+
const positionToasts = toasts.filter(toast => (toast.position || 'top-right') === position);
|
|
8
|
+
if (positionToasts.length === 0) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return (_jsx(ToastContainer, { position: position, className: className, children: positionToasts.map((toast) => (_jsx(Toast, { ...toast, onClose: () => removeToast(toast.id) }, toast.id))) }));
|
|
12
|
+
};
|
|
13
|
+
export const GlobalToastRenderer = ({ className = '' }) => {
|
|
14
|
+
const positions = [
|
|
15
|
+
'top-left',
|
|
16
|
+
'top-center',
|
|
17
|
+
'top-right',
|
|
18
|
+
'bottom-left',
|
|
19
|
+
'bottom-center',
|
|
20
|
+
'bottom-right'
|
|
21
|
+
];
|
|
22
|
+
return (_jsx(_Fragment, { children: positions.map(position => (_jsx(ToastRenderer, { position: position, className: className }, position))) }));
|
|
23
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/feedback/toast.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAe,mBAAmB,EAAE,MAAM,YAAY,CAAC;AA8G1E,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/feedback/toast.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAe,mBAAmB,EAAE,MAAM,YAAY,CAAC;AA8G1E,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAyJtC,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAYxF,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -66,8 +66,8 @@ const getToastColors = (type: ToastProps['type'], colors: any) => {
|
|
|
66
66
|
};
|
|
67
67
|
*/
|
|
68
68
|
// Toast Action Button Component
|
|
69
|
-
const ToastActionButton = ({ label,
|
|
70
|
-
return (_jsx("button", { type: "button", className: `toast__action-button toast__action-button--${variant}`, onClick:
|
|
69
|
+
const ToastActionButton = ({ label, onClick, variant = 'primary' }) => {
|
|
70
|
+
return (_jsx("button", { type: "button", className: `toast__action-button toast__action-button--${variant}`, onClick: onClick, children: label }));
|
|
71
71
|
};
|
|
72
72
|
// Individual Toast Component
|
|
73
73
|
export const Toast = ({ title, message, type = 'default', duration = 5000, onClose, actions = [], icon, showIcon = true, closable = true, autoClose = true, pauseOnHover = true, progress = false, size = 'md', variant = 'default', className = '', }) => {
|
|
@@ -134,7 +134,7 @@ export const Toast = ({ title, message, type = 'default', duration = 5000, onClo
|
|
|
134
134
|
return null;
|
|
135
135
|
}
|
|
136
136
|
const shouldShowIcon = showIcon && (icon || type);
|
|
137
|
-
return (_jsxs("div", { className: `toast__container toast__container--${size} toast__container--${variant} toast__container--${type} ${className}`, role: "alert", "aria-live": "polite", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [progress && (_jsx("div", { className: "toast__progress", children: _jsx("div", { className: `toast__progress-bar toast__progress-bar--${type}`, style: { width: `${progressValue}%` } }) })), shouldShowIcon && (_jsx("div", { className: `toast__icon toast__icon--${type}`, children: icon || getToastIcon(type, 'toast__icon') })), _jsxs("div", { className: "toast__content", children: [title && (_jsx("h3", { className: "toast__title", children: title })), _jsx("div", { className: `toast__message ${!title ? 'toast__message--only' : ''}`, children: message }), actions.length > 0 && (_jsx("div", { className: "toast__actions", children: actions.map((action, index) => (_jsx(ToastActionButton, { ...action }, index))) }))] }), closable && (_jsx("button", { type: "button", className: "toast__close-button", onClick: handleClose, "aria-label": "Close toast", children: _jsx(XMarkIcon, { className: "toast__close-icon" }) }))] }));
|
|
137
|
+
return (_jsxs("div", { className: `toast__container toast__container--${size} toast__container--${variant} toast__container--${type} ${className}`, role: "alert", "aria-live": "polite", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [progress && (_jsx("div", { className: "toast__progress", children: _jsx("div", { className: `toast__progress-bar toast__progress-bar--${type}`, style: { width: `${progressValue}%` } }) })), shouldShowIcon && (_jsx("div", { className: `toast__icon toast__icon--${type}`, children: icon || getToastIcon(type, 'toast__icon') })), _jsxs("div", { className: "toast__content", children: [title && (_jsx("h3", { className: "toast__title", children: title })), message && (_jsx("div", { className: `toast__message ${!title ? 'toast__message--only' : ''}`, children: message })), actions.length > 0 && (_jsx("div", { className: "toast__actions", children: actions.map((action, index) => (_jsx(ToastActionButton, { ...action }, index))) }))] }), closable && (_jsx("button", { type: "button", className: "toast__close-button", onClick: handleClose, "aria-label": "Close toast", children: _jsx(XMarkIcon, { className: "toast__close-icon" }) }))] }));
|
|
138
138
|
};
|
|
139
139
|
// Toast Container Component
|
|
140
140
|
export const ToastContainer = ({ position = 'top-right', className = '', children }) => {
|
|
@@ -66,8 +66,8 @@ const getToastColors = (type: ToastProps['type'], colors: any) => {
|
|
|
66
66
|
};
|
|
67
67
|
*/
|
|
68
68
|
// Toast Action Button Component
|
|
69
|
-
const ToastActionButton = ({ label,
|
|
70
|
-
return (_jsx("button", { type: "button", className: `toast__action-button toast__action-button--${variant}`, onClick:
|
|
69
|
+
const ToastActionButton = ({ label, onClick, variant = 'primary' }) => {
|
|
70
|
+
return (_jsx("button", { type: "button", className: `toast__action-button toast__action-button--${variant}`, onClick: onClick, children: label }));
|
|
71
71
|
};
|
|
72
72
|
// Individual Toast Component
|
|
73
73
|
export const Toast = ({ title, message, type = 'default', duration = 5000, onClose, actions = [], icon, showIcon = true, closable = true, autoClose = true, pauseOnHover = true, progress = false, size = 'md', variant = 'default', className = '', }) => {
|
|
@@ -134,7 +134,7 @@ export const Toast = ({ title, message, type = 'default', duration = 5000, onClo
|
|
|
134
134
|
return null;
|
|
135
135
|
}
|
|
136
136
|
const shouldShowIcon = showIcon && (icon || type);
|
|
137
|
-
return (_jsxs("div", { className: `toast__container toast__container--${size} toast__container--${variant} toast__container--${type} ${className}`, role: "alert", "aria-live": "polite", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [progress && (_jsx("div", { className: "toast__progress", children: _jsx("div", { className: `toast__progress-bar toast__progress-bar--${type}`, style: { width: `${progressValue}%` } }) })), shouldShowIcon && (_jsx("div", { className: `toast__icon toast__icon--${type}`, children: icon || getToastIcon(type, 'toast__icon') })), _jsxs("div", { className: "toast__content", children: [title && (_jsx("h3", { className: "toast__title", children: title })), _jsx("div", { className: `toast__message ${!title ? 'toast__message--only' : ''}`, children: message }), actions.length > 0 && (_jsx("div", { className: "toast__actions", children: actions.map((action, index) => (_jsx(ToastActionButton, { ...action }, index))) }))] }), closable && (_jsx("button", { type: "button", className: "toast__close-button", onClick: handleClose, "aria-label": "Close toast", children: _jsx(XMarkIcon, { className: "toast__close-icon" }) }))] }));
|
|
137
|
+
return (_jsxs("div", { className: `toast__container toast__container--${size} toast__container--${variant} toast__container--${type} ${className}`, role: "alert", "aria-live": "polite", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [progress && (_jsx("div", { className: "toast__progress", children: _jsx("div", { className: `toast__progress-bar toast__progress-bar--${type}`, style: { width: `${progressValue}%` } }) })), shouldShowIcon && (_jsx("div", { className: `toast__icon toast__icon--${type}`, children: icon || getToastIcon(type, 'toast__icon') })), _jsxs("div", { className: "toast__content", children: [title && (_jsx("h3", { className: "toast__title", children: title })), message && (_jsx("div", { className: `toast__message ${!title ? 'toast__message--only' : ''}`, children: message })), actions.length > 0 && (_jsx("div", { className: "toast__actions", children: actions.map((action, index) => (_jsx(ToastActionButton, { ...action }, index))) }))] }), closable && (_jsx("button", { type: "button", className: "toast__close-button", onClick: handleClose, "aria-label": "Close toast", children: _jsx(XMarkIcon, { className: "toast__close-icon" }) }))] }));
|
|
138
138
|
};
|
|
139
139
|
// Toast Container Component
|
|
140
140
|
export const ToastContainer = ({ position = 'top-right', className = '', children }) => {
|
|
@@ -45,11 +45,10 @@ export interface StatusAlertData {
|
|
|
45
45
|
export interface ToastProps extends FeedbackBaseProps {
|
|
46
46
|
id: string;
|
|
47
47
|
title?: string;
|
|
48
|
-
message
|
|
48
|
+
message?: string;
|
|
49
49
|
type: 'success' | 'warning' | 'error' | 'info' | 'default';
|
|
50
50
|
duration?: number;
|
|
51
51
|
onClose?: () => void;
|
|
52
|
-
onAction?: (action: string) => void;
|
|
53
52
|
actions?: ToastAction[];
|
|
54
53
|
icon?: React.ReactNode;
|
|
55
54
|
showIcon?: boolean;
|
|
@@ -64,7 +63,7 @@ export interface ToastProps extends FeedbackBaseProps {
|
|
|
64
63
|
}
|
|
65
64
|
export interface ToastAction {
|
|
66
65
|
label: string;
|
|
67
|
-
|
|
66
|
+
onClick: () => void;
|
|
68
67
|
variant?: 'primary' | 'secondary' | 'ghost';
|
|
69
68
|
}
|
|
70
69
|
export interface ToastContainerProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/feedback/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAGD,MAAM,WAAW,UAAW,SAAQ,iBAAiB;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,OAAO,CAAC,EAAE,WAAW,EAA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AAC;IACjC,KAAK,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;CAC3C;AAED,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Production-ready design system package with stan-design theme
|
|
4
4
|
*
|
|
5
5
|
* Auto-generated exports for:
|
|
6
|
-
* -
|
|
6
|
+
* - 61 UI components
|
|
7
7
|
* - 67 custom hooks
|
|
8
8
|
* - 6 utility functions
|
|
9
9
|
* - 29 theme system components
|
|
@@ -44,13 +44,34 @@ export { Tree } from './components/ui/data-display/tree.js';
|
|
|
44
44
|
export { Alert } from './components/ui/feedback/alert.js';
|
|
45
45
|
export { Progress } from './components/ui/feedback/progress.js';
|
|
46
46
|
export { SkeletonText } from './components/ui/feedback/skeleton.js';
|
|
47
|
+
export { SkeletonAvatar } from './components/ui/feedback/skeleton.js';
|
|
48
|
+
export { SkeletonButton } from './components/ui/feedback/skeleton.js';
|
|
49
|
+
export { Skeleton } from './components/ui/feedback/skeleton.js';
|
|
50
|
+
export { ToastProvider } from './components/ui/feedback/toast-context.js';
|
|
51
|
+
export { useToast } from './components/ui/feedback/toast-context.js';
|
|
52
|
+
export { useToastHelpers } from './components/ui/feedback/toast-context.js';
|
|
53
|
+
export { ToastExample } from './components/ui/feedback/toast-example.js';
|
|
54
|
+
export { ToastRenderer } from './components/ui/feedback/toast-renderer.js';
|
|
55
|
+
export { GlobalToastRenderer } from './components/ui/feedback/toast-renderer.js';
|
|
47
56
|
export { Toast } from './components/ui/feedback/toast.js';
|
|
57
|
+
export { ToastContainer } from './components/ui/feedback/toast.js';
|
|
48
58
|
export { Backdrop } from './components/ui/overlay/backdrop.js';
|
|
49
59
|
export { FocusManager } from './components/ui/overlay/focus-manager.js';
|
|
50
60
|
export { ModalHeader } from './components/ui/overlay/modal.js';
|
|
61
|
+
export { ModalBody } from './components/ui/overlay/modal.js';
|
|
62
|
+
export { ModalFooter } from './components/ui/overlay/modal.js';
|
|
63
|
+
export { Modal } from './components/ui/overlay/modal.js';
|
|
64
|
+
export { useOverlayManager } from './components/ui/overlay/overlay-manager.js';
|
|
65
|
+
export { OverlayProvider } from './components/ui/overlay/overlay-manager.js';
|
|
66
|
+
export { OverlayManager } from './components/ui/overlay/overlay-manager.js';
|
|
51
67
|
export { PopoverContent } from './components/ui/overlay/popover.js';
|
|
68
|
+
export { PopoverHeader } from './components/ui/overlay/popover.js';
|
|
69
|
+
export { PopoverBody } from './components/ui/overlay/popover.js';
|
|
70
|
+
export { PopoverFooter } from './components/ui/overlay/popover.js';
|
|
71
|
+
export { Popover } from './components/ui/overlay/popover.js';
|
|
52
72
|
export { Portal } from './components/ui/overlay/portal.js';
|
|
53
73
|
export { TooltipContent } from './components/ui/overlay/tooltip.js';
|
|
74
|
+
export { Tooltip } from './components/ui/overlay/tooltip.js';
|
|
54
75
|
export { AdaptiveLayout } from './components/ui/layouts/adaptive-layout.js';
|
|
55
76
|
export { DesktopLayout } from './components/ui/layouts/desktop-layout.js';
|
|
56
77
|
export { MobileLayout } from './components/ui/layouts/mobile-layout.js';
|