@ledgerhq/native-ui 0.19.1-nightly.0 → 0.20.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.
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import { FlexBoxProps } from "../Layout/Flex";
3
+ import { IconOrElementType } from "./type";
4
+ export declare const DEFAULT_ICON_SIZE = 16;
5
+ export type IconBadgeProps = FlexBoxProps & {
6
+ /**
7
+ * Component that takes `{size?: number; color?: string}` as props.
8
+ * Will be rendered at the top right with the size provided in `iconSize` or a default size.
9
+ */
10
+ Icon: IconOrElementType;
11
+ /**
12
+ * Icon size, will be applied to the component provided in the `Icon` prop
13
+ */
14
+ iconSize: number;
15
+ /**
16
+ * Icon color, will be applied to the component provided in the `Icon` prop
17
+ */
18
+ iconColor?: string;
19
+ };
20
+ declare const IconBadge: ({ Icon, iconSize, iconColor, ...rest }: IconBadgeProps) => JSX.Element;
21
+ export default IconBadge;
@@ -0,0 +1,20 @@
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 Flex from "../Layout/Flex";
14
+ export const DEFAULT_ICON_SIZE = 16;
15
+ const BORDER_RADIUS = 999999;
16
+ const IconBadge = (_a) => {
17
+ var { Icon, iconSize = DEFAULT_ICON_SIZE, iconColor } = _a, rest = __rest(_a, ["Icon", "iconSize", "iconColor"]);
18
+ return (React.createElement(Flex, Object.assign({ height: iconSize * 2, width: iconSize * 2, backgroundColor: "neutral.c40", borderRadius: BORDER_RADIUS, alignItems: "center", justifyContent: "center" }, rest), React.isValidElement(Icon) ? Icon : React.createElement(Icon, { size: iconSize, color: iconColor })));
19
+ };
20
+ export default IconBadge;
@@ -1,4 +1,5 @@
1
1
  export { default as IconBox } from "./IconBox";
2
+ export { default as IconBadge } from "./IconBadge";
2
3
  export { default as BoxedIcon } from "./BoxedIcon";
3
4
  export { default as Icon } from "./Icon";
4
5
  export { default as CryptoIcon } from "./CryptoIcon";
@@ -1,4 +1,5 @@
1
1
  export { default as IconBox } from "./IconBox";
2
+ export { default as IconBadge } from "./IconBadge";
2
3
  export { default as BoxedIcon } from "./BoxedIcon";
3
4
  export { default as Icon } from "./Icon";
4
5
  export { default as CryptoIcon } from "./CryptoIcon";
@@ -5,7 +5,7 @@ export type Props = {
5
5
  progress?: number;
6
6
  nested?: boolean;
7
7
  isLastItem?: boolean;
8
- setActiveIndex?: (_: number) => void;
8
+ onTapIndex?: (_: number) => void;
9
9
  index: number;
10
10
  };
11
- export default function StepperItem({ item, progress, nested, isLastItem, setActiveIndex, index, }: Props): JSX.Element;
11
+ export default function StepperItem({ item, progress, nested, isLastItem, onTapIndex, index, }: Props): JSX.Element;
@@ -11,7 +11,7 @@ const Container = styled(Flex) `
11
11
  border-bottom-width: ${(p) => (p.nested ? 0 : 1)}px;
12
12
  border-bottom-color: ${(p) => p.isLastItem && p.status !== "inactive" ? "transparent" : p.theme.colors.neutral.c40};
13
13
  `;
