@ledgerhq/native-ui 0.4.0 → 0.6.2

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 (124) hide show
  1. package/README.md +1 -4
  2. package/assets/logos/LedgerLiveAltRegular.d.ts +0 -1
  3. package/assets/logos/LedgerLiveRegular.d.ts +0 -1
  4. package/components/Carousel/index.d.ts +45 -0
  5. package/components/Carousel/index.js +74 -0
  6. package/components/Form/Checkbox/index.d.ts +3 -3
  7. package/components/Form/Checkbox/index.js +1 -1
  8. package/components/Form/Input/BaseInput/index.d.ts +83 -5
  9. package/components/Form/Input/BaseInput/index.js +6 -6
  10. package/components/Form/Input/LegendInput/index.d.ts +14 -3
  11. package/components/Form/Input/LegendInput/index.js +3 -2
  12. package/components/Form/Input/NumberInput/index.d.ts +16 -5
  13. package/components/Form/Input/NumberInput/index.js +5 -4
  14. package/components/Form/Input/QrCodeInput/index.d.ts +15 -4
  15. package/components/Form/Input/QrCodeInput/index.js +3 -2
  16. package/components/Form/Input/SearchInput/index.d.ts +13 -2
  17. package/components/Form/Input/SearchInput/index.js +3 -2
  18. package/components/Form/SelectableList.d.ts +12 -3
  19. package/components/Form/SelectableList.js +9 -8
  20. package/components/Form/Slider/index.d.ts +0 -1
  21. package/components/Form/Slider/index.native.d.ts +0 -1
  22. package/components/Form/Slider/index.native.js +1 -1
  23. package/components/Form/Switch/index.d.ts +1 -2
  24. package/components/Form/Switch/index.js +2 -2
  25. package/components/Form/Toggle/index.d.ts +1 -2
  26. package/components/Form/Toggle/index.js +1 -1
  27. package/components/Form/index.d.ts +1 -0
  28. package/components/Form/index.js +1 -0
  29. package/components/Icon/BoxedIcon.d.ts +49 -0
  30. package/components/Icon/BoxedIcon.js +85 -0
  31. package/components/Icon/Icon.d.ts +9 -0
  32. package/components/Icon/Icon.js +20 -0
  33. package/components/Icon/IconBox/index.d.ts +2 -4
  34. package/components/Icon/IconBox/index.js +1 -2
  35. package/components/Icon/index.d.ts +2 -0
  36. package/components/Icon/index.js +2 -0
  37. package/components/Icon/type.d.ts +7 -0
  38. package/components/Icon/type.js +1 -0
  39. package/components/Layout/Box/index.d.ts +11 -0
  40. package/components/Layout/Box/index.js +3 -0
  41. package/components/Layout/Collapse/Accordion/index.js +1 -1
  42. package/components/Layout/Flex/index.d.ts +11 -12
  43. package/components/Layout/Flex/index.js +2 -8
  44. package/components/Layout/List/IconBoxList/index.d.ts +10 -0
  45. package/components/Layout/List/IconBoxList/index.js +19 -0
  46. package/components/Layout/List/List/index.d.ts +13 -0
  47. package/components/Layout/List/List/index.js +29 -0
  48. package/components/Layout/List/NumberedList/index.d.ts +9 -0
  49. package/components/Layout/List/NumberedList/index.js +20 -0
  50. package/components/Layout/List/TipList/index.d.ts +9 -0
  51. package/components/Layout/List/TipList/index.js +20 -0
  52. package/components/Layout/List/index.d.ts +4 -0
  53. package/components/Layout/List/index.js +4 -0
  54. package/components/Layout/ScrollContainer/index.d.ts +2 -1
  55. package/components/Layout/ScrollContainer/index.js +2 -2
  56. package/components/Layout/ScrollContainerHeader/Header.d.ts +1 -2
  57. package/components/Layout/ScrollContainerHeader/Header.js +23 -16
  58. package/components/Layout/ScrollContainerHeader/index.d.ts +3 -2
  59. package/components/Layout/ScrollContainerHeader/index.js +9 -4
  60. package/components/Layout/index.d.ts +2 -0
  61. package/components/Layout/index.js +2 -0
  62. package/components/Loader/InfiniteLoader/index.d.ts +9 -0
  63. package/components/Loader/InfiniteLoader/index.js +58 -0
  64. package/components/Loader/ProgressLoader/index.d.ts +11 -0
  65. package/components/Loader/ProgressLoader/index.js +24 -0
  66. package/components/Loader/index.d.ts +2 -11
  67. package/components/Loader/index.js +2 -24
  68. package/components/Navigation/FlowStepper/index.d.ts +70 -0
  69. package/components/Navigation/FlowStepper/index.js +36 -0
  70. package/components/Navigation/SlideIndicator/index.d.ts +1 -1
  71. package/components/Navigation/SlideIndicator/index.js +13 -7
  72. package/components/Navigation/Stepper/index.d.ts +1 -1
  73. package/components/Navigation/Stepper/index.js +4 -4
  74. package/components/Navigation/index.d.ts +1 -0
  75. package/components/Navigation/index.js +1 -0
  76. package/components/ProgressBar/index.d.ts +15 -0
  77. package/components/ProgressBar/index.js +33 -0
  78. package/components/Tabs/Chip/index.d.ts +5 -0
  79. package/components/Tabs/Chip/index.js +20 -0
  80. package/components/Tabs/Graph/index.d.ts +5 -0
  81. package/components/Tabs/Graph/index.js +21 -0
  82. package/components/Tabs/TemplateTabs/index.d.ts +29 -0
  83. package/components/Tabs/TemplateTabs/index.js +14 -0
  84. package/components/Tabs/index.d.ts +2 -0
  85. package/components/Tabs/index.js +2 -0
  86. package/components/Text/getTextStyle.d.ts +1 -0
  87. package/components/Text/getTextStyle.js +5 -0
  88. package/components/Text/index.d.ts +6 -8
  89. package/components/Text/index.js +15 -8
  90. package/components/chart/index.d.ts +0 -1
  91. package/components/cta/Button/index.d.ts +5 -15
  92. package/components/cta/Button/index.js +21 -24
  93. package/components/cta/Link/index.js +1 -5
  94. package/components/index.d.ts +5 -2
  95. package/components/index.js +6 -2
  96. package/components/message/Alert/index.d.ts +1 -2
  97. package/components/message/Alert/index.js +2 -2
  98. package/components/{drawer → message}/Notification/index.d.ts +5 -4
  99. package/components/{drawer → message}/Notification/index.js +16 -12
  100. package/components/message/index.d.ts +1 -0
  101. package/components/message/index.js +1 -0
  102. package/components/styled.d.ts +15 -0
  103. package/components/styled.js +12 -0
  104. package/components/transitions/Fade.d.ts +5 -0
  105. package/components/transitions/Fade.js +32 -0
  106. package/components/transitions/Slide.d.ts +11 -0
  107. package/components/transitions/Slide.js +49 -0
  108. package/components/transitions/Transition.d.ts +49 -0
  109. package/components/transitions/Transition.js +39 -0
  110. package/components/transitions/index.d.ts +4 -0
  111. package/components/transitions/index.js +4 -0
  112. package/components/transitions/types.d.ts +21 -0
  113. package/components/transitions/types.js +1 -0
  114. package/package.json +4 -4
  115. package/styles/StyleProvider.d.ts +1 -1
  116. package/styles/StyleProvider.js +1 -1
  117. package/styles/helpers.js +1 -3
  118. package/styles/theme.js +2 -0
  119. package/assets/fonts/.DS_Store +0 -0
  120. package/assets/fonts/alpha/.DS_Store +0 -0
  121. package/components/Navigation/ToggleGroup/index.d.ts +0 -15
  122. package/components/Navigation/ToggleGroup/index.js +0 -25
  123. package/components/drawer/index.d.ts +0 -1
  124. package/components/drawer/index.js +0 -1
