@tamagui/text 3.0.0-beta.831.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.
- package/dist/cjs/SizableText.cjs +20 -9
- package/dist/cjs/SizableText.native.cjs +21 -10
- package/dist/cjs/SizableText.native.js +21 -10
- package/dist/cjs/SizableText.native.js.map +1 -1
- package/dist/esm/SizableText.mjs +20 -9
- package/dist/esm/SizableText.mjs.map +1 -1
- package/dist/esm/SizableText.native.js +21 -10
- package/dist/esm/SizableText.native.js.map +1 -1
- package/dist/jsx/SizableText.mjs +20 -9
- package/dist/jsx/SizableText.mjs.map +1 -1
- package/dist/jsx/SizableText.native.cjs +21 -10
- package/dist/jsx/SizableText.native.js +21 -10
- package/dist/jsx/SizableText.native.js.map +1 -1
- package/package.json +5 -5
- package/src/SizableText.tsx +29 -18
- package/types/SizableText.d.ts +2 -10
- package/types/SizableText.d.ts.map +1 -1
- package/types/types.d.ts +28 -28
package/dist/cjs/SizableText.cjs
CHANGED
|
@@ -23,20 +23,31 @@ __export(SizableText_exports, { SizableText: () => SizableText });
|
|
|
23
23
|
module.exports = __toCommonJS(SizableText_exports);
|
|
24
24
|
var import_get_font_sized = require("@tamagui/get-font-sized");
|
|
25
25
|
var import_web = require("@tamagui/web");
|
|
26
|
-
const
|
|
26
|
+
const SizableTextFrame = (0, import_web.styled)(import_web.Text, {
|
|
27
27
|
displayName: "SizableText",
|
|
28
28
|
fontFamily: "body",
|
|
29
29
|
color: "color",
|
|
30
30
|
size: true,
|
|
31
31
|
variants: { size: import_get_font_sized.getFontSized }
|
|
32
32
|
});
|
|
33
|
-
SizableText
|
|
34
|
-
|
|
35
|
-
if (val === "inherit") {
|
|
33
|
+
const SizableText = SizableTextFrame.resolve((props, env) => {
|
|
34
|
+
if (props.fontFamily === "inherit") {
|
|
36
35
|
return { fontFamily: "inherit" };
|
|
37
36
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
if (props.fontFamily === void 0) {
|
|
38
|
+
return {};
|
|
39
|
+
}
|
|
40
|
+
const size = props.size === true && props.fontSize ? props.fontSize : props.size ?? true;
|
|
41
|
+
const sized = (0, import_get_font_sized.getFontSized)(size, env);
|
|
42
|
+
return {
|
|
43
|
+
color: sized?.color,
|
|
44
|
+
fontFamily: sized?.fontFamily,
|
|
45
|
+
fontSize: sized?.fontSize,
|
|
46
|
+
fontStyle: sized?.fontStyle,
|
|
47
|
+
fontWeight: sized?.fontWeight,
|
|
48
|
+
letterSpacing: sized?.letterSpacing,
|
|
49
|
+
lineHeight: sized?.lineHeight,
|
|
50
|
+
textTransform: sized?.textTransform
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
SizableText.staticConfig.inlineProps = /* @__PURE__ */ new Set([...SizableText.staticConfig.inlineProps || [], "maxFontSizeMultiplier"]);
|
|
@@ -25,21 +25,32 @@ __export(SizableText_exports, { SizableText: () => SizableText });
|
|
|
25
25
|
module.exports = __toCommonJS(SizableText_exports);
|
|
26
26
|
var import_get_font_sized = require("@tamagui/get-font-sized");
|
|
27
27
|
var import_web = require("@tamagui/web");
|
|
28
|
-
var
|
|
28
|
+
var SizableTextFrame = (0, import_web.styled)(import_web.Text, {
|
|
29
29
|
displayName: "SizableText",
|
|
30
30
|
fontFamily: "body",
|
|
31
31
|
color: "color",
|
|
32
32
|
size: true,
|
|
33
33
|
variants: { size: import_get_font_sized.getFontSized }
|
|
34
34
|
});
|
|
35
|
-
SizableText
|
|
36
|
-
|
|
37
|
-
if (val === "inherit") {
|
|
35
|
+
var SizableText = SizableTextFrame.resolve(function(props, env) {
|
|
36
|
+
if (props.fontFamily === "inherit") {
|
|
38
37
|
return { fontFamily: "inherit" };
|
|
39
38
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
if (props.fontFamily === void 0) {
|
|
40
|
+
return {};
|
|
41
|
+
}
|
|
42
|
+
var _props_size;
|
|
43
|
+
var size = props.size === true && props.fontSize ? props.fontSize : (_props_size = props.size) !== null && _props_size !== void 0 ? _props_size : true;
|
|
44
|
+
var sized = (0, import_get_font_sized.getFontSized)(size, env);
|
|
45
|
+
return {
|
|
46
|
+
color: sized === null || sized === void 0 ? void 0 : sized.color,
|
|
47
|
+
fontFamily: sized === null || sized === void 0 ? void 0 : sized.fontFamily,
|
|
48
|
+
fontSize: sized === null || sized === void 0 ? void 0 : sized.fontSize,
|
|
49
|
+
fontStyle: sized === null || sized === void 0 ? void 0 : sized.fontStyle,
|
|
50
|
+
fontWeight: sized === null || sized === void 0 ? void 0 : sized.fontWeight,
|
|
51
|
+
letterSpacing: sized === null || sized === void 0 ? void 0 : sized.letterSpacing,
|
|
52
|
+
lineHeight: sized === null || sized === void 0 ? void 0 : sized.lineHeight,
|
|
53
|
+
textTransform: sized === null || sized === void 0 ? void 0 : sized.textTransform
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
SizableText.staticConfig.inlineProps = /* @__PURE__ */ new Set([...SizableText.staticConfig.inlineProps || [], "maxFontSizeMultiplier"]);
|
|
@@ -25,23 +25,34 @@ __export(SizableText_exports, { SizableText: () => SizableText });
|
|
|
25
25
|
module.exports = __toCommonJS(SizableText_exports);
|
|
26
26
|
var import_get_font_sized = require("@tamagui/get-font-sized");
|
|
27
27
|
var import_web = require("@tamagui/web");
|
|
28
|
-
var
|
|
28
|
+
var SizableTextFrame = (0, import_web.styled)(import_web.Text, {
|
|
29
29
|
displayName: "SizableText",
|
|
30
30
|
fontFamily: "body",
|
|
31
31
|
color: "color",
|
|
32
32
|
size: true,
|
|
33
33
|
variants: { size: import_get_font_sized.getFontSized }
|
|
34
34
|
});
|
|
35
|
-
SizableText
|
|
36
|
-
|
|
37
|
-
if (val === "inherit") {
|
|
35
|
+
var SizableText = SizableTextFrame.resolve(function(props, env) {
|
|
36
|
+
if (props.fontFamily === "inherit") {
|
|
38
37
|
return { fontFamily: "inherit" };
|
|
39
38
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
if (props.fontFamily === void 0) {
|
|
40
|
+
return {};
|
|
41
|
+
}
|
|
42
|
+
var _props_size;
|
|
43
|
+
var size = props.size === true && props.fontSize ? props.fontSize : (_props_size = props.size) !== null && _props_size !== void 0 ? _props_size : true;
|
|
44
|
+
var sized = (0, import_get_font_sized.getFontSized)(size, env);
|
|
45
|
+
return {
|
|
46
|
+
color: sized === null || sized === void 0 ? void 0 : sized.color,
|
|
47
|
+
fontFamily: sized === null || sized === void 0 ? void 0 : sized.fontFamily,
|
|
48
|
+
fontSize: sized === null || sized === void 0 ? void 0 : sized.fontSize,
|
|
49
|
+
fontStyle: sized === null || sized === void 0 ? void 0 : sized.fontStyle,
|
|
50
|
+
fontWeight: sized === null || sized === void 0 ? void 0 : sized.fontWeight,
|
|
51
|
+
letterSpacing: sized === null || sized === void 0 ? void 0 : sized.letterSpacing,
|
|
52
|
+
lineHeight: sized === null || sized === void 0 ? void 0 : sized.lineHeight,
|
|
53
|
+
textTransform: sized === null || sized === void 0 ? void 0 : sized.textTransform
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
SizableText.staticConfig.inlineProps = /* @__PURE__ */ new Set([...SizableText.staticConfig.inlineProps || [], "maxFontSizeMultiplier"]);
|
|
46
57
|
|
|
47
58
|
//# sourceMappingURL=SizableText.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SizableText.native.js","names":[],"sources":["cjs/SizableText.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 SizableText_exports = {};\n__export(SizableText_exports, {\n SizableText: () => SizableText\n});\nmodule.exports = __toCommonJS(SizableText_exports);\nvar import_get_font_sized = require(\"@tamagui/get-font-sized\");\nvar import_web = require(\"@tamagui/web\");\nvar
|
|
1
|
+
{"version":3,"file":"SizableText.native.js","names":[],"sources":["cjs/SizableText.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 SizableText_exports = {};\n__export(SizableText_exports, {\n SizableText: () => SizableText\n});\nmodule.exports = __toCommonJS(SizableText_exports);\nvar import_get_font_sized = require(\"@tamagui/get-font-sized\");\nvar import_web = require(\"@tamagui/web\");\nvar SizableTextFrame = (0, import_web.styled)(import_web.Text, {\n displayName: \"SizableText\",\n fontFamily: \"body\",\n color: \"color\",\n size: true,\n variants: {\n size: import_get_font_sized.getFontSized\n }\n});\nvar SizableText = SizableTextFrame.resolve(function(props, env) {\n if (props.fontFamily === \"inherit\") {\n return {\n fontFamily: \"inherit\"\n };\n }\n if (props.fontFamily === void 0) {\n return {};\n }\n var _props_size;\n var size = props.size === true && props.fontSize ? props.fontSize : (_props_size = props.size) !== null && _props_size !== void 0 ? _props_size : true;\n var sized = (0, import_get_font_sized.getFontSized)(size, env);\n return {\n color: sized === null || sized === void 0 ? void 0 : sized.color,\n fontFamily: sized === null || sized === void 0 ? void 0 : sized.fontFamily,\n fontSize: sized === null || sized === void 0 ? void 0 : sized.fontSize,\n fontStyle: sized === null || sized === void 0 ? void 0 : sized.fontStyle,\n fontWeight: sized === null || sized === void 0 ? void 0 : sized.fontWeight,\n letterSpacing: sized === null || sized === void 0 ? void 0 : sized.letterSpacing,\n lineHeight: sized === null || sized === void 0 ? void 0 : sized.lineHeight,\n textTransform: sized === null || sized === void 0 ? void 0 : sized.textTransform\n };\n});\nSizableText.staticConfig.inlineProps = /* @__PURE__ */ new Set([\n ...SizableText.staticConfig.inlineProps || [],\n \"maxFontSizeMultiplier\"\n]);\n//# sourceMappingURL=SizableText.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,sBAAsB,CAAC;AAC3B,SAAS,qBAAqB,EAC5B,mBAAmB,YACrB,CAAC;AACD,OAAO,UAAU,aAAa,mBAAmB;AACjD,IAAI,wBAAwB,QAAQ,yBAAyB;AAC7D,IAAI,aAAa,QAAQ,cAAc;AACvC,IAAI,oBAAoB,GAAG,WAAW,OAAM,CAAE,WAAW,MAAM;CAC7D,aAAa;CACb,YAAY;CACZ,OAAO;CACP,MAAM;CACN,UAAU,EACR,MAAM,sBAAsB,aAC9B;AACF,CAAC;AACD,IAAI,cAAc,iBAAiB,QAAQ,SAAS,OAAO,KAAK;CAC9D,IAAI,MAAM,eAAe,WAAW;EAClC,OAAO,EACL,YAAY,UACd;CACF;CACA,IAAI,MAAM,eAAe,KAAK,GAAG;EAC/B,OAAO,CAAC;CACV;CACA,IAAI;CACJ,IAAI,OAAO,MAAM,SAAS,QAAQ,MAAM,WAAW,MAAM,YAAY,cAAc,MAAM,UAAU,QAAQ,gBAAgB,KAAK,IAAI,cAAc;CAClJ,IAAI,SAAS,GAAG,sBAAsB,aAAY,CAAE,MAAM,GAAG;CAC7D,OAAO;EACL,OAAO,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAC3D,YAAY,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAChE,UAAU,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAC9D,WAAW,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAC/D,YAAY,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAChE,eAAe,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EACnE,YAAY,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAChE,eAAe,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;CACrE;AACF,CAAC;AACD,YAAY,aAAa,8BAA8B,IAAI,IAAI,CAC7D,GAAG,YAAY,aAAa,eAAe,CAAC,GAC5C,uBACF,CAAC"}
|
package/dist/esm/SizableText.mjs
CHANGED
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
import { getFontSized } from "@tamagui/get-font-sized";
|
|
2
2
|
import { Text, styled } from "@tamagui/web";
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const SizableTextFrame = styled(Text, {
|
|
5
5
|
displayName: "SizableText",
|
|
6
6
|
fontFamily: "body",
|
|
7
7
|
color: "color",
|
|
8
8
|
size: true,
|
|
9
9
|
variants: { size: getFontSized }
|
|
10
10
|
});
|
|
11
|
-
SizableText
|
|
12
|
-
|
|
13
|
-
if (val === "inherit") {
|
|
11
|
+
const SizableText = SizableTextFrame.resolve((props, env) => {
|
|
12
|
+
if (props.fontFamily === "inherit") {
|
|
14
13
|
return { fontFamily: "inherit" };
|
|
15
14
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if (props.fontFamily === void 0) {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
const size = props.size === true && props.fontSize ? props.fontSize : props.size ?? true;
|
|
19
|
+
const sized = getFontSized(size, env);
|
|
20
|
+
return {
|
|
21
|
+
color: sized?.color,
|
|
22
|
+
fontFamily: sized?.fontFamily,
|
|
23
|
+
fontSize: sized?.fontSize,
|
|
24
|
+
fontStyle: sized?.fontStyle,
|
|
25
|
+
fontWeight: sized?.fontWeight,
|
|
26
|
+
letterSpacing: sized?.letterSpacing,
|
|
27
|
+
lineHeight: sized?.lineHeight,
|
|
28
|
+
textTransform: sized?.textTransform
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
SizableText.staticConfig.inlineProps = /* @__PURE__ */ new Set([...SizableText.staticConfig.inlineProps || [], "maxFontSizeMultiplier"]);
|
|
21
32
|
|
|
22
33
|
export { SizableText };
|
|
23
34
|
//# sourceMappingURL=SizableText.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SizableText.js","names":[],"sources":["esm/SizableText.js"],"sourcesContent":["import { getFontSized } from \"@tamagui/get-font-sized\";\nimport { Text, styled } from \"@tamagui/web\";\nconst
|
|
1
|
+
{"version":3,"file":"SizableText.js","names":[],"sources":["esm/SizableText.js"],"sourcesContent":["import { getFontSized } from \"@tamagui/get-font-sized\";\nimport { Text, styled } from \"@tamagui/web\";\nconst SizableTextFrame = styled(Text, {\n displayName: \"SizableText\",\n fontFamily: \"body\",\n color: \"color\",\n size: true,\n variants: {\n size: getFontSized\n }\n});\nconst SizableText = SizableTextFrame.resolve((props, env) => {\n if (props.fontFamily === \"inherit\") {\n return { fontFamily: \"inherit\" };\n }\n if (props.fontFamily === void 0) {\n return {};\n }\n const size = props.size === true && props.fontSize ? props.fontSize : props.size ?? true;\n const sized = getFontSized(size, env);\n return {\n color: sized?.color,\n fontFamily: sized?.fontFamily,\n fontSize: sized?.fontSize,\n fontStyle: sized?.fontStyle,\n fontWeight: sized?.fontWeight,\n letterSpacing: sized?.letterSpacing,\n lineHeight: sized?.lineHeight,\n textTransform: sized?.textTransform\n };\n});\nSizableText.staticConfig.inlineProps = /* @__PURE__ */ new Set([\n ...SizableText.staticConfig.inlineProps || [],\n \"maxFontSizeMultiplier\"\n]);\nexport {\n SizableText\n};\n//# sourceMappingURL=SizableText.js.map\n"],"mappings":";;;;AAEA,MAAM,mBAAmB,OAAO,MAAM;CACpC,aAAa;CACb,YAAY;CACZ,OAAO;CACP,MAAM;CACN,UAAU,EACR,MAAM,aACR;AACF,CAAC;AACD,MAAM,cAAc,iBAAiB,SAAS,OAAO,QAAQ;CAC3D,IAAI,MAAM,eAAe,WAAW;EAClC,OAAO,EAAE,YAAY,UAAU;CACjC;CACA,IAAI,MAAM,eAAe,KAAK,GAAG;EAC/B,OAAO,CAAC;CACV;CACA,MAAM,OAAO,MAAM,SAAS,QAAQ,MAAM,WAAW,MAAM,WAAW,MAAM,QAAQ;CACpF,MAAM,QAAQ,aAAa,MAAM,GAAG;CACpC,OAAO;EACL,OAAO,OAAO;EACd,YAAY,OAAO;EACnB,UAAU,OAAO;EACjB,WAAW,OAAO;EAClB,YAAY,OAAO;EACnB,eAAe,OAAO;EACtB,YAAY,OAAO;EACnB,eAAe,OAAO;CACxB;AACF,CAAC;AACD,YAAY,aAAa,8BAA8B,IAAI,IAAI,CAC7D,GAAG,YAAY,aAAa,eAAe,CAAC,GAC5C,uBACF,CAAC"}
|
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
import { getFontSized } from "@tamagui/get-font-sized";
|
|
2
2
|
import { Text, styled } from "@tamagui/web";
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var SizableTextFrame = styled(Text, {
|
|
5
5
|
displayName: "SizableText",
|
|
6
6
|
fontFamily: "body",
|
|
7
7
|
color: "color",
|
|
8
8
|
size: true,
|
|
9
9
|
variants: { size: getFontSized }
|
|
10
10
|
});
|
|
11
|
-
SizableText
|
|
12
|
-
|
|
13
|
-
if (val === "inherit") {
|
|
11
|
+
var SizableText = SizableTextFrame.resolve(function(props, env) {
|
|
12
|
+
if (props.fontFamily === "inherit") {
|
|
14
13
|
return { fontFamily: "inherit" };
|
|
15
14
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
if (props.fontFamily === void 0) {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
var _props_size;
|
|
19
|
+
var size = props.size === true && props.fontSize ? props.fontSize : (_props_size = props.size) !== null && _props_size !== void 0 ? _props_size : true;
|
|
20
|
+
var sized = getFontSized(size, env);
|
|
21
|
+
return {
|
|
22
|
+
color: sized === null || sized === void 0 ? void 0 : sized.color,
|
|
23
|
+
fontFamily: sized === null || sized === void 0 ? void 0 : sized.fontFamily,
|
|
24
|
+
fontSize: sized === null || sized === void 0 ? void 0 : sized.fontSize,
|
|
25
|
+
fontStyle: sized === null || sized === void 0 ? void 0 : sized.fontStyle,
|
|
26
|
+
fontWeight: sized === null || sized === void 0 ? void 0 : sized.fontWeight,
|
|
27
|
+
letterSpacing: sized === null || sized === void 0 ? void 0 : sized.letterSpacing,
|
|
28
|
+
lineHeight: sized === null || sized === void 0 ? void 0 : sized.lineHeight,
|
|
29
|
+
textTransform: sized === null || sized === void 0 ? void 0 : sized.textTransform
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
SizableText.staticConfig.inlineProps = /* @__PURE__ */ new Set([...SizableText.staticConfig.inlineProps || [], "maxFontSizeMultiplier"]);
|
|
22
33
|
|
|
23
34
|
export { SizableText };
|
|
24
35
|
//# sourceMappingURL=SizableText.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SizableText.native.js","names":[],"sources":["esm/SizableText.native.js"],"sourcesContent":["import { getFontSized } from \"@tamagui/get-font-sized\";\nimport { Text, styled } from \"@tamagui/web\";\nvar
|
|
1
|
+
{"version":3,"file":"SizableText.native.js","names":[],"sources":["esm/SizableText.native.js"],"sourcesContent":["import { getFontSized } from \"@tamagui/get-font-sized\";\nimport { Text, styled } from \"@tamagui/web\";\nvar SizableTextFrame = styled(Text, {\n displayName: \"SizableText\",\n fontFamily: \"body\",\n color: \"color\",\n size: true,\n variants: {\n size: getFontSized\n }\n});\nvar SizableText = SizableTextFrame.resolve(function(props, env) {\n if (props.fontFamily === \"inherit\") {\n return {\n fontFamily: \"inherit\"\n };\n }\n if (props.fontFamily === void 0) {\n return {};\n }\n var _props_size;\n var size = props.size === true && props.fontSize ? props.fontSize : (_props_size = props.size) !== null && _props_size !== void 0 ? _props_size : true;\n var sized = getFontSized(size, env);\n return {\n color: sized === null || sized === void 0 ? void 0 : sized.color,\n fontFamily: sized === null || sized === void 0 ? void 0 : sized.fontFamily,\n fontSize: sized === null || sized === void 0 ? void 0 : sized.fontSize,\n fontStyle: sized === null || sized === void 0 ? void 0 : sized.fontStyle,\n fontWeight: sized === null || sized === void 0 ? void 0 : sized.fontWeight,\n letterSpacing: sized === null || sized === void 0 ? void 0 : sized.letterSpacing,\n lineHeight: sized === null || sized === void 0 ? void 0 : sized.lineHeight,\n textTransform: sized === null || sized === void 0 ? void 0 : sized.textTransform\n };\n});\nSizableText.staticConfig.inlineProps = /* @__PURE__ */ new Set([\n ...SizableText.staticConfig.inlineProps || [],\n \"maxFontSizeMultiplier\"\n]);\nexport {\n SizableText\n};\n//# sourceMappingURL=SizableText.js.map\n"],"mappings":";;;;AAEA,IAAI,mBAAmB,OAAO,MAAM;CAClC,aAAa;CACb,YAAY;CACZ,OAAO;CACP,MAAM;CACN,UAAU,EACR,MAAM,aACR;AACF,CAAC;AACD,IAAI,cAAc,iBAAiB,QAAQ,SAAS,OAAO,KAAK;CAC9D,IAAI,MAAM,eAAe,WAAW;EAClC,OAAO,EACL,YAAY,UACd;CACF;CACA,IAAI,MAAM,eAAe,KAAK,GAAG;EAC/B,OAAO,CAAC;CACV;CACA,IAAI;CACJ,IAAI,OAAO,MAAM,SAAS,QAAQ,MAAM,WAAW,MAAM,YAAY,cAAc,MAAM,UAAU,QAAQ,gBAAgB,KAAK,IAAI,cAAc;CAClJ,IAAI,QAAQ,aAAa,MAAM,GAAG;CAClC,OAAO;EACL,OAAO,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAC3D,YAAY,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAChE,UAAU,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAC9D,WAAW,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAC/D,YAAY,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAChE,eAAe,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EACnE,YAAY,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAChE,eAAe,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;CACrE;AACF,CAAC;AACD,YAAY,aAAa,8BAA8B,IAAI,IAAI,CAC7D,GAAG,YAAY,aAAa,eAAe,CAAC,GAC5C,uBACF,CAAC"}
|
package/dist/jsx/SizableText.mjs
CHANGED
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
import { getFontSized } from "@tamagui/get-font-sized";
|
|
2
2
|
import { Text, styled } from "@tamagui/web";
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const SizableTextFrame = styled(Text, {
|
|
5
5
|
displayName: "SizableText",
|
|
6
6
|
fontFamily: "body",
|
|
7
7
|
color: "color",
|
|
8
8
|
size: true,
|
|
9
9
|
variants: { size: getFontSized }
|
|
10
10
|
});
|
|
11
|
-
SizableText
|
|
12
|
-
|
|
13
|
-
if (val === "inherit") {
|
|
11
|
+
const SizableText = SizableTextFrame.resolve((props, env) => {
|
|
12
|
+
if (props.fontFamily === "inherit") {
|
|
14
13
|
return { fontFamily: "inherit" };
|
|
15
14
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if (props.fontFamily === void 0) {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
const size = props.size === true && props.fontSize ? props.fontSize : props.size ?? true;
|
|
19
|
+
const sized = getFontSized(size, env);
|
|
20
|
+
return {
|
|
21
|
+
color: sized?.color,
|
|
22
|
+
fontFamily: sized?.fontFamily,
|
|
23
|
+
fontSize: sized?.fontSize,
|
|
24
|
+
fontStyle: sized?.fontStyle,
|
|
25
|
+
fontWeight: sized?.fontWeight,
|
|
26
|
+
letterSpacing: sized?.letterSpacing,
|
|
27
|
+
lineHeight: sized?.lineHeight,
|
|
28
|
+
textTransform: sized?.textTransform
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
SizableText.staticConfig.inlineProps = /* @__PURE__ */ new Set([...SizableText.staticConfig.inlineProps || [], "maxFontSizeMultiplier"]);
|
|
21
32
|
|
|
22
33
|
export { SizableText };
|
|
23
34
|
//# sourceMappingURL=SizableText.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SizableText.js","names":[],"sources":["jsx/SizableText.js"],"sourcesContent":["import { getFontSized } from \"@tamagui/get-font-sized\";\nimport { Text, styled } from \"@tamagui/web\";\nconst
|
|
1
|
+
{"version":3,"file":"SizableText.js","names":[],"sources":["jsx/SizableText.js"],"sourcesContent":["import { getFontSized } from \"@tamagui/get-font-sized\";\nimport { Text, styled } from \"@tamagui/web\";\nconst SizableTextFrame = styled(Text, {\n displayName: \"SizableText\",\n fontFamily: \"body\",\n color: \"color\",\n size: true,\n variants: {\n size: getFontSized\n }\n});\nconst SizableText = SizableTextFrame.resolve((props, env) => {\n if (props.fontFamily === \"inherit\") {\n return { fontFamily: \"inherit\" };\n }\n if (props.fontFamily === void 0) {\n return {};\n }\n const size = props.size === true && props.fontSize ? props.fontSize : props.size ?? true;\n const sized = getFontSized(size, env);\n return {\n color: sized?.color,\n fontFamily: sized?.fontFamily,\n fontSize: sized?.fontSize,\n fontStyle: sized?.fontStyle,\n fontWeight: sized?.fontWeight,\n letterSpacing: sized?.letterSpacing,\n lineHeight: sized?.lineHeight,\n textTransform: sized?.textTransform\n };\n});\nSizableText.staticConfig.inlineProps = /* @__PURE__ */ new Set([\n ...SizableText.staticConfig.inlineProps || [],\n \"maxFontSizeMultiplier\"\n]);\nexport {\n SizableText\n};\n//# sourceMappingURL=SizableText.js.map\n"],"mappings":";;;;AAEA,MAAM,mBAAmB,OAAO,MAAM;CACpC,aAAa;CACb,YAAY;CACZ,OAAO;CACP,MAAM;CACN,UAAU,EACR,MAAM,aACR;AACF,CAAC;AACD,MAAM,cAAc,iBAAiB,SAAS,OAAO,QAAQ;CAC3D,IAAI,MAAM,eAAe,WAAW;EAClC,OAAO,EAAE,YAAY,UAAU;CACjC;CACA,IAAI,MAAM,eAAe,KAAK,GAAG;EAC/B,OAAO,CAAC;CACV;CACA,MAAM,OAAO,MAAM,SAAS,QAAQ,MAAM,WAAW,MAAM,WAAW,MAAM,QAAQ;CACpF,MAAM,QAAQ,aAAa,MAAM,GAAG;CACpC,OAAO;EACL,OAAO,OAAO;EACd,YAAY,OAAO;EACnB,UAAU,OAAO;EACjB,WAAW,OAAO;EAClB,YAAY,OAAO;EACnB,eAAe,OAAO;EACtB,YAAY,OAAO;EACnB,eAAe,OAAO;CACxB;AACF,CAAC;AACD,YAAY,aAAa,8BAA8B,IAAI,IAAI,CAC7D,GAAG,YAAY,aAAa,eAAe,CAAC,GAC5C,uBACF,CAAC"}
|
|
@@ -25,21 +25,32 @@ __export(SizableText_exports, { SizableText: () => SizableText });
|
|
|
25
25
|
module.exports = __toCommonJS(SizableText_exports);
|
|
26
26
|
var import_get_font_sized = require("@tamagui/get-font-sized");
|
|
27
27
|
var import_web = require("@tamagui/web");
|
|
28
|
-
var
|
|
28
|
+
var SizableTextFrame = (0, import_web.styled)(import_web.Text, {
|
|
29
29
|
displayName: "SizableText",
|
|
30
30
|
fontFamily: "body",
|
|
31
31
|
color: "color",
|
|
32
32
|
size: true,
|
|
33
33
|
variants: { size: import_get_font_sized.getFontSized }
|
|
34
34
|
});
|
|
35
|
-
SizableText
|
|
36
|
-
|
|
37
|
-
if (val === "inherit") {
|
|
35
|
+
var SizableText = SizableTextFrame.resolve(function(props, env) {
|
|
36
|
+
if (props.fontFamily === "inherit") {
|
|
38
37
|
return { fontFamily: "inherit" };
|
|
39
38
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
if (props.fontFamily === void 0) {
|
|
40
|
+
return {};
|
|
41
|
+
}
|
|
42
|
+
var _props_size;
|
|
43
|
+
var size = props.size === true && props.fontSize ? props.fontSize : (_props_size = props.size) !== null && _props_size !== void 0 ? _props_size : true;
|
|
44
|
+
var sized = (0, import_get_font_sized.getFontSized)(size, env);
|
|
45
|
+
return {
|
|
46
|
+
color: sized === null || sized === void 0 ? void 0 : sized.color,
|
|
47
|
+
fontFamily: sized === null || sized === void 0 ? void 0 : sized.fontFamily,
|
|
48
|
+
fontSize: sized === null || sized === void 0 ? void 0 : sized.fontSize,
|
|
49
|
+
fontStyle: sized === null || sized === void 0 ? void 0 : sized.fontStyle,
|
|
50
|
+
fontWeight: sized === null || sized === void 0 ? void 0 : sized.fontWeight,
|
|
51
|
+
letterSpacing: sized === null || sized === void 0 ? void 0 : sized.letterSpacing,
|
|
52
|
+
lineHeight: sized === null || sized === void 0 ? void 0 : sized.lineHeight,
|
|
53
|
+
textTransform: sized === null || sized === void 0 ? void 0 : sized.textTransform
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
SizableText.staticConfig.inlineProps = /* @__PURE__ */ new Set([...SizableText.staticConfig.inlineProps || [], "maxFontSizeMultiplier"]);
|
|
@@ -25,23 +25,34 @@ __export(SizableText_exports, { SizableText: () => SizableText });
|
|
|
25
25
|
module.exports = __toCommonJS(SizableText_exports);
|
|
26
26
|
var import_get_font_sized = require("@tamagui/get-font-sized");
|
|
27
27
|
var import_web = require("@tamagui/web");
|
|
28
|
-
var
|
|
28
|
+
var SizableTextFrame = (0, import_web.styled)(import_web.Text, {
|
|
29
29
|
displayName: "SizableText",
|
|
30
30
|
fontFamily: "body",
|
|
31
31
|
color: "color",
|
|
32
32
|
size: true,
|
|
33
33
|
variants: { size: import_get_font_sized.getFontSized }
|
|
34
34
|
});
|
|
35
|
-
SizableText
|
|
36
|
-
|
|
37
|
-
if (val === "inherit") {
|
|
35
|
+
var SizableText = SizableTextFrame.resolve(function(props, env) {
|
|
36
|
+
if (props.fontFamily === "inherit") {
|
|
38
37
|
return { fontFamily: "inherit" };
|
|
39
38
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
if (props.fontFamily === void 0) {
|
|
40
|
+
return {};
|
|
41
|
+
}
|
|
42
|
+
var _props_size;
|
|
43
|
+
var size = props.size === true && props.fontSize ? props.fontSize : (_props_size = props.size) !== null && _props_size !== void 0 ? _props_size : true;
|
|
44
|
+
var sized = (0, import_get_font_sized.getFontSized)(size, env);
|
|
45
|
+
return {
|
|
46
|
+
color: sized === null || sized === void 0 ? void 0 : sized.color,
|
|
47
|
+
fontFamily: sized === null || sized === void 0 ? void 0 : sized.fontFamily,
|
|
48
|
+
fontSize: sized === null || sized === void 0 ? void 0 : sized.fontSize,
|
|
49
|
+
fontStyle: sized === null || sized === void 0 ? void 0 : sized.fontStyle,
|
|
50
|
+
fontWeight: sized === null || sized === void 0 ? void 0 : sized.fontWeight,
|
|
51
|
+
letterSpacing: sized === null || sized === void 0 ? void 0 : sized.letterSpacing,
|
|
52
|
+
lineHeight: sized === null || sized === void 0 ? void 0 : sized.lineHeight,
|
|
53
|
+
textTransform: sized === null || sized === void 0 ? void 0 : sized.textTransform
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
SizableText.staticConfig.inlineProps = /* @__PURE__ */ new Set([...SizableText.staticConfig.inlineProps || [], "maxFontSizeMultiplier"]);
|
|
46
57
|
|
|
47
58
|
//# sourceMappingURL=SizableText.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SizableText.native.js","names":[],"sources":["jsx/SizableText.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 SizableText_exports = {};\n__export(SizableText_exports, {\n SizableText: () => SizableText\n});\nmodule.exports = __toCommonJS(SizableText_exports);\nvar import_get_font_sized = require(\"@tamagui/get-font-sized\");\nvar import_web = require(\"@tamagui/web\");\nvar
|
|
1
|
+
{"version":3,"file":"SizableText.native.js","names":[],"sources":["jsx/SizableText.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 SizableText_exports = {};\n__export(SizableText_exports, {\n SizableText: () => SizableText\n});\nmodule.exports = __toCommonJS(SizableText_exports);\nvar import_get_font_sized = require(\"@tamagui/get-font-sized\");\nvar import_web = require(\"@tamagui/web\");\nvar SizableTextFrame = (0, import_web.styled)(import_web.Text, {\n displayName: \"SizableText\",\n fontFamily: \"body\",\n color: \"color\",\n size: true,\n variants: {\n size: import_get_font_sized.getFontSized\n }\n});\nvar SizableText = SizableTextFrame.resolve(function(props, env) {\n if (props.fontFamily === \"inherit\") {\n return {\n fontFamily: \"inherit\"\n };\n }\n if (props.fontFamily === void 0) {\n return {};\n }\n var _props_size;\n var size = props.size === true && props.fontSize ? props.fontSize : (_props_size = props.size) !== null && _props_size !== void 0 ? _props_size : true;\n var sized = (0, import_get_font_sized.getFontSized)(size, env);\n return {\n color: sized === null || sized === void 0 ? void 0 : sized.color,\n fontFamily: sized === null || sized === void 0 ? void 0 : sized.fontFamily,\n fontSize: sized === null || sized === void 0 ? void 0 : sized.fontSize,\n fontStyle: sized === null || sized === void 0 ? void 0 : sized.fontStyle,\n fontWeight: sized === null || sized === void 0 ? void 0 : sized.fontWeight,\n letterSpacing: sized === null || sized === void 0 ? void 0 : sized.letterSpacing,\n lineHeight: sized === null || sized === void 0 ? void 0 : sized.lineHeight,\n textTransform: sized === null || sized === void 0 ? void 0 : sized.textTransform\n };\n});\nSizableText.staticConfig.inlineProps = /* @__PURE__ */ new Set([\n ...SizableText.staticConfig.inlineProps || [],\n \"maxFontSizeMultiplier\"\n]);\n//# sourceMappingURL=SizableText.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,sBAAsB,CAAC;AAC3B,SAAS,qBAAqB,EAC5B,mBAAmB,YACrB,CAAC;AACD,OAAO,UAAU,aAAa,mBAAmB;AACjD,IAAI,wBAAwB,QAAQ,yBAAyB;AAC7D,IAAI,aAAa,QAAQ,cAAc;AACvC,IAAI,oBAAoB,GAAG,WAAW,OAAM,CAAE,WAAW,MAAM;CAC7D,aAAa;CACb,YAAY;CACZ,OAAO;CACP,MAAM;CACN,UAAU,EACR,MAAM,sBAAsB,aAC9B;AACF,CAAC;AACD,IAAI,cAAc,iBAAiB,QAAQ,SAAS,OAAO,KAAK;CAC9D,IAAI,MAAM,eAAe,WAAW;EAClC,OAAO,EACL,YAAY,UACd;CACF;CACA,IAAI,MAAM,eAAe,KAAK,GAAG;EAC/B,OAAO,CAAC;CACV;CACA,IAAI;CACJ,IAAI,OAAO,MAAM,SAAS,QAAQ,MAAM,WAAW,MAAM,YAAY,cAAc,MAAM,UAAU,QAAQ,gBAAgB,KAAK,IAAI,cAAc;CAClJ,IAAI,SAAS,GAAG,sBAAsB,aAAY,CAAE,MAAM,GAAG;CAC7D,OAAO;EACL,OAAO,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAC3D,YAAY,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAChE,UAAU,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAC9D,WAAW,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAC/D,YAAY,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAChE,eAAe,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EACnE,YAAY,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;EAChE,eAAe,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM;CACrE;AACF,CAAC;AACD,YAAY,aAAa,8BAA8B,IAAI,IAAI,CAC7D,GAAG,YAAY,aAAa,eAAe,CAAC,GAC5C,uBACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/text",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.889.1",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"source": "src/index.tsx",
|
|
6
6
|
"files": [
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"clean:build": "tamagui-build clean:build"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@tamagui/get-font-sized": "3.0.0-beta.
|
|
39
|
-
"@tamagui/helpers-tamagui": "3.0.0-beta.
|
|
40
|
-
"@tamagui/web": "3.0.0-beta.
|
|
38
|
+
"@tamagui/get-font-sized": "3.0.0-beta.889.1",
|
|
39
|
+
"@tamagui/helpers-tamagui": "3.0.0-beta.889.1",
|
|
40
|
+
"@tamagui/web": "3.0.0-beta.889.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@tamagui/build": "3.0.0-beta.
|
|
43
|
+
"@tamagui/build": "3.0.0-beta.889.1",
|
|
44
44
|
"react": "19.2.3"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
package/src/SizableText.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { getFontSized } from '@tamagui/get-font-sized'
|
|
|
2
2
|
import type { GetProps } from '@tamagui/web'
|
|
3
3
|
import { Text, styled } from '@tamagui/web'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const SizableTextFrame = styled(Text, {
|
|
6
6
|
displayName: 'SizableText',
|
|
7
7
|
fontFamily: 'body',
|
|
8
8
|
color: 'color',
|
|
@@ -12,26 +12,37 @@ export const SizableText = styled(Text, {
|
|
|
12
12
|
},
|
|
13
13
|
})
|
|
14
14
|
|
|
15
|
+
export const SizableText = SizableTextFrame.resolve((props, env) => {
|
|
16
|
+
if (props.fontFamily === 'inherit') {
|
|
17
|
+
return { fontFamily: 'inherit' }
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// This replaces the old `fontFamily: { any: ... }` variant. Only an
|
|
21
|
+
// authored fontFamily prop triggered that variant; running it for the
|
|
22
|
+
// component's inherited base family would let this resolver overwrite a
|
|
23
|
+
// later variant's size (for example H1's unstyled=false -> size=10).
|
|
24
|
+
if (props.fontFamily === undefined) {
|
|
25
|
+
return {}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const size =
|
|
29
|
+
props.size === true && props.fontSize ? props.fontSize : (props.size ?? true)
|
|
30
|
+
const sized = getFontSized(size as any, env)
|
|
31
|
+
return {
|
|
32
|
+
color: sized?.color,
|
|
33
|
+
fontFamily: sized?.fontFamily,
|
|
34
|
+
fontSize: sized?.fontSize,
|
|
35
|
+
fontStyle: sized?.fontStyle,
|
|
36
|
+
fontWeight: sized?.fontWeight,
|
|
37
|
+
letterSpacing: sized?.letterSpacing,
|
|
38
|
+
lineHeight: sized?.lineHeight,
|
|
39
|
+
textTransform: sized?.textTransform,
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
|
|
15
43
|
SizableText.staticConfig.inlineProps = new Set([
|
|
16
44
|
...(SizableText.staticConfig.inlineProps || []),
|
|
17
45
|
'maxFontSizeMultiplier',
|
|
18
46
|
])
|
|
19
47
|
|
|
20
|
-
// we are doing weird stuff to avoid bad types
|
|
21
|
-
// TODO make this just work
|
|
22
|
-
SizableText.staticConfig.variants!.fontFamily = {
|
|
23
|
-
any: (val, extras) => {
|
|
24
|
-
// pass through inherit directly without font variant expansion
|
|
25
|
-
if (val === 'inherit') {
|
|
26
|
-
return { fontFamily: 'inherit' }
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const sizeProp = extras.props['size']
|
|
30
|
-
const fontSizeProp = extras.props['fontSize']
|
|
31
|
-
const size =
|
|
32
|
-
sizeProp === true && fontSizeProp ? fontSizeProp : (extras.props['size'] ?? true)
|
|
33
|
-
return getFontSized(size, extras)
|
|
34
|
-
},
|
|
35
|
-
}
|
|
36
|
-
|
|
37
48
|
export type SizableTextProps = GetProps<typeof SizableText>
|
package/types/SizableText.d.ts
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import type { GetProps } from '@tamagui/web';
|
|
2
|
-
export declare const SizableText: import("
|
|
2
|
+
export declare const SizableText: import("@tamagui/web").TamaguiComponent<import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiTextElement, import("@tamagui/web").TextNonStyleProps, import("@tamagui/web").TextStylePropsBase, {
|
|
3
3
|
size?: import("@tamagui/web").FontSize | undefined;
|
|
4
|
-
}
|
|
5
|
-
ref?: import("react").Ref<import("@tamagui/web").TamaguiTextElement> | undefined;
|
|
6
|
-
}> & import("@tamagui/web").StaticComponentObject<import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiTextElement, import("@tamagui/web").TextNonStyleProps, import("@tamagui/web").TextStylePropsBase, {
|
|
7
|
-
size?: import("@tamagui/web").FontSize | undefined;
|
|
8
|
-
}, import("@tamagui/web").StaticConfigPublic> & Omit<import("@tamagui/web").StaticConfigPublic, "staticConfig"> & {
|
|
9
|
-
__tama: [import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiTextElement, import("@tamagui/web").TextNonStyleProps, import("@tamagui/web").TextStylePropsBase, {
|
|
10
|
-
size?: import("@tamagui/web").FontSize | undefined;
|
|
11
|
-
}, import("@tamagui/web").StaticConfigPublic];
|
|
12
|
-
};
|
|
4
|
+
}, import("@tamagui/web").StaticConfigPublic>;
|
|
13
5
|
export type SizableTextProps = GetProps<typeof SizableText>;
|
|
14
6
|
//# sourceMappingURL=SizableText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SizableText.d.ts","sourceRoot":"","sources":["../src/SizableText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"SizableText.d.ts","sourceRoot":"","sources":["../src/SizableText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAa5C,eAAO,MAAM,WAAW;;6CA0BtB,CAAA;AAOF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAA"}
|
package/types/types.d.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { type Shorthands, type TextStyle, type TextStylePropsBase, type WithShorthands } from '@tamagui/web';
|
|
2
2
|
import type { SizableTextProps } from './SizableText';
|
|
3
3
|
export declare const textParentProps: {
|
|
4
|
-
readonly
|
|
5
|
-
readonly
|
|
6
|
-
readonly
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
24
|
-
readonly
|
|
25
|
-
readonly
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
29
|
-
readonly
|
|
30
|
-
readonly
|
|
31
|
-
readonly
|
|
4
|
+
readonly WebkitBoxOrient: true;
|
|
5
|
+
readonly WebkitLineClamp: true;
|
|
6
|
+
readonly color: true;
|
|
7
|
+
readonly font: true;
|
|
8
|
+
readonly fontFamily: true;
|
|
9
|
+
readonly fontSize: true;
|
|
10
|
+
readonly fontStyle: true;
|
|
11
|
+
readonly fontVariant: true;
|
|
12
|
+
readonly fontWeight: true;
|
|
13
|
+
readonly letterSpacing: true;
|
|
14
|
+
readonly lineHeight: true;
|
|
15
|
+
readonly textAlign: true;
|
|
16
|
+
readonly textDecoration: true;
|
|
17
|
+
readonly textDecorationColor: true;
|
|
18
|
+
readonly textDecorationDistance: true;
|
|
19
|
+
readonly textDecorationLine: true;
|
|
20
|
+
readonly textDecorationStyle: true;
|
|
21
|
+
readonly textOverflow: true;
|
|
22
|
+
readonly textShadow: true;
|
|
23
|
+
readonly textShadowColor: true;
|
|
24
|
+
readonly textShadowOffset: true;
|
|
25
|
+
readonly textShadowRadius: true;
|
|
26
|
+
readonly textTransform: true;
|
|
27
|
+
readonly userSelect: true;
|
|
28
|
+
readonly verticalAlign: true;
|
|
29
|
+
readonly whiteSpace: true;
|
|
30
|
+
readonly wordWrap: true;
|
|
31
|
+
readonly writingDirection: true;
|
|
32
32
|
readonly ellipsis: true;
|
|
33
33
|
readonly maxFontSizeMultiplier: true;
|
|
34
34
|
readonly noTextWrap: true;
|