@tamagui/sheet 3.0.0-beta.1479.1 → 3.0.0-beta.1537.1

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 (118) hide show
  1. package/dist/cjs/Sheet.cjs +29 -12
  2. package/dist/cjs/Sheet.native.cjs +29 -12
  3. package/dist/cjs/Sheet.native.js +29 -12
  4. package/dist/cjs/Sheet.native.js.map +1 -1
  5. package/dist/cjs/SheetScrollView.cjs +13 -1
  6. package/dist/cjs/SheetScrollView.native.cjs +14 -1
  7. package/dist/cjs/SheetScrollView.native.js +14 -1
  8. package/dist/cjs/SheetScrollView.native.js.map +1 -1
  9. package/dist/cjs/nativeSheet.cjs +1 -1
  10. package/dist/cjs/nativeSheet.native.cjs +66 -55
  11. package/dist/cjs/nativeSheet.native.js +66 -55
  12. package/dist/cjs/nativeSheet.native.js.map +1 -1
  13. package/dist/cjs/useSheetOffscreenSize.cjs +3 -1
  14. package/dist/cjs/useSheetOffscreenSize.native.cjs +3 -2
  15. package/dist/cjs/useSheetOffscreenSize.native.js +3 -2
  16. package/dist/cjs/useSheetOffscreenSize.native.js.map +1 -1
  17. package/dist/cjs/useSheetOpenState.cjs +9 -3
  18. package/dist/cjs/useSheetOpenState.native.cjs +11 -2
  19. package/dist/cjs/useSheetOpenState.native.js +11 -2
  20. package/dist/cjs/useSheetOpenState.native.js.map +1 -1
  21. package/dist/cjs/useSheetProviderProps.cjs +5 -94
  22. package/dist/cjs/useSheetProviderProps.native.cjs +5 -103
  23. package/dist/cjs/useSheetProviderProps.native.js +5 -103
  24. package/dist/cjs/useSheetProviderProps.native.js.map +1 -1
  25. package/dist/cjs/useSheetState.cjs +120 -0
  26. package/dist/cjs/useSheetState.native.cjs +131 -0
  27. package/dist/cjs/useSheetState.native.js +133 -0
  28. package/dist/cjs/useSheetState.native.js.map +1 -0
  29. package/dist/esm/Sheet.mjs +29 -12
  30. package/dist/esm/Sheet.mjs.map +1 -1
  31. package/dist/esm/Sheet.native.js +29 -12
  32. package/dist/esm/Sheet.native.js.map +1 -1
  33. package/dist/esm/SheetScrollView.mjs +14 -2
  34. package/dist/esm/SheetScrollView.mjs.map +1 -1
  35. package/dist/esm/SheetScrollView.native.js +15 -2
  36. package/dist/esm/SheetScrollView.native.js.map +1 -1
  37. package/dist/esm/nativeSheet.mjs +1 -1
  38. package/dist/esm/nativeSheet.mjs.map +1 -1
  39. package/dist/esm/nativeSheet.native.js +69 -58
  40. package/dist/esm/nativeSheet.native.js.map +1 -1
  41. package/dist/esm/useSheetOffscreenSize.mjs +3 -1
  42. package/dist/esm/useSheetOffscreenSize.mjs.map +1 -1
  43. package/dist/esm/useSheetOffscreenSize.native.js +3 -2
  44. package/dist/esm/useSheetOffscreenSize.native.js.map +1 -1
  45. package/dist/esm/useSheetOpenState.mjs +9 -3
  46. package/dist/esm/useSheetOpenState.mjs.map +1 -1
  47. package/dist/esm/useSheetOpenState.native.js +11 -2
  48. package/dist/esm/useSheetOpenState.native.js.map +1 -1
  49. package/dist/esm/useSheetProviderProps.mjs +5 -88
  50. package/dist/esm/useSheetProviderProps.mjs.map +1 -1
  51. package/dist/esm/useSheetProviderProps.native.js +5 -97
  52. package/dist/esm/useSheetProviderProps.native.js.map +1 -1
  53. package/dist/esm/useSheetState.mjs +95 -0
  54. package/dist/esm/useSheetState.mjs.map +1 -0
  55. package/dist/esm/useSheetState.native.js +104 -0
  56. package/dist/esm/useSheetState.native.js.map +1 -0
  57. package/dist/jsx/Sheet.mjs +29 -12
  58. package/dist/jsx/Sheet.mjs.map +1 -1
  59. package/dist/jsx/Sheet.native.cjs +29 -12
  60. package/dist/jsx/Sheet.native.js +29 -12
  61. package/dist/jsx/Sheet.native.js.map +1 -1
  62. package/dist/jsx/SheetScrollView.mjs +14 -2
  63. package/dist/jsx/SheetScrollView.mjs.map +1 -1
  64. package/dist/jsx/SheetScrollView.native.cjs +14 -1
  65. package/dist/jsx/SheetScrollView.native.js +14 -1
  66. package/dist/jsx/SheetScrollView.native.js.map +1 -1
  67. package/dist/jsx/nativeSheet.mjs +1 -1
  68. package/dist/jsx/nativeSheet.mjs.map +1 -1
  69. package/dist/jsx/nativeSheet.native.cjs +66 -55
  70. package/dist/jsx/nativeSheet.native.js +66 -55
  71. package/dist/jsx/nativeSheet.native.js.map +1 -1
  72. package/dist/jsx/useSheetOffscreenSize.mjs +3 -1
  73. package/dist/jsx/useSheetOffscreenSize.mjs.map +1 -1
  74. package/dist/jsx/useSheetOffscreenSize.native.cjs +3 -2
  75. package/dist/jsx/useSheetOffscreenSize.native.js +3 -2
  76. package/dist/jsx/useSheetOffscreenSize.native.js.map +1 -1
  77. package/dist/jsx/useSheetOpenState.mjs +9 -3
  78. package/dist/jsx/useSheetOpenState.mjs.map +1 -1
  79. package/dist/jsx/useSheetOpenState.native.cjs +11 -2
  80. package/dist/jsx/useSheetOpenState.native.js +11 -2
  81. package/dist/jsx/useSheetOpenState.native.js.map +1 -1
  82. package/dist/jsx/useSheetProviderProps.mjs +5 -88
  83. package/dist/jsx/useSheetProviderProps.mjs.map +1 -1
  84. package/dist/jsx/useSheetProviderProps.native.cjs +5 -103
  85. package/dist/jsx/useSheetProviderProps.native.js +5 -103
  86. package/dist/jsx/useSheetProviderProps.native.js.map +1 -1
  87. package/dist/jsx/useSheetState.mjs +95 -0
  88. package/dist/jsx/useSheetState.mjs.map +1 -0
  89. package/dist/jsx/useSheetState.native.cjs +131 -0
  90. package/dist/jsx/useSheetState.native.js +133 -0
  91. package/dist/jsx/useSheetState.native.js.map +1 -0
  92. package/package.json +22 -22
  93. package/src/Sheet.tsx +44 -15
  94. package/src/SheetScrollView.tsx +22 -3
  95. package/src/nativeSheet.native.tsx +89 -64
  96. package/src/nativeSheet.ts +7 -10
  97. package/src/types.tsx +29 -4
  98. package/src/useSheetOffscreenSize.tsx +3 -7
  99. package/src/useSheetOpenState.tsx +10 -2
  100. package/src/useSheetProviderProps.tsx +18 -149
  101. package/src/useSheetState.tsx +139 -0
  102. package/types/Sheet.d.ts +32 -32
  103. package/types/Sheet.d.ts.map +1 -1
  104. package/types/SheetScrollView.d.ts.map +1 -1
  105. package/types/nativeSheet.d.ts +8 -9
  106. package/types/nativeSheet.d.ts.map +1 -1
  107. package/types/nativeSheet.native.d.ts +4 -4
  108. package/types/nativeSheet.native.d.ts.map +1 -1
  109. package/types/types.d.ts +22 -4
  110. package/types/types.d.ts.map +1 -1
  111. package/types/useSheetOffscreenSize.d.ts +1 -1
  112. package/types/useSheetOffscreenSize.d.ts.map +1 -1
  113. package/types/useSheetOpenState.d.ts +3 -1
  114. package/types/useSheetOpenState.d.ts.map +1 -1
  115. package/types/useSheetProviderProps.d.ts +15 -13
  116. package/types/useSheetProviderProps.d.ts.map +1 -1
  117. package/types/useSheetState.d.ts +26 -0
  118. package/types/useSheetState.d.ts.map +1 -0
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
+ get: () => from[key],
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
+ });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
25
+ value: mod,
26
+ enumerable: true
27
+ }) : target, mod));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useSheetState_exports = {};
30
+ __export(useSheetState_exports, { useSheetState: () => useSheetState });
31
+ module.exports = __toCommonJS(useSheetState_exports);
32
+ var import_react = __toESM(require("react"), 1);
33
+ var import_use_controllable_state = require("@tamagui/use-controllable-state");
34
+ function useSheetState(props, state) {
35
+ var handleRef = import_react.default.useRef(null);
36
+ var contentRef = import_react.default.useRef(null);
37
+ var [frameSize, setFrameSize] = import_react.default.useState(0);
38
+ var [maxContentSize, setMaxContentSize] = import_react.default.useState(0);
39
+ var _props_snapPointsMode;
40
+ var snapPointsMode = (_props_snapPointsMode = props.snapPointsMode) !== null && _props_snapPointsMode !== void 0 ? _props_snapPointsMode : "percent";
41
+ var _props_snapPoints;
42
+ var snapPointsProp = (_props_snapPoints = props.snapPoints) !== null && _props_snapPoints !== void 0 ? _props_snapPoints : snapPointsMode === "percent" ? [80] : snapPointsMode === "constant" ? [256] : ["fit"];
43
+ var hasFit = snapPointsProp[0] === "fit";
44
+ var snapPoints = import_react.default.useMemo(function() {
45
+ return props.dismissOnSnapToBottom ? [...snapPointsProp, 0] : snapPointsProp;
46
+ }, [JSON.stringify(snapPointsProp), props.dismissOnSnapToBottom]);
47
+ var [position_, setPositionImmediate] = (0, import_use_controllable_state.useControllableState)({
48
+ prop: props.position,
49
+ defaultProp: props.defaultPosition || (state.open ? 0 : -1),
50
+ onChange: props.onPositionChange,
51
+ strategy: state.strategy
52
+ });
53
+ var position = state.open === false ? -1 : position_;
54
+ var { open } = state;
55
+ var setPosition = import_react.default.useCallback(function(next) {
56
+ if (props.dismissOnSnapToBottom && next === snapPoints.length - 1) {
57
+ state.setOpen(false);
58
+ } else {
59
+ setPositionImmediate(next);
60
+ }
61
+ }, [
62
+ props.dismissOnSnapToBottom,
63
+ snapPoints.length,
64
+ setPositionImmediate,
65
+ state.setOpen
66
+ ]);
67
+ if (process.env.NODE_ENV === "development") {
68
+ if (snapPointsMode === "mixed" && snapPoints.some(function(p) {
69
+ if (typeof p === "string") {
70
+ if (p === "fit") {
71
+ return false;
72
+ }
73
+ if (p.endsWith("%")) {
74
+ var n = Number(p.slice(0, -1));
75
+ return n < 0 || n > 100;
76
+ }
77
+ return true;
78
+ }
79
+ return typeof p !== "number" || p < 0;
80
+ })) {
81
+ console.warn("⚠️ Invalid snapPoint given, snapPoints must be positive numeric values, string percentages between 0-100%, or \"fit\" when snapPointsMode is mixed");
82
+ }
83
+ if (snapPointsMode === "mixed" && snapPoints.indexOf("fit") > 0) {
84
+ console.warn("⚠️ Invalid snapPoint given, \"fit\" must be the first/largest snap point when snapPointsMode is mixed");
85
+ }
86
+ if (snapPointsMode === "fit" && (snapPoints.length !== (props.dismissOnSnapToBottom ? 2 : 1) || snapPoints[0] !== "fit")) {
87
+ console.warn("⚠️ Invalid snapPoint given, there are no snap points when snapPointsMode is fit");
88
+ }
89
+ if (snapPointsMode === "constant" && snapPoints.some(function(p) {
90
+ return typeof p !== "number" || p < 0;
91
+ })) {
92
+ console.warn("⚠️ Invalid snapPoint given, snapPoints must be positive numeric values when snapPointsMode is constant");
93
+ }
94
+ if (snapPointsMode === "percent" && snapPoints.some(function(p) {
95
+ return typeof p !== "number" || p < 0 || p > 100;
96
+ })) {
97
+ console.warn("⚠️ Invalid snapPoint given, snapPoints must be numeric values between 0 and 100 when snapPointsMode is percent");
98
+ }
99
+ }
100
+ if (open && props.dismissOnSnapToBottom && position === snapPoints.length - 1) {
101
+ setPositionImmediate(0);
102
+ }
103
+ var shouldSetPositionOpen = open && position < 0;
104
+ import_react.default.useEffect(function() {
105
+ if (shouldSetPositionOpen) {
106
+ setPosition(0);
107
+ }
108
+ }, [setPosition, shouldSetPositionOpen]);
109
+ var _props_dismissOnOverlayPress, _props_dismissOnSnapToBottom, _props_scope;
110
+ return {
111
+ modal: !!props.modal,
112
+ open: state.open,
113
+ setOpen: state.setOpen,
114
+ hidden: !!state.isHidden,
115
+ contentRef,
116
+ handleRef,
117
+ frameSize,
118
+ setFrameSize,
119
+ maxContentSize,
120
+ dismissOnOverlayPress: (_props_dismissOnOverlayPress = props.dismissOnOverlayPress) !== null && _props_dismissOnOverlayPress !== void 0 ? _props_dismissOnOverlayPress : true,
121
+ dismissOnSnapToBottom: (_props_dismissOnSnapToBottom = props.dismissOnSnapToBottom) !== null && _props_dismissOnSnapToBottom !== void 0 ? _props_dismissOnSnapToBottom : false,
122
+ scope: (_props_scope = props.scope) !== null && _props_scope !== void 0 ? _props_scope : "",
123
+ hasFit,
124
+ position,
125
+ snapPoints,
126
+ snapPointsMode,
127
+ setMaxContentSize,
128
+ setPosition,
129
+ setPositionImmediate
130
+ };
131
+ }
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
+ get: () => from[key],
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
+ });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
25
+ value: mod,
26
+ enumerable: true
27
+ }) : target, mod));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useSheetState_exports = {};
30
+ __export(useSheetState_exports, { useSheetState: () => useSheetState });
31
+ module.exports = __toCommonJS(useSheetState_exports);
32
+ var import_react = __toESM(require("react"), 1);
33
+ var import_use_controllable_state = require("@tamagui/use-controllable-state");
34
+ function useSheetState(props, state) {
35
+ var handleRef = import_react.default.useRef(null);
36
+ var contentRef = import_react.default.useRef(null);
37
+ var [frameSize, setFrameSize] = import_react.default.useState(0);
38
+ var [maxContentSize, setMaxContentSize] = import_react.default.useState(0);
39
+ var _props_snapPointsMode;
40
+ var snapPointsMode = (_props_snapPointsMode = props.snapPointsMode) !== null && _props_snapPointsMode !== void 0 ? _props_snapPointsMode : "percent";
41
+ var _props_snapPoints;
42
+ var snapPointsProp = (_props_snapPoints = props.snapPoints) !== null && _props_snapPoints !== void 0 ? _props_snapPoints : snapPointsMode === "percent" ? [80] : snapPointsMode === "constant" ? [256] : ["fit"];
43
+ var hasFit = snapPointsProp[0] === "fit";
44
+ var snapPoints = import_react.default.useMemo(function() {
45
+ return props.dismissOnSnapToBottom ? [...snapPointsProp, 0] : snapPointsProp;
46
+ }, [JSON.stringify(snapPointsProp), props.dismissOnSnapToBottom]);
47
+ var [position_, setPositionImmediate] = (0, import_use_controllable_state.useControllableState)({
48
+ prop: props.position,
49
+ defaultProp: props.defaultPosition || (state.open ? 0 : -1),
50
+ onChange: props.onPositionChange,
51
+ strategy: state.strategy
52
+ });
53
+ var position = state.open === false ? -1 : position_;
54
+ var { open } = state;
55
+ var setPosition = import_react.default.useCallback(function(next) {
56
+ if (props.dismissOnSnapToBottom && next === snapPoints.length - 1) {
57
+ state.setOpen(false);
58
+ } else {
59
+ setPositionImmediate(next);
60
+ }
61
+ }, [
62
+ props.dismissOnSnapToBottom,
63
+ snapPoints.length,
64
+ setPositionImmediate,
65
+ state.setOpen
66
+ ]);
67
+ if (process.env.NODE_ENV === "development") {
68
+ if (snapPointsMode === "mixed" && snapPoints.some(function(p) {
69
+ if (typeof p === "string") {
70
+ if (p === "fit") {
71
+ return false;
72
+ }
73
+ if (p.endsWith("%")) {
74
+ var n = Number(p.slice(0, -1));
75
+ return n < 0 || n > 100;
76
+ }
77
+ return true;
78
+ }
79
+ return typeof p !== "number" || p < 0;
80
+ })) {
81
+ console.warn("⚠️ Invalid snapPoint given, snapPoints must be positive numeric values, string percentages between 0-100%, or \"fit\" when snapPointsMode is mixed");
82
+ }
83
+ if (snapPointsMode === "mixed" && snapPoints.indexOf("fit") > 0) {
84
+ console.warn("⚠️ Invalid snapPoint given, \"fit\" must be the first/largest snap point when snapPointsMode is mixed");
85
+ }
86
+ if (snapPointsMode === "fit" && (snapPoints.length !== (props.dismissOnSnapToBottom ? 2 : 1) || snapPoints[0] !== "fit")) {
87
+ console.warn("⚠️ Invalid snapPoint given, there are no snap points when snapPointsMode is fit");
88
+ }
89
+ if (snapPointsMode === "constant" && snapPoints.some(function(p) {
90
+ return typeof p !== "number" || p < 0;
91
+ })) {
92
+ console.warn("⚠️ Invalid snapPoint given, snapPoints must be positive numeric values when snapPointsMode is constant");
93
+ }
94
+ if (snapPointsMode === "percent" && snapPoints.some(function(p) {
95
+ return typeof p !== "number" || p < 0 || p > 100;
96
+ })) {
97
+ console.warn("⚠️ Invalid snapPoint given, snapPoints must be numeric values between 0 and 100 when snapPointsMode is percent");
98
+ }
99
+ }
100
+ if (open && props.dismissOnSnapToBottom && position === snapPoints.length - 1) {
101
+ setPositionImmediate(0);
102
+ }
103
+ var shouldSetPositionOpen = open && position < 0;
104
+ import_react.default.useEffect(function() {
105
+ if (shouldSetPositionOpen) {
106
+ setPosition(0);
107
+ }
108
+ }, [setPosition, shouldSetPositionOpen]);
109
+ var _props_dismissOnOverlayPress, _props_dismissOnSnapToBottom, _props_scope;
110
+ return {
111
+ modal: !!props.modal,
112
+ open: state.open,
113
+ setOpen: state.setOpen,
114
+ hidden: !!state.isHidden,
115
+ contentRef,
116
+ handleRef,
117
+ frameSize,
118
+ setFrameSize,
119
+ maxContentSize,
120
+ dismissOnOverlayPress: (_props_dismissOnOverlayPress = props.dismissOnOverlayPress) !== null && _props_dismissOnOverlayPress !== void 0 ? _props_dismissOnOverlayPress : true,
121
+ dismissOnSnapToBottom: (_props_dismissOnSnapToBottom = props.dismissOnSnapToBottom) !== null && _props_dismissOnSnapToBottom !== void 0 ? _props_dismissOnSnapToBottom : false,
122
+ scope: (_props_scope = props.scope) !== null && _props_scope !== void 0 ? _props_scope : "",
123
+ hasFit,
124
+ position,
125
+ snapPoints,
126
+ snapPointsMode,
127
+ setMaxContentSize,
128
+ setPosition,
129
+ setPositionImmediate
130
+ };
131
+ }
132
+
133
+ //# sourceMappingURL=useSheetState.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSheetState.native.js","names":[],"sources":["cjs/useSheetState.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useSheetState_exports = {};\n__export(useSheetState_exports, {\n useSheetState: () => useSheetState\n});\nmodule.exports = __toCommonJS(useSheetState_exports);\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nfunction useSheetState(props, state) {\n var handleRef = import_react.default.useRef(null);\n var contentRef = import_react.default.useRef(null);\n var [frameSize, setFrameSize] = import_react.default.useState(0);\n var [maxContentSize, setMaxContentSize] = import_react.default.useState(0);\n var _props_snapPointsMode;\n var snapPointsMode = (_props_snapPointsMode = props.snapPointsMode) !== null && _props_snapPointsMode !== void 0 ? _props_snapPointsMode : \"percent\";\n var _props_snapPoints;\n var snapPointsProp = (_props_snapPoints = props.snapPoints) !== null && _props_snapPoints !== void 0 ? _props_snapPoints : snapPointsMode === \"percent\" ? [\n 80\n ] : snapPointsMode === \"constant\" ? [\n 256\n ] : [\n \"fit\"\n ];\n var hasFit = snapPointsProp[0] === \"fit\";\n var snapPoints = import_react.default.useMemo(function() {\n return props.dismissOnSnapToBottom ? [\n ...snapPointsProp,\n 0\n ] : snapPointsProp;\n }, [\n JSON.stringify(snapPointsProp),\n props.dismissOnSnapToBottom\n ]);\n var [position_, setPositionImmediate] = (0, import_use_controllable_state.useControllableState)({\n prop: props.position,\n defaultProp: props.defaultPosition || (state.open ? 0 : -1),\n onChange: props.onPositionChange,\n strategy: state.strategy\n });\n var position = state.open === false ? -1 : position_;\n var { open } = state;\n var setPosition = import_react.default.useCallback(function(next) {\n if (props.dismissOnSnapToBottom && next === snapPoints.length - 1) {\n state.setOpen(false);\n } else {\n setPositionImmediate(next);\n }\n }, [\n props.dismissOnSnapToBottom,\n snapPoints.length,\n setPositionImmediate,\n state.setOpen\n ]);\n if (process.env.NODE_ENV === \"development\") {\n if (snapPointsMode === \"mixed\" && snapPoints.some(function(p) {\n if (typeof p === \"string\") {\n if (p === \"fit\") {\n return false;\n }\n if (p.endsWith(\"%\")) {\n var n = Number(p.slice(0, -1));\n return n < 0 || n > 100;\n }\n return true;\n }\n return typeof p !== \"number\" || p < 0;\n })) {\n console.warn('\\u26A0\\uFE0F Invalid snapPoint given, snapPoints must be positive numeric values, string percentages between 0-100%, or \"fit\" when snapPointsMode is mixed');\n }\n if (snapPointsMode === \"mixed\" && snapPoints.indexOf(\"fit\") > 0) {\n console.warn('\\u26A0\\uFE0F Invalid snapPoint given, \"fit\" must be the first/largest snap point when snapPointsMode is mixed');\n }\n if (snapPointsMode === \"fit\" && (snapPoints.length !== (props.dismissOnSnapToBottom ? 2 : 1) || snapPoints[0] !== \"fit\")) {\n console.warn(\"\\u26A0\\uFE0F Invalid snapPoint given, there are no snap points when snapPointsMode is fit\");\n }\n if (snapPointsMode === \"constant\" && snapPoints.some(function(p) {\n return typeof p !== \"number\" || p < 0;\n })) {\n console.warn(\"\\u26A0\\uFE0F Invalid snapPoint given, snapPoints must be positive numeric values when snapPointsMode is constant\");\n }\n if (snapPointsMode === \"percent\" && snapPoints.some(function(p) {\n return typeof p !== \"number\" || p < 0 || p > 100;\n })) {\n console.warn(\"\\u26A0\\uFE0F Invalid snapPoint given, snapPoints must be numeric values between 0 and 100 when snapPointsMode is percent\");\n }\n }\n if (open && props.dismissOnSnapToBottom && position === snapPoints.length - 1) {\n setPositionImmediate(0);\n }\n var shouldSetPositionOpen = open && position < 0;\n import_react.default.useEffect(function() {\n if (shouldSetPositionOpen) {\n setPosition(0);\n }\n }, [\n setPosition,\n shouldSetPositionOpen\n ]);\n var _props_dismissOnOverlayPress, _props_dismissOnSnapToBottom, _props_scope;\n return {\n modal: !!props.modal,\n open: state.open,\n setOpen: state.setOpen,\n hidden: !!state.isHidden,\n contentRef,\n handleRef,\n frameSize,\n setFrameSize,\n maxContentSize,\n dismissOnOverlayPress: (_props_dismissOnOverlayPress = props.dismissOnOverlayPress) !== null && _props_dismissOnOverlayPress !== void 0 ? _props_dismissOnOverlayPress : true,\n dismissOnSnapToBottom: (_props_dismissOnSnapToBottom = props.dismissOnSnapToBottom) !== null && _props_dismissOnSnapToBottom !== void 0 ? _props_dismissOnSnapToBottom : false,\n scope: (_props_scope = props.scope) !== null && _props_scope !== void 0 ? _props_scope : \"\",\n hasFit,\n position,\n snapPoints,\n snapPointsMode,\n setMaxContentSize,\n setPosition,\n setPositionImmediate\n };\n}\n//# sourceMappingURL=useSheetState.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,wBAAwB,CAAC;AAC7B,SAAS,uBAAuB,EAC9B,qBAAqB,cACvB,CAAC;AACD,OAAO,UAAU,aAAa,qBAAqB;AACnD,IAAI,eAAe,QAAQ,QAAQ,OAAO,GAAG,CAAC;AAC9C,IAAI,gCAA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wB,+BAA+B,MAAM,2BAA2B,QAAQ,iCAAiC,KAAK,IAAI,+BAA+B;EACzK,wBAAwB,+BAA+B,MAAM,2BAA2B,QAAQ,iCAAiC,KAAK,IAAI,+BAA+B;EACzK,QAAQ,eAAe,MAAM,WAAW,QAAQ,iBAAiB,KAAK,IAAI,eAAe;EACzF;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -45,8 +45,7 @@ const SheetContainerFrame = styled(YStack, {
45
45
  flex: 1,
