@ledgerhq/native-ui 0.3.0 → 0.6.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 (120) hide show
  1. package/README.md +13 -23
  2. package/assets/fonts/.DS_Store +0 -0
  3. package/assets/fonts/alpha/.DS_Store +0 -0
  4. package/assets/logos/LedgerLiveAltRegular.d.ts +0 -1
  5. package/assets/logos/LedgerLiveRegular.d.ts +0 -1
  6. package/components/Carousel/index.d.ts +45 -0
  7. package/components/Carousel/index.js +76 -0
  8. package/components/Form/Checkbox/index.d.ts +2 -2
  9. package/components/Form/Checkbox/index.js +5 -5
  10. package/components/Form/Input/BaseInput/index.d.ts +83 -5
  11. package/components/Form/Input/BaseInput/index.js +16 -16
  12. package/components/Form/Input/LegendInput/index.d.ts +14 -3
  13. package/components/Form/Input/LegendInput/index.js +4 -3
  14. package/components/Form/Input/NumberInput/index.d.ts +16 -5
  15. package/components/Form/Input/NumberInput/index.js +6 -9
  16. package/components/Form/Input/QrCodeInput/index.d.ts +15 -4
  17. package/components/Form/Input/QrCodeInput/index.js +5 -4
  18. package/components/Form/Input/SearchInput/index.d.ts +13 -2
  19. package/components/Form/Input/SearchInput/index.js +4 -3
  20. package/components/Form/SelectableList.d.ts +12 -3
  21. package/components/Form/SelectableList.js +9 -8
  22. package/components/Form/Slider/components.js +6 -6
  23. package/components/Form/Slider/index.d.ts +0 -1
  24. package/components/Form/Slider/index.native.d.ts +0 -1
  25. package/components/Form/Slider/index.native.js +2 -2
  26. package/components/Form/Switch/index.d.ts +0 -1
  27. package/components/Form/Switch/index.js +4 -4
  28. package/components/Form/Toggle/index.d.ts +0 -1
  29. package/components/Form/index.d.ts +1 -0
  30. package/components/Form/index.js +1 -0
  31. package/components/Icon/BoxedIcon.d.ts +48 -0
  32. package/components/Icon/BoxedIcon.js +87 -0
  33. package/components/Icon/IconBox/index.d.ts +2 -4
  34. package/components/Icon/IconBox/index.js +2 -3
  35. package/components/Icon/index.d.ts +1 -0
  36. package/components/Icon/index.js +1 -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/Flex/index.d.ts +11 -12
  42. package/components/Layout/Flex/index.js +2 -8
  43. package/components/Layout/List/IconBoxList/index.d.ts +10 -0
  44. package/components/Layout/List/IconBoxList/index.js +19 -0
  45. package/components/Layout/List/List/index.d.ts +13 -0
  46. package/components/Layout/List/List/index.js +29 -0
  47. package/components/Layout/List/NumberedList/index.d.ts +9 -0
  48. package/components/Layout/List/NumberedList/index.js +20 -0
  49. package/components/Layout/List/TipList/index.d.ts +9 -0
  50. package/components/Layout/List/TipList/index.js +20 -0
  51. package/components/Layout/List/index.d.ts +4 -0
  52. package/components/Layout/List/index.js +4 -0
  53. package/components/Layout/Modals/BaseModal/index.js +4 -4
  54. package/components/Layout/ScrollContainerHeader/Header.d.ts +0 -1
  55. package/components/Layout/ScrollContainerHeader/Header.js +1 -1
  56. package/components/Layout/index.d.ts +4 -0
  57. package/components/Layout/index.js +4 -0
  58. package/components/Loader/InfiniteLoader/index.d.ts +9 -0
  59. package/components/Loader/InfiniteLoader/index.js +62 -0
  60. package/components/Loader/ProgressLoader/index.d.ts +11 -0
  61. package/components/Loader/ProgressLoader/index.js +24 -0
  62. package/components/Loader/index.d.ts +2 -11
  63. package/components/Loader/index.js +2 -24
  64. package/components/Navigation/FlowStepper/index.d.ts +70 -0
  65. package/components/Navigation/FlowStepper/index.js +38 -0
  66. package/components/Navigation/SlideIndicator/index.js +15 -8
  67. package/components/Navigation/Stepper/index.js +12 -12
  68. package/components/Navigation/index.d.ts +1 -0
  69. package/components/Navigation/index.js +1 -0
  70. package/components/ProgressBar/index.d.ts +15 -0
  71. package/components/ProgressBar/index.js +33 -0
  72. package/components/Tabs/Chip/index.d.ts +5 -0
  73. package/components/Tabs/Chip/index.js +20 -0
  74. package/components/Tabs/Graph/index.d.ts +5 -0
  75. package/components/Tabs/Graph/index.js +21 -0
  76. package/components/Tabs/TemplateTabs/index.d.ts +29 -0
  77. package/components/Tabs/TemplateTabs/index.js +14 -0
  78. package/components/Tabs/index.d.ts +2 -0
  79. package/components/Tabs/index.js +2 -0
  80. package/components/Text/getTextStyle.d.ts +1 -0
  81. package/components/Text/getTextStyle.js +5 -0
  82. package/components/Text/index.d.ts +6 -8
  83. package/components/Text/index.js +17 -10
  84. package/components/chart/index.d.ts +0 -1
  85. package/components/chart/index.js +6 -6
  86. package/components/cta/Button/getButtonStyle.js +12 -12
  87. package/components/cta/Button/index.d.ts +4 -15
  88. package/components/cta/Button/index.js +13 -14
  89. package/components/cta/Link/getLinkStyle.js +8 -8
  90. package/components/index.d.ts +5 -2
  91. package/components/index.js +6 -2
  92. package/components/message/Alert/index.d.ts +0 -1
  93. package/components/message/Alert/index.js +7 -7
  94. package/components/{drawer → message}/Notification/index.d.ts +5 -4
  95. package/components/message/Notification/index.js +35 -0
  96. package/components/message/index.d.ts +1 -0
  97. package/components/message/index.js +1 -0
  98. package/components/styled.d.ts +15 -0
  99. package/components/styled.js +12 -0
  100. package/components/tags/Badge/index.js +7 -7
  101. package/components/transitions/Fade.d.ts +5 -0
  102. package/components/transitions/Fade.js +32 -0
  103. package/components/transitions/Slide.d.ts +11 -0
  104. package/components/transitions/Slide.js +49 -0
  105. package/components/transitions/Transition.d.ts +49 -0
  106. package/components/transitions/Transition.js +42 -0
  107. package/components/transitions/index.d.ts +4 -0
  108. package/components/transitions/index.js +4 -0
  109. package/components/transitions/types.d.ts +21 -0
  110. package/components/transitions/types.js +1 -0
  111. package/icons/Close.js +1 -1
  112. package/package.json +6 -8
  113. package/styles/StyleProvider.js +1 -1
  114. package/styles/theme.d.ts +4 -1
  115. package/styles/theme.js +3 -3
  116. package/components/Navigation/ToggleGroup/index.d.ts +0 -15
  117. package/components/Navigation/ToggleGroup/index.js +0 -25
  118. package/components/drawer/Notification/index.js +0 -37
  119. package/components/drawer/index.d.ts +0 -1
  120. package/components/drawer/index.js +0 -1
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import Animated from "react-native-reanimated";
3
2
  export declare type HeaderProps = {
4
3
  TopLeftSection?: JSX.Element;
@@ -6,7 +6,7 @@ import Flex from "../Flex";
6
6
  const Container = styled(Flex).attrs({
7
7
  paddingHorizontal: 16,
8
8
  }) `
9
- background-color: ${(p) => p.theme.colors.palette.background.main};
9
+ background-color: ${(p) => p.theme.colors.background.main};
10
10
  width: 100%;
11
11
  `;
12
12
  const SCROLL_BREAKPOINT = 80;
@@ -1,4 +1,8 @@
1
+ export { default as Accordion } from "./Collapse/Accordion";
1
2
  export { default as Flex } from "./Flex";
3
+ export { default as Box } from "./Box";
2
4
  export * from "./Modals";
3
5
  export { default as ScrollContainer } from "./ScrollContainer";
6
+ export { default as ScrollContainerHeader } from "./ScrollContainerHeader";
4
7
  export { default as Row } from "./Table/Row";
8
+ export * from "./List";
@@ -1,4 +1,8 @@
1
+ export { default as Accordion } from "./Collapse/Accordion";
1
2
  export { default as Flex } from "./Flex";
3
+ export { default as Box } from "./Box";
2
4
  export * from "./Modals";
3
5
  export { default as ScrollContainer } from "./ScrollContainer";
6
+ export { default as ScrollContainerHeader } from "./ScrollContainerHeader";
4
7
  export { default as Row } from "./Table/Row";
8
+ export * from "./List";
@@ -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,62 @@
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 //Infinite
43
+ );
44
+ return () => cancelAnimation(rotation);
45
+ // eslint-disable-next-line react-hooks/exhaustive-deps
46
+ }, []);
47
+ return (React.createElement(Animated.View, { style: [
48
+ { display: "flex", justifyContent: "center", alignItems: "center" },
49
+ animatedStyles,
50
+ ] },
51
+ React.createElement(Loader, Object.assign({ size: size, stroke: color, viewBox: "0 0 38 38", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, extraProps),
52
+ React.createElement(LinearGradient, { id: "gradient-start", gradientUnits: "userSpaceOnUse", gradientTransform: "rotate(-20)" },
53
+ React.createElement(Stop, { offset: 0, stopColor: "white", stopOpacity: 0.5 }),
54
+ React.createElement(Stop, { offset: 1, stopColor: "white", stopOpacity: 1 })),
55
+ React.createElement(LinearGradient, { id: "gradient-end", gradientUnits: "userSpaceOnUse", gradientTransform: "rotate(-20)" },
56
+ React.createElement(Stop, { offset: 0, stopColor: "white", stopOpacity: 0.5 }),
57
+ React.createElement(Stop, { offset: 1, stopColor: "white", stopOpacity: 0 })),
58
+ React.createElement(Mask, { id: "gradient-mask" },
59
+ React.createElement(Rect, { x: 0, y: -4, width: 44, height: 22, strokeWidth: 0, fill: "url(#gradient-start)", transform: "rotate(10)" }),
60
+ React.createElement(Rect, { x: 0, y: 18, width: 44, height: 21, strokeWidth: 0, fill: "url(#gradient-end)", transform: "rotate(10)" })),
61
+ 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)" }))));
62
+ }
@@ -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.palette.primary.c20;
14
- const progressColor = colors.palette.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,38 @@
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 &&
14
+ header(Object.assign(Object.assign({}, extraProps), { activeIndex, stepsLength })),
15
+ React.createElement(SafeAreaView, { style: { flex: 1 } },
16
+ React.createElement(ProgressBar, Object.assign({ index: activeIndex, length: stepsLength }, progressBarProps)),
17
+ React.createElement(Flex, { flex: 1 }, React.Children.map(children, (child, index) => {
18
+ if (renderTransition && transitionDuration) {
19
+ return (React.createElement(Transition, { in: index === activeIndex, timeout: transitionDuration, mountOnEnter: true, unmountOnExit: true }, (status) => {
20
+ return renderTransition({
21
+ index,
22
+ activeIndex,
23
+ previousActiveIndex: previousActiveIndex.current,
24
+ stepsLength,
25
+ status,
26
+ duration: transitionDuration,
27
+ children: child,
28
+ });
29
+ }));
30
+ }
31
+ else {
32
+ return index === activeIndex ? child : null;
33
+ }
34
+ })),
35
+ footer &&
36
+ footer(Object.assign(Object.assign({}, extraProps), { activeIndex, stepsLength })))));
37
+ }
38
+ export default FlowStepper;
@@ -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,15 +8,19 @@ 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
- background-color: ${(p) => p.theme.colors.palette.neutral.c40};
17
16
  `;
18
- const ActiveBullet = styled(Bullet) `
19
- background-color: ${(p) => p.theme.colors.palette.neutral.c100};
17
+ const Bullet = styled.TouchableOpacity `
18
+ ${bulletStyle}
19
+ background-color: ${(p) => p.theme.colors.neutral.c40};
20
+ `;
21
+ const ActiveBullet = styled.View.attrs({ pointerEvents: "none" }) `
22
+ ${bulletStyle}
23
+ background-color: ${(p) => p.theme.colors.neutral.c100};
20
24
  position: absolute;
21
25
  top: 0;
22
26
  left: 0;
@@ -28,10 +32,13 @@ const config = {
28
32
  };
29
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) -
37
+ 12;
38
+ return size;
39
+ }, [activeIndex, slidesLength]);
33
40
  const animatedStyles = useAnimatedStyle(() => ({
34
- width: withTiming(activeSize, config),
41
+ width: withTiming(activeSize.value, config),
35
42
  }));
36
43
  return (React.createElement(Container, null,
37
44
  slidesArray.map((_, index) => (React.createElement(Bullet, { key: index, onPress: () => onChange(index) }))),
@@ -19,12 +19,12 @@ import Animated, { useAnimatedStyle, withTiming, withDelay, Easing, } from "reac
19
19
  const Separator = styled.View `
