@hero-design/rn 8.45.0-test.0 → 8.45.1

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 (37) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/CHANGELOG.md +23 -2
  3. package/es/index.js +764 -578
  4. package/lib/index.js +764 -578
  5. package/package.json +6 -6
  6. package/src/components/Accordion/index.tsx +1 -1
  7. package/src/components/Avatar/AvatarStack/StyledAvatarStack.tsx +63 -9
  8. package/src/components/Avatar/AvatarStack/__tests__/StyledAvatarStack.spec.tsx +71 -9
  9. package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/StyledAvatarStack.spec.tsx.snap +271 -2
  10. package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/index.spec.tsx.snap +2156 -7
  11. package/src/components/Avatar/AvatarStack/__tests__/index.spec.tsx +140 -6
  12. package/src/components/Avatar/AvatarStack/index.tsx +94 -9
  13. package/src/components/Carousel/index.tsx +18 -11
  14. package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +108 -57
  15. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +36 -19
  16. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +36 -19
  17. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +36 -19
  18. package/src/components/RichTextEditor/RichTextEditor.tsx +89 -38
  19. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +130 -102
  20. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +247 -146
  21. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +211 -127
  22. package/src/components/TextInput/StyledTextInput.tsx +9 -31
  23. package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +0 -44
  24. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +21 -638
  25. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +1159 -833
  26. package/src/components/TextInput/__tests__/index.spec.tsx +2 -2
  27. package/src/components/TextInput/index.tsx +128 -57
  28. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +72 -38
  29. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +72 -38
  30. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +2 -2
  31. package/src/theme/components/textInput.ts +2 -2
  32. package/types/components/Accordion/index.d.ts +1 -1
  33. package/types/components/Avatar/AvatarStack/StyledAvatarStack.d.ts +13 -0
  34. package/types/components/Avatar/AvatarStack/index.d.ts +14 -2
  35. package/types/components/Avatar/index.d.ts +1 -1
  36. package/types/components/TextInput/StyledTextInput.d.ts +4 -24
  37. package/types/components/TextInput/index.d.ts +1 -0
package/lib/index.js CHANGED
@@ -3363,8 +3363,8 @@ var getTextInputTheme = function getTextInputTheme(theme) {
3363
3363
  };
3364
3364
  var space = {
3365
3365
  containerPadding: theme.space.medium,
3366
- labelLeft: theme.space.medium,
3367
- labelTop: theme.lineHeights.small / -4,
3366
+ labelLeft: theme.space.xlarge,
3367
+ labelTop: theme.space.xlarge / 3,
3368
3368
  labelPaddingBottom: theme.space.small,
3369
3369
  labelHorizontalPadding: theme.space.xsmall,
3370
3370
  inputHorizontalMargin: theme.space.small,
@@ -6791,7 +6791,7 @@ var Caption = function Caption(_ref) {
6791
6791
  }), children);
6792
6792
  };
6793
6793
 
