@ledgerhq/native-ui 0.50.0-nightly.20251205111238 → 0.50.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.
- package/lib/assets/cryptoIcons.d.ts +2 -0
- package/lib/assets/cryptoIcons.d.ts.map +1 -0
- package/lib/assets/cryptoIcons.js +1 -0
- package/lib/assets/index.d.ts +1 -0
- package/lib/assets/index.d.ts.map +1 -1
- package/lib/assets/index.js +2 -0
- package/lib/components/Cards/NotificationCard/index.d.ts +1 -1
- package/lib/components/Cards/NotificationCard/index.d.ts.map +1 -1
- package/lib/components/Cards/NotificationCard/index.js +1 -1
- package/lib/components/Icon/CryptoIcon.d.ts +14 -0
- package/lib/components/Icon/CryptoIcon.d.ts.map +1 -0
- package/lib/components/Icon/CryptoIcon.js +71 -0
- package/lib/components/Icon/index.d.ts +1 -0
- package/lib/components/Icon/index.d.ts.map +1 -1
- package/lib/components/Icon/index.js +1 -0
- package/lib/pre-ldls/components/index.d.ts +0 -1
- package/lib/pre-ldls/components/index.d.ts.map +1 -1
- package/lib/pre-ldls/components/index.js +0 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cryptoIcons.d.ts","sourceRoot":"","sources":["../../src/assets/cryptoIcons.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ledgerhq/crypto-icons-ui/native";
|
package/lib/assets/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,WAAW,MAAM,kCAAkC,CAAC"}
|
package/lib/assets/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Cards/NotificationCard/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAE,qBAAqB,EAAoB,MAAM,cAAc,CAAC;AAEvE,MAAM,MAAM,SAAS,GAAG,qBAAqB,GAAG;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Cards/NotificationCard/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAE,qBAAqB,EAAoB,MAAM,cAAc,CAAC;AAEvE,MAAM,MAAM,SAAS,GAAG,qBAAqB,GAAG;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AA0BF,QAAA,MAAM,gBAAgB,UAAW,SAAS,KAAG,MAAM,YAkElD,CAAC;AAEF,eAAO,MAAM,IAAI,6MAA6B,CAAC;AAM/C,eAAe,gBAAgB,CAAC"}
|
|
@@ -23,7 +23,7 @@ const NotificationCard = (props) => {
|
|
|
23
23
|
React.createElement(Tag, { tag: tag }),
|
|
24
24
|
React.createElement(Timer, { time: time, viewed: viewed })),
|
|
25
25
|
React.createElement(Text, { variant: "large", fontWeight: "semiBold", color: "neutral.c100", numberOfLines: 1, mt: 4 }, title),
|
|
26
|
-
|
|
26
|
+
React.createElement(Text, { variant: "bodyLineHeight", fontWeight: "medium", color: "neutral.c70", numberOfLines: 3, mt: 2, mb: showLinkCta ? 4 : 0 }, description),
|
|
27
27
|
!!showLinkCta && (React.createElement(Flex, { alignItems: "flex-start" },
|
|
28
28
|
React.createElement(Link, { type: "main", size: "medium", iconPosition: "right", Icon: ctaIcon, onPress: onClickCard, numberOfLines: 1 },
|
|
29
29
|
React.createElement(StyledText, { variant: "bodyLineHeight", fontWeight: "semiBold", color: "neutral.c100", numberOfLines: 1 }, cta)))))));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type Props = {
|
|
3
|
+
name: string;
|
|
4
|
+
size?: number;
|
|
5
|
+
color?: string;
|
|
6
|
+
backgroundColor?: string;
|
|
7
|
+
circleIcon?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
tokenIcon?: string;
|
|
10
|
+
fallbackIcon?: JSX.Element;
|
|
11
|
+
};
|
|
12
|
+
declare const CryptoIcon: ({ name, size, color, backgroundColor, circleIcon, disabled, tokenIcon, fallbackIcon, }: Props) => JSX.Element;
|
|
13
|
+
export default CryptoIcon;
|
|
14
|
+
//# sourceMappingURL=CryptoIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CryptoIcon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/CryptoIcon.tsx"],"names":[],"mappings":";AAQA,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CAC5B,CAAC;AAqFF,QAAA,MAAM,UAAU,2FASb,KAAK,KAAG,WA0BV,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as icons from "@ledgerhq/crypto-icons-ui/native";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ensureContrast } from "../../styles";
|
|
4
|
+
import styled, { useTheme } from "styled-components/native";
|
|
5
|
+
import Text from "../Text/index";
|
|
6
|
+
import Flex from "../Layout/Flex";
|
|
7
|
+
const Container = styled(Flex).attrs((p) => ({
|
|
8
|
+
heigth: p.size,
|
|
9
|
+
width: p.size,
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
justifyContent: "center",
|
|
12
|
+
position: "relative",
|
|
13
|
+
})) ``;
|
|
14
|
+
const Circle = styled(Flex).attrs((p) => ({
|
|
15
|
+
heigth: p.size,
|
|
16
|
+
width: p.size,
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
justifyContent: "center",
|
|
19
|
+
position: "relative",
|
|
20
|
+
borderRadius: 50.0,
|
|
21
|
+
backgroundColor: p.backgroundColor,
|
|
22
|
+
})) ``;
|
|
23
|
+
const TokenContainer = styled(Flex).attrs((p) => ({
|
|
24
|
+
position: "absolute",
|
|
25
|
+
bottom: "-2px",
|
|
26
|
+
right: "-5px",
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
justifyContent: "center",
|
|
29
|
+
heigth: p.size,
|
|
30
|
+
width: p.size,
|
|
31
|
+
borderRadius: 50.0,
|
|
32
|
+
border: `2px solid ${p.borderColor}`,
|
|
33
|
+
backgroundColor: p.backgroundColor,
|
|
34
|
+
zIndex: 0,
|
|
35
|
+
})) ``;
|
|
36
|
+
function Fallback({ name }) {
|
|
37
|
+
return (React.createElement(Text, { uppercase: true, color: "neutral.c70" }, name.slice(0, 1)));
|
|
38
|
+
}
|
|
39
|
+
const IconBox = ({ children, color, backgroundColor, disabled, size = 16, tokenIcon = "", }) => {
|
|
40
|
+
const { colors } = useTheme();
|
|
41
|
+
if (tokenIcon in icons) {
|
|
42
|
+
// @ts-expect-error FIXME I don't know how to make you happy ts
|
|
43
|
+
const Component = icons[tokenIcon];
|
|
44
|
+
const defaultColor = Component.DefaultColor;
|
|
45
|
+
const iconColor = disabled ? colors.neutral.c70 : color || defaultColor;
|
|
46
|
+
const contrastedColor = ensureContrast(iconColor, backgroundColor || colors.background.main);
|
|
47
|
+
return (React.createElement(Container, { size: size },
|
|
48
|
+
children,
|
|
49
|
+
tokenIcon && (React.createElement(TokenContainer, { size: size / 3, borderColor: colors.background.main, backgroundColor: contrastedColor },
|
|
50
|
+
React.createElement(Component, { size: size, color: colors.background.main })))));
|
|
51
|
+
}
|
|
52
|
+
return children;
|
|
53
|
+
};
|
|
54
|
+
const CryptoIcon = ({ name, size = 16, color, backgroundColor, circleIcon, disabled, tokenIcon, fallbackIcon, }) => {
|
|
55
|
+
const { colors } = useTheme();
|
|
56
|
+
const maybeIconName = `${name}`;
|
|
57
|
+
if (maybeIconName in icons) {
|
|
58
|
+
// @ts-expect-error FIXME I don't know how to make you happy ts
|
|
59
|
+
const Component = icons[maybeIconName];
|
|
60
|
+
const defaultColor = Component.DefaultColor;
|
|
61
|
+
const iconColor = disabled ? colors.neutral.c70 : color || defaultColor;
|
|
62
|
+
const contrastedColor = ensureContrast(iconColor, backgroundColor || colors.background.main);
|
|
63
|
+
return (React.createElement(IconBox, { size: size, tokenIcon: tokenIcon, color: color, disabled: disabled, name: name }, tokenIcon || circleIcon ? (React.createElement(Circle, { backgroundColor: contrastedColor, size: size },
|
|
64
|
+
React.createElement(Component, { size: size, color: colors.background.main }))) : (React.createElement(Component, { size: size, color: contrastedColor }))));
|
|
65
|
+
}
|
|
66
|
+
if (fallbackIcon) {
|
|
67
|
+
return fallbackIcon;
|
|
68
|
+
}
|
|
69
|
+
return React.createElement(Fallback, { name: name });
|
|
70
|
+
};
|
|
71
|
+
export default CryptoIcon;
|
|
@@ -2,5 +2,6 @@ export { default as IconBox } from "./IconBox";
|
|
|
2
2
|
export { default as IconBadge } from "./IconBadge";
|
|
3
3
|
export { default as BoxedIcon } from "./BoxedIcon";
|
|
4
4
|
export { default as Icon } from "./Icon";
|
|
5
|
+
export { default as CryptoIcon } from "./CryptoIcon";
|
|
5
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"}
|
|
@@ -2,4 +2,5 @@ export { default as IconBox } from "./IconBox";
|
|
|
2
2
|
export { default as IconBadge } from "./IconBadge";
|
|
3
3
|
export { default as BoxedIcon } from "./BoxedIcon";
|
|
4
4
|
export { default as Icon } from "./Icon";
|
|
5
|
+
export { default as CryptoIcon } from "./CryptoIcon";
|
|
5
6
|
export { default as BannerIcon } from "./BannerIcon";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pre-ldls/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qCAAqC,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pre-ldls/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qCAAqC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/native-ui",
|
|
3
|
-
"version": "0.50.0
|
|
3
|
+
"version": "0.50.0",
|
|
4
4
|
"description": "Ledger Live - Mobile UI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
".": "./lib/index.js",
|
|
28
28
|
"./lib/*": "./lib/*.js",
|
|
29
29
|
"./lib/*/": "./lib/*/index.js",
|
|
30
|
-
"./pre-ldls": "./lib/pre-ldls/index.js",
|
|
31
30
|
"./*": "./lib/*.js",
|
|
32
31
|
"./*/": "./lib/*/index.js",
|
|
33
32
|
"./package.json": "./package.json"
|
|
@@ -36,11 +35,12 @@
|
|
|
36
35
|
"lib/**/*"
|
|
37
36
|
],
|
|
38
37
|
"dependencies": {
|
|
39
|
-
"@ledgerhq/crypto-icons": "1.
|
|
38
|
+
"@ledgerhq/crypto-icons": "1.1.3",
|
|
40
39
|
"color": "^4.0.0",
|
|
41
40
|
"rn-range-slider": "2.1.1",
|
|
42
41
|
"styled-system": "^5.1.5",
|
|
43
|
-
"@ledgerhq/icons-ui": "^
|
|
42
|
+
"@ledgerhq/crypto-icons-ui": "^1.24.0",
|
|
43
|
+
"@ledgerhq/icons-ui": "^0.17.0",
|
|
44
44
|
"@ledgerhq/ui-shared": "^0.5.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|