@ledgerhq/native-ui 0.7.16 → 0.7.18-nightly.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/README.md +13 -16
- 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 +0 -0
- package/{assets → lib/assets}/logos/LedgerLiveAltRegular.js +0 -0
- package/{assets → lib/assets}/logos/LedgerLiveRegular.d.ts +0 -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}/ChartCard/index.d.ts +0 -0
- package/{components → lib/components}/ChartCard/index.js +0 -0
- package/{components → lib/components}/Form/Checkbox/index.d.ts +0 -0
- package/{components → lib/components}/Form/Checkbox/index.js +0 -0
- package/{components → lib/components}/Form/Input/BaseInput/index.d.ts +2 -2
- 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 +0 -0
- package/{components → lib/components}/Form/Slider/index.js +0 -0
- package/{components → lib/components}/Form/Slider/index.native.d.ts +0 -0
- package/{components → lib/components}/Form/Slider/index.native.js +0 -0
- package/{components → lib/components}/Form/Switch/index.d.ts +0 -0
- package/{components → lib/components}/Form/Switch/index.js +0 -0
- package/{components → lib/components}/Form/Toggle/index.d.ts +0 -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 +0 -0
- package/{components → lib/components}/Icon/BoxedIcon.js +0 -0
- package/{components → lib/components}/Icon/Icon.d.ts +0 -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 +0 -0
- 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 +0 -0
- package/{components → lib/components}/Layout/Flex/index.d.ts +0 -0
- 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 +2 -1
- package/{components → lib/components}/Layout/Modals/BaseModal/index.js +7 -7
- package/{components → lib/components}/Layout/Modals/BottomDrawer/index.d.ts +0 -0
- package/{components → lib/components}/Layout/Modals/BottomDrawer/index.js +7 -1
- 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 +0 -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 +0 -0
- package/{components → lib/components}/Loader/InfiniteLoader/index.js +0 -0
- package/{components → lib/components}/Loader/ProgressLoader/index.d.ts +0 -0
- package/{components → lib/components}/Loader/ProgressLoader/index.js +0 -0
- 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 +0 -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 +0 -0
- 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 +0 -0
- package/{components → lib/components}/chart/index.js +8 -2
- 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 +2 -0
- package/{components → lib/components}/cta/Button/getButtonStyle.js +12 -10
- package/{components → lib/components}/cta/Button/index.d.ts +3 -3
- package/{components → lib/components}/cta/Button/index.js +11 -9
- 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/{components → lib/components}/message/Alert/index.d.ts +0 -0
- package/{components → lib/components}/message/Alert/index.js +0 -0
- package/{components → lib/components}/message/Log/Brackets.d.ts +0 -0
- package/{components → lib/components}/message/Log/Brackets.js +0 -0
- package/{components → lib/components}/message/Log/index.d.ts +0 -0
- package/{components → lib/components}/message/Log/index.js +0 -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 +0 -0
- package/{components → lib/components}/message/index.js +0 -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 +0 -0
- package/{components → lib/components}/transitions/Fade.js +0 -0
- package/{components → lib/components}/transitions/Slide.d.ts +0 -0
- package/{components → lib/components}/transitions/Slide.js +0 -0
- package/{components → lib/components}/transitions/Transition.d.ts +0 -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 +127 -15
package/README.md
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# `@ledgerhq/native-ui`
|
|
2
2
|
|
|
3
|
-
[](https://github.com/LedgerHQ/ui/actions/workflows/native.yml)
|
|
4
3
|
[](https://www.npmjs.com/package/@ledgerhq/native-ui)
|
|
5
|
-
[](https://
|
|
4
|
+
[](https://native-ui-storybook.vercel.app)
|
|
6
5
|
|
|
7
6
|
### Design and interface resources for React Native
|
|
8
7
|
|
|
@@ -10,7 +9,7 @@
|
|
|
10
9
|
|
|
11
10
|
## Reference
|
|
12
11
|
|
|
13
|
-
**[🔗 Storybook](https://
|
|
12
|
+
**[🔗 Storybook](https://native-ui-storybook.vercel.app)**
|
|
14
13
|
|
|
15
14
|
## Installation
|
|
16
15
|
|
|
@@ -30,8 +29,6 @@ npm i styled-components react-native-reanimated react-native-svg
|
|
|
30
29
|
|
|
31
30
|
### Additional setup
|
|
32
31
|
|
|
33
|
-
**Skip this step if your project is managed by Expo.**
|
|
34
|
-
|
|
35
32
|
Follow the installation instructions for:
|
|
36
33
|
|
|
37
34
|
- [react-native-reanimated](https://docs.swmansion.com/react-native-reanimated/docs/2.2.0/installation)
|
|
@@ -86,10 +83,10 @@ import { useFonts } from "expo-font";
|
|
|
86
83
|
*/
|
|
87
84
|
function FontProvider({ children }) {
|
|
88
85
|
const [fontsLoaded] = useFonts({
|
|
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"),
|
|
86
|
+
"HMAlphaMono-Medium": require("@ledgerhq/native-ui/lib/assets/fonts/alpha/HMAlphaMono-Medium.otf"),
|
|
87
|
+
"Inter-Medium": require("@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-Medium.otf"),
|
|
88
|
+
"Inter-SemiBold": require("@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-SemiBold.otf"),
|
|
89
|
+
"Inter-Bold": require("@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-Bold.otf"),
|
|
93
90
|
});
|
|
94
91
|
|
|
95
92
|
if (!fontsLoaded) {
|
|
@@ -107,8 +104,8 @@ Add the paths in the `react-native.config.js` file:
|
|
|
107
104
|
```js
|
|
108
105
|
module.exports = {
|
|
109
106
|
assets: [
|
|
110
|
-
"node_modules/@ledgerhq/native-ui/assets/fonts/alpha",
|
|
111
|
-
"node_modules/@ledgerhq/native-ui/assets/fonts/inter",
|
|
107
|
+
"node_modules/@ledgerhq/native-ui/lib/assets/fonts/alpha",
|
|
108
|
+
"node_modules/@ledgerhq/native-ui/lib/assets/fonts/inter",
|
|
112
109
|
],
|
|
113
110
|
};
|
|
114
111
|
```
|
|
@@ -138,10 +135,10 @@ function Logo() {
|
|
|
138
135
|
|
|
139
136
|
function FontProvider({ children }) {
|
|
140
137
|
const [fontsLoaded] = useFonts({
|
|
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"),
|
|
138
|
+
"HMAlphaMono-Medium": require("@ledgerhq/native-ui/lib/assets/fonts/alpha/HMAlphaMono-Medium.otf"),
|
|
139
|
+
"Inter-Medium": require("@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-Medium.otf"),
|
|
140
|
+
"Inter-SemiBold": require("@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-SemiBold.otf"),
|
|
141
|
+
"Inter-Bold": require("@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-Bold.otf"),
|
|
145
142
|
});
|
|
146
143
|
|
|
147
144
|
if (!fontsLoaded) {
|
|
@@ -184,7 +181,7 @@ export default function App() {
|
|
|
184
181
|
|
|
185
182
|
```js
|
|
186
183
|
import React from "react";
|
|
187
|
-
import { StyleProvider } from "@ledgerhq/native-ui
|
|
184
|
+
import { StyleProvider } from "@ledgerhq/native-ui";
|
|
188
185
|
import { Flex, Text, Logos, Switch } from "@ledgerhq/native-ui";
|
|
189
186
|
import { useTheme } from "styled-components/native";
|
|
190
187
|
|
|
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
|
+
}, "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
|
/**
|
|
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,7 +11,9 @@ 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,
|
|
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, }) => {
|
|
15
17
|
const theme = useTheme();
|
|
16
18
|
const sortData = useMemo(() => data.sort(sortByDate), [data]);
|
|
17
19
|
const labelFormatted = useCallback(({ datum }) => {
|
|
@@ -50,7 +52,11 @@ const Chart = ({ data, backgroundColor, color, yAxisFormatter, valueFormatter, v
|
|
|
50
52
|
grid: { display: "none" },
|
|
51
53
|
}), [theme]);
|
|
52
54
|
return (React.createElement(Flex, { justifyContent: "center", alignItems: "center" },
|
|
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
|
|
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: {
|
|
54
60
|
fill: color,
|
|
55
61
|
}, flyoutPadding: 7, flyoutStyle: {
|
|
56
62
|
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
|
}
|