@ornikar/kitt-universal 29.4.1-canary.ee3a5de11ca14467578621a40a921148838ee329.0 → 29.4.2-canary.5279d6411761af875ca17c9a8eefbb621d15180d.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 (38) hide show
  1. package/CHANGELOG.md +16 -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
@@ -3063,6 +3063,7 @@ const getTypographyTypeWithAncestorValue = (type, typographyTypeInContext) => {
3063
3063
 
3064
3064
  const TypographyFamilyContext = /*#__PURE__*/createContext(null);
3065
3065
  const TypographyTypeContext = /*#__PURE__*/createContext(null);
3066
+ const TypographyVariantContext = /*#__PURE__*/createContext(undefined);
3066
3067
  const TypographyColorContext = /*#__PURE__*/createContext('black');
3067
3068
  function useTypographyColor() {
3068
3069
  return useContext(TypographyColorContext);
@@ -3161,7 +3162,7 @@ function getUniversalFontWeight(type, variant, typographyFamily) {
3161
3162
  ThrowErrorIfInvalidVariant(variant, value, 'regular');
3162
3163
  resolvedVariant = 'regular';
3163
3164
  }
3164
- webFontWeight[typeName] = resolvedVariant;
3165
+ webFontWeight[typeName] = `${typographyFamily}.${resolvedVariant}`;
3165
3166
  nativeFontFamily[typeName] = `${typographyFamily}.${resolvedVariant}`;
3166
3167
  });
