@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.
@@ -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 defaultColor = useTypographyDefaultColor();
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(TypographyFamilyContext.Provider, {
3251
- value: typographyFamily,
3252
- children: /*#__PURE__*/jsxRuntime.jsx(TypographyTypeContext.Provider, {
3253
- value: typographyType,
3254
- children: text
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, {