@ledgerhq/native-ui 0.50.0 → 0.51.0-nightly.20251210100832
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/Form/Input/NumberInput/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/components/Tabs/Chip/index.d.ts.map +1 -1
- package/lib/components/Tabs/Chip/index.js +1 -1
- package/lib/pre-ldls/components/Tag/Tag.d.ts.map +1 -1
- package/lib/pre-ldls/components/Tag/Tag.js +1 -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/lib/pre-ldls/components/sharedStoryBook.d.ts.map +1 -1
- package/lib/pre-ldls/components/sharedStoryBook.js +2 -2
- package/lib/styles/theme.d.ts +1 -6
- package/lib/styles/theme.d.ts.map +1 -1
- package/lib/styles/theme.js +1 -4
- package/package.json +3 -3
- 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/components/Tabs/Chip/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAqB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAc5E,eAAO,MAAM,OAAO,kHAWjB,YAAY,KAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/Chip/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAqB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAc5E,eAAO,MAAM,OAAO,kHAWjB,YAAY,KAAG,MAAM,YAmBvB,CAAC;AAEF,QAAA,MAAM,QAAQ,UAAW,aAAa,KAAG,MAAM,YAE9C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -12,6 +12,6 @@ const TabBox = styled(Pressable) `
|
|
|
12
12
|
background-color: ${(p) => p.isActive ? p.activeBg ?? p.theme.colors.primary.c20 : p.inactiveBg ?? "transparent"};
|
|
13
13
|
`;
|
|
14
14
|
export const ChipTab = ({ onPress, isActive, label, disabled, activeBg, activeColor, inactiveBg, inactiveColor, stretchItems, size = "medium", }) => (React.createElement(TabBox, { activeBg: activeBg, disabled: disabled, inactiveBg: inactiveBg, isActive: isActive, stretchItems: stretchItems, onPressIn: onPress, size: size },
|
|
15
|
-
React.createElement(Text, { variant: "small", fontWeight: "semiBold", color: isActive ? activeColor ?? "
|
|
15
|
+
React.createElement(Text, { variant: "small", fontWeight: "semiBold", color: isActive ? activeColor ?? "neutral.c100" : inactiveColor ?? "neutral.c80", textAlign: "center" }, label)));
|
|
16
16
|
const ChipTabs = (props) => (React.createElement(TemplateTabs, { ...props, Item: ChipTab }));
|
|
17
17
|
export default ChipTabs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAWzC,eAAO,MAAM,GAAG;oBAKE,SAAS,CAAC,eAAe,CAAC;cAChC,SAAS;;
|
|
1
|
+
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAWzC,eAAO,MAAM,GAAG;oBAKE,SAAS,CAAC,eAAe,CAAC;cAChC,SAAS;;uBAUpB,CAAC"}
|
|
@@ -10,5 +10,5 @@ const Wrapper = styled.View `
|
|
|
10
10
|
`;
|
|
11
11
|
export const Tag = ({ textTransform = "none", children, spacing = "sm", }) => {
|
|
12
12
|
return (React.createElement(Wrapper, { testID: "tag", "$spacing": spacing },
|
|
13
|
-
React.createElement(Text, { color: "
|
|
13
|
+
React.createElement(Text, { color: "neutral.c70", fontSize: "10px", lineHeight: "16px", textTransform: textTransform }, children)));
|
|
14
14
|
};
|
|
@@ -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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedStoryBook.d.ts","sourceRoot":"","sources":["../../../src/pre-ldls/components/sharedStoryBook.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,eAAO,MAAM,gBAAgB,sIAI5B,CAAC;AAEF,eAAO,MAAM,WAAW,mBAA2B,CAAC;AAEpD,eAAO,MAAM,kBAAkB,iBAAkB,OAAO,
|
|
1
|
+
{"version":3,"file":"sharedStoryBook.d.ts","sourceRoot":"","sources":["../../../src/pre-ldls/components/sharedStoryBook.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,eAAO,MAAM,gBAAgB,sIAI5B,CAAC;AAEF,eAAO,MAAM,WAAW,mBAA2B,CAAC;AAEpD,eAAO,MAAM,kBAAkB,iBAAkB,OAAO,sBAevD,CAAC"}
|
|
@@ -9,5 +9,5 @@ export const BalanceContainer = styled.View `
|
|
|
9
9
|
`;
|
|
10
10
|
export const leftElement = React.createElement(Tag, null, "1.34% APY");
|
|
11
11
|
export const createRightElement = (discreetMode) => (React.createElement(BalanceContainer, null,
|
|
12
|
-
React.createElement(Text, { fontSize: "14px", variant: "largeLineHeight", fontWeight: "semiBold", color: "
|
|
13
|
-
React.createElement(Text, { fontSize: "12px", lineHeight: "16px", variant: "bodyLineHeight", fontWeight: "medium", color: "
|
|
12
|
+
React.createElement(Text, { fontSize: "14px", variant: "largeLineHeight", fontWeight: "semiBold", color: "neutral.c100" }, discreetMode ? "$***" : "$5,969.83"),
|
|
13
|
+
React.createElement(Text, { fontSize: "12px", lineHeight: "16px", variant: "bodyLineHeight", fontWeight: "medium", color: "neutral.c70" }, discreetMode ? "*** BTC" : "0.118 BTC")));
|
package/lib/styles/theme.d.ts
CHANGED
|
@@ -15,12 +15,7 @@ export type Theme = {
|
|
|
15
15
|
radii: number[];
|
|
16
16
|
fontSizes: number[];
|
|
17
17
|
space: number[];
|
|
18
|
-
colors: ColorPalette
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated Do not use the .palette prefix anymore!
|
|
21
|
-
*/
|
|
22
|
-
palette: ColorPalette;
|
|
23
|
-
};
|
|
18
|
+
colors: ColorPalette;
|
|
24
19
|
zIndexes: number[];
|
|
25
20
|
};
|
|
26
21
|
declare const theme: Theme;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/styles/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAY,MAAM,qBAAqB,CAAC;AAG7D,eAAO,MAAM,KAAK,UAA4D,CAAC;AAE/E,eAAO,MAAM,YAAY,mMAkBf,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,MAAM,MAAM,UAAU,CAAC,IAAI,EAAE,OAAO,SAAS,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAG3F,eAAO,MAAM,SAAS,4NAGrB,CAAC;AAqBF,eAAO,MAAM,KAAK,UAAY,CAAC;AAC/B,eAAO,MAAM,QAAQ,UAAwC,CAAC;AAE9D,MAAM,MAAM,KAAK,GAAG;IAClB,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,KAAK,EAAE;QACL,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/styles/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAY,MAAM,qBAAqB,CAAC;AAG7D,eAAO,MAAM,KAAK,UAA4D,CAAC;AAE/E,eAAO,MAAM,YAAY,mMAkBf,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,MAAM,MAAM,UAAU,CAAC,IAAI,EAAE,OAAO,SAAS,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAG3F,eAAO,MAAM,SAAS,4NAGrB,CAAC;AAqBF,eAAO,MAAM,KAAK,UAAY,CAAC;AAC/B,eAAO,MAAM,QAAQ,UAAwC,CAAC;AAE9D,MAAM,MAAM,KAAK,GAAG;IAClB,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,KAAK,EAAE;QACL,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,QAAA,MAAM,KAAK,EAAE,KAWZ,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
package/lib/styles/theme.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/native-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.0-nightly.20251210100832",
|
|
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,11 +36,10 @@
|
|
|
35
36
|
"lib/**/*"
|
|
36
37
|
],
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@ledgerhq/crypto-icons": "1.
|
|
39
|
+
"@ledgerhq/crypto-icons": "1.4.0",
|
|
39
40
|
"color": "^4.0.0",
|
|
40
41
|
"rn-range-slider": "2.1.1",
|
|
41
42
|
"styled-system": "^5.1.5",
|
|
42
|
-
"@ledgerhq/crypto-icons-ui": "^1.24.0",
|
|
43
43
|
"@ledgerhq/icons-ui": "^0.17.0",
|
|
44
44
|
"@ledgerhq/ui-shared": "^0.5.0"
|
|
45
45
|
},
|
|
@@ -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;
|