@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
@@ -3107,6 +3107,7 @@ var getTypographyTypeWithAncestorValue = function (type, typographyTypeInContext
3107
3107
  var _excluded$P = ["accessibilityRole", "base", "small", "medium", "large", "wide", "type", "variant", "color"];
3108
3108
  var TypographyFamilyContext = /*#__PURE__*/createContext(null);
3109
3109
  var TypographyTypeContext = /*#__PURE__*/createContext(null);
3110
+ var TypographyVariantContext = /*#__PURE__*/createContext(undefined);
3110
3111
  var TypographyColorContext = /*#__PURE__*/createContext('black');
3111
3112
  function useTypographyColor() {
3112
3113
  return useContext(TypographyColorContext);
@@ -3202,7 +3203,7 @@ function getUniversalFontWeight(type, variant, typographyFamily) {
3202
3203
  ThrowErrorIfInvalidVariant(variant, value, 'regular');
3203
3204
  resolvedVariant = 'regular';
3204
3205
  }
3205
- webFontWeight[typeName] = resolvedVariant;
3206
+ webFontWeight[typeName] = "".concat(typographyFamily, ".").concat(resolvedVariant);
3206
3207
  nativeFontFamily[typeName] = "".concat(typographyFamily, ".").concat(resolvedVariant);
3207
3208
  });
3208
3209
  return {
@@ -3230,21 +3231,33 @@ var TypographyBase = /*#__PURE__*/forwardRef(function (_ref2, ref) {
3230
3231
  color = _ref2.color,
3231
3232
  otherProps = _objectWithoutProperties(_ref2, _excluded$P);
3232
3233
  var sx = useSx();
3234
+
3235
+ // ancestors
3233
3236
  var typographyFamilyInContext = useContext(TypographyFamilyContext);
3234
3237
  var typographyTypeInContext = useContext(TypographyTypeContext);
3235
- var defaultColor = useTypographyDefaultColor();
3238
+ var typographyVariantInContext = useContext(TypographyVariantContext);
3239
+
3240
+ // family
3236
3241
  var hasTypographyAncestor = typographyFamilyInContext !== null;
3237
3242
  var typographyType = getTypographyTypeWithAncestorValue(type, typographyTypeInContext);
3238
3243
  var baseOrDefaultToBody = (_typographyType$base = typographyType.base) !== null && _typographyType$base !== void 0 ? _typographyType$base : 'body-m';
3239
3244
  var typographyFamily = getTypographyFamilyWithAncestorValue(baseOrDefaultToBody, typographyFamilyInContext);
3245
+
3246
+ // size
3240
3247
  var fontSizeForNativeBase = createNativeBaseFontSize(_objectSpread(_objectSpread({}, type), {}, {
3241
3248
  base: baseOrDefaultToBody
3242
3249
  }));
3250
+
3251
+ // weight
3252
+
3243
3253
  var _getUniversalFontWeig = getUniversalFontWeight(_objectSpread(_objectSpread({}, type), {}, {
3244
3254
  base: baseOrDefaultToBody
3245
- }), variant, typographyFamily),
3255
+ }), !variant && typographyType === typographyTypeInContext ? typographyVariantInContext : variant, typographyFamily),
3246
3256
  webFontWeight = _getUniversalFontWeig.webFontWeight,
3247
3257
  nativeFontFamily = _getUniversalFontWeig.nativeFontFamily;
3258
+
3259
+ // color
3260
+ var defaultColor = useTypographyDefaultColor();
3248
3261
  var currentColor = !color && !hasTypographyAncestor ? defaultColor : color;
3249
3262
  var currentColorValue = getTypographyColorValue(currentColor);
3250
3263
  var colorStyles = sx({
@@ -3270,11 +3283,14 @@ var TypographyBase = /*#__PURE__*/forwardRef(function (_ref2, ref) {
3270
3283
  fontFamily: nativeFontFamily,
3271
3284
  textTransform: typographyFamily === 'contentCaps' ? 'uppercase' : undefined
3272
3285
  }, colorStyles), otherProps));
