Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tamagui/font-size

Package Overview
Dependencies
Maintainers
1
Versions
1075
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tamagui/font-size - npm Package Compare versions

Comparing version 1.113.2 to 1.114.0

5

dist/cjs/getFontSize.js

@@ -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);

7

dist/cjs/getFontSize.native.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc