@radix-ui/react-toast 1.2.0-rc.2 → 1.2.0-rc.4

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/index.d.mts CHANGED
@@ -1,12 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import * as DismissableLayer from '@radix-ui/react-dismissable-layer';
3
- import * as Radix from '@radix-ui/react-primitive';
4
3
  import { Primitive } from '@radix-ui/react-primitive';
5
4
 
6
- declare type Scope<C = any> = {
5
+ type Scope<C = any> = {
7
6
  [scopeName: string]: React.Context<C>[];
8
7
  } | undefined;
9
- declare type ScopeHook = (scope: Scope) => {
8
+ type ScopeHook = (scope: Scope) => {
10
9
  [__scopeProp: string]: Scope;
11
10
  };
12
11
  interface CreateScope {
@@ -14,7 +13,7 @@ interface CreateScope {
14
13
  (): ScopeHook;
15
14
  }
16
15
 
17
- declare type SwipeDirection = 'up' | 'down' | 'left' | 'right';
16
+ type SwipeDirection = 'up' | 'down' | 'left' | 'right';
18
17
  declare const createToastScope: CreateScope;
19
18
  interface ToastProviderProps {
20
19
  children?: React.ReactNode;
@@ -41,7 +40,7 @@ interface ToastProviderProps {
41
40
  swipeThreshold?: number;
42
41
  }
43
42
  declare const ToastProvider: React.FC<ToastProviderProps>;
44
- declare type PrimitiveOrderedListProps = Radix.ComponentPropsWithoutRef<typeof Primitive.ol>;
43
+ type PrimitiveOrderedListProps = React.ComponentPropsWithoutRef<typeof Primitive.ol>;
45
44
  interface ToastViewportProps extends PrimitiveOrderedListProps {
46
45
  /**
47
46
  * The keys to use as the keyboard shortcut that will move focus to the toast viewport.
@@ -56,7 +55,7 @@ interface ToastViewportProps extends PrimitiveOrderedListProps {
56
55
  label?: string;
57
56
  }
58
57
  declare const ToastViewport: React.ForwardRefExoticComponent<ToastViewportProps & React.RefAttributes<HTMLOListElement>>;
59
- declare type ToastElement = ToastImplElement;
58
+ type ToastElement = ToastImplElement;
60
59
  interface ToastProps extends Omit<ToastImplProps, keyof ToastImplPrivateProps> {
61
60
  open?: boolean;
62
61
  defaultOpen?: boolean;
@@ -68,7 +67,7 @@ interface ToastProps extends Omit<ToastImplProps, keyof ToastImplPrivateProps> {
68
67
  forceMount?: true;
69
68
  }
70
69
  declare const Toast: React.ForwardRefExoticComponent<ToastProps & React.RefAttributes<HTMLLIElement>>;
71
- declare type SwipeEvent = {
70
+ type SwipeEvent = {
72
71
  currentTarget: EventTarget & ToastElement;
73
72
  } & Omit<CustomEvent<{
74
73
  originalEvent: React.PointerEvent;
@@ -77,13 +76,13 @@ declare type SwipeEvent = {
77
76
  y: number;
78
77
  };
79
78
  }>, 'currentTarget'>;
80
- declare type ToastImplElement = React.ElementRef<typeof Primitive.li>;
81
- declare type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer.Root>;
82
- declare type ToastImplPrivateProps = {
79
+ type ToastImplElement = React.ElementRef<typeof Primitive.li>;
80
+ type DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer.Root>;
81
+ type ToastImplPrivateProps = {
83
82
  open: boolean;
84
83
  onClose(): void;
85
84
  };
86
- declare type PrimitiveListItemProps = Radix.ComponentPropsWithoutRef<typeof Primitive.li>;
85
+ type PrimitiveListItemProps = React.ComponentPropsWithoutRef<typeof Primitive.li>;
87
86
  interface ToastImplProps extends ToastImplPrivateProps, PrimitiveListItemProps {
88
87
  type?: 'foreground' | 'background';
89
88
  /**
@@ -99,7 +98,7 @@ interface ToastImplProps extends ToastImplPrivateProps, PrimitiveListItemProps {
99
98
  onSwipeCancel?(event: SwipeEvent): void;
100
99
  onSwipeEnd?(event: SwipeEvent): void;
101
100
  }
102
- declare type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
101
+ type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
103
102
  interface ToastTitleProps extends PrimitiveDivProps {
104
103
  }
105
104
  declare const ToastTitle: React.ForwardRefExoticComponent<ToastTitleProps & React.RefAttributes<HTMLDivElement>>;
@@ -116,7 +115,7 @@ interface ToastActionProps extends ToastCloseProps {
116
115
  altText: string;
117
116
  }
118
117
  declare const ToastAction: React.ForwardRefExoticComponent<ToastActionProps & React.RefAttributes<HTMLButtonElement>>;
119
- declare type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
118
+ type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
120
119
  interface ToastCloseProps extends PrimitiveButtonProps {
121
120
  }
122
121
  declare const ToastClose: React.ForwardRefExoticComponent<ToastCloseProps & React.RefAttributes<HTMLButtonElement>>;
package/dist/index.d.ts CHANGED
@@ -1,12 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import * as DismissableLayer from '@radix-ui/react-dismissable-layer';
3
- import * as Radix from '@radix-ui/react-primitive';
4
3
  import { Primitive } from '@radix-ui/react-primitive';
5
4
 
6
- declare type Scope<C = any> = {
5
+ type Scope<C = any> = {
7
6
  [scopeName: string]: React.Context<C>[];
8
7
  } | undefined;
9
- declare type ScopeHook = (scope: Scope) => {
8
+ type ScopeHook = (scope: Scope) => {
10
9
  [__scopeProp: string]: Scope;
11
10
  };
12
11
  interface CreateScope {
@@ -14,7 +13,7 @@ interface CreateScope {
14
13
  (): ScopeHook;
15
14
  }
16
15
 
17
- declare type SwipeDirection = 'up' | 'down' | 'left' | 'right';
16
+ type SwipeDirection = 'up' | 'down' | 'left' | 'right';
18
17
  declare const createToastScope: CreateScope;
19
18
  interface ToastProviderProps {
20
19
  children?: React.ReactNode;
@@ -41,7 +40,7 @@ interface ToastProviderProps {
41
40
  swipeThreshold?: number;
42
41
  }
43
42
  declare const ToastProvider: React.FC<ToastProviderProps>;
44
- declare type PrimitiveOrderedListProps = Radix.ComponentPropsWithoutRef<typeof Primitive.ol>;
43
+ type PrimitiveOrderedListProps = React.ComponentPropsWithoutRef<typeof Primitive.ol>;
45
44
  interface ToastViewportProps extends PrimitiveOrderedListProps {
46
45
  /**
47
46
  * The keys to use as the keyboard shortcut that will move focus to the toast viewport.
@@ -56,7 +55,7 @@ interface ToastViewportProps extends PrimitiveOrderedListProps {
56
55
  label?: string;
57
56
  }
58
57
  declare const ToastViewport: React.ForwardRefExoticComponent<ToastViewportProps & React.RefAttributes<HTMLOListElement>>;
59
- declare type ToastElement = ToastImplElement;
58
+ type ToastElement = ToastImplElement;
60
59
  interface ToastProps extends Omit<ToastImplProps, keyof ToastImplPrivateProps> {
61
60
  open?: boolean;
62
61
  defaultOpen?: boolean;
@@ -68,7 +67,7 @@ interface ToastProps extends Omit<ToastImplProps, keyof ToastImplPrivateProps> {
68
67
  forceMount?: true;
69
68
  }
70
69
  declare const Toast: React.ForwardRefExoticComponent<ToastProps & React.RefAttributes<HTMLLIElement>>;
71
- declare type SwipeEvent = {
70
+ type SwipeEvent = {
72
71
  currentTarget: EventTarget & ToastElement;
73
72
  } & Omit<CustomEvent<{
74
73
  originalEvent: React.PointerEvent;
@@ -77,13 +76,13 @@ declare type SwipeEvent = {
77
76
  y: number;
78
77
  };
79
78
  }>, 'currentTarget'>;
80
- declare type ToastImplElement = React.ElementRef<typeof Primitive.li>;
81
- declare type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer.Root>;
82
- declare type ToastImplPrivateProps = {
79
+ type ToastImplElement = React.ElementRef<typeof Primitive.li>;
80
+ type DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer.Root>;
81
+ type ToastImplPrivateProps = {
83
82
  open: boolean;
84
83
  onClose(): void;
85
84
  };
86
- declare type PrimitiveListItemProps = Radix.ComponentPropsWithoutRef<typeof Primitive.li>;
85
+ type PrimitiveListItemProps = React.ComponentPropsWithoutRef<typeof Primitive.li>;
87
86
  interface ToastImplProps extends ToastImplPrivateProps, PrimitiveListItemProps {
88
87
  type?: 'foreground' | 'background';
89
88
  /**
@@ -99,7 +98,7 @@ interface ToastImplProps extends ToastImplPrivateProps, PrimitiveListItemProps {
99
98
  onSwipeCancel?(event: SwipeEvent): void;
100
99
  onSwipeEnd?(event: SwipeEvent): void;
101
100
  }
102
- declare type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
101
+ type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
103
102
  interface ToastTitleProps extends PrimitiveDivProps {
104
103
  }
105
104
  declare const ToastTitle: React.ForwardRefExoticComponent<ToastTitleProps & React.RefAttributes<HTMLDivElement>>;
@@ -116,7 +115,7 @@ interface ToastActionProps extends ToastCloseProps {
116
115
  altText: string;
117
116
  }
118
117
  declare const ToastAction: React.ForwardRefExoticComponent<ToastActionProps & React.RefAttributes<HTMLButtonElement>>;
119
- declare type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
118
+ type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
120
119
  interface ToastCloseProps extends PrimitiveButtonProps {
121
120
  }
122
121
  declare const ToastClose: React.ForwardRefExoticComponent<ToastCloseProps & React.RefAttributes<HTMLButtonElement>>;