@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
|
@@ -3086,6 +3086,7 @@ const getTypographyTypeWithAncestorValue = (type, typographyTypeInContext) => {
|
|
|
3086
3086
|
|
|
3087
3087
|
const TypographyFamilyContext = /*#__PURE__*/React.createContext(null);
|
|
3088
3088
|
const TypographyTypeContext = /*#__PURE__*/React.createContext(null);
|
|
3089
|
+
const TypographyVariantContext = /*#__PURE__*/React.createContext(undefined);
|
|
3089
3090
|
const TypographyColorContext = /*#__PURE__*/React.createContext('black');
|
|
3090
3091
|
function useTypographyColor() {
|
|
3091
3092
|
return React.useContext(TypographyColorContext);
|
|
@@ -3211,24 +3212,36 @@ const TypographyBase = /*#__PURE__*/React.forwardRef(({
|
|
|
3211
3212
|
...otherProps
|
|
3212
3213
|
}, ref) => {
|
|
3213
3214
|
const sx = nativeBase.useSx();
|
|
3215
|
+
|
|
3216
|
+
// ancestors
|
|
3214
3217
|
const typographyFamilyInContext = React.useContext(TypographyFamilyContext);
|
|
3215
3218
|
const typographyTypeInContext = React.useContext(TypographyTypeContext);
|
|
3216
|
-
const
|
|
3219
|
+
const typographyVariantInContext = React.useContext(TypographyVariantContext);
|
|
3220
|
+
|
|
3221
|
+
// family
|
|
3217
3222
|
const hasTypographyAncestor = typographyFamilyInContext !== null;
|
|
3218
3223
|
const typographyType = getTypographyTypeWithAncestorValue(type, typographyTypeInContext);
|
|
3219
3224
|
const baseOrDefaultToBody = typographyType.base ?? 'body-m';
|
|
3220
3225
|
const typographyFamily = getTypographyFamilyWithAncestorValue(baseOrDefaultToBody, typographyFamilyInContext);
|
|
3226
|
+
|
|
3227
|
+
// size
|
|
3221
3228
|
const fontSizeForNativeBase = createNativeBaseFontSize({
|
|
3222
3229
|
...type,
|
|
3223
3230
|
base: baseOrDefaultToBody
|
|
3224
3231
|
});
|
|
3232
|
+
|
|
3233
|
+
// weight
|
|
3234
|
+
|
|
3225
3235
|
const {
|
|
3226
3236
|
webFontWeight,
|
|
3227
3237
|
nativeFontFamily
|
|
3228
3238
|
} = getUniversalFontWeight({
|
|
3229
3239
|
...type,
|
|
3230
3240
|
base: baseOrDefaultToBody
|
|
3231
|
-
}, variant, typographyFamily);
|
|
3241
|
+
}, !variant && typographyType === typographyTypeInContext ? typographyVariantInContext : variant, typographyFamily);
|
|
3242
|
+
|
|
3243
|
+
// color
|
|
3244
|
+
const defaultColor = useTypographyDefaultColor();
|
|
3232
3245
|
const currentColor = !color && !hasTypographyAncestor ? defaultColor : color;
|
|
3233
3246
|
const currentColorValue = getTypographyColorValue(currentColor);
|
|
3234
3247
|
const colorStyles = sx({
|
|
@@ -3253,11 +3266,14 @@ const TypographyBase = /*#__PURE__*/React.forwardRef(({
|
|
|
3253
3266
|
...colorStyles,
|
|
3254
3267
|
...otherProps
|
|
3255
3268
|
});
|
|
3256
|
-
const content = baseOrDefaultToBody ? /*#__PURE__*/jsxRuntime.jsx(
|
|
3257
|
-
value:
|
|
3258
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
3259
|
-
value:
|
|
3260
|
-
children:
|
|
3269
|
+
const content = baseOrDefaultToBody ? /*#__PURE__*/jsxRuntime.jsx(TypographyVariantContext.Provider, {
|
|
3270
|
+
value: variant,
|
|
3271
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TypographyFamilyContext.Provider, {
|
|
3272
|
+
value: typographyFamily,
|
|
3273
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TypographyTypeContext.Provider, {
|
|
3274
|
+
value: typographyType,
|
|
3275
|
+
children: text
|
|
3276
|
+
})
|
|
3261
3277
|
})
|
|
3262
3278
|
}) : text;
|
|
3263
3279
|
return color ? /*#__PURE__*/jsxRuntime.jsx(TypographyColorContext.Provider, {
|