@ledgerhq/native-ui 0.30.0-nightly.0 → 0.30.1-nightly.0

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,15 @@
1
+ import React, { type ReactNode } from "react";
2
+ import * as Icons from "@ledgerhq/icons-ui/native";
3
+ import type { BaseStyledProps } from "../../styled";
4
+ type Props = BaseStyledProps & Readonly<{
5
+ title?: string;
6
+ description: string;
7
+ cta: ReactNode;
8
+ icon: keyof typeof Icons;
9
+ hasExternalLinkIcon?: boolean;
10
+ unread?: boolean;
11
+ onPress: () => void;
12
+ }>;
13
+ export default function NewBannerCard({ title, description, cta, icon, hasExternalLinkIcon, unread, onPress, p, borderRadius, ...styledProps }: Props): React.JSX.Element;
14
+ export {};
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Cards/NewBannerCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC;AAGnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,KAAK,KAAK,GAAG,eAAe,GAC1B,QAAQ,CAAC;IACP,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,SAAS,CAAC;IACf,IAAI,EAAE,MAAM,OAAO,KAAK,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC,CAAC;AAEL,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,KAAK,EACL,WAAW,EACX,GAAG,EACH,IAAI,EACJ,mBAAmB,EACnB,MAAM,EACN,OAAO,EACP,CAAK,EACL,YAAiB,EACjB,GAAG,WAAW,EACf,EAAE,KAAK,qBAsDP"}
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import { Pressable } from "react-native";
3
+ import { useTheme } from "styled-components/native";
4
+ import * as Icons from "@ledgerhq/icons-ui/native";
5
+ import { BannerIcon } from "../../Icon";
6
+ import { Flex } from "../../Layout";
7
+ import Text from "../../Text";
8
+ export default function NewBannerCard({ title, description, cta, icon, hasExternalLinkIcon, unread, onPress, p = 4, borderRadius = 12, ...styledProps }) {
9
+ const { theme } = useTheme();
10
+ return (React.createElement(Pressable, { onPress: onPress, style: (p) => [{ opacity: p.pressed ? 0.2 : 1.0 }] },
11
+ React.createElement(Flex, { flexDirection: "row", alignItems: "center", bg: theme === "dark" ? "opacityDefault.c05" : "background.default", p: p, borderRadius: borderRadius, ...styledProps },
12
+ React.createElement(Flex, { position: "relative" },
13
+ React.createElement(BannerIcon, { icon: icon }),
14
+ !!unread && (React.createElement(Flex, { bg: "error.c60", height: 8, width: 8, borderRadius: 4, position: "absolute", right: 0, bottom: 0 }))),
15
+ React.createElement(Flex, { ml: 5, flexShrink: 1 },
16
+ title && (React.createElement(Text, { color: "neutral.c70", variant: "subtitle" }, title)),
17
+ React.createElement(Text, { color: "neutral.c100", variant: "body", mt: 2 }, description),
18
+ React.createElement(Flex, { mt: 3, flexDirection: "row", alignItems: "center" },
19
+ React.createElement(Text, { color: "primary.c80", variant: "paragraph", fontWeight: "semiBold", pr: hasExternalLinkIcon ? 3 : 0 }, cta),
20
+ hasExternalLinkIcon && React.createElement(Icons.ExternalLink, { size: "S", color: "primary.c80" }))))));
21
+ }
@@ -3,4 +3,5 @@ export { default as SideImageCard } from "./SideImageCard";
3
3
  export { default as NotificationCard } from "./NotificationCard";
4
4
  export { default as InformativeCard } from "./InformativeCard";
5
5
  export { default as BannerCard } from "./BannerCard";
6
+ export { default as NewBannerCard } from "./NewBannerCard";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Cards/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Cards/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -3,3 +3,4 @@ export { default as SideImageCard } from "./SideImageCard";
3
3
  export { default as NotificationCard } from "./NotificationCard";
4
4
  export { default as InformativeCard } from "./InformativeCard";
5
5
  export { default as BannerCard } from "./BannerCard";