3167
3168
  return {
@@ -3188,24 +3189,36 @@ const TypographyBase = /*#__PURE__*/forwardRef(({
3188
3189
  ...otherProps
3189
3190
  }, ref) => {
3190
3191
  const sx = useSx();
3192
+
3193
+ // ancestors
3191
3194
  const typographyFamilyInContext = useContext(TypographyFamilyContext);
3192
3195
  const typographyTypeInContext = useContext(TypographyTypeContext);
3193
- const defaultColor = useTypographyDefaultColor();
3196
+ const typographyVariantInContext = useContext(TypographyVariantContext);
3197
+
3198
+ // family
3194
3199
  const hasTypographyAncestor = typographyFamilyInContext !== null;
3195
3200
  const typographyType = getTypographyTypeWithAncestorValue(type, typographyTypeInContext);
3196
3201
  const baseOrDefaultToBody = typographyType.base ?? 'body-m';
3197
3202
  const typographyFamily = getTypographyFamilyWithAncestorValue(baseOrDefaultToBody, typographyFamilyInContext);
3203
+
3204
+ // size
3198
3205
  const fontSizeForNativeBase = createNativeBaseFontSize({
3199
3206
  ...type,
3200
3207
  base: baseOrDefaultToBody
3201
3208
  });
3209
+
3210
+ // weight
3211
+
3202
3212
  const {
3203
3213
  webFontWeight,
3204
3214
  nativeFontFamily
3205
3215
  } = getUniversalFontWeight({
3206
3216
  ...type,
3207
3217
  base: baseOrDefaultToBody
3208
- }, variant, typographyFamily);
3218
+ }, !variant && typographyType === typographyTypeInContext ? typographyVariantInContext : variant, typographyFamily);
3219
+
3220
+ // color
3221
+ const defaultColor = useTypographyDefaultColor();
3209
3222
  const currentColor = !color && !hasTypographyAncestor ? defaultColor : color;
3210
3223
  const currentColorValue = getTypographyColorValue(currentColor);
3211
3224
  const colorStyles = sx({
@@ -3230,11 +3243,14 @@ const TypographyBase = /*#__PURE__*/forwardRef(({
3230
3243
  ...colorStyles,
3231
3244
  ...otherProps
3232
3245
  });
3233
- const content = baseOrDefaultToBody ? /*#__PURE__*/jsx(TypographyFamilyContext.Provider, {
3234
- value: typographyFamily,
3235
- children: /*#__PURE__*/jsx(TypographyTypeContext.Provider, {
3236
- value: typographyType,
3237
- children: text
3246
+ const content = baseOrDefaultToBody ? /*#__PURE__*/jsx(TypographyVariantContext.Provider, {
3247
+ value: variant,
3248
+ children: /*#__PURE__*/jsx(TypographyFamilyContext.Provider, {
3249
+ value: typographyFamily,
3250
+ children: /*#__PURE__*/jsx(TypographyTypeContext.Provider, {
3251
+ value: typographyType,
3252
+ children: text
3253
+ })
3238
3254
  })
3239
3255
  }) : text;
3240
3256
  return color ? /*#__PURE__*/jsx(TypographyColorContext.Provider, {
@@ -4134,10 +4150,11 @@ function ModalBehaviour({
4134
4150
  }
4135
4151
  ModalBehaviour.CloseButton = CloseButton$1;
4136
4152
 
4137
- function Overlay({
4153
+ const Overlay = /*#__PURE__*/forwardRef(({
4138
4154
  onPress
4139
- }) {
4155
+ }, ref) => {
4140
4156
  return /*#__PURE__*/jsx(Pressable, {
4157
+ ref: ref,
4141
4158
  accessibilityRole: "none",
4142
4159
  position: "absolute",
4143
4160
  top: "0",
@@ -4147,9 +4164,9 @@ function Overlay({
4147
4164
  backgroundColor: "kitt.overlay.dark",
4148
4165
  onPress: onPress
4149
4166
  });
4150
- }
4167
+ });
4151
4168
 
4152
- function CardModalRotationContainer(props) {
4169
+ const CardModalRotationContainer = /*#__PURE__*/forwardRef((props, ref) => {
4153
4170
  return /*#__PURE__*/jsx(View, {
4154
4171
  paddingX: "kitt.cardModal.overlayPadding.horizontal",
4155
4172
  paddingY: "kitt.cardModal.overlayPadding.vertical",
@@ -4159,9 +4176,10 @@ function CardModalRotationContainer(props) {
4159
4176
  _web: {
4160
4177
  maxHeight: '100svh'
4161
4178
  },
4162
- ...props
4179
+ ...props,
4180
+ ref: ref
4163
4181
  });
4164
- }
4182
+ });
4165
4183
 
4166
4184
  function NativeOpacityAnimation$2({
4167
4185
  visible,
@@ -8959,16 +8977,17 @@ const getIconButtonColor = messageType => {
8959
8977
  }
8960
8978
  };
8961
8979
 
8962
- function BaseMessage({
8980
+ const BaseMessage = /*#__PURE__*/forwardRef(({
8963
8981
  type = 'info',
8964
8982
  children,
8965
8983
  hasNoRadius,
8966
8984
  centeredText,
8967
8985
  insets,
8968
8986
  onDismiss
8969
- }) {
8987
+ }, ref) => {
8970
8988
  const color = getColorByType(type);
8971
8989
  return /*#__PURE__*/jsxs(HStack, {
8990
+ ref: ref,
8972
8991
  alignItems: "flex-start",
8973
8992
  justifyContent: "space-between",
8974
8993
  minHeight: "kitt.feedbackMessage.minHeight",
@@ -9010,7 +9029,7 @@ function BaseMessage({
9010
9029
  })
9011
9030
  }) : null]
9012
9031
  });
9013
- }
9032
+ });
9014
9033
 
9015
9034
  function Message({
9016
9035
  type = 'info',
@@ -10988,17 +11007,19 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
10988
11007
  fontWeights: {
10989
11008
  headings: {
10990
11009
  regular: theme.typography.types.headings.fontWeight.regular,
11010
+ semibold: theme.typography.types.headings.fontWeight.semibold,
10991
11011
  bold: theme.typography.types.headings.fontWeight.bold
10992
11012
  },
10993
11013
  bodies: {
10994
- regular: theme.typography.types.bodies.fontWeight.regular
10995
- // 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
11014
+ regular: theme.typography.types.bodies.fontWeight.regular,
11015
+ // TODO [expo@>=53]: Check if still needed with new expo-fonts version
11016
+ bold: Platform.OS === 'android' ? 400 : theme.typography.types.bodies.fontWeight.bold
10996
11017
  },
10997
11018
  labels: {
10998
11019
  semibold: theme.typography.types.labels.fontWeight.semibold
10999
11020
  },
11000
11021
  contentCaps: {
11001
- // 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
11022
+ // TODO [expo@>=53]: Check if still needed with new expo-fonts version
11002
11023
  bold: Platform.OS === 'android' ? 400 : theme.typography.types.contentCaps.fontWeight.bold
11003
11024
  }
11004
11025
  },
@@ -11747,14 +11768,15 @@ NavigationModal.Body = Body;
11747
11768
  NavigationModal.Footer = Footer;
11748
11769
  NavigationModal.ModalBehaviour = NavigationModalBehaviour;
11749
11770
 
11750
- function Notification({
11771
+ const Notification = /*#__PURE__*/forwardRef(({
11751
11772
  type,
11752
11773
  children,
11753
11774
  centeredText,
11754
11775
  insets,
11755
11776
  onDismiss
11756
- }) {
11777
+ }, ref) => {
11757
11778
  return /*#__PURE__*/jsx(BaseMessage, {
11779
+ ref: ref,
11758
11780
  hasNoRadius: true,
11759
11781
  type: type,
11760
11782
  centeredText: centeredText,
@@ -11762,7 +11784,7 @@ function Notification({
11762
11784
  onDismiss: onDismiss,
11763
11785
  children: children
11764
11786
  });
11765
- }
11787
+ });
11766
11788
 
11767
11789
  const AnimatedCircle = Animated.createAnimatedComponent(Circle$1);
11768
11790
  function AnimatedLoaderCircle({