@spark-ui/components 10.18.1 → 10.19.0
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/avatar/index.d.mts +2 -2
- package/dist/avatar/index.d.ts +2 -2
- package/dist/docgen.json +356 -0
- package/dist/toast/index.d.mts +56 -0
- package/dist/toast/index.d.ts +56 -0
- package/dist/toast/index.js +1412 -0
- package/dist/toast/index.js.map +1 -0
- package/dist/toast/index.mjs +376 -0
- package/dist/toast/index.mjs.map +1 -0
- package/package.json +5 -5
package/dist/avatar/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
3
|
import { ComponentPropsWithoutRef } from 'react';
|
|
4
4
|
|
|
5
5
|
interface AvatarImageProps$1 extends React.ImgHTMLAttributes<HTMLImageElement> {
|
|
@@ -45,7 +45,7 @@ declare const AvatarPlaceholder: {
|
|
|
45
45
|
displayName: string;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
interface AvatarProps extends
|
|
48
|
+
interface AvatarProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
49
49
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
50
50
|
isOnline?: boolean;
|
|
51
51
|
onlineText?: string;
|
package/dist/avatar/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
3
|
import { ComponentPropsWithoutRef } from 'react';
|
|
4
4
|
|
|
5
5
|
interface AvatarImageProps$1 extends React.ImgHTMLAttributes<HTMLImageElement> {
|
|
@@ -45,7 +45,7 @@ declare const AvatarPlaceholder: {
|
|
|
45
45
|
displayName: string;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
interface AvatarProps extends
|
|
48
|
+
interface AvatarProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
49
49
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
50
50
|
isOnline?: boolean;
|
|
51
51
|
onlineText?: string;
|
package/dist/docgen.json
CHANGED
|
@@ -43840,6 +43840,362 @@
|
|
|
43840
43840
|
}
|
|
43841
43841
|
}
|
|
43842
43842
|
},
|
|
43843
|
+
"Toast": {
|
|
43844
|
+
"tags": {},
|
|
43845
|
+
"description": "",
|
|
43846
|
+
"displayName": "Toast",
|
|
43847
|
+
"methods": [],
|
|
43848
|
+
"props": {
|
|
43849
|
+
"toast": {
|
|
43850
|
+
"defaultValue": null,
|
|
43851
|
+
"description": "",
|
|
43852
|
+
"name": "toast",
|
|
43853
|
+
"declarations": [
|
|
43854
|
+
{
|
|
43855
|
+
"fileName": "src/toast/Toast.tsx",
|
|
43856
|
+
"name": "TypeLiteral"
|
|
43857
|
+
}
|
|
43858
|
+
],
|
|
43859
|
+
"required": true,
|
|
43860
|
+
"type": {
|
|
43861
|
+
"name": "ToastObject"
|
|
43862
|
+
}
|
|
43863
|
+
}
|
|
43864
|
+
}
|
|
43865
|
+
},
|
|
43866
|
+
"ToastProvider": {
|
|
43867
|
+
"tags": {},
|
|
43868
|
+
"description": "",
|
|
43869
|
+
"displayName": "ToastProvider",
|
|
43870
|
+
"methods": [],
|
|
43871
|
+
"props": {
|
|
43872
|
+
"timeout": {
|
|
43873
|
+
"defaultValue": {
|
|
43874
|
+
"value": "5000"
|
|
43875
|
+
},
|
|
43876
|
+
"description": "The default amount of time (in ms) before a toast is auto dismissed.\nA value of `0` will prevent the toast from being dismissed automatically.",
|
|
43877
|
+
"name": "timeout",
|
|
43878
|
+
"parent": {
|
|
43879
|
+
"fileName": "spark-web/node_modules/@base-ui-components/react/toast/provider/ToastProvider.d.ts",
|
|
43880
|
+
"name": "Props"
|
|
43881
|
+
},
|
|
43882
|
+
"declarations": [
|
|
43883
|
+
{
|
|
43884
|
+
"fileName": "spark-web/node_modules/@base-ui-components/react/toast/provider/ToastProvider.d.ts",
|
|
43885
|
+
"name": "Props"
|
|
43886
|
+
}
|
|
43887
|
+
],
|
|
43888
|
+
"required": false,
|
|
43889
|
+
"type": {
|
|
43890
|
+
"name": "number"
|
|
43891
|
+
}
|
|
43892
|
+
},
|
|
43893
|
+
"limit": {
|
|
43894
|
+
"defaultValue": {
|
|
43895
|
+
"value": 3
|
|
43896
|
+
},
|
|
43897
|
+
"description": "The maximum number of toasts that can be displayed at once.\nWhen the limit is reached, the oldest toast will be removed to make room for the new one.",
|
|
43898
|
+
"name": "limit",
|
|
43899
|
+
"parent": {
|
|
43900
|
+
"fileName": "spark-web/node_modules/@base-ui-components/react/toast/provider/ToastProvider.d.ts",
|
|
43901
|
+
"name": "Props"
|
|
43902
|
+
},
|
|
43903
|
+
"declarations": [
|
|
43904
|
+
{
|
|
43905
|
+
"fileName": "spark-web/node_modules/@base-ui-components/react/toast/provider/ToastProvider.d.ts",
|
|
43906
|
+
"name": "Props"
|
|
43907
|
+
}
|
|
43908
|
+
],
|
|
43909
|
+
"required": false,
|
|
43910
|
+
"type": {
|
|
43911
|
+
"name": "number"
|
|
43912
|
+
}
|
|
43913
|
+
},
|
|
43914
|
+
"toastManager": {
|
|
43915
|
+
"defaultValue": null,
|
|
43916
|
+
"description": "A global manager for toasts to use outside of a React component.",
|
|
43917
|
+
"name": "toastManager",
|
|
43918
|
+
"parent": {
|
|
43919
|
+
"fileName": "spark-web/node_modules/@base-ui-components/react/toast/provider/ToastProvider.d.ts",
|
|
43920
|
+
"name": "Props"
|
|
43921
|
+
},
|
|
43922
|
+
"declarations": [
|
|
43923
|
+
{
|
|
43924
|
+
"fileName": "spark-web/node_modules/@base-ui-components/react/toast/provider/ToastProvider.d.ts",
|
|
43925
|
+
"name": "Props"
|
|
43926
|
+
}
|
|
43927
|
+
],
|
|
43928
|
+
"required": false,
|
|
43929
|
+
"type": {
|
|
43930
|
+
"name": "ToastManager"
|
|
43931
|
+
}
|
|
43932
|
+
}
|
|
43933
|
+
}
|
|
43934
|
+
},
|
|
43935
|
+
"ToastTrigger": {
|
|
43936
|
+
"tags": {},
|
|
43937
|
+
"description": "",
|
|
43938
|
+
"displayName": "ToastTrigger",
|
|
43939
|
+
"methods": [],
|
|
43940
|
+
"props": {
|
|
43941
|
+
"asChild": {
|
|
43942
|
+
"defaultValue": {
|
|
43943
|
+
"value": false
|
|
43944
|
+
},
|
|
43945
|
+
"description": "",
|
|
43946
|
+
"name": "asChild",
|
|
43947
|
+
"parent": {
|
|
43948
|
+
"fileName": "src/toast/index.tsx",
|
|
43949
|
+
"name": "ToastTriggerProps"
|
|
43950
|
+
},
|
|
43951
|
+
"declarations": [
|
|
43952
|
+
{
|
|
43953
|
+
"fileName": "src/toast/index.tsx",
|
|
43954
|
+
"name": "ToastTriggerProps"
|
|
43955
|
+
}
|
|
43956
|
+
],
|
|
43957
|
+
"required": false,
|
|
43958
|
+
"type": {
|
|
43959
|
+
"name": "boolean"
|
|
43960
|
+
}
|
|
43961
|
+
},
|
|
43962
|
+
"title": {
|
|
43963
|
+
"defaultValue": null,
|
|
43964
|
+
"description": "",
|
|
43965
|
+
"name": "title",
|
|
43966
|
+
"parent": {
|
|
43967
|
+
"fileName": "src/toast/index.tsx",
|
|
43968
|
+
"name": "ToastTriggerProps"
|
|
43969
|
+
},
|
|
43970
|
+
"declarations": [
|
|
43971
|
+
{
|
|
43972
|
+
"fileName": "src/toast/index.tsx",
|
|
43973
|
+
"name": "ToastTriggerProps"
|
|
43974
|
+
}
|
|
43975
|
+
],
|
|
43976
|
+
"required": true,
|
|
43977
|
+
"type": {
|
|
43978
|
+
"name": "string"
|
|
43979
|
+
}
|
|
43980
|
+
},
|
|
43981
|
+
"description": {
|
|
43982
|
+
"defaultValue": null,
|
|
43983
|
+
"description": "",
|
|
43984
|
+
"name": "description",
|
|
43985
|
+
"parent": {
|
|
43986
|
+
"fileName": "src/toast/index.tsx",
|
|
43987
|
+
"name": "ToastTriggerProps"
|
|
43988
|
+
},
|
|
43989
|
+
"declarations": [
|
|
43990
|
+
{
|
|
43991
|
+
"fileName": "src/toast/index.tsx",
|
|
43992
|
+
"name": "ToastTriggerProps"
|
|
43993
|
+
}
|
|
43994
|
+
],
|
|
43995
|
+
"required": false,
|
|
43996
|
+
"type": {
|
|
43997
|
+
"name": "string"
|
|
43998
|
+
}
|
|
43999
|
+
},
|
|
44000
|
+
"timeout": {
|
|
44001
|
+
"defaultValue": {
|
|
44002
|
+
"value": 5000
|
|
44003
|
+
},
|
|
44004
|
+
"description": "",
|
|
44005
|
+
"name": "timeout",
|
|
44006
|
+
"parent": {
|
|
44007
|
+
"fileName": "src/toast/index.tsx",
|
|
44008
|
+
"name": "ToastTriggerProps"
|
|
44009
|
+
},
|
|
44010
|
+
"declarations": [
|
|
44011
|
+
{
|
|
44012
|
+
"fileName": "src/toast/index.tsx",
|
|
44013
|
+
"name": "ToastTriggerProps"
|
|
44014
|
+
}
|
|
44015
|
+
],
|
|
44016
|
+
"required": false,
|
|
44017
|
+
"type": {
|
|
44018
|
+
"name": "number"
|
|
44019
|
+
}
|
|
44020
|
+
},
|
|
44021
|
+
"priority": {
|
|
44022
|
+
"defaultValue": {
|
|
44023
|
+
"value": "low"
|
|
44024
|
+
},
|
|
44025
|
+
"description": "The priority of the toast.\n- `low` - The toast will be announced politely.\n- `high` - The toast will be announced urgently.",
|
|
44026
|
+
"name": "priority",
|
|
44027
|
+
"parent": {
|
|
44028
|
+
"fileName": "spark-web/node_modules/@base-ui-components/react/toast/useToastManager.d.ts",
|
|
44029
|
+
"name": "ToastObject"
|
|
44030
|
+
},
|
|
44031
|
+
"declarations": [
|
|
44032
|
+
{
|
|
44033
|
+
"fileName": "spark-web/node_modules/@base-ui-components/react/toast/useToastManager.d.ts",
|
|
44034
|
+
"name": "ToastObject"
|
|
44035
|
+
}
|
|
44036
|
+
],
|
|
44037
|
+
"required": false,
|
|
44038
|
+
"type": {
|
|
44039
|
+
"name": "enum",
|
|
44040
|
+
"raw": "\"high\" | \"low\"",
|
|
44041
|
+
"value": [
|
|
44042
|
+
{
|
|
44043
|
+
"value": "\"high\""
|
|
44044
|
+
},
|
|
44045
|
+
{
|
|
44046
|
+
"value": "\"low\""
|
|
44047
|
+
}
|
|
44048
|
+
]
|
|
44049
|
+
}
|
|
44050
|
+
},
|
|
44051
|
+
"design": {
|
|
44052
|
+
"defaultValue": {
|
|
44053
|
+
"value": "filled"
|
|
44054
|
+
},
|
|
44055
|
+
"description": "",
|
|
44056
|
+
"name": "design",
|
|
44057
|
+
"parent": {
|
|
44058
|
+
"fileName": "components/src/toast/types.ts",
|
|
44059
|
+
"name": "ToastData"
|
|
44060
|
+
},
|
|
44061
|
+
"declarations": [
|
|
44062
|
+
{
|
|
44063
|
+
"fileName": "components/src/toast/types.ts",
|
|
44064
|
+
"name": "ToastData"
|
|
44065
|
+
}
|
|
44066
|
+
],
|
|
44067
|
+
"required": false,
|
|
44068
|
+
"type": {
|
|
44069
|
+
"name": "enum",
|
|
44070
|
+
"raw": "ToastDesign",
|
|
44071
|
+
"value": [
|
|
44072
|
+
{
|
|
44073
|
+
"value": "\"filled\""
|
|
44074
|
+
},
|
|
44075
|
+
{
|
|
44076
|
+
"value": "\"tinted\""
|
|
44077
|
+
}
|
|
44078
|
+
]
|
|
44079
|
+
}
|
|
44080
|
+
},
|
|
44081
|
+
"intent": {
|
|
44082
|
+
"defaultValue": {
|
|
44083
|
+
"value": "neutral"
|
|
44084
|
+
},
|
|
44085
|
+
"description": "",
|
|
44086
|
+
"name": "intent",
|
|
44087
|
+
"parent": {
|
|
44088
|
+
"fileName": "components/src/toast/types.ts",
|
|
44089
|
+
"name": "ToastData"
|
|
44090
|
+
},
|
|
44091
|
+
"declarations": [
|
|
44092
|
+
{
|
|
44093
|
+
"fileName": "components/src/toast/types.ts",
|
|
44094
|
+
"name": "ToastData"
|
|
44095
|
+
}
|
|
44096
|
+
],
|
|
44097
|
+
"required": false,
|
|
44098
|
+
"type": {
|
|
44099
|
+
"name": "enum",
|
|
44100
|
+
"raw": "ToastIntent",
|
|
44101
|
+
"value": [
|
|
44102
|
+
{
|
|
44103
|
+
"value": "\"main\""
|
|
44104
|
+
},
|
|
44105
|
+
{
|
|
44106
|
+
"value": "\"alert\""
|
|
44107
|
+
},
|
|
44108
|
+
{
|
|
44109
|
+
"value": "\"support\""
|
|
44110
|
+
},
|
|
44111
|
+
{
|
|
44112
|
+
"value": "\"accent\""
|
|
44113
|
+
},
|
|
44114
|
+
{
|
|
44115
|
+
"value": "\"success\""
|
|
44116
|
+
},
|
|
44117
|
+
{
|
|
44118
|
+
"value": "\"info\""
|
|
44119
|
+
},
|
|
44120
|
+
{
|
|
44121
|
+
"value": "\"neutral\""
|
|
44122
|
+
},
|
|
44123
|
+
{
|
|
44124
|
+
"value": "\"surface\""
|
|
44125
|
+
},
|
|
44126
|
+
{
|
|
44127
|
+
"value": "\"basic\""
|
|
44128
|
+
},
|
|
44129
|
+
{
|
|
44130
|
+
"value": "\"error\""
|
|
44131
|
+
},
|
|
44132
|
+
{
|
|
44133
|
+
"value": "\"surfaceInverse\""
|
|
44134
|
+
}
|
|
44135
|
+
]
|
|
44136
|
+
}
|
|
44137
|
+
},
|
|
44138
|
+
"icon": {
|
|
44139
|
+
"defaultValue": null,
|
|
44140
|
+
"description": "",
|
|
44141
|
+
"name": "icon",
|
|
44142
|
+
"parent": {
|
|
44143
|
+
"fileName": "components/src/toast/types.ts",
|
|
44144
|
+
"name": "ToastData"
|
|
44145
|
+
},
|
|
44146
|
+
"declarations": [
|
|
44147
|
+
{
|
|
44148
|
+
"fileName": "components/src/toast/types.ts",
|
|
44149
|
+
"name": "ToastData"
|
|
44150
|
+
}
|
|
44151
|
+
],
|
|
44152
|
+
"required": false,
|
|
44153
|
+
"type": {
|
|
44154
|
+
"name": "ReactNode"
|
|
44155
|
+
}
|
|
44156
|
+
},
|
|
44157
|
+
"isClosable": {
|
|
44158
|
+
"defaultValue": {
|
|
44159
|
+
"value": true
|
|
44160
|
+
},
|
|
44161
|
+
"description": "",
|
|
44162
|
+
"name": "isClosable",
|
|
44163
|
+
"parent": {
|
|
44164
|
+
"fileName": "components/src/toast/types.ts",
|
|
44165
|
+
"name": "ToastData"
|
|
44166
|
+
},
|
|
44167
|
+
"declarations": [
|
|
44168
|
+
{
|
|
44169
|
+
"fileName": "components/src/toast/types.ts",
|
|
44170
|
+
"name": "ToastData"
|
|
44171
|
+
}
|
|
44172
|
+
],
|
|
44173
|
+
"required": false,
|
|
44174
|
+
"type": {
|
|
44175
|
+
"name": "boolean"
|
|
44176
|
+
}
|
|
44177
|
+
},
|
|
44178
|
+
"action": {
|
|
44179
|
+
"defaultValue": null,
|
|
44180
|
+
"description": "",
|
|
44181
|
+
"name": "action",
|
|
44182
|
+
"parent": {
|
|
44183
|
+
"fileName": "components/src/toast/types.ts",
|
|
44184
|
+
"name": "ToastData"
|
|
44185
|
+
},
|
|
44186
|
+
"declarations": [
|
|
44187
|
+
{
|
|
44188
|
+
"fileName": "components/src/toast/types.ts",
|
|
44189
|
+
"name": "ToastData"
|
|
44190
|
+
}
|
|
44191
|
+
],
|
|
44192
|
+
"required": false,
|
|
44193
|
+
"type": {
|
|
44194
|
+
"name": "any"
|
|
44195
|
+
}
|
|
44196
|
+
}
|
|
44197
|
+
}
|
|
44198
|
+
},
|
|
43843
44199
|
"VisuallyHidden": {
|
|
43844
44200
|
"tags": {},
|
|
43845
44201
|
"description": "",
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Toast } from '@base-ui-components/react/toast';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ButtonProps } from '../button/index.mjs';
|
|
5
|
+
import 'class-variance-authority/types';
|
|
6
|
+
import 'class-variance-authority';
|
|
7
|
+
|
|
8
|
+
type ToastIntent = 'main' | 'support' | 'accent' | 'basic' | 'success' | 'alert' | 'error' | 'info' | 'neutral' | 'surface' | 'surfaceInverse';
|
|
9
|
+
type ToastDesign = 'tinted' | 'filled';
|
|
10
|
+
interface ToastData {
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
design?: ToastDesign;
|
|
13
|
+
intent?: ToastIntent;
|
|
14
|
+
isClosable?: boolean;
|
|
15
|
+
closeLabel?: string;
|
|
16
|
+
action?: {
|
|
17
|
+
close?: boolean;
|
|
18
|
+
label: string;
|
|
19
|
+
onClick: () => void;
|
|
20
|
+
} & ButtonProps;
|
|
21
|
+
}
|
|
22
|
+
type ToastObject = Toast.Root.ToastObject<ToastData>;
|
|
23
|
+
interface AddOptions extends Omit<ToastObject, 'id' | 'animation' | 'height' | 'ref' | 'limited'> {
|
|
24
|
+
id?: string;
|
|
25
|
+
}
|
|
26
|
+
type UpdateOptions = Partial<AddOptions>;
|
|
27
|
+
interface PromiseOptions<Value> {
|
|
28
|
+
loading: string | UpdateOptions;
|
|
29
|
+
success: string | UpdateOptions | ((result: Value) => string | UpdateOptions);
|
|
30
|
+
error: string | UpdateOptions | ((error: any) => string | UpdateOptions);
|
|
31
|
+
}
|
|
32
|
+
interface UseToastManagerReturnValue {
|
|
33
|
+
toasts: ToastObject[];
|
|
34
|
+
add: (options: AddOptions) => string;
|
|
35
|
+
update: (toastId: string, options: UpdateOptions) => void;
|
|
36
|
+
close: (toastId: string) => void;
|
|
37
|
+
promise: <Value>(promise: Promise<Value>, options: PromiseOptions<Value>) => Promise<Value>;
|
|
38
|
+
closeAll: () => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare function useToastManager(): UseToastManagerReturnValue;
|
|
42
|
+
|
|
43
|
+
interface ToastProviderProps extends React.ComponentProps<typeof Toast.Provider> {
|
|
44
|
+
children: React.ReactNode;
|
|
45
|
+
}
|
|
46
|
+
declare function ToastProvider({ children, limit }: ToastProviderProps): react_jsx_runtime.JSX.Element;
|
|
47
|
+
interface ToastTriggerProps extends React.ComponentPropsWithRef<'button'>, Pick<ToastObject, 'priority'>, Pick<ToastData, 'design' | 'intent' | 'icon' | 'isClosable' | 'action'> {
|
|
48
|
+
children: React.ReactNode;
|
|
49
|
+
asChild?: boolean;
|
|
50
|
+
title: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
timeout?: number;
|
|
53
|
+
}
|
|
54
|
+
declare function ToastTrigger({ children, onClick, asChild, title, description, timeout, design, intent, isClosable, icon, action, priority, }: ToastTriggerProps): react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
export { type ToastData, type ToastDesign, type ToastIntent, type ToastObject, ToastProvider, ToastTrigger, type UseToastManagerReturnValue, useToastManager };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Toast } from '@base-ui-components/react/toast';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ButtonProps } from '../button/index.js';
|
|
5
|
+
import 'class-variance-authority/types';
|
|
6
|
+
import 'class-variance-authority';
|
|
7
|
+
|
|
8
|
+
type ToastIntent = 'main' | 'support' | 'accent' | 'basic' | 'success' | 'alert' | 'error' | 'info' | 'neutral' | 'surface' | 'surfaceInverse';
|
|
9
|
+
type ToastDesign = 'tinted' | 'filled';
|
|
10
|
+
interface ToastData {
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
design?: ToastDesign;
|
|
13
|
+
intent?: ToastIntent;
|
|
14
|
+
isClosable?: boolean;
|
|
15
|
+
closeLabel?: string;
|
|
16
|
+
action?: {
|
|
17
|
+
close?: boolean;
|
|
18
|
+
label: string;
|
|
19
|
+
onClick: () => void;
|
|
20
|
+
} & ButtonProps;
|
|
21
|
+
}
|
|
22
|
+
type ToastObject = Toast.Root.ToastObject<ToastData>;
|
|
23
|
+
interface AddOptions extends Omit<ToastObject, 'id' | 'animation' | 'height' | 'ref' | 'limited'> {
|
|
24
|
+
id?: string;
|
|
25
|
+
}
|
|
26
|
+
type UpdateOptions = Partial<AddOptions>;
|
|
27
|
+
interface PromiseOptions<Value> {
|
|
28
|
+
loading: string | UpdateOptions;
|
|
29
|
+
success: string | UpdateOptions | ((result: Value) => string | UpdateOptions);
|
|
30
|
+
error: string | UpdateOptions | ((error: any) => string | UpdateOptions);
|
|
31
|
+
}
|
|
32
|
+
interface UseToastManagerReturnValue {
|
|
33
|
+
toasts: ToastObject[];
|
|
34
|
+
add: (options: AddOptions) => string;
|
|
35
|
+
update: (toastId: string, options: UpdateOptions) => void;
|
|
36
|
+
close: (toastId: string) => void;
|
|
37
|
+
promise: <Value>(promise: Promise<Value>, options: PromiseOptions<Value>) => Promise<Value>;
|
|
38
|
+
closeAll: () => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare function useToastManager(): UseToastManagerReturnValue;
|
|
42
|
+
|
|
43
|
+
interface ToastProviderProps extends React.ComponentProps<typeof Toast.Provider> {
|
|
44
|
+
children: React.ReactNode;
|
|
45
|
+
}
|
|
46
|
+
declare function ToastProvider({ children, limit }: ToastProviderProps): react_jsx_runtime.JSX.Element;
|
|
47
|
+
interface ToastTriggerProps extends React.ComponentPropsWithRef<'button'>, Pick<ToastObject, 'priority'>, Pick<ToastData, 'design' | 'intent' | 'icon' | 'isClosable' | 'action'> {
|
|
48
|
+
children: React.ReactNode;
|
|
49
|
+
asChild?: boolean;
|
|
50
|
+
title: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
timeout?: number;
|
|
53
|
+
}
|
|
54
|
+
declare function ToastTrigger({ children, onClick, asChild, title, description, timeout, design, intent, isClosable, icon, action, priority, }: ToastTriggerProps): react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
export { type ToastData, type ToastDesign, type ToastIntent, type ToastObject, ToastProvider, ToastTrigger, type UseToastManagerReturnValue, useToastManager };
|