@tamagui/get-font-sized
Advanced tools
Comparing version 1.109.6 to 1.109.7
@@ -22,10 +22,4 @@ var __defProp = Object.defineProperty; | ||
const getFontSized = (sizeTokenIn = "$true", { font, fontFamily, props }) => { | ||
if (!font) { | ||
process.env.NODE_ENV === "development" && console.warn( | ||
"Warning: No font found in props", | ||
{ ...props }, | ||
'For a sized text component, you either need to set fontFamily directly, or through the "defaultFont" setting in your createTamagui config.' | ||
); | ||
if (!font) | ||
return; | ||
} | ||
const sizeToken = sizeTokenIn === "$true" ? getDefaultSizeToken(font) : sizeTokenIn, fontSize = font.size[sizeToken], lineHeight = font.lineHeight?.[sizeToken], fontWeight = font.weight?.[sizeToken], letterSpacing = font.letterSpacing?.[sizeToken], textTransform = font.transform?.[sizeToken], fontStyle = props.fontStyle ?? font.style?.[sizeToken], style = { | ||
@@ -32,0 +26,0 @@ color: props.color ?? font.color?.[sizeToken], |
@@ -22,21 +22,2 @@ "use strict"; | ||
var import_core = require("@tamagui/core"); | ||
function _define_property(obj, key, value) { | ||
return key in obj ? Object.defineProperty(obj, key, { | ||
value, | ||
enumerable: !0, | ||
configurable: !0, | ||
writable: !0 | ||
}) : obj[key] = value, obj; | ||
} | ||
function _object_spread(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i] != null ? arguments[i] : {}, ownKeys = Object.keys(source); | ||
typeof Object.getOwnPropertySymbols == "function" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { | ||
return Object.getOwnPropertyDescriptor(source, sym).enumerable; | ||
}))), ownKeys.forEach(function(key) { | ||
_define_property(target, key, source[key]); | ||
}); | ||
} | ||
return target; | ||
} | ||
function _type_of(obj) { | ||
@@ -48,21 +29,19 @@ "@swc/helpers - typeof"; | ||
var sizeTokenIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "$true", _ref = arguments.length > 1 ? arguments[1] : void 0, font = _ref.font, fontFamily = _ref.fontFamily, props = _ref.props, _font_lineHeight, _font_weight, _font_letterSpacing, _font_transform, _font_style, _font_color; | ||
if (!font) { | ||
process.env.NODE_ENV === "development" && console.warn("Warning: No font found in props", _object_spread({}, props), 'For a sized text component, you either need to set fontFamily directly, or through the "defaultFont" setting in your createTamagui config.'); | ||
return; | ||
if (font) { | ||
var sizeToken = sizeTokenIn === "$true" ? getDefaultSizeToken(font) : sizeTokenIn, fontSize = font.size[sizeToken], lineHeight = (_font_lineHeight = font.lineHeight) === null || _font_lineHeight === void 0 ? void 0 : _font_lineHeight[sizeToken], fontWeight = (_font_weight = font.weight) === null || _font_weight === void 0 ? void 0 : _font_weight[sizeToken], letterSpacing = (_font_letterSpacing = font.letterSpacing) === null || _font_letterSpacing === void 0 ? void 0 : _font_letterSpacing[sizeToken], textTransform = (_font_transform = font.transform) === null || _font_transform === void 0 ? void 0 : _font_transform[sizeToken], _props_fontStyle, fontStyle = (_props_fontStyle = props.fontStyle) !== null && _props_fontStyle !== void 0 ? _props_fontStyle : (_font_style = font.style) === null || _font_style === void 0 ? void 0 : _font_style[sizeToken], _props_color, color = (_props_color = props.color) !== null && _props_color !== void 0 ? _props_color : (_font_color = font.color) === null || _font_color === void 0 ? void 0 : _font_color[sizeToken], style = { | ||
color, | ||
fontStyle, | ||
textTransform, | ||
fontFamily, | ||
fontWeight, | ||
letterSpacing, | ||
fontSize, | ||
lineHeight | ||
}; | ||
return process.env.NODE_ENV === "development" && props.debug && props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} getFontSized", sizeTokenIn, sizeToken), console.info({ | ||
style, | ||
props, | ||
font | ||
}), console.groupEnd()), style; | ||
} | ||
var sizeToken = sizeTokenIn === "$true" ? getDefaultSizeToken(font) : sizeTokenIn, fontSize = font.size[sizeToken], lineHeight = (_font_lineHeight = font.lineHeight) === null || _font_lineHeight === void 0 ? void 0 : _font_lineHeight[sizeToken], fontWeight = (_font_weight = font.weight) === null || _font_weight === void 0 ? void 0 : _font_weight[sizeToken], letterSpacing = (_font_letterSpacing = font.letterSpacing) === null || _font_letterSpacing === void 0 ? void 0 : _font_letterSpacing[sizeToken], textTransform = (_font_transform = font.transform) === null || _font_transform === void 0 ? void 0 : _font_transform[sizeToken], _props_fontStyle, fontStyle = (_props_fontStyle = props.fontStyle) !== null && _props_fontStyle !== void 0 ? _props_fontStyle : (_font_style = font.style) === null || _font_style === void 0 ? void 0 : _font_style[sizeToken], _props_color, color = (_props_color = props.color) !== null && _props_color !== void 0 ? _props_color : (_font_color = font.color) === null || _font_color === void 0 ? void 0 : _font_color[sizeToken], style = { | ||
color, | ||
fontStyle, | ||
textTransform, | ||
fontFamily, | ||
fontWeight, | ||
letterSpacing, | ||
fontSize, | ||
lineHeight | ||
}; | ||
return process.env.NODE_ENV === "development" && props.debug && props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} getFontSized", sizeTokenIn, sizeToken), console.info({ | ||
style, | ||
props, | ||
font | ||
}), console.groupEnd()), style; | ||
}, cache = /* @__PURE__ */ new WeakMap(); | ||
@@ -69,0 +48,0 @@ function getDefaultSizeToken(font) { |
import { getTokens } from "@tamagui/core"; | ||
const getFontSized = (sizeTokenIn = "$true", { font, fontFamily, props }) => { | ||
if (!font) { | ||
process.env.NODE_ENV === "development" && console.warn( | ||
"Warning: No font found in props", | ||
{ ...props }, | ||
'For a sized text component, you either need to set fontFamily directly, or through the "defaultFont" setting in your createTamagui config.' | ||
); | ||
if (!font) | ||
return; | ||
} | ||
const sizeToken = sizeTokenIn === "$true" ? getDefaultSizeToken(font) : sizeTokenIn, fontSize = font.size[sizeToken], lineHeight = font.lineHeight?.[sizeToken], fontWeight = font.weight?.[sizeToken], letterSpacing = font.letterSpacing?.[sizeToken], textTransform = font.transform?.[sizeToken], fontStyle = props.fontStyle ?? font.style?.[sizeToken], style = { | ||
@@ -12,0 +6,0 @@ color: props.color ?? font.color?.[sizeToken], |
import { getTokens } from "@tamagui/core"; | ||
function _define_property(obj, key, value) { | ||
return key in obj ? Object.defineProperty(obj, key, { | ||
value, | ||
enumerable: !0, | ||
configurable: !0, | ||
writable: !0 | ||
}) : obj[key] = value, obj; | ||
} | ||
function _object_spread(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i] != null ? arguments[i] : {}, ownKeys = Object.keys(source); | ||
typeof Object.getOwnPropertySymbols == "function" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { | ||
return Object.getOwnPropertyDescriptor(source, sym).enumerable; | ||
}))), ownKeys.forEach(function(key) { | ||
_define_property(target, key, source[key]); | ||
}); | ||
} | ||
return target; | ||
} | ||
function _type_of(obj) { | ||
@@ -27,21 +8,19 @@ "@swc/helpers - typeof"; | ||
var sizeTokenIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "$true", _ref = arguments.length > 1 ? arguments[1] : void 0, font = _ref.font, fontFamily = _ref.fontFamily, props = _ref.props, _font_lineHeight, _font_weight, _font_letterSpacing, _font_transform, _font_style, _font_color; | ||
if (!font) { | ||
process.env.NODE_ENV === "development" && console.warn("Warning: No font found in props", _object_spread({}, props), 'For a sized text component, you either need to set fontFamily directly, or through the "defaultFont" setting in your createTamagui config.'); | ||
return; | ||
if (font) { | ||
var sizeToken = sizeTokenIn === "$true" ? getDefaultSizeToken(font) : sizeTokenIn, fontSize = font.size[sizeToken], lineHeight = (_font_lineHeight = font.lineHeight) === null || _font_lineHeight === void 0 ? void 0 : _font_lineHeight[sizeToken], fontWeight = (_font_weight = font.weight) === null || _font_weight === void 0 ? void 0 : _font_weight[sizeToken], letterSpacing = (_font_letterSpacing = font.letterSpacing) === null || _font_letterSpacing === void 0 ? void 0 : _font_letterSpacing[sizeToken], textTransform = (_font_transform = font.transform) === null || _font_transform === void 0 ? void 0 : _font_transform[sizeToken], _props_fontStyle, fontStyle = (_props_fontStyle = props.fontStyle) !== null && _props_fontStyle !== void 0 ? _props_fontStyle : (_font_style = font.style) === null || _font_style === void 0 ? void 0 : _font_style[sizeToken], _props_color, color = (_props_color = props.color) !== null && _props_color !== void 0 ? _props_color : (_font_color = font.color) === null || _font_color === void 0 ? void 0 : _font_color[sizeToken], style = { | ||
color, | ||
fontStyle, | ||
textTransform, | ||
fontFamily, | ||
fontWeight, | ||
letterSpacing, | ||
fontSize, | ||
lineHeight | ||
}; | ||
return process.env.NODE_ENV === "development" && props.debug && props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} getFontSized", sizeTokenIn, sizeToken), console.info({ | ||
style, | ||
props, | ||
font | ||
}), console.groupEnd()), style; | ||
} | ||
var sizeToken = sizeTokenIn === "$true" ? getDefaultSizeToken(font) : sizeTokenIn, fontSize = font.size[sizeToken], lineHeight = (_font_lineHeight = font.lineHeight) === null || _font_lineHeight === void 0 ? void 0 : _font_lineHeight[sizeToken], fontWeight = (_font_weight = font.weight) === null || _font_weight === void 0 ? void 0 : _font_weight[sizeToken], letterSpacing = (_font_letterSpacing = font.letterSpacing) === null || _font_letterSpacing === void 0 ? void 0 : _font_letterSpacing[sizeToken], textTransform = (_font_transform = font.transform) === null || _font_transform === void 0 ? void 0 : _font_transform[sizeToken], _props_fontStyle, fontStyle = (_props_fontStyle = props.fontStyle) !== null && _props_fontStyle !== void 0 ? _props_fontStyle : (_font_style = font.style) === null || _font_style === void 0 ? void 0 : _font_style[sizeToken], _props_color, color = (_props_color = props.color) !== null && _props_color !== void 0 ? _props_color : (_font_color = font.color) === null || _font_color === void 0 ? void 0 : _font_color[sizeToken], style = { | ||
color, | ||
fontStyle, | ||
textTransform, | ||
fontFamily, | ||
fontWeight, | ||
letterSpacing, | ||
fontSize, | ||
lineHeight | ||
}; | ||
return process.env.NODE_ENV === "development" && props.debug && props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} getFontSized", sizeTokenIn, sizeToken), console.info({ | ||
style, | ||
props, | ||
font | ||
}), console.groupEnd()), style; | ||
}, cache = /* @__PURE__ */ new WeakMap(); | ||
@@ -48,0 +27,0 @@ function getDefaultSizeToken(font) { |
{ | ||
"name": "@tamagui/get-font-sized", | ||
"version": "1.109.6", | ||
"version": "1.109.7", | ||
"types": "./types/index.d.ts", | ||
@@ -31,6 +31,6 @@ "main": "dist/cjs", | ||
"dependencies": { | ||
"@tamagui/core": "1.109.6" | ||
"@tamagui/core": "1.109.7" | ||
}, | ||
"devDependencies": { | ||
"@tamagui/build": "1.109.6", | ||
"@tamagui/build": "1.109.7", | ||
"react": "^18.2.0 || ^19.0.0" | ||
@@ -37,0 +37,0 @@ }, |
@@ -14,9 +14,2 @@ import type { | ||
if (!font) { | ||
if (process.env.NODE_ENV === 'development') { | ||
console.warn( | ||
`Warning: No font found in props`, | ||
{ ...props }, | ||
`For a sized text component, you either need to set fontFamily directly, or through the "defaultFont" setting in your createTamagui config.` | ||
) | ||
} | ||
return | ||
@@ -23,0 +16,0 @@ } |
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
11
27589
296
+ Added@tamagui/compose-refs@1.109.7(transitive)
+ Added@tamagui/constants@1.109.7(transitive)
+ Added@tamagui/core@1.109.7(transitive)
+ Added@tamagui/helpers@1.109.7(transitive)
+ Added@tamagui/normalize-css-color@1.109.7(transitive)
+ Added@tamagui/react-native-use-pressable@1.109.7(transitive)
+ Added@tamagui/react-native-use-responder-events@1.109.7(transitive)
+ Added@tamagui/simple-hash@1.109.7(transitive)
+ Added@tamagui/timer@1.109.7(transitive)
+ Added@tamagui/types@1.109.7(transitive)
+ Added@tamagui/use-did-finish-ssr@1.109.7(transitive)
+ Added@tamagui/use-event@1.109.7(transitive)
+ Added@tamagui/use-force-update@1.109.7(transitive)
+ Added@tamagui/web@1.109.7(transitive)
- Removed@tamagui/compose-refs@1.109.6(transitive)
- Removed@tamagui/constants@1.109.6(transitive)
- Removed@tamagui/core@1.109.6(transitive)
- Removed@tamagui/helpers@1.109.6(transitive)
- Removed@tamagui/normalize-css-color@1.109.6(transitive)
- Removed@tamagui/react-native-use-pressable@1.109.6(transitive)
- Removed@tamagui/react-native-use-responder-events@1.109.6(transitive)
- Removed@tamagui/simple-hash@1.109.6(transitive)
- Removed@tamagui/timer@1.109.6(transitive)
- Removed@tamagui/types@1.109.6(transitive)
- Removed@tamagui/use-did-finish-ssr@1.109.6(transitive)
- Removed@tamagui/use-event@1.109.6(transitive)
- Removed@tamagui/use-force-update@1.109.6(transitive)
- Removed@tamagui/web@1.109.6(transitive)
Updated@tamagui/core@1.109.7