20
20
  flex: 1;
21
21
  height: 1px;
22
- background-color: ${(p) => p.theme.colors.palette.neutral.c40};
22
+ background-color: ${(p) => p.theme.colors.neutral.c40};
23
23
  ${space}
24
24
  `;
25
25
  const SeparatorFilling = Animated.createAnimatedComponent(styled.View `
26
26
  height: 100%;
27
- background-color: ${(p) => p.theme.colors.palette.neutral.c100};
27
+ background-color: ${(p) => p.theme.colors.neutral.c100};
28
28
  `);
29
29
  const AnimatedSeparator = (_a) => {
30
30
  var { filled, delay, duration } = _a, spaceProps = __rest(_a, ["filled", "delay", "duration"]);
@@ -67,13 +67,13 @@ const StepIcon = {
67
67
  width: ${(p) => p.theme.space[2]}px;
68
68
  height: ${(p) => p.theme.space[2]}px;
69
69
  border-radius: ${(p) => p.theme.radii[2]}px;
70
- background-color: ${(p) => p.theme.colors.palette.primary.c90};
70
+ background-color: ${(p) => p.theme.colors.primary.c90};
71
71
  `,
72
72
  Pending: styled.View `
73
73
  width: ${(p) => p.theme.space[1]}px;
74
74
  height: ${(p) => p.theme.space[1]}px;
75
75
  border-radius: ${(p) => p.theme.space[1]}px;
76
- background-color: ${(p) => p.theme.colors.palette.neutral.c70};
76
+ background-color: ${(p) => p.theme.colors.neutral.c70};
77
77
  `,
