@wallarm-org/design-system 1.18.1 → 1.18.2
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.
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
export declare const SIMPLE_TOAST_DURATION_MS = 5000;
|
|
3
3
|
export declare const EXTENDED_TOAST_DURATION_MS = 10000;
|
|
4
|
-
|
|
5
|
-
* The fields a toast is actually made of.
|
|
6
|
-
*
|
|
7
|
-
* Kept apart from `ToastData` so they survive an `Omit`: an index signature
|
|
8
|
-
* swallows every named field it is declared beside, which left
|
|
9
|
-
* `ToastCreateOptions` — `Omit<ToastData, 'id'>` — checking nothing at all
|
|
10
|
-
* (`toaster.create({ titl: 'x' })` compiled) and widening each field back to
|
|
11
|
-
* `unknown` under the declaration compiler, invisibly to `tsc --noEmit`.
|
|
12
|
-
*/
|
|
13
|
-
export interface ToastFields {
|
|
14
|
-
id: string;
|
|
4
|
+
export interface ToastOptions {
|
|
15
5
|
title?: string;
|
|
16
6
|
description?: string;
|
|
17
7
|
type?: 'success' | 'error' | 'warning' | 'info' | 'loading' | 'default';
|
|
@@ -22,8 +12,8 @@ export interface ToastFields {
|
|
|
22
12
|
closable?: boolean;
|
|
23
13
|
duration?: number;
|
|
24
14
|
}
|
|
25
|
-
export interface ToastData extends
|
|
26
|
-
|
|
15
|
+
export interface ToastData extends ToastOptions {
|
|
16
|
+
id: string;
|
|
27
17
|
}
|
|
28
18
|
export interface ToastProps {
|
|
29
19
|
toast: ToastData;
|
|
@@ -32,4 +22,4 @@ export declare function Toast({ toast }: ToastProps): import("react").JSX.Elemen
|
|
|
32
22
|
export declare namespace Toast {
|
|
33
23
|
var displayName: string;
|
|
34
24
|
}
|
|
35
|
-
export declare const resolveToastVariant: (variant:
|
|
25
|
+
export declare const resolveToastVariant: (variant: ToastOptions['variant'], description: ToastOptions['description']) => NonNullable<ToastOptions['variant']>;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import { type CreateToasterReturn } from '@ark-ui/react/toast';
|
|
3
|
-
import { type
|
|
4
|
-
export interface ToastCreateOptions extends
|
|
3
|
+
import { type ToastOptions } from './Toast';
|
|
4
|
+
export interface ToastCreateOptions extends ToastOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Stable id for this toast. Creating with an id that is already showing
|
|
7
|
+
* updates that toast instead of stacking a duplicate, which is how a caller
|
|
8
|
+
* keeps a repeated action (copy to clipboard, say) to one visible toast.
|
|
9
|
+
* Omit it and the toaster assigns one.
|
|
10
|
+
*/
|
|
11
|
+
id?: string;
|
|
5
12
|
priority?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
|
6
13
|
}
|
|
7
14
|
export interface TypedToaster extends Omit<CreateToasterReturn, 'create' | 'update'> {
|
|
8
15
|
create: (options: ToastCreateOptions) => string;
|
|
9
|
-
update: (id: string, options: Partial<ToastCreateOptions>) => string;
|
|
16
|
+
update: (id: string, options: Omit<Partial<ToastCreateOptions>, 'id'>) => string;
|
|
10
17
|
__arkToaster: CreateToasterReturn;
|
|
11
18
|
}
|
|
12
19
|
/**
|