@hero-design/rn 8.45.0-test.0 → 8.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +23 -2
- package/es/index.js +764 -578
- package/lib/index.js +764 -578
- package/package.json +6 -6
- 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 +108 -57
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +36 -19
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +36 -19
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +36 -19
- package/src/components/RichTextEditor/RichTextEditor.tsx +89 -38
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +130 -102
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +247 -146
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +211 -127
- package/src/components/TextInput/StyledTextInput.tsx +9 -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 +1159 -833
- package/src/components/TextInput/__tests__/index.spec.tsx +2 -2
- package/src/components/TextInput/index.tsx +128 -57
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +72 -38
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +72 -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/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.
|
|
3337
|
-
labelTop: theme.
|
|
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$
|
|
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$
|
|
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
|
-
|
|
7512
|
-
|
|
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:
|
|
7812
|
-
width:
|
|
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:
|
|
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
|
|
7851
|
-
var
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
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
|
-
|
|
7860
|
-
var
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
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({
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
9097
|
+
props = _objectWithoutProperties(_ref, _excluded$m);
|
|
8791
9098
|
var _useContext = useContext(BottomSheetContext),
|
|
8792
9099
|
setInternalShowDivider = _useContext.setInternalShowDivider;
|
|
8793
9100
|
var onScrollBeginDrag = useCallback(function (e) {
|
|
@@ -8908,245 +9215,25 @@ var BottomSheet = function BottomSheet(_ref) {
|
|
|
8908
9215
|
style: [style, {
|
|
8909
9216
|
transform: [{
|
|
8910
9217
|
scaleY: height > 0 ? 1 : 0
|
|
8911
|
-
}, {
|
|
8912
|
-
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
|
-
}, {});
|
|
9218
|
+
}, {
|
|
9219
|
+
translateY: interpolateY
|
|
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
|
|
9130
|
-
|
|
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,26 +11867,59 @@ var Calendar = function Calendar(_ref) {
|
|
|
11780
11867
|
})));
|
|
11781
11868
|
};
|
|
11782
11869
|
|
|
11783
|
-
var
|
|
11784
|
-
var
|
|
11785
|
-
|
|
11786
|
-
|
|
11787
|
-
|
|
11788
|
-
|
|
11789
|
-
|
|
11790
|
-
|
|
11791
|
-
|
|
11792
|
-
var theme =
|
|
11793
|
-
|
|
11794
|
-
return
|
|
11795
|
-
|
|
11796
|
-
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
|
|
11800
|
-
|
|
11801
|
-
|
|
11870
|
+
var StyledDataCard = index$a(View)(function (_ref) {
|
|
11871
|
+
var theme = _ref.theme;
|
|
11872
|
+
return {
|
|
11873
|
+
borderRadius: theme.__hd__.card.radii["default"],
|
|
11874
|
+
overflow: 'hidden',
|
|
11875
|
+
flexDirection: 'row'
|
|
11876
|
+
};
|
|
11877
|
+
});
|
|
11878
|
+
var Indicator = index$a(View)(function (_ref2) {
|
|
11879
|
+
var theme = _ref2.theme,
|
|
11880
|
+
themeIntent = _ref2.themeIntent;
|
|
11881
|
+
return {
|
|
11882
|
+
backgroundColor: theme.__hd__.card.colors[themeIntent],
|
|
11883
|
+
width: theme.__hd__.card.sizes.indicatorWidth,
|
|
11884
|
+
height: '100%'
|
|
11885
|
+
};
|
|
11886
|
+
});
|
|
11887
|
+
|
|
11888
|
+
var _excluded$l = ["intent", "children"];
|
|
11889
|
+
var DataCard = function DataCard(_ref) {
|
|
11890
|
+
var _ref$intent = _ref.intent,
|
|
11891
|
+
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
11892
|
+
children = _ref.children,
|
|
11893
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$l);
|
|
11894
|
+
return /*#__PURE__*/React.createElement(StyledDataCard, nativeProps, /*#__PURE__*/React.createElement(Indicator, {
|
|
11895
|
+
themeIntent: intent,
|
|
11896
|
+
testID: "data-card-indicator"
|
|
11897
|
+
}), children);
|
|
11898
|
+
};
|
|
11899
|
+
|
|
11900
|
+
var StyledCard$1 = index$a(View)(function (_ref) {
|
|
11901
|
+
var theme = _ref.theme,
|
|
11902
|
+
themeIntent = _ref.themeIntent;
|
|
11903
|
+
return _objectSpread2(_objectSpread2({}, themeIntent !== undefined && {
|
|
11904
|
+
backgroundColor: theme.__hd__.card.colors[themeIntent]
|
|
11905
|
+
}), {}, {
|
|
11906
|
+
borderRadius: theme.__hd__.card.radii["default"],
|
|
11907
|
+
overflow: 'hidden'
|
|
11908
|
+
});
|
|
11909
|
+
});
|
|
11910
|
+
|
|
11911
|
+
var _excluded$k = ["intent", "children"];
|
|
11912
|
+
var Card = function Card(_ref) {
|
|
11913
|
+
var intent = _ref.intent,
|
|
11914
|
+
children = _ref.children,
|
|
11915
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$k);
|
|
11916
|
+
return /*#__PURE__*/React.createElement(StyledCard$1, _extends$1({}, nativeProps, {
|
|
11917
|
+
themeIntent: intent
|
|
11918
|
+
}), children);
|
|
11802
11919
|
};
|
|
11920
|
+
var Card$1 = Object.assign(Card, {
|
|
11921
|
+
Data: DataCard
|
|
11922
|
+
});
|
|
11803
11923
|
|
|
11804
11924
|
var StyledPageControl$2 = index$a(View)(function () {
|
|
11805
11925
|
return {
|
|
@@ -11854,172 +11974,11 @@ var PageControl = function PageControl(_ref) {
|
|
|
11854
11974
|
}],
|
|
11855
11975
|
key: index.toString(),
|
|
11856
11976
|
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
|
-
var StyledDataCard = index$a(View)(function (_ref) {
|
|
11969
|
-
var theme = _ref.theme;
|
|
11970
|
-
return {
|
|
11971
|
-
borderRadius: theme.__hd__.card.radii["default"],
|
|
11972
|
-
overflow: 'hidden',
|
|
11973
|
-
flexDirection: 'row'
|
|
11974
|
-
};
|
|
11975
|
-
});
|
|
11976
|
-
var Indicator = index$a(View)(function (_ref2) {
|
|
11977
|
-
var theme = _ref2.theme,
|
|
11978
|
-
themeIntent = _ref2.themeIntent;
|
|
11979
|
-
return {
|
|
11980
|
-
backgroundColor: theme.__hd__.card.colors[themeIntent],
|
|
11981
|
-
width: theme.__hd__.card.sizes.indicatorWidth,
|
|
11982
|
-
height: '100%'
|
|
11983
|
-
};
|
|
11984
|
-
});
|
|
11985
|
-
|
|
11986
|
-
var _excluded$k = ["intent", "children"];
|
|
11987
|
-
var DataCard = function DataCard(_ref) {
|
|
11988
|
-
var _ref$intent = _ref.intent,
|
|
11989
|
-
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
11990
|
-
children = _ref.children,
|
|
11991
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$k);
|
|
11992
|
-
return /*#__PURE__*/React.createElement(StyledDataCard, nativeProps, /*#__PURE__*/React.createElement(Indicator, {
|
|
11993
|
-
themeIntent: intent,
|
|
11994
|
-
testID: "data-card-indicator"
|
|
11995
|
-
}), children);
|
|
11996
|
-
};
|
|
11997
|
-
|
|
11998
|
-
var StyledCard$1 = index$a(View)(function (_ref) {
|
|
11999
|
-
var theme = _ref.theme,
|
|
12000
|
-
themeIntent = _ref.themeIntent;
|
|
12001
|
-
return _objectSpread2(_objectSpread2({}, themeIntent !== undefined && {
|
|
12002
|
-
backgroundColor: theme.__hd__.card.colors[themeIntent]
|
|
12003
|
-
}), {}, {
|
|
12004
|
-
borderRadius: theme.__hd__.card.radii["default"],
|
|
12005
|
-
overflow: 'hidden'
|
|
12006
|
-
});
|
|
12007
|
-
});
|
|
12008
|
-
|
|
12009
|
-
var _excluded$j = ["intent", "children"];
|
|
12010
|
-
var Card = function Card(_ref) {
|
|
12011
|
-
var intent = _ref.intent,
|
|
12012
|
-
children = _ref.children,
|
|
12013
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$j);
|
|
12014
|
-
return /*#__PURE__*/React.createElement(StyledCard$1, _extends$1({}, nativeProps, {
|
|
12015
|
-
themeIntent: intent
|
|
12016
|
-
}), children);
|
|
11977
|
+
});
|
|
11978
|
+
}));
|
|
12017
11979
|
};
|
|
12018
|
-
var Card$1 = Object.assign(Card, {
|
|
12019
|
-
Data: DataCard
|
|
12020
|
-
});
|
|
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 =
|
|
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
|
-
}
|
|
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
|
|
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
|
|
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
|
|
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
|
|
12567
|
+
})), /*#__PURE__*/React.createElement(StyledLabel, {
|
|
12479
12568
|
variant: "small",
|
|
12480
12569
|
themeVariant: variant,
|
|
12481
12570
|
themeSelected: selected
|
|
@@ -12581,45 +12670,23 @@ var StyledContainer$4 = index$a(View)(function (_ref) {
|
|
|
12581
12670
|
marginTop: theme.__hd__.textInput.space.containerMarginTop
|
|
12582
12671
|
};
|
|
12583
12672
|
});
|
|
12584
|
-
var
|
|
12585
|
-
var
|
|
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
|
-
|
|
12590
|
-
|
|
12591
|
-
|
|
12678
|
+
alignItems: themeVariant === 'text' ? 'center' : 'flex-start',
|
|
12679
|
+
justifyContent: 'center',
|
|
12680
|
+
position: 'absolute',
|
|
12592
12681
|
zIndex: 1,
|
|
12593
|
-
|
|
12682
|
+
left: 0,
|
|
12683
|
+
right: 0,
|
|
12684
|
+
top: -theme.__hd__.textInput.space.labelTop
|
|
12594
12685
|
};
|
|
12595
12686
|
});
|
|
12596
|
-
var
|
|
12687
|
+
var StyledLabelInsideTextInput = index$a(Typography.Body)(function (_ref3) {
|
|
12597
12688
|
var theme = _ref3.theme,
|
|
12598
12689
|
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
12690
|
return {
|
|
12624
12691
|
textAlignVertical: 'center',
|
|
12625
12692
|
alignContent: 'center',
|
|
@@ -12628,15 +12695,15 @@ var StyledLabelInsideTextInput = index$a(Typography.Body)(function (_ref6) {
|
|
|
12628
12695
|
marginTop: theme.__hd__.textInput.space.labelInsideTextInputMarginTop
|
|
12629
12696
|
};
|
|
12630
12697
|
});
|
|
12631
|
-
var StyledAsteriskLabelInsideTextInput = index$a(Typography.Body)(function (
|
|
12632
|
-
var theme =
|
|
12633
|
-
themeState =
|
|
12698
|
+
var StyledAsteriskLabelInsideTextInput = index$a(Typography.Body)(function (_ref4) {
|
|
12699
|
+
var theme = _ref4.theme,
|
|
12700
|
+
themeState = _ref4.themeState;
|
|
12634
12701
|
return {
|
|
12635
12702
|
color: theme.__hd__.textInput.colors.asterisks[themeState]
|
|
12636
12703
|
};
|
|
12637
12704
|
});
|
|
12638
|
-
var StyledErrorContainer$2 = index$a(View)(function (
|
|
12639
|
-
var theme =
|
|
12705
|
+
var StyledErrorContainer$2 = index$a(View)(function (_ref5) {
|
|
12706
|
+
var theme = _ref5.theme;
|
|
12640
12707
|
return {
|
|
12641
12708
|
marginRight: theme.__hd__.textInput.space.errorContainerMarginRight,
|
|
12642
12709
|
flexDirection: 'row',
|
|
@@ -12645,16 +12712,16 @@ var StyledErrorContainer$2 = index$a(View)(function (_ref8) {
|
|
|
12645
12712
|
flexGrow: 4
|
|
12646
12713
|
};
|
|
12647
12714
|
});
|
|
12648
|
-
var StyledError = index$a(Typography.Caption)(function (
|
|
12649
|
-
var theme =
|
|
12715
|
+
var StyledError = index$a(Typography.Caption)(function (_ref6) {
|
|
12716
|
+
var theme = _ref6.theme;
|
|
12650
12717
|
return {
|
|
12651
12718
|
color: theme.__hd__.textInput.colors.error,
|
|
12652
12719
|
marginLeft: theme.__hd__.textInput.space.errorMarginLeft
|
|
12653
12720
|
};
|
|
12654
12721
|
});
|
|
12655
|
-
var StyledMaxLengthMessage = index$a(Typography.Caption)(function (
|
|
12656
|
-
var theme =
|
|
12657
|
-
themeState =
|
|
12722
|
+
var StyledMaxLengthMessage = index$a(Typography.Caption)(function (_ref7) {
|
|
12723
|
+
var theme = _ref7.theme,
|
|
12724
|
+
themeState = _ref7.themeState;
|
|
12658
12725
|
return {
|
|
12659
12726
|
color: theme.__hd__.textInput.colors.maxLengthLabels[themeState],
|
|
12660
12727
|
marginRight: theme.__hd__.textInput.space.maxLengthLabelMarginLeft,
|
|
@@ -12665,9 +12732,9 @@ var StyledMaxLengthMessage = index$a(Typography.Caption)(function (_ref10) {
|
|
|
12665
12732
|
};
|
|
12666
12733
|
});
|
|
12667
12734
|
var StyledHelperText = Typography.Caption;
|
|
12668
|
-
var StyledTextInput = index$a(TextInput$1)(function (
|
|
12669
|
-
var theme =
|
|
12670
|
-
themeVariant =
|
|
12735
|
+
var StyledTextInput = index$a(TextInput$1)(function (_ref8) {
|
|
12736
|
+
var theme = _ref8.theme,
|
|
12737
|
+
themeVariant = _ref8.themeVariant;
|
|
12671
12738
|
return {
|
|
12672
12739
|
textAlignVertical: themeVariant === 'text' ? 'center' : 'top',
|
|
12673
12740
|
fontSize: theme.__hd__.textInput.fontSizes.text,
|
|
@@ -12680,19 +12747,19 @@ var StyledTextInput = index$a(TextInput$1)(function (_ref11) {
|
|
|
12680
12747
|
fontFamily: theme.__hd__.textInput.fonts.text
|
|
12681
12748
|
};
|
|
12682
12749
|
});
|
|
12683
|
-
var StyledBorderBackDrop = index$a(View)(function (
|
|
12750
|
+
var StyledBorderBackDrop = index$a(View)(function (_ref9) {
|
|
12684
12751
|
var _theme$__hd__$textInp;
|
|
12685
|
-
var theme =
|
|
12686
|
-
themeFocused =
|
|
12687
|
-
themeState =
|
|
12752
|
+
var theme = _ref9.theme,
|
|
12753
|
+
themeFocused = _ref9.themeFocused,
|
|
12754
|
+
themeState = _ref9.themeState;
|
|
12688
12755
|
return _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
|
|
12689
12756
|
borderWidth: themeFocused ? theme.__hd__.textInput.borderWidths.container.focused : theme.__hd__.textInput.borderWidths.container.normal,
|
|
12690
12757
|
borderRadius: theme.__hd__.textInput.radii.container,
|
|
12691
12758
|
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
12759
|
});
|
|
12693
12760
|
});
|
|
12694
|
-
var StyledTextInputContainer = index$a(View)(function (
|
|
12695
|
-
var theme =
|
|
12761
|
+
var StyledTextInputContainer = index$a(View)(function (_ref10) {
|
|
12762
|
+
var theme = _ref10.theme;
|
|
12696
12763
|
return {
|
|
12697
12764
|
flexDirection: 'row',
|
|
12698
12765
|
alignItems: 'center',
|
|
@@ -12710,8 +12777,8 @@ var StyledTextInputAndLabelContainer = index$a(View)(function () {
|
|
|
12710
12777
|
flexShrink: 1
|
|
12711
12778
|
};
|
|
12712
12779
|
});
|
|
12713
|
-
var StyledErrorAndHelpTextContainer = index$a(View)(function (
|
|
12714
|
-
var theme =
|
|
12780
|
+
var StyledErrorAndHelpTextContainer = index$a(View)(function (_ref11) {
|
|
12781
|
+
var theme = _ref11.theme;
|
|
12715
12782
|
return {
|
|
12716
12783
|
paddingLeft: theme.__hd__.textInput.space.errorAndHelpTextContainerPaddingLeft,
|
|
12717
12784
|
minHeight: theme.__hd__.textInput.sizes.errorAndHelpTextContainerHeight,
|
|
@@ -12749,6 +12816,7 @@ var getState$1 = function getState(_ref) {
|
|
|
12749
12816
|
// Fix issue: Placeholder is not shown on iOS when multiline is true
|
|
12750
12817
|
// https://github.com/callstack/react-native-paper/pull/3331
|
|
12751
12818
|
var EMPTY_PLACEHOLDER_VALUE = ' ';
|
|
12819
|
+
var LABEL_ANIMATION_DURATION = 150;
|
|
12752
12820
|
var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
12753
12821
|
var _ref3;
|
|
12754
12822
|
var label = _ref2.label,
|
|
@@ -12781,10 +12849,25 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
12781
12849
|
var displayText = (_ref3 = value !== undefined ? value : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
|
|
12782
12850
|
var isEmptyValue = displayText.length === 0;
|
|
12783
12851
|
var actualSuffix = loading ? 'loading' : suffix;
|
|
12784
|
-
var _React$useState = React.useState(
|
|
12852
|
+
var _React$useState = React.useState({
|
|
12853
|
+
height: 0,
|
|
12854
|
+
width: 0
|
|
12855
|
+
}),
|
|
12785
12856
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
12786
|
-
|
|
12787
|
-
|
|
12857
|
+
inputSize = _React$useState2[0],
|
|
12858
|
+
setInputSize = _React$useState2[1];
|
|
12859
|
+
var _React$useState3 = React.useState(0),
|
|
12860
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
12861
|
+
labelWidth = _React$useState4[0],
|
|
12862
|
+
setLabelWidth = _React$useState4[1];
|
|
12863
|
+
var _React$useState5 = React.useState(0),
|
|
12864
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
12865
|
+
prefixWidth = _React$useState6[0],
|
|
12866
|
+
setPrefixWidth = _React$useState6[1];
|
|
12867
|
+
var _React$useState7 = React.useState(false),
|
|
12868
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
12869
|
+
isFocused = _React$useState8[0],
|
|
12870
|
+
setIsFocused = _React$useState8[1];
|
|
12788
12871
|
var state = getState$1({
|
|
12789
12872
|
disabled: disabled,
|
|
12790
12873
|
error: error,
|
|
@@ -12795,6 +12878,34 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
12795
12878
|
});
|
|
12796
12879
|
var shouldShowMaxLength = maxLength !== undefined && !hideCharacterCount;
|
|
12797
12880
|
var theme = useTheme();
|
|
12881
|
+
var focusAnimation = useRef(new Animated.Value(0)).current;
|
|
12882
|
+
useEffect(function () {
|
|
12883
|
+
Animated.timing(focusAnimation, {
|
|
12884
|
+
toValue: isFocused || !isEmptyValue ? 1 : 0,
|
|
12885
|
+
duration: LABEL_ANIMATION_DURATION,
|
|
12886
|
+
easing: Easing.bezier(0.4, 0, 0.2, 1),
|
|
12887
|
+
useNativeDriver: true
|
|
12888
|
+
}).start();
|
|
12889
|
+
}, [focusAnimation, isEmptyValue, isFocused]);
|
|
12890
|
+
var onLayout = useCallback(function (event) {
|
|
12891
|
+
var _event$nativeEvent$la = event.nativeEvent.layout,
|
|
12892
|
+
height = _event$nativeEvent$la.height,
|
|
12893
|
+
width = _event$nativeEvent$la.width;
|
|
12894
|
+
setInputSize(function (prev) {
|
|
12895
|
+
return _objectSpread2(_objectSpread2({}, prev), {}, {
|
|
12896
|
+
height: height,
|
|
12897
|
+
width: width
|
|
12898
|
+
});
|
|
12899
|
+
});
|
|
12900
|
+
}, []);
|
|
12901
|
+
var onPrefixLayout = useCallback(function (event) {
|
|
12902
|
+
var width = event.nativeEvent.layout.width;
|
|
12903
|
+
setPrefixWidth(width);
|
|
12904
|
+
}, []);
|
|
12905
|
+
var onLabelLayout = useCallback(function (event) {
|
|
12906
|
+
var width = event.nativeEvent.layout.width;
|
|
12907
|
+
setLabelWidth(width);
|
|
12908
|
+
}, []);
|
|
12798
12909
|
var innerTextInput = React.useRef();
|
|
12799
12910
|
React.useImperativeHandle(ref, function () {
|
|
12800
12911
|
return {
|
|
@@ -12892,43 +13003,60 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
12892
13003
|
style: styleWithoutBackgroundColor,
|
|
12893
13004
|
pointerEvents: state === 'disabled' || state === 'readonly' ? 'none' : 'auto',
|
|
12894
13005
|
testID: testID
|
|
12895
|
-
}, /*#__PURE__*/React.createElement(StyledTextInputContainer,
|
|
13006
|
+
}, /*#__PURE__*/React.createElement(StyledTextInputContainer, {
|
|
13007
|
+
onLayout: onLayout
|
|
13008
|
+
}, /*#__PURE__*/React.createElement(StyledBorderBackDrop, {
|
|
12896
13009
|
themeFocused: isFocused,
|
|
12897
13010
|
themeState: state,
|
|
12898
13011
|
testID: "text-input-border",
|
|
12899
13012
|
style: [{
|
|
12900
13013
|
backgroundColor: backgroundColor
|
|
12901
13014
|
}, borderStyle]
|
|
12902
|
-
}),
|
|
12903
|
-
|
|
12904
|
-
|
|
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, {
|
|
13015
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
13016
|
+
onLayout: onPrefixLayout
|
|
13017
|
+
}, typeof prefix === 'string' ? /*#__PURE__*/React.createElement(Icon, {
|
|
12918
13018
|
intent: state === 'disabled' ? 'disabled-text' : 'text',
|
|
12919
13019
|
testID: "input-prefix",
|
|
12920
13020
|
icon: prefix,
|
|
12921
13021
|
size: "xsmall"
|
|
12922
|
-
}) : prefix, /*#__PURE__*/React.createElement(
|
|
13022
|
+
}) : prefix), /*#__PURE__*/React.createElement(StyledLabelContainerInsideTextInput, {
|
|
12923
13023
|
themeVariant: variant,
|
|
12924
|
-
pointerEvents: "none"
|
|
13024
|
+
pointerEvents: "none",
|
|
13025
|
+
style: [{
|
|
13026
|
+
position: 'absolute'
|
|
13027
|
+
}, {
|
|
13028
|
+
transform: [{
|
|
13029
|
+
translateY: focusAnimation.interpolate({
|
|
13030
|
+
inputRange: [0, 1],
|
|
13031
|
+
outputRange: [variant !== 'textarea' ? inputSize.height / 2 : theme.space.large, 0]
|
|
13032
|
+
})
|
|
13033
|
+
}, {
|
|
13034
|
+
translateX: focusAnimation.interpolate({
|
|
13035
|
+
inputRange: [0, 1],
|
|
13036
|
+
outputRange: [-inputSize.width / 2 + labelWidth / 2 + prefixWidth + theme.space.large, -inputSize.width / 2 + labelWidth / 2 + theme.space.small]
|
|
13037
|
+
})
|
|
13038
|
+
}, {
|
|
13039
|
+
scale: focusAnimation.interpolate({
|
|
13040
|
+
inputRange: [0, 1],
|
|
13041
|
+
outputRange: [1, 0.75]
|
|
13042
|
+
})
|
|
13043
|
+
}]
|
|
13044
|
+
}]
|
|
12925
13045
|
}, required && /*#__PURE__*/React.createElement(StyledAsteriskLabelInsideTextInput, {
|
|
12926
|
-
|
|
13046
|
+
style: {
|
|
13047
|
+
backgroundColor: backgroundColor
|
|
13048
|
+
},
|
|
13049
|
+
themeState: state,
|
|
13050
|
+
testID: "input-label-asterisk"
|
|
12927
13051
|
}, "*"), !!label && /*#__PURE__*/React.createElement(StyledLabelInsideTextInput, {
|
|
13052
|
+
style: {
|
|
13053
|
+
backgroundColor: backgroundColor
|
|
13054
|
+
},
|
|
12928
13055
|
nativeID: accessibilityLabelledBy,
|
|
12929
13056
|
testID: "input-label",
|
|
12930
|
-
themeState: state
|
|
12931
|
-
|
|
13057
|
+
themeState: state,
|
|
13058
|
+
onLayout: onLabelLayout
|
|
13059
|
+
}, label)), /*#__PURE__*/React.createElement(StyledTextInputAndLabelContainer, null, renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
|
|
12932
13060
|
themeVariant: variant,
|
|
12933
13061
|
multiline: variant === 'textarea' || nativeProps.multiline,
|
|
12934
13062
|
ref: function ref(reference) {
|
|
@@ -33923,6 +34051,41 @@ var RichTextEditor = function RichTextEditor(_ref) {
|
|
|
33923
34051
|
postMessage(webview.current, message);
|
|
33924
34052
|
}
|
|
33925
34053
|
};
|
|
34054
|
+
var _React$useState = React.useState({
|
|
34055
|
+
height: 0,
|
|
34056
|
+
width: 0
|
|
34057
|
+
}),
|
|
34058
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
34059
|
+
inputSize = _React$useState2[0],
|
|
34060
|
+
setInputSize = _React$useState2[1];
|
|
34061
|
+
var _React$useState3 = React.useState(0),
|
|
34062
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
34063
|
+
labelWidth = _React$useState4[0],
|
|
34064
|
+
setLabelWidth = _React$useState4[1];
|
|
34065
|
+
var focusAnimation = useRef(new Animated.Value(0)).current;
|
|
34066
|
+
useEffect(function () {
|
|
34067
|
+
Animated.timing(focusAnimation, {
|
|
34068
|
+
toValue: isFocused || !isEmptyValue ? 1 : 0,
|
|
34069
|
+
duration: LABEL_ANIMATION_DURATION,
|
|
34070
|
+
easing: Easing.bezier(0.4, 0, 0.2, 1),
|
|
34071
|
+
useNativeDriver: true
|
|
34072
|
+
}).start();
|
|
34073
|
+
}, [focusAnimation, isEmptyValue, isFocused]);
|
|
34074
|
+
var onLayout = useCallback(function (event) {
|
|
34075
|
+
var _event$nativeEvent$la = event.nativeEvent.layout,
|
|
34076
|
+
height = _event$nativeEvent$la.height,
|
|
34077
|
+
width = _event$nativeEvent$la.width;
|
|
34078
|
+
setInputSize(function (prev) {
|
|
34079
|
+
return _objectSpread2(_objectSpread2({}, prev), {}, {
|
|
34080
|
+
height: height,
|
|
34081
|
+
width: width
|
|
34082
|
+
});
|
|
34083
|
+
});
|
|
34084
|
+
}, []);
|
|
34085
|
+
var onLabelLayout = useCallback(function (event) {
|
|
34086
|
+
var width = event.nativeEvent.layout.width;
|
|
34087
|
+
setLabelWidth(width);
|
|
34088
|
+
}, []);
|
|
33926
34089
|
useEffect(function () {
|
|
33927
34090
|
var removeFocusListener = on(emitter, normalizeEventName('editor-focus'), function () {
|
|
33928
34091
|
return setIsFocused(true);
|
|
@@ -34012,25 +34175,48 @@ var RichTextEditor = function RichTextEditor(_ref) {
|
|
|
34012
34175
|
}, []);
|
|
34013
34176
|
return /*#__PURE__*/React.createElement(StyledContainer$4, {
|
|
34014
34177
|
testID: testID
|
|
34015
|
-
}, /*#__PURE__*/React.createElement(
|
|
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, {
|
|
34178
|
+
}, /*#__PURE__*/React.createElement(StyledLabelContainerInsideTextInput, {
|
|
34026
34179
|
themeVariant: "text",
|
|
34027
|
-
pointerEvents: "none"
|
|
34180
|
+
pointerEvents: "none",
|
|
34181
|
+
testID: "input-label-container",
|
|
34182
|
+
style: [{
|
|
34183
|
+
position: 'absolute'
|
|
34184
|
+
}, {
|
|
34185
|
+
transform: [{
|
|
34186
|
+
translateY: focusAnimation.interpolate({
|
|
34187
|
+
inputRange: [0, 1],
|
|
34188
|
+
outputRange: [inputSize.height / 2, 0]
|
|
34189
|
+
})
|
|
34190
|
+
}, {
|
|
34191
|
+
translateX: focusAnimation.interpolate({
|
|
34192
|
+
inputRange: [0, 1],
|
|
34193
|
+
outputRange: [-inputSize.width / 2 + labelWidth / 2 + theme.space.large, -inputSize.width / 2 + labelWidth / 2 + theme.space.small]
|
|
34194
|
+
})
|
|
34195
|
+
}, {
|
|
34196
|
+
scale: focusAnimation.interpolate({
|
|
34197
|
+
inputRange: [0, 1],
|
|
34198
|
+
outputRange: [1, 0.75]
|
|
34199
|
+
})
|
|
34200
|
+
}]
|
|
34201
|
+
}]
|
|
34028
34202
|
}, required && /*#__PURE__*/React.createElement(StyledAsteriskLabelInsideTextInput, {
|
|
34203
|
+
style: {
|
|
34204
|
+
backgroundColor: theme.__hd__.textInput.colors.labelBackground
|
|
34205
|
+
},
|
|
34029
34206
|
themeState: state
|
|
34030
34207
|
}, "*"), !!label && /*#__PURE__*/React.createElement(StyledLabelInsideTextInput, {
|
|
34208
|
+
style: {
|
|
34209
|
+
backgroundColor: theme.__hd__.textInput.colors.labelBackground
|
|
34210
|
+
},
|
|
34031
34211
|
testID: "input-label",
|
|
34032
|
-
themeState: state
|
|
34033
|
-
|
|
34212
|
+
themeState: state,
|
|
34213
|
+
onLayout: onLabelLayout
|
|
34214
|
+
}, label)), /*#__PURE__*/React.createElement(StyledTextInputContainer, {
|
|
34215
|
+
onLayout: onLayout
|
|
34216
|
+
}, /*#__PURE__*/React.createElement(StyledBorderBackDrop, {
|
|
34217
|
+
themeState: state,
|
|
34218
|
+
themeFocused: isFocused
|
|
34219
|
+
}), /*#__PURE__*/React.createElement(StyledTextInputAndLabelContainer, null, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
34034
34220
|
onPress: function onPress(e) {
|
|
34035
34221
|
return e.stopPropagation();
|
|
34036
34222
|
}
|