@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
@@ -3069,6 +3069,7 @@ const getTypographyTypeWithAncestorValue = (type, typographyTypeInContext) => {
3069
3069
  const _excluded$R = ["accessibilityRole", "base", "small", "medium", "large", "wide", "type", "variant", "color"];
3070
3070
  const TypographyFamilyContext = /*#__PURE__*/createContext(null);
3071
3071
  const TypographyTypeContext = /*#__PURE__*/createContext(null);
3072
+ const TypographyVariantContext = /*#__PURE__*/createContext(undefined);
3072
3073
  const TypographyColorContext = /*#__PURE__*/createContext('black');
3073
3074
  function useTypographyColor() {
3074
3075
  return useContext(TypographyColorContext);
@@ -3166,7 +3167,7 @@ function getUniversalFontWeight(type, variant, typographyFamily) {
3166
3167
  ThrowErrorIfInvalidVariant(variant, value, 'regular');
3167
3168
  resolvedVariant = 'regular';
3168
3169
  }
3169
- webFontWeight[typeName] = resolvedVariant;
3170
+ webFontWeight[typeName] = `${typographyFamily}.${resolvedVariant}`;
3170
3171
  nativeFontFamily[typeName] = `${typographyFamily}.${resolvedVariant}`;
3171
3172
  });
3172
3173
  return {
@@ -3195,22 +3196,34 @@ const TypographyBase = /*#__PURE__*/forwardRef((_ref, ref) => {
3195
3196
  } = _ref,
3196
3197
  otherProps = _objectWithoutProperties(_ref, _excluded$R);
3197
3198
  const sx = useSx();
3199
+
3200
+ // ancestors
3198
3201
  const typographyFamilyInContext = useContext(TypographyFamilyContext);
3199
3202
  const typographyTypeInContext = useContext(TypographyTypeContext);
3200
- const defaultColor = useTypographyDefaultColor();
3203
+ const typographyVariantInContext = useContext(TypographyVariantContext);
3204
+
3205
+ // family
3201
3206
  const hasTypographyAncestor = typographyFamilyInContext !== null;
3202
3207
  const typographyType = getTypographyTypeWithAncestorValue(type, typographyTypeInContext);
3203
3208
  const baseOrDefaultToBody = (_typographyType$base = typographyType.base) !== null && _typographyType$base !== void 0 ? _typographyType$base : 'body-m';
3204
3209
  const typographyFamily = getTypographyFamilyWithAncestorValue(baseOrDefaultToBody, typographyFamilyInContext);
3210
+
3211
+ // size
3205
3212
  const fontSizeForNativeBase = createNativeBaseFontSize(_objectSpread(_objectSpread({}, type), {}, {
3206
3213
  base: baseOrDefaultToBody
3207
3214
  }));
3215
+
3216
+ // weight
3217
+
3208
3218
  const {
3209
3219
  webFontWeight,
3210
3220
  nativeFontFamily
3211
3221
  } = getUniversalFontWeight(_objectSpread(_objectSpread({}, type), {}, {
3212
3222
  base: baseOrDefaultToBody
3213
- }), variant, typographyFamily);
3223
+ }), !variant && typographyType === typographyTypeInContext ? typographyVariantInContext : variant, typographyFamily);
3224
+
3225
+ // color
3226
+ const defaultColor = useTypographyDefaultColor();
3214
3227
  const currentColor = !color && !hasTypographyAncestor ? defaultColor : color;
3215
3228
  const currentColorValue = getTypographyColorValue(currentColor);
3216
3229
  const colorStyles = sx({
@@ -3233,11 +3246,14 @@ const TypographyBase = /*#__PURE__*/forwardRef((_ref, ref) => {
3233
3246
  fontFamily: nativeFontFamily,
3234
3247
  textTransform: typographyFamily === 'contentCaps' ? 'uppercase' : undefined
3235
3248
  }, colorStyles), otherProps));
