@multiplatform.one/theme 10.27.4 → 11.1.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/README.md +6 -4
- package/dist/cjs/index.gnome.cjs +2 -1
- package/dist/cjs/index.gnome.native.cjs +2 -1
- package/dist/cjs/index.gnome.native.js +2 -1
- package/dist/cjs/index.gnome.native.js.map +1 -1
- package/dist/cjs/theme/createThemes.cjs +0 -4
- package/dist/cjs/theme/createThemes.native.cjs +0 -4
- package/dist/cjs/theme/createThemes.native.js +0 -4
- package/dist/cjs/theme/createThemes.native.js.map +1 -1
- package/dist/cjs/theme/overlaySurfaces.cjs +18 -31
- package/dist/cjs/theme/overlaySurfaces.native.cjs +18 -32
- package/dist/cjs/theme/overlaySurfaces.native.js +18 -32
- package/dist/cjs/theme/overlaySurfaces.native.js.map +1 -1
- package/dist/cjs/theme/unknownTokenGuard.cjs +32 -1
- package/dist/cjs/theme/unknownTokenGuard.native.cjs +70 -1
- package/dist/cjs/theme/unknownTokenGuard.native.js +70 -1
- package/dist/cjs/theme/unknownTokenGuard.native.js.map +1 -1
- package/dist/esm/index.gnome.mjs +2 -2
- package/dist/esm/index.gnome.native.js +2 -2
- package/dist/esm/theme/createThemes.mjs +0 -4
- package/dist/esm/theme/createThemes.mjs.map +1 -1
- package/dist/esm/theme/createThemes.native.js +0 -4
- package/dist/esm/theme/createThemes.native.js.map +1 -1
- package/dist/esm/theme/overlaySurfaces.mjs +19 -33
- package/dist/esm/theme/overlaySurfaces.mjs.map +1 -1
- package/dist/esm/theme/overlaySurfaces.native.js +19 -34
- package/dist/esm/theme/overlaySurfaces.native.js.map +1 -1
- package/dist/esm/theme/unknownTokenGuard.mjs +32 -1
- package/dist/esm/theme/unknownTokenGuard.mjs.map +1 -1
- package/dist/esm/theme/unknownTokenGuard.native.js +70 -1
- package/dist/esm/theme/unknownTokenGuard.native.js.map +1 -1
- package/package.json +5 -5
- package/src/index.gnome.ts +2 -1
- package/src/theme/controlEdges.spec.ts +2 -2
- package/src/theme/createDefaultThemeConfig.spec.ts +6 -14
- package/src/theme/createThemes.ts +0 -4
- package/src/theme/overlaySurfaces.focus.spec.tsx +0 -48
- package/src/theme/overlaySurfaces.tsx +29 -67
- package/src/theme/rampRoles.spec.ts +1 -1
- package/src/theme/rowStates.spec.ts +1 -1
- package/src/theme/selectedState.spec.ts +1 -2
- package/src/theme/sheetFrameHandle.spec.ts +8 -0
- package/src/theme/sheetHandle.spec.ts +16 -16
- package/src/theme/subsetThemes.spec.ts +3 -3
- package/src/theme/unknownTokenGuard.spec.tsx +35 -1
- package/src/theme/unknownTokenGuard.ts +54 -3
- package/types/index.gnome.d.ts +1 -1
- package/types/index.gnome.d.ts.map +1 -1
- package/types/theme/createThemes.d.ts +0 -12
- package/types/theme/createThemes.d.ts.map +1 -1
- package/types/theme/overlaySurfaces.d.ts +23 -32
- package/types/theme/overlaySurfaces.d.ts.map +1 -1
- package/types/theme/unknownTokenGuard.d.ts +3 -2
- package/types/theme/unknownTokenGuard.d.ts.map +1 -1
|
@@ -26,8 +26,8 @@ __export(overlaySurfaces_exports, {
|
|
|
26
26
|
DialogOverlay: () => DialogOverlay,
|
|
27
27
|
DialogRegionContext: () => DialogRegionContext,
|
|
28
28
|
DialogSheetFaceProvider: () => DialogSheetFaceProvider,
|
|
29
|
-
DialogShowFocus: () => DialogShowFocus,
|
|
30
29
|
PopoverContent: () => PopoverContent,
|
|
30
|
+
SheetBodyInsetProvider: () => SheetBodyInsetProvider,
|
|
31
31
|
SheetBodyProvider: () => SheetBodyProvider,
|
|
32
32
|
dialogScrim: () => dialogScrim,
|
|
33
33
|
overlayScrim: () => overlayScrim,
|
|
@@ -42,7 +42,8 @@ __export(overlaySurfaces_exports, {
|
|
|
42
42
|
useDialogRegionContext: () => useDialogRegionContext,
|
|
43
43
|
useDialogSheetFace: () => useDialogSheetFace,
|
|
44
44
|
useIsInDialogRegion: () => useIsInDialogRegion,
|
|
45
|
-
useIsInSheetBody: () => useIsInSheetBody
|
|
45
|
+
useIsInSheetBody: () => useIsInSheetBody,
|
|
46
|
+
useSheetBodyInset: () => useSheetBodyInset
|
|
46
47
|
});
|
|
47
48
|
module.exports = __toCommonJS(overlaySurfaces_exports);
|
|
48
49
|
var import_keyboardFocusRing = require("../keyboardFocusRing.cjs");
|
|
@@ -53,7 +54,6 @@ var import_useResolvedKnobs = require("./useResolvedKnobs.cjs");
|
|
|
53
54
|
var import_layoutTokens = require("./layoutTokens.cjs");
|
|
54
55
|
var import_resolveKnobs = require("./resolveKnobs.cjs");
|
|
55
56
|
var import_react = require("react");
|
|
56
|
-
var import_web = require("@tamagui/web");
|
|
57
57
|
var import_tamagui = require("tamagui");
|
|
58
58
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
59
59
|
const dialogScrim = "$scrim-dialog";
|
|
@@ -79,25 +79,26 @@ const sheetGrabberZone = {
|
|
|
79
79
|
};
|
|
80
80
|
const sheetHandleWidthRatio = .3;
|
|
81
81
|
const sheetHandle = {
|
|
82
|
-
width:
|
|
83
|
-
height:
|
|
82
|
+
width: 36,
|
|
83
|
+
height: 5,
|
|
84
84
|
borderRadius: 100,
|
|
85
|
-
backgroundColor: "$color-
|
|
86
|
-
opacity:
|
|
85
|
+
backgroundColor: "$color-12",
|
|
86
|
+
opacity: .3,
|
|
87
87
|
alignSelf: "center",
|
|
88
88
|
marginHorizontal: 0,
|
|
89
|
-
marginTop:
|
|
90
|
-
marginBottom:
|
|
89
|
+
marginTop: 5,
|
|
90
|
+
marginBottom: -10,
|
|
91
91
|
zIndex: 10
|
|
92
92
|
};
|
|
93
93
|
const sheetHandleZone = {
|
|
94
94
|
alignSelf: "stretch",
|
|
95
95
|
alignItems: "center",
|
|
96
|
-
paddingTop:
|
|
96
|
+
paddingTop: 0,
|
|
97
|
+
height: 21
|
|
97
98
|
};
|
|
98
99
|
const sheetHandleToneOpen = {
|
|
99
|
-
backgroundColor: "$color-
|
|
100
|
-
opacity:
|
|
100
|
+
backgroundColor: "$color-12",
|
|
101
|
+
opacity: .3
|
|
101
102
|
};
|
|
102
103
|
function sheetHandleTone(_scheme) {
|
|
103
104
|
return sheetHandleToneOpen;
|
|
@@ -146,22 +147,6 @@ function contentById(contentId) {
|
|
|
146
147
|
if (!contentId || typeof document === "undefined") return null;
|
|
147
148
|
return document.getElementById(contentId);
|
|
148
149
|
}
|
|
149
|
-
function useDialogShowFocus(onOpenAutoFocus) {
|
|
150
|
-
const { open, contentId } = (0, import_tamagui.useDialogContext)();
|
|
151
|
-
(0, import_react.useEffect)(() => {
|
|
152
|
-
if (!open || !contentId || !import_tamagui.isWeb || typeof document === "undefined") return;
|
|
153
|
-
const content = document.getElementById(contentId);
|
|
154
|
-
const focused = document.activeElement;
|
|
155
|
-
if (!content || typeof HTMLElement === "undefined" || !(focused instanceof HTMLElement)) return;
|
|
156
|
-
if (!content.contains(focused) || focused.tabIndex >= 0 && (0, import_keyboardFocusRing.wasKeyboardFocus)()) return;
|
|
157
|
-
onOpenAutoFocus((0, import_web.createChangeEventDetails)("trigger-focus"));
|
|
158
|
-
}, [open, contentId]);
|
|
159
|
-
}
|
|
160
|
-
function DialogShowFocus({ onOpenAutoFocus }) {
|
|
161
|
-
const { contentId } = (0, import_tamagui.useDialogContext)();
|
|
162
|
-
useDialogShowFocus(withHouseOpenFocus(onOpenAutoFocus, contentId));
|
|
163
|
-
return null;
|
|
164
|
-
}
|
|
165
150
|
const DialogRegionContext = (0, import_react.createContext)({ inDialogRegion: false });
|
|
166
151
|
function useDialogRegionContext() {
|
|
167
152
|
return (0, import_react.useContext)(DialogRegionContext);
|
|
@@ -171,6 +156,11 @@ function useIsInDialogRegion() {
|
|
|
171
156
|
}
|
|
172
157
|
const IN_DIALOG_REGION = { inDialogRegion: true };
|
|
173
158
|
const SheetBodyContext = (0, import_react.createContext)(false);
|
|
159
|
+
const SheetBodyInsetContext = (0, import_react.createContext)(0);
|
|
160
|
+
const SheetBodyInsetProvider = SheetBodyInsetContext.Provider;
|
|
161
|
+
function useSheetBodyInset() {
|
|
162
|
+
return (0, import_react.useContext)(SheetBodyInsetContext);
|
|
163
|
+
}
|
|
174
164
|
const SheetBodyProvider = SheetBodyContext.Provider;
|
|
175
165
|
function useIsInSheetBody() {
|
|
176
166
|
return (0, import_react.useContext)(SheetBodyContext);
|
|
@@ -240,7 +230,6 @@ const DialogContentInner = (0, import_react.forwardRef)(function DialogContentIn
|
|
|
240
230
|
const { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({ component: "DialogContent" });
|
|
241
231
|
const { contentId } = (0, import_tamagui.useDialogContext)();
|
|
242
232
|
const openFocus = withHouseOpenFocus(onOpenAutoFocus, contentId);
|
|
243
|
-
useDialogShowFocus(openFocus);
|
|
244
233
|
const windowFit = useWindowFit(props);
|
|
245
234
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Dialog.Content, {
|
|
246
235
|
ref,
|
|
@@ -297,8 +286,6 @@ const AlertDialogContent = (0, import_react.forwardRef)(function AlertDialogCont
|
|
|
297
286
|
});
|
|
298
287
|
const AlertDialogContentInner = (0, import_react.forwardRef)(function AlertDialogContentInner2({ children, ...props }, ref) {
|
|
299
288
|
const { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({ component: "AlertDialogContent" });
|
|
300
|
-
const { contentId } = (0, import_tamagui.useDialogContext)();
|
|
301
|
-
useDialogShowFocus(withHouseOpenFocus(props.onOpenAutoFocus, contentId));
|
|
302
289
|
const windowFit = useWindowFit(props, import_layoutTokens.ALERT_READABLE_WIDTH);
|
|
303
290
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.AlertDialog.Content, {
|
|
304
291
|
ref,
|
|
@@ -28,8 +28,8 @@ __export(overlaySurfaces_exports, {
|
|
|
28
28
|
DialogOverlay: () => DialogOverlay,
|
|
29
29
|
DialogRegionContext: () => DialogRegionContext,
|
|
30
30
|
DialogSheetFaceProvider: () => DialogSheetFaceProvider,
|
|
31
|
-
DialogShowFocus: () => DialogShowFocus,
|
|
32
31
|
PopoverContent: () => PopoverContent,
|
|
32
|
+
SheetBodyInsetProvider: () => SheetBodyInsetProvider,
|
|
33
33
|
SheetBodyProvider: () => SheetBodyProvider,
|
|
34
34
|
dialogScrim: () => dialogScrim,
|
|
35
35
|
overlayScrim: () => overlayScrim,
|
|
@@ -44,7 +44,8 @@ __export(overlaySurfaces_exports, {
|
|
|
44
44
|
useDialogRegionContext: () => useDialogRegionContext,
|
|
45
45
|
useDialogSheetFace: () => useDialogSheetFace,
|
|
46
46
|
useIsInDialogRegion: () => useIsInDialogRegion,
|
|
47
|
-
useIsInSheetBody: () => useIsInSheetBody
|
|
47
|
+
useIsInSheetBody: () => useIsInSheetBody,
|
|
48
|
+
useSheetBodyInset: () => useSheetBodyInset
|
|
48
49
|
});
|
|
49
50
|
module.exports = __toCommonJS(overlaySurfaces_exports);
|
|
50
51
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -56,7 +57,6 @@ var import_useResolvedKnobs = require("./useResolvedKnobs.native.js");
|
|
|
56
57
|
var import_layoutTokens = require("./layoutTokens.native.js");
|
|
57
58
|
var import_resolveKnobs = require("./resolveKnobs.native.js");
|
|
58
59
|
var import_react = require("react");
|
|
59
|
-
var import_web = require("@tamagui/web");
|
|
60
60
|
var import_tamagui = require("tamagui");
|
|
61
61
|
var dialogScrim = "$scrim-dialog";
|
|
62
62
|
var sheetScrim = "$scrim-sheet";
|
|
@@ -81,25 +81,26 @@ var sheetGrabberZone = {
|
|
|
81
81
|
};
|
|
82
82
|
var sheetHandleWidthRatio = .3;
|
|
83
83
|
var sheetHandle = {
|
|
84
|
-
width:
|
|
85
|
-
height:
|
|
84
|
+
width: 36,
|
|
85
|
+
height: 5,
|
|
86
86
|
borderRadius: 100,
|
|
87
|
-
backgroundColor: "$color-
|
|
88
|
-
opacity:
|
|
87
|
+
backgroundColor: "$color-12",
|
|
88
|
+
opacity: .3,
|
|
89
89
|
alignSelf: "center",
|
|
90
90
|
marginHorizontal: 0,
|
|
91
|
-
marginTop:
|
|
92
|
-
marginBottom:
|
|
91
|
+
marginTop: 5,
|
|
92
|
+
marginBottom: -10,
|
|
93
93
|
zIndex: 10
|
|
94
94
|
};
|
|
95
95
|
var sheetHandleZone = {
|
|
96
96
|
alignSelf: "stretch",
|
|
97
97
|
alignItems: "center",
|
|
98
|
-
paddingTop:
|
|
98
|
+
paddingTop: 0,
|
|
99
|
+
height: 21
|
|
99
100
|
};
|
|
100
101
|
var sheetHandleToneOpen = {
|
|
101
|
-
backgroundColor: "$color-
|
|
102
|
-
opacity:
|
|
102
|
+
backgroundColor: "$color-12",
|
|
103
|
+
opacity: .3
|
|
103
104
|
};
|
|
104
105
|
function sheetHandleTone(_scheme) {
|
|
105
106
|
return sheetHandleToneOpen;
|
|
@@ -150,23 +151,6 @@ function contentById(contentId) {
|
|
|
150
151
|
if (!contentId || typeof document === "undefined") return null;
|
|
151
152
|
return document.getElementById(contentId);
|
|
152
153
|
}
|
|
153
|
-
function useDialogShowFocus(onOpenAutoFocus) {
|
|
154
|
-
var { open, contentId } = (0, import_tamagui.useDialogContext)();
|
|
155
|
-
(0, import_react.useEffect)(function() {
|
|
156
|
-
if (!open || !contentId || !import_tamagui.isWeb || typeof document === "undefined") return;
|
|
157
|
-
var content = document.getElementById(contentId);
|
|
158
|
-
var focused = document.activeElement;
|
|
159
|
-
if (!content || typeof HTMLElement === "undefined" || !(focused instanceof HTMLElement)) return;
|
|
160
|
-
if (!content.contains(focused) || focused.tabIndex >= 0 && (0, import_keyboardFocusRing.wasKeyboardFocus)()) return;
|
|
161
|
-
onOpenAutoFocus((0, import_web.createChangeEventDetails)("trigger-focus"));
|
|
162
|
-
}, [open, contentId]);
|
|
163
|
-
}
|
|
164
|
-
function DialogShowFocus(param) {
|
|
165
|
-
var { onOpenAutoFocus } = param;
|
|
166
|
-
var { contentId } = (0, import_tamagui.useDialogContext)();
|
|
167
|
-
useDialogShowFocus(withHouseOpenFocus(onOpenAutoFocus, contentId));
|
|
168
|
-
return null;
|
|
169
|
-
}
|
|
170
154
|
var DialogRegionContext = /* @__PURE__ */ (0, import_react.createContext)({ inDialogRegion: false });
|
|
171
155
|
function useDialogRegionContext() {
|
|
172
156
|
return (0, import_react.useContext)(DialogRegionContext);
|
|
@@ -176,6 +160,11 @@ function useIsInDialogRegion() {
|
|
|
176
160
|
}
|
|
177
161
|
var IN_DIALOG_REGION = { inDialogRegion: true };
|
|
178
162
|
var SheetBodyContext = /* @__PURE__ */ (0, import_react.createContext)(false);
|
|
163
|
+
var SheetBodyInsetContext = /* @__PURE__ */ (0, import_react.createContext)(0);
|
|
164
|
+
var SheetBodyInsetProvider = SheetBodyInsetContext.Provider;
|
|
165
|
+
function useSheetBodyInset() {
|
|
166
|
+
return (0, import_react.useContext)(SheetBodyInsetContext);
|
|
167
|
+
}
|
|
179
168
|
var SheetBodyProvider = SheetBodyContext.Provider;
|
|
180
169
|
function useIsInSheetBody() {
|
|
181
170
|
return (0, import_react.useContext)(SheetBodyContext);
|
|
@@ -251,7 +240,6 @@ var DialogContentInner = /* @__PURE__ */ (0, import_react.forwardRef)(function D
|
|
|
251
240
|
var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({ component: "DialogContent" });
|
|
252
241
|
var { contentId } = (0, import_tamagui.useDialogContext)();
|
|
253
242
|
var openFocus = withHouseOpenFocus(onOpenAutoFocus, contentId);
|
|
254
|
-
useDialogShowFocus(openFocus);
|
|
255
243
|
var windowFit = useWindowFit(props);
|
|
256
244
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Dialog.Content, {
|
|
257
245
|
ref,
|
|
@@ -311,8 +299,6 @@ var AlertDialogContent = /* @__PURE__ */ (0, import_react.forwardRef)(function A
|
|
|
311
299
|
var AlertDialogContentInner = /* @__PURE__ */ (0, import_react.forwardRef)(function AlertDialogContentInner2(param, ref) {
|
|
312
300
|
var { children, ...props } = param;
|
|
313
301
|
var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({ component: "AlertDialogContent" });
|
|
314
|
-
var { contentId } = (0, import_tamagui.useDialogContext)();
|
|
315
|
-
useDialogShowFocus(withHouseOpenFocus(props.onOpenAutoFocus, contentId));
|
|
316
302
|
var windowFit = useWindowFit(props, import_layoutTokens.ALERT_READABLE_WIDTH);
|
|
317
303
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.AlertDialog.Content, {
|
|
318
304
|
ref,
|
|
@@ -28,8 +28,8 @@ __export(overlaySurfaces_exports, {
|
|
|
28
28
|
DialogOverlay: () => DialogOverlay,
|
|
29
29
|
DialogRegionContext: () => DialogRegionContext,
|
|
30
30
|
DialogSheetFaceProvider: () => DialogSheetFaceProvider,
|
|
31
|
-
DialogShowFocus: () => DialogShowFocus,
|
|
32
31
|
PopoverContent: () => PopoverContent,
|
|
32
|
+
SheetBodyInsetProvider: () => SheetBodyInsetProvider,
|
|
33
33
|
SheetBodyProvider: () => SheetBodyProvider,
|
|
34
34
|
dialogScrim: () => dialogScrim,
|
|
35
35
|
overlayScrim: () => overlayScrim,
|
|
@@ -44,7 +44,8 @@ __export(overlaySurfaces_exports, {
|
|
|
44
44
|
useDialogRegionContext: () => useDialogRegionContext,
|
|
45
45
|
useDialogSheetFace: () => useDialogSheetFace,
|
|
46
46
|
useIsInDialogRegion: () => useIsInDialogRegion,
|
|
47
|
-
useIsInSheetBody: () => useIsInSheetBody
|
|
47
|
+
useIsInSheetBody: () => useIsInSheetBody,
|
|
48
|
+
useSheetBodyInset: () => useSheetBodyInset
|
|
48
49
|
});
|
|
49
50
|
module.exports = __toCommonJS(overlaySurfaces_exports);
|
|
50
51
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -56,7 +57,6 @@ var import_useResolvedKnobs = require("./useResolvedKnobs.native.js");
|
|
|
56
57
|
var import_layoutTokens = require("./layoutTokens.native.js");
|
|
57
58
|
var import_resolveKnobs = require("./resolveKnobs.native.js");
|
|
58
59
|
var import_react = require("react");
|
|
59
|
-
var import_web = require("@tamagui/web");
|
|
60
60
|
var import_tamagui = require("tamagui");
|
|
61
61
|
var dialogScrim = "$scrim-dialog";
|
|
62
62
|
var sheetScrim = "$scrim-sheet";
|
|
@@ -81,25 +81,26 @@ var sheetGrabberZone = {
|
|
|
81
81
|
};
|
|
82
82
|
var sheetHandleWidthRatio = .3;
|
|
83
83
|
var sheetHandle = {
|
|
84
|
-
width:
|
|
85
|
-
height:
|
|
84
|
+
width: 36,
|
|
85
|
+
height: 5,
|
|
86
86
|
borderRadius: 100,
|
|
87
|
-
backgroundColor: "$color-
|
|
88
|
-
opacity:
|
|
87
|
+
backgroundColor: "$color-12",
|
|
88
|
+
opacity: .3,
|
|
89
89
|
alignSelf: "center",
|
|
90
90
|
marginHorizontal: 0,
|
|
91
|
-
marginTop:
|
|
92
|
-
marginBottom:
|
|
91
|
+
marginTop: 5,
|
|
92
|
+
marginBottom: -10,
|
|
93
93
|
zIndex: 10
|
|
94
94
|
};
|
|
95
95
|
var sheetHandleZone = {
|
|
96
96
|
alignSelf: "stretch",
|
|
97
97
|
alignItems: "center",
|
|
98
|
-
paddingTop:
|
|
98
|
+
paddingTop: 0,
|
|
99
|
+
height: 21
|
|
99
100
|
};
|
|
100
101
|
var sheetHandleToneOpen = {
|
|
101
|
-
backgroundColor: "$color-
|
|
102
|
-
opacity:
|
|
102
|
+
backgroundColor: "$color-12",
|
|
103
|
+
opacity: .3
|
|
103
104
|
};
|
|
104
105
|
function sheetHandleTone(_scheme) {
|
|
105
106
|
return sheetHandleToneOpen;
|
|
@@ -150,23 +151,6 @@ function contentById(contentId) {
|
|
|
150
151
|
if (!contentId || typeof document === "undefined") return null;
|
|
151
152
|
return document.getElementById(contentId);
|
|
152
153
|
}
|
|
153
|
-
function useDialogShowFocus(onOpenAutoFocus) {
|
|
154
|
-
var { open, contentId } = (0, import_tamagui.useDialogContext)();
|
|
155
|
-
(0, import_react.useEffect)(function() {
|
|
156
|
-
if (!open || !contentId || !import_tamagui.isWeb || typeof document === "undefined") return;
|
|
157
|
-
var content = document.getElementById(contentId);
|
|
158
|
-
var focused = document.activeElement;
|
|
159
|
-
if (!content || typeof HTMLElement === "undefined" || !(focused instanceof HTMLElement)) return;
|
|
160
|
-
if (!content.contains(focused) || focused.tabIndex >= 0 && (0, import_keyboardFocusRing.wasKeyboardFocus)()) return;
|
|
161
|
-
onOpenAutoFocus((0, import_web.createChangeEventDetails)("trigger-focus"));
|
|
162
|
-
}, [open, contentId]);
|
|
163
|
-
}
|
|
164
|
-
function DialogShowFocus(param) {
|
|
165
|
-
var { onOpenAutoFocus } = param;
|
|
166
|
-
var { contentId } = (0, import_tamagui.useDialogContext)();
|
|
167
|
-
useDialogShowFocus(withHouseOpenFocus(onOpenAutoFocus, contentId));
|
|
168
|
-
return null;
|
|
169
|
-
}
|
|
170
154
|
var DialogRegionContext = /* @__PURE__ */ (0, import_react.createContext)({ inDialogRegion: false });
|
|
171
155
|
function useDialogRegionContext() {
|
|
172
156
|
return (0, import_react.useContext)(DialogRegionContext);
|
|
@@ -176,6 +160,11 @@ function useIsInDialogRegion() {
|
|
|
176
160
|
}
|
|
177
161
|
var IN_DIALOG_REGION = { inDialogRegion: true };
|
|
178
162
|
var SheetBodyContext = /* @__PURE__ */ (0, import_react.createContext)(false);
|
|
163
|
+
var SheetBodyInsetContext = /* @__PURE__ */ (0, import_react.createContext)(0);
|
|
164
|
+
var SheetBodyInsetProvider = SheetBodyInsetContext.Provider;
|
|
165
|
+
function useSheetBodyInset() {
|
|
166
|
+
return (0, import_react.useContext)(SheetBodyInsetContext);
|
|
167
|
+
}
|
|
179
168
|
var SheetBodyProvider = SheetBodyContext.Provider;
|
|
180
169
|
function useIsInSheetBody() {
|
|
181
170
|
return (0, import_react.useContext)(SheetBodyContext);
|
|
@@ -251,7 +240,6 @@ var DialogContentInner = /* @__PURE__ */ (0, import_react.forwardRef)(function D
|
|
|
251
240
|
var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({ component: "DialogContent" });
|
|
252
241
|
var { contentId } = (0, import_tamagui.useDialogContext)();
|
|
253
242
|
var openFocus = withHouseOpenFocus(onOpenAutoFocus, contentId);
|
|
254
|
-
useDialogShowFocus(openFocus);
|
|
255
243
|
var windowFit = useWindowFit(props);
|
|
256
244
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Dialog.Content, {
|
|
257
245
|
ref,
|
|
@@ -311,8 +299,6 @@ var AlertDialogContent = /* @__PURE__ */ (0, import_react.forwardRef)(function A
|
|
|
311
299
|
var AlertDialogContentInner = /* @__PURE__ */ (0, import_react.forwardRef)(function AlertDialogContentInner2(param, ref) {
|
|
312
300
|
var { children, ...props } = param;
|
|
313
301
|
var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({ component: "AlertDialogContent" });
|
|
314
|
-
var { contentId } = (0, import_tamagui.useDialogContext)();
|
|
315
|
-
useDialogShowFocus(withHouseOpenFocus(props.onOpenAutoFocus, contentId));
|
|
316
302
|
var windowFit = useWindowFit(props, import_layoutTokens.ALERT_READABLE_WIDTH);
|
|
317
303
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.AlertDialog.Content, {
|
|
318
304
|
ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlaySurfaces.native.js","names":[],"sources":["cjs/theme/overlaySurfaces.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar overlaySurfaces_exports = {};\n__export(overlaySurfaces_exports, {\n AlertDialogContent: () => AlertDialogContent,\n AlertDialogOverlay: () => AlertDialogOverlay,\n DialogContent: () => DialogContent,\n DialogOverlay: () => DialogOverlay,\n DialogRegionContext: () => DialogRegionContext,\n DialogSheetFaceProvider: () => DialogSheetFaceProvider,\n DialogShowFocus: () => DialogShowFocus,\n PopoverContent: () => PopoverContent,\n SheetBodyProvider: () => SheetBodyProvider,\n dialogScrim: () => dialogScrim,\n overlayScrim: () => overlayScrim,\n sheetGrabber: () => sheetGrabber,\n sheetGrabberClearance: () => sheetGrabberClearance,\n sheetGrabberZone: () => sheetGrabberZone,\n sheetHandle: () => sheetHandle,\n sheetHandleTone: () => sheetHandleTone,\n sheetHandleWidthRatio: () => sheetHandleWidthRatio,\n sheetHandleZone: () => sheetHandleZone,\n sheetScrim: () => sheetScrim,\n useDialogRegionContext: () => useDialogRegionContext,\n useDialogSheetFace: () => useDialogSheetFace,\n useIsInDialogRegion: () => useIsInDialogRegion,\n useIsInSheetBody: () => useIsInSheetBody\n});\nmodule.exports = __toCommonJS(overlaySurfaces_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_keyboardFocusRing = require(\"../keyboardFocusRing\");\nvar import_motion = require(\"./motion\");\nvar import_transitionProps = require(\"./transitionProps\");\nvar import_Surface = require(\"./Surface\");\nvar import_useResolvedKnobs = require(\"./useResolvedKnobs\");\nvar import_layoutTokens = require(\"./layoutTokens\");\nvar import_resolveKnobs = require(\"./resolveKnobs\");\nvar import_react = require(\"react\");\nvar import_web = require(\"@tamagui/web\");\nvar import_tamagui = require(\"tamagui\");\nvar dialogScrim = \"$scrim-dialog\";\nvar sheetScrim = \"$scrim-sheet\";\nvar overlayScrim = dialogScrim;\nvar sheetGrabber = {\n width: 36,\n height: 5,\n borderRadius: 100,\n backgroundColor: \"$color-12\",\n opacity: 0.3,\n alignSelf: \"center\",\n marginHorizontal: 0,\n marginTop: 5,\n marginBottom: -10,\n zIndex: 10\n};\nvar sheetGrabberClearance = 16;\nvar sheetGrabberZone = {\n alignSelf: \"stretch\",\n alignItems: \"center\",\n height: 21\n};\nvar sheetHandleWidthRatio = 0.3;\nvar sheetHandle = {\n width: \"30%\",\n height: 10,\n borderRadius: 100,\n backgroundColor: \"$color-5\",\n opacity: 1,\n alignSelf: \"center\",\n marginHorizontal: 0,\n marginTop: 0,\n marginBottom: 8,\n zIndex: 10\n};\nvar sheetHandleZone = {\n alignSelf: \"stretch\",\n alignItems: \"center\",\n paddingTop: 8\n};\nvar sheetHandleToneOpen = {\n backgroundColor: \"$color-5\",\n opacity: 1\n};\nfunction sheetHandleTone(_scheme) {\n return sheetHandleToneOpen;\n}\nvar overlayFrameFocus = {\n outlineWidth: {\n default: 0,\n focus: 0,\n \"focus-visible\": 0\n },\n outlineStyle: {\n default: \"none\",\n focus: \"none\",\n \"focus-visible\": \"none\"\n }\n};\nfunction isTabbableWithin(node, container) {\n if (node.tabIndex < 0 || node.hidden || node.tagName === \"A\") return false;\n if (node.disabled) return false;\n if (typeof HTMLInputElement !== \"undefined\" && node instanceof HTMLInputElement && node.type === \"hidden\") {\n return false;\n }\n if (getComputedStyle(node).visibility === \"hidden\") return false;\n for (var el = node; el && el !== container; el = el.parentElement) {\n if (getComputedStyle(el).display === \"none\") return false;\n }\n return true;\n}\nfunction focusFirstTabbableOnOpen(details, container) {\n if (typeof HTMLElement === \"undefined\" || !(container instanceof HTMLElement)) return;\n var first = Array.from(container.querySelectorAll(\"*\")).find(function(node) {\n return isTabbableWithin(node, container);\n });\n if (!first) return;\n details.cancel();\n var focused = (0, import_keyboardFocusRing.focusOnOpen)(first, container);\n if (typeof HTMLInputElement !== \"undefined\" && focused instanceof HTMLInputElement) {\n focused.select();\n }\n}\nfunction withHouseOpenFocus(onOpenAutoFocus, contentId) {\n return function(details) {\n onOpenAutoFocus === null || onOpenAutoFocus === void 0 ? void 0 : onOpenAutoFocus(details);\n if (!details.isCanceled) focusFirstTabbableOnOpen(details, contentById(contentId));\n };\n}\nfunction contentById(contentId) {\n if (!contentId || typeof document === \"undefined\") return null;\n return document.getElementById(contentId);\n}\nfunction useDialogShowFocus(onOpenAutoFocus) {\n var { open, contentId } = (0, import_tamagui.useDialogContext)();\n (0, import_react.useEffect)(function() {\n if (!open || !contentId || !import_tamagui.isWeb || typeof document === \"undefined\") return;\n var content = document.getElementById(contentId);\n var focused = document.activeElement;\n if (!content || typeof HTMLElement === \"undefined\" || !(focused instanceof HTMLElement)) return;\n if (!content.contains(focused) || focused.tabIndex >= 0 && (0, import_keyboardFocusRing.wasKeyboardFocus)()) return;\n onOpenAutoFocus((0, import_web.createChangeEventDetails)(\"trigger-focus\"));\n }, [\n open,\n contentId\n ]);\n}\nfunction DialogShowFocus(param) {\n var { onOpenAutoFocus } = param;\n var { contentId } = (0, import_tamagui.useDialogContext)();\n useDialogShowFocus(withHouseOpenFocus(onOpenAutoFocus, contentId));\n return null;\n}\nvar DialogRegionContext = /* @__PURE__ */ (0, import_react.createContext)({\n inDialogRegion: false\n});\nfunction useDialogRegionContext() {\n return (0, import_react.useContext)(DialogRegionContext);\n}\nfunction useIsInDialogRegion() {\n return useDialogRegionContext().inDialogRegion;\n}\nvar IN_DIALOG_REGION = {\n inDialogRegion: true\n};\nvar SheetBodyContext = /* @__PURE__ */ (0, import_react.createContext)(false);\nvar SheetBodyProvider = SheetBodyContext.Provider;\nfunction useIsInSheetBody() {\n return (0, import_react.useContext)(SheetBodyContext);\n}\nvar DialogSheetFaceContext = /* @__PURE__ */ (0, import_react.createContext)(false);\nvar DialogSheetFaceProvider = DialogSheetFaceContext.Provider;\nfunction useDialogSheetFace() {\n return (0, import_react.useContext)(DialogSheetFaceContext);\n}\nvar DialogSheetBody = /* @__PURE__ */ (0, import_react.forwardRef)(function DialogSheetBody2(param, ref) {\n var { children } = param;\n var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({\n component: \"DialogContent\"\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n ref,\n ...knobProps.gap,\n ...{\n \"data-mp-dialog-face\": \"sheet\"\n },\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogSheetFaceContext.Provider, {\n value: false,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogRegionContext.Provider, {\n value: IN_DIALOG_REGION,\n children\n })\n })\n });\n});\nvar overlayEnterExit = {\n opacity: {\n enter: 0,\n exit: 0\n },\n y: {\n enter: -4,\n exit: -4\n },\n scale: {\n enter: 0.97,\n exit: 0.97\n }\n};\nvar DialogContent = /* @__PURE__ */ (0, import_react.forwardRef)(function DialogContent2(param, ref) {\n var { children, size = \"4\", ...props } = param;\n if (useDialogSheetFace()) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogSheetBody, {\n ref,\n children\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Surface.Surface, {\n size,\n painted: false,\n elevated: true,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentInner, {\n ref,\n ...props,\n children\n })\n });\n});\nfunction useWindowFit(props, fallbackMaxWidth) {\n var _ref, _props_maxWidth;\n var { width: windowWidth } = (0, import_tamagui.useWindowDimensions)();\n var room = windowWidth > 0 ? Math.max(0, windowWidth - 2 * (0, import_resolveKnobs.panelPaddingPx)()) : void 0;\n var fit = function fit2(value) {\n return room != null && typeof value === \"number\" ? Math.min(value, room) : value;\n };\n if (room == null) return fallbackMaxWidth == null ? void 0 : {\n maxWidth: fallbackMaxWidth\n };\n return {\n maxWidth: fit((_ref = (_props_maxWidth = props.maxWidth) !== null && _props_maxWidth !== void 0 ? _props_maxWidth : fallbackMaxWidth) !== null && _ref !== void 0 ? _ref : room),\n ...props.minWidth != null ? {\n minWidth: fit(props.minWidth)\n } : void 0,\n ...props.width != null ? {\n width: fit(props.width)\n } : void 0\n };\n}\nvar DialogContentInner = /* @__PURE__ */ (0, import_react.forwardRef)(function DialogContentInner2(param, ref) {\n var { children, onOpenAutoFocus, ...props } = param;\n var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({\n component: \"DialogContent\"\n });\n var { contentId } = (0, import_tamagui.useDialogContext)();\n var openFocus = withHouseOpenFocus(onOpenAutoFocus, contentId);\n useDialogShowFocus(openFocus);\n var windowFit = useWindowFit(props);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Dialog.Content, {\n ref,\n position: \"relative\",\n pointerEvents: \"auto\",\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...knobProps.panelPadding,\n ...knobProps.gap,\n elevate: false,\n ...(0, import_transitionProps.transitionProps)(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n onOpenAutoFocus: openFocus,\n ...props,\n ...windowFit,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogRegionContext.Provider, {\n value: IN_DIALOG_REGION,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetBodyContext.Provider, {\n value: false,\n children\n })\n })\n });\n});\nvar scrimFade = {\n opacity: {\n enter: 0,\n exit: 0\n }\n};\nvar DialogOverlay = /* @__PURE__ */ (0, import_react.forwardRef)(function DialogOverlay2(param, ref) {\n var { children, ...props } = param;\n var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)();\n var sheetFace = useDialogSheetFace();\n if (sheetFace) return null;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Dialog.Overlay, {\n ref,\n backgroundColor: dialogScrim,\n ...(0, import_transitionProps.transitionProps)((0, import_motion.scrimFor)(knobProps.motion.overlay)),\n ...scrimFade,\n ...props,\n children\n });\n});\nvar AlertDialogContent = /* @__PURE__ */ (0, import_react.forwardRef)(function AlertDialogContent2(param, ref) {\n var { children, size = \"4\", ...props } = param;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Surface.Surface, {\n size,\n painted: false,\n elevated: true,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogContentInner, {\n ref,\n ...props,\n children\n })\n });\n});\nvar AlertDialogContentInner = /* @__PURE__ */ (0, import_react.forwardRef)(function AlertDialogContentInner2(param, ref) {\n var { children, ...props } = param;\n var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({\n component: \"AlertDialogContent\"\n });\n var { contentId } = (0, import_tamagui.useDialogContext)();\n useDialogShowFocus(withHouseOpenFocus(props.onOpenAutoFocus, contentId));\n var windowFit = useWindowFit(props, import_layoutTokens.ALERT_READABLE_WIDTH);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.AlertDialog.Content, {\n ref,\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...knobProps.panelPadding,\n ...knobProps.gap,\n elevate: false,\n ...(0, import_transitionProps.transitionProps)(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n ...props,\n ...windowFit,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogRegionContext.Provider, {\n value: IN_DIALOG_REGION,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetBodyContext.Provider, {\n value: false,\n children\n })\n })\n });\n});\nvar AlertDialogOverlay = /* @__PURE__ */ (0, import_react.forwardRef)(function AlertDialogOverlay2(param, ref) {\n var { children, ...props } = param;\n var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)();\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.AlertDialog.Overlay, {\n ref,\n backgroundColor: dialogScrim,\n ...(0, import_transitionProps.transitionProps)((0, import_motion.scrimFor)(knobProps.motion.overlay)),\n ...scrimFade,\n ...props,\n children\n });\n});\nvar PopoverContent = /* @__PURE__ */ (0, import_react.forwardRef)(function PopoverContent2(param, ref) {\n var { children, onOpenAutoFocus: _onOpenAutoFocus, ...props } = param;\n var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({\n component: \"PopoverContent\",\n painted: false\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n ref,\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...(0, import_transitionProps.transitionProps)(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n ...props,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Surface.Surface, {\n painted: false,\n elevated: true,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetBodyContext.Provider, {\n value: false,\n children\n })\n })\n });\n});\n//# sourceMappingURL=overlaySurfaces.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,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,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,0BAA0B,CAAC;AAC/B,SAAS,yBAAyB;CAChC,0BAA0B;CAC1B,0BAA0B;CAC1B,qBAAqB;CACrB,qBAAqB;CACrB,2BAA2B;CAC3B,+BAA+B;CAC/B,uB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AAQ;EACxE;EACA,GAAG,UAAU;EACb,GAAG,UAAU;EACb,IAAI,GAAG,uBAAuB,gBAAe,CAAE,UAAU,OAAO,OAAO;EACvE,GAAG;EACH,GAAG;EACH,GAAG;EACH,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,eAAe,SAAS;GAC5E,SAAS;GACT,UAAU;GACV,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,iBAAiB,UAAU;IAC/E,OAAO;IACP;GACF,CAAC;EACH,CAAC;CACH,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"overlaySurfaces.native.js","names":[],"sources":["cjs/theme/overlaySurfaces.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar overlaySurfaces_exports = {};\n__export(overlaySurfaces_exports, {\n AlertDialogContent: () => AlertDialogContent,\n AlertDialogOverlay: () => AlertDialogOverlay,\n DialogContent: () => DialogContent,\n DialogOverlay: () => DialogOverlay,\n DialogRegionContext: () => DialogRegionContext,\n DialogSheetFaceProvider: () => DialogSheetFaceProvider,\n PopoverContent: () => PopoverContent,\n SheetBodyInsetProvider: () => SheetBodyInsetProvider,\n SheetBodyProvider: () => SheetBodyProvider,\n dialogScrim: () => dialogScrim,\n overlayScrim: () => overlayScrim,\n sheetGrabber: () => sheetGrabber,\n sheetGrabberClearance: () => sheetGrabberClearance,\n sheetGrabberZone: () => sheetGrabberZone,\n sheetHandle: () => sheetHandle,\n sheetHandleTone: () => sheetHandleTone,\n sheetHandleWidthRatio: () => sheetHandleWidthRatio,\n sheetHandleZone: () => sheetHandleZone,\n sheetScrim: () => sheetScrim,\n useDialogRegionContext: () => useDialogRegionContext,\n useDialogSheetFace: () => useDialogSheetFace,\n useIsInDialogRegion: () => useIsInDialogRegion,\n useIsInSheetBody: () => useIsInSheetBody,\n useSheetBodyInset: () => useSheetBodyInset\n});\nmodule.exports = __toCommonJS(overlaySurfaces_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_keyboardFocusRing = require(\"../keyboardFocusRing\");\nvar import_motion = require(\"./motion\");\nvar import_transitionProps = require(\"./transitionProps\");\nvar import_Surface = require(\"./Surface\");\nvar import_useResolvedKnobs = require(\"./useResolvedKnobs\");\nvar import_layoutTokens = require(\"./layoutTokens\");\nvar import_resolveKnobs = require(\"./resolveKnobs\");\nvar import_react = require(\"react\");\nvar import_tamagui = require(\"tamagui\");\nvar dialogScrim = \"$scrim-dialog\";\nvar sheetScrim = \"$scrim-sheet\";\nvar overlayScrim = dialogScrim;\nvar sheetGrabber = {\n width: 36,\n height: 5,\n borderRadius: 100,\n backgroundColor: \"$color-12\",\n opacity: 0.3,\n alignSelf: \"center\",\n marginHorizontal: 0,\n marginTop: 5,\n marginBottom: -10,\n zIndex: 10\n};\nvar sheetGrabberClearance = 16;\nvar sheetGrabberZone = {\n alignSelf: \"stretch\",\n alignItems: \"center\",\n height: 21\n};\nvar sheetHandleWidthRatio = 0.3;\nvar sheetHandle = {\n width: 36,\n height: 5,\n borderRadius: 100,\n backgroundColor: \"$color-12\",\n opacity: 0.3,\n alignSelf: \"center\",\n marginHorizontal: 0,\n marginTop: 5,\n marginBottom: -10,\n zIndex: 10\n};\nvar sheetHandleZone = {\n alignSelf: \"stretch\",\n alignItems: \"center\",\n paddingTop: 0,\n height: 21\n};\nvar sheetHandleToneOpen = {\n backgroundColor: \"$color-12\",\n opacity: 0.3\n};\nfunction sheetHandleTone(_scheme) {\n return sheetHandleToneOpen;\n}\nvar overlayFrameFocus = {\n outlineWidth: {\n default: 0,\n focus: 0,\n \"focus-visible\": 0\n },\n outlineStyle: {\n default: \"none\",\n focus: \"none\",\n \"focus-visible\": \"none\"\n }\n};\nfunction isTabbableWithin(node, container) {\n if (node.tabIndex < 0 || node.hidden || node.tagName === \"A\") return false;\n if (node.disabled) return false;\n if (typeof HTMLInputElement !== \"undefined\" && node instanceof HTMLInputElement && node.type === \"hidden\") {\n return false;\n }\n if (getComputedStyle(node).visibility === \"hidden\") return false;\n for (var el = node; el && el !== container; el = el.parentElement) {\n if (getComputedStyle(el).display === \"none\") return false;\n }\n return true;\n}\nfunction focusFirstTabbableOnOpen(details, container) {\n if (typeof HTMLElement === \"undefined\" || !(container instanceof HTMLElement)) return;\n var first = Array.from(container.querySelectorAll(\"*\")).find(function(node) {\n return isTabbableWithin(node, container);\n });\n if (!first) return;\n details.cancel();\n var focused = (0, import_keyboardFocusRing.focusOnOpen)(first, container);\n if (typeof HTMLInputElement !== \"undefined\" && focused instanceof HTMLInputElement) {\n focused.select();\n }\n}\nfunction withHouseOpenFocus(onOpenAutoFocus, contentId) {\n return function(details) {\n onOpenAutoFocus === null || onOpenAutoFocus === void 0 ? void 0 : onOpenAutoFocus(details);\n if (!details.isCanceled) focusFirstTabbableOnOpen(details, contentById(contentId));\n };\n}\nfunction contentById(contentId) {\n if (!contentId || typeof document === \"undefined\") return null;\n return document.getElementById(contentId);\n}\nvar DialogRegionContext = /* @__PURE__ */ (0, import_react.createContext)({\n inDialogRegion: false\n});\nfunction useDialogRegionContext() {\n return (0, import_react.useContext)(DialogRegionContext);\n}\nfunction useIsInDialogRegion() {\n return useDialogRegionContext().inDialogRegion;\n}\nvar IN_DIALOG_REGION = {\n inDialogRegion: true\n};\nvar SheetBodyContext = /* @__PURE__ */ (0, import_react.createContext)(false);\nvar SheetBodyInsetContext = /* @__PURE__ */ (0, import_react.createContext)(0);\nvar SheetBodyInsetProvider = SheetBodyInsetContext.Provider;\nfunction useSheetBodyInset() {\n return (0, import_react.useContext)(SheetBodyInsetContext);\n}\nvar SheetBodyProvider = SheetBodyContext.Provider;\nfunction useIsInSheetBody() {\n return (0, import_react.useContext)(SheetBodyContext);\n}\nvar DialogSheetFaceContext = /* @__PURE__ */ (0, import_react.createContext)(false);\nvar DialogSheetFaceProvider = DialogSheetFaceContext.Provider;\nfunction useDialogSheetFace() {\n return (0, import_react.useContext)(DialogSheetFaceContext);\n}\nvar DialogSheetBody = /* @__PURE__ */ (0, import_react.forwardRef)(function DialogSheetBody2(param, ref) {\n var { children } = param;\n var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({\n component: \"DialogContent\"\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n ref,\n ...knobProps.gap,\n ...{\n \"data-mp-dialog-face\": \"sheet\"\n },\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogSheetFaceContext.Provider, {\n value: false,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogRegionContext.Provider, {\n value: IN_DIALOG_REGION,\n children\n })\n })\n });\n});\nvar overlayEnterExit = {\n opacity: {\n enter: 0,\n exit: 0\n },\n y: {\n enter: -4,\n exit: -4\n },\n scale: {\n enter: 0.97,\n exit: 0.97\n }\n};\nvar DialogContent = /* @__PURE__ */ (0, import_react.forwardRef)(function DialogContent2(param, ref) {\n var { children, size = \"4\", ...props } = param;\n if (useDialogSheetFace()) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogSheetBody, {\n ref,\n children\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Surface.Surface, {\n size,\n painted: false,\n elevated: true,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentInner, {\n ref,\n ...props,\n children\n })\n });\n});\nfunction useWindowFit(props, fallbackMaxWidth) {\n var _ref, _props_maxWidth;\n var { width: windowWidth } = (0, import_tamagui.useWindowDimensions)();\n var room = windowWidth > 0 ? Math.max(0, windowWidth - 2 * (0, import_resolveKnobs.panelPaddingPx)()) : void 0;\n var fit = function fit2(value) {\n return room != null && typeof value === \"number\" ? Math.min(value, room) : value;\n };\n if (room == null) return fallbackMaxWidth == null ? void 0 : {\n maxWidth: fallbackMaxWidth\n };\n return {\n maxWidth: fit((_ref = (_props_maxWidth = props.maxWidth) !== null && _props_maxWidth !== void 0 ? _props_maxWidth : fallbackMaxWidth) !== null && _ref !== void 0 ? _ref : room),\n ...props.minWidth != null ? {\n minWidth: fit(props.minWidth)\n } : void 0,\n ...props.width != null ? {\n width: fit(props.width)\n } : void 0\n };\n}\nvar DialogContentInner = /* @__PURE__ */ (0, import_react.forwardRef)(function DialogContentInner2(param, ref) {\n var { children, onOpenAutoFocus, ...props } = param;\n var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({\n component: \"DialogContent\"\n });\n var { contentId } = (0, import_tamagui.useDialogContext)();\n var openFocus = withHouseOpenFocus(onOpenAutoFocus, contentId);\n var windowFit = useWindowFit(props);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Dialog.Content, {\n ref,\n position: \"relative\",\n pointerEvents: \"auto\",\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...knobProps.panelPadding,\n ...knobProps.gap,\n elevate: false,\n ...(0, import_transitionProps.transitionProps)(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n onOpenAutoFocus: openFocus,\n ...props,\n ...windowFit,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogRegionContext.Provider, {\n value: IN_DIALOG_REGION,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetBodyContext.Provider, {\n value: false,\n children\n })\n })\n });\n});\nvar scrimFade = {\n opacity: {\n enter: 0,\n exit: 0\n }\n};\nvar DialogOverlay = /* @__PURE__ */ (0, import_react.forwardRef)(function DialogOverlay2(param, ref) {\n var { children, ...props } = param;\n var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)();\n var sheetFace = useDialogSheetFace();\n if (sheetFace) return null;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Dialog.Overlay, {\n ref,\n backgroundColor: dialogScrim,\n ...(0, import_transitionProps.transitionProps)((0, import_motion.scrimFor)(knobProps.motion.overlay)),\n ...scrimFade,\n ...props,\n children\n });\n});\nvar AlertDialogContent = /* @__PURE__ */ (0, import_react.forwardRef)(function AlertDialogContent2(param, ref) {\n var { children, size = \"4\", ...props } = param;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Surface.Surface, {\n size,\n painted: false,\n elevated: true,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogContentInner, {\n ref,\n ...props,\n children\n })\n });\n});\nvar AlertDialogContentInner = /* @__PURE__ */ (0, import_react.forwardRef)(function AlertDialogContentInner2(param, ref) {\n var { children, ...props } = param;\n var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({\n component: \"AlertDialogContent\"\n });\n var windowFit = useWindowFit(props, import_layoutTokens.ALERT_READABLE_WIDTH);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.AlertDialog.Content, {\n ref,\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...knobProps.panelPadding,\n ...knobProps.gap,\n elevate: false,\n ...(0, import_transitionProps.transitionProps)(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n ...props,\n ...windowFit,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogRegionContext.Provider, {\n value: IN_DIALOG_REGION,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetBodyContext.Provider, {\n value: false,\n children\n })\n })\n });\n});\nvar AlertDialogOverlay = /* @__PURE__ */ (0, import_react.forwardRef)(function AlertDialogOverlay2(param, ref) {\n var { children, ...props } = param;\n var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)();\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.AlertDialog.Overlay, {\n ref,\n backgroundColor: dialogScrim,\n ...(0, import_transitionProps.transitionProps)((0, import_motion.scrimFor)(knobProps.motion.overlay)),\n ...scrimFade,\n ...props,\n children\n });\n});\nvar PopoverContent = /* @__PURE__ */ (0, import_react.forwardRef)(function PopoverContent2(param, ref) {\n var { children, onOpenAutoFocus: _onOpenAutoFocus, ...props } = param;\n var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({\n component: \"PopoverContent\",\n painted: false\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {\n ref,\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...(0, import_transitionProps.transitionProps)(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n ...props,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Surface.Surface, {\n painted: false,\n elevated: true,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetBodyContext.Provider, {\n value: false,\n children\n })\n })\n });\n});\n//# sourceMappingURL=overlaySurfaces.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,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,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AAU;IAC/E,OAAO;IACP;GACF,CAAC;EACH,CAAC;CACH,CAAC;AACH,CAAC"}
|
|
@@ -70,13 +70,44 @@ function guardTable(table) {
|
|
|
70
70
|
guarded.add(proxy);
|
|
71
71
|
return proxy;
|
|
72
72
|
}
|
|
73
|
+
function kebabThemeKey(key) {
|
|
74
|
+
return key.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Za-z])(\d)/g, "$1-$2").toLowerCase();
|
|
75
|
+
}
|
|
76
|
+
function themeKeysOf(themes) {
|
|
77
|
+
const keys = /* @__PURE__ */ new Set();
|
|
78
|
+
for (const theme of Object.values(themes ?? {})) {
|
|
79
|
+
for (const key of Object.keys(theme)) keys.add(key);
|
|
80
|
+
}
|
|
81
|
+
return keys;
|
|
82
|
+
}
|
|
83
|
+
function guardColorTable(table, themes) {
|
|
84
|
+
if (guarded.has(table)) return table;
|
|
85
|
+
let keys;
|
|
86
|
+
const proxy = new Proxy(table, { get(target, key, receiver) {
|
|
87
|
+
const value = Reflect.get(target, key, receiver);
|
|
88
|
+
if (value !== void 0 || typeof key !== "string" || key in target) return value;
|
|
89
|
+
const meant = kebabThemeKey(key);
|
|
90
|
+
if (meant === key) return value;
|
|
91
|
+
keys ??= themes();
|
|
92
|
+
if (keys.has(key) || !keys.has(meant)) return value;
|
|
93
|
+
(0, import_devWarn.devWarn)("unknown-token", {
|
|
94
|
+
component: renderingComponent(),
|
|
95
|
+
value: `$${key}`,
|
|
96
|
+
suggest: `$${meant}`
|
|
97
|
+
});
|
|
98
|
+
return value;
|
|
99
|
+
} });
|
|
100
|
+
guarded.add(proxy);
|
|
101
|
+
return proxy;
|
|
102
|
+
}
|
|
73
103
|
function guardUnknownTokens(config) {
|
|
74
104
|
if (process.env.NODE_ENV === "production") return config;
|
|
75
|
-
const tables = config
|
|
105
|
+
const { tokensParsed: tables, themes } = config;
|
|
76
106
|
if (!tables) return config;
|
|
77
107
|
for (const category of guardedCategories) {
|
|
78
108
|
const table = tables[category];
|
|
79
109
|
if (table) tables[category] = guardTable(table);
|
|
80
110
|
}
|
|
111
|
+
if (tables.color) tables.color = guardColorTable(tables.color, () => themeKeysOf(themes));
|
|
81
112
|
return config;
|
|
82
113
|
}
|
|
@@ -92,9 +92,75 @@ function guardTable(table) {
|
|
|
92
92
|
guarded.add(proxy);
|
|
93
93
|
return proxy;
|
|
94
94
|
}
|
|
95
|
+
function kebabThemeKey(key) {
|
|
96
|
+
return key.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Za-z])(\d)/g, "$1-$2").toLowerCase();
|
|
97
|
+
}
|
|
98
|
+
function themeKeysOf(themes) {
|
|
99
|
+
var keys = /* @__PURE__ */ new Set();
|
|
100
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
101
|
+
try {
|
|
102
|
+
for (var _iterator = Object.values(themes !== null && themes !== void 0 ? themes : {})[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
103
|
+
var theme = _step.value;
|
|
104
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
105
|
+
try {
|
|
106
|
+
for (var _iterator1 = Object.keys(theme)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
107
|
+
var key = _step1.value;
|
|
108
|
+
keys.add(key);
|
|
109
|
+
}
|
|
110
|
+
} catch (err) {
|
|
111
|
+
_didIteratorError1 = true;
|
|
112
|
+
_iteratorError1 = err;
|
|
113
|
+
} finally {
|
|
114
|
+
try {
|
|
115
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
116
|
+
_iterator1.return();
|
|
117
|
+
}
|
|
118
|
+
} finally {
|
|
119
|
+
if (_didIteratorError1) {
|
|
120
|
+
throw _iteratorError1;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
} catch (err) {
|
|
126
|
+
_didIteratorError = true;
|
|
127
|
+
_iteratorError = err;
|
|
128
|
+
} finally {
|
|
129
|
+
try {
|
|
130
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
131
|
+
_iterator.return();
|
|
132
|
+
}
|
|
133
|
+
} finally {
|
|
134
|
+
if (_didIteratorError) {
|
|
135
|
+
throw _iteratorError;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return keys;
|
|
140
|
+
}
|
|
141
|
+
function guardColorTable(table, themes) {
|
|
142
|
+
if (guarded.has(table)) return table;
|
|
143
|
+
var keys;
|
|
144
|
+
var proxy = new Proxy(table, { get(target, key, receiver) {
|
|
145
|
+
var value = Reflect.get(target, key, receiver);
|
|
146
|
+
if (value !== void 0 || typeof key !== "string" || key in target) return value;
|
|
147
|
+
var meant = kebabThemeKey(key);
|
|
148
|
+
if (meant === key) return value;
|
|
149
|
+
keys !== null && keys !== void 0 ? keys : keys = themes();
|
|
150
|
+
if (keys.has(key) || !keys.has(meant)) return value;
|
|
151
|
+
(0, import_devWarn.devWarn)("unknown-token", {
|
|
152
|
+
component: renderingComponent(),
|
|
153
|
+
value: `$${key}`,
|
|
154
|
+
suggest: `$${meant}`
|
|
155
|
+
});
|
|
156
|
+
return value;
|
|
157
|
+
} });
|
|
158
|
+
guarded.add(proxy);
|
|
159
|
+
return proxy;
|
|
160
|
+
}
|
|
95
161
|
function guardUnknownTokens(config) {
|
|
96
162
|
if (process.env.NODE_ENV === "production") return config;
|
|
97
|
-
var tables = config
|
|
163
|
+
var { tokensParsed: tables, themes } = config;
|
|
98
164
|
if (!tables) return config;
|
|
99
165
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
100
166
|
try {
|
|
@@ -117,5 +183,8 @@ function guardUnknownTokens(config) {
|
|
|
117
183
|
}
|
|
118
184
|
}
|
|
119
185
|
}
|
|
186
|
+
if (tables.color) tables.color = guardColorTable(tables.color, function() {
|
|
187
|
+
return themeKeysOf(themes);
|
|
188
|
+
});
|
|
120
189
|
return config;
|
|
121
190
|
}
|