@pagopa/io-app-design-system 5.11.1 → 5.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/lib/commonjs/components/layout/index.js +0 -22
  2. package/lib/commonjs/components/layout/index.js.map +1 -1
  3. package/lib/commonjs/components/templates/ForceScrollDownView.js +13 -5
  4. package/lib/commonjs/components/templates/ForceScrollDownView.js.map +1 -1
  5. package/lib/commonjs/components/templates/__test__/__snapshots__/ForceScrollDownView.test.tsx.snap +1 -0
  6. package/lib/commonjs/components/typography/BodySmall.js +3 -1
  7. package/lib/commonjs/components/typography/BodySmall.js.map +1 -1
  8. package/lib/module/components/layout/index.js +0 -2
  9. package/lib/module/components/layout/index.js.map +1 -1
  10. package/lib/module/components/templates/ForceScrollDownView.js +15 -7
  11. package/lib/module/components/templates/ForceScrollDownView.js.map +1 -1
  12. package/lib/module/components/templates/__test__/__snapshots__/ForceScrollDownView.test.tsx.snap +1 -0
  13. package/lib/module/components/typography/BodySmall.js +3 -1
  14. package/lib/module/components/typography/BodySmall.js.map +1 -1
  15. package/lib/typescript/components/layout/index.d.ts +0 -2
  16. package/lib/typescript/components/layout/index.d.ts.map +1 -1
  17. package/lib/typescript/components/templates/ForceScrollDownView.d.ts +7 -1
  18. package/lib/typescript/components/templates/ForceScrollDownView.d.ts.map +1 -1
  19. package/lib/typescript/components/typography/BodySmall.d.ts.map +1 -1
  20. package/package.json +1 -1
  21. package/src/components/layout/index.tsx +0 -2
  22. package/src/components/templates/ForceScrollDownView.tsx +23 -8
  23. package/src/components/templates/__test__/__snapshots__/ForceScrollDownView.test.tsx.snap +1 -0
  24. package/src/components/typography/BodySmall.tsx +7 -2
  25. package/lib/commonjs/components/layout/GradientBottomActions.js +0 -121
  26. package/lib/commonjs/components/layout/GradientBottomActions.js.map +0 -1
  27. package/lib/commonjs/components/layout/GradientScrollView.js +0 -116
  28. package/lib/commonjs/components/layout/GradientScrollView.js.map +0 -1
  29. package/lib/module/components/layout/GradientBottomActions.js +0 -114
  30. package/lib/module/components/layout/GradientBottomActions.js.map +0 -1
  31. package/lib/module/components/layout/GradientScrollView.js +0 -109
  32. package/lib/module/components/layout/GradientScrollView.js.map +0 -1
  33. package/lib/typescript/components/layout/GradientBottomActions.d.ts +0 -33
  34. package/lib/typescript/components/layout/GradientBottomActions.d.ts.map +0 -1
  35. package/lib/typescript/components/layout/GradientScrollView.d.ts +0 -19
  36. package/lib/typescript/components/layout/GradientScrollView.d.ts.map +0 -1
  37. package/src/components/layout/GradientBottomActions.tsx +0 -143
  38. package/src/components/layout/GradientScrollView.tsx +0 -173