3273
- var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(TypographyFamilyContext.Provider, {
3274
- value: typographyFamily,
3275
- children: /*#__PURE__*/jsx(TypographyTypeContext.Provider, {
3276
- value: typographyType,
3277
- children: text
3286
+ var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(TypographyVariantContext.Provider, {
3287
+ value: variant,
3288
+ children: /*#__PURE__*/jsx(TypographyFamilyContext.Provider, {
3289
+ value: typographyFamily,
3290
+ children: /*#__PURE__*/jsx(TypographyTypeContext.Provider, {
3291
+ value: typographyType,
3292
+ children: text
3293
+ })
3278
3294
  })
3279
3295
  }) : text;
3280
3296
  return color ? /*#__PURE__*/jsx(TypographyColorContext.Provider, {
@@ -4138,9 +4154,10 @@ function ModalBehaviour(_ref2) {
4138
4154
  }
4139
4155
  ModalBehaviour.CloseButton = CloseButton$1;
4140
4156
 
4141
- function Overlay(_ref) {
4157
+ var Overlay = /*#__PURE__*/forwardRef(function (_ref, ref) {
4142
4158
  var onPress = _ref.onPress;
4143
4159
  return /*#__PURE__*/jsx(Pressable, {
4160
+ ref: ref,
4144
4161
  accessibilityRole: "none",
4145
4162
  position: "absolute",
4146
4163
  top: "0",
@@ -4150,10 +4167,10 @@ function Overlay(_ref) {
4150
4167
  backgroundColor: "kitt.overlay.dark",
4151
4168
  onPress: onPress
4152
4169
  });
4153
- }
4170
+ });
4154
4171
 
4155
- function CardModalRotationContainer(props) {
4156
- return /*#__PURE__*/jsx(View, _objectSpread({
4172
+ var CardModalRotationContainer = /*#__PURE__*/forwardRef(function (props, ref) {
4173
+ return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({
4157
4174
  paddingX: "kitt.cardModal.overlayPadding.horizontal",
4158
4175
  paddingY: "kitt.cardModal.overlayPadding.vertical",
4159
4176
  maxWidth: "kitt.cardModal.maxWidthWithPadding",
@@ -4162,8 +4179,10 @@ function CardModalRotationContainer(props) {
4162
4179
  _web: {
4163
4180
  maxHeight: '100svh'
4164
4181
  }
4165
- }, props));
4166
- }
4182
+ }, props), {}, {
4183
+ ref: ref
4184
+ }));
4185
+ });
4167
4186
 
4168
4187
  var _excluded$J = ["children", "appear", "visible", "unmountOnExit", "isAnimationEnabled", "onEnter", "onEntered", "onExit", "onExited", "onClose"];
4169
4188
  var contentAnimationEnter$1 = "kitt-u_contentAnimationEnter_c11xxy4r";
@@ -4205,6 +4224,10 @@ function CardModalAnimation(_ref) {
4205
4224
  onExited = _ref.onExited,
4206
4225
  onClose = _ref.onClose,
4207
4226
  props = _objectWithoutProperties(_ref, _excluded$J);
4227
+ // React 19 has removed the ReactDOM.findDOMNode method. We need to use refs to access DOM nodes in CSSTransition.
4228
+ // See https://github.com/reactjs/react-transition-group/issues/918
4229
+ var overlayRef = useRef(null);
4230
+ var contentRef = useRef(null);
4208
4231
  var theme = useTheme();
4209
4232
  var animation = theme.kitt.cardModal.animation;
4210
4233
  var sharedProps = {
@@ -4216,12 +4239,15 @@ function CardModalAnimation(_ref) {
4216
4239
  height: "100%",
4217
4240
  justifyContent: "center",
4218
4241
  children: [/*#__PURE__*/jsx(CSSTransition, _objectSpread(_objectSpread({}, sharedProps), {}, {
4242
+ nodeRef: overlayRef,
4219
4243
  timeout: isAnimationEnabled ? animation.overlay.duration : 0,
4220
4244
  classNames: opacityClassNames$2,
4221
4245
  children: /*#__PURE__*/jsx(Overlay, {
4246
+ ref: overlayRef,
4222
4247
  onPress: onClose
4223
4248
  })
4224
4249
  })), /*#__PURE__*/jsx(CSSTransition, _objectSpread(_objectSpread({}, sharedProps), {}, {
4250
+ nodeRef: contentRef,
4225
4251
  timeout: isAnimationEnabled ? animation.content.duration : 0,
4226
4252
  classNames: contentAnimationClassNames$1,
4227
4253
  onEnter: onEnter,
@@ -4229,6 +4255,7 @@ function CardModalAnimation(_ref) {
4229
4255
  onExit: onExit,
4230
4256
  onExited: onExited,
4231
4257
  children: /*#__PURE__*/jsx(CardModalRotationContainer, {
4258
+ ref: contentRef,
4232
4259
  alignItems: "center",
4233
4260
  margin: "auto",
4234
4261
  children: children
@@ -4799,6 +4826,10 @@ function DialogModalAnimation(_ref) {
4799
4826
  onExited = _ref.onExited,
4800
4827
  onClose = _ref.onClose,
4801
4828
  props = _objectWithoutProperties(_ref, _excluded$C);
4829
+ // React 19 has removed the ReactDOM.findDOMNode method. We need to use refs to access DOM nodes in CSSTransition.
4830
+ // See https://github.com/reactjs/react-transition-group/issues/918
4831
+ var overlayRef = useRef(null);
4832
+ var contentRef = useRef(null);
4802
4833
  var theme = useTheme();
4803
4834
  var animation = theme.kitt.dialogModal.animation;
4804
4835
  var sharedProps = {
@@ -4810,12 +4841,15 @@ function DialogModalAnimation(_ref) {
4810
4841
  height: "100%",
4811
4842
  justifyContent: "center",
4812
4843
  children: [/*#__PURE__*/jsx(CSSTransition, _objectSpread(_objectSpread({}, sharedProps), {}, {
4844
+ nodeRef: overlayRef,
4813
4845
  timeout: isAnimationEnabled ? animation.overlay.duration : 0,
4814
4846
  classNames: opacityClassNames$1,
4815
4847
  children: /*#__PURE__*/jsx(Overlay, {
4848
+ ref: overlayRef,
4816
4849
  onPress: onClose
4817
4850
  })
4818
4851
  })), /*#__PURE__*/jsx(CSSTransition, _objectSpread(_objectSpread({}, sharedProps), {}, {
4852
+ nodeRef: contentRef,
4819
4853
  timeout: isAnimationEnabled ? animation.content.duration : 0,
4820
4854
  classNames: contentAnimationClassNames,
4821
4855
  onEnter: onEnter,
@@ -4823,6 +4857,7 @@ function DialogModalAnimation(_ref) {
4823
4857
  onExit: onExit,
4824
4858
  onExited: onExited,
4825
4859
  children: /*#__PURE__*/jsx(View, {
4860
+ ref: contentRef,
4826
4861
  alignItems: "center",
4827
4862
  paddingX: "kitt.dialogModal.overlayPadding.horizontal",
4828
4863
  paddingY: "kitt.dialogModal.overlayPadding.vertical",
@@ -7577,6 +7612,10 @@ function FullscreenModalAnimation(_ref) {
7577
7612
  onExited = _ref.onExited,
7578
7613
  onClose = _ref.onClose,
7579
7614
  props = _objectWithoutProperties(_ref, _excluded$i);
7615
+ // React 19 has removed the ReactDOM.findDOMNode method. We need to use refs to access DOM nodes in CSSTransition.
7616
+ // See https://github.com/reactjs/react-transition-group/issues/918
7617
+ var overlayRef = useRef(null);
7618
+ var contentRef = useRef(null);
7580
7619
  var theme = useTheme();
7581
7620
  var animation = theme.kitt.fullscreenModal.animation;
7582
7621
  var sharedProps = {
@@ -7586,19 +7625,25 @@ function FullscreenModalAnimation(_ref) {
7586
7625
  };
7587
7626
  return /*#__PURE__*/jsxs(View, _objectSpread(_objectSpread({}, props), {}, {
7588
7627
  children: [/*#__PURE__*/jsx(CSSTransition, _objectSpread(_objectSpread({}, sharedProps), {}, {
7628
+ nodeRef: overlayRef,
7589
7629
  timeout: isAnimationEnabled ? animation.overlay.duration : 0,
7590
7630
  classNames: opacityClassNames,
7591
7631
  children: /*#__PURE__*/jsx(Overlay, {
7632
+ ref: overlayRef,
7592
7633
  onPress: onClose
7593
7634
  })
7594
7635
  })), /*#__PURE__*/jsx(CSSTransition, _objectSpread(_objectSpread({}, sharedProps), {}, {
7636
+ nodeRef: contentRef,
7595
7637
  timeout: isAnimationEnabled ? animation.content.duration : 0,
7596
7638
  classNames: slideInClassNames,
7597
7639
  onEnter: onEnter,
7598
7640
  onEntered: onEntered,
7599
7641
  onExit: onExit,
7600
7642
  onExited: onExited,
7601
- children: children
7643
+ children: /*#__PURE__*/jsx(View, {
7644
+ ref: contentRef,
7645
+ children: children
7646
+ })
7602
7647
  }))]
7603
7648
  }));
7604
7649
  }
@@ -8358,7 +8403,7 @@ var getIconButtonColor = function (messageType) {
8358
8403
  }
8359
8404
  };
8360
8405
 
8361
- function BaseMessage(_ref) {
8406
+ var BaseMessage = /*#__PURE__*/forwardRef(function (_ref, ref) {
8362
8407
  var _ref$type = _ref.type,
8363
8408
  type = _ref$type === void 0 ? 'info' : _ref$type,
8364
8409
  children = _ref.children,
@@ -8368,6 +8413,7 @@ function BaseMessage(_ref) {
8368
8413
  onDismiss = _ref.onDismiss;
8369
8414
  var color = getColorByType(type);
8370
8415
  return /*#__PURE__*/jsxs(HStack, {
8416
+ ref: ref,
8371
8417
  alignItems: "flex-start",
8372
8418
  justifyContent: "space-between",
8373
8419
  minHeight: "kitt.feedbackMessage.minHeight",
@@ -8409,7 +8455,7 @@ function BaseMessage(_ref) {
8409
8455
  })
8410
8456
  }) : null]
8411
8457
  });
8412
- }
8458
+ });
8413
8459
 
8414
8460
  function Message(_ref) {
8415
8461
  var _ref$type = _ref.type,
@@ -10380,17 +10426,19 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
10380
10426
  fontWeights: {
10381
10427
  headings: {
10382
10428
  regular: theme.typography.types.headings.fontWeight.regular,
10429
+ semibold: theme.typography.types.headings.fontWeight.semibold,
10383
10430
  bold: theme.typography.types.headings.fontWeight.bold
10384
10431
  },
10385
10432
  bodies: {
10386
- regular: theme.typography.types.bodies.fontWeight.regular
10387
- // 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
10433
+ regular: theme.typography.types.bodies.fontWeight.regular,
10434
+ // TODO [expo@>=53]: Check if still needed with new expo-fonts version
10435
+ bold: theme.typography.types.bodies.fontWeight.bold
10388
10436
  },
10389
10437
  labels: {
10390
10438
  semibold: theme.typography.types.labels.fontWeight.semibold
10391
10439
  },
10392
10440
  contentCaps: {
10393
- // 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
10441
+ // TODO [expo@>=53]: Check if still needed with new expo-fonts version
10394
10442
  bold: theme.typography.types.contentCaps.fontWeight.bold
10395
10443
  }
10396
10444
  },
@@ -11150,13 +11198,14 @@ NavigationBottomSheet.Header = NavigationBottomSheetHeader;
11150
11198
  NavigationBottomSheet.Body = NavigationBottomSheetBody;
11151
11199
  NavigationBottomSheet.Footer = NavigationBottomSheetFooter;
11152
11200
 
11153
- function Notification(_ref) {
11201
+ var Notification = /*#__PURE__*/forwardRef(function (_ref, ref) {
11154
11202
  var type = _ref.type,
11155
11203
  children = _ref.children,
11156
11204
  centeredText = _ref.centeredText,
11157
11205
  insets = _ref.insets,
11158
11206
  onDismiss = _ref.onDismiss;
11159
11207
  return /*#__PURE__*/jsx(BaseMessage, {
11208
+ ref: ref,
11160
11209
  hasNoRadius: true,
11161
11210
  type: type,
11162
11211
  centeredText: centeredText,
@@ -11164,7 +11213,7 @@ function Notification(_ref) {
11164
11213
  onDismiss: onDismiss,
11165
11214
  children: children
11166
11215
  });
11167
- }
11216
+ });
11168
11217
 
11169
11218
  var AnimatedCircle = Animated$1.createAnimatedComponent(Circle$1);
11170
11219
  function AnimatedLoaderCircle(_ref) {
@@ -11420,6 +11469,9 @@ function Picker(_ref) {
11420
11469
  isItemsWidthFixed = _ref.isItemsWidthFixed,
11421
11470
  onChange = _ref.onChange,
11422
11471
  onClose = _ref.onClose;
11472
+ // React 19 has removed the ReactDOM.findDOMNode method. We need to use refs to access DOM nodes in CSSTransition.
11473
+ // See https://github.com/reactjs/react-transition-group/issues/918
11474
+ var nodeRef = useRef(null);
11423
11475
  if ((process.env.NODE_ENV !== "production") && sourceValue !== undefined && !syncStateWithSourceValue) {
11424
11476
  throw new Error('Picker: sourceValue prop should only be used with syncStateWithSourceValue prop');
11425
11477
  }
@@ -11528,6 +11580,7 @@ function Picker(_ref) {
11528
11580
  },
11529
11581
  children: /*#__PURE__*/jsx(CSSTransition, {
11530
11582
  unmountOnExit: true,
11583
+ nodeRef: nodeRef,
11531
11584
  timeout: 300,
11532
11585
  "in": isOpen,
11533
11586
  classNames: {
@@ -11537,6 +11590,7 @@ function Picker(_ref) {
11537
11590
  exitActive: exitActive
11538
11591
  },
11539
11592
  children: /*#__PURE__*/jsx(View, {
11593
+ ref: nodeRef,
11540
11594
  paddingY: "kitt.2",
11541
11595
  children: childrenArray.map(function (child, index) {
11542
11596
  var currentValue = items[index];