6
+ export { default as NewBannerCard } from "./NewBannerCard";
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import * as Icons from "@ledgerhq/icons-ui/native";
3
+ type IconKey = keyof typeof Icons;
4
+ type Props = Readonly<{
5
+ icon: IconKey;
6
+ }>;
7
+ export default function BannerIcon({ icon }: Props): React.JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=BannerIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerIcon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/BannerIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAItD,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC;AAInD,KAAK,OAAO,GAAG,MAAM,OAAO,KAAK,CAAC;AAelC,KAAK,KAAK,GAAG,QAAQ,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,qBAajD"}
@@ -0,0 +1,53 @@
1
+ import React from "react";
2
+ import Svg, { Defs, LinearGradient, Rect, Stop } from "react-native-svg";
3
+ import styled, { useTheme } from "styled-components/native";
4
+ import * as Icons from "@ledgerhq/icons-ui/native";
5
+ import { Flex } from "../Layout";
6
+ function getColorsByIcon(colors) {
7
+ const { warning } = colors;
8
+ return {
9
+ Warning: { fg: warning.c80, bg: warning.c30 },
10
+ };
11
+ }
12
+ function getDefaultDefaultColors({ primary }) {
13
+ return { fg: primary.c80, bg: primary.c80 };
14
+ }
15
+ export default function BannerIcon({ icon }) {
16
+ const { colors } = useTheme();
17
+ const defaultColors = getDefaultDefaultColors(colors);
18
+ const safeIcon = icon in Icons ? icon : "Information";
19
+ const Icon = Icons[safeIcon];
20
+ const { fg: iconColor = defaultColors.fg, bg: iconBgColor = defaultColors.bg } = getColorsByIcon(colors)[safeIcon] ?? {};
21
+ return (React.createElement(IconContainer, { color: iconBgColor },
22
+ React.createElement(Icon, { color: iconColor })));
23
+ }
24
+ function IconContainer({ color, children }) {
25
+ const { theme } = useTheme();
26
+ return (React.createElement(Flex, { width: 52, height: 52, alignItems: "center", justifyContent: "center" },
27
+ React.createElement(IconBg, { viewBox: "0 0 52 52", fill: "none" },
28
+ React.createElement(Defs, null,
29
+ React.createElement(VGradient, { id: "fillGrad", gradient: theme === "dark"
30
+ ? { 0: ["#FFF", 0.05], 1: ["#1D1C1F", 0] }
31
+ : { 0: ["#1D1C1F", 0.05], 1: ["#1D1C1F", 0] } }),
32
+ React.createElement(VGradient, { id: "strokeGrad", gradient: theme === "dark"
33
+ ? { 0: ["#FFF", 1], 1: ["#000", 0.5] }
34
+ : { 0: ["#000", 0.3], 1: ["#000", 0] } })),
35
+ React.createElement(Square, { offset: 0, size: 52, rx: 13.5, fill: "url(#fillGrad)" }),
36
+ React.createElement(BorderSquare, { offset: 0.25, size: 51.5, rx: 13.5, stroke: "url(#strokeGrad)" }),
37
+ React.createElement(Square, { offset: 7.25, size: 38, rx: 8.7, fill: color, fillOpacity: 0.08 })),
38
+ children));
39
+ }
40
+ function Square({ offset, size, ...rectProps }) {
41
+ return React.createElement(Rect, { x: offset, y: offset, width: size, height: size, ...rectProps });
42
+ }
43
+ function VGradient({ id, gradient }) {
44
+ return (React.createElement(LinearGradient, { id: id, x1: "0", y1: "0", x2: "0", y2: "100%", gradientUnits: "userSpaceOnUse" }, Object.entries(gradient).map(([offset, [hex, opacity]]) => (React.createElement(Stop, { key: offset, offset: offset, stopColor: hex, stopOpacity: opacity })))));
45
+ }
46
+ const IconBg = styled(Svg).attrs({ xmlns: "http://www.w3.org/2000/svg" }) `
47
+ position: absolute;
48
+ inset: 0;
49
+ `;
50
+ const BorderSquare = styled(Square) `
51
+ stroke-opacity: 0.16px;
52
+ stroke-width: 0.5px;
53
+ `;
@@ -3,4 +3,5 @@ export { default as IconBadge } from "./IconBadge";
3
3
  export { default as BoxedIcon } from "./BoxedIcon";
4
4
  export { default as Icon } from "./Icon";
5
5
  export { default as CryptoIcon } from "./CryptoIcon";
6
+ export { default as BannerIcon } from "./BannerIcon";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC"}
@@ -3,3 +3,4 @@ export { default as IconBadge } from "./IconBadge";
3
3
  export { default as BoxedIcon } from "./BoxedIcon";
4
4
  export { default as Icon } from "./Icon";
5
5
  export { default as CryptoIcon } from "./CryptoIcon";
6
+ export { default as BannerIcon } from "./BannerIcon";
@@ -36,13 +36,13 @@ export function getTextTypeStyle({ bracket }) {
36
36
  },
37
37
  h2: {
38
38
  fontFamily: "Alpha",
39
- lineHeight: "32px",
39
+ lineHeight: "34px",
40
40
  paddingTop: bracket ? 3 : 0,
41
41
  textTransform: "uppercase",
42
42
  },
43
43
  h3: {
44
44
  fontFamily: "Alpha",
45
- lineHeight: "24px",
45
+ lineHeight: "26px",
46
46
  paddingTop: bracket ? 5 : 0,
47
47
  textTransform: "uppercase",
48
48
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/native-ui",
3
- "version": "0.30.0-nightly.0",
3
+ "version": "0.30.1-nightly.0",
4
4
  "description": "Ledger Live - Mobile UI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,8 +39,8 @@
39
39
  "react-native-modal": "^13.0.0",
40
40
  "rn-range-slider": "2.1.1",
41
41
  "styled-system": "^5.1.5",
42
- "@ledgerhq/crypto-icons-ui": "^1.9.0",
43
- "@ledgerhq/icons-ui": "^0.8.1",
42
+ "@ledgerhq/crypto-icons-ui": "^1.10.0",
43
+ "@ledgerhq/icons-ui": "^0.9.0-nightly.0",
44
44
  "@ledgerhq/ui-shared": "^0.3.0"
45
45
  },
46
46
  "peerDependencies": {