6794
- var StyledLabel$2 = index$a(reactNative.Text)(function (_ref) {
6794
+ var StyledLabel$1 = index$a(reactNative.Text)(function (_ref) {
6795
6795
  var themeIntent = _ref.themeIntent,
6796
6796
  theme = _ref.theme;
6797
6797
  return {
@@ -6810,7 +6810,7 @@ var Label = function Label(_ref) {
6810
6810
  _ref$allowFontScaling = _ref.allowFontScaling,
6811
6811
  allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
6812
6812
  nativeProps = _objectWithoutProperties(_ref, _excluded$y);
6813
- return /*#__PURE__*/React__default["default"].createElement(StyledLabel$2, _extends$1({}, nativeProps, {
6813
+ return /*#__PURE__*/React__default["default"].createElement(StyledLabel$1, _extends$1({}, nativeProps, {
6814
6814
  themeIntent: intent,
6815
6815
  allowFontScaling: allowFontScaling
6816
6816
  }), children);
@@ -7538,8 +7538,8 @@ var Accordion = function Accordion(_ref) {
7538
7538
  onItemPress = _ref.onItemPress,
7539
7539
  _ref$variant = _ref.variant,
7540
7540
  variant = _ref$variant === void 0 ? 'default' : _ref$variant,
7541
- testID = _ref.testID,
7542
- style = _ref.style;
7541
+ style = _ref.style,
7542
+ testID = _ref.testID;
7543
7543
  var defaultValue = React.useMemo(function () {
7544
7544
  return typeof activeItemKey === 'number' ? NaN : '';
7545
7545
  }, [activeItemKey]);
@@ -7830,27 +7830,300 @@ var Avatar = function Avatar(_ref) {
7830
7830
  }));
7831
7831
  };
7832
7832
 
7833
+ var isIOS = reactNative.Platform.OS === 'ios';
7834
+ var isAndroid = reactNative.Platform.OS === 'android';
7835
+ function pick(keys, obj) {
7836
+ return keys.filter(function (key) {
7837
+ return key in obj;
7838
+ }).reduce(function (result, cur) {
7839
+ return _objectSpread2(_objectSpread2({}, result), {}, _defineProperty({}, cur, obj[cur]));
7840
+ }, {});
7841
+ }
7842
+ function omit(keys, obj) {
7843
+ var result = obj;
7844
+ keys.forEach(function (key) {
7845
+ delete result[key];
7846
+ });
7847
+ return result;
7848
+ }
7849
+
7850
+ var colors = {
7851
+ backgroundColor: {
7852
+ property: 'backgroundColor',
7853
+ scale: 'colors'
7854
+ },
7855
+ bgColor: {
7856
+ property: 'backgroundColor',
7857
+ scale: 'colors'
7858
+ },
7859
+ borderColor: {
7860
+ property: 'borderColor',
7861
+ scale: 'colors'
7862
+ },
7863
+ borderTopColor: {
7864
+ property: 'borderTopColor',
7865
+ scale: 'colors'
7866
+ },
7867
+ borderBottomColor: {
7868
+ property: 'borderBottomColor',
7869
+ scale: 'colors'
7870
+ },
7871
+ borderStartColor: {
7872
+ property: 'borderStartColor',
7873
+ scale: 'colors'
7874
+ },
7875
+ borderEndColor: {
7876
+ property: 'borderEndColor',
7877
+ scale: 'colors'
7878
+ },
7879
+ borderLeftColor: {
7880
+ property: 'borderLeftColor',
7881
+ scale: 'colors'
7882
+ },
7883
+ borderRightColor: {
7884
+ property: 'borderRightColor',
7885
+ scale: 'colors'
7886
+ }
7887
+ };
7888
+ var space = {
7889
+ margin: {
7890
+ property: 'margin',
7891
+ scale: 'space'
7892
+ },
7893
+ marginBottom: {
7894
+ property: 'marginBottom',
7895
+ scale: 'space'
7896
+ },
7897
+ marginEnd: {
7898
+ property: 'marginEnd',
7899
+ scale: 'space'
7900
+ },
7901
+ marginHorizontal: {
7902
+ property: 'marginHorizontal',
7903
+ scale: 'space'
7904
+ },
7905
+ marginLeft: {
7906
+ property: 'marginLeft',
7907
+ scale: 'space'
7908
+ },
7909
+ marginRight: {
7910
+ property: 'marginRight',
7911
+ scale: 'space'
7912
+ },
7913
+ marginStart: {
7914
+ property: 'marginStart',
7915
+ scale: 'space'
7916
+ },
7917
+ marginTop: {
7918
+ property: 'marginTop',
7919
+ scale: 'space'
7920
+ },
7921
+ marginVertical: {
7922
+ property: 'marginVertical',
7923
+ scale: 'space'
7924
+ },
7925
+ padding: {
7926
+ property: 'padding',
7927
+ scale: 'space'
7928
+ },
7929
+ paddingBottom: {
7930
+ property: 'paddingBottom',
7931
+ scale: 'space'
7932
+ },
7933
+ paddingEnd: {
7934
+ property: 'paddingEnd',
7935
+ scale: 'space'
7936
+ },
7937
+ paddingHorizontal: {
7938
+ property: 'paddingHorizontal',
7939
+ scale: 'space'
7940
+ },
7941
+ paddingLeft: {
7942
+ property: 'paddingLeft',
7943
+ scale: 'space'
7944
+ },
7945
+ paddingRight: {
7946
+ property: 'paddingRight',
7947
+ scale: 'space'
7948
+ },
7949
+ paddingStart: {
7950
+ property: 'paddingStart',
7951
+ scale: 'space'
7952
+ },
7953
+ paddingTop: {
7954
+ property: 'paddingTop',
7955
+ scale: 'space'
7956
+ },
7957
+ paddingVertical: {
7958
+ property: 'paddingVertical',
7959
+ scale: 'space'
7960
+ }
7961
+ };
7962
+ var radii = {
7963
+ borderBottomEndRadius: {
7964
+ property: 'borderBottomEndRadius',
7965
+ scale: 'radii'
7966
+ },
7967
+ borderBottomLeftRadius: {
7968
+ property: 'borderBottomLeftRadius',
7969
+ scale: 'radii'
7970
+ },
7971
+ borderBottomRightRadius: {
7972
+ property: 'borderBottomRightRadius',
7973
+ scale: 'radii'
7974
+ },
7975
+ borderBottomStartRadius: {
7976
+ property: 'borderBottomStartRadius',
7977
+ scale: 'radii'
7978
+ },
7979
+ borderTopEndRadius: {
7980
+ property: 'borderTopEndRadius',
7981
+ scale: 'radii'
7982
+ },
7983
+ borderTopLeftRadius: {
7984
+ property: 'borderTopLeftRadius',
7985
+ scale: 'radii'
7986
+ },
7987
+ borderTopRightRadius: {
7988
+ property: 'borderTopRightRadius',
7989
+ scale: 'radii'
7990
+ },
7991
+ borderTopStartRadius: {
7992
+ property: 'borderTopStartRadius',
7993
+ scale: 'radii'
7994
+ },
7995
+ borderRadius: {
7996
+ property: 'borderRadius',
7997
+ scale: 'radii'
7998
+ }
7999
+ };
8000
+ var borderWidths = {
8001
+ borderWidth: {
8002
+ property: 'borderWidth',
8003
+ scale: 'borderWidths'
8004
+ },
8005
+ borderBottomWidth: {
8006
+ property: 'borderBottomWidth',
8007
+ scale: 'borderWidths'
8008
+ },
8009
+ borderTopWidth: {
8010
+ property: 'borderTopWidth',
8011
+ scale: 'borderWidths'
8012
+ },
8013
+ borderLeftWidth: {
8014
+ property: 'borderLeftWidth',
8015
+ scale: 'borderWidths'
8016
+ },
8017
+ borderRightWidth: {
8018
+ property: 'borderRightWidth',
8019
+ scale: 'borderWidths'
8020
+ }
8021
+ };
8022
+ var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
8023
+ var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
8024
+
8025
+ var _excluded$t = ["theme"];
8026
+ var getThemeValue = function getThemeValue(theme, key, props) {
8027
+ var propConfig = config[key];
8028
+ var propValue = props[key];
8029
+ if (!propValue) return undefined;
8030
+ var scale = propConfig.scale,
8031
+ property = propConfig.property;
8032
+ switch (scale) {
8033
+ case 'colors':
8034
+ return _defineProperty({}, property, theme.colors[propValue]);
8035
+ case 'space':
8036
+ return _defineProperty({}, property, theme.space[propValue]);
8037
+ case 'radii':
8038
+ return _defineProperty({}, property, theme.radii[propValue]);
8039
+ case 'borderWidths':
8040
+ return _defineProperty({}, property, theme.borderWidths[propValue]);
8041
+ }
8042
+ };
8043
+ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
8044
+ var entries = Object.keys(props);
8045
+ return entries.reduce(function (result, key) {
8046
+ return _objectSpread2(_objectSpread2({}, result), getThemeValue(theme, key, props));
8047
+ }, {});
8048
+ };
8049
+ var configKeys = Object.keys(config);
8050
+ var StyledBox = index$a(reactNative.View)(function (_ref5) {
8051
+ var theme = _ref5.theme,
8052
+ otherProps = _objectWithoutProperties(_ref5, _excluded$t);
8053
+ var styleProps = pick(configKeys, otherProps);
8054
+ var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
8055
+ return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
8056
+ });
8057
+
8058
+ var _excluded$s = ["children", "style", "testID"];
8059
+ var Box = function Box(_ref) {
8060
+ var children = _ref.children,
8061
+ style = _ref.style,
8062
+ testID = _ref.testID,
8063
+ otherProps = _objectWithoutProperties(_ref, _excluded$s);
8064
+ return /*#__PURE__*/React__default["default"].createElement(StyledBox, _extends$1({}, otherProps, {
8065
+ style: style,
8066
+ testID: testID
8067
+ }), children);
8068
+ };
8069
+
7833
8070
  var VISIBLE_RATIO = 0.7;
7834
8071
  var StyledWrapper$a = index$a(reactNative.View)(function (_ref) {
7835
8072
  var theme = _ref.theme,
7836
8073
  themeSize = _ref.themeSize,
7837
- themeAvatarCount = _ref.themeAvatarCount;
8074
+ themeAvatarCount = _ref.themeAvatarCount,
8075
+ _ref$themeVariant = _ref.themeVariant,
8076
+ themeVariant = _ref$themeVariant === void 0 ? 'horizontal' : _ref$themeVariant,
8077
+ _ref$themeHasSurplus = _ref.themeHasSurplus,
8078
+ themeHasSurplus = _ref$themeHasSurplus === void 0 ? false : _ref$themeHasSurplus;
7838
8079
  var avatarSize = theme.__hd__.avatar.sizes[themeSize];
8080
+ var widthAndHeightByVariant = {
8081
+ horizontal: {
8082
+ width: avatarSize * (1 + VISIBLE_RATIO * (themeHasSurplus ? themeAvatarCount : themeAvatarCount - 1)),
8083
+ height: avatarSize
8084
+ },
8085
+ vertical: {
8086
+ width: avatarSize,
8087
+ height: avatarSize * (1 + VISIBLE_RATIO * (themeHasSurplus ? themeAvatarCount : themeAvatarCount - 1))
8088
+ }
8089
+ };
7839
8090
  return {
7840
- flexDirection: 'row',
7841
- height: avatarSize,
7842
- width: avatarSize * (1 + VISIBLE_RATIO * (themeAvatarCount - 1))
8091
+ flexDirection: themeVariant === 'horizontal' ? 'row' : 'column',
8092
+ height: widthAndHeightByVariant[themeVariant].height,
8093
+ width: widthAndHeightByVariant[themeVariant].width
7843
8094
  };
7844
8095
  });
7845
8096
  var StyledAvatar = index$a(Avatar)(function (_ref2) {
7846
8097
  var theme = _ref2.theme,
7847
8098
  themeIndex = _ref2.themeIndex,
7848
8099
  _ref2$size = _ref2.size,
7849
- size = _ref2$size === void 0 ? 'small' : _ref2$size;
8100
+ size = _ref2$size === void 0 ? 'small' : _ref2$size,
8101
+ _ref2$themeVariant = _ref2.themeVariant,
8102
+ themeVariant = _ref2$themeVariant === void 0 ? 'horizontal' : _ref2$themeVariant;
7850
8103
  var avatarSize = theme.__hd__.avatar.sizes[size];
8104
+ var offset = avatarSize * VISIBLE_RATIO * themeIndex;
7851
8105
  return {
7852
8106
  position: 'absolute',
7853
- left: avatarSize * VISIBLE_RATIO * themeIndex
8107
+ left: themeVariant === 'horizontal' ? offset : undefined,
8108
+ top: themeVariant === 'vertical' ? offset : undefined
8109
+ };
8110
+ });
8111
+ var StyledSurplusContainer = index$a(Box)(function (_ref3) {
8112
+ var theme = _ref3.theme,
8113
+ themeIndex = _ref3.themeIndex,
8114
+ themeVariant = _ref3.themeVariant,
8115
+ _ref3$themeSize = _ref3.themeSize,
8116
+ themeSize = _ref3$themeSize === void 0 ? 'small' : _ref3$themeSize;
8117
+ var avatarSize = theme.__hd__.avatar.sizes[themeSize];
8118
+ var offset = avatarSize * VISIBLE_RATIO * themeIndex;
8119
+ return {
8120
+ position: 'absolute',
8121
+ left: themeVariant === 'horizontal' ? offset : undefined,
8122
+ top: themeVariant === 'vertical' ? offset : undefined,
8123
+ borderRadius: theme.__hd__.avatar.radii.rounded,
8124
+ width: theme.__hd__.avatar.sizes[themeSize],
8125
+ height: theme.__hd__.avatar.sizes[themeSize],
8126
+ overflow: 'hidden'
7854
8127
  };
7855
8128
  });
7856
8129
 
@@ -7876,36 +8149,87 @@ var useAvatarColors = function useAvatarColors() {
7876
8149
  }, []);
7877
8150
  return shuffledColors;
7878
8151
  };
7879
-
7880
- var AvatarStack = function AvatarStack(_ref) {
7881
- var children = _ref.children,
7882
- max = _ref.max,
7883
- _ref$size = _ref.size,
7884
- size = _ref$size === void 0 ? 'small' : _ref$size,
7885
- style = _ref.style,
7886
- testID = _ref.testID;
8152
+
8153
+ var Surplus = function Surplus(_ref) {
8154
+ var value = _ref.value,
8155
+ renderSurplus = _ref.renderSurplus,
8156
+ size = _ref.size,
8157
+ _ref$variant = _ref.variant,
8158
+ variant = _ref$variant === void 0 ? 'horizontal' : _ref$variant,
8159
+ index = _ref.index,
8160
+ backgroundColor = _ref.backgroundColor;
8161
+ if (value > 0) {
8162
+ if (renderSurplus) {
8163
+ return /*#__PURE__*/React__default["default"].createElement(StyledSurplusContainer, {
8164
+ testID: "surplus-container",
8165
+ themeSize: size,
8166
+ themeVariant: variant,
8167
+ themeIndex: index,
8168
+ style: {
8169
+ backgroundColor: backgroundColor
8170
+ }
8171
+ }, renderSurplus(value));
8172
+ }
8173
+ return /*#__PURE__*/React__default["default"].createElement(StyledAvatar, {
8174
+ testID: "surplus-container",
8175
+ themeVariant: variant,
8176
+ title: "+".concat(value),
8177
+ size: size,
8178
+ themeIndex: index,
8179
+ style: {
8180
+ backgroundColor: backgroundColor
8181
+ }
8182
+ });
8183
+ }
8184
+ return null;
8185
+ };
8186
+ var AvatarStack = function AvatarStack(_ref2) {
8187
+ var children = _ref2.children,
8188
+ max = _ref2.max,
8189
+ _ref2$size = _ref2.size,
8190
+ size = _ref2$size === void 0 ? 'small' : _ref2$size,
8191
+ style = _ref2.style,
8192
+ testID = _ref2.testID,
8193
+ _ref2$variant = _ref2.variant,
8194
+ variant = _ref2$variant === void 0 ? 'horizontal' : _ref2$variant,
8195
+ total = _ref2.total,
8196
+ renderSurplus = _ref2.renderSurplus;
7887
8197
  var colors = useAvatarColors();
7888
8198
  var avatars = children.slice(0, max);
7889
- if (max !== undefined && children.length - max > 0) {
7890
- var remainingAvatar = /*#__PURE__*/React__default["default"].createElement(Avatar, {
7891
- title: "+".concat(children.length - max),
7892
- size: size
7893
- });
7894
- avatars.push(remainingAvatar);
7895
- }
8199
+ var remainingAvatar = function () {
8200
+ var remain = 0;
8201
+ // Remaining value will prioritize total prop if it exists
8202
+ if (total && total > children.length) {
8203
+ remain = total - avatars.length;
8204
+ } else if (max && children.length > max) {
8205
+ remain = children.length - max;
8206
+ }
8207
+ return remain;
8208
+ }();
7896
8209
  return /*#__PURE__*/React__default["default"].createElement(StyledWrapper$a, {
7897
8210
  themeSize: size,
7898
8211
  themeAvatarCount: avatars.length,
8212
+ themeHasSurplus: remainingAvatar > 0,
7899
8213
  style: style,
7900
- testID: testID
8214
+ testID: testID,
8215
+ themeVariant: variant
7901
8216
  }, avatars.map(function (avt, index) {
7902
- return /*#__PURE__*/React__default["default"].createElement(StyledAvatar, _extends$1({}, avt.props, {
8217
+ return /*#__PURE__*/React__default["default"].createElement(StyledAvatar, _extends$1({
8218
+ themeVariant: variant
8219
+ }, avt.props, {
7903
8220
  size: size,
7904
8221
  themeIndex: index,
7905
8222
  style: {
7906
8223
  backgroundColor: colors[index % colors.length]
7907
8224
  }
7908
8225
  }));
8226
+ }), /*#__PURE__*/React__default["default"].createElement(Surplus, {
8227
+ value: remainingAvatar,
8228
+ index: avatars.length,
8229
+ size: size,
8230
+ variant: variant,
8231
+ renderSurplus: renderSurplus,
8232
+ backgroundColor: colors[avatars.length % colors.length]
7909
8233
  }));
7910
8234
  };
7911
8235
 
@@ -7950,7 +8274,7 @@ var StyledStatus = index$a(reactNative.Animated.View)(function (_ref3) {
7950
8274
  };
7951
8275
  });
7952
8276
 
7953
- var _excluded$t = ["children", "visible", "intent", "style", "testID"];
8277
+ var _excluded$r = ["children", "visible", "intent", "style", "testID"];
7954
8278
  var Status = function Status(_ref) {
7955
8279
  var children = _ref.children,
7956
8280
  _ref$visible = _ref.visible,
@@ -7959,7 +8283,7 @@ var Status = function Status(_ref) {
7959
8283
  intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
7960
8284
  style = _ref.style,
7961
8285
  testID = _ref.testID,
7962
- nativeProps = _objectWithoutProperties(_ref, _excluded$t);
8286
+ nativeProps = _objectWithoutProperties(_ref, _excluded$r);
7963
8287
  var _React$useRef = React__default["default"].useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
7964
8288
  opacity = _React$useRef.current;
7965
8289
  var isFirstRendering = React__default["default"].useRef(true);
@@ -7992,7 +8316,7 @@ var Status = function Status(_ref) {
7992
8316
  }));
7993
8317
  };
7994
8318
 
7995
- var _excluded$s = ["content", "visible", "max", "intent", "style", "testID"];
8319
+ var _excluded$q = ["content", "visible", "max", "intent", "style", "testID"];
7996
8320
  var DEFAULT_MAX_NUMBER = 99;
7997
8321
  var getPaddingState = function getPaddingState(content) {
7998
8322
  return content.length > 1 ? 'wideContent' : 'narrowContent';
@@ -8007,7 +8331,7 @@ var Badge = function Badge(_ref) {
8007
8331
  intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
8008
8332
  style = _ref.style,
8009
8333
  testID = _ref.testID,
8010
- nativeProps = _objectWithoutProperties(_ref, _excluded$s);
8334
+ nativeProps = _objectWithoutProperties(_ref, _excluded$q);
8011
8335
  var _React$useRef = React__default["default"].useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
8012
8336
  opacity = _React$useRef.current;
8013
8337
  var isFirstRendering = React__default["default"].useRef(true);
@@ -8094,24 +8418,7 @@ var StyledBottomBarText = index$a(Typography.Caption)(function (_ref3) {
8094
8418
  };
8095
8419
  });
8096
8420
 
8097
- var isIOS = reactNative.Platform.OS === 'ios';
8098
- var isAndroid = reactNative.Platform.OS === 'android';
8099
- function pick(keys, obj) {
8100
- return keys.filter(function (key) {
8101
- return key in obj;
8102
- }).reduce(function (result, cur) {
8103
- return _objectSpread2(_objectSpread2({}, result), {}, _defineProperty({}, cur, obj[cur]));
8104
- }, {});
8105
- }
8106
- function omit(keys, obj) {
8107
- var result = obj;
8108
- keys.forEach(function (key) {
8109
- delete result[key];
8110
- });
8111
- return result;
8112
- }
8113
-
8114
- var _excluded$r = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
8421
+ var _excluded$p = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
8115
8422
  var getInactiveIcon = function getInactiveIcon(icon) {
8116
8423
  var inactiveIcon = "".concat(icon, "-outlined");
8117
8424
  return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
@@ -8122,7 +8429,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
8122
8429
  renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
8123
8430
  selectedTabKey = _ref.selectedTabKey,
8124
8431
  tabs = _ref.tabs,
8125
- nativeProps = _objectWithoutProperties(_ref, _excluded$r);
8432
+ nativeProps = _objectWithoutProperties(_ref, _excluded$p);
8126
8433
  useDeprecation('BottomNavigation is deprecated and will be removed in the next major release. Please remove it.');
8127
8434
  var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
8128
8435
  /**
@@ -8209,13 +8516,13 @@ var StyledDivider = index$a(reactNative.View)(function (_ref) {
8209
8516
  }, horizontalMargin), verticalMargin);
8210
8517
  });
8211
8518
 
8212
- var _excluded$q = ["marginHorizontal", "marginVertical", "style", "testID"];
8519
+ var _excluded$o = ["marginHorizontal", "marginVertical", "style", "testID"];
8213
8520
  var Divider = function Divider(_ref) {
8214
8521
  var marginHorizontal = _ref.marginHorizontal,
8215
8522
  marginVertical = _ref.marginVertical,
8216
8523
  style = _ref.style,
8217
8524
  testID = _ref.testID,
8218
- nativeProps = _objectWithoutProperties(_ref, _excluded$q);
8525
+ nativeProps = _objectWithoutProperties(_ref, _excluded$o);
8219
8526
  return /*#__PURE__*/React__default["default"].createElement(StyledDivider, _extends$1({}, nativeProps, {
8220
8527
  themeMarginHorizontal: marginHorizontal,
8221
8528
  themeMarginVertical: marginVertical,
@@ -8339,7 +8646,7 @@ var StyledLoadingDot = index$a(reactNative.View)(function (_ref) {
8339
8646
  }, themeStyling());
8340
8647
  });
8341
8648
 
8342
- var _excluded$p = ["count", "size", "testID", "themeVariant"];
8649
+ var _excluded$n = ["count", "size", "testID", "themeVariant"];
8343
8650
  var AnimatedLoadingIndicatorWrapper = reactNative.Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
8344
8651
  var AnimatedLoadingDot = reactNative.Animated.createAnimatedComponent(StyledLoadingDot);
8345
8652
  var renderDotComponent = function renderDotComponent(_ref) {
@@ -8371,7 +8678,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
8371
8678
  size = _ref2$size === void 0 ? 12 : _ref2$size,
8372
8679
  testID = _ref2.testID,
8373
8680
  themeVariant = _ref2.themeVariant,
8374
- nativeProps = _objectWithoutProperties(_ref2, _excluded$p);
8681
+ nativeProps = _objectWithoutProperties(_ref2, _excluded$n);
8375
8682
  var progressAnimation = React.useRef(new reactNative.Animated.Value(0));
8376
8683
  React.useEffect(function () {
8377
8684
  var animation = reactNative.Animated.loop(reactNative.Animated.timing(progressAnimation.current, {
@@ -8813,11 +9120,11 @@ var Header = function Header(_ref) {
8813
9120
  })) : null), showDivider ? /*#__PURE__*/React__default["default"].createElement(Divider, null) : null);
8814
9121
  };
8815
9122
 
8816
- var _excluded$o = ["scrollEventThrottle"];
9123
+ var _excluded$m = ["scrollEventThrottle"];
8817
9124
  var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
8818
9125
  var _ref$scrollEventThrot = _ref.scrollEventThrottle,
8819
9126
  scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
8820
- props = _objectWithoutProperties(_ref, _excluded$o);
9127
+ props = _objectWithoutProperties(_ref, _excluded$m);
8821
9128
  var _useContext = React.useContext(BottomSheetContext),
8822
9129
  setInternalShowDivider = _useContext.setInternalShowDivider;
8823
9130
  var onScrollBeginDrag = React.useCallback(function (e) {
@@ -8938,245 +9245,25 @@ var BottomSheet = function BottomSheet(_ref) {
8938
9245
  style: [style, {
8939
9246
  transform: [{
8940
9247
  scaleY: height > 0 ? 1 : 0
8941
- }, {
8942
- translateY: interpolateY
8943
- }]
8944
- }]
8945
- }, header !== undefined ? /*#__PURE__*/React__default["default"].createElement(Header, {
8946
- content: header,
8947
- showDivider: internalShowDivider,
8948
- onRequestClose: onRequestClose,
8949
- showCloseButton: showCloseButton
8950
- }) : null, /*#__PURE__*/React__default["default"].createElement(BottomSheetContext.Provider, {
8951
- value: BottomSheetContextValue
8952
- }, children), footer ? /*#__PURE__*/React__default["default"].createElement(Footer$1, {
8953
- showDivider: showDivider
8954
- }, footer) : null))));
8955
- };
8956
- var BottomSheet$1 = Object.assign(BottomSheet, {
8957
- ScrollView: BottomSheetScrollView
8958
- });
8959
-
8960
- var colors = {
8961
- backgroundColor: {
8962
- property: 'backgroundColor',
8963
- scale: 'colors'
8964
- },
8965
- bgColor: {
8966
- property: 'backgroundColor',
8967
- scale: 'colors'
8968
- },
8969
- borderColor: {
8970
- property: 'borderColor',
8971
- scale: 'colors'
8972
- },
8973
- borderTopColor: {
8974
- property: 'borderTopColor',
8975
- scale: 'colors'
8976
- },
8977
- borderBottomColor: {
8978
- property: 'borderBottomColor',
8979
- scale: 'colors'
8980
- },
8981
- borderStartColor: {
8982
- property: 'borderStartColor',
8983
- scale: 'colors'
8984
- },
8985
- borderEndColor: {
8986
- property: 'borderEndColor',
8987
- scale: 'colors'
8988
- },
8989
- borderLeftColor: {
8990
- property: 'borderLeftColor',
8991
- scale: 'colors'
8992
- },
8993
- borderRightColor: {
8994
- property: 'borderRightColor',
8995
- scale: 'colors'
8996
- }
8997
- };
8998
- var space = {
8999
- margin: {
9000
- property: 'margin',
9001
- scale: 'space'
9002
- },
9003
- marginBottom: {
9004
- property: 'marginBottom',
9005
- scale: 'space'
9006
- },
9007
- marginEnd: {
9008
- property: 'marginEnd',
9009
- scale: 'space'
9010
- },
9011
- marginHorizontal: {
9012
- property: 'marginHorizontal',
9013
- scale: 'space'
9014
- },
9015
- marginLeft: {
9016
- property: 'marginLeft',
9017
- scale: 'space'
9018
- },
9019
- marginRight: {
9020
- property: 'marginRight',
9021
- scale: 'space'
9022
- },
9023
- marginStart: {
9024
- property: 'marginStart',
9025
- scale: 'space'
9026
- },
9027
- marginTop: {
9028
- property: 'marginTop',
9029
- scale: 'space'
9030
- },
9031
- marginVertical: {
9032
- property: 'marginVertical',
9033
- scale: 'space'
9034
- },
9035
- padding: {
9036
- property: 'padding',
9037
- scale: 'space'
9038
- },
9039
- paddingBottom: {
9040
- property: 'paddingBottom',
9041
- scale: 'space'
9042
- },
9043
- paddingEnd: {
9044
- property: 'paddingEnd',
9045
- scale: 'space'
9046
- },
9047
- paddingHorizontal: {
9048
- property: 'paddingHorizontal',
9049
- scale: 'space'
9050
- },
9051
- paddingLeft: {
9052
- property: 'paddingLeft',
9053
- scale: 'space'
9054
- },
9055
- paddingRight: {
9056
- property: 'paddingRight',
9057
- scale: 'space'
9058
- },
9059
- paddingStart: {
9060
- property: 'paddingStart',
9061
- scale: 'space'
9062
- },
9063
- paddingTop: {
9064
- property: 'paddingTop',
9065
- scale: 'space'
9066
- },
9067
- paddingVertical: {
9068
- property: 'paddingVertical',
9069
- scale: 'space'
9070
- }
9071
- };
9072
- var radii = {
9073
- borderBottomEndRadius: {
9074
- property: 'borderBottomEndRadius',
9075
- scale: 'radii'
9076
- },
9077
- borderBottomLeftRadius: {
9078
- property: 'borderBottomLeftRadius',
9079
- scale: 'radii'
9080
- },
9081
- borderBottomRightRadius: {
9082
- property: 'borderBottomRightRadius',
9083
- scale: 'radii'
9084
- },
9085
- borderBottomStartRadius: {
9086
- property: 'borderBottomStartRadius',
9087
- scale: 'radii'
9088
- },
9089
- borderTopEndRadius: {
9090
- property: 'borderTopEndRadius',
9091
- scale: 'radii'
9092
- },
9093
- borderTopLeftRadius: {
9094
- property: 'borderTopLeftRadius',
9095
- scale: 'radii'
9096
- },
9097
- borderTopRightRadius: {
9098
- property: 'borderTopRightRadius',
9099
- scale: 'radii'
9100
- },
9101
- borderTopStartRadius: {
9102
- property: 'borderTopStartRadius',
9103
- scale: 'radii'
9104
- },
9105
- borderRadius: {
9106
- property: 'borderRadius',
9107
- scale: 'radii'
9108
- }
9109
- };
9110
- var borderWidths = {
9111
- borderWidth: {
9112
- property: 'borderWidth',
9113
- scale: 'borderWidths'
9114
- },
9115
- borderBottomWidth: {
9116
- property: 'borderBottomWidth',
9117
- scale: 'borderWidths'
9118
- },
9119
- borderTopWidth: {
9120
- property: 'borderTopWidth',
9121
- scale: 'borderWidths'
9122
- },
9123
- borderLeftWidth: {
9124
- property: 'borderLeftWidth',
9125
- scale: 'borderWidths'
9126
- },
9127
- borderRightWidth: {
9128
- property: 'borderRightWidth',
9129
- scale: 'borderWidths'
9130
- }
9131
- };
9132
- var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
9133
- var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
9134
-
9135
- var _excluded$n = ["theme"];
9136
- var getThemeValue = function getThemeValue(theme, key, props) {
9137
- var propConfig = config[key];
9138
- var propValue = props[key];
9139
- if (!propValue) return undefined;
9140
- var scale = propConfig.scale,
9141
- property = propConfig.property;
9142
- switch (scale) {
9143
- case 'colors':
9144
- return _defineProperty({}, property, theme.colors[propValue]);
9145
- case 'space':
9146
- return _defineProperty({}, property, theme.space[propValue]);
9147
- case 'radii':
9148
- return _defineProperty({}, property, theme.radii[propValue]);
9149
- case 'borderWidths':
9150
- return _defineProperty({}, property, theme.borderWidths[propValue]);
9151
- }
9152
- };
9153
- var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
9154
- var entries = Object.keys(props);
9155
- return entries.reduce(function (result, key) {
9156
- return _objectSpread2(_objectSpread2({}, result), getThemeValue(theme, key, props));
9157
- }, {});
9248
+ }, {
9249
+ translateY: interpolateY
9250
+ }]
9251
+ }]
9252
+ }, header !== undefined ? /*#__PURE__*/React__default["default"].createElement(Header, {
9253
+ content: header,
9254
+ showDivider: internalShowDivider,
9255
+ onRequestClose: onRequestClose,
9256
+ showCloseButton: showCloseButton
9257
+ }) : null, /*#__PURE__*/React__default["default"].createElement(BottomSheetContext.Provider, {
9258
+ value: BottomSheetContextValue
9259
+ }, children), footer ? /*#__PURE__*/React__default["default"].createElement(Footer$1, {
9260
+ showDivider: showDivider
9261
+ }, footer) : null))));
9158
9262
  };
