@ledgerhq/native-ui 0.7.4-monorepo.4 → 0.7.6

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.
Files changed (197) hide show
  1. package/README.md +10 -10
  2. package/{lib/assets → assets}/fonts/alpha/HMAlphaMono-Medium.otf +0 -0
  3. package/{lib/assets → assets}/fonts/inter/Inter-Bold.otf +0 -0
  4. package/{lib/assets → assets}/fonts/inter/Inter-Medium.otf +0 -0
  5. package/{lib/assets → assets}/fonts/inter/Inter-SemiBold.otf +0 -0
  6. package/{lib/assets → assets}/icons.d.ts +0 -0
  7. package/{lib/assets → assets}/icons.js +0 -0
  8. package/{lib/assets → assets}/index.d.ts +0 -0
  9. package/{lib/assets → assets}/index.js +0 -0
  10. package/{lib/assets → assets}/logos/LedgerLiveAltRegular.d.ts +0 -0
  11. package/{lib/assets → assets}/logos/LedgerLiveAltRegular.js +0 -0
  12. package/{lib/assets → assets}/logos/LedgerLiveRegular.d.ts +0 -0
  13. package/{lib/assets → assets}/logos/LedgerLiveRegular.js +0 -0
  14. package/{lib/assets → assets}/logos/index.d.ts +0 -0
  15. package/{lib/assets → assets}/logos/index.js +0 -0
  16. package/{lib/components → components}/Carousel/index.d.ts +0 -0
  17. package/{lib/components → components}/Carousel/index.js +0 -0
  18. package/components/ChartCard/index.d.ts +19 -0
  19. package/components/ChartCard/index.js +25 -0
  20. package/{lib/components → components}/Form/Checkbox/index.d.ts +0 -0
  21. package/{lib/components → components}/Form/Checkbox/index.js +0 -0
  22. package/{lib/components → components}/Form/Input/BaseInput/index.d.ts +4 -4
  23. package/{lib/components → components}/Form/Input/BaseInput/index.js +0 -0
  24. package/{lib/components → components}/Form/Input/LegendInput/index.d.ts +0 -0
  25. package/{lib/components → components}/Form/Input/LegendInput/index.js +0 -0
  26. package/{lib/components → components}/Form/Input/NumberInput/index.d.ts +0 -0
  27. package/{lib/components → components}/Form/Input/NumberInput/index.js +0 -0
  28. package/{lib/components → components}/Form/Input/QrCodeInput/index.d.ts +0 -0
  29. package/{lib/components → components}/Form/Input/QrCodeInput/index.js +0 -0
  30. package/{lib/components → components}/Form/Input/SearchInput/index.d.ts +0 -0
  31. package/{lib/components → components}/Form/Input/SearchInput/index.js +0 -0
  32. package/{lib/components → components}/Form/Input/index.d.ts +0 -0
  33. package/{lib/components → components}/Form/Input/index.js +0 -0
  34. package/{lib/components → components}/Form/SelectableList.d.ts +0 -0
  35. package/{lib/components → components}/Form/SelectableList.js +0 -0
  36. package/{lib/components → components}/Form/Slider/components.d.ts +0 -0
  37. package/{lib/components → components}/Form/Slider/components.js +0 -0
  38. package/{lib/components → components}/Form/Slider/index.d.ts +0 -0
  39. package/{lib/components → components}/Form/Slider/index.js +0 -0
  40. package/{lib/components → components}/Form/Slider/index.native.d.ts +0 -0
  41. package/{lib/components → components}/Form/Slider/index.native.js +0 -0
  42. package/{lib/components → components}/Form/Switch/index.d.ts +0 -0
  43. package/{lib/components → components}/Form/Switch/index.js +0 -0
  44. package/{lib/components → components}/Form/Toggle/index.d.ts +0 -0
  45. package/{lib/components → components}/Form/Toggle/index.js +0 -0
  46. package/{lib/components → components}/Form/index.d.ts +0 -0
  47. package/{lib/components → components}/Form/index.js +0 -0
  48. package/{lib/components → components}/Icon/BoxedIcon.d.ts +0 -0
  49. package/{lib/components → components}/Icon/BoxedIcon.js +0 -0
  50. package/{lib/components → components}/Icon/Icon.d.ts +0 -0
  51. package/{lib/components → components}/Icon/Icon.js +0 -0
  52. package/{lib/components → components}/Icon/IconBox/index.d.ts +0 -0
  53. package/{lib/components → components}/Icon/IconBox/index.js +0 -0
  54. package/{lib/components → components}/Icon/index.d.ts +0 -0
  55. package/{lib/components → components}/Icon/index.js +0 -0
  56. package/{lib/components → components}/Icon/type.d.ts +0 -0
  57. package/{lib/components → components}/Icon/type.js +0 -0
  58. package/{lib/components → components}/Layout/Box/index.d.ts +1 -1
  59. package/{lib/components → components}/Layout/Box/index.js +0 -0
  60. package/{lib/components → components}/Layout/Collapse/Accordion/index.d.ts +0 -0
  61. package/{lib/components → components}/Layout/Collapse/Accordion/index.js +0 -1
  62. package/{lib/components → components}/Layout/Flex/index.d.ts +1 -1
  63. package/{lib/components → components}/Layout/Flex/index.js +0 -0
  64. package/{lib/components → components}/Layout/List/IconBoxList/index.d.ts +0 -0
  65. package/{lib/components → components}/Layout/List/IconBoxList/index.js +0 -0
  66. package/{lib/components → components}/Layout/List/List/index.d.ts +0 -0
  67. package/{lib/components → components}/Layout/List/List/index.js +0 -0
  68. package/{lib/components → components}/Layout/List/NumberedList/index.d.ts +0 -0
  69. package/{lib/components → components}/Layout/List/NumberedList/index.js +0 -0
  70. package/{lib/components → components}/Layout/List/TipList/index.d.ts +0 -0
  71. package/{lib/components → components}/Layout/List/TipList/index.js +0 -0
  72. package/{lib/components → components}/Layout/List/index.d.ts +0 -0
  73. package/{lib/components → components}/Layout/List/index.js +0 -0
  74. package/{lib/components → components}/Layout/Modals/BaseModal/index.d.ts +0 -0
  75. package/{lib/components → components}/Layout/Modals/BaseModal/index.js +0 -0
  76. package/{lib/components → components}/Layout/Modals/BottomDrawer/index.d.ts +0 -0
  77. package/{lib/components → components}/Layout/Modals/BottomDrawer/index.js +0 -0
  78. package/{lib/components → components}/Layout/Modals/Popin/index.d.ts +0 -0
  79. package/{lib/components → components}/Layout/Modals/Popin/index.js +0 -0
  80. package/{lib/components → components}/Layout/Modals/Tooltip/index.d.ts +0 -0
  81. package/{lib/components → components}/Layout/Modals/Tooltip/index.js +0 -0
  82. package/{lib/components → components}/Layout/Modals/index.d.ts +0 -0
  83. package/{lib/components → components}/Layout/Modals/index.js +0 -0
  84. package/{lib/components → components}/Layout/ScrollContainer/index.d.ts +0 -0
  85. package/{lib/components → components}/Layout/ScrollContainer/index.js +0 -0
  86. package/{lib/components → components}/Layout/ScrollContainerHeader/Header.d.ts +0 -0
  87. package/{lib/components → components}/Layout/ScrollContainerHeader/Header.js +0 -0
  88. package/{lib/components → components}/Layout/ScrollContainerHeader/index.d.ts +0 -0
  89. package/{lib/components → components}/Layout/ScrollContainerHeader/index.js +0 -0
  90. package/{lib/components → components}/Layout/ScrollListContainer/index.d.ts +0 -0
  91. package/{lib/components → components}/Layout/ScrollListContainer/index.js +0 -0
  92. package/{lib/components → components}/Layout/Table/Row.d.ts +0 -0
  93. package/{lib/components → components}/Layout/Table/Row.js +0 -0
  94. package/{lib/components → components}/Layout/index.d.ts +0 -0
  95. package/{lib/components → components}/Layout/index.js +0 -0
  96. package/{lib/components → components}/Layout/types.d.ts +0 -0
  97. package/{lib/components → components}/Layout/types.js +0 -0
  98. package/{lib/components → components}/Loader/InfiniteLoader/index.d.ts +1 -1
  99. package/{lib/components → components}/Loader/InfiniteLoader/index.js +0 -0
  100. package/{lib/components → components}/Loader/ProgressLoader/index.d.ts +0 -0
  101. package/{lib/components → components}/Loader/ProgressLoader/index.js +0 -0
  102. package/{lib/components → components}/Loader/index.d.ts +0 -0
  103. package/{lib/components → components}/Loader/index.js +0 -0
  104. package/{lib/components → components}/Navigation/FlowStepper/index.d.ts +0 -0
  105. package/{lib/components → components}/Navigation/FlowStepper/index.js +0 -0
  106. package/{lib/components → components}/Navigation/SlideIndicator/index.d.ts +0 -0
  107. package/{lib/components → components}/Navigation/SlideIndicator/index.js +0 -1
  108. package/{lib/components → components}/Navigation/Stepper/index.d.ts +0 -0
  109. package/{lib/components → components}/Navigation/Stepper/index.js +0 -0
  110. package/{lib/components → components}/Navigation/index.d.ts +0 -0
  111. package/{lib/components → components}/Navigation/index.js +0 -0
  112. package/{lib/components → components}/ProgressBar/index.d.ts +0 -0
  113. package/{lib/components → components}/ProgressBar/index.js +0 -0
  114. package/{lib/components → components}/Tabs/Chip/index.d.ts +0 -0
  115. package/{lib/components → components}/Tabs/Chip/index.js +0 -0
  116. package/{lib/components → components}/Tabs/Graph/index.d.ts +0 -0
  117. package/{lib/components → components}/Tabs/Graph/index.js +0 -0
  118. package/{lib/components → components}/Tabs/TemplateTabs/index.d.ts +1 -1
  119. package/{lib/components → components}/Tabs/TemplateTabs/index.js +0 -0
  120. package/{lib/components → components}/Tabs/index.d.ts +0 -0
  121. package/{lib/components → components}/Tabs/index.js +0 -0
  122. package/{lib/components → components}/Text/getTextStyle.d.ts +0 -0
  123. package/{lib/components → components}/Text/getTextStyle.js +0 -0
  124. package/{lib/components → components}/Text/index.d.ts +0 -0
  125. package/{lib/components → components}/Text/index.js +0 -0
  126. package/components/chart/index.d.ts +15 -0
  127. package/components/chart/index.js +68 -0
  128. package/components/chart/types.d.ts +6 -0
  129. package/{lib/components → components}/chart/types.js +0 -0
  130. package/{lib/components → components}/cta/Button/getButtonStyle.d.ts +0 -0
  131. package/{lib/components → components}/cta/Button/getButtonStyle.js +0 -0
  132. package/{lib/components → components}/cta/Button/index.d.ts +0 -0
  133. package/{lib/components → components}/cta/Button/index.js +0 -0
  134. package/{lib/components → components}/cta/Link/getLinkStyle.d.ts +0 -0
  135. package/{lib/components → components}/cta/Link/getLinkStyle.js +0 -0
  136. package/{lib/components → components}/cta/Link/index.d.ts +0 -0
  137. package/{lib/components → components}/cta/Link/index.js +0 -0
  138. package/{lib/components → components}/cta/getCtaStyle.d.ts +0 -0
  139. package/{lib/components → components}/cta/getCtaStyle.js +0 -0
  140. package/{lib/components → components}/cta/index.d.ts +0 -0
  141. package/{lib/components → components}/cta/index.js +0 -0
  142. package/{lib/components → components}/index.d.ts +2 -0
  143. package/{lib/components → components}/index.js +2 -0
  144. package/{lib/components → components}/message/Alert/index.d.ts +0 -0
  145. package/{lib/components → components}/message/Alert/index.js +0 -0
  146. package/{lib/components → components}/message/Log/Brackets.d.ts +0 -0
  147. package/{lib/components → components}/message/Log/Brackets.js +4 -4
  148. package/{lib/components → components}/message/Log/index.d.ts +0 -0
  149. package/{lib/components → components}/message/Log/index.js +4 -3
  150. package/{lib/components → components}/message/Notification/index.d.ts +0 -0
  151. package/{lib/components → components}/message/Notification/index.js +0 -0
  152. package/{lib/components → components}/message/index.d.ts +0 -0
  153. package/{lib/components → components}/message/index.js +0 -0
  154. package/{lib/components → components}/styled.d.ts +0 -0
  155. package/{lib/components → components}/styled.js +1 -4
  156. package/{lib/components → components}/tags/Badge/index.d.ts +0 -0
  157. package/{lib/components → components}/tags/Badge/index.js +0 -0
  158. package/{lib/components → components}/tags/Tag/index.d.ts +0 -0
  159. package/{lib/components → components}/tags/Tag/index.js +0 -0
  160. package/{lib/components → components}/tags/index.d.ts +0 -0
  161. package/{lib/components → components}/tags/index.js +0 -0
  162. package/{lib/components → components}/transitions/Fade.d.ts +0 -0
  163. package/{lib/components → components}/transitions/Fade.js +0 -0
  164. package/{lib/components → components}/transitions/Slide.d.ts +0 -0
  165. package/{lib/components → components}/transitions/Slide.js +0 -0
  166. package/{lib/components → components}/transitions/Transition.d.ts +0 -0
  167. package/{lib/components → components}/transitions/Transition.js +0 -0
  168. package/{lib/components → components}/transitions/index.d.ts +0 -0
  169. package/{lib/components → components}/transitions/index.js +0 -0
  170. package/{lib/components → components}/transitions/types.d.ts +0 -0
  171. package/{lib/components → components}/transitions/types.js +0 -0
  172. package/{lib/helpers → helpers}/getDeviceSize.d.ts +0 -0
  173. package/{lib/helpers → helpers}/getDeviceSize.js +0 -0
  174. package/{lib/icons → icons}/BracketLeft.d.ts +0 -0
  175. package/{lib/icons → icons}/BracketLeft.js +0 -0
  176. package/{lib/icons → icons}/BracketRight.d.ts +0 -0
  177. package/{lib/icons → icons}/BracketRight.js +0 -0
  178. package/{lib/icons → icons}/Close.d.ts +0 -0
  179. package/{lib/icons → icons}/Close.js +0 -0
  180. package/{lib/icons → icons}/Info.d.ts +0 -0
  181. package/{lib/icons → icons}/Info.js +0 -0
  182. package/{lib/index.d.ts → index.d.ts} +0 -0
  183. package/{lib/index.js → index.js} +0 -0
  184. package/package.json +16 -121
  185. package/{lib/styles → styles}/InvertTheme.d.ts +0 -0
  186. package/{lib/styles → styles}/InvertTheme.js +0 -0
  187. package/{lib/styles → styles}/StyleProvider.d.ts +0 -0
  188. package/{lib/styles → styles}/StyleProvider.js +0 -0
  189. package/{lib/styles → styles}/helpers.d.ts +0 -0
  190. package/{lib/styles → styles}/helpers.js +0 -0
  191. package/{lib/styles → styles}/index.d.ts +0 -0
  192. package/{lib/styles → styles}/index.js +0 -0
  193. package/{lib/styles → styles}/theme.d.ts +0 -0
  194. package/{lib/styles → styles}/theme.js +0 -0
  195. package/lib/components/chart/index.d.ts +0 -11
  196. package/lib/components/chart/index.js +0 -59
  197. package/lib/components/chart/types.d.ts +0 -6
