@spark-ui/components 10.18.1 → 10.19.1
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/stepper/index.js +9 -2
- package/dist/stepper/index.js.map +1 -1
- package/dist/stepper/index.mjs +9 -2
- package/dist/stepper/index.mjs.map +1 -1
- 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
|
@@ -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 };
|