@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.web.js
CHANGED
|
@@ -3107,6 +3107,7 @@ var getTypographyTypeWithAncestorValue = function (type, typographyTypeInContext
|
|
|
3107
3107
|
var _excluded$P = ["accessibilityRole", "base", "small", "medium", "large", "wide", "type", "variant", "color"];
|
|
3108
3108
|
var TypographyFamilyContext = /*#__PURE__*/createContext(null);
|
|
3109
3109
|
var TypographyTypeContext = /*#__PURE__*/createContext(null);
|
|
3110
|
+
var TypographyVariantContext = /*#__PURE__*/createContext(undefined);
|
|
3110
3111
|
var TypographyColorContext = /*#__PURE__*/createContext('black');
|
|
3111
3112
|
function useTypographyColor() {
|
|
3112
3113
|
return useContext(TypographyColorContext);
|
|
@@ -3230,21 +3231,33 @@ var TypographyBase = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
3230
3231
|
color = _ref2.color,
|
|
3231
3232
|
otherProps = _objectWithoutProperties(_ref2, _excluded$P);
|
|
3232
3233
|
var sx = useSx();
|
|
3234
|
+
|
|
3235
|
+
// ancestors
|
|
3233
3236
|
var typographyFamilyInContext = useContext(TypographyFamilyContext);
|
|
3234
3237
|
var typographyTypeInContext = useContext(TypographyTypeContext);
|
|
3235
|
-
var
|
|
3238
|
+
var typographyVariantInContext = useContext(TypographyVariantContext);
|
|
3239
|
+
|
|
3240
|
+
// family
|
|
3236
3241
|
var hasTypographyAncestor = typographyFamilyInContext !== null;
|
|
3237
3242
|
var typographyType = getTypographyTypeWithAncestorValue(type, typographyTypeInContext);
|
|
3238
3243
|
var baseOrDefaultToBody = (_typographyType$base = typographyType.base) !== null && _typographyType$base !== void 0 ? _typographyType$base : 'body-m';
|
|
3239
3244
|
var typographyFamily = getTypographyFamilyWithAncestorValue(baseOrDefaultToBody, typographyFamilyInContext);
|
|
3245
|
+
|
|
3246
|
+
// size
|
|
3240
3247
|
var fontSizeForNativeBase = createNativeBaseFontSize(_objectSpread(_objectSpread({}, type), {}, {
|
|
3241
3248
|
base: baseOrDefaultToBody
|
|
3242
3249
|
}));
|
|
3250
|
+
|
|
3251
|
+
// weight
|
|
3252
|
+
|
|
3243
3253
|
var _getUniversalFontWeig = getUniversalFontWeight(_objectSpread(_objectSpread({}, type), {}, {
|
|
3244
3254
|
base: baseOrDefaultToBody
|
|
3245
|
-
}), variant, typographyFamily),
|
|
3255
|
+
}), !variant && typographyType === typographyTypeInContext ? typographyVariantInContext : variant, typographyFamily),
|
|
3246
3256
|
webFontWeight = _getUniversalFontWeig.webFontWeight,
|
|
3247
3257
|
nativeFontFamily = _getUniversalFontWeig.nativeFontFamily;
|
|
3258
|
+
|
|
3259
|
+
// color
|
|
3260
|
+
var defaultColor = useTypographyDefaultColor();
|
|
3248
3261
|
var currentColor = !color && !hasTypographyAncestor ? defaultColor : color;
|
|
3249
3262
|
var currentColorValue = getTypographyColorValue(currentColor);
|
|
3250
3263
|
var colorStyles = sx({
|
|
@@ -3270,11 +3283,14 @@ var TypographyBase = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
3270
3283
|
fontFamily: nativeFontFamily,
|
|
3271
3284
|
textTransform: typographyFamily === 'contentCaps' ? 'uppercase' : undefined
|
|
3272
3285
|
}, colorStyles), otherProps));
|
|
3273
|
-
var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(
|
|
3274
|
-
value:
|
|
3275
|
-
children: /*#__PURE__*/jsx(
|
|
3276
|
-
value:
|
|
3277
|
-
children:
|
|
3286
|
+
var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(TypographyVariantContext.Provider, {
|
|
3287
|
+
value: variant,
|
|
3288
|
+
children: /*#__PURE__*/jsx(TypographyFamilyContext.Provider, {
|
|
3289
|
+
value: typographyFamily,
|
|
3290
|
+
children: /*#__PURE__*/jsx(TypographyTypeContext.Provider, {
|
|
3291
|
+
value: typographyType,
|
|
3292
|
+
children: text
|
|
3293
|
+
})
|
|
3278
3294
|
})
|
|
3279
3295
|
}) : text;
|
|
3280
3296
|
return color ? /*#__PURE__*/jsx(TypographyColorContext.Provider, {
|