@@ -1,121 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.GradientBottomActions = void 0;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
- var _reactNativeEasingGradient = require("react-native-easing-gradient");
10
- var _reactNativeLinearGradient = _interopRequireDefault(require("react-native-linear-gradient"));
11
- var _reactNativeReanimated = _interopRequireDefault(require("react-native-reanimated"));
12
- var _core = require("../../core");
13
- var _buttons = require("../buttons");
14
- var _Spacer = require("./Spacer");
15
- var _jsxRuntime = require("react/jsx-runtime");
16
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
18
- // Background color should be app main background (both light and dark themes)
19
- const HEADER_BG_COLOR = "white";
20
- const {
21
- colors,
22
- locations
23
- } = (0, _reactNativeEasingGradient.easeGradient)({
24
- colorStops: {
25
- 0: {
26
- color: (0, _core.hexToRgba)(_core.IOColors[HEADER_BG_COLOR], 0)
27
- },
28
- 1: {
29
- color: _core.IOColors[HEADER_BG_COLOR]
30
- }
31
- },
32
- easing: _reactNative.Easing.ease,
33
- extraColorStopsPerTransition: 20
34
- });
35
- const styles = _reactNative.StyleSheet.create({
36
- buttonContainer: {
37
- paddingHorizontal: _core.IOVisualCostants.appMarginDefault,
38
- width: "100%",
39
- flex: 1,
40
- flexShrink: 0,
41
- justifyContent: "flex-end"
42
- },
43
- gradientContainer: {
44
- ..._reactNative.StyleSheet.absoluteFillObject
45
- },
46
- safeBackgroundBlock: {
47
- position: "absolute",
48
- bottom: 0,
49
- left: 0,
50
- right: 0,
51
- backgroundColor: _core.IOColors[HEADER_BG_COLOR]
52
- }
53
- });
54
-
55
- /**
56
- * @deprecated This component has been included in the new `IOScrollView` after a proper refactor. It will be removed in a future release.
57
- * @see IOScrollView
58
- */
59
- const GradientBottomActions = ({
60
- primaryActionProps,
61
- secondaryActionProps,
62
- dimensions,
63
- transitionAnimStyle,
64
- debugMode,
65
- testID
66
- }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
67
- style: {
68
- width: "100%",
69
- position: "absolute",
70
- bottom: 0,
71
- height: dimensions.gradientAreaHeight,
72
- paddingBottom: dimensions.bottomMargin
73
- },
74
- testID: testID,
75
- pointerEvents: "box-none",
76
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
77
- style: [styles.gradientContainer, debugMode && {
78
- borderTopColor: _core.IOColors["error-500"],
79
- borderTopWidth: 1,
80
- backgroundColor: (0, _core.hexToRgba)(_core.IOColors["error-500"], 0.5)
81
- }, transitionAnimStyle],
82
- pointerEvents: "none",
83
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeLinearGradient.default, {
84
- style: {
85
- height: dimensions.gradientAreaHeight * 0.55
86
- },
87
- locations: locations,
88
- colors: colors
89
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
90
- style: {
91
- bottom: 0,
92
- height: dimensions.gradientAreaHeight * 0.45,
93
- backgroundColor: _core.IOColors[HEADER_BG_COLOR]
94
- }
95
- })]
96
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
97
- style: [styles.safeBackgroundBlock, {
98
- height: dimensions.safeBackgroundHeight
99
- }]
100
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
101
- style: styles.buttonContainer,
102
- pointerEvents: "box-none",
103
- children: [primaryActionProps && /*#__PURE__*/(0, _jsxRuntime.jsx)(_buttons.IOButton, {
104
- ...primaryActionProps,
105
- fullWidth: true
106
- }), secondaryActionProps && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
107
- style: {
108
- alignSelf: "center",
109
- marginBottom: dimensions.extraBottomMargin
110
- },
111
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Spacer.VSpacer, {
112
- size: dimensions.spaceBetweenActions
113
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_buttons.IOButton, {
114
- ...secondaryActionProps
115
- })]
116
- })]
117
- })]
118
- });
119
- exports.GradientBottomActions = GradientBottomActions;
120
- var _default = exports.default = GradientBottomActions;
121
- //# sourceMappingURL=GradientBottomActions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_reactNativeEasingGradient","_reactNativeLinearGradient","_interopRequireDefault","_reactNativeReanimated","_core","_buttons","_Spacer","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","HEADER_BG_COLOR","colors","locations","easeGradient","colorStops","color","hexToRgba","IOColors","easing","Easing","ease","extraColorStopsPerTransition","styles","StyleSheet","create","buttonContainer","paddingHorizontal","IOVisualCostants","appMarginDefault","width","flex","flexShrink","justifyContent","gradientContainer","absoluteFillObject","safeBackgroundBlock","position","bottom","left","right","backgroundColor","GradientBottomActions","primaryActionProps","secondaryActionProps","dimensions","transitionAnimStyle","debugMode","testID","jsxs","View","style","height","gradientAreaHeight","paddingBottom","bottomMargin","pointerEvents","children","borderTopColor","borderTopWidth","jsx","safeBackgroundHeight","IOButton","fullWidth","alignSelf","marginBottom","extraBottomMargin","VSpacer","size","spaceBetweenActions","exports","_default"],"sourceRoot":"../../../../src","sources":["components/layout/GradientBottomActions.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AACA,IAAAG,0BAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAEA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAAmC,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAI,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAf,uBAAA,YAAAA,CAAAW,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,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@@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.gradientSafeArea = exports.default = exports.GradientScrollView = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var React = _react;
9
- var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
10
- var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
11
- var _core = require("../../core");
12
- var _GradientBottomActions = _interopRequireDefault(require("./GradientBottomActions"));
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
16
- // Extended gradient area above the actions
17
- const gradientSafeArea = exports.gradientSafeArea = 96;
18
- // End content margin before the actions
19
- const contentEndMargin = 32;
20
- // Margin between primary action and secondary one
21
- const spaceBetweenActions = 24;
22
- // Estimated height of the secondary action
23
- const secondaryActionEstHeight = 20;
24
- // Extra bottom margin for iPhone bottom handle
25
- const extraSafeAreaMargin = 8;
26
-
27
- /**
28
- * @deprecated This component has been deprecated. It will be removed in a future release.
29
- * @see IOScrollView
30
- */
31
- const GradientScrollView = ({
32
- children,
33
- primaryActionProps: primaryActionProps,
34
- secondaryActionProps: secondaryActionProps,
35
- // Don't include safe area insets
36
- excludeSafeAreaMargins = false,
37
- debugMode = false,
38
- testID
39
- }) => {
40
- const gradientOpacity = (0, _reactNativeReanimated.useSharedValue)(1);
41
- const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
42
-
43
- /* Check if the iPhone bottom handle is present.
44
- If not, or if you don't need safe area insets,
45
- add a default margin to prevent the button
46
- from sticking to the bottom. */
47
- const bottomMargin = (0, _react.useMemo)(() => insets.bottom === 0 || excludeSafeAreaMargins ? _core.IOVisualCostants.appMarginDefault : insets.bottom, [insets, excludeSafeAreaMargins]);
48
-
49
- /* When the secondary action is visible, add extra margin
50
- to avoid little space from iPhone bottom handle */
51
- const extraBottomMargin = (0, _react.useMemo)(() => secondaryActionProps && insets.bottom !== 0 ? extraSafeAreaMargin : 0, [insets.bottom, secondaryActionProps]);
52
-
53
- /* Total height of actions */
54
- const actionsArea = (0, _react.useMemo)(() => primaryActionProps && secondaryActionProps ? _core.buttonSolidHeight + spaceBetweenActions + secondaryActionEstHeight + extraBottomMargin : _core.buttonSolidHeight, [extraBottomMargin, primaryActionProps, secondaryActionProps]);
55
-
56
- /* Total height of "Actions + Gradient" area */
57
- const gradientAreaHeight = (0, _react.useMemo)(() => bottomMargin + actionsArea + gradientSafeArea, [actionsArea, bottomMargin]);
58
-
59
- /* Height of the safe bottom area, applied to the ScrollView:
60
- Actions + Content end margin */
61
- const safeBottomAreaHeight = (0, _react.useMemo)(() => bottomMargin + actionsArea + contentEndMargin, [actionsArea, bottomMargin]);
62
- {
63
- /* Safe background block. It's added because when
64
- you swipe up quickly, the content below is visible
65
- for about 100ms. Without this block, the content
66
- appears glitchy. */
67
- }
68
- const safeBackgroundHeight = (0, _react.useMemo)(() => secondaryActionProps ? spaceBetweenActions + secondaryActionEstHeight + extraBottomMargin + bottomMargin : bottomMargin, [bottomMargin, extraBottomMargin, secondaryActionProps]);
69
- const handleScroll = (0, _reactNativeReanimated.useAnimatedScrollHandler)(({
70
- contentOffset,
71
- layoutMeasurement,
72
- contentSize
73
- }) => {
74
- /* We use Math.floor because decimals used on Android
75
- devices never change the `isEndReached` boolean value.
76
- We have more consistent behavior across platforms
77
- if we round these calculations ¯\_(ツ)_/¯ */
78
- const isEndReached = Math.floor(layoutMeasurement.height + contentOffset.y) >= Math.floor(contentSize.height);
79
-
80
- // eslint-disable-next-line functional/immutable-data
81
- gradientOpacity.value = isEndReached ? 0 : 1;
82
- });
83
- const opacityTransition = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
84
- opacity: (0, _reactNativeReanimated.withTiming)(gradientOpacity.value, {
85
- duration: 200,
86
- easing: _reactNativeReanimated.Easing.ease
87
- })
88
- }));
89
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
90
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.ScrollView, {
91
- testID: testID,
92
- onScroll: handleScroll,
93
- scrollEventThrottle: 16,
94
- contentContainerStyle: {
95
- paddingHorizontal: _core.IOVisualCostants.appMarginDefault,
96
- paddingBottom: safeBottomAreaHeight
97
- },
98
- children: children
99
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GradientBottomActions.default, {
100
- debugMode: debugMode,
101
- primaryActionProps: primaryActionProps,
102
- secondaryActionProps: secondaryActionProps,
103
- transitionAnimStyle: opacityTransition,
104
- dimensions: {
105
- bottomMargin,
106
- extraBottomMargin,
107
- gradientAreaHeight,
108
- spaceBetweenActions,
109
- safeBackgroundHeight
110
- }
111
- })]
112
- });
113
- };
114
- exports.GradientScrollView = GradientScrollView;
115
- var _default = exports.default = GradientScrollView;
116
- //# sourceMappingURL=GradientScrollView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","React","_reactNativeReanimated","_reactNativeSafeAreaContext","_core","_GradientBottomActions","_interopRequireDefault","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","gradientSafeArea","exports","contentEndMargin","spaceBetweenActions","secondaryActionEstHeight","extraSafeAreaMargin","GradientScrollView","children","primaryActionProps","secondaryActionProps","excludeSafeAreaMargins","debugMode","testID","gradientOpacity","useSharedValue","insets","useSafeAreaInsets","bottomMargin","useMemo","bottom","IOVisualCostants","appMarginDefault","extraBottomMargin","actionsArea","buttonSolidHeight","gradientAreaHeight","safeBottomAreaHeight","safeBackgroundHeight","handleScroll","useAnimatedScrollHandler","contentOffset","layoutMeasurement","contentSize","isEndReached","Math","floor","height","y","value","opacityTransition","useAnimatedStyle","opacity","withTiming","duration","easing","Easing","ease","jsxs","Fragment","jsx","ScrollView","onScroll","scrollEventThrottle","contentContainerStyle","paddingHorizontal","paddingBottom","transitionAnimStyle","dimensions","_default"],"sourceRoot":"../../../../src","sources":["components/layout/GradientScrollView.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,IAAAC,KAAA,GAAAH,MAAA;AAE/B,IAAAI,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAOA,IAAAG,2BAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAOA,IAAAK,sBAAA,GAAAC,sBAAA,CAAAN,OAAA;AAA4D,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAM,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAS,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GA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from "react";
4
- import { Easing, StyleSheet, View } from "react-native";
5
- import { easeGradient } from "react-native-easing-gradient";
6
- import LinearGradient from "react-native-linear-gradient";
7
- import Animated from "react-native-reanimated";
8
- import { IOColors, IOVisualCostants, hexToRgba } from "../../core";
9
- import { IOButton } from "../buttons";
10
- import { VSpacer } from "./Spacer";
11
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
- // Background color should be app main background (both light and dark themes)
13
- const HEADER_BG_COLOR = "white";
14
- const {
15
- colors,
16
- locations
17
- } = easeGradient({
18
- colorStops: {
19
- 0: {
20
- color: hexToRgba(IOColors[HEADER_BG_COLOR], 0)
21
- },
22
- 1: {
23
- color: IOColors[HEADER_BG_COLOR]
24
- }
25
- },
26
- easing: Easing.ease,
27
- extraColorStopsPerTransition: 20
28
- });
29
- const styles = StyleSheet.create({
30
- buttonContainer: {
31
- paddingHorizontal: IOVisualCostants.appMarginDefault,
32
- width: "100%",
33
- flex: 1,
34
- flexShrink: 0,
35
- justifyContent: "flex-end"
36
- },
37
- gradientContainer: {
38
- ...StyleSheet.absoluteFillObject
39
- },
40
- safeBackgroundBlock: {
41
- position: "absolute",
42
- bottom: 0,
43
- left: 0,
44
- right: 0,
45
- backgroundColor: IOColors[HEADER_BG_COLOR]
46
- }
47
- });
48
-
49
- /**
50
- * @deprecated This component has been included in the new `IOScrollView` after a proper refactor. It will be removed in a future release.
51
- * @see IOScrollView
52
- */
53
- export const GradientBottomActions = ({
54
- primaryActionProps,
55
- secondaryActionProps,
56
- dimensions,
57
- transitionAnimStyle,
58
- debugMode,
59
- testID
60
- }) => /*#__PURE__*/_jsxs(View, {
61
- style: {
62
- width: "100%",
63
- position: "absolute",
64
- bottom: 0,
65
- height: dimensions.gradientAreaHeight,
66
- paddingBottom: dimensions.bottomMargin
67
- },
68
- testID: testID,
69
- pointerEvents: "box-none",
70
- children: [/*#__PURE__*/_jsxs(Animated.View, {
71
- style: [styles.gradientContainer, debugMode && {
72
- borderTopColor: IOColors["error-500"],
73
- borderTopWidth: 1,
74
- backgroundColor: hexToRgba(IOColors["error-500"], 0.5)
75
- }, transitionAnimStyle],
76
- pointerEvents: "none",
77
- children: [/*#__PURE__*/_jsx(LinearGradient, {
78
- style: {
79
- height: dimensions.gradientAreaHeight * 0.55
80
- },
81
- locations: locations,
82
- colors: colors
83
- }), /*#__PURE__*/_jsx(View, {
84
- style: {
85
- bottom: 0,
86
- height: dimensions.gradientAreaHeight * 0.45,
87
- backgroundColor: IOColors[HEADER_BG_COLOR]
88
- }
89
- })]
90
- }), /*#__PURE__*/_jsx(View, {
91
- style: [styles.safeBackgroundBlock, {
92
- height: dimensions.safeBackgroundHeight
93
- }]
94
- }), /*#__PURE__*/_jsxs(View, {
95
- style: styles.buttonContainer,
96
- pointerEvents: "box-none",
97
- children: [primaryActionProps && /*#__PURE__*/_jsx(IOButton, {
98
- ...primaryActionProps,
99
- fullWidth: true
100
- }), secondaryActionProps && /*#__PURE__*/_jsxs(View, {
101
- style: {
102
- alignSelf: "center",
103
- marginBottom: dimensions.extraBottomMargin
104
- },
105
- children: [/*#__PURE__*/_jsx(VSpacer, {
106
- size: dimensions.spaceBetweenActions
107
- }), /*#__PURE__*/_jsx(IOButton, {
108
- ...secondaryActionProps
109
- })]
110
- })]
111
- })]
112
- });
113
- export default GradientBottomActions;
114
- //# sourceMappingURL=GradientBottomActions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","Easing","StyleSheet","View","easeGradient","LinearGradient","Animated","IOColors","IOVisualCostants","hexToRgba","IOButton","VSpacer","jsx","_jsx","jsxs","_jsxs","HEADER_BG_COLOR","colors","locations","colorStops","color","easing","ease","extraColorStopsPerTransition","styles","create","buttonContainer","paddingHorizontal","appMarginDefault","width","flex","flexShrink","justifyContent","gradientContainer","absoluteFillObject","safeBackgroundBlock","position","bottom","left","right","backgroundColor","GradientBottomActions","primaryActionProps","secondaryActionProps","dimensions","transitionAnimStyle","debugMode","testID","style","height","gradientAreaHeight","paddingBottom","bottomMargin","pointerEvents","children","borderTopColor","borderTopWidth","safeBackgroundHeight","fullWidth","alignSelf","marginBottom","extraBottomMargin","size","spaceBetweenActions"],"sourceRoot":"../../../../src","sources":["components/layout/GradientBottomActions.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,MAAM,EAAaC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAC7E,SAASC,YAAY,QAAQ,8BAA8B;AAC3D,OAAOC,cAAc,MAAM,8BAA8B;AACzD,OAAOC,QAAQ,MAAyB,yBAAyB;AACjE,SAASC,QAAQ,EAAYC,gBAAgB,EAAEC,SAAS,QAAQ,YAAY;AAE5E,SAASC,QAAQ,QAAuB,YAAY;AACpD,SAASC,OAAO,QAAQ,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA0BnC;AACA,MAAMC,eAAyB,GAAG,OAAO;AAEzC,MAAM;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAGd,YAAY,CAAC;EACzCe,UAAU,EAAE;IACV,CAAC,EAAE;MAAEC,KAAK,EAAEX,SAAS,CAACF,QAAQ,CAACS,eAAe,CAAC,EAAE,CAAC;IAAE,CAAC;IACrD,CAAC,EAAE;MAAEI,KAAK,EAAEb,QAAQ,CAACS,eAAe;IAAE;EACxC,CAAC;EACDK,MAAM,EAAEpB,MAAM,CAACqB,IAAI;EACnBC,4BAA4B,EAAE;AAChC,CAAC,CAAC;AAEF,MAAMC,MAAM,GAAGtB,UAAU,CAACuB,MAAM,CAAC;EAC/BC,eAAe,EAAE;IACfC,iBAAiB,EAAEnB,gBAAgB,CAACoB,gBAAgB;IACpDC,KAAK,EAAE,MAAM;IACbC,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE,CAAC;IACbC,cAAc,EAAE;EAClB,CAAC;EACDC,iBAAiB,EAAE;IACjB,GAAG/B,UAAU,CAACgC;EAChB,CAAC;EACDC,mBAAmB,EAAE;IACnBC,QAAQ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AAe;MAC3C;IAAE,CACH,CAAC;EAAA,CACW,CAAC,eAEhBH,IAAA,CAACV,IAAI;IACH6C,KAAK,EAAE,CACLxB,MAAM,CAACW,mBAAmB,EAC1B;MACEc,MAAM,EAAEL,UAAU,CAACa;IACrB,CAAC;EACD,CACH,CAAC,eACF1C,KAAA,CAACZ,IAAI;IAAC6C,KAAK,EAAExB,MAAM,CAACE,eAAgB;IAAC2B,aAAa,EAAC,UAAU;IAAAC,QAAA,GAC1DZ,kBAAkB,iBAAI7B,IAAA,CAACH,QAAQ;MAAA,GAAKgC,kBAAkB;MAAEgB,SAAS;IAAA,CAAE,CAAC,EAEpEf,oBAAoB,iBACnB5B,KAAA,CAACZ,IAAI;MACH6C,KAAK,EAAE;QACLW,SAAS,EAAE,QAAQ;QACnBC,YAAY,EAAEhB,UAAU,CAACiB;MAC3B,CAAE;MAAAP,QAAA,gBAEFzC,IAAA,CAACF,OAAO;QAACmD,IAAI,EAAElB,UAAU,CAACmB;MAAoB,CAAE,CAAC,eACjDlD,IAAA,CAACH,QAAQ;QAAA,GAAKiC;MAAoB,CAAG,CAAC;IAAA,CAClC,CACP;EAAA,CACG,CAAC;AAAA,CACH,CACP;AAED,eAAeF,qBAAqB","ignoreList":[]}
@@ -1,109 +0,0 @@
1
- "use strict";
2
-
3
- import * as React from "react";
4
- import { useMemo } from "react";
5
- import Animated, { Easing, useAnimatedScrollHandler, useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
6
- import { useSafeAreaInsets } from "react-native-safe-area-context";
7
- import { IOVisualCostants, buttonSolidHeight } from "../../core";
8
- import GradientBottomActions from "./GradientBottomActions";
9
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
10
- // Extended gradient area above the actions
11
- export const gradientSafeArea = 96;
12
- // End content margin before the actions
13
- const contentEndMargin = 32;
14
- // Margin between primary action and secondary one
15
- const spaceBetweenActions = 24;
16
- // Estimated height of the secondary action
17
- const secondaryActionEstHeight = 20;
18
- // Extra bottom margin for iPhone bottom handle
19
- const extraSafeAreaMargin = 8;
20
-
21
- /**
22
- * @deprecated This component has been deprecated. It will be removed in a future release.
23
- * @see IOScrollView
24
- */
25
- export const GradientScrollView = ({
26
- children,
27
- primaryActionProps: primaryActionProps,
28
- secondaryActionProps: secondaryActionProps,
29
- // Don't include safe area insets
30
- excludeSafeAreaMargins = false,
31
- debugMode = false,
32
- testID
33
- }) => {
34
- const gradientOpacity = useSharedValue(1);
35
- const insets = useSafeAreaInsets();
36
-
37
- /* Check if the iPhone bottom handle is present.
38
- If not, or if you don't need safe area insets,
39
- add a default margin to prevent the button
40
- from sticking to the bottom. */
41
- const bottomMargin = useMemo(() => insets.bottom === 0 || excludeSafeAreaMargins ? IOVisualCostants.appMarginDefault : insets.bottom, [insets, excludeSafeAreaMargins]);
42
-
43
- /* When the secondary action is visible, add extra margin
44
- to avoid little space from iPhone bottom handle */
45
- const extraBottomMargin = useMemo(() => secondaryActionProps && insets.bottom !== 0 ? extraSafeAreaMargin : 0, [insets.bottom, secondaryActionProps]);
46
-
47
- /* Total height of actions */
48
- const actionsArea = useMemo(() => primaryActionProps && secondaryActionProps ? buttonSolidHeight + spaceBetweenActions + secondaryActionEstHeight + extraBottomMargin : buttonSolidHeight, [extraBottomMargin, primaryActionProps, secondaryActionProps]);
49
-
50
- /* Total height of "Actions + Gradient" area */
51
- const gradientAreaHeight = useMemo(() => bottomMargin + actionsArea + gradientSafeArea, [actionsArea, bottomMargin]);
52
-
53
- /* Height of the safe bottom area, applied to the ScrollView:
54
- Actions + Content end margin */
55
- const safeBottomAreaHeight = useMemo(() => bottomMargin + actionsArea + contentEndMargin, [actionsArea, bottomMargin]);
56
- {
57
- /* Safe background block. It's added because when
58
- you swipe up quickly, the content below is visible
59
- for about 100ms. Without this block, the content
60
- appears glitchy. */
61
- }
62
- const safeBackgroundHeight = useMemo(() => secondaryActionProps ? spaceBetweenActions + secondaryActionEstHeight + extraBottomMargin + bottomMargin : bottomMargin, [bottomMargin, extraBottomMargin, secondaryActionProps]);
63
- const handleScroll = useAnimatedScrollHandler(({
64
- contentOffset,
65
- layoutMeasurement,
66
- contentSize
67
- }) => {
68
- /* We use Math.floor because decimals used on Android
69
- devices never change the `isEndReached` boolean value.
70
- We have more consistent behavior across platforms
71
- if we round these calculations ¯\_(ツ)_/¯ */
72
- const isEndReached = Math.floor(layoutMeasurement.height + contentOffset.y) >= Math.floor(contentSize.height);
73
-
74
- // eslint-disable-next-line functional/immutable-data
75
- gradientOpacity.value = isEndReached ? 0 : 1;
76
- });
77
- const opacityTransition = useAnimatedStyle(() => ({
78
- opacity: withTiming(gradientOpacity.value, {
79
- duration: 200,
80
- easing: Easing.ease
81
- })
82
- }));
83
- return /*#__PURE__*/_jsxs(_Fragment, {
84
- children: [/*#__PURE__*/_jsx(Animated.ScrollView, {
85
- testID: testID,
86
- onScroll: handleScroll,
87
- scrollEventThrottle: 16,
88
- contentContainerStyle: {
89
- paddingHorizontal: IOVisualCostants.appMarginDefault,
90
- paddingBottom: safeBottomAreaHeight
91
- },
92
- children: children
93
- }), /*#__PURE__*/_jsx(GradientBottomActions, {
94
- debugMode: debugMode,
95
- primaryActionProps: primaryActionProps,
96
- secondaryActionProps: secondaryActionProps,
97
- transitionAnimStyle: opacityTransition,
98
- dimensions: {
99
- bottomMargin,
100
- extraBottomMargin,
101
- gradientAreaHeight,
102
- spaceBetweenActions,
103
- safeBackgroundHeight
104
- }
105
- })]
106
- });
107
- };
108
- export default GradientScrollView;
109
- //# sourceMappingURL=GradientScrollView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","useMemo","Animated","Easing","useAnimatedScrollHandler","useAnimatedStyle","useSharedValue","withTiming","useSafeAreaInsets","IOVisualCostants","buttonSolidHeight","GradientBottomActions","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","gradientSafeArea","contentEndMargin","spaceBetweenActions","secondaryActionEstHeight","extraSafeAreaMargin","GradientScrollView","children","primaryActionProps","secondaryActionProps","excludeSafeAreaMargins","debugMode","testID","gradientOpacity","insets","bottomMargin","bottom","appMarginDefault","extraBottomMargin","actionsArea","gradientAreaHeight","safeBottomAreaHeight","safeBackgroundHeight","handleScroll","contentOffset","layoutMeasurement","contentSize","isEndReached","Math","floor","height","y","value","opacityTransition","opacity","duration","easing","ease","ScrollView","onScroll","scrollEventThrottle","contentContainerStyle","paddingHorizontal","paddingBottom","transitionAnimStyle","dimensions"],"sourceRoot":"../../../../src","sources":["components/layout/GradientScrollView.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,OAAO,QAAQ,OAAO;AAC/B,OAAOC,QAAQ,IACbC,MAAM,EACNC,wBAAwB,EACxBC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAChC,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SAGEC,gBAAgB,EAChBC,iBAAiB,QACZ,YAAY;AAEnB,OAAOC,qBAAqB,MAAM,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAa5D;AACA,OAAO,MAAMC,gBAAgC,GAAG,EAAE;AAClD;AACA,MAAMC,gBAAgC,GAAG,EAAE;AAC3C;AACA,MAAMC,mBAA6B,GAAG,EAAE;AACxC;AACA,MAAMC,wBAAgC,GAAG,EAAE;AAC3C;AACA,MAAMC,mBAAmC,GAAG,CAAC;;AAE7C;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,GAAGA,CAAC;EACjCC,QAAQ;EACRC,kBAAkB,EAAEA,kBAAkB;EACtCC,oBAAoB,EAAEA,oBAAoB;EAC1C;EACAC,sBAAsB,GAAG,KAAK;EAC9BC,SAAS,GAAG,KAAK;EACjBC;AACkB,CAAC,KAAK;EACxB,MAAMC,eAAe,GAAGxB,cAAc,CAAC,CAAC,CAAC;EACzC,MAAMyB,MAAM,GAAGvB,iBAAiB,CAAC,CAAC;;EA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AAK;IACrD;AACN;AACA;AACA;IACM,MAAMC,YAAY,GAChBC,IAAI,CAACC,KAAK,CAACJ,iBAAiB,CAACK,MAAM,GAAGN,aAAa,CAACO,CAAC,CAAC,IACtDH,IAAI,CAACC,KAAK,CAACH,WAAW,CAACI,MAAM,CAAC;;IAEhC;IACAjB,eAAe,CAACmB,KAAK,GAAGL,YAAY,GAAG,CAAC,GAAG,CAAC;EAC9C,CACF,CAAC;EAED,MAAMM,iBAAiB,GAAG7C,gBAAgB,CAAC,OAAO;IAChD8C,OAAO,EAAE5C,UAAU,CAACuB,eAAe,CAACmB,KAAK,EAAE;MACzCG,QAAQ,EAAE,GAAG;MACbC,MAAM,EAAElD,MAAM,CAACmD;IACjB,CAAC;EACH,CAAC,CAAC,CAAC;EAEH,oBACErC,KAAA,CAAAF,SAAA;IAAAS,QAAA,gBACEX,IAAA,CAACX,QAAQ,CAACqD,UAAU;MAClB1B,MAAM,EAAEA,MAAO;MACf2B,QAAQ,EAAEhB,YAAa;MACvBiB,mBAAmB,EAAE,EAAG;MACxBC,qBAAqB,EAAE;QACrBC,iBAAiB,EAAElD,gBAAgB,CAACyB,gBAAgB;QACpD0B,aAAa,EAAEtB;MACjB,CAAE;MAAAd,QAAA,EAEDA;IAAQ,CACU,CAAC,eACtBX,IAAA,CAACF,qBAAqB;MACpBiB,SAAS,EAAEA,SAAU;MACrBH,kBAAkB,EAAEA,kBAAmB;MACvCC,oBAAoB,EAAEA,oBAAqB;MAC3CmC,mBAAmB,EAAEX,iBAAkB;MACvCY,UAAU,EAAE;QACV9B,YAAY;QACZG,iBAAiB;QACjBE,kBAAkB;QAClBjB,mBAAmB;QACnBmB;MACF;IAAE,CACH,CAAC;EAAA,CACF,CAAC;AAEP,CAAC;AAED,eAAehB,kBAAkB","ignoreList":[]}
@@ -1,33 +0,0 @@
1
- import * as React from "react";
2
- import { StyleProp, ViewStyle } from "react-native";
3
- import { AnimatedStyle } from "react-native-reanimated";
4
- import { IOSpacer } from "../../core";
5
- import { WithTestID } from "../../utils/types";
6
- import { IOButtonProps } from "../buttons";
7
- type PrimaryActionProps = Extract<IOButtonProps, {
8
- variant?: "solid" | "outline";
9
- }>;
10
- type SecondaryActionProps = Extract<IOButtonProps, {
11
- variant?: "link";
12
- }>;
13
- export type GradientBottomActions = WithTestID<{
14
- transitionAnimStyle: AnimatedStyle<StyleProp<ViewStyle>>;
15
- dimensions: GradientBottomActionsDimensions;
16
- primaryActionProps?: PrimaryActionProps;
17
- secondaryActionProps?: SecondaryActionProps;
18
- debugMode?: boolean;
19
- }>;
20
- type GradientBottomActionsDimensions = {
21
- bottomMargin: number;
22
- extraBottomMargin: number;
23
- gradientAreaHeight: number;
24
- spaceBetweenActions: IOSpacer;
25
- safeBackgroundHeight: number;
26
- };
27
- /**
28
- * @deprecated This component has been included in the new `IOScrollView` after a proper refactor. It will be removed in a future release.
29
- * @see IOScrollView
30
- */
31
- export declare const GradientBottomActions: ({ primaryActionProps, secondaryActionProps, dimensions, transitionAnimStyle, debugMode, testID }: GradientBottomActions) => React.JSX.Element;
32
- export default GradientBottomActions;
33
- //# sourceMappingURL=GradientBottomActions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GradientBottomActions.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/GradientBottomActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAU,SAAS,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9E,OAAiB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAY,QAAQ,EAA+B,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAY,aAAa,EAAE,MAAM,YAAY,CAAC;AAGrD,KAAK,kBAAkB,GAAG,OAAO,CAC/B,aAAa,EACb;IAAE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,CAClC,CAAC;AACF,KAAK,oBAAoB,GAAG,OAAO,CAAC,aAAa,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEzE,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC;IAC7C,mBAAmB,EAAE,aAAa,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IACzD,UAAU,EAAE,+BAA+B,CAAC;IAE5C,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAE5C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH,KAAK,+BAA+B,GAAG;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,QAAQ,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAkCF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,kGAOnC,qBAAqB,sBA+DvB,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -1,19 +0,0 @@
1
- import * as React from "react";
2
- import { IOSpacingScale } from "../../core";
3
- import { WithTestID } from "../../utils/types";
4
- import GradientBottomActions from "./GradientBottomActions";
5
- export type GradientScrollView = WithTestID<{
6
- children: React.ReactNode;
7
- excludeSafeAreaMargins?: boolean;
8
- debugMode?: boolean;
9
- primaryActionProps: GradientBottomActions["primaryActionProps"];
10
- secondaryActionProps?: GradientBottomActions["secondaryActionProps"];
11
- }>;
12
- export declare const gradientSafeArea: IOSpacingScale;
13
- /**
14
- * @deprecated This component has been deprecated. It will be removed in a future release.
15
- * @see IOScrollView
16
- */
17
- export declare const GradientScrollView: ({ children, primaryActionProps: primaryActionProps, secondaryActionProps: secondaryActionProps, excludeSafeAreaMargins, debugMode, testID }: GradientScrollView) => React.JSX.Element;
18
- export default GradientScrollView;
19
- //# sourceMappingURL=GradientScrollView.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GradientScrollView.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/GradientScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,EAEL,cAAc,EAGf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC;IAC1C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IAIpB,kBAAkB,EAAE,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;IAChE,oBAAoB,CAAC,EAAE,qBAAqB,CAAC,sBAAsB,CAAC,CAAC;CACtE,CAAC,CAAC;AAGH,eAAO,MAAM,gBAAgB,EAAE,cAAmB,CAAC;AAUnD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,6IAQhC,kBAAkB,sBAqHpB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}