@ledgerhq/native-ui 0.21.1 → 0.22.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.d.ts +1 -0
- package/lib/components/Cards/BannerCard/index.js +2 -2
- package/lib/components/Loader/InfiniteLoader/index.d.ts +1 -1
- package/lib/components/Loader/InfiniteLoader/index.js +2 -2
- package/lib/components/cta/QuickAction/QuickActionButton/index.d.ts +7 -1
- package/lib/components/cta/QuickAction/QuickActionButton/index.js +10 -6
- package/lib/components/cta/QuickAction/QuickActionList/index.d.ts +4 -2
- package/lib/components/cta/QuickAction/QuickActionList/index.js +2 -2
- package/lib/components/cta/QuickAction/index.d.ts +2 -2
- package/package.json +4 -4
|
@@ -37,9 +37,9 @@ export const CloseButton = ({ onPressDismiss }) => {
|
|
|
37
37
|
React.createElement(CloseMedium, { size: 14, color: colors.neutral.c100 })));
|
|
38
38
|
};
|
|
39
39
|
const CardContainer = (props) => {
|
|
40
|
-
const { onPressDismiss, LeftElement, title, typeOfRightIcon } = props;
|
|
40
|
+
const { onPressDismiss, LeftElement, hideLeftElementContainer, title, typeOfRightIcon } = props;
|
|
41
41
|
return (React.createElement(Container, Object.assign({}, props),
|
|
42
|
-
React.createElement(Flex, { borderRadius: 50, height: 40, width: 40, alignItems: "center", justifyContent: "center", bg: "opacityDefault.c05" }, LeftElement),
|
|
42
|
+
hideLeftElementContainer ? (React.createElement(Flex, { borderRadius: 50, height: 40, width: 40, alignItems: "center", justifyContent: "center", bg: "opacityDefault.c05" }, LeftElement)) : (LeftElement),
|
|
43
43
|
React.createElement(Text, { mx: 4, variant: "large", fontWeight: "medium", numberOfLines: 3, maxWidth: "70%", color: "neutral.c100" }, title),
|
|
44
44
|
typeOfRightIcon === "close" ? (React.createElement(CloseButton, { onPressDismiss: onPressDismiss })) : (React.createElement(ChevronContainer, null,
|
|
45
45
|
React.createElement(ChevronRightMedium, { size: 24 })))));
|
|
@@ -6,5 +6,5 @@ declare const Loader: import("styled-components").StyledComponent<typeof Svg, im
|
|
|
6
6
|
export type Props = React.ComponentProps<typeof Loader> & {
|
|
7
7
|
color?: string;
|
|
8
8
|
};
|
|
9
|
-
export default function InfiniteLoader({ size, color, ...extraProps }: Props): JSX.Element;
|
|
9
|
+
export default function InfiniteLoader({ size, color, mock, ...extraProps }: Props): JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -24,7 +24,7 @@ const Loader = styled(Svg).attrs((props) => (Object.assign({}, strokeSystem(prop
|
|
|
24
24
|
${size}
|
|
25
25
|
`;
|
|
26
26
|
export default function InfiniteLoader(_a) {
|
|
27
|
-
var { size = 38, color = "primary.c50" } = _a, extraProps = __rest(_a, ["size", "color"]);
|
|
27
|
+
var { size = 38, color = "primary.c50", mock = false } = _a, extraProps = __rest(_a, ["size", "color", "mock"]);
|
|
28
28
|
const rotation = useSharedValue(0);
|
|
29
29
|
const animatedStyles = useAnimatedStyle(() => {
|
|
30
30
|
return {
|
|
@@ -39,7 +39,7 @@ export default function InfiniteLoader(_a) {
|
|
|
39
39
|
rotation.value = withRepeat(withTiming(360, {
|
|
40
40
|
duration: 1000,
|
|
41
41
|
easing: Easing.linear,
|
|
42
|
-
}), -1);
|
|
42
|
+
}), mock ? 1 : -1);
|
|
43
43
|
return () => cancelAnimation(rotation);
|
|
44
44
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
45
|
}, []);
|
|
@@ -2,13 +2,19 @@ import React from "react";
|
|
|
2
2
|
import { TouchableOpacity, TouchableOpacityProps } from "react-native";
|
|
3
3
|
import { IconType } from "src/components/Icon/type";
|
|
4
4
|
import { BaseStyledProps } from "../../../styled";
|
|
5
|
+
import { TextVariants } from "../../../../styles/theme";
|
|
6
|
+
type Variant = "small" | "large";
|
|
5
7
|
export type QuickActionButtonProps = TouchableOpacityProps & BaseStyledProps & {
|
|
6
8
|
Icon: IconType;
|
|
7
9
|
disabled?: boolean;
|
|
8
10
|
onPressWhenDisabled?: TouchableOpacityProps["onPress"];
|
|
11
|
+
textVariant?: TextVariants;
|
|
12
|
+
variant?: Variant;
|
|
9
13
|
};
|
|
14
|
+
export declare const StyledText: import("styled-components").StyledComponent<({ children, bracket, textAlign, testID, ...props }: import("../../../Text").BaseTextProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
|
10
15
|
export declare const Base: import("styled-components").StyledComponent<typeof TouchableOpacity, import("styled-components").DefaultTheme, TouchableOpacityProps & {
|
|
11
16
|
visuallyDisabled?: boolean | undefined;
|
|
17
|
+
variant: Variant;
|
|
12
18
|
}, never>;
|
|
13
|
-
declare const QuickActionButton: ({ Icon, children, disabled, onPress, onPressWhenDisabled, ...otherProps }: QuickActionButtonProps) => React.ReactElement;
|
|
19
|
+
declare const QuickActionButton: ({ Icon, children, disabled, onPress, onPressWhenDisabled, textVariant, variant, ...otherProps }: QuickActionButtonProps) => React.ReactElement;
|
|
14
20
|
export default QuickActionButton;
|
|
@@ -13,22 +13,26 @@ import React from "react";
|
|
|
13
13
|
import { TouchableOpacity } from "react-native";
|
|
14
14
|
import Text from "../../../Text";
|
|
15
15
|
import baseStyled from "../../../styled";
|
|
16
|
+
export const StyledText = baseStyled(Text) `
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
max-width: 100%;
|
|
19
|
+
`;
|
|
16
20
|
export const Base = baseStyled(TouchableOpacity) `
|
|
17
|
-
height:
|
|
21
|
+
height: ${({ variant }) => (variant === "small" ? 59 : 80)}px;
|
|
18
22
|
flex-direction: column;
|
|
19
23
|
text-align: center;
|
|
20
24
|
align-items: center;
|
|
21
25
|
justify-content: center;
|
|
22
26
|
border-radius: ${(p) => p.theme.radii[2]}px;
|
|
23
|
-
padding:
|
|
27
|
+
padding: ${({ theme, variant }) => variant === "small" ? `${theme.space[3]}px ${theme.space[2]}px` : `0 ${theme.space[6]}px`};
|
|
24
28
|
${({ visuallyDisabled, theme }) => visuallyDisabled
|
|
25
29
|
? `border: 1px solid ${theme.colors.neutral.c30};`
|
|
26
30
|
: `background-color: ${theme.colors.neutral.c20};`}
|
|
27
31
|
`;
|
|
28
32
|
const QuickActionButton = (_a) => {
|
|
29
|
-
var { Icon, children, disabled, onPress, onPressWhenDisabled } = _a, otherProps = __rest(_a, ["Icon", "children", "disabled", "onPress", "onPressWhenDisabled"]);
|
|
30
|
-
return (React.createElement(Base, Object.assign({ disabled: onPressWhenDisabled ? false : disabled, onPress: disabled ? onPressWhenDisabled : onPress, visuallyDisabled: disabled }, otherProps),
|
|
31
|
-
React.createElement(Icon, { size: 24, color: disabled ? "neutral.c50" : "neutral.c100" }),
|
|
32
|
-
React.createElement(
|
|
33
|
+
var { Icon, children, disabled, onPress, onPressWhenDisabled, textVariant = "body", variant = "large" } = _a, otherProps = __rest(_a, ["Icon", "children", "disabled", "onPress", "onPressWhenDisabled", "textVariant", "variant"]);
|
|
34
|
+
return (React.createElement(Base, Object.assign({ disabled: onPressWhenDisabled ? false : disabled, onPress: disabled ? onPressWhenDisabled : onPress, visuallyDisabled: disabled, variant: variant }, otherProps),
|
|
35
|
+
React.createElement(Icon, { size: variant === "small" ? 20 : 24, color: disabled ? "neutral.c50" : "neutral.c100" }),
|
|
36
|
+
React.createElement(StyledText, { numberOfLines: 1, variant: textVariant, fontWeight: "semiBold", color: disabled ? "neutral.c50" : "neutral.c100", mt: 2 }, children)));
|
|
33
37
|
};
|
|
34
38
|
export default QuickActionButton;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FlatListProps } from "react-native";
|
|
3
3
|
import { QuickActionButtonProps } from "../QuickActionButton";
|
|
4
|
-
export type QuickActionListProps = Omit<FlatListProps<QuickActionButtonProps>, "renderItem"
|
|
5
|
-
|
|
4
|
+
export type QuickActionListProps = Omit<FlatListProps<QuickActionButtonProps>, "renderItem"> & {
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
declare const QuickActionList: ({ numColumns, data, id, ...otherProps }: QuickActionListProps) => React.ReactElement;
|
|
6
8
|
export default QuickActionList;
|
|
@@ -13,10 +13,10 @@ import React, { useCallback } from "react";
|
|
|
13
13
|
import { FlatList } from "react-native";
|
|
14
14
|
import QuickActionButton from "../QuickActionButton";
|
|
15
15
|
const QuickActionList = (_a) => {
|
|
16
|
-
var { numColumns = 3, data } = _a, otherProps = __rest(_a, ["numColumns", "data"]);
|
|
16
|
+
var { numColumns = 3, data, id } = _a, otherProps = __rest(_a, ["numColumns", "data", "id"]);
|
|
17
17
|
const renderItem = useCallback(({ item, index }) => {
|
|
18
18
|
return (React.createElement(QuickActionButton, Object.assign({}, item, { flex: 1, mr: (index + 1) % numColumns > 0 && data && index !== data.length - 1 ? 4 : 0, mb: (data === null || data === void 0 ? void 0 : data.length) && index + numColumns < data.length ? 4 : 0 })));
|
|
19
19
|
}, []);
|
|
20
|
-
return (React.createElement(FlatList, Object.assign({}, otherProps, { data: data, horizontal: false, renderItem: renderItem, numColumns: numColumns, style: { width: "100%" } })));
|
|
20
|
+
return (React.createElement(FlatList, Object.assign({}, otherProps, { data: data, keyExtractor: (_item, index) => `${id}${index}`, horizontal: false, renderItem: renderItem, numColumns: numColumns, style: { width: "100%" } })));
|
|
21
21
|
};
|
|
22
22
|
export default QuickActionList;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as QuickActionList } from "./QuickActionList";
|
|
2
|
-
export { default as QuickActionButton } from "./QuickActionButton";
|
|
1
|
+
export { default as QuickActionList, type QuickActionListProps } from "./QuickActionList";
|
|
2
|
+
export { default as QuickActionButton, type QuickActionButtonProps } from "./QuickActionButton";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/native-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0-next.0",
|
|
4
4
|
"description": "Ledger Live - Mobile UI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"@babel/plugin-transform-template-literals": "^7.18.9",
|
|
73
73
|
"@babel/preset-env": "^7.15.8",
|
|
74
74
|
"@babel/runtime": "^7.17.2",
|
|
75
|
-
"@emotion/core": "^
|
|
76
|
-
"@emotion/native": "^
|
|
75
|
+
"@emotion/core": "^11.0.0",
|
|
76
|
+
"@emotion/native": "^11.0.0",
|
|
77
77
|
"@expo/metro-config": "^0.7.1",
|
|
78
78
|
"@expo/webpack-config": "^18.0.1",
|
|
79
79
|
"@react-native-async-storage/async-storage": "1.17.12",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"rimraf": "^4.4.1",
|
|
145
145
|
"styled-components": "^5.3.3",
|
|
146
146
|
"stylelint": "^14.9.1",
|
|
147
|
-
"stylelint-config-recommended": "^
|
|
147
|
+
"stylelint-config-recommended": "^13.0.0",
|
|
148
148
|
"stylelint-config-styled-components": "^0.1.1",
|
|
149
149
|
"stylelint-processor-styled-components": "^1.10.0",
|
|
150
150
|
"util": "^0.12.5",
|