@ornikar/kitt-universal 29.4.1-canary.ee3a5de11ca14467578621a40a921148838ee329.0 → 29.4.2-canary.0e4f130cb45a177a7fdd9a15817918e986eb8cd4.0

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +17 -2
  2. package/dist/definitions/BaseMessage/BaseMessage.d.ts +1 -1
  3. package/dist/definitions/BaseMessage/BaseMessage.d.ts.map +1 -1
  4. package/dist/definitions/CardModal/CardModalAnimation/CardModalAnimation.web.d.ts +1 -1
  5. package/dist/definitions/CardModal/CardModalAnimation/CardModalAnimation.web.d.ts.map +1 -1
  6. package/dist/definitions/CardModal/CardModalAnimation/CardModalRotationContainer.d.ts +2 -2
  7. package/dist/definitions/CardModal/CardModalAnimation/CardModalRotationContainer.d.ts.map +1 -1
  8. package/dist/definitions/DialogModal/DialogModalAnimation/DialogModalAnimation.web.d.ts +1 -1
  9. package/dist/definitions/DialogModal/DialogModalAnimation/DialogModalAnimation.web.d.ts.map +1 -1
  10. package/dist/definitions/FullscreenModal/FullscreenModalAnimation.web.d.ts +1 -1
  11. package/dist/definitions/FullscreenModal/FullscreenModalAnimation.web.d.ts.map +1 -1
  12. package/dist/definitions/Notification/Notification.d.ts +2 -2
  13. package/dist/definitions/Notification/Notification.d.ts.map +1 -1
  14. package/dist/definitions/Overlay/Overlay.d.ts +2 -2
  15. package/dist/definitions/Overlay/Overlay.d.ts.map +1 -1
  16. package/dist/definitions/Picker/Picker.web.d.ts.map +1 -1
  17. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +2 -0
  18. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
  19. package/dist/definitions/typography/Typography.d.ts +1 -0
  20. package/dist/definitions/typography/Typography.d.ts.map +1 -1
  21. package/dist/index-metro.es.android.js +52 -29
  22. package/dist/index-metro.es.android.js.map +1 -1
  23. package/dist/index-metro.es.ios.js +52 -29
  24. package/dist/index-metro.es.ios.js.map +1 -1
  25. package/dist/index-node-22.17.cjs.js +45 -23
  26. package/dist/index-node-22.17.cjs.js.map +1 -1
  27. package/dist/index-node-22.17.cjs.web.js +77 -24
  28. package/dist/index-node-22.17.cjs.web.js.map +1 -1
  29. package/dist/index-node-22.17.es.mjs +45 -23
  30. package/dist/index-node-22.17.es.mjs.map +1 -1
  31. package/dist/index-node-22.17.es.web.mjs +77 -24
  32. package/dist/index-node-22.17.es.web.mjs.map +1 -1
  33. package/dist/index.es.js +44 -21
  34. package/dist/index.es.js.map +1 -1
  35. package/dist/index.es.web.js +76 -22
  36. package/dist/index.es.web.js.map +1 -1
  37. package/dist/tsbuildinfo +1 -1
  38. package/package.json +1 -1
  39. package/scripts/codemods/__testfixtures__/illustration-imports/illustration-imports.input.tsx +11 -0
  40. package/scripts/codemods/__testfixtures__/illustration-imports/illustration-imports.output.tsx +13 -0
  41. package/scripts/codemods/__tests__/illustration-imports.test.js +12 -0
  42. package/scripts/codemods/illustration-imports.js +184 -0
@@ -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);
@@ -3184,7 +3185,7 @@ function getUniversalFontWeight(type, variant, typographyFamily) {
3184
3185
  ThrowErrorIfInvalidVariant(variant, value, 'regular');
3185
3186
  resolvedVariant = 'regular';
3186
3187
  }
3187
- webFontWeight[typeName] = resolvedVariant;
3188
+ webFontWeight[typeName] = `${typographyFamily}.${resolvedVariant}`;
3188
3189
  nativeFontFamily[typeName] = `${typographyFamily}.${resolvedVariant}`;
3189
3190
  });
