@tamagui/font-size
Advanced tools
Comparing version 1.113.2 to 1.114.0
@@ -31,7 +31,8 @@ var __defProp = Object.defineProperty; | ||
const conf = (0, import_core.getConfig)(); | ||
return conf.fontsParsed[opts?.font || conf.defaultFontToken].size[token]; | ||
return conf.fontsParsed[opts?.font || conf.defaultFontToken]?.size[token]; | ||
}, getFontSizeToken = (inSize, opts) => { | ||
if (typeof inSize == "number") | ||
return null; | ||
const relativeSize = opts?.relativeSize || 0, conf = (0, import_core.getConfig)(), fontSize = conf.fontsParsed[opts?.font || conf.defaultFontToken].size, size = (inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) ?? ("$true" in fontSize ? "$true" : "$4"), sizeTokens = Object.keys(fontSize); | ||
const relativeSize = opts?.relativeSize || 0, conf = (0, import_core.getConfig)(), fontSize = conf.fontsParsed[opts?.font || conf.defaultFontToken]?.size || // fallback to size tokens | ||
conf.tokensParsed.size, size = (inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) ?? ("$true" in fontSize ? "$true" : "$4"), sizeTokens = Object.keys(fontSize); | ||
let foundIndex = sizeTokens.indexOf(size); | ||
@@ -38,0 +39,0 @@ 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); |
@@ -30,8 +30,9 @@ "use strict"; | ||
return inSize; | ||
var conf = (0, import_core.getConfig)(); | ||
return conf.fontsParsed[(opts == null ? void 0 : opts.font) || conf.defaultFontToken].size[token]; | ||
var conf = (0, import_core.getConfig)(), font = conf.fontsParsed[(opts == null ? void 0 : opts.font) || conf.defaultFontToken]; | ||
return font == null ? void 0 : font.size[token]; | ||
}, getFontSizeToken = function(inSize, opts) { | ||
if (typeof inSize == "number") | ||
return null; | ||
var relativeSize = (opts == null ? void 0 : opts.relativeSize) || 0, conf = (0, import_core.getConfig)(), fontSize = conf.fontsParsed[(opts == null ? void 0 : opts.font) || conf.defaultFontToken].size, _ref, size = (_ref = inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) !== null && _ref !== void 0 ? _ref : "$true" in fontSize ? "$true" : "$4", sizeTokens = Object.keys(fontSize), foundIndex = sizeTokens.indexOf(size); | ||
var relativeSize = (opts == null ? void 0 : opts.relativeSize) || 0, conf = (0, import_core.getConfig)(), font = conf.fontsParsed[(opts == null ? void 0 : opts.font) || conf.defaultFontToken], fontSize = (font == null ? void 0 : font.size) || // fallback to size tokens | ||
conf.tokensParsed.size, _ref, size = (_ref = inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) !== null && _ref !== void 0 ? _ref : "$true" in fontSize ? "$true" : "$4", sizeTokens = Object.keys(fontSize), foundIndex = sizeTokens.indexOf(size); | ||
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); | ||
@@ -38,0 +39,0 @@ var tokenIndex = Math.min(Math.max(0, foundIndex + relativeSize), sizeTokens.length - 1), _sizeTokens_tokenIndex; |
@@ -10,7 +10,8 @@ import { getConfig, isVariable } from "@tamagui/core"; | ||
const conf = getConfig(); | ||
return conf.fontsParsed[opts?.font || conf.defaultFontToken].size[token]; | ||
return conf.fontsParsed[opts?.font || conf.defaultFontToken]?.size[token]; | ||
}, getFontSizeToken = (inSize, opts) => { | ||
if (typeof inSize == "number") | ||
return null; | ||
const relativeSize = opts?.relativeSize || 0, conf = getConfig(), fontSize = conf.fontsParsed[opts?.font || conf.defaultFontToken].size, size = (inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) ?? ("$true" in fontSize ? "$true" : "$4"), sizeTokens = Object.keys(fontSize); | ||
const relativeSize = opts?.relativeSize || 0, conf = getConfig(), fontSize = conf.fontsParsed[opts?.font || conf.defaultFontToken]?.size || // fallback to size tokens | ||
conf.tokensParsed.size, size = (inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) ?? ("$true" in fontSize ? "$true" : "$4"), sizeTokens = Object.keys(fontSize); | ||
let foundIndex = sizeTokens.indexOf(size); | ||
@@ -17,0 +18,0 @@ 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); |
@@ -9,8 +9,9 @@ import { getConfig, isVariable } from "@tamagui/core"; | ||
return inSize; | ||
var conf = getConfig(); | ||
return conf.fontsParsed[opts?.font || conf.defaultFontToken].size[token]; | ||
var conf = getConfig(), font = conf.fontsParsed[opts?.font || conf.defaultFontToken]; | ||
return font?.size[token]; | ||
}, getFontSizeToken = function(inSize, opts) { | ||
if (typeof inSize == "number") | ||
return null; | ||
var relativeSize = opts?.relativeSize || 0, conf = getConfig(), fontSize = conf.fontsParsed[opts?.font || conf.defaultFontToken].size, _ref, size = (_ref = inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) !== null && _ref !== void 0 ? _ref : "$true" in fontSize ? "$true" : "$4", sizeTokens = Object.keys(fontSize), foundIndex = sizeTokens.indexOf(size); | ||
var relativeSize = opts?.relativeSize || 0, conf = getConfig(), font = conf.fontsParsed[opts?.font || conf.defaultFontToken], fontSize = font?.size || // fallback to size tokens | ||
conf.tokensParsed.size, _ref, size = (_ref = inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) !== null && _ref !== void 0 ? _ref : "$true" in fontSize ? "$true" : "$4", sizeTokens = Object.keys(fontSize), foundIndex = sizeTokens.indexOf(size); | ||
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); | ||
@@ -17,0 +18,0 @@ var tokenIndex = Math.min(Math.max(0, foundIndex + relativeSize), sizeTokens.length - 1), _sizeTokens_tokenIndex; |
@@ -10,7 +10,8 @@ import { getConfig, isVariable } from "@tamagui/core"; | ||
const conf = getConfig(); | ||
return conf.fontsParsed[opts?.font || conf.defaultFontToken].size[token]; | ||
return conf.fontsParsed[opts?.font || conf.defaultFontToken]?.size[token]; | ||
}, getFontSizeToken = (inSize, opts) => { | ||
if (typeof inSize == "number") | ||
return null; | ||
const relativeSize = opts?.relativeSize || 0, conf = getConfig(), fontSize = conf.fontsParsed[opts?.font || conf.defaultFontToken].size, size = (inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) ?? ("$true" in fontSize ? "$true" : "$4"), sizeTokens = Object.keys(fontSize); | ||
const relativeSize = opts?.relativeSize || 0, conf = getConfig(), fontSize = conf.fontsParsed[opts?.font || conf.defaultFontToken]?.size || // fallback to size tokens | ||
conf.tokensParsed.size, size = (inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) ?? ("$true" in fontSize ? "$true" : "$4"), sizeTokens = Object.keys(fontSize); | ||
let foundIndex = sizeTokens.indexOf(size); | ||
@@ -17,0 +18,0 @@ 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); |
@@ -9,8 +9,9 @@ import { getConfig, isVariable } from "@tamagui/core"; | ||
return inSize; | ||
var conf = getConfig(); | ||
return conf.fontsParsed[(opts == null ? void 0 : opts.font) || conf.defaultFontToken].size[token]; | ||
var conf = getConfig(), font = conf.fontsParsed[(opts == null ? void 0 : opts.font) || conf.defaultFontToken]; | ||
return font == null ? void 0 : font.size[token]; | ||
}, getFontSizeToken = function(inSize, opts) { | ||
if (typeof inSize == "number") | ||
return null; | ||
var relativeSize = (opts == null ? void 0 : opts.relativeSize) || 0, conf = getConfig(), fontSize = conf.fontsParsed[(opts == null ? void 0 : opts.font) || conf.defaultFontToken].size, _ref, size = (_ref = inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) !== null && _ref !== void 0 ? _ref : "$true" in fontSize ? "$true" : "$4", sizeTokens = Object.keys(fontSize), foundIndex = sizeTokens.indexOf(size); | ||
var relativeSize = (opts == null ? void 0 : opts.relativeSize) || 0, conf = getConfig(), font = conf.fontsParsed[(opts == null ? void 0 : opts.font) || conf.defaultFontToken], fontSize = (font == null ? void 0 : font.size) || // fallback to size tokens | ||
conf.tokensParsed.size, _ref, size = (_ref = inSize === "$true" && !("$true" in fontSize) ? "$4" : inSize) !== null && _ref !== void 0 ? _ref : "$true" in fontSize ? "$true" : "$4", sizeTokens = Object.keys(fontSize), foundIndex = sizeTokens.indexOf(size); | ||
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); | ||
@@ -17,0 +18,0 @@ var tokenIndex = Math.min(Math.max(0, foundIndex + relativeSize), sizeTokens.length - 1), _sizeTokens_tokenIndex; |
{ | ||
"name": "@tamagui/font-size", | ||
"version": "1.113.2", | ||
"version": "1.114.0", | ||
"sideEffects": false, | ||
@@ -33,6 +33,6 @@ "source": "src/index.ts", | ||
"dependencies": { | ||
"@tamagui/core": "1.113.2" | ||
"@tamagui/core": "1.114.0" | ||
}, | ||
"devDependencies": { | ||
"@tamagui/build": "1.113.2", | ||
"@tamagui/build": "1.114.0", | ||
"react": "^18.2.0 || ^19.0.0" | ||
@@ -39,0 +39,0 @@ }, |
@@ -29,3 +29,4 @@ import type { FontSizeTokens, FontTokens } from '@tamagui/core' | ||
const conf = getConfig() | ||
return conf.fontsParsed[opts?.font || conf.defaultFontToken].size[token] | ||
const font = conf.fontsParsed[opts?.font || conf.defaultFontToken] | ||
return font?.size[token] | ||
} | ||
@@ -43,3 +44,7 @@ | ||
const conf = getConfig() | ||
const fontSize = conf.fontsParsed[opts?.font || conf.defaultFontToken].size | ||
const font = conf.fontsParsed[opts?.font || conf.defaultFontToken] | ||
const fontSize = | ||
font?.size || | ||
// fallback to size tokens | ||
conf.tokensParsed.size | ||
const size = | ||
@@ -46,0 +51,0 @@ (inSize === '$true' && !('$true' in fontSize) ? '$4' : inSize) ?? |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43010
471
+ Added@tamagui/compose-refs@1.114.0(transitive)
+ Added@tamagui/constants@1.114.0(transitive)
+ Added@tamagui/core@1.114.0(transitive)
+ Added@tamagui/helpers@1.114.0(transitive)
+ Added@tamagui/normalize-css-color@1.114.0(transitive)
+ Added@tamagui/react-native-use-pressable@1.114.0(transitive)
+ Added@tamagui/react-native-use-responder-events@1.114.0(transitive)
+ Added@tamagui/simple-hash@1.114.0(transitive)
+ Added@tamagui/timer@1.114.0(transitive)
+ Added@tamagui/types@1.114.0(transitive)
+ Added@tamagui/use-did-finish-ssr@1.114.0(transitive)
+ Added@tamagui/use-event@1.114.0(transitive)
+ Added@tamagui/use-force-update@1.114.0(transitive)
+ Added@tamagui/web@1.114.0(transitive)
- Removed@tamagui/compose-refs@1.113.2(transitive)
- Removed@tamagui/constants@1.113.2(transitive)
- Removed@tamagui/core@1.113.2(transitive)
- Removed@tamagui/helpers@1.113.2(transitive)
- Removed@tamagui/normalize-css-color@1.113.2(transitive)
- Removed@tamagui/react-native-use-pressable@1.113.2(transitive)
- Removed@tamagui/react-native-use-responder-events@1.113.2(transitive)
- Removed@tamagui/simple-hash@1.113.2(transitive)
- Removed@tamagui/timer@1.113.2(transitive)
- Removed@tamagui/types@1.113.2(transitive)
- Removed@tamagui/use-did-finish-ssr@1.113.2(transitive)
- Removed@tamagui/use-event@1.113.2(transitive)
- Removed@tamagui/use-force-update@1.113.2(transitive)
- Removed@tamagui/web@1.113.2(transitive)
Updated@tamagui/core@1.114.0