@ledgerhq/native-ui 0.7.6 → 0.7.9
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/components/ChartCard/index.js +1 -1
- package/components/Form/Switch/index.js +13 -4
- package/components/Layout/Modals/BaseModal/index.js +9 -1
- package/components/message/Notification/index.js +8 -1
- package/components/tags/Tag/index.d.ts +2 -1
- package/components/tags/Tag/index.js +2 -2
- package/package.json +2 -2
|
@@ -19,7 +19,7 @@ const ChartCard = ({ Header, Footer, range, isLoading, refreshChart, chartData,
|
|
|
19
19
|
React.createElement(Flex, { mt: 6, height: 100, alignItems: "center", justifyContent: "center" }, chartData && chartData.length > 0 ? (React.createElement(Transitions.Fade, { status: "entering", duration: 400 },
|
|
20
20
|
React.createElement(Chart, { data: chartData, backgroundColor: colors.neutral.c30, color: currencyColor, valueKey: "value", xAxisFormatter: xAxisFormatter, yAxisFormatter: yAxisFormatter, valueFormatter: valueFormatter, disableTooltips: false }))) : (React.createElement(InfiniteLoader, { size: 32 }))),
|
|
21
21
|
React.createElement(Flex, { mt: 70 },
|
|
22
|
-
React.createElement(GraphTabs, { activeIndex: activeRangeIndex, activeBg: "neutral.c30", onChange: setRange, labels: rangesLabels })),
|
|
22
|
+
React.createElement(GraphTabs, { activeIndex: activeRangeIndex, activeBg: currencyColor, activeColor: "neutral.c30", onChange: setRange, labels: rangesLabels })),
|
|
23
23
|
Footer));
|
|
24
24
|
};
|
|
25
25
|
export default ChartCard;
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Switch as NativeSwitch } from "react-native";
|
|
1
|
+
import React, { useCallback } from "react";
|
|
2
|
+
import { Pressable as BasePressable, Switch as NativeSwitch } from "react-native";
|
|
3
3
|
import { useTheme } from "styled-components/native";
|
|
4
4
|
import Text from "../../Text";
|
|
5
|
-
import
|
|
5
|
+
import proxyStyled from "../../../components/styled";
|
|
6
|
+
const Pressable = proxyStyled(BasePressable).attrs({
|
|
7
|
+
flexDirection: "row",
|
|
8
|
+
alignItems: "center",
|
|
9
|
+
}) ``;
|
|
6
10
|
const Switch = ({ checked, onChange, disabled, label }) => {
|
|
7
11
|
const { colors, space } = useTheme();
|
|
8
|
-
|
|
12
|
+
const handlePress = useCallback(() => {
|
|
13
|
+
if (disabled)
|
|
14
|
+
return;
|
|
15
|
+
onChange && onChange(!checked);
|
|
16
|
+
}, [checked, disabled, onChange]);
|
|
17
|
+
return (React.createElement(Pressable, { onPress: handlePress },
|
|
9
18
|
React.createElement(NativeSwitch, { trackColor: {
|
|
10
19
|
false: colors.neutral.c50,
|
|
11
20
|
true: colors.primary.c80,
|
|
@@ -18,6 +18,7 @@ import CloseMedium from "@ledgerhq/icons-ui/native/CloseMedium";
|
|
|
18
18
|
import Text from "../../../Text";
|
|
19
19
|
import { BoxedIcon } from "../../../Icon";
|
|
20
20
|
import { Flex } from "../../index";
|
|
21
|
+
import { space } from "styled-system";
|
|
21
22
|
const { width, height } = sizes;
|
|
22
23
|
const Container = styled.View `
|
|
23
24
|
background-color: ${(p) => p.theme.colors.background.main};
|
|
@@ -34,6 +35,12 @@ const CloseContainer = styled.View `
|
|
|
34
35
|
align-items: flex-end;
|
|
35
36
|
margin-bottom: ${(p) => p.theme.space[7]}px;
|
|
36
37
|
`;
|
|
38
|
+
const ClosePressableExtendedBounds = styled.TouchableOpacity.attrs({
|
|
39
|
+
p: 5,
|
|
40
|
+
m: -5,
|
|
41
|
+
}) `
|
|
42
|
+
${space};
|
|
43
|
+
`;
|
|
37
44
|
const StyledTitle = styled(Text).attrs({ variant: "h2" }) `
|
|
38
45
|
text-transform: uppercase;
|
|
39
46
|
`;
|
|
@@ -70,7 +77,8 @@ export default function BaseModal(_a) {
|
|
|
70
77
|
return (React.createElement(ReactNativeModal, Object.assign({}, rest, backDropProps, { isVisible: isOpen, deviceWidth: width, deviceHeight: height, useNativeDriver: true, useNativeDriverForBackdrop: true, hideModalContentWhileAnimating: true, onModalHide: onClose, style: [defaultModalStyle, modalStyle] }),
|
|
71
78
|
React.createElement(Container, { style: containerStyle },
|
|
72
79
|
!noCloseButton && (React.createElement(CloseContainer, null,
|
|
73
|
-
React.createElement(
|
|
80
|
+
React.createElement(ClosePressableExtendedBounds, { onPress: onClose },
|
|
81
|
+
React.createElement(Link, { Icon: CloseMedium, onPress: onClose })))),
|
|
74
82
|
React.createElement(ModalHeader, { Icon: Icon, iconColor: iconColor, title: title, description: description, subtitle: subtitle }),
|
|
75
83
|
React.createElement(ContentContainer, null, children))));
|
|
76
84
|
}
|
|
@@ -5,6 +5,7 @@ import { TouchableOpacity } from "react-native";
|
|
|
5
5
|
import Text from "../../Text";
|
|
6
6
|
import CloseMedium from "@ledgerhq/icons-ui/native/CloseMedium";
|
|
7
7
|
import { Flex } from "../../Layout";
|
|
8
|
+
import { space } from "styled-system";
|
|
8
9
|
const NotificationContainer = styled.View `
|
|
9
10
|
display: flex;
|
|
10
11
|
width: 100%;
|
|
@@ -17,6 +18,12 @@ const NotificationContainer = styled.View `
|
|
|
17
18
|
background-color: ${(p) => p.variant === "primary" ? p.theme.colors.primary.c90 : "transparent"};
|
|
18
19
|
border-radius: ${(p) => `${p.theme.radii[1]}px`};
|
|
19
20
|
`;
|
|
21
|
+
const ClosePressableExtendedBounds = styled.TouchableOpacity.attrs({
|
|
22
|
+
p: 5,
|
|
23
|
+
m: -5,
|
|
24
|
+
}) `
|
|
25
|
+
${space};
|
|
26
|
+
`;
|
|
20
27
|
export default function Notification({ Icon, iconColor, variant = "primary", numberOfLines, title, subtitle, onClose, linkText, onLinkPress, }) {
|
|
21
28
|
const { colors } = useTheme();
|
|
22
29
|
const textColor = variant === "primary" ? colors.neutral.c00 : colors.neutral.c100;
|
|
@@ -30,6 +37,6 @@ export default function Notification({ Icon, iconColor, variant = "primary", num
|
|
|
30
37
|
React.createElement(TouchableOpacity, { onPress: onLinkPress },
|
|
31
38
|
React.createElement(Text, { variant: "body", fontWeight: "semiBold", color: textColor }, linkText))))),
|
|
32
39
|
onClose && (React.createElement(FlexBox, { marginLeft: "auto", pl: 16 },
|
|
33
|
-
React.createElement(
|
|
40
|
+
React.createElement(ClosePressableExtendedBounds, { onPress: onClose },
|
|
34
41
|
React.createElement(CloseMedium, { size: 14, color: textColor }))))));
|
|
35
42
|
}
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { FlexBoxProps } from "../../Layout/Flex";
|
|
3
3
|
export interface TagProps extends FlexBoxProps {
|
|
4
4
|
active?: boolean;
|
|
5
|
+
uppercase?: boolean;
|
|
5
6
|
children: React.ReactNode;
|
|
6
7
|
}
|
|
7
|
-
export default function Tag({ active, children, ...props }: TagProps): JSX.Element;
|
|
8
|
+
export default function Tag({ active, uppercase, children, ...props }: TagProps): JSX.Element;
|
|
@@ -13,7 +13,7 @@ import React from "react";
|
|
|
13
13
|
import Flex from "../../Layout/Flex";
|
|
14
14
|
import Text from "../../Text";
|
|
15
15
|
export default function Tag(_a) {
|
|
16
|
-
var { active, children } = _a, props = __rest(_a, ["active", "children"]);
|
|
16
|
+
var { active, uppercase, children } = _a, props = __rest(_a, ["active", "uppercase", "children"]);
|
|
17
17
|
return (React.createElement(Flex, Object.assign({ px: 2, alignItems: "center", justifyContent: "center", borderRadius: 4, borderWidth: 1, borderColor: active ? "primary.c50" : "neutral.c40" }, props),
|
|
18
|
-
React.createElement(Text, { variant: "tiny", fontWeight: "semiBold", lineHeight: "16px",
|
|
18
|
+
React.createElement(Text, { variant: "tiny", fontWeight: "semiBold", lineHeight: "16px", uppercase: uppercase !== false, textAlign: "center", color: active ? "primary.c70" : "neutral.c80" }, children)));
|
|
19
19
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/native-ui",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.9",
|
|
4
4
|
"description": "Ledger Live - Desktop UI",
|
|
5
5
|
"repository": "https://github.com/LedgerHQ/ui",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@ledgerhq/icons-ui": "^0.2.3",
|
|
19
|
-
"@ledgerhq/ui-shared": "^0.1.
|
|
19
|
+
"@ledgerhq/ui-shared": "^0.1.6",
|
|
20
20
|
"@types/color": "^3.0.2",
|
|
21
21
|
"@types/react": "^17.0.37",
|
|
22
22
|
"@types/react-native": "^0.65.9",
|