@ledgerhq/native-ui 0.20.0-nightly.1 → 0.20.1-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/Carousel/index.js +3 -1
- package/lib/components/Form/Input/BaseInput/index.d.ts +2 -2
- package/lib/components/Form/SelectableList.js +3 -1
- package/lib/components/Icon/BoxedIcon.js +3 -1
- package/lib/components/Icon/IconBadge.js +3 -1
- package/lib/components/Icon/IconBox/index.js +3 -1
- package/lib/components/Layout/Modals/BaseModal/index.d.ts +2 -1
- package/lib/components/Layout/Modals/BaseModal/index.js +4 -2
- package/lib/components/Text/index.d.ts +2 -1
- package/lib/components/Text/index.js +2 -2
- package/lib/components/cta/Button/index.d.ts +1 -0
- package/lib/components/cta/Button/index.js +2 -2
- package/lib/components/message/Alert/index.d.ts +4 -4
- package/lib/styles/theme.d.ts +1 -1
- package/package.json +4 -11
|
@@ -117,7 +117,9 @@ function Carousel({ activeIndex = 0, autoDelay, restartAfterEnd = true, scrollOn
|
|
|
117
117
|
width: `${fullWidth}%`,
|
|
118
118
|
flexDirection: I18nManager.isRTL && Platform.OS !== "ios" ? "row-reverse" : "row",
|
|
119
119
|
}, decelerationRate: "fast", onTouchStart: scrollOnSidePress ? onStartTap : undefined, onTouchEnd: scrollOnSidePress ? onEndTap : undefined }, scrollViewProps), React.Children.map(children, (child, index) => (React.createElement(Flex, { key: index, flex: 1 }, child)))),
|
|
120
|
-
React.createElement(Flex, Object.assign({ my: 8 }, slideIndicatorContainerProps), React.isValidElement(IndicatorComponent) ? (IndicatorComponent) : (
|
|
120
|
+
React.createElement(Flex, Object.assign({ my: 8 }, slideIndicatorContainerProps), React.isValidElement(IndicatorComponent) ? (IndicatorComponent) : (
|
|
121
|
+
/* @ts-expect-error TS 5 can't seem to be able to prove this is a react comopnent here */
|
|
122
|
+
React.createElement(IndicatorComponent, { activeIndex: activeIndexState || 0, onChange: (index) => {
|
|
121
123
|
scrollToIndex(index);
|
|
122
124
|
setResetTimer({});
|
|
123
125
|
onManualChange && onManualChange(index);
|
|
@@ -58,7 +58,7 @@ export declare const InputRenderLeftContainer: import("styled-components").Style
|
|
|
58
58
|
alignItems: string;
|
|
59
59
|
flexDirection: string;
|
|
60
60
|
pl: string;
|
|
61
|
-
}, "
|
|
61
|
+
}, "alignItems" | "flexDirection" | "pl">;
|
|
62
62
|
export declare const InputRenderRightContainer: import("styled-components").StyledComponent<typeof import("react-native").View, import("styled-components").DefaultTheme, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").BorderProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").BackgroundProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Background<import("styled-system").TLengthStyledSystem>> & {
|
|
63
63
|
columnGap?: string | number | undefined;
|
|
64
64
|
rowGap?: string | number | undefined;
|
|
@@ -70,7 +70,7 @@ export declare const InputRenderRightContainer: import("styled-components").Styl
|
|
|
70
70
|
alignItems: string;
|
|
71
71
|
flexDirection: string;
|
|
72
72
|
pr: string;
|
|
73
|
-
}, "
|
|
73
|
+
}, "alignItems" | "flexDirection" | "pr">;
|
|
74
74
|
declare function Input<T = string>(props: InputProps<T>, ref?: any): JSX.Element;
|
|
75
75
|
declare const _default: <T>(props: Omit<CommonProps, "onChange" | "value"> & {
|
|
76
76
|
/**
|
|
@@ -14,7 +14,9 @@ function Element(props) {
|
|
|
14
14
|
Icon && (React.createElement(Flex, { mr: 6, flexShrink: 0 },
|
|
15
15
|
React.createElement(Icon, { size: 24, color: disabled ? "neutral.c50" : selected ? "primary.c90" : "neutral.c100" }))),
|
|
16
16
|
React.createElement(Text, { variant: "large", flex: 1, color: disabled ? "neutral.c50" : selected ? "primary.c90" : "neutral.c100" }, children || value),
|
|
17
|
-
RenderRight && (React.createElement(Flex, { pl: 6, flexShrink: 0 }, React.isValidElement(RenderRight) ? RenderRight :
|
|
17
|
+
RenderRight && (React.createElement(Flex, { pl: 6, flexShrink: 0 }, React.isValidElement(RenderRight) ? (RenderRight) : (
|
|
18
|
+
/* @ts-expect-error TS 5 can't seem to be able to prove this is a react comopnent here */
|
|
19
|
+
React.createElement(RenderRight, Object.assign({}, props))))))));
|
|
18
20
|
}
|
|
19
21
|
function SelectableList({ currentValue, onChange, children }) {
|
|
20
22
|
return (React.createElement(Flex, { accessible: true, accessibilityRole: "radiogroup" }, React.Children.map(children, (child, index) => {
|
|
@@ -80,6 +80,8 @@ export const IconBox = ({ Badge, size = DEFAULT_BOX_SIZE, children, borderColor
|
|
|
80
80
|
};
|
|
81
81
|
const BoxedIcon = (_a) => {
|
|
82
82
|
var { Icon, iconSize = DEFAULT_ICON_SIZE, iconColor } = _a, iconBoxProps = __rest(_a, ["Icon", "iconSize", "iconColor"]);
|
|
83
|
-
return (React.createElement(IconBox, Object.assign({}, iconBoxProps), React.isValidElement(Icon) ? (Icon) : (
|
|
83
|
+
return (React.createElement(IconBox, Object.assign({}, iconBoxProps), React.isValidElement(Icon) ? (Icon) : (
|
|
84
|
+
/* @ts-expect-error TS 5 can't seem to be able to prove this is a react comopnent here */
|
|
85
|
+
React.createElement(Icon, { size: iconSize || DEFAULT_ICON_SIZE, color: iconColor }))));
|
|
84
86
|
};
|
|
85
87
|
export default BoxedIcon;
|
|
@@ -15,6 +15,8 @@ export const DEFAULT_ICON_SIZE = 16;
|
|
|
15
15
|
const BORDER_RADIUS = 999999;
|
|
16
16
|
const IconBadge = (_a) => {
|
|
17
17
|
var { Icon, iconSize = DEFAULT_ICON_SIZE, iconColor } = _a, rest = __rest(_a, ["Icon", "iconSize", "iconColor"]);
|
|
18
|
-
return (React.createElement(Flex, Object.assign({ height: iconSize * 2, width: iconSize * 2, backgroundColor: "neutral.c40", borderRadius: BORDER_RADIUS, alignItems: "center", justifyContent: "center" }, rest), React.isValidElement(Icon) ? Icon :
|
|
18
|
+
return (React.createElement(Flex, Object.assign({ height: iconSize * 2, width: iconSize * 2, backgroundColor: "neutral.c40", borderRadius: BORDER_RADIUS, alignItems: "center", justifyContent: "center" }, rest), React.isValidElement(Icon) ? (Icon) : (
|
|
19
|
+
/* @ts-expect-error TS 5 can't seem to be able to prove this is a react comopnent here */
|
|
20
|
+
React.createElement(Icon, { size: iconSize, color: iconColor }))));
|
|
19
21
|
};
|
|
20
22
|
export default IconBadge;
|
|
@@ -15,5 +15,7 @@ const IconContainer = styled(Flex).attrs(({ size = DEFAULT_BOX_SIZE }) => ({
|
|
|
15
15
|
`;
|
|
16
16
|
export default function IconBox({ Icon, color, boxSize = DEFAULT_BOX_SIZE, iconSize = DEFAULT_ICON_SIZE, iconContainerProps, }) {
|
|
17
17
|
const { colors } = useTheme();
|
|
18
|
-
return (React.createElement(IconContainer, Object.assign({ size: boxSize }, iconContainerProps), React.isValidElement(Icon) ? (Icon) : (
|
|
18
|
+
return (React.createElement(IconContainer, Object.assign({ size: boxSize }, iconContainerProps), React.isValidElement(Icon) ? (Icon) : (
|
|
19
|
+
/* @ts-expect-error TS 5 can't seem to be able to prove this is a react comopnent here */
|
|
20
|
+
React.createElement(Icon, { size: iconSize, color: color || colors.neutral.c100 }))));
|
|
19
21
|
}
|
|
@@ -16,7 +16,8 @@ export type BaseModalProps = {
|
|
|
16
16
|
subtitle?: string;
|
|
17
17
|
children?: React.ReactNode;
|
|
18
18
|
noCloseButton?: boolean;
|
|
19
|
+
CustomHeader?: React.ComponentType;
|
|
19
20
|
} & Partial<ModalProps>;
|
|
20
21
|
export declare function ModalHeader({ Icon, iconColor, title, description, subtitle, }: Pick<BaseModalProps, "Icon" | "iconColor" | "title" | "description" | "subtitle">): React.ReactElement | null;
|
|
21
22
|
export declare function ModalHeaderCloseButton({ onClose, }: Pick<BaseModalProps, "onClose">): React.ReactElement;
|
|
22
|
-
export default function BaseModal({ isOpen, onClose, noCloseButton, safeContainerStyle, containerStyle, modalStyle, preventBackdropClick, Icon, iconColor, title, description, subtitle, children, onModalHide, ...rest }: BaseModalProps): React.ReactElement;
|
|
23
|
+
export default function BaseModal({ isOpen, onClose, noCloseButton, safeContainerStyle, containerStyle, modalStyle, preventBackdropClick, Icon, iconColor, title, description, subtitle, children, onModalHide, CustomHeader, ...rest }: BaseModalProps): React.ReactElement;
|
|
@@ -36,6 +36,7 @@ const CloseContainer = styled.View `
|
|
|
36
36
|
display: flex;
|
|
37
37
|
align-items: flex-end;
|
|
38
38
|
margin-bottom: ${(p) => p.theme.space[6]}px;
|
|
39
|
+
z-index: 10;
|
|
39
40
|
`;
|
|
40
41
|
const ClosePressableExtendedBounds = styled.TouchableOpacity.attrs({
|
|
41
42
|
p: 3,
|
|
@@ -74,7 +75,7 @@ export function ModalHeaderCloseButton({ onClose, }) {
|
|
|
74
75
|
React.createElement(Icons.CloseMedium, { color: "neutral.c100", size: "20px" }))));
|
|
75
76
|
}
|
|
76
77
|
export default function BaseModal(_a) {
|
|
77
|
-
var { isOpen, onClose = () => { }, noCloseButton, safeContainerStyle = {}, containerStyle = {}, modalStyle = {}, preventBackdropClick, Icon, iconColor, title, description, subtitle, children, onModalHide } = _a, rest = __rest(_a, ["isOpen", "onClose", "noCloseButton", "safeContainerStyle", "containerStyle", "modalStyle", "preventBackdropClick", "Icon", "iconColor", "title", "description", "subtitle", "children", "onModalHide"]);
|
|
78
|
+
var { isOpen, onClose = () => { }, noCloseButton, safeContainerStyle = {}, containerStyle = {}, modalStyle = {}, preventBackdropClick, Icon, iconColor, title, description, subtitle, children, onModalHide, CustomHeader } = _a, rest = __rest(_a, ["isOpen", "onClose", "noCloseButton", "safeContainerStyle", "containerStyle", "modalStyle", "preventBackdropClick", "Icon", "iconColor", "title", "description", "subtitle", "children", "onModalHide", "CustomHeader"]);
|
|
78
79
|
const backDropProps = preventBackdropClick
|
|
79
80
|
? {}
|
|
80
81
|
: {
|
|
@@ -91,8 +92,9 @@ export default function BaseModal(_a) {
|
|
|
91
92
|
}, [onClose, onModalHide]);
|
|
92
93
|
return (React.createElement(ReactNativeModal, Object.assign({}, backDropProps, rest, { isVisible: !!isOpen, deviceWidth: width, deviceHeight: height, useNativeDriver: true, useNativeDriverForBackdrop: true, hideModalContentWhileAnimating: true, onModalHide: onModalHideWithClose, style: [defaultModalStyle, modalStyle] }),
|
|
93
94
|
React.createElement(SafeContainer, { style: safeContainerStyle },
|
|
95
|
+
CustomHeader && (React.createElement(CustomHeader, null, !noCloseButton && React.createElement(ModalHeaderCloseButton, { onClose: onClose }))),
|
|
94
96
|
React.createElement(Container, { style: containerStyle },
|
|
95
|
-
!noCloseButton && React.createElement(ModalHeaderCloseButton, { onClose: onClose }),
|
|
97
|
+
!CustomHeader && !noCloseButton && React.createElement(ModalHeaderCloseButton, { onClose: onClose }),
|
|
96
98
|
React.createElement(ModalHeader, { Icon: Icon, iconColor: iconColor, title: title, description: description, subtitle: subtitle }),
|
|
97
99
|
React.createElement(ContentContainer, null, children)))));
|
|
98
100
|
}
|
|
@@ -13,8 +13,9 @@ export interface BaseTextProps extends TextProps, BaseStyledProps, FontSizeProps
|
|
|
13
13
|
lineHeight?: string;
|
|
14
14
|
bracket?: boolean;
|
|
15
15
|
textTransform?: TextStyle["textTransform"];
|
|
16
|
+
testID?: string;
|
|
16
17
|
uppercase?: boolean;
|
|
17
18
|
children?: React.ReactNode;
|
|
18
19
|
}
|
|
19
|
-
declare const Text: ({ children, bracket, textAlign, ...props }: BaseTextProps) => JSX.Element;
|
|
20
|
+
declare const Text: ({ children, bracket, textAlign, testID, ...props }: BaseTextProps) => JSX.Element;
|
|
20
21
|
export default Text;
|
|
@@ -56,9 +56,9 @@ const BracketText = (_a) => {
|
|
|
56
56
|
React.createElement(BracketRight, { fill: c, width: size, height: size })));
|
|
57
57
|
};
|
|
58
58
|
const Text = (_a) => {
|
|
59
|
-
var { children, bracket, textAlign = "left" } = _a, props = __rest(_a, ["children", "bracket", "textAlign"]);
|
|
59
|
+
var { children, bracket, textAlign = "left", testID } = _a, props = __rest(_a, ["children", "bracket", "textAlign", "testID"]);
|
|
60
60
|
if (bracket)
|
|
61
61
|
return React.createElement(BracketText, Object.assign({}, props), children);
|
|
62
|
-
return (React.createElement(Base, Object.assign({ textAlign: textAlign }, props), children));
|
|
62
|
+
return (React.createElement(Base, Object.assign({ textAlign: textAlign }, props, { testID: testID }), children));
|
|
63
63
|
};
|
|
64
64
|
export default Text;
|
|
@@ -15,6 +15,7 @@ export type ButtonProps = TouchableOpacityProps & BaseStyledProps & {
|
|
|
15
15
|
children?: React.ReactNode;
|
|
16
16
|
pending?: boolean;
|
|
17
17
|
displayContentWhenPending?: boolean;
|
|
18
|
+
testID?: string;
|
|
18
19
|
};
|
|
19
20
|
export declare const Base: import("styled-components").StyledComponent<typeof TouchableOpacity, import("styled-components").DefaultTheme, {
|
|
20
21
|
iconButton?: boolean | undefined;
|
|
@@ -69,9 +69,9 @@ const ButtonContainer = (props) => {
|
|
|
69
69
|
iconPosition === "left" && children ? (React.createElement(Text, { variant: ctaTextType[size], fontWeight: "semiBold", color: textColor }, children)) : null));
|
|
70
70
|
};
|
|
71
71
|
const Button = (props) => {
|
|
72
|
-
const { Icon, children, type = "default", iconName, disabled = false, pending = false, displayContentWhenPending = false, } = props;
|
|
72
|
+
const { Icon, children, type = "default", iconName, disabled = false, pending = false, displayContentWhenPending = false, testID, } = props;
|
|
73
73
|
const theme = useTheme();
|
|
74
|
-
return (React.createElement(Base, Object.assign({}, props, { type: type, iconButton: (!!Icon || !!iconName) && !children, activeOpacity: 1, disabled: disabled || pending }),
|
|
74
|
+
return (React.createElement(Base, Object.assign({}, props, { type: type, iconButton: (!!Icon || !!iconName) && !children, activeOpacity: 1, disabled: disabled || pending, testID: testID }),
|
|
75
75
|
React.createElement(View, null,
|
|
76
76
|
React.createElement(ButtonContainer, Object.assign({}, props, { type: type, hide: pending && !displayContentWhenPending })),
|
|
77
77
|
pending && !displayContentWhenPending ? (React.createElement(SpinnerContainer, { displayContentWhenPending: displayContentWhenPending },
|
|
@@ -19,15 +19,15 @@ export interface AlertProps {
|
|
|
19
19
|
}
|
|
20
20
|
declare function Alert({ type, Icon, title, showIcon, children }: AlertProps): JSX.Element;
|
|
21
21
|
declare namespace Alert {
|
|
22
|
-
var BodyText: import("styled-components").StyledComponent<({ children, bracket, textAlign, ...props }: import("../../Text").BaseTextProps) => JSX.Element, import("styled-components").DefaultTheme, {
|
|
22
|
+
var BodyText: import("styled-components").StyledComponent<({ children, bracket, textAlign, testID, ...props }: import("../../Text").BaseTextProps) => JSX.Element, import("styled-components").DefaultTheme, {
|
|
23
23
|
flexShrink: 1;
|
|
24
24
|
variant: "bodyLineHeight";
|
|
25
25
|
fontWeight: "semiBold";
|
|
26
|
-
}, "fontWeight" | "
|
|
27
|
-
var UnderlinedText: import("styled-components").StyledComponent<({ children, bracket, textAlign, ...props }: import("../../Text").BaseTextProps) => JSX.Element, import("styled-components").DefaultTheme, {
|
|
26
|
+
}, "fontWeight" | "flexShrink" | "variant">;
|
|
27
|
+
var UnderlinedText: import("styled-components").StyledComponent<({ children, bracket, textAlign, testID, ...props }: import("../../Text").BaseTextProps) => JSX.Element, import("styled-components").DefaultTheme, {
|
|
28
28
|
flexShrink: 1;
|
|
29
29
|
variant: "bodyLineHeight";
|
|
30
30
|
fontWeight: "semiBold";
|
|
31
|
-
}, "fontWeight" | "
|
|
31
|
+
}, "fontWeight" | "flexShrink" | "variant">;
|
|
32
32
|
}
|
|
33
33
|
export default Alert;
|
package/lib/styles/theme.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ColorPalette } from "@ledgerhq/ui-shared";
|
|
2
2
|
export declare const space: number[];
|
|
3
3
|
export declare const textVariants: readonly ["h1", "h1Inter", "h2", "h3", "h4", "h5", "large", "largeLineHeight", "body", "bodyLineHeight", "paragraph", "paragraphLineHeight", "small", "subtitle", "tiny", "tinyAlpha"];
|
|
4
|
-
export type TextVariants = typeof textVariants[number];
|
|
4
|
+
export type TextVariants = (typeof textVariants)[number];
|
|
5
5
|
export type ThemeScale<Type, Aliases extends string> = Array<Type> & Record<Aliases, Type>;
|
|
6
6
|
export declare const fontSizes: ThemeScale<number, "h1" | "h1Inter" | "h2" | "h3" | "h4" | "h5" | "large" | "largeLineHeight" | "body" | "bodyLineHeight" | "paragraph" | "paragraphLineHeight" | "small" | "subtitle" | "tiny" | "tinyAlpha">;
|
|
7
7
|
export declare const radii: number[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/native-ui",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.1-next.0",
|
|
4
4
|
"description": "Ledger Live - Mobile UI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"styled-system": "^5.1.5",
|
|
48
48
|
"victory-native": "^35.5.5",
|
|
49
49
|
"@ledgerhq/crypto-icons-ui": "^0.3.0",
|
|
50
|
-
"@ledgerhq/icons-ui": "^0.4.0",
|
|
50
|
+
"@ledgerhq/icons-ui": "^0.4.1-next.0",
|
|
51
51
|
"@ledgerhq/ui-shared": "^0.2.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
@@ -79,7 +79,6 @@
|
|
|
79
79
|
"@react-native-async-storage/async-storage": "1.17.11",
|
|
80
80
|
"@react-native-community/cli-server-api": "^7.0.3",
|
|
81
81
|
"@react-native-community/datetimepicker": "6.7.3",
|
|
82
|
-
"@react-native-community/eslint-config": "^3.0.1",
|
|
83
82
|
"@react-native-community/slider": "^4.4.2",
|
|
84
83
|
"@storybook/addon-actions": "^6.5.16",
|
|
85
84
|
"@storybook/addon-controls": "^6.5.16",
|
|
@@ -105,8 +104,6 @@
|
|
|
105
104
|
"@types/react-native": "0.71.5",
|
|
106
105
|
"@types/styled-components": "^5.1.3",
|
|
107
106
|
"@types/styled-components-react-native": "^5.1.3",
|
|
108
|
-
"@typescript-eslint/eslint-plugin": "^5.22.0",
|
|
109
|
-
"@typescript-eslint/parser": "^5.22.0",
|
|
110
107
|
"assert": "^2.0.0",
|
|
111
108
|
"babel-loader": "^8.2.2",
|
|
112
109
|
"babel-plugin-module-resolver": "^4.1.0",
|
|
@@ -115,11 +112,8 @@
|
|
|
115
112
|
"babel-preset-expo": "^9.3.0",
|
|
116
113
|
"camelcase": "^6.2.1",
|
|
117
114
|
"csstype": "^3.0.11",
|
|
118
|
-
"eslint": "^
|
|
119
|
-
"eslint-
|
|
120
|
-
"eslint-plugin-prettier": "^4.0.0",
|
|
121
|
-
"eslint-plugin-react": "^7.29.2",
|
|
122
|
-
"eslint-plugin-react-hooks": "^4.3.0",
|
|
115
|
+
"eslint-plugin-react": "^7.32.2",
|
|
116
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
123
117
|
"expo": "~48.0.9",
|
|
124
118
|
"expo-asset": "^8.9.1",
|
|
125
119
|
"expo-constants": "^14.2.1",
|
|
@@ -138,7 +132,6 @@
|
|
|
138
132
|
"metro-source-map": "^0.76.0",
|
|
139
133
|
"metro-transform-worker": "^0.76.0",
|
|
140
134
|
"minimatch": "^5.1.0",
|
|
141
|
-
"prettier": "^2.4.1",
|
|
142
135
|
"prop-types": "^15.8.1",
|
|
143
136
|
"react": "^18",
|
|
144
137
|
"react-dom": "^18",
|