@tamagui/font-size 1.88.21 → 1.88.23

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.
@@ -1,36 +1,14 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
- var getFontSize_exports = {};
17
- __export(getFontSize_exports, {
18
- getFontSize: () => getFontSize,
19
- getFontSizeToken: () => getFontSizeToken,
20
- getFontSizeVariable: () => getFontSizeVariable
21
- });
22
- module.exports = __toCommonJS(getFontSize_exports);
23
- var import_core = require("@tamagui/core");
1
+ import { getConfig, isVariable } from "@tamagui/core";
24
2
  const getFontSize = (inSize, opts) => {
25
3
  const res = getFontSizeVariable(inSize, opts);
26
- return (0, import_core.isVariable)(res) ? +res.val : res ? +res : 16;
4
+ return isVariable(res) ? +res.val : res ? +res : 16;
27
5
  }, getFontSizeVariable = (inSize, opts) => {
28
6
  const token = getFontSizeToken(inSize, opts);
29
- return token ? (0, import_core.getConfig)().fontsParsed[(opts == null ? void 0 : opts.font) || "$body"].size[token] : inSize;
7
+ return token ? getConfig().fontsParsed[(opts == null ? void 0 : opts.font) || "$body"].size[token] : inSize;
30
8
  }, getFontSizeToken = (inSize, opts) => {
31
9
  if (typeof inSize == "number")
32
10
  return null;
33
- const relativeSize = (opts == null ? void 0 : opts.relativeSize) || 0, fontSize = (0, import_core.getConfig)().fontsParsed[(opts == null ? void 0 : opts.font) || "$body"].size, size = (inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) ?? ("$true" in fontSize ? "$true" : "$4"), sizeTokens = Object.keys(fontSize);
11
+ const relativeSize = (opts == null ? void 0 : opts.relativeSize) || 0, fontSize = getConfig().fontsParsed[(opts == null ? void 0 : opts.font) || "$body"].size, size = (inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) ?? ("$true" in fontSize ? "$true" : "$4"), sizeTokens = Object.keys(fontSize);
34
12
  let foundIndex = sizeTokens.indexOf(size);
35
13
  foundIndex === -1 && size.endsWith(".5") && (foundIndex = sizeTokens.indexOf(size.replace(".5", ""))), process.env.NODE_ENV === "development" && foundIndex === -1 && console.warn("No font size found", size, opts, "in size tokens", sizeTokens);
36
14
  const tokenIndex = Math.min(
@@ -39,10 +17,9 @@ const getFontSize = (inSize, opts) => {
39
17
  );
40
18
  return sizeTokens[tokenIndex] ?? size;
41
19
  };
42
- // Annotate the CommonJS export names for ESM import in node:
43
- 0 && (module.exports = {
20
+ export {
44
21
  getFontSize,
45
22
  getFontSizeToken,
46
23
  getFontSizeVariable
47
- });
24
+ };
48
25
  //# sourceMappingURL=getFontSize.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/getFontSize.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAsC;AAO/B,MAAM,cAAc,CACzB,QACA,SACW;AACX,QAAM,MAAM,oBAAoB,QAAQ,IAAI;AAC5C,aAAI,wBAAW,GAAG,IACT,CAAC,IAAI,MAEP,MAAM,CAAC,MAAM;AACtB,GAEa,sBAAsB,CACjC,QACA,SACG;AACH,QAAM,QAAQ,iBAAiB,QAAQ,IAAI;AAC3C,SAAK,YAGQ,uBAAU,EACX,aAAY,6BAAM,SAAQ,OAAO,EAAE,K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OAC7B,aAAa,OAAO,KAAK,QAAQ;AACvC,MAAI,aAAa,WAAW,QAAQ,IAAI;AACxC,EAAI,eAAe,MACb,KAAK,SAAS,IAAI,MACpB,aAAa,WAAW,QAAQ,KAAK,QAAQ,MAAM,EAAE,CAAC,IAGtD,QAAQ,IAAI,aAAa,iBACvB,eAAe,MACjB,QAAQ,KAAK,sBAAsB,MAAM,MAAM,kBAAkB,UAAU;AAG/E,QAAM,aAAa,KAAK;AAAA,IACtB,KAAK,IAAI,GAAG,aAAa,YAAY;AAAA,IACrC,WAAW,SAAS;AAAA,EACtB;AACA,SAAQ,WAAW,UAAU,KAAK;AACpC;",
5
5
  "names": []
6
6
  }
@@ -1,20 +1,2 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from == "object" || typeof from == "function")
8
- for (let key of __getOwnPropNames(from))
9
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- return to;
11
- }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
12
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
13
- var src_exports = {};
14
- module.exports = __toCommonJS(src_exports);
15
- __reExport(src_exports, require("./getFontSize"), module.exports);
16
- // Annotate the CommonJS export names for ESM import in node:
17
- 0 && (module.exports = {
18
- ...require("./getFontSize")
19
- });
1
+ export * from "./getFontSize";
20
2
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,0BAAd;",
4
+ "mappings": "AAAA,cAAc;",
5
5
  "names": []
6
6
  }