package/README.md CHANGED
@@ -86,10 +86,10 @@ import { useFonts } from "expo-font";
86
86
  */
87
87
  function FontProvider({ children }) {
88
88
  const [fontsLoaded] = useFonts({
89
- "HMAlphaMono-Medium": require("@ledgerhq/native-ui/lib/assets/fonts/alpha/HMAlphaMono-Medium.otf"),
90
- "Inter-Medium": require("@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-Medium.otf"),
91
- "Inter-SemiBold": require("@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-SemiBold.otf"),
92
- "Inter-Bold": require("@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-Bold.otf"),
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"),
93
93
  });
94
94
 
95
95
  if (!fontsLoaded) {
@@ -107,8 +107,8 @@ Add the paths in the `react-native.config.js` file:
107
107
  ```js
108
108
  module.exports = {
109
109
  assets: [
110
- "node_modules/@ledgerhq/native-ui/lib/assets/fonts/alpha",
111
- "node_modules/@ledgerhq/native-ui/lib/assets/fonts/inter",
110
+ "node_modules/@ledgerhq/native-ui/assets/fonts/alpha",
111
+ "node_modules/@ledgerhq/native-ui/assets/fonts/inter",
112
112
  ],
113
113
  };
114
114
  ```
@@ -138,10 +138,10 @@ function Logo() {
138
138
 
139
139
  function FontProvider({ children }) {
140
140
  const [fontsLoaded] = useFonts({
141
- "HMAlphaMono-Medium": require("@ledgerhq/native-ui/lib/assets/fonts/alpha/HMAlphaMono-Medium.otf"),
142
- "Inter-Medium": require("@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-Medium.otf"),
143
- "Inter-SemiBold": require("@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-SemiBold.otf"),
144
- "Inter-Bold": require("@ledgerhq/native-ui/lib/assets/fonts/inter/Inter-Bold.otf"),
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"),
145
145
  });
146
146
 
147
147
  if (!fontsLoaded) {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ declare const ChartCard: ({ Header, Footer, range, isLoading, refreshChart, chartData, currencyColor, margin, xAxisFormatter, ranges, yAxisFormatter, valueFormatter, }: {
3
+ Header?: React.ReactNode;
4
+ Footer?: React.ReactNode;
5
+ range: string;
6
+ isLoading?: boolean | undefined;
7
+ refreshChart: (request: any) => void;
8
+ chartData: any;
9
+ currencyColor: string;
10
+ margin: number;
11
+ xAxisFormatter?: ((value: number) => string) | undefined;
12
+ ranges: {
13
+ label: string;
14
+ value: string;
15
+ }[];
16
+ yAxisFormatter: (value: number) => string;
17
+ valueFormatter: (value: number) => string;
18
+ }) => JSX.Element;
19
+ export default ChartCard;
@@ -0,0 +1,25 @@
1
+ import React, { useCallback } from "react";
2
+ import { useTheme } from "styled-components/native";
3
+ import { Flex, GraphTabs, InfiniteLoader, Transitions } from "../index";
4
+ import Chart from "../chart";
5
+ const ChartCard = ({ Header, Footer, range, isLoading, refreshChart, chartData, currencyColor, margin = 0, xAxisFormatter, ranges, yAxisFormatter, valueFormatter, }) => {
6
+ const { colors } = useTheme();
7
+ const rangesLabels = ranges.map(({ label }) => label);
8
+ const activeRangeIndex = ranges.findIndex((r) => r.value === range);
9
+ const setRange = useCallback((index) => {
10
+ var _a;
11
+ if (isLoading)
12
+ return;
13
+ const newRange = (_a = ranges[index]) === null || _a === void 0 ? void 0 : _a.value;
14
+ if (range !== newRange)
15
+ refreshChart({ range: newRange });
16
+ }, [isLoading, range, ranges, refreshChart]);
17
+ return (React.createElement(Flex, { margin: margin, padding: 6, borderRadius: 2, bg: "neutral.c30" },
18
+ Header,
19
+ React.createElement(Flex, { mt: 6, height: 100, alignItems: "center", justifyContent: "center" }, chartData && chartData.length > 0 ? (React.createElement(Transitions.Fade, { status: "entering", duration: 400 },
20
+ React.createElement(Chart, { data: chartData, backgroundColor: colors.neutral.c30, color: currencyColor, valueKey: "value", xAxisFormatter: xAxisFormatter, yAxisFormatter: yAxisFormatter, valueFormatter: valueFormatter, disableTooltips: false }))) : (React.createElement(InfiniteLoader, { size: 32 }))),
21
+ React.createElement(Flex, { mt: 70 },
22
+ React.createElement(GraphTabs, { activeIndex: activeRangeIndex, activeBg: "neutral.c30", onChange: setRange, labels: rangesLabels })),
23
+ Footer));
24
+ };
25
+ export default ChartCard;
@@ -47,7 +47,7 @@ export declare type InputProps<T = string> = Omit<CommonProps, "value" | "onChan
47
47
  */
48
48
  containerStyle?: StyleProp<ViewStyle>;
49
49
  };
50
- export declare const InputRenderLeftContainer: 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>>, CSS.Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").BackgroundProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, CSS.Property.Background<import("styled-system").TLengthStyledSystem>> & {
50
+ export declare const InputRenderLeftContainer: 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>> & {
51
51
  columnGap?: string | number | undefined;
52
52
  rowGap?: string | number | undefined;
53
53
  color?: string | undefined;
@@ -58,8 +58,8 @@ export declare const InputRenderLeftContainer: import("styled-components").Style
58
58
  alignItems: string;
59
59
  flexDirection: string;
60
60
  pl: string;
61
- }, "alignItems" | "flexDirection" | "pl">;
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>>, CSS.Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").BackgroundProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, CSS.Property.Background<import("styled-system").TLengthStyledSystem>> & {
61
+ }, "pl" | "alignItems" | "flexDirection">;
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;
65
65
  color?: string | 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
- }, "alignItems" | "flexDirection" | "pr">;
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
@@ -1,6 +1,6 @@
1
1
  import { BaseStyledProps } from "../../styled";
2
2
  export declare type BoxProps = BaseStyledProps;
3
- declare const Box: 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>>, CSS.Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").BackgroundProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, CSS.Property.Background<import("styled-system").TLengthStyledSystem>> & {
3
+ declare const Box: 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>> & {
4
4
  columnGap?: string | number | undefined;
5
5
  rowGap?: string | number | undefined;
6
6
  color?: string | undefined;
@@ -11,7 +11,6 @@ const Accordion = ({ collapsed = false, children, title, onPress, }) => {
11
11
  };
12
12
  const style = useAnimatedStyle(() => {
13
13
  return {
14
- // @ts-expect-error https://github.com/software-mansion/react-native-reanimated/issues/2971
15
14
  maxHeight: withTiming(animationHeight.value, config),
16
15
  };
17
16
  });
@@ -1,7 +1,7 @@
1
1
  import { BaseStyledProps } from "../../styled";
2
2
  export declare type FlexBoxProps = BaseStyledProps;
3
3
  export declare type Props = FlexBoxProps;
4
- declare const FlexBox: 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>>, CSS.Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").BackgroundProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, CSS.Property.Background<import("styled-system").TLengthStyledSystem>> & {
4
+ declare const FlexBox: 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>> & {
5
5
  columnGap?: string | number | undefined;
6
6
  rowGap?: string | number | undefined;
7
7
  color?: string | undefined;
File without changes
File without changes
File without changes
File without changes
@@ -1,7 +1,7 @@
1
1
  /// <reference types="styled-components-react-native" />
2
2
  import React from "react";
3
3
  import { SizeProps } from "styled-system";
4
- declare const Loader: import("styled-components").StyledComponent<React.ComponentClass<import("react-native-svg").SvgProps, any>, import("styled-components").DefaultTheme, SizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, CSS.Property.Height<import("styled-system").TLengthStyledSystem>>, never>;
4
+ declare const Loader: import("styled-components").StyledComponent<React.ComponentClass<import("react-native-svg").SvgProps, any>, import("styled-components").DefaultTheme, SizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Height<import("styled-system").TLengthStyledSystem>>, never>;
5
5
  export declare type Props = React.ComponentProps<typeof Loader> & {
6
6
  color?: string;
7
7
  };
File without changes
File without changes
@@ -37,7 +37,6 @@ function SlideIndicator({ slidesLength, activeIndex = 0, onChange }) {
37
37
  return size;
38
38
  }, [activeIndex, slidesLength]);
39
39
  const animatedStyles = useAnimatedStyle(() => ({
40
- // @ts-expect-error https://github.com/software-mansion/react-native-reanimated/issues/2971
41
40
  width: withTiming(activeSize.value, config),
42
41
  }));
43
42
  return (React.createElement(Container, null,
@@ -22,7 +22,7 @@ export declare type TabsProps = BaseTabsProps & {
22
22
  activeColor?: string;
23
23
  activeBg?: string;
24
24
  };
25
- export declare const TabsContainer: 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>>, CSS.Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").BackgroundProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, CSS.Property.Background<import("styled-system").TLengthStyledSystem>> & {
25
+ export declare const TabsContainer: 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>> & {
26
26
  columnGap?: string | number | undefined;
27
27
  rowGap?: string | number | undefined;
28
28
  color?: string | undefined;
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import type { Item } from "./types";
3
+ export declare type ChartProps = {
4
+ data: Array<Item>;
5
+ backgroundColor: string;
6
+ color: string;
7
+ valueKey?: string;
8
+ height?: number;
9
+ xAxisFormatter?: (timestamp: number) => string;
10
+ yAxisFormatter: (n: number) => string;
11
+ valueFormatter: (n: number) => string;
12
+ disableTooltips: boolean;
13
+ };
14
+ declare const Chart: ({ data, backgroundColor, color, yAxisFormatter, valueFormatter, valueKey, height, xAxisFormatter, disableTooltips, }: ChartProps) => JSX.Element;
15
+ export default Chart;
@@ -0,0 +1,68 @@
1
+ import React, { useMemo, useCallback } from "react";
2
+ import { useTheme } from "styled-components/native";
3
+ import { Defs, LinearGradient, Stop } from "react-native-svg";
4
+ import { VictoryLine, VictoryChart, VictoryAxis, VictoryArea, VictoryTooltip, VictoryVoronoiContainer, } from "victory-native";
5
+ import { Flex } from "../index";
6
+ import { hex } from "../../styles/helpers";
7
+ const sortByDate = (a, b) => {
8
+ if (a.date.getTime() < b.date.getTime())
9
+ return -1;
10
+ if (a.date.getTime() > b.date.getTime())
11
+ return 1;
12
+ return 0;
13
+ };
14
+ const Chart = ({ data, backgroundColor, color, yAxisFormatter, valueFormatter, valueKey = "value", height = 200, xAxisFormatter = (timestamp) => `${new Date(timestamp).toLocaleDateString()}`, disableTooltips = false, }) => {
15
+ const theme = useTheme();
16
+ const sortData = useMemo(() => data.sort(sortByDate), [data]);
17
+ const labelFormatted = useCallback(({ datum }) => {
18
+ const valueFormatted = valueFormatter(datum[valueKey]);
19
+ return valueFormatted === "-" ? "0" : valueFormatted;
20
+ }, [valueKey, valueFormatter]);
21
+ const domainValues = useMemo(() => {
22
+ const counterValues = data.map((d) => d[valueKey]);
23
+ return {
24
+ min: Math.min(...counterValues) * 0.8,
25
+ max: Math.max(...counterValues) * 1.2, // 1.2 So the maximum value of the yAxis is a bit bigger than the max value displayed
26
+ };
27
+ }, [data, valueKey]);
28
+ const yAxisStyle = useMemo(() => ({
29
+ grid: {
30
+ stroke: theme.colors.neutral.c40,
31
+ strokeDasharray: "4 4",
32
+ },
33
+ axisLabel: { display: "none" },
34
+ axis: { display: "none" },
35
+ ticks: { display: "none" },
36
+ tickLabels: {
37
+ fill: theme.colors.neutral.c80,
38
+ fontSize: 12,
39
+ },
40
+ }), [theme]);
41
+ const xAxisStyle = useMemo(() => ({
42
+ axis: {
43
+ stroke: theme.colors.neutral.c40,
44
+ strokeDasharray: "4 4",
45
+ },
46
+ tickLabels: {
47
+ fill: theme.colors.neutral.c80,
48
+ fontSize: 12,
49
+ },
50
+ grid: { display: "none" },
51
+ }), [theme]);
52
+ 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, { disable: disableTooltips, voronoiBlacklist: ["victory-area"], labels: labelFormatted, labelComponent: React.createElement(VictoryTooltip, { centerOffset: { y: -10 }, renderInPortal: false, constrainToVisibleArea: true, style: {
54
+ fill: color,
55
+ }, flyoutPadding: 7, flyoutStyle: {
56
+ fill: backgroundColor,
57
+ stroke: color,
58
+ } }) }) },
59
+ React.createElement(VictoryAxis, { dependentAxis: true, crossAxis: true, tickFormat: yAxisFormatter, style: yAxisStyle }),
60
+ React.createElement(VictoryAxis, { crossAxis: false, tickFormat: xAxisFormatter, style: xAxisStyle }),
61
+ React.createElement(Defs, null,
62
+ React.createElement(LinearGradient, { id: "chartGradient", x1: "0.5", x2: "0.5", y1: "0", y2: "1" },
63
+ React.createElement(Stop, { stopColor: hex(color), stopOpacity: "0.15" }),
64
+ React.createElement(Stop, { offset: "1", stopColor: hex(theme.colors.neutral.c00), stopOpacity: "0" }))),
65
+ React.createElement(VictoryArea, { name: "victory-area", data: sortData, interpolation: "monotoneX", sortKey: "date", x: "date", y: valueKey, style: { data: { fill: `url(#chartGradient)` } }, standalone: false }),
66
+ React.createElement(VictoryLine, { data: sortData, interpolation: "monotoneX", x: "date", y: valueKey, style: { data: { stroke: color } } }))));
67
+ };
68
+ export default Chart;