@hero-design/rn 8.45.0-test.0 → 8.45.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 (37) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +12 -2
  3. package/es/index.js +731 -584
  4. package/lib/index.js +731 -584
  5. package/package.json +1 -1
  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 +102 -57
  15. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +34 -19
  16. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +34 -19
  17. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +34 -19
  18. package/src/components/RichTextEditor/RichTextEditor.tsx +76 -38
  19. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +126 -102
  20. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +235 -146
  21. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +201 -127
  22. package/src/components/TextInput/StyledTextInput.tsx +8 -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 +1126 -833
  26. package/src/components/TextInput/__tests__/index.spec.tsx +2 -2
  27. package/src/components/TextInput/index.tsx +113 -57
  28. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +68 -38
  29. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +68 -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/es/index.js CHANGED
@@ -3333,8 +3333,8 @@ var getTextInputTheme = function getTextInputTheme(theme) {
3333
3333
  };
3334
3334
  var space = {
3335
3335
  containerPadding: theme.space.medium,
3336
- labelLeft: theme.space.medium,
3337
- labelTop: theme.lineHeights.small / -4,
3336
+ labelLeft: theme.space.xlarge,
3337
+ labelTop: theme.space.xlarge / 3,
3338
3338
  labelPaddingBottom: theme.space.small,
3339
3339
  labelHorizontalPadding: theme.space.xsmall,
3340
3340
  inputHorizontalMargin: theme.space.small,
@@ -6761,7 +6761,7 @@ var Caption = function Caption(_ref) {
6761
6761
  }), children);
6762
6762
  };
6763
6763
 
