@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.
@@ -3072,6 +3072,7 @@ const getTypographyTypeWithAncestorValue = (type, typographyTypeInContext) => {
3072
3072
 
3073
3073
  const TypographyFamilyContext = /*#__PURE__*/createContext(null);
3074
3074
  const TypographyTypeContext = /*#__PURE__*/createContext(null);
3075
+ const TypographyVariantContext = /*#__PURE__*/createContext(undefined);
3075
3076
  const TypographyColorContext = /*#__PURE__*/createContext('black');
3076
3077
  function useTypographyColor() {
3077
3078
  return useContext(TypographyColorContext);
@@ -3197,24 +3198,36 @@ const TypographyBase = /*#__PURE__*/forwardRef(({
3197
3198
  ...otherProps
3198
3199
  }, ref) => {
3199
3200
  const sx = useSx();
3201
+
3202
+ // ancestors
3200
3203
  const typographyFamilyInContext = useContext(TypographyFamilyContext);
3201
3204
  const typographyTypeInContext = useContext(TypographyTypeContext);
3202
- const defaultColor = useTypographyDefaultColor();
3205
+ const typographyVariantInContext = useContext(TypographyVariantContext);
3206
+
3207
+ // family
3203
3208
  const hasTypographyAncestor = typographyFamilyInContext !== null;
3204
3209
  const typographyType = getTypographyTypeWithAncestorValue(type, typographyTypeInContext);
3205
3210
  const baseOrDefaultToBody = typographyType.base ?? 'body-m';
3206
3211
  const typographyFamily = getTypographyFamilyWithAncestorValue(baseOrDefaultToBody, typographyFamilyInContext);
3212
+
3213
+ // size
3207
3214
  const fontSizeForNativeBase = createNativeBaseFontSize({
3208
3215
  ...type,
3209
3216
  base: baseOrDefaultToBody
3210
3217
  });
3218
+
3219
+ // weight
3220
+
3211
3221
  const {
3212
3222
  webFontWeight,
3213
3223
  nativeFontFamily
3214
3224
  } = getUniversalFontWeight({
3215
3225
  ...type,
3216
3226
  base: baseOrDefaultToBody
3217
- }, variant, typographyFamily);
3227
+ }, !variant && typographyType === typographyTypeInContext ? typographyVariantInContext : variant, typographyFamily);
3228
+
3229
+ // color
3230
+ const defaultColor = useTypographyDefaultColor();
3218
3231
  const currentColor = !color && !hasTypographyAncestor ? defaultColor : color;
3219
3232
  const currentColorValue = getTypographyColorValue(currentColor);
3220
3233
  const colorStyles = sx({
@@ -3239,11 +3252,14 @@ const TypographyBase = /*#__PURE__*/forwardRef(({
3239
3252
  ...colorStyles,
3240
3253
  ...otherProps
3241
3254
  });
3242
- const content = baseOrDefaultToBody ? /*#__PURE__*/jsx(TypographyFamilyContext.Provider, {
3243
- value: typographyFamily,
3244
- children: /*#__PURE__*/jsx(TypographyTypeContext.Provider, {
3245
- value: typographyType,
3246
- children: text
3255
+ const content = baseOrDefaultToBody ? /*#__PURE__*/jsx(TypographyVariantContext.Provider, {
3256
+ value: variant,
3257
+ children: /*#__PURE__*/jsx(TypographyFamilyContext.Provider, {
3258
+ value: typographyFamily,
3259
+ children: /*#__PURE__*/jsx(TypographyTypeContext.Provider, {
3260
+ value: typographyType,
3261
+ children: text
3262
+ })
3247
3263
  })
3248
3264
  }) : text;
3249
3265
  return color ? /*#__PURE__*/jsx(TypographyColorContext.Provider, {