@@ -1,36 +1,14 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
- var getFontSize_exports = {};
17
- __export(getFontSize_exports, {
18
- getFontSize: () => getFontSize,
19
- getFontSizeToken: () => getFontSizeToken,
20
- getFontSizeVariable: () => getFontSizeVariable
21
- });
22
- module.exports = __toCommonJS(getFontSize_exports);
23
- var import_core = require("@tamagui/core");
1
+ import { getConfig, isVariable } from "@tamagui/core";
24
2
  const getFontSize = (inSize, opts) => {
25
3
  const res = getFontSizeVariable(inSize, opts);
26
- return (0, import_core.isVariable)(res) ? +res.val : res ? +res : 16;
4
+ return isVariable(res) ? +res.val : res ? +res : 16;
27
5
  }, getFontSizeVariable = (inSize, opts) => {
28
6
  const token = getFontSizeToken(inSize, opts);
29
- return token ? (0, import_core.getConfig)().fontsParsed[(opts == null ? void 0 : opts.font) || "$body"].size[token] : inSize;
7
+ return token ? getConfig().fontsParsed[(opts == null ? void 0 : opts.font) || "$body"].size[token] : inSize;
30
8
  }, getFontSizeToken = (inSize, opts) => {
31
9
  if (typeof inSize == "number")
32
10
  return null;
33
- const relativeSize = (opts == null ? void 0 : opts.relativeSize) || 0, fontSize = (0, import_core.getConfig)().fontsParsed[(opts == null ? void 0 : opts.font) || "$body"].size, size = (inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) ?? ("$true" in fontSize ? "$true" : "$4"), sizeTokens = Object.keys(fontSize);
11
+ const relativeSize = (opts == null ? void 0 : opts.relativeSize) || 0, fontSize = getConfig().fontsParsed[(opts == null ? void 0 : opts.font) || "$body"].size, size = (inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) ?? ("$true" in fontSize ? "$true" : "$4"), sizeTokens = Object.keys(fontSize);
34
12
  let foundIndex = sizeTokens.indexOf(size);
35
13
  foundIndex === -1 && size.endsWith(".5") && (foundIndex = sizeTokens.indexOf(size.replace(".5", ""))), process.env.NODE_ENV === "development" && foundIndex === -1 && console.warn("No font size found", size, opts, "in size tokens", sizeTokens);
36
14
  const tokenIndex = Math.min(
@@ -39,10 +17,9 @@ const getFontSize = (inSize, opts) => {
39
17
  );
40
18
  return sizeTokens[tokenIndex] ?? size;
41
19
  };
42
- // Annotate the CommonJS export names for ESM import in node:
43
- 0 && (module.exports = {
20
+ export {
44
21
  getFontSize,
45
22
  getFontSizeToken,
46
23
  getFontSizeVariable
47
- });
24
+ };
48
25
  //# sourceMappingURL=getFontSize.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/getFontSize.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAsC;AAO/B,MAAM,cAAc,CACzB,QACA,SACW;AACX,QAAM,MAAM,oBAAoB,QAAQ,IAAI;AAC5C,aAAI,wBAAW,GAAG,IACT,CAAC,IAAI,MAEP,MAAM,CAAC,MAAM;AACtB,GAEa,sBAAsB,CACjC,QACA,SACG;AACH,QAAM,QAAQ,iBAAiB,QAAQ,IAAI;AAC3C,SAAK,YAGQ,uBAAU,EACX,aAAY,6BAAM,SAAQ,OAAO,EAAE,KAAK,KAAK,IAHhD;AAIX,GAEa,mBAAmB,CAC9B,QACA,SAC0B;AAC1B,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AAI;AACxC,EAAI,eAAe,MACb,KAAK,SAAS,IAAI,MACpB,aAAa,WAAW,QAAQ,KAAK,QAAQ,MAAM,EAAE,CAAC,IAGtD,QAAQ,IAAI,aAAa,iBACvB,eAAe,MACjB,QAAQ,KAAK,sBAAsB,MAAM,MAAM,kBAAkB,UAAU;AAG/E,QAAM,aAAa,KAAK;AAAA,IACtB,KAAK,IAAI,GAAG,aAAa,YAAY;AAAA,IACrC,WAAW,SAAS;AAAA,EACtB;AACA,SAAQ,WAAW,UAAU,KAAK;AACpC;",
5
5
  "names": []
6
6
  }
@@ -1,20 +1,2 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from == "object" || typeof from == "function")
8
- for (let key of __getOwnPropNames(from))
9
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- return to;
11
- }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
12
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
13
- var src_exports = {};
14
- module.exports = __toCommonJS(src_exports);
15
- __reExport(src_exports, require("./getFontSize"), module.exports);
16
- // Annotate the CommonJS export names for ESM import in node:
17
- 0 && (module.exports = {
18
- ...require("./getFontSize")
19
- });
1
+ export * from "./getFontSize";
20
2
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,0BAAd;",
4
+ "mappings": "AAAA,cAAc;",
5
5
  "names": []
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/font-size",
3
- "version": "1.88.21",
3
+ "version": "1.88.23",
4
4
  "sideEffects": false,
5
5
  "source": "src/index.ts",
6
6
  "types": "./types/index.d.ts",
@@ -20,13 +20,13 @@
20
20
  "lint:fix": "../../node_modules/.bin/biome check --apply-unsafe src"
21
21
  },
22
22
  "dependencies": {
23
- "@tamagui/core": "1.88.21"
23
+ "@tamagui/core": "1.88.23"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": "*"
27
27
  },
28
28
  "devDependencies": {
29
- "@tamagui/build": "1.88.21",
29
+ "@tamagui/build": "1.88.23",
30
30
  "react": "^18.2.0"
31
31
  },
32
32
  "publishConfig": {