@tamagui/toast 1.0.1-beta.166 → 1.0.1-beta.168

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.
Files changed (2) hide show
  1. package/package.json +13 -13
  2. package/types/Toast.d.ts +40 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/toast",
3
- "version": "1.0.1-beta.166",
3
+ "version": "1.0.1-beta.168",
4
4
  "source": "src/index.ts",
5
5
  "types": "./types/index.d.ts",
6
6
  "main": "dist/cjs",
@@ -23,17 +23,17 @@
23
23
  "clean:build": "tamagui-build clean:build"
24
24
  },
25
25
  "dependencies": {
26
- "@tamagui/animate-presence": "^1.0.1-beta.166",
27
- "@tamagui/compose-refs": "^1.0.1-beta.166",
28
- "@tamagui/core": "^1.0.1-beta.166",
29
- "@tamagui/create-context": "^1.0.1-beta.166",
30
- "@tamagui/dismissable": "^1.0.1-beta.166",
31
- "@tamagui/polyfill-dev": "^1.0.1-beta.166",
32
- "@tamagui/portal": "^1.0.1-beta.166",
33
- "@tamagui/stacks": "^1.0.1-beta.166",
34
- "@tamagui/text": "^1.0.1-beta.166",
35
- "@tamagui/use-controllable-state": "^1.0.1-beta.166",
36
- "@tamagui/visually-hidden": "^1.0.1-beta.166"
26
+ "@tamagui/animate-presence": "^1.0.1-beta.168",
27
+ "@tamagui/compose-refs": "^1.0.1-beta.168",
28
+ "@tamagui/core": "^1.0.1-beta.168",
29
+ "@tamagui/create-context": "^1.0.1-beta.168",
30
+ "@tamagui/dismissable": "^1.0.1-beta.168",
31
+ "@tamagui/polyfill-dev": "^1.0.1-beta.168",
32
+ "@tamagui/portal": "^1.0.1-beta.168",
33
+ "@tamagui/stacks": "^1.0.1-beta.168",
34
+ "@tamagui/text": "^1.0.1-beta.168",
35
+ "@tamagui/use-controllable-state": "^1.0.1-beta.168",
36
+ "@tamagui/visually-hidden": "^1.0.1-beta.168"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "react": "*",
@@ -41,7 +41,7 @@
41
41
  "react-native": "*"
42
42
  },
43
43
  "devDependencies": {
44
- "@tamagui/build": "^1.0.1-beta.166",
44
+ "@tamagui/build": "^1.0.1-beta.168",
45
45
  "@types/react-dom": "^18.0.3",
46
46
  "@types/react-native": "^0.69.2",
47
47
  "react": "*",
package/types/Toast.d.ts CHANGED
@@ -3,15 +3,41 @@ import * as React from 'react';
3
3
  declare type SwipeDirection = 'up' | 'down' | 'left' | 'right';
4
4
  interface ToastProviderProps {
5
5
  children?: React.ReactNode;
6
+ /**
7
+ * An author-localized label for each toast. Used to help screen reader users
8
+ * associate the interruption with a toast.
9
+ * @defaultValue 'Notification'
10
+ */
6
11
  label?: string;
12
+ /**
13
+ * Time in milliseconds that each toast should remain visible for.
14
+ * @defaultValue 5000
15
+ */
7
16
  duration?: number;
17
+ /**
18
+ * Direction of pointer swipe that should close the toast.
19
+ * @defaultValue 'right'
20
+ */
8
21
  swipeDirection?: SwipeDirection;
22
+ /**
23
+ * Distance in pixels that the swipe must pass before a close is triggered.
24
+ * @defaultValue 50
25
+ */
9
26
  swipeThreshold?: number;
10
27
  }
11
28
  declare const ToastProvider: React.FC<ToastProviderProps>;
12
29
  declare type PrimitiveOrderedListProps = any;
13
30
  interface ToastViewportProps extends PrimitiveOrderedListProps {
31
+ /**
32
+ * The keys to use as the keyboard shortcut that will move focus to the toast viewport.
33
+ * @defaultValue ['F8']
34
+ */
14
35
  hotkey?: string[];
36
+ /**
37
+ * An author-localized label for the toast viewport to provide context for screen reader users
38
+ * when navigating page landmarks. The available `{hotkey}` placeholder will be replaced for you.
39
+ * @defaultValue 'Notifications ({hotkey})'
40
+ */
15
41
  label?: string;
16
42
  }
17
43
  declare const ToastViewport: React.ForwardRefExoticComponent<Pick<ToastViewportProps, keyof ToastViewportProps> & React.RefAttributes<TamaguiElement>>;
@@ -20,6 +46,10 @@ interface ToastProps extends Omit<ToastImplProps, keyof ToastImplPrivateProps> {
20
46
  open?: boolean;
21
47
  defaultOpen?: boolean;
22
48
  onOpenChange?(open: boolean): void;
49
+ /**
50
+ * Used to force mounting when more control is needed. Useful when
51
+ * controlling animation with React animation libraries.
52
+ */
23
53
  forceMount?: true;
24
54
  }
25
55
  declare const Toast: React.ForwardRefExoticComponent<Pick<ToastProps, keyof ToastProps> & React.RefAttributes<TamaguiElement>>;
@@ -41,6 +71,10 @@ declare type ToastImplPrivateProps = {
41
71
  declare type PrimitiveListItemProps = any;
42
72
  interface ToastImplProps extends ToastImplPrivateProps, PrimitiveListItemProps {
43
73
  type?: 'foreground' | 'background';
74
+ /**
75
+ * Time in milliseconds that toast should remain visible for. Overrides value
76
+ * given to `ToastProvider`.
77
+ */
44
78
  duration?: number;
45
79
  onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];
46
80
  onSwipeStart?(event: SwipeEvent): void;
@@ -56,6 +90,12 @@ interface ToastDescriptionProps extends PrimitiveDivProps {
56
90
  }
57
91
  declare const ToastDescription: React.ForwardRefExoticComponent<Pick<ToastDescriptionProps, string | number> & React.RefAttributes<TamaguiElement>>;
58
92
  interface ToastActionProps extends ToastCloseProps {
93
+ /**
94
+ * A short description for an alternate way to carry out the action. For screen reader users
95
+ * who will not be able to navigate to the button easily/quickly.
96
+ * @example <ToastAction altText="Goto account settings to updgrade">Upgrade</ToastAction>
97
+ * @example <ToastAction altText="Undo (Alt+U)">Undo</ToastAction>
98
+ */
59
99
  altText: string;
60
100
  }
61
101
  declare const ToastAction: React.ForwardRefExoticComponent<Pick<ToastActionProps, keyof ToastActionProps> & React.RefAttributes<TamaguiElement>>;