@ledgerhq/native-ui 0.31.2-nightly.0 → 0.32.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.
- package/lib/components/ProgressPoint/index.d.ts +11 -0
- package/lib/components/ProgressPoint/index.d.ts.map +1 -0
- package/lib/components/ProgressPoint/index.js +32 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FlexBoxProps } from "../Layout/Flex";
|
|
3
|
+
export interface PointProgressProps extends FlexBoxProps {
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
current: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function ProgressPoint({ start, end, current, ...props }: PointProgressProps): React.JSX.Element;
|
|
9
|
+
declare const _default: React.MemoExoticComponent<typeof ProgressPoint>;
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ProgressPoint/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAIpD,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAgBD,wBAAgB,aAAa,CAAC,EAAE,KAAS,EAAE,GAAS,EAAE,OAAW,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,qBAiBhG;;AAED,wBAAyC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styled from "styled-components/native";
|
|
3
|
+
import Flex from "../Layout/Flex";
|
|
4
|
+
import Animated, { useDerivedValue, useAnimatedStyle, withTiming } from "react-native-reanimated";
|
|
5
|
+
import Box from "../Layout/Box";
|
|
6
|
+
const Container = styled(Flex) `
|
|
7
|
+
width: 100%;
|
|
8
|
+
position: relative;
|
|
9
|
+
`;
|
|
10
|
+
const Point = styled(Box) `
|
|
11
|
+
position: absolute;
|
|
12
|
+
width: 4px;
|
|
13
|
+
height: 9px;
|
|
14
|
+
border-radius: 4px;
|
|
15
|
+
background-color: ${({ theme }) => theme.colors.primary.c100};
|
|
16
|
+
`;
|
|
17
|
+
const AnimatedPoint = Animated.createAnimatedComponent(Point);
|
|
18
|
+
export function ProgressPoint({ start = 0, end = 100, current = 0, ...props }) {
|
|
19
|
+
const percentage = useDerivedValue(() => {
|
|
20
|
+
const range = end - start;
|
|
21
|
+
if (range <= 0)
|
|
22
|
+
return 0;
|
|
23
|
+
return Math.max(0, Math.min(100, ((current - start) / range) * 100));
|
|
24
|
+
}, [start, end, current]);
|
|
25
|
+
const animatedPointStyle = useAnimatedStyle(() => ({
|
|
26
|
+
left: withTiming(`${percentage.value}%`, { duration: 300 }),
|
|
27
|
+
transform: [{ translateX: -6 }],
|
|
28
|
+
}));
|
|
29
|
+
return (React.createElement(Container, { height: 9, bg: "neutral.c40", borderRadius: 4, ...props },
|
|
30
|
+
React.createElement(AnimatedPoint, { style: animatedPointStyle })));
|
|
31
|
+
}
|
|
32
|
+
export default React.memo(ProgressPoint);
|
|
@@ -11,5 +11,6 @@ export { default as Carousel } from "./Carousel";
|
|
|
11
11
|
export * from "./Tabs";
|
|
12
12
|
export * from "./Loader";
|
|
13
13
|
export { default as ProgressBar } from "./ProgressBar";
|
|
14
|
+
export { default as ProgressPoint } from "./ProgressPoint";
|
|
14
15
|
export * as Transitions from "./transitions";
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC"}
|
package/lib/components/index.js
CHANGED
|
@@ -11,5 +11,6 @@ export { default as Carousel } from "./Carousel";
|
|
|
11
11
|
export * from "./Tabs";
|
|
12
12
|
export * from "./Loader";
|
|
13
13
|
export { default as ProgressBar } from "./ProgressBar";
|
|
14
|
+
export { default as ProgressPoint } from "./ProgressPoint";
|
|
14
15
|
import * as Transitions_1 from "./transitions";
|
|
15
16
|
export { Transitions_1 as Transitions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/native-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0-nightly.1",
|
|
4
4
|
"description": "Ledger Live - Mobile UI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"rn-range-slider": "2.1.1",
|
|
41
41
|
"styled-system": "^5.1.5",
|
|
42
42
|
"@ledgerhq/crypto-icons-ui": "^1.12.0-nightly.0",
|
|
43
|
-
"@ledgerhq/
|
|
44
|
-
"@ledgerhq/ui
|
|
43
|
+
"@ledgerhq/ui-shared": "^0.3.0",
|
|
44
|
+
"@ledgerhq/icons-ui": "^0.9.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"react": ">=17",
|