@@ -0,0 +1,9 @@
1
+ /// <reference types="styled-components-react-native" />
2
+ import React from "react";
3
+ import { SizeProps } from "styled-system";
4
+ declare const Loader: import("styled-components").StyledComponent<import("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
+ export declare type Props = React.ComponentProps<typeof Loader> & {
6
+ color?: string;
7
+ };
8
+ export default function InfiniteLoader({ size, color, ...extraProps }: Props): JSX.Element;
9
+ export {};
@@ -0,0 +1,58 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React, { useEffect } from "react";
13
+ import Svg, { LinearGradient, Stop, Mask, Path, Rect } from "react-native-svg";
14
+ import styled from "styled-components/native";
15
+ import { system, size } from "styled-system";
16
+ import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withTiming, cancelAnimation, Easing, } from "react-native-reanimated";
17
+ const strokeSystem = system({
18
+ stroke: {
19
+ property: "stroke",
20
+ scale: "colors",
21
+ },
22
+ });
23
+ const Loader = styled(Svg).attrs((props) => (Object.assign({}, strokeSystem(props)))) `
24
+ ${size}
25
+ `;
26
+ export default function InfiniteLoader(_a) {
27
+ var { size = 38, color = "primary.c50" } = _a, extraProps = __rest(_a, ["size", "color"]);
28
+ const rotation = useSharedValue(0);
29
+ const animatedStyles = useAnimatedStyle(() => {
30
+ return {
31
+ transform: [
32
+ {
33
+ rotateZ: `${rotation.value}deg`,
34
+ },
35
+ ],
36
+ };
37
+ }, [rotation.value]);
38
+ useEffect(() => {
39
+ rotation.value = withRepeat(withTiming(360, {
40
+ duration: 1000,
41
+ easing: Easing.linear,
42
+ }), -1);
43
+ return () => cancelAnimation(rotation);
44
+ // eslint-disable-next-line react-hooks/exhaustive-deps
45
+ }, []);
46
+ return (React.createElement(Animated.View, { style: [{ display: "flex", justifyContent: "center", alignItems: "center" }, animatedStyles] },
47
+ React.createElement(Loader, Object.assign({ size: size, stroke: color, viewBox: "0 0 38 38", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, extraProps),
48
+ React.createElement(LinearGradient, { id: "gradient-start", gradientUnits: "userSpaceOnUse", gradientTransform: "rotate(-20)" },
49
+ React.createElement(Stop, { offset: 0, stopColor: "white", stopOpacity: 0.5 }),
50
+ React.createElement(Stop, { offset: 1, stopColor: "white", stopOpacity: 1 })),
51
+ React.createElement(LinearGradient, { id: "gradient-end", gradientUnits: "userSpaceOnUse", gradientTransform: "rotate(-20)" },
52
+ React.createElement(Stop, { offset: 0, stopColor: "white", stopOpacity: 0.5 }),
53
+ React.createElement(Stop, { offset: 1, stopColor: "white", stopOpacity: 0 })),
54
+ React.createElement(Mask, { id: "gradient-mask" },
55
+ React.createElement(Rect, { x: 0, y: -4, width: 44, height: 22, strokeWidth: 0, fill: "url(#gradient-start)", transform: "rotate(10)" }),
56
+ React.createElement(Rect, { x: 0, y: 18, width: 44, height: 21, strokeWidth: 0, fill: "url(#gradient-end)", transform: "rotate(10)" })),
57
+ React.createElement(Path, { d: "M34.8807 20.9499C35.3608 17.0398 34.3815 13.09 32.1304 9.85712C29.8793 6.6242 26.5146 4.33541 22.6808 3.42914C18.847 2.52287 14.8136 3.06283 11.3532 4.94559C7.89277 6.82836 5.24858 9.92158 3.92708 13.6328C2.60558 17.344 2.69968 21.4123 4.19135 25.0584C5.68302 28.7045 8.4674 31.6722 12.0112 33.3929C15.5549 35.1137 19.609 35.4666 23.3968 34.384C27.1846 33.3015 30.4398 30.8596 32.5391 27.526", strokeWidth: 6, strokeLinecap: "round", strokeLinejoin: "round", mask: "url(#gradient-mask)" }))));
58
+ }
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ declare type Props = {
3
+ progress?: number;
4
+ onPress?: () => void;
5
+ Icon?: React.ComponentType<{
6
+ color: string;
7
+ size: number;
8
+ }>;
9
+ };
10
+ declare const ProgressLoader: ({ progress, onPress, Icon }: Props) => React.ReactElement;
11
+ export default ProgressLoader;
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import { Svg, Circle, G } from "react-native-svg";
3
+ import { useTheme } from "styled-components/native";
4
+ import { TouchableOpacity } from "react-native";
5
+ const radius = 25;
6
+ const strokeWidth = 2;
7
+ const normalizedRadius = radius - strokeWidth / 2;
8
+ const circumference = normalizedRadius * 2 * Math.PI;
9
+ const iconSize = radius * 0.88;
10
+ const iconOffset = radius - iconSize / 2;
11
+ const ProgressLoader = ({ progress = 0, onPress, Icon }) => {
12
+ const { colors } = useTheme();
13
+ const backgroundColor = colors.primary.c20;
14
+ const progressColor = colors.primary.c90;
15
+ const strokeDashoffset = circumference - progress * circumference;
16
+ return (React.createElement(TouchableOpacity, { disabled: !onPress, onPress: onPress },
17
+ React.createElement(Svg, { width: radius * 2, height: radius * 2 },
18
+ React.createElement(Circle, { cx: radius, cy: radius, r: radius * 0.92, fill: "transparent", stroke: backgroundColor, strokeDashoffset: 0, strokeWidth: strokeWidth }),
19
+ React.createElement(G, { transform: `rotate(-90) translate(-${radius * 2}, 0)` },
20
+ React.createElement(Circle, { cx: radius, cy: radius, r: radius * 0.92, fill: "transparent", stroke: progressColor, strokeWidth: strokeWidth, strokeDasharray: `${circumference} ${circumference}`, strokeDashoffset: strokeDashoffset })),
21
+ Icon ? (React.createElement(G, { transform: `translate(${iconOffset}, ${iconOffset})` },
22
+ React.createElement(Icon, { color: progressColor, size: iconSize }))) : null)));
23
+ };
24
+ export default ProgressLoader;
@@ -1,11 +1,2 @@
1
- import React from "react";
2
- declare type Props = {
3
- progress?: number;
4
- onPress?: () => void;
5
- Icon?: React.ComponentType<{
6
- color: string;
7
- size: number;
8
- }>;
9
- };
10
- declare const ProgressLoader: ({ progress, onPress, Icon, }: Props) => React.ReactElement;
11
- export default ProgressLoader;
1
+ export { default as Loader } from "./ProgressLoader";
2
+ export { default as InfiniteLoader } from "./InfiniteLoader";
@@ -1,24 +1,2 @@
1
- import React from "react";
2
- import { Svg, Circle, G } from "react-native-svg";
3
- import { useTheme } from "styled-components/native";
4
- import { TouchableOpacity } from "react-native";
5
- const radius = 25;
6
- const strokeWidth = 2;
7
- const normalizedRadius = radius - strokeWidth / 2;
8
- const circumference = normalizedRadius * 2 * Math.PI;
9
- const iconSize = radius * 0.88;
10
- const iconOffset = radius - iconSize / 2;
11
- const ProgressLoader = ({ progress = 0, onPress, Icon, }) => {
12
- const { colors } = useTheme();
13
- const backgroundColor = colors.primary.c20;
14
- const progressColor = colors.primary.c90;
15
- const strokeDashoffset = circumference - progress * circumference;
16
- return (React.createElement(TouchableOpacity, { disabled: !onPress, onPress: onPress },
17
- React.createElement(Svg, { width: radius * 2, height: radius * 2 },
18
- React.createElement(Circle, { cx: radius, cy: radius, r: radius * 0.92, fill: "transparent", stroke: backgroundColor, strokeDashoffset: 0, strokeWidth: strokeWidth }),
19
- React.createElement(G, { transform: `rotate(-90) translate(-${radius * 2}, 0)` },
20
- React.createElement(Circle, { cx: radius, cy: radius, r: radius * 0.92, fill: "transparent", stroke: progressColor, strokeWidth: strokeWidth, strokeDasharray: `${circumference} ${circumference}`, strokeDashoffset: strokeDashoffset })),
21
- Icon ? (React.createElement(G, { transform: `translate(${iconOffset}, ${iconOffset})` },
22
- React.createElement(Icon, { color: progressColor, size: iconSize }))) : null)));
23
- };
24
- export default ProgressLoader;
1
+ export { default as Loader } from "./ProgressLoader";
2
+ export { default as InfiniteLoader } from "./InfiniteLoader";
@@ -0,0 +1,70 @@
1
+ import React from "react";
2
+ import { Props as ProgressBarProps } from "../../ProgressBar";
3
+ import { TransitionProps } from "../../transitions";
4
+ interface InnerProps {
5
+ /**
6
+ * The active index.
7
+ */
8
+ activeIndex: number;
9
+ /**
10
+ * The total number of steps.
11
+ */
12
+ stepsLength: number;
13
+ }
14
+ export interface RenderTransitionProps extends InnerProps, TransitionProps {
15
+ /**
16
+ * The index of the child.
17
+ */
18
+ index: number;
19
+ /**
20
+ * The previously active index.
21
+ */
22
+ previousActiveIndex: number | null;
23
+ }
24
+ export interface Props<ExtraProps> {
25
+ /**
26
+ * The index of the active step.
27
+ */
28
+ activeIndex: number;
29
+ /**
30
+ * An optional header displayed above the progress bar.
31
+ */
32
+ header?: (props: InnerProps & ExtraProps) => React.ReactNode;
33
+ /**
34
+ * An optional footer displayed below the body.
35
+ */
36
+ footer?: (props: InnerProps & ExtraProps) => React.ReactNode;
37
+ /**
38
+ * Extra props that are passed to the header and footer render functions.
39
+ */
40
+ extraProps?: ExtraProps;
41
+ /**
42
+ * Additional props to pass to the progressbar component.
43
+ * This component is a Flex element.
44
+ */
45
+ progressBarProps?: ProgressBarProps;
46
+ /**
47
+ * **Use this prop in combination with `transitionDuration`.**
48
+ *
49
+ * A render function wrapping every children which allows using transitions.
50
+ * This function is called with various useful arguments, most notably:
51
+ * - the child index
52
+ * - the current active index
53
+ * - the previous active index
54
+ * - the transition status ("entered", "entering", "exiting" or "exited")
55
+ */
56
+ renderTransition?: (props: RenderTransitionProps) => JSX.Element | null;
57
+ /**
58
+ * **Use this prop in combination with `renderTransition`.**
59
+ *
60
+ * If this prop is true and if `renderTransition` is used
61
+ * then specifies the duration of the transition in milliseconds.
62
+ */
63
+ transitionDuration?: number;
64
+ /**
65
+ * A list of children representing each step of the flow.
66
+ */
67
+ children: React.ReactNode;
68
+ }
69
+ declare function FlowStepper<ExtraProps>({ activeIndex, header, footer, extraProps, progressBarProps, renderTransition, transitionDuration, children, }: Props<ExtraProps>): JSX.Element;
70
+ export default FlowStepper;
@@ -0,0 +1,36 @@
1
+ import React, { useRef, useEffect } from "react";
2
+ import { SafeAreaView } from "react-native";
3
+ import Flex from "../../Layout/Flex";
4
+ import ProgressBar from "../../ProgressBar";
5
+ import { Transition } from "../../transitions";
6
+ function FlowStepper({ activeIndex, header, footer, extraProps, progressBarProps, renderTransition, transitionDuration = 0, children, }) {
7
+ const previousActiveIndex = useRef(null);
8
+ const stepsLength = React.Children.count(children);
9
+ useEffect(() => () => {
10
+ previousActiveIndex.current = activeIndex;
11
+ }, [activeIndex]);
12
+ return (React.createElement(Flex, { flex: 1 },
13
+ header && header(Object.assign(Object.assign({}, extraProps), { activeIndex, stepsLength })),
14
+ React.createElement(SafeAreaView, { style: { flex: 1 } },
15
+ React.createElement(ProgressBar, Object.assign({ index: activeIndex, length: stepsLength }, progressBarProps)),
16
+ React.createElement(Flex, { flex: 1 }, React.Children.map(children, (child, index) => {
17
+ if (renderTransition && transitionDuration) {
18
+ return (React.createElement(Transition, { in: index === activeIndex, timeout: transitionDuration, mountOnEnter: true, unmountOnExit: true }, (status) => {
19
+ return renderTransition({
20
+ index,
21
+ activeIndex,
22
+ previousActiveIndex: previousActiveIndex.current,
23
+ stepsLength,
24
+ status,
25
+ duration: transitionDuration,
26
+ children: child,
27
+ });
28
+ }));
29
+ }
30
+ else {
31
+ return index === activeIndex ? child : null;
32
+ }
33
+ })),
34
+ footer && footer(Object.assign(Object.assign({}, extraProps), { activeIndex, stepsLength })))));
35
+ }
36
+ export default FlowStepper;
@@ -4,5 +4,5 @@ declare type Props = {
4
4
  activeIndex: number;
5
5
  onChange: (index: number) => void;
6
6
  };
7
- declare function SlideIndicator({ slidesLength, activeIndex, onChange, }: Props): React.ReactElement;
7
+ declare function SlideIndicator({ slidesLength, activeIndex, onChange }: Props): React.ReactElement;
8
8
  export default SlideIndicator;
@@ -1,6 +1,6 @@
1
1
  import React, { useMemo } from "react";
2
2
  import styled from "styled-components/native";
3
- import Animated, { useAnimatedStyle, Easing, withTiming, } from "react-native-reanimated";
3
+ import Animated, { useDerivedValue, useAnimatedStyle, Easing, withTiming, } from "react-native-reanimated";
4
4
  const Container = styled.View `
5
5
  flex-direction: row;
6
6
  align-items: center;
@@ -8,14 +8,18 @@ const Container = styled.View `
8
8
  height: 6px;
9
9
  position: relative;
10
10
  `;
11
- const Bullet = styled.TouchableOpacity `
11
+ const bulletStyle = `
12
12
  width: 6px;
13
13
  height: 6px;
14
14
  border-radius: 6px;
15
15
  margin: 0 6px;
16
+ `;
17
+ const Bullet = styled.TouchableOpacity `
18
+ ${bulletStyle}
16
19
  background-color: ${(p) => p.theme.colors.neutral.c40};
17
20
  `;
18
- const ActiveBullet = styled(Bullet) `
21
+ const ActiveBullet = styled.View.attrs({ pointerEvents: "none" }) `
22
+ ${bulletStyle}
19
23
  background-color: ${(p) => p.theme.colors.neutral.c100};
20
24
  position: absolute;
21
25
  top: 0;
@@ -26,12 +30,14 @@ const config = {
26
30
  duration: 200,
27
31
  easing: Easing.bezier(0.5, 0.01, 0, 1),
28
32
  };
29
- function SlideIndicator({ slidesLength, activeIndex = 0, onChange, }) {
33
+ function SlideIndicator({ slidesLength, activeIndex = 0, onChange }) {
30
34
  const slidesArray = useMemo(() => new Array(slidesLength).fill(0), [slidesLength]);
31
- const activeSize = useMemo(() => (Math.max(0, Math.min(slidesLength - 1, activeIndex)) + 1) * (6 + 12) -
32
- 12, [activeIndex, slidesLength]);
35
+ const activeSize = useDerivedValue(() => {
36
+ const size = (Math.max(0, Math.min(slidesLength - 1, activeIndex)) + 1) * (6 + 12) - 12;
37
+ return size;
38
+ }, [activeIndex, slidesLength]);
33
39
  const animatedStyles = useAnimatedStyle(() => ({
34
- width: withTiming(activeSize, config),
40
+ width: withTiming(activeSize.value, config),
35
41
  }));
36
42
  return (React.createElement(Container, null,
37
43
  slidesArray.map((_, index) => (React.createElement(Bullet, { key: index, onPress: () => onChange(index) }))),
@@ -13,5 +13,5 @@ export declare type StepperProps = {
13
13
  */
14
14
  errored?: boolean;
15
15
  };
16
- declare function Stepper({ steps, activeIndex, errored, }: StepperProps): React.ReactElement;
16
+ declare function Stepper({ steps, activeIndex, errored }: StepperProps): React.ReactElement;
17
17
  export default Stepper;
@@ -15,7 +15,7 @@ import { space, color } from "styled-system";
15
15
  import Text from "../../Text";
16
16
  import CheckAlone from "@ledgerhq/icons-ui/native/CheckAloneMedium";
17
17
  import CloseMedium from "@ledgerhq/icons-ui/native/CloseMedium";
18
- import Animated, { useAnimatedStyle, withTiming, withDelay, Easing, } from "react-native-reanimated";
18
+ import Animated, { useAnimatedStyle, withTiming, withDelay, Easing } from "react-native-reanimated";
19
19
  const Separator = styled.View `
20
20
  flex: 1;
21
21
  height: 1px;
@@ -75,8 +75,8 @@ const StepIcon = {
75
75
  border-radius: ${(p) => p.theme.space[1]}px;
76
76
  background-color: ${(p) => p.theme.colors.neutral.c70};
77
77
  `,
78
- Completed: ({ color }) => (React.createElement(CheckAlone, { size: 16, color: color })),
79
- Errored: ({ color }) => (React.createElement(CloseMedium, { size: 16, color: color })),
78
+ Completed: ({ color }) => React.createElement(CheckAlone, { size: 16, color: color }),
79
+ Errored: ({ color }) => React.createElement(CloseMedium, { size: 16, color: color }),
80
80
  };
81
81
  // #endregion
82
82
  // #region Step
@@ -133,7 +133,7 @@ const Container = styled.View `
133
133
  flex-direction: row;
134
134
  width: 100%;
135
135
  `;
136
- function Stepper({ steps, activeIndex, errored, }) {
136
+ function Stepper({ steps, activeIndex, errored }) {
137
137
  const { space } = useTheme();
138
138
  const separatorMarginTop = useMemo(() => Math.floor(space[5] / 2), [space]);
139
139
  return (React.createElement(Container, null, steps.map((label, i) => (React.createElement(React.Fragment, { key: i },
@@ -1,2 +1,3 @@
1
1
  export { default as SlideIndicator } from "./SlideIndicator";
2
2
  export { default as Stepper } from "./Stepper";
3
+ export { default as FlowStepper } from "./FlowStepper";
@@ -1,2 +1,3 @@
1
1
  export { default as SlideIndicator } from "./SlideIndicator";
2
2
  export { default as Stepper } from "./Stepper";
3
+ export { default as FlowStepper } from "./FlowStepper";
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { FlexBoxProps } from "../Layout/Flex";
3
+ export interface Props extends FlexBoxProps {
4
+ /**
5
+ * The index of the active step.
6
+ */
7
+ index: number;
8
+ /**
9
+ * The total number of steps.
10
+ */
11
+ length: number;
12
+ }
13
+ declare function ProgressBar({ index, length, ...props }: Props): JSX.Element;
14
+ declare const _default: React.MemoExoticComponent<typeof ProgressBar>;
15
+ export default _default;
@@ -0,0 +1,33 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from "react";
13
+ import styled from "styled-components/native";
14
+ import Flex from "../Layout/Flex";
15
+ import Animated, { useDerivedValue, useAnimatedStyle, withTiming } from "react-native-reanimated";
16
+ const ActiveBar = styled.View `
17
+ background-color: ${(p) => p.theme.colors.neutral.c100};
18
+ position: absolute;
19
+ height: 100%;
20
+ top: 0;
21
+ left: 0;
22
+ `;
23
+ const AnimatedBar = Animated.createAnimatedComponent(ActiveBar);
24
+ function ProgressBar(_a) {
25
+ var { index, length } = _a, props = __rest(_a, ["index", "length"]);
26
+ const width = useDerivedValue(() => Math.round((index / (length - 1)) * 100), [index, length]);
27
+ const animatedStyles = useAnimatedStyle(() => ({
28
+ width: withTiming(`${width.value}%`),
29
+ }));
30
+ return (React.createElement(Flex, Object.assign({ height: 4, width: "100%", backgroundColor: "neutral.c20", position: "relative" }, props),
31
+ React.createElement(AnimatedBar, { style: [animatedStyles] })));
32
+ }
33
+ export default React.memo(ProgressBar);
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { BaseTabsProps, TabItemProps } from "../TemplateTabs";
3
+ export declare const ChipTab: ({ onPress, isActive, label }: TabItemProps) => React.ReactElement;
4
+ declare const ChipTabs: (props: BaseTabsProps) => React.ReactElement;
5
+ export default ChipTabs;
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import styled from "styled-components/native";
3
+ import Text from "../../Text";
4
+ import { TouchableOpacity } from "react-native";
5
+ import TemplateTabs from "../TemplateTabs";
6
+ const TabBox = styled(TouchableOpacity) `
7
+ text-align: center;
8
+ margin: auto;
9
+ flex: 1;
10
+ padding: ${(p) => p.theme.space[5]}px 0;
11
+ border-radius: 8px;
12
+ background-color: ${(p) => (p.isActive ? p.theme.colors.palette.primary.c20 : "transparent")};
13
+ `;
14
+ const StyledTabs = styled(TemplateTabs) ``;
15
+ export const ChipTab = ({ onPress, isActive, label }) => {
16
+ return (React.createElement(TabBox, { isActive: isActive, onPress: onPress },
17
+ React.createElement(Text, { variant: "small", fontWeight: "semiBold", color: isActive ? "palette.neutral.c100" : "palette.neutral.c80", textAlign: "center" }, label)));
18
+ };
19
+ const ChipTabs = (props) => (React.createElement(StyledTabs, Object.assign({}, props, { Item: ChipTab })));
20
+ export default ChipTabs;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { BaseTabsProps, TabItemProps } from "../TemplateTabs";
3
+ export declare const GraphTab: ({ onPress, isActive, label }: TabItemProps) => React.ReactElement;
4
+ declare const GraphTabs: (props: BaseTabsProps) => React.ReactElement;
5
+ export default GraphTabs;
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import styled from "styled-components/native";
3
+ import Text from "../../Text";
4
+ import { TouchableOpacity } from "react-native";
5
+ import Button from "../../cta/Button";
6
+ import TemplateTabs from "../TemplateTabs";
7
+ const TabBbx = styled(TouchableOpacity) `
8
+ text-align: center;
9
+ margin: auto;
10
+ flex: 1;
11
+ `;
12
+ const StyledTabs = styled(TemplateTabs) `
13
+ border: ${(p) => `1px solid ${p.theme.colors.palette.neutral.c40}`};
14
+ border-radius: 35px;
15
+ padding: 4px;
16
+ `;
17
+ export const GraphTab = ({ onPress, isActive, label }) => {
18
+ return (React.createElement(TabBbx, { onPress: onPress }, isActive ? (React.createElement(Button, { type: "main" }, label)) : (React.createElement(Text, { lineHeight: 36, textAlign: "center" }, label))));
19
+ };
20
+ const GraphTabs = (props) => (React.createElement(StyledTabs, Object.assign({}, props, { Item: GraphTab })));
21
+ export default GraphTabs;
@@ -0,0 +1,29 @@
1
+ /// <reference types="styled-components-react-native" />
2
+ import React from "react";
3
+ export declare type BaseTabsProps = {
4
+ labels: string[];
5
+ activeIndex: number;
6
+ onChange: (newIndex: number) => void;
7
+ };
8
+ export declare type TabItemProps = Partial<BaseTabsProps> & {
9
+ label: string;
10
+ isActive: boolean;
11
+ index: number;
12
+ onPress: () => void;
13
+ };
14
+ export declare type TabsProps = BaseTabsProps & {
15
+ Item: (props: TabItemProps) => React.ReactElement;
16
+ };
17
+ 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>> & {
18
+ columnGap?: string | number | undefined;
19
+ rowGap?: string | number | undefined;
20
+ color?: string | undefined;
21
+ display?: string | undefined;
22
+ position?: string | undefined;
23
+ maxHeight?: number | undefined;
24
+ } & {
25
+ flexDirection: string;
26
+ alignItems: string;
27
+ }, "alignItems" | "flexDirection">;
28
+ declare const TemplateTabsGroup: (props: TabsProps) => React.ReactElement;
29
+ export default TemplateTabsGroup;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import styled from "styled-components/native";
3
+ import FlexBox from "../../Layout/Flex";
4
+ export const TabsContainer = styled(FlexBox).attrs({
5
+ flexDirection: "row",
6
+ alignItems: "stretch",
7
+ }) `
8
+ width: 100%;
9
+ `;
10
+ const TemplateTabsGroup = (props) => {
11
+ const { labels, activeIndex, onChange, Item } = props;
12
+ return (React.createElement(TabsContainer, Object.assign({}, props), labels.map((label, index) => (React.createElement(Item, Object.assign({ key: index }, props, { label: label, index: index, isActive: index === activeIndex, onPress: () => onChange(index) }))))));
13
+ };
14
+ export default TemplateTabsGroup;
@@ -0,0 +1,2 @@
1
+ export { default as ChipTabs } from "./Chip";
2
+ export { default as GraphTabs } from "./Graph";
@@ -0,0 +1,2 @@
1
+ export { default as ChipTabs } from "./Chip";
2
+ export { default as GraphTabs } from "./Graph";
@@ -7,6 +7,7 @@ export declare function getTextTypeStyle({ bracket }: {
7
7
  fontFamily: string;
8
8
  lineHeight?: number;
9
9
  paddingTop?: number;
10
+ textTransform?: string;
10
11
  }>;
11
12
  export declare function getTextStyle({ variant, bracket, fontWeight, }: Partial<BaseTextProps>): {
12
13
  fontFamily: string;
@@ -4,19 +4,23 @@ export function getTextTypeStyle({ bracket }) {
4
4
  fontFamily: "Alpha",
5
5
  lineHeight: 32,
6
6
  paddingTop: bracket ? 15 : 0,
7
+ textTransform: "uppercase",
7
8
  },
8
9
  h2: {
9
10
  fontFamily: "Alpha",
10
11
  lineHeight: 28,
11
12
  paddingTop: bracket ? 10 : 0,
13
+ textTransform: "uppercase",
12
14
  },
13
15
  h3: {
14
16
  fontFamily: "Alpha",
15
17
  lineHeight: 20,
16
18
  paddingTop: bracket ? 5 : 0,
19
+ textTransform: "uppercase",
17
20
  },
18
21
  h4: {
19
22
  fontFamily: "Inter",
23
+ textTransform: "uppercase",
20
24
  },
21
25
  large: {
22
26
  fontFamily: "Inter",
@@ -40,6 +44,7 @@ export function getTextTypeStyle({ bracket }) {
40
44
  },
41
45
  subtitle: {
42
46
  fontFamily: "Inter",
47
+ textTransform: "uppercase",
43
48
  },
44
49
  tiny: {
45
50
  fontFamily: "Inter",
@@ -1,21 +1,19 @@
1
1
  import React from "react";
2
- import { TextProps } from "react-native";
3
- import { FontSizeProps, TextAlignProps, ColorProps, SpaceProps, LineHeightProps, BorderProps } from "styled-system";
2
+ import { TextProps, TextStyle } from "react-native";
3
+ import { FontSizeProps, TextAlignProps, LineHeightProps } from "styled-system";
4
+ import { BaseStyledProps } from "../styled";
4
5
  import { FontWeightTypes } from "./getTextStyle";
5
6
  import { TextVariants } from "../../styles/theme";
6
- export interface BaseTextProps extends TextProps, FontSizeProps, TextAlignProps, ColorProps, SpaceProps, LineHeightProps, BorderProps {
7
+ export interface BaseTextProps extends TextProps, BaseStyledProps, FontSizeProps, TextAlignProps, LineHeightProps {
7
8
  variant?: TextVariants;
8
9
  fontWeight?: FontWeightTypes;
9
10
  fontFamily?: string;
10
11
  fontSize?: number | string | TextVariants;
11
12
  color?: string;
12
- mt?: number | string;
13
- mb?: number | string;
14
- ml?: number | string;
15
- mr?: number | string;
16
- paddingTop?: number;
17
13
  lineHeight?: number;
18
14
  bracket?: boolean;
15
+ textTransform?: TextStyle["textTransform"];
16
+ uppercase?: boolean;
19
17
  children: React.ReactNode;
20
18
  }
21
19
  declare const Text: ({ children, bracket, ...props }: BaseTextProps) => JSX.Element;
@@ -11,12 +11,24 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import React from "react";
13
13
  import styled, { useTheme } from "styled-components/native";
14
- import { fontSize, textAlign, color, space, lineHeight, border, } from "styled-system";
14
+ import { compose, fontSize, textAlign, lineHeight, system, } from "styled-system";
15
+ import baseStyled from "../styled";
15
16
  import BracketRight from "../../icons/BracketLeft";
16
17
  import BracketLeft from "../../icons/BracketRight";
17
18
  import { getColor } from "../../styles";
18
19
  import { getTextStyle } from "./getTextStyle";
19
- const Base = styled.Text.attrs((p) => {
20
+ const uppercase = system({
21
+ uppercase: {
22
+ property: "textTransform",
23
+ transform: (value) => (value ? "uppercase" : "none"),
24
+ },
25
+ });
26
+ const textTransform = system({
27
+ textTransform: {
28
+ property: "textTransform",
29
+ },
30
+ });
31
+ const Base = baseStyled.Text.attrs((p) => {
20
32
  var _a;
21
33
  return ({
22
34
  fontSize: p.fontSize ? p.fontSize : (_a = p.variant) !== null && _a !== void 0 ? _a : "paragraph",
@@ -24,12 +36,7 @@ const Base = styled.Text.attrs((p) => {
24
36
  });
25
37
  }) `
26
38
  ${(p) => getTextStyle(p)}
27
- ${lineHeight};
28
- ${fontSize};
29
- ${textAlign};
30
- ${color};
31
- ${space};
32
- ${border};
39
+ ${compose(lineHeight, fontSize, textAlign, uppercase, textTransform)}
33
40
  justify-content: center;
34
41
  align-items: center;
35
42
  `;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Item } from "./types";
3
2
  export declare type ChartProps = {
4
3
  data: Array<Item>;