@tamagui/web 3.0.0-beta.881.1 → 3.0.0-beta.889.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,7 +42,7 @@ function createStyledHOC(component, render, options) {
42
42
  };
43
43
  let out = function StyledHOCComponent(props) {
44
44
  "use no memo";
45
- const { ref, ...rest } = props;
45
+ const { ref = null, ...rest } = props;
46
46
  if (options?.disableTheme) {
47
47
  return render(rest, ref);
48
48
  }
@@ -45,7 +45,7 @@ function createStyledHOC(component, render, options) {
45
45
  var out = function StyledHOCComponent(props) {
46
46
  "use no memo";
47
47
  var _extendedConfig_defaultProps;
48
- var { ref, ...rest } = props;
48
+ var { ref = null, ...rest } = props;
49
49
  if (options === null || options === void 0 ? void 0 : options.disableTheme) {
50
50
  return render(rest, ref);
51
51
  }
@@ -45,7 +45,7 @@ function createStyledHOC(component, render, options) {
45
45
  var out = function StyledHOCComponent(props) {
46
46
  "use no memo";
47
47
  var _extendedConfig_defaultProps;
48
- var { ref, ...rest } = props;
48
+ var { ref = null, ...rest } = props;
49
49
  if (options === null || options === void 0 ? void 0 : options.disableTheme) {
50
50
  return render(rest, ref);
51
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"createStyledHOC.native.js","names":[],"sources":["cjs/createStyledHOC.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar createStyledHOC_exports = {};\n__export(createStyledHOC_exports, {\n createStyledHOC: () => createStyledHOC\n});\nmodule.exports = __toCommonJS(createStyledHOC_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_componentDisplayName = require(\"./helpers/componentDisplayName\");\nvar import_Theme = require(\"./views/Theme\");\nfunction createStyledHOC(component, render, options) {\n var staticConfig = component.staticConfig;\n var extendedConfig = {\n ...staticConfig,\n ...options === null || options === void 0 ? void 0 : options.staticConfig,\n neverFlatten: true,\n isHOC: true,\n isStyledHOC: false\n };\n var out = function StyledHOCComponent(props) {\n \"use no memo\";\n var _extendedConfig_defaultProps;\n var { ref, ...rest } = props;\n if (options === null || options === void 0 ? void 0 : options.disableTheme) {\n return render(rest, ref);\n }\n var defaultTheme = (_extendedConfig_defaultProps = extendedConfig.defaultProps) === null || _extendedConfig_defaultProps === void 0 ? void 0 : _extendedConfig_defaultProps.theme;\n var { theme: _, ...themedRest } = rest;\n var element = render({\n ...themedRest,\n \"data-disable-theme\": true\n }, ref);\n var themeProps = null;\n if (\"debug\" in props) {\n themeProps = {\n debug: props.debug\n };\n }\n if (\"theme\" in props || defaultTheme) {\n ;\n (themeProps || (themeProps = {})).name = \"theme\" in props ? props.theme : defaultTheme;\n }\n if (!themeProps) {\n return element;\n }\n var context = extendedConfig.context;\n if (!context) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.Theme, {\n \"disable-child-theme\": true,\n ...themeProps,\n children: element\n });\n }\n var contextValue = import_react.default.useContext(context);\n var overriddenContextProps;\n for (var key in context.props) {\n var value = props[key];\n if (value !== void 0) {\n ;\n (overriddenContextProps || (overriddenContextProps = {}))[key] = value;\n }\n }\n var Provider = context.Provider;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider, {\n ...contextValue,\n ...overriddenContextProps,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.Theme, {\n \"disable-child-theme\": true,\n ...themeProps,\n children: element\n })\n });\n };\n if (extendedConfig.memo || process.env.TAMAGUI_MEMOIZE_STYLED_HOC) {\n out = /* @__PURE__ */ import_react.default.memo(out);\n }\n var displayName = (options === null || options === void 0 ? void 0 : options.displayName) || component[import_componentDisplayName.componentDisplayName];\n if (displayName) {\n out.displayName = displayName;\n out[import_componentDisplayName.componentDisplayName] = displayName;\n }\n out.staticConfig = extendedConfig;\n return out;\n}\n//# sourceMappingURL=createStyledHOC.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAi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AAI,aAAa;EACjB,IAAI,WAAW,OAAO;GACpB,aAAa,EACX,OAAO,MAAM,MACf;EACF;EACA,IAAI,WAAW,SAAS,cAAc;GACpC;GACA,CAAC,eAAe,aAAa,CAAC,GAAE,CAAE,OAAO,WAAW,QAAQ,MAAM,QAAQ;EAC5E;EACA,IAAI,CAAC,YAAY;GACf,OAAO;EACT;EACA,IAAI,UAAU,eAAe;EAC7B,IAAI,CAAC,SAAS;GACZ,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,aAAa,OAAO;IACrE,uBAAuB;IACvB,GAAG;IACH,UAAU;GACZ,CAAC;EACH;EACA,IAAI,eAAe,aAAa,QAAQ,WAAW,OAAO;EAC1D,IAAI;EACJ,KAAK,IAAI,OAAO,QAAQ,OAAO;GAC7B,IAAI,QAAQ,MAAM;GAClB,IAAI,UAAU,KAAK,GAAG;IACpB;IACA,CAAC,2BAA2B,yBAAyB,CAAC,GAAE,CAAE,OAAO;GACnE;EACF;EACA,IAAI,WAAW,QAAQ;EACvB,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,UAAU;GAC3D,GAAG;GACH,GAAG;GACH,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,aAAa,OAAO;IACxE,uBAAuB;IACvB,GAAG;IACH,UAAU;GACZ,CAAC;EACH,CAAC;CACH;CACA,IAAI,eAAe,QAAQ,QAAQ,IAAI,4BAA4B;EACjE,MAAsB,6BAAa,QAAQ,KAAK,GAAG;CACrD;CACA,IAAI,eAAe,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,gBAAgB,UAAU,4BAA4B;CACnI,IAAI,aAAa;EACf,IAAI,cAAc;EAClB,IAAI,4BAA4B,wBAAwB;CAC1D;CACA,IAAI,eAAe;CACnB,OAAO;AACT"}
1
+ {"version":3,"file":"createStyledHOC.native.js","names":[],"sources":["cjs/createStyledHOC.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar createStyledHOC_exports = {};\n__export(createStyledHOC_exports, {\n createStyledHOC: () => createStyledHOC\n});\nmodule.exports = __toCommonJS(createStyledHOC_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_componentDisplayName = require(\"./helpers/componentDisplayName\");\nvar import_Theme = require(\"./views/Theme\");\nfunction createStyledHOC(component, render, options) {\n var staticConfig = component.staticConfig;\n var extendedConfig = {\n ...staticConfig,\n ...options === null || options === void 0 ? void 0 : options.staticConfig,\n neverFlatten: true,\n isHOC: true,\n isStyledHOC: false\n };\n var out = function StyledHOCComponent(props) {\n \"use no memo\";\n var _extendedConfig_defaultProps;\n var { ref = null, ...rest } = props;\n if (options === null || options === void 0 ? void 0 : options.disableTheme) {\n return render(rest, ref);\n }\n var defaultTheme = (_extendedConfig_defaultProps = extendedConfig.defaultProps) === null || _extendedConfig_defaultProps === void 0 ? void 0 : _extendedConfig_defaultProps.theme;\n var { theme: _, ...themedRest } = rest;\n var element = render({\n ...themedRest,\n \"data-disable-theme\": true\n }, ref);\n var themeProps = null;\n if (\"debug\" in props) {\n themeProps = {\n debug: props.debug\n };\n }\n if (\"theme\" in props || defaultTheme) {\n ;\n (themeProps || (themeProps = {})).name = \"theme\" in props ? props.theme : defaultTheme;\n }\n if (!themeProps) {\n return element;\n }\n var context = extendedConfig.context;\n if (!context) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.Theme, {\n \"disable-child-theme\": true,\n ...themeProps,\n children: element\n });\n }\n var contextValue = import_react.default.useContext(context);\n var overriddenContextProps;\n for (var key in context.props) {\n var value = props[key];\n if (value !== void 0) {\n ;\n (overriddenContextProps || (overriddenContextProps = {}))[key] = value;\n }\n }\n var Provider = context.Provider;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider, {\n ...contextValue,\n ...overriddenContextProps,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.Theme, {\n \"disable-child-theme\": true,\n ...themeProps,\n children: element\n })\n });\n };\n if (extendedConfig.memo || process.env.TAMAGUI_MEMOIZE_STYLED_HOC) {\n out = /* @__PURE__ */ import_react.default.memo(out);\n }\n var displayName = (options === null || options === void 0 ? void 0 : options.displayName) || component[import_componentDisplayName.componentDisplayName];\n if (displayName) {\n out.displayName = displayName;\n out[import_componentDisplayName.componentDisplayName] = displayName;\n }\n out.staticConfig = extendedConfig;\n return out;\n}\n//# sourceMappingURL=createStyledHOC.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CA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AI,4BAA4B;EACjE,MAAsB,6BAAa,QAAQ,KAAK,GAAG;CACrD;CACA,IAAI,eAAe,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,gBAAgB,UAAU,4BAA4B;CACnI,IAAI,aAAa;EACf,IAAI,cAAc;EAClB,IAAI,4BAA4B,wBAAwB;CAC1D;CACA,IAAI,eAAe;CACnB,OAAO;AACT"}
@@ -46,7 +46,7 @@ const Theme = (0, import_compose_refs.createRefComponent)(function Theme2(props,
46
46
  "use no memo";
47
47
  if (props.disable) return props.children;
48
48
  if (process.env.NODE_ENV === "development") {
49
- for (const key in props) if (!import_helpers.reservedThemeProps[key]) (0, import_warnOnce.warnOnce)(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
49
+ for (const key in props) if (!import_helpers.reservedThemeProps[key] && key !== "srcloc" && !key.startsWith("data-")) (0, import_warnOnce.warnOnce)(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
50
50
  }
51
51
  const { passThrough } = props;
52
52
  const isRoot = !!props["_isRoot"];
@@ -48,7 +48,7 @@ var Theme = (0, import_compose_refs.createRefComponent)(function Theme2(props, r
48
48
  "use no memo";
49
49
  if (props.disable) return props.children;
50
50
  if (process.env.NODE_ENV === "development") {
51
- for (var key in props) if (!import_helpers.reservedThemeProps[key]) (0, import_warnOnce.warnOnce)(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
51
+ for (var key in props) if (!import_helpers.reservedThemeProps[key] && key !== "srcloc" && !key.startsWith("data-")) (0, import_warnOnce.warnOnce)(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
52
52
  }
53
53
  var { passThrough } = props;
54
54
  var isRoot = !!props["_isRoot"];
@@ -48,7 +48,7 @@ var Theme = (0, import_compose_refs.createRefComponent)(function Theme2(props, r
48
48
  "use no memo";
49
49
  if (props.disable) return props.children;
50
50
  if (process.env.NODE_ENV === "development") {
51
- for (var key in props) if (!import_helpers.reservedThemeProps[key]) (0, import_warnOnce.warnOnce)(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
51
+ for (var key in props) if (!import_helpers.reservedThemeProps[key] && key !== "srcloc" && !key.startsWith("data-")) (0, import_warnOnce.warnOnce)(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
52
52
  }
53
53
  var { passThrough } = props;
54
54
  var isRoot = !!props["_isRoot"];
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.native.js","names":[],"sources":["cjs/views/Theme.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Theme_exports = {};\n__export(Theme_exports, {\n\tTheme: () => Theme,\n\tgetThemedChildren: () => getThemedChildren\n});\nmodule.exports = __toCommonJS(Theme_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_createVariable = require(\"../createVariable\");\nvar import_formatDiagnostic = require(\"../helpers/formatDiagnostic\");\nvar import_nativeStyleEngine = require(\"../helpers/nativeStyleEngine\");\nvar import_warnOnce = require(\"../helpers/warnOnce\");\nvar import_useTheme = require(\"../hooks/useTheme\");\nvar import_useThemeState = require(\"../hooks/useThemeState\");\nvar import_ThemeDebug = require(\"./ThemeDebug\");\nvar Theme = (0, import_compose_refs.createRefComponent)(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tfor (var key in props) if (!import_helpers.reservedThemeProps[key]) (0, import_warnOnce.warnOnce)(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tvar { passThrough } = props;\n\tvar isRoot = !!props[\"_isRoot\"];\n\tvar [_, themeState] = (0, import_useTheme.useThemeWithState)(props, isRoot, true);\n\t(0, import_constants.useIsomorphicLayoutEffect)(function() {\n\t\t(0, import_nativeStyleEngine.updateNativeStyleScope)(themeState.id, themeState.name, themeState.theme);\n\t\treturn function() {\n\t\t\treturn (0, import_nativeStyleEngine.removeNativeStyleScope)(themeState.id);\n\t\t};\n\t}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tvar finalChildren = props[\"disable-child-theme\"] ? import_react.Children.map(props.children, function(child) {\n\t\treturn passThrough || !/* @__PURE__ */ (0, import_react.isValidElement)(child) ? child : /* @__PURE__ */ (0, import_react.cloneElement)(child, { [\"data-disable-theme\"]: true });\n\t}) : props.children;\n\tif (ref) try {\n\t\timport_react.default.Children.only(finalChildren);\n\t\tfinalChildren = /* @__PURE__ */ (0, import_react.cloneElement)(finalChildren, { ref });\n\t} catch (e) {}\n\tvar stateRef = (0, import_react.useRef)({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, stateRef = arguments.length > 4 ? arguments[4] : void 0, passThrough = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar { shallow, forceClassName } = props;\n\tvar state = stateRef.current;\n\tvar shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || (0, import_useThemeState.hasThemeUpdatingProps)(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_useThemeState.ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tvar { isInverse, name } = themeState;\n\tvar requiresExtraWrapper = isInverse || forceClassName;\n\tif (!state.hasEverThemed) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || themeState.name === \"dark\" || themeState.name === \"light\") state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tvar parentState = (0, import_useThemeState.getThemeState)(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(process.env.NODE_ENV !== \"production\" ? (0, import_formatDiagnostic.formatDiagnostic)(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}) : \"❌ Error 014\");\n\t\tchildren = import_react.Children.toArray(children).map(function(child) {\n\t\t\treturn /* @__PURE__ */ (0, import_react.isValidElement)(child) ? passThrough ? child : /* @__PURE__ */ (0, import_react.cloneElement)(child, void 0, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (import_constants.isWeb) {\n\t\tvar _props__themeUpdate;\n\t\tvar baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tvar { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tvar inlineClassName = passThrough ? void 0 : (_props__themeUpdate = props._themeUpdate) === null || _props__themeUpdate === void 0 ? void 0 : _props__themeUpdate.className;\n\t\tchildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") {\n\t\t\tvar className1 = requiresExtraWrapper ? `${name.startsWith(\"light\") ? \"t_light\" : name.startsWith(\"dark\") ? \"t_dark\" : \"\"} _dsp_contents` : `_dsp_contents`;\n\t\t\tchildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"span\", {\n\t\t\t\tclassName: className1,\n\t\t\t\tchildren\n\t\t\t});\n\t\t}\n\t\treturn children;\n\t}\n\treturn children;\n}\nvar inertStyle = { display: \"contents\" };\nvar inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nvar empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props) {\n\tvar isRoot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: (themeState === null || themeState === void 0 ? void 0 : themeState.theme) && themeState.isNew ? (0, import_createVariable.variableToString)(themeState.theme.color) : \"\",\n\t\tclassName: (0, import_helpers.getThemeClassNames)(themeState.name, isRoot)\n\t};\n}\n//# sourceMappingURL=Theme.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO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UAAU,WAAW,SAAS,GAAG,sBAAsB,iBAAgB,CAAE,WAAW,MAAM,KAAK,IAAI;EAC9K,YAAY,GAAG,eAAe,mBAAkB,CAAE,WAAW,MAAM,MAAM;CAC1E;AACD"}
1
+ {"version":3,"file":"Theme.native.js","names":[],"sources":["cjs/views/Theme.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Theme_exports = {};\n__export(Theme_exports, {\n\tTheme: () => Theme,\n\tgetThemedChildren: () => getThemedChildren\n});\nmodule.exports = __toCommonJS(Theme_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_createVariable = require(\"../createVariable\");\nvar import_formatDiagnostic = require(\"../helpers/formatDiagnostic\");\nvar import_nativeStyleEngine = require(\"../helpers/nativeStyleEngine\");\nvar import_warnOnce = require(\"../helpers/warnOnce\");\nvar import_useTheme = require(\"../hooks/useTheme\");\nvar import_useThemeState = require(\"../hooks/useThemeState\");\nvar import_ThemeDebug = require(\"./ThemeDebug\");\nvar Theme = (0, import_compose_refs.createRefComponent)(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tfor (var key in props) if (!import_helpers.reservedThemeProps[key] && key !== \"srcloc\" && !key.startsWith(\"data-\")) (0, import_warnOnce.warnOnce)(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tvar { passThrough } = props;\n\tvar isRoot = !!props[\"_isRoot\"];\n\tvar [_, themeState] = (0, import_useTheme.useThemeWithState)(props, isRoot, true);\n\t(0, import_constants.useIsomorphicLayoutEffect)(function() {\n\t\t(0, import_nativeStyleEngine.updateNativeStyleScope)(themeState.id, themeState.name, themeState.theme);\n\t\treturn function() {\n\t\t\treturn (0, import_nativeStyleEngine.removeNativeStyleScope)(themeState.id);\n\t\t};\n\t}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tvar finalChildren = props[\"disable-child-theme\"] ? import_react.Children.map(props.children, function(child) {\n\t\treturn passThrough || !/* @__PURE__ */ (0, import_react.isValidElement)(child) ? child : /* @__PURE__ */ (0, import_react.cloneElement)(child, { [\"data-disable-theme\"]: true });\n\t}) : props.children;\n\tif (ref) try {\n\t\timport_react.default.Children.only(finalChildren);\n\t\tfinalChildren = /* @__PURE__ */ (0, import_react.cloneElement)(finalChildren, { ref });\n\t} catch (e) {}\n\tvar stateRef = (0, import_react.useRef)({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, stateRef = arguments.length > 4 ? arguments[4] : void 0, passThrough = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar { shallow, forceClassName } = props;\n\tvar state = stateRef.current;\n\tvar shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || (0, import_useThemeState.hasThemeUpdatingProps)(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_useThemeState.ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tvar { isInverse, name } = themeState;\n\tvar requiresExtraWrapper = isInverse || forceClassName;\n\tif (!state.hasEverThemed) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || themeState.name === \"dark\" || themeState.name === \"light\") state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tvar parentState = (0, import_useThemeState.getThemeState)(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(process.env.NODE_ENV !== \"production\" ? (0, import_formatDiagnostic.formatDiagnostic)(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}) : \"❌ Error 014\");\n\t\tchildren = import_react.Children.toArray(children).map(function(child) {\n\t\t\treturn /* @__PURE__ */ (0, import_react.isValidElement)(child) ? passThrough ? child : /* @__PURE__ */ (0, import_react.cloneElement)(child, void 0, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (import_constants.isWeb) {\n\t\tvar _props__themeUpdate;\n\t\tvar baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tvar { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tvar inlineClassName = passThrough ? void 0 : (_props__themeUpdate = props._themeUpdate) === null || _props__themeUpdate === void 0 ? void 0 : _props__themeUpdate.className;\n\t\tchildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") {\n\t\t\tvar className1 = requiresExtraWrapper ? `${name.startsWith(\"light\") ? \"t_light\" : name.startsWith(\"dark\") ? \"t_dark\" : \"\"} _dsp_contents` : `_dsp_contents`;\n\t\t\tchildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"span\", {\n\t\t\t\tclassName: className1,\n\t\t\t\tchildren\n\t\t\t});\n\t\t}\n\t\treturn children;\n\t}\n\treturn children;\n}\nvar inertStyle = { display: \"contents\" };\nvar inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nvar empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props) {\n\tvar isRoot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: (themeState === null || themeState === void 0 ? void 0 : themeState.theme) && themeState.isNew ? (0, import_createVariable.variableToString)(themeState.theme.color) : \"\",\n\t\tclassName: (0, import_helpers.getThemeClassNames)(themeState.name, isRoot)\n\t};\n}\n//# sourceMappingURL=Theme.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAC3D,CAAC;CACF;CACA,OAAO;AACR;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKpG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CACpE,OAAO;CACP,YAAY;AACb,CAAC,IAAI,QACL,GACD;AACA,IAAI,gBAAgB,QAAQ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EAAE,YAAY,IAAI,UAAU,cAAc,CAAC,IAAI,0BAA0B,YAAY,OAAO,MAAM;EACtG,IAAI,kBAAkB,cAAc,KAAK,KAAK,sBAAsB,MAAM,kBAAkB,QAAQ,wBAAwB,KAAK,IAAI,KAAK,IAAI,oBAAoB;EAClK,WAA2B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,QAAQ;GAC9D,WAAW,GAAG,UAAU,WAAW,kBAAkB,IAAI,oBAAoB;GAC7E,OAAO,cAAc,YAAY;IAChC;IACA,GAAG;GACJ;GACA;EACD,CAAC;EACD,IAAI,MAAM,kBAAkB,WAAW;GACtC,IAAI,aAAa,uBAAuB,GAAG,KAAK,WAAW,OAAO,IAAI,YAAY,KAAK,WAAW,MAAM,IAAI,WAAW,GAAG,kBAAkB;GAC5I,WAA2B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,QAAQ;IAC9D,WAAW;IACX;GACD,CAAC;EACF;EACA,OAAO;CACR;CACA,OAAO;AACR;AACA,IAAI,aAAa,EAAE,SAAS,WAAW;AACvC,IAAI,sBAAsB;CACzB,SAAS;CACT,SAAS;AACV;AACA,IAAI,QAAQ;CACX,WAAW;CACX,OAAO,KAAK;AACb;AACA,SAAS,0BAA0B,YAAY,OAAO;CACrD,IAAI,SAAS,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC9E,IAAI,CAAC,WAAW,SAAS,CAAC,MAAM,gBAAgB,OAAO;CACvD,OAAO;EACN,QAAQ,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW,UAAU,WAAW,SAAS,GAAG,sBAAsB,iBAAgB,CAAE,WAAW,MAAM,KAAK,IAAI;EAC9K,YAAY,GAAG,eAAe,mBAAkB,CAAE,WAAW,MAAM,MAAM;CAC1E;AACD"}
@@ -14,7 +14,7 @@ function createStyledHOC(component, render, options) {
14
14
  };
15
15
  let out = function StyledHOCComponent(props) {
16
16
  "use no memo";
17
- const { ref, ...rest } = props;
17
+ const { ref = null, ...rest } = props;
18
18
  if (options?.disableTheme) {
19
19
  return render(rest, ref);
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"createStyledHOC.js","names":[],"sources":["esm/createStyledHOC.js"],"sourcesContent":["import React from \"react\";\nimport { componentDisplayName } from \"./helpers/componentDisplayName\";\nimport { Theme } from \"./views/Theme\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createStyledHOC(component, render, options) {\n const staticConfig = component.staticConfig;\n const extendedConfig = {\n ...staticConfig,\n ...options?.staticConfig,\n neverFlatten: true,\n isHOC: true,\n isStyledHOC: false\n };\n let out = function StyledHOCComponent(props) {\n \"use no memo\";\n const { ref, ...rest } = props;\n if (options?.disableTheme) {\n return render(rest, ref);\n }\n const defaultTheme = extendedConfig.defaultProps?.theme;\n const { theme: _, ...themedRest } = rest;\n const element = render({ ...themedRest, \"data-disable-theme\": true }, ref);\n let themeProps = null;\n if (\"debug\" in props) {\n themeProps = { debug: props.debug };\n }\n if (\"theme\" in props || defaultTheme) {\n ;\n (themeProps ||= {}).name = \"theme\" in props ? props.theme : defaultTheme;\n }\n if (!themeProps) {\n return element;\n }\n const context = extendedConfig.context;\n if (!context) {\n return /* @__PURE__ */ jsx(Theme, { \"disable-child-theme\": true, ...themeProps, children: element });\n }\n const contextValue = React.useContext(context);\n let overriddenContextProps;\n for (const key in context.props) {\n const value = props[key];\n if (value !== void 0) {\n ;\n (overriddenContextProps ||= {})[key] = value;\n }\n }\n const Provider = context.Provider;\n return /* @__PURE__ */ jsx(Provider, { ...contextValue, ...overriddenContextProps, children: /* @__PURE__ */ jsx(Theme, { \"disable-child-theme\": true, ...themeProps, children: element }) });\n };\n if (extendedConfig.memo || process.env.TAMAGUI_MEMOIZE_STYLED_HOC) {\n out = React.memo(out);\n }\n const displayName = options?.displayName || component[componentDisplayName];\n if (displayName) {\n out.displayName = displayName;\n out[componentDisplayName] = displayName;\n }\n out.staticConfig = extendedConfig;\n return out;\n}\nexport {\n createStyledHOC\n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AAe,QAAQ,QAAQ,IAAI,4BAA4B;EACjE,MAAM,MAAM,KAAK,GAAG;CACtB;CACA,MAAM,cAAc,SAAS,eAAe,UAAU;CACtD,IAAI,aAAa;EACf,IAAI,cAAc;EAClB,IAAI,wBAAwB;CAC9B;CACA,IAAI,eAAe;CACnB,OAAO;AACT"}
1
+ {"version":3,"file":"createStyledHOC.js","names":[],"sources":["esm/createStyledHOC.js"],"sourcesContent":["import React from \"react\";\nimport { componentDisplayName } from \"./helpers/componentDisplayName\";\nimport { Theme } from \"./views/Theme\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createStyledHOC(component, render, options) {\n const staticConfig = component.staticConfig;\n const extendedConfig = {\n ...staticConfig,\n ...options?.staticConfig,\n neverFlatten: true,\n isHOC: true,\n isStyledHOC: false\n };\n let out = function StyledHOCComponent(props) {\n \"use no memo\";\n const { ref = null, ...rest } = props;\n if (options?.disableTheme) {\n return render(rest, ref);\n }\n const defaultTheme = extendedConfig.defaultProps?.theme;\n const { theme: _, ...themedRest } = rest;\n const element = render({ ...themedRest, \"data-disable-theme\": true }, ref);\n let themeProps = null;\n if (\"debug\" in props) {\n themeProps = { debug: props.debug };\n }\n if (\"theme\" in props || defaultTheme) {\n ;\n (themeProps ||= {}).name = \"theme\" in props ? props.theme : defaultTheme;\n }\n if (!themeProps) {\n return element;\n }\n const context = extendedConfig.context;\n if (!context) {\n return /* @__PURE__ */ jsx(Theme, { \"disable-child-theme\": true, ...themeProps, children: element });\n }\n const contextValue = React.useContext(context);\n let overriddenContextProps;\n for (const key in context.props) {\n const value = props[key];\n if (value !== void 0) {\n ;\n (overriddenContextProps ||= {})[key] = value;\n }\n }\n const Provider = context.Provider;\n return /* @__PURE__ */ jsx(Provider, { ...contextValue, ...overriddenContextProps, children: /* @__PURE__ */ jsx(Theme, { \"disable-child-theme\": true, ...themeProps, children: element }) });\n };\n if (extendedConfig.memo || process.env.TAMAGUI_MEMOIZE_STYLED_HOC) {\n out = React.memo(out);\n }\n const displayName = options?.displayName || component[componentDisplayName];\n if (displayName) {\n out.displayName = displayName;\n out[componentDisplayName] = displayName;\n }\n out.staticConfig = extendedConfig;\n return out;\n}\nexport {\n createStyledHOC\n};\n//# sourceMappingURL=createStyledHOC.js.map\n"],"mappings":";;;;;;AAIA,SAAS,gBAAgB,WAAW,QAAQ,SAAS;CACnD,MAAM,eAAe,UAAU;CAC/B,MAAM,iBAAiB;EACrB,GAAG;EACH,GAAG,SAAS;EACZ,cAAc;EACd,OAAO;EACP,aAAa;CACf;CACA,IAAI,MAAM,SAAS,mBAAmB,OAAO;EAC3C;EACA,MAAM,EAAE,MAAM,MAAM,GAAG,SAAS;EAChC,IAAI,SAAS,cAAc;GACzB,OAAO,OAAO,MAAM,GAAG;EACzB;EACA,MAAM,eAAe,eAAe,cAAc;EAClD,MAAM,EAAE,OAAO,GAAG,GAAG,eAAe;EACpC,MAAM,UAAU,OAAO;GAAE,GAAG;GAAY,sBAAsB;EAAK,GAAG,GAAG;EACzE,IAAI,aAAa;EACjB,IAAI,WAAW,OAAO;GACpB,aAAa,EAAE,OAAO,MAAM,MAAM;EACpC;EACA,IAAI,WAAW,SAAS,cAAc;GACpC;GACA,CAAC,eAAe,CAAC,EAAC,CAAE,OAAO,WAAW,QAAQ,MAAM,QAAQ;EAC9D;EACA,IAAI,CAAC,YAAY;GACf,OAAO;EACT;EACA,MAAM,UAAU,eAAe;EAC/B,IAAI,CAAC,SAAS;GACZ,OAAuB,oBAAI,OAAO;IAAE,uBAAuB;IAAM,GAAG;IAAY,UAAU;GAAQ,CAAC;EACrG;EACA,MAAM,eAAe,MAAM,WAAW,OAAO;EAC7C,IAAI;EACJ,KAAK,MAAM,OAAO,QAAQ,OAAO;GAC/B,MAAM,QAAQ,MAAM;GACpB,IAAI,UAAU,KAAK,GAAG;IACpB;IACA,CAAC,2BAA2B,CAAC,EAAC,CAAE,OAAO;GACzC;EACF;EACA,MAAM,WAAW,QAAQ;EACzB,OAAuB,oBAAI,UAAU;GAAE,GAAG;GAAc,GAAG;GAAwB,UAA0B,oBAAI,OAAO;IAAE,uBAAuB;IAAM,GAAG;IAAY,UAAU;GAAQ,CAAC;EAAE,CAAC;CAC9L;CACA,IAAI,eAAe,QAAQ,QAAQ,IAAI,4BAA4B;EACjE,MAAM,MAAM,KAAK,GAAG;CACtB;CACA,MAAM,cAAc,SAAS,eAAe,UAAU;CACtD,IAAI,aAAa;EACf,IAAI,cAAc;EAClB,IAAI,wBAAwB;CAC9B;CACA,IAAI,eAAe;CACnB,OAAO;AACT"}
@@ -15,7 +15,7 @@ function createStyledHOC(component, render, options) {
15
15
  var out = function StyledHOCComponent(props) {
16
16
  "use no memo";
17
17
  var _extendedConfig_defaultProps;
18
- var { ref, ...rest } = props;
18
+ var { ref = null, ...rest } = props;
19
19
  if (options === null || options === void 0 ? void 0 : options.disableTheme) {
20
20
  return render(rest, ref);
21
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"createStyledHOC.native.js","names":[],"sources":["esm/createStyledHOC.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from \"react\";\nimport { componentDisplayName } from \"./helpers/componentDisplayName\";\nimport { Theme } from \"./views/Theme\";\nfunction createStyledHOC(component, render, options) {\n var staticConfig = component.staticConfig;\n var extendedConfig = {\n ...staticConfig,\n ...options === null || options === void 0 ? void 0 : options.staticConfig,\n neverFlatten: true,\n isHOC: true,\n isStyledHOC: false\n };\n var out = function StyledHOCComponent(props) {\n \"use no memo\";\n var _extendedConfig_defaultProps;\n var { ref, ...rest } = props;\n if (options === null || options === void 0 ? void 0 : options.disableTheme) {\n return render(rest, ref);\n }\n var defaultTheme = (_extendedConfig_defaultProps = extendedConfig.defaultProps) === null || _extendedConfig_defaultProps === void 0 ? void 0 : _extendedConfig_defaultProps.theme;\n var { theme: _, ...themedRest } = rest;\n var element = render({\n ...themedRest,\n \"data-disable-theme\": true\n }, ref);\n var themeProps = null;\n if (\"debug\" in props) {\n themeProps = {\n debug: props.debug\n };\n }\n if (\"theme\" in props || defaultTheme) {\n ;\n (themeProps || (themeProps = {})).name = \"theme\" in props ? props.theme : defaultTheme;\n }\n if (!themeProps) {\n return element;\n }\n var context = extendedConfig.context;\n if (!context) {\n return /* @__PURE__ */ _jsx(Theme, {\n \"disable-child-theme\": true,\n ...themeProps,\n children: element\n });\n }\n var contextValue = React.useContext(context);\n var overriddenContextProps;\n for (var key in context.props) {\n var value = props[key];\n if (value !== void 0) {\n ;\n (overriddenContextProps || (overriddenContextProps = {}))[key] = value;\n }\n }\n var Provider = context.Provider;\n return /* @__PURE__ */ _jsx(Provider, {\n ...contextValue,\n ...overriddenContextProps,\n children: /* @__PURE__ */ _jsx(Theme, {\n \"disable-child-theme\": true,\n ...themeProps,\n children: element\n })\n });\n };\n if (extendedConfig.memo || process.env.TAMAGUI_MEMOIZE_STYLED_HOC) {\n out = /* @__PURE__ */ React.memo(out);\n }\n var displayName = (options === null || options === void 0 ? void 0 : options.displayName) || component[componentDisplayName];\n if (displayName) {\n out.displayName = displayName;\n out[componentDisplayName] = displayName;\n }\n out.staticConfig = extendedConfig;\n return out;\n}\nexport {\n createStyledHOC\n};\n//# sourceMappingURL=createStyledHOC.js.map\n"],"mappings":";;;;;;AAIA,SAAS,gBAAgB,WAAW,QAAQ,SAAS;CACnD,IAAI,eAAe,UAAU;CAC7B,IAAI,iBAAiB;EACnB,GAAG;EACH,GAAG,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ;EAC7D,cAAc;EACd,OAAO;EACP,aAAa;CACf;CACA,IAAI,MAAM,SAAS,mBAAmB,OAAO;EAC3C;EACA,IAAI;EACJ,IAAI,EAAE,KAAK,GAAG,SAAS;EACvB,IAAI,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,cAAc;GAC1E,OAAO,OAAO,MAAM,GAAG;EACzB;EACA,IAAI,gBAAgB,+BAA+B,eAAe,kBAAkB,QAAQ,iCAAiC,KAAK,IAAI,KAAK,IAAI,6BAA6B;EAC5K,IAAI,EAAE,OAAO,GAAG,GAAG,eAAe;EAClC,IAAI,UAAU,OAAO;GACnB,GAAG;GACH,sBAAsB;EACxB,GAAG,GAAG;EACN,IAAI,aAAa;EACjB,IAAI,WAAW,OAAO;GACpB,aAAa,EACX,OAAO,MAAM,MACf;EACF;EACA,IAAI,WAAW,SAAS,cAAc;GACpC;GACA,CAAC,eAAe,aAAa,CAAC,GAAE,CAAE,OAAO,WAAW,QAAQ,MAAM,QAAQ;EAC5E;EACA,IAAI,CAAC,YAAY;GACf,OAAO;EACT;EACA,IAAI,UAAU,eAAe;EAC7B,IAAI,CAAC,SAAS;GACZ,OAAuB,oBAAK,OAAO;IACjC,uBAAuB;IACvB,GAAG;IACH,UAAU;GACZ,CAAC;EACH;EACA,IAAI,eAAe,MAAM,WAAW,OAAO;EAC3C,IAAI;EACJ,KAAK,IAAI,OAAO,QAAQ,OAAO;GAC7B,IAAI,QAAQ,MAAM;GAClB,IAAI,UAAU,KAAK,GAAG;IACpB;IACA,CAAC,2BAA2B,yBAAyB,CAAC,GAAE,CAAE,OAAO;GACnE;EACF;EACA,IAAI,WAAW,QAAQ;EACvB,OAAuB,oBAAK,UAAU;GACpC,GAAG;GACH,GAAG;GACH,UAA0B,oBAAK,OAAO;IACpC,uBAAuB;IACvB,GAAG;IACH,UAAU;GACZ,CAAC;EACH,CAAC;CACH;CACA,IAAI,eAAe,QAAQ,QAAQ,IAAI,4BAA4B;EACjE,MAAsB,sBAAM,KAAK,GAAG;CACtC;CACA,IAAI,eAAe,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,gBAAgB,UAAU;CACvG,IAAI,aAAa;EACf,IAAI,cAAc;EAClB,IAAI,wBAAwB;CAC9B;CACA,IAAI,eAAe;CACnB,OAAO;AACT"}
1
+ {"version":3,"file":"createStyledHOC.native.js","names":[],"sources":["esm/createStyledHOC.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from \"react\";\nimport { componentDisplayName } from \"./helpers/componentDisplayName\";\nimport { Theme } from \"./views/Theme\";\nfunction createStyledHOC(component, render, options) {\n var staticConfig = component.staticConfig;\n var extendedConfig = {\n ...staticConfig,\n ...options === null || options === void 0 ? void 0 : options.staticConfig,\n neverFlatten: true,\n isHOC: true,\n isStyledHOC: false\n };\n var out = function StyledHOCComponent(props) {\n \"use no memo\";\n var _extendedConfig_defaultProps;\n var { ref = null, ...rest } = props;\n if (options === null || options === void 0 ? void 0 : options.disableTheme) {\n return render(rest, ref);\n }\n var defaultTheme = (_extendedConfig_defaultProps = extendedConfig.defaultProps) === null || _extendedConfig_defaultProps === void 0 ? void 0 : _extendedConfig_defaultProps.theme;\n var { theme: _, ...themedRest } = rest;\n var element = render({\n ...themedRest,\n \"data-disable-theme\": true\n }, ref);\n var themeProps = null;\n if (\"debug\" in props) {\n themeProps = {\n debug: props.debug\n };\n }\n if (\"theme\" in props || defaultTheme) {\n ;\n (themeProps || (themeProps = {})).name = \"theme\" in props ? props.theme : defaultTheme;\n }\n if (!themeProps) {\n return element;\n }\n var context = extendedConfig.context;\n if (!context) {\n return /* @__PURE__ */ _jsx(Theme, {\n \"disable-child-theme\": true,\n ...themeProps,\n children: element\n });\n }\n var contextValue = React.useContext(context);\n var overriddenContextProps;\n for (var key in context.props) {\n var value = props[key];\n if (value !== void 0) {\n ;\n (overriddenContextProps || (overriddenContextProps = {}))[key] = value;\n }\n }\n var Provider = context.Provider;\n return /* @__PURE__ */ _jsx(Provider, {\n ...contextValue,\n ...overriddenContextProps,\n children: /* @__PURE__ */ _jsx(Theme, {\n \"disable-child-theme\": true,\n ...themeProps,\n children: element\n })\n });\n };\n if (extendedConfig.memo || process.env.TAMAGUI_MEMOIZE_STYLED_HOC) {\n out = /* @__PURE__ */ React.memo(out);\n }\n var displayName = (options === null || options === void 0 ? void 0 : options.displayName) || component[componentDisplayName];\n if (displayName) {\n out.displayName = displayName;\n out[componentDisplayName] = displayName;\n }\n out.staticConfig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C,GAAE,CAAE,OAAO;GACnE;EACF;EACA,IAAI,WAAW,QAAQ;EACvB,OAAuB,oBAAK,UAAU;GACpC,GAAG;GACH,GAAG;GACH,UAA0B,oBAAK,OAAO;IACpC,uBAAuB;IACvB,GAAG;IACH,UAAU;GACZ,CAAC;EACH,CAAC;CACH;CACA,IAAI,eAAe,QAAQ,QAAQ,IAAI,4BAA4B;EACjE,MAAsB,sBAAM,KAAK,GAAG;CACtC;CACA,IAAI,eAAe,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ,gBAAgB,UAAU;CACvG,IAAI,aAAa;EACf,IAAI,cAAc;EAClB,IAAI,wBAAwB;CAC9B;CACA,IAAI,eAAe;CACnB,OAAO;AACT"}
@@ -14,7 +14,7 @@ const Theme = createRefComponent(function Theme2(props, ref) {
14
14
  "use no memo";
15
15
  if (props.disable) return props.children;
16
16
  if (process.env.NODE_ENV === "development") {
17
- for (const key in props) if (!reservedThemeProps[key]) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
17
+ for (const key in props) if (!reservedThemeProps[key] && key !== "srcloc" && !key.startsWith("data-")) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
18
18
  }
19
19
  const { passThrough } = props;
20
20
  const isRoot = !!props["_isRoot"];
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.js","names":[],"sources":["esm/views/Theme.js"],"sourcesContent":["import { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport React, { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { warnOnce } from \"../helpers/warnOnce\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\nimport { jsx } from \"react/jsx-runtime\";\n\nconst Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tfor (const key in props) if (!reservedThemeProps[key]) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tconst { passThrough } = props;\n\tconst isRoot = !!props[\"_isRoot\"];\n\tconst [_, themeState] = useThemeWithState(props, isRoot, true);\n\tuseIsomorphicLayoutEffect(() => {}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tlet finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, (child) => passThrough || !isValidElement(child) ? child : cloneElement(child, { [\"data-disable-theme\"]: true })) : props.children;\n\tif (ref) try {\n\t\tReact.Children.only(finalChildren);\n\t\tfinalChildren = cloneElement(finalChildren, { ref });\n\t} catch {}\n\tconst stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props, isRoot = false, stateRef, passThrough = false) {\n\tconst { shallow, forceClassName } = props;\n\tconst state = stateRef.current;\n\tlet shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tconst { isInverse, name } = themeState;\n\tconst requiresExtraWrapper = isInverse || forceClassName;\n\tif (!state.hasEverThemed) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || themeState.name === \"dark\" || themeState.name === \"light\") state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tconst parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(process.env.NODE_ENV !== \"production\" ? formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}) : \"❌ Error 014\");\n\t\tchildren = Children.toArray(children).map((child) => {\n\t\t\treturn isValidElement(child) ? passThrough ? child : cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tconst baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tconst { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tconst inlineClassName = passThrough ? void 0 : props._themeUpdate?.className;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") children = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: requiresExtraWrapper ? `${name.startsWith(\"light\") ? \"t_light\" : name.startsWith(\"dark\") ? \"t_dark\" : \"\"} _dsp_contents` : `_dsp_contents`,\n\t\t\tchildren\n\t\t});\n\t\treturn children;\n\t}\n\treturn children;\n}\nconst inertStyle = { display: \"contents\" };\nconst inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nconst empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props, isRoot = false) {\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: themeState?.theme && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;AAYA,MAAM,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC5D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC3C,KAAK,MAAM,OAAO,OAAO,IAAI,CAAC,mBAAmB,MAAM,SAAS,gBAAgB,OAAO,UAAU,IAAI,0EAA0E,IAAI,eAAe;CACnM;CACA,MAAM,EAAE,gBAAgB;CACxB,MAAM,SAAS,CAAC,CAAC,MAAM;CACvB,MAAM,CAAC,GAAG,cAAc,kBAAkB,OAAO,QAAQ,IAAI;CAC7D,gCAAgC,CAAC,GAAG;EACnC,WAAW;EACX,WAAW;EACX,WAAW;CACZ,CAAC;CACD,IAAI,gBAAgB,MAAM,yBAAyB,SAAS,IAAI,MAAM,WAAW,UAAU,eAAe,CAAC,eAAe,KAAK,IAAI,QAAQ,aAAa,OAAO,GAAG,uBAAuB,KAAK,CAAC,CAAC,IAAI,MAAM;CAC1M,IAAI,KAAK,IAAI;EACZ,MAAM,SAAS,KAAK,aAAa;EACjC,gBAAgB,aAAa,eAAe,EAAE,IAA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C,CAAC,IAAI;EACP,CAAC;CACF;CACA,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC3C,IAAI,CAAC,eAAe,MAAM,OAAO,QAAQ,KAAK,sBAAsB;GACnE;GACA;GACA;GACA;GACA,gBAAgB,0BAA0B,YAAY,OAAO,MAAM;EACpE,CAAC;CACF;CACA,IAAI,mBAAmB,OAAO,OAAO;CACrC,IAAI,OAAO;EACV,MAAM,YAAY,MAAM,UAAU,sBAAsB;EACxD,MAAM,EAAE,YAAY,IAAI,UAAU,cAAc,CAAC,IAAI,0BAA0B,YAAY,OAAO,MAAM;EACxG,MAAM,kBAAkB,cAAc,KAAK,IAAI,MAAM,cAAc;EACnE,WAA2B,oBAAI,QAAQ;GACtC,WAAW,GAAG,UAAU,WAAW,kBAAkB,IAAI,oBAAoB;GAC7E,OAAO,cAAc,YAAY;IAChC;IACA,GAAG;GACJ;GACA;EACD,CAAC;EACD,IAAI,MAAM,kBAAkB,WAAW,WAA2B,oBAAI,QAAQ;GAC7E,WAAW,uBAAuB,GAAG,KAAK,WAAW,OAAO,IAAI,YAAY,KAAK,WAAW,MAAM,IAAI,WAAW,GAAG,kBAAkB;GACtI;EACD,CAAC;EACD,OAAO;CACR;CACA,OAAO;AACR;AACA,MAAM,aAAa,EAAE,SAAS,WAAW;AACzC,MAAM,sBAAsB;CAC3B,SAAS;CACT,SAAS;AACV;AACA,MAAM,QAAQ;CACb,WAAW;CACX,OAAO,KAAK;AACb;AACA,SAAS,0BAA0B,YAAY,OAAO,SAAS,OAAO;CACrE,IAAI,CAAC,WAAW,SAAS,CAAC,MAAM,gBAAgB,OAAO;CACvD,OAAO;EACN,OAAO,YAAY,SAAS,WAAW,QAAQ,iBAAiB,WAAW,MAAM,KAAK,IAAI;EAC1F,WAAW,mBAAmB,WAAW,MAAM,MAAM;CACtD;AACD"}
1
+ {"version":3,"file":"Theme.js","names":[],"sources":["esm/views/Theme.js"],"sourcesContent":["import { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport React, { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { warnOnce } from \"../helpers/warnOnce\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\nimport { jsx } from \"react/jsx-runtime\";\n\nconst Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tfor (const key in props) if (!reservedThemeProps[key] && key !== \"srcloc\" && !key.startsWith(\"data-\")) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tconst { passThrough } = props;\n\tconst isRoot = !!props[\"_isRoot\"];\n\tconst [_, themeState] = useThemeWithState(props, isRoot, true);\n\tuseIsomorphicLayoutEffect(() => {}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tlet finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, (child) => passThrough || !isValidElement(child) ? child : cloneElement(child, { [\"data-disable-theme\"]: true })) : props.children;\n\tif (ref) try {\n\t\tReact.Children.only(finalChildren);\n\t\tfinalChildren = cloneElement(finalChildren, { ref });\n\t} catch {}\n\tconst stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props, isRoot = false, stateRef, passThrough = false) {\n\tconst { shallow, forceClassName } = props;\n\tconst state = stateRef.current;\n\tlet shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tconst { isInverse, name } = themeState;\n\tconst requiresExtraWrapper = isInverse || forceClassName;\n\tif (!state.hasEverThemed) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || themeState.name === \"dark\" || themeState.name === \"light\") state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tconst parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(process.env.NODE_ENV !== \"production\" ? formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}) : \"❌ Error 014\");\n\t\tchildren = Children.toArray(children).map((child) => {\n\t\t\treturn isValidElement(child) ? passThrough ? child : cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tconst baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tconst { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tconst inlineClassName = passThrough ? void 0 : props._themeUpdate?.className;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") children = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: requiresExtraWrapper ? `${name.startsWith(\"light\") ? \"t_light\" : name.startsWith(\"dark\") ? \"t_dark\" : \"\"} _dsp_contents` : `_dsp_contents`,\n\t\t\tchildren\n\t\t});\n\t\treturn children;\n\t}\n\treturn children;\n}\nconst inertStyle = { display: \"contents\" };\nconst inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nconst empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props, isRoot = false) {\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: themeState?.theme && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;AAYA,MAAM,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC5D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC3C,KAAK,MAAM,OAAO,OAAO,IAAI,CAAC,mBAAmB,QAAQ,QAAQ,YAAY,CAAC,IAAI,WAAW,OAAO,GAAG,SAAS,gBAAgB,OAAO,UAAU,IAAI,0EAA0E,IAAI,eAAe;CACnP;CACA,MAAM,EAAE,gBAAgB;CACxB,MAAM,SAAS,CAAC,CAAC,MAAM;CACvB,MAAM,CAAC,GAAG,cAAc,kBAAkB,OAAO,QAAQ,IAAI;CAC7D,g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0B,YAAY,OAAO,SAAS,OAAO;CACrE,IAAI,CAAC,WAAW,SAAS,CAAC,MAAM,gBAAgB,OAAO;CACvD,OAAO;EACN,OAAO,YAAY,SAAS,WAAW,QAAQ,iBAAiB,WAAW,MAAM,KAAK,IAAI;EAC1F,WAAW,mBAAmB,WAAW,MAAM,MAAM;CACtD;AACD"}
@@ -15,7 +15,7 @@ var Theme = createRefComponent(function Theme2(props, ref) {
15
15
  "use no memo";
16
16
  if (props.disable) return props.children;
17
17
  if (process.env.NODE_ENV === "development") {
18
- for (var key in props) if (!reservedThemeProps[key]) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
18
+ for (var key in props) if (!reservedThemeProps[key] && key !== "srcloc" && !key.startsWith("data-")) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
19
19
  }
20
20
  var { passThrough } = props;
21
21
  var isRoot = !!props["_isRoot"];
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.native.js","names":[],"sources":["esm/views/Theme.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport React, { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { removeNativeStyleScope, updateNativeStyleScope } from \"../helpers/nativeStyleEngine\";\nimport { warnOnce } from \"../helpers/warnOnce\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\n\nvar Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tfor (var key in props) if (!reservedThemeProps[key]) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tvar { passThrough } = props;\n\tvar isRoot = !!props[\"_isRoot\"];\n\tvar [_, themeState] = useThemeWithState(props, isRoot, true);\n\tuseIsomorphicLayoutEffect(function() {\n\t\tupdateNativeStyleScope(themeState.id, themeState.name, themeState.theme);\n\t\treturn function() {\n\t\t\treturn removeNativeStyleScope(themeState.id);\n\t\t};\n\t}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tvar finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, function(child) {\n\t\treturn passThrough || !/* @__PURE__ */ isValidElement(child) ? child : /* @__PURE__ */ cloneElement(child, { [\"data-disable-theme\"]: true });\n\t}) : props.children;\n\tif (ref) try {\n\t\tReact.Children.only(finalChildren);\n\t\tfinalChildren = /* @__PURE__ */ cloneElement(finalChildren, { ref });\n\t} catch (e) {}\n\tvar stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, stateRef = arguments.length > 4 ? arguments[4] : void 0, passThrough = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar { shallow, forceClassName } = props;\n\tvar state = stateRef.current;\n\tvar shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tvar { isInverse, name } = themeState;\n\tvar requiresExtraWrapper = isInverse || forceClassName;\n\tif (!state.hasEverThemed) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || themeState.name === \"dark\" || themeState.name === \"light\") state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tvar parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(process.env.NODE_ENV !== \"production\" ? formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}) : \"❌ Error 014\");\n\t\tchildren = Children.toArray(children).map(function(child) {\n\t\t\treturn /* @__PURE__ */ isValidElement(child) ? passThrough ? child : /* @__PURE__ */ cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tvar _props__themeUpdate;\n\t\tvar baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tvar { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tvar inlineClassName = passThrough ? void 0 : (_props__themeUpdate = props._themeUpdate) === null || _props__themeUpdate === void 0 ? void 0 : _props__themeUpdate.className;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") children = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: requiresExtraWrapper ? `${name.startsWith(\"light\") ? \"t_light\" : name.startsWith(\"dark\") ? \"t_dark\" : \"\"} _dsp_contents` : `_dsp_contents`,\n\t\t\tchildren\n\t\t});\n\t\treturn children;\n\t}\n\treturn children;\n}\nvar inertStyle = { display: \"contents\" };\nvar inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nvar empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props) {\n\tvar isRoot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: (themeState === null || themeState === void 0 ? void 0 : themeState.theme) && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;;AAaA,IAAI,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC1D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC3C,KAAK,IAAI,OAAO,OAAO,IAAI,CAAC,mBAAmB,MAAM,SAAS,gBAAgB,OAAO,UAAU,IAAI,0EAA0E,IAAI,eAAe;CACjM;CACA,IAAI,EAAE,gBAAgB;CACtB,IAAI,SAAS,CAAC,CAAC,MAAM;CACrB,IAAI,CAAC,GAAG,cAAc,kBAAkB,OAAO,QAAQ,IAAI;CAC3D,0BAA0B,WAAW;EACpC,uBAAuB,WAAW,IAAI,WAAW,MAA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AAkB,WAAW,WAA2B,oBAAI,QAAQ;GAC7E,WAAW,uBAAuB,GAAG,KAAK,WAAW,OAAO,IAAI,YAAY,KAAK,WAAW,MAAM,IAAI,WAAW,GAAG,kBAAkB;GACtI;EACD,CAAC;EACD,OAAO;CACR;CACA,OAAO;AACR;AACA,IAAI,aAAa,EAAE,SAAS,WAAW;AACvC,IAAI,sBAAsB;CACzB,SAAS;CACT,SAAS;AACV;AACA,IAAI,QAAQ;CACX,WAAW;CACX,OAAO,KAAK;AACb;AACA,SAAS,0BAA0B,YAAY,OAAO;CACrD,IAAI,SAAS,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC9E,IAAI,CAAC,WAAW,SAAS,CAAC,MAAM,gBAAgB,OAAO;CACvD,OAAO;EACN,QAAQ,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW,UAAU,WAAW,QAAQ,iBAAiB,WAAW,MAAM,KAAK,IAAI;EACnJ,WAAW,mBAAmB,WAAW,MAAM,MAAM;CACtD;AACD"}
1
+ {"version":3,"file":"Theme.native.js","names":[],"sources":["esm/views/Theme.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport React, { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { removeNativeStyleScope, updateNativeStyleScope } from \"../helpers/nativeStyleEngine\";\nimport { warnOnce } from \"../helpers/warnOnce\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\n\nvar Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tfor (var key in props) if (!reservedThemeProps[key] && key !== \"srcloc\" && !key.startsWith(\"data-\")) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tvar { passThrough } = props;\n\tvar isRoot = !!props[\"_isRoot\"];\n\tvar [_, themeState] = useThemeWithState(props, isRoot, true);\n\tuseIsomorphicLayoutEffect(function() {\n\t\tupdateNativeStyleScope(themeState.id, themeState.name, themeState.theme);\n\t\treturn function() {\n\t\t\treturn removeNativeStyleScope(themeState.id);\n\t\t};\n\t}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tvar finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, function(child) {\n\t\treturn passThrough || !/* @__PURE__ */ isValidElement(child) ? child : /* @__PURE__ */ cloneElement(child, { [\"data-disable-theme\"]: true });\n\t}) : props.children;\n\tif (ref) try {\n\t\tReact.Children.only(finalChildren);\n\t\tfinalChildren = /* @__PURE__ */ cloneElement(finalChildren, { ref });\n\t} catch (e) {}\n\tvar stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, stateRef = arguments.length > 4 ? arguments[4] : void 0, passThrough = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar { shallow, forceClassName } = props;\n\tvar state = stateRef.current;\n\tvar shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tvar { isInverse, name } = themeState;\n\tvar requiresExtraWrapper = isInverse || forceClassName;\n\tif (!state.hasEverThemed) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || themeState.name === \"dark\" || themeState.name === \"light\") state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tvar parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(process.env.NODE_ENV !== \"production\" ? formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}) : \"❌ Error 014\");\n\t\tchildren = Children.toArray(children).map(function(child) {\n\t\t\treturn /* @__PURE__ */ isValidElement(child) ? passThrough ? child : /* @__PURE__ */ cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tvar _props__themeUpdate;\n\t\tvar baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tvar { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tvar inlineClassName = passThrough ? void 0 : (_props__themeUpdate = props._themeUpdate) === null || _props__themeUpdate === void 0 ? void 0 : _props__themeUpdate.className;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") children = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: requiresExtraWrapper ? `${name.startsWith(\"light\") ? \"t_light\" : name.startsWith(\"dark\") ? \"t_dark\" : \"\"} _dsp_contents` : `_dsp_contents`,\n\t\t\tchildren\n\t\t});\n\t\treturn children;\n\t}\n\treturn children;\n}\nvar inertStyle = { display: \"contents\" };\nvar inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nvar empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props) {\n\tvar isRoot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: (themeState === null || themeState === void 0 ? void 0 : themeState.theme) && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;;AAaA,IAAI,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC1D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC3C,KAAK,IAAI,OAAO,OAAO,IAAI,CAAC,mBAAmB,QAAQ,QAAQ,YAAY,CAAC,IAAI,WAAW,OAAO,GAAG,SAAS,gBAAgB,OAAO,UAAU,IAAI,0EAA0E,IAAI,eAAe;CACjP;CACA,IAAI,EAAE,gBAAgB;CACtB,IAAI,SAAS,CAAC,CAAC,MAAM;CACrB,IAAI,CAAC,GAAG,cAAc,kBAAkB,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,OAAO,cAAc,YAAY;IAChC;IACA,GAAG;GACJ;GACA;EACD,CAAC;EACD,IAAI,MAAM,kBAAkB,WAAW,WAA2B,oBAAI,QAAQ;GAC7E,WAAW,uBAAuB,GAAG,KAAK,WAAW,OAAO,IAAI,YAAY,KAAK,WAAW,MAAM,IAAI,WAAW,GAAG,kBAAkB;GACtI;EACD,CAAC;EACD,OAAO;CACR;CACA,OAAO;AACR;AACA,IAAI,aAAa,EAAE,SAAS,WAAW;AACvC,IAAI,sBAAsB;CACzB,SAAS;CACT,SAAS;AACV;AACA,IAAI,QAAQ;CACX,WAAW;CACX,OAAO,KAAK;AACb;AACA,SAAS,0BAA0B,YAAY,OAAO;CACrD,IAAI,SAAS,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC9E,IAAI,CAAC,WAAW,SAAS,CAAC,MAAM,gBAAgB,OAAO;CACvD,OAAO;EACN,QAAQ,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW,UAAU,WAAW,QAAQ,iBAAiB,WAAW,MAAM,KAAK,IAAI;EACnJ,WAAW,mBAAmB,WAAW,MAAM,MAAM;CACtD;AACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/web",
3
- "version": "3.0.0-beta.881.1",
3
+ "version": "3.0.0-beta.889.1",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Nate Wienert"
@@ -100,22 +100,22 @@
100
100
  "test:web": "vitest --typecheck --run"
101
101
  },
102
102
  "dependencies": {
103
- "@tamagui/compose-refs": "3.0.0-beta.881.1",
104
- "@tamagui/constants": "3.0.0-beta.881.1",
105
- "@tamagui/dom": "3.0.0-beta.881.1",
106
- "@tamagui/helpers": "3.0.0-beta.881.1",
107
- "@tamagui/is-equal-shallow": "3.0.0-beta.881.1",
108
- "@tamagui/native": "3.0.0-beta.881.1",
109
- "@tamagui/normalize-css-color": "3.0.0-beta.881.1",
110
- "@tamagui/style-grammar": "3.0.0-beta.881.1",
111
- "@tamagui/timer": "3.0.0-beta.881.1",
112
- "@tamagui/types": "3.0.0-beta.881.1",
113
- "@tamagui/use-did-finish-ssr": "3.0.0-beta.881.1",
114
- "@tamagui/use-event": "3.0.0-beta.881.1",
115
- "@tamagui/use-force-update": "3.0.0-beta.881.1"
103
+ "@tamagui/compose-refs": "3.0.0-beta.889.1",
104
+ "@tamagui/constants": "3.0.0-beta.889.1",
105
+ "@tamagui/dom": "3.0.0-beta.889.1",
106
+ "@tamagui/helpers": "3.0.0-beta.889.1",
107
+ "@tamagui/is-equal-shallow": "3.0.0-beta.889.1",
108
+ "@tamagui/native": "3.0.0-beta.889.1",
109
+ "@tamagui/normalize-css-color": "3.0.0-beta.889.1",
110
+ "@tamagui/style-grammar": "3.0.0-beta.889.1",
111
+ "@tamagui/timer": "3.0.0-beta.889.1",
112
+ "@tamagui/types": "3.0.0-beta.889.1",
113
+ "@tamagui/use-did-finish-ssr": "3.0.0-beta.889.1",
114
+ "@tamagui/use-event": "3.0.0-beta.889.1",
115
+ "@tamagui/use-force-update": "3.0.0-beta.889.1"
116
116
  },
117
117
  "devDependencies": {
118
- "@tamagui/build": "3.0.0-beta.881.1",
118
+ "@tamagui/build": "3.0.0-beta.889.1",
119
119
  "@testing-library/react": "^16.1.0",
120
120
  "csstype": "^3.0.10",
121
121
  "react": "19.2.3",
@@ -35,7 +35,9 @@ export function createStyledHOC<
35
35
  : Props
36
36
  > &
37
37
  CustomProps,
38
- ref?: ReactRef<NoInfer<Ref>>
38
+ // always a ref value (null when the caller passed none), so a render
39
+ // callback may declare a required `Ref<TamaguiElement>` parameter
40
+ ref: ReactRef<NoInfer<Ref>> | null
39
41
  ) => ReactNode,
40
42
  options?: StyledHOCOptions
41
43
  ): TamaguiComponent<
@@ -70,7 +72,7 @@ export function createStyledHOC<
70
72
  let out: any = function StyledHOCComponent(props: any) {
71
73
  'use no memo'
72
74
 
73
- const { ref, ...rest } = props
75
+ const { ref = null, ...rest } = props
74
76
  if (options?.disableTheme) {
75
77
  return render(rest, ref)
76
78
  }
@@ -33,7 +33,9 @@ export const Theme = createRefComponent(function Theme(
33
33
 
34
34
  if (process.env.NODE_ENV === 'development') {
35
35
  for (const key in props) {
36
- if (!reservedThemeProps[key]) {
36
+ // bundler dev tooling stamps source locations onto every element
37
+ // (`data-one-source` on web, `srcloc` on native); those are not values
38
+ if (!reservedThemeProps[key] && key !== 'srcloc' && !key.startsWith('data-')) {
37
39
  warnOnce(
38
40
  `theme-update:${key}`,
39
41
  `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`
@@ -1,4 +1,4 @@
1
1
  import { type ReactNode, type Ref as ReactRef } from 'react';
2
2
  import type { GetFinalProps, StyledHOCMergedProps, StyledHOCOptions, TamaguiComponent, TamaDefer } from './types';
3
- export declare function createStyledHOC<Props, Ref, NonStyledProps, BaseStyles extends object, VariantProps, ParentStaticProperties, CustomProps extends object = {}>(component: TamaguiComponent<Props, Ref, NonStyledProps, BaseStyles, VariantProps, ParentStaticProperties>, render: (props: NoInfer<Props extends TamaDefer ? GetFinalProps<NonStyledProps, BaseStyles, VariantProps> : Props> & CustomProps, ref?: ReactRef<NoInfer<Ref>>) => ReactNode, options?: StyledHOCOptions): TamaguiComponent<keyof CustomProps extends never ? Props : StyledHOCMergedProps<Props extends TamaDefer ? GetFinalProps<NonStyledProps, BaseStyles, VariantProps> : Props, CustomProps>, Ref, NonStyledProps & CustomProps, BaseStyles, VariantProps, ParentStaticProperties>;
3
+ export declare function createStyledHOC<Props, Ref, NonStyledProps, BaseStyles extends object, VariantProps, ParentStaticProperties, CustomProps extends object = {}>(component: TamaguiComponent<Props, Ref, NonStyledProps, BaseStyles, VariantProps, ParentStaticProperties>, render: (props: NoInfer<Props extends TamaDefer ? GetFinalProps<NonStyledProps, BaseStyles, VariantProps> : Props> & CustomProps, ref: ReactRef<NoInfer<Ref>> | null) => ReactNode, options?: StyledHOCOptions): TamaguiComponent<keyof CustomProps extends never ? Props : StyledHOCMergedProps<Props extends TamaDefer ? GetFinalProps<NonStyledProps, BaseStyles, VariantProps> : Props, CustomProps>, Ref, NonStyledProps & CustomProps, BaseStyles, VariantProps, ParentStaticProperties>;
4
4
  //# sourceMappingURL=createStyledHOC.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createStyledHOC.d.ts","sourceRoot":"","sources":["../src/createStyledHOC.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,IAAI,QAAQ,EAAE,MAAM,OAAO,CAAA;AAGnE,OAAO,KAAK,EACV,aAAa,EAEb,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EAEV,MAAM,SAAS,CAAA;AAEhB,wBAAgB,eAAe,CAC7B,KAAK,EACL,GAAG,EACH,cAAc,EACd,UAAU,SAAS,MAAM,EACzB,YAAY,EACZ,sBAAsB,EACtB,WAAW,SAAS,MAAM,GAAG,EAAE,EAE/B,SAAS,EAAE,gBAAgB,CACzB,KAAK,EACL,GAAG,EACH,cAAc,EACd,UAAU,EACV,YAAY,EACZ,sBAAsB,CACvB,EACD,MAAM,EAAE,CACN,KAAK,EAAE,OAAO,CACZ,KAAK,SAAS,SAAS,GACnB,aAAa,CAAC,cAAc,EAAE,UAAU,EAAE,YAAY,CAAC,GACvD,KAAK,CACV,GACC,WAAW,EACb,GAAG,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KACzB,SAAS,EACd,OAAO,CAAC,EAAE,gBAAgB,GACzB,gBAAgB,CAKjB,MAAM,WAAW,SAAS,KAAK,GAC3B,KAAK,GACL,oBAAoB,CAClB,KAAK,SAAS,SAAS,GACnB,aAAa,CAAC,cAAc,EAAE,UAAU,EAAE,YAAY,CAAC,GACvD,KAAK,EACT,WAAW,CACZ,EACL,GAAG,EACH,cAAc,GAAG,WAAW,EAC5B,UAAU,EACV,YAAY,EACZ,sBAAsB,CACvB,CA4EA"}
1
+ {"version":3,"file":"createStyledHOC.d.ts","sourceRoot":"","sources":["../src/createStyledHOC.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,IAAI,QAAQ,EAAE,MAAM,OAAO,CAAA;AAGnE,OAAO,KAAK,EACV,aAAa,EAEb,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EAEV,MAAM,SAAS,CAAA;AAEhB,wBAAgB,eAAe,CAC7B,KAAK,EACL,GAAG,EACH,cAAc,EACd,UAAU,SAAS,MAAM,EACzB,YAAY,EACZ,sBAAsB,EACtB,WAAW,SAAS,MAAM,GAAG,EAAE,EAE/B,SAAS,EAAE,gBAAgB,CACzB,KAAK,EACL,GAAG,EACH,cAAc,EACd,UAAU,EACV,YAAY,EACZ,sBAAsB,CACvB,EACD,MAAM,EAAE,CACN,KAAK,EAAE,OAAO,CACZ,KAAK,SAAS,SAAS,GACnB,aAAa,CAAC,cAAc,EAAE,UAAU,EAAE,YAAY,CAAC,GACvD,KAAK,CACV,GACC,WAAW,EAGb,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,KAC/B,SAAS,EACd,OAAO,CAAC,EAAE,gBAAgB,GACzB,gBAAgB,CAKjB,MAAM,WAAW,SAAS,KAAK,GAC3B,KAAK,GACL,oBAAoB,CAClB,KAAK,SAAS,SAAS,GACnB,aAAa,CAAC,cAAc,EAAE,UAAU,EAAE,YAAY,CAAC,GACvD,KAAK,EACT,WAAW,CACZ,EACL,GAAG,EACH,cAAc,GAAG,WAAW,EAC5B,UAAU,EACV,YAAY,EACZ,sBAAsB,CACvB,CA4EA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../src/views/Theme.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAe7C,OAAO,KAAK,EAAc,UAAU,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAG9E,KAAK,uBAAuB,GAAG,sBAAsB,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAE7E,eAAO,MAAM,KAAK,gFAoEhB,CAAA;AAIF,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,GAAG,EACb,KAAK,EAAE,uBAAuB,EAC9B,MAAM,qBAAQ,EACd,QAAQ,EAAE,gBAAgB,CAAC;IAAE,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,CAAC,EACnE,WAAW,UAAQ,OAsIpB"}
1
+ {"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../src/views/Theme.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAe7C,OAAO,KAAK,EAAc,UAAU,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAG9E,KAAK,uBAAuB,GAAG,sBAAsB,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAE7E,eAAO,MAAM,KAAK,gFAsEhB,CAAA;AAIF,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,GAAG,EACb,KAAK,EAAE,uBAAuB,EAC9B,MAAM,qBAAQ,EACd,QAAQ,EAAE,gBAAgB,CAAC;IAAE,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,CAAC,EACnE,WAAW,UAAQ,OAsIpB"}