@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
package/dist/index.es.js CHANGED
@@ -3101,6 +3101,7 @@ var getTypographyTypeWithAncestorValue = function (type, typographyTypeInContext
3101
3101
  var _excluded$R = ["accessibilityRole", "base", "small", "medium", "large", "wide", "type", "variant", "color"];
3102
3102
  var TypographyFamilyContext = /*#__PURE__*/createContext(null);
3103
3103
  var TypographyTypeContext = /*#__PURE__*/createContext(null);
3104
+ var TypographyVariantContext = /*#__PURE__*/createContext(undefined);
3104
3105
  var TypographyColorContext = /*#__PURE__*/createContext('black');
3105
3106
  function useTypographyColor() {
3106
3107
  return useContext(TypographyColorContext);
@@ -3196,7 +3197,7 @@ function getUniversalFontWeight(type, variant, typographyFamily) {
3196
3197
  ThrowErrorIfInvalidVariant(variant, value, 'regular');
3197
3198
  resolvedVariant = 'regular';
3198
3199
  }
3199
- webFontWeight[typeName] = resolvedVariant;
3200
+ webFontWeight[typeName] = "".concat(typographyFamily, ".").concat(resolvedVariant);
3200
3201
  nativeFontFamily[typeName] = "".concat(typographyFamily, ".").concat(resolvedVariant);
3201
3202
  });
3202
3203
  return {
@@ -3224,21 +3225,33 @@ var TypographyBase = /*#__PURE__*/forwardRef(function (_ref2, ref) {
3224
3225
  color = _ref2.color,
3225
3226
  otherProps = _objectWithoutProperties(_ref2, _excluded$R);
3226
3227
  var sx = useSx();
3228
+
3229
+ // ancestors
3227
3230
  var typographyFamilyInContext = useContext(TypographyFamilyContext);
3228
3231
  var typographyTypeInContext = useContext(TypographyTypeContext);
3229
- var defaultColor = useTypographyDefaultColor();
3232
+ var typographyVariantInContext = useContext(TypographyVariantContext);
3233
+
3234
+ // family
3230
3235
  var hasTypographyAncestor = typographyFamilyInContext !== null;
3231
3236
  var typographyType = getTypographyTypeWithAncestorValue(type, typographyTypeInContext);
3232
3237
  var baseOrDefaultToBody = (_typographyType$base = typographyType.base) !== null && _typographyType$base !== void 0 ? _typographyType$base : 'body-m';
3233
3238
  var typographyFamily = getTypographyFamilyWithAncestorValue(baseOrDefaultToBody, typographyFamilyInContext);
3239
+
3240
+ // size
3234
3241
  var fontSizeForNativeBase = createNativeBaseFontSize(_objectSpread(_objectSpread({}, type), {}, {
3235
3242
  base: baseOrDefaultToBody
3236
3243
  }));
3244
+
3245
+ // weight
3246
+
3237
3247
  var _getUniversalFontWeig = getUniversalFontWeight(_objectSpread(_objectSpread({}, type), {}, {
3238
3248
  base: baseOrDefaultToBody
3239
- }), variant, typographyFamily),
3249
+ }), !variant && typographyType === typographyTypeInContext ? typographyVariantInContext : variant, typographyFamily),
3240
3250
  webFontWeight = _getUniversalFontWeig.webFontWeight,
3241
3251
  nativeFontFamily = _getUniversalFontWeig.nativeFontFamily;
3252
+
3253
+ // color
3254
+ var defaultColor = useTypographyDefaultColor();
3242
3255
  var currentColor = !color && !hasTypographyAncestor ? defaultColor : color;
3243
3256
  var currentColorValue = getTypographyColorValue(currentColor);
3244
3257
  var colorStyles = sx({
@@ -3264,11 +3277,14 @@ var TypographyBase = /*#__PURE__*/forwardRef(function (_ref2, ref) {
3264
3277
  fontFamily: nativeFontFamily,
3265
3278
  textTransform: typographyFamily === 'contentCaps' ? 'uppercase' : undefined
3266
3279
  }, colorStyles), otherProps));