6764
- var StyledLabel$2 = index$a(Text$1)(function (_ref) {
6764
+ var StyledLabel$1 = index$a(Text$1)(function (_ref) {
6765
6765
  var themeIntent = _ref.themeIntent,
6766
6766
  theme = _ref.theme;
6767
6767
  return {
@@ -6780,7 +6780,7 @@ var Label = function Label(_ref) {
6780
6780
  _ref$allowFontScaling = _ref.allowFontScaling,
6781
6781
  allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
6782
6782
  nativeProps = _objectWithoutProperties(_ref, _excluded$y);
6783
- return /*#__PURE__*/React.createElement(StyledLabel$2, _extends$1({}, nativeProps, {
6783
+ return /*#__PURE__*/React.createElement(StyledLabel$1, _extends$1({}, nativeProps, {
6784
6784
  themeIntent: intent,
6785
6785
  allowFontScaling: allowFontScaling
6786
6786
  }), children);
@@ -7508,8 +7508,8 @@ var Accordion = function Accordion(_ref) {
7508
7508
  onItemPress = _ref.onItemPress,
7509
7509
  _ref$variant = _ref.variant,
7510
7510
  variant = _ref$variant === void 0 ? 'default' : _ref$variant,
7511
- testID = _ref.testID,
7512
- style = _ref.style;
7511
+ style = _ref.style,
7512
+ testID = _ref.testID;
7513
7513
  var defaultValue = useMemo(function () {
7514
7514
  return typeof activeItemKey === 'number' ? NaN : '';
7515
7515
  }, [activeItemKey]);
@@ -7800,27 +7800,300 @@ var Avatar = function Avatar(_ref) {
7800
7800
  }));
7801
7801
  };
7802
7802
 
7803
+ var isIOS = Platform.OS === 'ios';
7804
+ var isAndroid = Platform.OS === 'android';
7805
+ function pick(keys, obj) {
7806
+ return keys.filter(function (key) {
7807
+ return key in obj;
7808
+ }).reduce(function (result, cur) {
7809
+ return _objectSpread2(_objectSpread2({}, result), {}, _defineProperty({}, cur, obj[cur]));
7810
+ }, {});
7811
+ }
7812
+ function omit(keys, obj) {
7813
+ var result = obj;
7814
+ keys.forEach(function (key) {
7815
+ delete result[key];
7816
+ });
7817
+ return result;
7818
+ }
7819
+
7820
+ var colors = {
7821
+ backgroundColor: {
7822
+ property: 'backgroundColor',
7823
+ scale: 'colors'
7824
+ },
7825
+ bgColor: {
7826
+ property: 'backgroundColor',
7827
+ scale: 'colors'
7828
+ },
7829
+ borderColor: {
7830
+ property: 'borderColor',
7831
+ scale: 'colors'
7832
+ },
7833
+ borderTopColor: {
7834
+ property: 'borderTopColor',
7835
+ scale: 'colors'
7836
+ },
7837
+ borderBottomColor: {
7838
+ property: 'borderBottomColor',
7839
+ scale: 'colors'
7840
+ },
7841
+ borderStartColor: {
7842
+ property: 'borderStartColor',
7843
+ scale: 'colors'
7844
+ },
7845
+ borderEndColor: {
7846
+ property: 'borderEndColor',
7847
+ scale: 'colors'
7848
+ },
7849
+ borderLeftColor: {
7850
+ property: 'borderLeftColor',
7851
+ scale: 'colors'
7852
+ },
7853
+ borderRightColor: {
7854
+ property: 'borderRightColor',
7855
+ scale: 'colors'
7856
+ }
7857
+ };
7858
+ var space = {
7859
+ margin: {
7860
+ property: 'margin',
7861
+ scale: 'space'
7862
+ },
7863
+ marginBottom: {
7864
+ property: 'marginBottom',
7865
+ scale: 'space'
7866
+ },
7867
+ marginEnd: {
7868
+ property: 'marginEnd',
7869
+ scale: 'space'
7870
+ },
7871
+ marginHorizontal: {
7872
+ property: 'marginHorizontal',
7873
+ scale: 'space'
7874
+ },
7875
+ marginLeft: {
7876
+ property: 'marginLeft',
7877
+ scale: 'space'
7878
+ },
7879
+ marginRight: {
7880
+ property: 'marginRight',
7881
+ scale: 'space'
7882
+ },
7883
+ marginStart: {
7884
+ property: 'marginStart',
7885
+ scale: 'space'
7886
+ },
7887
+ marginTop: {
7888
+ property: 'marginTop',
7889
+ scale: 'space'
7890
+ },
7891
+ marginVertical: {
7892
+ property: 'marginVertical',
7893
+ scale: 'space'
7894
+ },
7895
+ padding: {
7896
+ property: 'padding',
7897
+ scale: 'space'
7898
+ },
7899
+ paddingBottom: {
7900
+ property: 'paddingBottom',
7901
+ scale: 'space'
7902
+ },
7903
+ paddingEnd: {
7904
+ property: 'paddingEnd',
7905
+ scale: 'space'
7906
+ },
7907
+ paddingHorizontal: {
7908
+ property: 'paddingHorizontal',
7909
+ scale: 'space'
7910
+ },
7911
+ paddingLeft: {
7912
+ property: 'paddingLeft',
7913
+ scale: 'space'
7914
+ },
7915
+ paddingRight: {
7916
+ property: 'paddingRight',
7917
+ scale: 'space'
7918
+ },
7919
+ paddingStart: {
7920
+ property: 'paddingStart',
7921
+ scale: 'space'
7922
+ },
7923
+ paddingTop: {
7924
+ property: 'paddingTop',
7925
+ scale: 'space'
7926
+ },
7927
+ paddingVertical: {
7928
+ property: 'paddingVertical',
7929
+ scale: 'space'
7930
+ }
7931
+ };
7932
+ var radii = {
7933
+ borderBottomEndRadius: {
7934
+ property: 'borderBottomEndRadius',
7935
+ scale: 'radii'
7936
+ },
7937
+ borderBottomLeftRadius: {
7938
+ property: 'borderBottomLeftRadius',
7939
+ scale: 'radii'
7940
+ },
7941
+ borderBottomRightRadius: {
7942
+ property: 'borderBottomRightRadius',
7943
+ scale: 'radii'
7944
+ },
7945
+ borderBottomStartRadius: {
7946
+ property: 'borderBottomStartRadius',
7947
+ scale: 'radii'
7948
+ },
7949
+ borderTopEndRadius: {
7950
+ property: 'borderTopEndRadius',
7951
+ scale: 'radii'
7952
+ },
7953
+ borderTopLeftRadius: {
7954
+ property: 'borderTopLeftRadius',
7955
+ scale: 'radii'
7956
+ },
7957
+ borderTopRightRadius: {
7958
+ property: 'borderTopRightRadius',
7959
+ scale: 'radii'
7960
+ },
7961
+ borderTopStartRadius: {
7962
+ property: 'borderTopStartRadius',
7963
+ scale: 'radii'
7964
+ },
7965
+ borderRadius: {
7966
+ property: 'borderRadius',
7967
+ scale: 'radii'
7968
+ }
7969
+ };
7970
+ var borderWidths = {
7971
+ borderWidth: {
7972
+ property: 'borderWidth',
7973
+ scale: 'borderWidths'
7974
+ },
7975
+ borderBottomWidth: {
7976
+ property: 'borderBottomWidth',
7977
+ scale: 'borderWidths'
7978
+ },
7979
+ borderTopWidth: {
7980
+ property: 'borderTopWidth',
7981
+ scale: 'borderWidths'
7982
+ },
7983
+ borderLeftWidth: {
7984
+ property: 'borderLeftWidth',
7985
+ scale: 'borderWidths'
7986
+ },
7987
+ borderRightWidth: {
7988
+ property: 'borderRightWidth',
7989
+ scale: 'borderWidths'
7990
+ }
7991
+ };
7992
+ var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
7993
+ var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
7994
+
7995
+ var _excluded$t = ["theme"];
7996
+ var getThemeValue = function getThemeValue(theme, key, props) {
7997
+ var propConfig = config[key];
7998
+ var propValue = props[key];
7999
+ if (!propValue) return undefined;
8000
+ var scale = propConfig.scale,
8001
+ property = propConfig.property;
8002
+ switch (scale) {
8003
+ case 'colors':
8004
+ return _defineProperty({}, property, theme.colors[propValue]);
8005
+ case 'space':
8006
+ return _defineProperty({}, property, theme.space[propValue]);
8007
+ case 'radii':
8008
+ return _defineProperty({}, property, theme.radii[propValue]);
8009
+ case 'borderWidths':
8010
+ return _defineProperty({}, property, theme.borderWidths[propValue]);
8011
+ }
8012
+ };
8013
+ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
8014
+ var entries = Object.keys(props);
8015
+ return entries.reduce(function (result, key) {
8016
+ return _objectSpread2(_objectSpread2({}, result), getThemeValue(theme, key, props));
8017
+ }, {});
8018
+ };
8019
+ var configKeys = Object.keys(config);
8020
+ var StyledBox = index$a(View)(function (_ref5) {
8021
+ var theme = _ref5.theme,
8022
+ otherProps = _objectWithoutProperties(_ref5, _excluded$t);
8023
+ var styleProps = pick(configKeys, otherProps);
8024
+ var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
8025
+ return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
8026
+ });
8027
+
8028
+ var _excluded$s = ["children", "style", "testID"];
8029
+ var Box = function Box(_ref) {
8030
+ var children = _ref.children,
8031
+ style = _ref.style,
8032
+ testID = _ref.testID,
8033
+ otherProps = _objectWithoutProperties(_ref, _excluded$s);
8034
+ return /*#__PURE__*/React.createElement(StyledBox, _extends$1({}, otherProps, {
8035
+ style: style,
8036
+ testID: testID
8037
+ }), children);
8038
+ };
8039
+
7803
8040
  var VISIBLE_RATIO = 0.7;
7804
8041
  var StyledWrapper$a = index$a(View)(function (_ref) {
7805
8042
  var theme = _ref.theme,
7806
8043
  themeSize = _ref.themeSize,
7807
- themeAvatarCount = _ref.themeAvatarCount;
8044
+ themeAvatarCount = _ref.themeAvatarCount,
8045
+ _ref$themeVariant = _ref.themeVariant,
8046
+ themeVariant = _ref$themeVariant === void 0 ? 'horizontal' : _ref$themeVariant,
8047
+ _ref$themeHasSurplus = _ref.themeHasSurplus,
8048
+ themeHasSurplus = _ref$themeHasSurplus === void 0 ? false : _ref$themeHasSurplus;
7808
8049
  var avatarSize = theme.__hd__.avatar.sizes[themeSize];
8050
+ var widthAndHeightByVariant = {
8051
+ horizontal: {
8052
+ width: avatarSize * (1 + VISIBLE_RATIO * (themeHasSurplus ? themeAvatarCount : themeAvatarCount - 1)),
8053
+ height: avatarSize
8054
+ },
8055
+ vertical: {
8056
+ width: avatarSize,
8057
+ height: avatarSize * (1 + VISIBLE_RATIO * (themeHasSurplus ? themeAvatarCount : themeAvatarCount - 1))
8058
+ }
8059
+ };
7809
8060
  return {
7810
- flexDirection: 'row',
7811
- height: avatarSize,
7812
- width: avatarSize * (1 + VISIBLE_RATIO * (themeAvatarCount - 1))
8061
+ flexDirection: themeVariant === 'horizontal' ? 'row' : 'column',
8062
+ height: widthAndHeightByVariant[themeVariant].height,
8063
+ width: widthAndHeightByVariant[themeVariant].width
7813
8064
  };
7814
8065
  });
7815
8066
  var StyledAvatar = index$a(Avatar)(function (_ref2) {
7816
8067
  var theme = _ref2.theme,
7817
8068
  themeIndex = _ref2.themeIndex,
7818
8069
  _ref2$size = _ref2.size,
7819
- size = _ref2$size === void 0 ? 'small' : _ref2$size;
8070
+ size = _ref2$size === void 0 ? 'small' : _ref2$size,
8071
+ _ref2$themeVariant = _ref2.themeVariant,
8072
+ themeVariant = _ref2$themeVariant === void 0 ? 'horizontal' : _ref2$themeVariant;
7820
8073
  var avatarSize = theme.__hd__.avatar.sizes[size];
8074
+ var offset = avatarSize * VISIBLE_RATIO * themeIndex;
7821
8075
  return {
7822
8076
  position: 'absolute',
7823
- left: avatarSize * VISIBLE_RATIO * themeIndex
8077
+ left: themeVariant === 'horizontal' ? offset : undefined,
8078
+ top: themeVariant === 'vertical' ? offset : undefined
8079
+ };
8080
+ });
8081
+ var StyledSurplusContainer = index$a(Box)(function (_ref3) {
8082
+ var theme = _ref3.theme,
8083
+ themeIndex = _ref3.themeIndex,
8084
+ themeVariant = _ref3.themeVariant,
8085
+ _ref3$themeSize = _ref3.themeSize,
8086
+ themeSize = _ref3$themeSize === void 0 ? 'small' : _ref3$themeSize;
8087
+ var avatarSize = theme.__hd__.avatar.sizes[themeSize];
8088
+ var offset = avatarSize * VISIBLE_RATIO * themeIndex;
8089
+ return {
8090
+ position: 'absolute',
8091
+ left: themeVariant === 'horizontal' ? offset : undefined,
8092
+ top: themeVariant === 'vertical' ? offset : undefined,
8093
+ borderRadius: theme.__hd__.avatar.radii.rounded,
8094
+ width: theme.__hd__.avatar.sizes[themeSize],
8095
+ height: theme.__hd__.avatar.sizes[themeSize],
8096
+ overflow: 'hidden'
7824
8097
  };
7825
8098
  });
7826
8099
 
@@ -7846,36 +8119,87 @@ var useAvatarColors = function useAvatarColors() {
7846
8119
  }, []);
7847
8120
  return shuffledColors;
7848
8121
  };
7849
-
7850
- var AvatarStack = function AvatarStack(_ref) {
7851
- var children = _ref.children,
7852
- max = _ref.max,
7853
- _ref$size = _ref.size,
7854
- size = _ref$size === void 0 ? 'small' : _ref$size,
7855
- style = _ref.style,
7856
- testID = _ref.testID;
8122
+
8123
+ var Surplus = function Surplus(_ref) {
8124
+ var value = _ref.value,
8125
+ renderSurplus = _ref.renderSurplus,
8126
+ size = _ref.size,
8127
+ _ref$variant = _ref.variant,
8128
+ variant = _ref$variant === void 0 ? 'horizontal' : _ref$variant,
8129
+ index = _ref.index,
8130
+ backgroundColor = _ref.backgroundColor;
8131
+ if (value > 0) {
8132
+ if (renderSurplus) {
8133
+ return /*#__PURE__*/React.createElement(StyledSurplusContainer, {
8134
+ testID: "surplus-container",
8135
+ themeSize: size,
8136
+ themeVariant: variant,
8137
+ themeIndex: index,
8138
+ style: {
8139
+ backgroundColor: backgroundColor
8140
+ }
8141
+ }, renderSurplus(value));
8142
+ }
8143
+ return /*#__PURE__*/React.createElement(StyledAvatar, {
8144
+ testID: "surplus-container",
8145
+ themeVariant: variant,
8146
+ title: "+".concat(value),
8147
+ size: size,
8148
+ themeIndex: index,
8149
+ style: {
8150
+ backgroundColor: backgroundColor
8151
+ }
8152
+ });
8153
+ }
8154
+ return null;
8155
+ };
8156
+ var AvatarStack = function AvatarStack(_ref2) {
8157
+ var children = _ref2.children,
8158
+ max = _ref2.max,
8159
+ _ref2$size = _ref2.size,
8160
+ size = _ref2$size === void 0 ? 'small' : _ref2$size,
8161
+ style = _ref2.style,
8162
+ testID = _ref2.testID,
8163
+ _ref2$variant = _ref2.variant,
8164
+ variant = _ref2$variant === void 0 ? 'horizontal' : _ref2$variant,
8165
+ total = _ref2.total,
8166
+ renderSurplus = _ref2.renderSurplus;
7857
8167
  var colors = useAvatarColors();
7858
8168
  var avatars = children.slice(0, max);
7859
- if (max !== undefined && children.length - max > 0) {
7860
- var remainingAvatar = /*#__PURE__*/React.createElement(Avatar, {
7861
- title: "+".concat(children.length - max),
7862
- size: size
7863
- });
7864
- avatars.push(remainingAvatar);
7865
- }
8169
+ var remainingAvatar = function () {
8170
+ var remain = 0;
8171
+ // Remaining value will prioritize total prop if it exists
8172
+ if (total && total > children.length) {
8173
+ remain = total - avatars.length;
8174
+ } else if (max && children.length > max) {
8175
+ remain = children.length - max;
8176
+ }
8177
+ return remain;
8178
+ }();
7866
8179
  return /*#__PURE__*/React.createElement(StyledWrapper$a, {
7867
8180
  themeSize: size,
7868
8181
  themeAvatarCount: avatars.length,
8182
+ themeHasSurplus: remainingAvatar > 0,
7869
8183
  style: style,
7870
- testID: testID
8184
+ testID: testID,
8185
+ themeVariant: variant
7871
8186
  }, avatars.map(function (avt, index) {
7872
- return /*#__PURE__*/React.createElement(StyledAvatar, _extends$1({}, avt.props, {
8187
+ return /*#__PURE__*/React.createElement(StyledAvatar, _extends$1({
8188
+ themeVariant: variant
8189
+ }, avt.props, {
7873
8190
  size: size,
7874
8191
  themeIndex: index,
7875
8192
  style: {
7876
8193
  backgroundColor: colors[index % colors.length]
7877
8194
  }
7878
8195
  }));
8196
+ }), /*#__PURE__*/React.createElement(Surplus, {
8197
+ value: remainingAvatar,
8198
+ index: avatars.length,
8199
+ size: size,
8200
+ variant: variant,
8201
+ renderSurplus: renderSurplus,
8202
+ backgroundColor: colors[avatars.length % colors.length]
7879
8203
  }));
7880
8204
  };
7881
8205
 
@@ -7920,7 +8244,7 @@ var StyledStatus = index$a(Animated.View)(function (_ref3) {
7920
8244
  };
7921
8245
  });
7922
8246
 
7923
- var _excluded$t = ["children", "visible", "intent", "style", "testID"];
8247
+ var _excluded$r = ["children", "visible", "intent", "style", "testID"];
7924
8248
  var Status = function Status(_ref) {
7925
8249
  var children = _ref.children,
7926
8250
  _ref$visible = _ref.visible,
@@ -7929,7 +8253,7 @@ var Status = function Status(_ref) {
7929
8253
  intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
7930
8254
  style = _ref.style,
7931
8255
  testID = _ref.testID,
7932
- nativeProps = _objectWithoutProperties(_ref, _excluded$t);
8256
+ nativeProps = _objectWithoutProperties(_ref, _excluded$r);
7933
8257
  var _React$useRef = React.useRef(new Animated.Value(visible ? 1 : 0)),
7934
8258
  opacity = _React$useRef.current;
7935
8259
  var isFirstRendering = React.useRef(true);
@@ -7962,7 +8286,7 @@ var Status = function Status(_ref) {
7962
8286
  }));
7963
8287
  };
7964
8288
 
7965
- var _excluded$s = ["content", "visible", "max", "intent", "style", "testID"];
8289
+ var _excluded$q = ["content", "visible", "max", "intent", "style", "testID"];
7966
8290
  var DEFAULT_MAX_NUMBER = 99;
7967
8291
  var getPaddingState = function getPaddingState(content) {
7968
8292
  return content.length > 1 ? 'wideContent' : 'narrowContent';
@@ -7977,7 +8301,7 @@ var Badge = function Badge(_ref) {
7977
8301
  intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
7978
8302
  style = _ref.style,
7979
8303
  testID = _ref.testID,
7980
- nativeProps = _objectWithoutProperties(_ref, _excluded$s);
8304
+ nativeProps = _objectWithoutProperties(_ref, _excluded$q);
7981
8305
  var _React$useRef = React.useRef(new Animated.Value(visible ? 1 : 0)),
7982
8306
  opacity = _React$useRef.current;
7983
8307
  var isFirstRendering = React.useRef(true);
@@ -8064,24 +8388,7 @@ var StyledBottomBarText = index$a(Typography.Caption)(function (_ref3) {
8064
8388
  };
8065
8389
  });
8066
8390
 
8067
- var isIOS = Platform.OS === 'ios';
8068
- var isAndroid = Platform.OS === 'android';
8069
- function pick(keys, obj) {
8070
- return keys.filter(function (key) {
8071
- return key in obj;
8072
- }).reduce(function (result, cur) {
8073
- return _objectSpread2(_objectSpread2({}, result), {}, _defineProperty({}, cur, obj[cur]));
8074
- }, {});
8075
- }
8076
- function omit(keys, obj) {
8077
- var result = obj;
8078
- keys.forEach(function (key) {
8079
- delete result[key];
8080
- });
8081
- return result;
8082
- }
8083
-
8084
- var _excluded$r = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
8391
+ var _excluded$p = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
8085
8392
  var getInactiveIcon = function getInactiveIcon(icon) {
8086
8393
  var inactiveIcon = "".concat(icon, "-outlined");
8087
8394
  return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
@@ -8092,7 +8399,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
8092
8399
  renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
8093
8400
  selectedTabKey = _ref.selectedTabKey,
8094
8401
  tabs = _ref.tabs,
8095
- nativeProps = _objectWithoutProperties(_ref, _excluded$r);
8402
+ nativeProps = _objectWithoutProperties(_ref, _excluded$p);
8096
8403
  useDeprecation('BottomNavigation is deprecated and will be removed in the next major release. Please remove it.');
8097
8404
  var insets = useSafeAreaInsets();
8098
8405
  /**
@@ -8179,13 +8486,13 @@ var StyledDivider = index$a(View)(function (_ref) {
8179
8486
  }, horizontalMargin), verticalMargin);
8180
8487
  });
8181
8488
 
8182
- var _excluded$q = ["marginHorizontal", "marginVertical", "style", "testID"];
8489
+ var _excluded$o = ["marginHorizontal", "marginVertical", "style", "testID"];
8183
8490
  var Divider = function Divider(_ref) {
8184
8491
  var marginHorizontal = _ref.marginHorizontal,
8185
8492
  marginVertical = _ref.marginVertical,
8186
8493
  style = _ref.style,
8187
8494
  testID = _ref.testID,
8188
- nativeProps = _objectWithoutProperties(_ref, _excluded$q);
8495
+ nativeProps = _objectWithoutProperties(_ref, _excluded$o);
8189
8496
  return /*#__PURE__*/React.createElement(StyledDivider, _extends$1({}, nativeProps, {
8190
8497
  themeMarginHorizontal: marginHorizontal,
8191
8498
  themeMarginVertical: marginVertical,
@@ -8309,7 +8616,7 @@ var StyledLoadingDot = index$a(View)(function (_ref) {
8309
8616
  }, themeStyling());
8310
8617
  });
8311
8618
 
8312
- var _excluded$p = ["count", "size", "testID", "themeVariant"];
8619
+ var _excluded$n = ["count", "size", "testID", "themeVariant"];
8313
8620
  var AnimatedLoadingIndicatorWrapper = Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
8314
8621
  var AnimatedLoadingDot = Animated.createAnimatedComponent(StyledLoadingDot);
8315
8622
  var renderDotComponent = function renderDotComponent(_ref) {
@@ -8341,7 +8648,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
8341
8648
  size = _ref2$size === void 0 ? 12 : _ref2$size,
8342
8649
  testID = _ref2.testID,
8343
8650
  themeVariant = _ref2.themeVariant,
8344
- nativeProps = _objectWithoutProperties(_ref2, _excluded$p);
8651
+ nativeProps = _objectWithoutProperties(_ref2, _excluded$n);
8345
8652
  var progressAnimation = useRef(new Animated.Value(0));
8346
8653
  useEffect(function () {
8347
8654
  var animation = Animated.loop(Animated.timing(progressAnimation.current, {
@@ -8783,11 +9090,11 @@ var Header = function Header(_ref) {
8783
9090
  })) : null), showDivider ? /*#__PURE__*/React.createElement(Divider, null) : null);
8784
9091
  };
8785
9092
 
8786
- var _excluded$o = ["scrollEventThrottle"];
9093
+ var _excluded$m = ["scrollEventThrottle"];
8787
9094
  var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
8788
9095
  var _ref$scrollEventThrot = _ref.scrollEventThrottle,
8789
9096
  scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
8790
- props = _objectWithoutProperties(_ref, _excluded$o);
9097
+ props = _objectWithoutProperties(_ref, _excluded$m);
8791
9098
  var _useContext = useContext(BottomSheetContext),
8792
9099
  setInternalShowDivider = _useContext.setInternalShowDivider;
8793
9100
  var onScrollBeginDrag = useCallback(function (e) {
@@ -8910,243 +9217,23 @@ var BottomSheet = function BottomSheet(_ref) {
8910
9217
  scaleY: height > 0 ? 1 : 0
8911
9218
  }, {
8912
9219
  translateY: interpolateY
8913
- }]
8914
- }]
8915
- }, header !== undefined ? /*#__PURE__*/React.createElement(Header, {
8916
- content: header,
8917
- showDivider: internalShowDivider,
8918
- onRequestClose: onRequestClose,
8919
- showCloseButton: showCloseButton
8920
- }) : null, /*#__PURE__*/React.createElement(BottomSheetContext.Provider, {
8921
- value: BottomSheetContextValue
8922
- }, children), footer ? /*#__PURE__*/React.createElement(Footer$1, {
8923
- showDivider: showDivider
8924
- }, footer) : null))));
8925
- };
8926
- var BottomSheet$1 = Object.assign(BottomSheet, {
8927
- ScrollView: BottomSheetScrollView
8928
- });
8929
-
8930
- var colors = {
8931
- backgroundColor: {
8932
- property: 'backgroundColor',
8933
- scale: 'colors'
8934
- },
8935
- bgColor: {
8936
- property: 'backgroundColor',
8937
- scale: 'colors'
8938
- },
8939
- borderColor: {
8940
- property: 'borderColor',
8941
- scale: 'colors'
8942
- },
8943
- borderTopColor: {
8944
- property: 'borderTopColor',
8945
- scale: 'colors'
8946
- },
8947
- borderBottomColor: {
8948
- property: 'borderBottomColor',
8949
- scale: 'colors'
8950
- },
8951
- borderStartColor: {
8952
- property: 'borderStartColor',
8953
- scale: 'colors'
8954
- },
8955
- borderEndColor: {
8956
- property: 'borderEndColor',
8957
- scale: 'colors'
8958
- },
8959
- borderLeftColor: {
8960
- property: 'borderLeftColor',
8961
- scale: 'colors'
8962
- },
8963
- borderRightColor: {
8964
- property: 'borderRightColor',
8965
- scale: 'colors'
8966
- }
8967
- };
8968
- var space = {
8969
- margin: {
8970
- property: 'margin',
8971
- scale: 'space'
8972
- },
8973
- marginBottom: {
8974
- property: 'marginBottom',
8975
- scale: 'space'
8976
- },
8977
- marginEnd: {
8978
- property: 'marginEnd',
8979
- scale: 'space'
8980
- },
8981
- marginHorizontal: {
8982
- property: 'marginHorizontal',
8983
- scale: 'space'
8984
- },
8985
- marginLeft: {
8986
- property: 'marginLeft',
8987
- scale: 'space'
8988
- },
8989
- marginRight: {
8990
- property: 'marginRight',
8991
- scale: 'space'
8992
- },
8993
- marginStart: {
8994
- property: 'marginStart',
8995
- scale: 'space'
8996
- },
8997
- marginTop: {
8998
- property: 'marginTop',
8999
- scale: 'space'
9000
- },
9001
- marginVertical: {
9002
- property: 'marginVertical',
9003
- scale: 'space'
9004
- },
9005
- padding: {
9006
- property: 'padding',
9007
- scale: 'space'
9008
- },
9009
- paddingBottom: {
9010
- property: 'paddingBottom',
9011
- scale: 'space'
9012
- },
9013
- paddingEnd: {
9014
- property: 'paddingEnd',
9015
- scale: 'space'
9016
- },
9017
- paddingHorizontal: {
9018
- property: 'paddingHorizontal',
9019
- scale: 'space'
9020
- },
9021
- paddingLeft: {
9022
- property: 'paddingLeft',
9023
- scale: 'space'
9024
- },
9025
- paddingRight: {
9026
- property: 'paddingRight',
9027
- scale: 'space'
9028
- },
9029
- paddingStart: {
9030
- property: 'paddingStart',
9031
- scale: 'space'
9032
- },
9033
- paddingTop: {
9034
- property: 'paddingTop',
9035
- scale: 'space'
9036
- },
9037
- paddingVertical: {
9038
- property: 'paddingVertical',
9039
- scale: 'space'
9040
- }
9041
- };
9042
- var radii = {
9043
- borderBottomEndRadius: {
9044
- property: 'borderBottomEndRadius',
9045
- scale: 'radii'
9046
- },
9047
- borderBottomLeftRadius: {
9048
- property: 'borderBottomLeftRadius',
9049
- scale: 'radii'
9050
- },
9051
- borderBottomRightRadius: {
9052
- property: 'borderBottomRightRadius',
9053
- scale: 'radii'
9054
- },
9055
- borderBottomStartRadius: {
9056
- property: 'borderBottomStartRadius',
9057
- scale: 'radii'
9058
- },
9059
- borderTopEndRadius: {
9060
- property: 'borderTopEndRadius',
9061
- scale: 'radii'
9062
- },
9063
- borderTopLeftRadius: {
9064
- property: 'borderTopLeftRadius',
9065
- scale: 'radii'
9066
- },
9067
- borderTopRightRadius: {
9068
- property: 'borderTopRightRadius',
9069
- scale: 'radii'
9070
- },
9071
- borderTopStartRadius: {
9072
- property: 'borderTopStartRadius',
9073
- scale: 'radii'
9074
- },
9075
- borderRadius: {
9076
- property: 'borderRadius',
9077
- scale: 'radii'
9078
- }
9079
- };
9080
- var borderWidths = {
9081
- borderWidth: {
9082
- property: 'borderWidth',
9083
- scale: 'borderWidths'
9084
- },
9085
- borderBottomWidth: {
9086
- property: 'borderBottomWidth',
9087
- scale: 'borderWidths'
9088
- },
9089
- borderTopWidth: {
9090
- property: 'borderTopWidth',
9091
- scale: 'borderWidths'
9092
- },
9093
- borderLeftWidth: {
9094
- property: 'borderLeftWidth',
9095
- scale: 'borderWidths'
9096
- },
9097
- borderRightWidth: {
9098
- property: 'borderRightWidth',
9099
- scale: 'borderWidths'
9100
- }
9101
- };
9102
- var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
9103
- var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
9104
-
9105
- var _excluded$n = ["theme"];
9106
- var getThemeValue = function getThemeValue(theme, key, props) {
9107
- var propConfig = config[key];
9108
- var propValue = props[key];
9109
- if (!propValue) return undefined;
9110
- var scale = propConfig.scale,
9111
- property = propConfig.property;
9112
- switch (scale) {
9113
- case 'colors':
9114
- return _defineProperty({}, property, theme.colors[propValue]);
9115
- case 'space':
9116
- return _defineProperty({}, property, theme.space[propValue]);
9117
- case 'radii':
9118
- return _defineProperty({}, property, theme.radii[propValue]);
9119
- case 'borderWidths':
9120
- return _defineProperty({}, property, theme.borderWidths[propValue]);
9121
- }
9122
- };
9123
- var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
9124
- var entries = Object.keys(props);
9125
- return entries.reduce(function (result, key) {
9126
- return _objectSpread2(_objectSpread2({}, result), getThemeValue(theme, key, props));
9127
- }, {});
9220
+ }]
9221
+ }]
9222
+ }, header !== undefined ? /*#__PURE__*/React.createElement(Header, {
9223
+ content: header,
9224
+ showDivider: internalShowDivider,
9225
+ onRequestClose: onRequestClose,
9226
+ showCloseButton: showCloseButton
9227
+ }) : null, /*#__PURE__*/React.createElement(BottomSheetContext.Provider, {
9228
+ value: BottomSheetContextValue
9229
+ }, children), footer ? /*#__PURE__*/React.createElement(Footer$1, {
9230
+ showDivider: showDivider
9231
+ }, footer) : null))));
9128
9232
  };