3236
- const content = baseOrDefaultToBody ? /*#__PURE__*/jsx(TypographyFamilyContext.Provider, {
3237
- value: typographyFamily,
3238
- children: /*#__PURE__*/jsx(TypographyTypeContext.Provider, {
3239
- value: typographyType,
3240
- children: text
3249
+ const content = baseOrDefaultToBody ? /*#__PURE__*/jsx(TypographyVariantContext.Provider, {
3250
+ value: variant,
3251
+ children: /*#__PURE__*/jsx(TypographyFamilyContext.Provider, {
3252
+ value: typographyFamily,
3253
+ children: /*#__PURE__*/jsx(TypographyTypeContext.Provider, {
3254
+ value: typographyType,
3255
+ children: text
3256
+ })
3241
3257
  })
3242
3258
  }) : text;
3243
3259
  return color ? /*#__PURE__*/jsx(TypographyColorContext.Provider, {
@@ -4133,10 +4149,11 @@ function ModalBehaviour({
4133
4149
  }
4134
4150
  ModalBehaviour.CloseButton = CloseButton$1;
4135
4151
 
4136
- function Overlay({
4152
+ const Overlay = /*#__PURE__*/forwardRef(({
4137
4153
  onPress
4138
- }) {
4154
+ }, ref) => {
4139
4155
  return /*#__PURE__*/jsx(Pressable, {
4156
+ ref: ref,
4140
4157
  accessibilityRole: "none",
4141
4158
  position: "absolute",
4142
4159
  top: "0",
@@ -4146,10 +4163,10 @@ function Overlay({
4146
4163
  backgroundColor: "kitt.overlay.dark",
4147
4164
  onPress: onPress
4148
4165
  });
4149
- }
4166
+ });
4150
4167
 
4151
- function CardModalRotationContainer(props) {
4152
- return /*#__PURE__*/jsx(View, _objectSpread({
4168
+ const CardModalRotationContainer = /*#__PURE__*/forwardRef((props, ref) => {
4169
+ return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({
4153
4170
  paddingX: "kitt.cardModal.overlayPadding.horizontal",
4154
4171
  paddingY: "kitt.cardModal.overlayPadding.vertical",
4155
4172
  maxWidth: "kitt.cardModal.maxWidthWithPadding",
@@ -4158,8 +4175,10 @@ function CardModalRotationContainer(props) {
4158
4175
  _web: {
4159
4176
  maxHeight: '100svh'
4160
4177
  }
4161
- }, props));
4162
- }
4178
+ }, props), {}, {
4179
+ ref: ref
4180
+ }));
4181
+ });
4163
4182
 
4164
4183
  function NativeOpacityAnimation$2({
4165
4184
  visible,
@@ -8983,22 +9002,23 @@ const getIconButtonColor = messageType => {
8983
9002
  }
8984
9003
  };
8985
9004
 
8986
- function BaseMessage({
8987
- type = 'info',
9005
+ const BaseMessage = /*#__PURE__*/forwardRef(({
9006
+ type: _type = 'info',
8988
9007
  children,
8989
9008
  hasNoRadius,
8990
9009
  centeredText,
8991
9010
  insets,
8992
9011
  onDismiss
8993
- }) {
8994
- const color = getColorByType(type);
9012
+ }, ref) => {
9013
+ const color = getColorByType(_type);
8995
9014
  return /*#__PURE__*/jsxs(HStack, {
9015
+ ref: ref,
8996
9016
  alignItems: "flex-start",
8997
9017
  justifyContent: "space-between",
8998
9018
  minHeight: "kitt.feedbackMessage.minHeight",
8999
9019
  paddingTop: insets === null || insets === void 0 ? void 0 : insets.top,
9000
9020
  borderRadius: hasNoRadius ? undefined : 'kitt.2',
9001
- backgroundColor: `kitt.feedbackMessage.${type}.backgroundColor`,
9021
+ backgroundColor: `kitt.feedbackMessage.${_type}.backgroundColor`,
9002
9022
  children: [/*#__PURE__*/jsxs(HStack, {
9003
9023
  flexGrow: 1,
9004
9024
  flexShrink: 1,
@@ -9011,7 +9031,7 @@ function BaseMessage({
9011
9031
  children: /*#__PURE__*/jsx(Icon, {
9012
9032
  color: color,
9013
9033
  icon: /*#__PURE__*/jsx(IconContent, {
9014
- type: type,
9034
+ type: _type,
9015
9035
  color: color
9016
9036
  })
9017
9037
  })
@@ -9029,12 +9049,12 @@ function BaseMessage({
9029
9049
  marginRight: "kitt.2",
9030
9050
  marginLeft: "kitt.5",
9031
9051
  children: /*#__PURE__*/jsx(CloseIconButton, {
9032
- color: getIconButtonColor(type),
9052
+ color: getIconButtonColor(_type),
9033
9053
  onPress: onDismiss
9034
9054
  })
9035
9055
  }) : null]
9036
9056
  });
9037
- }
9057
+ });
9038
9058
 
9039
9059
  function Message({
9040
9060
  type = 'info',
@@ -11003,17 +11023,19 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
11003
11023
  fontWeights: {
11004
11024
  headings: {
11005
11025
  regular: theme.typography.types.headings.fontWeight.regular,
11026
+ semibold: theme.typography.types.headings.fontWeight.semibold,
11006
11027
  bold: theme.typography.types.headings.fontWeight.bold
11007
11028
  },
11008
11029
  bodies: {
11009
- regular: theme.typography.types.bodies.fontWeight.regular
11010
- // 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
11030
+ regular: theme.typography.types.bodies.fontWeight.regular,
11031
+ // TODO [expo@>=53]: Check if still needed with new expo-fonts version
11032
+ bold: Platform.OS === 'android' ? 400 : theme.typography.types.bodies.fontWeight.bold
11011
11033
  },
11012
11034
  labels: {
11013
11035
  semibold: theme.typography.types.labels.fontWeight.semibold
11014
11036
  },
11015
11037
  contentCaps: {
11016
- // 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
11038
+ // TODO [expo@>=53]: Check if still needed with new expo-fonts version
11017
11039
  bold: Platform.OS === 'android' ? 400 : theme.typography.types.contentCaps.fontWeight.bold
11018
11040
  }
11019
11041
  },
@@ -11755,14 +11777,15 @@ NavigationModal.Body = Body;
11755
11777
  NavigationModal.Footer = Footer;
11756
11778
  NavigationModal.ModalBehaviour = NavigationModalBehaviour;
11757
11779
 
11758
- function Notification({
11780
+ const Notification = /*#__PURE__*/forwardRef(({
11759
11781
  type,
11760
11782
  children,
11761
11783
  centeredText,
11762
11784
  insets,
11763
11785
  onDismiss
11764
- }) {
11786
+ }, ref) => {
11765
11787
  return /*#__PURE__*/jsx(BaseMessage, {
11788
+ ref: ref,
11766
11789
  hasNoRadius: true,
11767
11790
  type: type,
11768
11791
  centeredText: centeredText,
@@ -11770,7 +11793,7 @@ function Notification({
11770
11793
  onDismiss: onDismiss,
11771
11794
  children: children
11772
11795
  });
11773
- }
11796
+ });
11774
11797
 
11775
11798
  const AnimatedCircle = Animated.createAnimatedComponent(Circle$1);
11776
11799
  function AnimatedLoaderCircle({