9159
- var configKeys = Object.keys(config);
9160
- var StyledBox = index$a(reactNative.View)(function (_ref5) {
9161
- var theme = _ref5.theme,
9162
- otherProps = _objectWithoutProperties(_ref5, _excluded$n);
9163
- var styleProps = pick(configKeys, otherProps);
9164
- var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
9165
- return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
9263
+ var BottomSheet$1 = Object.assign(BottomSheet, {
9264
+ ScrollView: BottomSheetScrollView
9166
9265
  });
9167
9266
 
9168
- var _excluded$m = ["children", "style", "testID"];
9169
- var Box = function Box(_ref) {
9170
- var children = _ref.children,
9171
- style = _ref.style,
9172
- testID = _ref.testID,
9173
- otherProps = _objectWithoutProperties(_ref, _excluded$m);
9174
- return /*#__PURE__*/React__default["default"].createElement(StyledBox, _extends$1({}, otherProps, {
9175
- style: style,
9176
- testID: testID
9177
- }), children);
9178
- };
9179
-
9180
9267
  function requiredArgs(required, args) {
9181
9268
  if (args.length < required) {
9182
9269
  throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
@@ -11810,26 +11897,59 @@ var Calendar = function Calendar(_ref) {
11810
11897
  })));
11811
11898
  };
