@pagopa/io-app-design-system 1.17.1 → 1.17.2
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/lib/commonjs/components/buttons/ButtonLink.js +14 -0
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/common/ScaleInOutAnimation.js +69 -0
- package/lib/commonjs/components/common/ScaleInOutAnimation.js.map +1 -0
- package/lib/commonjs/components/layout/ForceScrollDownView.js +161 -0
- package/lib/commonjs/components/layout/ForceScrollDownView.js.map +1 -0
- package/lib/commonjs/components/layout/HeaderFirstLevel.js +4 -4
- package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/commonjs/components/layout/__test__/ForceScrollDownView.test.js +94 -0
- package/lib/commonjs/components/layout/__test__/ForceScrollDownView.test.js.map +1 -0
- package/lib/commonjs/components/layout/__test__/__snapshots__/ForceScrollDownView.test.tsx.snap +23 -0
- package/lib/commonjs/components/layout/index.js +11 -0
- package/lib/commonjs/components/layout/index.js.map +1 -1
- package/lib/commonjs/core/IOStyles.js +3 -1
- package/lib/commonjs/core/IOStyles.js.map +1 -1
- package/lib/module/components/buttons/ButtonLink.js +15 -1
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/common/ScaleInOutAnimation.js +59 -0
- package/lib/module/components/common/ScaleInOutAnimation.js.map +1 -0
- package/lib/module/components/layout/ForceScrollDownView.js +153 -0
- package/lib/module/components/layout/ForceScrollDownView.js.map +1 -0
- package/lib/module/components/layout/HeaderFirstLevel.js +4 -4
- package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/module/components/layout/__test__/ForceScrollDownView.test.js +90 -0
- package/lib/module/components/layout/__test__/ForceScrollDownView.test.js.map +1 -0
- package/lib/module/components/layout/__test__/__snapshots__/ForceScrollDownView.test.tsx.snap +23 -0
- package/lib/module/components/layout/index.js +1 -0
- package/lib/module/components/layout/index.js.map +1 -1
- package/lib/module/core/IOStyles.js +3 -1
- package/lib/module/core/IOStyles.js.map +1 -1
- package/lib/typescript/components/buttons/ButtonLink.d.ts +1 -1
- package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
- package/lib/typescript/components/common/ScaleInOutAnimation.d.ts +14 -0
- package/lib/typescript/components/common/ScaleInOutAnimation.d.ts.map +1 -0
- package/lib/typescript/components/layout/ForceScrollDownView.d.ts +27 -0
- package/lib/typescript/components/layout/ForceScrollDownView.d.ts.map +1 -0
- package/lib/typescript/components/layout/__test__/ForceScrollDownView.test.d.ts +2 -0
- package/lib/typescript/components/layout/__test__/ForceScrollDownView.test.d.ts.map +1 -0
- package/lib/typescript/components/layout/index.d.ts +1 -0
- package/lib/typescript/components/layout/index.d.ts.map +1 -1
- package/lib/typescript/core/IOStyles.d.ts +2 -0
- package/lib/typescript/core/IOStyles.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/components/buttons/ButtonLink.tsx +17 -1
- package/src/components/common/ScaleInOutAnimation.tsx +68 -0
- package/src/components/layout/ForceScrollDownView.tsx +210 -0
- package/src/components/layout/HeaderFirstLevel.tsx +4 -4
- package/src/components/layout/__test__/ForceScrollDownView.test.tsx +106 -0
- package/src/components/layout/__test__/__snapshots__/ForceScrollDownView.test.tsx.snap +23 -0
- package/src/components/layout/index.tsx +1 -0
- package/src/core/IOStyles.ts +5 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from "react";
|
|
2
2
|
import { Pressable, StyleSheet } from "react-native";
|
|
3
3
|
import Animated, { Extrapolate, interpolate, interpolateColor, useAnimatedProps, useAnimatedStyle, useDerivedValue, useSharedValue, withSpring } from "react-native-reanimated";
|
|
4
|
-
import { IOButtonStyles, IOColors, IOScaleValues, IOSpringValues, useIOExperimentalDesign } from "../../core";
|
|
4
|
+
import { IOButtonStyles, IOColors, IOScaleValues, IOSpringValues, hexToRgba, useIOExperimentalDesign } from "../../core";
|
|
5
5
|
import { makeFontStyleObject } from "../../utils/fonts";
|
|
6
6
|
import { AnimatedIcon, IconClassComponent } from "../icons";
|
|
7
7
|
import { HSpacer } from "../spacer/Spacer";
|
|
@@ -14,6 +14,13 @@ const mapColorStates = {
|
|
|
14
14
|
pressed: IOColors["blueIO-600"],
|
|
15
15
|
disabled: IOColors["grey-700"]
|
|
16
16
|
}
|
|
17
|
+
},
|
|
18
|
+
contrast: {
|
|
19
|
+
label: {
|
|
20
|
+
default: IOColors.white,
|
|
21
|
+
pressed: hexToRgba(IOColors.white, 0.85),
|
|
22
|
+
disabled: hexToRgba(IOColors.white, 0.5)
|
|
23
|
+
}
|
|
17
24
|
}
|
|
18
25
|
};
|
|
19
26
|
|
|
@@ -26,6 +33,13 @@ const mapLegacyColorStates = {
|
|
|
26
33
|
pressed: IOColors["blue-600"],
|
|
27
34
|
disabled: IOColors["grey-700"]
|
|
28
35
|
}
|
|
36
|
+
},
|
|
37
|
+
contrast: {
|
|
38
|
+
label: {
|
|
39
|
+
default: IOColors.white,
|
|
40
|
+
pressed: hexToRgba(IOColors.white, 0.85),
|
|
41
|
+
disabled: hexToRgba(IOColors.white, 0.5)
|
|
42
|
+
}
|
|
29
43
|
}
|
|
30
44
|
};
|
|
31
45
|
const DISABLED_OPACITY = 0.5;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useMemo","Pressable","StyleSheet","Animated","Extrapolate","interpolate","interpolateColor","useAnimatedProps","useAnimatedStyle","useDerivedValue","useSharedValue","withSpring","IOButtonStyles","IOColors","IOScaleValues","IOSpringValues","useIOExperimentalDesign","makeFontStyleObject","AnimatedIcon","IconClassComponent","HSpacer","buttonTextFontSize","mapColorStates","primary","label","default","pressed","disabled","mapLegacyColorStates","blue","DISABLED_OPACITY","IOButtonStylesLocal","create","fontSize","IOButtonLegacyStylesLocal","ButtonLink","memo","_ref","_IOScaleValues$basicB","_colorMap$color","_colorMap$color2","_colorMap$color3","_colorMap$color4","color","icon","iconPosition","onPress","accessibilityLabel","accessibilityHint","testID","isPressed","isExperimental","colorMap","buttonStylesLocal","animationScaleValue","basicButton","pressedState","progressPressed","value","button","pressedAnimationStyle","scale","CLAMP","transform","pressedColorLabelAnimationStyle","labelColor","pressedColorIconAnimationStyle","iconColor","AnimatedIconClassComponent","createAnimatedComponent","onPressIn","onPressOut","iconSize","createElement","accessibilityRole","onTouchEnd","accessible","hitSlop","top","right","bottom","left","style","dimensionsDefault","View","buttonLink","flexDirection","opacity","Fragment","name","animatedProps","size","Text","numberOfLines","ellipsizeMode","allowFontScaling","maxFontSizeMultiplier"],"sourceRoot":"../../../../src","sources":["components/buttons/ButtonLink.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACnD,SAAgCC,SAAS,EAAEC,UAAU,QAAQ,cAAc;AAC3E,OAAOC,QAAQ,IACbC,WAAW,EACXC,WAAW,EACXC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe,EACfC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAChC,SACEC,cAAc,EACdC,QAAQ,EACRC,aAAa,EACbC,cAAc,EACdC,uBAAuB,QAClB,YAAY;AACnB,SAASC,mBAAmB,QAAQ,mBAAmB;AAEvD,SACEC,YAAY,EAGZC,kBAAkB,QACb,UAAU;AACjB,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,kBAAkB,QAAQ,eAAe;
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","Pressable","StyleSheet","Animated","Extrapolate","interpolate","interpolateColor","useAnimatedProps","useAnimatedStyle","useDerivedValue","useSharedValue","withSpring","IOButtonStyles","IOColors","IOScaleValues","IOSpringValues","hexToRgba","useIOExperimentalDesign","makeFontStyleObject","AnimatedIcon","IconClassComponent","HSpacer","buttonTextFontSize","mapColorStates","primary","label","default","pressed","disabled","contrast","white","mapLegacyColorStates","blue","DISABLED_OPACITY","IOButtonStylesLocal","create","fontSize","IOButtonLegacyStylesLocal","ButtonLink","memo","_ref","_IOScaleValues$basicB","_colorMap$color","_colorMap$color2","_colorMap$color3","_colorMap$color4","color","icon","iconPosition","onPress","accessibilityLabel","accessibilityHint","testID","isPressed","isExperimental","colorMap","buttonStylesLocal","animationScaleValue","basicButton","pressedState","progressPressed","value","button","pressedAnimationStyle","scale","CLAMP","transform","pressedColorLabelAnimationStyle","labelColor","pressedColorIconAnimationStyle","iconColor","AnimatedIconClassComponent","createAnimatedComponent","onPressIn","onPressOut","iconSize","createElement","accessibilityRole","onTouchEnd","accessible","hitSlop","top","right","bottom","left","style","dimensionsDefault","View","buttonLink","flexDirection","opacity","Fragment","name","animatedProps","size","Text","numberOfLines","ellipsizeMode","allowFontScaling","maxFontSizeMultiplier"],"sourceRoot":"../../../../src","sources":["components/buttons/ButtonLink.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACnD,SAAgCC,SAAS,EAAEC,UAAU,QAAQ,cAAc;AAC3E,OAAOC,QAAQ,IACbC,WAAW,EACXC,WAAW,EACXC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe,EACfC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAChC,SACEC,cAAc,EACdC,QAAQ,EACRC,aAAa,EACbC,cAAc,EACdC,SAAS,EACTC,uBAAuB,QAClB,YAAY;AACnB,SAASC,mBAAmB,QAAQ,mBAAmB;AAEvD,SACEC,YAAY,EAGZC,kBAAkB,QACb,UAAU;AACjB,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,kBAAkB,QAAQ,eAAe;AA0BlD,MAAMC,cAGL,GAAG;EACF;EACAC,OAAO,EAAE;IACPC,KAAK,EAAE;MACLC,OAAO,EAAEb,QAAQ,CAAC,YAAY,CAAC;MAC/Bc,OAAO,EAAEd,QAAQ,CAAC,YAAY,CAAC;MAC/Be,QAAQ,EAAEf,QAAQ,CAAC,UAAU;IAC/B;EACF,CAAC;EACDgB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CkE,IAAI,EAAEnB;EAAS,CAChB,CACF,eACD7E,KAAA,CAAA8E,aAAA,CAACvD,OAAO;IAACyE,IAAI,EAAE;EAAE,CAAE,CACnB,CACH,eACDhG,KAAA,CAAA8E,aAAA,CAACzE,QAAQ,CAAC4F,IAAI;IACZV,KAAK,EAAE,CACL7B,iBAAiB,CAAC/B,KAAK,EACvBG,QAAQ,GACJ;MAAEkB,KAAK,GAAAF,gBAAA,GAAEW,QAAQ,CAACT,KAAK,CAAC,cAAAF,gBAAA,gBAAAA,gBAAA,GAAfA,gBAAA,CAAiBnB,KAAK,cAAAmB,gBAAA,uBAAtBA,gBAAA,CAAwBhB;IAAS,CAAC,GAC3C;MAAEkB,KAAK,GAAAD,gBAAA,GAAEU,QAAQ,CAACT,KAAK,CAAC,cAAAD,gBAAA,gBAAAA,gBAAA,GAAfA,gBAAA,CAAiBpB,KAAK,cAAAoB,gBAAA,uBAAtBA,gBAAA,CAAwBnB;IAAQ,CAAC,EAC9C,CAACE,QAAQ,IAAIuC,+BAA+B,CAC5C;IACF6B,aAAa,EAAE,CAAE;IACjBC,aAAa,EAAC,MAAM;IACpBC,gBAAgB,EAAE5C,cAAe;IACjC6C,qBAAqB,EAAE;EAAI,GAE1B1E,KACY,CACF,CACN,CAAC;AAEhB,CACF,CAAC;AAED,eAAea,UAAU"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* eslint-disable functional/immutable-data */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import Animated, { withDelay, withSpring, withTiming } from "react-native-reanimated";
|
|
4
|
+
const ScaleInOutAnimation = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
visible = true,
|
|
7
|
+
springConfig = {
|
|
8
|
+
damping: 500,
|
|
9
|
+
mass: 3,
|
|
10
|
+
stiffness: 1000
|
|
11
|
+
},
|
|
12
|
+
delayOut = 0,
|
|
13
|
+
delayIn = 0,
|
|
14
|
+
children,
|
|
15
|
+
style
|
|
16
|
+
} = _ref;
|
|
17
|
+
const enteringAnimation = () => {
|
|
18
|
+
"worklet";
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
initialValues: {
|
|
22
|
+
transform: [{
|
|
23
|
+
scale: 0
|
|
24
|
+
}]
|
|
25
|
+
},
|
|
26
|
+
animations: {
|
|
27
|
+
transform: [{
|
|
28
|
+
scale: withDelay(delayIn, withSpring(1, springConfig))
|
|
29
|
+
}]
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
const exitingAnimation = () => {
|
|
34
|
+
"worklet";
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
initialValues: {
|
|
38
|
+
transform: [{
|
|
39
|
+
scale: 1
|
|
40
|
+
}]
|
|
41
|
+
},
|
|
42
|
+
animations: {
|
|
43
|
+
transform: [{
|
|
44
|
+
scale: withDelay(delayOut, withTiming(0))
|
|
45
|
+
}]
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
if (!visible) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
53
|
+
style: style,
|
|
54
|
+
entering: enteringAnimation,
|
|
55
|
+
exiting: exitingAnimation
|
|
56
|
+
}, children);
|
|
57
|
+
};
|
|
58
|
+
export { ScaleInOutAnimation };
|
|
59
|
+
//# sourceMappingURL=ScaleInOutAnimation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Animated","withDelay","withSpring","withTiming","ScaleInOutAnimation","_ref","visible","springConfig","damping","mass","stiffness","delayOut","delayIn","children","style","enteringAnimation","initialValues","transform","scale","animations","exitingAnimation","createElement","View","entering","exiting"],"sourceRoot":"../../../../src","sources":["components/common/ScaleInOutAnimation.tsx"],"mappings":"AAAA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAOC,QAAQ,IAGbC,SAAS,EACTC,UAAU,EACVC,UAAU,QACL,yBAAyB;AAWhC,MAAMC,mBAA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yleSheet } from "react-native";
|
|
3
|
+
import { ScaleInOutAnimation } from "../common/ScaleInOutAnimation";
|
|
4
|
+
import { IOSpringValues, IOVisualCostants } from "../../core";
|
|
5
|
+
import { IconButtonSolid } from "../buttons";
|
|
6
|
+
/**
|
|
7
|
+
* A React Native component that displays a scroll view with a button that scrolls to the bottom of the content
|
|
8
|
+
* when pressed. The button is hidden when the scroll view reaches a certain threshold from the bottom, which is
|
|
9
|
+
* configurable by the `threshold` prop. The button, and the scrolling, can also be disabled by setting the
|
|
10
|
+
* `scrollEnabled` prop to `false`.
|
|
11
|
+
*/
|
|
12
|
+
const ForceScrollDownView = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
children,
|
|
15
|
+
threshold = 100,
|
|
16
|
+
style,
|
|
17
|
+
contentContainerStyle,
|
|
18
|
+
scrollEnabled = true,
|
|
19
|
+
onThresholdCrossed
|
|
20
|
+
} = _ref;
|
|
21
|
+
const scrollViewRef = useRef(null);
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The height of the scroll view, used to determine whether or not the scrollable content fits inside
|
|
25
|
+
* the scroll view and whether the "scroll to bottom" button should be displayed.
|
|
26
|
+
*/
|
|
27
|
+
const [scrollViewHeight, setScrollViewHeight] = useState();
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The height of the scrollable content, used to determine whether or not the "scroll to bottom" button
|
|
31
|
+
* should be displayed.
|
|
32
|
+
*/
|
|
33
|
+
const [contentHeight, setContentHeight] = useState();
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Whether or not the scroll view has crossed the threshold from the bottom.
|
|
37
|
+
*/
|
|
38
|
+
const [isThresholdCrossed, setThresholdCrossed] = useState(false);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Whether or not the "scroll to bottom" button should be visible. This is controlled by the threshold
|
|
42
|
+
* and the current scroll position.
|
|
43
|
+
*/
|
|
44
|
+
const [isButtonVisible, setButtonVisible] = useState(true);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* A callback that is called whenever the scroll view is scrolled. It checks whether or not the
|
|
48
|
+
* scroll view has crossed the threshold from the bottom and updates the state accordingly.
|
|
49
|
+
* The callback is designed to updatr button visibility only when crossing the threshold.
|
|
50
|
+
*/
|
|
51
|
+
const handleScroll = useCallback(event => {
|
|
52
|
+
const {
|
|
53
|
+
layoutMeasurement,
|
|
54
|
+
contentOffset,
|
|
55
|
+
contentSize
|
|
56
|
+
} = event.nativeEvent;
|
|
57
|
+
const thresholdCrossed = layoutMeasurement.height + contentOffset.y >= contentSize.height - threshold;
|
|
58
|
+
setThresholdCrossed(previousState => {
|
|
59
|
+
if (!previousState && thresholdCrossed) {
|
|
60
|
+
setButtonVisible(false);
|
|
61
|
+
}
|
|
62
|
+
if (previousState && !thresholdCrossed) {
|
|
63
|
+
setButtonVisible(true);
|
|
64
|
+
}
|
|
65
|
+
return thresholdCrossed;
|
|
66
|
+
});
|
|
67
|
+
}, [threshold]);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* A side effect that calls the `onThresholdCrossed` callback whenever the value of `isThresholdCrossed` changes.
|
|
71
|
+
*/
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
onThresholdCrossed === null || onThresholdCrossed === void 0 || onThresholdCrossed(isThresholdCrossed);
|
|
74
|
+
}, [onThresholdCrossed, isThresholdCrossed]);
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* A callback that is called whenever the size of the scrollable content changes. It updates the
|
|
78
|
+
* state with the new content height.
|
|
79
|
+
*/
|
|
80
|
+
const handleContentSizeChange = useCallback((_contentWidth, contentHeight) => {
|
|
81
|
+
setContentHeight(contentHeight);
|
|
82
|
+
}, []);
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* A callback that is called whenever the size of the scroll view changes. It updates the state
|
|
86
|
+
* with the new scroll view height.
|
|
87
|
+
*/
|
|
88
|
+
const handleLayout = useCallback(event => {
|
|
89
|
+
setScrollViewHeight(event.nativeEvent.layout.height);
|
|
90
|
+
}, []);
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* A callback that is called when the "scroll to bottom" button is pressed. It scrolls the
|
|
94
|
+
* scroll view to the bottom and hides the button.
|
|
95
|
+
*/
|
|
96
|
+
const handleScrollDownPress = useCallback(() => {
|
|
97
|
+
var _scrollViewRef$curren;
|
|
98
|
+
setButtonVisible(false);
|
|
99
|
+
(_scrollViewRef$curren = scrollViewRef.current) === null || _scrollViewRef$curren === void 0 || _scrollViewRef$curren.scrollToEnd();
|
|
100
|
+
}, [scrollViewRef]);
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Whether or not the "scroll to bottom" button needs to be displayed. It is only displayed
|
|
104
|
+
* when the scrollable content cannot fit inside the scroll view and the button is enabled
|
|
105
|
+
* (`scrollEnabled` is `true`).
|
|
106
|
+
*/
|
|
107
|
+
const needsScroll = useMemo(() => scrollViewHeight != null && contentHeight != null && scrollViewHeight < contentHeight, [scrollViewHeight, contentHeight]);
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Whether or not to render the "scroll to bottom" button. It is only rendered when the scroll view
|
|
111
|
+
* is enabled, needs to be scrolled, and the button is visible (`isButtonVisible` is `true`).
|
|
112
|
+
*/
|
|
113
|
+
const shouldRenderScrollButton = scrollEnabled && needsScroll && isButtonVisible;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The "scroll to bottom" button component. It is wrapped in a reanimated view and has enter and exit
|
|
117
|
+
* animations applied to it.
|
|
118
|
+
*/
|
|
119
|
+
const scrollDownButton = /*#__PURE__*/React.createElement(ScaleInOutAnimation, {
|
|
120
|
+
springConfig: IOSpringValues.button,
|
|
121
|
+
style: styles.scrollDownButton,
|
|
122
|
+
visible: shouldRenderScrollButton
|
|
123
|
+
}, /*#__PURE__*/React.createElement(IconButtonSolid, {
|
|
124
|
+
testID: "ScrollDownButton",
|
|
125
|
+
accessibilityLabel: "Scroll to bottom",
|
|
126
|
+
icon: "arrowBottom",
|
|
127
|
+
onPress: handleScrollDownPress
|
|
128
|
+
}));
|
|
129
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ScrollView, {
|
|
130
|
+
testID: "ScrollView",
|
|
131
|
+
ref: scrollViewRef,
|
|
132
|
+
scrollIndicatorInsets: {
|
|
133
|
+
right: 1
|
|
134
|
+
},
|
|
135
|
+
scrollEnabled: scrollEnabled,
|
|
136
|
+
onScroll: handleScroll,
|
|
137
|
+
scrollEventThrottle: 400,
|
|
138
|
+
style: style,
|
|
139
|
+
onLayout: handleLayout,
|
|
140
|
+
onContentSizeChange: handleContentSizeChange,
|
|
141
|
+
contentContainerStyle: contentContainerStyle
|
|
142
|
+
}, children), scrollDownButton);
|
|
143
|
+
};
|
|
144
|
+
const styles = StyleSheet.create({
|
|
145
|
+
scrollDownButton: {
|
|
146
|
+
position: "absolute",
|
|
147
|
+
zIndex: 10,
|
|
148
|
+
right: IOVisualCostants.scrollDownButtonRight,
|
|
149
|
+
bottom: IOVisualCostants.scrollDownButtonBottom
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
export { ForceScrollDownView };
|
|
153
|
+
//# sourceMappingURL=ForceScrollDownView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useMemo","useRef","useState","ScrollView","StyleSheet","ScaleInOutAnimation","IOSpringValues","IOVisualCostants","IconButtonSolid","ForceScrollDownView","_ref","children","threshold","style","contentContainerStyle","scrollEnabled","onThresholdCrossed","scrollViewRef","scrollViewHeight","setScrollViewHeight","contentHeight","setContentHeight","isThresholdCrossed","setThresholdCrossed","isButtonVisible","setButtonVisible","handleScroll","event","layoutMeasurement","contentOffset","contentSize","nativeEvent","thresholdCrossed","height","y","previousState","handleContentSizeChange","_contentWidth","handleLayout","layout","handleScrollDownPress","_scrollViewRef$curren","current","scrollToEnd","needsScroll","shouldRenderScrollButton","scrollDownButton","createElement","springConfig","button","styles","visible","testID","accessibilityLabel","icon","onPress","Fragment","ref","scrollIndicatorInsets","right","onScroll","scrollEventThrottle","onLayout","onContentSizeChange","create","position","zIndex","scrollDownButtonRight","bottom","scrollDownButtonBottom"],"sourceRoot":"../../../../src","sources":["components/layout/ForceScrollDownView.tsx"],"mappings":"AAAA,OAAOA,KAAK,IACVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SAIEC,UAAU,EAEVC,UAAU,QACL,cAAc;AACrB,SAASC,mBAAmB,QAAQ,+BAA+B;AACnE,SAASC,cAAc,EAAEC,gBAAgB,QAAQ,YAAY;AAC7D,SAASC,eAAe,QAAQ,YAAY;AAsB5C;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAGC,IAAA,IAOI;EAAA,IAPH;IAC3BC,QAAQ;IACRC,SAAS,GAAG,GAAG;IACfC,KAAK;IACLC,qBAAqB;IACrBC,aAAa,GAAG,IAAI;IACpBC;EACwB,CAAC,GAAAN,IAAA;EACzB,MAAMO,aAAa,GAAGhB,MAAM,CAAa,IAAI,CAAC;;EAE9C;AACF;AACA;AACA;EACE,MAAM,CAACiB,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGjB,QAAQ,CAAS,CAAC;;EAElE;AACF;AACA;AACA;EACE,MAAM,CAACkB,aAAa,EAAEC,gBAAgB,CAAC,GAAGnB,QAAQ,CAAS,CAAC;;EAE5D;AACF;AACA;EACE,MAAM,CAACoB,kBAAkB,EAAEC,mBAAmB,CAAC,GAAGrB,QAAQ,CAAC,KAAK,CAAC;;EAEjE;AACF;AACA;AACA;EACE,MAAM,CAACsB,eAAe,EAAEC,gBAAgB,CAAC,GAAGvB,QAAQ,CAAC,IAAI,CAAC;;EAE1D;AACF;AACA;AACA;AACA;EACE,MAAMwB,YAAY,GAAG5B,WAAW,CAC7B6B,KAA8C,IAAK;IAClD,MAAM;MAAEC,iBAAiB;MAAEC,aAAa;MAAEC;IAAY,CAAC,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M,EAAE,EAAE;IACVP,KAAK,EAAEpD,gBAAgB,CAAC4D,qBAAqB;IAC7CC,MAAM,EAAE7D,gBAAgB,CAAC8D;EAC3B;AACF,CAAC,CAAC;AAEF,SAAS5D,mBAAmB"}
|
|
@@ -43,21 +43,21 @@ export const HeaderFirstLevel = _ref => {
|
|
|
43
43
|
flexShrink: 1
|
|
44
44
|
},
|
|
45
45
|
numberOfLines: 1,
|
|
46
|
-
color: backgroundColor === "dark" ? "white" :
|
|
46
|
+
color: backgroundColor === "dark" ? "white" : "black"
|
|
47
47
|
}, title), /*#__PURE__*/React.createElement(View, {
|
|
48
48
|
style: [IOStyles.row, {
|
|
49
49
|
flexShrink: 0
|
|
50
50
|
}]
|
|
51
51
|
}, type === "threeActions" && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconButton, _extends({}, thirdAction, {
|
|
52
|
-
color: backgroundColor === "dark" ? "contrast" : "
|
|
52
|
+
color: backgroundColor === "dark" ? "contrast" : "primary"
|
|
53
53
|
})), /*#__PURE__*/React.createElement(HSpacer, {
|
|
54
54
|
size: 16
|
|
55
55
|
})), (type === "twoActions" || type === "threeActions") && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconButton, _extends({}, secondAction, {
|
|
56
|
-
color: backgroundColor === "dark" ? "contrast" : "
|
|
56
|
+
color: backgroundColor === "dark" ? "contrast" : "primary"
|
|
57
57
|
})), /*#__PURE__*/React.createElement(HSpacer, {
|
|
58
58
|
size: 16
|
|
59
59
|
})), type !== "base" && /*#__PURE__*/React.createElement(IconButton, _extends({}, firstAction, {
|
|
60
|
-
color: backgroundColor === "dark" ? "contrast" : "
|
|
60
|
+
color: backgroundColor === "dark" ? "contrast" : "primary"
|
|
61
61
|
})))));
|
|
62
62
|
};
|
|
63
63
|
export default HeaderFirstLevel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","StyleSheet","useSafeAreaInsets","IOStyles","IOVisualCostants","IOColors","H3","HSpacer","IconButton","HEADER_BG_COLOR_LIGHT","HEADER_BG_COLOR_DARK","styles","create","headerInner","paddingHorizontal","appMarginDefault","height","headerHeight","width","flexDirection","alignItems","justifyContent","HeaderFirstLevel","_ref","title","type","testID","backgroundColor","firstAction","secondAction","thirdAction","insets","createElement","style","paddingTop","top","accessibilityRole","flexShrink","numberOfLines","color","
|
|
1
|
+
{"version":3,"names":["React","View","StyleSheet","useSafeAreaInsets","IOStyles","IOVisualCostants","IOColors","H3","HSpacer","IconButton","HEADER_BG_COLOR_LIGHT","HEADER_BG_COLOR_DARK","styles","create","headerInner","paddingHorizontal","appMarginDefault","height","headerHeight","width","flexDirection","alignItems","justifyContent","HeaderFirstLevel","_ref","title","type","testID","backgroundColor","firstAction","secondAction","thirdAction","insets","createElement","style","paddingTop","top","accessibilityRole","flexShrink","numberOfLines","color","row","Fragment","_extends","size"],"sourceRoot":"../../../../src","sources":["components/layout/HeaderFirstLevel.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,QAAQ,EAAEC,gBAAgB,EAAEC,QAAQ,QAAQ,YAAY;AACjE,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,UAAU,QAAQ,YAAY;AAuCvC,MAAMC,qBAA+B,GAAG,OAAO;AAC/C,MAAMC,oBAA8B,GAAG,UAAU;AAEjD,MAAMC,MAAM,GAAGV,UAAU,CAACW,MAAM,CAAC;EAC/BC,WAAW,EAAE;IACXC,iBAAiB,EAAEV,gBAAgB,CAACW,gBAAgB;IACpDC,MAAM,EAAEZ,gBAAgB,CAACa,YAAY;IACrCC,KAAK,EAAE,MAAM;IACbC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,C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,CACpB,CACH,EACA,CAAClB,IAAI,KAAK,YAAY,IAAIA,IAAI,KAAK,cAAc,kBAChD1B,KAAA,CAAAiC,aAAA,CAAAjC,KAAA,CAAA0C,QAAA,qBACE1C,KAAA,CAAAiC,aAAA,CAACxB,UAAU,EAAAkC,QAAA,KACLb,YAAY;IAChBU,KAAK,EAAEZ,eAAe,KAAK,MAAM,GAAG,UAAU,GAAG;EAAU,EAC5D,CAAC,eAEF5B,KAAA,CAAAiC,aAAA,CAACzB,OAAO;IAACoC,IAAI,EAAE;EAAG,CAAE,CACpB,CACH,EACAlB,IAAI,KAAK,MAAM,iBACd1B,KAAA,CAAAiC,aAAA,CAACxB,UAAU,EAAAkC,QAAA,KACLd,WAAW;IACfW,KAAK,EAAEZ,eAAe,KAAK,MAAM,GAAG,UAAU,GAAG;EAAU,EAC5D,CAEC,CACF,CACF,CAAC;AAEX,CAAC;AAED,eAAeL,gBAAgB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/* eslint-disable functional/immutable-data */
|
|
2
|
+
import { fireEvent, render } from "@testing-library/react-native";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Text } from "react-native";
|
|
5
|
+
import { ForceScrollDownView } from "../ForceScrollDownView";
|
|
6
|
+
const tContent = "Some content";
|
|
7
|
+
describe("ForceScrollDownView", () => {
|
|
8
|
+
jest.useFakeTimers();
|
|
9
|
+
it("should match snapshot", () => {
|
|
10
|
+
const tChildren = /*#__PURE__*/React.createElement(Text, null, tContent);
|
|
11
|
+
const component = render( /*#__PURE__*/React.createElement(ForceScrollDownView, null, tChildren));
|
|
12
|
+
expect(component).toMatchSnapshot();
|
|
13
|
+
});
|
|
14
|
+
it("renders the content correctly", () => {
|
|
15
|
+
const tChildren = /*#__PURE__*/React.createElement(Text, null, tContent);
|
|
16
|
+
const {
|
|
17
|
+
getByText
|
|
18
|
+
} = render( /*#__PURE__*/React.createElement(ForceScrollDownView, null, tChildren));
|
|
19
|
+
expect(getByText(tContent)).toBeDefined();
|
|
20
|
+
});
|
|
21
|
+
it("displays the scroll down button when necessary", async () => {
|
|
22
|
+
const tChildren = /*#__PURE__*/React.createElement(Text, null, tContent);
|
|
23
|
+
const tScreenHeight = 1000;
|
|
24
|
+
const {
|
|
25
|
+
getByTestId,
|
|
26
|
+
queryByTestId
|
|
27
|
+
} = render( /*#__PURE__*/React.createElement(ForceScrollDownView, null, tChildren));
|
|
28
|
+
const scrollView = getByTestId("ScrollView");
|
|
29
|
+
|
|
30
|
+
// Update scroll view height
|
|
31
|
+
fireEvent(scrollView, "layout", {
|
|
32
|
+
nativeEvent: {
|
|
33
|
+
layout: {
|
|
34
|
+
height: tScreenHeight
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// Update scroll view content height
|
|
40
|
+
fireEvent(scrollView, "contentSizeChange", null, tScreenHeight - 500);
|
|
41
|
+
|
|
42
|
+
// Button should not be visible because content does not need scrolling
|
|
43
|
+
const buttonBefore = queryByTestId("ScrollDownButton");
|
|
44
|
+
expect(buttonBefore).toBeNull();
|
|
45
|
+
|
|
46
|
+
// Increase content height to force button to be shown
|
|
47
|
+
fireEvent(scrollView, "contentSizeChange", null, tScreenHeight + 500);
|
|
48
|
+
jest.advanceTimersByTime(500);
|
|
49
|
+
|
|
50
|
+
// Button should be visible now beacuse content needs scrolling
|
|
51
|
+
const buttonAfter = queryByTestId("ScrollDownButton");
|
|
52
|
+
expect(buttonAfter).not.toBeNull();
|
|
53
|
+
});
|
|
54
|
+
it("scrolls to the bottom when the button is pressed", () => {
|
|
55
|
+
const tChildren = /*#__PURE__*/React.createElement(Text, null, tContent);
|
|
56
|
+
const tScreenHeight = 1000;
|
|
57
|
+
const {
|
|
58
|
+
getByTestId,
|
|
59
|
+
queryByTestId
|
|
60
|
+
} = render( /*#__PURE__*/React.createElement(ForceScrollDownView, null, tChildren));
|
|
61
|
+
const scrollView = getByTestId("ScrollView");
|
|
62
|
+
|
|
63
|
+
// Update scroll view height
|
|
64
|
+
fireEvent(scrollView, "layout", {
|
|
65
|
+
nativeEvent: {
|
|
66
|
+
layout: {
|
|
67
|
+
height: tScreenHeight
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// Update scroll view content height
|
|
73
|
+
fireEvent(scrollView, "contentSizeChange", null, tScreenHeight + 500);
|
|
74
|
+
|
|
75
|
+
// Button should be visible
|
|
76
|
+
const buttonBefore = getByTestId("ScrollDownButton");
|
|
77
|
+
expect(buttonBefore).not.toBeNull();
|
|
78
|
+
|
|
79
|
+
// Fire button press event
|
|
80
|
+
fireEvent.press(buttonBefore);
|
|
81
|
+
|
|
82
|
+
// Wait for the scroll animation
|
|
83
|
+
jest.advanceTimersByTime(500);
|
|
84
|
+
|
|
85
|
+
// Button should not be visible after scrolling
|
|
86
|
+
const buttonAfter = queryByTestId("ScrollDownButton");
|
|
87
|
+
expect(buttonAfter).toBeNull();
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
//# sourceMappingURL=ForceScrollDownView.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fireEvent","render","React","Text","ForceScrollDownView","tContent","describe","jest","useFakeTimers","it","tChildren","createElement","component","expect","toMatchSnapshot","getByText","toBeDefined","tScreenHeight","getByTestId","queryByTestId","scrollView","nativeEvent","layout","height","buttonBefore","toBeNull","advanceTimersByTime","buttonAfter","not","press"],"sourceRoot":"../../../../../src","sources":["components/layout/__test__/ForceScrollDownView.test.tsx"],"mappings":"AAAA;AACA,SAASA,SAAS,EAAEC,MAAM,QAAQ,+BAA+B;AACjE,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,mBAAmB,QAAQ,wBAAwB;AAE5D,MAAMC,QAAQ,GAAG,cAAc;AAE/BC,QAAQ,CAAC,qBAAqB,EAAE,MAAM;EACpCC,IAAI,CAACC,aAAa,CAAC,CAAC;EAEpB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CAACF,QAAQ,CAAC,CAAC;EAChC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`ForceScrollDownView should match snapshot 1`] = `
|
|
4
|
+
<RCTScrollView
|
|
5
|
+
onContentSizeChange={[Function]}
|
|
6
|
+
onLayout={[Function]}
|
|
7
|
+
onScroll={[Function]}
|
|
8
|
+
scrollEnabled={true}
|
|
9
|
+
scrollEventThrottle={400}
|
|
10
|
+
scrollIndicatorInsets={
|
|
11
|
+
{
|
|
12
|
+
"right": 1,
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
testID="ScrollView"
|
|
16
|
+
>
|
|
17
|
+
<View>
|
|
18
|
+
<Text>
|
|
19
|
+
Some content
|
|
20
|
+
</Text>
|
|
21
|
+
</View>
|
|
22
|
+
</RCTScrollView>
|
|
23
|
+
`;
|
|
@@ -3,6 +3,7 @@ export * from "./GradientScrollView";
|
|
|
3
3
|
export * from "./GradientBottomActions";
|
|
4
4
|
export * from "./HeaderFirstLevel";
|
|
5
5
|
export * from "./HeaderSecondLevel";
|
|
6
|
+
export * from "./ForceScrollDownView";
|
|
6
7
|
export * from "./FooterWithButtons";
|
|
7
8
|
export * from "./BlockButtons";
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/layout/index.tsx"],"mappings":"AAAA,cAAc,UAAU;AACxB,cAAc,sBAAsB;AACpC,cAAc,yBAAyB;AACvC,cAAc,oBAAoB;AAClC,cAAc,qBAAqB;AACnC,cAAc,qBAAqB;AACnC,cAAc,gBAAgB"}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/layout/index.tsx"],"mappings":"AAAA,cAAc,UAAU;AACxB,cAAc,sBAAsB;AACpC,cAAc,yBAAyB;AACvC,cAAc,oBAAoB;AAClC,cAAc,qBAAqB;AACnC,cAAc,uBAAuB;AACrC,cAAc,qBAAqB;AACnC,cAAc,gBAAgB"}
|
|
@@ -12,7 +12,9 @@ export const IOVisualCostants = {
|
|
|
12
12
|
headerHeight: 56,
|
|
13
13
|
avatarSizeSmall: 44,
|
|
14
14
|
avatarSizeMedium: 66,
|
|
15
|
-
iconContainedSizeDefault: 44
|
|
15
|
+
iconContainedSizeDefault: 44,
|
|
16
|
+
scrollDownButtonRight: 24,
|
|
17
|
+
scrollDownButtonBottom: 24
|
|
16
18
|
};
|
|
17
19
|
export const IOStyles = StyleSheet.create({
|
|
18
20
|
flex: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","StyleSheet","IOColors","IOModuleIDPHSpacing","IOModuleIDPVSpacing","IOModuleIDPRadius","IOVisualCostants","appMarginDefault","headerHeight","avatarSizeSmall","avatarSizeMedium","iconContainedSizeDefault","IOStyles","create","flex","selfCenter","alignSelf","alignCenter","alignItems","horizontalContentPadding","paddingHorizontal","row","flexDirection","column","rowSpaceBetween","justifyContent","centerJustified","footer","backgroundColor","white","paddingBottom","paddingTop","shadowColor","black","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","bgWhite","topListBorderBelowTabsStyle","borderTopWidth","OS","undefined","btnLegacySizeDefault","btnSizeLarge","btnBorderRadius","btnSizeDefault","buttonSolidHeight","iconBtnSizeSmall","numberPadBtnSize","IOButtonLegacyStyles","button","textAlignVertical","borderRadius","buttonInner","label","labelSizeDefault","fontSize","buttonSizeDefault","IOButtonStyles","buttonLink","labelSizeSmall","buttonSizeSmall","dimensionsDefault","IOIconButtonStyles","buttonSizeLarge","IONumberPadButtonStyles","circularShape","buttonSize","IOListItemVisualParams","paddingVertical","iconMargin","actionMargin","iconSize","chevronSize","IOListItemStyles","listItem","marginHorizontal","listItemInner","IOModuleStyles","borderWidth","borderColor","IOSelectionTickVisualParams","size","borderColorOffState","bgColorOnState","tickColor","IOSwitchVisualParams","bgColorOffState","bgCircle","padding","IOSelectionTickLegacyVisualParams","IOSelectionListItemVisualParams","descriptionMargin","IOSelectionListItemStyles"],"sourceRoot":"../../../src","sources":["core/IOStyles.ts"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AAEnD,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAEEC,mBAAmB,EACnBC,mBAAmB,QAGd,aAAa;AACpB,SAASC,iBAAiB,QAAQ,YAAY;;AAE9C;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["Platform","StyleSheet","IOColors","IOModuleIDPHSpacing","IOModuleIDPVSpacing","IOModuleIDPRadius","IOVisualCostants","appMarginDefault","headerHeight","avatarSizeSmall","avatarSizeMedium","iconContainedSizeDefault","scrollDownButtonRight","scrollDownButtonBottom","IOStyles","create","flex","selfCenter","alignSelf","alignCenter","alignItems","horizontalContentPadding","paddingHorizontal","row","flexDirection","column","rowSpaceBetween","justifyContent","centerJustified","footer","backgroundColor","white","paddingBottom","paddingTop","shadowColor","black","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","bgWhite","topListBorderBelowTabsStyle","borderTopWidth","OS","undefined","btnLegacySizeDefault","btnSizeLarge","btnBorderRadius","btnSizeDefault","buttonSolidHeight","iconBtnSizeSmall","numberPadBtnSize","IOButtonLegacyStyles","button","textAlignVertical","borderRadius","buttonInner","label","labelSizeDefault","fontSize","buttonSizeDefault","IOButtonStyles","buttonLink","labelSizeSmall","buttonSizeSmall","dimensionsDefault","IOIconButtonStyles","buttonSizeLarge","IONumberPadButtonStyles","circularShape","buttonSize","IOListItemVisualParams","paddingVertical","iconMargin","actionMargin","iconSize","chevronSize","IOListItemStyles","listItem","marginHorizontal","listItemInner","IOModuleStyles","borderWidth","borderColor","IOSelectionTickVisualParams","size","borderColorOffState","bgColorOnState","tickColor","IOSwitchVisualParams","bgColorOffState","bgCircle","padding","IOSelectionTickLegacyVisualParams","IOSelectionListItemVisualParams","descriptionMargin","IOSel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ACpBJ,UAAU,EAAE,YAAY;IACxBO,cAAc,EAAE;EAClB;AACF,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { GestureResponderEvent } from "react-native";
|
|
3
3
|
import { WithTestID } from "../../utils/types";
|
|
4
4
|
import { IOIcons } from "../icons";
|
|
5
|
-
export type ColorButtonLink = "primary";
|
|
5
|
+
export type ColorButtonLink = "primary" | "contrast";
|
|
6
6
|
export type ButtonLinkProps = WithTestID<{
|
|
7
7
|
color?: ColorButtonLink;
|
|
8
8
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonLink.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/ButtonLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAyB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ButtonLink.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/ButtonLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAyB,MAAM,cAAc,CAAC;AAoB5E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAGL,OAAO,EAER,MAAM,UAAU,CAAC;AAIlB,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,CAAC;AAErD,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC;IACvC,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAE/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,OAAO,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACjD,CAAC,CAAC;AAqEH,eAAO,MAAM,UAAU,qIAWlB,eAAe,uBA6InB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ViewStyle } from "react-native";
|
|
3
|
+
import { WithSpringConfig } from "react-native-reanimated";
|
|
4
|
+
type Props = {
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
springConfig?: WithSpringConfig;
|
|
7
|
+
delayOut?: number;
|
|
8
|
+
delayIn?: number;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
style?: ViewStyle;
|
|
11
|
+
};
|
|
12
|
+
declare const ScaleInOutAnimation: ({ visible, springConfig, delayOut, delayIn, children, style }: Props) => React.JSX.Element | null;
|
|
13
|
+
export { ScaleInOutAnimation };
|
|
14
|
+
//# sourceMappingURL=ScaleInOutAnimation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScaleInOutAnimation.d.ts","sourceRoot":"","sources":["../../../../src/components/common/ScaleInOutAnimation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAiB,EAEf,gBAAgB,EAIjB,MAAM,yBAAyB,CAAC;AAEjC,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,QAAA,MAAM,mBAAmB,kEAOtB,KAAK,6BAsCP,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ScrollViewProps } from "react-native";
|
|
3
|
+
type ForceScrollDownViewProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The content to display inside the scroll view.
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The distance from the bottom of the scrollable content at which the "scroll to bottom" button
|
|
10
|
+
* should become hidden. Defaults to 100.
|
|
11
|
+
*/
|
|
12
|
+
threshold?: number;
|
|
13
|
+
/**
|
|
14
|
+
* A callback that will be called whenever the scroll view crosses the threshold. The callback
|
|
15
|
+
* is passed a boolean indicating whether the threshold has been crossed (`true`) or not (`false`).
|
|
16
|
+
*/
|
|
17
|
+
onThresholdCrossed?: (crossed: boolean) => void;
|
|
18
|
+
} & Pick<ScrollViewProps, "style" | "contentContainerStyle" | "scrollEnabled" | "testID">;
|
|
19
|
+
/**
|
|
20
|
+
* A React Native component that displays a scroll view with a button that scrolls to the bottom of the content
|
|
21
|
+
* when pressed. The button is hidden when the scroll view reaches a certain threshold from the bottom, which is
|
|
22
|
+
* configurable by the `threshold` prop. The button, and the scrolling, can also be disabled by setting the
|
|
23
|
+
* `scrollEnabled` prop to `false`.
|
|
24
|
+
*/
|
|
25
|
+
declare const ForceScrollDownView: ({ children, threshold, style, contentContainerStyle, scrollEnabled, onThresholdCrossed }: ForceScrollDownViewProps) => React.JSX.Element;
|
|
26
|
+
export { ForceScrollDownView };
|
|
27
|
+
//# sourceMappingURL=ForceScrollDownView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ForceScrollDownView.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ForceScrollDownView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,eAAe,EAEhB,MAAM,cAAc,CAAC;AAKtB,KAAK,wBAAwB,GAAG;IAC9B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACjD,GAAG,IAAI,CACN,eAAe,EACf,OAAO,GAAG,uBAAuB,GAAG,eAAe,GAAG,QAAQ,CAC/D,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,mBAAmB,6FAOtB,wBAAwB,sBAkJ1B,CAAC;AAWF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ForceScrollDownView.test.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/__test__/ForceScrollDownView.test.tsx"],"names":[],"mappings":""}
|
|
@@ -3,6 +3,7 @@ export * from "./GradientScrollView";
|
|
|
3
3
|
export * from "./GradientBottomActions";
|
|
4
4
|
export * from "./HeaderFirstLevel";
|
|
5
5
|
export * from "./HeaderSecondLevel";
|
|
6
|
+
export * from "./ForceScrollDownView";
|
|
6
7
|
export * from "./FooterWithButtons";
|
|
7
8
|
export * from "./BlockButtons";
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|