@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.
Files changed (54) hide show
  1. package/README.md +6 -4
  2. package/dist/cjs/index.gnome.cjs +2 -1
  3. package/dist/cjs/index.gnome.native.cjs +2 -1
  4. package/dist/cjs/index.gnome.native.js +2 -1
  5. package/dist/cjs/index.gnome.native.js.map +1 -1
  6. package/dist/cjs/theme/createThemes.cjs +0 -4
  7. package/dist/cjs/theme/createThemes.native.cjs +0 -4
  8. package/dist/cjs/theme/createThemes.native.js +0 -4
  9. package/dist/cjs/theme/createThemes.native.js.map +1 -1
  10. package/dist/cjs/theme/overlaySurfaces.cjs +18 -31
  11. package/dist/cjs/theme/overlaySurfaces.native.cjs +18 -32
  12. package/dist/cjs/theme/overlaySurfaces.native.js +18 -32
  13. package/dist/cjs/theme/overlaySurfaces.native.js.map +1 -1
  14. package/dist/cjs/theme/unknownTokenGuard.cjs +32 -1
  15. package/dist/cjs/theme/unknownTokenGuard.native.cjs +70 -1
  16. package/dist/cjs/theme/unknownTokenGuard.native.js +70 -1
  17. package/dist/cjs/theme/unknownTokenGuard.native.js.map +1 -1
  18. package/dist/esm/index.gnome.mjs +2 -2
  19. package/dist/esm/index.gnome.native.js +2 -2
  20. package/dist/esm/theme/createThemes.mjs +0 -4
  21. package/dist/esm/theme/createThemes.mjs.map +1 -1
  22. package/dist/esm/theme/createThemes.native.js +0 -4
  23. package/dist/esm/theme/createThemes.native.js.map +1 -1
  24. package/dist/esm/theme/overlaySurfaces.mjs +19 -33
  25. package/dist/esm/theme/overlaySurfaces.mjs.map +1 -1
  26. package/dist/esm/theme/overlaySurfaces.native.js +19 -34
  27. package/dist/esm/theme/overlaySurfaces.native.js.map +1 -1
  28. package/dist/esm/theme/unknownTokenGuard.mjs +32 -1
  29. package/dist/esm/theme/unknownTokenGuard.mjs.map +1 -1
  30. package/dist/esm/theme/unknownTokenGuard.native.js +70 -1
  31. package/dist/esm/theme/unknownTokenGuard.native.js.map +1 -1
  32. package/package.json +5 -5
  33. package/src/index.gnome.ts +2 -1
  34. package/src/theme/controlEdges.spec.ts +2 -2
  35. package/src/theme/createDefaultThemeConfig.spec.ts +6 -14
  36. package/src/theme/createThemes.ts +0 -4
  37. package/src/theme/overlaySurfaces.focus.spec.tsx +0 -48
  38. package/src/theme/overlaySurfaces.tsx +29 -67
  39. package/src/theme/rampRoles.spec.ts +1 -1
  40. package/src/theme/rowStates.spec.ts +1 -1
  41. package/src/theme/selectedState.spec.ts +1 -2
  42. package/src/theme/sheetFrameHandle.spec.ts +8 -0
  43. package/src/theme/sheetHandle.spec.ts +16 -16
  44. package/src/theme/subsetThemes.spec.ts +3 -3
  45. package/src/theme/unknownTokenGuard.spec.tsx +35 -1
  46. package/src/theme/unknownTokenGuard.ts +54 -3
  47. package/types/index.gnome.d.ts +1 -1
  48. package/types/index.gnome.d.ts.map +1 -1
  49. package/types/theme/createThemes.d.ts +0 -12
  50. package/types/theme/createThemes.d.ts.map +1 -1
  51. package/types/theme/overlaySurfaces.d.ts +23 -32
  52. package/types/theme/overlaySurfaces.d.ts.map +1 -1
  53. package/types/theme/unknownTokenGuard.d.ts +3 -2
  54. package/types/theme/unknownTokenGuard.d.ts.map +1 -1
@@ -1,13 +1,12 @@
1
- import { focusOnOpen, wasKeyboardFocus } from "../keyboardFocusRing.mjs";
1
+ import { focusOnOpen } from "../keyboardFocusRing.mjs";
2
2
  import { scrimFor } from "./motion.mjs";
3
3
  import { transitionProps } from "./transitionProps.mjs";
4
4
  import { Surface } from "./Surface.mjs";
5
5
  import { useResolvedKnobs } from "./useResolvedKnobs.mjs";
6
6
  import { ALERT_READABLE_WIDTH } from "./layoutTokens.mjs";
7
7
  import { panelPaddingPx } from "./resolveKnobs.mjs";
8
- import { createContext, forwardRef, useContext, useEffect } from "react";
9
- import { createChangeEventDetails } from "@tamagui/web";
10
- import { AlertDialog, Dialog, YStack, isWeb, useDialogContext, useWindowDimensions } from "tamagui";
8
+ import { createContext, forwardRef, useContext } from "react";
9
+ import { AlertDialog, Dialog, YStack, useDialogContext, useWindowDimensions } from "tamagui";
11
10
  import { jsx } from "react/jsx-runtime";
12
11
 
13
12
  const dialogScrim = "$scrim-dialog";
@@ -33,25 +32,26 @@ const sheetGrabberZone = {
33
32
  };
34
33
  const sheetHandleWidthRatio = .3;
35
34
  const sheetHandle = {
36
- width: "30%",
37
- height: 10,
35
+ width: 36,
36
+ height: 5,
38
37
  borderRadius: 100,
39
- backgroundColor: "$color-5",
40
- opacity: 1,
38
+ backgroundColor: "$color-12",
39
+ opacity: .3,
41
40
  alignSelf: "center",
42
41
  marginHorizontal: 0,
43
- marginTop: 0,
44
- marginBottom: 8,
42
+ marginTop: 5,
43
+ marginBottom: -10,
45
44
  zIndex: 10
46
45
  };
47
46
  const sheetHandleZone = {
48
47
  alignSelf: "stretch",
49
48
  alignItems: "center",
50
- paddingTop: 8
49
+ paddingTop: 0,
50
+ height: 21
51
51
  };
52
52
  const sheetHandleToneOpen = {
53
- backgroundColor: "$color-5",
54
- opacity: 1
53
+ backgroundColor: "$color-12",
54
+ opacity: .3
55
55
  };