11812
11899
 
11813
- var _excluded$l = ["rounded", "size", "testID", "style"];
11814
- var Image = function Image(_ref) {
11815
- var _ref$rounded = _ref.rounded,
11816
- rounded = _ref$rounded === void 0 ? false : _ref$rounded,
11817
- _ref$size = _ref.size,
11818
- size = _ref$size === void 0 ? '6xlarge' : _ref$size,
11819
- testID = _ref.testID,
11820
- style = _ref.style,
11821
- imageNativeProps = _objectWithoutProperties(_ref, _excluded$l);
11822
- var theme = useTheme();
11823
- var imageSize = theme.__hd__.image.sizes[size];
11824
- return /*#__PURE__*/React__default["default"].createElement(reactNative.Image, _extends$1({
11825
- testID: testID,
11826
- style: [{
11827
- width: imageSize,
11828
- height: imageSize,
11829
- borderRadius: rounded ? imageSize / 2 : 0
11830
- }, style]
11831
- }, imageNativeProps));
11900
+ var StyledDataCard = index$a(reactNative.View)(function (_ref) {
11901
+ var theme = _ref.theme;
11902
+ return {
11903
+ borderRadius: theme.__hd__.card.radii["default"],
11904
+ overflow: 'hidden',
11905
+ flexDirection: 'row'
11906
+ };
11907
+ });
11908
+ var Indicator = index$a(reactNative.View)(function (_ref2) {
11909
+ var theme = _ref2.theme,
11910
+ themeIntent = _ref2.themeIntent;
11911
+ return {
11912
+ backgroundColor: theme.__hd__.card.colors[themeIntent],
11913
+ width: theme.__hd__.card.sizes.indicatorWidth,
11914
+ height: '100%'
11915
+ };
11916
+ });
11917
+
11918
+ var _excluded$l = ["intent", "children"];
11919
+ var DataCard = function DataCard(_ref) {
11920
+ var _ref$intent = _ref.intent,
11921
+ intent = _ref$intent === void 0 ? 'info' : _ref$intent,
11922
+ children = _ref.children,
11923
+ nativeProps = _objectWithoutProperties(_ref, _excluded$l);
11924
+ return /*#__PURE__*/React__default["default"].createElement(StyledDataCard, nativeProps, /*#__PURE__*/React__default["default"].createElement(Indicator, {
11925
+ themeIntent: intent,
11926
+ testID: "data-card-indicator"
11927
+ }), children);
11928
+ };
11929
+
11930
+ var StyledCard$1 = index$a(reactNative.View)(function (_ref) {
11931
+ var theme = _ref.theme,
11932
+ themeIntent = _ref.themeIntent;
11933
+ return _objectSpread2(_objectSpread2({}, themeIntent !== undefined && {
11934
+ backgroundColor: theme.__hd__.card.colors[themeIntent]
11935
+ }), {}, {
11936
+ borderRadius: theme.__hd__.card.radii["default"],
11937
+ overflow: 'hidden'
11938
+ });
11939
+ });
11940
+
11941
+ var _excluded$k = ["intent", "children"];
11942
+ var Card = function Card(_ref) {
11943
+ var intent = _ref.intent,
11944
+ children = _ref.children,
11945
+ nativeProps = _objectWithoutProperties(_ref, _excluded$k);
11946
+ return /*#__PURE__*/React__default["default"].createElement(StyledCard$1, _extends$1({}, nativeProps, {
11947
+ themeIntent: intent
11948
+ }), children);
11832
11949
  };
11950
+ var Card$1 = Object.assign(Card, {
11951
+ Data: DataCard
11952
+ });
11833
11953
 
11834
11954
  var StyledPageControl$2 = index$a(reactNative.View)(function () {
11835
11955
  return {
@@ -11884,172 +12004,11 @@ var PageControl = function PageControl(_ref) {
11884
12004
  }],
11885
12005
  key: index.toString(),
11886
12006
  testID: "page-control-indicator".concat(index)
11887
- });
11888
- }));
11889
- };
11890
-
11891
- var StyledBackDrop = index$a(reactNative.View)(function (_ref) {
11892
- var themeSlideBackground = _ref.themeSlideBackground;
11893
- return {
11894
- position: 'absolute',
11895
- backgroundColor: themeSlideBackground,
11896
- top: 0,
11897
- bottom: 0,
11898
- right: 0,
11899
- left: 0
11900
- };
11901
- });
11902
- var StyledCarouselView = index$a(reactNative.View)(function () {
11903
- return {
11904
- flexGrow: 2,
11905
- justifyContent: 'space-between'
11906
- };
11907
- });
11908
- var StyledCarouselHeading = index$a(Typography.Title)(function (_ref2) {
11909
- var theme = _ref2.theme;
11910
- return {
11911
- marginTop: theme.__hd__.carousel.space.headingMarginTop,
11912
- marginBottom: theme.__hd__.carousel.space.headingMarginBottom
11913
- };
11914
- });
11915
- var StyledCarouselImage = index$a(Image)(function () {
11916
- return {
11917
- flexGrow: 2,
11918
- flex: 1,
11919
- width: '100%',
11920
- resizeMode: 'contain'
11921
- };
11922
- });
11923
- var StyledCustomSizeCarouselImage = index$a(Image)(function (_ref3) {
11924
- var height = _ref3.height,
11925
- _ref3$resizeMode = _ref3.resizeMode,
11926
- resizeMode = _ref3$resizeMode === void 0 ? 'contain' : _ref3$resizeMode,
11927
- width = _ref3.width;
11928
- return {
11929
- alignSelf: 'center',
11930
- width: width,
11931
- height: height,
11932
- resizeMode: resizeMode
11933
- };
11934
- });
11935
- var StyledCarouselContentWrapper = index$a(Box)(function (_ref4) {
11936
- var width = _ref4.width;
11937
- return {
11938
- width: width
11939
- };
11940
- });
11941
- var StyledCarouselFooterWrapper = index$a(reactNative.View)(function (_ref5) {
11942
- var theme = _ref5.theme;
11943
- return {
11944
- paddingHorizontal: theme.__hd__.carousel.space.footerPaddingHorizontal,
11945
- flexDirection: 'row',
11946
- justifyContent: 'space-between',
11947
- paddingVertical: theme.__hd__.carousel.space.footerPaddingVertical,
11948
- marginBottom: theme.__hd__.carousel.space.footerMarginBottom
11949
- };
11950
- });
11951
- var StyledPageControl$1 = index$a(PageControl)(function (_ref6) {
11952
- var theme = _ref6.theme;
11953
- return {
11954
- paddingVertical: theme.__hd__.carousel.space.pageControlPaddingVertical
11955
- };
11956
- });
11957
- var StyledPageControlWrapper = index$a(reactNative.View)(function (_ref7) {
11958
- var theme = _ref7.theme;
11959
- return {
11960
- alignItems: 'center',
11961
- justifyContent: 'center',
11962
- height: theme.__hd__.carousel.space.pageControlWrapperHeight
11963
- };
11964
- });
11965
-
11966
- function isCarouselImageProps(image) {
11967
- return _typeof(image) === 'object';
11968
- }
11969
- var CarouselItem = function CarouselItem(_ref) {
11970
- var width = _ref.width,
11971
- image = _ref.image,
11972
- content = _ref.content,
11973
- heading = _ref.heading,
11974
- body = _ref.body;
11975
- return /*#__PURE__*/React__default["default"].createElement(Box, {
11976
- style: {
11977
- width: width
11978
- }
11979
- }, image && (isCarouselImageProps(image) ? /*#__PURE__*/React__default["default"].createElement(StyledCustomSizeCarouselImage, {
11980
- source: image,
11981
- height: image.height,
11982
- width: image.width,
11983
- resizeMode: image.resizeMode
11984
- }) : /*#__PURE__*/React__default["default"].createElement(StyledCarouselImage, {
11985
- source: typeof image === 'string' ? {
11986
- uri: image
11987
- } : image
11988
- })), /*#__PURE__*/React__default["default"].createElement(StyledCarouselContentWrapper, {
11989
- paddingHorizontal: "large",
11990
- marginTop: "large",
11991
- width: width
11992
- }, content, /*#__PURE__*/React__default["default"].createElement(StyledCarouselHeading, {
11993
- level: "h1",
11994
- typeface: "playful"
11995
- }, heading), body ? /*#__PURE__*/React__default["default"].createElement(Typography.Body, null, body) : null));
11996
- };
11997
-
11998
- var StyledDataCard = index$a(reactNative.View)(function (_ref) {
11999
- var theme = _ref.theme;
12000
- return {
12001
- borderRadius: theme.__hd__.card.radii["default"],
12002
- overflow: 'hidden',
12003
- flexDirection: 'row'
12004
- };
12005
- });
12006
- var Indicator = index$a(reactNative.View)(function (_ref2) {
12007
- var theme = _ref2.theme,
12008
- themeIntent = _ref2.themeIntent;
12009
- return {
12010
- backgroundColor: theme.__hd__.card.colors[themeIntent],
12011
- width: theme.__hd__.card.sizes.indicatorWidth,
12012
- height: '100%'
12013
- };
12014
- });
12015
-
12016
- var _excluded$k = ["intent", "children"];
12017
- var DataCard = function DataCard(_ref) {
12018
- var _ref$intent = _ref.intent,
12019
- intent = _ref$intent === void 0 ? 'info' : _ref$intent,
12020
- children = _ref.children,
12021
- nativeProps = _objectWithoutProperties(_ref, _excluded$k);
12022
- return /*#__PURE__*/React__default["default"].createElement(StyledDataCard, nativeProps, /*#__PURE__*/React__default["default"].createElement(Indicator, {
12023
- themeIntent: intent,
12024
- testID: "data-card-indicator"
12025
- }), children);
12026
- };
12027
-
12028
- var StyledCard$1 = index$a(reactNative.View)(function (_ref) {
12029
- var theme = _ref.theme,
12030
- themeIntent = _ref.themeIntent;
12031
- return _objectSpread2(_objectSpread2({}, themeIntent !== undefined && {
12032
- backgroundColor: theme.__hd__.card.colors[themeIntent]
12033
- }), {}, {
12034
- borderRadius: theme.__hd__.card.radii["default"],
12035
- overflow: 'hidden'
12036
- });
12037
- });
12038
-
12039
- var _excluded$j = ["intent", "children"];
12040
- var Card = function Card(_ref) {
12041
- var intent = _ref.intent,
12042
- children = _ref.children,
12043
- nativeProps = _objectWithoutProperties(_ref, _excluded$j);
12044
- return /*#__PURE__*/React__default["default"].createElement(StyledCard$1, _extends$1({}, nativeProps, {
12045
- themeIntent: intent
12046
- }), children);
12007
+ });
12008
+ }));
12047
12009
  };
