@ledgerhq/native-ui 0.20.1-notarizer.0 → 0.20.2-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.
@@ -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,12 +19,12 @@ 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
26
  }, "fontWeight" | "flexShrink" | "variant">;
27
- var UnderlinedText: import("styled-components").StyledComponent<({ children, bracket, textAlign, ...props }: import("../../Text").BaseTextProps) => JSX.Element, import("styled-components").DefaultTheme, {
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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/native-ui",
3
- "version": "0.20.1-notarizer.0",
3
+ "version": "0.20.2-next.0",
4
4
  "description": "Ledger Live - Mobile UI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -46,8 +46,8 @@
46
46
  "rn-range-slider": "2.1.1",
47
47
  "styled-system": "^5.1.5",
48
48
  "victory-native": "^35.5.5",
49
- "@ledgerhq/crypto-icons-ui": "^0.3.0",
50
- "@ledgerhq/icons-ui": "^0.4.1-notarizer.0",
49
+ "@ledgerhq/crypto-icons-ui": "^0.4.0-next.0",
50
+ "@ledgerhq/icons-ui": "^0.4.1",
51
51
  "@ledgerhq/ui-shared": "^0.2.0"
52
52
  },
53
53
  "peerDependencies": {