3267
- var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(TypographyFamilyContext.Provider, {
3268
- value: typographyFamily,
3269
- children: /*#__PURE__*/jsx(TypographyTypeContext.Provider, {
3270
- value: typographyType,
3271
- children: text
3280
+ var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(TypographyVariantContext.Provider, {
3281
+ value: variant,
3282
+ children: /*#__PURE__*/jsx(TypographyFamilyContext.Provider, {
3283
+ value: typographyFamily,
3284
+ children: /*#__PURE__*/jsx(TypographyTypeContext.Provider, {
3285
+ value: typographyType,
3286
+ children: text
3287
+ })
3272
3288
  })
3273
3289
  }) : text;
3274
3290
  return color ? /*#__PURE__*/jsx(TypographyColorContext.Provider, {
@@ -4183,9 +4199,10 @@ function ModalBehaviour(_ref2) {
4183
4199
  }
4184
4200
  ModalBehaviour.CloseButton = CloseButton$1;
4185
4201
 
4186
- function Overlay(_ref) {
4202
+ var Overlay = /*#__PURE__*/forwardRef(function (_ref, ref) {
4187
4203
  var onPress = _ref.onPress;
4188
4204
  return /*#__PURE__*/jsx(Pressable, {
4205
+ ref: ref,
4189
4206
  accessibilityRole: "none",
4190
4207
  position: "absolute",
4191
4208
  top: "0",
@@ -4195,10 +4212,10 @@ function Overlay(_ref) {
4195
4212
  backgroundColor: "kitt.overlay.dark",
4196
4213
  onPress: onPress
4197
4214
  });
4198
- }
4215
+ });
4199
4216
 
4200
- function CardModalRotationContainer(props) {
4201
- return /*#__PURE__*/jsx(View, _objectSpread({
4217
+ var CardModalRotationContainer = /*#__PURE__*/forwardRef(function (props, ref) {
4218
+ return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({
4202
4219
  paddingX: "kitt.cardModal.overlayPadding.horizontal",
4203
4220
  paddingY: "kitt.cardModal.overlayPadding.vertical",
4204
4221
  maxWidth: "kitt.cardModal.maxWidthWithPadding",
@@ -4207,8 +4224,10 @@ function CardModalRotationContainer(props) {
4207
4224
  _web: {
4208
4225
  maxHeight: '100svh'
4209
4226
  }
4210
- }, props));
4211
- }
4227
+ }, props), {}, {
4228
+ ref: ref
4229
+ }));
4230
+ });
4212
4231
 
4213
4232
  function NativeOpacityAnimation$2(_ref) {
4214
4233
  var visible = _ref.visible,
@@ -9207,7 +9226,7 @@ var getIconButtonColor = function (messageType) {
9207
9226
  }
9208
9227
  };
9209
9228
 
9210
- function BaseMessage(_ref) {
9229
+ var BaseMessage = /*#__PURE__*/forwardRef(function (_ref, ref) {
9211
9230
  var _ref$type = _ref.type,
9212
9231
  type = _ref$type === void 0 ? 'info' : _ref$type,
9213
9232
  children = _ref.children,
@@ -9217,6 +9236,7 @@ function BaseMessage(_ref) {
9217
9236
  onDismiss = _ref.onDismiss;
9218
9237
  var color = getColorByType(type);
9219
9238
  return /*#__PURE__*/jsxs(HStack, {
9239
+ ref: ref,
9220
9240
  alignItems: "flex-start",
9221
9241
  justifyContent: "space-between",
9222
9242
  minHeight: "kitt.feedbackMessage.minHeight",
@@ -9258,7 +9278,7 @@ function BaseMessage(_ref) {
9258
9278
  })
9259
9279
  }) : null]
9260
9280
  });
9261
- }
9281
+ });
9262
9282
 
9263
9283
  function Message(_ref) {
9264
9284
  var _ref$type = _ref.type,
@@ -11229,17 +11249,19 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
11229
11249
  fontWeights: {
11230
11250
  headings: {
11231
11251
  regular: theme.typography.types.headings.fontWeight.regular,
11252
+ semibold: theme.typography.types.headings.fontWeight.semibold,
11232
11253
  bold: theme.typography.types.headings.fontWeight.bold
11233
11254
  },
11234
11255
  bodies: {
11235
- regular: theme.typography.types.bodies.fontWeight.regular
11236
- // 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
11256
+ regular: theme.typography.types.bodies.fontWeight.regular,
11257
+ // TODO [expo@>=53]: Check if still needed with new expo-fonts version
11258
+ bold: Platform.OS === 'android' ? 400 : theme.typography.types.bodies.fontWeight.bold
11237
11259
  },
11238
11260
  labels: {
11239
11261
  semibold: theme.typography.types.labels.fontWeight.semibold
11240
11262
  },
11241
11263
  contentCaps: {
11242
- // 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
11264
+ // TODO [expo@>=53]: Check if still needed with new expo-fonts version
11243
11265
  bold: Platform.OS === 'android' ? 400 : theme.typography.types.contentCaps.fontWeight.bold
11244
11266
  }
11245
11267
  },
@@ -11988,13 +12010,14 @@ NavigationModal.Body = Body;
11988
12010
  NavigationModal.Footer = Footer;
11989
12011
  NavigationModal.ModalBehaviour = NavigationModalBehaviour;
11990
12012
 
11991
- function Notification(_ref) {
12013
+ var Notification = /*#__PURE__*/forwardRef(function (_ref, ref) {
11992
12014
  var type = _ref.type,
11993
12015
  children = _ref.children,
11994
12016
  centeredText = _ref.centeredText,
11995
12017
  insets = _ref.insets,
11996
12018
  onDismiss = _ref.onDismiss;
11997
12019
  return /*#__PURE__*/jsx(BaseMessage, {
12020
+ ref: ref,
11998
12021
  hasNoRadius: true,
11999
12022
  type: type,
12000
12023
  centeredText: centeredText,
@@ -12002,7 +12025,7 @@ function Notification(_ref) {
12002
12025
  onDismiss: onDismiss,
12003
12026
  children: children
12004
12027
  });
12005
- }
12028
+ });
12006
12029
 
12007
12030
  var AnimatedCircle = Animated.createAnimatedComponent(Circle$1);
12008
12031
  function AnimatedLoaderCircle(_ref) {