@ledgerhq/native-ui 0.50.0-nightly.20251129023709 → 0.50.0-nightly.20251203101856
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/index.d.ts +0 -1
- package/lib/assets/index.d.ts.map +1 -1
- package/lib/assets/index.js +0 -2
- 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/index.d.ts +0 -1
- package/lib/components/Icon/index.d.ts.map +1 -1
- package/lib/components/Icon/index.js +0 -1
- package/lib/pre-ldls/components/index.d.ts +1 -0
- package/lib/pre-ldls/components/index.d.ts.map +1 -1
- package/lib/pre-ldls/components/index.js +1 -0
- package/package.json +5 -5
- package/lib/assets/cryptoIcons.d.ts +0 -2
- package/lib/assets/cryptoIcons.d.ts.map +0 -1
- package/lib/assets/cryptoIcons.js +0 -1
- package/lib/components/Icon/CryptoIcon.d.ts +0 -14
- package/lib/components/Icon/CryptoIcon.d.ts.map +0 -1
- package/lib/components/Icon/CryptoIcon.js +0 -71
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"}
|
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,CAAC;
|
|
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,GAAG,KAAK,CAAC,SAAS,CAAC;IACvC,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,YAwElD,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
|
-
React.createElement(Text, { variant: "bodyLineHeight", fontWeight: "medium", color: "neutral.c70", numberOfLines: 3, mt: 2, mb: showLinkCta ? 4 : 0 }, description),
|
|
26
|
+
typeof description === "string" ? (React.createElement(Text, { variant: "bodyLineHeight", fontWeight: "medium", color: "neutral.c70", numberOfLines: 3, mt: 2, mb: showLinkCta ? 4 : 0 }, description)) : (React.createElement(Box, { 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)))))));
|
|
@@ -2,6 +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";
|
|
6
5
|
export { default as BannerIcon } from "./BannerIcon";
|
|
7
6
|
//# 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"}
|
|
@@ -2,5 +2,4 @@ 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";
|
|
6
5
|
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;AACpD,cAAc,yBAAyB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/native-ui",
|
|
3
|
-
"version": "0.50.0-nightly.
|
|
3
|
+
"version": "0.50.0-nightly.20251203101856",
|
|
4
4
|
"description": "Ledger Live - Mobile UI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
".": "./lib/index.js",
|
|
28
28
|
"./lib/*": "./lib/*.js",
|
|
29
29
|
"./lib/*/": "./lib/*/index.js",
|
|
30
|
+
"./pre-ldls": "./lib/pre-ldls/index.js",
|
|
30
31
|
"./*": "./lib/*.js",
|
|
31
32
|
"./*/": "./lib/*/index.js",
|
|
32
33
|
"./package.json": "./package.json"
|
|
@@ -35,13 +36,12 @@
|
|
|
35
36
|
"lib/**/*"
|
|
36
37
|
],
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@ledgerhq/crypto-icons": "1.
|
|
39
|
+
"@ledgerhq/crypto-icons": "1.3.0",
|
|
39
40
|
"color": "^4.0.0",
|
|
40
41
|
"rn-range-slider": "2.1.1",
|
|
41
42
|
"styled-system": "^5.1.5",
|
|
42
|
-
"@ledgerhq/
|
|
43
|
-
"@ledgerhq/ui-shared": "^0.5.0"
|
|
44
|
-
"@ledgerhq/icons-ui": "^0.17.0-nightly.20251129023709"
|
|
43
|
+
"@ledgerhq/icons-ui": "^0.17.0-nightly.20251203101856",
|
|
44
|
+
"@ledgerhq/ui-shared": "^0.5.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"react": ">=17",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cryptoIcons.d.ts","sourceRoot":"","sources":["../../src/assets/cryptoIcons.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "@ledgerhq/crypto-icons-ui/native";
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,71 +0,0 @@
|
|
|
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;
|