@tamagui/portal 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/portal",
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",
@@ -20,8 +20,8 @@
20
20
  "clean:build": "tamagui-build clean:build"
21
21
  },
22
22
  "dependencies": {
23
- "@tamagui/core": "^1.0.1-beta.166",
24
- "@tamagui/stacks": "^1.0.1-beta.166"
23
+ "@tamagui/core": "^1.0.1-beta.168",
24
+ "@tamagui/stacks": "^1.0.1-beta.168"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "react": "*",
@@ -29,7 +29,7 @@
29
29
  "react-native": "*"
30
30
  },
31
31
  "devDependencies": {
32
- "@tamagui/build": "^1.0.1-beta.166",
32
+ "@tamagui/build": "^1.0.1-beta.168",
33
33
  "@types/react-native": "^0.69.2",
34
34
  "react": "*",
35
35
  "react-dom": "*",
@@ -36,21 +36,70 @@ export declare const usePortal: (hostName?: string) => {
36
36
  removePortal: (name: string) => void;
37
37
  };
38
38
  export interface PortalProviderProps {
39
+ /**
40
+ * Defines whether to add a default root host or not.
41
+ *
42
+ * @default true
43
+ * @type boolean
44
+ */
39
45
  shouldAddRootHost?: boolean;
46
+ /**
47
+ * Defines the root portal host name.
48
+ *
49
+ * @default "root"
50
+ * @type string
51
+ */
40
52
  rootHostName?: string;
41
53
  children: ReactNode | ReactNode[];
42
54
  }
43
55
  export declare const PortalProvider: React.MemoExoticComponent<({ rootHostName, shouldAddRootHost, children, }: PortalProviderProps) => JSX.Element>;
44
56
  export interface PortalHostProps {
57
+ /**
58
+ * Host's key or name to be used as an identifier.
59
+ * @type string
60
+ */
45
61
  name: string;
46
62
  }
47
63
  export declare const PortalHost: React.MemoExoticComponent<({ name }: PortalHostProps) => JSX.Element>;
48
64
  export interface PortalItemProps {
65
+ /**
66
+ * Portal's key or name to be used as an identifier.
67
+ * @type string
68
+ * @default nanoid generated unique key.
69
+ */
49
70
  name?: string;
71
+ /**
72
+ * Host's name to teleport the portal content to.
73
+ * @type string
74
+ * @default 'root'
75
+ */
50
76
  hostName?: string;
77
+ /**
78
+ * Override internal mounting functionality, this is useful
79
+ * if you want to trigger any action before mounting the portal content.
80
+ * @type (mount?: () => void) => void
81
+ * @default undefined
82
+ */
51
83
  handleOnMount?: (mount: () => void) => void;
84
+ /**
85
+ * Override internal un-mounting functionality, this is useful
86
+ * if you want to trigger any action before un-mounting the portal content.
87
+ * @type (unmount?: () => void) => void
88
+ * @default undefined
89
+ */
52
90
  handleOnUnmount?: (unmount: () => void) => void;
91
+ /**
92
+ * Override internal updating functionality, this is useful
93
+ * if you want to trigger any action before updating the portal content.
94
+ * @type (update?: () => void) => void
95
+ * @default undefined
96
+ */
53
97
  handleOnUpdate?: (update: () => void) => void;
98
+ /**
99
+ * Portal's content.
100
+ * @type ReactNode
101
+ * @default undefined
102
+ */
54
103
  children?: ReactNode | ReactNode[];
55
104
  }
56
105
  export declare const PortalItem: React.MemoExoticComponent<({ name, hostName, handleOnMount, handleOnUnmount, handleOnUpdate, children, }: PortalItemProps) => null>;