uibee 2.5.9 → 2.5.10
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.
|
@@ -17,9 +17,10 @@ export { default as NavDropdown } from './navbar/navbarDropdown';
|
|
|
17
17
|
// Containers
|
|
18
18
|
export { default as PageContainer } from './container/page';
|
|
19
19
|
export { default as Highlight } from './container/highlight';
|
|
20
|
-
//
|
|
20
|
+
// Login
|
|
21
21
|
export { default as VersionTag } from './version/version';
|
|
22
22
|
export { default as LoginPage } from './login/loginPage';
|
|
23
|
+
// Toasts
|
|
23
24
|
export { default as Toaster, toast } from './toast/toaster';
|
|
24
25
|
// Buttons
|
|
25
26
|
export { default as Button } from './buttons/button';
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import type { ToastType } from 'uibee/components';
|
|
2
2
|
export declare function toast(message: string, type: ToastType, duration?: number): void;
|
|
3
|
+
export declare namespace toast {
|
|
4
|
+
var info: (message: string, duration?: number) => void;
|
|
5
|
+
var success: (message: string, duration?: number) => void;
|
|
6
|
+
var warning: (message: string, duration?: number) => void;
|
|
7
|
+
var error: (message: string, duration?: number) => void;
|
|
8
|
+
}
|
|
3
9
|
export default function Toaster(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,6 +8,10 @@ export function toast(message, type, duration = 4000) {
|
|
|
8
8
|
const id = ++idCounter;
|
|
9
9
|
listeners.forEach(listener => listener({ id, message, type, expiresAt: Date.now() + duration }));
|
|
10
10
|
}
|
|
11
|
+
toast.info = (message, duration) => toast(message, 'info', duration);
|
|
12
|
+
toast.success = (message, duration) => toast(message, 'success', duration);
|
|
13
|
+
toast.warning = (message, duration) => toast(message, 'warning', duration);
|
|
14
|
+
toast.error = (message, duration) => toast(message, 'error', duration);
|
|
11
15
|
export default function Toaster() {
|
|
12
16
|
const [toasts, setToasts] = useState([]);
|
|
13
17
|
const [expanded, setExpanded] = useState(false);
|
package/package.json
CHANGED
package/src/components/index.ts
CHANGED
|
@@ -22,9 +22,11 @@ export { default as NavDropdown } from './navbar/navbarDropdown'
|
|
|
22
22
|
export { default as PageContainer} from './container/page'
|
|
23
23
|
export { default as Highlight } from './container/highlight'
|
|
24
24
|
|
|
25
|
-
//
|
|
25
|
+
// Login
|
|
26
26
|
export { default as VersionTag } from './version/version'
|
|
27
27
|
export { default as LoginPage } from './login/loginPage'
|
|
28
|
+
|
|
29
|
+
// Toasts
|
|
28
30
|
export { default as Toaster, toast } from './toast/toaster'
|
|
29
31
|
|
|
30
32
|
// Buttons
|
|
@@ -12,6 +12,11 @@ export function toast(message: string, type: ToastType, duration = 4000) {
|
|
|
12
12
|
listeners.forEach(listener => listener({ id, message, type, expiresAt: Date.now() + duration }))
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
toast.info = (message: string, duration?: number) => toast(message, 'info', duration)
|
|
16
|
+
toast.success = (message: string, duration?: number) => toast(message, 'success', duration)
|
|
17
|
+
toast.warning = (message: string, duration?: number) => toast(message, 'warning', duration)
|
|
18
|
+
toast.error = (message: string, duration?: number) => toast(message, 'error', duration)
|
|
19
|
+
|
|
15
20
|
export default function Toaster() {
|
|
16
21
|
const [toasts, setToasts] = useState<Toast[]>([])
|
|
17
22
|
const [expanded, setExpanded] = useState(false)
|
|
@@ -33,8 +33,14 @@ declare module 'uibee/components' {
|
|
|
33
33
|
export type Language = 'no' | 'en'
|
|
34
34
|
|
|
35
35
|
export default function LoginPage(props: LoginPageProps): JSX.Element;
|
|
36
|
-
export
|
|
37
|
-
export
|
|
36
|
+
export function Toaster(): JSX.Element;
|
|
37
|
+
export function toast(message: string, type: ToastType, duration?: number): void;
|
|
38
|
+
export namespace toast {
|
|
39
|
+
export function info(message: string, duration?: number): void;
|
|
40
|
+
export function success(message: string, duration?: number): void;
|
|
41
|
+
export function warning(message: string, duration?: number): void;
|
|
42
|
+
export function error(message: string, duration?: number): void;
|
|
43
|
+
}
|
|
38
44
|
export default function LanguageToggle(props: { lang: Language }): JSX.Element;
|
|
39
45
|
export default function ThemeSwitch(props: { className?: string }): JSX.Element;
|
|
40
46
|
}
|