@ledgerhq/native-ui 0.45.0 → 0.46.0-nightly.1

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 (33) hide show
  1. package/lib/components/Layout/List/VerticalTimeline/TimelineIndicator.d.ts +2 -1
  2. package/lib/components/Layout/List/VerticalTimeline/TimelineIndicator.d.ts.map +1 -1
  3. package/lib/components/Layout/List/VerticalTimeline/TimelineIndicator.js +8 -8
  4. package/lib/components/Layout/List/VerticalTimeline/TimelineItem.d.ts +7 -2
  5. package/lib/components/Layout/List/VerticalTimeline/TimelineItem.d.ts.map +1 -1
  6. package/lib/components/Layout/List/VerticalTimeline/TimelineItem.js +8 -7
  7. package/lib/components/Layout/List/VerticalTimeline/index.d.ts +5 -4
  8. package/lib/components/Layout/List/VerticalTimeline/index.d.ts.map +1 -1
  9. package/lib/components/Layout/List/VerticalTimeline/index.js +2 -2
  10. package/lib/pre-ldls/components/AccountItem/AccountItem.d.ts +2 -1
  11. package/lib/pre-ldls/components/AccountItem/AccountItem.d.ts.map +1 -1
  12. package/lib/pre-ldls/components/AccountItem/AccountItem.js +2 -2
  13. package/lib/pre-ldls/components/AccountItem/AccountItem.stories.d.ts.map +1 -1
  14. package/lib/pre-ldls/components/AccountItem/AccountItem.stories.js +7 -0
  15. package/lib/pre-ldls/components/Address/Address.d.ts +2 -1
  16. package/lib/pre-ldls/components/Address/Address.d.ts.map +1 -1
  17. package/lib/pre-ldls/components/Address/Address.js +2 -2
  18. package/lib/pre-ldls/components/MarketPercentIndicator/MarketPercentIndicator.d.ts +5 -0
  19. package/lib/pre-ldls/components/MarketPercentIndicator/MarketPercentIndicator.d.ts.map +1 -0
  20. package/lib/pre-ldls/components/MarketPercentIndicator/MarketPercentIndicator.js +40 -0
  21. package/lib/pre-ldls/components/MarketPercentIndicator/MarketPercentIndicator.stories.d.ts +10 -0
  22. package/lib/pre-ldls/components/MarketPercentIndicator/MarketPercentIndicator.stories.d.ts.map +1 -0
  23. package/lib/pre-ldls/components/MarketPercentIndicator/MarketPercentIndicator.stories.js +20 -0
  24. package/lib/pre-ldls/components/MarketPriceIndicator/MarketPriceIndicator.d.ts +6 -0
  25. package/lib/pre-ldls/components/MarketPriceIndicator/MarketPriceIndicator.d.ts.map +1 -0
  26. package/lib/pre-ldls/components/MarketPriceIndicator/MarketPriceIndicator.js +35 -0
  27. package/lib/pre-ldls/components/MarketPriceIndicator/MarketPriceIndicator.stories.d.ts +10 -0
  28. package/lib/pre-ldls/components/MarketPriceIndicator/MarketPriceIndicator.stories.d.ts.map +1 -0
  29. package/lib/pre-ldls/components/MarketPriceIndicator/MarketPriceIndicator.stories.js +20 -0
  30. package/lib/pre-ldls/components/index.d.ts +2 -0
  31. package/lib/pre-ldls/components/index.d.ts.map +1 -1
  32. package/lib/pre-ldls/components/index.js +2 -0
  33. package/package.json +4 -4
@@ -5,9 +5,10 @@ export type Props = FlexProps & {
5
5
  status: ItemStatus;
6
6
  isFirstItem?: boolean;
7
7
  isLastItem?: boolean;
8
+ isNeutral?: boolean;
8
9
  topHeight?: number;
9
10
  };
10
- declare function TimelineIndicator({ status, isFirstItem, isLastItem, topHeight, ...props }: Props): React.JSX.Element;
11
+ declare function TimelineIndicator({ status, isFirstItem, isLastItem, isNeutral, topHeight, ...props }: Props): React.JSX.Element;
11
12
  declare namespace TimelineIndicator {
12
13
  var topSegmentDefaultHeight: number;
13
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TimelineIndicator.d.ts","sourceRoot":"","sources":["../../../../../src/components/Layout/List/VerticalTimeline/TimelineIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAa,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AA2GtC,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,iBAAwB,iBAAiB,CAAC,EACxC,MAAM,EACN,WAAW,EACX,UAAU,EACV,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,qBAqBP;kBA3BuB,iBAAiB;;;eAAjB,iBAAiB"}
1
+ {"version":3,"file":"TimelineIndicator.d.ts","sourceRoot":"","sources":["../../../../../src/components/Layout/List/VerticalTimeline/TimelineIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAa,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAyHtC,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,iBAAwB,iBAAiB,CAAC,EACxC,MAAM,EACN,WAAW,EACX,UAAU,EACV,SAAS,EACT,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,qBAqBP;kBA5BuB,iBAAiB;;;eAAjB,iBAAiB"}
@@ -33,8 +33,8 @@ const BottomSegmentSvg = ({ status, hidden }) => {
33
33
  React.createElement(Svg, { height: 2 * Dimensions.get("screen").height, width: linesWidth, viewBox: `0 0 ${linesWidth} ${linesLength}`, preserveAspectRatio: "xMinYMin slice" },
34
34
  React.createElement(Line, { key: status + " " + hidden, x1: "0", y1: "0", x2: "0", y2: "100%", strokeWidth: hidden ? 0 : 2 * linesWidth, stroke: strokeColor, strokeDasharray: strokeDashArray, strokeDashoffset: `${dashLength}` })))));