46
46
  position: "relative",
47
47
  zIndex: 0,
48
- width: "100%",
49
- maxHeight: "100%"
48
+ width: "100%"
50
49
  });
51
50
  const SheetBackgroundFrame = styled(YStack, {
52
51
  displayName: SHEET_BACKGROUND_NAME,
@@ -115,7 +114,7 @@ const SheetOverlay = createStyledHOC(SheetOverlayFrame, (propsIn, ref) => {
115
114
  });
116
115
  const SheetContainer = createStyledHOC(SheetContainerFrame, ({ scope, adjustPaddingForOffscreenContent, children, ...props }, forwardedRef) => {
117
116
  const context = useSheetContext(scope);
118
- const { hasFit, disableRemoveScroll, frameSize, contentRef, open } = context;
117
+ const { hasFit, frameSize, contentRef, open } = context;
119
118
  const composedContentRef = useComposedRefs(forwardedRef, contentRef);
120
119
  const offscreenSize = useSheetOffscreenSize(context);
121
120
  const stableFrameSize = useRef(frameSize);
@@ -125,11 +124,30 @@ const SheetContainer = createStyledHOC(SheetContainerFrame, ({ scope, adjustPadd
125
124
  }
126
125
  }, [open, frameSize]);
127
126
  const sheetContents = useMemo(() => {
127
+ if (context.onlyShowContainer) {
128
+ return /* @__PURE__ */ jsx(SheetContainerFrame, {
129
+ ref: composedContentRef,
130
+ flex: hasFit ? 0 : 1,
131
+ flexBasis: hasFit ? "auto" : void 0,
132
+ maxHeight: hasFit ? void 0 : "100%",
133
+ pointerEvents: open ? "auto" : "none",
134
+ "data-state": open ? "open" : "closed",
135
+ ...props,
136
+ onLayout: composeEventHandlers(props.onLayout, (event) => {
137
+ context.setFrameSize(event.nativeEvent.layout.height);
138
+ }),
139
+ children: /* @__PURE__ */ jsx(StackZIndexContext, {
140
+ zIndex: resolveViewZIndex(props.zIndex),
141
+ children
142
+ })
143
+ });
144
+ }
128
145
  const shouldUseFixedHeight = hasFit && !open && stableFrameSize.current;
129
146
  return /* @__PURE__ */ jsxs(SheetContainerFrame, {
130
147
  ref: composedContentRef,
131
148
  flex: hasFit && open ? 0 : 1,
132
149
  flexBasis: hasFit ? "auto" : void 0,
150
+ maxHeight: "100%",
133
151
  height: shouldUseFixedHeight ? stableFrameSize.current : hasFit ? void 0 : frameSize,
134
152
  pointerEvents: open ? "auto" : "none",
135
153
  "data-state": open ? "open" : "closed",
@@ -149,15 +167,19 @@ const SheetContainer = createStyledHOC(SheetContainerFrame, ({ scope, adjustPadd
149
167
  frameSize,
150
168
  offscreenSize,
151
169
  adjustPaddingForOffscreenContent,
152
- hasFit
170
+ hasFit,
171
+ context.onlyShowContainer,
172
+ context.setFrameSize
153
173
  ]);
174
+ if (context.onlyShowContainer) return sheetContents;
154
175
  return /* @__PURE__ */ jsx(RemoveScroll, {
155
- enabled: !disableRemoveScroll && context.open,
176
+ enabled: !context.disableRemoveScroll && context.open,
156
177
  children: sheetContents
157
178
  });
158
179
  });
159
180
  const SheetBackground = createStyledHOC(SheetBackgroundFrame, ({ scope, disableHideBottomOverflow, ...props }, forwardedRef) => {
160
181
  const context = useSheetContext(scope);
182
+ if (context.onlyShowContainer) return null;
161
183
  const bottomOverflow = isWeb ? Math.max(context.frameSize, getMaxViewportHeight()) : context.frameSize;
162
184
  return /* @__PURE__ */ jsx(SheetBackgroundFrame, {
163
185
  ref: forwardedRef,
@@ -173,13 +195,8 @@ const SheetRoot = createRefComponent(function SheetRoot2(props, ref) {
173
195
  const { isShowingNonSheet } = useSheetController(props.scope);
174
196
  const shouldUseAdapt = Boolean(adaptContext.open !== void 0 || adaptContext.onOpenChange);
175
197
  const isShowingAdaptNonSheet = shouldUseAdapt && !adaptContext.active && adaptContext.open;
176
- let SheetImplementation = SheetImplementationCustom;
177
- if (props.native) {
178
- const impl = getNativeSheet("ios");
179
- if (impl) {
180
- SheetImplementation = impl;
181
- }
182
- }
198
+ const nativeImplementation = props.native === true || Array.isArray(props.native) && props.native.includes("ios") ? getNativeSheet("ios") : null;
199
+ const SheetImplementation = nativeImplementation ?? SheetImplementationCustom;
183
200
  if (isShowingAdaptNonSheet || isShowingNonSheet || !hydrated) {
184
201
  return null;
185
202
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Sheet.js","names":[],"sources":["esm/Sheet.js"],"sourcesContent":["import { AdaptCapabilities, useAdaptContext, useAdaptIsActive } from \"@tamagui/adapt\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport {\n createRefComponent,\n createStyledHOC,\n styled,\n View\n} from \"@tamagui/core\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { resolveViewZIndex } from \"@tamagui/portal\";\nimport { RemoveScroll } from \"@tamagui/remove-scroll\";\nimport { XStack, YStack } from \"@tamagui/stacks\";\nimport { useDidFinishSSR } from \"@tamagui/use-did-finish-ssr\";\nimport { StackZIndexContext } from \"@tamagui/z-index-stack\";\nimport { useContext, useEffect, useMemo, useRef } from \"react\";\nimport {\n SHEET_BACKGROUND_NAME,\n SHEET_CONTAINER_NAME,\n SHEET_HANDLE_NAME,\n SHEET_OVERLAY_MARKER,\n SHEET_OVERLAY_NAME\n} from \"./constants\";\nimport { getNativeSheet } from \"./nativeSheet\";\nimport {\n SheetOverlayLayerContext,\n useAnimatedPosition,\n useSheetContext\n} from \"./SheetContext\";\nimport { SheetImplementationCustom } from \"./SheetImplementationCustom\";\nimport { SheetScrollView } from \"./SheetScrollView\";\nimport { useSheetController } from \"./useSheetController\";\nimport { useSheetOffscreenSize } from \"./useSheetOffscreenSize\";\nimport { getMaxViewportHeight } from \"./webViewport\";\nexport * from \"./types\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nconst SheetHandleFrame = styled(XStack, {\n displayName: SHEET_HANDLE_NAME,\n // the behavior Handle ships no opacity rules; open/close aesthetics (fade in\n // when open, dim when idle) live in the copied skin. see the canonical skin.\n variants: {\n open: {\n true: {\n pointerEvents: \"auto\"\n },\n false: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nconst SheetOverlayFrame = styled(YStack, {\n displayName: SHEET_OVERLAY_NAME,\n inset: 0,\n position: \"absolute\",\n zIndex: 1e5 - 1,\n pointerEvents: \"auto\",\n variants: {\n open: {\n true: {\n pointerEvents: \"auto\"\n },\n false: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nObject.assign(SheetOverlayFrame.staticConfig, { [SHEET_OVERLAY_MARKER]: true });\nconst SheetContainerFrame = styled(YStack, {\n displayName: SHEET_CONTAINER_NAME,\n flex: 1,\n position: \"relative\",\n zIndex: 0,\n width: \"100%\",\n maxHeight: \"100%\"\n});\nconst SheetBackgroundFrame = styled(YStack, {\n displayName: SHEET_BACKGROUND_NAME,\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n zIndex: -1,\n pointerEvents: \"none\"\n});\nconst SheetHandle = createStyledHOC(\n SheetHandleFrame,\n ({ scope, ...props }, forwardedRef) => {\n const context = useSheetContext(scope);\n const composedRef = useComposedRefs(context.handleRef, forwardedRef);\n const wasDraggingRef = useRef(false);\n useEffect(() => {\n if (!context.scrollBridge) return;\n return context.scrollBridge.onParentDragging((isDragging) => {\n if (isDragging) {\n wasDraggingRef.current = true;\n }\n });\n }, [context.scrollBridge]);\n if (context.onlyShowContainer) {\n return null;\n }\n return /* @__PURE__ */ jsx(\n SheetHandleFrame,\n {\n ref: composedRef,\n onPressIn: () => {\n wasDraggingRef.current = false;\n },\n onPress: () => {\n if (wasDraggingRef.current) {\n wasDraggingRef.current = false;\n return;\n }\n const max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0);\n const nextPos = (context.position + 1) % max;\n context.setPosition(nextPos);\n },\n open: context.open,\n ...props\n }\n );\n }\n);\nconst SheetOverlay = createStyledHOC(\n SheetOverlayFrame,\n (propsIn, ref) => {\n const { scope, ...props } = propsIn;\n const context = useSheetContext(scope);\n const isInOverlayLayer = useContext(SheetOverlayLayerContext);\n const didWarn = useRef(false);\n if (context.onlyShowContainer) {\n return null;\n }\n if (!isInOverlayLayer) {\n if (process.env.NODE_ENV === \"development\" && !didWarn.current) {\n didWarn.current = true;\n console.error(\n \"Sheet.Overlay must be a direct child of Sheet. Move it next to Sheet.Handle and Sheet.Container.\"\n );\n }\n return null;\n }\n return /* @__PURE__ */ jsx(\n SheetOverlayFrame,\n {\n ...props,\n ref,\n onPress: composeEventHandlers(\n props.onPress,\n context.dismissOnOverlayPress ? () => {\n context.setOpen(false);\n } : void 0\n )\n }\n );\n }\n);\nconst SheetContainer = createStyledHOC(\n SheetContainerFrame,\n ({\n scope,\n adjustPaddingForOffscreenContent,\n children,\n ...props\n }, forwardedRef) => {\n const context = useSheetContext(scope);\n const { hasFit, disableRemoveScroll, frameSize, contentRef, open } = context;\n const composedContentRef = useComposedRefs(forwardedRef, contentRef);\n const offscreenSize = useSheetOffscreenSize(context);\n const stableFrameSize = useRef(frameSize);\n useEffect(() => {\n if (open && frameSize) {\n stableFrameSize.current = frameSize;\n }\n }, [open, frameSize]);\n const sheetContents = useMemo(() => {\n const shouldUseFixedHeight = hasFit && !open && stableFrameSize.current;\n return /* @__PURE__ */ jsxs(\n SheetContainerFrame,\n {\n ref: composedContentRef,\n flex: hasFit && open ? 0 : 1,\n flexBasis: hasFit ? \"auto\" : void 0,\n height: shouldUseFixedHeight ? stableFrameSize.current : hasFit ? void 0 : frameSize,\n pointerEvents: open ? \"auto\" : \"none\",\n \"data-state\": open ? \"open\" : \"closed\",\n ...props,\n children: [\n /* @__PURE__ */ jsx(StackZIndexContext, { zIndex: resolveViewZIndex(props.zIndex), children }),\n adjustPaddingForOffscreenContent && /* @__PURE__ */ jsx(View, { \"data-sheet-offscreen-pad\": true, height: offscreenSize, width: \"100%\" })\n ]\n }\n );\n }, [open, props, frameSize, offscreenSize, adjustPaddingForOffscreenContent, hasFit]);\n return /* @__PURE__ */ jsx(RemoveScroll, { enabled: !disableRemoveScroll && context.open, children: sheetContents });\n }\n);\nconst SheetBackground = createStyledHOC(\n SheetBackgroundFrame,\n ({ scope, disableHideBottomOverflow, ...props }, forwardedRef) => {\n const context = useSheetContext(scope);\n const bottomOverflow = isWeb ? Math.max(context.frameSize, getMaxViewportHeight()) : context.frameSize;\n return /* @__PURE__ */ jsx(\n SheetBackgroundFrame,\n {\n ref: forwardedRef,\n \"data-sheet-background\": \"\",\n bottom: disableHideBottomOverflow ? 0 : -bottomOverflow,\n ...props\n }\n );\n }\n);\nconst SheetRoot = createRefComponent(\n function SheetRoot2(props, ref) {\n const hydrated = useDidFinishSSR();\n const isAdapted = useAdaptIsActive();\n const adaptContext = useAdaptContext();\n const { isShowingNonSheet } = useSheetController(props.scope);\n const shouldUseAdapt = Boolean(\n adaptContext.open !== void 0 || adaptContext.onOpenChange\n );\n const isShowingAdaptNonSheet = shouldUseAdapt && !adaptContext.active && adaptContext.open;\n let SheetImplementation = SheetImplementationCustom;\n if (props.native) {\n const impl = getNativeSheet(\"ios\");\n if (impl) {\n SheetImplementation = impl;\n }\n }\n if (isShowingAdaptNonSheet || isShowingNonSheet || !hydrated) {\n return null;\n }\n const implementation = /* @__PURE__ */ jsx(SheetImplementation, { ref, ...props });\n return isAdapted ? /* @__PURE__ */ jsx(AdaptCapabilities, { scroll: true, overlay: true, dismiss: true, children: implementation }) : implementation;\n }\n);\nconst sheetParts = {\n Container: SheetContainer,\n Background: SheetBackground,\n Overlay: SheetOverlay,\n Handle: SheetHandle,\n ScrollView: SheetScrollView\n};\nconst SheetControlled = withStaticProperties(\n SheetRoot,\n sheetParts\n);\nconst Sheet = withStaticProperties(SheetRoot, {\n Root: SheetRoot,\n Controlled: SheetControlled,\n useAnimatedPosition,\n ...sheetParts\n});\nexport {\n Sheet,\n SheetBackground,\n SheetContainer,\n SheetControl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;CACA,IAAI,0BAA0B,qBAAqB,CAAC,UAAU;EAC5D,OAAO;CACT;CACA,MAAM,iBAAiC,oBAAI,qBAAqB;EAAE;EAAK,GAAG;CAAM,CAAC;CACjF,OAAO,YAA4B,oBAAI,mBAAmB;EAAE,QAAQ;EAAM,SAAS;EAAM,SAAS;EAAM,UAAU;CAAe,CAAC,IAAI;AACxI,CACF;AACA,MAAM,aAAa;CACjB,WAAW;CACX,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,YAAY;AACd;AACA,MAAM,kBAAkB,qBACtB,WACA,UACF;AACA,MAAM,QAAQ,qBAAqB,WAAW;CAC5C,MAAM;CACN,YAAY;CACZ;CACA,GAAG;AACL,CAAC"}
1
+ {"version":3,"file":"Sheet.js","names":[],"sources":["esm/Sheet.js"],"sourcesContent":["import { AdaptCapabilities, useAdaptContext, useAdaptIsActive } from \"@tamagui/adapt\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport {\n createRefComponent,\n createStyledHOC,\n styled,\n View\n} from \"@tamagui/core\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { resolveViewZIndex } from \"@tamagui/portal\";\nimport { RemoveScroll } from \"@tamagui/remove-scroll\";\nimport { XStack, YStack } from \"@tamagui/stacks\";\nimport { useDidFinishSSR } from \"@tamagui/use-did-finish-ssr\";\nimport { StackZIndexContext } from \"@tamagui/z-index-stack\";\nimport { useContext, useEffect, useMemo, useRef } from \"react\";\nimport {\n SHEET_BACKGROUND_NAME,\n SHEET_CONTAINER_NAME,\n SHEET_HANDLE_NAME,\n SHEET_OVERLAY_MARKER,\n SHEET_OVERLAY_NAME\n} from \"./constants\";\nimport { getNativeSheet } from \"./nativeSheet\";\nimport {\n SheetOverlayLayerContext,\n useAnimatedPosition,\n useSheetContext\n} from \"./SheetContext\";\nimport { SheetImplementationCustom } from \"./SheetImplementationCustom\";\nimport { SheetScrollView } from \"./SheetScrollView\";\nimport { useSheetController } from \"./useSheetController\";\nimport { useSheetOffscreenSize } from \"./useSheetOffscreenSize\";\nimport { getMaxViewportHeight } from \"./webViewport\";\nexport * from \"./types\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nconst SheetHandleFrame = styled(XStack, {\n displayName: SHEET_HANDLE_NAME,\n // the behavior Handle ships no opacity rules; open/close aesthetics (fade in\n // when open, dim when idle) live in the copied skin. see the canonical skin.\n variants: {\n open: {\n true: {\n pointerEvents: \"auto\"\n },\n false: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nconst SheetOverlayFrame = styled(YStack, {\n displayName: SHEET_OVERLAY_NAME,\n inset: 0,\n position: \"absolute\",\n zIndex: 1e5 - 1,\n pointerEvents: \"auto\",\n variants: {\n open: {\n true: {\n pointerEvents: \"auto\"\n },\n false: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nObject.assign(SheetOverlayFrame.staticConfig, { [SHEET_OVERLAY_MARKER]: true });\nconst SheetContainerFrame = styled(YStack, {\n displayName: SHEET_CONTAINER_NAME,\n flex: 1,\n position: \"relative\",\n zIndex: 0,\n width: \"100%\"\n});\nconst SheetBackgroundFrame = styled(YStack, {\n displayName: SHEET_BACKGROUND_NAME,\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n zIndex: -1,\n pointerEvents: \"none\"\n});\nconst SheetHandle = createStyledHOC(\n SheetHandleFrame,\n ({ scope, ...props }, forwardedRef) => {\n const context = useSheetContext(scope);\n const composedRef = useComposedRefs(context.handleRef, forwardedRef);\n const wasDraggingRef = useRef(false);\n useEffect(() => {\n if (!context.scrollBridge) return;\n return context.scrollBridge.onParentDragging((isDragging) => {\n if (isDragging) {\n wasDraggingRef.current = true;\n }\n });\n }, [context.scrollBridge]);\n if (context.onlyShowContainer) {\n return null;\n }\n return /* @__PURE__ */ jsx(\n SheetHandleFrame,\n {\n ref: composedRef,\n onPressIn: () => {\n wasDraggingRef.current = false;\n },\n onPress: () => {\n if (wasDraggingRef.current) {\n wasDraggingRef.current = false;\n return;\n }\n const max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0);\n const nextPos = (context.position + 1) % max;\n context.setPosition(nextPos);\n },\n open: context.open,\n ...props\n }\n );\n }\n);\nconst SheetOverlay = createStyledHOC(\n SheetOverlayFrame,\n (propsIn, ref) => {\n const { scope, ...props } = propsIn;\n const context = useSheetContext(scope);\n const isInOverlayLayer = useContext(SheetOverlayLayerContext);\n const didWarn = useRef(false);\n if (context.onlyShowContainer) {\n return null;\n }\n if (!isInOverlayLayer) {\n if (process.env.NODE_ENV === \"development\" && !didWarn.current) {\n didWarn.current = true;\n console.error(\n \"Sheet.Overlay must be a direct child of Sheet. Move it next to Sheet.Handle and Sheet.Container.\"\n );\n }\n return null;\n }\n return /* @__PURE__ */ jsx(\n SheetOverlayFrame,\n {\n ...props,\n ref,\n onPress: composeEventHandlers(\n props.onPress,\n context.dismissOnOverlayPress ? () => {\n context.setOpen(false);\n } : void 0\n )\n }\n );\n }\n);\nconst SheetContainer = createStyledHOC(\n SheetContainerFrame,\n ({\n scope,\n adjustPaddingForOffscreenContent,\n children,\n ...props\n }, forwardedRef) => {\n const context = useSheetContext(scope);\n const { hasFit, frameSize, contentRef, open } = context;\n const composedContentRef = useComposedRefs(forwardedRef, contentRef);\n const offscreenSize = useSheetOffscreenSize(context);\n const stableFrameSize = useRef(frameSize);\n useEffect(() => {\n if (open && frameSize) {\n stableFrameSize.current = frameSize;\n }\n }, [open, frameSize]);\n const sheetContents = useMemo(() => {\n if (context.onlyShowContainer) {\n return /* @__PURE__ */ jsx(\n SheetContainerFrame,\n {\n ref: composedContentRef,\n flex: hasFit ? 0 : 1,\n flexBasis: hasFit ? \"auto\" : void 0,\n maxHeight: hasFit ? void 0 : \"100%\",\n pointerEvents: open ? \"auto\" : \"none\",\n \"data-state\": open ? \"open\" : \"closed\",\n ...props,\n onLayout: composeEventHandlers(props.onLayout, (event) => {\n context.setFrameSize(event.nativeEvent.layout.height);\n }),\n children: /* @__PURE__ */ jsx(StackZIndexContext, { zIndex: resolveViewZIndex(props.zIndex), children })\n }\n );\n }\n const shouldUseFixedHeight = hasFit && !open && stableFrameSize.current;\n return /* @__PURE__ */ jsxs(\n SheetContainerFrame,\n {\n ref: composedContentRef,\n flex: hasFit && open ? 0 : 1,\n flexBasis: hasFit ? \"auto\" : void 0,\n maxHeight: \"100%\",\n height: shouldUseFixedHeight ? stableFrameSize.current : hasFit ? void 0 : frameSize,\n pointerEvents: open ? \"auto\" : \"none\",\n \"data-state\": open ? \"open\" : \"closed\",\n ...props,\n children: [\n /* @__PURE__ */ jsx(StackZIndexContext, { zIndex: resolveViewZIndex(props.zIndex), children }),\n adjustPaddingForOffscreenContent && /* @__PURE__ */ jsx(View, { \"data-sheet-offscreen-pad\": true, height: offscreenSize, width: \"100%\" })\n ]\n }\n );\n }, [\n open,\n props,\n frameSize,\n offscreenSize,\n adjustPaddingForOffscreenContent,\n hasFit,\n context.onlyShowContainer,\n context.setFrameSize\n ]);\n if (context.onlyShowContainer) return sheetContents;\n return /* @__PURE__ */ jsx(RemoveScroll, { enabled: !context.disableRemoveScroll && context.open, children: sheetContents });\n }\n);\nconst SheetBackground = createStyledHOC(\n SheetBackgroundFrame,\n ({ scope, disableHideBottomOverflow, ...props }, forwardedRef) => {\n const context = useSheetContext(scope);\n if (context.onlyShowContainer) return null;\n const bottomOverflow = isWeb ? Math.max(context.frameSize, getMaxViewportHeight()) : context.frameSize;\n return /* @__PURE__ */ jsx(\n SheetBackgroundFrame,\n {\n ref: forwardedRef,\n \"data-sheet-background\": \"\",\n bottom: disableHideBottomOverflow ? 0 : -bottomOverflow,\n ...props\n }\n );\n }\n);\nconst SheetRoot = createRefComponent(\n function SheetRoot2(props, ref) {\n const hydrated = useDidFinishSSR();\n const isAdapted = useAdaptIsActive();\n const adaptContext = useAdaptContext();\n const { isShowingNonSheet } = useSheetController(props.scope);\n const shouldUseAdapt = Boolean(\n adaptContext.open !== void 0 || adaptContext.onOpenChange\n );\n const isShowingAdaptNonSheet = shouldUseAdapt && !adaptContext.active && adaptContext.open;\n const nativeImplementation = props.native === true || Array.isArray(props.native) && props.native.includes(\"ios\") ? getNativeSheet(\"ios\") : null;\n const SheetImplementation = nativeImplementation ?? SheetImplementationCustom;\n if (isShowingAdaptNonSheet || isShowingNonSheet || !hydrated) {\n return null;\n }\n const implementation = /* @__PURE__ */ jsx(SheetImplementation, { ref, ...props });\n return isAdapted ? /* @__PURE__ */ jsx(AdaptCapabilities, { scroll: true, overlay: true, dismiss: true, children: implementation }) : implementation;\n }\n);\nconst sheetParts = {\n Container: SheetContainer,\n Background: SheetBackground,\n Overlay: SheetOverlay,\n Handle: SheetHandle,\n ScrollView: SheetScrollView\n};\nconst SheetControlled = withStaticProperties(\n SheetRoot,\n sheetParts\n);\nconst Sheet = withStaticProperties(SheetRoot, {\n Root: SheetRoot,\n Controlled: SheetControlled,\n useAnimatedPosition,\n ...sheetParts\n});\nexport {\n Sheet,\n SheetBackground,\n SheetContainer,\n SheetControlled,\n SheetHandle,\n SheetOverlay,\n SheetRoot\n};\n//# sourceMappingURL=Sheet.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAM,mBAAmB,OAAO,QAAQ;CACtC,aAAa;CAGb,UAAU,EACR,MAAM;EACJ,MAAM,EACJ,eAAe,OACjB;EACA,OAAO,EACL,eAAe,OACjB;CACF,EACF;AACF,CAAC;AACD,MAAM,oBAAoB,OAAO,QAAQ;CACvC,aAAa;CACb,OAAO;CACP,UAAU;CACV,QAAQ,MAAM;CACd,eAAe;CACf,UAAU,EACR,MAAM;EACJ,MAAM,EACJ,eAAe,OACjB;EACA,OAAO,EACL,eAAe,OACjB;CACF,EACF;AACF,CAAC;AACD,OAAO,OAAO,kBAAkB,cAAc,GAAG,uBAAuB,KAAK,CAAC;AAC9E,MAAM,sBAAsB,OAAO,QAAQ;CACzC,aAAa;CACb,MAAM;CACN,UAAU;CACV,QAAQ;CACR,OAAO;AACT,CAAC;AACD,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EAAK,GAAG;CAAM,CAAC;CACjF,OAAO,YAA4B,oBAAI,mBAAmB;EAAE,QAAQ;EAAM,SAAS;EAAM,SAAS;EAAM,UAAU;CAAe,CAAC,IAAI;AACxI,CACF;AACA,MAAM,aAAa;CACjB,WAAW;CACX,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,YAAY;AACd;AACA,MAAM,kBAAkB,qBACtB,WACA,UACF;AACA,MAAM,QAAQ,qBAAqB,WAAW;CAC5C,MAAM;CACN,YAAY;CACZ;CACA,GAAG;AACL,CAAC"}
@@ -45,8 +45,7 @@ var SheetContainerFrame = styled(YStack, {
45
45
  flex: 1,
46
46
  position: "relative",
47
47
  zIndex: 0,
48
- width: "100%",
49
- maxHeight: "100%"
48
+ width: "100%"
50
49
  });
51
50
  var SheetBackgroundFrame = styled(YStack, {
52
51
  displayName: SHEET_BACKGROUND_NAME,
@@ -117,7 +116,7 @@ var SheetOverlay = createStyledHOC(SheetOverlayFrame, function(propsIn, ref) {
117
116
  var SheetContainer = createStyledHOC(SheetContainerFrame, function(param, forwardedRef) {
118
117
  var { scope, adjustPaddingForOffscreenContent, children, ...props } = param;
119
118
  var context = useSheetContext(scope);
120
- var { hasFit, disableRemoveScroll, frameSize, contentRef, open } = context;
119
+ var { hasFit, frameSize, contentRef, open } = context;
121
120
  var composedContentRef = useComposedRefs(forwardedRef, contentRef);
122
121
  var offscreenSize = useSheetOffscreenSize(context);
123
122
  var stableFrameSize = useRef(frameSize);
@@ -127,11 +126,30 @@ var SheetContainer = createStyledHOC(SheetContainerFrame, function(param, forwar
127
126
  }
128
127
  }, [open, frameSize]);
129
128
  var sheetContents = useMemo(function() {
129
+ if (context.onlyShowContainer) {
130
+ return /* @__PURE__ */ jsx(SheetContainerFrame, {
131
+ ref: composedContentRef,
132
+ flex: hasFit ? 0 : 1,
133
+ flexBasis: hasFit ? "auto" : void 0,
134
+ maxHeight: hasFit ? void 0 : "100%",
135
+ pointerEvents: open ? "auto" : "none",
136
+ "data-state": open ? "open" : "closed",
137
+ ...props,
138
+ onLayout: composeEventHandlers(props.onLayout, function(event) {
139
+ context.setFrameSize(event.nativeEvent.layout.height);
140
+ }),
141
+ children: /* @__PURE__ */ jsx(StackZIndexContext, {
142
+ zIndex: resolveViewZIndex(props.zIndex),
143
+ children
144
+ })
145
+ });
146
+ }
130
147
  var shouldUseFixedHeight = hasFit && !open && stableFrameSize.current;
131
148
  return /* @__PURE__ */ jsxs(SheetContainerFrame, {
132
149
  ref: composedContentRef,
133
150
  flex: hasFit && open ? 0 : 1,
134
151
  flexBasis: hasFit ? "auto" : void 0,
152
+ maxHeight: "100%",
135
153
  height: shouldUseFixedHeight ? stableFrameSize.current : hasFit ? void 0 : frameSize,
136
154
  pointerEvents: open ? "auto" : "none",
137
155
  "data-state": open ? "open" : "closed",
@@ -151,16 +169,20 @@ var SheetContainer = createStyledHOC(SheetContainerFrame, function(param, forwar
151
169
  frameSize,
152
170
  offscreenSize,
153
171
  adjustPaddingForOffscreenContent,
154
- hasFit
172
+ hasFit,
173
+ context.onlyShowContainer,
174
+ context.setFrameSize
155
175
  ]);
176
+ if (context.onlyShowContainer) return sheetContents;
156
177
  return /* @__PURE__ */ jsx(RemoveScroll, {
157
- enabled: !disableRemoveScroll && context.open,
178
+ enabled: !context.disableRemoveScroll && context.open,
158
179
  children: sheetContents
159
180
  });
160
181
  });
161
182
  var SheetBackground = createStyledHOC(SheetBackgroundFrame, function(param, forwardedRef) {
162
183
  var { scope, disableHideBottomOverflow, ...props } = param;
163
184
  var context = useSheetContext(scope);
185
+ if (context.onlyShowContainer) return null;
164
186
  var bottomOverflow = isWeb ? Math.max(context.frameSize, getMaxViewportHeight()) : context.frameSize;
165
187
  return /* @__PURE__ */ jsx(SheetBackgroundFrame, {
166
188
  ref: forwardedRef,
@@ -176,13 +198,8 @@ var SheetRoot = createRefComponent(function SheetRoot2(props, ref) {
176
198
  var { isShowingNonSheet } = useSheetController(props.scope);
177
199
  var shouldUseAdapt = Boolean(adaptContext.open !== void 0 || adaptContext.onOpenChange);
178
200
  var isShowingAdaptNonSheet = shouldUseAdapt && !adaptContext.active && adaptContext.open;
179
- var SheetImplementation = SheetImplementationCustom;
180
- if (props.native) {
181
- var impl = getNativeSheet("ios");
182
- if (impl) {
183
- SheetImplementation = impl;
184
- }
185
- }
201
+ var nativeImplementation = props.native === true || Array.isArray(props.native) && props.native.includes("ios") ? getNativeSheet("ios") : null;
202
+ var SheetImplementation = nativeImplementation !== null && nativeImplementation !== void 0 ? nativeImplementation : SheetImplementationCustom;
186
203
  if (isShowingAdaptNonSheet || isShowingNonSheet || !hydrated) {
187
204
  return null;
188
205
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Sheet.native.js","names":[],"sources":["esm/Sheet.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { AdaptCapabilities, useAdaptContext, useAdaptIsActive } from \"@tamagui/adapt\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { createRefComponent, createStyledHOC, styled, View } from \"@tamagui/core\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { resolveViewZIndex } from \"@tamagui/portal\";\nimport { RemoveScroll } from \"@tamagui/remove-scroll\";\nimport { XStack, YStack } from \"@tamagui/stacks\";\nimport { useDidFinishSSR } from \"@tamagui/use-did-finish-ssr\";\nimport { StackZIndexContext } from \"@tamagui/z-index-stack\";\nimport { useContext, useEffect, useMemo, useRef } from \"react\";\nimport { SHEET_BACKGROUND_NAME, SHEET_CONTAINER_NAME, SHEET_HANDLE_NAME, SHEET_OVERLAY_MARKER, SHEET_OVERLAY_NAME } from \"./constants\";\nimport { getNativeSheet } from \"./nativeSheet\";\nimport { SheetOverlayLayerContext, useAnimatedPosition, useSheetContext } from \"./SheetContext\";\nimport { SheetImplementationCustom } from \"./SheetImplementationCustom\";\nimport { SheetScrollView } from \"./SheetScrollView\";\nimport { useSheetController } from \"./useSheetController\";\nimport { useSheetOffscreenSize } from \"./useSheetOffscreenSize\";\nimport { getMaxViewportHeight } from \"./webViewport\";\nexport * from \"./types\";\nvar SheetHandleFrame = styled(XStack, {\n displayName: SHEET_HANDLE_NAME,\n // the behavior Handle ships no opacity rules; open/close aesthetics (fade in\n // when open, dim when idle) live in the copied skin. see the canonical skin.\n variants: {\n open: {\n true: {\n pointerEvents: \"auto\"\n },\n false: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nvar SheetOverlayFrame = styled(YStack, {\n displayName: SHEET_OVERLAY_NAME,\n inset: 0,\n position: \"absolute\",\n zIndex: 1e5 - 1,\n pointerEvents: \"auto\",\n variants: {\n open: {\n true: {\n pointerEvents: \"auto\"\n },\n false: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nObject.assign(SheetOverlayFrame.staticConfig, {\n [SHEET_OVERLAY_MARKER]: true\n});\nvar SheetContainerFrame = styled(YStack, {\n displayName: SHEET_CONTAINER_NAME,\n flex: 1,\n position: \"relative\",\n zIndex: 0,\n width: \"100%\",\n maxHeight: \"100%\"\n});\nvar SheetBackgroundFrame = styled(YStack, {\n displayName: SHEET_BACKGROUND_NAME,\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n zIndex: -1,\n pointerEvents: \"none\"\n});\nvar SheetHandle = createStyledHOC(SheetHandleFrame, function(param, forwardedRef) {\n var { scope, ...props } = param;\n var context = useSheetContext(scope);\n var composedRef = useComposedRefs(context.handleRef, forwardedRef);\n var wasDraggingRef = useRef(false);\n useEffect(function() {\n if (!context.scrollBridge) return;\n return context.scrollBridge.onParentDragging(function(isDragging) {\n if (isDragging) {\n wasDraggingRef.current = true;\n }\n });\n }, [\n context.scrollBridge\n ]);\n if (context.onlyShowContainer) {\n return null;\n }\n return /* @__PURE__ */ _jsx(SheetHandleFrame, {\n ref: composedRef,\n onPressIn: function() {\n wasDraggingRef.current = false;\n },\n onPress: function() {\n if (wasDraggingRef.current) {\n wasDraggingRef.current = false;\n return;\n }\n var max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0);\n var nextPos = (context.position + 1) % max;\n context.setPosition(nextPos);\n },\n open: context.open,\n ...props\n });\n});\nvar SheetOverlay = createStyledHOC(SheetOverlayFrame, function(propsIn, ref) {\n var { scope, ...props } = propsIn;\n var context = useSheetContext(scope);\n var isInOverlayLayer = useContext(SheetOverlayLayerContext);\n var didWarn = useRef(false);\n if (context.onlyShowContainer) {\n return null;\n }\n if (!isInOverlayLayer) {\n if (process.env.NODE_ENV === \"development\" && !didWarn.current) {\n didWarn.current = true;\n console.error(\"Sheet.Overlay must be a direct child of Sheet. Move it next to Sheet.Handle and Sheet.Container.\");\n }\n return null;\n }\n return /* @__PURE__ */ _jsx(SheetOverlayFrame, {\n ...props,\n ref,\n onPress: composeEventHandlers(props.onPress, context.dismissOnOverlayPress ? function() {\n context.setOpen(false);\n } : void 0)\n });\n});\nvar SheetContainer = createStyledHOC(SheetContainerFrame, function(param, forwardedRef) {\n var { scope, adjustPaddingForOffscreenContent, children, ...props } = param;\n var context = useSheetContext(scope);\n var { hasFit, disableRemoveScroll, frameSize, contentRef, open } = context;\n var composedContentRef = useComposedRefs(forwardedRef, contentRef);\n var offscreenSize = useSheetOffscreenSize(context);\n var stableFrameSize = useRef(frameSize);\n useEffect(function() {\n if (open && frameSize) {\n stableFrameSize.current = frameSize;\n }\n }, [\n open,\n frameSize\n ]);\n var sheetContents = useMemo(function() {\n var shouldUseFixedHeight = hasFit && !open && stableFrameSize.current;\n return /* @__PURE__ */ _jsxs(SheetContainerFrame, {\n ref: composedContentRef,\n flex: hasFit && open ? 0 : 1,\n flexBasis: hasFit ? \"auto\" : void 0,\n height: shouldUseFixedHeight ? stableFrameSize.current : hasFit ? void 0 : frameSize,\n pointerEvents: open ? \"auto\" : \"none\",\n \"data-state\": open ? \"open\" : \"closed\",\n ...props,\n children: [\n /* @__PURE__ */ _jsx(StackZIndexContext, {\n zIndex: resolveViewZIndex(props.zIndex),\n children\n }),\n adjustPaddingForOffscreenContent && /* @__PURE__ */ _jsx(View, {\n \"data-sheet-offscreen-pad\": true,\n height: offscreenSize,\n width: \"100%\"\n })\n ]\n });\n }, [\n open,\n props,\n frameSize,\n offscreenSize,\n adjustPaddingForOffscreenContent,\n hasFit\n ]);\n return /* @__PURE__ */ _jsx(RemoveScroll, {\n enabled: !disableRemoveScroll && context.open,\n children: sheetContents\n });\n});\nvar SheetBackground = createStyledHOC(SheetBackgroundFrame, function(param, forwardedRef) {\n var { scope, disableHideBottomOverflow, ...props } = param;\n var context = useSheetContext(scope);\n var bottomOverflow = isWeb ? Math.max(context.frameSize, getMaxViewportHeight()) : context.frameSize;\n return /* @__PURE__ */ _jsx(SheetBackgroundFrame, {\n ref: forwardedRef,\n \"data-sheet-background\": \"\",\n bottom: disableHideBottomOverflow ? 0 : -bottomOverflow,\n ...props\n });\n});\nvar SheetRoot = createRefComponent(function SheetRoot2(props, ref) {\n var hydrated = useDidFinishSSR();\n var isAdapted = useAdaptIsActive();\n var adaptContext = useAdaptContext();\n var { isShowingNonSheet } = useSheetController(props.scope);\n var shouldUseAdapt = Boolean(adaptContext.open !== void 0 || adaptContext.onOpenChange);\n var isShowingAdaptNonSheet = shouldUseAdapt && !adaptContext.active && adaptContext.open;\n var SheetImplementation = SheetImplementationCustom;\n if (props.native) {\n var impl = getNativeSheet(\"ios\");\n if (impl) {\n SheetImplementation = impl;\n }\n }\n if (isShowingAdaptNonSheet || isShowingNonSheet || !hydrated) {\n return null;\n }\n var implementation = /* @__PURE__ */ _jsx(SheetImplementation, {\n ref,\n ...props\n });\n return isAdapted ? /* @__PURE__ */ _jsx(AdaptCapabilities, {\n scroll: true,\n overlay: true,\n dismiss: true,\n children: implementation\n }) : implementation;\n});\nvar sheetParts = {\n Container: SheetContainer,\n Background: SheetBackground,\n Overlay: SheetOverlay,\n Handle: SheetHandle,\n ScrollView: SheetScrollView\n};\nvar SheetControlled = withStaticProperties(SheetRoot, sheetParts);\nvar Sheet = withStaticProperties(SheetRoot, {\n Root: SheetRoot,\n Controlled: SheetControlled,\n useAnimatedPosition,\n ...sheetParts\n});\nexport {\n Sheet,\n SheetBackground,\n SheetContainer,\n SheetControlled,\n SheetHandle,\n SheetOverlay,\n SheetRoot\n};\n//# sourceMappingURL=Sheet.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAI,mBAAmB,OAAO,QAAQ;CACpC,aAAa;CAGb,UAAU,EACR,MAAM;EACJ,MAAM,EACJ,eAAe,OACjB;EACA,OAAO,EACL,eAAe,OACjB;CACF,EACF;AACF,CAAC;AACD,IAAI,oBAAoB,OAAO,QAAQ;CACrC,aAAa;CACb,OAAO;CACP,UAAU;CACV,QAAQ,MAAM;CACd,eAAe;CACf,UAAU,EACR,MAAM;EACJ,MAAM,EACJ,eAAe,OACjB;EACA,OAAO,EACL,eAAe,OACjB;CACF,EACF;AACF,CAAC;AACD,OAAO,OAAO,kBAAkB,cAAc,GAC3C,uBAAuB,KAC1B,CAAC;AACD,IAAI,sBAAsB,OAAO,QAAQ;CACvC,aAAa;CACb,MAAM;CACN,UAAU;CACV,QAAQ;CACR,OAAO;CACP,WAAW;AACb,CAAC;AACD,IAAI,uBAAuB,OAAO,QAAQ;CACxC,aAAa;CACb,UAAU;CACV,KAAK;CACL,MAAM;CACN,OAAO;CACP,QAAQ,CAAC;CACT,eAAe;AACjB,CAAC;AACD,IAAI,cAAc,gBAAgB,kBAAkB,SAAS,OAAO,cAAc;CAChF,IAAI,EAAE,OAAO,GAAG,UAAU;CAC1B,IAAI,UAAU,gBAAgB,KAAK;CACnC,IAAI,cAAc,gBAAgB,QAAQ,WAAW,YAAY;CACjE,IAAI,iBAAiB,OAAO,KAAK;CACjC,UAAU,WAAW;EACnB,IAAI,CAAC,QAAQ,cAAc;EAC3B,OAAO,QAAQ,aAAa,iBAAiB,SAAS,YAAY;GAChE,IAAI,YAAY;IACd,eAAe,UAAU;GAC3B;EACF,CAAC;CACH,GAAG,CACD,QAAQ,YACV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,mBAAmB,MAAM,KAAK;CAC1D,IAAI,iBAAiB,QAAQ,aAAa,SAAS,KAAK,KAAK,aAAa,YAAY;CACtF,IAAI,yBAAyB,kBAAkB,CAAC,aAAa,UAAU,aAAa;CACpF,IAAI,sBAAsB;CAC1B,IAAI,MAAM,QAAQ;EAChB,IAAI,OAAO,eAAe,KAAK;EAC/B,IAAI,MAAM;GACR,sBAAsB;EACxB;CACF;CACA,IAAI,0BAA0B,qBAAqB,CAAC,UAAU;EAC5D,OAAO;CACT;CACA,IAAI,iBAAiC,oBAAK,qBAAqB;EAC7D;EACA,GAAG;CACL,CAAC;CACD,OAAO,YAA4B,oBAAK,mBAAmB;EACzD,QAAQ;EACR,SAAS;EACT,SAAS;EACT,UAAU;CACZ,CAAC,IAAI;AACP,CAAC;AACD,IAAI,aAAa;CACf,WAAW;CACX,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,YAAY;AACd;AACA,IAAI,kBAAkB,qBAAqB,WAAW,UAAU;AAChE,IAAI,QAAQ,qBAAqB,WAAW;CAC1C,MAAM;CACN,YAAY;CACZ;CACA,GAAG;AACL,CAAC"}
1
+ {"version":3,"file":"Sheet.native.js","names":[],"sources":["esm/Sheet.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { AdaptCapabilities, useAdaptContext, useAdaptIsActive } from \"@tamagui/adapt\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { createRefComponent, createStyledHOC, styled, View } from \"@tamagui/core\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { resolveViewZIndex } from \"@tamagui/portal\";\nimport { RemoveScroll } from \"@tamagui/remove-scroll\";\nimport { XStack, YStack } from \"@tamagui/stacks\";\nimport { useDidFinishSSR } from \"@tamagui/use-did-finish-ssr\";\nimport { StackZIndexContext } from \"@tamagui/z-index-stack\";\nimport { useContext, useEffect, useMemo, useRef } from \"react\";\nimport { SHEET_BACKGROUND_NAME, SHEET_CONTAINER_NAME, SHEET_HANDLE_NAME, SHEET_OVERLAY_MARKER, SHEET_OVERLAY_NAME } from \"./constants\";\nimport { getNativeSheet } from \"./nativeSheet\";\nimport { SheetOverlayLayerContext, useAnimatedPosition, useSheetContext } from \"./SheetContext\";\nimport { SheetImplementationCustom } from \"./SheetImplementationCustom\";\nimport { SheetScrollView } from \"./SheetScrollView\";\nimport { useSheetController } from \"./useSheetController\";\nimport { useSheetOffscreenSize } from \"./useSheetOffscreenSize\";\nimport { getMaxViewportHeight } from \"./webViewport\";\nexport * from \"./types\";\nvar SheetHandleFrame = styled(XStack, {\n displayName: SHEET_HANDLE_NAME,\n // the behavior Handle ships no opacity rules; open/close aesthetics (fade in\n // when open, dim when idle) live in the copied skin. see the canonical skin.\n variants: {\n open: {\n true: {\n pointerEvents: \"auto\"\n },\n false: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nvar SheetOverlayFrame = styled(YStack, {\n displayName: SHEET_OVERLAY_NAME,\n inset: 0,\n position: \"absolute\",\n zIndex: 1e5 - 1,\n pointerEvents: \"auto\",\n variants: {\n open: {\n true: {\n pointerEvents: \"auto\"\n },\n false: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nObject.assign(SheetOverlayFrame.staticConfig, {\n [SHEET_OVERLAY_MARKER]: true\n});\nvar SheetContainerFrame = styled(YStack, {\n displayName: SHEET_CONTAINER_NAME,\n flex: 1,\n position: \"relative\",\n zIndex: 0,\n width: \"100%\"\n});\nvar SheetBackgroundFrame = styled(YStack, {\n displayName: SHEET_BACKGROUND_NAME,\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n zIndex: -1,\n pointerEvents: \"none\"\n});\nvar SheetHandle = createStyledHOC(SheetHandleFrame, function(param, forwardedRef) {\n var { scope, ...props } = param;\n var context = useSheetContext(scope);\n var composedRef = useComposedRefs(context.handleRef, forwardedRef);\n var wasDraggingRef = useRef(false);\n useEffect(function() {\n if (!context.scrollBridge) return;\n return context.scrollBridge.onParentDragging(function(isDragging) {\n if (isDragging) {\n wasDraggingRef.current = true;\n }\n });\n }, [\n context.scrollBridge\n ]);\n if (context.onlyShowContainer) {\n return null;\n }\n return /* @__PURE__ */ _jsx(SheetHandleFrame, {\n ref: composedRef,\n onPressIn: function() {\n wasDraggingRef.current = false;\n },\n onPress: function() {\n if (wasDraggingRef.current) {\n wasDraggingRef.current = false;\n return;\n }\n var max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0);\n var nextPos = (context.position + 1) % max;\n context.setPosition(nextPos);\n },\n open: context.open,\n ...props\n });\n});\nvar SheetOverlay = createStyledHOC(SheetOverlayFrame, function(propsIn, ref) {\n var { scope, ...props } = propsIn;\n var context = useSheetContext(scope);\n var isInOverlayLayer = useContext(SheetOverlayLayerContext);\n var didWarn = useRef(false);\n if (context.onlyShowContainer) {\n return null;\n }\n if (!isInOverlayLayer) {\n if (process.env.NODE_ENV === \"development\" && !didWarn.current) {\n didWarn.current = true;\n console.error(\"Sheet.Overlay must be a direct child of Sheet. Move it next to Sheet.Handle and Sheet.Container.\");\n }\n return null;\n }\n return /* @__PURE__ */ _jsx(SheetOverlayFrame, {\n ...props,\n ref,\n onPress: composeEventHandlers(props.onPress, context.dismissOnOverlayPress ? function() {\n context.setOpen(false);\n } : void 0)\n });\n});\nvar SheetContainer = createStyledHOC(SheetContainerFrame, function(param, forwardedRef) {\n var { scope, adjustPaddingForOffscreenContent, children, ...props } = param;\n var context = useSheetContext(scope);\n var { hasFit, frameSize, contentRef, open } = context;\n var composedContentRef = useComposedRefs(forwardedRef, contentRef);\n var offscreenSize = useSheetOffscreenSize(context);\n var stableFrameSize = useRef(frameSize);\n useEffect(function() {\n if (open && frameSize) {\n stableFrameSize.current = frameSize;\n }\n }, [\n open,\n frameSize\n ]);\n var sheetContents = useMemo(function() {\n if (context.onlyShowContainer) {\n return /* @__PURE__ */ _jsx(SheetContainerFrame, {\n ref: composedContentRef,\n flex: hasFit ? 0 : 1,\n flexBasis: hasFit ? \"auto\" : void 0,\n maxHeight: hasFit ? void 0 : \"100%\",\n pointerEvents: open ? \"auto\" : \"none\",\n \"data-state\": open ? \"open\" : \"closed\",\n ...props,\n onLayout: composeEventHandlers(props.onLayout, function(event) {\n context.setFrameSize(event.nativeEvent.layout.height);\n }),\n children: /* @__PURE__ */ _jsx(StackZIndexContext, {\n zIndex: resolveViewZIndex(props.zIndex),\n children\n })\n });\n }\n var shouldUseFixedHeight = hasFit && !open && stableFrameSize.current;\n return /* @__PURE__ */ _jsxs(SheetContainerFrame, {\n ref: composedContentRef,\n flex: hasFit && open ? 0 : 1,\n flexBasis: hasFit ? \"auto\" : void 0,\n maxHeight: \"100%\",\n height: shouldUseFixedHeight ? stableFrameSize.current : hasFit ? void 0 : frameSize,\n pointerEvents: open ? \"auto\" : \"none\",\n \"data-state\": open ? \"open\" : \"closed\",\n ...props,\n children: [\n /* @__PURE__ */ _jsx(StackZIndexContext, {\n zIndex: resolveViewZIndex(props.zIndex),\n children\n }),\n adjustPaddingForOffscreenContent && /* @__PURE__ */ _jsx(View, {\n \"data-sheet-offscreen-pad\": true,\n height: offscreenSize,\n width: \"100%\"\n })\n ]\n });\n }, [\n open,\n props,\n frameSize,\n offscreenSize,\n adjustPaddingForOffscreenContent,\n hasFit,\n context.onlyShowContainer,\n context.setFrameSize\n ]);\n if (context.onlyShowContainer) return sheetContents;\n return /* @__PURE__ */ _jsx(RemoveScroll, {\n enabled: !context.disableRemoveScroll && context.open,\n children: sheetContents\n });\n});\nvar SheetBackground = createStyledHOC(SheetBackgroundFrame, function(param, forwardedRef) {\n var { scope, disableHideBottomOverflow, ...props } = param;\n var context = useSheetContext(scope);\n if (context.onlyShowContainer) return null;\n var bottomOverflow = isWeb ? Math.max(context.frameSize, getMaxViewportHeight()) : context.frameSize;\n return /* @__PURE__ */ _jsx(SheetBackgroundFrame, {\n ref: forwardedRef,\n \"data-sheet-background\": \"\",\n bottom: disableHideBottomOverflow ? 0 : -bottomOverflow,\n ...props\n });\n});\nvar SheetRoot = createRefComponent(function SheetRoot2(props, ref) {\n var hydrated = useDidFinishSSR();\n var isAdapted = useAdaptIsActive();\n var adaptContext = useAdaptContext();\n var { isShowingNonSheet } = useSheetController(props.scope);\n var shouldUseAdapt = Boolean(adaptContext.open !== void 0 || adaptContext.onOpenChange);\n var isShowingAdaptNonSheet = shouldUseAdapt && !adaptContext.active && adaptContext.open;\n var nativeImplementation = props.native === true || Array.isArray(props.native) && props.native.includes(\"ios\") ? getNativeSheet(\"ios\") : null;\n var SheetImplementation = nativeImplementation !== null && nativeImplementation !== void 0 ? nativeImplementation : SheetImplementationCustom;\n if (isShowingAdaptNonSheet || isShowingNonSheet || !hydrated) {\n return null;\n }\n var implementation = /* @__PURE__ */ _jsx(SheetImplementation, {\n ref,\n ...props\n });\n return isAdapted ? /* @__PURE__ */ _jsx(AdaptCapabilities, {\n scroll: true,\n overlay: true,\n dismiss: true,\n children: implementation\n }) : implementation;\n});\nvar sheetParts = {\n Container: SheetContainer,\n Background: SheetBackground,\n Overlay: SheetOverlay,\n Handle: SheetHandle,\n ScrollView: SheetScrollView\n};\nvar SheetControlled = withStaticProperties(SheetRoot, sheetParts);\nvar Sheet = withStaticProperties(SheetRoot, {\n Root: SheetRoot,\n Controlled: SheetControlled,\n useAnimatedPosition,\n ...sheetParts\n});\nexport {\n Sheet,\n SheetBackground,\n SheetContainer,\n SheetControlled,\n SheetHandle,\n SheetOverlay,\n SheetRoot\n};\n//# sourceMappingURL=Sheet.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAI,mBAAmB,OAAO,QAAQ;CACpC,aAAa;CAGb,UAAU,EACR,MAAM;EACJ,MAAM,EACJ,eAAe,OACjB;EACA,OAAO,EACL,eAAe,OACjB;CACF,EACF;AACF,CAAC;AACD,IAAI,oBAAoB,OAAO,QAAQ;CACrC,aAAa;CACb,OAAO;CACP,UAAU;CACV,QAAQ,MAAM;CACd,eAAe;CACf,UAAU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,gBAAgB;CACnC,IAAI,EAAE,sBAAsB,mBAAmB,MAAM,KAAK;CAC1D,IAAI,iBAAiB,QAAQ,aAAa,SAAS,KAAK,KAAK,aAAa,YAAY;CACtF,IAAI,yBAAyB,kBAAkB,CAAC,aAAa,UAAU,aAAa;CACpF,IAAI,uBAAuB,MAAM,WAAW,QAAQ,MAAM,QAAQ,MAAM,MAAM,KAAK,MAAM,OAAO,SAAS,KAAK,IAAI,eAAe,KAAK,IAAI;CAC1I,IAAI,sBAAsB,yBAAyB,QAAQ,yBAAyB,KAAK,IAAI,uBAAuB;CACpH,IAAI,0BAA0B,qBAAqB,CAAC,UAAU;EAC5D,OAAO;CACT;CACA,IAAI,iBAAiC,oBAAK,qBAAqB;EAC7D;EACA,GAAG;CACL,CAAC;CACD,OAAO,YAA4B,oBAAK,mBAAmB;EACzD,QAAQ;EACR,SAAS;EACT,SAAS;EACT,UAAU;CACZ,CAAC,IAAI;AACP,CAAC;AACD,IAAI,aAAa;CACf,WAAW;CACX,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,YAAY;AACd;AACA,IAAI,kBAAkB,qBAAqB,WAAW,UAAU;AAChE,IAAI,QAAQ,qBAAqB,WAAW;CAC1C,MAAM;CACN,YAAY;CACZ;CACA,GAAG;AACL,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { composeRefs } from "@tamagui/compose-refs";
2
- import { View, createStyledHOC, isWeb } from "@tamagui/core";
2
+ import { View, createRefComponent, createStyledHOC, isWeb } from "@tamagui/core";
3
3
  import { ScrollView } from "@tamagui/scroll-view";
4
4
  import { useControllableState } from "@tamagui/use-controllable-state";
5
5
  import React, { useEffect, useRef, useState } from "react";
@@ -12,8 +12,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
12
12
 
13
13
  const SHEET_SCROLL_VIEW_NAME = "SheetScrollView";
14
14
  const sheetContentStyle = { minHeight: "100%" };
15
- const SheetScrollView = createStyledHOC(ScrollView, ({ scope, children, onScroll, scrollEnabled: scrollEnabledProp, style, ...props }, ref) => {
15
+ const SheetScrollViewCustom = createRefComponent(({ scope, children, onScroll, scrollEnabled: scrollEnabledProp, style, ...props }, ref) => {
16
16
  const context = useSheetContext(scope);
17
+ if (context.onlyShowContainer) throw new Error("Custom Sheet scrolling requires a custom Sheet");
17
18
  const gestureContext = useGestureSheetContext();
18
19
  const { scrollBridge, setHasScrollView, hasFit, screenSize } = context;
19
20
  const keyboardOccludedHeight = Math.max(0, context.keyboardOccludedHeight || 0);
@@ -282,6 +283,17 @@ const SheetScrollView = createStyledHOC(ScrollView, ({ scope, children, onScroll
282
283
  style: scrollViewStyle,
283
284
  children: contentWrapper
284
285
  });
286
+ });
287
+ const SheetScrollView = createStyledHOC(ScrollView, ({ scope, ...props }, ref) => {
288
+ const context = useSheetContext(scope);
289
+ return context.onlyShowContainer ? /* @__PURE__ */ jsx(ScrollView, {
290
+ ...props,
291
+ ref
292
+ }) : /* @__PURE__ */ jsx(SheetScrollViewCustom, {
293
+ ...props,
294
+ scope,
295
+ ref
296
+ });
285
297
  }, {
286
298
  disableTheme: true,
287
299
  displayName: SHEET_SCROLL_VIEW_NAME