9129
- var configKeys = Object.keys(config);
9130
- var StyledBox = index$a(View)(function (_ref5) {
9131
- var theme = _ref5.theme,
9132
- otherProps = _objectWithoutProperties(_ref5, _excluded$n);
9133
- var styleProps = pick(configKeys, otherProps);
9134
- var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
9135
- return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
9233
+ var BottomSheet$1 = Object.assign(BottomSheet, {
9234
+ ScrollView: BottomSheetScrollView
9136
9235
  });
9137
9236
 
9138
- var _excluded$m = ["children", "style", "testID"];
9139
- var Box = function Box(_ref) {
9140
- var children = _ref.children,
9141
- style = _ref.style,
9142
- testID = _ref.testID,
9143
- otherProps = _objectWithoutProperties(_ref, _excluded$m);
9144
- return /*#__PURE__*/React.createElement(StyledBox, _extends$1({}, otherProps, {
9145
- style: style,
9146
- testID: testID
9147
- }), children);
9148
- };
9149
-
9150
9237
  function requiredArgs(required, args) {
9151
9238
  if (args.length < required) {
9152
9239
  throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
@@ -11780,191 +11867,6 @@ var Calendar = function Calendar(_ref) {
11780
11867
  })));
11781
11868
  };
11782
11869
 