56
56
  function sheetHandleTone(_scheme) {
57
57
  return sheetHandleToneOpen;
@@ -100,22 +100,6 @@ function contentById(contentId) {
100
100
  if (!contentId || typeof document === "undefined") return null;
101
101
  return document.getElementById(contentId);
102
102
  }
103
- function useDialogShowFocus(onOpenAutoFocus) {
104
- const { open, contentId } = useDialogContext();
105
- useEffect(() => {
106
- if (!open || !contentId || !isWeb || typeof document === "undefined") return;
107
- const content = document.getElementById(contentId);
108
- const focused = document.activeElement;
109
- if (!content || typeof HTMLElement === "undefined" || !(focused instanceof HTMLElement)) return;
110
- if (!content.contains(focused) || focused.tabIndex >= 0 && wasKeyboardFocus()) return;
111
- onOpenAutoFocus(createChangeEventDetails("trigger-focus"));
112
- }, [open, contentId]);
113
- }
114
- function DialogShowFocus({ onOpenAutoFocus }) {
115
- const { contentId } = useDialogContext();
116
- useDialogShowFocus(withHouseOpenFocus(onOpenAutoFocus, contentId));
117
- return null;
118
- }
119
103
  const DialogRegionContext = createContext({ inDialogRegion: false });
120
104
  function useDialogRegionContext() {
121
105
  return useContext(DialogRegionContext);
@@ -125,6 +109,11 @@ function useIsInDialogRegion() {
125
109
  }
126
110
  const IN_DIALOG_REGION = { inDialogRegion: true };
127
111
  const SheetBodyContext = createContext(false);
112
+ const SheetBodyInsetContext = createContext(0);
113
+ const SheetBodyInsetProvider = SheetBodyInsetContext.Provider;
114
+ function useSheetBodyInset() {
115
+ return useContext(SheetBodyInsetContext);
116
+ }
128
117
  const SheetBodyProvider = SheetBodyContext.Provider;
129
118
  function useIsInSheetBody() {
130
119
  return useContext(SheetBodyContext);
@@ -194,7 +183,6 @@ const DialogContentInner = forwardRef(function DialogContentInner2({ children, o
194
183
  const { knobProps } = useResolvedKnobs({ component: "DialogContent" });
195
184
  const { contentId } = useDialogContext();
196
185
  const openFocus = withHouseOpenFocus(onOpenAutoFocus, contentId);
197
- useDialogShowFocus(openFocus);
198
186
  const windowFit = useWindowFit(props);
199
187
  return /* @__PURE__ */ jsx(Dialog.Content, {
200
188
  ref,
@@ -251,8 +239,6 @@ const AlertDialogContent = forwardRef(function AlertDialogContent2({ children, s
251
239
  });
252
240
  const AlertDialogContentInner = forwardRef(function AlertDialogContentInner2({ children, ...props }, ref) {
253
241
  const { knobProps } = useResolvedKnobs({ component: "AlertDialogContent" });
254
- const { contentId } = useDialogContext();
255
- useDialogShowFocus(withHouseOpenFocus(props.onOpenAutoFocus, contentId));
256
242
  const windowFit = useWindowFit(props, ALERT_READABLE_WIDTH);
257
243
  return /* @__PURE__ */ jsx(AlertDialog.Content, {
258
244
  ref,
@@ -310,5 +296,5 @@ const PopoverContent = forwardRef(function PopoverContent2({ children, onOpenAut
310
296
  });
311
297
  });
312
298
 
313
- export { AlertDialogContent, AlertDialogOverlay, DialogContent, DialogOverlay, DialogRegionContext, DialogSheetFaceProvider, DialogShowFocus, PopoverContent, SheetBodyProvider, dialogScrim, overlayScrim, sheetGrabber, sheetGrabberClearance, sheetGrabberZone, sheetHandle, sheetHandleTone, sheetHandleWidthRatio, sheetHandleZone, sheetScrim, useDialogRegionContext, useDialogSheetFace, useIsInDialogRegion, useIsInSheetBody };
299
+ export { AlertDialogContent, AlertDialogOverlay, DialogContent, DialogOverlay, DialogRegionContext, DialogSheetFaceProvider, PopoverContent, SheetBodyInsetProvider, SheetBodyProvider, dialogScrim, overlayScrim, sheetGrabber, sheetGrabberClearance, sheetGrabberZone, sheetHandle, sheetHandleTone, sheetHandleWidthRatio, sheetHandleZone, sheetScrim, useDialogRegionContext, useDialogSheetFace, useIsInDialogRegion, useIsInSheetBody, useSheetBodyInset };
314
300
  //# sourceMappingURL=overlaySurfaces.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"overlaySurfaces.js","names":[],"sources":["esm/theme/overlaySurfaces.js"],"sourcesContent":["import { focusOnOpen, wasKeyboardFocus } from \"../keyboardFocusRing\";\nimport { scrimFor } from \"./motion\";\nimport { transitionProps } from \"./transitionProps\";\nimport { Surface } from \"./Surface\";\nimport { useResolvedKnobs } from \"./useResolvedKnobs\";\nimport { ALERT_READABLE_WIDTH } from \"./layoutTokens\";\nimport { panelPaddingPx } from \"./resolveKnobs\";\nimport { createContext, forwardRef, useContext, useEffect } from \"react\";\nimport { createChangeEventDetails } from \"@tamagui/web\";\nimport {\n AlertDialog,\n Dialog,\n isWeb,\n useDialogContext,\n useWindowDimensions,\n YStack\n} from \"tamagui\";\nimport { jsx } from \"react/jsx-runtime\";\nconst dialogScrim = \"$scrim-dialog\";\nconst sheetScrim = \"$scrim-sheet\";\nconst overlayScrim = dialogScrim;\nconst 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};\nconst sheetGrabberClearance = 16;\nconst sheetGrabberZone = {\n alignSelf: \"stretch\",\n alignItems: \"center\",\n height: 21\n};\nconst sheetHandleWidthRatio = 0.3;\nconst 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};\nconst sheetHandleZone = {\n alignSelf: \"stretch\",\n alignItems: \"center\",\n paddingTop: 8\n};\nconst sheetHandleToneOpen = { backgroundColor: \"$color-5\", opacity: 1 };\nfunction sheetHandleTone(_scheme) {\n return sheetHandleToneOpen;\n}\nconst overlayFrameFocus = {\n outlineWidth: { default: 0, focus: 0, \"focus-visible\": 0 },\n outlineStyle: { default: \"none\", focus: \"none\", \"focus-visible\": \"none\" }\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 (let 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 const first = Array.from(container.querySelectorAll(\"*\")).find(\n (node) => isTabbableWithin(node, container)\n );\n if (!first) return;\n details.cancel();\n const focused = focusOnOpen(first, container);\n if (typeof HTMLInputElement !== \"undefined\" && focused instanceof HTMLInputElement) {\n focused.select();\n }\n}\nfunction withHouseOpenFocus(onOpenAutoFocus, contentId) {\n return (details) => {\n 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 const { open, contentId } = useDialogContext();\n useEffect(() => {\n if (!open || !contentId || !isWeb || typeof document === \"undefined\") return;\n const content = document.getElementById(contentId);\n const focused = document.activeElement;\n if (!content || typeof HTMLElement === \"undefined\" || !(focused instanceof HTMLElement)) return;\n if (!content.contains(focused) || focused.tabIndex >= 0 && wasKeyboardFocus()) return;\n onOpenAutoFocus(createChangeEventDetails(\"trigger-focus\"));\n }, [open, contentId]);\n}\nfunction DialogShowFocus({ onOpenAutoFocus }) {\n const { contentId } = useDialogContext();\n useDialogShowFocus(withHouseOpenFocus(onOpenAutoFocus, contentId));\n return null;\n}\nconst DialogRegionContext = createContext({\n inDialogRegion: false\n});\nfunction useDialogRegionContext() {\n return useContext(DialogRegionContext);\n}\nfunction useIsInDialogRegion() {\n return useDialogRegionContext().inDialogRegion;\n}\nconst IN_DIALOG_REGION = { inDialogRegion: true };\nconst SheetBodyContext = createContext(false);\nconst SheetBodyProvider = SheetBodyContext.Provider;\nfunction useIsInSheetBody() {\n return useContext(SheetBodyContext);\n}\nconst DialogSheetFaceContext = createContext(false);\nconst DialogSheetFaceProvider = DialogSheetFaceContext.Provider;\nfunction useDialogSheetFace() {\n return useContext(DialogSheetFaceContext);\n}\nconst DialogSheetBody = forwardRef(\n function DialogSheetBody2({ children }, ref) {\n const { knobProps } = useResolvedKnobs({ component: \"DialogContent\" });\n return /* @__PURE__ */ jsx(YStack, { ref, ...knobProps.gap, ...{ \"data-mp-dialog-face\": \"sheet\" }, children: /* @__PURE__ */ jsx(DialogSheetFaceContext.Provider, { value: false, children: /* @__PURE__ */ jsx(DialogRegionContext.Provider, { value: IN_DIALOG_REGION, children }) }) });\n }\n);\nconst overlayEnterExit = {\n opacity: { enter: 0, exit: 0 },\n y: { enter: -4, exit: -4 },\n scale: { enter: 0.97, exit: 0.97 }\n};\nconst DialogContent = forwardRef(function DialogContent2({ children, size = \"4\", ...props }, ref) {\n if (useDialogSheetFace()) return /* @__PURE__ */ jsx(DialogSheetBody, { ref, children });\n return /* @__PURE__ */ jsx(Surface, { size, painted: false, elevated: true, children: /* @__PURE__ */ jsx(DialogContentInner, { ref, ...props, children }) });\n});\nfunction useWindowFit(props, fallbackMaxWidth) {\n const { width: windowWidth } = useWindowDimensions();\n const room = windowWidth > 0 ? Math.max(0, windowWidth - 2 * panelPaddingPx()) : void 0;\n const fit = (value) => room != null && typeof value === \"number\" ? Math.min(value, room) : value;\n if (room == null) return fallbackMaxWidth == null ? void 0 : { maxWidth: fallbackMaxWidth };\n return {\n maxWidth: fit(props.maxWidth ?? fallbackMaxWidth ?? room),\n ...props.minWidth != null ? { minWidth: fit(props.minWidth) } : void 0,\n ...props.width != null ? { width: fit(props.width) } : void 0\n };\n}\nconst DialogContentInner = forwardRef(function DialogContentInner2({ children, onOpenAutoFocus, ...props }, ref) {\n const { knobProps } = useResolvedKnobs({ component: \"DialogContent\" });\n const { contentId } = useDialogContext();\n const openFocus = withHouseOpenFocus(onOpenAutoFocus, contentId);\n useDialogShowFocus(openFocus);\n const windowFit = useWindowFit(props);\n return /* @__PURE__ */ jsx(\n Dialog.Content,\n {\n ref,\n position: \"relative\",\n pointerEvents: \"auto\",\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...knobProps.panelPadding,\n ...knobProps.gap,\n elevate: false,\n ...transitionProps(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n onOpenAutoFocus: openFocus,\n ...props,\n ...windowFit,\n children: /* @__PURE__ */ jsx(DialogRegionContext.Provider, { value: IN_DIALOG_REGION, children: /* @__PURE__ */ jsx(SheetBodyContext.Provider, { value: false, children }) })\n }\n );\n});\nconst scrimFade = { opacity: { enter: 0, exit: 0 } };\nconst DialogOverlay = forwardRef(function DialogOverlay2({ children, ...props }, ref) {\n const { knobProps } = useResolvedKnobs();\n const sheetFace = useDialogSheetFace();\n if (sheetFace) return null;\n return /* @__PURE__ */ jsx(\n Dialog.Overlay,\n {\n ref,\n backgroundColor: dialogScrim,\n ...transitionProps(scrimFor(knobProps.motion.overlay)),\n ...scrimFade,\n ...props,\n children\n }\n );\n});\nconst AlertDialogContent = forwardRef(\n function AlertDialogContent2({ children, size = \"4\", ...props }, ref) {\n return /* @__PURE__ */ jsx(Surface, { size, painted: false, elevated: true, children: /* @__PURE__ */ jsx(AlertDialogContentInner, { ref, ...props, children }) });\n }\n);\nconst AlertDialogContentInner = forwardRef(function AlertDialogContentInner2({ children, ...props }, ref) {\n const { knobProps } = useResolvedKnobs({ component: \"AlertDialogContent\" });\n const { contentId } = useDialogContext();\n useDialogShowFocus(withHouseOpenFocus(props.onOpenAutoFocus, contentId));\n const windowFit = useWindowFit(props, ALERT_READABLE_WIDTH);\n return /* @__PURE__ */ jsx(\n AlertDialog.Content,\n {\n ref,\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...knobProps.panelPadding,\n ...knobProps.gap,\n elevate: false,\n ...transitionProps(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n ...props,\n ...windowFit,\n children: /* @__PURE__ */ jsx(DialogRegionContext.Provider, { value: IN_DIALOG_REGION, children: /* @__PURE__ */ jsx(SheetBodyContext.Provider, { value: false, children }) })\n }\n );\n});\nconst AlertDialogOverlay = forwardRef(function AlertDialogOverlay2({ children, ...props }, ref) {\n const { knobProps } = useResolvedKnobs();\n return /* @__PURE__ */ jsx(\n AlertDialog.Overlay,\n {\n ref,\n backgroundColor: dialogScrim,\n ...transitionProps(scrimFor(knobProps.motion.overlay)),\n ...scrimFade,\n ...props,\n children\n }\n );\n});\nconst PopoverContent = forwardRef(\n function PopoverContent2({ children, onOpenAutoFocus: _onOpenAutoFocus, ...props }, ref) {\n const { knobProps } = useResolvedKnobs({ component: \"PopoverContent\", painted: false });\n return /* @__PURE__ */ jsx(\n YStack,\n {\n ref,\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...transitionProps(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n ...props,\n children: /* @__PURE__ */ jsx(Surface, { painted: false, elevated: true, children: /* @__PURE__ */ jsx(SheetBodyContext.Provider, { value: false, children }) })\n }\n );\n }\n);\nexport {\n AlertDialogContent,\n AlertDialogOverlay,\n DialogContent,\n DialogOverlay,\n DialogRegionContext,\n DialogSheetFaceProvider,\n DialogShowFocus,\n PopoverContent,\n SheetBodyProvider,\n dialogScrim,\n overlayScrim,\n sheetGrabber,\n sheetGrabberClearance,\n sheetGrabberZone,\n sheetHandle,\n sheetHandleTone,\n sheetHandleWidthRatio,\n sheetHandleZone,\n sheetScrim,\n useDialogRegionContext,\n useDialogSheetFace,\n useIsInDialogRegion,\n useIsInSheetBody\n};\n//# sourceMappingURL=overlaySurfaces.js.map\n"],"mappings":";;;;;;;;;;;;;AAkBA,MAAM,cAAc;AACpB,MAAM,aAAa;AACnB,MAAM,eAAe;AACrB,MAAM,eAAe;CACnB,OAAO;CACP,QAAQ;CACR,cAAc;CACd,iBAAiB;CACjB,SAAS;CACT,WAAW;CACX,kBAAkB;CAClB,WAAW;CACX,cAAc,CAAC;CACf,QAAQ;AACV;AACA,MAAM,wBAAwB;AAC9B,MAAM,mBAAmB;CACvB,WAAW;CACX,YAAY;CACZ,QAAQ;AACV;AACA,MAAM,wBAAwB;AAC9B,MAAM,cAAc;CAClB,OAAO;CACP,QAAQ;CACR,cAAc;CACd,iBAAiB;CACjB,SAAS;CACT,WAAW;CACX,kBAAkB;CAClB,WAAW;CACX,cAAc;CACd,QAAQ;AACV;AACA,MAAM,kBAAkB;CACtB,WAAW;CACX,YAAY;CACZ,YAAY;AACd;AACA,MAAM,sBAAsB;CAAE,iBAAiB;CAAY,SAAS;AAAE;AACtE,SAAS,gBAAgB,SAAS;CAChC,OAAO;AACT;AACA,MAAM,oBAAoB;CACxB,cAAc;EAAE,SAAS;EAAG,OAAO;EAAG,iBAAiB;CAAE;CACzD,cAAc;EAAE,SAAS;EAAQ,OAAO;EAAQ,iBAAiB;CAAO;AAC1E;AACA,SAAS,iBAAiB,MA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GAAG,UAAU;EACb,GAAG,UAAU;EACb,SAAS;EACT,GAAG,gBAAgB,UAAU,OAAO,OAAO;EAC3C,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,UAA0B,oBAAI,oBAAoB,UAAU;GAAE,OAAO;GAAkB,UAA0B,oBAAI,iBAAiB,UAAU;IAAE,OAAO;IAAO;GAAS,CAAC;EAAE,CAAC;CAC/K,CACF;AACF,CAAC;AACD,MAAM,qBAAqB,WAAW,SAAS,oBAAoB,EAAE,UAAU,GAAG,SAAS,KAAK;CAC9F,MAAM,EAAE,cAAc,iBAAiB;CACvC,OAAuB,oBACrB,YAAY,SACZ;EACE;EACA,iBAAiB;EACjB,GAAG,gBAAgB,SAAS,UAAU,OAAO,OAAO,CAAC;EACrD,GAAG;EACH,GAAG;EACH;CACF,CACF;AACF,CAAC;AACD,MAAM,iBAAiB,WACrB,SAAS,gBAAgB,EAAE,UAAU,iBAAiB,kBAAkB,GAAG,SAAS,KAAK;CACvF,MAAM,EAAE,cAAc,iBAAiB;EAAE,WAAW;EAAkB,SAAS;CAAM,CAAC;CACtF,OAAuB,oBACrB,QACA;EACE;EACA,GAAG,UAAU;EACb,GAAG,UAAU;EACb,GAAG,gBAAgB,UAAU,OAAO,OAAO;EAC3C,GAAG;EACH,GAAG;EACH,GAAG;EACH,UAA0B,oBAAI,SAAS;GAAE,SAAS;GAAO,UAAU;GAAM,UAA0B,oBAAI,iBAAiB,UAAU;IAAE,OAAO;IAAO;GAAS,CAAC;EAAE,CAAC;CACjK,CACF;AACF,CACF"}
1
+ {"version":3,"file":"overlaySurfaces.js","names":[],"sources":["esm/theme/overlaySurfaces.js"],"sourcesContent":["import { focusOnOpen } from \"../keyboardFocusRing\";\nimport { scrimFor } from \"./motion\";\nimport { transitionProps } from \"./transitionProps\";\nimport { Surface } from \"./Surface\";\nimport { useResolvedKnobs } from \"./useResolvedKnobs\";\nimport { ALERT_READABLE_WIDTH } from \"./layoutTokens\";\nimport { panelPaddingPx } from \"./resolveKnobs\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport {\n AlertDialog,\n Dialog,\n useDialogContext,\n useWindowDimensions,\n YStack\n} from \"tamagui\";\nimport { jsx } from \"react/jsx-runtime\";\nconst dialogScrim = \"$scrim-dialog\";\nconst sheetScrim = \"$scrim-sheet\";\nconst overlayScrim = dialogScrim;\nconst 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};\nconst sheetGrabberClearance = 16;\nconst sheetGrabberZone = {\n alignSelf: \"stretch\",\n alignItems: \"center\",\n height: 21\n};\nconst sheetHandleWidthRatio = 0.3;\nconst 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};\nconst sheetHandleZone = {\n alignSelf: \"stretch\",\n alignItems: \"center\",\n paddingTop: 0,\n height: 21\n};\nconst sheetHandleToneOpen = { backgroundColor: \"$color-12\", opacity: 0.3 };\nfunction sheetHandleTone(_scheme) {\n return sheetHandleToneOpen;\n}\nconst overlayFrameFocus = {\n outlineWidth: { default: 0, focus: 0, \"focus-visible\": 0 },\n outlineStyle: { default: \"none\", focus: \"none\", \"focus-visible\": \"none\" }\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 (let 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 const first = Array.from(container.querySelectorAll(\"*\")).find(\n (node) => isTabbableWithin(node, container)\n );\n if (!first) return;\n details.cancel();\n const focused = focusOnOpen(first, container);\n if (typeof HTMLInputElement !== \"undefined\" && focused instanceof HTMLInputElement) {\n focused.select();\n }\n}\nfunction withHouseOpenFocus(onOpenAutoFocus, contentId) {\n return (details) => {\n 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}\nconst DialogRegionContext = createContext({\n inDialogRegion: false\n});\nfunction useDialogRegionContext() {\n return useContext(DialogRegionContext);\n}\nfunction useIsInDialogRegion() {\n return useDialogRegionContext().inDialogRegion;\n}\nconst IN_DIALOG_REGION = { inDialogRegion: true };\nconst SheetBodyContext = createContext(false);\nconst SheetBodyInsetContext = createContext(0);\nconst SheetBodyInsetProvider = SheetBodyInsetContext.Provider;\nfunction useSheetBodyInset() {\n return useContext(SheetBodyInsetContext);\n}\nconst SheetBodyProvider = SheetBodyContext.Provider;\nfunction useIsInSheetBody() {\n return useContext(SheetBodyContext);\n}\nconst DialogSheetFaceContext = createContext(false);\nconst DialogSheetFaceProvider = DialogSheetFaceContext.Provider;\nfunction useDialogSheetFace() {\n return useContext(DialogSheetFaceContext);\n}\nconst DialogSheetBody = forwardRef(\n function DialogSheetBody2({ children }, ref) {\n const { knobProps } = useResolvedKnobs({ component: \"DialogContent\" });\n return /* @__PURE__ */ jsx(YStack, { ref, ...knobProps.gap, ...{ \"data-mp-dialog-face\": \"sheet\" }, children: /* @__PURE__ */ jsx(DialogSheetFaceContext.Provider, { value: false, children: /* @__PURE__ */ jsx(DialogRegionContext.Provider, { value: IN_DIALOG_REGION, children }) }) });\n }\n);\nconst overlayEnterExit = {\n opacity: { enter: 0, exit: 0 },\n y: { enter: -4, exit: -4 },\n scale: { enter: 0.97, exit: 0.97 }\n};\nconst DialogContent = forwardRef(function DialogContent2({ children, size = \"4\", ...props }, ref) {\n if (useDialogSheetFace()) return /* @__PURE__ */ jsx(DialogSheetBody, { ref, children });\n return /* @__PURE__ */ jsx(Surface, { size, painted: false, elevated: true, children: /* @__PURE__ */ jsx(DialogContentInner, { ref, ...props, children }) });\n});\nfunction useWindowFit(props, fallbackMaxWidth) {\n const { width: windowWidth } = useWindowDimensions();\n const room = windowWidth > 0 ? Math.max(0, windowWidth - 2 * panelPaddingPx()) : void 0;\n const fit = (value) => room != null && typeof value === \"number\" ? Math.min(value, room) : value;\n if (room == null) return fallbackMaxWidth == null ? void 0 : { maxWidth: fallbackMaxWidth };\n return {\n maxWidth: fit(props.maxWidth ?? fallbackMaxWidth ?? room),\n ...props.minWidth != null ? { minWidth: fit(props.minWidth) } : void 0,\n ...props.width != null ? { width: fit(props.width) } : void 0\n };\n}\nconst DialogContentInner = forwardRef(function DialogContentInner2({ children, onOpenAutoFocus, ...props }, ref) {\n const { knobProps } = useResolvedKnobs({ component: \"DialogContent\" });\n const { contentId } = useDialogContext();\n const openFocus = withHouseOpenFocus(onOpenAutoFocus, contentId);\n const windowFit = useWindowFit(props);\n return /* @__PURE__ */ jsx(\n Dialog.Content,\n {\n ref,\n position: \"relative\",\n pointerEvents: \"auto\",\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...knobProps.panelPadding,\n ...knobProps.gap,\n elevate: false,\n ...transitionProps(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n onOpenAutoFocus: openFocus,\n ...props,\n ...windowFit,\n children: /* @__PURE__ */ jsx(DialogRegionContext.Provider, { value: IN_DIALOG_REGION, children: /* @__PURE__ */ jsx(SheetBodyContext.Provider, { value: false, children }) })\n }\n );\n});\nconst scrimFade = { opacity: { enter: 0, exit: 0 } };\nconst DialogOverlay = forwardRef(function DialogOverlay2({ children, ...props }, ref) {\n const { knobProps } = useResolvedKnobs();\n const sheetFace = useDialogSheetFace();\n if (sheetFace) return null;\n return /* @__PURE__ */ jsx(\n Dialog.Overlay,\n {\n ref,\n backgroundColor: dialogScrim,\n ...transitionProps(scrimFor(knobProps.motion.overlay)),\n ...scrimFade,\n ...props,\n children\n }\n );\n});\nconst AlertDialogContent = forwardRef(\n function AlertDialogContent2({ children, size = \"4\", ...props }, ref) {\n return /* @__PURE__ */ jsx(Surface, { size, painted: false, elevated: true, children: /* @__PURE__ */ jsx(AlertDialogContentInner, { ref, ...props, children }) });\n }\n);\nconst AlertDialogContentInner = forwardRef(function AlertDialogContentInner2({ children, ...props }, ref) {\n const { knobProps } = useResolvedKnobs({ component: \"AlertDialogContent\" });\n const windowFit = useWindowFit(props, ALERT_READABLE_WIDTH);\n return /* @__PURE__ */ jsx(\n AlertDialog.Content,\n {\n ref,\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...knobProps.panelPadding,\n ...knobProps.gap,\n elevate: false,\n ...transitionProps(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n ...props,\n ...windowFit,\n children: /* @__PURE__ */ jsx(DialogRegionContext.Provider, { value: IN_DIALOG_REGION, children: /* @__PURE__ */ jsx(SheetBodyContext.Provider, { value: false, children }) })\n }\n );\n});\nconst AlertDialogOverlay = forwardRef(function AlertDialogOverlay2({ children, ...props }, ref) {\n const { knobProps } = useResolvedKnobs();\n return /* @__PURE__ */ jsx(\n AlertDialog.Overlay,\n {\n ref,\n backgroundColor: dialogScrim,\n ...transitionProps(scrimFor(knobProps.motion.overlay)),\n ...scrimFade,\n ...props,\n children\n }\n );\n});\nconst PopoverContent = forwardRef(\n function PopoverContent2({ children, onOpenAutoFocus: _onOpenAutoFocus, ...props }, ref) {\n const { knobProps } = useResolvedKnobs({ component: \"PopoverContent\", painted: false });\n return /* @__PURE__ */ jsx(\n YStack,\n {\n ref,\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...transitionProps(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n ...props,\n children: /* @__PURE__ */ jsx(Surface, { painted: false, elevated: true, children: /* @__PURE__ */ jsx(SheetBodyContext.Provider, { value: false, children }) })\n }\n );\n }\n);\nexport {\n AlertDialogContent,\n AlertDialogOverlay,\n DialogContent,\n DialogOverlay,\n DialogRegionContext,\n DialogSheetFaceProvider,\n PopoverContent,\n SheetBodyInsetProvider,\n SheetBodyProvider,\n dialogScrim,\n overlayScrim,\n sheetGrabber,\n sheetGrabberClearance,\n sheetGrabberZone,\n sheetHandle,\n sheetHandleTone,\n sheetHandleWidthRatio,\n sheetHandleZone,\n sheetScrim,\n useDialogRegionContext,\n useDialogSheetFace,\n useIsInDialogRegion,\n useIsInSheetBody,\n useSheetBodyInset\n};\n//# sourceMappingURL=overlaySurfaces.js.map\n"],"mappings":";;;;;;;;;;;;AAgBA,MAAM,cAAc;AACpB,MAAM,aAAa;AACnB,MAAM,eAAe;AACrB,MAAM,eAAe;CACnB,OAAO;CACP,QAAQ;CACR,cAAc;CACd,iBAAiB;CACjB,SAAS;CACT,WAAW;CACX,kBAAkB;CAClB,WAAW;CACX,cAAc,CAAC;CACf,QAAQ;AACV;AACA,MAAM,wBAAwB;AAC9B,MAAM,mBAAmB;CACvB,WAAW;CACX,YAAY;CACZ,QAAQ;AACV;AACA,MAAM,wBAAwB;AAC9B,MAAM,cAAc;CAClB,OAAO;CACP,QAAQ;CACR,cAAc;CACd,iBAAiB;CACjB,SAAS;CACT,WAAW;CACX,kBAAkB;CAClB,WAAW;CACX,cAAc,CAAC;CACf,QAAQ;AACV;AACA,MAAM,kBAAkB;CACtB,WAAW;CACX,YAAY;CACZ,YAAY;CACZ,QAAQ;AACV;AACA,MAAM,sBAAsB;CAAE,iBAAiB;CAAa,SAAS;AAAI;AACzE,SAAS,gBAAgB,SAAS;CAChC,OAAO;AACT;AACA,MAAM,oBAAoB;CACxB,cAAc;EAAE,SAAS;EAAG,OAAO;EAAG,iBAAiB;CAAE;CACzD,cAAc;EAAE,SAAS;EAAQ,OAAO;E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EACH;CACF,CACF;AACF,CAAC;AACD,MAAM,iBAAiB,WACrB,SAAS,gBAAgB,EAAE,UAAU,iBAAiB,kBAAkB,GAAG,SAAS,KAAK;CACvF,MAAM,EAAE,cAAc,iBAAiB;EAAE,WAAW;EAAkB,SAAS;CAAM,CAAC;CACtF,OAAuB,oBACrB,QACA;EACE;EACA,GAAG,UAAU;EACb,GAAG,UAAU;EACb,GAAG,gBAAgB,UAAU,OAAO,OAAO;EAC3C,GAAG;EACH,GAAG;EACH,GAAG;EACH,UAA0B,oBAAI,SAAS;GAAE,SAAS;GAAO,UAAU;GAAM,UAA0B,oBAAI,iBAAiB,UAAU;IAAE,OAAO;IAAO;GAAS,CAAC;EAAE,CAAC;CACjK,CACF;AACF,CACF"}
@@ -1,14 +1,13 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { focusOnOpen, wasKeyboardFocus } from "../keyboardFocusRing.native.js";
2
+ import { focusOnOpen } from "../keyboardFocusRing.native.js";
3
3
  import { scrimFor } from "./motion.native.js";
4
4
  import { transitionProps } from "./transitionProps.native.js";
5
5
  import { Surface } from "./Surface.native.js";
6
6
  import { useResolvedKnobs } from "./useResolvedKnobs.native.js";
7
7
  import { ALERT_READABLE_WIDTH } from "./layoutTokens.native.js";
8
8
  import { panelPaddingPx } from "./resolveKnobs.native.js";
9
- import { createContext, forwardRef, useContext, useEffect } from "react";
10
- import { createChangeEventDetails } from "@tamagui/web";
11
- import { AlertDialog, Dialog, YStack, isWeb, useDialogContext, useWindowDimensions } from "tamagui";
9
+ import { createContext, forwardRef, useContext } from "react";
10
+ import { AlertDialog, Dialog, YStack, useDialogContext, useWindowDimensions } from "tamagui";
12
11
 
13
12
  var dialogScrim = "$scrim-dialog";
14
13
  var sheetScrim = "$scrim-sheet";
@@ -33,25 +32,26 @@ var sheetGrabberZone = {
33
32
  };
34
33
  var sheetHandleWidthRatio = .3;
35
34
  var sheetHandle = {
36
- width: "30%",
37
- height: 10,
35
+ width: 36,
36
+ height: 5,
38
37
  borderRadius: 100,
39
- backgroundColor: "$color-5",
40
- opacity: 1,
38
+ backgroundColor: "$color-12",
39
+ opacity: .3,
41
40
  alignSelf: "center",
42
41
  marginHorizontal: 0,
43
- marginTop: 0,
44
- marginBottom: 8,
42
+ marginTop: 5,
43
+ marginBottom: -10,
45
44
  zIndex: 10
46
45
  };
47
46
  var sheetHandleZone = {
48
47
  alignSelf: "stretch",
49
48
  alignItems: "center",
50
- paddingTop: 8
49
+ paddingTop: 0,
50
+ height: 21
51
51
  };
52
52
  var sheetHandleToneOpen = {
53
- backgroundColor: "$color-5",
54
- opacity: 1
53
+ backgroundColor: "$color-12",
54
+ opacity: .3
55
55
  };
56
56
  function sheetHandleTone(_scheme) {
57
57
  return sheetHandleToneOpen;
@@ -102,23 +102,6 @@ function contentById(contentId) {
102
102
  if (!contentId || typeof document === "undefined") return null;
103
103
  return document.getElementById(contentId);
104
104
  }
105
- function useDialogShowFocus(onOpenAutoFocus) {
106
- var { open, contentId } = useDialogContext();
107
- useEffect(function() {
108
- if (!open || !contentId || !isWeb || typeof document === "undefined") return;
109
- var content = document.getElementById(contentId);
110
- var focused = document.activeElement;
111
- if (!content || typeof HTMLElement === "undefined" || !(focused instanceof HTMLElement)) return;
112
- if (!content.contains(focused) || focused.tabIndex >= 0 && wasKeyboardFocus()) return;
113
- onOpenAutoFocus(createChangeEventDetails("trigger-focus"));
114
- }, [open, contentId]);
115
- }
116
- function DialogShowFocus(param) {
117
- var { onOpenAutoFocus } = param;
118
- var { contentId } = useDialogContext();
119
- useDialogShowFocus(withHouseOpenFocus(onOpenAutoFocus, contentId));
120
- return null;
121
- }
122
105
  var DialogRegionContext = /* @__PURE__ */ createContext({ inDialogRegion: false });
123
106
  function useDialogRegionContext() {
124
107
  return useContext(DialogRegionContext);
@@ -128,6 +111,11 @@ function useIsInDialogRegion() {
128
111
  }
129
112
  var IN_DIALOG_REGION = { inDialogRegion: true };
130
113
  var SheetBodyContext = /* @__PURE__ */ createContext(false);
114
+ var SheetBodyInsetContext = /* @__PURE__ */ createContext(0);
115
+ var SheetBodyInsetProvider = SheetBodyInsetContext.Provider;
116
+ function useSheetBodyInset() {
117
+ return useContext(SheetBodyInsetContext);
118
+ }
131
119
  var SheetBodyProvider = SheetBodyContext.Provider;
132
120
  function useIsInSheetBody() {
133
121
  return useContext(SheetBodyContext);
@@ -203,7 +191,6 @@ var DialogContentInner = /* @__PURE__ */ forwardRef(function DialogContentInner2
203
191
  var { knobProps } = useResolvedKnobs({ component: "DialogContent" });
204
192
  var { contentId } = useDialogContext();
205
193
  var openFocus = withHouseOpenFocus(onOpenAutoFocus, contentId);
206
- useDialogShowFocus(openFocus);
207
194
  var windowFit = useWindowFit(props);
208
195
  return /* @__PURE__ */ jsx(Dialog.Content, {
209
196
  ref,
@@ -263,8 +250,6 @@ var AlertDialogContent = /* @__PURE__ */ forwardRef(function AlertDialogContent2
263
250
  var AlertDialogContentInner = /* @__PURE__ */ forwardRef(function AlertDialogContentInner2(param, ref) {
264
251
  var { children, ...props } = param;
265
252
  var { knobProps } = useResolvedKnobs({ component: "AlertDialogContent" });
266
- var { contentId } = useDialogContext();
267
- useDialogShowFocus(withHouseOpenFocus(props.onOpenAutoFocus, contentId));
268
253
  var windowFit = useWindowFit(props, ALERT_READABLE_WIDTH);
269
254
  return /* @__PURE__ */ jsx(AlertDialog.Content, {
270
255
  ref,
@@ -324,5 +309,5 @@ var PopoverContent = /* @__PURE__ */ forwardRef(function PopoverContent2(param,
324
309
  });
325
310
  });
326
311
 
327
- export { AlertDialogContent, AlertDialogOverlay, DialogContent, DialogOverlay, DialogRegionContext, DialogSheetFaceProvider, DialogShowFocus, PopoverContent, SheetBodyProvider, dialogScrim, overlayScrim, sheetGrabber, sheetGrabberClearance, sheetGrabberZone, sheetHandle, sheetHandleTone, sheetHandleWidthRatio, sheetHandleZone, sheetScrim, useDialogRegionContext, useDialogSheetFace, useIsInDialogRegion, useIsInSheetBody };
312
+ export { AlertDialogContent, AlertDialogOverlay, DialogContent, DialogOverlay, DialogRegionContext, DialogSheetFaceProvider, PopoverContent, SheetBodyInsetProvider, SheetBodyProvider, dialogScrim, overlayScrim, sheetGrabber, sheetGrabberClearance, sheetGrabberZone, sheetHandle, sheetHandleTone, sheetHandleWidthRatio, sheetHandleZone, sheetScrim, useDialogRegionContext, useDialogSheetFace, useIsInDialogRegion, useIsInSheetBody, useSheetBodyInset };
328
313
  //# sourceMappingURL=overlaySurfaces.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"overlaySurfaces.native.js","names":[],"sources":["esm/theme/overlaySurfaces.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { focusOnOpen, wasKeyboardFocus } from \"../keyboardFocusRing\";\nimport { scrimFor } from \"./motion\";\nimport { transitionProps } from \"./transitionProps\";\nimport { Surface } from \"./Surface\";\nimport { useResolvedKnobs } from \"./useResolvedKnobs\";\nimport { ALERT_READABLE_WIDTH } from \"./layoutTokens\";\nimport { panelPaddingPx } from \"./resolveKnobs\";\nimport { createContext, forwardRef, useContext, useEffect } from \"react\";\nimport { createChangeEventDetails } from \"@tamagui/web\";\nimport { AlertDialog, Dialog, isWeb, useDialogContext, useWindowDimensions, YStack } from \"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 = 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 } = useDialogContext();\n useEffect(function() {\n if (!open || !contentId || !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 && wasKeyboardFocus()) return;\n onOpenAutoFocus(createChangeEventDetails(\"trigger-focus\"));\n }, [\n open,\n contentId\n ]);\n}\nfunction DialogShowFocus(param) {\n var { onOpenAutoFocus } = param;\n var { contentId } = useDialogContext();\n useDialogShowFocus(withHouseOpenFocus(onOpenAutoFocus, contentId));\n return null;\n}\nvar DialogRegionContext = /* @__PURE__ */ createContext({\n inDialogRegion: false\n});\nfunction useDialogRegionContext() {\n return useContext(DialogRegionContext);\n}\nfunction useIsInDialogRegion() {\n return useDialogRegionContext().inDialogRegion;\n}\nvar IN_DIALOG_REGION = {\n inDialogRegion: true\n};\nvar SheetBodyContext = /* @__PURE__ */ createContext(false);\nvar SheetBodyProvider = SheetBodyContext.Provider;\nfunction useIsInSheetBody() {\n return useContext(SheetBodyContext);\n}\nvar DialogSheetFaceContext = /* @__PURE__ */ createContext(false);\nvar DialogSheetFaceProvider = DialogSheetFaceContext.Provider;\nfunction useDialogSheetFace() {\n return useContext(DialogSheetFaceContext);\n}\nvar DialogSheetBody = /* @__PURE__ */ forwardRef(function DialogSheetBody2(param, ref) {\n var { children } = param;\n var { knobProps } = useResolvedKnobs({\n component: \"DialogContent\"\n });\n return /* @__PURE__ */ _jsx(YStack, {\n ref,\n ...knobProps.gap,\n ...{\n \"data-mp-dialog-face\": \"sheet\"\n },\n children: /* @__PURE__ */ _jsx(DialogSheetFaceContext.Provider, {\n value: false,\n children: /* @__PURE__ */ _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__ */ forwardRef(function DialogContent2(param, ref) {\n var { children, size = \"4\", ...props } = param;\n if (useDialogSheetFace()) return /* @__PURE__ */ _jsx(DialogSheetBody, {\n ref,\n children\n });\n return /* @__PURE__ */ _jsx(Surface, {\n size,\n painted: false,\n elevated: true,\n children: /* @__PURE__ */ _jsx(DialogContentInner, {\n ref,\n ...props,\n children\n })\n });\n});\nfunction useWindowFit(props, fallbackMaxWidth) {\n var _ref, _props_maxWidth;\n var { width: windowWidth } = useWindowDimensions();\n var room = windowWidth > 0 ? Math.max(0, windowWidth - 2 * 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__ */ forwardRef(function DialogContentInner2(param, ref) {\n var { children, onOpenAutoFocus, ...props } = param;\n var { knobProps } = useResolvedKnobs({\n component: \"DialogContent\"\n });\n var { contentId } = useDialogContext();\n var openFocus = withHouseOpenFocus(onOpenAutoFocus, contentId);\n useDialogShowFocus(openFocus);\n var windowFit = useWindowFit(props);\n return /* @__PURE__ */ _jsx(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 ...transitionProps(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n onOpenAutoFocus: openFocus,\n ...props,\n ...windowFit,\n children: /* @__PURE__ */ _jsx(DialogRegionContext.Provider, {\n value: IN_DIALOG_REGION,\n children: /* @__PURE__ */ _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__ */ forwardRef(function DialogOverlay2(param, ref) {\n var { children, ...props } = param;\n var { knobProps } = useResolvedKnobs();\n var sheetFace = useDialogSheetFace();\n if (sheetFace) return null;\n return /* @__PURE__ */ _jsx(Dialog.Overlay, {\n ref,\n backgroundColor: dialogScrim,\n ...transitionProps(scrimFor(knobProps.motion.overlay)),\n ...scrimFade,\n ...props,\n children\n });\n});\nvar AlertDialogContent = /* @__PURE__ */ forwardRef(function AlertDialogContent2(param, ref) {\n var { children, size = \"4\", ...props } = param;\n return /* @__PURE__ */ _jsx(Surface, {\n size,\n painted: false,\n elevated: true,\n children: /* @__PURE__ */ _jsx(AlertDialogContentInner, {\n ref,\n ...props,\n children\n })\n });\n});\nvar AlertDialogContentInner = /* @__PURE__ */ forwardRef(function AlertDialogContentInner2(param, ref) {\n var { children, ...props } = param;\n var { knobProps } = useResolvedKnobs({\n component: \"AlertDialogContent\"\n });\n var { contentId } = useDialogContext();\n useDialogShowFocus(withHouseOpenFocus(props.onOpenAutoFocus, contentId));\n var windowFit = useWindowFit(props, ALERT_READABLE_WIDTH);\n return /* @__PURE__ */ _jsx(AlertDialog.Content, {\n ref,\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...knobProps.panelPadding,\n ...knobProps.gap,\n elevate: false,\n ...transitionProps(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n ...props,\n ...windowFit,\n children: /* @__PURE__ */ _jsx(DialogRegionContext.Provider, {\n value: IN_DIALOG_REGION,\n children: /* @__PURE__ */ _jsx(SheetBodyContext.Provider, {\n value: false,\n children\n })\n })\n });\n});\nvar AlertDialogOverlay = /* @__PURE__ */ forwardRef(function AlertDialogOverlay2(param, ref) {\n var { children, ...props } = param;\n var { knobProps } = useResolvedKnobs();\n return /* @__PURE__ */ _jsx(AlertDialog.Overlay, {\n ref,\n backgroundColor: dialogScrim,\n ...transitionProps(scrimFor(knobProps.motion.overlay)),\n ...scrimFade,\n ...props,\n children\n });\n});\nvar PopoverContent = /* @__PURE__ */ forwardRef(function PopoverContent2(param, ref) {\n var { children, onOpenAutoFocus: _onOpenAutoFocus, ...props } = param;\n var { knobProps } = useResolvedKnobs({\n component: \"PopoverContent\",\n painted: false\n });\n return /* @__PURE__ */ _jsx(YStack, {\n ref,\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...transitionProps(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n ...props,\n children: /* @__PURE__ */ _jsx(Surface, {\n painted: false,\n elevated: true,\n children: /* @__PURE__ */ _jsx(SheetBodyContext.Provider, {\n value: false,\n children\n })\n })\n });\n});\nexport {\n AlertDialogContent,\n AlertDialogOverlay,\n DialogContent,\n DialogOverlay,\n DialogRegionContext,\n DialogSheetFaceProvider,\n DialogShowFocus,\n PopoverContent,\n SheetBodyProvider,\n dialogScrim,\n overlayScrim,\n sheetGrabber,\n sheetGrabberClearance,\n sheetGrabberZone,\n sheetHandle,\n sheetHandleTone,\n sheetHandleWidthRatio,\n sheetHandleZone,\n sheetScrim,\n useDialogRegionContext,\n useDialogSheetFace,\n useIsInDialogRegion,\n useIsInSheetBody\n};\n//# sourceMappingURL=overlaySurfaces.js.map\n"],"mappings":";;;;;;;;;;;;;AAWA,IAAI,cAAc;AAClB,IAAI,aAAa;AACjB,IAAI,eAAe;AACnB,IAAI,eAAe;CACjB,OAAO;CACP,QAAQ;CACR,cAAc;CACd,iBAAiB;CACjB,SAAS;CACT,WAAW;CACX,kBAAkB;CAClB,WAAW;CACX,cAAc,CAAC;CACf,QAAQ;AACV;AACA,IAAI,wBAAwB;AAC5B,IAAI,mBAAmB;CACrB,WAAW;CACX,YAAY;CACZ,QAAQ;AACV;AACA,IAAI,wBAAwB;AAC5B,IAAI,cAAc;CAChB,OAAO;CACP,QAAQ;CACR,cAAc;CACd,iBAAiB;CACjB,SAAS;CACT,WAAW;CACX,kBAAkB;CAClB,WAAW;CACX,cAAc;CACd,QAAQ;AACV;AACA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IAAI,EAAE,cAAc,iBAAiB;EACnC,WAAW;EACX,SAAS;CACX,CAAC;CACD,OAAuB,oBAAK,QAAQ;EAClC;EACA,GAAG,UAAU;EACb,GAAG,UAAU;EACb,GAAG,gBAAgB,UAAU,OAAO,OAAO;EAC3C,GAAG;EACH,GAAG;EACH,GAAG;EACH,UAA0B,oBAAK,SAAS;GACtC,SAAS;GACT,UAAU;GACV,UAA0B,oBAAK,iBAAiB,UAAU;IACxD,OAAO;IACP;GACF,CAAC;EACH,CAAC;CACH,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"overlaySurfaces.native.js","names":[],"sources":["esm/theme/overlaySurfaces.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { focusOnOpen } from \"../keyboardFocusRing\";\nimport { scrimFor } from \"./motion\";\nimport { transitionProps } from \"./transitionProps\";\nimport { Surface } from \"./Surface\";\nimport { useResolvedKnobs } from \"./useResolvedKnobs\";\nimport { ALERT_READABLE_WIDTH } from \"./layoutTokens\";\nimport { panelPaddingPx } from \"./resolveKnobs\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport { AlertDialog, Dialog, useDialogContext, useWindowDimensions, YStack } from \"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 = 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__ */ createContext({\n inDialogRegion: false\n});\nfunction useDialogRegionContext() {\n return useContext(DialogRegionContext);\n}\nfunction useIsInDialogRegion() {\n return useDialogRegionContext().inDialogRegion;\n}\nvar IN_DIALOG_REGION = {\n inDialogRegion: true\n};\nvar SheetBodyContext = /* @__PURE__ */ createContext(false);\nvar SheetBodyInsetContext = /* @__PURE__ */ createContext(0);\nvar SheetBodyInsetProvider = SheetBodyInsetContext.Provider;\nfunction useSheetBodyInset() {\n return useContext(SheetBodyInsetContext);\n}\nvar SheetBodyProvider = SheetBodyContext.Provider;\nfunction useIsInSheetBody() {\n return useContext(SheetBodyContext);\n}\nvar DialogSheetFaceContext = /* @__PURE__ */ createContext(false);\nvar DialogSheetFaceProvider = DialogSheetFaceContext.Provider;\nfunction useDialogSheetFace() {\n return useContext(DialogSheetFaceContext);\n}\nvar DialogSheetBody = /* @__PURE__ */ forwardRef(function DialogSheetBody2(param, ref) {\n var { children } = param;\n var { knobProps } = useResolvedKnobs({\n component: \"DialogContent\"\n });\n return /* @__PURE__ */ _jsx(YStack, {\n ref,\n ...knobProps.gap,\n ...{\n \"data-mp-dialog-face\": \"sheet\"\n },\n children: /* @__PURE__ */ _jsx(DialogSheetFaceContext.Provider, {\n value: false,\n children: /* @__PURE__ */ _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__ */ forwardRef(function DialogContent2(param, ref) {\n var { children, size = \"4\", ...props } = param;\n if (useDialogSheetFace()) return /* @__PURE__ */ _jsx(DialogSheetBody, {\n ref,\n children\n });\n return /* @__PURE__ */ _jsx(Surface, {\n size,\n painted: false,\n elevated: true,\n children: /* @__PURE__ */ _jsx(DialogContentInner, {\n ref,\n ...props,\n children\n })\n });\n});\nfunction useWindowFit(props, fallbackMaxWidth) {\n var _ref, _props_maxWidth;\n var { width: windowWidth } = useWindowDimensions();\n var room = windowWidth > 0 ? Math.max(0, windowWidth - 2 * 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__ */ forwardRef(function DialogContentInner2(param, ref) {\n var { children, onOpenAutoFocus, ...props } = param;\n var { knobProps } = useResolvedKnobs({\n component: \"DialogContent\"\n });\n var { contentId } = useDialogContext();\n var openFocus = withHouseOpenFocus(onOpenAutoFocus, contentId);\n var windowFit = useWindowFit(props);\n return /* @__PURE__ */ _jsx(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 ...transitionProps(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n onOpenAutoFocus: openFocus,\n ...props,\n ...windowFit,\n children: /* @__PURE__ */ _jsx(DialogRegionContext.Provider, {\n value: IN_DIALOG_REGION,\n children: /* @__PURE__ */ _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__ */ forwardRef(function DialogOverlay2(param, ref) {\n var { children, ...props } = param;\n var { knobProps } = useResolvedKnobs();\n var sheetFace = useDialogSheetFace();\n if (sheetFace) return null;\n return /* @__PURE__ */ _jsx(Dialog.Overlay, {\n ref,\n backgroundColor: dialogScrim,\n ...transitionProps(scrimFor(knobProps.motion.overlay)),\n ...scrimFade,\n ...props,\n children\n });\n});\nvar AlertDialogContent = /* @__PURE__ */ forwardRef(function AlertDialogContent2(param, ref) {\n var { children, size = \"4\", ...props } = param;\n return /* @__PURE__ */ _jsx(Surface, {\n size,\n painted: false,\n elevated: true,\n children: /* @__PURE__ */ _jsx(AlertDialogContentInner, {\n ref,\n ...props,\n children\n })\n });\n});\nvar AlertDialogContentInner = /* @__PURE__ */ forwardRef(function AlertDialogContentInner2(param, ref) {\n var { children, ...props } = param;\n var { knobProps } = useResolvedKnobs({\n component: \"AlertDialogContent\"\n });\n var windowFit = useWindowFit(props, ALERT_READABLE_WIDTH);\n return /* @__PURE__ */ _jsx(AlertDialog.Content, {\n ref,\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...knobProps.panelPadding,\n ...knobProps.gap,\n elevate: false,\n ...transitionProps(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n ...props,\n ...windowFit,\n children: /* @__PURE__ */ _jsx(DialogRegionContext.Provider, {\n value: IN_DIALOG_REGION,\n children: /* @__PURE__ */ _jsx(SheetBodyContext.Provider, {\n value: false,\n children\n })\n })\n });\n});\nvar AlertDialogOverlay = /* @__PURE__ */ forwardRef(function AlertDialogOverlay2(param, ref) {\n var { children, ...props } = param;\n var { knobProps } = useResolvedKnobs();\n return /* @__PURE__ */ _jsx(AlertDialog.Overlay, {\n ref,\n backgroundColor: dialogScrim,\n ...transitionProps(scrimFor(knobProps.motion.overlay)),\n ...scrimFade,\n ...props,\n children\n });\n});\nvar PopoverContent = /* @__PURE__ */ forwardRef(function PopoverContent2(param, ref) {\n var { children, onOpenAutoFocus: _onOpenAutoFocus, ...props } = param;\n var { knobProps } = useResolvedKnobs({\n component: \"PopoverContent\",\n painted: false\n });\n return /* @__PURE__ */ _jsx(YStack, {\n ref,\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...transitionProps(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n ...props,\n children: /* @__PURE__ */ _jsx(Surface, {\n painted: false,\n elevated: true,\n children: /* @__PURE__ */ _jsx(SheetBodyContext.Provider, {\n value: false,\n children\n })\n })\n });\n});\nexport {\n AlertDialogContent,\n AlertDialogOverlay,\n DialogContent,\n DialogOverlay,\n DialogRegionContext,\n DialogSheetFaceProvider,\n PopoverContent,\n SheetBodyInsetProvider,\n SheetBodyProvider,\n dialogScrim,\n overlayScrim,\n sheetGrabber,\n sheetGrabberClearance,\n sheetGrabberZone,\n sheetHandle,\n sheetHandleTone,\n sheetHandleWidthRatio,\n sheetHandleZone,\n sheetScrim,\n useDialogRegionContext,\n useDialogSheetFace,\n useIsInDialogRegion,\n useIsInSheetBody,\n useSheetBodyInset\n};\n//# sourceMappingURL=overlaySurfaces.js.map\n"],"mappings":";;;;;;;;;;;;AAUA,IAAI,cAAc;AAClB,IAAI,aAAa;AACjB,IAAI,eAAe;AACnB,IAAI,eAAe;CACjB,OAAO;CACP,QAAQ;CACR,cAAc;CACd,iBAAiB;CACjB,SAAS;CACT,WAAW;CACX,kBAAkB;CAClB,WAAW;CACX,cAAc,CAAC;CACf,QAAQ;AACV;AACA,IAAI,wBAAwB;AAC5B,IAAI,mBAAmB;CACrB,WAAW;CACX,YAAY;CACZ,QAAQ;AACV;AACA,IAAI,wBAAwB;AAC5B,IAAI,cAAc;CAChB,OAAO;CACP,QAAQ;CACR,cAAc;CACd,iBAAiB;CACjB,SAAS;CACT,WAAW;CACX,kBAAkB;CAClB,WAAW;CACX,cAAc,CAAC;CACf,QAAQ;AACV;AACA,IAAI,kBAAkB;CACpB,WAAW;CACX,YAAY;CACZ,YAAY;CACZ,QAAQ;AACV;AACA,IAAI,sBAAsB;CACxB,iBAAiB;CACjB,SAAS;AACX;AACA,SAAS,gBAAgB,SAAS;CAChC,OAAO;AACT;AACA,IAAI,oBAAoB;CACtB,cAAc;EACZ,SAAS;EACT,OAAO;EACP,iBAAiB;CACnB;CACA,cAAc;EACZ,SAAS;EACT,OAAO;EACP,iBAAiB;CACnB;AACF;AACA,SAAS,iBAAiB,MAAM,WAAW;CACzC,IAAI,KAAK,WAAW,KAAK,KAAK,UAAU,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AU,GAAG,UAAU;CAC7B,IAAI,EAAE,cAAc,iBAAiB;CACrC,OAAuB,oBAAK,YAAY,SAAS;EAC/C;EACA,iBAAiB;EACjB,GAAG,gBAAgB,SAAS,UAAU,OAAO,OAAO,CAAC;EACrD,GAAG;EACH,GAAG;EACH;CACF,CAAC;AACH,CAAC;AACD,IAAI,iBAAiC,2BAAW,SAAS,gBAAgB,OAAO,KAAK;CACnF,IAAI,EAAE,UAAU,iBAAiB,kBAAkB,GAAG,UAAU;CAChE,IAAI,EAAE,cAAc,iBAAiB;EACnC,WAAW;EACX,SAAS;CACX,CAAC;CACD,OAAuB,oBAAK,QAAQ;EAClC;EACA,GAAG,UAAU;EACb,GAAG,UAAU;EACb,GAAG,gBAAgB,UAAU,OAAO,OAAO;EAC3C,GAAG;EACH,GAAG;EACH,GAAG;EACH,UAA0B,oBAAK,SAAS;GACtC,SAAS;GACT,UAAU;GACV,UAA0B,oBAAK,iBAAiB,UAAU;IACxD,OAAO;IACP;GACF,CAAC;EACH,CAAC;CACH,CAAC;AACH,CAAC"}
@@ -42,14 +42,45 @@ function guardTable(table) {
42
42
  guarded.add(proxy);
43
43
  return proxy;
44
44
  }
45
+ function kebabThemeKey(key) {
46
+ return key.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Za-z])(\d)/g, "$1-$2").toLowerCase();
47
+ }
48
+ function themeKeysOf(themes) {
49
+ const keys = /* @__PURE__ */ new Set();
50
+ for (const theme of Object.values(themes ?? {})) {
51
+ for (const key of Object.keys(theme)) keys.add(key);
52
+ }
53
+ return keys;
54
+ }
55
+ function guardColorTable(table, themes) {
56
+ if (guarded.has(table)) return table;
57
+ let keys;
58
+ const proxy = new Proxy(table, { get(target, key, receiver) {
59
+ const value = Reflect.get(target, key, receiver);
60
+ if (value !== void 0 || typeof key !== "string" || key in target) return value;
61
+ const meant = kebabThemeKey(key);
62
+ if (meant === key) return value;
63
+ keys ??= themes();
64
+ if (keys.has(key) || !keys.has(meant)) return value;
65
+ devWarn("unknown-token", {
66
+ component: renderingComponent(),
67
+ value: `$${key}`,
68
+ suggest: `$${meant}`
69
+ });
70
+ return value;
71
+ } });
72
+ guarded.add(proxy);
73
+ return proxy;
74
+ }
45
75
  function guardUnknownTokens(config) {
46
76
  if (process.env.NODE_ENV === "production") return config;
47
- const tables = config.tokensParsed;
77
+ const { tokensParsed: tables, themes } = config;
48
78
  if (!tables) return config;
49
79
  for (const category of guardedCategories) {
50
80
  const table = tables[category];
51
81
  if (table) tables[category] = guardTable(table);
52
82
  }
83
+ if (tables.color) tables.color = guardColorTable(tables.color, () => themeKeysOf(themes));
53
84
  return config;
54
85
  }
55
86
 
@@ -1 +1 @@
1
- {"version":3,"file":"unknownTokenGuard.js","names":[],"sources":["esm/theme/unknownTokenGuard.js"],"sourcesContent":["import * as React from \"react\";\nimport { devWarn } from \"../devWarn\";\nconst guardedCategories = [\"size\", \"space\"];\nconst scaleStep = /^-?\\d+(?:[.-]\\d+)?$/;\nconst guarded = /* @__PURE__ */ new WeakSet();\nfunction ownerNames(stack) {\n const names = [];\n for (const line of stack?.split(\"\\n\") ?? []) {\n const frame = /^\\s*at (?:new )?([\\w$.<>]+) \\(/.exec(line) ?? /^\\s*([\\w$.<>]+)@/.exec(line);\n if (frame) names.push(frame[1]);\n }\n return names;\n}\nfunction ownerName(stack) {\n const [owner, outer] = ownerNames(stack);\n if (!owner) return void 0;\n return outer && /^[A-Z]\\w*$/.test(outer) ? `${owner} in ${outer}` : owner;\n}\nfunction renderingComponent() {\n const capture = React.captureOwnerStack;\n try {\n return ownerName(capture?.()) ?? \"unknown\";\n } catch {\n return \"unknown\";\n }\n}\nfunction guardTable(table) {\n if (guarded.has(table)) return table;\n const proxy = new Proxy(table, {\n get(target, key, receiver) {\n const value = Reflect.get(target, key, receiver);\n if (value === void 0 && typeof key === \"string\" && scaleStep.test(key) && !(key in target)) {\n const meant = key.replace(\".\", \"-\");\n devWarn(\"unknown-token\", {\n component: renderingComponent(),\n value: `$${key}`,\n suggest: meant !== key && meant in target ? `$${meant}` : void 0\n });\n }\n return value;\n }\n });\n guarded.add(proxy);\n return proxy;\n}\nfunction guardUnknownTokens(config) {\n if (process.env.NODE_ENV === \"production\") return config;\n const tables = config.tokensParsed;\n if (!tables) return config;\n for (const category of guardedCategories) {\n const table = tables[category];\n if (table) tables[category] = guardTable(table);\n }\n return config;\n}\nexport {\n guardUnknownTokens\n};\n//# sourceMappingURL=unknownTokenGuard.js.map\n"],"mappings":";;;;AAEA,MAAM,oBAAoB,CAAC,QAAQ,OAAO;AAC1C,MAAM,YAAY;AAClB,MAAM,0BAA0B,IAAI,QAAQ;AAC5C,SAAS,WAAW,OAAO;CACzB,MAAM,QAAQ,CAAC;CACf,KAAK,MAAM,QAAQ,OAAO,MAAM,IAAI,KAAK,CAAC,GAAG;EAC3C,MAAM,QAAQ,iCAAiC,KAAK,IAAI,KAAK,mBAAmB,KAAK,IAAI;EACzF,IAAI,OAAO,MAAM,KAAK,MAAM,EAAE;CAChC;CACA,OAAO;AACT;AACA,SAAS,UAAU,OAAO;CACxB,MAAM,CAAC,OAAO,SAAS,WAAW,KAAK;CACvC,IAAI,CAAC,OAAO,OAAO,KAAK;CACxB,OAAO,SAAS,aAAa,KAAK,KAAK,IAAI,GAAG,MAAM,MAAM,UAAU;AACtE;AACA,SAAS,qBAAqB;CAC5B,MAAM,UAAU,MAAM;CACtB,IAAI;EACF,OAAO,UAAU,UAAU,CAAC,KAAK;CACnC,QAAQ;EACN,OAAO;CACT;AACF;AACA,SAAS,WAAW,OAAO;CACzB,IAAI,QAAQ,IAAI,KAAK,GAAG,OAAO;CAC/B,MAAM,QAAQ,IAAI,MAAM,OAAO,EAC7B,IAAI,QAAQ,KAAK,UAAU;EACzB,MAAM,QAAQ,QAAQ,IAAI,QAAQ,KAAK,QAAQ;EAC/C,IAAI,UAAU,KAAK,KAAK,OAAO,QAAQ,YAAY,UAAU,KAAK,GAAG,KAAK,EAAE,OAAO,SAAS;GAC1F,MAAM,QAAQ,IAAI,QAAQ,KAAK,GAAG;GAClC,QAAQ,iBAAiB;IACvB,WAAW,mBAAmB;IAC9B,OAAO,IAAI;IACX,SAAS,UAAU,OAAO,SAAS,SAAS,IAAI,UAAU,KAAK;GACjE,CAAC;EACH;EACA,OAAO;CACT,EACF,CAAC;CACD,QAAQ,IAAI,KAAK;CACjB,OAAO;AACT;AACA,SAAS,mBAAmB,QAAQ;CAClC,IAAI,QAAQ,IAAI,aAAa,cAAc,OAAO;CAClD,MAAM,SAAS,OAAO;CACtB,IAAI,CAAC,QAAQ,OAAO;CACpB,KAAK,MAAM,YAAY,mBAAmB;EACxC,MAAM,QAAQ,OAAO;EACrB,IAAI,OAAO,OAAO,YAAY,WAAW,KAAK;CAChD;CACA,OAAO;AACT"}
1
+ {"version":3,"file":"unknownTokenGuard.js","names":[],"sources":["esm/theme/unknownTokenGuard.js"],"sourcesContent":["import * as React from \"react\";\nimport { devWarn } from \"../devWarn\";\nconst guardedCategories = [\"size\", \"space\"];\nconst scaleStep = /^-?\\d+(?:[.-]\\d+)?$/;\nconst guarded = /* @__PURE__ */ new WeakSet();\nfunction ownerNames(stack) {\n const names = [];\n for (const line of stack?.split(\"\\n\") ?? []) {\n const frame = /^\\s*at (?:new )?([\\w$.<>]+) \\(/.exec(line) ?? /^\\s*([\\w$.<>]+)@/.exec(line);\n if (frame) names.push(frame[1]);\n }\n return names;\n}\nfunction ownerName(stack) {\n const [owner, outer] = ownerNames(stack);\n if (!owner) return void 0;\n return outer && /^[A-Z]\\w*$/.test(outer) ? `${owner} in ${outer}` : owner;\n}\nfunction renderingComponent() {\n const capture = React.captureOwnerStack;\n try {\n return ownerName(capture?.()) ?? \"unknown\";\n } catch {\n return \"unknown\";\n }\n}\nfunction guardTable(table) {\n if (guarded.has(table)) return table;\n const proxy = new Proxy(table, {\n get(target, key, receiver) {\n const value = Reflect.get(target, key, receiver);\n if (value === void 0 && typeof key === \"string\" && scaleStep.test(key) && !(key in target)) {\n const meant = key.replace(\".\", \"-\");\n devWarn(\"unknown-token\", {\n component: renderingComponent(),\n value: `$${key}`,\n suggest: meant !== key && meant in target ? `$${meant}` : void 0\n });\n }\n return value;\n }\n });\n guarded.add(proxy);\n return proxy;\n}\nfunction kebabThemeKey(key) {\n return key.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").replace(/([A-Za-z])(\\d)/g, \"$1-$2\").toLowerCase();\n}\nfunction themeKeysOf(themes) {\n const keys = /* @__PURE__ */ new Set();\n for (const theme of Object.values(themes ?? {})) {\n for (const key of Object.keys(theme)) keys.add(key);\n }\n return keys;\n}\nfunction guardColorTable(table, themes) {\n if (guarded.has(table)) return table;\n let keys;\n const proxy = new Proxy(table, {\n get(target, key, receiver) {\n const value = Reflect.get(target, key, receiver);\n if (value !== void 0 || typeof key !== \"string\" || key in target) return value;\n const meant = kebabThemeKey(key);\n if (meant === key) return value;\n keys ??= themes();\n if (keys.has(key) || !keys.has(meant)) return value;\n devWarn(\"unknown-token\", {\n component: renderingComponent(),\n value: `$${key}`,\n suggest: `$${meant}`\n });\n return value;\n }\n });\n guarded.add(proxy);\n return proxy;\n}\nfunction guardUnknownTokens(config) {\n if (process.env.NODE_ENV === \"production\") return config;\n const { tokensParsed: tables, themes } = config;\n if (!tables) return config;\n for (const category of guardedCategories) {\n const table = tables[category];\n if (table) tables[category] = guardTable(table);\n }\n if (tables.color) tables.color = guardColorTable(tables.color, () => themeKeysOf(themes));\n return config;\n}\nexport {\n guardUnknownTokens\n};\n//# sourceMappingURL=unknownTokenGuard.js.map\n"],"mappings":";;;;AAEA,MAAM,oBAAoB,CAAC,QAAQ,OAAO;AAC1C,MAAM,YAAY;AAClB,MAAM,0BAA0B,IAAI,QAAQ;AAC5C,SAAS,WAAW,OAAO;CACzB,MAAM,QAAQ,CAAC;CACf,KAAK,MAAM,QAAQ,OAAO,MAAM,IAAI,KAAK,CAAC,GAAG;EAC3C,MAAM,QAAQ,iCAAiC,KAAK,IAAI,KAAK,mBAAmB,KAAK,IAAI;E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gB,OAAO,QAAQ;CACtC,IAAI,QAAQ,IAAI,KAAK,GAAG,OAAO;CAC/B,IAAI;CACJ,MAAM,QAAQ,IAAI,MAAM,OAAO,EAC7B,IAAI,QAAQ,KAAK,UAAU;EACzB,MAAM,QAAQ,QAAQ,IAAI,QAAQ,KAAK,QAAQ;EAC/C,IAAI,UAAU,KAAK,KAAK,OAAO,QAAQ,YAAY,OAAO,QAAQ,OAAO;EACzE,MAAM,QAAQ,cAAc,GAAG;EAC/B,IAAI,UAAU,KAAK,OAAO;EAC1B,SAAS,OAAO;EAChB,IAAI,KAAK,IAAI,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,GAAG,OAAO;EAC9C,QAAQ,iBAAiB;GACvB,WAAW,mBAAmB;GAC9B,OAAO,IAAI;GACX,SAAS,IAAI;EACf,CAAC;EACD,OAAO;CACT,EACF,CAAC;CACD,QAAQ,IAAI,KAAK;CACjB,OAAO;AACT;AACA,SAAS,mBAAmB,QAAQ;CAClC,IAAI,QAAQ,IAAI,aAAa,cAAc,OAAO;CAClD,MAAM,EAAE,cAAc,QAAQ,WAAW;CACzC,IAAI,CAAC,QAAQ,OAAO;CACpB,KAAK,MAAM,YAAY,mBAAmB;EACxC,MAAM,QAAQ,OAAO;EACrB,IAAI,OAAO,OAAO,YAAY,WAAW,KAAK;CAChD;CACA,IAAI,OAAO,OAAO,OAAO,QAAQ,gBAAgB,OAAO,aAAa,YAAY,MAAM,CAAC;CACxF,OAAO;AACT"}
@@ -62,9 +62,75 @@ function guardTable(table) {
62
62
  guarded.add(proxy);
63
63
  return proxy;
64
64
  }
65
+ function kebabThemeKey(key) {
66
+ return key.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Za-z])(\d)/g, "$1-$2").toLowerCase();
67
+ }
68
+ function themeKeysOf(themes) {
69
+ var keys = /* @__PURE__ */ new Set();
70
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
71
+ try {
72
+ for (var _iterator = Object.values(themes !== null && themes !== void 0 ? themes : {})[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
73
+ var theme = _step.value;
74
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
75
+ try {
76
+ for (var _iterator1 = Object.keys(theme)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
77
+ var key = _step1.value;
78
+ keys.add(key);
79
+ }
80
+ } catch (err) {
81
+ _didIteratorError1 = true;
82
+ _iteratorError1 = err;
83
+ } finally {
84
+ try {
85
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
86
+ _iterator1.return();
87
+ }
88
+ } finally {
89
+ if (_didIteratorError1) {
90
+ throw _iteratorError1;
91
+ }
92
+ }
93
+ }
94
+ }
95
+ } catch (err) {
96
+ _didIteratorError = true;
97
+ _iteratorError = err;
98
+ } finally {
99
+ try {
100
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
101
+ _iterator.return();
102
+ }
103
+ } finally {
104
+ if (_didIteratorError) {
105
+ throw _iteratorError;
106
+ }
107
+ }
108
+ }
109
+ return keys;
110
+ }
111
+ function guardColorTable(table, themes) {
112
+ if (guarded.has(table)) return table;
113
+ var keys;
114
+ var proxy = new Proxy(table, { get(target, key, receiver) {
115
+ var value = Reflect.get(target, key, receiver);
116
+ if (value !== void 0 || typeof key !== "string" || key in target) return value;
117
+ var meant = kebabThemeKey(key);
118
+ if (meant === key) return value;
119
+ keys !== null && keys !== void 0 ? keys : keys = themes();
120
+ if (keys.has(key) || !keys.has(meant)) return value;
121
+ devWarn("unknown-token", {
122
+ component: renderingComponent(),
123
+ value: `$${key}`,
124
+ suggest: `$${meant}`
125
+ });
126
+ return value;
127
+ } });
128
+ guarded.add(proxy);
129
+ return proxy;
130
+ }
65
131
  function guardUnknownTokens(config) {
66
132
  if (process.env.NODE_ENV === "production") return config;
67
- var tables = config.tokensParsed;
133
+ var { tokensParsed: tables, themes } = config;
68
134
  if (!tables) return config;
69
135
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
70
136
  try {
@@ -87,6 +153,9 @@ function guardUnknownTokens(config) {
87
153
  }
88
154
  }
89
155
  }
156
+ if (tables.color) tables.color = guardColorTable(tables.color, function() {
157
+ return themeKeysOf(themes);
158
+ });
90
159
  return config;
91
160
  }
92
161
 
@@ -1 +1 @@
1
- {"version":3,"file":"unknownTokenGuard.native.js","names":[],"sources":["esm/theme/unknownTokenGuard.native.js"],"sourcesContent":["import * as React from \"react\";\nimport { devWarn } from \"../devWarn\";\nvar guardedCategories = [\n \"size\",\n \"space\"\n];\nvar scaleStep = /^-?\\d+(?:[.-]\\d+)?$/;\nvar guarded = /* @__PURE__ */ new WeakSet();\nfunction ownerNames(stack) {\n var _ref;\n var names = [];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = ((_ref = stack === null || stack === void 0 ? void 0 : stack.split(\"\\n\")) !== null && _ref !== void 0 ? _ref : [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var line = _step.value;\n var _exec;\n var frame = (_exec = /^\\s*at (?:new )?([\\w$.<>]+) \\(/.exec(line)) !== null && _exec !== void 0 ? _exec : /^\\s*([\\w$.<>]+)@/.exec(line);\n if (frame) names.push(frame[1]);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return names;\n}\nfunction ownerName(stack) {\n var [owner, outer] = ownerNames(stack);\n if (!owner) return void 0;\n return outer && /^[A-Z]\\w*$/.test(outer) ? `${owner} in ${outer}` : owner;\n}\nfunction renderingComponent() {\n var capture = React.captureOwnerStack;\n try {\n var _ownerName;\n return (_ownerName = ownerName(capture === null || capture === void 0 ? void 0 : capture())) !== null && _ownerName !== void 0 ? _ownerName : \"unknown\";\n } catch (unused) {\n return \"unknown\";\n }\n}\nfunction guardTable(table) {\n if (guarded.has(table)) return table;\n var proxy = new Proxy(table, {\n get(target, key, receiver) {\n var value = Reflect.get(target, key, receiver);\n if (value === void 0 && typeof key === \"string\" && scaleStep.test(key) && !(key in target)) {\n var meant = key.replace(\".\", \"-\");\n devWarn(\"unknown-token\", {\n component: renderingComponent(),\n value: `$${key}`,\n suggest: meant !== key && meant in target ? `$${meant}` : void 0\n });\n }\n return value;\n }\n });\n guarded.add(proxy);\n return proxy;\n}\nfunction guardUnknownTokens(config) {\n if (process.env.NODE_ENV === \"production\") return config;\n var tables = config.tokensParsed;\n if (!tables) return config;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = guardedCategories[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var category = _step.value;\n var table = tables[category];\n if (table) tables[category] = guardTable(table);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return config;\n}\nexport {\n guardUnknownTokens\n};\n//# sourceMappingURL=unknownTokenGuard.js.map\n"],"mappings":";;;;AAEA,IAAI,oBAAoB,CACtB,QACA,OACF;AACA,IAAI,YAAY;AAChB,IAAI,0BAA0B,IAAI,QAAQ;AAC1C,SAAS,WAAW,OAAO;CACzB,IAAI;CACJ,IAAI,QAAQ,CAAC;CACb,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;CACvF,IAAI;EACF,KAAK,IAAI,cAAc,OAAO,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,MAAM,IAAI,OAAO,QAAQ,SAAS,KAAK,IAA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QAAQ,KAAK,GAAG;GAChC,QAAQ,iBAAiB;IACvB,WAAW,mBAAmB;IAC9B,OAAO,IAAI;IACX,SAAS,UAAU,OAAO,SAAS,SAAS,IAAI,UAAU,KAAK;GACjE,CAAC;EACH;EACA,OAAO;CACT,EACF,CAAC;CACD,QAAQ,IAAI,KAAK;CACjB,OAAO;AACT;AACA,SAAS,mBAAmB,QAAQ;CAClC,IAAI,QAAQ,IAAI,aAAa,cAAc,OAAO;CAClD,IAAI,SAAS,OAAO;CACpB,IAAI,CAAC,QAAQ,OAAO;CACpB,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;CACvF,IAAI;EACF,KAAK,IAAI,YAAY,kBAAkB,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;GAClK,IAAI,WAAW,MAAM;GACrB,IAAI,QAAQ,OAAO;GACnB,IAAI,OAAO,OAAO,YAAY,WAAW,KAAK;EAChD;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;IAC1D,UAAU,OAAO;GACnB;EACF,UAAU;GACR,IAAI,mBAAmB;IACrB,MAAM;GACR;EACF;CACF;CACA,OAAO;AACT"}
1
+ {"version":3,"file":"unknownTokenGuard.native.js","names":[],"sources":["esm/theme/unknownTokenGuard.native.js"],"sourcesContent":["import * as React from \"react\";\nimport { devWarn } from \"../devWarn\";\nvar guardedCategories = [\n \"size\",\n \"space\"\n];\nvar scaleStep = /^-?\\d+(?:[.-]\\d+)?$/;\nvar guarded = /* @__PURE__ */ new WeakSet();\nfunction ownerNames(stack) {\n var _ref;\n var names = [];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = ((_ref = stack === null || stack === void 0 ? void 0 : stack.split(\"\\n\")) !== null && _ref !== void 0 ? _ref : [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var line = _step.value;\n var _exec;\n var frame = (_exec = /^\\s*at (?:new )?([\\w$.<>]+) \\(/.exec(line)) !== null && _exec !== void 0 ? _exec : /^\\s*([\\w$.<>]+)@/.exec(line);\n if (frame) names.push(frame[1]);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return names;\n}\nfunction ownerName(stack) {\n var [owner, outer] = ownerNames(stack);\n if (!owner) return void 0;\n return outer && /^[A-Z]\\w*$/.test(outer) ? `${owner} in ${outer}` : owner;\n}\nfunction renderingComponent() {\n var capture = React.captureOwnerStack;\n try {\n var _ownerName;\n return (_ownerName = ownerName(capture === null || capture === void 0 ? void 0 : capture())) !== null && _ownerName !== void 0 ? _ownerName : \"unknown\";\n } catch (unused) {\n return \"unknown\";\n }\n}\nfunction guardTable(table) {\n if (guarded.has(table)) return table;\n var proxy = new Proxy(table, {\n get(target, key, receiver) {\n var value = Reflect.get(target, key, receiver);\n if (value === void 0 && typeof key === \"string\" && scaleStep.test(key) && !(key in target)) {\n var meant = key.replace(\".\", \"-\");\n devWarn(\"unknown-token\", {\n component: renderingComponent(),\n value: `$${key}`,\n suggest: meant !== key && meant in target ? `$${meant}` : void 0\n });\n }\n return value;\n }\n });\n guarded.add(proxy);\n return proxy;\n}\nfunction kebabThemeKey(key) {\n return key.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").replace(/([A-Za-z])(\\d)/g, \"$1-$2\").toLowerCase();\n}\nfunction themeKeysOf(themes) {\n var keys = /* @__PURE__ */ new Set();\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = Object.values(themes !== null && themes !== void 0 ? themes : {})[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var theme = _step.value;\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = Object.keys(theme)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var key = _step1.value;\n keys.add(key);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return keys;\n}\nfunction guardColorTable(table, themes) {\n if (guarded.has(table)) return table;\n var keys;\n var proxy = new Proxy(table, {\n get(target, key, receiver) {\n var value = Reflect.get(target, key, receiver);\n if (value !== void 0 || typeof key !== \"string\" || key in target) return value;\n var meant = kebabThemeKey(key);\n if (meant === key) return value;\n keys !== null && keys !== void 0 ? keys : keys = themes();\n if (keys.has(key) || !keys.has(meant)) return value;\n devWarn(\"unknown-token\", {\n component: renderingComponent(),\n value: `$${key}`,\n suggest: `$${meant}`\n });\n return value;\n }\n });\n guarded.add(proxy);\n return proxy;\n}\nfunction guardUnknownTokens(config) {\n if (process.env.NODE_ENV === \"production\") return config;\n var { tokensParsed: tables, themes } = config;\n if (!tables) return config;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = guardedCategories[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var category = _step.value;\n var table = tables[category];\n if (table) tables[category] = guardTable(table);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (tables.color) tables.color = guardColorTable(tables.color, function() {\n return themeKeysOf(themes);\n });\n return config;\n}\nexport {\n guardUnknownTokens\n};\n//# sourceMappingURL=unknownTokenGuard.js.map\n"],"mappings":";;;;AAEA,IAAI,oBAAoB,CACtB,QACA,OACF;AACA,IAAI,YAAY;AAChB,IAAI,0BAA0B,IAAI,QAAQ;AAC1C,SAAS,WAAW,OAAO;CACzB,IAAI;CACJ,IAAI,QAAQ,CAAC;CACb,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;CACvF,IAAI;EACF,KAAK,IAAI,cAAc,OAAO,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,MAAM,IAAI,OAAO,QAAQ,SAAS,KAAK,IAAI,OAAO,CAAC,EAAC,CAAE,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;GACnQ,IAAI,OAAO,MAAM;GACjB,IAAI;GACJ,IAAI,SAAS,QAAQ,iCAAiC,KAAK,IAAI,OAAO,QAAQ,UAAU,KAAK,IAAI,QAAQ,mBAAmB,KAAK,IAAI;GACrI,IAAI,OAAO,MAAM,KAAK,MAAM,EAAE;EAChC;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;IAC1D,UAAU,OAAO;GACnB;EACF,UAAU;GACR,IAAI,mBAAmB;IACrB,MAAM;GACR;EACF;CACF;CACA,OAAO;AACT;AACA,SAAS,UAAU,OAAO;CACxB,IAAI,CAAC,OAAO,SAAS,WAAW,KAAK;CACrC,IAAI,CAAC,OAAO,OAAO,KAAK;CACxB,OAAO,SAAS,aAA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GAC9B,OAAO,IAAI;GACX,SAAS,IAAI;EACf,CAAC;EACD,OAAO;CACT,EACF,CAAC;CACD,QAAQ,IAAI,KAAK;CACjB,OAAO;AACT;AACA,SAAS,mBAAmB,QAAQ;CAClC,IAAI,QAAQ,IAAI,aAAa,cAAc,OAAO;CAClD,IAAI,EAAE,cAAc,QAAQ,WAAW;CACvC,IAAI,CAAC,QAAQ,OAAO;CACpB,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;CACvF,IAAI;EACF,KAAK,IAAI,YAAY,kBAAkB,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;GAClK,IAAI,WAAW,MAAM;GACrB,IAAI,QAAQ,OAAO;GACnB,IAAI,OAAO,OAAO,YAAY,WAAW,KAAK;EAChD;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;IAC1D,UAAU,OAAO;GACnB;EACF,UAAU;GACR,IAAI,mBAAmB;IACrB,MAAM;GACR;EACF;CACF;CACA,IAAI,OAAO,OAAO,OAAO,QAAQ,gBAAgB,OAAO,OAAO,WAAW;EACxE,OAAO,YAAY,MAAM;CAC3B,CAAC;CACD,OAAO;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/theme",
3
- "version": "10.27.4",
3
+ "version": "11.1.0",
4
4
  "description": "Tamagui theme system for multiplatform.one",
5
5
  "keywords": [
6
6
  "multiplatform",
@@ -163,8 +163,8 @@
163
163
  "access": "public"
164
164
  },
165
165
  "dependencies": {
166
- "@multiplatform.one/platform": "^10.27.4",
167
- "@multiplatform.one/store": "^10.27.4",
166
+ "@multiplatform.one/platform": "^11.1.0",
167
+ "@multiplatform.one/store": "^11.1.0",
168
168
  "@tamagui/animations-react-native": "3.2.3",
169
169
  "@tamagui/colors": "3.2.3",
170
170
  "@tamagui/config": "3.2.3",
@@ -178,8 +178,8 @@
178
178
  },
179
179
  "devDependencies": {
180
180
  "@expo/prebuild-config": "58.0.19",
181
- "@multiplatform.one/config": "10.27.4",
182
- "@multiplatform.one/test-utils": "10.27.4",
181
+ "@multiplatform.one/config": "11.1.0",
182
+ "@multiplatform.one/test-utils": "11.1.0",
183
183
  "@tamagui/animations-css": "3.2.3",
184
184
  "@tamagui/animations-reanimated": "3.2.3",
185
185
  "@tamagui/build": "3.2.3",
@@ -224,7 +224,6 @@ export {
224
224
  DialogOverlay,
225
225
  DialogRegionContext,
226
226
  DialogSheetFaceProvider,
227
- DialogShowFocus,
228
227
  overlayScrim,
229
228
  PopoverContent,
230
229
  sheetGrabber,
@@ -236,6 +235,8 @@ export {
236
235
  sheetHandleWidthRatio,
237
236
  sheetHandleZone,
238
237
  SheetBodyProvider,
238
+ SheetBodyInsetProvider,
239
+ useSheetBodyInset,
239
240
  useDialogRegionContext,
240
241
  useDialogSheetFace,
241
242
  useIsInDialogRegion,