@tamagui/dismissable 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/dismissable",
3
- "version": "1.0.1-beta.166",
3
+ "version": "1.0.1-beta.168",
4
4
  "sideEffects": true,
5
5
  "source": "src/index.ts",
6
6
  "types": "./types/index.d.ts",
@@ -22,16 +22,16 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@radix-ui/react-use-escape-keydown": "^0.1.0",
25
- "@tamagui/compose-refs": "^1.0.1-beta.166",
26
- "@tamagui/core": "^1.0.1-beta.166",
27
- "@tamagui/use-event": "^1.0.1-beta.166"
25
+ "@tamagui/compose-refs": "^1.0.1-beta.168",
26
+ "@tamagui/core": "^1.0.1-beta.168",
27
+ "@tamagui/use-event": "^1.0.1-beta.168"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "react": "*",
31
31
  "react-dom": "*"
32
32
  },
33
33
  "devDependencies": {
34
- "@tamagui/build": "^1.0.1-beta.166",
34
+ "@tamagui/build": "^1.0.1-beta.168",
35
35
  "react": "*",
36
36
  "react-dom": "*"
37
37
  },
@@ -1,12 +1,40 @@
1
1
  import React from 'react';
2
2
  import { FocusOutsideEvent, PointerDownOutsideEvent } from './Dismissable';
3
3
  export interface DismissableProps {
4
+ /**
5
+ * When `true`, hover/focus/click interactions will be disabled on elements outside
6
+ * the `Dismissable`. Users will need to click twice on outside elements to
7
+ * interact with them: once to close the `Dismissable`, and again to trigger the element.
8
+ */
4
9
  disableOutsidePointerEvents?: boolean;
10
+ /**
11
+ * Event handler called when the escape key is down.
12
+ * Can be prevented.
13
+ */
5
14
  onEscapeKeyDown?: (event: KeyboardEvent) => void;
15
+ /**
16
+ * Event handler called when the a `pointerdown` event happens outside of the `Dismissable`.
17
+ * Can be prevented.
18
+ */
6
19
  onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;
20
+ /**
21
+ * Event handler called when the focus moves outside of the `Dismissable`.
22
+ * Can be prevented.
23
+ */
7
24
  onFocusOutside?: (event: FocusOutsideEvent) => void;
25
+ /**
26
+ * Event handler called when an interaction happens outside the `Dismissable`.
27
+ * Specifically, when a `pointerdown` event happens outside or focus moves outside of it.
28
+ * Can be prevented.
29
+ */
8
30
  onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void;
31
+ /**
32
+ * Handler called when the `Dismissable` should be dismissed
33
+ */
9
34
  onDismiss?: () => void;
35
+ /**
36
+ * When using animations on exit, may want to simualte force unmount early
37
+ */
10
38
  forceUnmount?: boolean;
11
39
  children?: React.ReactNode;
12
40
  }