35
35
  };
36
- const getIconBackground = (theme, status, isLastItem) => {
37
- if (isLastItem) {
36
+ const getIconBackground = (theme, status, isLastItem, isNeutral) => {
37
+ if (isLastItem && !isNeutral) {
38
38
  if (status === "inactive")
39
39
  return theme.colors.success.c10;
40
40
  return "transparent";
@@ -46,8 +46,8 @@ const getIconBackground = (theme, status, isLastItem) => {
46
46
  return "transparent";
47
47
  }
48
48
  };
49
- const getIconBorder = (theme, status, isLastItem) => {
50
- if (isLastItem) {
49
+ const getIconBorder = (theme, status, isLastItem, isNeutral) => {
50
+ if (isLastItem && !isNeutral) {
51
51
  return theme.colors.success.c70;
52
52
  }
53
53
  else if (status === "inactive") {
@@ -59,16 +59,16 @@ const CenterCircle = styled(Flex) `
59
59
  border-radius: 9999px;
60
60
  width: 16px;
61
61
  height: 16px;
62
- background: ${(p) => getIconBackground(p.theme, p.status, p.isLastItem)};
63
- border: 2px solid ${(p) => getIconBorder(p.theme, p.status, p.isLastItem)};
62
+ background: ${(p) => getIconBackground(p.theme, p.status, p.isLastItem, p.isNeutral)};
63
+ border: 2px solid ${(p) => getIconBorder(p.theme, p.status, p.isLastItem, p.isNeutral)};
64
64
  align-items: center;
65
65
  justify-content: center;
66
66
  `;
67
- export default function TimelineIndicator({ status, isFirstItem, isLastItem, topHeight, ...props }) {
67
+ export default function TimelineIndicator({ status, isFirstItem, isLastItem, isNeutral, topHeight, ...props }) {
68
68
  const { colors } = useTheme();
69
69
  return (React.createElement(Flex, { flexDirection: "column", alignItems: "center", ...props },
70
70
  React.createElement(TopSegmentSvg, { status: status, hidden: isFirstItem, height: PixelRatio.roundToNearestPixel(topHeight || topSegmentDefaultHeight) }),
71
- React.createElement(CenterCircle, { status: status, isLastItem: isLastItem }, status === "completed" && (React.createElement(CircledCheckSolidMedium, { color: isLastItem ? colors.success.c70 : colors.primary.c80, size: 20 }))),
71
+ React.createElement(CenterCircle, { status: status, isLastItem: isLastItem, isNeutral: isNeutral }, status === "completed" && (React.createElement(CircledCheckSolidMedium, { color: isLastItem && !isNeutral ? colors.success.c70 : colors.primary.c80, size: 20 }))),
72
72
  React.createElement(BottomSegmentSvg, { status: status, hidden: isLastItem })));
73
73
  }
74
74
  TimelineIndicator.topSegmentDefaultHeight = topSegmentDefaultHeight;
@@ -1,13 +1,18 @@
1
1
  import React from "react";
2
+ import { ScrollView } from "react-native";
2
3
  import { Item } from "../types";
4
+ export interface TimelineStep extends Item {
5
+ isNeutral?: boolean;
6
+ }
3
7
  export type Props = {
4
- item: Item;
8
+ item: TimelineStep;
5
9
  formatEstimatedTime?: (_: number) => string;
6
10
  isFirstItem?: boolean;
7
11
  isLastItem?: boolean;
8
12
  setActiveIndex?: (_: number) => void;
9
13
  index: number;
10
14
  withExtraMarginOnActiveStep?: boolean;
15
+ parentScrollRef?: null | React.RefObject<ScrollView>;
11
16
  };
12
- export default function TimelineItem({ item, formatEstimatedTime, isFirstItem, isLastItem, setActiveIndex, index, withExtraMarginOnActiveStep, }: Props): React.JSX.Element;
17
+ export default function TimelineItem({ item, formatEstimatedTime, isFirstItem, isLastItem, setActiveIndex, index, withExtraMarginOnActiveStep, parentScrollRef, }: Props): React.JSX.Element;
13
18
  //# sourceMappingURL=TimelineItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimelineItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Layout/List/VerticalTimeline/TimelineItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAM3C,OAAO,EAAE,IAAI,EAAc,MAAM,UAAU,CAAC;AAM5C,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,IAAI,CAAC;IACX,mBAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AA+BF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,IAAI,EACJ,mBAAmB,EACnB,WAAW,EACX,UAAU,EACV,cAAc,EACd,KAAK,EACL,2BAA2B,GAC5B,EAAE,KAAK,qBAwFP"}
1
+ {"version":3,"file":"TimelineItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Layout/List/VerticalTimeline/TimelineItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAgC,UAAU,EAAE,MAAM,cAAc,CAAC;AAKxE,OAAO,EAAE,IAAI,EAAc,MAAM,UAAU,CAAC;AAM5C,MAAM,WAAW,YAAa,SAAQ,IAAI;IACxC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,YAAY,CAAC;IACnB,mBAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,eAAe,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;CACtD,CAAC;AAoCF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,IAAI,EACJ,mBAAmB,EACnB,WAAW,EACX,UAAU,EACV,cAAc,EACd,KAAK,EACL,2BAA2B,EAC3B,eAAsB,GACvB,EAAE,KAAK,qBA2FP"}
@@ -15,11 +15,11 @@ const getContainerBackground = (theme, status) => {
15
15
  }
16
16
  return "transparent";
17
17
  };
18
- const getContainerBorder = (theme, status, isLastItem) => {
18
+ const getContainerBorder = (theme, status, isLastItem, isNeutral) => {
19
19
  if (status === "completed") {
20
20
  return "transparent";
21
21
  }
22
- else if (isLastItem && status === "active") {
22
+ else if (isLastItem && !isNeutral && status === "active") {
23
23
  return theme.colors.success.c70;
24
24
  }
25
25
  else if (status === "active") {
@@ -31,11 +31,11 @@ const Container = styled(Flex) `
31
31
  flex: 1;
32
32
  border-radius: ${(p) => p.theme.radii[2]}px;
33
33
  background: ${(p) => getContainerBackground(p.theme, p.status)};
34
- border: 1px solid ${(p) => getContainerBorder(p.theme, p.status, p.isLastItem)};
34
+ border: 1px solid ${(p) => getContainerBorder(p.theme, p.status, p.isLastItem, p.isNeutral)};
35
35
  padding: 20px 16px;
36
36
  overflow: hidden;
37
37
  `;
38
- export default function TimelineItem({ item, formatEstimatedTime, isFirstItem, isLastItem, setActiveIndex, index, withExtraMarginOnActiveStep, }) {
38
+ export default function TimelineItem({ item, formatEstimatedTime, isFirstItem, isLastItem, setActiveIndex, index, withExtraMarginOnActiveStep, parentScrollRef = null, }) {
39
39
  const theme = useTheme();
40
40
  /**
41
41
  * Having an initial value of null will prevent having "height: 0" before the
@@ -48,7 +48,8 @@ export default function TimelineItem({ item, formatEstimatedTime, isFirstItem, i
48
48
  const sharedHeight = useSharedValue(null);
49
49
  const handleLayout = useCallback(({ nativeEvent: { layout } }) => {
50
50
  sharedHeight.value = withTiming(layout.height, { duration: 300 });
51
- }, [sharedHeight]);
51
+ parentScrollRef?.current?.scrollToEnd({ animated: true });
52
+ }, [sharedHeight, parentScrollRef]);
52
53
  const animatedStyle = useAnimatedStyle(() => ({
53
54
  /**
54
55
  * If it's null the component still renders normally at its full height
@@ -61,10 +62,10 @@ export default function TimelineItem({ item, formatEstimatedTime, isFirstItem, i
61
62
  }, [setActiveIndex, index]);
62
63
  return (React.createElement(Pressable, { onPress: handlePress },
63
64
  React.createElement(Flex, { flexDirection: "row" },
64
- React.createElement(TimelineIndicator, { status: item.status, isFirstItem: isFirstItem, isLastItem: isLastItem, mr: 4, topHeight: withExtraMarginOnActiveStep && !isFirstItem && item.status === "active"
65
+ React.createElement(TimelineIndicator, { status: item.status, isFirstItem: isFirstItem, isLastItem: isLastItem, isNeutral: item.isNeutral, mr: 4, topHeight: withExtraMarginOnActiveStep && !isFirstItem && item.status === "active"
65
66
  ? TimelineIndicator.topSegmentDefaultHeight + theme.space[4]
66
67
  : undefined }),
67
- React.createElement(Container, { status: item.status, isLastItem: isLastItem, mt: withExtraMarginOnActiveStep && !isFirstItem && item.status === "active" ? 4 : 0, mb: withExtraMarginOnActiveStep && !isLastItem && item.status === "active" ? 4 : 0 },
68
+ React.createElement(Container, { status: item.status, isLastItem: isLastItem, isNeutral: item.isNeutral, mt: withExtraMarginOnActiveStep && !isFirstItem && item.status === "active" ? 4 : 0, mb: withExtraMarginOnActiveStep && !isLastItem && item.status === "active" ? 4 : 0 },
68
69
  item.status === "active" ? item.background : null,
69
70
  React.createElement(Flex, { flexDirection: "row", justifyContent: "space-between" },
70
71
  React.createElement(Text, { variant: "body", fontWeight: item.status === "active" ? "semiBold" : "medium", flexShrink: 1, color: item.status === "completed" && isLastItem
@@ -1,10 +1,10 @@
1
1
  import React from "react";
2
- import { StyleProp, ViewStyle } from "react-native";
2
+ import { ScrollView, StyleProp, ViewStyle } from "react-native";
3
+ import { TimelineStep } from "./TimelineItem";
3
4
  import { BaseTextProps } from "../../../Text";
4
5
  import { BaseStyledProps } from "src/components/styled";
5
- import { Item } from "../types";
6
6
  export type Props = BaseStyledProps & {
7
- steps?: Item[];
7
+ steps?: TimelineStep[];
8
8
  formatEstimatedTime?: (_: number) => string;
9
9
  setActiveIndex?: (arg0: number) => void;
10
10
  header?: React.ReactNode;
@@ -14,8 +14,9 @@ export type Props = BaseStyledProps & {
14
14
  * */
15
15
  autoScroll?: boolean;
16
16
  contentContainerStyle?: StyleProp<ViewStyle>;
17
+ parentScrollRef?: null | React.RefObject<ScrollView>;
17
18
  };
18
- declare function VerticalTimeline({ steps, formatEstimatedTime, setActiveIndex, header, autoScroll, contentContainerStyle, ...props }: Props): React.JSX.Element;
19
+ declare function VerticalTimeline({ steps, formatEstimatedTime, setActiveIndex, header, autoScroll, contentContainerStyle, parentScrollRef, ...props }: Props): React.JSX.Element;
19
20
  declare namespace VerticalTimeline {
20
21
  var BodyText: React.FC<BaseTextProps>;
21
22
  var SubtitleText: React.FC<BaseTextProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Layout/List/VerticalTimeline/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAKL,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAItB,OAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAc,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,KAAK,GAAG,eAAe,GAAG;IACpC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,mBAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;SAGK;IACL,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qBAAqB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9C,CAAC;AAEF,iBAAwB,gBAAgB,CAAC,EACvC,KAAK,EACL,mBAAmB,EACnB,cAAc,EACd,MAAM,EACN,UAAiB,EACjB,qBAAqB,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,qBAsCP;kBA9CuB,gBAAgB;;;;;eAAhB,gBAAgB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Layout/List/VerticalTimeline/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAEL,UAAU,EAGV,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAqB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,MAAM,MAAM,KAAK,GAAG,eAAe,GAAG;IACpC,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,mBAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;SAGK;IACL,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qBAAqB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAI7C,eAAe,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;CACtD,CAAC;AAEF,iBAAwB,gBAAgB,CAAC,EACvC,KAAK,EACL,mBAAmB,EACnB,cAAc,EACd,MAAM,EACN,UAAiB,EACjB,qBAAqB,EACrB,eAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,qBAuCP;kBAhDuB,gBAAgB;;;;;eAAhB,gBAAgB"}
@@ -4,7 +4,7 @@ import TimelineItem from "./TimelineItem";
4
4
  import Flex from "../../Flex";
5
5
  import Text from "../../../Text";
6
6
  import { ItemStatus } from "../types";
7
- export default function VerticalTimeline({ steps, formatEstimatedTime, setActiveIndex, header, autoScroll = true, contentContainerStyle, ...props }) {
7
+ export default function VerticalTimeline({ steps, formatEstimatedTime, setActiveIndex, header, autoScroll = true, contentContainerStyle, parentScrollRef = null, ...props }) {
8
8
  const scrollViewRef = useRef(null);
9
9
  const stepsContainerLayout = useRef();
10
10
  const onStepsContainerLayout = useCallback((evt) => {
@@ -19,7 +19,7 @@ export default function VerticalTimeline({ steps, formatEstimatedTime, setActive
19
19
  return (React.createElement(ScrollView, { ref: scrollViewRef, onLayout: onStepsContainerLayout, contentContainerStyle: contentContainerStyle },
20
20
  header,
21
21
  React.createElement(Flex, { ...props, onLayout: onStepsContainerLayout, flexDirection: "column" }, steps?.map((step, index) => (React.createElement(View, { onLayout: autoScroll && step.status === "active" ? onActiveStepLayout : undefined },
22
- React.createElement(TimelineItem, { key: step.title, item: step, formatEstimatedTime: formatEstimatedTime, isFirstItem: index === 0, isLastItem: index === steps.length - 1, setActiveIndex: setActiveIndex, index: index })))))));
22
+ React.createElement(TimelineItem, { key: step.title, item: step, formatEstimatedTime: formatEstimatedTime, isFirstItem: index === 0, isLastItem: index === steps.length - 1, setActiveIndex: setActiveIndex, index: index, parentScrollRef: parentScrollRef })))))));
23
23
  }
24
24
  const SubtitleText = (props) => (React.createElement(Text, { variant: "body", fontWeight: "semiBold", color: "neutral.c100", mb: 3, ...props }));
25
25
  const BodyText = (props) => (React.createElement(Text, { variant: "bodyLineHeight", fontWeight: "medium", color: "neutral.c80", ...props }));
@@ -32,6 +32,7 @@ export type AccountItemProps = {
32
32
  rightElement?: RightElement;
33
33
  showIcon?: boolean;
34
34
  backgroundColor?: string;
35
+ cryptoIconBackgroundColor: string;
35
36
  };
36
- export declare const AccountItem: ({ onClick, account, rightElement, showIcon, backgroundColor, }: AccountItemProps) => React.JSX.Element;
37
+ export declare const AccountItem: ({ onClick, account, rightElement, showIcon, backgroundColor, cryptoIconBackgroundColor, }: AccountItemProps) => React.JSX.Element;
37
38
  //# sourceMappingURL=AccountItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccountItem.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/AccountItem/AccountItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE;QACR,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;QACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,gBAAgB,CAAC;AAEvF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,SAAS,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAkGF,eAAO,MAAM,WAAW,mEAMrB,gBAAgB,sBA6FlB,CAAC"}
1
+ {"version":3,"file":"AccountItem.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/AccountItem/AccountItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE;QACR,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;QACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,gBAAgB,CAAC;AAEvF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,SAAS,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yBAAyB,EAAE,MAAM,CAAC;CACnC,CAAC;AAkGF,eAAO,MAAM,WAAW,8FAOrB,gBAAgB,sBA8FlB,CAAC"}
@@ -70,7 +70,7 @@ const RightElementRenderer = ({ rightElement, tokens, onEditPress }) => {
70
70
  rightElement.type === "edit" && (React.createElement(IconButton, { onPress: onEditPress, testID: "right-element-edit-icon" },
71
71
  React.createElement(PenMedium, { size: 16, color: String(tokens["colors-content-default-default"]) })))));
72
72
  };
73
- export const AccountItem = ({ onClick, account, rightElement, showIcon = true, backgroundColor, }) => {
73
+ export const AccountItem = ({ onClick, account, rightElement, showIcon = true, backgroundColor, cryptoIconBackgroundColor, }) => {
74
74
  const theme = useTheme();
75
75
  const colorType = theme.colors.type === "dark" ? "dark" : "light";
76
76
  const tokens = useTokens(colorType, [
@@ -106,7 +106,7 @@ export const AccountItem = ({ onClick, account, rightElement, showIcon = true, b
106
106
  React.createElement(Text, { variant: "largeLineHeight", fontWeight: "semiBold", color: String(tokens["colors-content-default-default"]), fontSize: "18px", numberOfLines: 1, ellipsizeMode: "tail" }, name)),
107
107
  protocol && (React.createElement(TagWrapper, { style: { marginLeft: Number(tokens["spacing-xs"]) } },
108
108
  React.createElement(Tag, { textTransform: "uppercase" }, protocol)))),
109
- React.createElement(Address, { address: address, cryptoId: cryptoId, ticker: ticker, parentId: parentId, showIcon: showIcon })),
109
+ React.createElement(Address, { address: address, cryptoId: cryptoId, ticker: ticker, parentId: parentId, showIcon: showIcon, backgroundColor: cryptoIconBackgroundColor })),
110
110
  React.createElement(BalanceContainer, { style: { gap: Number(tokens["spacing-xxxs"]) } },
111
111
  fiatValue && (React.createElement(Text, { fontSize: "18px", color: String(tokens["colors-content-default-default"]) }, fiatValue)),
112
112
  balance && (React.createElement(Text, { fontSize: "14px", color: String(tokens["colors-content-subdued-default-default"]) }, balance))),
@@ -1 +1 @@
1
- {"version":3,"file":"AccountItem.stories.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/AccountItem/AccountItem.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAwBlC,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAC;AAE1C,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,WAAW,EAAE,KAczB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAajC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAYpC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAoB9B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAc3B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAgB1B,CAAC"}
1
+ {"version":3,"file":"AccountItem.stories.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/AccountItem/AccountItem.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAyBlC,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAC;AAE1C,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,WAAW,EAAE,KAezB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAcjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAapC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAqB9B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAe3B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAiB1B,CAAC"}
@@ -14,6 +14,7 @@ const meta = {
14
14
  id: "12345",
15
15
  name: "Main BTC",
16
16
  ticker: "btc",
17
+ cryptoIconBackgroundColor: "red",
17
18
  },
18
19
  },
19
20
  parameters: {
@@ -38,6 +39,7 @@ export const TestAccount = {
38
39
  name: "Main BTC",
39
40
  protocol: "Native Segwit",
40
41
  ticker: "btc",
42
+ cryptoIconBackgroundColor: "red",
41
43
  },
42
44
  },
43
45
  };
@@ -52,6 +54,7 @@ export const TestWithoutProtocol = {
52
54
  id: "21345",
53
55
  name: "Main BTC",
54
56
  ticker: "btc",
57
+ cryptoIconBackgroundColor: "red",
55
58
  },
56
59
  },
57
60
  };
@@ -64,6 +67,7 @@ export const TestWithoutAddressIcon = {
64
67
  fiatValue: "$5,969.83",
65
68
  id: "bitcoin",
66
69
  name: "Main BTC",
70
+ cryptoIconBackgroundColor: "red",
67
71
  },
68
72
  showIcon: false,
69
73
  },
@@ -78,6 +82,7 @@ export const TestWithCheckbox = {
78
82
  id: "12345",
79
83
  name: "Main BTC",
80
84
  ticker: "btc",
85
+ cryptoIconBackgroundColor: "red",
81
86
  },
82
87
  onClick: onClick,
83
88
  rightElement: {
@@ -98,6 +103,7 @@ export const TestWithArrow = {
98
103
  id: "12345",
99
104
  name: "Main BTC",
100
105
  ticker: "btc",
106
+ cryptoIconBackgroundColor: "red",
101
107
  },
102
108
  rightElement: {
103
109
  type: "arrow",
@@ -113,6 +119,7 @@ export const TestWithEdit = {
113
119
  id: "12345",
114
120
  name: "Main BTC",
115
121
  ticker: "btc",
122
+ cryptoIconBackgroundColor: "red",
116
123
  },
117
124
  onClick: undefined,
118
125
  rightElement: {
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
- export declare const Address: ({ address, showIcon, cryptoId, ticker, parentId, }: {
2
+ export declare const Address: ({ address, showIcon, cryptoId, ticker, parentId, backgroundColor, }: {
3
3
  address: string;
4
4
  showIcon: boolean;
5
5
  cryptoId?: string | undefined;
6
6
  ticker?: string | undefined;
7
7
  parentId?: string | undefined;
8
+ backgroundColor: string;
8
9
  }) => React.JSX.Element;
9
10
  //# sourceMappingURL=Address.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Address.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/Address/Address.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,eAAO,MAAM,OAAO;aAOT,MAAM;cACL,OAAO;;;;uBAqBlB,CAAC"}
1
+ {"version":3,"file":"Address.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/Address/Address.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,eAAO,MAAM,OAAO;aAQT,MAAM;cACL,OAAO;;;;qBAIA,MAAM;uBA2BxB,CAAC"}
@@ -8,11 +8,11 @@ const Wrapper = styled(View) `
8
8
  flex-direction: row;
9
9
  align-items: center;
10
10
  `;
11
- export const Address = ({ address, showIcon, cryptoId, ticker, parentId, }) => {
11
+ export const Address = ({ address, showIcon, cryptoId, ticker, parentId, backgroundColor, }) => {
12
12
  const { theme } = useTheme();
13
13
  const colorType = theme;
14
14
  const tokens = useTokens(colorType, ["spacing-xxxs", "colors-content-subdued-default-default"]);
15
15
  return (React.createElement(Wrapper, null,
16
16
  React.createElement(Text, { fontSize: "14px", color: String(tokens["colors-content-subdued-default-default"]), marginRight: showIcon ? Number(tokens["spacing-xxxs"]) : 0 }, address),
17
- showIcon && React.createElement(CryptoIcon, { ledgerId: cryptoId, network: parentId, ticker: ticker, size: 20 })));
17
+ showIcon && (React.createElement(CryptoIcon, { ledgerId: cryptoId, network: parentId, ticker: ticker, size: 20, theme: theme, backgroundColor: backgroundColor }))));
18
18
  };
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ export declare const MarketPercentIndicator: ({ percent }: {
3
+ percent: number;
4
+ }) => React.JSX.Element;
5
+ //# sourceMappingURL=MarketPercentIndicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarketPercentIndicator.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/MarketPercentIndicator/MarketPercentIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA2B1B,eAAO,MAAM,sBAAsB;aAA4B,MAAM;uBA6BpE,CAAC"}
@@ -0,0 +1,40 @@
1
+ import React from "react";
2
+ import { Flex, Text } from "../../../components";
3
+ import { useTokens } from "../../libs";
4
+ import { useTheme } from "styled-components/native";
5
+ const getPercentageDisplay = (percent, tokens) => {
6
+ if (percent > 0) {
7
+ return {
8
+ backgroundColor: String(tokens["colors-surface-status-success-default"]),
9
+ color: String(tokens["colors-surface-status-success-strong-default"]),
10
+ text: `+${percent}%`,
11
+ };
12
+ }
13
+ if (percent < 0) {
14
+ return {
15
+ backgroundColor: String(tokens["colors-surface-status-error-default"]),
16
+ color: String(tokens["colors-surface-status-error-strong-default"]),
17
+ text: `-${Math.abs(percent)}%`,
18
+ };
19
+ }
20
+ return {
21
+ backgroundColor: String(tokens["colors-surface-transparent-hover"]),
22
+ color: String(tokens["colors-content-default-default"]),
23
+ text: `${percent}%`,
24
+ };
25
+ };
26
+ export const MarketPercentIndicator = ({ percent }) => {
27
+ const { theme } = useTheme();
28
+ const colorType = theme;
29
+ const tokens = useTokens(colorType, [
30
+ "colors-surface-status-success-default",
31
+ "colors-surface-status-success-strong-default",
32
+ "colors-surface-status-error-default",
33
+ "colors-surface-status-error-strong-default",
34
+ "colors-surface-transparent-hover",
35
+ "colors-content-default-default",
36
+ ]);
37
+ const percentageDisplay = getPercentageDisplay(percent, tokens);
38
+ return (React.createElement(Flex, { "data-testid": "market-percent-indicator", flexDirection: "column", alignItems: "flex-end", width: "fit-content", p: "4px", borderRadius: "4px", backgroundColor: percentageDisplay.backgroundColor },
39
+ React.createElement(Text, { color: percentageDisplay.color, fontSize: "12px" }, percentageDisplay.text)));
40
+ };
@@ -0,0 +1,10 @@
1
+ import { type Meta, type StoryObj } from "@storybook/react";
2
+ import { MarketPercentIndicator } from "./MarketPercentIndicator";
3
+ declare const meta: Meta<typeof MarketPercentIndicator>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MarketPercentIndicator>;
6
+ export declare const Positive: Story;
7
+ export declare const Negative: Story;
8
+ export declare const Zero: Story;
9
+ export declare const TestMarketPercentIndicator: Story;
10
+ //# sourceMappingURL=MarketPercentIndicator.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarketPercentIndicator.stories.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/MarketPercentIndicator/MarketPercentIndicator.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,sBAAsB,CAK7C,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAErD,eAAO,MAAM,QAAQ,EAAE,KAAiC,CAAC;AACzD,eAAO,MAAM,QAAQ,EAAE,KAAkC,CAAC;AAC1D,eAAO,MAAM,IAAI,EAAE,KAAgC,CAAC;AAEpD,eAAO,MAAM,0BAA0B,EAAE,KAMxC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { MarketPercentIndicator } from "./MarketPercentIndicator";
2
+ import { expect } from "@storybook/jest";
3
+ import { within } from "@storybook/testing-library";
4
+ const meta = {
5
+ component: MarketPercentIndicator,
6
+ title: "PreLdls/Components/MarketPercentIndicator",
7
+ tags: ["autodocs"],
8
+ args: { percent: 30 },
9
+ };
10
+ export default meta;
11
+ export const Positive = { args: { percent: 30 } };
12
+ export const Negative = { args: { percent: -30 } };
13
+ export const Zero = { args: { percent: 0 } };
14
+ export const TestMarketPercentIndicator = {
15
+ play: async ({ canvasElement }) => {
16
+ const canvas = within(canvasElement);
17
+ const input = canvas.getByTestId("market-percent-indicator");
18
+ await expect(input).toHaveTextContent("+30%");
19
+ },
20
+ };
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ export declare const MarketPriceIndicator: ({ percent, price }: {
3
+ percent: number;
4
+ price: string;
5
+ }) => React.JSX.Element;
6
+ //# sourceMappingURL=MarketPriceIndicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarketPriceIndicator.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/MarketPriceIndicator/MarketPriceIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAwB1B,eAAO,MAAM,oBAAoB;aAAmC,MAAM;WAAS,MAAM;uBA0BxF,CAAC"}
@@ -0,0 +1,35 @@
1
+ import React from "react";
2
+ import { useTokens } from "../../libs";
3
+ import { useTheme } from "styled-components/native";
4
+ import { Flex, Text } from "../../../components";
5
+ const getPercentageDisplay = (percent, tokens) => {
6
+ if (percent > 0) {
7
+ return {
8
+ color: String(tokens["colors-surface-status-success-strong-default"]),
9
+ text: `+${percent}%`,
10
+ };
11
+ }
12
+ if (percent < 0) {
13
+ return {
14
+ color: String(tokens["colors-surface-status-error-strong-default"]),
15
+ text: `-${Math.abs(percent)}%`,
16
+ };
17
+ }
18
+ return {
19
+ color: String(tokens["colors-content-default-default"]),
20
+ text: `${percent}%`,
21
+ };
22
+ };
23
+ export const MarketPriceIndicator = ({ percent, price }) => {
24
+ const { theme } = useTheme();
25
+ const colorType = theme;
26
+ const tokens = useTokens(colorType, [
27
+ "colors-surface-status-success-strong-default",
28
+ "colors-surface-status-error-strong-default",
29
+ "colors-content-default-default",
30
+ ]);
31
+ const percentageDisplay = getPercentageDisplay(percent, tokens);
32
+ return (React.createElement(Flex, { "data-testid": "market-price-indicator", flexDirection: "column", alignItems: "flex-end", width: "fit-content" },
33
+ React.createElement(Text, { variant: "body", fontWeight: "semiBold", mb: "4px" }, price),
34
+ React.createElement(Text, { color: percentageDisplay.color, fontSize: "12px" }, percentageDisplay.text)));
35
+ };
@@ -0,0 +1,10 @@
1
+ import { type Meta, type StoryObj } from "@storybook/react";
2
+ import { MarketPriceIndicator } from "./MarketPriceIndicator";
3
+ declare const meta: Meta<typeof MarketPriceIndicator>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MarketPriceIndicator>;
6
+ export declare const Positive: Story;
7
+ export declare const Negative: Story;
8
+ export declare const Zero: Story;
9
+ export declare const TestMarketPriceIndicator: Story;
10
+ //# sourceMappingURL=MarketPriceIndicator.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarketPriceIndicator.stories.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/MarketPriceIndicator/MarketPriceIndicator.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,oBAAoB,CAK3C,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEnD,eAAO,MAAM,QAAQ,EAAE,KAAuD,CAAC;AAC/E,eAAO,MAAM,QAAQ,EAAE,KAAwD,CAAC;AAChF,eAAO,MAAM,IAAI,EAAE,KAAsD,CAAC;AAE1E,eAAO,MAAM,wBAAwB,EAAE,KAMtC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { MarketPriceIndicator } from "./MarketPriceIndicator";
2
+ import { expect } from "@storybook/jest";
3
+ import { within } from "@storybook/testing-library";
4
+ const meta = {
5
+ component: MarketPriceIndicator,
6
+ title: "PreLdls/Components/MarketPriceIndicator",
7
+ tags: ["autodocs"],
8
+ args: { percent: 30, price: "$100,000.00" },
9
+ };
10
+ export default meta;
11
+ export const Positive = { args: { percent: 30, price: "$100,000.00" } };
12
+ export const Negative = { args: { percent: -30, price: "$100,000.00" } };
13
+ export const Zero = { args: { percent: 0, price: "$100,000.00" } };
14
+ export const TestMarketPriceIndicator = {
15
+ play: async ({ canvasElement }) => {
16
+ const canvas = within(canvasElement);
17
+ const input = canvas.getByTestId("market-price-indicator");
18
+ await expect(input).toHaveTextContent("$100,000.00");
19
+ },
20
+ };
@@ -2,6 +2,8 @@ export * from "./Input/Input";
2
2
  export * from "./AssetItem/AssetItem";
3
3
  export * from "./AssetTypeList/AssetList";
4
4
  export * from "./ApyIndicator/ApyIndicator";
5
+ export * from "./MarketPriceIndicator/MarketPriceIndicator";
6
+ export * from "./MarketPercentIndicator/MarketPercentIndicator";
5
7
  export * from "./NetworkItem/NetworkItem";
6
8
  export * from "./NetworkList/NetworkList";
7
9
  export * from "./Tag/Tag";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pre-ldls/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pre-ldls/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qCAAqC,CAAC"}
@@ -2,6 +2,8 @@ export * from "./Input/Input";
2
2
  export * from "./AssetItem/AssetItem";
3
3
  export * from "./AssetTypeList/AssetList";
4
4
  export * from "./ApyIndicator/ApyIndicator";
5
+ export * from "./MarketPriceIndicator/MarketPriceIndicator";
6
+ export * from "./MarketPercentIndicator/MarketPercentIndicator";
5
7
  export * from "./NetworkItem/NetworkItem";
6
8
  export * from "./NetworkList/NetworkList";
7
9
  export * from "./Tag/Tag";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/native-ui",
3
- "version": "0.45.0",
3
+ "version": "0.46.0-nightly.1",
4
4
  "description": "Ledger Live - Mobile UI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -40,9 +40,9 @@
40
40
  "react-native-modal": "14.0.0-rc.1",
41
41
  "rn-range-slider": "2.1.1",
42
42
  "styled-system": "^5.1.5",
43
- "@ledgerhq/crypto-icons-ui": "^1.18.0",
44
- "@ledgerhq/icons-ui": "^0.13.0",
45
- "@ledgerhq/ui-shared": "^0.4.0"
43
+ "@ledgerhq/icons-ui": "^0.14.0-nightly.0",
44
+ "@ledgerhq/ui-shared": "^0.4.0",
45
+ "@ledgerhq/crypto-icons-ui": "^1.19.0-nightly.1"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "react": ">=17",