@ledgerhq/native-ui 0.21.0-nightly.4 → 0.21.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.
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { FlexBoxProps } from "../Layout/Flex";
3
+ import { BaseStyledProps } from "../styled";
3
4
  export interface Props extends FlexBoxProps {
4
5
  /**
5
6
  * The index of the active step.
@@ -9,7 +10,11 @@ export interface Props extends FlexBoxProps {
9
10
  * The total number of steps.
10
11
  */
11
12
  length: number;
13
+ /**
14
+ * Style props for the bar element.
15
+ */
16
+ activeBarProps?: BaseStyledProps;
12
17
  }
13
- declare function ProgressBar({ index, length, ...props }: Props): JSX.Element;
18
+ declare function ProgressBar({ index, length, activeBarProps, ...props }: Props): JSX.Element;
14
19
  declare const _default: React.MemoExoticComponent<typeof ProgressBar>;
15
20
  export default _default;
@@ -13,8 +13,8 @@ import React from "react";
13
13
  import styled from "styled-components/native";
14
14
  import Flex from "../Layout/Flex";
15
15
  import Animated, { useDerivedValue, useAnimatedStyle, withTiming } from "react-native-reanimated";
16
- const ActiveBar = styled.View `
17
- background-color: ${(p) => p.theme.colors.neutral.c100};
16
+ import Box from "../Layout/Box";
17
+ const ActiveBar = styled(Box) `
18
18
  position: absolute;
19
19
  height: 100%;
20
20
  top: 0;
@@ -22,12 +22,12 @@ const ActiveBar = styled.View `
22
22
  `;
23
23
  const AnimatedBar = Animated.createAnimatedComponent(ActiveBar);
24
24
  function ProgressBar(_a) {
25
- var { index, length } = _a, props = __rest(_a, ["index", "length"]);
25
+ var { index, length, activeBarProps } = _a, props = __rest(_a, ["index", "length", "activeBarProps"]);
26
26
  const width = useDerivedValue(() => Math.round((index / (length - 1)) * 100), [index, length]);
27
27
  const animatedStyles = useAnimatedStyle(() => ({
28
28
  width: withTiming(`${width.value}%`),
29
29
  }));
30
30
  return (React.createElement(Flex, Object.assign({ height: 4, width: "100%", backgroundColor: "neutral.c20", position: "relative" }, props),
31
- React.createElement(AnimatedBar, { style: [animatedStyles] })));
31
+ React.createElement(AnimatedBar, Object.assign({ style: [animatedStyles], bg: "neutral.c100" }, activeBarProps))));
32
32
  }
33
33
  export default React.memo(ProgressBar);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/native-ui",
3
- "version": "0.21.0-nightly.4",
3
+ "version": "0.21.1",
4
4
  "description": "Ledger Live - Mobile UI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -47,7 +47,7 @@
47
47
  "styled-system": "^5.1.5",
48
48
  "victory-native": "^35.5.5",
49
49
  "@ledgerhq/crypto-icons-ui": "^0.5.1",
50
- "@ledgerhq/icons-ui": "^0.6.0-nightly.1",
50
+ "@ledgerhq/icons-ui": "^0.6.1",
51
51
  "@ledgerhq/ui-shared": "^0.2.1"
52
52
  },
53
53
  "peerDependencies": {