@ledgerhq/native-ui 0.7.17-nightly.0 → 0.7.17
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 +16 -13
- package/{lib/assets → assets}/fonts/alpha/HMAlphaMono-Medium.otf +0 -0
- package/{lib/assets → assets}/fonts/inter/Inter-Bold.otf +0 -0
- package/{lib/assets → assets}/fonts/inter/Inter-Medium.otf +0 -0
- package/{lib/assets → assets}/fonts/inter/Inter-SemiBold.otf +0 -0
- package/{lib/assets → assets}/icons.d.ts +0 -0
- package/{lib/assets → assets}/icons.js +0 -0
- package/{lib/assets → assets}/index.d.ts +0 -0
- package/{lib/assets → assets}/index.js +0 -0
- package/{lib/assets → assets}/logos/LedgerLiveAltRegular.d.ts +0 -0
- package/{lib/assets → assets}/logos/LedgerLiveAltRegular.js +0 -0
- package/{lib/assets → assets}/logos/LedgerLiveRegular.d.ts +0 -0
- package/{lib/assets → assets}/logos/LedgerLiveRegular.js +0 -0
- package/{lib/assets → assets}/logos/index.d.ts +0 -0
- package/{lib/assets → assets}/logos/index.js +0 -0
- package/{lib/components → components}/Carousel/index.d.ts +0 -0
- package/{lib/components → components}/Carousel/index.js +0 -0
- package/{lib/components → components}/ChartCard/index.d.ts +0 -0
- package/{lib/components → components}/ChartCard/index.js +0 -0
- package/{lib/components → components}/Form/Checkbox/index.d.ts +0 -0
- package/{lib/components → components}/Form/Checkbox/index.js +0 -0
- package/{lib/components → components}/Form/Input/BaseInput/index.d.ts +2 -2
- package/{lib/components → components}/Form/Input/BaseInput/index.js +0 -0
- package/{lib/components → components}/Form/Input/LegendInput/index.d.ts +0 -0
- package/{lib/components → components}/Form/Input/LegendInput/index.js +0 -0
- package/{lib/components → components}/Form/Input/NumberInput/index.d.ts +0 -0
- package/{lib/components → components}/Form/Input/NumberInput/index.js +0 -0
- package/{lib/components → components}/Form/Input/QrCodeInput/index.d.ts +0 -0
- package/{lib/components → components}/Form/Input/QrCodeInput/index.js +0 -0
- package/{lib/components → components}/Form/Input/SearchInput/index.d.ts +0 -0
- package/{lib/components → components}/Form/Input/SearchInput/index.js +0 -0
- package/{lib/components → components}/Form/Input/index.d.ts +0 -0
- package/{lib/components → components}/Form/Input/index.js +0 -0
- package/{lib/components → components}/Form/SelectableList.d.ts +0 -0
- package/{lib/components → components}/Form/SelectableList.js +0 -0
- package/{lib/components → components}/Form/Slider/components.d.ts +0 -0
- package/{lib/components → components}/Form/Slider/components.js +0 -0
- package/{lib/components → components}/Form/Slider/index.d.ts +0 -0
- package/{lib/components → components}/Form/Slider/index.js +0 -0
- package/{lib/components → components}/Form/Slider/index.native.d.ts +0 -0
- package/{lib/components → components}/Form/Slider/index.native.js +0 -0
- package/{lib/components → components}/Form/Switch/index.d.ts +0 -0
- package/{lib/components → components}/Form/Switch/index.js +0 -0
- package/{lib/components → components}/Form/Toggle/index.d.ts +0 -0
- package/{lib/components → components}/Form/Toggle/index.js +0 -0
- package/{lib/components → components}/Form/index.d.ts +0 -0
- package/{lib/components → components}/Form/index.js +0 -0
- package/{lib/components → components}/Icon/BoxedIcon.d.ts +0 -0
- package/{lib/components → components}/Icon/BoxedIcon.js +0 -0
- package/{lib/components → components}/Icon/Icon.d.ts +0 -0
- package/{lib/components → components}/Icon/Icon.js +0 -0
- package/{lib/components → components}/Icon/IconBox/index.d.ts +0 -0
- package/{lib/components → components}/Icon/IconBox/index.js +0 -0
- package/{lib/components → components}/Icon/index.d.ts +0 -0
- package/{lib/components → components}/Icon/index.js +0 -0
- package/{lib/components → components}/Icon/type.d.ts +0 -0
- package/{lib/components → components}/Icon/type.js +0 -0
- package/{lib/components → components}/Layout/Box/index.d.ts +0 -0
- package/{lib/components → components}/Layout/Box/index.js +0 -0
- package/{lib/components → components}/Layout/Collapse/Accordion/index.d.ts +0 -0
- package/{lib/components → components}/Layout/Collapse/Accordion/index.js +0 -0
- package/{lib/components → components}/Layout/Flex/index.d.ts +0 -0
- package/{lib/components → components}/Layout/Flex/index.js +0 -0
- package/{lib/components → components}/Layout/List/IconBoxList/index.d.ts +0 -0
- package/{lib/components → components}/Layout/List/IconBoxList/index.js +0 -0
- package/{lib/components → components}/Layout/List/List/index.d.ts +0 -0
- package/{lib/components → components}/Layout/List/List/index.js +0 -0
- package/{lib/components → components}/Layout/List/NumberedList/index.d.ts +0 -0
- package/{lib/components → components}/Layout/List/NumberedList/index.js +0 -0
- package/{lib/components → components}/Layout/List/TipList/index.d.ts +0 -0
- package/{lib/components → components}/Layout/List/TipList/index.js +0 -0
- package/{lib/components → components}/Layout/List/index.d.ts +0 -0
- package/{lib/components → components}/Layout/List/index.js +0 -0
- package/{lib/components → components}/Layout/Modals/BaseModal/index.d.ts +2 -1
- package/{lib/components → components}/Layout/Modals/BaseModal/index.js +7 -7
- package/{lib/components → components}/Layout/Modals/BottomDrawer/index.d.ts +0 -0
- package/{lib/components → components}/Layout/Modals/BottomDrawer/index.js +7 -1
- package/{lib/components → components}/Layout/Modals/Popin/index.d.ts +0 -0
- package/{lib/components → components}/Layout/Modals/Popin/index.js +0 -0
- package/{lib/components → components}/Layout/Modals/Tooltip/index.d.ts +0 -0
- package/{lib/components → components}/Layout/Modals/Tooltip/index.js +0 -0
- package/{lib/components → components}/Layout/Modals/index.d.ts +0 -0
- package/{lib/components → components}/Layout/Modals/index.js +0 -0
- package/{lib/components → components}/Layout/ScrollContainer/index.d.ts +0 -0
- package/{lib/components → components}/Layout/ScrollContainer/index.js +0 -0
- package/{lib/components → components}/Layout/ScrollContainerHeader/Header.d.ts +0 -0
- package/{lib/components → components}/Layout/ScrollContainerHeader/Header.js +0 -0
- package/{lib/components → components}/Layout/ScrollContainerHeader/index.d.ts +0 -0
- package/{lib/components → components}/Layout/ScrollContainerHeader/index.js +0 -0
- package/{lib/components → components}/Layout/ScrollListContainer/index.d.ts +0 -0
- package/{lib/components → components}/Layout/ScrollListContainer/index.js +0 -0
- package/{lib/components → components}/Layout/Table/Row.d.ts +0 -0
- package/{lib/components → components}/Layout/Table/Row.js +0 -0
- package/{lib/components → components}/Layout/index.d.ts +0 -0
- package/{lib/components → components}/Layout/index.js +0 -0
- package/{lib/components → components}/Layout/types.d.ts +0 -0
- package/{lib/components → components}/Layout/types.js +0 -0
- package/{lib/components → components}/Loader/InfiniteLoader/index.d.ts +0 -0
- package/{lib/components → components}/Loader/InfiniteLoader/index.js +0 -0
- package/{lib/components → components}/Loader/ProgressLoader/index.d.ts +0 -0
- package/{lib/components → components}/Loader/ProgressLoader/index.js +0 -0
- package/{lib/components → components}/Loader/index.d.ts +0 -0
- package/{lib/components → components}/Loader/index.js +0 -0
- package/{lib/components → components}/Navigation/FlowStepper/index.d.ts +0 -0
- package/{lib/components → components}/Navigation/FlowStepper/index.js +0 -0
- package/{lib/components → components}/Navigation/SlideIndicator/index.d.ts +0 -0
- package/{lib/components → components}/Navigation/SlideIndicator/index.js +0 -0
- package/{lib/components → components}/Navigation/Stepper/index.d.ts +0 -0
- package/{lib/components → components}/Navigation/Stepper/index.js +0 -0
- package/{lib/components → components}/Navigation/index.d.ts +0 -0
- package/{lib/components → components}/Navigation/index.js +0 -0
- package/{lib/components → components}/ProgressBar/index.d.ts +0 -0
- package/{lib/components → components}/ProgressBar/index.js +0 -0
- package/{lib/components → components}/Tabs/Chip/index.d.ts +0 -0
- package/{lib/components → components}/Tabs/Chip/index.js +0 -0
- package/{lib/components → components}/Tabs/Graph/index.d.ts +0 -0
- package/{lib/components → components}/Tabs/Graph/index.js +0 -0
- package/{lib/components → components}/Tabs/TemplateTabs/index.d.ts +0 -0
- package/{lib/components → components}/Tabs/TemplateTabs/index.js +0 -0
- package/{lib/components → components}/Tabs/index.d.ts +0 -0
- package/{lib/components → components}/Tabs/index.js +0 -0
- package/{lib/components → components}/Text/getTextStyle.d.ts +0 -0
- package/{lib/components → components}/Text/getTextStyle.js +0 -0
- package/{lib/components → components}/Text/index.d.ts +0 -0
- package/{lib/components → components}/Text/index.js +0 -0
- package/{lib/components → components}/chart/index.d.ts +0 -0
- package/{lib/components → components}/chart/index.js +2 -8
- package/{lib/components → components}/chart/types.d.ts +0 -0
- package/{lib/components → components}/chart/types.js +0 -0
- package/{lib/components → components}/cta/Button/getButtonStyle.d.ts +2 -0
- package/{lib/components → components}/cta/Button/getButtonStyle.js +12 -10
- package/{lib/components → components}/cta/Button/index.d.ts +3 -3
- package/{lib/components → components}/cta/Button/index.js +11 -9
- package/{lib/components → components}/cta/Link/getLinkStyle.d.ts +0 -0
- package/{lib/components → components}/cta/Link/getLinkStyle.js +0 -0
- package/{lib/components → components}/cta/Link/index.d.ts +0 -0
- package/{lib/components → components}/cta/Link/index.js +0 -0
- package/{lib/components → components}/cta/getCtaStyle.d.ts +0 -0
- package/{lib/components → components}/cta/getCtaStyle.js +0 -0
- package/{lib/components → components}/cta/index.d.ts +0 -0
- package/{lib/components → components}/cta/index.js +0 -0
- package/{lib/components → components}/index.d.ts +0 -0
- package/{lib/components → components}/index.js +0 -0
- package/{lib/components → components}/message/Alert/index.d.ts +0 -0
- package/{lib/components → components}/message/Alert/index.js +0 -0
- package/{lib/components → components}/message/Log/Brackets.d.ts +0 -0
- package/{lib/components → components}/message/Log/Brackets.js +0 -0
- package/{lib/components → components}/message/Log/index.d.ts +0 -0
- package/{lib/components → components}/message/Log/index.js +0 -0
- package/{lib/components → components}/message/Notification/index.d.ts +0 -0
- package/{lib/components → components}/message/Notification/index.js +0 -0
- package/{lib/components → components}/message/index.d.ts +0 -0
- package/{lib/components → components}/message/index.js +0 -0
- package/{lib/components → components}/styled.d.ts +0 -0
- package/{lib/components → components}/styled.js +1 -4
- package/{lib/components → components}/tags/Badge/index.d.ts +0 -0
- package/{lib/components → components}/tags/Badge/index.js +0 -0
- package/{lib/components → components}/tags/Tag/index.d.ts +0 -0
- package/{lib/components → components}/tags/Tag/index.js +0 -0
- package/{lib/components → components}/tags/index.d.ts +0 -0
- package/{lib/components → components}/tags/index.js +0 -0
- package/{lib/components → components}/transitions/Fade.d.ts +0 -0
- package/{lib/components → components}/transitions/Fade.js +0 -0
- package/{lib/components → components}/transitions/Slide.d.ts +0 -0
- package/{lib/components → components}/transitions/Slide.js +0 -0
- package/{lib/components → components}/transitions/Transition.d.ts +0 -0
- package/{lib/components → components}/transitions/Transition.js +0 -0
- package/{lib/components → components}/transitions/index.d.ts +0 -0
- package/{lib/components → components}/transitions/index.js +0 -0
- package/{lib/components → components}/transitions/types.d.ts +0 -0
- package/{lib/components → components}/transitions/types.js +0 -0
- package/{lib/helpers → helpers}/getDeviceSize.d.ts +0 -0
- package/{lib/helpers → helpers}/getDeviceSize.js +0 -0
- package/{lib/icons → icons}/BracketLeft.d.ts +0 -0
- package/{lib/icons → icons}/BracketLeft.js +0 -0
- package/{lib/icons → icons}/BracketRight.d.ts +0 -0
- package/{lib/icons → icons}/BracketRight.js +0 -0
- package/{lib/icons → icons}/Close.d.ts +0 -0
- package/{lib/icons → icons}/Close.js +0 -0
- package/{lib/icons → icons}/Info.d.ts +0 -0
- package/{lib/icons → icons}/Info.js +0 -0
- package/{lib/index.d.ts → index.d.ts} +0 -0
- package/{lib/index.js → index.js} +0 -0
- package/package.json +15 -127
- /package/{lib/styles → styles}/InvertTheme.d.ts +0 -0
- /package/{lib/styles → styles}/InvertTheme.js +0 -0
- /package/{lib/styles → styles}/StyleProvider.d.ts +0 -0
- /package/{lib/styles → styles}/StyleProvider.js +0 -0
- /package/{lib/styles → styles}/helpers.d.ts +0 -0
- /package/{lib/styles → styles}/helpers.js +0 -0
- /package/{lib/styles → styles}/index.d.ts +0 -0
- /package/{lib/styles → styles}/index.js +0 -0
- /package/{lib/styles → styles}/theme.d.ts +0 -0
- /package/{lib/styles → styles}/theme.js +0 -0
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# `@ledgerhq/native-ui`
|
|
2
2
|
|
|
3
|
+
[](https://github.com/LedgerHQ/ui/actions/workflows/native.yml)
|
|
3
4
|
[](https://www.npmjs.com/package/@ledgerhq/native-ui)
|
|
4
|
-
[](https://
|
|
5
|
+
[](https://ledger-live-ui-native.vercel.app)
|
|
5
6
|
|
|
6
7
|
### Design and interface resources for React Native
|
|
7
8
|
|
|
@@ -9,7 +10,7 @@
|
|
|
9
10
|
|
|
10
11
|
## Reference
|
|
11
12
|
|
|
12
|
-
**[🔗 Storybook](https://
|
|
13
|
+
**[🔗 Storybook](https://ledger-live-ui-native.vercel.app/)**
|
|
13
14
|
|
|
14
15
|
## Installation
|
|
15
16
|
|
|
@@ -29,6 +30,8 @@ npm i styled-components react-native-reanimated react-native-svg
|
|
|
29
30
|
|
|
30
31
|
### Additional setup
|
|
31
32
|
|
|
33
|
+
**Skip this step if your project is managed by Expo.**
|
|
34
|
+
|
|
32
35
|
Follow the installation instructions for:
|
|
33
36
|
|
|
34
37
|
- [react-native-reanimated](https://docs.swmansion.com/react-native-reanimated/docs/2.2.0/installation)
|
|
@@ -83,10 +86,10 @@ import { useFonts } from "expo-font";
|
|
|
83
86
|
*/
|
|
84
87
|
function FontProvider({ children }) {
|
|
85
88
|
const [fontsLoaded] = useFonts({
|
|
86
|
-
"HMAlphaMono-Medium": require("@ledgerhq/native-ui/
|
|
87
|
-
"Inter-Medium": require("@ledgerhq/native-ui/
|
|
88
|
-
"Inter-SemiBold": require("@ledgerhq/native-ui/
|
|
89
|
-
"Inter-Bold": require("@ledgerhq/native-ui/
|
|
89
|
+
"HMAlphaMono-Medium": require("@ledgerhq/native-ui/assets/fonts/alpha/HMAlphaMono-Medium.otf"),
|
|
90
|
+
"Inter-Medium": require("@ledgerhq/native-ui/assets/fonts/inter/Inter-Medium.otf"),
|
|
91
|
+
"Inter-SemiBold": require("@ledgerhq/native-ui/assets/fonts/inter/Inter-SemiBold.otf"),
|
|
92
|
+
"Inter-Bold": require("@ledgerhq/native-ui/assets/fonts/inter/Inter-Bold.otf"),
|
|
90
93
|
});
|
|
91
94
|
|
|
92
95
|
if (!fontsLoaded) {
|
|
@@ -104,8 +107,8 @@ Add the paths in the `react-native.config.js` file:
|
|
|
104
107
|
```js
|
|
105
108
|
module.exports = {
|
|
106
109
|
assets: [
|
|
107
|
-
"node_modules/@ledgerhq/native-ui/
|
|
108
|
-
"node_modules/@ledgerhq/native-ui/
|
|
110
|
+
"node_modules/@ledgerhq/native-ui/assets/fonts/alpha",
|
|
111
|
+
"node_modules/@ledgerhq/native-ui/assets/fonts/inter",
|
|
109
112
|
],
|
|
110
113
|
};
|
|
111
114
|
```
|
|
@@ -135,10 +138,10 @@ function Logo() {
|
|
|
135
138
|
|
|
136
139
|
function FontProvider({ children }) {
|
|
137
140
|
const [fontsLoaded] = useFonts({
|
|
138
|
-
"HMAlphaMono-Medium": require("@ledgerhq/native-ui/
|
|
139
|
-
"Inter-Medium": require("@ledgerhq/native-ui/
|
|
140
|
-
"Inter-SemiBold": require("@ledgerhq/native-ui/
|
|
141
|
-
"Inter-Bold": require("@ledgerhq/native-ui/
|
|
141
|
+
"HMAlphaMono-Medium": require("@ledgerhq/native-ui/assets/fonts/alpha/HMAlphaMono-Medium.otf"),
|
|
142
|
+
"Inter-Medium": require("@ledgerhq/native-ui/assets/fonts/inter/Inter-Medium.otf"),
|
|
143
|
+
"Inter-SemiBold": require("@ledgerhq/native-ui/assets/fonts/inter/Inter-SemiBold.otf"),
|
|
144
|
+
"Inter-Bold": require("@ledgerhq/native-ui/assets/fonts/inter/Inter-Bold.otf"),
|
|
142
145
|
});
|
|
143
146
|
|
|
144
147
|
if (!fontsLoaded) {
|
|
@@ -181,7 +184,7 @@ export default function App() {
|
|
|
181
184
|
|
|
182
185
|
```js
|
|
183
186
|
import React from "react";
|
|
184
|
-
import { StyleProvider } from "@ledgerhq/native-ui";
|
|
187
|
+
import { StyleProvider } from "@ledgerhq/native-ui/styles";
|
|
185
188
|
import { Flex, Text, Logos, Switch } from "@ledgerhq/native-ui";
|
|
186
189
|
import { useTheme } from "styled-components/native";
|
|
187
190
|
|
|
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
|
|
@@ -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
|
+
}, "pl" | "alignItems" | "flexDirection">;
|
|
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
|
+
}, "pr" | "alignItems" | "flexDirection">;
|
|
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
|
/**
|
|
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
|
|
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
|
|
@@ -6,6 +6,7 @@ export declare type BaseModalProps = {
|
|
|
6
6
|
isOpen?: boolean;
|
|
7
7
|
onClose?: () => void;
|
|
8
8
|
modalStyle?: StyleProp<ViewStyle>;
|
|
9
|
+
safeContainerStyle?: StyleProp<ViewStyle>;
|
|
9
10
|
containerStyle?: StyleProp<ViewStyle>;
|
|
10
11
|
preventBackdropClick?: boolean;
|
|
11
12
|
Icon?: IconOrElementType;
|
|
@@ -17,4 +18,4 @@ export declare type BaseModalProps = {
|
|
|
17
18
|
noCloseButton?: boolean;
|
|
18
19
|
} & Partial<ModalProps>;
|
|
19
20
|
export declare function ModalHeader({ Icon, iconColor, title, description, subtitle, }: Pick<BaseModalProps, "Icon" | "iconColor" | "title" | "description" | "subtitle">): React.ReactElement | null;
|
|
20
|
-
export default function BaseModal({ isOpen, onClose, noCloseButton, containerStyle, modalStyle, preventBackdropClick, Icon, iconColor, title, description, subtitle, children, ...rest }: BaseModalProps): React.ReactElement;
|
|
21
|
+
export default function BaseModal({ isOpen, onClose, noCloseButton, safeContainerStyle, containerStyle, modalStyle, preventBackdropClick, Icon, iconColor, title, description, subtitle, children, ...rest }: BaseModalProps): React.ReactElement;
|
|
@@ -13,12 +13,11 @@ import React from "react";
|
|
|
13
13
|
import ReactNativeModal from "react-native-modal";
|
|
14
14
|
import styled from "styled-components/native";
|
|
15
15
|
import sizes from "../../../../helpers/getDeviceSize";
|
|
16
|
-
import Link from "../../../cta/Link";
|
|
17
|
-
import CloseMedium from "@ledgerhq/icons-ui/native/CloseMedium";
|
|
18
16
|
import Text from "../../../Text";
|
|
19
17
|
import { BoxedIcon } from "../../../Icon";
|
|
20
18
|
import { Flex } from "../../index";
|
|
21
19
|
import { space } from "styled-system";
|
|
20
|
+
import { Icons } from "../../../../assets";
|
|
22
21
|
const { width, height } = sizes;
|
|
23
22
|
const SafeContainer = styled.SafeAreaView `
|
|
24
23
|
background-color: ${(p) => p.theme.colors.background.main};
|
|
@@ -39,10 +38,11 @@ const CloseContainer = styled.View `
|
|
|
39
38
|
margin-bottom: ${(p) => p.theme.space[7]}px;
|
|
40
39
|
`;
|
|
41
40
|
const ClosePressableExtendedBounds = styled.TouchableOpacity.attrs({
|
|
42
|
-
p:
|
|
43
|
-
m: -5,
|
|
41
|
+
p: 3,
|
|
44
42
|
}) `
|
|
45
43
|
${space};
|
|
44
|
+
border-radius: 100px;
|
|
45
|
+
background-color: ${(p) => p.theme.colors.neutral.c30};
|
|
46
46
|
`;
|
|
47
47
|
const StyledTitle = styled(Text).attrs({ variant: "h2" }) `
|
|
48
48
|
text-transform: uppercase;
|
|
@@ -69,7 +69,7 @@ export function ModalHeader({ Icon, iconColor, title, description, subtitle, })
|
|
|
69
69
|
description && (React.createElement(Text, { variant: "body", color: "neutral.c70", textAlign: "center", mt: 6 }, description))));
|
|
70
70
|
}
|
|
71
71
|
export default function BaseModal(_a) {
|
|
72
|
-
var { isOpen, onClose = () => { }, noCloseButton, containerStyle = {}, modalStyle = {}, preventBackdropClick, Icon, iconColor, title, description, subtitle, children } = _a, rest = __rest(_a, ["isOpen", "onClose", "noCloseButton", "containerStyle", "modalStyle", "preventBackdropClick", "Icon", "iconColor", "title", "description", "subtitle", "children"]);
|
|
72
|
+
var { isOpen, onClose = () => { }, noCloseButton, safeContainerStyle = {}, containerStyle = {}, modalStyle = {}, preventBackdropClick, Icon, iconColor, title, description, subtitle, children } = _a, rest = __rest(_a, ["isOpen", "onClose", "noCloseButton", "safeContainerStyle", "containerStyle", "modalStyle", "preventBackdropClick", "Icon", "iconColor", "title", "description", "subtitle", "children"]);
|
|
73
73
|
const backDropProps = preventBackdropClick
|
|
74
74
|
? {}
|
|
75
75
|
: {
|
|
@@ -78,11 +78,11 @@ export default function BaseModal(_a) {
|
|
|
78
78
|
onSwipeComplete: onClose,
|
|
79
79
|
};
|
|
80
80
|
return (React.createElement(ReactNativeModal, Object.assign({}, rest, backDropProps, { isVisible: isOpen, deviceWidth: width, deviceHeight: height, useNativeDriver: true, useNativeDriverForBackdrop: true, hideModalContentWhileAnimating: true, onModalHide: onClose, style: [defaultModalStyle, modalStyle] }),
|
|
81
|
-
React.createElement(SafeContainer,
|
|
81
|
+
React.createElement(SafeContainer, { style: safeContainerStyle },
|
|
82
82
|
React.createElement(Container, { style: containerStyle },
|
|
83
83
|
!noCloseButton && (React.createElement(CloseContainer, null,
|
|
84
84
|
React.createElement(ClosePressableExtendedBounds, { onPress: onClose },
|
|
85
|
-
React.createElement(
|
|
85
|
+
React.createElement(Icons.CloseMedium, { color: "neutral.c100", size: "20px" })))),
|
|
86
86
|
React.createElement(ModalHeader, { Icon: Icon, iconColor: iconColor, title: title, description: description, subtitle: subtitle }),
|
|
87
87
|
React.createElement(ContentContainer, null, children)))));
|
|
88
88
|
}
|
|
File without changes
|
|
@@ -18,6 +18,10 @@ const modalStyleOverrides = StyleSheet.create({
|
|
|
18
18
|
justifyContent: "flex-end",
|
|
19
19
|
margin: 0,
|
|
20
20
|
},
|
|
21
|
+
safeContainer: {
|
|
22
|
+
borderTopLeftRadius: 24,
|
|
23
|
+
borderTopRightRadius: 24,
|
|
24
|
+
},
|
|
21
25
|
container: {
|
|
22
26
|
minHeight: 0,
|
|
23
27
|
paddingLeft: 24,
|
|
@@ -25,9 +29,11 @@ const modalStyleOverrides = StyleSheet.create({
|
|
|
25
29
|
paddingTop: 24,
|
|
26
30
|
paddingBottom: 24,
|
|
27
31
|
maxHeight: "100%",
|
|
32
|
+
borderTopLeftRadius: 24,
|
|
33
|
+
borderTopRightRadius: 24,
|
|
28
34
|
},
|
|
29
35
|
});
|
|
30
36
|
export default function BottomDrawer(_a) {
|
|
31
37
|
var { children } = _a, restProps = __rest(_a, ["children"]);
|
|
32
|
-
return (React.createElement(BaseModal, Object.assign({}, restProps, { modalStyle: modalStyleOverrides.modal, containerStyle: modalStyleOverrides.container, propagateSwipe: true }), children));
|
|
38
|
+
return (React.createElement(BaseModal, Object.assign({}, restProps, { modalStyle: modalStyleOverrides.modal, safeContainerStyle: modalStyleOverrides.safeContainer, containerStyle: modalStyleOverrides.container, propagateSwipe: true }), children));
|
|
33
39
|
}
|
|
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
|
|
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
|
|
@@ -11,9 +11,7 @@ const sortByDate = (a, b) => {
|
|
|
11
11
|
return 1;
|
|
12
12
|
return 0;
|
|
13
13
|
};
|
|
14
|
-
const Chart = ({ data, backgroundColor, color, yAxisFormatter, valueFormatter, valueKey = "value", height = 200,
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
-
xAxisFormatter = (timestamp) => `${new Date(timestamp).toLocaleDateString()}`, disableTooltips = false, }) => {
|
|
14
|
+
const Chart = ({ data, backgroundColor, color, yAxisFormatter, valueFormatter, valueKey = "value", height = 200, xAxisFormatter = (timestamp) => `${new Date(timestamp).toLocaleDateString()}`, disableTooltips = false, }) => {
|
|
17
15
|
const theme = useTheme();
|
|
18
16
|
const sortData = useMemo(() => data.sort(sortByDate), [data]);
|
|
19
17
|
const labelFormatted = useCallback(({ datum }) => {
|
|
@@ -52,11 +50,7 @@ xAxisFormatter = (timestamp) => `${new Date(timestamp).toLocaleDateString()}`, d
|
|
|
52
50
|
grid: { display: "none" },
|
|
53
51
|
}), [theme]);
|
|
54
52
|
return (React.createElement(Flex, { justifyContent: "center", alignItems: "center" },
|
|
55
|
-
React.createElement(VictoryChart, { scale: { x: "time" }, height: height, domainPadding: { y: 5 }, padding: { top: 30, left: 60, right: 35, bottom: 35 }, maxDomain: { y: domainValues.max }, minDomain: { y: domainValues.min }, containerComponent: React.createElement(VictoryVoronoiContainer
|
|
56
|
-
// @ts-expect-error disable this error for the sake of the monorepo
|
|
57
|
-
, {
|
|
58
|
-
// @ts-expect-error disable this error for the sake of the monorepo
|
|
59
|
-
disable: disableTooltips, voronoiBlacklist: ["victory-area"], labels: labelFormatted, labelComponent: React.createElement(VictoryTooltip, { centerOffset: { y: -10 }, renderInPortal: false, constrainToVisibleArea: true, style: {
|
|
53
|
+
React.createElement(VictoryChart, { scale: { x: "time" }, height: height, domainPadding: { y: 5 }, padding: { top: 30, left: 60, right: 35, bottom: 35 }, maxDomain: { y: domainValues.max }, minDomain: { y: domainValues.min }, containerComponent: React.createElement(VictoryVoronoiContainer, { disable: disableTooltips, voronoiBlacklist: ["victory-area"], labels: labelFormatted, labelComponent: React.createElement(VictoryTooltip, { centerOffset: { y: -10 }, renderInPortal: false, constrainToVisibleArea: true, style: {
|
|
60
54
|
fill: color,
|
|
61
55
|
}, flyoutPadding: 7, flyoutStyle: {
|
|
62
56
|
fill: backgroundColor,
|
|
File without changes
|
|
File without changes
|
|
@@ -5,6 +5,8 @@ export declare function getButtonColors(colors: Theme["colors"]): {
|
|
|
5
5
|
primaryColor: string;
|
|
6
6
|
secondaryColor: string;
|
|
7
7
|
tertiaryColor?: string;
|
|
8
|
+
pressedColor?: string;
|
|
9
|
+
pressedOutlineColor?: string;
|
|
8
10
|
};
|
|
9
11
|
};
|
|
10
12
|
export declare function getButtonColorStyle(colors: Theme["colors"], props: ButtonProps): {
|
|
@@ -2,7 +2,7 @@ export function getButtonColors(colors) {
|
|
|
2
2
|
return {
|
|
3
3
|
default: {
|
|
4
4
|
primaryColor: colors.neutral.c100,
|
|
5
|
-
secondaryColor: "rgba(0,0,
|
|
5
|
+
secondaryColor: "rgba(0,0,255,0)",
|
|
6
6
|
},
|
|
7
7
|
disabled: {
|
|
8
8
|
primaryColor: colors.neutral.c50,
|
|
@@ -11,41 +11,43 @@ export function getButtonColors(colors) {
|
|
|
11
11
|
main: {
|
|
12
12
|
primaryColor: colors.neutral.c00,
|
|
13
13
|
secondaryColor: colors.neutral.c100,
|
|
14
|
+
pressedColor: colors.neutral.c100a06,
|
|
15
|
+
pressedOutlineColor: colors.neutral.c100a01,
|
|
14
16
|
},
|
|
15
17
|
shade: {
|
|
16
18
|
primaryColor: colors.neutral.c00,
|
|
17
19
|
secondaryColor: colors.neutral.c100,
|
|
18
20
|
tertiaryColor: colors.neutral.c40,
|
|
21
|
+
pressedColor: colors.neutral.c100a06,
|
|
22
|
+
pressedOutlineColor: colors.neutral.c100a01,
|
|
19
23
|
},
|
|
20
24
|
error: {
|
|
21
25
|
primaryColor: colors.neutral.c00,
|
|
22
26
|
secondaryColor: colors.error.c100,
|
|
27
|
+
pressedColor: colors.error.c100a07,
|
|
28
|
+
pressedOutlineColor: colors.error.c100a025,
|
|
23
29
|
},
|
|
24
30
|
color: {
|
|
25
31
|
primaryColor: colors.neutral.c00,
|
|
26
32
|
secondaryColor: colors.primary.c80,
|
|
33
|
+
pressedColor: colors.primary.c80a70,
|
|
34
|
+
pressedOutlineColor: colors.primary.c70a025,
|
|
27
35
|
},
|
|
28
36
|
};
|
|
29
37
|
}
|
|
30
38
|
export function getButtonColorStyle(colors, props) {
|
|
31
39
|
const { outline, type = "main", disabled } = props;
|
|
32
|
-
const { primaryColor, secondaryColor, tertiaryColor } = getButtonColors(colors)[disabled ? "disabled" : type];
|
|
40
|
+
const { primaryColor, secondaryColor, tertiaryColor, pressedColor, pressedOutlineColor } = getButtonColors(colors)[disabled ? "disabled" : type];
|
|
33
41
|
if (outline) {
|
|
34
42
|
return {
|
|
35
43
|
text: { color: disabled ? primaryColor : secondaryColor },
|
|
36
|
-
button: {
|
|
37
|
-
backgroundColor: "transparent",
|
|
38
|
-
borderColor: disabled ? primaryColor : tertiaryColor !== null && tertiaryColor !== void 0 ? tertiaryColor : secondaryColor,
|
|
39
|
-
borderWidth: 1,
|
|
40
|
-
},
|
|
44
|
+
button: Object.assign({ backgroundColor: "transparent", borderColor: disabled ? primaryColor : tertiaryColor !== null && tertiaryColor !== void 0 ? tertiaryColor : secondaryColor, borderWidth: 1 }, (pressedOutlineColor && { underlayColor: pressedOutlineColor })),
|
|
41
45
|
};
|
|
42
46
|
}
|
|
43
47
|
else {
|
|
44
48
|
return {
|
|
45
49
|
text: { color: primaryColor },
|
|
46
|
-
button: {
|
|
47
|
-
backgroundColor: secondaryColor,
|
|
48
|
-
},
|
|
50
|
+
button: Object.assign({ backgroundColor: secondaryColor }, (pressedColor && { underlayColor: pressedColor })),
|
|
49
51
|
};
|
|
50
52
|
}
|
|
51
53
|
}
|