12048
- var Card$1 = Object.assign(Card, {
12049
- Data: DataCard
12050
- });
12051
12010
 
12052
- var StyledPageControl = index$a(PageControl)(function (_ref) {
12011
+ var StyledPageControl$1 = index$a(PageControl)(function (_ref) {
12053
12012
  var theme = _ref.theme;
12054
12013
  return {
12055
12014
  alignSelf: 'center',
@@ -12249,7 +12208,7 @@ var CardCarousel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
12249
12208
  viewabilityConfig: {
12250
12209
  itemVisiblePercentThreshold: 80
12251
12210
  }
12252
- }), !hidePageControl && /*#__PURE__*/React__default["default"].createElement(StyledPageControl, {
12211
+ }), !hidePageControl && /*#__PURE__*/React__default["default"].createElement(StyledPageControl$1, {
12253
12212
  testID: "pageControl",
12254
12213
  currentPage: currentIndex,
12255
12214
  numberOfPages: items.length
@@ -12257,6 +12216,134 @@ var CardCarousel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
12257
12216
  });
12258
12217
  CardCarousel.displayName = 'CardCarousel';
12259
12218
 
12219
+ var _excluded$j = ["rounded", "size", "testID", "style"];
12220
+ var Image = function Image(_ref) {
12221
+ var _ref$rounded = _ref.rounded,
12222
+ rounded = _ref$rounded === void 0 ? false : _ref$rounded,
12223
+ _ref$size = _ref.size,
12224
+ size = _ref$size === void 0 ? '6xlarge' : _ref$size,
12225
+ testID = _ref.testID,
12226
+ style = _ref.style,
12227
+ imageNativeProps = _objectWithoutProperties(_ref, _excluded$j);
12228
+ var theme = useTheme();
12229
+ var imageSize = theme.__hd__.image.sizes[size];
12230
+ return /*#__PURE__*/React__default["default"].createElement(reactNative.Image, _extends$1({
12231
+ testID: testID,
12232
+ style: [{
12233
+ width: imageSize,
12234
+ height: imageSize,
12235
+ borderRadius: rounded ? imageSize / 2 : 0
12236
+ }, style]
12237
+ }, imageNativeProps));
12238
+ };
12239
+
12240
+ var StyledBackDrop = index$a(reactNative.View)(function (_ref) {
12241
+ var themeSlideBackground = _ref.themeSlideBackground;
12242
+ return {
12243
+ position: 'absolute',
12244
+ backgroundColor: themeSlideBackground,
12245
+ top: 0,
12246
+ bottom: 0,
12247
+ right: 0,
12248
+ left: 0
12249
+ };
12250
+ });
12251
+ var StyledCarouselView = index$a(reactNative.View)(function () {
12252
+ return {
12253
+ flexGrow: 2,
12254
+ justifyContent: 'space-between'
12255
+ };
12256
+ });
12257
+ var StyledCarouselHeading = index$a(Typography.Title)(function (_ref2) {
12258
+ var theme = _ref2.theme;
12259
+ return {
12260
+ marginTop: theme.__hd__.carousel.space.headingMarginTop,
12261
+ marginBottom: theme.__hd__.carousel.space.headingMarginBottom
12262
+ };
12263
+ });
12264
+ var StyledCarouselImage = index$a(Image)(function () {
12265
+ return {
12266
+ flexGrow: 2,
12267
+ flex: 1,
12268
+ width: '100%',
12269
+ resizeMode: 'contain'
12270
+ };
12271
+ });
12272
+ var StyledCustomSizeCarouselImage = index$a(Image)(function (_ref3) {
12273
+ var height = _ref3.height,
12274
+ _ref3$resizeMode = _ref3.resizeMode,
12275
+ resizeMode = _ref3$resizeMode === void 0 ? 'contain' : _ref3$resizeMode,
12276
+ width = _ref3.width;
12277
+ return {
12278
+ alignSelf: 'center',
12279
+ width: width,
12280
+ height: height,
12281
+ resizeMode: resizeMode
12282
+ };
12283
+ });
12284
+ var StyledCarouselContentWrapper = index$a(Box)(function (_ref4) {
12285
+ var width = _ref4.width;
12286
+ return {
12287
+ width: width
12288
+ };
12289
+ });
12290
+ var StyledCarouselFooterWrapper = index$a(reactNative.View)(function (_ref5) {
12291
+ var theme = _ref5.theme;
12292
+ return {
12293
+ paddingHorizontal: theme.__hd__.carousel.space.footerPaddingHorizontal,
12294
+ flexDirection: 'row',
12295
+ justifyContent: 'space-between',
12296
+ paddingVertical: theme.__hd__.carousel.space.footerPaddingVertical,
12297
+ marginBottom: theme.__hd__.carousel.space.footerMarginBottom
12298
+ };
12299
+ });
12300
+ var StyledPageControl = index$a(PageControl)(function (_ref6) {
12301
+ var theme = _ref6.theme;
12302
+ return {
12303
+ paddingVertical: theme.__hd__.carousel.space.pageControlPaddingVertical
12304
+ };
12305
+ });
12306
+ var StyledPageControlWrapper = index$a(reactNative.View)(function (_ref7) {
12307
+ var theme = _ref7.theme;
12308
+ return {
12309
+ alignItems: 'center',
12310
+ justifyContent: 'center',
12311
+ height: theme.__hd__.carousel.space.pageControlWrapperHeight
12312
+ };
12313
+ });
12314
+
12315
+ function isCarouselImageProps(image) {
12316
+ return _typeof(image) === 'object';
12317
+ }
12318
+ var CarouselItem = function CarouselItem(_ref) {
12319
+ var width = _ref.width,
12320
+ image = _ref.image,
12321
+ content = _ref.content,
12322
+ heading = _ref.heading,
12323
+ body = _ref.body;
12324
+ return /*#__PURE__*/React__default["default"].createElement(Box, {
12325
+ style: {
12326
+ width: width
12327
+ }
12328
+ }, image && (isCarouselImageProps(image) ? /*#__PURE__*/React__default["default"].createElement(StyledCustomSizeCarouselImage, {
12329
+ source: image,
12330
+ height: image.height,
12331
+ width: image.width,
12332
+ resizeMode: image.resizeMode
12333
+ }) : /*#__PURE__*/React__default["default"].createElement(StyledCarouselImage, {
12334
+ source: typeof image === 'string' ? {
12335
+ uri: image
12336
+ } : image
12337
+ })), /*#__PURE__*/React__default["default"].createElement(StyledCarouselContentWrapper, {
12338
+ paddingHorizontal: "large",
12339
+ marginTop: "large",
12340
+ width: width
12341
+ }, content, /*#__PURE__*/React__default["default"].createElement(StyledCarouselHeading, {
12342
+ level: "h1",
12343
+ typeface: "playful"
12344
+ }, heading), body ? /*#__PURE__*/React__default["default"].createElement(Typography.Body, null, body) : null));
12345
+ };
12346
+
12260
12347
  var _excluded$i = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
12261
12348
  function useStateFromProp(initialValue) {
12262
12349
  var _useState = React.useState(initialValue),
@@ -12272,6 +12359,7 @@ var noop = function noop(_) {
12272
12359
  return true;
12273
12360
  };
12274
12361
  var Carousel = function Carousel(_ref) {
12362
+ var _items$currentSlideIn;
12275
12363
  var items = _ref.items,
12276
12364
  onItemIndexChange = _ref.onItemIndexChange,
12277
12365
  renderActions = _ref.renderActions,
@@ -12286,6 +12374,7 @@ var Carousel = function Carousel(_ref) {
12286
12374
  nativeProps = _objectWithoutProperties(_ref, _excluded$i);
12287
12375
  useDeprecation("shouldShowPagination prop has been deprecated", shouldShowPagination !== noop);
12288
12376
  useDeprecation("The use of 'pageControlPosition == bottom' has been deprecated", pageControlPosition === 'bottom');
12377
+ var theme = useTheme();
12289
12378
  var carouselRef = React.useRef(null);
12290
12379
  var _useStateFromProp = useStateFromProp(selectedItemIndex),
12291
12380
  _useStateFromProp2 = _slicedToArray(_useStateFromProp, 2),
@@ -12317,20 +12406,20 @@ var Carousel = function Carousel(_ref) {
12317
12406
  var viewConfig = React.useRef({
12318
12407
  viewAreaCoveragePercentThreshold: 50
12319
12408
  }).current;
12320
- var onViewCallBack = React__default["default"].useCallback(function (info) {
12409
+ var onViewCallBack = React.useRef(function (info) {
12321
12410
  var firstVisibleItem = info.viewableItems.find(function (view) {
12322
12411
  return view.index != null && view.isViewable;
12323
12412
  });
12324
12413
  if (firstVisibleItem) {
12325
12414
  internalOnItemIndexChange(firstVisibleItem.index || 0);
12326
12415
  }
12327
- }, [internalOnItemIndexChange]);
12416
+ });
12328
12417
  return /*#__PURE__*/React__default["default"].createElement(reactNative.View, _extends$1({
12329
12418
  style: style,
12330
12419
  testID: testID
12331
12420
  }, nativeProps), /*#__PURE__*/React__default["default"].createElement(StyledBackDrop, {
12332
- themeSlideBackground: items[currentSlideIndex].background
12333
- }), /*#__PURE__*/React__default["default"].createElement(StyledPageControlWrapper, null, pageControlPosition === 'top' && shouldShowPagination(currentSlideIndex) && /*#__PURE__*/React__default["default"].createElement(StyledPageControl$1, {
12421
+ themeSlideBackground: ((_items$currentSlideIn = items[currentSlideIndex]) === null || _items$currentSlideIn === void 0 ? void 0 : _items$currentSlideIn.background) || theme.colors.defaultGlobalSurface
12422
+ }), /*#__PURE__*/React__default["default"].createElement(StyledPageControlWrapper, null, pageControlPosition === 'top' && shouldShowPagination(currentSlideIndex) && /*#__PURE__*/React__default["default"].createElement(StyledPageControl, {
12334
12423
  numberOfPages: items.length,
12335
12424
  currentPage: currentSlideIndex
12336
12425
  })), /*#__PURE__*/React__default["default"].createElement(StyledCarouselView, null, /*#__PURE__*/React__default["default"].createElement(reactNative.FlatList, {
@@ -12340,7 +12429,7 @@ var Carousel = function Carousel(_ref) {
12340
12429
  pagingEnabled: true,
12341
12430
  bounces: false,
12342
12431
  data: items,
12343
- onViewableItemsChanged: onViewCallBack,
12432
+ onViewableItemsChanged: onViewCallBack.current,
12344
12433
  viewabilityConfig: viewConfig,
12345
12434
  scrollEventThrottle: 32,
12346
12435
  ref: carouselRef,
@@ -12368,7 +12457,7 @@ var Carousel = function Carousel(_ref) {
12368
12457
  width: width
12369
12458
  });
12370
12459
  }
12371
- }), /*#__PURE__*/React__default["default"].createElement(StyledCarouselFooterWrapper, null, renderActions && renderActions(currentSlideIndex), pageControlPosition === 'bottom' && shouldShowPagination(currentSlideIndex) && /*#__PURE__*/React__default["default"].createElement(StyledPageControl$1, {
12460
+ }), /*#__PURE__*/React__default["default"].createElement(StyledCarouselFooterWrapper, null, renderActions && renderActions(currentSlideIndex), pageControlPosition === 'bottom' && shouldShowPagination(currentSlideIndex) && /*#__PURE__*/React__default["default"].createElement(StyledPageControl, {
12372
12461
  numberOfPages: items.length,
12373
12462
  currentPage: currentSlideIndex
12374
12463
  }))));
@@ -12459,7 +12548,7 @@ var StyledIconWrapper$3 = index$a(Box)(function (_ref2) {
12459
12548
  marginRight: theme.__hd__.chip.space.iconWrapperMarginRight
12460
12549
  };
12461
12550
  });
12462
- var StyledLabel$1 = index$a(Typography.Body)(function (_ref3) {
12551
+ var StyledLabel = index$a(Typography.Body)(function (_ref3) {
12463
12552
  var themeSelected = _ref3.themeSelected,
12464
12553
  themeVariant = _ref3.themeVariant,
12465
12554
  theme = _ref3.theme;
@@ -12505,7 +12594,7 @@ var Chip = function Chip(_ref) {
12505
12594
  themeSelected: selected,
12506
12595
  themeVariant: variant,
12507
12596
  testID: "chip-icon-".concat(internalIcon)
12508
- })), /*#__PURE__*/React__default["default"].createElement(StyledLabel$1, {
12597
+ })), /*#__PURE__*/React__default["default"].createElement(StyledLabel, {
12509
12598
  variant: "small",
12510
12599
  themeVariant: variant,
12511
12600
  themeSelected: selected
@@ -12611,45 +12700,23 @@ var StyledContainer$4 = index$a(reactNative.View)(function (_ref) {
12611
12700
  marginTop: theme.__hd__.textInput.space.containerMarginTop
12612
12701
  };
12613
12702
  });
12614
- var StyledLabelContainer = index$a(reactNative.View)(function (_ref2) {
12615
- var theme = _ref2.theme;
12703
+ var StyledLabelContainerInsideTextInput = index$a(reactNative.Animated.View)(function (_ref2) {
12704
+ var themeVariant = _ref2.themeVariant,
12705
+ theme = _ref2.theme;
12616
12706
  return {
12617
- position: 'absolute',
12618
12707
  flexDirection: 'row',
12619
- left: theme.__hd__.textInput.space.labelLeft,
12620
- top: theme.__hd__.textInput.space.labelTop,
12621
- backgroundColor: theme.__hd__.textInput.colors.labelBackground,
12708
+ alignItems: themeVariant === 'text' ? 'center' : 'flex-start',
12709
+ justifyContent: 'center',
12710
+ position: 'absolute',
12622
12711
  zIndex: 1,
12623
- paddingHorizontal: theme.__hd__.textInput.space.labelHorizontalPadding
12712
+ left: 0,
12713
+ right: 0,
12714
+ top: -theme.__hd__.textInput.space.labelTop
12624
12715
  };
12625
12716
  });
12626
- var StyledLabel = index$a(Typography.Caption)(function (_ref3) {
12717
+ var StyledLabelInsideTextInput = index$a(Typography.Body)(function (_ref3) {
12627
12718
  var theme = _ref3.theme,
12628
12719
  themeState = _ref3.themeState;
12629
- return {
12630
- color: theme.__hd__.textInput.colors.labels[themeState],
12631
- lineHeight: theme.__hd__.textInput.lineHeights.topLabel
12632
- };
12633
- });
12634
- var StyledAsteriskLabel = index$a(Typography.Caption)(function (_ref4) {
12635
- var theme = _ref4.theme,
12636
- themeState = _ref4.themeState;
12637
- return {
12638
- color: theme.__hd__.textInput.colors.asterisks[themeState],
12639
- lineHeight: theme.__hd__.textInput.lineHeights.topLabel
12640
- };
12641
- });
12642
- var StyledLabelContainerInsideTextInput = index$a(reactNative.View)(function (_ref5) {
12643
- var themeVariant = _ref5.themeVariant;
12644
- return _objectSpread2({
12645
- flexDirection: 'row',
12646
- zIndex: 9999,
12647
- alignItems: themeVariant === 'text' ? 'center' : 'flex-start'
12648
- }, reactNative.StyleSheet.absoluteFillObject);
12649
- });
12650
- var StyledLabelInsideTextInput = index$a(Typography.Body)(function (_ref6) {
12651
- var theme = _ref6.theme,
12652
- themeState = _ref6.themeState;
12653
12720
  return {
12654
12721
  textAlignVertical: 'center',
12655
12722
  alignContent: 'center',
@@ -12658,15 +12725,15 @@ var StyledLabelInsideTextInput = index$a(Typography.Body)(function (_ref6) {
12658
12725
  marginTop: theme.__hd__.textInput.space.labelInsideTextInputMarginTop
12659
12726
  };
12660
12727
  });
12661
- var StyledAsteriskLabelInsideTextInput = index$a(Typography.Body)(function (_ref7) {
12662
- var theme = _ref7.theme,
12663
- themeState = _ref7.themeState;
12728
+ var StyledAsteriskLabelInsideTextInput = index$a(Typography.Body)(function (_ref4) {
12729
+ var theme = _ref4.theme,
12730
+ themeState = _ref4.themeState;
12664
12731
  return {
12665
12732
  color: theme.__hd__.textInput.colors.asterisks[themeState]
12666
12733
  };
12667
12734
  });
12668
- var StyledErrorContainer$2 = index$a(reactNative.View)(function (_ref8) {
12669
- var theme = _ref8.theme;
12735
+ var StyledErrorContainer$2 = index$a(reactNative.View)(function (_ref5) {
12736
+ var theme = _ref5.theme;
12670
12737
  return {
12671
12738
  marginRight: theme.__hd__.textInput.space.errorContainerMarginRight,
12672
12739
  flexDirection: 'row',
@@ -12675,16 +12742,16 @@ var StyledErrorContainer$2 = index$a(reactNative.View)(function (_ref8) {
12675
12742
  flexGrow: 4
12676
12743
  };
12677
12744
  });
12678
- var StyledError = index$a(Typography.Caption)(function (_ref9) {
12679
- var theme = _ref9.theme;
12745
+ var StyledError = index$a(Typography.Caption)(function (_ref6) {
12746
+ var theme = _ref6.theme;
12680
12747
  return {
12681
12748
  color: theme.__hd__.textInput.colors.error,
12682
12749
  marginLeft: theme.__hd__.textInput.space.errorMarginLeft
12683
12750
  };
12684
12751
  });
12685
- var StyledMaxLengthMessage = index$a(Typography.Caption)(function (_ref10) {
12686
- var theme = _ref10.theme,
12687
- themeState = _ref10.themeState;
12752
+ var StyledMaxLengthMessage = index$a(Typography.Caption)(function (_ref7) {
12753
+ var theme = _ref7.theme,
12754
+ themeState = _ref7.themeState;
12688
12755
  return {
12689
12756
  color: theme.__hd__.textInput.colors.maxLengthLabels[themeState],
12690
12757
  marginRight: theme.__hd__.textInput.space.maxLengthLabelMarginLeft,
@@ -12695,9 +12762,9 @@ var StyledMaxLengthMessage = index$a(Typography.Caption)(function (_ref10) {
12695
12762
  };
12696
12763
  });
12697
12764
  var StyledHelperText = Typography.Caption;
12698
- var StyledTextInput = index$a(reactNative.TextInput)(function (_ref11) {
12699
- var theme = _ref11.theme,
12700
- themeVariant = _ref11.themeVariant;
12765
+ var StyledTextInput = index$a(reactNative.TextInput)(function (_ref8) {
12766
+ var theme = _ref8.theme,
12767
+ themeVariant = _ref8.themeVariant;
12701
12768
  return {
12702
12769
  textAlignVertical: themeVariant === 'text' ? 'center' : 'top',
12703
12770
  fontSize: theme.__hd__.textInput.fontSizes.text,
@@ -12710,19 +12777,19 @@ var StyledTextInput = index$a(reactNative.TextInput)(function (_ref11) {
12710
12777
  fontFamily: theme.__hd__.textInput.fonts.text
12711
12778
  };
12712
12779
  });
12713
- var StyledBorderBackDrop = index$a(reactNative.View)(function (_ref12) {
12780
+ var StyledBorderBackDrop = index$a(reactNative.View)(function (_ref9) {
12714
12781
  var _theme$__hd__$textInp;
12715
- var theme = _ref12.theme,
12716
- themeFocused = _ref12.themeFocused,
12717
- themeState = _ref12.themeState;
12782
+ var theme = _ref9.theme,
12783
+ themeFocused = _ref9.themeFocused,
12784
+ themeState = _ref9.themeState;
12718
12785
  return _objectSpread2(_objectSpread2({}, reactNative.StyleSheet.absoluteFillObject), {}, {
12719
12786
  borderWidth: themeFocused ? theme.__hd__.textInput.borderWidths.container.focused : theme.__hd__.textInput.borderWidths.container.normal,
12720
12787
  borderRadius: theme.__hd__.textInput.radii.container,
12721
12788
  borderColor: (_theme$__hd__$textInp = theme.__hd__.textInput.colors.borders[themeState]) !== null && _theme$__hd__$textInp !== void 0 ? _theme$__hd__$textInp : theme.__hd__.textInput.colors.borders["default"]
12722
12789
  });
12723
12790
  });
12724
- var StyledTextInputContainer = index$a(reactNative.View)(function (_ref13) {
12725
- var theme = _ref13.theme;
12791
+ var StyledTextInputContainer = index$a(reactNative.View)(function (_ref10) {
12792
+ var theme = _ref10.theme;
12726
12793
  return {
12727
12794
  flexDirection: 'row',
12728
12795
  alignItems: 'center',
@@ -12740,8 +12807,8 @@ var StyledTextInputAndLabelContainer = index$a(reactNative.View)(function () {
12740
12807
  flexShrink: 1
12741
12808
  };
12742
12809
  });
12743
- var StyledErrorAndHelpTextContainer = index$a(reactNative.View)(function (_ref14) {
12744
- var theme = _ref14.theme;
12810
+ var StyledErrorAndHelpTextContainer = index$a(reactNative.View)(function (_ref11) {
12811
+ var theme = _ref11.theme;
12745
12812
  return {
12746
12813
  paddingLeft: theme.__hd__.textInput.space.errorAndHelpTextContainerPaddingLeft,
12747
12814
  minHeight: theme.__hd__.textInput.sizes.errorAndHelpTextContainerHeight,
@@ -12779,6 +12846,7 @@ var getState$1 = function getState(_ref) {
12779
12846
  // Fix issue: Placeholder is not shown on iOS when multiline is true
12780
12847
  // https://github.com/callstack/react-native-paper/pull/3331
12781
12848
  var EMPTY_PLACEHOLDER_VALUE = ' ';
12849
+ var LABEL_ANIMATION_DURATION = 150;
12782
12850
  var TextInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
12783
12851
  var _ref3;
12784
12852
  var label = _ref2.label,
@@ -12811,10 +12879,25 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
12811
12879
  var displayText = (_ref3 = value !== undefined ? value : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
12812
12880
  var isEmptyValue = displayText.length === 0;
12813
12881
  var actualSuffix = loading ? 'loading' : suffix;
12814
- var _React$useState = React__default["default"].useState(false),
12882
+ var _React$useState = React__default["default"].useState({
12883
+ height: 0,
12884
+ width: 0
12885
+ }),
12815
12886
  _React$useState2 = _slicedToArray(_React$useState, 2),
12816
- isFocused = _React$useState2[0],
12817
- setIsFocused = _React$useState2[1];
12887
+ inputSize = _React$useState2[0],
12888
+ setInputSize = _React$useState2[1];
12889
+ var _React$useState3 = React__default["default"].useState(0),
12890
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
12891
+ labelWidth = _React$useState4[0],
12892
+ setLabelWidth = _React$useState4[1];
12893
+ var _React$useState5 = React__default["default"].useState(0),
12894
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
12895
+ prefixWidth = _React$useState6[0],
12896
+ setPrefixWidth = _React$useState6[1];
12897
+ var _React$useState7 = React__default["default"].useState(false),
12898
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
12899
+ isFocused = _React$useState8[0],
12900
+ setIsFocused = _React$useState8[1];
12818
12901
  var state = getState$1({
12819
12902
  disabled: disabled,
12820
12903
  error: error,
@@ -12825,6 +12908,34 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
12825
12908
  });
12826
12909
  var shouldShowMaxLength = maxLength !== undefined && !hideCharacterCount;
12827
12910
  var theme = useTheme();
12911
+ var focusAnimation = React.useRef(new reactNative.Animated.Value(0)).current;
12912
+ React.useEffect(function () {
12913
+ reactNative.Animated.timing(focusAnimation, {
12914
+ toValue: isFocused || !isEmptyValue ? 1 : 0,
12915
+ duration: LABEL_ANIMATION_DURATION,
12916
+ easing: reactNative.Easing.bezier(0.4, 0, 0.2, 1),
12917
+ useNativeDriver: true
12918
+ }).start();
12919
+ }, [focusAnimation, isEmptyValue, isFocused]);
12920
+ var onLayout = React.useCallback(function (event) {
12921
+ var _event$nativeEvent$la = event.nativeEvent.layout,
12922
+ height = _event$nativeEvent$la.height,
12923
+ width = _event$nativeEvent$la.width;
12924
+ setInputSize(function (prev) {
12925
+ return _objectSpread2(_objectSpread2({}, prev), {}, {
12926
+ height: height,
12927
+ width: width
12928
+ });
12929
+ });
12930
+ }, []);
12931
+ var onPrefixLayout = React.useCallback(function (event) {
12932
+ var width = event.nativeEvent.layout.width;
12933
+ setPrefixWidth(width);
12934
+ }, []);
12935
+ var onLabelLayout = React.useCallback(function (event) {
12936
+ var width = event.nativeEvent.layout.width;
12937
+ setLabelWidth(width);
12938
+ }, []);
12828
12939
  var innerTextInput = React__default["default"].useRef();
12829
12940
  React__default["default"].useImperativeHandle(ref, function () {
12830
12941
  return {
@@ -12922,43 +13033,60 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
12922
13033
  style: styleWithoutBackgroundColor,
12923
13034
  pointerEvents: state === 'disabled' || state === 'readonly' ? 'none' : 'auto',
12924
13035
  testID: testID
12925
- }, /*#__PURE__*/React__default["default"].createElement(StyledTextInputContainer, null, /*#__PURE__*/React__default["default"].createElement(StyledBorderBackDrop, {
13036
+ }, /*#__PURE__*/React__default["default"].createElement(StyledTextInputContainer, {
13037
+ onLayout: onLayout
13038
+ }, /*#__PURE__*/React__default["default"].createElement(StyledBorderBackDrop, {
12926
13039
  themeFocused: isFocused,
12927
13040
  themeState: state,
12928
13041
  testID: "text-input-border",
12929
13042
  style: [{
12930
13043
  backgroundColor: backgroundColor
12931
13044
  }, borderStyle]
12932
- }), (isFocused || label && !isEmptyValue) && /*#__PURE__*/React__default["default"].createElement(StyledLabelContainer, {
12933
- pointerEvents: "none",
12934
- testID: "label-container",
12935
- style: {
12936
- backgroundColor: backgroundColor
12937
- }
12938
- }, required && /*#__PURE__*/React__default["default"].createElement(StyledAsteriskLabel, {
12939
- themeState: state
12940
- }, "*"), !!label && /*#__PURE__*/React__default["default"].createElement(StyledLabel, {
12941
- nativeID: accessibilityLabelledBy,
12942
- testID: "input-label",
12943
- themeState: state,
12944
- style: {
12945
- backgroundColor: backgroundColor
12946
- }
12947
- }, label)), typeof prefix === 'string' ? /*#__PURE__*/React__default["default"].createElement(Icon, {
13045
+ }), /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
13046
+ onLayout: onPrefixLayout
13047
+ }, typeof prefix === 'string' ? /*#__PURE__*/React__default["default"].createElement(Icon, {
12948
13048
  intent: state === 'disabled' ? 'disabled-text' : 'text',
12949
13049
  testID: "input-prefix",
12950
13050
  icon: prefix,
12951
13051
  size: "xsmall"
12952
- }) : prefix, /*#__PURE__*/React__default["default"].createElement(StyledTextInputAndLabelContainer, null, !isFocused && isEmptyValue && /*#__PURE__*/React__default["default"].createElement(StyledLabelContainerInsideTextInput, {
13052
+ }) : prefix), /*#__PURE__*/React__default["default"].createElement(StyledLabelContainerInsideTextInput, {
12953
13053
  themeVariant: variant,
12954
- pointerEvents: "none"
13054
+ pointerEvents: "none",
13055
+ style: [{
13056
+ position: 'absolute'
13057
+ }, {
13058
+ transform: [{
13059
+ translateY: focusAnimation.interpolate({
13060
+ inputRange: [0, 1],
13061
+ outputRange: [variant !== 'textarea' ? inputSize.height / 2 : theme.space.large, 0]
13062
+ })
13063
+ }, {
13064
+ translateX: focusAnimation.interpolate({
13065
+ inputRange: [0, 1],
13066
+ outputRange: [-inputSize.width / 2 + labelWidth / 2 + prefixWidth + theme.space.large, -inputSize.width / 2 + labelWidth / 2 + theme.space.small]
13067
+ })
13068
+ }, {
13069
+ scale: focusAnimation.interpolate({
13070
+ inputRange: [0, 1],
13071
+ outputRange: [1, 0.75]
13072
+ })
13073
+ }]
13074
+ }]
12955
13075
  }, required && /*#__PURE__*/React__default["default"].createElement(StyledAsteriskLabelInsideTextInput, {
12956
- themeState: state
13076
+ style: {
13077
+ backgroundColor: backgroundColor
13078
+ },
13079
+ themeState: state,
13080
+ testID: "input-label-asterisk"
12957
13081
  }, "*"), !!label && /*#__PURE__*/React__default["default"].createElement(StyledLabelInsideTextInput, {
13082
+ style: {
13083
+ backgroundColor: backgroundColor
13084
+ },
12958
13085
  nativeID: accessibilityLabelledBy,
12959
13086
  testID: "input-label",
12960
- themeState: state
12961
- }, label)), renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React__default["default"].createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
13087
+ themeState: state,
13088
+ onLayout: onLabelLayout
13089
+ }, label)), /*#__PURE__*/React__default["default"].createElement(StyledTextInputAndLabelContainer, null, renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React__default["default"].createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
12962
13090
  themeVariant: variant,
12963
13091
  multiline: variant === 'textarea' || nativeProps.multiline,
12964
13092
  ref: function ref(reference) {
@@ -33953,6 +34081,41 @@ var RichTextEditor = function RichTextEditor(_ref) {
33953
34081
  postMessage(webview.current, message);
33954
34082
  }
33955
34083
  };
34084
+ var _React$useState = React__default["default"].useState({
34085
+ height: 0,
34086
+ width: 0
34087
+ }),
34088
+ _React$useState2 = _slicedToArray(_React$useState, 2),
34089
+ inputSize = _React$useState2[0],
34090
+ setInputSize = _React$useState2[1];
34091
+ var _React$useState3 = React__default["default"].useState(0),
34092
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
34093
+ labelWidth = _React$useState4[0],
34094
+ setLabelWidth = _React$useState4[1];
34095
+ var focusAnimation = React.useRef(new reactNative.Animated.Value(0)).current;
34096
+ React.useEffect(function () {
34097
+ reactNative.Animated.timing(focusAnimation, {
34098
+ toValue: isFocused || !isEmptyValue ? 1 : 0,
34099
+ duration: LABEL_ANIMATION_DURATION,
34100
+ easing: reactNative.Easing.bezier(0.4, 0, 0.2, 1),
34101
+ useNativeDriver: true
34102
+ }).start();
34103
+ }, [focusAnimation, isEmptyValue, isFocused]);
34104
+ var onLayout = React.useCallback(function (event) {
34105
+ var _event$nativeEvent$la = event.nativeEvent.layout,
34106
+ height = _event$nativeEvent$la.height,
34107
+ width = _event$nativeEvent$la.width;
34108
+ setInputSize(function (prev) {
34109
+ return _objectSpread2(_objectSpread2({}, prev), {}, {
34110
+ height: height,
34111
+ width: width
34112
+ });
34113
+ });
34114
+ }, []);
34115
+ var onLabelLayout = React.useCallback(function (event) {
34116
+ var width = event.nativeEvent.layout.width;
34117
+ setLabelWidth(width);
34118
+ }, []);
33956
34119
  React.useEffect(function () {
33957
34120
  var removeFocusListener = on(emitter, normalizeEventName('editor-focus'), function () {
33958
34121
  return setIsFocused(true);
@@ -34042,25 +34205,48 @@ var RichTextEditor = function RichTextEditor(_ref) {
34042
34205
  }, []);
34043
34206
  return /*#__PURE__*/React__default["default"].createElement(StyledContainer$4, {
34044
34207
  testID: testID
34045
- }, /*#__PURE__*/React__default["default"].createElement(StyledTextInputContainer, null, /*#__PURE__*/React__default["default"].createElement(StyledBorderBackDrop, {
34046
- themeState: state,
34047
- themeFocused: isFocused
34048
- }), (isFocused || label && !isEmptyValue) && /*#__PURE__*/React__default["default"].createElement(StyledLabelContainer, {
34049
- pointerEvents: "none"
34050
- }, required && /*#__PURE__*/React__default["default"].createElement(StyledAsteriskLabel, {
34051
- themeState: state
34052
- }, "*"), !!label && /*#__PURE__*/React__default["default"].createElement(StyledLabel, {
34053
- testID: "input-label",
34054
- themeState: state
34055
- }, label)), /*#__PURE__*/React__default["default"].createElement(StyledTextInputAndLabelContainer, null, !isFocused && isEmptyValue && /*#__PURE__*/React__default["default"].createElement(StyledLabelContainerInsideTextInput, {
34208
+ }, /*#__PURE__*/React__default["default"].createElement(StyledLabelContainerInsideTextInput, {
34056
34209
  themeVariant: "text",
34057
- pointerEvents: "none"
34210
+ pointerEvents: "none",
34211
+ testID: "input-label-container",
34212
+ style: [{
34213
+ position: 'absolute'
34214
+ }, {
34215
+ transform: [{
34216
+ translateY: focusAnimation.interpolate({
34217
+ inputRange: [0, 1],
34218
+ outputRange: [inputSize.height / 2, 0]
34219
+ })
34220
+ }, {
34221
+ translateX: focusAnimation.interpolate({
34222
+ inputRange: [0, 1],
34223
+ outputRange: [-inputSize.width / 2 + labelWidth / 2 + theme.space.large, -inputSize.width / 2 + labelWidth / 2 + theme.space.small]
34224
+ })
34225
+ }, {
34226
+ scale: focusAnimation.interpolate({
34227
+ inputRange: [0, 1],
34228
+ outputRange: [1, 0.75]
34229
+ })
34230
+ }]
34231
+ }]
34058
34232
  }, required && /*#__PURE__*/React__default["default"].createElement(StyledAsteriskLabelInsideTextInput, {
34233
+ style: {
34234
+ backgroundColor: theme.__hd__.textInput.colors.labelBackground
34235
+ },
34059
34236
  themeState: state
34060
34237
  }, "*"), !!label && /*#__PURE__*/React__default["default"].createElement(StyledLabelInsideTextInput, {
34238
+ style: {
34239
+ backgroundColor: theme.__hd__.textInput.colors.labelBackground
34240
+ },
34061
34241
  testID: "input-label",
34062
- themeState: state
34063
- }, label)), /*#__PURE__*/React__default["default"].createElement(reactNative.TouchableWithoutFeedback, {
34242
+ themeState: state,
34243
+ onLayout: onLabelLayout
34244
+ }, label)), /*#__PURE__*/React__default["default"].createElement(StyledTextInputContainer, {
34245
+ onLayout: onLayout
34246
+ }, /*#__PURE__*/React__default["default"].createElement(StyledBorderBackDrop, {
34247
+ themeState: state,
34248
+ themeFocused: isFocused
34249
+ }), /*#__PURE__*/React__default["default"].createElement(StyledTextInputAndLabelContainer, null, /*#__PURE__*/React__default["default"].createElement(reactNative.TouchableWithoutFeedback, {
34064
34250
  onPress: function onPress(e) {
34065
34251
  return e.stopPropagation();
34066
34252
  }