@ornikar/kitt-universal 29.4.1-canary.ee3a5de11ca14467578621a40a921148838ee329.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);
@@ -3178,7 +3179,7 @@ function getUniversalFontWeight(type, variant, typographyFamily) {
3178
3179
  ThrowErrorIfInvalidVariant(variant, value, 'regular');
3179
3180
  resolvedVariant = 'regular';
3180
3181
  }
3181
- webFontWeight[typeName] = resolvedVariant;
3182
+ webFontWeight[typeName] = `${typographyFamily}.${resolvedVariant}`;
3182
3183
  nativeFontFamily[typeName] = `${typographyFamily}.${resolvedVariant}`;
3183
3184
  });
3184
3185
  return {
@@ -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, {
@@ -10202,17 +10218,19 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
10202
10218
  fontWeights: {
10203
10219
  headings: {
10204
10220
  regular: theme.typography.types.headings.fontWeight.regular,
10221
+ semibold: theme.typography.types.headings.fontWeight.semibold,
10205
10222
  bold: theme.typography.types.headings.fontWeight.bold
10206
10223
  },
10207
10224
  bodies: {
10208
- regular: theme.typography.types.bodies.fontWeight.regular
10209
- // TODO [https://ornikar.atlassian.net/browse/CME-767] This quick fix should be replaced by a 700 in every case, and native font weights should be handled by expo-fonts
10225
+ regular: theme.typography.types.bodies.fontWeight.regular,
10226
+ // TODO [expo@>=53]: Check if still needed with new expo-fonts version
10227
+ bold: theme.typography.types.bodies.fontWeight.bold
10210
10228
  },
10211
10229
  labels: {
10212
10230
  semibold: theme.typography.types.labels.fontWeight.semibold
10213
10231
  },
10214
10232
  contentCaps: {
10215
- // TODO [https://ornikar.atlassian.net/browse/CME-767] This quick fix should be replaced by a 700 in every case, and native font weights should be handled by expo-fonts
10233
+ // TODO [expo@>=53]: Check if still needed with new expo-fonts version
10216
10234
  bold: theme.typography.types.contentCaps.fontWeight.bold
10217
10235
  }
10218
10236
  },