@ornikar/kitt-universal 29.4.1-canary.cbb5dfd9b37cae9e4b2943cbcdd994e53c1d96d8.0 → 29.4.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/CHANGELOG.md +2 -2
- package/dist/definitions/typography/Typography.d.ts +1 -0
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +23 -7
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +23 -7
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.17.cjs.js +23 -7
- package/dist/index-node-22.17.cjs.js.map +1 -1
- package/dist/index-node-22.17.cjs.web.js +23 -7
- package/dist/index-node-22.17.cjs.web.js.map +1 -1
- package/dist/index-node-22.17.es.mjs +23 -7
- package/dist/index-node-22.17.es.mjs.map +1 -1
- package/dist/index-node-22.17.es.web.mjs +23 -7
- package/dist/index-node-22.17.es.web.mjs.map +1 -1
- package/dist/index.es.js +23 -7
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +23 -7
- package/dist/index.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -3101,6 +3101,7 @@ var getTypographyTypeWithAncestorValue = function (type, typographyTypeInContext
|
|
|
3101
3101
|
var _excluded$R = ["accessibilityRole", "base", "small", "medium", "large", "wide", "type", "variant", "color"];
|
|
3102
3102
|
var TypographyFamilyContext = /*#__PURE__*/createContext(null);
|
|
3103
3103
|
var TypographyTypeContext = /*#__PURE__*/createContext(null);
|
|
3104
|
+
var TypographyVariantContext = /*#__PURE__*/createContext(undefined);
|
|
3104
3105
|
var TypographyColorContext = /*#__PURE__*/createContext('black');
|
|
3105
3106
|
function useTypographyColor() {
|
|
3106
3107
|
return useContext(TypographyColorContext);
|
|
@@ -3224,21 +3225,33 @@ var TypographyBase = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
3224
3225
|
color = _ref2.color,
|
|
3225
3226
|
otherProps = _objectWithoutProperties(_ref2, _excluded$R);
|
|
3226
3227
|
var sx = useSx();
|
|
3228
|
+
|
|
3229
|
+
// ancestors
|
|
3227
3230
|
var typographyFamilyInContext = useContext(TypographyFamilyContext);
|
|
3228
3231
|
var typographyTypeInContext = useContext(TypographyTypeContext);
|
|
3229
|
-
var
|
|
3232
|
+
var typographyVariantInContext = useContext(TypographyVariantContext);
|
|
3233
|
+
|
|
3234
|
+
// family
|
|
3230
3235
|
var hasTypographyAncestor = typographyFamilyInContext !== null;
|
|
3231
3236
|
var typographyType = getTypographyTypeWithAncestorValue(type, typographyTypeInContext);
|
|
3232
3237
|
var baseOrDefaultToBody = (_typographyType$base = typographyType.base) !== null && _typographyType$base !== void 0 ? _typographyType$base : 'body-m';
|
|
3233
3238
|
var typographyFamily = getTypographyFamilyWithAncestorValue(baseOrDefaultToBody, typographyFamilyInContext);
|
|
3239
|
+
|
|
3240
|
+
// size
|
|
3234
3241
|
var fontSizeForNativeBase = createNativeBaseFontSize(_objectSpread(_objectSpread({}, type), {}, {
|
|
3235
3242
|
base: baseOrDefaultToBody
|
|
3236
3243
|
}));
|
|
3244
|
+
|
|
3245
|
+
// weight
|
|
3246
|
+
|
|
3237
3247
|
var _getUniversalFontWeig = getUniversalFontWeight(_objectSpread(_objectSpread({}, type), {}, {
|
|
3238
3248
|
base: baseOrDefaultToBody
|
|
3239
|
-
}), variant, typographyFamily),
|
|
3249
|
+
}), !variant && typographyType === typographyTypeInContext ? typographyVariantInContext : variant, typographyFamily),
|
|
3240
3250
|
webFontWeight = _getUniversalFontWeig.webFontWeight,
|
|
3241
3251
|
nativeFontFamily = _getUniversalFontWeig.nativeFontFamily;
|
|
3252
|
+
|
|
3253
|
+
// color
|
|
3254
|
+
var defaultColor = useTypographyDefaultColor();
|
|
3242
3255
|
var currentColor = !color && !hasTypographyAncestor ? defaultColor : color;
|
|
3243
3256
|
var currentColorValue = getTypographyColorValue(currentColor);
|
|
3244
3257
|
var colorStyles = sx({
|
|
@@ -3264,11 +3277,14 @@ var TypographyBase = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
3264
3277
|
fontFamily: nativeFontFamily,
|
|
3265
3278
|
textTransform: typographyFamily === 'contentCaps' ? 'uppercase' : undefined
|
|
3266
3279
|
}, colorStyles), otherProps));
|
|
3267
|
-
var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(
|
|
3268
|
-
value:
|
|
3269
|
-
children: /*#__PURE__*/jsx(
|
|
3270
|
-
value:
|
|
3271
|
-
children:
|
|
3280
|
+
var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(TypographyVariantContext.Provider, {
|
|
3281
|
+
value: variant,
|
|
3282
|
+
children: /*#__PURE__*/jsx(TypographyFamilyContext.Provider, {
|
|
3283
|
+
value: typographyFamily,
|
|
3284
|
+
children: /*#__PURE__*/jsx(TypographyTypeContext.Provider, {
|
|
3285
|
+
value: typographyType,
|
|
3286
|
+
children: text
|
|
3287
|
+
})
|
|
3272
3288
|
})
|
|
3273
3289
|
}) : text;
|
|
3274
3290
|
return color ? /*#__PURE__*/jsx(TypographyColorContext.Provider, {
|