@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
|
@@ -3080,6 +3080,7 @@ const getTypographyTypeWithAncestorValue = (type, typographyTypeInContext) => {
|
|
|
3080
3080
|
|
|
3081
3081
|
const TypographyFamilyContext = /*#__PURE__*/react.createContext(null);
|
|
3082
3082
|
const TypographyTypeContext = /*#__PURE__*/react.createContext(null);
|
|
3083
|
+
const TypographyVariantContext = /*#__PURE__*/react.createContext(undefined);
|
|
3083
3084
|
const TypographyColorContext = /*#__PURE__*/react.createContext('black');
|
|
3084
3085
|
function useTypographyColor() {
|
|
3085
3086
|
return react.useContext(TypographyColorContext);
|
|
@@ -3205,24 +3206,36 @@ const TypographyBase = /*#__PURE__*/react.forwardRef(({
|
|
|
3205
3206
|
...otherProps
|
|
3206
3207
|
}, ref) => {
|
|
3207
3208
|
const sx = nativeBase.useSx();
|
|
3209
|
+
|
|
3210
|
+
// ancestors
|
|
3208
3211
|
const typographyFamilyInContext = react.useContext(TypographyFamilyContext);
|
|
3209
3212
|
const typographyTypeInContext = react.useContext(TypographyTypeContext);
|
|
3210
|
-
const
|
|
3213
|
+
const typographyVariantInContext = react.useContext(TypographyVariantContext);
|
|
3214
|
+
|
|
3215
|
+
// family
|
|
3211
3216
|
const hasTypographyAncestor = typographyFamilyInContext !== null;
|
|
3212
3217
|
const typographyType = getTypographyTypeWithAncestorValue(type, typographyTypeInContext);
|
|
3213
3218
|
const baseOrDefaultToBody = typographyType.base ?? 'body-m';
|
|
3214
3219
|
const typographyFamily = getTypographyFamilyWithAncestorValue(baseOrDefaultToBody, typographyFamilyInContext);
|
|
3220
|
+
|
|
3221
|
+
// size
|
|
3215
3222
|
const fontSizeForNativeBase = createNativeBaseFontSize({
|
|
3216
3223
|
...type,
|
|
3217
3224
|
base: baseOrDefaultToBody
|
|
3218
3225
|
});
|
|
3226
|
+
|
|
3227
|
+
// weight
|
|
3228
|
+
|
|
3219
3229
|
const {
|
|
3220
3230
|
webFontWeight,
|
|
3221
3231
|
nativeFontFamily
|
|
3222
3232
|
} = getUniversalFontWeight({
|
|
3223
3233
|
...type,
|
|
3224
3234
|
base: baseOrDefaultToBody
|
|
3225
|
-
}, variant, typographyFamily);
|
|
3235
|
+
}, !variant && typographyType === typographyTypeInContext ? typographyVariantInContext : variant, typographyFamily);
|
|
3236
|
+
|
|
3237
|
+
// color
|
|
3238
|
+
const defaultColor = useTypographyDefaultColor();
|
|
3226
3239
|
const currentColor = !color && !hasTypographyAncestor ? defaultColor : color;
|
|
3227
3240
|
const currentColorValue = getTypographyColorValue(currentColor);
|
|
3228
3241
|
const colorStyles = sx({
|
|
@@ -3247,11 +3260,14 @@ const TypographyBase = /*#__PURE__*/react.forwardRef(({
|
|
|
3247
3260
|
...colorStyles,
|
|
3248
3261
|
...otherProps
|
|
3249
3262
|
});
|
|
3250
|
-
const content = baseOrDefaultToBody ? /*#__PURE__*/jsxRuntime.jsx(
|
|
3251
|
-
value:
|
|
3252
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
3253
|
-
value:
|
|
3254
|
-
children:
|
|
3263
|
+
const content = baseOrDefaultToBody ? /*#__PURE__*/jsxRuntime.jsx(TypographyVariantContext.Provider, {
|
|
3264
|
+
value: variant,
|
|
3265
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TypographyFamilyContext.Provider, {
|
|
3266
|
+
value: typographyFamily,
|
|
3267
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TypographyTypeContext.Provider, {
|
|
3268
|
+
value: typographyType,
|
|
3269
|
+
children: text
|
|
3270
|
+
})
|
|
3255
3271
|
})
|
|
3256
3272
|
}) : text;
|
|
3257
3273
|
return color ? /*#__PURE__*/jsxRuntime.jsx(TypographyColorContext.Provider, {
|