@enigmax/primitives 0.20.0 → 0.22.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/chunk-WPTBURIC.js +1627 -0
- package/dist/{index-dTdAbOWl.d.ts → index-BHpOZncw.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/next/index.d.ts +5 -5
- package/dist/next/index.js +1 -1
- package/dist/react/button.d.ts +2 -2
- package/dist/react/index.d.ts +4 -4
- package/dist/react/index.js +1 -1
- package/dist/react/input.d.ts +2 -2
- package/dist/react/palette.d.ts +1 -1
- package/dist/react/search.d.ts +1 -1
- package/dist/react/slot.d.ts +2 -2
- package/dist/react/toast.d.ts +168 -34
- package/dist/react/toast.js +2 -2
- package/dist/react-router/index.d.ts +5 -5
- package/dist/react-router/index.js +1 -1
- package/dist/search/index.d.ts +2 -2
- package/dist/{search-DXxY8SEH.d.ts → search-BD9-5O5U.d.ts} +7 -2
- package/package.json +1 -1
- package/recipes/toast/styles.css +697 -128
- package/registry.json +79 -26
- package/src/core/search.ts +6 -1
- package/src/react/index.ts +2 -1
- package/src/react/toast/NOTICE +20 -0
- package/src/react/toast/assets.tsx +85 -0
- package/src/react/toast/cn.ts +10 -0
- package/src/react/toast/hooks.ts +13 -0
- package/src/react/toast/index.tsx +736 -0
- package/src/react/toast/state.ts +207 -0
- package/src/react/toast/styles.ts +738 -0
- package/src/react/toast/types.ts +193 -0
- package/src/react/toaster.tsx +97 -209
- package/dist/chunk-ZCUFYBPB.js +0 -154
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
import { c as SearchOptions, F as FuseConstructor, b as SearchMatch } from './search-
|
|
2
|
+
import { c as SearchOptions, F as FuseConstructor, b as SearchMatch } from './search-BD9-5O5U.js';
|
|
3
3
|
import { G as GeneratePasswordOptions, E as EstimateOptions, b as PasswordStrengthReport } from './password-C8lG4Zm9.js';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { M as MarqueeHover, a as MarqueeInstance, b as MarqueeOptions, c as createMarquee } from './marquee-CJ3Uwy3E.js';
|
|
2
2
|
export { I as InputAction, a as InputActionState, b as InputIcon, c as InputInstance, d as InputOptions, e as createInput } from './input-BwXjFenq.js';
|
|
3
|
-
export { F as FuseConstructor, a as FuseLike, S as SearchInstance, b as SearchMatch, c as SearchOptions, d as createSearch, s as subsequenceMatcher } from './search-
|
|
3
|
+
export { F as FuseConstructor, a as FuseLike, S as SearchInstance, b as SearchMatch, c as SearchOptions, d as createSearch, s as subsequenceMatcher } from './search-BD9-5O5U.js';
|
|
4
4
|
export { B as ButtonCooldown, a as ButtonElement, b as ButtonInstance, c as ButtonOptions, d as ButtonState, e as createButton } from './button-CaXaqG_K.js';
|
|
5
5
|
export { E as EstimateOptions, G as GeneratePasswordOptions, P as PasswordAlphabet, a as PasswordScore, b as PasswordStrengthReport, e as estimatePasswordStrength, g as generatePassword } from './password-C8lG4Zm9.js';
|
|
6
6
|
export { N as Notification, a as NotificationAction, b as NotificationInput, c as NotificationTone, d as Notifications, e as NotificationsOptions, P as PromiseMessages, f as createNotifications } from './notifications-BpVV6sel.js';
|
package/dist/next/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ButtonProps } from '../react/button.js';
|
|
3
3
|
export { UseMarqueeResult, useMarquee } from '../react/marquee.js';
|
|
4
4
|
export { M as MarqueeHover, a as MarqueeInstance, b as MarqueeOptions } from '../marquee-CJ3Uwy3E.js';
|
|
5
5
|
export { PasswordStrength, PasswordStrengthProps, UseButtonResult, UseInputResult, getLinkComponent, setLinkComponent, useButton, useInput } from '../react/index.js';
|
|
6
6
|
export { UseSearchResult, useSearch } from '../react/search.js';
|
|
7
7
|
export { I as InputAction, b as InputIcon, d as InputOptions } from '../input-BwXjFenq.js';
|
|
8
|
-
export { F as FuseConstructor, a as FuseLike, S as SearchInstance, b as SearchMatch, c as SearchOptions } from '../search-
|
|
8
|
+
export { F as FuseConstructor, a as FuseLike, S as SearchInstance, b as SearchMatch, c as SearchOptions } from '../search-BD9-5O5U.js';
|
|
9
9
|
export { c as ButtonOptions, d as ButtonState } from '../button-CaXaqG_K.js';
|
|
10
|
-
export { B as BreachChecker, a as BreachState, b as BreachStatus, F as FieldAction, I as Input, c as InputBaseProps, d as InputProps, e as InputType, P as PasswordOnlyProps, g as PlainOnlyProps, S as SearchOnlyProps } from '../index-
|
|
10
|
+
export { B as BreachChecker, a as BreachState, b as BreachStatus, F as FieldAction, I as Input, c as InputBaseProps, d as InputProps, e as InputType, P as PasswordOnlyProps, g as PlainOnlyProps, S as SearchOnlyProps } from '../index-BHpOZncw.js';
|
|
11
11
|
export { Slot, SlotProps, mergeSlotProps } from '../react/slot.js';
|
|
12
12
|
export { E as EstimateOptions, G as GeneratePasswordOptions, a as PasswordScore, b as PasswordStrengthReport, e as estimatePasswordStrength, g as generatePassword } from '../password-C8lG4Zm9.js';
|
|
13
13
|
export { UseNotificationsResult, createNotificationQueue, defaultQueue, useNotifications } from '../react/notifications.js';
|
|
14
|
-
export {
|
|
14
|
+
export { Action, ExternalToast, ToastClassnames, ToastT, Toaster, ToasterProps, toast, useSonner } from '../react/toast.js';
|
|
15
15
|
export { useNetworkState } from '../react/network.js';
|
|
16
16
|
export { a as NetworkState } from '../network-D2LsBG_k.js';
|
|
17
17
|
export { RelativeTime, RelativeTimeProps } from '../react/relative-time.js';
|
|
@@ -39,6 +39,6 @@ export { R as RecentEntry, b as RecentStore, e as createRecentStore, g as groupR
|
|
|
39
39
|
* Everything else is re-exported unchanged, so this can be the only import path in a Next
|
|
40
40
|
* app rather than a second one to remember.
|
|
41
41
|
*/
|
|
42
|
-
declare const Button:
|
|
42
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>;
|
|
43
43
|
|
|
44
44
|
export { Button, ButtonProps };
|
package/dist/next/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export { useInput } from '../chunk-U3V4EHOB.js';
|
|
3
3
|
export { PasswordStrength } from '../chunk-XQHCZAPJ.js';
|
|
4
4
|
export { Flag } from '../chunk-NPHRS2Q7.js';
|
|
5
|
-
export { Toaster } from '../chunk-
|
|
5
|
+
export { Toaster, toast, useSonner } from '../chunk-WPTBURIC.js';
|
|
6
6
|
export { useMarquee } from '../chunk-ZWR2EXHQ.js';
|
|
7
7
|
export { useSearch } from '../chunk-QQFNAKMY.js';
|
|
8
8
|
export { useNetworkState } from '../chunk-S653GLSF.js';
|
package/dist/react/button.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
|
|
3
3
|
import { c as ButtonOptions, d as ButtonState } from '../button-CaXaqG_K.js';
|
|
4
4
|
|
|
@@ -70,6 +70,6 @@ interface ButtonProps extends ButtonOptions, Omit<ComponentPropsWithoutRef<"butt
|
|
|
70
70
|
*/
|
|
71
71
|
asChild?: boolean;
|
|
72
72
|
}
|
|
73
|
-
declare const Button:
|
|
73
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>;
|
|
74
74
|
|
|
75
75
|
export { Button, type ButtonProps };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -4,16 +4,16 @@ import { d as InputOptions } from '../input-BwXjFenq.js';
|
|
|
4
4
|
export { I as InputAction, b as InputIcon } from '../input-BwXjFenq.js';
|
|
5
5
|
import { RefObject, ElementType, ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
6
6
|
export { UseSearchResult, useSearch } from './search.js';
|
|
7
|
-
export { F as FuseConstructor, a as FuseLike, S as SearchInstance, b as SearchMatch, c as SearchOptions } from '../search-
|
|
7
|
+
export { F as FuseConstructor, a as FuseLike, S as SearchInstance, b as SearchMatch, c as SearchOptions } from '../search-BD9-5O5U.js';
|
|
8
8
|
import { d as ButtonState, c as ButtonOptions } from '../button-CaXaqG_K.js';
|
|
9
9
|
export { Button, ButtonProps } from './button.js';
|
|
10
|
-
import { f as PasswordStrengthClassNames } from '../index-
|
|
11
|
-
export { B as BreachChecker, a as BreachState, b as BreachStatus, F as FieldAction, I as Input, c as InputBaseProps, d as InputProps, e as InputType, P as PasswordOnlyProps, g as PlainOnlyProps, S as SearchOnlyProps } from '../index-
|
|
10
|
+
import { f as PasswordStrengthClassNames } from '../index-BHpOZncw.js';
|
|
11
|
+
export { B as BreachChecker, a as BreachState, b as BreachStatus, F as FieldAction, I as Input, c as InputBaseProps, d as InputProps, e as InputType, P as PasswordOnlyProps, g as PlainOnlyProps, S as SearchOnlyProps } from '../index-BHpOZncw.js';
|
|
12
12
|
import { b as PasswordStrengthReport } from '../password-C8lG4Zm9.js';
|
|
13
13
|
export { E as EstimateOptions, G as GeneratePasswordOptions, a as PasswordScore, e as estimatePasswordStrength, g as generatePassword } from '../password-C8lG4Zm9.js';
|
|
14
14
|
export { Slot, SlotProps, mergeSlotProps } from './slot.js';
|
|
15
15
|
export { UseNotificationsResult, createNotificationQueue, defaultQueue, useNotifications } from './notifications.js';
|
|
16
|
-
export {
|
|
16
|
+
export { Action, ExternalToast, ToastClassnames, ToastT, Toaster, ToasterProps, toast, useSonner } from './toast.js';
|
|
17
17
|
export { useNetworkState } from './network.js';
|
|
18
18
|
export { a as NetworkState } from '../network-D2LsBG_k.js';
|
|
19
19
|
export { RelativeTime, RelativeTimeProps } from './relative-time.js';
|
package/dist/react/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export { useInput } from '../chunk-U3V4EHOB.js';
|
|
3
3
|
export { PasswordStrength } from '../chunk-XQHCZAPJ.js';
|
|
4
4
|
export { Flag } from '../chunk-NPHRS2Q7.js';
|
|
5
|
-
export { Toaster } from '../chunk-
|
|
5
|
+
export { Toaster, toast, useSonner } from '../chunk-WPTBURIC.js';
|
|
6
6
|
export { useMarquee } from '../chunk-ZWR2EXHQ.js';
|
|
7
7
|
export { useSearch } from '../chunk-QQFNAKMY.js';
|
|
8
8
|
export { useNetworkState } from '../chunk-S653GLSF.js';
|
package/dist/react/input.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BreachChecker, a as BreachState, b as BreachStatus, F as FieldAction, I as Input, c as InputBaseProps, d as InputProps, e as InputType, P as PasswordOnlyProps, g as PlainOnlyProps, S as SearchOnlyProps } from '../index-
|
|
1
|
+
export { B as BreachChecker, a as BreachState, b as BreachStatus, F as FieldAction, I as Input, c as InputBaseProps, d as InputProps, e as InputType, P as PasswordOnlyProps, g as PlainOnlyProps, S as SearchOnlyProps } from '../index-BHpOZncw.js';
|
|
2
2
|
import 'react';
|
|
3
|
-
import '../search-
|
|
3
|
+
import '../search-BD9-5O5U.js';
|
|
4
4
|
import '../password-C8lG4Zm9.js';
|
package/dist/react/palette.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
-
import { b as SearchMatch, c as SearchOptions } from '../search-
|
|
2
|
+
import { b as SearchMatch, c as SearchOptions } from '../search-BD9-5O5U.js';
|
|
3
3
|
import { R as RecentEntry } from '../palette-D7iuQh_T.js';
|
|
4
4
|
|
|
5
5
|
/** One line in the palette, whatever it came from. */
|
package/dist/react/search.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
-
import { b as SearchMatch, c as SearchOptions } from '../search-
|
|
2
|
+
import { b as SearchMatch, c as SearchOptions } from '../search-BD9-5O5U.js';
|
|
3
3
|
|
|
4
4
|
interface UseSearchResult<T> {
|
|
5
5
|
/** Attach to the search field, or drive it yourself with `search`. */
|
package/dist/react/slot.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -42,6 +42,6 @@ interface SlotProps extends Props {
|
|
|
42
42
|
* papering over: `asChild` with two children has no answer to "which one gets the
|
|
43
43
|
* behaviour", and rendering nothing would be a blank space nobody can debug.
|
|
44
44
|
*/
|
|
45
|
-
declare const Slot:
|
|
45
|
+
declare const Slot: React.ForwardRefExoticComponent<Omit<SlotProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
46
46
|
|
|
47
47
|
export { Slot, type SlotProps, mergeSlotProps };
|
package/dist/react/toast.d.ts
CHANGED
|
@@ -1,40 +1,174 @@
|
|
|
1
|
-
import { d as Notifications
|
|
2
|
-
|
|
1
|
+
import { d as Notifications } from '../notifications-BpVV6sel.js';
|
|
2
|
+
export { N as Notification, a as NotificationAction, b as NotificationInput, c as NotificationTone } from '../notifications-BpVV6sel.js';
|
|
3
|
+
import React__default, { ReactNode } from 'react';
|
|
4
|
+
export { createNotificationQueue, defaultQueue, useNotifications } from './notifications.js';
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
type ToastTypes = "normal" | "action" | "success" | "info" | "warning" | "error" | "loading" | "default";
|
|
7
|
+
type PromiseT<Data = any> = Promise<Data> | (() => Promise<Data>);
|
|
8
|
+
type PromiseTResult<Data = any> = string | React__default.ReactNode | ((data: Data) => React__default.ReactNode | string | Promise<React__default.ReactNode | string>);
|
|
9
|
+
type PromiseExternalToast = Omit<ExternalToast, "description">;
|
|
10
|
+
type PromiseData<ToastData = any> = PromiseExternalToast & {
|
|
11
|
+
loading?: string | React__default.ReactNode;
|
|
12
|
+
success?: PromiseTResult<ToastData>;
|
|
13
|
+
error?: PromiseTResult;
|
|
14
|
+
description?: PromiseTResult;
|
|
15
|
+
finally?: () => void | Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
interface ToastClassnames {
|
|
18
|
+
toast?: string;
|
|
19
|
+
title?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
loader?: string;
|
|
22
|
+
closeButton?: string;
|
|
23
|
+
cancelButton?: string;
|
|
24
|
+
actionButton?: string;
|
|
25
|
+
success?: string;
|
|
26
|
+
error?: string;
|
|
27
|
+
info?: string;
|
|
28
|
+
warning?: string;
|
|
29
|
+
loading?: string;
|
|
30
|
+
default?: string;
|
|
31
|
+
content?: string;
|
|
32
|
+
icon?: string;
|
|
33
|
+
}
|
|
34
|
+
interface ToastIcons {
|
|
35
|
+
success?: React__default.ReactNode;
|
|
36
|
+
info?: React__default.ReactNode;
|
|
37
|
+
warning?: React__default.ReactNode;
|
|
38
|
+
error?: React__default.ReactNode;
|
|
39
|
+
loading?: React__default.ReactNode;
|
|
40
|
+
close?: React__default.ReactNode;
|
|
41
|
+
}
|
|
42
|
+
interface Action {
|
|
43
|
+
label: React__default.ReactNode;
|
|
44
|
+
onClick: (event: React__default.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
45
|
+
actionButtonStyle?: React__default.CSSProperties;
|
|
46
|
+
}
|
|
47
|
+
interface ToastT {
|
|
48
|
+
id: number | string;
|
|
49
|
+
title?: (() => React__default.ReactNode) | React__default.ReactNode;
|
|
50
|
+
type?: ToastTypes;
|
|
51
|
+
icon?: React__default.ReactNode;
|
|
52
|
+
jsx?: React__default.ReactNode;
|
|
53
|
+
richColors?: boolean;
|
|
54
|
+
invert?: boolean;
|
|
55
|
+
closeButton?: boolean;
|
|
56
|
+
dismissible?: boolean;
|
|
57
|
+
description?: (() => React__default.ReactNode) | React__default.ReactNode;
|
|
58
|
+
duration?: number;
|
|
59
|
+
delete?: boolean;
|
|
60
|
+
action?: Action | React__default.ReactNode;
|
|
61
|
+
cancel?: Action | React__default.ReactNode;
|
|
62
|
+
onDismiss?: (toast: ToastT) => void;
|
|
63
|
+
onAutoClose?: (toast: ToastT) => void;
|
|
64
|
+
promise?: PromiseT;
|
|
65
|
+
cancelButtonStyle?: React__default.CSSProperties;
|
|
66
|
+
actionButtonStyle?: React__default.CSSProperties;
|
|
67
|
+
style?: React__default.CSSProperties;
|
|
68
|
+
unstyled?: boolean;
|
|
69
|
+
className?: string;
|
|
70
|
+
classNames?: ToastClassnames;
|
|
71
|
+
descriptionClassName?: string;
|
|
72
|
+
position?: Position;
|
|
73
|
+
}
|
|
74
|
+
type Position = "top-left" | "top-right" | "bottom-left" | "bottom-right" | "top-center" | "bottom-center";
|
|
75
|
+
interface ToastOptions {
|
|
76
|
+
className?: string;
|
|
77
|
+
closeButton?: boolean;
|
|
78
|
+
descriptionClassName?: string;
|
|
79
|
+
style?: React__default.CSSProperties;
|
|
80
|
+
cancelButtonStyle?: React__default.CSSProperties;
|
|
81
|
+
actionButtonStyle?: React__default.CSSProperties;
|
|
82
|
+
duration?: number;
|
|
83
|
+
unstyled?: boolean;
|
|
84
|
+
classNames?: ToastClassnames;
|
|
85
|
+
}
|
|
86
|
+
type Offset = {
|
|
87
|
+
top?: string | number;
|
|
88
|
+
right?: string | number;
|
|
89
|
+
bottom?: string | number;
|
|
90
|
+
left?: string | number;
|
|
91
|
+
} | string | number;
|
|
92
|
+
interface ToasterProps$1 {
|
|
93
|
+
invert?: boolean;
|
|
94
|
+
theme?: "light" | "dark" | "system";
|
|
95
|
+
position?: Position;
|
|
96
|
+
hotkey?: string[];
|
|
97
|
+
richColors?: boolean;
|
|
98
|
+
expand?: boolean;
|
|
99
|
+
duration?: number;
|
|
100
|
+
gap?: number;
|
|
101
|
+
visibleToasts?: number;
|
|
102
|
+
closeButton?: boolean;
|
|
103
|
+
toastOptions?: ToastOptions;
|
|
104
|
+
className?: string;
|
|
105
|
+
style?: React__default.CSSProperties;
|
|
106
|
+
offset?: Offset;
|
|
107
|
+
mobileOffset?: Offset;
|
|
108
|
+
dir?: "rtl" | "ltr" | "auto";
|
|
109
|
+
swipeDirections?: SwipeDirection[];
|
|
20
110
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
111
|
+
* @deprecated Please use the `icons` prop instead:
|
|
112
|
+
* ```jsx
|
|
113
|
+
* <Toaster
|
|
114
|
+
* icons={{ loading: <LoadingIcon /> }}
|
|
115
|
+
* />
|
|
116
|
+
* ```
|
|
24
117
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
children?: (notification: Notification, controls: ToastControls) => ReactNode;
|
|
30
|
-
/** Accessible name for the region. */
|
|
31
|
-
label?: string;
|
|
32
|
-
className?: string;
|
|
33
|
-
style?: CSSProperties;
|
|
118
|
+
loadingIcon?: React__default.ReactNode;
|
|
119
|
+
icons?: ToastIcons;
|
|
120
|
+
containerAriaLabel?: string;
|
|
121
|
+
pauseWhenPageIsHidden?: boolean;
|
|
34
122
|
}
|
|
35
|
-
|
|
36
|
-
|
|
123
|
+
type SwipeDirection = "top" | "right" | "bottom" | "left";
|
|
124
|
+
interface ToastToDismiss {
|
|
125
|
+
id: number | string;
|
|
126
|
+
dismiss: boolean;
|
|
127
|
+
}
|
|
128
|
+
type ExternalToast = Omit<ToastT, "id" | "type" | "title" | "jsx" | "delete" | "promise"> & {
|
|
129
|
+
id?: number | string;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
type titleT = (() => React__default.ReactNode) | React__default.ReactNode;
|
|
133
|
+
declare const toast: ((message: titleT, data?: ExternalToast) => string | number) & {
|
|
134
|
+
success: (message: titleT | React__default.ReactNode, data?: ExternalToast) => string | number;
|
|
135
|
+
info: (message: titleT | React__default.ReactNode, data?: ExternalToast) => string | number;
|
|
136
|
+
warning: (message: titleT | React__default.ReactNode, data?: ExternalToast) => string | number;
|
|
137
|
+
error: (message: titleT | React__default.ReactNode, data?: ExternalToast) => string | number;
|
|
138
|
+
custom: (jsx: (id: number | string) => React__default.ReactElement, data?: ExternalToast) => string | number;
|
|
139
|
+
message: (message: titleT | React__default.ReactNode, data?: ExternalToast) => string | number;
|
|
140
|
+
promise: <ToastData>(promise: PromiseT<ToastData>, data?: PromiseData<ToastData> | undefined) => (string & {
|
|
141
|
+
unwrap: () => Promise<ToastData>;
|
|
142
|
+
}) | (number & {
|
|
143
|
+
unwrap: () => Promise<ToastData>;
|
|
144
|
+
}) | {
|
|
145
|
+
unwrap: () => Promise<ToastData>;
|
|
146
|
+
} | undefined;
|
|
147
|
+
dismiss: (id?: number | string) => string | number | undefined;
|
|
148
|
+
loading: (message: titleT | React__default.ReactNode, data?: ExternalToast) => string | number;
|
|
149
|
+
} & {
|
|
150
|
+
getHistory: () => (ToastT | ToastToDismiss)[];
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
declare function useSonner(): {
|
|
154
|
+
toasts: ToastT[];
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
interface ToasterProps extends ToasterProps$1 {
|
|
158
|
+
/**
|
|
159
|
+
* Inject the stylesheet. On by default - see the note above. `false` leaves the markup
|
|
160
|
+
* bare for a theme of your own.
|
|
161
|
+
*/
|
|
162
|
+
styles?: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* A notification QUEUE to render, alongside anything raised with `toast()`.
|
|
165
|
+
*
|
|
166
|
+
* This is the bridge for `useNotifications().notify()`, which predates the vendored
|
|
167
|
+
* component: everything already written against the queue keeps working, and both APIs
|
|
168
|
+
* end up in one stack rather than in two competing ones. `null` unsubscribes.
|
|
169
|
+
*/
|
|
170
|
+
queue?: Notifications | null;
|
|
37
171
|
}
|
|
38
|
-
declare function Toaster({
|
|
172
|
+
declare function Toaster({ styles, queue, ...props }: ToasterProps): ReactNode;
|
|
39
173
|
|
|
40
|
-
export { type
|
|
174
|
+
export { type Action, type ExternalToast, Notifications, type ToastClassnames, type ToastT, Toaster, type ToasterProps, toast, useSonner };
|
package/dist/react/toast.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { Toaster } from '../chunk-
|
|
3
|
-
|
|
2
|
+
export { Toaster, toast, useSonner } from '../chunk-WPTBURIC.js';
|
|
3
|
+
export { createNotificationQueue, defaultQueue, useNotifications } from '../chunk-QYMUIW5I.js';
|
|
4
4
|
import '../chunk-SNYUBXWQ.js';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ButtonProps } from '../react/button.js';
|
|
3
3
|
export { UseMarqueeResult, useMarquee } from '../react/marquee.js';
|
|
4
4
|
export { M as MarqueeHover, a as MarqueeInstance, b as MarqueeOptions } from '../marquee-CJ3Uwy3E.js';
|
|
5
5
|
export { PasswordStrength, PasswordStrengthProps, UseButtonResult, UseInputResult, getLinkComponent, setLinkComponent, useButton, useInput } from '../react/index.js';
|
|
6
6
|
export { UseSearchResult, useSearch } from '../react/search.js';
|
|
7
7
|
export { I as InputAction, b as InputIcon, d as InputOptions } from '../input-BwXjFenq.js';
|
|
8
|
-
export { F as FuseConstructor, a as FuseLike, S as SearchInstance, b as SearchMatch, c as SearchOptions } from '../search-
|
|
8
|
+
export { F as FuseConstructor, a as FuseLike, S as SearchInstance, b as SearchMatch, c as SearchOptions } from '../search-BD9-5O5U.js';
|
|
9
9
|
export { c as ButtonOptions, d as ButtonState } from '../button-CaXaqG_K.js';
|
|
10
|
-
export { B as BreachChecker, a as BreachState, b as BreachStatus, F as FieldAction, I as Input, c as InputBaseProps, d as InputProps, e as InputType, P as PasswordOnlyProps, g as PlainOnlyProps, S as SearchOnlyProps } from '../index-
|
|
10
|
+
export { B as BreachChecker, a as BreachState, b as BreachStatus, F as FieldAction, I as Input, c as InputBaseProps, d as InputProps, e as InputType, P as PasswordOnlyProps, g as PlainOnlyProps, S as SearchOnlyProps } from '../index-BHpOZncw.js';
|
|
11
11
|
export { Slot, SlotProps, mergeSlotProps } from '../react/slot.js';
|
|
12
12
|
export { E as EstimateOptions, G as GeneratePasswordOptions, a as PasswordScore, b as PasswordStrengthReport, e as estimatePasswordStrength, g as generatePassword } from '../password-C8lG4Zm9.js';
|
|
13
13
|
export { UseNotificationsResult, createNotificationQueue, defaultQueue, useNotifications } from '../react/notifications.js';
|
|
14
|
-
export {
|
|
14
|
+
export { Action, ExternalToast, ToastClassnames, ToastT, Toaster, ToasterProps, toast, useSonner } from '../react/toast.js';
|
|
15
15
|
export { useNetworkState } from '../react/network.js';
|
|
16
16
|
export { a as NetworkState } from '../network-D2LsBG_k.js';
|
|
17
17
|
export { RelativeTime, RelativeTimeProps } from '../react/relative-time.js';
|
|
@@ -22,6 +22,6 @@ export { c as FlagFormat, d as FlagOptions, e as FlagShape, f as FlagSource, h a
|
|
|
22
22
|
export { PaletteContent, PaletteContextValue, PaletteField, PaletteFooter, PaletteItem, PaletteList, PaletteListProps, PaletteRoot, PaletteRootProps, PaletteRow, PaletteSection, PaletteTrigger, SearchPalette, SearchPaletteProps, usePaletteContext } from '../react/palette.js';
|
|
23
23
|
export { R as RecentEntry, b as RecentStore, e as createRecentStore, g as groupRows, i as isPaletteShortcut, m as moveActive, r as recentKey, s as shortcutLabel } from '../palette-D7iuQh_T.js';
|
|
24
24
|
|
|
25
|
-
declare const Button:
|
|
25
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>;
|
|
26
26
|
|
|
27
27
|
export { Button, ButtonProps };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export { useInput } from '../chunk-U3V4EHOB.js';
|
|
3
3
|
export { PasswordStrength } from '../chunk-XQHCZAPJ.js';
|
|
4
4
|
export { Flag } from '../chunk-NPHRS2Q7.js';
|
|
5
|
-
export { Toaster } from '../chunk-
|
|
5
|
+
export { Toaster, toast, useSonner } from '../chunk-WPTBURIC.js';
|
|
6
6
|
export { useMarquee } from '../chunk-ZWR2EXHQ.js';
|
|
7
7
|
export { useSearch } from '../chunk-QQFNAKMY.js';
|
|
8
8
|
export { useNetworkState } from '../chunk-S653GLSF.js';
|
package/dist/search/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as SearchOptions, S as SearchInstance } from '../search-
|
|
2
|
-
export { b as SearchMatch } from '../search-
|
|
1
|
+
import { c as SearchOptions, S as SearchInstance } from '../search-BD9-5O5U.js';
|
|
2
|
+
export { b as SearchMatch } from '../search-BD9-5O5U.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Search with Fuse.js already wired: the batteries-included entry point.
|
|
@@ -17,10 +17,15 @@ interface SearchMatch<T> {
|
|
|
17
17
|
}
|
|
18
18
|
/** The shape of Fuse's constructor, declared here so the package need not depend on it. */
|
|
19
19
|
interface FuseLike<T> {
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Readonly arrays, because Fuse's own signature returns them - and a mutable array is
|
|
22
|
+
* not assignable to one, so the stricter shape made `fuse={Fuse}` a type error at the
|
|
23
|
+
* call site while working perfectly at runtime.
|
|
24
|
+
*/
|
|
25
|
+
search(query: string): readonly {
|
|
21
26
|
item: T;
|
|
22
27
|
score?: number;
|
|
23
|
-
matches?: {
|
|
28
|
+
matches?: readonly {
|
|
24
29
|
key?: string;
|
|
25
30
|
}[];
|
|
26
31
|
}[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enigmax/primitives",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Headless components: the behaviour, the timing and the accessibility, with no styles of their own. Framework-agnostic core plus thin adapters.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|