@multiplatform.one/components 9.1.0 → 9.2.0
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/cjs/SheetModal/SheetBodyRegion.cjs +44 -0
- package/dist/cjs/SheetModal/SheetBodyRegion.native.js +48 -0
- package/dist/cjs/SheetModal/SheetBodyRegion.native.js.map +1 -0
- package/dist/cjs/SheetModal/SheetHeader.cjs +11 -14
- package/dist/cjs/SheetModal/SheetHeader.native.js +11 -14
- package/dist/cjs/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/cjs/SheetModal/index.cjs +57 -18
- package/dist/cjs/SheetModal/index.native.js +87 -65
- package/dist/cjs/SheetModal/index.native.js.map +1 -1
- package/dist/cjs/actions/StandardAction.cjs +62 -1
- package/dist/cjs/actions/StandardAction.native.js +63 -1
- package/dist/cjs/actions/StandardAction.native.js.map +1 -1
- package/dist/cjs/appShell/TabHost.native.js +24 -3
- package/dist/cjs/appShell/TabHost.native.js.map +1 -1
- package/dist/cjs/appShell/bottomChrome.cjs +3 -0
- package/dist/cjs/appShell/bottomChrome.native.js +3 -0
- package/dist/cjs/appShell/bottomChrome.native.js.map +1 -1
- package/dist/cjs/appShell/index.cjs +2 -1
- package/dist/cjs/appShell/index.native.js +2 -1
- package/dist/cjs/appShell/index.native.js.map +1 -1
- package/dist/cjs/charts/ChartDataView.cjs +0 -1
- package/dist/cjs/charts/ChartDataView.native.js +0 -1
- package/dist/cjs/charts/ChartDataView.native.js.map +1 -1
- package/dist/cjs/icons/lucide.cjs +16 -8
- package/dist/cjs/icons/lucide.native.js +16 -8
- package/dist/cjs/icons/lucide.native.js.map +1 -1
- package/dist/cjs/icons/themed.cjs +4 -1
- package/dist/cjs/icons/themed.native.js +4 -1
- package/dist/cjs/icons/themed.native.js.map +1 -1
- package/dist/cjs/layouts/page.cjs +25 -2
- package/dist/cjs/layouts/page.native.js +27 -2
- package/dist/cjs/layouts/page.native.js.map +1 -1
- package/dist/cjs/layouts/timeline.cjs +4 -3
- package/dist/cjs/layouts/timeline.native.js +4 -3
- package/dist/cjs/layouts/timeline.native.js.map +1 -1
- package/dist/cjs/surfaces.cjs +1 -1
- package/dist/cjs/surfaces.native.js +1 -1
- package/dist/cjs/surfaces.native.js.map +1 -1
- package/dist/cjs/views/FilePreview.cjs +1 -1
- package/dist/cjs/views/FilePreview.native.js +1 -1
- package/dist/cjs/views/FilePreview.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetBodyRegion.mjs +19 -0
- package/dist/esm/SheetModal/SheetBodyRegion.mjs.map +1 -0
- package/dist/esm/SheetModal/SheetBodyRegion.native.js +20 -0
- package/dist/esm/SheetModal/SheetBodyRegion.native.js.map +1 -0
- package/dist/esm/SheetModal/SheetHeader.mjs +11 -14
- package/dist/esm/SheetModal/SheetHeader.mjs.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.native.js +11 -14
- package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/esm/SheetModal/index.mjs +61 -22
- package/dist/esm/SheetModal/index.mjs.map +1 -1
- package/dist/esm/SheetModal/index.native.js +89 -67
- package/dist/esm/SheetModal/index.native.js.map +1 -1
- package/dist/esm/actions/StandardAction.mjs +63 -2
- package/dist/esm/actions/StandardAction.mjs.map +1 -1
- package/dist/esm/actions/StandardAction.native.js +64 -2
- package/dist/esm/actions/StandardAction.native.js.map +1 -1
- package/dist/esm/appShell/TabHost.native.js +26 -5
- package/dist/esm/appShell/TabHost.native.js.map +1 -1
- package/dist/esm/appShell/bottomChrome.mjs +2 -1
- package/dist/esm/appShell/bottomChrome.mjs.map +1 -1
- package/dist/esm/appShell/bottomChrome.native.js +2 -1
- package/dist/esm/appShell/bottomChrome.native.js.map +1 -1
- package/dist/esm/appShell/index.mjs +2 -2
- package/dist/esm/appShell/index.mjs.map +1 -1
- package/dist/esm/appShell/index.native.js +2 -2
- package/dist/esm/appShell/index.native.js.map +1 -1
- package/dist/esm/charts/ChartDataView.mjs +0 -1
- package/dist/esm/charts/ChartDataView.mjs.map +1 -1
- package/dist/esm/charts/ChartDataView.native.js +0 -1
- package/dist/esm/charts/ChartDataView.native.js.map +1 -1
- package/dist/esm/icons/lucide.mjs +11 -3
- package/dist/esm/icons/lucide.mjs.map +1 -1
- package/dist/esm/icons/lucide.native.js +11 -3
- package/dist/esm/icons/lucide.native.js.map +1 -1
- package/dist/esm/icons/themed.mjs +4 -1
- package/dist/esm/icons/themed.mjs.map +1 -1
- package/dist/esm/icons/themed.native.js +4 -1
- package/dist/esm/icons/themed.native.js.map +1 -1
- package/dist/esm/layouts/page.mjs +26 -3
- package/dist/esm/layouts/page.mjs.map +1 -1
- package/dist/esm/layouts/page.native.js +28 -3
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/esm/layouts/timeline.mjs +2 -1
- package/dist/esm/layouts/timeline.mjs.map +1 -1
- package/dist/esm/layouts/timeline.native.js +2 -1
- package/dist/esm/layouts/timeline.native.js.map +1 -1
- package/dist/esm/surfaces.mjs +1 -1
- package/dist/esm/surfaces.mjs.map +1 -1
- package/dist/esm/surfaces.native.js +1 -1
- package/dist/esm/surfaces.native.js.map +1 -1
- package/dist/esm/views/FilePreview.mjs +1 -1
- package/dist/esm/views/FilePreview.mjs.map +1 -1
- package/dist/esm/views/FilePreview.native.js +1 -1
- package/dist/esm/views/FilePreview.native.js.map +1 -1
- package/dist/jsx/SheetModal/SheetBodyRegion.mjs +19 -0
- package/dist/jsx/SheetModal/SheetBodyRegion.mjs.map +1 -0
- package/dist/jsx/SheetModal/SheetBodyRegion.native.js +48 -0
- package/dist/jsx/SheetModal/SheetBodyRegion.native.js.map +1 -0
- package/dist/jsx/SheetModal/SheetHeader.mjs +11 -14
- package/dist/jsx/SheetModal/SheetHeader.mjs.map +1 -1
- package/dist/jsx/SheetModal/SheetHeader.native.js +11 -14
- package/dist/jsx/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/jsx/SheetModal/index.mjs +61 -22
- package/dist/jsx/SheetModal/index.mjs.map +1 -1
- package/dist/jsx/SheetModal/index.native.js +87 -65
- package/dist/jsx/SheetModal/index.native.js.map +1 -1
- package/dist/jsx/actions/StandardAction.mjs +63 -2
- package/dist/jsx/actions/StandardAction.mjs.map +1 -1
- package/dist/jsx/actions/StandardAction.native.js +63 -1
- package/dist/jsx/actions/StandardAction.native.js.map +1 -1
- package/dist/jsx/appShell/TabHost.native.js +24 -3
- package/dist/jsx/appShell/TabHost.native.js.map +1 -1
- package/dist/jsx/appShell/bottomChrome.mjs +2 -1
- package/dist/jsx/appShell/bottomChrome.mjs.map +1 -1
- package/dist/jsx/appShell/bottomChrome.native.js +3 -0
- package/dist/jsx/appShell/bottomChrome.native.js.map +1 -1
- package/dist/jsx/appShell/index.mjs +2 -2
- package/dist/jsx/appShell/index.mjs.map +1 -1
- package/dist/jsx/appShell/index.native.js +2 -1
- package/dist/jsx/charts/ChartDataView.mjs +0 -1
- package/dist/jsx/charts/ChartDataView.mjs.map +1 -1
- package/dist/jsx/charts/ChartDataView.native.js +0 -1
- package/dist/jsx/charts/ChartDataView.native.js.map +1 -1
- package/dist/jsx/icons/lucide.mjs +11 -3
- package/dist/jsx/icons/lucide.mjs.map +1 -1
- package/dist/jsx/icons/lucide.native.js +16 -8
- package/dist/jsx/icons/lucide.native.js.map +1 -1
- package/dist/jsx/icons/themed.mjs +4 -1
- package/dist/jsx/icons/themed.mjs.map +1 -1
- package/dist/jsx/icons/themed.native.js +4 -1
- package/dist/jsx/icons/themed.native.js.map +1 -1
- package/dist/jsx/layouts/page.mjs +26 -3
- package/dist/jsx/layouts/page.mjs.map +1 -1
- package/dist/jsx/layouts/page.native.js +27 -2
- package/dist/jsx/layouts/page.native.js.map +1 -1
- package/dist/jsx/layouts/timeline.mjs +2 -1
- package/dist/jsx/layouts/timeline.mjs.map +1 -1
- package/dist/jsx/layouts/timeline.native.js +4 -3
- package/dist/jsx/layouts/timeline.native.js.map +1 -1
- package/dist/jsx/surfaces.mjs +1 -1
- package/dist/jsx/surfaces.mjs.map +1 -1
- package/dist/jsx/surfaces.native.js +1 -1
- package/dist/jsx/views/FilePreview.mjs +1 -1
- package/dist/jsx/views/FilePreview.mjs.map +1 -1
- package/dist/jsx/views/FilePreview.native.js +1 -1
- package/dist/jsx/views/FilePreview.native.js.map +1 -1
- package/package.json +7 -7
- package/src/SheetFrame.stories.tsx +2 -2
- package/src/SheetModal/SheetBodyRegion.tsx +19 -0
- package/src/SheetModal/SheetHeader.tsx +23 -27
- package/src/SheetModal/SheetModal.grabber.spec.tsx +52 -10
- package/src/SheetModal/SheetModal.native.spec.tsx +90 -6
- package/src/SheetModal/SheetModal.noHeaderBar.spec.tsx +103 -0
- package/src/SheetModal/SheetModal.onDismiss.spec.tsx +35 -0
- package/src/SheetModal/SheetModal.stories.spec.tsx +11 -13
- package/src/SheetModal/SheetModal.stories.tsx +2 -6
- package/src/SheetModal/SheetModal.titleRow.spec.tsx +203 -0
- package/src/SheetModal/index.native.tsx +83 -54
- package/src/SheetModal/index.tsx +99 -25
- package/src/SheetScrollView/SheetScrollView.stories.tsx +2 -2
- package/src/actions/StandardAction.tsx +72 -4
- package/src/appShell/TabHost.native.tsx +50 -5
- package/src/appShell/TabHost.nestedScroll.spec.tsx +177 -0
- package/src/appShell/bottomChrome.ts +2 -0
- package/src/appShell/index.ts +1 -1
- package/src/charts/ChartDataView.tsx +0 -1
- package/src/charts/Charts.stories.tsx +20 -0
- package/src/icons/lucide.glyphGrid.spec.tsx +41 -0
- package/src/icons/lucide.ts +21 -2
- package/src/icons/themed.tsx +6 -2
- package/src/layouts/page.tsx +35 -2
- package/src/layouts/severityShape.spec.tsx +31 -0
- package/src/layouts/timeline.tsx +1 -1
- package/src/surfaces.spec.tsx +6 -2
- package/src/surfaces.tsx +1 -1
- package/src/views/FilePreview.tsx +1 -8
- package/src/views/filePreview.spec.tsx +3 -4
- package/types/Chip/index.d.ts +1 -1
- package/types/Collapsible.d.ts +1 -1
- package/types/Dialog.d.ts +3 -3
- package/types/SheetModal/SheetBodyRegion.d.ts +9 -0
- package/types/SheetModal/SheetBodyRegion.d.ts.map +1 -0
- package/types/SheetModal/SheetHeader.d.ts +4 -4
- package/types/SheetModal/SheetHeader.d.ts.map +1 -1
- package/types/SheetModal/index.d.ts +12 -4
- package/types/SheetModal/index.d.ts.map +1 -1
- package/types/SheetModal/index.native.d.ts +1 -1
- package/types/SheetModal/index.native.d.ts.map +1 -1
- package/types/actions/StandardAction.d.ts +4 -3
- package/types/actions/StandardAction.d.ts.map +1 -1
- package/types/appShell/TabHost.native.d.ts.map +1 -1
- package/types/appShell/bottomChrome.d.ts +1 -0
- package/types/appShell/bottomChrome.d.ts.map +1 -1
- package/types/appShell/index.d.ts +1 -1
- package/types/appShell/index.d.ts.map +1 -1
- package/types/charts/ChartDataView.d.ts.map +1 -1
- package/types/icons/lucide.d.ts +7 -3
- package/types/icons/lucide.d.ts.map +1 -1
- package/types/icons/themed.d.ts.map +1 -1
- package/types/layouts/page.d.ts.map +1 -1
- package/types/layouts/timeline.d.ts.map +1 -1
- package/types/views/FilePreview.d.ts.map +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: true
|
|
22
|
+
}), mod);
|
|
23
|
+
var SheetBodyRegion_exports = {};
|
|
24
|
+
__export(SheetBodyRegion_exports, {
|
|
25
|
+
SheetBodyRegion: () => SheetBodyRegion
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(SheetBodyRegion_exports);
|
|
28
|
+
var import_theme = require("@multiplatform.one/theme");
|
|
29
|
+
var import_surfaces = require("../surfaces.cjs");
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
+
const IN_DIALOG_REGION = {
|
|
32
|
+
inDialogRegion: true
|
|
33
|
+
};
|
|
34
|
+
function SheetBodyRegion({
|
|
35
|
+
children
|
|
36
|
+
}) {
|
|
37
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_theme.SheetBodyProvider, {
|
|
38
|
+
value: true,
|
|
39
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_surfaces.DialogRegionContext.Provider, {
|
|
40
|
+
value: IN_DIALOG_REGION,
|
|
41
|
+
children
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var SheetBodyRegion_exports = {};
|
|
26
|
+
__export(SheetBodyRegion_exports, {
|
|
27
|
+
SheetBodyRegion: () => SheetBodyRegion
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(SheetBodyRegion_exports);
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
+
var import_theme = require("@multiplatform.one/theme");
|
|
32
|
+
var import_surfaces = require("../surfaces.native.js");
|
|
33
|
+
var IN_DIALOG_REGION = {
|
|
34
|
+
inDialogRegion: true
|
|
35
|
+
};
|
|
36
|
+
function SheetBodyRegion(param) {
|
|
37
|
+
var {
|
|
38
|
+
children
|
|
39
|
+
} = param;
|
|
40
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_theme.SheetBodyProvider, {
|
|
41
|
+
value: true,
|
|
42
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_surfaces.DialogRegionContext.Provider, {
|
|
43
|
+
value: IN_DIALOG_REGION,
|
|
44
|
+
children
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=SheetBodyRegion.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","SheetBodyRegion_exports","__export","SheetBodyRegion","module","exports","import_jsx_runtime","require","import_theme","import_surfaces","IN_DIALOG_REGION","inDialogRegion"],"sources":["../../../src/SheetModal/SheetBodyRegion.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,uBAAA;AAAAC,QAAA,CAAAD,uBAAA;EAAAE,eAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAkC,CAAAK,uBAAA;AAElC,IAAAK,kBAAoC,GAAAC,OAAA;AAW9B,IAAAC,YAAA,GAAAD,OAAA;AATN,IAAAE,eAAM,GAAAF,OAAqB,wBAAgB;AAMpC,IAAAG,gBAAS;EACdC,cACE;AAMJ","ignoreList":[]}
|
|
@@ -45,21 +45,18 @@ function SheetHeader({
|
|
|
45
45
|
}) {
|
|
46
46
|
if (isOverlayHeader(header)) {
|
|
47
47
|
const own = header.props.actions;
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}) : /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
58
|
-
children: [own, actions]
|
|
59
|
-
})
|
|
48
|
+
return actions ? (0, import_react.cloneElement)(header, {
|
|
49
|
+
actions: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.XStack, {
|
|
50
|
+
testID: "sheet-modal-header-actions",
|
|
51
|
+
flexShrink: 0,
|
|
52
|
+
alignItems: "center",
|
|
53
|
+
children: countItems(own) + countItems(actions) > 1 ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_forms.IconButtonGroup, {
|
|
54
|
+
children: [own, actions]
|
|
55
|
+
}) : /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
56
|
+
children: [own, actions]
|
|
60
57
|
})
|
|
61
|
-
})
|
|
62
|
-
});
|
|
58
|
+
})
|
|
59
|
+
}) : header;
|
|
63
60
|
}
|
|
64
61
|
if (!actions) return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
65
62
|
children: header
|
|
@@ -50,21 +50,18 @@ function SheetHeader(param) {
|
|
|
50
50
|
} = param;
|
|
51
51
|
if (isOverlayHeader(header)) {
|
|
52
52
|
var own = header.props.actions;
|
|
53
|
-
return /* @__PURE__ */(0,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}) : /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
63
|
-
children: [own, actions]
|
|
64
|
-
})
|
|
53
|
+
return actions ? /* @__PURE__ */(0, import_react.cloneElement)(header, {
|
|
54
|
+
actions: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.XStack, {
|
|
55
|
+
testID: "sheet-modal-header-actions",
|
|
56
|
+
flexShrink: 0,
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
children: countItems(own) + countItems(actions) > 1 ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_forms.IconButtonGroup, {
|
|
59
|
+
children: [own, actions]
|
|
60
|
+
}) : /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
61
|
+
children: [own, actions]
|
|
65
62
|
})
|
|
66
|
-
})
|
|
67
|
-
});
|
|
63
|
+
})
|
|
64
|
+
}) : header;
|
|
68
65
|
}
|
|
69
66
|
if (!actions) return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
70
67
|
children: header
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","SheetHeader_exports","__export","SheetHeader","isOverlayHeader","module","exports","import_jsx_runtime","require","import_forms","import_theme","import_react","import_tamagui","import_StandardAction","countItems","node","Children","toArray","reduce","count","child","isValidElement","type","Fragment","props","children","OverlayHeader","param","header","actions","titleId","own","
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","SheetHeader_exports","__export","SheetHeader","isOverlayHeader","module","exports","import_jsx_runtime","require","import_forms","import_theme","import_react","import_tamagui","import_StandardAction","countItems","node","Children","toArray","reduce","count","child","isValidElement","type","Fragment","props","children","OverlayHeader","param","header","actions","titleId","own","cloneElement","jsx","XStack","testID","flexShrink","alignItems","jsxs","IconButtonGroup"],"sources":["../../../src/SheetModal/SheetHeader.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,mBAAA;AAAAC,QAAA,CAAAD,mBAAA;EAAAE,WAAA,EAAAA,CAAA,KAAAA,WAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAV,YAAgC,CAAAK,mBAAA;AAChC,IAAAM,kBAAwB,GAAAC,OAAA;AACxB,IAAAC,YAAA,GAOOD,OAAA;AACP,IAAAE,YAAA,GAAAF,OAA6B;AAC7B,IAAAG,YAAA,GAAAH,OAAA,QAAuD;AA0C3C,IAAAI,cAAA,GAAAJ,OAAA;AAxCZ,IAAAK,qBAAoB,GAAyBL,OAAA;AAC3C,SAAOM,WAAAC,IAAA;EAAuB,OAC3BJ,YAAO,CACNK,QAAA,CAAAC,OACC,CAAAF,IAAA,EAAAG,MAAA,WAAAC,KAAyC,EAAAC,KAAK,EAAK;IAGtD,OAAAD,KAAA,QAAAR,YAAA,CAAAU,cAAA,EAAAD,KAAA,KAAAA,KAAA,CAAAE,IAAA,KAAAX,YAAA,CAAAY,QAAA,GAAAT,UAAA,CAAAM,KAAA,CAAAI,KAAA,CAAAC,QAAA;EACF;AACF;AAEO,SAASrB,gBAAgBW,IAAA,EAA2D;EACzF,sBAAO,IAAAJ,YAAA,CAAeU,cAAc,EAAAN,IAAA,KAASA,IAAA,CAAAO,IAAA,KAAAT,qBAAA,CAAAa,aAAA;AAC/C;AAYO,SAASvB,YAAYwB,KAAA;EAC1B;IAAAC,MAAA;IAAAC,OAAA;IAAAC;EAAA,IAAAH,KAAA;EACA,IAAAvB,eAAA,CAAAwB,MAAA;IACA,IAAAG,GAAA,GAAAH,MAAA,CAAAJ,KAAA,CAAAK,OAAA;IAMC,OAAAA,OAAA,sBAAAlB,YAAA,CAAAqB,YAAA,EAAAJ,MAAA;MACGC,OAAA,iBAAyB,IAAAtB,kBAAA,CAAA0B,GAAA,EAAArB,cAAA,CAAAsB,MAAA;QAC3BC,MAAM,EAAM,4BAAa;QACzBC,UAAO;QAEDC,UACE;QAGOZ,QAAA,EAAAX,UAAA,CAAAiB,GAAA,IAAAjB,UAAA,CAAAe,OAAA,2BAAAtB,kBAAA,CAAA+B,IAAA,EAAA7B,YAAA,CAAA8B,eAAA;UACAd,QAAA,GACHM,GAEA,EACGF,OAAA;QACA,CACH,IAEJ,mBAAAtB,kBAAA,CAAA+B,IAAA,EAAA/B,kBAAA,CAAAgB,QAAA;UAGJE,QAAA,GACNM,GAAA,EACKF,OAAS;QAGV;MAGA;IAIA,CACF,IAAAD,MAAA;EAEJ","ignoreList":[]}
|
|
@@ -32,13 +32,11 @@ var import_tamagui = require("tamagui");
|
|
|
32
32
|
var import_StandardAction = require("../actions/StandardAction.cjs");
|
|
33
33
|
var import_surfaces = require("../surfaces.cjs");
|
|
34
34
|
var import_detents = require("./detents.cjs");
|
|
35
|
+
var import_SheetBodyRegion = require("./SheetBodyRegion.cjs");
|
|
35
36
|
var import_SheetHeader = require("./SheetHeader.cjs");
|
|
36
37
|
var import_SheetNavigation = require("./SheetNavigation.cjs");
|
|
37
38
|
var import_useSheetFrameFocus = require("./useSheetFrameFocus.cjs");
|
|
38
39
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
-
const IN_DIALOG_REGION = {
|
|
40
|
-
inDialogRegion: true
|
|
41
|
-
};
|
|
42
40
|
const fillSlot = {
|
|
43
41
|
flex: 1,
|
|
44
42
|
minHeight: 0
|
|
@@ -124,6 +122,33 @@ function useSheetEscapeDismiss(open, onDismiss) {
|
|
|
124
122
|
return () => window.removeEventListener("keydown", onKeyDown);
|
|
125
123
|
}, [open]);
|
|
126
124
|
}
|
|
125
|
+
const dismissFallbackMs = 1e3;
|
|
126
|
+
function useSheetDismissed(open, onDismiss) {
|
|
127
|
+
const onDismissRef = (0, import_react.useRef)(onDismiss);
|
|
128
|
+
onDismissRef.current = onDismiss;
|
|
129
|
+
const openRef = (0, import_react.useRef)(open);
|
|
130
|
+
openRef.current = open;
|
|
131
|
+
const shownRef = (0, import_react.useRef)(false);
|
|
132
|
+
const fire = (0, import_react.useCallback)(() => {
|
|
133
|
+
if (openRef.current || !shownRef.current) return;
|
|
134
|
+
shownRef.current = false;
|
|
135
|
+
onDismissRef.current?.();
|
|
136
|
+
}, []);
|
|
137
|
+
(0, import_react.useEffect)(() => {
|
|
138
|
+
if (open) {
|
|
139
|
+
shownRef.current = true;
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (!shownRef.current) return;
|
|
143
|
+
const timer = setTimeout(fire, dismissFallbackMs);
|
|
144
|
+
return () => clearTimeout(timer);
|
|
145
|
+
}, [open, fire]);
|
|
146
|
+
return (0, import_react.useCallback)(({
|
|
147
|
+
open: opened
|
|
148
|
+
}) => {
|
|
149
|
+
if (!opened) fire();
|
|
150
|
+
}, [fire]);
|
|
151
|
+
}
|
|
127
152
|
function SheetModal({
|
|
128
153
|
open,
|
|
129
154
|
onOpenChange,
|
|
@@ -134,7 +159,8 @@ function SheetModal({
|
|
|
134
159
|
detents,
|
|
135
160
|
scrollable,
|
|
136
161
|
fill = false,
|
|
137
|
-
flush = false
|
|
162
|
+
flush = false,
|
|
163
|
+
onDismiss
|
|
138
164
|
}) {
|
|
139
165
|
const titleId = (0, import_react.useId)();
|
|
140
166
|
const overlayHeader = (0, import_SheetHeader.isOverlayHeader)(headerContent);
|
|
@@ -160,17 +186,29 @@ function SheetModal({
|
|
|
160
186
|
const sheetZIndex = (0, import_forms.useOverlayZIndex)("sheet");
|
|
161
187
|
const transition = knobProps.motion.slide.transition;
|
|
162
188
|
const frameRef = (0, import_react.useRef)(null);
|
|
189
|
+
const handleAnimationComplete = useSheetDismissed(open, onDismiss);
|
|
163
190
|
(0, import_useSheetFrameFocus.useSheetFrameFocus)(open, frameRef);
|
|
164
191
|
useSheetEscapeDismiss(open, () => onOpenChange(false));
|
|
165
192
|
useOutsidePressDismiss(open, frameRef, () => onOpenChange(false));
|
|
166
193
|
const flushHeader = flush ? {
|
|
167
194
|
paddingHorizontal: knobProps.panelPadding.padding
|
|
168
195
|
} : null;
|
|
196
|
+
const titleScrolls = overlayHeader && scrollable === true;
|
|
197
|
+
const headerSlot = header ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
198
|
+
id: overlayHeader || headerActions ? void 0 : titleId,
|
|
199
|
+
...(fill && !titleScrolls ? nonShrinking : null),
|
|
200
|
+
...flushHeader,
|
|
201
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StandardAction.OverlayTitleIdContext.Provider, {
|
|
202
|
+
value: overlayHeader ? titleId : void 0,
|
|
203
|
+
children: header
|
|
204
|
+
})
|
|
205
|
+
}) : null;
|
|
169
206
|
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.Sheet, {
|
|
170
207
|
modal: true,
|
|
171
208
|
open,
|
|
172
209
|
onOpenChange,
|
|
173
210
|
dismissOnSnapToBottom: true,
|
|
211
|
+
onAnimationComplete: handleAnimationComplete,
|
|
174
212
|
...snap,
|
|
175
213
|
transition,
|
|
176
214
|
zIndex: sheetZIndex,
|
|
@@ -188,7 +226,11 @@ function SheetModal({
|
|
|
188
226
|
opacity: 0
|
|
189
227
|
}
|
|
190
228
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Sheet.Handle, {
|
|
191
|
-
...import_theme.
|
|
229
|
+
...import_theme.sheetHandle,
|
|
230
|
+
...(0, import_theme.sheetHandleTone)(knobProps.scheme),
|
|
231
|
+
...(regular ? {
|
|
232
|
+
width: Math.round((0, import_forms.sheetPanelWidth)(windowWidth) * import_theme.sheetHandleWidthRatio)
|
|
233
|
+
} : null),
|
|
192
234
|
"aria-label": "Resize",
|
|
193
235
|
"data-sheet-grabber": ""
|
|
194
236
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_surfaces.SheetFrame, {
|
|
@@ -214,8 +256,7 @@ function SheetModal({
|
|
|
214
256
|
...(regular ? regularPanel(windowWidth) : bottomEdges),
|
|
215
257
|
overflow: "hidden",
|
|
216
258
|
...frameRingReset,
|
|
217
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(
|
|
218
|
-
value: IN_DIALOG_REGION,
|
|
259
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_SheetBodyRegion.SheetBodyRegion, {
|
|
219
260
|
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_forms.OverlayStackProvider, {
|
|
220
261
|
zIndex: sheetZIndex,
|
|
221
262
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_SheetNavigation.SheetNavigation, {
|
|
@@ -223,25 +264,23 @@ function SheetModal({
|
|
|
223
264
|
gap: knobProps.gap.gap,
|
|
224
265
|
fill,
|
|
225
266
|
root: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
226
|
-
children: [
|
|
227
|
-
id: overlayHeader || headerActions ? void 0 : titleId,
|
|
228
|
-
...(fill ? nonShrinking : null),
|
|
229
|
-
...flushHeader,
|
|
230
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_StandardAction.OverlayTitleIdContext.Provider, {
|
|
231
|
-
value: overlayHeader ? titleId : void 0,
|
|
232
|
-
children: header
|
|
233
|
-
})
|
|
234
|
-
}) : null, fill ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
267
|
+
children: [titleScrolls ? null : headerSlot, fill ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
235
268
|
testID: "sheet-modal-body",
|
|
236
269
|
...fillSlot,
|
|
237
270
|
children: scrollable ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Sheet.ScrollView, {
|
|
238
271
|
testID: "sheet-modal-scroll",
|
|
239
272
|
...fillSlot,
|
|
240
|
-
children
|
|
273
|
+
children: titleScrolls ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
274
|
+
gap: knobProps.gap.gap,
|
|
275
|
+
children: [headerSlot, children]
|
|
276
|
+
}) : children
|
|
241
277
|
}) : children
|
|
242
278
|
}) : scrollable ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Sheet.ScrollView, {
|
|
243
279
|
testID: "sheet-modal-scroll",
|
|
244
|
-
children
|
|
280
|
+
children: titleScrolls ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
281
|
+
gap: knobProps.gap.gap,
|
|
282
|
+
children: [headerSlot, children]
|
|
283
|
+
}) : children
|
|
245
284
|
}) : children]
|
|
246
285
|
})
|
|
247
286
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
@@ -37,14 +37,11 @@ var import_detents = require("./detents.native.js");
|
|
|
37
37
|
var import_i18n = require("../shared/i18n.native.js");
|
|
38
38
|
var import_useKeyboardInset = require("../shared/useKeyboardInset.native.js");
|
|
39
39
|
var import_tamagui = require("tamagui");
|
|
40
|
-
var
|
|
40
|
+
var import_SheetBodyRegion = require("./SheetBodyRegion.native.js");
|
|
41
41
|
var import_SheetHeader = require("./SheetHeader.native.js");
|
|
42
42
|
var import_SheetNavigation = require("./SheetNavigation.native.js");
|
|
43
43
|
var bottomInset = import_react_native.Platform.OS === "ios" ? 24 : 16;
|
|
44
44
|
var backdropStrip = 48;
|
|
45
|
-
var IN_DIALOG_REGION = {
|
|
46
|
-
inDialogRegion: true
|
|
47
|
-
};
|
|
48
45
|
var fillSlot = {
|
|
49
46
|
flex: 1,
|
|
50
47
|
minHeight: 0
|
|
@@ -66,7 +63,8 @@ function SheetModal(param) {
|
|
|
66
63
|
detents,
|
|
67
64
|
scrollable,
|
|
68
65
|
fill = false,
|
|
69
|
-
flush = false
|
|
66
|
+
flush = false,
|
|
67
|
+
onDismiss
|
|
70
68
|
} = param;
|
|
71
69
|
var _ref, _ref1;
|
|
72
70
|
var _useContext;
|
|
@@ -84,6 +82,7 @@ function SheetModal(param) {
|
|
|
84
82
|
paddingHorizontal: knobProps.panelPadding.padding,
|
|
85
83
|
children: sheetHeader
|
|
86
84
|
}) : sheetHeader;
|
|
85
|
+
var titleScrolls = (0, import_SheetHeader.isOverlayHeader)(headerContent) && scrollable === true;
|
|
87
86
|
var windowZIndex = (0, import_forms.useOverlayZIndex)("sheet");
|
|
88
87
|
var slideTransition = knobProps.motion.slide.transition;
|
|
89
88
|
var slideDuration = (0, import_theme.motionDurationMs)(slideTransition);
|
|
@@ -104,14 +103,13 @@ function SheetModal(param) {
|
|
|
104
103
|
var regular = (0, import_forms.overlaySizeClass)(windowWidth) === "regular";
|
|
105
104
|
var keyboardInset = (0, import_useKeyboardInset.useKeyboardInset)();
|
|
106
105
|
var topInset = (_ref = (_ref1 = (_useContext = (0, import_react.useContext)(import_react_native_safe_area_context.SafeAreaInsetsContext)) === null || _useContext === void 0 ? void 0 : _useContext.top) !== null && _ref1 !== void 0 ? _ref1 : import_react_native_safe_area_context.initialWindowMetrics === null || import_react_native_safe_area_context.initialWindowMetrics === void 0 ? void 0 : import_react_native_safe_area_context.initialWindowMetrics.insets.top) !== null && _ref !== void 0 ? _ref : 0;
|
|
107
|
-
var
|
|
108
|
-
var
|
|
106
|
+
var scrimOpacity = (0, import_react.useRef)(new import_react_native.Animated.Value(0)).current;
|
|
107
|
+
var onDismissRef = (0, import_react.useRef)(onDismiss);
|
|
108
|
+
onDismissRef.current = onDismiss;
|
|
109
|
+
var shownRef = (0, import_react.useRef)(false);
|
|
109
110
|
var close = (0, import_react.useCallback)(function () {
|
|
110
111
|
return onOpenChange(false);
|
|
111
112
|
}, [onOpenChange]);
|
|
112
|
-
var handleBackdropPress = (0, import_react.useCallback)(function () {
|
|
113
|
-
if (backdropArmed) close();
|
|
114
|
-
}, [backdropArmed, close]);
|
|
115
113
|
var available = Math.max(0, windowHeight - keyboardInset);
|
|
116
114
|
var maxHeight = Math.max(import_detents.minSheetHeight, Math.round(Math.min(windowHeight * import_detents.largeDetentRatio, available - topInset - backdropStrip)));
|
|
117
115
|
var [measuredHeight, setMeasuredHeight] = (0, import_react.useState)(0);
|
|
@@ -132,6 +130,12 @@ function SheetModal(param) {
|
|
|
132
130
|
detentsRef.current = detentHeights;
|
|
133
131
|
var presentationRef = (0, import_react.useRef)(0);
|
|
134
132
|
var activeRef = (0, import_react.useRef)(false);
|
|
133
|
+
var handleDismiss = (0, import_react.useCallback)(function () {
|
|
134
|
+
var _onDismissRef_current;
|
|
135
|
+
if (activeRef.current || !shownRef.current) return;
|
|
136
|
+
shownRef.current = false;
|
|
137
|
+
(_onDismissRef_current = onDismissRef.current) === null || _onDismissRef_current === void 0 ? void 0 : _onDismissRef_current.call(onDismissRef);
|
|
138
|
+
}, []);
|
|
135
139
|
var frameCap = (0, import_react.useRef)(new import_react_native.Animated.Value(maxHeight)).current;
|
|
136
140
|
var maxHeightRef = (0, import_react.useRef)(maxHeight);
|
|
137
141
|
var restHeightRef = (0, import_react.useRef)(null);
|
|
@@ -288,19 +292,22 @@ function SheetModal(param) {
|
|
|
288
292
|
scrimDuration: scrimDuration2
|
|
289
293
|
} = entryTiming.current;
|
|
290
294
|
enteredRef.current = true;
|
|
291
|
-
if (
|
|
295
|
+
if (scrimDuration2) {
|
|
296
|
+
scrimOpacity.setValue(0);
|
|
297
|
+
import_react_native.Animated.timing(scrimOpacity, {
|
|
298
|
+
toValue: 1,
|
|
299
|
+
duration: scrimDuration2,
|
|
300
|
+
easing: import_react_native.Easing.bezier(0.25, 0.1, 0.25, 1),
|
|
301
|
+
useNativeDriver: false
|
|
302
|
+
}).start();
|
|
303
|
+
} else {
|
|
304
|
+
scrimOpacity.setValue(1);
|
|
305
|
+
}
|
|
292
306
|
if (!slideDuration2) {
|
|
293
307
|
translateY.setValue(0);
|
|
294
308
|
restRef.current = 0;
|
|
295
|
-
setBackdropArmed(true);
|
|
296
309
|
return;
|
|
297
310
|
}
|
|
298
|
-
armTimerRef.current = setTimeout(function () {
|
|
299
|
-
if (activeRef.current && presentation === presentationRef.current) {
|
|
300
|
-
armTimerRef.current = null;
|
|
301
|
-
setBackdropArmed(true);
|
|
302
|
-
}
|
|
303
|
-
}, scrimDuration2);
|
|
304
311
|
translateY.setValue(travelRef.current);
|
|
305
312
|
restRef.current = 0;
|
|
306
313
|
import_react_native.Animated.timing(translateY, {
|
|
@@ -314,16 +321,18 @@ function SheetModal(param) {
|
|
|
314
321
|
} = param2;
|
|
315
322
|
if (finished && activeRef.current && presentation === presentationRef.current) translateY.setValue(0);
|
|
316
323
|
});
|
|
317
|
-
}, [translateY]);
|
|
324
|
+
}, [scrimOpacity, translateY]);
|
|
318
325
|
(0, import_react.useEffect)(function () {
|
|
319
326
|
presentationRef.current += 1;
|
|
320
327
|
activeRef.current = open;
|
|
321
328
|
restHeightRef.current = null;
|
|
322
329
|
frameCap.setValue(maxHeightRef.current);
|
|
323
330
|
if (open) {
|
|
331
|
+
shownRef.current = true;
|
|
324
332
|
enter();
|
|
325
333
|
} else {
|
|
326
|
-
|
|
334
|
+
scrimOpacity.setValue(0);
|
|
335
|
+
if (import_react_native.Platform.OS !== "ios") handleDismiss();
|
|
327
336
|
var parked = travelRef.current || 1e4;
|
|
328
337
|
translateY.setValue(parked);
|
|
329
338
|
restRef.current = parked;
|
|
@@ -332,20 +341,18 @@ function SheetModal(param) {
|
|
|
332
341
|
activeRef.current = false;
|
|
333
342
|
presentationRef.current += 1;
|
|
334
343
|
enteredRef.current = false;
|
|
335
|
-
|
|
336
|
-
clearTimeout(armTimerRef.current);
|
|
337
|
-
armTimerRef.current = null;
|
|
338
|
-
}
|
|
344
|
+
scrimOpacity.stopAnimation();
|
|
339
345
|
translateY.stopAnimation();
|
|
340
346
|
};
|
|
341
|
-
}, [open, enter, frameCap, translateY]);
|
|
347
|
+
}, [open, enter, frameCap, handleDismiss, scrimOpacity, translateY]);
|
|
342
348
|
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.Modal, {
|
|
343
349
|
visible: open,
|
|
344
350
|
transparent: true,
|
|
345
|
-
animationType:
|
|
351
|
+
animationType: "none",
|
|
346
352
|
statusBarTranslucent: true,
|
|
347
353
|
onRequestClose: close,
|
|
348
354
|
onShow: enter,
|
|
355
|
+
onDismiss: handleDismiss,
|
|
349
356
|
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_forms.OverlayWindow, {
|
|
350
357
|
zIndex: windowZIndex,
|
|
351
358
|
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_react_native.View, {
|
|
@@ -361,14 +368,21 @@ function SheetModal(param) {
|
|
|
361
368
|
onTouchCancel: stopAtModal,
|
|
362
369
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.Pressable, {
|
|
363
370
|
style: import_react_native.StyleSheet.absoluteFill,
|
|
364
|
-
onPress:
|
|
371
|
+
onPress: close,
|
|
365
372
|
accessibilityRole: "button",
|
|
366
373
|
accessibilityLabel: t("Close"),
|
|
367
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(
|
|
368
|
-
|
|
369
|
-
|
|
374
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.Animated.View, {
|
|
375
|
+
testID: "sheet-modal-scrim",
|
|
376
|
+
style: {
|
|
377
|
+
flex: 1,
|
|
378
|
+
opacity: scrimOpacity
|
|
379
|
+
},
|
|
380
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
381
|
+
flex: 1,
|
|
382
|
+
backgroundColor: import_theme.overlayScrim
|
|
383
|
+
})
|
|
370
384
|
})
|
|
371
|
-
}), /* @__PURE__ */(0, import_jsx_runtime.
|
|
385
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_react_native.Animated.View, {
|
|
372
386
|
onLayout: function onLayout(e) {
|
|
373
387
|
if (restHeightRef.current !== null) return;
|
|
374
388
|
var h = Math.round(e.nativeEvent.layout.height);
|
|
@@ -396,7 +410,29 @@ function SheetModal(param) {
|
|
|
396
410
|
translateY
|
|
397
411
|
}]
|
|
398
412
|
},
|
|
399
|
-
children:
|
|
413
|
+
children: [
|
|
414
|
+
/*
|
|
415
|
+
The grabber is the grab ZONE, not the 10pt pill inside it. LC-71
|
|
416
|
+
says the frame is not a control; the grabber is the one part of
|
|
417
|
+
it that is, so it is the only thing that takes the gesture, and
|
|
418
|
+
it never fights the ScrollView below.
|
|
419
|
+
*/
|
|
420
|
+
/* @__PURE__ */
|
|
421
|
+
(0, import_jsx_runtime.jsx)(import_react_native.View, {
|
|
422
|
+
...panResponder.panHandlers,
|
|
423
|
+
accessibilityRole: "adjustable",
|
|
424
|
+
accessibilityLabel: t("Drag to resize"),
|
|
425
|
+
testID: "sheet-modal-grabber",
|
|
426
|
+
style: {
|
|
427
|
+
...import_theme.sheetHandleZone,
|
|
428
|
+
...(fill ? nonShrinking : null)
|
|
429
|
+
},
|
|
430
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
431
|
+
...import_theme.sheetHandle,
|
|
432
|
+
...(0, import_theme.sheetHandleTone)(knobProps.scheme),
|
|
433
|
+
accessible: false
|
|
434
|
+
})
|
|
435
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
400
436
|
testID: "sheet-modal-surface",
|
|
401
437
|
"data-sheet-form": regular ? "panel" : "bottom",
|
|
402
438
|
...(regular ? knobProps.elevatedSurface : {
|
|
@@ -404,6 +440,8 @@ function SheetModal(param) {
|
|
|
404
440
|
backgroundColor: knobProps.elevatedSurface.backgroundColor
|
|
405
441
|
}),
|
|
406
442
|
...knobProps.borderRadius,
|
|
443
|
+
borderTopLeftRadius: knobProps.sheetRadius.borderRadius,
|
|
444
|
+
borderTopRightRadius: knobProps.sheetRadius.borderRadius,
|
|
407
445
|
borderBottomLeftRadius: 0,
|
|
408
446
|
borderBottomRightRadius: 0,
|
|
409
447
|
// A compact sheet spans the screen: only its top edge meets the page.
|
|
@@ -425,37 +463,15 @@ function SheetModal(param) {
|
|
|
425
463
|
// takes every drag from the ScrollView inside (MPO-299).
|
|
426
464
|
accessibilityViewIsModal: true,
|
|
427
465
|
onAccessibilityEscape: close,
|
|
428
|
-
children: (
|
|
429
|
-
/*
|
|
430
|
-
The grabber is the grab ZONE, not the 5pt pill inside it. LC-71
|
|
431
|
-
says the frame is not a control; the grabber is the one part of
|
|
432
|
-
it that is, so it is the only thing that takes the gesture, and
|
|
433
|
-
it never fights the ScrollView below.
|
|
434
|
-
*/
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
-
(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
466
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
437
467
|
testID: "sheet-modal-clip",
|
|
438
468
|
overflow: "hidden",
|
|
439
|
-
borderTopLeftRadius: knobProps.
|
|
440
|
-
borderTopRightRadius: knobProps.
|
|
469
|
+
borderTopLeftRadius: knobProps.sheetRadius.borderRadius,
|
|
470
|
+
borderTopRightRadius: knobProps.sheetRadius.borderRadius,
|
|
441
471
|
flexShrink: 1,
|
|
442
472
|
minHeight: 0,
|
|
443
473
|
...(fill ? fillSlot : null),
|
|
444
|
-
children:
|
|
445
|
-
...panResponder.panHandlers,
|
|
446
|
-
accessibilityRole: "adjustable",
|
|
447
|
-
accessibilityLabel: t("Drag to resize"),
|
|
448
|
-
testID: "sheet-modal-grabber",
|
|
449
|
-
style: {
|
|
450
|
-
...import_theme.sheetGrabberZone,
|
|
451
|
-
...(fill ? nonShrinking : null)
|
|
452
|
-
},
|
|
453
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
454
|
-
...import_theme.sheetGrabber,
|
|
455
|
-
accessible: false
|
|
456
|
-
})
|
|
457
|
-
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_surfaces.DialogRegionContext.Provider, {
|
|
458
|
-
value: IN_DIALOG_REGION,
|
|
474
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_SheetBodyRegion.SheetBodyRegion, {
|
|
459
475
|
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_theme.Surface, {
|
|
460
476
|
elevated: true,
|
|
461
477
|
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
@@ -473,7 +489,7 @@ function SheetModal(param) {
|
|
|
473
489
|
gap: knobProps.gap.gap,
|
|
474
490
|
fill,
|
|
475
491
|
root: fill ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
476
|
-
children: [header ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.View, {
|
|
492
|
+
children: [header && !titleScrolls ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.View, {
|
|
477
493
|
style: nonShrinking,
|
|
478
494
|
children: header
|
|
479
495
|
}) : null, /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.View, {
|
|
@@ -483,25 +499,31 @@ function SheetModal(param) {
|
|
|
483
499
|
testID: "sheet-modal-scroll",
|
|
484
500
|
style: fillSlot,
|
|
485
501
|
keyboardShouldPersistTaps: "handled",
|
|
486
|
-
children
|
|
502
|
+
children: titleScrolls ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
503
|
+
gap: knobProps.gap.gap,
|
|
504
|
+
children: [header, children]
|
|
505
|
+
}) : children
|
|
487
506
|
}) : children
|
|
488
507
|
})]
|
|
489
508
|
}) : /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
490
|
-
children: [header, scrollable ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.ScrollView, {
|
|
509
|
+
children: [titleScrolls ? null : header, scrollable ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.ScrollView, {
|
|
491
510
|
testID: "sheet-modal-scroll",
|
|
492
511
|
style: {
|
|
493
512
|
flexGrow: 0
|
|
494
513
|
},
|
|
495
514
|
keyboardShouldPersistTaps: "handled",
|
|
496
|
-
children
|
|
515
|
+
children: titleScrolls ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.YStack, {
|
|
516
|
+
gap: knobProps.gap.gap,
|
|
517
|
+
children: [header, children]
|
|
518
|
+
}) : children
|
|
497
519
|
}) : children]
|
|
498
520
|
})
|
|
499
521
|
})
|
|
500
522
|
})
|
|
501
523
|
})
|
|
502
|
-
})
|
|
503
|
-
})
|
|
504
|
-
})
|
|
524
|
+
})
|
|
525
|
+
})
|
|
526
|
+
})]
|
|
505
527
|
})]
|
|
506
528
|
})
|
|
507
529
|
})
|