@ledgerhq/native-ui 0.28.0 → 0.29.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Cards/BannerCard/index.js +2 -2
- package/lib/components/Cards/InformativeCard/index.js +4 -4
- package/lib/components/Cards/NotificationCard/index.js +1 -1
- package/lib/components/Cards/SideImageCard/index.js +3 -3
- package/lib/components/Carousel/index.js +4 -4
- package/lib/components/Form/Input/AnimatedInput/AnimatedNotchedLabel.js +2 -2
- package/lib/components/Form/Input/AnimatedInput/index.js +4 -16
- package/lib/components/Form/Input/AnimatedInputSelect/index.js +3 -15
- package/lib/components/Form/Input/BaseInput/index.js +8 -19
- package/lib/components/Form/Input/LegendInput/index.js +3 -15
- package/lib/components/Form/Input/NumberInput/index.js +3 -15
- package/lib/components/Form/Input/QrCodeInput/index.js +3 -15
- package/lib/components/Form/Input/SearchInput/index.js +5 -17
- package/lib/components/Form/SelectableList.js +3 -3
- package/lib/components/Form/TabSelector/index.d.ts +5 -4
- package/lib/components/Form/TabSelector/index.d.ts.map +1 -1
- package/lib/components/Form/TabSelector/index.js +10 -4
- package/lib/components/Icon/BoxedIcon.js +2 -14
- package/lib/components/Icon/IconBadge.js +2 -14
- package/lib/components/Icon/IconBox/index.js +1 -1
- package/lib/components/Layout/Divider/index.js +2 -2
- package/lib/components/Layout/List/IconBoxList/index.js +6 -15
- package/lib/components/Layout/List/List/index.js +5 -18
- package/lib/components/Layout/List/NumberedList/index.js +6 -18
- package/lib/components/Layout/List/TipList/index.js +6 -15
- package/lib/components/Layout/List/VerticalStepper/StepperItem.js +8 -12
- package/lib/components/Layout/List/VerticalStepper/index.js +4 -16
- package/lib/components/Layout/List/VerticalTimeline/TimelineIndicator.js +2 -14
- package/lib/components/Layout/List/VerticalTimeline/TimelineItem.js +9 -13
- package/lib/components/Layout/List/VerticalTimeline/index.js +4 -16
- package/lib/components/Layout/Modals/BaseModal/index.js +2 -14
- package/lib/components/Layout/Modals/BottomDrawer/index.js +2 -14
- package/lib/components/Layout/Modals/Popin/index.js +2 -14
- package/lib/components/Layout/Modals/Tooltip/index.js +3 -15
- package/lib/components/Layout/ScrollContainer/index.js +1 -15
- package/lib/components/Layout/ScrollContainerHeader/index.js +3 -15
- package/lib/components/Layout/ScrollListContainer/index.js +2 -14
- package/lib/components/Layout/Table/Row.js +2 -14
- package/lib/components/Loader/InfiniteLoader/index.js +5 -15
- package/lib/components/Loader/ProgressLoader/index.js +1 -1
- package/lib/components/Navigation/FlowStepper/index.js +3 -3
- package/lib/components/Navigation/Stepper/index.js +4 -16
- package/lib/components/ProgressBar/index.js +3 -15
- package/lib/components/Tabs/Chip/index.js +3 -3
- package/lib/components/Tabs/Graph/index.js +1 -1
- package/lib/components/Tabs/TemplateTabs/index.js +2 -14
- package/lib/components/Text/getTextStyle.js +4 -2
- package/lib/components/Text/index.js +9 -25
- package/lib/components/cta/Button/getButtonStyle.js +10 -2
- package/lib/components/cta/Button/index.js +15 -20
- package/lib/components/cta/Link/index.js +2 -2
- package/lib/components/cta/QuickAction/QuickActionButton/index.d.ts.map +1 -1
- package/lib/components/cta/QuickAction/QuickActionButton/index.js +6 -14
- package/lib/components/cta/QuickAction/QuickActionList/index.js +3 -15
- package/lib/components/message/Alert/index.js +1 -1
- package/lib/components/message/Log/index.js +1 -1
- package/lib/components/message/Notification/index.js +15 -19
- package/lib/components/tags/Badge/index.js +3 -1
- package/lib/components/tags/Tag/index.js +2 -14
- package/lib/icons/BracketLeft.js +1 -1
- package/lib/icons/BracketRight.js +1 -1
- package/lib/styles/InvertTheme.js +5 -1
- package/lib/styles/StyleProvider.js +9 -1
- package/lib/styles/theme.js +4 -1
- package/package.json +2 -3
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React, { useMemo } from "react";
|
|
13
2
|
import List from "../List";
|
|
14
3
|
import Check from "@ledgerhq/icons-ui/nativeLegacy/CheckAloneMedium";
|
|
15
4
|
import Close from "@ledgerhq/icons-ui/nativeLegacy/CloseMedium";
|
|
16
|
-
export default function TipList(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
export default function TipList({ items, ...props }) {
|
|
6
|
+
const tipItems = useMemo(() => items.map((item) => ({
|
|
7
|
+
...item,
|
|
8
|
+
bullet: item.isPositive ? (React.createElement(Check, { size: 20, color: "success.c50" })) : (React.createElement(Close, { size: 20, color: "error.c50" })),
|
|
9
|
+
})), [items]);
|
|
10
|
+
return React.createElement(List, { items: tipItems, ...props });
|
|
20
11
|
}
|
|
@@ -12,7 +12,6 @@ const Container = styled(Flex) `
|
|
|
12
12
|
border-bottom-color: ${(p) => p.isLastItem && p.status !== "inactive" ? "transparent" : p.theme.colors.neutral.c40};
|
|
13
13
|
`;
|
|
14
14
|
export default function StepperItem({ item, progress, nested, isLastItem, onTapIndex, index, }) {
|
|
15
|
-
var _a;
|
|
16
15
|
/**
|
|
17
16
|
* Having an initial value of null will prevent having "height: 0" before the
|
|
18
17
|
* initial call of onLayout.
|
|
@@ -25,16 +24,13 @@ export default function StepperItem({ item, progress, nested, isLastItem, onTapI
|
|
|
25
24
|
const handleLayout = useCallback(({ nativeEvent: { layout } }) => {
|
|
26
25
|
sharedHeight.value = withTiming(layout.height, { duration: 300 });
|
|
27
26
|
}, [sharedHeight]);
|
|
28
|
-
const animatedStyle = useAnimatedStyle(() => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
height: (_a = sharedHeight.value) !== null && _a !== void 0 ? _a : undefined,
|
|
36
|
-
});
|
|
37
|
-
}, []);
|
|
27
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
28
|
+
/**
|
|
29
|
+
* If it's null the component still renders normally at its full height
|
|
30
|
+
* without its height being derived from an animated value.
|
|
31
|
+
*/
|
|
32
|
+
height: sharedHeight.value ?? undefined,
|
|
33
|
+
}), []);
|
|
38
34
|
const handlePress = useCallback(() => {
|
|
39
35
|
onTapIndex && onTapIndex(index);
|
|
40
36
|
}, [onTapIndex, index]);
|
|
@@ -47,7 +43,7 @@ export default function StepperItem({ item, progress, nested, isLastItem, onTapI
|
|
|
47
43
|
item.status === "active" && (React.createElement(ProgressLoader, { progress: progress, infinite: !progress, radius: 10, strokeWidth: 2 }))),
|
|
48
44
|
React.createElement(Flex, { flex: 1, ml: nested ? 0 : 4, mr: nested ? 0 : 2 },
|
|
49
45
|
React.createElement(Flex, { pb: item.status === "active" && item.renderBody ? 3 : undefined },
|
|
50
|
-
React.createElement(Text,
|
|
46
|
+
React.createElement(Text, { ...(nested ? { variant: "body" } : { variant: "large", fontWeight: "semiBold" }), color: item.status === "active" || nested ? "neutral.c100" : "neutral.c80" }, item.status === "completed" ? item.doneTitle ?? item.title : item.title)),
|
|
51
47
|
React.createElement(Animated.ScrollView, { style: animatedStyle, showsVerticalScrollIndicator: false },
|
|
52
48
|
React.createElement(Animated.View, { onLayout: handleLayout }, item.renderBody && item.status === "active" ? item.renderBody(true) : null))))))));
|
|
53
49
|
}
|
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from "react";
|
|
13
2
|
import StepperItem from "./StepperItem";
|
|
14
3
|
import { Flex } from "../..";
|
|
15
|
-
export default React.memo(function VerticalStepper(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
steps.map((step, index) => (React.createElement(StepperItem, { key: step.title, item: step, progress: step.progress, nested: nested, isLastItem: index === steps.length - 1, onTapIndex: onTapIndex, index: index })))));
|
|
4
|
+
export default React.memo(function VerticalStepper({ steps, onTapIndex, nested, ...props }) {
|
|
5
|
+
return (React.createElement(Flex, { ...props, flexDirection: "column" },
|
|
6
|
+
nested && React.createElement(Flex, { mt: 7, mb: 4, borderBottomWidth: 1, borderBottomColor: "neutral.c40" }),
|
|
7
|
+
steps?.map((step, index) => (React.createElement(StepperItem, { key: step.title, item: step, progress: step.progress, nested: nested, isLastItem: index === steps.length - 1, onTapIndex: onTapIndex, index: index })))));
|
|
20
8
|
});
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from "react";
|
|
13
2
|
import { Dimensions, PixelRatio, Platform, StyleSheet } from "react-native";
|
|
14
3
|
import { CircledCheckSolidMedium } from "@ledgerhq/icons-ui/nativeLegacy";
|
|
@@ -75,10 +64,9 @@ const CenterCircle = styled(Flex) `
|
|
|
75
64
|
align-items: center;
|
|
76
65
|
justify-content: center;
|
|
77
66
|
`;
|
|
78
|
-
export default function TimelineIndicator(
|
|
79
|
-
var { status, isFirstItem, isLastItem, topHeight } = _a, props = __rest(_a, ["status", "isFirstItem", "isLastItem", "topHeight"]);
|
|
67
|
+
export default function TimelineIndicator({ status, isFirstItem, isLastItem, topHeight, ...props }) {
|
|
80
68
|
const { colors } = useTheme();
|
|
81
|
-
return (React.createElement(Flex,
|
|
69
|
+
return (React.createElement(Flex, { flexDirection: "column", alignItems: "center", ...props },
|
|
82
70
|
React.createElement(TopSegmentSvg, { status: status, hidden: isFirstItem, height: PixelRatio.roundToNearestPixel(topHeight || topSegmentDefaultHeight) }),
|
|
83
71
|
React.createElement(CenterCircle, { status: status, isLastItem: isLastItem }, status === "completed" && (React.createElement(CircledCheckSolidMedium, { color: isLastItem ? colors.success.c70 : colors.primary.c80, size: 20 }))),
|
|
84
72
|
React.createElement(BottomSegmentSvg, { status: status, hidden: isLastItem })));
|
|
@@ -35,7 +35,6 @@ const Container = styled(Flex) `
|
|
|
35
35
|
padding: 20px 16px;
|
|
36
36
|
`;
|
|
37
37
|
export default function TimelineItem({ item, formatEstimatedTime, isFirstItem, isLastItem, setActiveIndex, index, withExtraMarginOnActiveStep, }) {
|
|
38
|
-
var _a;
|
|
39
38
|
const theme = useTheme();
|
|
40
39
|
/**
|
|
41
40
|
* Having an initial value of null will prevent having "height: 0" before the
|
|
@@ -49,16 +48,13 @@ export default function TimelineItem({ item, formatEstimatedTime, isFirstItem, i
|
|
|
49
48
|
const handleLayout = useCallback(({ nativeEvent: { layout } }) => {
|
|
50
49
|
sharedHeight.value = withTiming(layout.height, { duration: 300 });
|
|
51
50
|
}, [sharedHeight]);
|
|
52
|
-
const animatedStyle = useAnimatedStyle(() => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
height: (_a = sharedHeight.value) !== null && _a !== void 0 ? _a : undefined,
|
|
60
|
-
});
|
|
61
|
-
}, []);
|
|
51
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
52
|
+
/**
|
|
53
|
+
* If it's null the component still renders normally at its full height
|
|
54
|
+
* without its height being derived from an animated value.
|
|
55
|
+
*/
|
|
56
|
+
height: sharedHeight.value ?? undefined,
|
|
57
|
+
}), []);
|
|
62
58
|
const handlePress = useCallback(() => {
|
|
63
59
|
setActiveIndex && setActiveIndex(index);
|
|
64
60
|
}, [setActiveIndex, index]);
|
|
@@ -73,8 +69,8 @@ export default function TimelineItem({ item, formatEstimatedTime, isFirstItem, i
|
|
|
73
69
|
? "success.c70"
|
|
74
70
|
: item.status === "active"
|
|
75
71
|
? "primary.c80"
|
|
76
|
-
: "neutral.c70" }, item.status === "completed" ?
|
|
77
|
-
|
|
72
|
+
: "neutral.c70" }, item.status === "completed" ? item.doneTitle ?? item.title : item.title),
|
|
73
|
+
item?.estimatedTime && item.status === "active" && (React.createElement(Tag, null, formatEstimatedTime
|
|
78
74
|
? formatEstimatedTime(item.estimatedTime)
|
|
79
75
|
: `${item.estimatedTime / 60} min`))),
|
|
80
76
|
React.createElement(Animated.ScrollView, { style: animatedStyle, showsVerticalScrollIndicator: false },
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React, { useRef, useCallback } from "react";
|
|
13
2
|
import { ScrollView, View, } from "react-native";
|
|
14
3
|
import TimelineItem from "./TimelineItem";
|
|
15
4
|
import Flex from "../../Flex";
|
|
16
5
|
import Text from "../../../Text";
|
|
17
6
|
import { ItemStatus } from "../types";
|
|
18
|
-
export default function VerticalTimeline(
|
|
19
|
-
var { steps, formatEstimatedTime, setActiveIndex, header, autoScroll = true, contentContainerStyle } = _a, props = __rest(_a, ["steps", "formatEstimatedTime", "setActiveIndex", "header", "autoScroll", "contentContainerStyle"]);
|
|
7
|
+
export default function VerticalTimeline({ steps, formatEstimatedTime, setActiveIndex, header, autoScroll = true, contentContainerStyle, ...props }) {
|
|
20
8
|
const scrollViewRef = useRef(null);
|
|
21
9
|
const stepsContainerLayout = useRef();
|
|
22
10
|
const onStepsContainerLayout = useCallback((evt) => {
|
|
@@ -30,11 +18,11 @@ export default function VerticalTimeline(_a) {
|
|
|
30
18
|
}, []);
|
|
31
19
|
return (React.createElement(ScrollView, { ref: scrollViewRef, onLayout: onStepsContainerLayout, contentContainerStyle: contentContainerStyle },
|
|
32
20
|
header,
|
|
33
|
-
React.createElement(Flex,
|
|
21
|
+
React.createElement(Flex, { ...props, onLayout: onStepsContainerLayout, flexDirection: "column" }, steps?.map((step, index) => (React.createElement(View, { onLayout: autoScroll && step.status === "active" ? onActiveStepLayout : undefined },
|
|
34
22
|
React.createElement(TimelineItem, { key: step.title, item: step, formatEstimatedTime: formatEstimatedTime, isFirstItem: index === 0, isLastItem: index === steps.length - 1, setActiveIndex: setActiveIndex, index: index })))))));
|
|
35
23
|
}
|
|
36
|
-
const SubtitleText = (props) => (React.createElement(Text,
|
|
37
|
-
const BodyText = (props) => (React.createElement(Text,
|
|
24
|
+
const SubtitleText = (props) => (React.createElement(Text, { variant: "body", fontWeight: "semiBold", color: "neutral.c100", mb: 3, ...props }));
|
|
25
|
+
const BodyText = (props) => (React.createElement(Text, { variant: "bodyLineHeight", fontWeight: "medium", color: "neutral.c80", ...props }));
|
|
38
26
|
VerticalTimeline.BodyText = BodyText;
|
|
39
27
|
VerticalTimeline.SubtitleText = SubtitleText;
|
|
40
28
|
VerticalTimeline.ItemStatus = ItemStatus;
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React, { useCallback } from "react";
|
|
13
2
|
import ReactNativeModal from "react-native-modal";
|
|
14
3
|
import styled from "styled-components/native";
|
|
@@ -89,8 +78,7 @@ export function ModalHeaderBackButton({ onBack, }) {
|
|
|
89
78
|
React.createElement(TouchableOpacity, { onPress: onBack, testID: "modal-back-button" },
|
|
90
79
|
React.createElement(ArrowLeft, { color: colors.neutral.c100, size: "XS" }))));
|
|
91
80
|
}
|
|
92
|
-
export default function BaseModal(
|
|
93
|
-
var { isOpen, onClose = () => { }, onBack = () => { }, noCloseButton, hasBackButton, safeContainerStyle = {}, containerStyle = {}, modalStyle = {}, preventBackdropClick, Icon, iconColor, title, description, subtitle, children, onModalHide, CustomHeader } = _a, rest = __rest(_a, ["isOpen", "onClose", "onBack", "noCloseButton", "hasBackButton", "safeContainerStyle", "containerStyle", "modalStyle", "preventBackdropClick", "Icon", "iconColor", "title", "description", "subtitle", "children", "onModalHide", "CustomHeader"]);
|
|
81
|
+
export default function BaseModal({ isOpen, onClose = () => { }, onBack = () => { }, noCloseButton, hasBackButton, safeContainerStyle = {}, containerStyle = {}, modalStyle = {}, preventBackdropClick, Icon, iconColor, title, description, subtitle, children, onModalHide, CustomHeader, ...rest }) {
|
|
94
82
|
const backDropProps = preventBackdropClick
|
|
95
83
|
? {}
|
|
96
84
|
: {
|
|
@@ -105,7 +93,7 @@ export default function BaseModal(_a) {
|
|
|
105
93
|
onClose();
|
|
106
94
|
onModalHide && onModalHide();
|
|
107
95
|
}, [onClose, onModalHide]);
|
|
108
|
-
return (React.createElement(ReactNativeModal,
|
|
96
|
+
return (React.createElement(ReactNativeModal, { ...backDropProps, ...rest, isVisible: !!isOpen, deviceWidth: width, deviceHeight: height, useNativeDriver: true, useNativeDriverForBackdrop: true, hideModalContentWhileAnimating: true, onModalHide: onModalHideWithClose, style: [defaultModalStyle, modalStyle] },
|
|
109
97
|
React.createElement(SafeContainer, { style: safeContainerStyle },
|
|
110
98
|
CustomHeader && (React.createElement(CustomHeader, null, !noCloseButton && React.createElement(ModalHeaderCloseButton, { onClose: onClose }))),
|
|
111
99
|
React.createElement(Container, { style: containerStyle },
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from "react";
|
|
13
2
|
import { StyleSheet } from "react-native";
|
|
14
3
|
import BaseModal from "../BaseModal";
|
|
@@ -34,7 +23,6 @@ const modalStyleOverrides = StyleSheet.create({
|
|
|
34
23
|
borderTopRightRadius: 24,
|
|
35
24
|
},
|
|
36
25
|
});
|
|
37
|
-
export default function BottomDrawer(
|
|
38
|
-
|
|
39
|
-
return (React.createElement(BaseModal, Object.assign({}, restProps, { modalStyle: modalStyleOverrides.modal, safeContainerStyle: modalStyleOverrides.safeContainer, containerStyle: [modalStyleOverrides.container, restProps.containerStyle], propagateSwipe: true }), children));
|
|
26
|
+
export default function BottomDrawer({ children, ...restProps }) {
|
|
27
|
+
return (React.createElement(BaseModal, { ...restProps, modalStyle: modalStyleOverrides.modal, safeContainerStyle: modalStyleOverrides.safeContainer, containerStyle: [modalStyleOverrides.container, restProps.containerStyle], propagateSwipe: true }, children));
|
|
40
28
|
}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from "react";
|
|
13
2
|
import { StyleSheet } from "react-native";
|
|
14
3
|
import styled from "styled-components/native";
|
|
@@ -27,9 +16,8 @@ const modalStyleOverrides = StyleSheet.create({
|
|
|
27
16
|
borderRadius: 4,
|
|
28
17
|
},
|
|
29
18
|
});
|
|
30
|
-
export default function Popin(
|
|
31
|
-
|
|
32
|
-
return (React.createElement(BaseModal, Object.assign({}, restProps, { containerStyle: modalStyleOverrides.container }),
|
|
19
|
+
export default function Popin({ children, leftButtonText = "Cancel", rightButtonText = "Delete", onLeftButtonPress, onRightButtonPress, ...restProps }) {
|
|
20
|
+
return (React.createElement(BaseModal, { ...restProps, containerStyle: modalStyleOverrides.container },
|
|
33
21
|
children,
|
|
34
22
|
React.createElement(FooterButtonsContainer, null,
|
|
35
23
|
React.createElement(Button, { onPress: onLeftButtonPress, outline: true, type: "shade", style: { flex: 1, marginRight: 8 } },
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React, { useCallback, useState } from "react";
|
|
13
2
|
import { TouchableOpacity } from "react-native";
|
|
14
3
|
import BottomDrawer from "../BottomDrawer";
|
|
15
|
-
export default function Tooltip(
|
|
16
|
-
var { children, tooltipContent } = _a, restProps = __rest(_a, ["children", "tooltipContent"]);
|
|
4
|
+
export default function Tooltip({ children, tooltipContent, ...restProps }) {
|
|
17
5
|
const [isOpen, setIsOpen] = useState(false);
|
|
18
6
|
const openModal = useCallback(() => {
|
|
19
7
|
setIsOpen(true);
|
|
20
8
|
}, []);
|
|
21
9
|
return (React.createElement(React.Fragment, null,
|
|
22
10
|
React.createElement(TouchableOpacity, { onPress: openModal }, children),
|
|
23
|
-
React.createElement(BottomDrawer,
|
|
11
|
+
React.createElement(BottomDrawer, { ...restProps, isOpen: isOpen, onClose: () => {
|
|
24
12
|
setIsOpen(false);
|
|
25
|
-
} }
|
|
13
|
+
} }, tooltipContent)));
|
|
26
14
|
}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from "react";
|
|
13
2
|
import { space } from "styled-system";
|
|
14
3
|
import baseStyled from "../../styled";
|
|
@@ -16,8 +5,5 @@ import Animated from "react-native-reanimated";
|
|
|
16
5
|
const ScrollView = baseStyled(Animated.ScrollView) `
|
|
17
6
|
${space};
|
|
18
7
|
`;
|
|
19
|
-
const ScrollContainer = (
|
|
20
|
-
var { children, onScroll, horizontal = false } = _a, props = __rest(_a, ["children", "onScroll", "horizontal"]);
|
|
21
|
-
return (React.createElement(ScrollView, Object.assign({}, props, { onScroll: onScroll, horizontal: horizontal }), children));
|
|
22
|
-
};
|
|
8
|
+
const ScrollContainer = ({ children, onScroll, horizontal = false, ...props }) => (React.createElement(ScrollView, { ...props, onScroll: onScroll, horizontal: horizontal }, children));
|
|
23
9
|
export default ScrollContainer;
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from "react";
|
|
13
2
|
import { FlatList, View } from "react-native";
|
|
14
3
|
import Animated, { useAnimatedScrollHandler, useSharedValue } from "react-native-reanimated";
|
|
@@ -17,17 +6,16 @@ import Header from "./Header";
|
|
|
17
6
|
import baseStyled from "../../styled";
|
|
18
7
|
const StyledFlatList = baseStyled(FlatList) ``;
|
|
19
8
|
const AnimatedFlatList = Animated.createAnimatedComponent(StyledFlatList);
|
|
20
|
-
const ScrollContainerHeader = (
|
|
21
|
-
var { TopLeftSection, TopRightSection, TopMiddleSection, MiddleSection, BottomSection, children, onScroll, containerProps } = _a, props = __rest(_a, ["TopLeftSection", "TopRightSection", "TopMiddleSection", "MiddleSection", "BottomSection", "children", "onScroll", "containerProps"]);
|
|
9
|
+
const ScrollContainerHeader = ({ TopLeftSection, TopRightSection, TopMiddleSection, MiddleSection, BottomSection, children, onScroll, containerProps, ...props }) => {
|
|
22
10
|
const currentPositionY = useSharedValue(0);
|
|
23
11
|
const handleScroll = useAnimatedScrollHandler((event) => {
|
|
24
12
|
currentPositionY.value = event.contentOffset.y;
|
|
25
13
|
if (onScroll)
|
|
26
14
|
onScroll(event.contentOffset.y);
|
|
27
15
|
});
|
|
28
|
-
return (React.createElement(Flex,
|
|
16
|
+
return (React.createElement(Flex, { flex: 1, ...containerProps },
|
|
29
17
|
React.createElement(Header, { TopLeftSection: TopLeftSection, TopRightSection: TopRightSection, TopMiddleSection: TopMiddleSection, MiddleSection: MiddleSection, BottomSection: BottomSection, currentPositionY: currentPositionY }),
|
|
30
|
-
React.createElement(AnimatedFlatList,
|
|
18
|
+
React.createElement(AnimatedFlatList, { ...props, onScroll: handleScroll, scrollEventThrottle: 16, data: [...React.Children.toArray(children)], renderItem: ({ item }) => React.createElement(View, null, item), keyExtractor: (_, index) => index.toString() })));
|
|
31
19
|
};
|
|
32
20
|
ScrollContainerHeader.Header = Header;
|
|
33
21
|
export default ScrollContainerHeader;
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React, { forwardRef } from "react";
|
|
13
2
|
import { View, } from "react-native";
|
|
14
3
|
import Animated from "react-native-reanimated";
|
|
@@ -19,8 +8,7 @@ const AnimatedFlatList = Animated.createAnimatedComponent(StyledFlatList);
|
|
|
19
8
|
** This Layout is a wrapper for FlatList that accepts
|
|
20
9
|
** complex onScroll callback for react-native-reanimated.
|
|
21
10
|
*/
|
|
22
|
-
const ScrollListContainer = forwardRef((
|
|
23
|
-
|
|
24
|
-
return (React.createElement(AnimatedFlatList, Object.assign({ ref: ref, data: [...React.Children.toArray(children)], renderItem: ({ item }) => React.createElement(View, null, item), onScroll: onScroll, horizontal: horizontal }, props)));
|
|
11
|
+
const ScrollListContainer = forwardRef(({ children, onScroll, horizontal = false, ...props }, ref) => {
|
|
12
|
+
return (React.createElement(AnimatedFlatList, { ref: ref, data: [...React.Children.toArray(children)], renderItem: ({ item }) => React.createElement(View, null, item), onScroll: onScroll, horizontal: horizontal, ...props }));
|
|
25
13
|
});
|
|
26
14
|
export default ScrollListContainer;
|
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from "react";
|
|
13
2
|
import FlexBox from "../Flex";
|
|
14
3
|
import IconBox from "../../Icon/IconBox";
|
|
15
4
|
const ICON_SIZE = 32;
|
|
16
5
|
const BOX_SIZE = 40;
|
|
17
6
|
const SMALL_ICON_SIZE = 14;
|
|
18
|
-
export default function Row(
|
|
19
|
-
|
|
20
|
-
return (React.createElement(FlexBox, Object.assign({}, props, { flexDirection: "row", justifyContent: "space-between", p: 6 }),
|
|
7
|
+
export default function Row({ Icon, iconBorder = true, topLeft, bottomLeft, topRight, bottomRight, ...props }) {
|
|
8
|
+
return (React.createElement(FlexBox, { ...props, flexDirection: "row", justifyContent: "space-between", p: 6 },
|
|
21
9
|
React.createElement(FlexBox, { flexDirection: "row", flexShrink: 1, alignItems: "center" },
|
|
22
10
|
Icon &&
|
|
23
11
|
(iconBorder ? (React.createElement(IconBox, { Icon: Icon, iconSize: SMALL_ICON_SIZE, boxSize: BOX_SIZE })) : (React.createElement(Icon, { size: ICON_SIZE }))),
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React, { useEffect } from "react";
|
|
13
2
|
import Svg, { LinearGradient, Stop, Mask, Path, Rect } from "react-native-svg";
|
|
14
3
|
import styled from "styled-components/native";
|
|
@@ -20,11 +9,12 @@ const strokeSystem = system({
|
|
|
20
9
|
scale: "colors",
|
|
21
10
|
},
|
|
22
11
|
});
|
|
23
|
-
const Loader = styled(Svg).attrs((props) => (
|
|
12
|
+
const Loader = styled(Svg).attrs((props) => ({
|
|
13
|
+
...strokeSystem(props),
|
|
14
|
+
})) `
|
|
24
15
|
${size}
|
|
25
16
|
`;
|
|
26
|
-
export default function InfiniteLoader(
|
|
27
|
-
var { size = 38, color = "primary.c50", mock = false, testID = "" } = _a, extraProps = __rest(_a, ["size", "color", "mock", "testID"]);
|
|
17
|
+
export default function InfiniteLoader({ size = 38, color = "primary.c50", mock = false, testID = "", ...extraProps }) {
|
|
28
18
|
const rotation = useSharedValue(0);
|
|
29
19
|
const animatedStyles = useAnimatedStyle(() => {
|
|
30
20
|
return {
|
|
@@ -44,7 +34,7 @@ export default function InfiniteLoader(_a) {
|
|
|
44
34
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
35
|
}, []);
|
|
46
36
|
return (React.createElement(Animated.View, { style: [{ display: "flex", justifyContent: "center", alignItems: "center" }, animatedStyles], testID: testID },
|
|
47
|
-
React.createElement(Loader,
|
|
37
|
+
React.createElement(Loader, { size: size, stroke: color, viewBox: "0 0 38 38", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...extraProps },
|
|
48
38
|
React.createElement(LinearGradient, { id: "gradient-start", gradientUnits: "userSpaceOnUse", gradientTransform: "rotate(-20)" },
|
|
49
39
|
React.createElement(Stop, { offset: 0, stopColor: "white", stopOpacity: 0.5 }),
|
|
50
40
|
React.createElement(Stop, { offset: 1, stopColor: "white", stopOpacity: 1 })),
|
|
@@ -10,7 +10,7 @@ const ProgressLoader = ({ progress = 0, infinite, mainColor, secondaryColor, onP
|
|
|
10
10
|
const progressColor = mainColor || colors.primary.c80;
|
|
11
11
|
const normalizedRadius = radius - strokeWidth / 2;
|
|
12
12
|
const circumference = normalizedRadius * 2 * Math.PI;
|
|
13
|
-
const strokeDashoffset = circumference * (1 - (progress
|
|
13
|
+
const strokeDashoffset = circumference * (1 - (progress ?? 0));
|
|
14
14
|
const rotation = useSharedValue(0);
|
|
15
15
|
const animatedStyles = useAnimatedStyle(() => ({
|
|
16
16
|
transform: [
|
|
@@ -10,9 +10,9 @@ function FlowStepper({ activeIndex, header, footer, extraProps, progressBarProps
|
|
|
10
10
|
previousActiveIndex.current = activeIndex;
|
|
11
11
|
}, [activeIndex]);
|
|
12
12
|
return (React.createElement(Flex, { flex: 1 },
|
|
13
|
-
header && header(
|
|
13
|
+
header && header({ ...extraProps, activeIndex, stepsLength }),
|
|
14
14
|
React.createElement(SafeAreaView, { style: { flex: 1 } },
|
|
15
|
-
React.createElement(ProgressBar,
|
|
15
|
+
React.createElement(ProgressBar, { index: activeIndex, length: stepsLength, ...progressBarProps }),
|
|
16
16
|
React.createElement(Flex, { flex: 1 }, React.Children.map(children, (child, index) => {
|
|
17
17
|
if (renderTransition && transitionDuration) {
|
|
18
18
|
return (React.createElement(Transition, { in: index === activeIndex, timeout: transitionDuration, mountOnEnter: true, unmountOnExit: true }, (status) => {
|
|
@@ -31,6 +31,6 @@ function FlowStepper({ activeIndex, header, footer, extraProps, progressBarProps
|
|
|
31
31
|
return index === activeIndex ? child : null;
|
|
32
32
|
}
|
|
33
33
|
})),
|
|
34
|
-
footer && footer(
|
|
34
|
+
footer && footer({ ...extraProps, activeIndex, stepsLength }))));
|
|
35
35
|
}
|
|
36
36
|
export default FlowStepper;
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React, { useMemo } from "react";
|
|
13
2
|
import styled, { useTheme } from "styled-components/native";
|
|
14
3
|
import { space, color } from "styled-system";
|
|
@@ -26,15 +15,14 @@ const SeparatorFilling = Animated.createAnimatedComponent(styled.View `
|
|
|
26
15
|
height: 100%;
|
|
27
16
|
background-color: ${(p) => p.theme.colors.neutral.c100};
|
|
28
17
|
`);
|
|
29
|
-
const AnimatedSeparator = (
|
|
30
|
-
var { filled, delay, duration } = _a, spaceProps = __rest(_a, ["filled", "delay", "duration"]);
|
|
18
|
+
const AnimatedSeparator = ({ filled, delay, duration, ...spaceProps }) => {
|
|
31
19
|
const animatedStyle = useAnimatedStyle(() => ({
|
|
32
20
|
width: withDelay(delay, withTiming(filled ? "100%" : "0%", {
|
|
33
21
|
duration: duration,
|
|
34
22
|
easing: Easing.linear,
|
|
35
23
|
})),
|
|
36
24
|
}));
|
|
37
|
-
return (React.createElement(Separator,
|
|
25
|
+
return (React.createElement(Separator, { ...spaceProps },
|
|
38
26
|
React.createElement(SeparatorFilling, { style: [animatedStyle] })));
|
|
39
27
|
};
|
|
40
28
|
// #endregion
|
|
@@ -141,10 +129,10 @@ function Stepper({ steps, activeIndex, errored }) {
|
|
|
141
129
|
? errored
|
|
142
130
|
? "ERRORED"
|
|
143
131
|
: "CURRENT"
|
|
144
|
-
: i < (activeIndex
|
|
132
|
+
: i < (activeIndex ?? 0)
|
|
145
133
|
? "COMPLETED"
|
|
146
134
|
: "PENDING", showLeftSeparator: i > 0, showRightSeparator: i < steps.length - 1 }),
|
|
147
|
-
i < steps.length - 1 ? (React.createElement(AnimatedSeparator, { filled: i < (activeIndex
|
|
135
|
+
i < steps.length - 1 ? (React.createElement(AnimatedSeparator, { filled: i < (activeIndex ?? 0), duration: 250, delay: 100, mt: separatorMarginTop })) : null)))));
|
|
148
136
|
}
|
|
149
137
|
// #endregion
|
|
150
138
|
export default Stepper;
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import React from "react";
|
|
13
2
|
import styled from "styled-components/native";
|
|
14
3
|
import Flex from "../Layout/Flex";
|
|
@@ -21,13 +10,12 @@ const ActiveBar = styled(Box) `
|
|
|
21
10
|
left: 0;
|
|
22
11
|
`;
|
|
23
12
|
const AnimatedBar = Animated.createAnimatedComponent(ActiveBar);
|
|
24
|
-
function ProgressBar(
|
|
25
|
-
var { index, length, activeBarProps } = _a, props = __rest(_a, ["index", "length", "activeBarProps"]);
|
|
13
|
+
function ProgressBar({ index, length, activeBarProps, ...props }) {
|
|
26
14
|
const width = useDerivedValue(() => Math.round((index / (length - 1)) * 100), [index, length]);
|
|
27
15
|
const animatedStyles = useAnimatedStyle(() => ({
|
|
28
16
|
width: withTiming(`${width.value}%`),
|
|
29
17
|
}));
|
|
30
|
-
return (React.createElement(Flex,
|
|
31
|
-
React.createElement(AnimatedBar,
|
|
18
|
+
return (React.createElement(Flex, { height: 4, width: "100%", backgroundColor: "neutral.c20", position: "relative", ...props },
|
|
19
|
+
React.createElement(AnimatedBar, { style: [animatedStyles], bg: "neutral.c100", ...activeBarProps })));
|
|
32
20
|
}
|
|
33
21
|
export default React.memo(ProgressBar);
|
|
@@ -9,9 +9,9 @@ const TabBox = styled(TouchableOpacity) `
|
|
|
9
9
|
${(p) => (p.stretchItems ? "margin: auto;" : "margin: auto 0;")}
|
|
10
10
|
padding: ${(p) => p.theme.space[p.size === "small" ? 3 : 5]}px;
|
|
11
11
|
border-radius: 8px;
|
|
12
|
-
background-color: ${(p) =>
|
|
12
|
+
background-color: ${(p) => p.isActive ? p.activeBg ?? p.theme.colors.primary.c20 : p.inactiveBg ?? "transparent"};
|
|
13
13
|
`;
|
|
14
14
|
export const ChipTab = ({ onPress, isActive, label, disabled, activeBg, activeColor, inactiveBg, inactiveColor, stretchItems, size = "medium", }) => (React.createElement(TabBox, { activeBg: activeBg, disabled: disabled, inactiveBg: inactiveBg, isActive: isActive, stretchItems: stretchItems, onPress: onPress, size: size },
|
|
15
|
-
React.createElement(Text, { variant: "small", fontWeight: "semiBold", color: isActive ? activeColor
|
|
16
|
-
const ChipTabs = (props) => (React.createElement(TemplateTabs,
|
|
15
|
+
React.createElement(Text, { variant: "small", fontWeight: "semiBold", color: isActive ? activeColor ?? "palette.neutral.c100" : inactiveColor ?? "palette.neutral.c80", textAlign: "center" }, label)));
|
|
16
|
+
const ChipTabs = (props) => (React.createElement(TemplateTabs, { ...props, Item: ChipTab }));
|
|
17
17
|
export default ChipTabs;
|
|
@@ -24,5 +24,5 @@ const StyledTabs = styled(TemplateTabs) `
|
|
|
24
24
|
export const GraphTab = ({ onPress, isActive, label, activeColor = "neutral.c100", activeBg = "neutral.c30", size = "medium", disabled, }) => {
|
|
25
25
|
return (React.createElement(TabBox, { onPress: onPress, disabled: disabled }, isActive ? (React.createElement(TabText, { variant: "small", size: size, bg: activeBg, color: disabled ? "neutral.c70" : activeColor, fontWeight: "semiBold", uppercase: true }, label)) : (React.createElement(TabText, { variant: "small", size: size, color: disabled ? "neutral.c40" : "neutral.c70", fontWeight: "semiBold", uppercase: true }, label))));
|
|
26
26
|
};
|
|
27
|
-
const GraphTabs = (props) => (React.createElement(StyledTabs,
|
|
27
|
+
const GraphTabs = (props) => (React.createElement(StyledTabs, { ...props, Item: GraphTab }));
|
|
28
28
|
export default GraphTabs;
|