@ledgerhq/native-ui 0.7.3 → 0.7.4-monorepo.3
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/README.md +10 -10
- package/{assets → lib/assets}/fonts/alpha/HMAlphaMono-Medium.otf +0 -0
- package/{assets → lib/assets}/fonts/inter/Inter-Bold.otf +0 -0
- package/{assets → lib/assets}/fonts/inter/Inter-Medium.otf +0 -0
- package/{assets → lib/assets}/fonts/inter/Inter-SemiBold.otf +0 -0
- package/{assets → lib/assets}/icons.d.ts +0 -0
- package/{assets → lib/assets}/icons.js +0 -0
- package/{assets → lib/assets}/index.d.ts +0 -0
- package/{assets → lib/assets}/index.js +0 -0
- package/{assets → lib/assets}/logos/LedgerLiveAltRegular.d.ts +1 -0
- package/{assets → lib/assets}/logos/LedgerLiveAltRegular.js +0 -0
- package/{assets → lib/assets}/logos/LedgerLiveRegular.d.ts +1 -0
- package/{assets → lib/assets}/logos/LedgerLiveRegular.js +0 -0
- package/{assets → lib/assets}/logos/index.d.ts +0 -0
- package/{assets → lib/assets}/logos/index.js +0 -0
- package/{components → lib/components}/Carousel/index.d.ts +0 -0
- package/{components → lib/components}/Carousel/index.js +0 -0
- package/{components → lib/components}/Form/Checkbox/index.d.ts +1 -0
- package/{components → lib/components}/Form/Checkbox/index.js +0 -0
- package/{components → lib/components}/Form/Input/BaseInput/index.d.ts +4 -4
- package/{components → lib/components}/Form/Input/BaseInput/index.js +0 -0
- package/{components → lib/components}/Form/Input/LegendInput/index.d.ts +0 -0
- package/{components → lib/components}/Form/Input/LegendInput/index.js +0 -0
- package/{components → lib/components}/Form/Input/NumberInput/index.d.ts +0 -0
- package/{components → lib/components}/Form/Input/NumberInput/index.js +0 -0
- package/{components → lib/components}/Form/Input/QrCodeInput/index.d.ts +0 -0
- package/{components → lib/components}/Form/Input/QrCodeInput/index.js +0 -0
- package/{components → lib/components}/Form/Input/SearchInput/index.d.ts +0 -0
- package/{components → lib/components}/Form/Input/SearchInput/index.js +0 -0
- package/{components → lib/components}/Form/Input/index.d.ts +0 -0
- package/{components → lib/components}/Form/Input/index.js +0 -0
- package/{components → lib/components}/Form/SelectableList.d.ts +0 -0
- package/{components → lib/components}/Form/SelectableList.js +0 -0
- package/{components → lib/components}/Form/Slider/components.d.ts +0 -0
- package/{components → lib/components}/Form/Slider/components.js +0 -0
- package/{components → lib/components}/Form/Slider/index.d.ts +1 -0
- package/{components → lib/components}/Form/Slider/index.js +0 -0
- package/{components → lib/components}/Form/Slider/index.native.d.ts +1 -0
- package/{components → lib/components}/Form/Slider/index.native.js +0 -0
- package/{components → lib/components}/Form/Switch/index.d.ts +1 -0
- package/{components → lib/components}/Form/Switch/index.js +0 -0
- package/{components → lib/components}/Form/Toggle/index.d.ts +1 -0
- package/{components → lib/components}/Form/Toggle/index.js +0 -0
- package/{components → lib/components}/Form/index.d.ts +0 -0
- package/{components → lib/components}/Form/index.js +0 -0
- package/{components → lib/components}/Icon/BoxedIcon.d.ts +1 -0
- package/{components → lib/components}/Icon/BoxedIcon.js +0 -0
- package/{components → lib/components}/Icon/Icon.d.ts +1 -0
- package/{components → lib/components}/Icon/Icon.js +0 -0
- package/{components → lib/components}/Icon/IconBox/index.d.ts +0 -0
- package/{components → lib/components}/Icon/IconBox/index.js +0 -0
- package/{components → lib/components}/Icon/index.d.ts +0 -0
- package/{components → lib/components}/Icon/index.js +0 -0
- package/{components → lib/components}/Icon/type.d.ts +0 -0
- package/{components → lib/components}/Icon/type.js +0 -0
- package/{components → lib/components}/Layout/Box/index.d.ts +1 -1
- package/{components → lib/components}/Layout/Box/index.js +0 -0
- package/{components → lib/components}/Layout/Collapse/Accordion/index.d.ts +0 -0
- package/{components → lib/components}/Layout/Collapse/Accordion/index.js +1 -0
- package/{components → lib/components}/Layout/Flex/index.d.ts +1 -1
- package/{components → lib/components}/Layout/Flex/index.js +0 -0
- package/{components → lib/components}/Layout/List/IconBoxList/index.d.ts +0 -0
- package/{components → lib/components}/Layout/List/IconBoxList/index.js +0 -0
- package/{components → lib/components}/Layout/List/List/index.d.ts +0 -0
- package/{components → lib/components}/Layout/List/List/index.js +0 -0
- package/{components → lib/components}/Layout/List/NumberedList/index.d.ts +0 -0
- package/{components → lib/components}/Layout/List/NumberedList/index.js +0 -0
- package/{components → lib/components}/Layout/List/TipList/index.d.ts +0 -0
- package/{components → lib/components}/Layout/List/TipList/index.js +0 -0
- package/{components → lib/components}/Layout/List/index.d.ts +0 -0
- package/{components → lib/components}/Layout/List/index.js +0 -0
- package/{components → lib/components}/Layout/Modals/BaseModal/index.d.ts +1 -1
- package/{components → lib/components}/Layout/Modals/BaseModal/index.js +4 -1
- package/{components → lib/components}/Layout/Modals/BottomDrawer/index.d.ts +0 -0
- package/{components → lib/components}/Layout/Modals/BottomDrawer/index.js +0 -0
- package/{components → lib/components}/Layout/Modals/Popin/index.d.ts +0 -0
- package/{components → lib/components}/Layout/Modals/Popin/index.js +0 -0
- package/{components → lib/components}/Layout/Modals/Tooltip/index.d.ts +0 -0
- package/{components → lib/components}/Layout/Modals/Tooltip/index.js +0 -0
- package/{components → lib/components}/Layout/Modals/index.d.ts +0 -0
- package/{components → lib/components}/Layout/Modals/index.js +0 -0
- package/{components → lib/components}/Layout/ScrollContainer/index.d.ts +0 -0
- package/{components → lib/components}/Layout/ScrollContainer/index.js +0 -0
- package/{components → lib/components}/Layout/ScrollContainerHeader/Header.d.ts +1 -0
- package/{components → lib/components}/Layout/ScrollContainerHeader/Header.js +0 -0
- package/{components → lib/components}/Layout/ScrollContainerHeader/index.d.ts +0 -0
- package/{components → lib/components}/Layout/ScrollContainerHeader/index.js +0 -0
- package/{components → lib/components}/Layout/ScrollListContainer/index.d.ts +0 -0
- package/{components → lib/components}/Layout/ScrollListContainer/index.js +0 -0
- package/{components → lib/components}/Layout/Table/Row.d.ts +0 -0
- package/{components → lib/components}/Layout/Table/Row.js +0 -0
- package/{components → lib/components}/Layout/index.d.ts +0 -0
- package/{components → lib/components}/Layout/index.js +0 -0
- package/{components → lib/components}/Layout/types.d.ts +0 -0
- package/{components → lib/components}/Layout/types.js +0 -0
- package/{components → lib/components}/Loader/InfiniteLoader/index.d.ts +1 -1
- package/{components → lib/components}/Loader/InfiniteLoader/index.js +0 -0
- package/lib/components/Loader/ProgressLoader/index.d.ts +17 -0
- package/{components → lib/components}/Loader/ProgressLoader/index.js +7 -7
- package/{components → lib/components}/Loader/index.d.ts +0 -0
- package/{components → lib/components}/Loader/index.js +0 -0
- package/{components → lib/components}/Navigation/FlowStepper/index.d.ts +0 -0
- package/{components → lib/components}/Navigation/FlowStepper/index.js +0 -0
- package/{components → lib/components}/Navigation/SlideIndicator/index.d.ts +0 -0
- package/{components → lib/components}/Navigation/SlideIndicator/index.js +1 -0
- package/{components → lib/components}/Navigation/Stepper/index.d.ts +0 -0
- package/{components → lib/components}/Navigation/Stepper/index.js +0 -0
- package/{components → lib/components}/Navigation/index.d.ts +0 -0
- package/{components → lib/components}/Navigation/index.js +0 -0
- package/{components → lib/components}/ProgressBar/index.d.ts +0 -0
- package/{components → lib/components}/ProgressBar/index.js +0 -0
- package/{components → lib/components}/Tabs/Chip/index.d.ts +0 -0
- package/{components → lib/components}/Tabs/Chip/index.js +0 -0
- package/{components → lib/components}/Tabs/Graph/index.d.ts +0 -0
- package/{components → lib/components}/Tabs/Graph/index.js +0 -0
- package/{components → lib/components}/Tabs/TemplateTabs/index.d.ts +1 -1
- package/{components → lib/components}/Tabs/TemplateTabs/index.js +0 -0
- package/{components → lib/components}/Tabs/index.d.ts +0 -0
- package/{components → lib/components}/Tabs/index.js +0 -0
- package/{components → lib/components}/Text/getTextStyle.d.ts +0 -0
- package/{components → lib/components}/Text/getTextStyle.js +0 -0
- package/{components → lib/components}/Text/index.d.ts +0 -0
- package/{components → lib/components}/Text/index.js +0 -0
- package/{components → lib/components}/chart/index.d.ts +1 -0
- package/{components → lib/components}/chart/index.js +0 -0
- package/{components → lib/components}/chart/types.d.ts +0 -0
- package/{components → lib/components}/chart/types.js +0 -0
- package/{components → lib/components}/cta/Button/getButtonStyle.d.ts +0 -0
- package/{components → lib/components}/cta/Button/getButtonStyle.js +0 -0
- package/{components → lib/components}/cta/Button/index.d.ts +0 -0
- package/{components → lib/components}/cta/Button/index.js +4 -4
- package/{components → lib/components}/cta/Link/getLinkStyle.d.ts +0 -0
- package/{components → lib/components}/cta/Link/getLinkStyle.js +0 -0
- package/{components → lib/components}/cta/Link/index.d.ts +0 -0
- package/{components → lib/components}/cta/Link/index.js +0 -0
- package/{components → lib/components}/cta/getCtaStyle.d.ts +0 -0
- package/{components → lib/components}/cta/getCtaStyle.js +0 -0
- package/{components → lib/components}/cta/index.d.ts +0 -0
- package/{components → lib/components}/cta/index.js +0 -0
- package/{components → lib/components}/index.d.ts +0 -0
- package/{components → lib/components}/index.js +0 -0
- package/lib/components/message/Alert/index.d.ts +27 -0
- package/{components → lib/components}/message/Alert/index.js +7 -5
- package/lib/components/message/Log/Brackets.d.ts +15 -0
- package/lib/components/message/Log/Brackets.js +29 -0
- package/lib/components/message/Log/index.d.ts +9 -0
- package/lib/components/message/Log/index.js +15 -0
- package/{components → lib/components}/message/Notification/index.d.ts +0 -0
- package/{components → lib/components}/message/Notification/index.js +0 -0
- package/{components → lib/components}/message/index.d.ts +1 -0
- package/{components → lib/components}/message/index.js +1 -0
- package/{components → lib/components}/styled.d.ts +0 -0
- package/{components → lib/components}/styled.js +4 -1
- package/{components → lib/components}/tags/Badge/index.d.ts +0 -0
- package/{components → lib/components}/tags/Badge/index.js +0 -0
- package/{components → lib/components}/tags/Tag/index.d.ts +0 -0
- package/{components → lib/components}/tags/Tag/index.js +0 -0
- package/{components → lib/components}/tags/index.d.ts +0 -0
- package/{components → lib/components}/tags/index.js +0 -0
- package/{components → lib/components}/transitions/Fade.d.ts +1 -0
- package/{components → lib/components}/transitions/Fade.js +0 -0
- package/{components → lib/components}/transitions/Slide.d.ts +1 -0
- package/{components → lib/components}/transitions/Slide.js +0 -0
- package/{components → lib/components}/transitions/Transition.d.ts +1 -0
- package/{components → lib/components}/transitions/Transition.js +0 -0
- package/{components → lib/components}/transitions/index.d.ts +0 -0
- package/{components → lib/components}/transitions/index.js +0 -0
- package/{components → lib/components}/transitions/types.d.ts +0 -0
- package/{components → lib/components}/transitions/types.js +0 -0
- package/{helpers → lib/helpers}/getDeviceSize.d.ts +0 -0
- package/{helpers → lib/helpers}/getDeviceSize.js +0 -0
- package/{icons → lib/icons}/BracketLeft.d.ts +0 -0
- package/{icons → lib/icons}/BracketLeft.js +0 -0
- package/{icons → lib/icons}/BracketRight.d.ts +0 -0
- package/{icons → lib/icons}/BracketRight.js +0 -0
- package/{icons → lib/icons}/Close.d.ts +0 -0
- package/{icons → lib/icons}/Close.js +0 -0
- package/{icons → lib/icons}/Info.d.ts +0 -0
- package/{icons → lib/icons}/Info.js +0 -0
- package/{index.d.ts → lib/index.d.ts} +0 -0
- package/{index.js → lib/index.js} +0 -0
- package/{styles → lib/styles}/InvertTheme.d.ts +0 -0
- package/{styles → lib/styles}/InvertTheme.js +0 -0
- package/{styles → lib/styles}/StyleProvider.d.ts +0 -0
- package/{styles → lib/styles}/StyleProvider.js +0 -0
- package/{styles → lib/styles}/helpers.d.ts +0 -0
- package/{styles → lib/styles}/helpers.js +0 -0
- package/{styles → lib/styles}/index.d.ts +0 -0
- package/{styles → lib/styles}/index.js +0 -0
- package/{styles → lib/styles}/theme.d.ts +0 -0
- package/{styles → lib/styles}/theme.js +0 -0
- package/package.json +121 -16
- package/components/Loader/ProgressLoader/index.d.ts +0 -13
- package/components/message/Alert/index.d.ts +0 -10
|
File without changes
|
|
File without changes
|
|
@@ -66,12 +66,12 @@ const ButtonContainer = (props) => {
|
|
|
66
66
|
iconPosition === "left" && children ? (React.createElement(Text, { variant: ctaTextType[size], fontWeight: "semiBold", color: text.color }, children)) : null));
|
|
67
67
|
};
|
|
68
68
|
const Button = (props) => {
|
|
69
|
-
const { Icon, children, type = "default" } = props;
|
|
70
|
-
return (React.createElement(Base, Object.assign({}, props, { type: type, iconButton: !!Icon && !children, activeOpacity: 0.5 }),
|
|
69
|
+
const { Icon, children, type = "default", iconName } = props;
|
|
70
|
+
return (React.createElement(Base, Object.assign({}, props, { type: type, iconButton: (!!Icon || !!iconName) && !children, activeOpacity: 0.5 }),
|
|
71
71
|
React.createElement(ButtonContainer, Object.assign({}, props, { type: type }))));
|
|
72
72
|
};
|
|
73
73
|
export const PromisableButton = (props) => {
|
|
74
|
-
const { Icon, children, onPress, type = "main", disabled = false } = props;
|
|
74
|
+
const { Icon, children, onPress, type = "main", disabled = false, iconName } = props;
|
|
75
75
|
const [spinnerOn, setSpinnerOn] = useState(false);
|
|
76
76
|
const theme = useTheme();
|
|
77
77
|
const onPressHandler = useCallback((event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -85,7 +85,7 @@ export const PromisableButton = (props) => {
|
|
|
85
85
|
setSpinnerOn(false);
|
|
86
86
|
}
|
|
87
87
|
}), [onPress]);
|
|
88
|
-
return (React.createElement(Base, Object.assign({}, props, { type: type, iconButton: !!Icon && !children, disabled: disabled || spinnerOn, onPress: onPressHandler }),
|
|
88
|
+
return (React.createElement(Base, Object.assign({}, props, { type: type, iconButton: (!!Icon || !!iconName) && !children, disabled: disabled || spinnerOn, onPress: onPressHandler }),
|
|
89
89
|
React.createElement(ButtonContainer, Object.assign({}, props, { type: type, hide: spinnerOn })),
|
|
90
90
|
React.createElement(SpinnerContainer, null,
|
|
91
91
|
React.createElement(ActivityIndicator, { color: theme.colors.neutral.c50, animating: spinnerOn }))));
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare type AlertType = "info" | "warning" | "error";
|
|
3
|
+
export declare type IconProps = {
|
|
4
|
+
size?: number;
|
|
5
|
+
color?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare type IconType = React.ComponentType<IconProps>;
|
|
8
|
+
export interface AlertProps {
|
|
9
|
+
type?: AlertType;
|
|
10
|
+
/**
|
|
11
|
+
* Optional component to replace the default Icon for the given `type` prop.
|
|
12
|
+
* It will receive a `color: string` and a `size: number` as props.
|
|
13
|
+
* */
|
|
14
|
+
Icon?: IconType;
|
|
15
|
+
title?: string;
|
|
16
|
+
showIcon?: boolean;
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Alternative to using the `children` prop in order to render something using the value of `textColor`
|
|
20
|
+
* that is passed as a parameter.
|
|
21
|
+
*/
|
|
22
|
+
renderContent?: ({ textColor }: {
|
|
23
|
+
textColor: string;
|
|
24
|
+
}) => React.ReactNode | null;
|
|
25
|
+
}
|
|
26
|
+
export default function Alert({ type, Icon, title, showIcon, children, renderContent, }: AlertProps): JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import styled, { useTheme } from "styled-components/native";
|
|
3
|
-
import
|
|
3
|
+
import InfoMedium from "@ledgerhq/icons-ui/native/InfoMedium";
|
|
4
4
|
import CircledCrossMedium from "@ledgerhq/icons-ui/native/CircledCrossMedium";
|
|
5
5
|
import CircledAlertMedium from "@ledgerhq/icons-ui/native/CircledAlertMedium";
|
|
6
6
|
import Text from "../../Text";
|
|
7
7
|
import { getColor } from "../../../styles";
|
|
8
8
|
import FlexBox from "../../Layout/Flex";
|
|
9
9
|
const icons = {
|
|
10
|
-
info:
|
|
10
|
+
info: InfoMedium,
|
|
11
11
|
warning: CircledAlertMedium,
|
|
12
12
|
error: CircledCrossMedium,
|
|
13
13
|
};
|
|
@@ -39,11 +39,13 @@ const StyledAlertContainer = styled(FlexBox).attrs((p) => ({
|
|
|
39
39
|
flex-direction: row;
|
|
40
40
|
align-items: center;
|
|
41
41
|
`;
|
|
42
|
-
export default function Alert({ type = "info", title, showIcon = true, children, }) {
|
|
42
|
+
export default function Alert({ type = "info", Icon, title, showIcon = true, children, renderContent, }) {
|
|
43
43
|
const theme = useTheme();
|
|
44
44
|
const textColor = getColor(theme, alertColors[type || "info"].color);
|
|
45
|
+
const iconProps = { size: 20, color: textColor };
|
|
45
46
|
return (React.createElement(StyledAlertContainer, { type: type },
|
|
46
|
-
showIcon && !!icons[type] && (React.createElement(StyledIconContainer, null, icons[type || "info"](
|
|
47
|
+
showIcon && !!icons[type] && (React.createElement(StyledIconContainer, null, Icon ? React.createElement(Icon, Object.assign({}, iconProps)) : icons[type || "info"](iconProps))),
|
|
47
48
|
title && (React.createElement(Text, { color: textColor, flexShrink: 1 }, title)),
|
|
48
|
-
children
|
|
49
|
+
children,
|
|
50
|
+
renderContent && renderContent({ textColor })));
|
|
49
51
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FlexBoxProps } from "../../Layout/Flex";
|
|
3
|
+
import { ViewStyle } from "react-native";
|
|
4
|
+
declare type BracketProps = {
|
|
5
|
+
color: string;
|
|
6
|
+
};
|
|
7
|
+
declare type BaseBracketProps = FlexBoxProps & BracketProps & {
|
|
8
|
+
style?: ViewStyle;
|
|
9
|
+
};
|
|
10
|
+
export declare const Bracket: ({ color, style, mb, mt }: BaseBracketProps) => React.ReactElement;
|
|
11
|
+
export declare const BracketTopLeft: ({ color }: BracketProps) => JSX.Element;
|
|
12
|
+
export declare const BracketTopRight: ({ color }: BracketProps) => JSX.Element;
|
|
13
|
+
export declare const BracketBottomLeft: ({ color }: BracketProps) => JSX.Element;
|
|
14
|
+
export declare const BracketBottomRight: ({ color }: BracketProps) => JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styled, { useTheme } from "styled-components/native";
|
|
3
|
+
import { Svg, Path } from "react-native-svg";
|
|
4
|
+
import FlexBox from "../../Layout/Flex";
|
|
5
|
+
import { getColor } from "../../../styles";
|
|
6
|
+
const BracketContainer = styled(FlexBox).attrs({
|
|
7
|
+
flexDirection: "column",
|
|
8
|
+
position: "relative",
|
|
9
|
+
justifyContent: "space-between",
|
|
10
|
+
}) ``;
|
|
11
|
+
export const Bracket = ({ color, style, mb, mt }) => {
|
|
12
|
+
const theme = useTheme();
|
|
13
|
+
const fill = getColor(theme, color);
|
|
14
|
+
return (React.createElement(BracketContainer, { style: style, mb: mb, mt: mt },
|
|
15
|
+
React.createElement(Svg, { width: "17", height: "10", viewBox: "0 0 17 10" },
|
|
16
|
+
React.createElement(Path, { d: "M16.8125 0H2.8125H0.8125V2V10H2.8125V2H16.8125V0Z", fill: fill }))));
|
|
17
|
+
};
|
|
18
|
+
export const BracketTopLeft = ({ color }) => {
|
|
19
|
+
return React.createElement(Bracket, { color: color, mb: "-4px" });
|
|
20
|
+
};
|
|
21
|
+
export const BracketTopRight = ({ color }) => {
|
|
22
|
+
return React.createElement(Bracket, { color: color, mb: "-4px", style: { transform: [{ scaleX: -1 }] } });
|
|
23
|
+
};
|
|
24
|
+
export const BracketBottomLeft = ({ color }) => {
|
|
25
|
+
return React.createElement(Bracket, { color: color, mt: "-4px", style: { transform: [{ scaleY: -1 }] } });
|
|
26
|
+
};
|
|
27
|
+
export const BracketBottomRight = ({ color }) => {
|
|
28
|
+
return React.createElement(Bracket, { color: color, mt: "-4px", style: { transform: [{ scale: -1 }] } });
|
|
29
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BaseTextProps as TextProps } from "../../Text";
|
|
3
|
+
import { FlexBoxProps } from "../../Layout/Flex";
|
|
4
|
+
export declare type Props = React.PropsWithChildren<FlexBoxProps & {
|
|
5
|
+
extraTextProps?: TextProps;
|
|
6
|
+
}>;
|
|
7
|
+
declare function Log({ children, extraTextProps }: Props): JSX.Element;
|
|
8
|
+
declare const _default: React.MemoExoticComponent<typeof Log>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { memo } from "react";
|
|
2
|
+
import Text from "../../Text";
|
|
3
|
+
import Flex from "../../Layout/Flex";
|
|
4
|
+
import { BracketTopLeft, BracketTopRight, BracketBottomLeft, BracketBottomRight } from "./Brackets";
|
|
5
|
+
function Log({ children, extraTextProps }) {
|
|
6
|
+
return (React.createElement(Flex, { flexDirection: "column" },
|
|
7
|
+
React.createElement(Flex, { flexDirection: "row", justifyContent: "space-between" },
|
|
8
|
+
React.createElement(BracketTopLeft, { color: "neutral.c100" }),
|
|
9
|
+
React.createElement(BracketTopRight, { color: "neutral.c100" })),
|
|
10
|
+
React.createElement(Text, Object.assign({ variant: "h2", textTransform: "uppercase", textAlign: "center", color: "neutral.c100", px: "16px" }, extraTextProps), children),
|
|
11
|
+
React.createElement(Flex, { flexDirection: "row", justifyContent: "space-between" },
|
|
12
|
+
React.createElement(BracketBottomLeft, { color: "neutral.c100" }),
|
|
13
|
+
React.createElement(BracketBottomRight, { color: "neutral.c100" }))));
|
|
14
|
+
}
|
|
15
|
+
export default memo(Log);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -6,7 +6,10 @@ const proxyStyled = new Proxy(styled, {
|
|
|
6
6
|
return styled(target.apply(thisArg, argumentsList)(baseStyles));
|
|
7
7
|
},
|
|
8
8
|
get(target, property) {
|
|
9
|
-
|
|
9
|
+
if (typeof target[property] === "function") {
|
|
10
|
+
return styled(target[property].apply(styled, [baseStyles]));
|
|
11
|
+
}
|
|
12
|
+
return target[property];
|
|
10
13
|
},
|
|
11
14
|
});
|
|
12
15
|
export default proxyStyled;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,24 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/native-ui",
|
|
3
|
-
"version": "0.7.3",
|
|
4
|
-
"description": "Ledger Live -
|
|
3
|
+
"version": "0.7.4-monorepo.3",
|
|
4
|
+
"description": "Ledger Live - Mobile UI",
|
|
5
5
|
"repository": "https://github.com/LedgerHQ/ui",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Ledger Live Team <team-live@ledger.fr>",
|
|
8
|
+
"main": "lib/index.js",
|
|
9
|
+
"types": "index.d.ts",
|
|
10
|
+
"typesVersions": {
|
|
11
|
+
"*": {
|
|
12
|
+
"*": [
|
|
13
|
+
"lib/*",
|
|
14
|
+
"lib/*/index.d.ts"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"exports": {
|
|
19
|
+
".": "./lib/index.js",
|
|
20
|
+
"./": "./lib/",
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
8
23
|
"files": [
|
|
9
|
-
"
|
|
10
|
-
"assets",
|
|
11
|
-
"styles",
|
|
12
|
-
"helpers",
|
|
13
|
-
"icons",
|
|
14
|
-
"index.d.ts",
|
|
15
|
-
"index.js"
|
|
24
|
+
"lib/**/*"
|
|
16
25
|
],
|
|
17
26
|
"dependencies": {
|
|
18
|
-
"@ledgerhq/icons-ui": "^0.2.3",
|
|
19
|
-
"@ledgerhq/ui-shared": "^0.1.
|
|
20
|
-
"@types/color": "^3.0.
|
|
21
|
-
"@types/react": "^17.0.
|
|
27
|
+
"@ledgerhq/icons-ui": "^0.2.4-monorepo.3",
|
|
28
|
+
"@ledgerhq/ui-shared": "^0.1.6-monorepo.3",
|
|
29
|
+
"@types/color": "^3.0.3",
|
|
30
|
+
"@types/react": "^17.0.39",
|
|
22
31
|
"@types/react-native": "^0.65.9",
|
|
23
32
|
"@types/styled-components-react-native": "^5.1.3",
|
|
24
33
|
"@types/styled-system": "^5.1.13",
|
|
@@ -31,9 +40,105 @@
|
|
|
31
40
|
},
|
|
32
41
|
"peerDependencies": {
|
|
33
42
|
"react": "^17.0.2",
|
|
34
|
-
"react-native": "
|
|
35
|
-
"react-native-reanimated": "^2.
|
|
43
|
+
"react-native": ">=0.64.0",
|
|
44
|
+
"react-native-reanimated": "^2.4.1",
|
|
36
45
|
"react-native-svg": "^12.1.1",
|
|
37
46
|
"styled-components": "^5.3.3"
|
|
38
|
-
}
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@babel/core": "^7.17.4",
|
|
50
|
+
"@babel/generator": "^7.17.2",
|
|
51
|
+
"@babel/plugin-proposal-export-namespace-from": "^7.16.0",
|
|
52
|
+
"@babel/preset-env": "^7.15.8",
|
|
53
|
+
"@babel/runtime": "^7.17.2",
|
|
54
|
+
"@emotion/core": "^11.0.0",
|
|
55
|
+
"@expo/webpack-config": "^0.16.18",
|
|
56
|
+
"@react-native-community/eslint-config": "^3.0.1",
|
|
57
|
+
"@storybook/addon-actions": "^6.4.19",
|
|
58
|
+
"@storybook/addon-backgrounds": "^6.4.19",
|
|
59
|
+
"@storybook/addon-controls": "^6.4.19",
|
|
60
|
+
"@storybook/addon-docs": "^6.4.19",
|
|
61
|
+
"@storybook/addon-essentials": "^6.4.19",
|
|
62
|
+
"@storybook/addon-knobs": "^6.4.0",
|
|
63
|
+
"@storybook/addon-links": "^6.4.19",
|
|
64
|
+
"@storybook/addon-measure": "^6.4.19",
|
|
65
|
+
"@storybook/addon-ondevice-actions": "^5.3.23",
|
|
66
|
+
"@storybook/addon-ondevice-knobs": "^5.3.25",
|
|
67
|
+
"@storybook/addon-outline": "^6.4.19",
|
|
68
|
+
"@storybook/addon-toolbars": "^6.4.19",
|
|
69
|
+
"@storybook/addon-viewport": "^6.4.19",
|
|
70
|
+
"@storybook/addons": "^6.4.19",
|
|
71
|
+
"@storybook/api": "^6.4.19",
|
|
72
|
+
"@storybook/components": "^6.4.19",
|
|
73
|
+
"@storybook/core-events": "^6.4.19",
|
|
74
|
+
"@storybook/react": "^6.4.19",
|
|
75
|
+
"@storybook/react-native": "^5.3.25",
|
|
76
|
+
"@storybook/theming": "^6.4.19",
|
|
77
|
+
"@svgr/core": "^5.5.0",
|
|
78
|
+
"@svgr/plugin-jsx": "^5.5.0",
|
|
79
|
+
"@svgr/plugin-svgo": "^5.5.0",
|
|
80
|
+
"@typescript-eslint/eslint-plugin": "^5.12.1",
|
|
81
|
+
"@typescript-eslint/parser": "^5.12.1",
|
|
82
|
+
"babel-loader": "^8.2.2",
|
|
83
|
+
"babel-plugin-module-resolver": "^4.1.0",
|
|
84
|
+
"babel-preset-expo": "^9.0.2",
|
|
85
|
+
"camelcase": "^6.2.1",
|
|
86
|
+
"eslint": "^8.10.0",
|
|
87
|
+
"eslint-config-prettier": "^8.3.0",
|
|
88
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
89
|
+
"eslint-plugin-react": "^7.29.2",
|
|
90
|
+
"eslint-plugin-react-hooks": "^4.3.0",
|
|
91
|
+
"expo": "~44.0.0",
|
|
92
|
+
"expo-asset": "~8.4.6",
|
|
93
|
+
"expo-cli": "^5",
|
|
94
|
+
"expo-constants": "~13.0.2",
|
|
95
|
+
"expo-file-system": "~13.1.3",
|
|
96
|
+
"expo-font": "^10.0.5",
|
|
97
|
+
"expo-modules-core": "0.6.5",
|
|
98
|
+
"expo-status-bar": "~1.2.0",
|
|
99
|
+
"fs-extra": "^10.0.1",
|
|
100
|
+
"glob": "^7.2.0",
|
|
101
|
+
"metro": "^0.67.0",
|
|
102
|
+
"metro-config": "^0.67.0",
|
|
103
|
+
"metro-extra-config": "1.0.1-monorepo.3",
|
|
104
|
+
"metro-minify-uglify": "^0.67.0",
|
|
105
|
+
"metro-react-native-babel-preset": "^0.67.0",
|
|
106
|
+
"metro-runtime": "^0.67.0",
|
|
107
|
+
"metro-transform-worker": "^0.67.0",
|
|
108
|
+
"prettier": "^2.4.1",
|
|
109
|
+
"react": "^17.0.2",
|
|
110
|
+
"react-dom": "^17.0.2",
|
|
111
|
+
"react-is": "^17.0.2",
|
|
112
|
+
"react-native": "0.64.3",
|
|
113
|
+
"react-native-gesture-handler": "^1.10.3",
|
|
114
|
+
"react-native-reanimated": "^2.4.1",
|
|
115
|
+
"react-native-svg": "^12.1.1",
|
|
116
|
+
"react-native-web": "~0.17.5",
|
|
117
|
+
"regenerator-runtime": "^0.13.9",
|
|
118
|
+
"rimraf": "^3.0.2",
|
|
119
|
+
"styled-components": "^5.3.3",
|
|
120
|
+
"typescript": "^4.4.4",
|
|
121
|
+
"victory": "^35.5.5",
|
|
122
|
+
"webpack": "^4.46.0"
|
|
123
|
+
},
|
|
124
|
+
"scripts": {
|
|
125
|
+
"android": "expo start --android",
|
|
126
|
+
"build": "tsc -p tsconfig.prod.json && node scripts/postBuild",
|
|
127
|
+
"build:storybook": "build-storybook -o web-build",
|
|
128
|
+
"build:icons": "node -e \"process.env['VERCEL_BUILD'] ? process.exit(1) : process.exit(0)\" || (cd ../icons && npm run build)",
|
|
129
|
+
"build:web": "npm run build:icons && npm run build:storybook",
|
|
130
|
+
"watch": "tsc --watch",
|
|
131
|
+
"clean": "rimraf lib",
|
|
132
|
+
"eject": "expo eject",
|
|
133
|
+
"ios": "expo start --ios",
|
|
134
|
+
"lint": "eslint src storybook --ext .ts,.tsx,.js,.jsx --cache",
|
|
135
|
+
"lint:fix": "eslint src storybook --ext .ts,.tsx,.js,.jsx --fix --cache",
|
|
136
|
+
"release": "yarn publish ./lib --access public",
|
|
137
|
+
"expo": "expo start",
|
|
138
|
+
"storybook": "start-storybook -p 6006",
|
|
139
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
140
|
+
"test": "exit 0",
|
|
141
|
+
"web": "expo start --web"
|
|
142
|
+
},
|
|
143
|
+
"readme": "# `@ledgerhq/native-ui`\n\n[](https://github.com/LedgerHQ/ui/actions/workflows/native.yml)\n[](https://www.npmjs.com/package/@ledgerhq/native-ui)\n[](https://ledger-live-ui-native.vercel.app)\n\n### Design and interface resources for React Native\n\n#### This package contains [React Native](https://reactnative.dev/) components and styles built on top of our design system and used internally at [Ledger](https://www.ledger.com/).\n\n## Reference\n\n**[🔗 Storybook](https://ledger-live-ui-native.vercel.app/)**\n\n## Installation\n\n### Package\n\n```sh\nnpm i @ledgerhq/native-ui\n```\n\n### Peer dependencies\n\n_This library uses the following packages under the hood and relies on them being installed separately to avoid package duplication._\n\n```sh\nnpm i styled-components react-native-reanimated react-native-svg\n```\n\n### Additional setup\n\n**Skip this step if your project is managed by Expo.**\n\nFollow the installation instructions for:\n\n- [react-native-reanimated](https://docs.swmansion.com/react-native-reanimated/docs/2.2.0/installation)\n- [react-native-svg](https://github.com/react-native-svg/react-native-svg#installation)\n\n## Usage\n\n### Provider\n\nBefore using the library components, the style provider must be imported and rendered once to provide the components with the right context.\n\n```tsx\nimport { StyleProvider } from \"@ledgerhq/native-ui\";\n\nfunction Root({ children }) {\n // Selected theme palette can be either \"dark\" or \"light\".\n return <StyleProvider selectedPalette=\"light\">{children}</StyleProvider>;\n}\n```\n\n### Components\n\nImport the components from `@ledgerhq/native-ui`.\n\n```tsx\nimport { Flex, Text } from \"@ledgerhq/native-ui\";\n\nfunction Hello() {\n return (\n <Flex flexDirection=\"column\" alignItems=\"center\">\n <Text variant=\"h1\" color=\"neutral.c100\">\n Hello, world!\n </Text>\n </Flex>\n );\n}\n```\n\n### Fonts\n\n#### Using [Expo](https://expo.dev/)\n\n```sh\nexpo install expo-font\n```\n\n```js\nimport { useFonts } from \"expo-font\";\n\n/*\n A higher-order component that will load and provide Ledger fonts to your app.\n*/\nfunction FontProvider({ children }) {\n const [fontsLoaded] = useFonts({\n \"HMAlphaMono-Medium\": require(\"@ledgerhq/native-ui/lib/assets/fonts/alpha/HMAlphaMono-Medium.otf\"),\n \"Inter-Medium\": require(\"@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-Medium.otf\"),\n \"Inter-SemiBold\": require(\"@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-SemiBold.otf\"),\n \"Inter-Bold\": require(\"@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-Bold.otf\"),\n });\n\n if (!fontsLoaded) {\n return null;\n }\n\n return children;\n}\n```\n\n#### React Native - Bare\n\nAdd the paths in the `react-native.config.js` file:\n\n```js\nmodule.exports = {\n assets: [\n \"node_modules/@ledgerhq/native-ui/lib/assets/fonts/alpha\",\n \"node_modules/@ledgerhq/native-ui/lib/assets/fonts/inter\",\n ],\n};\n```\n\nThen run the following command to add the required native code:\n\n```\nnpx react-native link\n```\n\n## Minimal Working Example\n\n[🌍 Hosted here.](https://snack.expo.dev/PG3RFRIAP)\n\n### Expo\n\n```js\nimport React from \"react\";\nimport { StyleProvider, Flex, Switch, Text, Logos } from \"@ledgerhq/native-ui\";\nimport { useTheme } from \"styled-components/native\";\nimport { useFonts } from \"expo-font\";\n\nfunction Logo() {\n const theme = useTheme();\n return <Logos.LedgerLiveRegular color={theme.colors.neutral.c100} />;\n}\n\nfunction FontProvider({ children }) {\n const [fontsLoaded] = useFonts({\n \"HMAlphaMono-Medium\": require(\"@ledgerhq/native-ui/lib/assets/fonts/alpha/HMAlphaMono-Medium.otf\"),\n \"Inter-Medium\": require(\"@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-Medium.otf\"),\n \"Inter-SemiBold\": require(\"@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-SemiBold.otf\"),\n \"Inter-Bold\": require(\"@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-Bold.otf\"),\n });\n\n if (!fontsLoaded) {\n return null;\n }\n\n return children;\n}\n\nexport default function App() {\n const [palette, setPalette] = React.useState(\"light\");\n const isLight = palette === \"light\";\n\n return (\n <FontProvider>\n <StyleProvider selectedPalette={palette}>\n <Flex\n flex={1}\n justifyContent=\"center\"\n alignItems=\"center\"\n flexDirection=\"column\"\n backgroundColor=\"neutral.c00\"\n >\n <Logo />\n <Text variant=\"h2\" color=\"neutral.c100\" my={10}>\n Hello, world!\n </Text>\n <Switch\n checked={isLight}\n onChange={() => setPalette(() => (isLight ? \"dark\" : \"light\"))}\n />\n </Flex>\n </StyleProvider>\n </FontProvider>\n );\n}\n```\n\n### React Native - Bare\n\n```js\nimport React from \"react\";\nimport { StyleProvider } from \"@ledgerhq/native-ui/styles\";\nimport { Flex, Text, Logos, Switch } from \"@ledgerhq/native-ui\";\nimport { useTheme } from \"styled-components/native\";\n\nfunction Logo() {\n const theme = useTheme();\n return <Logos.LedgerLiveRegular color={theme.colors.neutral.c100} />;\n}\n\nexport default function App() {\n const [palette, setPalette] = React.useState(\"light\");\n const isLight = palette === \"light\";\n\n return (\n <StyleProvider selectedPalette={palette}>\n <Flex\n flex={1}\n p={12}\n justifyContent=\"center\"\n alignItems=\"center\"\n flexDirection=\"column\"\n backgroundColor=\"neutral.c00\"\n >\n <Logo />\n <Text variant=\"h2\" color=\"neutral.c100\" my={10}>\n Hello, world!\n </Text>\n <Switch checked={isLight} onChange={() => setPalette(() => (isLight ? \"dark\" : \"light\"))} />\n </Flex>\n </StyleProvider>\n );\n}\n```\n"
|
|
39
144
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
declare type Props = {
|
|
3
|
-
progress?: number;
|
|
4
|
-
infinite: boolean;
|
|
5
|
-
onPress?: () => void;
|
|
6
|
-
mainColor: string;
|
|
7
|
-
secondaryColor: string;
|
|
8
|
-
radius: number;
|
|
9
|
-
strokeWidth: number;
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
};
|
|
12
|
-
declare const ProgressLoader: ({ progress, infinite, mainColor, secondaryColor, onPress, radius, strokeWidth, children, }: Props) => React.ReactElement;
|
|
13
|
-
export default ProgressLoader;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
declare type AlertType = "info" | "warning" | "error";
|
|
3
|
-
export interface AlertProps {
|
|
4
|
-
type?: AlertType;
|
|
5
|
-
title?: string;
|
|
6
|
-
showIcon?: boolean;
|
|
7
|
-
children?: React.ReactNode;
|
|
8
|
-
}
|
|
9
|
-
export default function Alert({ type, title, showIcon, children, }: AlertProps): JSX.Element;
|
|
10
|
-
export {};
|