@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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +12 -2
- package/es/index.js +731 -584
- package/lib/index.js +731 -584
- package/package.json +1 -1
- package/src/components/Accordion/index.tsx +1 -1
- package/src/components/Avatar/AvatarStack/StyledAvatarStack.tsx +63 -9
- package/src/components/Avatar/AvatarStack/__tests__/StyledAvatarStack.spec.tsx +71 -9
- package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/StyledAvatarStack.spec.tsx.snap +271 -2
- package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/index.spec.tsx.snap +2156 -7
- package/src/components/Avatar/AvatarStack/__tests__/index.spec.tsx +140 -6
- package/src/components/Avatar/AvatarStack/index.tsx +94 -9
- package/src/components/Carousel/index.tsx +18 -11
- package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +102 -57
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +34 -19
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +34 -19
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +34 -19
- package/src/components/RichTextEditor/RichTextEditor.tsx +76 -38
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +126 -102
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +235 -146
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +201 -127
- package/src/components/TextInput/StyledTextInput.tsx +8 -31
- package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +0 -44
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +21 -638
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +1126 -833
- package/src/components/TextInput/__tests__/index.spec.tsx +2 -2
- package/src/components/TextInput/index.tsx +113 -57
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +68 -38
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +68 -38
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +2 -2
- package/src/theme/components/textInput.ts +2 -2
- package/types/components/Accordion/index.d.ts +1 -1
- package/types/components/Avatar/AvatarStack/StyledAvatarStack.d.ts +13 -0
- package/types/components/Avatar/AvatarStack/index.d.ts +14 -2
- package/types/components/Avatar/index.d.ts +1 -1
- package/types/components/TextInput/StyledTextInput.d.ts +4 -24
- 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.
|
|
3367
|
-
labelTop: theme.
|
|
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$
|
|
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$
|
|
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
|
-
|
|
7542
|
-
|
|
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:
|
|
7842
|
-
width:
|
|
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:
|
|
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
|
|
7881
|
-
var
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
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
|
-
|
|
7890
|
-
var
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
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({
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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) {
|
|
@@ -8940,243 +9247,23 @@ var BottomSheet = function BottomSheet(_ref) {
|
|
|
8940
9247
|
scaleY: height > 0 ? 1 : 0
|
|
8941
9248
|
}, {
|
|
8942
9249
|
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
|
-
}, {});
|
|
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
|
|
9160
|
-
|
|
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,191 +11897,6 @@ 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));
|
|
11832
|
-
};
|
|
11833
|
-
|
|
11834
|
-
var StyledPageControl$2 = index$a(reactNative.View)(function () {
|
|
11835
|
-
return {
|
|
11836
|
-
flexDirection: 'row',
|
|
11837
|
-
alignItems: 'center'
|
|
11838
|
-
};
|
|
11839
|
-
});
|
|
11840
|
-
var StyledPageControlAnimatedView = index$a(reactNative.Animated.View)(function (_ref) {
|
|
11841
|
-
var theme = _ref.theme;
|
|
11842
|
-
return {
|
|
11843
|
-
height: theme.__hd__.pageControl.sizes.paginatorHeight,
|
|
11844
|
-
width: theme.__hd__.pageControl.sizes.paginatorWidth,
|
|
11845
|
-
borderRadius: theme.__hd__.pageControl.radii.paginatorBorderRadius,
|
|
11846
|
-
backgroundColor: theme.__hd__.pageControl.colors.paginatorBackgroundColor,
|
|
11847
|
-
marginHorizontal: theme.__hd__.pageControl.space.paginatorMarginHorizontal
|
|
11848
|
-
};
|
|
11849
|
-
});
|
|
11850
|
-
|
|
11851
|
-
var PageControl = function PageControl(_ref) {
|
|
11852
|
-
var numberOfPages = _ref.numberOfPages,
|
|
11853
|
-
_ref$currentPage = _ref.currentPage,
|
|
11854
|
-
currentPage = _ref$currentPage === void 0 ? 0 : _ref$currentPage,
|
|
11855
|
-
testID = _ref.testID,
|
|
11856
|
-
style = _ref.style;
|
|
11857
|
-
var theme = useTheme();
|
|
11858
|
-
var animatedValue = React__default["default"].useRef(new reactNative.Animated.Value(currentPage)).current;
|
|
11859
|
-
React__default["default"].useEffect(function () {
|
|
11860
|
-
animatedValue.setValue(currentPage);
|
|
11861
|
-
}, [currentPage]);
|
|
11862
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledPageControl$2, {
|
|
11863
|
-
testID: testID,
|
|
11864
|
-
style: style
|
|
11865
|
-
}, new Array(numberOfPages).fill('').map(function (_, index) {
|
|
11866
|
-
var inputRange = [index - 1, index, index + 1];
|
|
11867
|
-
var indicatorWidth = animatedValue.interpolate({
|
|
11868
|
-
inputRange: inputRange,
|
|
11869
|
-
outputRange: [theme.space.small, theme.space.large, theme.space.small],
|
|
11870
|
-
extrapolate: 'clamp'
|
|
11871
|
-
});
|
|
11872
|
-
var opacity = animatedValue.interpolate({
|
|
11873
|
-
inputRange: inputRange,
|
|
11874
|
-
outputRange: [0.5, 1, 0.5],
|
|
11875
|
-
extrapolate: 'clamp'
|
|
11876
|
-
});
|
|
11877
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledPageControlAnimatedView, {
|
|
11878
|
-
accessibilityState: {
|
|
11879
|
-
selected: index === currentPage
|
|
11880
|
-
},
|
|
11881
|
-
style: [{
|
|
11882
|
-
width: indicatorWidth,
|
|
11883
|
-
opacity: opacity
|
|
11884
|
-
}],
|
|
11885
|
-
key: index.toString(),
|
|
11886
|
-
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
11900
|
var StyledDataCard = index$a(reactNative.View)(function (_ref) {
|
|
11999
11901
|
var theme = _ref.theme;
|
|
12000
11902
|
return {
|
|
@@ -12013,12 +11915,12 @@ var Indicator = index$a(reactNative.View)(function (_ref2) {
|
|
|
12013
11915
|
};
|
|
12014
11916
|
});
|
|
12015
11917
|
|
|
12016
|
-
var _excluded$
|
|
11918
|
+
var _excluded$l = ["intent", "children"];
|
|
12017
11919
|
var DataCard = function DataCard(_ref) {
|
|
12018
11920
|
var _ref$intent = _ref.intent,
|
|
12019
11921
|
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
12020
11922
|
children = _ref.children,
|
|
12021
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
11923
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$l);
|
|
12022
11924
|
return /*#__PURE__*/React__default["default"].createElement(StyledDataCard, nativeProps, /*#__PURE__*/React__default["default"].createElement(Indicator, {
|
|
12023
11925
|
themeIntent: intent,
|
|
12024
11926
|
testID: "data-card-indicator"
|
|
@@ -12036,20 +11938,77 @@ var StyledCard$1 = index$a(reactNative.View)(function (_ref) {
|
|
|
12036
11938
|
});
|
|
12037
11939
|
});
|
|
12038
11940
|
|
|
12039
|
-
var _excluded$
|
|
11941
|
+
var _excluded$k = ["intent", "children"];
|
|
12040
11942
|
var Card = function Card(_ref) {
|
|
12041
11943
|
var intent = _ref.intent,
|
|
12042
11944
|
children = _ref.children,
|
|
12043
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
11945
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$k);
|
|
12044
11946
|
return /*#__PURE__*/React__default["default"].createElement(StyledCard$1, _extends$1({}, nativeProps, {
|
|
12045
11947
|
themeIntent: intent
|
|
12046
11948
|
}), children);
|
|
12047
11949
|
};
|
|
12048
|
-
var Card$1 = Object.assign(Card, {
|
|
12049
|
-
Data: DataCard
|
|
12050
|
-
});
|
|
11950
|
+
var Card$1 = Object.assign(Card, {
|
|
11951
|
+
Data: DataCard
|
|
11952
|
+
});
|
|
11953
|
+
|
|
11954
|
+
var StyledPageControl$2 = index$a(reactNative.View)(function () {
|
|
11955
|
+
return {
|
|
11956
|
+
flexDirection: 'row',
|
|
11957
|
+
alignItems: 'center'
|
|
11958
|
+
};
|
|
11959
|
+
});
|
|
11960
|
+
var StyledPageControlAnimatedView = index$a(reactNative.Animated.View)(function (_ref) {
|
|
11961
|
+
var theme = _ref.theme;
|
|
11962
|
+
return {
|
|
11963
|
+
height: theme.__hd__.pageControl.sizes.paginatorHeight,
|
|
11964
|
+
width: theme.__hd__.pageControl.sizes.paginatorWidth,
|
|
11965
|
+
borderRadius: theme.__hd__.pageControl.radii.paginatorBorderRadius,
|
|
11966
|
+
backgroundColor: theme.__hd__.pageControl.colors.paginatorBackgroundColor,
|
|
11967
|
+
marginHorizontal: theme.__hd__.pageControl.space.paginatorMarginHorizontal
|
|
11968
|
+
};
|
|
11969
|
+
});
|
|
11970
|
+
|
|
11971
|
+
var PageControl = function PageControl(_ref) {
|
|
11972
|
+
var numberOfPages = _ref.numberOfPages,
|
|
11973
|
+
_ref$currentPage = _ref.currentPage,
|
|
11974
|
+
currentPage = _ref$currentPage === void 0 ? 0 : _ref$currentPage,
|
|
11975
|
+
testID = _ref.testID,
|
|
11976
|
+
style = _ref.style;
|
|
11977
|
+
var theme = useTheme();
|
|
11978
|
+
var animatedValue = React__default["default"].useRef(new reactNative.Animated.Value(currentPage)).current;
|
|
11979
|
+
React__default["default"].useEffect(function () {
|
|
11980
|
+
animatedValue.setValue(currentPage);
|
|
11981
|
+
}, [currentPage]);
|
|
11982
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledPageControl$2, {
|
|
11983
|
+
testID: testID,
|
|
11984
|
+
style: style
|
|
11985
|
+
}, new Array(numberOfPages).fill('').map(function (_, index) {
|
|
11986
|
+
var inputRange = [index - 1, index, index + 1];
|
|
11987
|
+
var indicatorWidth = animatedValue.interpolate({
|
|
11988
|
+
inputRange: inputRange,
|
|
11989
|
+
outputRange: [theme.space.small, theme.space.large, theme.space.small],
|
|
11990
|
+
extrapolate: 'clamp'
|
|
11991
|
+
});
|
|
11992
|
+
var opacity = animatedValue.interpolate({
|
|
11993
|
+
inputRange: inputRange,
|
|
11994
|
+
outputRange: [0.5, 1, 0.5],
|
|
11995
|
+
extrapolate: 'clamp'
|
|
11996
|
+
});
|
|
11997
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledPageControlAnimatedView, {
|
|
11998
|
+
accessibilityState: {
|
|
11999
|
+
selected: index === currentPage
|
|
12000
|
+
},
|
|
12001
|
+
style: [{
|
|
12002
|
+
width: indicatorWidth,
|
|
12003
|
+
opacity: opacity
|
|
12004
|
+
}],
|
|
12005
|
+
key: index.toString(),
|
|
12006
|
+
testID: "page-control-indicator".concat(index)
|
|
12007
|
+
});
|
|
12008
|
+
}));
|
|
12009
|
+
};
|
|
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 =
|
|
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
|
-
}
|
|
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
|
|
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
|
|
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
|
|
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
|
|
12597
|
+
})), /*#__PURE__*/React__default["default"].createElement(StyledLabel, {
|
|
12509
12598
|
variant: "small",
|
|
12510
12599
|
themeVariant: variant,
|
|
12511
12600
|
themeSelected: selected
|
|
@@ -12611,45 +12700,22 @@ var StyledContainer$4 = index$a(reactNative.View)(function (_ref) {
|
|
|
12611
12700
|
marginTop: theme.__hd__.textInput.space.containerMarginTop
|
|
12612
12701
|
};
|
|
12613
12702
|
});
|
|
12614
|
-
var
|
|
12615
|
-
var
|
|
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
|
-
|
|
12620
|
-
|
|
12621
|
-
backgroundColor: theme.__hd__.textInput.colors.labelBackground,
|
|
12708
|
+
alignItems: themeVariant === 'text' ? 'center' : 'flex-start',
|
|
12709
|
+
position: 'absolute',
|
|
12622
12710
|
zIndex: 1,
|
|
12623
|
-
|
|
12711
|
+
left: -theme.__hd__.textInput.space.labelLeft,
|
|
12712
|
+
right: 0,
|
|
12713
|
+
top: -theme.__hd__.textInput.space.labelTop
|
|
12624
12714
|
};
|
|
12625
12715
|
});
|
|
12626
|
-
var
|
|
12716
|
+
var StyledLabelInsideTextInput = index$a(Typography.Body)(function (_ref3) {
|
|
12627
12717
|
var theme = _ref3.theme,
|
|
12628
12718
|
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
12719
|
return {
|
|
12654
12720
|
textAlignVertical: 'center',
|
|
12655
12721
|
alignContent: 'center',
|
|
@@ -12658,15 +12724,15 @@ var StyledLabelInsideTextInput = index$a(Typography.Body)(function (_ref6) {
|
|
|
12658
12724
|
marginTop: theme.__hd__.textInput.space.labelInsideTextInputMarginTop
|
|
12659
12725
|
};
|
|
12660
12726
|
});
|
|
12661
|
-
var StyledAsteriskLabelInsideTextInput = index$a(Typography.Body)(function (
|
|
12662
|
-
var theme =
|
|
12663
|
-
themeState =
|
|
12727
|
+
var StyledAsteriskLabelInsideTextInput = index$a(Typography.Body)(function (_ref4) {
|
|
12728
|
+
var theme = _ref4.theme,
|
|
12729
|
+
themeState = _ref4.themeState;
|
|
12664
12730
|
return {
|
|
12665
12731
|
color: theme.__hd__.textInput.colors.asterisks[themeState]
|
|
12666
12732
|
};
|
|
12667
12733
|
});
|
|
12668
|
-
var StyledErrorContainer$2 = index$a(reactNative.View)(function (
|
|
12669
|
-
var theme =
|
|
12734
|
+
var StyledErrorContainer$2 = index$a(reactNative.View)(function (_ref5) {
|
|
12735
|
+
var theme = _ref5.theme;
|
|
12670
12736
|
return {
|
|
12671
12737
|
marginRight: theme.__hd__.textInput.space.errorContainerMarginRight,
|
|
12672
12738
|
flexDirection: 'row',
|
|
@@ -12675,16 +12741,16 @@ var StyledErrorContainer$2 = index$a(reactNative.View)(function (_ref8) {
|
|
|
12675
12741
|
flexGrow: 4
|
|
12676
12742
|
};
|
|
12677
12743
|
});
|
|
12678
|
-
var StyledError = index$a(Typography.Caption)(function (
|
|
12679
|
-
var theme =
|
|
12744
|
+
var StyledError = index$a(Typography.Caption)(function (_ref6) {
|
|
12745
|
+
var theme = _ref6.theme;
|
|
12680
12746
|
return {
|
|
12681
12747
|
color: theme.__hd__.textInput.colors.error,
|
|
12682
12748
|
marginLeft: theme.__hd__.textInput.space.errorMarginLeft
|
|
12683
12749
|
};
|
|
12684
12750
|
});
|
|
12685
|
-
var StyledMaxLengthMessage = index$a(Typography.Caption)(function (
|
|
12686
|
-
var theme =
|
|
12687
|
-
themeState =
|
|
12751
|
+
var StyledMaxLengthMessage = index$a(Typography.Caption)(function (_ref7) {
|
|
12752
|
+
var theme = _ref7.theme,
|
|
12753
|
+
themeState = _ref7.themeState;
|
|
12688
12754
|
return {
|
|
12689
12755
|
color: theme.__hd__.textInput.colors.maxLengthLabels[themeState],
|
|
12690
12756
|
marginRight: theme.__hd__.textInput.space.maxLengthLabelMarginLeft,
|
|
@@ -12695,9 +12761,9 @@ var StyledMaxLengthMessage = index$a(Typography.Caption)(function (_ref10) {
|
|
|
12695
12761
|
};
|
|
12696
12762
|
});
|
|
12697
12763
|
var StyledHelperText = Typography.Caption;
|
|
12698
|
-
var StyledTextInput = index$a(reactNative.TextInput)(function (
|
|
12699
|
-
var theme =
|
|
12700
|
-
themeVariant =
|
|
12764
|
+
var StyledTextInput = index$a(reactNative.TextInput)(function (_ref8) {
|
|
12765
|
+
var theme = _ref8.theme,
|
|
12766
|
+
themeVariant = _ref8.themeVariant;
|
|
12701
12767
|
return {
|
|
12702
12768
|
textAlignVertical: themeVariant === 'text' ? 'center' : 'top',
|
|
12703
12769
|
fontSize: theme.__hd__.textInput.fontSizes.text,
|
|
@@ -12710,19 +12776,19 @@ var StyledTextInput = index$a(reactNative.TextInput)(function (_ref11) {
|
|
|
12710
12776
|
fontFamily: theme.__hd__.textInput.fonts.text
|
|
12711
12777
|
};
|
|
12712
12778
|
});
|
|
12713
|
-
var StyledBorderBackDrop = index$a(reactNative.View)(function (
|
|
12779
|
+
var StyledBorderBackDrop = index$a(reactNative.View)(function (_ref9) {
|
|
12714
12780
|
var _theme$__hd__$textInp;
|
|
12715
|
-
var theme =
|
|
12716
|
-
themeFocused =
|
|
12717
|
-
themeState =
|
|
12781
|
+
var theme = _ref9.theme,
|
|
12782
|
+
themeFocused = _ref9.themeFocused,
|
|
12783
|
+
themeState = _ref9.themeState;
|
|
12718
12784
|
return _objectSpread2(_objectSpread2({}, reactNative.StyleSheet.absoluteFillObject), {}, {
|
|
12719
12785
|
borderWidth: themeFocused ? theme.__hd__.textInput.borderWidths.container.focused : theme.__hd__.textInput.borderWidths.container.normal,
|
|
12720
12786
|
borderRadius: theme.__hd__.textInput.radii.container,
|
|
12721
12787
|
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
12788
|
});
|
|
12723
12789
|
});
|
|
12724
|
-
var StyledTextInputContainer = index$a(reactNative.View)(function (
|
|
12725
|
-
var theme =
|
|
12790
|
+
var StyledTextInputContainer = index$a(reactNative.View)(function (_ref10) {
|
|
12791
|
+
var theme = _ref10.theme;
|
|
12726
12792
|
return {
|
|
12727
12793
|
flexDirection: 'row',
|
|
12728
12794
|
alignItems: 'center',
|
|
@@ -12740,8 +12806,8 @@ var StyledTextInputAndLabelContainer = index$a(reactNative.View)(function () {
|
|
|
12740
12806
|
flexShrink: 1
|
|
12741
12807
|
};
|
|
12742
12808
|
});
|
|
12743
|
-
var StyledErrorAndHelpTextContainer = index$a(reactNative.View)(function (
|
|
12744
|
-
var theme =
|
|
12809
|
+
var StyledErrorAndHelpTextContainer = index$a(reactNative.View)(function (_ref11) {
|
|
12810
|
+
var theme = _ref11.theme;
|
|
12745
12811
|
return {
|
|
12746
12812
|
paddingLeft: theme.__hd__.textInput.space.errorAndHelpTextContainerPaddingLeft,
|
|
12747
12813
|
minHeight: theme.__hd__.textInput.sizes.errorAndHelpTextContainerHeight,
|
|
@@ -12779,6 +12845,7 @@ var getState$1 = function getState(_ref) {
|
|
|
12779
12845
|
// Fix issue: Placeholder is not shown on iOS when multiline is true
|
|
12780
12846
|
// https://github.com/callstack/react-native-paper/pull/3331
|
|
12781
12847
|
var EMPTY_PLACEHOLDER_VALUE = ' ';
|
|
12848
|
+
var LABEL_ANIMATION_DURATION = 150;
|
|
12782
12849
|
var TextInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
12783
12850
|
var _ref3;
|
|
12784
12851
|
var label = _ref2.label,
|
|
@@ -12811,10 +12878,18 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
|
12811
12878
|
var displayText = (_ref3 = value !== undefined ? value : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
|
|
12812
12879
|
var isEmptyValue = displayText.length === 0;
|
|
12813
12880
|
var actualSuffix = loading ? 'loading' : suffix;
|
|
12814
|
-
var _React$useState = React__default["default"].useState(
|
|
12881
|
+
var _React$useState = React__default["default"].useState(0),
|
|
12815
12882
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
12816
|
-
|
|
12817
|
-
|
|
12883
|
+
inputHeight = _React$useState2[0],
|
|
12884
|
+
setInputHeight = _React$useState2[1];
|
|
12885
|
+
var _React$useState3 = React__default["default"].useState(0),
|
|
12886
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
12887
|
+
prefixWidth = _React$useState4[0],
|
|
12888
|
+
setPrefixWidth = _React$useState4[1];
|
|
12889
|
+
var _React$useState5 = React__default["default"].useState(false),
|
|
12890
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
12891
|
+
isFocused = _React$useState6[0],
|
|
12892
|
+
setIsFocused = _React$useState6[1];
|
|
12818
12893
|
var state = getState$1({
|
|
12819
12894
|
disabled: disabled,
|
|
12820
12895
|
error: error,
|
|
@@ -12825,6 +12900,23 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
|
12825
12900
|
});
|
|
12826
12901
|
var shouldShowMaxLength = maxLength !== undefined && !hideCharacterCount;
|
|
12827
12902
|
var theme = useTheme();
|
|
12903
|
+
var focusAnimation = React.useRef(new reactNative.Animated.Value(0)).current;
|
|
12904
|
+
React.useEffect(function () {
|
|
12905
|
+
reactNative.Animated.timing(focusAnimation, {
|
|
12906
|
+
toValue: isFocused || !isEmptyValue ? 1 : 0,
|
|
12907
|
+
duration: LABEL_ANIMATION_DURATION,
|
|
12908
|
+
easing: reactNative.Easing.bezier(0.4, 0, 0.2, 1),
|
|
12909
|
+
useNativeDriver: true
|
|
12910
|
+
}).start();
|
|
12911
|
+
}, [focusAnimation, isEmptyValue, isFocused]);
|
|
12912
|
+
var onLayout = React.useCallback(function (event) {
|
|
12913
|
+
var height = event.nativeEvent.layout.height;
|
|
12914
|
+
setInputHeight(height);
|
|
12915
|
+
}, []);
|
|
12916
|
+
var onPrefixLayout = React.useCallback(function (event) {
|
|
12917
|
+
var width = event.nativeEvent.layout.width;
|
|
12918
|
+
setPrefixWidth(width);
|
|
12919
|
+
}, []);
|
|
12828
12920
|
var innerTextInput = React__default["default"].useRef();
|
|
12829
12921
|
React__default["default"].useImperativeHandle(ref, function () {
|
|
12830
12922
|
return {
|
|
@@ -12922,43 +13014,59 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
|
12922
13014
|
style: styleWithoutBackgroundColor,
|
|
12923
13015
|
pointerEvents: state === 'disabled' || state === 'readonly' ? 'none' : 'auto',
|
|
12924
13016
|
testID: testID
|
|
12925
|
-
}, /*#__PURE__*/React__default["default"].createElement(StyledTextInputContainer,
|
|
13017
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledTextInputContainer, {
|
|
13018
|
+
onLayout: onLayout
|
|
13019
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledBorderBackDrop, {
|
|
12926
13020
|
themeFocused: isFocused,
|
|
12927
13021
|
themeState: state,
|
|
12928
13022
|
testID: "text-input-border",
|
|
12929
13023
|
style: [{
|
|
12930
13024
|
backgroundColor: backgroundColor
|
|
12931
13025
|
}, borderStyle]
|
|
12932
|
-
}),
|
|
12933
|
-
|
|
12934
|
-
|
|
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, {
|
|
13026
|
+
}), /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
|
|
13027
|
+
onLayout: onPrefixLayout
|
|
13028
|
+
}, typeof prefix === 'string' ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
12948
13029
|
intent: state === 'disabled' ? 'disabled-text' : 'text',
|
|
12949
13030
|
testID: "input-prefix",
|
|
12950
13031
|
icon: prefix,
|
|
12951
13032
|
size: "xsmall"
|
|
12952
|
-
}) : prefix, /*#__PURE__*/React__default["default"].createElement(
|
|
13033
|
+
}) : prefix), /*#__PURE__*/React__default["default"].createElement(StyledLabelContainerInsideTextInput, {
|
|
12953
13034
|
themeVariant: variant,
|
|
12954
|
-
pointerEvents: "none"
|
|
13035
|
+
pointerEvents: "none",
|
|
13036
|
+
style: [{
|
|
13037
|
+
position: 'absolute'
|
|
13038
|
+
}, {
|
|
13039
|
+
transform: [{
|
|
13040
|
+
translateY: focusAnimation.interpolate({
|
|
13041
|
+
inputRange: [0, 1],
|
|
13042
|
+
outputRange: [variant !== 'textarea' ? inputHeight / 2 : theme.space.large, 0]
|
|
13043
|
+
})
|
|
13044
|
+
}, {
|
|
13045
|
+
translateX: focusAnimation.interpolate({
|
|
13046
|
+
inputRange: [0, 1],
|
|
13047
|
+
outputRange: [prefix ? prefixWidth * 4 : theme.space.xxxlarge, 0]
|
|
13048
|
+
})
|
|
13049
|
+
}, {
|
|
13050
|
+
scale: focusAnimation.interpolate({
|
|
13051
|
+
inputRange: [0, 1],
|
|
13052
|
+
outputRange: [1, 0.75]
|
|
13053
|
+
})
|
|
13054
|
+
}]
|
|
13055
|
+
}]
|
|
12955
13056
|
}, required && /*#__PURE__*/React__default["default"].createElement(StyledAsteriskLabelInsideTextInput, {
|
|
12956
|
-
|
|
13057
|
+
style: {
|
|
13058
|
+
backgroundColor: backgroundColor
|
|
13059
|
+
},
|
|
13060
|
+
themeState: state,
|
|
13061
|
+
testID: "input-label-asterisk"
|
|
12957
13062
|
}, "*"), !!label && /*#__PURE__*/React__default["default"].createElement(StyledLabelInsideTextInput, {
|
|
13063
|
+
style: {
|
|
13064
|
+
backgroundColor: backgroundColor
|
|
13065
|
+
},
|
|
12958
13066
|
nativeID: accessibilityLabelledBy,
|
|
12959
13067
|
testID: "input-label",
|
|
12960
13068
|
themeState: state
|
|
12961
|
-
}, label)), renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React__default["default"].createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
|
|
13069
|
+
}, label)), /*#__PURE__*/React__default["default"].createElement(StyledTextInputAndLabelContainer, null, renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React__default["default"].createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
|
|
12962
13070
|
themeVariant: variant,
|
|
12963
13071
|
multiline: variant === 'textarea' || nativeProps.multiline,
|
|
12964
13072
|
ref: function ref(reference) {
|
|
@@ -33953,6 +34061,23 @@ var RichTextEditor = function RichTextEditor(_ref) {
|
|
|
33953
34061
|
postMessage(webview.current, message);
|
|
33954
34062
|
}
|
|
33955
34063
|
};
|
|
34064
|
+
var _React$useState = React__default["default"].useState(0),
|
|
34065
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
34066
|
+
inputHeight = _React$useState2[0],
|
|
34067
|
+
setInputHeight = _React$useState2[1];
|
|
34068
|
+
var focusAnimation = React.useRef(new reactNative.Animated.Value(0)).current;
|
|
34069
|
+
React.useEffect(function () {
|
|
34070
|
+
reactNative.Animated.timing(focusAnimation, {
|
|
34071
|
+
toValue: isFocused || !isEmptyValue ? 1 : 0,
|
|
34072
|
+
duration: LABEL_ANIMATION_DURATION,
|
|
34073
|
+
easing: reactNative.Easing.bezier(0.4, 0, 0.2, 1),
|
|
34074
|
+
useNativeDriver: true
|
|
34075
|
+
}).start();
|
|
34076
|
+
}, [focusAnimation, isEmptyValue, isFocused]);
|
|
34077
|
+
var onLayout = React.useCallback(function (event) {
|
|
34078
|
+
var height = event.nativeEvent.layout.height;
|
|
34079
|
+
setInputHeight(height);
|
|
34080
|
+
}, []);
|
|
33956
34081
|
React.useEffect(function () {
|
|
33957
34082
|
var removeFocusListener = on(emitter, normalizeEventName('editor-focus'), function () {
|
|
33958
34083
|
return setIsFocused(true);
|
|
@@ -34042,25 +34167,47 @@ var RichTextEditor = function RichTextEditor(_ref) {
|
|
|
34042
34167
|
}, []);
|
|
34043
34168
|
return /*#__PURE__*/React__default["default"].createElement(StyledContainer$4, {
|
|
34044
34169
|
testID: testID
|
|
34045
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
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, {
|
|
34170
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledLabelContainerInsideTextInput, {
|
|
34056
34171
|
themeVariant: "text",
|
|
34057
|
-
pointerEvents: "none"
|
|
34172
|
+
pointerEvents: "none",
|
|
34173
|
+
testID: "input-label-container",
|
|
34174
|
+
style: [{
|
|
34175
|
+
position: 'absolute'
|
|
34176
|
+
}, {
|
|
34177
|
+
transform: [{
|
|
34178
|
+
translateY: focusAnimation.interpolate({
|
|
34179
|
+
inputRange: [0, 1],
|
|
34180
|
+
outputRange: [inputHeight / 2, 0]
|
|
34181
|
+
})
|
|
34182
|
+
}, {
|
|
34183
|
+
translateX: focusAnimation.interpolate({
|
|
34184
|
+
inputRange: [0, 1],
|
|
34185
|
+
outputRange: [theme.space.xxxlarge, 0]
|
|
34186
|
+
})
|
|
34187
|
+
}, {
|
|
34188
|
+
scale: focusAnimation.interpolate({
|
|
34189
|
+
inputRange: [0, 1],
|
|
34190
|
+
outputRange: [1, 0.75]
|
|
34191
|
+
})
|
|
34192
|
+
}]
|
|
34193
|
+
}]
|
|
34058
34194
|
}, required && /*#__PURE__*/React__default["default"].createElement(StyledAsteriskLabelInsideTextInput, {
|
|
34195
|
+
style: {
|
|
34196
|
+
backgroundColor: theme.__hd__.textInput.colors.labelBackground
|
|
34197
|
+
},
|
|
34059
34198
|
themeState: state
|
|
34060
34199
|
}, "*"), !!label && /*#__PURE__*/React__default["default"].createElement(StyledLabelInsideTextInput, {
|
|
34200
|
+
style: {
|
|
34201
|
+
backgroundColor: theme.__hd__.textInput.colors.labelBackground
|
|
34202
|
+
},
|
|
34061
34203
|
testID: "input-label",
|
|
34062
34204
|
themeState: state
|
|
34063
|
-
}, label)), /*#__PURE__*/React__default["default"].createElement(
|
|
34205
|
+
}, label)), /*#__PURE__*/React__default["default"].createElement(StyledTextInputContainer, {
|
|
34206
|
+
onLayout: onLayout
|
|
34207
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledBorderBackDrop, {
|
|
34208
|
+
themeState: state,
|
|
34209
|
+
themeFocused: isFocused
|
|
34210
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledTextInputAndLabelContainer, null, /*#__PURE__*/React__default["default"].createElement(reactNative.TouchableWithoutFeedback, {
|
|
34064
34211
|
onPress: function onPress(e) {
|
|
34065
34212
|
return e.stopPropagation();
|
|
34066
34213
|
}
|