@ledgerhq/native-ui 0.6.5 → 0.6.6
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/Layout/Modals/BaseModal/index.js +4 -10
- package/components/Tabs/Chip/index.d.ts +1 -1
- package/components/Tabs/Chip/index.js +2 -2
- package/components/Tabs/Graph/index.d.ts +9 -2
- package/components/Tabs/Graph/index.js +11 -9
- package/components/Tabs/TemplateTabs/index.d.ts +5 -2
- package/components/Tabs/TemplateTabs/index.js +4 -2
- package/package.json +1 -1
|
@@ -39,15 +39,9 @@ const CloseContainer = styled.View `
|
|
|
39
39
|
align-items: flex-end;
|
|
40
40
|
margin-bottom: ${(p) => p.theme.space[7]}px;
|
|
41
41
|
`;
|
|
42
|
-
const StyledTitle = styled(Text).attrs({ variant: "
|
|
42
|
+
const StyledTitle = styled(Text).attrs({ variant: "h2" }) `
|
|
43
43
|
text-transform: uppercase;
|
|
44
44
|
`;
|
|
45
|
-
const StyledDescription = styled(Text).attrs({
|
|
46
|
-
variant: "body",
|
|
47
|
-
color: "neutral.c80",
|
|
48
|
-
}) `
|
|
49
|
-
margin-top: ${(p) => p.theme.space[2]}px;
|
|
50
|
-
`;
|
|
51
45
|
const StyledSubtitle = styled(Text).attrs({
|
|
52
46
|
variant: "subtitle",
|
|
53
47
|
color: "neutral.c80",
|
|
@@ -75,8 +69,8 @@ export default function BaseModal(_a) {
|
|
|
75
69
|
React.createElement(Link, { Icon: CloseMedium, onPress: onClose })),
|
|
76
70
|
React.createElement(HeaderContainer, null,
|
|
77
71
|
Icon && (React.createElement(Flex, { mb: 7 }, React.isValidElement(Icon) ? (Icon) : (React.createElement(BoxedIcon, { size: 64, Icon: Icon, iconSize: 24, iconColor: iconColor })))),
|
|
78
|
-
subtitle && React.createElement(StyledSubtitle,
|
|
79
|
-
title && React.createElement(StyledTitle,
|
|
80
|
-
description && React.createElement(
|
|
72
|
+
subtitle && React.createElement(StyledSubtitle, { textAlign: "center" }, subtitle),
|
|
73
|
+
title && React.createElement(StyledTitle, { textAlign: "center" }, title),
|
|
74
|
+
description && (React.createElement(Text, { variant: "body", color: "neutral.c70", textAlign: "center", mt: 6 }, description))),
|
|
81
75
|
React.createElement(ContentContainer, null, children))));
|
|
82
76
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { BaseTabsProps, TabItemProps } from "../TemplateTabs";
|
|
3
|
-
export declare const ChipTab: ({ onPress, isActive, label }: TabItemProps) => React.ReactElement;
|
|
3
|
+
export declare const ChipTab: ({ onPress, isActive, label, disabled, }: TabItemProps) => React.ReactElement;
|
|
4
4
|
declare const ChipTabs: (props: BaseTabsProps) => React.ReactElement;
|
|
5
5
|
export default ChipTabs;
|
|
@@ -12,8 +12,8 @@ const TabBox = styled(TouchableOpacity) `
|
|
|
12
12
|
background-color: ${(p) => (p.isActive ? p.theme.colors.palette.primary.c20 : "transparent")};
|
|
13
13
|
`;
|
|
14
14
|
const StyledTabs = styled(TemplateTabs) ``;
|
|
15
|
-
export const ChipTab = ({ onPress, isActive, label }) => {
|
|
16
|
-
return (React.createElement(TabBox, { isActive: isActive, onPress: onPress },
|
|
15
|
+
export const ChipTab = ({ onPress, isActive, label, disabled, }) => {
|
|
16
|
+
return (React.createElement(TabBox, { isActive: isActive, onPress: onPress, disabled: disabled },
|
|
17
17
|
React.createElement(Text, { variant: "small", fontWeight: "semiBold", color: isActive ? "palette.neutral.c100" : "palette.neutral.c80", textAlign: "center" }, label)));
|
|
18
18
|
};
|
|
19
19
|
const ChipTabs = (props) => (React.createElement(StyledTabs, Object.assign({}, props, { Item: ChipTab })));
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { BaseTabsProps, TabItemProps } from "../TemplateTabs";
|
|
3
|
-
|
|
4
|
-
declare
|
|
3
|
+
declare type GraphTabSize = "small" | "medium";
|
|
4
|
+
declare type GraphTabsProps = BaseTabsProps & {
|
|
5
|
+
size?: GraphTabSize;
|
|
6
|
+
};
|
|
7
|
+
declare type GraphTabItemProps = TabItemProps & {
|
|
8
|
+
size?: GraphTabSize;
|
|
9
|
+
};
|
|
10
|
+
export declare const GraphTab: ({ onPress, isActive, label, activeColor, activeBg, size, disabled, }: GraphTabItemProps) => React.ReactElement;
|
|
11
|
+
declare const GraphTabs: (props: GraphTabsProps) => React.ReactElement;
|
|
5
12
|
export default GraphTabs;
|
|
@@ -3,25 +3,27 @@ import styled from "styled-components/native";
|
|
|
3
3
|
import Text from "../../Text";
|
|
4
4
|
import { TouchableOpacity } from "react-native";
|
|
5
5
|
import TemplateTabs from "../TemplateTabs";
|
|
6
|
-
const
|
|
6
|
+
const TabBox = styled(TouchableOpacity) `
|
|
7
7
|
text-align: center;
|
|
8
8
|
margin: auto;
|
|
9
9
|
flex: 1;
|
|
10
10
|
`;
|
|
11
|
-
const TabText = styled(Text).attrs({
|
|
12
|
-
|
|
11
|
+
const TabText = styled(Text).attrs((p) => ({
|
|
12
|
+
// Avoid conflict with styled-system's size property by nulling size and renaming it
|
|
13
|
+
size: undefined,
|
|
14
|
+
lineHeight: p.size === "medium" ? "36px" : "26px",
|
|
13
15
|
textAlign: "center",
|
|
14
16
|
borderRadius: 48,
|
|
15
|
-
px:
|
|
16
|
-
height:
|
|
17
|
-
}) ``;
|
|
17
|
+
px: p.theme.space[p.size === "medium" ? 7 : 6],
|
|
18
|
+
height: p.size === "medium" ? 36 : 26,
|
|
19
|
+
})) ``;
|
|
18
20
|
const StyledTabs = styled(TemplateTabs) `
|
|
19
21
|
border: ${(p) => `1px solid ${p.theme.colors.palette.neutral.c40}`};
|
|
20
22
|
border-radius: 35px;
|
|
21
|
-
padding:
|
|
23
|
+
padding: ${(p) => `${p.theme.space[p.size === "medium" ? 2 : 1]}px`};
|
|
22
24
|
`;
|
|
23
|
-
export const GraphTab = ({ onPress, isActive, label, activeColor = "neutral.c100", activeBg = "primary.c20", }) => {
|
|
24
|
-
return (React.createElement(
|
|
25
|
+
export const GraphTab = ({ onPress, isActive, label, activeColor = "neutral.c100", activeBg = "primary.c20", size = "medium", disabled, }) => {
|
|
26
|
+
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" }, label)) : (React.createElement(TabText, { variant: "small", size: size, color: disabled ? "neutral.c70" : "neutral.c90" }, label))));
|
|
25
27
|
};
|
|
26
28
|
const GraphTabs = (props) => (React.createElement(StyledTabs, Object.assign({}, props, { Item: GraphTab })));
|
|
27
29
|
export default GraphTabs;
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
export declare type BaseTabsProps = {
|
|
4
4
|
labels: string[];
|
|
5
|
-
activeIndex
|
|
5
|
+
activeIndex?: number;
|
|
6
6
|
onChange: (newIndex: number) => void;
|
|
7
7
|
activeColor?: string;
|
|
8
8
|
activeBg?: string;
|
|
9
|
+
disabled?: boolean;
|
|
9
10
|
};
|
|
10
11
|
export declare type TabItemProps = Partial<BaseTabsProps> & {
|
|
11
12
|
label: string;
|
|
@@ -14,6 +15,7 @@ export declare type TabItemProps = Partial<BaseTabsProps> & {
|
|
|
14
15
|
onPress: () => void;
|
|
15
16
|
activeColor?: string;
|
|
16
17
|
activeBg?: string;
|
|
18
|
+
disabled?: boolean;
|
|
17
19
|
};
|
|
18
20
|
export declare type TabsProps = BaseTabsProps & {
|
|
19
21
|
Item: (props: TabItemProps) => React.ReactElement;
|
|
@@ -28,8 +30,9 @@ export declare const TabsContainer: import("styled-components").StyledComponent<
|
|
|
28
30
|
position?: string | undefined;
|
|
29
31
|
maxHeight?: number | undefined;
|
|
30
32
|
} & {
|
|
33
|
+
size: undefined;
|
|
31
34
|
flexDirection: string;
|
|
32
35
|
alignItems: string;
|
|
33
|
-
}, "alignItems" | "flexDirection">;
|
|
36
|
+
}, "size" | "alignItems" | "flexDirection">;
|
|
34
37
|
declare const TemplateTabsGroup: (props: TabsProps) => React.ReactElement;
|
|
35
38
|
export default TemplateTabsGroup;
|
|
@@ -2,13 +2,15 @@ import React from "react";
|
|
|
2
2
|
import styled from "styled-components/native";
|
|
3
3
|
import FlexBox from "../../Layout/Flex";
|
|
4
4
|
export const TabsContainer = styled(FlexBox).attrs({
|
|
5
|
+
// Avoid conflict with styled-system's size property by nulling size and renaming it
|
|
6
|
+
size: undefined,
|
|
5
7
|
flexDirection: "row",
|
|
6
8
|
alignItems: "stretch",
|
|
7
9
|
}) `
|
|
8
10
|
width: 100%;
|
|
9
11
|
`;
|
|
10
12
|
const TemplateTabsGroup = (props) => {
|
|
11
|
-
const { labels, activeIndex, onChange, Item
|
|
12
|
-
return (React.createElement(TabsContainer, Object.assign({}, props), labels.map((label, index) => (React.createElement(Item, Object.assign({ key: index }, props, { label: label, index: index, isActive: index === activeIndex, onPress: () => onChange(index)
|
|
13
|
+
const { labels, activeIndex, onChange, Item } = props;
|
|
14
|
+
return (React.createElement(TabsContainer, Object.assign({}, props), labels.map((label, index) => (React.createElement(Item, Object.assign({ key: index }, props, { label: label, index: index, isActive: index === activeIndex, onPress: () => onChange(index) }))))));
|
|
13
15
|
};
|
|
14
16
|
export default TemplateTabsGroup;
|