11783
- var _excluded$l = ["rounded", "size", "testID", "style"];
11784
- var Image = function Image(_ref) {
11785
- var _ref$rounded = _ref.rounded,
11786
- rounded = _ref$rounded === void 0 ? false : _ref$rounded,
11787
- _ref$size = _ref.size,
11788
- size = _ref$size === void 0 ? '6xlarge' : _ref$size,
11789
- testID = _ref.testID,
11790
- style = _ref.style,
11791
- imageNativeProps = _objectWithoutProperties(_ref, _excluded$l);
11792
- var theme = useTheme();
11793
- var imageSize = theme.__hd__.image.sizes[size];
11794
- return /*#__PURE__*/React.createElement(Image$1, _extends$1({
11795
- testID: testID,
11796
- style: [{
11797
- width: imageSize,
11798
- height: imageSize,
11799
- borderRadius: rounded ? imageSize / 2 : 0
11800
- }, style]
11801
- }, imageNativeProps));
11802
- };
11803
-
11804
- var StyledPageControl$2 = index$a(View)(function () {
11805
- return {
11806
- flexDirection: 'row',
11807
- alignItems: 'center'
11808
- };
11809
- });
11810
- var StyledPageControlAnimatedView = index$a(Animated.View)(function (_ref) {
11811
- var theme = _ref.theme;
11812
- return {
11813
- height: theme.__hd__.pageControl.sizes.paginatorHeight,
11814
- width: theme.__hd__.pageControl.sizes.paginatorWidth,
11815
- borderRadius: theme.__hd__.pageControl.radii.paginatorBorderRadius,
11816
- backgroundColor: theme.__hd__.pageControl.colors.paginatorBackgroundColor,
11817
- marginHorizontal: theme.__hd__.pageControl.space.paginatorMarginHorizontal
11818
- };
11819
- });
11820
-
11821
- var PageControl = function PageControl(_ref) {
11822
- var numberOfPages = _ref.numberOfPages,
11823
- _ref$currentPage = _ref.currentPage,
11824
- currentPage = _ref$currentPage === void 0 ? 0 : _ref$currentPage,
11825
- testID = _ref.testID,
11826
- style = _ref.style;
11827
- var theme = useTheme();
11828
- var animatedValue = React.useRef(new Animated.Value(currentPage)).current;
11829
- React.useEffect(function () {
11830
- animatedValue.setValue(currentPage);
11831
- }, [currentPage]);
11832
- return /*#__PURE__*/React.createElement(StyledPageControl$2, {
11833
- testID: testID,
11834
- style: style
11835
- }, new Array(numberOfPages).fill('').map(function (_, index) {
11836
- var inputRange = [index - 1, index, index + 1];
11837
- var indicatorWidth = animatedValue.interpolate({
11838
- inputRange: inputRange,
11839
- outputRange: [theme.space.small, theme.space.large, theme.space.small],
11840
- extrapolate: 'clamp'
11841
- });
11842
- var opacity = animatedValue.interpolate({
11843
- inputRange: inputRange,
11844
- outputRange: [0.5, 1, 0.5],
11845
- extrapolate: 'clamp'
11846
- });
11847
- return /*#__PURE__*/React.createElement(StyledPageControlAnimatedView, {
11848
- accessibilityState: {
11849
- selected: index === currentPage
11850
- },
11851
- style: [{
11852
- width: indicatorWidth,
11853
- opacity: opacity
11854
- }],
11855
- key: index.toString(),
11856
- testID: "page-control-indicator".concat(index)
11857
- });
11858
- }));
11859
- };
11860
-
11861
- var StyledBackDrop = index$a(View)(function (_ref) {
11862
- var themeSlideBackground = _ref.themeSlideBackground;
11863
- return {
11864
- position: 'absolute',
11865
- backgroundColor: themeSlideBackground,
11866
- top: 0,
11867
- bottom: 0,
11868
- right: 0,
11869
- left: 0
11870
- };
11871
- });
11872
- var StyledCarouselView = index$a(View)(function () {
11873
- return {
11874
- flexGrow: 2,
11875
- justifyContent: 'space-between'
11876
- };
11877
- });
11878
- var StyledCarouselHeading = index$a(Typography.Title)(function (_ref2) {
11879
- var theme = _ref2.theme;
11880
- return {
11881
- marginTop: theme.__hd__.carousel.space.headingMarginTop,
11882
- marginBottom: theme.__hd__.carousel.space.headingMarginBottom
11883
- };
11884
- });
11885
- var StyledCarouselImage = index$a(Image)(function () {
11886
- return {
11887
- flexGrow: 2,
11888
- flex: 1,
11889
- width: '100%',
11890
- resizeMode: 'contain'
11891
- };
11892
- });
11893
- var StyledCustomSizeCarouselImage = index$a(Image)(function (_ref3) {
11894
- var height = _ref3.height,
11895
- _ref3$resizeMode = _ref3.resizeMode,
11896
- resizeMode = _ref3$resizeMode === void 0 ? 'contain' : _ref3$resizeMode,
11897
- width = _ref3.width;
11898
- return {
11899
- alignSelf: 'center',
11900
- width: width,
11901
- height: height,
11902
- resizeMode: resizeMode
11903
- };
11904
- });
11905
- var StyledCarouselContentWrapper = index$a(Box)(function (_ref4) {
11906
- var width = _ref4.width;
11907
- return {
11908
- width: width
11909
- };
11910
- });
11911
- var StyledCarouselFooterWrapper = index$a(View)(function (_ref5) {
11912
- var theme = _ref5.theme;
11913
- return {
11914
- paddingHorizontal: theme.__hd__.carousel.space.footerPaddingHorizontal,
11915
- flexDirection: 'row',
11916
- justifyContent: 'space-between',
11917
- paddingVertical: theme.__hd__.carousel.space.footerPaddingVertical,
11918
- marginBottom: theme.__hd__.carousel.space.footerMarginBottom
11919
- };
11920
- });
11921
- var StyledPageControl$1 = index$a(PageControl)(function (_ref6) {
11922
- var theme = _ref6.theme;
11923
- return {
11924
- paddingVertical: theme.__hd__.carousel.space.pageControlPaddingVertical
11925
- };
11926
- });
11927
- var StyledPageControlWrapper = index$a(View)(function (_ref7) {
11928
- var theme = _ref7.theme;
11929
- return {
11930
- alignItems: 'center',
11931
- justifyContent: 'center',
11932
- height: theme.__hd__.carousel.space.pageControlWrapperHeight
11933
- };
11934
- });
11935
-
11936
- function isCarouselImageProps(image) {
11937
- return _typeof(image) === 'object';
11938
- }
11939
- var CarouselItem = function CarouselItem(_ref) {
11940
- var width = _ref.width,
11941
- image = _ref.image,
11942
- content = _ref.content,
11943
- heading = _ref.heading,
11944
- body = _ref.body;
11945
- return /*#__PURE__*/React.createElement(Box, {
11946
- style: {
11947
- width: width
11948
- }
11949
- }, image && (isCarouselImageProps(image) ? /*#__PURE__*/React.createElement(StyledCustomSizeCarouselImage, {
11950
- source: image,
11951
- height: image.height,
11952
- width: image.width,
11953
- resizeMode: image.resizeMode
11954
- }) : /*#__PURE__*/React.createElement(StyledCarouselImage, {
11955
- source: typeof image === 'string' ? {
11956
- uri: image
11957
- } : image
11958
- })), /*#__PURE__*/React.createElement(StyledCarouselContentWrapper, {
11959
- paddingHorizontal: "large",
11960
- marginTop: "large",
11961
- width: width
11962
- }, content, /*#__PURE__*/React.createElement(StyledCarouselHeading, {
11963
- level: "h1",
11964
- typeface: "playful"
11965
- }, heading), body ? /*#__PURE__*/React.createElement(Typography.Body, null, body) : null));
11966
- };
11967
-
11968
11870
  var StyledDataCard = index$a(View)(function (_ref) {
11969
11871
  var theme = _ref.theme;
11970
11872
  return {
@@ -11983,12 +11885,12 @@ var Indicator = index$a(View)(function (_ref2) {
11983
11885
  };
11984
11886
  });
11985
11887
 
11986
- var _excluded$k = ["intent", "children"];
11888
+ var _excluded$l = ["intent", "children"];
11987
11889
  var DataCard = function DataCard(_ref) {
11988
11890
  var _ref$intent = _ref.intent,
11989
11891
  intent = _ref$intent === void 0 ? 'info' : _ref$intent,
11990
11892
  children = _ref.children,
11991
- nativeProps = _objectWithoutProperties(_ref, _excluded$k);
11893
+ nativeProps = _objectWithoutProperties(_ref, _excluded$l);
11992
11894
  return /*#__PURE__*/React.createElement(StyledDataCard, nativeProps, /*#__PURE__*/React.createElement(Indicator, {
11993
11895
  themeIntent: intent,
11994
11896
  testID: "data-card-indicator"
@@ -12006,20 +11908,77 @@ var StyledCard$1 = index$a(View)(function (_ref) {
12006
11908
  });
12007
11909
  });
12008
11910
 
12009
- var _excluded$j = ["intent", "children"];
11911
+ var _excluded$k = ["intent", "children"];
12010
11912
  var Card = function Card(_ref) {
12011
11913
  var intent = _ref.intent,
12012
11914
  children = _ref.children,
12013
- nativeProps = _objectWithoutProperties(_ref, _excluded$j);
11915
+ nativeProps = _objectWithoutProperties(_ref, _excluded$k);
12014
11916
  return /*#__PURE__*/React.createElement(StyledCard$1, _extends$1({}, nativeProps, {
12015
11917
  themeIntent: intent
12016
11918
  }), children);
12017
11919
  };
12018
- var Card$1 = Object.assign(Card, {
12019
- Data: DataCard
12020
- });
11920
+ var Card$1 = Object.assign(Card, {
11921
+ Data: DataCard
11922
+ });
11923
+
11924
+ var StyledPageControl$2 = index$a(View)(function () {
11925
+ return {
11926
+ flexDirection: 'row',
11927
+ alignItems: 'center'
11928
+ };
11929
+ });
11930
+ var StyledPageControlAnimatedView = index$a(Animated.View)(function (_ref) {
11931
+ var theme = _ref.theme;
11932
+ return {
11933
+ height: theme.__hd__.pageControl.sizes.paginatorHeight,
11934
+ width: theme.__hd__.pageControl.sizes.paginatorWidth,
11935
+ borderRadius: theme.__hd__.pageControl.radii.paginatorBorderRadius,
11936
+ backgroundColor: theme.__hd__.pageControl.colors.paginatorBackgroundColor,
11937
+ marginHorizontal: theme.__hd__.pageControl.space.paginatorMarginHorizontal
11938
+ };
11939
+ });
11940
+
11941
+ var PageControl = function PageControl(_ref) {
11942
+ var numberOfPages = _ref.numberOfPages,
11943
+ _ref$currentPage = _ref.currentPage,
11944
+ currentPage = _ref$currentPage === void 0 ? 0 : _ref$currentPage,
11945
+ testID = _ref.testID,
11946
+ style = _ref.style;
11947
+ var theme = useTheme();
11948
+ var animatedValue = React.useRef(new Animated.Value(currentPage)).current;
11949
+ React.useEffect(function () {
11950
+ animatedValue.setValue(currentPage);
11951
+ }, [currentPage]);
11952
+ return /*#__PURE__*/React.createElement(StyledPageControl$2, {
11953
+ testID: testID,
11954
+ style: style
11955
+ }, new Array(numberOfPages).fill('').map(function (_, index) {
11956
+ var inputRange = [index - 1, index, index + 1];
11957
+ var indicatorWidth = animatedValue.interpolate({
11958
+ inputRange: inputRange,
11959
+ outputRange: [theme.space.small, theme.space.large, theme.space.small],
11960
+ extrapolate: 'clamp'
11961
+ });
11962
+ var opacity = animatedValue.interpolate({
11963
+ inputRange: inputRange,
11964
+ outputRange: [0.5, 1, 0.5],
11965
+ extrapolate: 'clamp'
11966
+ });
11967
+ return /*#__PURE__*/React.createElement(StyledPageControlAnimatedView, {
11968
+ accessibilityState: {
11969
+ selected: index === currentPage
11970
+ },
11971
+ style: [{
11972
+ width: indicatorWidth,
11973
+ opacity: opacity
11974
+ }],
11975
+ key: index.toString(),
11976
+ testID: "page-control-indicator".concat(index)
11977
+ });
11978
+ }));
11979
+ };
12021
11980
 
12022
- var StyledPageControl = index$a(PageControl)(function (_ref) {
11981
+ var StyledPageControl$1 = index$a(PageControl)(function (_ref) {
12023
11982
  var theme = _ref.theme;
12024
11983
  return {
12025
11984
  alignSelf: 'center',
@@ -12219,7 +12178,7 @@ var CardCarousel = /*#__PURE__*/forwardRef(function (_ref, ref) {
12219
12178
  viewabilityConfig: {
12220
12179
  itemVisiblePercentThreshold: 80
12221
12180
  }
12222
- }), !hidePageControl && /*#__PURE__*/React.createElement(StyledPageControl, {
12181
+ }), !hidePageControl && /*#__PURE__*/React.createElement(StyledPageControl$1, {
12223
12182
  testID: "pageControl",
12224
12183
  currentPage: currentIndex,
12225
12184
  numberOfPages: items.length
@@ -12227,6 +12186,134 @@ var CardCarousel = /*#__PURE__*/forwardRef(function (_ref, ref) {
12227
12186
  });
12228
12187
  CardCarousel.displayName = 'CardCarousel';
12229
12188
 
12189
+ var _excluded$j = ["rounded", "size", "testID", "style"];
12190
+ var Image = function Image(_ref) {
12191
+ var _ref$rounded = _ref.rounded,
12192
+ rounded = _ref$rounded === void 0 ? false : _ref$rounded,
12193
+ _ref$size = _ref.size,
12194
+ size = _ref$size === void 0 ? '6xlarge' : _ref$size,
12195
+ testID = _ref.testID,
12196
+ style = _ref.style,
12197
+ imageNativeProps = _objectWithoutProperties(_ref, _excluded$j);
12198
+ var theme = useTheme();
12199
+ var imageSize = theme.__hd__.image.sizes[size];
12200
+ return /*#__PURE__*/React.createElement(Image$1, _extends$1({
12201
+ testID: testID,
12202
+ style: [{
12203
+ width: imageSize,
12204
+ height: imageSize,
12205
+ borderRadius: rounded ? imageSize / 2 : 0
12206
+ }, style]
12207
+ }, imageNativeProps));
12208
+ };
12209
+
12210
+ var StyledBackDrop = index$a(View)(function (_ref) {
12211
+ var themeSlideBackground = _ref.themeSlideBackground;
12212
+ return {
12213
+ position: 'absolute',
12214
+ backgroundColor: themeSlideBackground,
12215
+ top: 0,
12216
+ bottom: 0,
12217
+ right: 0,
12218
+ left: 0
12219
+ };
12220
+ });
12221
+ var StyledCarouselView = index$a(View)(function () {
12222
+ return {
12223
+ flexGrow: 2,
12224
+ justifyContent: 'space-between'
12225
+ };
12226
+ });
12227
+ var StyledCarouselHeading = index$a(Typography.Title)(function (_ref2) {
12228
+ var theme = _ref2.theme;
12229
+ return {
12230
+ marginTop: theme.__hd__.carousel.space.headingMarginTop,
12231
+ marginBottom: theme.__hd__.carousel.space.headingMarginBottom
12232
+ };
12233
+ });
12234
+ var StyledCarouselImage = index$a(Image)(function () {
12235
+ return {
12236
+ flexGrow: 2,
12237
+ flex: 1,
12238
+ width: '100%',
12239
+ resizeMode: 'contain'
12240
+ };
12241
+ });
12242
+ var StyledCustomSizeCarouselImage = index$a(Image)(function (_ref3) {
12243
+ var height = _ref3.height,
12244
+ _ref3$resizeMode = _ref3.resizeMode,
12245
+ resizeMode = _ref3$resizeMode === void 0 ? 'contain' : _ref3$resizeMode,
12246
+ width = _ref3.width;
12247
+ return {
12248
+ alignSelf: 'center',
12249
+ width: width,
12250
+ height: height,
12251
+ resizeMode: resizeMode
12252
+ };
12253
+ });
12254
+ var StyledCarouselContentWrapper = index$a(Box)(function (_ref4) {
12255
+ var width = _ref4.width;
12256
+ return {
12257
+ width: width
12258
+ };
12259
+ });
12260
+ var StyledCarouselFooterWrapper = index$a(View)(function (_ref5) {
12261
+ var theme = _ref5.theme;
12262
+ return {
12263
+ paddingHorizontal: theme.__hd__.carousel.space.footerPaddingHorizontal,
12264
+ flexDirection: 'row',
12265
+ justifyContent: 'space-between',
12266
+ paddingVertical: theme.__hd__.carousel.space.footerPaddingVertical,
12267
+ marginBottom: theme.__hd__.carousel.space.footerMarginBottom
12268
+ };
12269
+ });
12270
+ var StyledPageControl = index$a(PageControl)(function (_ref6) {
12271
+ var theme = _ref6.theme;
12272
+ return {
12273
+ paddingVertical: theme.__hd__.carousel.space.pageControlPaddingVertical
12274
+ };
12275
+ });
12276
+ var StyledPageControlWrapper = index$a(View)(function (_ref7) {
12277
+ var theme = _ref7.theme;
12278
+ return {
12279
+ alignItems: 'center',
12280
+ justifyContent: 'center',
12281
+ height: theme.__hd__.carousel.space.pageControlWrapperHeight
12282
+ };
12283
+ });
12284
+
12285
+ function isCarouselImageProps(image) {
12286
+ return _typeof(image) === 'object';
12287
+ }
12288
+ var CarouselItem = function CarouselItem(_ref) {
12289
+ var width = _ref.width,
12290
+ image = _ref.image,
12291
+ content = _ref.content,
12292
+ heading = _ref.heading,
12293
+ body = _ref.body;
12294
+ return /*#__PURE__*/React.createElement(Box, {
12295
+ style: {
12296
+ width: width
12297
+ }
12298
+ }, image && (isCarouselImageProps(image) ? /*#__PURE__*/React.createElement(StyledCustomSizeCarouselImage, {
12299
+ source: image,
12300
+ height: image.height,
12301
+ width: image.width,
12302
+ resizeMode: image.resizeMode
12303
+ }) : /*#__PURE__*/React.createElement(StyledCarouselImage, {
12304
+ source: typeof image === 'string' ? {
12305
+ uri: image
12306
+ } : image
12307
+ })), /*#__PURE__*/React.createElement(StyledCarouselContentWrapper, {
12308
+ paddingHorizontal: "large",
12309
+ marginTop: "large",
12310
+ width: width
12311
+ }, content, /*#__PURE__*/React.createElement(StyledCarouselHeading, {
12312
+ level: "h1",
12313
+ typeface: "playful"
12314
+ }, heading), body ? /*#__PURE__*/React.createElement(Typography.Body, null, body) : null));
12315
+ };
12316
+
12230
12317
  var _excluded$i = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
12231
12318
  function useStateFromProp(initialValue) {
12232
12319
  var _useState = useState(initialValue),
@@ -12242,6 +12329,7 @@ var noop = function noop(_) {
12242
12329
  return true;
12243
12330
  };
12244
12331
  var Carousel = function Carousel(_ref) {
12332
+ var _items$currentSlideIn;
12245
12333
  var items = _ref.items,
12246
12334
  onItemIndexChange = _ref.onItemIndexChange,
12247
12335
  renderActions = _ref.renderActions,
@@ -12256,6 +12344,7 @@ var Carousel = function Carousel(_ref) {
12256
12344
  nativeProps = _objectWithoutProperties(_ref, _excluded$i);
12257
12345
  useDeprecation("shouldShowPagination prop has been deprecated", shouldShowPagination !== noop);
12258
12346
  useDeprecation("The use of 'pageControlPosition == bottom' has been deprecated", pageControlPosition === 'bottom');
12347
+ var theme = useTheme();
12259
12348
  var carouselRef = useRef(null);
12260
12349
  var _useStateFromProp = useStateFromProp(selectedItemIndex),
12261
12350
  _useStateFromProp2 = _slicedToArray(_useStateFromProp, 2),
@@ -12287,20 +12376,20 @@ var Carousel = function Carousel(_ref) {
12287
12376
  var viewConfig = useRef({
12288
12377
  viewAreaCoveragePercentThreshold: 50
12289
12378
  }).current;
12290
- var onViewCallBack = React.useCallback(function (info) {
12379
+ var onViewCallBack = useRef(function (info) {
12291
12380
  var firstVisibleItem = info.viewableItems.find(function (view) {
12292
12381
  return view.index != null && view.isViewable;
12293
12382
  });
12294
12383
  if (firstVisibleItem) {
12295
12384
  internalOnItemIndexChange(firstVisibleItem.index || 0);
12296
12385
  }
12297
- }, [internalOnItemIndexChange]);
12386
+ });
12298
12387
  return /*#__PURE__*/React.createElement(View, _extends$1({
12299
12388
  style: style,
12300
12389
  testID: testID
12301
12390
  }, nativeProps), /*#__PURE__*/React.createElement(StyledBackDrop, {
12302
- themeSlideBackground: items[currentSlideIndex].background
12303
- }), /*#__PURE__*/React.createElement(StyledPageControlWrapper, null, pageControlPosition === 'top' && shouldShowPagination(currentSlideIndex) && /*#__PURE__*/React.createElement(StyledPageControl$1, {
12391
+ themeSlideBackground: ((_items$currentSlideIn = items[currentSlideIndex]) === null || _items$currentSlideIn === void 0 ? void 0 : _items$currentSlideIn.background) || theme.colors.defaultGlobalSurface
12392
+ }), /*#__PURE__*/React.createElement(StyledPageControlWrapper, null, pageControlPosition === 'top' && shouldShowPagination(currentSlideIndex) && /*#__PURE__*/React.createElement(StyledPageControl, {
12304
12393
  numberOfPages: items.length,
12305
12394
  currentPage: currentSlideIndex
12306
12395
  })), /*#__PURE__*/React.createElement(StyledCarouselView, null, /*#__PURE__*/React.createElement(FlatList, {
@@ -12310,7 +12399,7 @@ var Carousel = function Carousel(_ref) {
12310
12399
  pagingEnabled: true,
12311
12400
  bounces: false,
12312
12401
  data: items,
12313
- onViewableItemsChanged: onViewCallBack,
12402
+ onViewableItemsChanged: onViewCallBack.current,
12314
12403
  viewabilityConfig: viewConfig,
12315
12404
  scrollEventThrottle: 32,
12316
12405
  ref: carouselRef,
@@ -12338,7 +12427,7 @@ var Carousel = function Carousel(_ref) {
12338
12427
  width: width
12339
12428
  });
12340
12429
  }
12341
- }), /*#__PURE__*/React.createElement(StyledCarouselFooterWrapper, null, renderActions && renderActions(currentSlideIndex), pageControlPosition === 'bottom' && shouldShowPagination(currentSlideIndex) && /*#__PURE__*/React.createElement(StyledPageControl$1, {
12430
+ }), /*#__PURE__*/React.createElement(StyledCarouselFooterWrapper, null, renderActions && renderActions(currentSlideIndex), pageControlPosition === 'bottom' && shouldShowPagination(currentSlideIndex) && /*#__PURE__*/React.createElement(StyledPageControl, {
12342
12431
  numberOfPages: items.length,
12343
12432
  currentPage: currentSlideIndex
12344
12433
  }))));
@@ -12429,7 +12518,7 @@ var StyledIconWrapper$3 = index$a(Box)(function (_ref2) {
12429
12518
  marginRight: theme.__hd__.chip.space.iconWrapperMarginRight
12430
12519
  };
12431
12520
  });
12432
- var StyledLabel$1 = index$a(Typography.Body)(function (_ref3) {
12521
+ var StyledLabel = index$a(Typography.Body)(function (_ref3) {
12433
12522
  var themeSelected = _ref3.themeSelected,
12434
12523
  themeVariant = _ref3.themeVariant,
12435
12524
  theme = _ref3.theme;
@@ -12475,7 +12564,7 @@ var Chip = function Chip(_ref) {
12475
12564
  themeSelected: selected,
12476
12565
  themeVariant: variant,
12477
12566
  testID: "chip-icon-".concat(internalIcon)
12478
- })), /*#__PURE__*/React.createElement(StyledLabel$1, {
12567
+ })), /*#__PURE__*/React.createElement(StyledLabel, {
12479
12568
  variant: "small",
12480
12569
  themeVariant: variant,
12481
12570
  themeSelected: selected
@@ -12581,45 +12670,22 @@ var StyledContainer$4 = index$a(View)(function (_ref) {
12581
12670
  marginTop: theme.__hd__.textInput.space.containerMarginTop
12582
12671
  };
12583
12672
  });
12584
- var StyledLabelContainer = index$a(View)(function (_ref2) {
12585
- var theme = _ref2.theme;
12673
+ var StyledLabelContainerInsideTextInput = index$a(Animated.View)(function (_ref2) {
12674
+ var themeVariant = _ref2.themeVariant,
12675
+ theme = _ref2.theme;
12586
12676
  return {
12587
- position: 'absolute',
12588
12677
  flexDirection: 'row',
12589
- left: theme.__hd__.textInput.space.labelLeft,
12590
- top: theme.__hd__.textInput.space.labelTop,
12591
- backgroundColor: theme.__hd__.textInput.colors.labelBackground,
12678
+ alignItems: themeVariant === 'text' ? 'center' : 'flex-start',
12679
+ position: 'absolute',
12592
12680
  zIndex: 1,
12593
- paddingHorizontal: theme.__hd__.textInput.space.labelHorizontalPadding
12681
+ left: -theme.__hd__.textInput.space.labelLeft,
12682
+ right: 0,
12683
+ top: -theme.__hd__.textInput.space.labelTop
12594
12684
  };
12595
12685
  });
12596
- var StyledLabel = index$a(Typography.Caption)(function (_ref3) {
12686
+ var StyledLabelInsideTextInput = index$a(Typography.Body)(function (_ref3) {
12597
12687
  var theme = _ref3.theme,
12598
12688
  themeState = _ref3.themeState;
12599
- return {
12600
- color: theme.__hd__.textInput.colors.labels[themeState],
12601
- lineHeight: theme.__hd__.textInput.lineHeights.topLabel
12602
- };
12603
- });
12604
- var StyledAsteriskLabel = index$a(Typography.Caption)(function (_ref4) {
12605
- var theme = _ref4.theme,
12606
- themeState = _ref4.themeState;
12607
- return {
12608
- color: theme.__hd__.textInput.colors.asterisks[themeState],
12609
- lineHeight: theme.__hd__.textInput.lineHeights.topLabel
12610
- };
12611
- });
12612
- var StyledLabelContainerInsideTextInput = index$a(View)(function (_ref5) {
12613
- var themeVariant = _ref5.themeVariant;
12614
- return _objectSpread2({
12615
- flexDirection: 'row',
12616
- zIndex: 9999,
12617
- alignItems: themeVariant === 'text' ? 'center' : 'flex-start'
12618
- }, StyleSheet$1.absoluteFillObject);
12619
- });
12620
- var StyledLabelInsideTextInput = index$a(Typography.Body)(function (_ref6) {
12621
- var theme = _ref6.theme,
12622
- themeState = _ref6.themeState;
12623
12689
  return {
12624
12690
  textAlignVertical: 'center',
12625
12691
  alignContent: 'center',
@@ -12628,15 +12694,15 @@ var StyledLabelInsideTextInput = index$a(Typography.Body)(function (_ref6) {
12628
12694
  marginTop: theme.__hd__.textInput.space.labelInsideTextInputMarginTop
12629
12695
  };
12630
12696
  });
12631
- var StyledAsteriskLabelInsideTextInput = index$a(Typography.Body)(function (_ref7) {
12632
- var theme = _ref7.theme,
12633
- themeState = _ref7.themeState;
12697
+ var StyledAsteriskLabelInsideTextInput = index$a(Typography.Body)(function (_ref4) {
12698
+ var theme = _ref4.theme,
12699
+ themeState = _ref4.themeState;
12634
12700
  return {
12635
12701
  color: theme.__hd__.textInput.colors.asterisks[themeState]
12636
12702
  };
12637
12703
  });
12638
- var StyledErrorContainer$2 = index$a(View)(function (_ref8) {
12639
- var theme = _ref8.theme;
12704
+ var StyledErrorContainer$2 = index$a(View)(function (_ref5) {
12705
+ var theme = _ref5.theme;
12640
12706
  return {
12641
12707
  marginRight: theme.__hd__.textInput.space.errorContainerMarginRight,
12642
12708
  flexDirection: 'row',
@@ -12645,16 +12711,16 @@ var StyledErrorContainer$2 = index$a(View)(function (_ref8) {
12645
12711
  flexGrow: 4
12646
12712
  };
12647
12713
  });
12648
- var StyledError = index$a(Typography.Caption)(function (_ref9) {
12649
- var theme = _ref9.theme;
12714
+ var StyledError = index$a(Typography.Caption)(function (_ref6) {
12715
+ var theme = _ref6.theme;
12650
12716
  return {
12651
12717
  color: theme.__hd__.textInput.colors.error,
12652
12718
  marginLeft: theme.__hd__.textInput.space.errorMarginLeft
12653
12719
  };
12654
12720
  });
12655
- var StyledMaxLengthMessage = index$a(Typography.Caption)(function (_ref10) {
12656
- var theme = _ref10.theme,
12657
- themeState = _ref10.themeState;
12721
+ var StyledMaxLengthMessage = index$a(Typography.Caption)(function (_ref7) {
12722
+ var theme = _ref7.theme,
12723
+ themeState = _ref7.themeState;
12658
12724
  return {
12659
12725
  color: theme.__hd__.textInput.colors.maxLengthLabels[themeState],
12660
12726
  marginRight: theme.__hd__.textInput.space.maxLengthLabelMarginLeft,
@@ -12665,9 +12731,9 @@ var StyledMaxLengthMessage = index$a(Typography.Caption)(function (_ref10) {
12665
12731
  };
12666
12732
  });
12667
12733
  var StyledHelperText = Typography.Caption;
12668
- var StyledTextInput = index$a(TextInput$1)(function (_ref11) {
12669
- var theme = _ref11.theme,
12670
- themeVariant = _ref11.themeVariant;
12734
+ var StyledTextInput = index$a(TextInput$1)(function (_ref8) {
12735
+ var theme = _ref8.theme,
12736
+ themeVariant = _ref8.themeVariant;
12671
12737
  return {
12672
12738
  textAlignVertical: themeVariant === 'text' ? 'center' : 'top',
12673
12739
  fontSize: theme.__hd__.textInput.fontSizes.text,
@@ -12680,19 +12746,19 @@ var StyledTextInput = index$a(TextInput$1)(function (_ref11) {
12680
12746
  fontFamily: theme.__hd__.textInput.fonts.text
12681
12747
  };
12682
12748
  });
12683
- var StyledBorderBackDrop = index$a(View)(function (_ref12) {
12749
+ var StyledBorderBackDrop = index$a(View)(function (_ref9) {
12684
12750
  var _theme$__hd__$textInp;
12685
- var theme = _ref12.theme,
12686
- themeFocused = _ref12.themeFocused,
12687
- themeState = _ref12.themeState;
12751
+ var theme = _ref9.theme,
12752
+ themeFocused = _ref9.themeFocused,
12753
+ themeState = _ref9.themeState;
12688
12754
  return _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
12689
12755
  borderWidth: themeFocused ? theme.__hd__.textInput.borderWidths.container.focused : theme.__hd__.textInput.borderWidths.container.normal,
12690
12756
  borderRadius: theme.__hd__.textInput.radii.container,
12691
12757
  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"]
12692
12758
  });
12693
12759
  });
12694
- var StyledTextInputContainer = index$a(View)(function (_ref13) {
12695
- var theme = _ref13.theme;
12760
+ var StyledTextInputContainer = index$a(View)(function (_ref10) {
12761
+ var theme = _ref10.theme;
12696
12762
  return {
12697
12763
  flexDirection: 'row',
12698
12764
  alignItems: 'center',
@@ -12710,8 +12776,8 @@ var StyledTextInputAndLabelContainer = index$a(View)(function () {
12710
12776
  flexShrink: 1
12711
12777
  };
12712
12778
  });
12713
- var StyledErrorAndHelpTextContainer = index$a(View)(function (_ref14) {
12714
- var theme = _ref14.theme;
12779
+ var StyledErrorAndHelpTextContainer = index$a(View)(function (_ref11) {
12780
+ var theme = _ref11.theme;
12715
12781
  return {
12716
12782
  paddingLeft: theme.__hd__.textInput.space.errorAndHelpTextContainerPaddingLeft,
12717
12783
  minHeight: theme.__hd__.textInput.sizes.errorAndHelpTextContainerHeight,
@@ -12749,6 +12815,7 @@ var getState$1 = function getState(_ref) {
12749
12815
  // Fix issue: Placeholder is not shown on iOS when multiline is true
12750
12816
  // https://github.com/callstack/react-native-paper/pull/3331
12751
12817
  var EMPTY_PLACEHOLDER_VALUE = ' ';
12818
+ var LABEL_ANIMATION_DURATION = 150;
12752
12819
  var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
12753
12820
  var _ref3;
12754
12821
  var label = _ref2.label,
@@ -12781,10 +12848,18 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
12781
12848
  var displayText = (_ref3 = value !== undefined ? value : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
12782
12849
  var isEmptyValue = displayText.length === 0;
12783
12850
  var actualSuffix = loading ? 'loading' : suffix;
12784
- var _React$useState = React.useState(false),
12851
+ var _React$useState = React.useState(0),
12785
12852
  _React$useState2 = _slicedToArray(_React$useState, 2),
12786
- isFocused = _React$useState2[0],
12787
- setIsFocused = _React$useState2[1];
12853
+ inputHeight = _React$useState2[0],
12854
+ setInputHeight = _React$useState2[1];
12855
+ var _React$useState3 = React.useState(0),
12856
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
12857
+ prefixWidth = _React$useState4[0],
12858
+ setPrefixWidth = _React$useState4[1];
12859
+ var _React$useState5 = React.useState(false),
12860
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
12861
+ isFocused = _React$useState6[0],
12862
+ setIsFocused = _React$useState6[1];
12788
12863
  var state = getState$1({
12789
12864
  disabled: disabled,
12790
12865
  error: error,
@@ -12795,6 +12870,23 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
12795
12870
  });
12796
12871
  var shouldShowMaxLength = maxLength !== undefined && !hideCharacterCount;
12797
12872
  var theme = useTheme();
12873
+ var focusAnimation = useRef(new Animated.Value(0)).current;
12874
+ useEffect(function () {
12875
+ Animated.timing(focusAnimation, {
12876
+ toValue: isFocused || !isEmptyValue ? 1 : 0,
12877
+ duration: LABEL_ANIMATION_DURATION,
12878
+ easing: Easing.bezier(0.4, 0, 0.2, 1),
12879
+ useNativeDriver: true
12880
+ }).start();
12881
+ }, [focusAnimation, isEmptyValue, isFocused]);
12882
+ var onLayout = useCallback(function (event) {
12883
+ var height = event.nativeEvent.layout.height;
12884
+ setInputHeight(height);
12885
+ }, []);
12886
+ var onPrefixLayout = useCallback(function (event) {
12887
+ var width = event.nativeEvent.layout.width;
12888
+ setPrefixWidth(width);
12889
+ }, []);
12798
12890
  var innerTextInput = React.useRef();
12799
12891
  React.useImperativeHandle(ref, function () {
12800
12892
  return {
@@ -12892,43 +12984,59 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
12892
12984
  style: styleWithoutBackgroundColor,
12893
12985
  pointerEvents: state === 'disabled' || state === 'readonly' ? 'none' : 'auto',
12894
12986
  testID: testID
12895
- }, /*#__PURE__*/React.createElement(StyledTextInputContainer, null, /*#__PURE__*/React.createElement(StyledBorderBackDrop, {
12987
+ }, /*#__PURE__*/React.createElement(StyledTextInputContainer, {
12988
+ onLayout: onLayout
12989
+ }, /*#__PURE__*/React.createElement(StyledBorderBackDrop, {
12896
12990
  themeFocused: isFocused,
12897
12991
  themeState: state,
12898
12992
  testID: "text-input-border",
12899
12993
  style: [{
12900
12994
  backgroundColor: backgroundColor
12901
12995
  }, borderStyle]
12902
- }), (isFocused || label && !isEmptyValue) && /*#__PURE__*/React.createElement(StyledLabelContainer, {
12903
- pointerEvents: "none",
12904
- testID: "label-container",
12905
- style: {
12906
- backgroundColor: backgroundColor
12907
- }
12908
- }, required && /*#__PURE__*/React.createElement(StyledAsteriskLabel, {
12909
- themeState: state
12910
- }, "*"), !!label && /*#__PURE__*/React.createElement(StyledLabel, {
12911
- nativeID: accessibilityLabelledBy,
12912
- testID: "input-label",
12913
- themeState: state,
12914
- style: {
12915
- backgroundColor: backgroundColor
12916
- }
12917
- }, label)), typeof prefix === 'string' ? /*#__PURE__*/React.createElement(Icon, {
12996
+ }), /*#__PURE__*/React.createElement(View, {
12997
+ onLayout: onPrefixLayout
12998
+ }, typeof prefix === 'string' ? /*#__PURE__*/React.createElement(Icon, {
12918
12999
  intent: state === 'disabled' ? 'disabled-text' : 'text',
12919
13000
  testID: "input-prefix",
12920
13001
  icon: prefix,
12921
13002
  size: "xsmall"
12922
- }) : prefix, /*#__PURE__*/React.createElement(StyledTextInputAndLabelContainer, null, !isFocused && isEmptyValue && /*#__PURE__*/React.createElement(StyledLabelContainerInsideTextInput, {
13003
+ }) : prefix), /*#__PURE__*/React.createElement(StyledLabelContainerInsideTextInput, {
12923
13004
  themeVariant: variant,
12924
- pointerEvents: "none"
13005
+ pointerEvents: "none",
13006
+ style: [{
13007
+ position: 'absolute'
13008
+ }, {
13009
+ transform: [{
13010
+ translateY: focusAnimation.interpolate({
13011
+ inputRange: [0, 1],
13012
+ outputRange: [variant !== 'textarea' ? inputHeight / 2 : theme.space.large, 0]
13013
+ })
13014
+ }, {
13015
+ translateX: focusAnimation.interpolate({
13016
+ inputRange: [0, 1],
13017
+ outputRange: [prefix ? prefixWidth * 4 : theme.space.xxxlarge, 0]
13018
+ })
13019
+ }, {
13020
+ scale: focusAnimation.interpolate({
13021
+ inputRange: [0, 1],
13022
+ outputRange: [1, 0.75]
13023
+ })
13024
+ }]
13025
+ }]
12925
13026
  }, required && /*#__PURE__*/React.createElement(StyledAsteriskLabelInsideTextInput, {
12926
- themeState: state
13027
+ style: {
13028
+ backgroundColor: backgroundColor
13029
+ },
13030
+ themeState: state,
13031
+ testID: "input-label-asterisk"
12927
13032
  }, "*"), !!label && /*#__PURE__*/React.createElement(StyledLabelInsideTextInput, {
13033
+ style: {
13034
+ backgroundColor: backgroundColor
13035
+ },
12928
13036
  nativeID: accessibilityLabelledBy,
12929
13037
  testID: "input-label",
12930
13038
  themeState: state
12931
- }, label)), renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
13039
+ }, label)), /*#__PURE__*/React.createElement(StyledTextInputAndLabelContainer, null, renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
12932
13040
  themeVariant: variant,
12933
13041
  multiline: variant === 'textarea' || nativeProps.multiline,
12934
13042
  ref: function ref(reference) {
@@ -33923,6 +34031,23 @@ var RichTextEditor = function RichTextEditor(_ref) {
33923
34031
  postMessage(webview.current, message);
33924
34032
  }
33925
34033
  };
34034
+ var _React$useState = React.useState(0),
34035
+ _React$useState2 = _slicedToArray(_React$useState, 2),
34036
+ inputHeight = _React$useState2[0],
34037
+ setInputHeight = _React$useState2[1];
34038
+ var focusAnimation = useRef(new Animated.Value(0)).current;
34039
+ useEffect(function () {
34040
+ Animated.timing(focusAnimation, {
34041
+ toValue: isFocused || !isEmptyValue ? 1 : 0,
34042
+ duration: LABEL_ANIMATION_DURATION,
34043
+ easing: Easing.bezier(0.4, 0, 0.2, 1),
34044
+ useNativeDriver: true
34045
+ }).start();
34046
+ }, [focusAnimation, isEmptyValue, isFocused]);
34047
+ var onLayout = useCallback(function (event) {
34048
+ var height = event.nativeEvent.layout.height;
34049
+ setInputHeight(height);
34050
+ }, []);
33926
34051
  useEffect(function () {
33927
34052
  var removeFocusListener = on(emitter, normalizeEventName('editor-focus'), function () {
33928
34053
  return setIsFocused(true);
@@ -34012,25 +34137,47 @@ var RichTextEditor = function RichTextEditor(_ref) {
34012
34137
  }, []);
34013
34138
  return /*#__PURE__*/React.createElement(StyledContainer$4, {
34014
34139
  testID: testID
34015
- }, /*#__PURE__*/React.createElement(StyledTextInputContainer, null, /*#__PURE__*/React.createElement(StyledBorderBackDrop, {
34016
- themeState: state,
34017
- themeFocused: isFocused
34018
- }), (isFocused || label && !isEmptyValue) && /*#__PURE__*/React.createElement(StyledLabelContainer, {
34019
- pointerEvents: "none"
34020
- }, required && /*#__PURE__*/React.createElement(StyledAsteriskLabel, {
34021
- themeState: state
34022
- }, "*"), !!label && /*#__PURE__*/React.createElement(StyledLabel, {
34023
- testID: "input-label",
34024
- themeState: state
34025
- }, label)), /*#__PURE__*/React.createElement(StyledTextInputAndLabelContainer, null, !isFocused && isEmptyValue && /*#__PURE__*/React.createElement(StyledLabelContainerInsideTextInput, {
34140
+ }, /*#__PURE__*/React.createElement(StyledLabelContainerInsideTextInput, {
34026
34141
  themeVariant: "text",
34027
- pointerEvents: "none"
34142
+ pointerEvents: "none",
34143
+ testID: "input-label-container",
34144
+ style: [{
34145
+ position: 'absolute'
34146
+ }, {
34147
+ transform: [{
34148
+ translateY: focusAnimation.interpolate({
34149
+ inputRange: [0, 1],
34150
+ outputRange: [inputHeight / 2, 0]
34151
+ })
34152
+ }, {
34153
+ translateX: focusAnimation.interpolate({
34154
+ inputRange: [0, 1],
34155
+ outputRange: [theme.space.xxxlarge, 0]
34156
+ })
34157
+ }, {
34158
+ scale: focusAnimation.interpolate({
34159
+ inputRange: [0, 1],
34160
+ outputRange: [1, 0.75]
34161
+ })
34162
+ }]
34163
+ }]
34028
34164
  }, required && /*#__PURE__*/React.createElement(StyledAsteriskLabelInsideTextInput, {
34165
+ style: {
34166
+ backgroundColor: theme.__hd__.textInput.colors.labelBackground
34167
+ },
34029
34168
  themeState: state
34030
34169
  }, "*"), !!label && /*#__PURE__*/React.createElement(StyledLabelInsideTextInput, {
34170
+ style: {
34171
+ backgroundColor: theme.__hd__.textInput.colors.labelBackground
34172
+ },
34031
34173
  testID: "input-label",
34032
34174
  themeState: state
34033
- }, label)), /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
34175
+ }, label)), /*#__PURE__*/React.createElement(StyledTextInputContainer, {
34176
+ onLayout: onLayout
34177
+ }, /*#__PURE__*/React.createElement(StyledBorderBackDrop, {
34178
+ themeState: state,
34179
+ themeFocused: isFocused
34180
+ }), /*#__PURE__*/React.createElement(StyledTextInputAndLabelContainer, null, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
34034
34181
  onPress: function onPress(e) {
34035
34182
  return e.stopPropagation();
34036
34183
  }