@ledgerhq/native-ui 0.19.0-nightly.1 → 0.19.1-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,7 +27,7 @@ const linesWidth = 2;
27
27
  const linesLength = 5000;
28
28
  const TopSegmentSvg = ({ status, hidden, height }) => {
29
29
  const theme = useTheme();
30
- const strokeColor = status === "inactive" ? theme.colors.neutral.c50 : theme.colors.primary.c80;
30
+ const strokeColor = status === "inactive" ? theme.colors.neutral.c40 : theme.colors.primary.c80;
31
31
  const strokeDashArray = status === "inactive" ? `${dashLength}` : undefined;
32
32
  return (React.createElement(Flex, { height: height, width: "100%", overflow: "hidden" },
33
33
  React.createElement(Flex, { style: StyleSheet.absoluteFillObject, alignItems: "center" },
@@ -37,7 +37,7 @@ const TopSegmentSvg = ({ status, hidden, height }) => {
37
37
  const topSegmentDefaultHeight = Platform.OS === "android" ? 23 : 21; // difference due to how borders are drawn in android
38
38
  const BottomSegmentSvg = ({ status, hidden }) => {
39
39
  const theme = useTheme();
40
- const strokeColor = status === "completed" ? theme.colors.primary.c80 : theme.colors.neutral.c50;
40
+ const strokeColor = status === "completed" ? theme.colors.primary.c80 : theme.colors.neutral.c40;
41
41
  const strokeDashArray = status === "completed" ? undefined : `${dashLength}`;
42
42
  return (React.createElement(Flex, { flex: 1, width: "100%", style: { transform: [{ scaleY: -1 }] }, overflow: "hidden" },
43
43
  React.createElement(Flex, { style: StyleSheet.absoluteFillObject, alignItems: "center" },
@@ -45,23 +45,24 @@ const BottomSegmentSvg = ({ status, hidden }) => {
45
45
  React.createElement(Line, { x1: "0", y1: "0", x2: "0", y2: "100%", strokeWidth: hidden ? 0 : 2 * linesWidth, stroke: strokeColor, strokeDasharray: strokeDashArray, strokeDashoffset: `${dashLength}` })))));
46
46
  };
47
47
  const getIconBackground = (theme, status, isLastItem) => {
48
- if (status === "completed") {
48
+ if (isLastItem) {
49
+ if (status === "inactive")
50
+ return theme.colors.success.c10;
49
51
  return "transparent";
50
52
  }
51
- else if (isLastItem) {
52
- return theme.colors.success.c10;
53
- }
54
53
  else if (status === "active") {
55
54
  return theme.colors.neutral.c40;
56
55
  }
57
- return theme.colors.background.main;
56
+ else {
57
+ return "transparent";
58
+ }
58
59
  };
59
60
  const getIconBorder = (theme, status, isLastItem) => {
60
61
  if (isLastItem) {
61
- return theme.colors.success.c50;
62
+ return theme.colors.success.c70;
62
63
  }
63
64
  else if (status === "inactive") {
64
- return theme.colors.neutral.c50;
65
+ return theme.colors.neutral.c40;
65
66
  }
66
67
  return theme.colors.primary.c80;
67
68
  };
@@ -79,7 +80,7 @@ export default function TimelineIndicator(_a) {
79
80
  const { colors } = useTheme();
80
81
  return (React.createElement(Flex, Object.assign({ flexDirection: "column", alignItems: "center" }, props),
81
82
  React.createElement(TopSegmentSvg, { status: status, hidden: isFirstItem, height: PixelRatio.roundToNearestPixel(topHeight || topSegmentDefaultHeight) }),
82
- React.createElement(CenterCircle, { status: status, isLastItem: isLastItem }, status === "completed" && (React.createElement(CircledCheckSolidMedium, { color: isLastItem ? colors.success.c50 : colors.primary.c80, size: 20 }))),
83
+ React.createElement(CenterCircle, { status: status, isLastItem: isLastItem }, status === "completed" && (React.createElement(CircledCheckSolidMedium, { color: isLastItem ? colors.success.c70 : colors.primary.c80, size: 20 }))),
83
84
  React.createElement(BottomSegmentSvg, { status: status, hidden: isLastItem })));
84
85
  }
85
86
  TimelineIndicator.topSegmentDefaultHeight = topSegmentDefaultHeight;
@@ -11,7 +11,7 @@ const getContainerBackground = (theme, status) => {
11
11
  return "transparent";
12
12
  }
13
13
  else if (status === "active") {
14
- return theme.colors.neutral.c20;
14
+ return theme.colors.opacityDefault.c05;
15
15
  }
16
16
  return "transparent";
17
17
  };
@@ -20,7 +20,7 @@ const getContainerBorder = (theme, status, isLastItem) => {
20
20
  return "transparent";
21
21
  }
22
22
  else if (isLastItem && status === "active") {
23
- return theme.colors.success.c50;
23
+ return theme.colors.success.c70;
24
24
  }
25
25
  else if (status === "active") {
26
26
  return theme.colors.neutral.c40;
@@ -69,8 +69,8 @@ export default function TimelineItem({ item, formatEstimatedTime, isFirstItem, i
69
69
  : undefined }),
70
70
  React.createElement(Container, { status: item.status, isLastItem: isLastItem, mt: withExtraMarginOnActiveStep && !isFirstItem && item.status === "active" ? 4 : 0, mb: withExtraMarginOnActiveStep && !isLastItem && item.status === "active" ? 4 : 0 },
71
71
  React.createElement(Flex, { flexDirection: "row", justifyContent: "space-between" },
72
- React.createElement(Text, { variant: "body", fontWeight: "semiBold", flexShrink: 1, color: item.status === "completed" && isLastItem
73
- ? "success.c40"
72
+ React.createElement(Text, { variant: "body", fontWeight: item.status === "active" ? "semiBold" : "medium", flexShrink: 1, color: item.status === "completed" && isLastItem
73
+ ? "success.c70"
74
74
  : item.status === "active"
75
75
  ? "primary.c80"
76
76
  : "neutral.c70" }, item.status === "completed" ? (_a = item.doneTitle) !== null && _a !== void 0 ? _a : item.title : item.title),
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
2
3
  import { BaseTextProps } from "../../../Text";
3
4
  import { BaseStyledProps } from "src/components/styled";
4
5
  import { Item } from "../types";
@@ -12,8 +13,9 @@ export type Props = BaseStyledProps & {
12
13
  * Defaults to true.
13
14
  * */
14
15
  autoScroll?: boolean;
16
+ contentContainerStyle?: StyleProp<ViewStyle>;
15
17
  };
16
- declare function VerticalTimeline({ steps, formatEstimatedTime, setActiveIndex, header, autoScroll, ...props }: Props): JSX.Element;
18
+ declare function VerticalTimeline({ steps, formatEstimatedTime, setActiveIndex, header, autoScroll, contentContainerStyle, ...props }: Props): JSX.Element;
17
19
  declare namespace VerticalTimeline {
18
20
  var BodyText: React.FC<BaseTextProps>;
19
21
  var SubtitleText: React.FC<BaseTextProps>;
@@ -10,13 +10,13 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import React, { useRef, useCallback } from "react";
13
- import { ScrollView, View } from "react-native";
13
+ import { ScrollView, View, } from "react-native";
14
14
  import TimelineItem from "./TimelineItem";
15
15
  import Flex from "../../Flex";
16
16
  import Text from "../../../Text";
17
17
  import { ItemStatus } from "../types";
18
18
  export default function VerticalTimeline(_a) {
19
- var { steps, formatEstimatedTime, setActiveIndex, header, autoScroll = true } = _a, props = __rest(_a, ["steps", "formatEstimatedTime", "setActiveIndex", "header", "autoScroll"]);
19
+ var { steps, formatEstimatedTime, setActiveIndex, header, autoScroll = true, contentContainerStyle } = _a, props = __rest(_a, ["steps", "formatEstimatedTime", "setActiveIndex", "header", "autoScroll", "contentContainerStyle"]);
20
20
  const scrollViewRef = useRef(null);
21
21
  const stepsContainerLayout = useRef();
22
22
  const onStepsContainerLayout = useCallback((evt) => {
@@ -28,7 +28,7 @@ export default function VerticalTimeline(_a) {
28
28
  const { layout } = evt.nativeEvent;
29
29
  scrollViewRef.current.scrollTo({ x: 0, y: stepsContainerLayout.current.y + layout.y });
30
30
  }, []);
31
- return (React.createElement(ScrollView, { ref: scrollViewRef, onLayout: onStepsContainerLayout },
31
+ return (React.createElement(ScrollView, { ref: scrollViewRef, onLayout: onStepsContainerLayout, contentContainerStyle: contentContainerStyle },
32
32
  header,
33
33
  React.createElement(Flex, Object.assign({}, props, { onLayout: onStepsContainerLayout, flexDirection: "column" }), steps === null || steps === void 0 ? void 0 : steps.map((step, index) => (React.createElement(View, { onLayout: autoScroll && step.status === "active" ? onActiveStepLayout : undefined },
34
34
  React.createElement(TimelineItem, { key: step.title, item: step, formatEstimatedTime: formatEstimatedTime, isFirstItem: index === 0, isLastItem: index === steps.length - 1, setActiveIndex: setActiveIndex, index: index })))))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/native-ui",
3
- "version": "0.19.0-nightly.1",
3
+ "version": "0.19.1-next.0",
4
4
  "description": "Ledger Live - Mobile UI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -46,9 +46,9 @@
46
46
  "rn-range-slider": "2.1.1",
47
47
  "styled-system": "^5.1.5",
48
48
  "victory-native": "^35.5.5",
49
- "@ledgerhq/crypto-icons-ui": "^0.2.2-nightly.0",
50
- "@ledgerhq/icons-ui": "^0.4.0-nightly.1",
51
- "@ledgerhq/ui-shared": "^0.2.0-nightly.0"
49
+ "@ledgerhq/crypto-icons-ui": "^0.3.0",
50
+ "@ledgerhq/icons-ui": "^0.4.0",
51
+ "@ledgerhq/ui-shared": "^0.2.0"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@types/react": "*",
@@ -57,7 +57,7 @@
57
57
  "@types/styled-components-react-native": "^5.3.3",
58
58
  "react": ">=17",
59
59
  "react-native": ">=0.64.0",
60
- "react-native-reanimated": "^2.9.1",
60
+ "react-native-reanimated": "^3.0.0",
61
61
  "styled-components": "^5.3.3"
62
62
  },
63
63
  "devDependencies": {
@@ -65,6 +65,11 @@
65
65
  "@babel/generator": "^7.17.2",
66
66
  "@babel/plugin-proposal-class-properties": "^7.13.0",
67
67
  "@babel/plugin-proposal-export-namespace-from": "^7.16.0",
68
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
69
+ "@babel/plugin-proposal-optional-chaining": "^7.21.0",
70
+ "@babel/plugin-transform-arrow-functions": "^7.20.7",
71
+ "@babel/plugin-transform-shorthand-properties": "^7.18.6",
72
+ "@babel/plugin-transform-template-literals": "^7.18.9",
68
73
  "@babel/preset-env": "^7.15.8",
69
74
  "@babel/runtime": "^7.17.2",
70
75
  "@emotion/core": "^10.3.1",
@@ -139,17 +144,16 @@
139
144
  "react-dom": "^18",
140
145
  "react-is": "^18",
141
146
  "react-native": "0.71.6",
142
- "react-native-reanimated": "^2.15.0",
147
+ "react-native-reanimated": "^3.1.0",
143
148
  "react-native-safe-area-context": "^4.5.0",
144
149
  "react-native-web": "~0.18.12",
145
150
  "regenerator-runtime": "^0.13.9",
146
- "rimraf": "^4.1.2",
151
+ "rimraf": "^4.4.1",
147
152
  "styled-components": "^5.3.3",
148
153
  "stylelint": "^14.9.1",
149
154
  "stylelint-config-recommended": "^8.0.0",
150
155
  "stylelint-config-styled-components": "^0.1.1",
151
156
  "stylelint-processor-styled-components": "^1.10.0",
152
- "typescript": "^4.9.5",
153
157
  "util": "^0.12.5",
154
158
  "victory": "^35.5.5",
155
159
  "webpack": "^5.76.1",