3190
3191
  return {
@@ -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 defaultColor = useTypographyDefaultColor();
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(TypographyFamilyContext.Provider, {
3257
- value: typographyFamily,
3258
- children: /*#__PURE__*/jsxRuntime.jsx(TypographyTypeContext.Provider, {
3259
- value: typographyType,
3260
- children: text
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, {
@@ -4157,10 +4173,11 @@ function ModalBehaviour({
4157
4173
  }
4158
4174
  ModalBehaviour.CloseButton = CloseButton$1;
4159
4175
 
4160
- function Overlay({
4176
+ const Overlay = /*#__PURE__*/React.forwardRef(({
4161
4177
  onPress
4162
- }) {
4178
+ }, ref) => {
4163
4179
  return /*#__PURE__*/jsxRuntime.jsx(Pressable, {
4180
+ ref: ref,
4164
4181
  accessibilityRole: "none",
4165
4182
  position: "absolute",
4166
4183
  top: "0",
@@ -4170,9 +4187,9 @@ function Overlay({
4170
4187
  backgroundColor: "kitt.overlay.dark",
4171
4188
  onPress: onPress
4172
4189
  });
4173
- }
4190
+ });
4174
4191
 
4175
- function CardModalRotationContainer(props) {
4192
+ const CardModalRotationContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
4176
4193
  return /*#__PURE__*/jsxRuntime.jsx(View, {
4177
4194
  paddingX: "kitt.cardModal.overlayPadding.horizontal",
4178
4195
  paddingY: "kitt.cardModal.overlayPadding.vertical",
@@ -4182,9 +4199,10 @@ function CardModalRotationContainer(props) {
4182
4199
  _web: {
4183
4200
  maxHeight: '100svh'
4184
4201
  },
4185
- ...props
4202
+ ...props,
4203
+ ref: ref
4186
4204
  });
4187
- }
4205
+ });
4188
4206
 
4189
4207
  function NativeOpacityAnimation$2({
4190
4208
  visible,
@@ -8982,16 +9000,17 @@ const getIconButtonColor = messageType => {
8982
9000
  }
8983
9001
  };
8984
9002
 
8985
- function BaseMessage({
9003
+ const BaseMessage = /*#__PURE__*/React.forwardRef(({
8986
9004
  type = 'info',
8987
9005
  children,
8988
9006
  hasNoRadius,
8989
9007
  centeredText,
8990
9008
  insets,
8991
9009
  onDismiss
8992
- }) {
9010
+ }, ref) => {
8993
9011
  const color = getColorByType(type);
8994
9012
  return /*#__PURE__*/jsxRuntime.jsxs(HStack, {
9013
+ ref: ref,
8995
9014
  alignItems: "flex-start",
8996
9015
  justifyContent: "space-between",
8997
9016
  minHeight: "kitt.feedbackMessage.minHeight",
@@ -9033,7 +9052,7 @@ function BaseMessage({
9033
9052
  })
9034
9053
  }) : null]
9035
9054
  });
9036
- }
9055
+ });
9037
9056
 
9038
9057
  function Message({
9039
9058
  type = 'info',
@@ -11011,17 +11030,19 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
11011
11030
  fontWeights: {
11012
11031
  headings: {
11013
11032
  regular: theme.typography.types.headings.fontWeight.regular,
11033
+ semibold: theme.typography.types.headings.fontWeight.semibold,
11014
11034
  bold: theme.typography.types.headings.fontWeight.bold
11015
11035
  },
11016
11036
  bodies: {
11017
- regular: theme.typography.types.bodies.fontWeight.regular
11018
- // 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
11037
+ regular: theme.typography.types.bodies.fontWeight.regular,
11038
+ // TODO [expo@>=53]: Check if still needed with new expo-fonts version
11039
+ bold: reactNative.Platform.OS === 'android' ? 400 : theme.typography.types.bodies.fontWeight.bold
11019
11040
  },
11020
11041
  labels: {
11021
11042
  semibold: theme.typography.types.labels.fontWeight.semibold
11022
11043
  },
11023
11044
  contentCaps: {
11024
- // 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
11045
+ // TODO [expo@>=53]: Check if still needed with new expo-fonts version
11025
11046
  bold: reactNative.Platform.OS === 'android' ? 400 : theme.typography.types.contentCaps.fontWeight.bold
11026
11047
  }
11027
11048
  },
@@ -11770,14 +11791,15 @@ NavigationModal.Body = Body;
11770
11791
  NavigationModal.Footer = Footer;
11771
11792
  NavigationModal.ModalBehaviour = NavigationModalBehaviour;
11772
11793
 
11773
- function Notification({
11794
+ const Notification = /*#__PURE__*/React.forwardRef(({
11774
11795
  type,
11775
11796
  children,
11776
11797
  centeredText,
11777
11798
  insets,
11778
11799
  onDismiss
11779
- }) {
11800
+ }, ref) => {
11780
11801
  return /*#__PURE__*/jsxRuntime.jsx(BaseMessage, {
11802
+ ref: ref,
11781
11803
  hasNoRadius: true,
11782
11804
  type: type,
11783
11805
  centeredText: centeredText,
@@ -11785,7 +11807,7 @@ function Notification({
11785
11807
  onDismiss: onDismiss,
11786
11808
  children: children
11787
11809
  });
11788
- }
11810
+ });
11789
11811
 
11790
11812
  const AnimatedCircle = Animated__default.createAnimatedComponent(Svg.Circle);
11791
11813
  function AnimatedLoaderCircle({