78
78
  Completed: ({ color }) => (React.createElement(CheckAlone, { size: 16, color: color })),
79
79
  Errored: ({ color }) => (React.createElement(CloseMedium, { size: 16, color: color })),
@@ -85,13 +85,13 @@ const StepView = styled.View `
85
85
  justify-content: center;
86
86
  `;
87
87
  const ActiveText = styled(Text) `
88
- color: ${(p) => p.theme.colors.palette.neutral.c100};
88
+ color: ${(p) => p.theme.colors.neutral.c100};
89
89
  `;
90
90
  const PendingText = styled(Text) `
91
- color: ${(p) => p.theme.colors.palette.neutral.c70};
91
+ color: ${(p) => p.theme.colors.neutral.c70};
92
92
  `;
93
93
  const ErroredText = styled(Text) `
94
- color: ${(p) => p.theme.colors.palette.error.c100};
94
+ color: ${(p) => p.theme.colors.error.c100};
95
95
  `;
96
96
  function Step({ state, label, showLeftSeparator, showRightSeparator, }) {
97
97
  const labelText = useMemo(() => {
@@ -109,14 +109,14 @@ function Step({ state, label, showLeftSeparator, showRightSeparator, }) {
109
109
  const icon = useMemo(() => {
110
110
  switch (state) {
111
111
  case "COMPLETED":
112
- return (React.createElement(StepIcon.Background, { backgroundColor: "palette.primary.c20" },
113
- React.createElement(StepIcon.Completed, { color: colors.palette.primary.c90 })));
112
+ return (React.createElement(StepIcon.Background, { backgroundColor: "primary.c20" },
113
+ React.createElement(StepIcon.Completed, { color: colors.primary.c90 })));
114
114
  case "CURRENT":
115
- return (React.createElement(StepIcon.Background, { backgroundColor: "palette.primary.c20" },
115
+ return (React.createElement(StepIcon.Background, { backgroundColor: "primary.c20" },
116
116
  React.createElement(StepIcon.Current, null)));
117
117
  case "ERRORED":
118
- return (React.createElement(StepIcon.Background, { backgroundColor: "palette.warning.c30" },
119
- React.createElement(StepIcon.Errored, { color: colors.palette.error.c100 })));
118
+ return (React.createElement(StepIcon.Background, { backgroundColor: "warning.c30" },
119
+ React.createElement(StepIcon.Errored, { color: colors.error.c100 })));
120
120
  case "PENDING":
121
121
  return (React.createElement(StepIcon.Background, null,
122
122
  React.createElement(StepIcon.Pending, null)));
@@ -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",