@multiplatform.one/theme 10.10.3 → 10.11.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.
@@ -54,7 +54,7 @@ function leadingFor(fontSize) {
54
54
  return import_scaleInputs.FONT_KEYS.includes(key) ? key : void 0;
55
55
  }
56
56
  function consumerLeading(lineHeight) {
57
- return import_tamagui.isWeb && typeof lineHeight === "number" ? { lineHeight: `${lineHeight}px` } : {};
57
+ return typeof lineHeight === "number" && lineHeight > 4 ? { lineHeight: `${lineHeight}px` } : {};
58
58
  }
59
59
  function useBodyVoice(fontWeight, { variant, tabular } = {}) {
60
60
  const { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)();
@@ -56,7 +56,7 @@ function leadingFor(fontSize) {
56
56
  return import_scaleInputs.FONT_KEYS.includes(key) ? key : void 0;
57
57
  }
58
58
  function consumerLeading(lineHeight) {
59
- return import_tamagui.isWeb && typeof lineHeight === "number" ? { lineHeight: `${lineHeight}px` } : {};
59
+ return typeof lineHeight === "number" && lineHeight > 4 ? { lineHeight: `${lineHeight}px` } : {};
60
60
  }
61
61
  function useBodyVoice(fontWeight) {
62
62
  var { variant, tabular } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
@@ -56,7 +56,7 @@ function leadingFor(fontSize) {
56
56
  return import_scaleInputs.FONT_KEYS.includes(key) ? key : void 0;
57
57
  }
58
58
  function consumerLeading(lineHeight) {
59
- return import_tamagui.isWeb && typeof lineHeight === "number" ? { lineHeight: `${lineHeight}px` } : {};
59
+ return typeof lineHeight === "number" && lineHeight > 4 ? { lineHeight: `${lineHeight}px` } : {};
60
60
  }
61
61
  function useBodyVoice(fontWeight) {
62
62
  var { variant, tabular } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
@@ -1 +1 @@
1
- {"version":3,"file":"Text.native.js","names":[],"sources":["cjs/theme/Text.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 Text_exports = {};\n__export(Text_exports, {\n Anchor: () => Anchor,\n Paragraph: () => Paragraph,\n SizableText: () => SizableText,\n Text: () => Text\n});\nmodule.exports = __toCommonJS(Text_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_readableColor = require(\"./readableColor\");\nvar import_scaleInputs = require(\"./scale/scaleInputs\");\nvar import_useResolvedKnobs = require(\"./useResolvedKnobs\");\nvar import_tamagui = require(\"tamagui\");\nfunction bodyStop(body, props) {\n if (props.size !== void 0) {\n var { lineHeight: _lineHeight, letterSpacing: _letterSpacing, ...voice } = body;\n return {\n ...voice,\n fontSize: void 0,\n lineHeight: void 0,\n letterSpacing: void 0\n };\n }\n return {\n ...body,\n fontSize: \"4\",\n lineHeight: leadingFor(props.fontSize)\n };\n}\nfunction leadingFor(fontSize) {\n if (fontSize === void 0) return \"4\";\n if (typeof fontSize !== \"string\") return void 0;\n var key = fontSize.startsWith(\"$\") ? fontSize.slice(1) : fontSize;\n return import_scaleInputs.FONT_KEYS.includes(key) ? key : void 0;\n}\nfunction consumerLeading(lineHeight) {\n return import_tamagui.isWeb && typeof lineHeight === \"number\" ? {\n lineHeight: `${lineHeight}px`\n } : {};\n}\nfunction useBodyVoice(fontWeight) {\n var { variant, tabular } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)();\n var { fontWeight: knobWeight, ...body } = knobProps.body;\n return {\n body,\n variantProps: variant === \"mutedMono\" ? knobProps.typography.mutedMono : void 0,\n digitProps: tabular ? knobProps.typography.tabular : void 0,\n color: knobProps.textAccentColor,\n weight: fontWeight !== null && fontWeight !== void 0 ? fontWeight : knobWeight\n };\n}\nfunction Text(param) {\n var { fontWeight, variant, tabular, style, ...props } = param;\n var { body, color, weight, variantProps, digitProps } = useBodyVoice(fontWeight, {\n variant,\n tabular: tabular && props.fontVariant === void 0\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Text, {\n ...bodyStop(body, props),\n color,\n ...variantProps,\n ...digitProps,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight,\n style: (digitProps === null || digitProps === void 0 ? void 0 : digitProps.style) ? [\n digitProps.style,\n ...[\n style\n ].flat()\n ] : style\n });\n}\nfunction SizableText(param) {\n var { fontWeight, ...props } = param;\n var { body, color, weight } = useBodyVoice(fontWeight);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.SizableText, {\n ...bodyStop(body, props),\n color,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight\n });\n}\nfunction Paragraph(param) {\n var { fontWeight, variant, tabular, style, ...props } = param;\n var { body, color, weight, variantProps, digitProps } = useBodyVoice(fontWeight, {\n variant,\n tabular: tabular && props.fontVariant === void 0\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, {\n ...bodyStop(body, props),\n color,\n ...variantProps,\n ...digitProps,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight,\n style: (digitProps === null || digitProps === void 0 ? void 0 : digitProps.style) ? [\n digitProps.style,\n ...[\n style\n ].flat()\n ] : style\n });\n}\nvar linkInkByIntent = {\n error: \"$red-11\"\n};\nfunction Anchor(param) {\n var { fontWeight, inline, intent, ...props } = param;\n var { body, weight } = useBodyVoice(fontWeight);\n var accentInk = (0, import_readableColor.useAccentOnSurface)();\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Anchor, {\n // link-chrome-escape: the house Anchor is where link chrome is drawn (LC-181).\n ...bodyStop(body, props),\n color: intent ? linkInkByIntent[intent] : accentInk,\n textDecorationLine: inline ? \"underline\" : {\n default: \"none\",\n hover: \"underline\"\n },\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight\n });\n}\n//# sourceMappingURL=Text.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,eAAe,CAAC;AACpB,SAAS,cAAc;CACrB,cAAc;CACd,iBAAiB;CACjB,mBAAmB;CACnB,YAAY;AACd,CAAC;AACD,OAAO,UAAU,aAAa,YAAY;AAC1C,IAAI,qBAAqB,QAAQ,mBAAmB;AACpD,IAAI,uBAAuB,QAAQ,2BAAiB;AACpD,IAAI,qBAAqB,QAAQ,+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OAAO;CACrB,IAAI,EAAE,YAAY,QAAQ,QAAQ,GAAG,UAAU;CAC/C,IAAI,EAAE,MAAM,WAAW,aAAa,UAAU;CAC9C,IAAI,aAAa,GAAG,qBAAqB,mBAAkB,CAAE;CAC7D,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,eAAe,QAAQ;EAExE,GAAG,SAAS,MAAM,KAAK;EACvB,OAAO,SAAS,gBAAgB,UAAU;EAC1C,oBAAoB,SAAS,cAAc;GACzC,SAAS;GACT,OAAO;EACT;EACA,GAAG;EACH,GAAG,gBAAgB,MAAM,UAAU;EACnC,YAAY;CACd,CAAC;AACH"}
1
+ {"version":3,"file":"Text.native.js","names":[],"sources":["cjs/theme/Text.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 Text_exports = {};\n__export(Text_exports, {\n Anchor: () => Anchor,\n Paragraph: () => Paragraph,\n SizableText: () => SizableText,\n Text: () => Text\n});\nmodule.exports = __toCommonJS(Text_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_readableColor = require(\"./readableColor\");\nvar import_scaleInputs = require(\"./scale/scaleInputs\");\nvar import_useResolvedKnobs = require(\"./useResolvedKnobs\");\nvar import_tamagui = require(\"tamagui\");\nfunction bodyStop(body, props) {\n if (props.size !== void 0) {\n var { lineHeight: _lineHeight, letterSpacing: _letterSpacing, ...voice } = body;\n return {\n ...voice,\n fontSize: void 0,\n lineHeight: void 0,\n letterSpacing: void 0\n };\n }\n return {\n ...body,\n fontSize: \"4\",\n lineHeight: leadingFor(props.fontSize)\n };\n}\nfunction leadingFor(fontSize) {\n if (fontSize === void 0) return \"4\";\n if (typeof fontSize !== \"string\") return void 0;\n var key = fontSize.startsWith(\"$\") ? fontSize.slice(1) : fontSize;\n return import_scaleInputs.FONT_KEYS.includes(key) ? key : void 0;\n}\nfunction consumerLeading(lineHeight) {\n return typeof lineHeight === \"number\" && lineHeight > 4 ? {\n lineHeight: `${lineHeight}px`\n } : {};\n}\nfunction useBodyVoice(fontWeight) {\n var { variant, tabular } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var { knobProps } = (0, import_useResolvedKnobs.useResolvedKnobs)();\n var { fontWeight: knobWeight, ...body } = knobProps.body;\n return {\n body,\n variantProps: variant === \"mutedMono\" ? knobProps.typography.mutedMono : void 0,\n digitProps: tabular ? knobProps.typography.tabular : void 0,\n color: knobProps.textAccentColor,\n weight: fontWeight !== null && fontWeight !== void 0 ? fontWeight : knobWeight\n };\n}\nfunction Text(param) {\n var { fontWeight, variant, tabular, style, ...props } = param;\n var { body, color, weight, variantProps, digitProps } = useBodyVoice(fontWeight, {\n variant,\n tabular: tabular && props.fontVariant === void 0\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Text, {\n ...bodyStop(body, props),\n color,\n ...variantProps,\n ...digitProps,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight,\n style: (digitProps === null || digitProps === void 0 ? void 0 : digitProps.style) ? [\n digitProps.style,\n ...[\n style\n ].flat()\n ] : style\n });\n}\nfunction SizableText(param) {\n var { fontWeight, ...props } = param;\n var { body, color, weight } = useBodyVoice(fontWeight);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.SizableText, {\n ...bodyStop(body, props),\n color,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight\n });\n}\nfunction Paragraph(param) {\n var { fontWeight, variant, tabular, style, ...props } = param;\n var { body, color, weight, variantProps, digitProps } = useBodyVoice(fontWeight, {\n variant,\n tabular: tabular && props.fontVariant === void 0\n });\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, {\n ...bodyStop(body, props),\n color,\n ...variantProps,\n ...digitProps,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight,\n style: (digitProps === null || digitProps === void 0 ? void 0 : digitProps.style) ? [\n digitProps.style,\n ...[\n style\n ].flat()\n ] : style\n });\n}\nvar linkInkByIntent = {\n error: \"$red-11\"\n};\nfunction Anchor(param) {\n var { fontWeight, inline, intent, ...props } = param;\n var { body, weight } = useBodyVoice(fontWeight);\n var accentInk = (0, import_readableColor.useAccentOnSurface)();\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Anchor, {\n // link-chrome-escape: the house Anchor is where link chrome is drawn (LC-181).\n ...bodyStop(body, props),\n color: intent ? linkInkByIntent[intent] : accentInk,\n textDecorationLine: inline ? \"underline\" : {\n default: \"none\",\n hover: \"underline\"\n },\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight\n });\n}\n//# sourceMappingURL=Text.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,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AG,UAAU;CACxD,IAAI,EAAE,MAAM,OAAO,QAAQ,cAAc,eAAe,aAAa,YAAY;EAC/E;EACA,SAAS,WAAW,MAAM,gBAAgB,KAAK;CACjD,CAAC;CACD,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,eAAe,WAAW;EAC3E,GAAG,SAAS,MAAM,KAAK;EACvB;EACA,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG,gBAAgB,MAAM,UAAU;EACnC,YAAY;EACZ,QAAQ,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW,SAAS,CAClF,WAAW,OACX,GAAG,CACD,KACF,CAAC,CAAC,KAAK,CACT,IAAI;CACN,CAAC;AACH;AACA,IAAI,kBAAkB,EACpB,OAAO,UACT;AACA,SAAS,OAAO,OAAO;CACrB,IAAI,EAAE,YAAY,QAAQ,QAAQ,GAAG,UAAU;CAC/C,IAAI,EAAE,MAAM,WAAW,aAAa,UAAU;CAC9C,IAAI,aAAa,GAAG,qBAAqB,mBAAkB,CAAE;CAC7D,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,eAAe,QAAQ;EAExE,GAAG,SAAS,MAAM,KAAK;EACvB,OAAO,SAAS,gBAAgB,UAAU;EAC1C,oBAAoB,SAAS,cAAc;GACzC,SAAS;GACT,OAAO;EACT;EACA,GAAG;EACH,GAAG,gBAAgB,MAAM,UAAU;EACnC,YAAY;CACd,CAAC;AACH"}
@@ -24,8 +24,7 @@ module.exports = __toCommonJS(nativeTransitionProps_exports);
24
24
  var import_reactNative = require("./animations/reactNative.cjs");
25
25
  function transitionProps(role, extra = []) {
26
26
  const isRole = isMotionRole(role);
27
- const transition = isRole ? role.transition : role;
28
- if (transition === void 0) return {};
27
+ const transition = (isRole ? role.transition : role) ?? instant;
29
28
  if (!isRole) return { transition };
30
29
  const properties = [...role.animateOnly, ...extra].flatMap((property) => nativeLonghands[property] ?? [property]).join(", ");
31
30
  if (typeof transition !== "string") return { transition: {
@@ -44,6 +43,7 @@ function transitionProps(role, extra = []) {
44
43
  } } : {}
45
44
  } };
46
45
  }
46
+ const instant = "0ms";
47
47
  function isSpring(stop) {
48
48
  const config = import_reactNative.animationConfig[stop];
49
49
  return config !== void 0 && config.type !== "timing";
@@ -26,9 +26,9 @@ module.exports = __toCommonJS(nativeTransitionProps_exports);
26
26
  var import_reactNative = require("./animations/reactNative.native.js");
27
27
  function transitionProps(role) {
28
28
  var extra = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
29
+ var _ref;
29
30
  var isRole = isMotionRole(role);
30
- var transition = isRole ? role.transition : role;
31
- if (transition === void 0) return {};
31
+ var transition = (_ref = isRole ? role.transition : role) !== null && _ref !== void 0 ? _ref : instant;
32
32
  if (!isRole) return { transition };
33
33
  var properties = [...role.animateOnly, ...extra].flatMap(function(property) {
34
34
  var _nativeLonghands_property;
@@ -50,6 +50,7 @@ function transitionProps(role) {
50
50
  } } : {}
51
51
  } };
52
52
  }
53
+ var instant = "0ms";
53
54
  function isSpring(stop) {
54
55
  var config = import_reactNative.animationConfig[stop];
55
56
  return config !== void 0 && config.type !== "timing";
@@ -26,9 +26,9 @@ module.exports = __toCommonJS(nativeTransitionProps_exports);
26
26
  var import_reactNative = require("./animations/reactNative.native.js");
27
27
  function transitionProps(role) {
28
28
  var extra = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
29
+ var _ref;
29
30
  var isRole = isMotionRole(role);
30
- var transition = isRole ? role.transition : role;
31
- if (transition === void 0) return {};
31
+ var transition = (_ref = isRole ? role.transition : role) !== null && _ref !== void 0 ? _ref : instant;
32
32
  if (!isRole) return { transition };
33
33
  var properties = [...role.animateOnly, ...extra].flatMap(function(property) {
34
34
  var _nativeLonghands_property;
@@ -50,6 +50,7 @@ function transitionProps(role) {
50
50
  } } : {}
51
51
  } };
52
52
  }
53
+ var instant = "0ms";
53
54
  function isSpring(stop) {
54
55
  var config = import_reactNative.animationConfig[stop];
55
56
  return config !== void 0 && config.type !== "timing";
@@ -1 +1 @@
1
- {"version":3,"file":"nativeTransitionProps.native.js","names":[],"sources":["cjs/theme/nativeTransitionProps.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 nativeTransitionProps_exports = {};\n__export(nativeTransitionProps_exports, {\n transitionProps: () => transitionProps\n});\nmodule.exports = __toCommonJS(nativeTransitionProps_exports);\nvar import_reactNative = require(\"./animations/reactNative\");\nfunction transitionProps(role) {\n var extra = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];\n var isRole = isMotionRole(role);\n var transition = isRole ? role.transition : role;\n if (transition === void 0) return {};\n if (!isRole) return {\n transition\n };\n var properties = [\n ...role.animateOnly,\n ...extra\n ].flatMap(function(property) {\n var _nativeLonghands_property;\n return (_nativeLonghands_property = nativeLonghands[property]) !== null && _nativeLonghands_property !== void 0 ? _nativeLonghands_property : [\n property\n ];\n }).join(\", \");\n if (typeof transition !== \"string\") return {\n transition: {\n ...transition,\n properties\n }\n };\n var exit = typeof role.exit === \"string\" && role.exit !== transition ? role.exit : void 0;\n var clamp = isSpring(transition) && !presetBounce.has(transition);\n return {\n transition: {\n preset: transition,\n properties,\n ...clamp ? {\n spring: {\n overshootClamping: true\n }\n } : {},\n ...exit ? {\n exit: {\n preset: exit,\n properties\n }\n } : {}\n }\n };\n}\nfunction isSpring(stop) {\n var config = import_reactNative.animationConfig[stop];\n return config !== void 0 && config.type !== \"timing\";\n}\nvar presetBounce = /* @__PURE__ */ new Set([\n \"bouncy\",\n \"superBouncy\"\n]);\nvar nativeLonghands = {\n borderColor: [\n \"borderColor\",\n \"borderTopColor\",\n \"borderRightColor\",\n \"borderBottomColor\",\n \"borderLeftColor\"\n ]\n};\nfunction isMotionRole(value) {\n return typeof value === \"object\" && value !== null && \"transition\" in value && \"animateOnly\" in value && Array.isArray(value.animateOnly);\n}\n//# sourceMappingURL=nativeTransitionProps.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,gCAAgC,CAAC;AACrC,SAAS,+BAA+B,EACtC,uBAAuB,gBACzB,CAAC;AACD,OAAO,UAAU,aAAa,6BAA6B;AAC3D,IAAI,qBAAqB,QAAQ,oCAA0B;AAC3D,SAAS,gBAAgB,MAAM;CAC7B,IAAI,QAAQ,UAAU,SA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ransitionProps.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 nativeTransitionProps_exports = {};\n__export(nativeTransitionProps_exports, {\n transitionProps: () => transitionProps\n});\nmodule.exports = __toCommonJS(nativeTransitionProps_exports);\nvar import_reactNative = require(\"./animations/reactNative\");\nfunction transitionProps(role) {\n var extra = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];\n var _ref;\n var isRole = isMotionRole(role);\n var transition = (_ref = isRole ? role.transition : role) !== null && _ref !== void 0 ? _ref : instant;\n if (!isRole) return {\n transition\n };\n var properties = [\n ...role.animateOnly,\n ...extra\n ].flatMap(function(property) {\n var _nativeLonghands_property;\n return (_nativeLonghands_property = nativeLonghands[property]) !== null && _nativeLonghands_property !== void 0 ? _nativeLonghands_property : [\n property\n ];\n }).join(\", \");\n if (typeof transition !== \"string\") return {\n transition: {\n ...transition,\n properties\n }\n };\n var exit = typeof role.exit === \"string\" && role.exit !== transition ? role.exit : void 0;\n var clamp = isSpring(transition) && !presetBounce.has(transition);\n return {\n transition: {\n preset: transition,\n properties,\n ...clamp ? {\n spring: {\n overshootClamping: true\n }\n } : {},\n ...exit ? {\n exit: {\n preset: exit,\n properties\n }\n } : {}\n }\n };\n}\nvar instant = \"0ms\";\nfunction isSpring(stop) {\n var config = import_reactNative.animationConfig[stop];\n return config !== void 0 && config.type !== \"timing\";\n}\nvar presetBounce = /* @__PURE__ */ new Set([\n \"bouncy\",\n \"superBouncy\"\n]);\nvar nativeLonghands = {\n borderColor: [\n \"borderColor\",\n \"borderTopColor\",\n \"borderRightColor\",\n \"borderBottomColor\",\n \"borderLeftColor\"\n ]\n};\nfunction isMotionRole(value) {\n return typeof value === \"object\" && value !== null && \"transition\" in value && \"animateOnly\" in value && Array.isArray(value.animateOnly);\n}\n//# sourceMappingURL=nativeTransitionProps.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,gCAAgC,CAAC;AACrC,SAAS,+BAA+B,EACtC,uBAAuB,gBACzB,CAAC;AACD,OAAO,UAAU,aAAa,6BAA6B;AAC3D,IAAI,qBAAqB,QAAQ,oCAA0B;AAC3D,SAAS,gBAAgB,MAAM;CAC7B,IAAI,QAAQ,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,U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{ FONT_KEYS } from "./scale/scaleInputs.mjs";
3
3
  import { useResolvedKnobs } from "./useResolvedKnobs.mjs";
4
- import { Anchor as Anchor$1, Paragraph as Paragraph$1, SizableText as SizableText$1, Text as Text$1, isWeb } from "tamagui";
4
+ import { Anchor as Anchor$1, Paragraph as Paragraph$1, SizableText as SizableText$1, Text as Text$1 } from "tamagui";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
 
7
7
  function bodyStop(body, props) {
@@ -27,7 +27,7 @@ function leadingFor(fontSize) {
27
27
  return FONT_KEYS.includes(key) ? key : void 0;
28
28
  }
29
29
  function consumerLeading(lineHeight) {
30
- return isWeb && typeof lineHeight === "number" ? { lineHeight: `${lineHeight}px` } : {};
30
+ return typeof lineHeight === "number" && lineHeight > 4 ? { lineHeight: `${lineHeight}px` } : {};
31
31
  }
32
32
  function useBodyVoice(fontWeight, { variant, tabular } = {}) {
33
33
  const { knobProps } = useResolvedKnobs();
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","names":["RawText","RawSizableText","RawParagraph","RawAnchor"],"sources":["esm/theme/Text.js"],"sourcesContent":["import { useAccentOnSurface } from \"./readableColor\";\nimport { FONT_KEYS } from \"./scale/scaleInputs\";\nimport { useResolvedKnobs } from \"./useResolvedKnobs\";\nimport {\n Anchor as RawAnchor,\n Paragraph as RawParagraph,\n SizableText as RawSizableText,\n Text as RawText,\n isWeb\n} from \"tamagui\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction bodyStop(body, props) {\n if (props.size !== void 0) {\n const { lineHeight: _lineHeight, letterSpacing: _letterSpacing, ...voice } = body;\n return { ...voice, fontSize: void 0, lineHeight: void 0, letterSpacing: void 0 };\n }\n return { ...body, fontSize: \"4\", lineHeight: leadingFor(props.fontSize) };\n}\nfunction leadingFor(fontSize) {\n if (fontSize === void 0) return \"4\";\n if (typeof fontSize !== \"string\") return void 0;\n const key = fontSize.startsWith(\"$\") ? fontSize.slice(1) : fontSize;\n return FONT_KEYS.includes(key) ? key : void 0;\n}\nfunction consumerLeading(lineHeight) {\n return isWeb && typeof lineHeight === \"number\" ? { lineHeight: `${lineHeight}px` } : {};\n}\nfunction useBodyVoice(fontWeight, { variant, tabular } = {}) {\n const { knobProps } = useResolvedKnobs();\n const { fontWeight: knobWeight, ...body } = knobProps.body;\n return {\n body,\n variantProps: variant === \"mutedMono\" ? knobProps.typography.mutedMono : void 0,\n digitProps: tabular ? knobProps.typography.tabular : void 0,\n color: knobProps.textAccentColor,\n weight: fontWeight ?? knobWeight\n };\n}\nfunction Text({ fontWeight, variant, tabular, style, ...props }) {\n const { body, color, weight, variantProps, digitProps } = useBodyVoice(fontWeight, {\n variant,\n tabular: tabular && props.fontVariant === void 0\n });\n return /* @__PURE__ */ jsx(\n RawText,\n {\n ...bodyStop(body, props),\n color,\n ...variantProps,\n ...digitProps,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight,\n style: digitProps?.style ? [digitProps.style, ...[style].flat()] : style\n }\n );\n}\nfunction SizableText({ fontWeight, ...props }) {\n const { body, color, weight } = useBodyVoice(fontWeight);\n return /* @__PURE__ */ jsx(\n RawSizableText,\n {\n ...bodyStop(body, props),\n color,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight\n }\n );\n}\nfunction Paragraph({ fontWeight, variant, tabular, style, ...props }) {\n const { body, color, weight, variantProps, digitProps } = useBodyVoice(fontWeight, {\n variant,\n tabular: tabular && props.fontVariant === void 0\n });\n return /* @__PURE__ */ jsx(\n RawParagraph,\n {\n ...bodyStop(body, props),\n color,\n ...variantProps,\n ...digitProps,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight,\n style: digitProps?.style ? [digitProps.style, ...[style].flat()] : style\n }\n );\n}\nconst linkInkByIntent = { error: \"$red-11\" };\nfunction Anchor({ fontWeight, inline, intent, ...props }) {\n const { body, weight } = useBodyVoice(fontWeight);\n const accentInk = useAccentOnSurface();\n return /* @__PURE__ */ jsx(\n RawAnchor,\n {\n ...bodyStop(body, props),\n color: intent ? linkInkByIntent[intent] : accentInk,\n textDecorationLine: inline ? \"underline\" : { default: \"none\", hover: \"underline\" },\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight\n }\n );\n}\nexport {\n Anchor,\n Paragraph,\n SizableText,\n Text\n};\n//# sourceMappingURL=Text.js.map\n"],"mappings":";;;;;;;AAWA,SAAS,SAAS,MAAM,OAAO;CAC7B,IAAI,MAAM,SAAS,KAAK,GAAG;EACzB,MAAM,EAAE,YAAY,aAAa,eAAe,gBAAgB,GAAG,UAAU;EAC7E,OAAO;GAAE,GAAG;GAAO,UAAU,KAAK;GAAG,YAAY,KAAK;GAAG,eAAe,KAAK;EAAE;CACjF;CACA,OAAO;EAAE,GAAG;EAAM,UAAU;EAAK,YAAY,WAAW,MAAM,QAAQ;CAAE;AAC1E;AACA,SAAS,WAAW,UAAU;CAC5B,IAAI,aAAa,KAAK,GAAG,OAAO;CAChC,IAAI,OAAO,aAAa,UAAU,OAAO,KAAK;CAC9C,MAAM,MAAM,SAAS,WAAW,GAAG,IAAI,SAAS,MAAM,CAAC,IAAI;CAC3D,OAAO,UAAU,SAAS,GAAG,IAAI,MAAM,KAAK;AAC9C;AACA,SAAS,gBAAgB,YAAY;CACnC,OAAO,SAAS,OAAO,eAAe,WAAW,EAAE,YAAY,GAAG,WAAW,IAAI,IAAI,CAAC;AACxF;AACA,SAAS,aAAa,YAAY,EAAE,SAAS,YAAY,CAAC,GAAG;CAC3D,MAAM,EAAE,cAAc,iBAAiB;CACvC,MAAM,EAAE,YAAY,YAAY,GAAG,SAAS,UAAU;CACtD,OAAO;EACL;EACA,cAAc,YAAY,cAAc,UAAU,WAAW,YAAY,KAAK;EAC9E,YAAY,UAAU,UAAU,WAAW,UAAU,KAAK;EAC1D,OAAO,UAAU;EACjB,QAAQ,cAAc;CACxB;AACF;AACA,SAAS,KAAK,EAAE,YAAY,SAAS,SAAS,OAAO,GAAG,SAAS;CAC/D,MAAM,EAAE,MAAM,OAAO,QAAQ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AS,cAAc;GAAE,SAAS;GAAQ,OAAO;EAAY;EACjF,GAAG;EACH,GAAG,gBAAgB,MAAM,UAAU;EACnC,YAAY;CACd,CACF;AACF"}
1
+ {"version":3,"file":"Text.js","names":["RawText","RawSizableText","RawParagraph","RawAnchor"],"sources":["esm/theme/Text.js"],"sourcesContent":["import { useAccentOnSurface } from \"./readableColor\";\nimport { FONT_KEYS } from \"./scale/scaleInputs\";\nimport { useResolvedKnobs } from \"./useResolvedKnobs\";\nimport {\n Anchor as RawAnchor,\n Paragraph as RawParagraph,\n SizableText as RawSizableText,\n Text as RawText\n} from \"tamagui\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction bodyStop(body, props) {\n if (props.size !== void 0) {\n const { lineHeight: _lineHeight, letterSpacing: _letterSpacing, ...voice } = body;\n return { ...voice, fontSize: void 0, lineHeight: void 0, letterSpacing: void 0 };\n }\n return { ...body, fontSize: \"4\", lineHeight: leadingFor(props.fontSize) };\n}\nfunction leadingFor(fontSize) {\n if (fontSize === void 0) return \"4\";\n if (typeof fontSize !== \"string\") return void 0;\n const key = fontSize.startsWith(\"$\") ? fontSize.slice(1) : fontSize;\n return FONT_KEYS.includes(key) ? key : void 0;\n}\nfunction consumerLeading(lineHeight) {\n return typeof lineHeight === \"number\" && lineHeight > 4 ? { lineHeight: `${lineHeight}px` } : {};\n}\nfunction useBodyVoice(fontWeight, { variant, tabular } = {}) {\n const { knobProps } = useResolvedKnobs();\n const { fontWeight: knobWeight, ...body } = knobProps.body;\n return {\n body,\n variantProps: variant === \"mutedMono\" ? knobProps.typography.mutedMono : void 0,\n digitProps: tabular ? knobProps.typography.tabular : void 0,\n color: knobProps.textAccentColor,\n weight: fontWeight ?? knobWeight\n };\n}\nfunction Text({ fontWeight, variant, tabular, style, ...props }) {\n const { body, color, weight, variantProps, digitProps } = useBodyVoice(fontWeight, {\n variant,\n tabular: tabular && props.fontVariant === void 0\n });\n return /* @__PURE__ */ jsx(\n RawText,\n {\n ...bodyStop(body, props),\n color,\n ...variantProps,\n ...digitProps,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight,\n style: digitProps?.style ? [digitProps.style, ...[style].flat()] : style\n }\n );\n}\nfunction SizableText({ fontWeight, ...props }) {\n const { body, color, weight } = useBodyVoice(fontWeight);\n return /* @__PURE__ */ jsx(\n RawSizableText,\n {\n ...bodyStop(body, props),\n color,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight\n }\n );\n}\nfunction Paragraph({ fontWeight, variant, tabular, style, ...props }) {\n const { body, color, weight, variantProps, digitProps } = useBodyVoice(fontWeight, {\n variant,\n tabular: tabular && props.fontVariant === void 0\n });\n return /* @__PURE__ */ jsx(\n RawParagraph,\n {\n ...bodyStop(body, props),\n color,\n ...variantProps,\n ...digitProps,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight,\n style: digitProps?.style ? [digitProps.style, ...[style].flat()] : style\n }\n );\n}\nconst linkInkByIntent = { error: \"$red-11\" };\nfunction Anchor({ fontWeight, inline, intent, ...props }) {\n const { body, weight } = useBodyVoice(fontWeight);\n const accentInk = useAccentOnSurface();\n return /* @__PURE__ */ jsx(\n RawAnchor,\n {\n ...bodyStop(body, props),\n color: intent ? linkInkByIntent[intent] : accentInk,\n textDecorationLine: inline ? \"underline\" : { default: \"none\", hover: \"underline\" },\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight\n }\n );\n}\nexport {\n Anchor,\n Paragraph,\n SizableText,\n Text\n};\n//# sourceMappingURL=Text.js.map\n"],"mappings":";;;;;;;AAUA,SAAS,SAAS,MAAM,OAAO;CAC7B,IAAI,MAAM,SAAS,KAAK,GAAG;EACzB,MAAM,EAAE,YAAY,aAAa,eAAe,gBAAgB,GAAG,UAAU;EAC7E,OAAO;GAAE,GAAG;GAAO,UAAU,KAAK;GAAG,YAAY,KAAK;GAAG,eAAe,KAAK;EAAE;CACjF;CACA,OAAO;EAAE,GAAG;EAAM,UAAU;EAAK,YAAY,WAAW,MA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,GAAG;EACH,GAAG,gBAAgB,MAAM,UAAU;EACnC,YAAY;CACd,CACF;AACF;AACA,SAAS,UAAU,EAAE,YAAY,SAAS,SAAS,OAAO,GAAG,SAAS;CACpE,MAAM,EAAE,MAAM,OAAO,QAAQ,cAAc,eAAe,aAAa,YAAY;EACjF;EACA,SAAS,WAAW,MAAM,gBAAgB,KAAK;CACjD,CAAC;CACD,OAAuB,oBACrBC,aACA;EACE,GAAG,SAAS,MAAM,KAAK;EACvB;EACA,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG,gBAAgB,MAAM,UAAU;EACnC,YAAY;EACZ,OAAO,YAAY,QAAQ,CAAC,WAAW,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI;CACrE,CACF;AACF;AACA,MAAM,kBAAkB,EAAE,OAAO,UAAU;AAC3C,SAAS,OAAO,EAAE,YAAY,QAAQ,QAAQ,GAAG,SAAS;CACxD,MAAM,EAAE,MAAM,WAAW,aAAa,UAAU;CAChD,MAAM,YAAY,mBAAmB;CACrC,OAAuB,oBACrBC,UACA;EACE,GAAG,SAAS,MAAM,KAAK;EACvB,OAAO,SAAS,gBAAgB,UAAU;EAC1C,oBAAoB,SAAS,cAAc;GAAE,SAAS;GAAQ,OAAO;EAAY;EACjF,GAAG;EACH,GAAG,gBAAgB,MAAM,UAAU;EACnC,YAAY;CACd,CACF;AACF"}
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useAccentOnSurface } from "./readableColor.native.js";
3
3
  import { FONT_KEYS } from "./scale/scaleInputs.native.js";
4
4
  import { useResolvedKnobs } from "./useResolvedKnobs.native.js";
5
- import { Anchor as Anchor$1, Paragraph as Paragraph$1, SizableText as SizableText$1, Text as Text$1, isWeb } from "tamagui";
5
+ import { Anchor as Anchor$1, Paragraph as Paragraph$1, SizableText as SizableText$1, Text as Text$1 } from "tamagui";
6
6
 
7
7
  function bodyStop(body, props) {
8
8
  if (props.size !== void 0) {
@@ -27,7 +27,7 @@ function leadingFor(fontSize) {
27
27
  return FONT_KEYS.includes(key) ? key : void 0;
28
28
  }
29
29
  function consumerLeading(lineHeight) {
30
- return isWeb && typeof lineHeight === "number" ? { lineHeight: `${lineHeight}px` } : {};
30
+ return typeof lineHeight === "number" && lineHeight > 4 ? { lineHeight: `${lineHeight}px` } : {};
31
31
  }
32
32
  function useBodyVoice(fontWeight) {
33
33
  var { variant, tabular } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
@@ -1 +1 @@
1
- {"version":3,"file":"Text.native.js","names":["RawText","RawSizableText","RawParagraph","RawAnchor"],"sources":["esm/theme/Text.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useAccentOnSurface } from \"./readableColor\";\nimport { FONT_KEYS } from \"./scale/scaleInputs\";\nimport { useResolvedKnobs } from \"./useResolvedKnobs\";\nimport { Anchor as RawAnchor, Paragraph as RawParagraph, SizableText as RawSizableText, Text as RawText, isWeb } from \"tamagui\";\nfunction bodyStop(body, props) {\n if (props.size !== void 0) {\n var { lineHeight: _lineHeight, letterSpacing: _letterSpacing, ...voice } = body;\n return {\n ...voice,\n fontSize: void 0,\n lineHeight: void 0,\n letterSpacing: void 0\n };\n }\n return {\n ...body,\n fontSize: \"4\",\n lineHeight: leadingFor(props.fontSize)\n };\n}\nfunction leadingFor(fontSize) {\n if (fontSize === void 0) return \"4\";\n if (typeof fontSize !== \"string\") return void 0;\n var key = fontSize.startsWith(\"$\") ? fontSize.slice(1) : fontSize;\n return FONT_KEYS.includes(key) ? key : void 0;\n}\nfunction consumerLeading(lineHeight) {\n return isWeb && typeof lineHeight === \"number\" ? {\n lineHeight: `${lineHeight}px`\n } : {};\n}\nfunction useBodyVoice(fontWeight) {\n var { variant, tabular } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var { knobProps } = useResolvedKnobs();\n var { fontWeight: knobWeight, ...body } = knobProps.body;\n return {\n body,\n variantProps: variant === \"mutedMono\" ? knobProps.typography.mutedMono : void 0,\n digitProps: tabular ? knobProps.typography.tabular : void 0,\n color: knobProps.textAccentColor,\n weight: fontWeight !== null && fontWeight !== void 0 ? fontWeight : knobWeight\n };\n}\nfunction Text(param) {\n var { fontWeight, variant, tabular, style, ...props } = param;\n var { body, color, weight, variantProps, digitProps } = useBodyVoice(fontWeight, {\n variant,\n tabular: tabular && props.fontVariant === void 0\n });\n return /* @__PURE__ */ _jsx(RawText, {\n ...bodyStop(body, props),\n color,\n ...variantProps,\n ...digitProps,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight,\n style: (digitProps === null || digitProps === void 0 ? void 0 : digitProps.style) ? [\n digitProps.style,\n ...[\n style\n ].flat()\n ] : style\n });\n}\nfunction SizableText(param) {\n var { fontWeight, ...props } = param;\n var { body, color, weight } = useBodyVoice(fontWeight);\n return /* @__PURE__ */ _jsx(RawSizableText, {\n ...bodyStop(body, props),\n color,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight\n });\n}\nfunction Paragraph(param) {\n var { fontWeight, variant, tabular, style, ...props } = param;\n var { body, color, weight, variantProps, digitProps } = useBodyVoice(fontWeight, {\n variant,\n tabular: tabular && props.fontVariant === void 0\n });\n return /* @__PURE__ */ _jsx(RawParagraph, {\n ...bodyStop(body, props),\n color,\n ...variantProps,\n ...digitProps,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight,\n style: (digitProps === null || digitProps === void 0 ? void 0 : digitProps.style) ? [\n digitProps.style,\n ...[\n style\n ].flat()\n ] : style\n });\n}\nvar linkInkByIntent = {\n error: \"$red-11\"\n};\nfunction Anchor(param) {\n var { fontWeight, inline, intent, ...props } = param;\n var { body, weight } = useBodyVoice(fontWeight);\n var accentInk = useAccentOnSurface();\n return /* @__PURE__ */ _jsx(RawAnchor, {\n // link-chrome-escape: the house Anchor is where link chrome is drawn (LC-181).\n ...bodyStop(body, props),\n color: intent ? linkInkByIntent[intent] : accentInk,\n textDecorationLine: inline ? \"underline\" : {\n default: \"none\",\n hover: \"underline\"\n },\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight\n });\n}\nexport {\n Anchor,\n Paragraph,\n SizableText,\n Text\n};\n//# sourceMappingURL=Text.js.map\n"],"mappings":";;;;;;;AAKA,SAAS,SAAS,MAAM,OAAO;CAC7B,IAAI,MAAM,SAAS,KAAK,GAAG;EACzB,IAAI,EAAE,YAAY,aAAa,eAAe,gBAAgB,GAAG,UAAU;EAC3E,OAAO;GACL,GAAG;GACH,UAAU,KAAK;GACf,YAAY,KAAK;GACjB,eAAe,KAAK;EACtB;CACF;CACA,OAAO;EACL,GAAG;EACH,UAAU;EACV,YAAY,WAAW,MAAM,QAAQ;CACvC;AACF;AACA,SAAS,WAAW,UAAU;CAC5B,IAAI,aAAa,KAAK,GAAG,OAAO;CAChC,IAAI,OAAO,aAAa,UAAU,OAAO,KAAK;CAC9C,IAAI,MAAM,SAAS,WAAW,GAAG,IAAI,SAAS,MAAM,CAAC,IAAI;CACzD,OAAO,UAAU,SAAS,GAAG,IAAI,MAAM,KAAK;AAC9C;AACA,SAAS,gBAAgB,YAAY;CACnC,OAAO,SAAS,OAAO,eAAe,WAAW,EAC/C,YAAY,GAAG,WAAW,IAC5B,IAAI,CAAC;AACP;AACA,SAAS,aAAa,YAAY;CAChC,IAAI,EAAE,SAAS,YAAY,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,CAAC;CAC7F,IAAI,EAAE,cAAc,iBAAiB;CACrC,IAAI,EAAE,YAAY,YAAY,GAAG,SAAS,UAAU;CACpD,OAAO;EACL;EACA,cAAc,YAAY,cAAc,UAAU,WAAW,YAAY,KAAK;EAC9E,YAAY,UAAU,UAAU,WAAW,UAAU,KAAK;EAC1D,OAAO,UAAU;EACjB,QAAQ,eAAe,QAAQ,eAAe,KAAK,IAAI,aAAa;CACtE;AACF;AACA,SAAS,KAAK,OAAO;CACnB,IAAI,EAAE,YAAY,SAAS,SAAS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Q,QAAQ,GAAG,UAAU;CAC/C,IAAI,EAAE,MAAM,WAAW,aAAa,UAAU;CAC9C,IAAI,YAAY,mBAAmB;CACnC,OAAuB,oBAAKC,UAAW;EAErC,GAAG,SAAS,MAAM,KAAK;EACvB,OAAO,SAAS,gBAAgB,UAAU;EAC1C,oBAAoB,SAAS,cAAc;GACzC,SAAS;GACT,OAAO;EACT;EACA,GAAG;EACH,GAAG,gBAAgB,MAAM,UAAU;EACnC,YAAY;CACd,CAAC;AACH"}
1
+ {"version":3,"file":"Text.native.js","names":["RawText","RawSizableText","RawParagraph","RawAnchor"],"sources":["esm/theme/Text.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useAccentOnSurface } from \"./readableColor\";\nimport { FONT_KEYS } from \"./scale/scaleInputs\";\nimport { useResolvedKnobs } from \"./useResolvedKnobs\";\nimport { Anchor as RawAnchor, Paragraph as RawParagraph, SizableText as RawSizableText, Text as RawText } from \"tamagui\";\nfunction bodyStop(body, props) {\n if (props.size !== void 0) {\n var { lineHeight: _lineHeight, letterSpacing: _letterSpacing, ...voice } = body;\n return {\n ...voice,\n fontSize: void 0,\n lineHeight: void 0,\n letterSpacing: void 0\n };\n }\n return {\n ...body,\n fontSize: \"4\",\n lineHeight: leadingFor(props.fontSize)\n };\n}\nfunction leadingFor(fontSize) {\n if (fontSize === void 0) return \"4\";\n if (typeof fontSize !== \"string\") return void 0;\n var key = fontSize.startsWith(\"$\") ? fontSize.slice(1) : fontSize;\n return FONT_KEYS.includes(key) ? key : void 0;\n}\nfunction consumerLeading(lineHeight) {\n return typeof lineHeight === \"number\" && lineHeight > 4 ? {\n lineHeight: `${lineHeight}px`\n } : {};\n}\nfunction useBodyVoice(fontWeight) {\n var { variant, tabular } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var { knobProps } = useResolvedKnobs();\n var { fontWeight: knobWeight, ...body } = knobProps.body;\n return {\n body,\n variantProps: variant === \"mutedMono\" ? knobProps.typography.mutedMono : void 0,\n digitProps: tabular ? knobProps.typography.tabular : void 0,\n color: knobProps.textAccentColor,\n weight: fontWeight !== null && fontWeight !== void 0 ? fontWeight : knobWeight\n };\n}\nfunction Text(param) {\n var { fontWeight, variant, tabular, style, ...props } = param;\n var { body, color, weight, variantProps, digitProps } = useBodyVoice(fontWeight, {\n variant,\n tabular: tabular && props.fontVariant === void 0\n });\n return /* @__PURE__ */ _jsx(RawText, {\n ...bodyStop(body, props),\n color,\n ...variantProps,\n ...digitProps,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight,\n style: (digitProps === null || digitProps === void 0 ? void 0 : digitProps.style) ? [\n digitProps.style,\n ...[\n style\n ].flat()\n ] : style\n });\n}\nfunction SizableText(param) {\n var { fontWeight, ...props } = param;\n var { body, color, weight } = useBodyVoice(fontWeight);\n return /* @__PURE__ */ _jsx(RawSizableText, {\n ...bodyStop(body, props),\n color,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight\n });\n}\nfunction Paragraph(param) {\n var { fontWeight, variant, tabular, style, ...props } = param;\n var { body, color, weight, variantProps, digitProps } = useBodyVoice(fontWeight, {\n variant,\n tabular: tabular && props.fontVariant === void 0\n });\n return /* @__PURE__ */ _jsx(RawParagraph, {\n ...bodyStop(body, props),\n color,\n ...variantProps,\n ...digitProps,\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight,\n style: (digitProps === null || digitProps === void 0 ? void 0 : digitProps.style) ? [\n digitProps.style,\n ...[\n style\n ].flat()\n ] : style\n });\n}\nvar linkInkByIntent = {\n error: \"$red-11\"\n};\nfunction Anchor(param) {\n var { fontWeight, inline, intent, ...props } = param;\n var { body, weight } = useBodyVoice(fontWeight);\n var accentInk = useAccentOnSurface();\n return /* @__PURE__ */ _jsx(RawAnchor, {\n // link-chrome-escape: the house Anchor is where link chrome is drawn (LC-181).\n ...bodyStop(body, props),\n color: intent ? linkInkByIntent[intent] : accentInk,\n textDecorationLine: inline ? \"underline\" : {\n default: \"none\",\n hover: \"underline\"\n },\n ...props,\n ...consumerLeading(props.lineHeight),\n fontWeight: weight\n });\n}\nexport {\n Anchor,\n Paragraph,\n SizableText,\n Text\n};\n//# sourceMappingURL=Text.js.map\n"],"mappings":";;;;;;;AAKA,SAAS,SAAS,MAAM,OAAO;CAC7B,IAAI,MAAM,SAAS,KAAK,GAAG;EACzB,IAAI,EAAE,YAAY,aAAa,eAAe,gBAAgB,GAAG,UAAU;EAC3E,OAAO;GACL,GAAG;GACH,UAAU,KAAK;GACf,YAAY,KAAK;GACjB,eAAe,KAAK;EACtB;CACF;CACA,OAAO;EACL,GAAG;EACH,UAAU;EACV,YAAY,WAAW,MAAM,QAAQ;CACvC;AACF;AACA,SAAS,WAAW,UAAU;CAC5B,IAAI,aAAa,KAAK,GAAG,OAAO;CAChC,IAAI,OAAO,aAAa,UAAU,OAAO,KAAK;CAC9C,IAAI,MAAM,SAAS,WAAW,GAAG,IAAI,SAAS,MAAM,CAAC,IAAI;CACzD,OAAO,UAAU,SAAS,GAAG,IAAI,MAAM,KAAK;AAC9C;AACA,SAAS,gBAAgB,YAAY;CACnC,OAAO,OAAO,eAAe,YAAY,aAAa,IAAI,EACxD,YAAY,GAAG,WAAW,IAC5B,IAAI,CAAC;AACP;AACA,SAAS,aAAa,YAAY;CAChC,IAAI,EAAE,SAAS,YAAY,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,CAAC;CAC7F,IAAI,EAAE,cAAc,iBAAiB;CACrC,IAAI,EAAE,YAAY,YAAY,GAAG,SAAS,UAAU;CACpD,OAAO;EACL;EACA,cAAc,YAAY,cAAc,UAAU,WAAW,YAAY,KAAK;EAC9E,YAAY,UAAU,UAAU,WAAW,UAAU,KAAK;EAC1D,OAAO,UAAU;EACjB,QAAQ,eAAe,QAAQ,eAAe,KAAK,IAAI,aAAa;CACtE;AACF;AACA,SAAS,KAAK,OAAO;CACnB,IAAI,EAAE,YAAY,SAAS,SAAS,OAAO,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Q,GAAG,UAAU;CAC/C,IAAI,EAAE,MAAM,WAAW,aAAa,UAAU;CAC9C,IAAI,YAAY,mBAAmB;CACnC,OAAuB,oBAAKC,UAAW;EAErC,GAAG,SAAS,MAAM,KAAK;EACvB,OAAO,SAAS,gBAAgB,UAAU;EAC1C,oBAAoB,SAAS,cAAc;GACzC,SAAS;GACT,OAAO;EACT;EACA,GAAG;EACH,GAAG,gBAAgB,MAAM,UAAU;EACnC,YAAY;CACd,CAAC;AACH"}
@@ -2,8 +2,7 @@ import { animationConfig } from "./animations/reactNative.mjs";
2
2
 
3
3
  function transitionProps(role, extra = []) {
4
4
  const isRole = isMotionRole(role);
5
- const transition = isRole ? role.transition : role;
6
- if (transition === void 0) return {};
5
+ const transition = (isRole ? role.transition : role) ?? instant;
7
6
  if (!isRole) return { transition };
8
7
  const properties = [...role.animateOnly, ...extra].flatMap((property) => nativeLonghands[property] ?? [property]).join(", ");
9
8
  if (typeof transition !== "string") return { transition: {
@@ -22,6 +21,7 @@ function transitionProps(role, extra = []) {
22
21
  } } : {}
23
22
  } };
24
23
  }
24
+ const instant = "0ms";
25
25
  function isSpring(stop) {
26
26
  const config = animationConfig[stop];
27
27
  return config !== void 0 && config.type !== "timing";
@@ -1 +1 @@
1
- {"version":3,"file":"nativeTransitionProps.js","names":["nativeAnimationConfig"],"sources":["esm/theme/nativeTransitionProps.js"],"sourcesContent":["import { animationConfig as nativeAnimationConfig } from \"./animations/reactNative\";\nfunction transitionProps(role, extra = []) {\n const isRole = isMotionRole(role);\n const transition = isRole ? role.transition : role;\n if (transition === void 0) return {};\n if (!isRole) return { transition };\n const properties = [...role.animateOnly, ...extra].flatMap((property) => nativeLonghands[property] ?? [property]).join(\", \");\n if (typeof transition !== \"string\") return { transition: { ...transition, properties } };\n const exit = typeof role.exit === \"string\" && role.exit !== transition ? role.exit : void 0;\n const clamp = isSpring(transition) && !presetBounce.has(transition);\n return {\n transition: {\n preset: transition,\n properties,\n ...clamp ? { spring: { overshootClamping: true } } : {},\n ...exit ? { exit: { preset: exit, properties } } : {}\n }\n };\n}\nfunction isSpring(stop) {\n const config = nativeAnimationConfig[stop];\n return config !== void 0 && config.type !== \"timing\";\n}\nconst presetBounce = /* @__PURE__ */ new Set([\"bouncy\", \"superBouncy\"]);\nconst nativeLonghands = {\n borderColor: [\n \"borderColor\",\n \"borderTopColor\",\n \"borderRightColor\",\n \"borderBottomColor\",\n \"borderLeftColor\"\n ]\n};\nfunction isMotionRole(value) {\n return typeof value === \"object\" && value !== null && \"transition\" in value && \"animateOnly\" in value && Array.isArray(value.animateOnly);\n}\nexport {\n transitionProps\n};\n//# sourceMappingURL=nativeTransitionProps.js.map\n"],"mappings":";;;AACA,SAAS,gBAAgB,MAAM,QAAQ,CAAC,GAAG;CACzC,MAAM,SAAS,aAAa,IAAI;CAChC,MAAM,aAAa,SAAS,KAAK,aAAa;CAC9C,IAAI,eAAe,KAAK,GAAG,OAAO,CAAC;CACnC,IAAI,CAAC,QAAQ,OAAO,EAAE,WAAW;CACjC,MAAM,aAAa,CAAC,GAAG,KAAK,aAAa,GAAG,KAAK,CAAC,CAAC,SAAS,aAAa,gBAAgB,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI;CAC3H,IAAI,OAAO,eAAe,UAAU,OAAO,EAAE,YAAY;EAAE,GAAG;EAAY;CAAW,EAAE;CACvF,MAAM,OAAO,OAAO,KAAK,SAAS,YAAY,KAAK,SAAS,aAAa,KAAK,OAAO,KAAK;CAC1F,MAAM,QAAQ,SAAS,UAAU,KAAK,CAAC,aAAa,IAAI,UAAU;CAClE,OAAO,EACL,YAAY;EACV,QAAQ;EACR;EACA,GAAG,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,KAAK,EAAE,IAAI,CAAC;EACtD,GAAG,OAAO,EAAE,MAAM;GAAE,QAAQ;GAAM;EAAW,EAAE,IAAI,CAAC;CACtD,EACF;AACF;AACA,SAAS,SAAS,MAAM;CACtB,MAAM,SAASA,gBAAsB;CACrC,OAAO,WAAW,KAAK,KAAK,OAAO,SAAS;AAC9C;AACA,MAAM,+BAA+B,IAAI,IAAI,CAAC,UAAU,aAAa,CAAC;AACtE,MAAM,kBAAkB,EACtB,aAAa;CACX;CACA;CACA;CACA;CACA;AACF,EACF;AACA,SAAS,aAAa,OAAO;CAC3B,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,gBAAgB,SAAS,iBAAiB,SAAS,MAAM,QAAQ,MAAM,WAAW;AAC1I"}
1
+ {"version":3,"file":"nativeTransitionProps.js","names":["nativeAnimationConfig"],"sources":["esm/theme/nativeTransitionProps.js"],"sourcesContent":["import { animationConfig as nativeAnimationConfig } from \"./animations/reactNative\";\nfunction transitionProps(role, extra = []) {\n const isRole = isMotionRole(role);\n const transition = (isRole ? role.transition : role) ?? instant;\n if (!isRole) return { transition };\n const properties = [...role.animateOnly, ...extra].flatMap((property) => nativeLonghands[property] ?? [property]).join(\", \");\n if (typeof transition !== \"string\") return { transition: { ...transition, properties } };\n const exit = typeof role.exit === \"string\" && role.exit !== transition ? role.exit : void 0;\n const clamp = isSpring(transition) && !presetBounce.has(transition);\n return {\n transition: {\n preset: transition,\n properties,\n ...clamp ? { spring: { overshootClamping: true } } : {},\n ...exit ? { exit: { preset: exit, properties } } : {}\n }\n };\n}\nconst instant = \"0ms\";\nfunction isSpring(stop) {\n const config = nativeAnimationConfig[stop];\n return config !== void 0 && config.type !== \"timing\";\n}\nconst presetBounce = /* @__PURE__ */ new Set([\"bouncy\", \"superBouncy\"]);\nconst nativeLonghands = {\n borderColor: [\n \"borderColor\",\n \"borderTopColor\",\n \"borderRightColor\",\n \"borderBottomColor\",\n \"borderLeftColor\"\n ]\n};\nfunction isMotionRole(value) {\n return typeof value === \"object\" && value !== null && \"transition\" in value && \"animateOnly\" in value && Array.isArray(value.animateOnly);\n}\nexport {\n transitionProps\n};\n//# sourceMappingURL=nativeTransitionProps.js.map\n"],"mappings":";;;AACA,SAAS,gBAAgB,MAAM,QAAQ,CAAC,GAAG;CACzC,MAAM,SAAS,aAAa,IAAI;CAChC,MAAM,cAAc,SAAS,KAAK,aAAa,SAAS;CACxD,IAAI,CAAC,QAAQ,OAAO,EAAE,WAAW;CACjC,MAAM,aAAa,CAAC,GAAG,KAAK,aAAa,GAAG,KAAK,CAAC,CAAC,SAAS,aAAa,gBAAgB,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI;CAC3H,IAAI,OAAO,eAAe,UAAU,OAAO,EAAE,YAAY;EAAE,GAAG;EAAY;CAAW,EAAE;CACvF,MAAM,OAAO,OAAO,KAAK,SAAS,YAAY,KAAK,SAAS,aAAa,KAAK,OAAO,KAAK;CAC1F,MAAM,QAAQ,SAAS,UAAU,KAAK,CAAC,aAAa,IAAI,UAAU;CAClE,OAAO,EACL,YAAY;EACV,QAAQ;EACR;EACA,GAAG,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,KAAK,EAAE,IAAI,CAAC;EACtD,GAAG,OAAO,EAAE,MAAM;GAAE,QAAQ;GAAM;EAAW,EAAE,IAAI,CAAC;CACtD,EACF;AACF;AACA,MAAM,UAAU;AAChB,SAAS,SAAS,MAAM;CACtB,MAAM,SAASA,gBAAsB;CACrC,OAAO,WAAW,KAAK,KAAK,OAAO,SAAS;AAC9C;AACA,MAAM,+BAA+B,IAAI,IAAI,CAAC,UAAU,aAAa,CAAC;AACtE,MAAM,kBAAkB,EACtB,aAAa;CACX;CACA;CACA;CACA;CACA;AACF,EACF;AACA,SAAS,aAAa,OAAO;CAC3B,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,gBAAgB,SAAS,iBAAiB,SAAS,MAAM,QAAQ,MAAM,WAAW;AAC1I"}
@@ -2,9 +2,9 @@ import { animationConfig } from "./animations/reactNative.native.js";
2
2
 
3
3
  function transitionProps(role) {
4
4
  var extra = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
5
+ var _ref;
5
6
  var isRole = isMotionRole(role);
6
- var transition = isRole ? role.transition : role;
7
- if (transition === void 0) return {};
7
+ var transition = (_ref = isRole ? role.transition : role) !== null && _ref !== void 0 ? _ref : instant;
8
8
  if (!isRole) return { transition };
9
9
  var properties = [...role.animateOnly, ...extra].flatMap(function(property) {
10
10
  var _nativeLonghands_property;
@@ -26,6 +26,7 @@ function transitionProps(role) {
26
26
  } } : {}
27
27
  } };
28
28
  }
29
+ var instant = "0ms";
29
30
  function isSpring(stop) {
30
31
  var config = animationConfig[stop];
31
32
  return config !== void 0 && config.type !== "timing";
@@ -1 +1 @@
1
- {"version":3,"file":"nativeTransitionProps.native.js","names":["nativeAnimationConfig"],"sources":["esm/theme/nativeTransitionProps.native.js"],"sourcesContent":["import { animationConfig as nativeAnimationConfig } from \"./animations/reactNative\";\nfunction transitionProps(role) {\n var extra = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];\n var isRole = isMotionRole(role);\n var transition = isRole ? role.transition : role;\n if (transition === void 0) return {};\n if (!isRole) return {\n transition\n };\n var properties = [\n ...role.animateOnly,\n ...extra\n ].flatMap(function(property) {\n var _nativeLonghands_property;\n return (_nativeLonghands_property = nativeLonghands[property]) !== null && _nativeLonghands_property !== void 0 ? _nativeLonghands_property : [\n property\n ];\n }).join(\", \");\n if (typeof transition !== \"string\") return {\n transition: {\n ...transition,\n properties\n }\n };\n var exit = typeof role.exit === \"string\" && role.exit !== transition ? role.exit : void 0;\n var clamp = isSpring(transition) && !presetBounce.has(transition);\n return {\n transition: {\n preset: transition,\n properties,\n ...clamp ? {\n spring: {\n overshootClamping: true\n }\n } : {},\n ...exit ? {\n exit: {\n preset: exit,\n properties\n }\n } : {}\n }\n };\n}\nfunction isSpring(stop) {\n var config = nativeAnimationConfig[stop];\n return config !== void 0 && config.type !== \"timing\";\n}\nvar presetBounce = /* @__PURE__ */ new Set([\n \"bouncy\",\n \"superBouncy\"\n]);\nvar nativeLonghands = {\n borderColor: [\n \"borderColor\",\n \"borderTopColor\",\n \"borderRightColor\",\n \"borderBottomColor\",\n \"borderLeftColor\"\n ]\n};\nfunction isMotionRole(value) {\n return typeof value === \"object\" && value !== null && \"transition\" in value && \"animateOnly\" in value && Array.isArray(value.animateOnly);\n}\nexport {\n transitionProps\n};\n//# sourceMappingURL=nativeTransitionProps.js.map\n"],"mappings":";;;AACA,SAAS,gBAAgB,MAAM;CAC7B,IAAI,QAAQ,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,CAAC;CAC9E,IAAI,SAAS,aAAa,IAAI;CAC9B,IAAI,aAAa,SAAS,KAAK,aAAa;CAC5C,IAAI,eAAe,KAAK,GAAG,OAAO,CAAC;CACnC,IAAI,CAAC,QAAQ,OAAO,EAClB,WACF;CACA,IAAI,aAAa,CACf,GAAG,KAAK,aACR,GAAG,KACL,CAAC,CAAC,QAAQ,SAAS,UAAU;EAC3B,IAAI;EACJ,QAAQ,4BAA4B,gBAAgB,eAAe,QAAQ,8BAA8B,KAAK,IAAI,4BAA4B,CAC5I,QACF;CACF,CAAC,CAAC,CAAC,KAAK,IAAI;CACZ,IAAI,OAAO,eAAe,UAAU,OAAO,EACzC,YAAY;EACV,GAAG;EACH;CACF,EACF;CACA,IAAI,OAAO,OAAO,KAAK,SAAS,YAAY,KAAK,SAAS,aAAa,KAAK,OAAO,KAAK;CACxF,IAAI,QAAQ,SAAS,UAAU,KAAK,CAAC,aAAa,IAAI,UAAU;CAChE,OAAO,EACL,YAAY;EACV,QAAQ;EACR;EACA,GAAG,QAAQ,EACT,QAAQ,EACN,mBAAmB,KACrB,EACF,IAAI,CAAC;EACL,GAAG,OAAO,EACR,MAAM;GACJ,QAAQ;GACR;EACF,EACF,IAAI,CAAC;CACP,EACF;AACF;AACA,SAAS,SAAS,MAAM;CACtB,IAAI,SAASA,gBAAsB;CACnC,OAAO,WAAW,KAAK,KAAK,OAAO,SAAS;AAC9C;AACA,IAAI,+BAA+B,IAAI,IAAI,CACzC,UACA,aACF,CAAC;AACD,IAAI,kBAAkB,EACpB,aAAa;CACX;CACA;CACA;CACA;CACA;AACF,EACF;AACA,SAAS,aAAa,OAAO;CAC3B,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,gBAAgB,SAAS,iBAAiB,SAAS,MAAM,QAAQ,MAAM,WAAW;AAC1I"}
1
+ {"version":3,"file":"nativeTransitionProps.native.js","names":["nativeAnimationConfig"],"sources":["esm/theme/nativeTransitionProps.native.js"],"sourcesContent":["import { animationConfig as nativeAnimationConfig } from \"./animations/reactNative\";\nfunction transitionProps(role) {\n var extra = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];\n var _ref;\n var isRole = isMotionRole(role);\n var transition = (_ref = isRole ? role.transition : role) !== null && _ref !== void 0 ? _ref : instant;\n if (!isRole) return {\n transition\n };\n var properties = [\n ...role.animateOnly,\n ...extra\n ].flatMap(function(property) {\n var _nativeLonghands_property;\n return (_nativeLonghands_property = nativeLonghands[property]) !== null && _nativeLonghands_property !== void 0 ? _nativeLonghands_property : [\n property\n ];\n }).join(\", \");\n if (typeof transition !== \"string\") return {\n transition: {\n ...transition,\n properties\n }\n };\n var exit = typeof role.exit === \"string\" && role.exit !== transition ? role.exit : void 0;\n var clamp = isSpring(transition) && !presetBounce.has(transition);\n return {\n transition: {\n preset: transition,\n properties,\n ...clamp ? {\n spring: {\n overshootClamping: true\n }\n } : {},\n ...exit ? {\n exit: {\n preset: exit,\n properties\n }\n } : {}\n }\n };\n}\nvar instant = \"0ms\";\nfunction isSpring(stop) {\n var config = nativeAnimationConfig[stop];\n return config !== void 0 && config.type !== \"timing\";\n}\nvar presetBounce = /* @__PURE__ */ new Set([\n \"bouncy\",\n \"superBouncy\"\n]);\nvar nativeLonghands = {\n borderColor: [\n \"borderColor\",\n \"borderTopColor\",\n \"borderRightColor\",\n \"borderBottomColor\",\n \"borderLeftColor\"\n ]\n};\nfunction isMotionRole(value) {\n return typeof value === \"object\" && value !== null && \"transition\" in value && \"animateOnly\" in value && Array.isArray(value.animateOnly);\n}\nexport {\n transitionProps\n};\n//# s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B,SAAS,iBAAiB,SAAS,MAAM,QAAQ,MAAM,WAAW;AAC1I"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/theme",
3
- "version": "10.10.3",
3
+ "version": "10.11.1",
4
4
  "description": "Tamagui theme system for multiplatform.one",
5
5
  "keywords": [
6
6
  "multiplatform",
@@ -163,8 +163,8 @@
163
163
  "access": "public"
164
164
  },
165
165
  "dependencies": {
166
- "@multiplatform.one/platform": "^10.10.3",
167
- "@multiplatform.one/store": "^10.10.3",
166
+ "@multiplatform.one/platform": "^10.11.1",
167
+ "@multiplatform.one/store": "^10.11.1",
168
168
  "@tamagui/animations-react-native": "3.2.3",
169
169
  "@tamagui/colors": "3.2.3",
170
170
  "@tamagui/config": "3.2.3",
@@ -178,8 +178,8 @@
178
178
  },
179
179
  "devDependencies": {
180
180
  "@expo/prebuild-config": "58.0.19",
181
- "@multiplatform.one/config": "10.10.3",
182
- "@multiplatform.one/test-utils": "10.10.3",
181
+ "@multiplatform.one/config": "10.11.1",
182
+ "@multiplatform.one/test-utils": "10.11.1",
183
183
  "@tamagui/animations-css": "3.2.3",
184
184
  "@tamagui/animations-reanimated": "3.2.3",
185
185
  "@tamagui/build": "3.2.3",
@@ -66,7 +66,6 @@ import {
66
66
  type SizableTextProps,
67
67
  Text as RawText,
68
68
  type TextProps as RawTextProps,
69
- isWeb,
70
69
  } from "tamagui";
71
70
 
72
71
  export type { SizableTextProps };
@@ -115,11 +114,11 @@ function leadingFor(fontSize: TextProps["fontSize"]): TextProps["lineHeight"] {
115
114
  * native branch returns it early — so on web a bare number lands as a CSS
116
115
  * multiplier and `lineHeight={27}` means 27x, not 27px. Converting is the
117
116
  * caller's job by v3's design, which is what its own `resolveSizing` does with
118
- * `toPx`. On native a number is already dp and a px string would not parse,
119
- * so only web converts. Returns nothing to change when there is nothing.
117
+ * `toPx`. On native a number is multiplied by fontSize and a px string kept,
118
+ * so both convert one above 4. Returns nothing to change when there is nothing.
120
119
  */
121
120
  function consumerLeading(lineHeight: TextProps["lineHeight"]) {
122
- return isWeb && typeof lineHeight === "number" ? { lineHeight: `${lineHeight}px` } : {};
121
+ return typeof lineHeight === "number" && lineHeight > 4 ? { lineHeight: `${lineHeight}px` } : {};
123
122
  }
124
123
 
125
124
  /** The body fragment without its weight, and the weight a voice writes last. */
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @vitest-environment happy-dom
3
+ *
4
+ * FZ-12715: Tamagui only calls `useAnimations` while `transition` is in a
5
+ * component's props. A native part whose role is still at animation `none`
6
+ * and then gains a transition (a knob flip, a late reduced-motion read, a
7
+ * conditional role) must keep the same hooks across both renders.
8
+ */
9
+ import { createElement } from "react";
10
+ import { cleanup, render } from "@testing-library/react";
11
+ import { afterEach, describe, expect, it, vi } from "vitest";
12
+ import { TamaguiProvider, View } from "tamagui";
13
+ import { createDefaultThemeConfig } from "./createDefaultThemeConfig";
14
+ import { motionFor } from "./motion";
15
+ import type { MotionRole } from "./motion";
16
+ import { transitionProps } from "./nativeTransitionProps";
17
+
18
+ const config = createDefaultThemeConfig().tamagui;
19
+
20
+ afterEach(cleanup);
21
+
22
+ function Part({ role }: { role: MotionRole }) {
23
+ return createElement(View, { testID: "part", ...transitionProps(role) });
24
+ }
25
+
26
+ function tree(role: MotionRole) {
27
+ return createElement(
28
+ TamaguiProvider,
29
+ { config, defaultTheme: "light", disableInjectCSS: true },
30
+ createElement(Part, { role }),
31
+ );
32
+ }
33
+
34
+ describe("native transitionProps across a role change", () => {
35
+ it.each([
36
+ ["none", "quick"],
37
+ ["quick", "none"],
38
+ ] as const)("keeps the transition key from %s to %s", (from, to) => {
39
+ expect(transitionProps(motionFor(from).control)).toHaveProperty("transition");
40
+ expect(transitionProps(motionFor(to).control)).toHaveProperty("transition");
41
+ });
42
+
43
+ it("adds no hooks to a live part when its role gains a transition", () => {
44
+ const errors = vi.spyOn(console, "error").mockImplementation(() => {});
45
+ const { rerender, getByTestId } = render(tree(motionFor("none").control));
46
+ rerender(tree(motionFor("quick").control));
47
+ rerender(tree(motionFor("none").control));
48
+ expect(getByTestId("part")).toBeTruthy();
49
+ const hookErrors = errors.mock.calls
50
+ .flat()
51
+ .map(String)
52
+ .filter((line) => /hooks|Should have a queue/i.test(line));
53
+ errors.mockRestore();
54
+ expect(hookErrors).toEqual([]);
55
+ });
56
+
57
+ it("runs animation none as the registered 0ms timing, never the driver's default spring", () => {
58
+ const transition = transitionProps(motionFor("none").control).transition as {
59
+ preset: string;
60
+ };
61
+ expect(transition.preset).toBe("0ms");
62
+ expect(config.animations.animations).toHaveProperty("0ms");
63
+ });
64
+ });
@@ -8,17 +8,16 @@ import { animationConfig as nativeAnimationConfig } from "./animations/reactNati
8
8
  * The React Native driver resolves an undefined `transition` to an empty
9
9
  * config and animates with a default spring (LC-59), so keeping the key at
10
10
  * animation `none` would put motion on every part that is meant to be still.
11
- * Native keeps omitting it until the driver has an instant token to pass.
11
+ * Native passes the registered `0ms` timing instead.
12
12
  */
13
13
  export function transitionProps(
14
14
  role: MotionRole | TransitionProp | undefined,
15
15
  extra: readonly string[] = [],
16
16
  ): {
17
- transition?: TransitionProp;
17
+ transition: TransitionProp;
18
18
  } {
19
19
  const isRole = isMotionRole(role);
20
- const transition = isRole ? role.transition : role;
21
- if (transition === undefined) return {};
20
+ const transition = (isRole ? role.transition : role) ?? instant;
22
21
  if (!isRole) return { transition };
23
22
  const properties = [...role.animateOnly, ...extra]
24
23
  .flatMap((property) => nativeLonghands[property] ?? [property])
@@ -36,6 +35,8 @@ export function transitionProps(
36
35
  };
37
36
  }
38
37
 
38
+ const instant: TransitionKeys = "0ms";
39
+
39
40
  function isSpring(stop: string): boolean {
40
41
  const config = nativeAnimationConfig[stop as keyof typeof nativeAnimationConfig] as
41
42
  | { type?: string }
@@ -0,0 +1,10 @@
1
+ /** LC-311: the design lint's token keys are the scale's, so it never flags a real token or misses a dropped one. */
2
+ import { scaleTokenKeys } from "@multiplatform.one/config/design-lint";
3
+ import { describe, expect, it } from "vitest";
4
+ import { SIZE_KEYS } from "./scaleInputs";
5
+
6
+ describe("the design lint's scale keys (FZ-12784)", () => {
7
+ it("are the theme's SIZE_KEYS", () => {
8
+ expect(scaleTokenKeys).toEqual([...SIZE_KEYS]);
9
+ });
10
+ });
@@ -0,0 +1,34 @@
1
+ /**
2
+ * FZ-12784: on native, Tamagui 3 multiplies a numeric lineHeight by fontSize
3
+ * and keeps an "Npx" string absolute. Drover's `lineHeight={17}` at 13pt drew
4
+ * 221pt lines. MPO's text hands a point leading over as "Npx" on both
5
+ * platforms, which is only right while Tamagui keeps that contract.
6
+ */
7
+ import { createRequire } from "node:module";
8
+ import path from "node:path";
9
+ import { pathToFileURL } from "node:url";
10
+ import { describe, expect, it } from "vitest";
11
+
12
+ const tamaguiWeb = path.dirname(createRequire(import.meta.url).resolve("@tamagui/web"));
13
+ const { resolveTextMetrics } = (await import(
14
+ pathToFileURL(path.join(tamaguiWeb, "../esm/helpers/nativeTextMetrics.native.js")).href
15
+ )) as {
16
+ resolveTextMetrics: (style: Record<string, unknown>, lineHeight: unknown) => unknown;
17
+ };
18
+
19
+ function nativeLeading(fontSize: number, lineHeight: unknown) {
20
+ const style: Record<string, unknown> = { fontSize };
21
+ resolveTextMetrics(style, lineHeight);
22
+ return style.lineHeight;
23
+ }
24
+
25
+ describe("Tamagui 3's native text leading", () => {
26
+ it("multiplies a bare number by the font size", () => {
27
+ expect(nativeLeading(13, 17)).toBe(221);
28
+ expect(nativeLeading(13, 1.2)).toBeCloseTo(15.6);
29
+ });
30
+
31
+ it("keeps an Npx string as points", () => {
32
+ expect(nativeLeading(13, "17px")).toBe(17);
33
+ });
34
+ });
@@ -29,9 +29,15 @@ describe("role property scopes", () => {
29
29
  },
30
30
  });
31
31
  });
32
- it("omits disabled native transitions and expands the border colour longhands", () => {
33
- expect(nativeTransitionProps(motionFor("none").control)).toEqual({});
34
- expect(nativeTransitionProps(undefined)).toEqual({});
32
+ it("runs disabled native transitions at 0ms and expands the border colour longhands", () => {
33
+ expect(nativeTransitionProps(motionFor("none").control)).toEqual({
34
+ transition: {
35
+ preset: "0ms",
36
+ properties:
37
+ "backgroundColor, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, color, opacity, transform",
38
+ },
39
+ });
40
+ expect(nativeTransitionProps(undefined)).toEqual({ transition: "0ms" });
35
41
  expect(nativeTransitionProps("quick")).toEqual({ transition: "quick" });
36
42
  const properties =
37
43
  "backgroundColor, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, color, opacity, transform, maxHeight";
@@ -1 +1 @@
1
- {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/theme/Text.tsx"],"names":[],"mappings":"AA2DA,OAAO,EAEL,KAAK,WAAW,IAAI,cAAc,EAElC,KAAK,cAAc,IAAI,iBAAiB,EAExC,KAAK,gBAAgB,EAErB,KAAK,SAAS,IAAI,YAAY,EAE/B,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC,UAAU,eAAe;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,eAAe,CAAC;AACvD,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG,eAAe,CAAC;AA0DjE,wBAAgB,IAAI,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAiBhF;AAED,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,+BAWrE;AAED,wBAAgB,SAAS,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,+BAiB1F;AAED,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,uEAAuE;IACvE,MAAM,C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AAC,WAAW,CAAC,+BAcrF"}
@@ -6,9 +6,9 @@ import type { TransitionProp } from "tamagui";
6
6
  * The React Native driver resolves an undefined `transition` to an empty
7
7
  * config and animates with a default spring (LC-59), so keeping the key at
8
8
  * animation `none` would put motion on every part that is meant to be still.
9
- * Native keeps omitting it until the driver has an instant token to pass.
9
+ * Native passes the registered `0ms` timing instead.
10
10
  */
11
11
  export declare function transitionProps(role: MotionRole | TransitionProp | undefined, extra?: readonly string[]): {
12
- transition?: TransitionProp;
12
+ transition: TransitionProp;
13
13
  };
14
14
  //# sourceMappingURL=nativeTransitionProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nativeTransitionProps.d.ts","sourceRoot":"","sources":["../../src/theme/nativeTransitionProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9D;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,UAAU,GAAG,cAAc,GAAG,SAAS,EAC7C,KAAK,GAAE,SAAS,MAAM,EAAO,GAC5B;IACD,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B,CAmBA"}
1
+ {"version":3,"file":"nativeTransitionProps.d.ts","sourceRoot":"","sources":["../../src/theme/nativeTransitionProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9D;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,UAAU,GAAG,cAAc,GAAG,SAAS,EAC7C,KAAK,GAAE,SAAS,MAAM,EAAO,GAC5B;IACD,UAAU,EAAE,cAAc,CAAC;CAC5B,CAkBA"}