@multiplatform.one/theme 10.25.2 → 10.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/theme/createThemes.cjs +41 -2
- package/dist/cjs/theme/createThemes.native.cjs +64 -2
- package/dist/cjs/theme/createThemes.native.js +64 -2
- package/dist/cjs/theme/createThemes.native.js.map +1 -1
- package/dist/cjs/theme/overlaySurfaces.cjs +2 -4
- package/dist/cjs/theme/overlaySurfaces.native.cjs +2 -4
- package/dist/cjs/theme/overlaySurfaces.native.js +2 -4
- package/dist/cjs/theme/overlaySurfaces.native.js.map +1 -1
- package/dist/esm/theme/createThemes.mjs +41 -2
- package/dist/esm/theme/createThemes.mjs.map +1 -1
- package/dist/esm/theme/createThemes.native.js +64 -2
- package/dist/esm/theme/createThemes.native.js.map +1 -1
- package/dist/esm/theme/overlaySurfaces.mjs +3 -5
- package/dist/esm/theme/overlaySurfaces.mjs.map +1 -1
- package/dist/esm/theme/overlaySurfaces.native.js +3 -5
- package/dist/esm/theme/overlaySurfaces.native.js.map +1 -1
- package/package.json +5 -5
- package/src/theme/consumerAccentFill.spec.ts +64 -0
- package/src/theme/createThemes.ts +41 -4
- package/src/theme/overlaySurfaces.focus.spec.tsx +4 -5
- package/src/theme/overlaySurfaces.tsx +11 -15
- package/types/theme/createThemes.d.ts.map +1 -1
- package/types/theme/overlaySurfaces.d.ts +1 -1
- package/types/theme/overlaySurfaces.d.ts.map +1 -1
|
@@ -332,20 +332,18 @@ const AlertDialogOverlay = (0, import_react.forwardRef)(function AlertDialogOver
|
|
|
332
332
|
children
|
|
333
333
|
});
|
|
334
334
|
});
|
|
335
|
-
const PopoverContent = (0, import_react.forwardRef)(function PopoverContent2({ children, onOpenAutoFocus, ...props }, ref) {
|
|
335
|
+
const PopoverContent = (0, import_react.forwardRef)(function PopoverContent2({ children, onOpenAutoFocus: _onOpenAutoFocus, ...props }, ref) {
|
|
336
336
|
const { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({
|
|
337
337
|
component: "PopoverContent",
|
|
338
338
|
painted: false
|
|
339
339
|
});
|
|
340
|
-
|
|
341
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Popover.Content, {
|
|
340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
342
341
|
ref,
|
|
343
342
|
...knobProps.elevatedSurface,
|
|
344
343
|
...knobProps.containerRadius,
|
|
345
344
|
...(0, import_transitionProps.transitionProps)(knobProps.motion.overlay),
|
|
346
345
|
...overlayEnterExit,
|
|
347
346
|
...overlayFrameFocus,
|
|
348
|
-
onOpenAutoFocus: withHouseOpenFocus(onOpenAutoFocus, contentId),
|
|
349
347
|
...props,
|
|
350
348
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Surface.Surface, {
|
|
351
349
|
painted: false,
|
|
@@ -348,20 +348,18 @@ var AlertDialogOverlay = /* @__PURE__ */ (0, import_react.forwardRef)(function A
|
|
|
348
348
|
});
|
|
349
349
|
});
|
|
350
350
|
var PopoverContent = /* @__PURE__ */ (0, import_react.forwardRef)(function PopoverContent2(param, ref) {
|
|
351
|
-
var { children, onOpenAutoFocus, ...props } = param;
|
|
351
|
+
var { children, onOpenAutoFocus: _onOpenAutoFocus, ...props } = param;
|
|
352
352
|
var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({
|
|
353
353
|
component: "PopoverContent",
|
|
354
354
|
painted: false
|
|
355
355
|
});
|
|
356
|
-
|
|
357
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Popover.Content, {
|
|
356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
358
357
|
ref,
|
|
359
358
|
...knobProps.elevatedSurface,
|
|
360
359
|
...knobProps.containerRadius,
|
|
361
360
|
...(0, import_transitionProps.transitionProps)(knobProps.motion.overlay),
|
|
362
361
|
...overlayEnterExit,
|
|
363
362
|
...overlayFrameFocus,
|
|
364
|
-
onOpenAutoFocus: withHouseOpenFocus(onOpenAutoFocus, contentId),
|
|
365
363
|
...props,
|
|
366
364
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Surface.Surface, {
|
|
367
365
|
painted: false,
|
|
@@ -348,20 +348,18 @@ var AlertDialogOverlay = /* @__PURE__ */ (0, import_react.forwardRef)(function A
|
|
|
348
348
|
});
|
|
349
349
|
});
|
|
350
350
|
var PopoverContent = /* @__PURE__ */ (0, import_react.forwardRef)(function PopoverContent2(param, ref) {
|
|
351
|
-
var { children, onOpenAutoFocus, ...props } = param;
|
|
351
|
+
var { children, onOpenAutoFocus: _onOpenAutoFocus, ...props } = param;
|
|
352
352
|
var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({
|
|
353
353
|
component: "PopoverContent",
|
|
354
354
|
painted: false
|
|
355
355
|
});
|
|
356
|
-
|
|
357
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Popover.Content, {
|
|
356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
358
357
|
ref,
|
|
359
358
|
...knobProps.elevatedSurface,
|
|
360
359
|
...knobProps.containerRadius,
|
|
361
360
|
...(0, import_transitionProps.transitionProps)(knobProps.motion.overlay),
|
|
362
361
|
...overlayEnterExit,
|
|
363
362
|
...overlayFrameFocus,
|
|
364
|
-
onOpenAutoFocus: withHouseOpenFocus(onOpenAutoFocus, contentId),
|
|
365
363
|
...props,
|
|
366
364
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Surface.Surface, {
|
|
367
365
|
painted: false,
|
|
@@ -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, ...props } = param;\n var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)({\n component: \"PopoverContent\",\n painted: false\n });\n var { contentId } = (0, import_tamagui.usePopoverContext)();\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Popover.Content, {\n ref,\n ...knobProps.elevatedSurface,\n ...knobProps.containerRadius,\n ...(0, import_transitionProps.transitionProps)(knobProps.motion.overlay),\n ...overlayEnterExit,\n ...overlayFrameFocus,\n onOpenAutoFocus: withHouseOpenFocus(onOpenAutoFocus, contentId),\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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cAAc,SAAQ,CAAE,UAAU,OAAO,OAAO,CAAC;EACpG,GAAG;EACH,GAAG;EACH;CACF,CAAC;AACH,CAAC;AACD,IAAI,iBAAiC,iBAAC,GAAG,aAAa,WAAU,CAAE,SAAS,gBAAgB,OAAO,KAAK;CACrG,IAAI,EAAE,UAAU,iBAAiB,GAAG,UAAU;CAC9C,IAAI,EAAE,eAAe,GAAG,wBAAwB,iBAAgB,CAAE;EAChE,WAAW;EACX,SAAS;CACX,CAAC;CACD,IAAI,EAAE,eAAe,GAAG,eAAe,kBAAiB,CAAE;CAC1D,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,eAAe,QAAQ,SAAS;EACjF;EACA,GAAG,UAAU;EACb,GAAG,UAAU;EACb,IAAI,GAAG,uBAAuB,gBAAe,CAAE,UAAU,OAAO,OAAO;EACvE,GAAG;EACH,GAAG;EACH,iBAAiB,mBAAmB,iBAAiB,SAAS;EAC9D,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 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,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AAG,CAAE,eAAe,QAAQ;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"}
|
|
@@ -673,6 +673,45 @@ function holdStateFill(ramp, fill, label, paper) {
|
|
|
673
673
|
].map((index) => ramp[index]).filter((step) => step !== void 0 && labelHolds(label, step));
|
|
674
674
|
return holding.find((step) => contrastRatio(luminanceOf(step), paper) >= minContrastRatio) ?? holding[0] ?? fill;
|
|
675
675
|
}
|
|
676
|
+
function holdConsumerAccentStates(themes) {
|
|
677
|
+
const out = { ...themes };
|
|
678
|
+
for (const scheme of ["light", "dark"]) {
|
|
679
|
+
const base = themes[scheme];
|
|
680
|
+
if (!base) continue;
|
|
681
|
+
const ramp = Array.from({ length: 12 }, (_, index) => base[`accent-${index + 1}`]);
|
|
682
|
+
const paper = luminanceOf(base["color-1"]);
|
|
683
|
+
if (!isFullRamp(ramp) || isAchromaticRamp(ramp) || paper === null) continue;
|
|
684
|
+
const scopeName = `${scheme}_accent`;
|
|
685
|
+
const scope = themes[scopeName];
|
|
686
|
+
if (!scope) continue;
|
|
687
|
+
for (const [name, theme] of Object.entries(themes)) {
|
|
688
|
+
if (name !== scopeName && !name.startsWith(`${scopeName}_`)) continue;
|
|
689
|
+
const held = { ...theme };
|
|
690
|
+
for (const state of [
|
|
691
|
+
"hover",
|
|
692
|
+
"press",
|
|
693
|
+
"focus"
|
|
694
|
+
]) {
|
|
695
|
+
const fillKey = `background-${state}`;
|
|
696
|
+
const inkKey = `color-${state}`;
|
|
697
|
+
const fill = theme[fillKey] ?? scope[fillKey] ?? theme.background ?? scope.background;
|
|
698
|
+
const label = theme[inkKey] ?? scope[inkKey] ?? theme.color ?? scope.color;
|
|
699
|
+
if (labelHolds(label, fill)) continue;
|
|
700
|
+
const pair = holdFillLabel(fill, ramp, [label], paper) ?? holdFillLabel(fill, ramp, [
|
|
701
|
+
scope.color,
|
|
702
|
+
base["color-1"],
|
|
703
|
+
base["color-12"]
|
|
704
|
+
], paper);
|
|
705
|
+
if (!pair) continue;
|
|
706
|
+
held[fillKey] = pair.fill;
|
|
707
|
+
held[inkKey] = pair.label;
|
|
708
|
+
if ((theme[`border-color-${state}`] ?? scope[`border-color-${state}`]) === fill) held[`border-color-${state}`] = pair.fill;
|
|
709
|
+
}
|
|
710
|
+
out[name] = held;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
return out;
|
|
714
|
+
}
|
|
676
715
|
function holdFillLabel(preferred, steps, labels, paper) {
|
|
677
716
|
const preferredLum = luminanceOf(preferred);
|
|
678
717
|
if (preferredLum === null) return void 0;
|
|
@@ -1151,10 +1190,10 @@ function createThemesBuilder(baseTheme, accentTheme, options, accentHue = "blue"
|
|
|
1151
1190
|
} });
|
|
1152
1191
|
return Object.fromEntries(Object.entries(raw).map(([name, theme]) => [name, { ...theme }]));
|
|
1153
1192
|
};
|
|
1154
|
-
const initialTheme = buildRawThemes({
|
|
1193
|
+
const initialTheme = holdConsumerAccentStates(buildRawThemes({
|
|
1155
1194
|
dark: accentTheme.darkPalette,
|
|
1156
1195
|
light: accentTheme.lightPalette
|
|
1157
|
-
});
|
|
1196
|
+
}));
|
|
1158
1197
|
const scrimAlphas = {
|
|
1159
1198
|
light: baseTheme.lightScrims ?? defaultBaseTheme.lightScrims,
|
|
1160
1199
|
dark: baseTheme.darkScrims ?? defaultBaseTheme.darkScrims
|