14
- export default function StepperItem({ item, progress, nested, isLastItem, setActiveIndex, index, }) {
14
+ export default function StepperItem({ item, progress, nested, isLastItem, onTapIndex, index, }) {
15
15
  var _a;
16
16
  /**
17
17
  * Having an initial value of null will prevent having "height: 0" before the
@@ -36,8 +36,8 @@ export default function StepperItem({ item, progress, nested, isLastItem, setAct
36
36
  });
37
37
  }, []);
38
38
  const handlePress = useCallback(() => {
39
- setActiveIndex && setActiveIndex(index);
40
- }, [setActiveIndex, index]);
39
+ onTapIndex && onTapIndex(index);
40
+ }, [onTapIndex, index]);
41
41
  return (React.createElement(Pressable, { onPress: handlePress },
42
42
  React.createElement(Flex, { flexDirection: "row" },
43
43
  React.createElement(Container, { nested: nested, status: item.status, isLastItem: isLastItem },
@@ -1,13 +1,21 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
2
  import { BaseStyledProps } from "src/components/styled";
3
3
  import { Item } from "../types";
4
4
  export type Props = BaseStyledProps & {
5
5
  steps?: Item[];
6
- setActiveIndex?: (arg0: number) => void;
6
+ onTapIndex?: (arg0: number) => void;
7
7
  nested?: boolean;
8
8
  };
9
- declare function VerticalStepper({ steps, setActiveIndex, nested, ...props }: Props): JSX.Element;
10
- declare namespace VerticalStepper {
11
- var ItemStatus: typeof import("../types").ItemStatus;
12
- }
13
- export default VerticalStepper;
9
+ declare const _default: React.NamedExoticComponent<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>> & {
10
+ columnGap?: string | number | undefined;
11
+ rowGap?: string | number | undefined;
12
+ color?: string | undefined;
13
+ display?: string | undefined;
14
+ position?: string | undefined;
15
+ maxHeight?: string | number | undefined;
16
+ } & {
17
+ steps?: Item[] | undefined;
18
+ onTapIndex?: ((arg0: number) => void) | undefined;
19
+ nested?: boolean | undefined;
20
+ }>;
21
+ export default _default;
@@ -12,11 +12,9 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import React from "react";
13
13
  import StepperItem from "./StepperItem";
14
14
  import { Flex } from "../..";
15
- import { ItemStatus } from "../types";
16
- export default function VerticalStepper(_a) {
17
- var { steps, setActiveIndex, nested } = _a, props = __rest(_a, ["steps", "setActiveIndex", "nested"]);
15
+ export default React.memo(function VerticalStepper(_a) {
16
+ var { steps, onTapIndex, nested } = _a, props = __rest(_a, ["steps", "onTapIndex", "nested"]);
18
17
  return (React.createElement(Flex, Object.assign({}, props, { flexDirection: "column" }),
19
18
  nested && React.createElement(Flex, { mt: 7, mb: 4, borderBottomWidth: 1, borderBottomColor: "neutral.c40" }), steps === null || steps === void 0 ? void 0 :
20
- steps.map((step, index) => (React.createElement(StepperItem, { key: step.title, item: step, progress: step.progress, nested: nested, isLastItem: index === steps.length - 1, setActiveIndex: setActiveIndex, index: index })))));
21
- }
22
- VerticalStepper.ItemStatus = ItemStatus;
19
+ steps.map((step, index) => (React.createElement(StepperItem, { key: step.title, item: step, progress: step.progress, nested: nested, isLastItem: index === steps.length - 1, onTapIndex: onTapIndex, index: index })))));
20
+ });
@@ -3,4 +3,5 @@ export { default as IconBoxList } from "./IconBoxList";
3
3
  export { default as TipList } from "./TipList";
4
4
  export { default as NumberedList } from "./NumberedList";
5
5
  export { default as VerticalTimeline } from "./VerticalTimeline";
6
+ export { ItemStatus } from "./types";
6
7
  export { default as VerticalStepper } from "./VerticalStepper";
@@ -3,4 +3,5 @@ export { default as IconBoxList } from "./IconBoxList";
3
3
  export { default as TipList } from "./TipList";
4
4
  export { default as NumberedList } from "./NumberedList";
5
5
  export { default as VerticalTimeline } from "./VerticalTimeline";
6
+ export { ItemStatus } from "./types";
6
7
  export { default as VerticalStepper } from "./VerticalStepper";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/native-ui",
3
- "version": "0.19.1-nightly.0",
3
+ "version": "0.20.0-nightly.1",
4
4
  "description": "Ledger Live - Mobile UI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -57,7 +57,7 @@
57
57
  "@types/styled-components-react-native": "^5.3.3",
58
58
  "react": ">=17",
59
59
  "react-native": ">=0.64.0",
60
- "react-native-reanimated": "^2.9.1",
60
+ "react-native-reanimated": "^3.0.0",
61
61
  "styled-components": "^5.3.3"
62
62
  },
63
63
  "devDependencies": {
@@ -65,6 +65,11 @@
65
65
  "@babel/generator": "^7.17.2",
66
66
  "@babel/plugin-proposal-class-properties": "^7.13.0",
67
67
  "@babel/plugin-proposal-export-namespace-from": "^7.16.0",
68
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
69
+ "@babel/plugin-proposal-optional-chaining": "^7.21.0",
70
+ "@babel/plugin-transform-arrow-functions": "^7.20.7",
71
+ "@babel/plugin-transform-shorthand-properties": "^7.18.6",
72
+ "@babel/plugin-transform-template-literals": "^7.18.9",
68
73
  "@babel/preset-env": "^7.15.8",
69
74
  "@babel/runtime": "^7.17.2",
70
75
  "@emotion/core": "^10.3.1",
@@ -139,7 +144,7 @@
139
144
  "react-dom": "^18",
140
145
  "react-is": "^18",
141
146
  "react-native": "0.71.6",
142
- "react-native-reanimated": "^2.15.0",
147
+ "react-native-reanimated": "^3.1.0",
143
148
  "react-native-safe-area-context": "^4.5.0",
144
149
  "react-native-web": "~0.18.12",
145
150
  "regenerator-runtime": "^0.13.9",