@ledgerhq/react-ui 0.19.1 → 0.20.0-next.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/cjs/components/asorted/Icon/NotificationIcon.js +106 -0
- package/lib/cjs/components/asorted/Icon/NotificationIcon.js.map +7 -0
- package/lib/cjs/components/asorted/Icon/NotificationIcon.stories.js +58 -0
- package/lib/cjs/components/asorted/Icon/NotificationIcon.stories.js.map +7 -0
- package/lib/cjs/components/asorted/Icon/index.js +2 -0
- package/lib/cjs/components/asorted/Icon/index.js.map +2 -2
- package/lib/cjs/components/asorted/index.js +1 -0
- package/lib/cjs/components/asorted/index.js.map +2 -2
- package/lib/cjs/components/layout/Banner/BannerCard/BannerCard.stories.js +8 -14
- package/lib/cjs/components/layout/Banner/BannerCard/BannerCard.stories.js.map +2 -2
- package/lib/cjs/components/layout/Banner/BannerCard/index.js +5 -12
- package/lib/cjs/components/layout/Banner/BannerCard/index.js.map +3 -3
- package/lib/cjs/components/layout/Banner/NotificationCard/NotificationCard.stories.js +9 -6
- package/lib/cjs/components/layout/Banner/NotificationCard/NotificationCard.stories.js.map +3 -3
- package/lib/cjs/components/layout/Banner/NotificationCard/index.js +8 -45
- package/lib/cjs/components/layout/Banner/NotificationCard/index.js.map +3 -3
- package/lib/cjs/components/layout/ContentCard/PortfolioContentCard/index.js +2 -1
- package/lib/cjs/components/layout/ContentCard/PortfolioContentCard/index.js.map +2 -2
- package/lib/components/asorted/Icon/NotificationIcon.d.ts +11 -0
- package/lib/components/asorted/Icon/NotificationIcon.d.ts.map +1 -0
- package/lib/components/asorted/Icon/NotificationIcon.js +73 -0
- package/lib/components/asorted/Icon/NotificationIcon.js.map +1 -0
- package/lib/components/asorted/Icon/index.d.ts +1 -0
- package/lib/components/asorted/Icon/index.d.ts.map +1 -1
- package/lib/components/asorted/Icon/index.js +1 -0
- package/lib/components/asorted/Icon/index.js.map +1 -1
- package/lib/components/asorted/index.d.ts +1 -1
- package/lib/components/asorted/index.d.ts.map +1 -1
- package/lib/components/asorted/index.js +1 -1
- package/lib/components/asorted/index.js.map +1 -1
- package/lib/components/layout/Banner/BannerCard/index.d.ts +4 -5
- package/lib/components/layout/Banner/BannerCard/index.d.ts.map +1 -1
- package/lib/components/layout/Banner/BannerCard/index.js +6 -14
- package/lib/components/layout/Banner/BannerCard/index.js.map +1 -1
- package/lib/components/layout/Banner/NotificationCard/index.d.ts +4 -4
- package/lib/components/layout/Banner/NotificationCard/index.d.ts.map +1 -1
- package/lib/components/layout/Banner/NotificationCard/index.js +10 -49
- package/lib/components/layout/Banner/NotificationCard/index.js.map +1 -1
- package/lib/components/layout/ContentCard/PortfolioContentCard/index.d.ts.map +1 -1
- package/lib/components/layout/ContentCard/PortfolioContentCard/index.js +2 -1
- package/lib/components/layout/ContentCard/PortfolioContentCard/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var NotificationIcon_exports = {};
|
|
30
|
+
__export(NotificationIcon_exports, {
|
|
31
|
+
default: () => NotificationIcon
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(NotificationIcon_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
36
|
+
var Icons = __toESM(require("@ledgerhq/icons-ui/react"));
|
|
37
|
+
var import_layout = require("../../layout");
|
|
38
|
+
var import_styles = require("../../../styles");
|
|
39
|
+
function getColorsByIcon(colors) {
|
|
40
|
+
const { warning } = colors;
|
|
41
|
+
return {
|
|
42
|
+
Warning: {
|
|
43
|
+
round: { fg: warning.c80, bg: warning.c30 },
|
|
44
|
+
square: { fg: warning.c80, bg: warning.c30 }
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function getDefaultDefaultColors({ primary }) {
|
|
49
|
+
return {
|
|
50
|
+
round: { fg: primary.c90, bg: primary.c30 },
|
|
51
|
+
square: { fg: primary.c80, bg: (0, import_styles.rgba)(primary.c80, 0.08) }
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function NotificationIcon({ icon, variant = "round" }) {
|
|
55
|
+
var _a;
|
|
56
|
+
const { colors } = (0, import_styled_components.useTheme)();
|
|
57
|
+
const defaultColors = getDefaultDefaultColors(colors)[variant];
|
|
58
|
+
const safeIcon = icon in Icons ? icon : "Information";
|
|
59
|
+
const Icon = Icons[safeIcon];
|
|
60
|
+
const { fg: iconColor = defaultColors.fg, bg: iconBgColor = defaultColors.bg } = ((_a = getColorsByIcon(colors)[safeIcon]) == null ? void 0 : _a[variant]) ?? {};
|
|
61
|
+
return /* @__PURE__ */ import_react.default.createElement(Wrapper, { backgroundColor: iconBgColor, variant }, /* @__PURE__ */ import_react.default.createElement(Icon, { color: iconColor }));
|
|
62
|
+
}
|
|
63
|
+
const Wrapper = (0, import_styled_components.default)(import_layout.Box)`
|
|
64
|
+
display: inline-flex;
|
|
65
|
+
padding: 8px;
|
|
66
|
+
${(p) => p.variant === "square" ? squareWrapper : roundWrapper}
|
|
67
|
+
`;
|
|
68
|
+
const roundWrapper = import_styled_components.css`
|
|
69
|
+
border-radius: 50%;
|
|
70
|
+
`;
|
|
71
|
+
const squareWrapper = import_styled_components.css`
|
|
72
|
+
border-radius: 13.5px;
|
|
73
|
+
background-clip: padding-box;
|
|
74
|
+
border-width: 7px;
|
|
75
|
+
border-style: solid;
|
|
76
|
+
border-color: transparent;
|
|
77
|
+
position: relative;
|
|
78
|
+
|
|
79
|
+
${(p) => import_styled_components.css`
|
|
80
|
+
&::before,
|
|
81
|
+
&::after {
|
|
82
|
+
content: "";
|
|
83
|
+
position: absolute;
|
|
84
|
+
inset: -7px;
|
|
85
|
+
border-radius: 13.5px;
|
|
86
|
+
rotate: ${p.theme.colors.type === "dark" ? "0deg" : "180deg"};
|
|
87
|
+
}
|
|
88
|
+
&::before {
|
|
89
|
+
background: linear-gradient(
|
|
90
|
+
${p.theme.colors.type === "dark" ? "rgba(255, 255, 255, 0.05)" : "rgba(29, 28, 31, 0.05)"}
|
|
91
|
+
0%,
|
|
92
|
+
rgba(29, 28, 31, 0) 100%
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
&::after {
|
|
96
|
+
content: ${p.theme.colors.type};
|
|
97
|
+
border: solid 0.5px ${p.theme.colors.type === "dark" ? "#fff" : "rgba(0, 0, 0, 0.5)"};
|
|
98
|
+
mask-image: linear-gradient(
|
|
99
|
+
rgba(255, 255, 255, 0.15) 0%,
|
|
100
|
+
rgba(255, 255, 255, 0.01) 60%,
|
|
101
|
+
rgba(255, 255, 255, 0) 100%
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
`};
|
|
105
|
+
`;
|
|
106
|
+
//# sourceMappingURL=NotificationIcon.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/asorted/Icon/NotificationIcon.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from \"react\";\nimport styled, { css, useTheme } from \"styled-components\";\n\nimport * as Icons from \"@ledgerhq/icons-ui/react\";\nimport { Box } from \"../../layout\";\nimport { type ColorPalette, rgba } from \"../../../styles\";\n\ntype IconKey = keyof typeof Icons;\ntype WrapperType = \"round\" | \"square\";\n\ntype IconPallet = { fg: string; bg: string };\n\nfunction getColorsByIcon(\n colors: ColorPalette,\n): Partial<Record<IconKey, Partial<Record<WrapperType, Partial<IconPallet>>>>> {\n const { warning } = colors;\n\n return {\n Warning: {\n round: { fg: warning.c80, bg: warning.c30 },\n square: { fg: warning.c80, bg: warning.c30 },\n },\n };\n}\n\nfunction getDefaultDefaultColors({ primary }: ColorPalette): Record<WrapperType, IconPallet> {\n return {\n round: { fg: primary.c90, bg: primary.c30 },\n square: { fg: primary.c80, bg: rgba(primary.c80, 0.08) },\n };\n}\n\ntype Props = Readonly<{\n icon: IconKey;\n variant: WrapperType;\n}>;\n\nexport default function NotificationIcon({ icon, variant = \"round\" }: Props) {\n const { colors } = useTheme();\n const defaultColors = getDefaultDefaultColors(colors)[variant];\n const safeIcon: IconKey = icon in Icons ? icon : \"Information\";\n const Icon = Icons[safeIcon];\n const { fg: iconColor = defaultColors.fg, bg: iconBgColor = defaultColors.bg } =\n getColorsByIcon(colors)[safeIcon]?.[variant] ?? {};\n\n return (\n <Wrapper backgroundColor={iconBgColor} variant={variant}>\n <Icon color={iconColor} />\n </Wrapper>\n );\n}\n\nconst Wrapper = styled(Box)<{ variant: WrapperType }>`\n display: inline-flex;\n padding: 8px;\n ${p => (p.variant === \"square\" ? squareWrapper : roundWrapper)}\n`;\n\nconst roundWrapper = css`\n border-radius: 50%;\n`;\n\nconst squareWrapper = css`\n border-radius: 13.5px;\n background-clip: padding-box;\n border-width: 7px;\n border-style: solid;\n border-color: transparent;\n position: relative;\n\n ${p => css`\n &::before,\n &::after {\n content: \"\";\n position: absolute;\n inset: -7px;\n border-radius: 13.5px;\n rotate: ${p.theme.colors.type === \"dark\" ? \"0deg\" : \"180deg\"};\n }\n &::before {\n background: linear-gradient(\n ${p.theme.colors.type === \"dark\" ? \"rgba(255, 255, 255, 0.05)\" : \"rgba(29, 28, 31, 0.05)\"}\n 0%,\n rgba(29, 28, 31, 0) 100%\n );\n }\n &::after {\n content: ${p.theme.colors.type};\n border: solid 0.5px ${p.theme.colors.type === \"dark\" ? \"#fff\" : \"rgba(0, 0, 0, 0.5)\"};\n mask-image: linear-gradient(\n rgba(255, 255, 255, 0.15) 0%,\n rgba(255, 255, 255, 0.01) 60%,\n rgba(255, 255, 255, 0) 100%\n );\n }\n `};\n`;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,+BAAsC;AAEtC,YAAuB;AACvB,oBAAoB;AACpB,oBAAwC;AAOxC,SAAS,gBACP,QAC6E;AAC7E,QAAM,EAAE,QAAQ,IAAI;AAEpB,SAAO;AAAA,IACL,SAAS;AAAA,MACP,OAAO,EAAE,IAAI,QAAQ,KAAK,IAAI,QAAQ,IAAI;AAAA,MAC1C,QAAQ,EAAE,IAAI,QAAQ,KAAK,IAAI,QAAQ,IAAI;AAAA,IAC7C;AAAA,EACF;AACF;AAEA,SAAS,wBAAwB,EAAE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|
6
|
+
"names": ["React", "styled"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var NotificationIcon_stories_exports = {};
|
|
30
|
+
__export(NotificationIcon_stories_exports, {
|
|
31
|
+
Default: () => Default,
|
|
32
|
+
default: () => NotificationIcon_stories_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(NotificationIcon_stories_exports);
|
|
35
|
+
var Icons = __toESM(require("@ledgerhq/icons-ui/react"));
|
|
36
|
+
var import_NotificationIcon = __toESM(require("./NotificationIcon"));
|
|
37
|
+
const meta = {
|
|
38
|
+
title: "Asorted/NotificationIcon",
|
|
39
|
+
component: import_NotificationIcon.default,
|
|
40
|
+
argTypes: {
|
|
41
|
+
icon: {
|
|
42
|
+
description: "Icon to display.",
|
|
43
|
+
options: Object.keys(Icons),
|
|
44
|
+
control: { type: "select" }
|
|
45
|
+
},
|
|
46
|
+
variant: {
|
|
47
|
+
options: ["round", "square"],
|
|
48
|
+
control: { type: "inline-radio" }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
args: {
|
|
52
|
+
icon: "Info",
|
|
53
|
+
variant: "round"
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var NotificationIcon_stories_default = meta;
|
|
57
|
+
const Default = {};
|
|
58
|
+
//# sourceMappingURL=NotificationIcon.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/asorted/Icon/NotificationIcon.stories.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from \"@storybook/react\";\n\nimport * as Icons from \"@ledgerhq/icons-ui/react\";\nimport NotificationIcon from \"./NotificationIcon\";\n\nconst meta: Meta<typeof NotificationIcon> = {\n title: \"Asorted/NotificationIcon\",\n component: NotificationIcon,\n argTypes: {\n icon: {\n description: \"Icon to display.\",\n options: Object.keys(Icons),\n control: { type: \"select\" },\n },\n variant: {\n options: [\"round\", \"square\"],\n control: { type: \"inline-radio\" },\n },\n },\n args: {\n icon: \"Info\",\n variant: \"round\",\n },\n};\nexport default meta;\n\ntype Story = StoryObj<typeof NotificationIcon>;\n\nexport const Default: Story = {};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AACvB,8BAA6B;AAE7B,MAAM,OAAsC;AAAA,EAC1C,OAAO;AAAA,EACP,WAAW,wBAAAA;AAAA,EACX,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,aAAa;AAAA,MACb,SAAS,OAAO,KAAK,KAAK;AAAA,MAC1B,SAAS,EAAE,MAAM,SAAS;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,MACP,SAAS,CAAC,SAAS,QAAQ;AAAA,MAC3B,SAAS,EAAE,MAAM,eAAe;AAAA,IAClC;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AACF;AACA,IAAO,mCAAQ;AAIR,MAAM,UAAiB,CAAC;",
|
|
6
|
+
"names": ["NotificationIcon"]
|
|
7
|
+
}
|
|
@@ -31,6 +31,7 @@ __export(Icon_exports, {
|
|
|
31
31
|
BoxedIcon: () => import_BoxedIcon.default,
|
|
32
32
|
CryptoIcon: () => import_CryptoIcon.default,
|
|
33
33
|
IconBox: () => import_BoxedIcon.IconBox,
|
|
34
|
+
NotificationIcon: () => import_NotificationIcon.default,
|
|
34
35
|
default: () => import_Icon.default,
|
|
35
36
|
iconNames: () => import_Icon.iconNames
|
|
36
37
|
});
|
|
@@ -38,4 +39,5 @@ module.exports = __toCommonJS(Icon_exports);
|
|
|
38
39
|
var import_Icon = __toESM(require("./Icon"));
|
|
39
40
|
var import_BoxedIcon = __toESM(require("./BoxedIcon"));
|
|
40
41
|
var import_CryptoIcon = __toESM(require("./CryptoIcon"));
|
|
42
|
+
var import_NotificationIcon = __toESM(require("./NotificationIcon"));
|
|
41
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/asorted/Icon/index.tsx"],
|
|
4
|
-
"sourcesContent": ["export { default, iconNames } from \"./Icon\";\nimport BoxedIcon, { IconBox } from \"./BoxedIcon\";\nexport { BoxedIcon, IconBox };\nexport type { Props } from \"./Icon\";\nexport { default as CryptoIcon } from \"./CryptoIcon\";\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,oCAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmC;AACnC,uBAAmC;AAGnC,wBAAsC;",
|
|
4
|
+
"sourcesContent": ["export { default, iconNames } from \"./Icon\";\nimport BoxedIcon, { IconBox } from \"./BoxedIcon\";\nexport { BoxedIcon, IconBox };\nexport type { Props } from \"./Icon\";\nexport { default as CryptoIcon } from \"./CryptoIcon\";\nexport { default as NotificationIcon } from \"./NotificationIcon\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,oCAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmC;AACnC,uBAAmC;AAGnC,wBAAsC;AACtC,8BAA4C;",
|
|
6
6
|
"names": ["BoxedIcon"]
|
|
7
7
|
}
|
|
@@ -33,6 +33,7 @@ __export(asorted_exports, {
|
|
|
33
33
|
Divider: () => import_Divider.default,
|
|
34
34
|
Icon: () => import_Icon.default,
|
|
35
35
|
IconBox: () => import_Icon.IconBox,
|
|
36
|
+
NotificationIcon: () => import_Icon.NotificationIcon,
|
|
36
37
|
Text: () => import_Text.default
|
|
37
38
|
});
|
|
38
39
|
module.exports = __toCommonJS(asorted_exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/asorted/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { default as Divider } from \"./Divider\";\nexport { default as Icon, IconBox, BoxedIcon, CryptoIcon } from \"./Icon\";\nexport { default as Text } from \"./Text\";\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAmC;AACnC,
|
|
4
|
+
"sourcesContent": ["export { default as Divider } from \"./Divider\";\nexport { default as Icon, IconBox, BoxedIcon, CryptoIcon, NotificationIcon } from \"./Icon\";\nexport { default as Text } from \"./Text\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAmC;AACnC,kBAAkF;AAClF,kBAAgC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -35,8 +35,9 @@ __export(BannerCard_stories_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(BannerCard_stories_exports);
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var import_asorted = require("../../../asorted");
|
|
38
|
+
var import_cta = require("../../../cta");
|
|
38
39
|
var import__ = __toESM(require("."));
|
|
39
|
-
|
|
40
|
+
const meta = {
|
|
40
41
|
title: "Layout/Banner/BannerCard",
|
|
41
42
|
component: import__.default,
|
|
42
43
|
argTypes: {
|
|
@@ -44,10 +45,7 @@ var BannerCard_stories_default = {
|
|
|
44
45
|
description: "Title of the card."
|
|
45
46
|
},
|
|
46
47
|
cta: {
|
|
47
|
-
description: "Call to action
|
|
48
|
-
},
|
|
49
|
-
linkText: {
|
|
50
|
-
description: "Link text."
|
|
48
|
+
description: "Call to action element."
|
|
51
49
|
},
|
|
52
50
|
description: {
|
|
53
51
|
description: "Description of the card."
|
|
@@ -61,9 +59,6 @@ var BannerCard_stories_default = {
|
|
|
61
59
|
onClick: {
|
|
62
60
|
description: "Function to be called when the card is clicked."
|
|
63
61
|
},
|
|
64
|
-
onLinkClick: {
|
|
65
|
-
description: "Function to be called when the link is clicked."
|
|
66
|
-
},
|
|
67
62
|
onClose: {
|
|
68
63
|
description: "Function to be called when the close button is clicked."
|
|
69
64
|
}
|
|
@@ -71,19 +66,18 @@ var BannerCard_stories_default = {
|
|
|
71
66
|
args: {
|
|
72
67
|
title: "Ledger Recover",
|
|
73
68
|
description: "Get peace of mind and start your free trial.",
|
|
74
|
-
cta: "Start my free trial",
|
|
75
|
-
linkText: "Learn more",
|
|
69
|
+
cta: /* @__PURE__ */ import_react.default.createElement(import_cta.Link, null, /* @__PURE__ */ import_react.default.createElement(import_asorted.Text, null, "Start my free trial")),
|
|
76
70
|
tag: "New",
|
|
77
71
|
image: "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='450' height='526' viewBox='0 0 450 526'><defs><linearGradient id='g' x0='0' y0='0' x1='1' y1='1'><stop stop-color='%23000' offset='0%' /><stop stop-color='%23FFF' offset='100%' /></linearGradient></defs><path d='M0,0 H450 V526 Q0,526 0,0 z' fill='url(%23g)' /></svg>"
|
|
78
72
|
}
|
|
79
73
|
};
|
|
74
|
+
var BannerCard_stories_default = meta;
|
|
80
75
|
const Default = {};
|
|
81
76
|
const LNSCardBanner = {
|
|
82
77
|
args: {
|
|
83
|
-
title: "
|
|
84
|
-
description: /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, "Upgrade to
|
|
85
|
-
|
|
86
|
-
cta: "Level up my wallet",
|
|
78
|
+
title: "Limited memory, limited experience",
|
|
79
|
+
description: /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, "Upgrade your Nano S to a newer Ledger \u2014 like the Ledger Flex \u2014 for more memory, the latest security enhancements, fresh features, and", " ", /* @__PURE__ */ import_react.default.createElement(import_asorted.Text, { color: "primary.c80" }, "an exclusive 20% off"), "."),
|
|
80
|
+
cta: /* @__PURE__ */ import_react.default.createElement(import_cta.Button, { variant: "main", outline: false }, "Upgrade my Ledger"),
|
|
87
81
|
tag: void 0,
|
|
88
82
|
onClose: void 0,
|
|
89
83
|
borderRadius: "5px"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/components/layout/Banner/BannerCard/BannerCard.stories.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { Meta, StoryObj } from \"@storybook/react\";\nimport React from \"react\";\n\nimport { Text } from \"../../../asorted\";\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAElB,qBAAqB;AACrB,
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from \"@storybook/react\";\nimport React from \"react\";\n\nimport { Text } from \"../../../asorted\";\nimport { Button, Link } from \"../../../cta\";\nimport BannerCard from \".\";\n\nconst meta: Meta<typeof BannerCard> = {\n title: \"Layout/Banner/BannerCard\",\n component: BannerCard,\n argTypes: {\n title: {\n description: \"Title of the card.\",\n },\n cta: {\n description: \"Call to action element.\",\n },\n description: {\n description: \"Description of the card.\",\n },\n tag: {\n description: \"Tag to be displayed on top of the card.\",\n },\n image: {\n description: \"Image to be displayed on the right of the card.\",\n },\n onClick: {\n description: \"Function to be called when the card is clicked.\",\n },\n onClose: {\n description: \"Function to be called when the close button is clicked.\",\n },\n },\n args: {\n title: \"Ledger Recover\",\n description: \"Get peace of mind and start your free trial.\",\n cta: (\n <Link>\n <Text>Start my free trial</Text>\n </Link>\n ),\n tag: \"New\",\n image:\n \"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='450' height='526' viewBox='0 0 450 526'><defs><linearGradient id='g' x0='0' y0='0' x1='1' y1='1'><stop stop-color='%23000' offset='0%' /><stop stop-color='%23FFF' offset='100%' /></linearGradient></defs><path d='M0,0 H450 V526 Q0,526 0,0 z' fill='url(%23g)' /></svg>\",\n },\n};\nexport default meta;\n\ntype Story = StoryObj<typeof BannerCard>;\n\nexport const Default: Story = {};\n\nexport const LNSCardBanner: Story = {\n args: {\n title: \"Limited memory, limited experience\",\n description: (\n <>\n Upgrade your Nano S to a newer Ledger \u2014 like the Ledger Flex \u2014 for more memory, the latest\n security enhancements, fresh features, and{\" \"}\n <Text color=\"primary.c80\">an exclusive 20% off</Text>.\n </>\n ),\n cta: (\n <Button variant=\"main\" outline={false}>\n Upgrade my Ledger\n </Button>\n ),\n tag: undefined,\n onClose: undefined,\n borderRadius: \"5px\",\n },\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAElB,qBAAqB;AACrB,iBAA6B;AAC7B,eAAuB;AAEvB,MAAM,OAAgC;AAAA,EACpC,OAAO;AAAA,EACP,WAAW,SAAAA;AAAA,EACX,UAAU;AAAA,IACR,OAAO;AAAA,MACL,aAAa;AAAA,IACf;AAAA,IACA,KAAK;AAAA,MACH,aAAa;AAAA,IACf;AAAA,IACA,aAAa;AAAA,MACX,aAAa;AAAA,IACf;AAAA,IACA,KAAK;AAAA,MACH,aAAa;AAAA,IACf;AAAA,IACA,OAAO;AAAA,MACL,aAAa;AAAA,IACf;AAAA,IACA,SAAS;AAAA,MACP,aAAa;AAAA,IACf;AAAA,IACA,SAAS;AAAA,MACP,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,KACE,6BAAAC,QAAA,cAAC,uBACC,6BAAAA,QAAA,cAAC,2BAAK,qBAAmB,CAC3B;AAAA,IAEF,KAAK;AAAA,IACL,OACE;AAAA,EACJ;AACF;AACA,IAAO,6BAAQ;AAIR,MAAM,UAAiB,CAAC;AAExB,MAAM,gBAAuB;AAAA,EAClC,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,aACE,6BAAAA,QAAA,2BAAAA,QAAA,gBAAE,mJAE2C,KAC3C,6BAAAA,QAAA,cAAC,uBAAK,OAAM,iBAAc,sBAAoB,GAAO,GACvD;AAAA,IAEF,KACE,6BAAAA,QAAA,cAAC,qBAAO,SAAQ,QAAO,SAAS,SAAO,mBAEvC;AAAA,IAEF,KAAK;AAAA,IACL,SAAS;AAAA,IACT,cAAc;AAAA,EAChB;AACF;",
|
|
6
6
|
"names": ["BannerCard", "React"]
|
|
7
7
|
}
|
|
@@ -35,20 +35,18 @@ var import_react = __toESM(require("react"));
|
|
|
35
35
|
var import_styled_components = __toESM(require("styled-components"));
|
|
36
36
|
var import_styles = require("../../../../styles");
|
|
37
37
|
var import_assets = require("../../../../assets");
|
|
38
|
-
var
|
|
38
|
+
var import_Text = __toESM(require("../../../asorted/Text"));
|
|
39
39
|
var import_cta = require("../../../cta");
|
|
40
40
|
var import_Tag = __toESM(require("../../../Tag"));
|
|
41
41
|
var import__ = require("../..");
|
|
42
42
|
function BannerCard({
|
|
43
43
|
title,
|
|
44
44
|
cta,
|
|
45
|
-
linkText,
|
|
46
45
|
description,
|
|
47
46
|
descriptionWidth,
|
|
48
47
|
tag,
|
|
49
48
|
image,
|
|
50
49
|
onClick,
|
|
51
|
-
onLinkClick,
|
|
52
50
|
onClose,
|
|
53
51
|
...boxProps
|
|
54
52
|
}) {
|
|
@@ -56,26 +54,22 @@ function BannerCard({
|
|
|
56
54
|
event.stopPropagation();
|
|
57
55
|
onClose == null ? void 0 : onClose(event);
|
|
58
56
|
};
|
|
59
|
-
const
|
|
57
|
+
const handleClick = (event) => {
|
|
60
58
|
event.stopPropagation();
|
|
61
59
|
onClick(event);
|
|
62
60
|
};
|
|
63
|
-
|
|
64
|
-
event.stopPropagation();
|
|
65
|
-
onLinkClick == null ? void 0 : onLinkClick(event);
|
|
66
|
-
};
|
|
67
|
-
return /* @__PURE__ */ import_react.default.createElement(Wrapper, { ...boxProps, image, tag, onClick: handleCTAClick }, tag && /* @__PURE__ */ import_react.default.createElement(StyledTag, null, tag), /* @__PURE__ */ import_react.default.createElement(Title, null, title), description && /* @__PURE__ */ import_react.default.createElement(Desc, { maxWidth: descriptionWidth }, description), /* @__PURE__ */ import_react.default.createElement(import__.Flex, { columnGap: 5 }, cta && /* @__PURE__ */ import_react.default.createElement(import_cta.Button, { variant: "main", outline: false, onClick: handleCTAClick }, cta), linkText && /* @__PURE__ */ import_react.default.createElement(import_cta.Link, { onClick: handleLinkClick }, /* @__PURE__ */ import_react.default.createElement(import_asorted.Text, { variant: "body", fontSize: 14, flexShrink: 1 }, linkText))), onClose && /* @__PURE__ */ import_react.default.createElement(import_styles.StyleProvider, { selectedPalette: "dark" }, /* @__PURE__ */ import_react.default.createElement(CloseButton, { "data-testid": "portfolio-card-close-button", onClick: handleClose })));
|
|
61
|
+
return /* @__PURE__ */ import_react.default.createElement(Wrapper, { ...boxProps, image, tag, onClick: handleClick }, tag && /* @__PURE__ */ import_react.default.createElement(StyledTag, null, tag), /* @__PURE__ */ import_react.default.createElement(Title, null, title), description && /* @__PURE__ */ import_react.default.createElement(Desc, { maxWidth: descriptionWidth }, description), /* @__PURE__ */ import_react.default.createElement(import__.Flex, { columnGap: 5 }, cta), onClose && /* @__PURE__ */ import_react.default.createElement(import_styles.StyleProvider, { selectedPalette: "dark" }, /* @__PURE__ */ import_react.default.createElement(CloseButton, { "data-testid": "portfolio-card-close-button", onClick: handleClose })));
|
|
68
62
|
}
|
|
69
63
|
const StyledTag = (0, import_styled_components.default)(import_Tag.default).attrs({ size: "medium", type: "plain", active: true })`
|
|
70
64
|
font-size: 11px;
|
|
71
65
|
background-color: ${(p) => p.theme.colors.primary.c80};
|
|
72
66
|
`;
|
|
73
|
-
const Title = (0, import_styled_components.default)(
|
|
67
|
+
const Title = (0, import_styled_components.default)(import_Text.default).attrs({ variant: "h4Inter" })`
|
|
74
68
|
font-family: Inter;
|
|
75
69
|
font-size: 24px;
|
|
76
70
|
font-weight: 600;
|
|
77
71
|
`;
|
|
78
|
-
const Desc = (0, import_styled_components.default)(
|
|
72
|
+
const Desc = (0, import_styled_components.default)(import_Text.default).attrs({ variant: "small", color: "neutral.c70" })`
|
|
79
73
|
font-family: Inter;
|
|
80
74
|
font-size: 13px;
|
|
81
75
|
font-style: normal;
|
|
@@ -93,7 +87,6 @@ const Wrapper = (0, import_styled_components.default)(import__.Flex)`
|
|
|
93
87
|
padding: 16px;
|
|
94
88
|
padding-top: ${(p) => p.tag ? "16px" : "24px"};
|
|
95
89
|
padding-right: 50%;
|
|
96
|
-
flex-basis: 100%;
|
|
97
90
|
|
|
98
91
|
position: relative;
|
|
99
92
|
flex-direction: column;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/components/layout/Banner/BannerCard/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { type ReactEventHandler, type ReactNode } from \"react\";\nimport styled from \"styled-components\";\n\nimport { StyleProvider } from \"../../../../styles\";\nimport { Icons } from \"../../../../assets\";\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8D;AAC9D,+BAAmB;AAEnB,oBAA8B;AAC9B,oBAAsB;AACtB,
|
|
6
|
-
"names": ["React", "styled", "Tag"]
|
|
4
|
+
"sourcesContent": ["import React, { type ReactEventHandler, type ReactNode } from \"react\";\nimport styled from \"styled-components\";\n\nimport { StyleProvider } from \"../../../../styles\";\nimport { Icons } from \"../../../../assets\";\nimport Text from \"../../../asorted/Text\";\nimport { Button } from \"../../../cta\";\nimport Tag from \"../../../Tag\";\nimport type { FlexBoxProps } from \"../../Flex\";\nimport { Flex } from \"../..\";\n\ntype Props = FlexBoxProps & {\n title: string;\n cta?: ReactNode;\n description?: ReactNode;\n descriptionWidth?: number;\n tag?: string;\n image?: string;\n\n onClick: ReactEventHandler;\n onClose?: ReactEventHandler;\n};\n\nexport default function BannerCard({\n title,\n cta,\n description,\n descriptionWidth,\n tag,\n image,\n onClick,\n onClose,\n ...boxProps\n}: Props) {\n const handleClose: ReactEventHandler = event => {\n event.stopPropagation();\n onClose?.(event);\n };\n const handleClick: ReactEventHandler = event => {\n event.stopPropagation();\n onClick(event);\n };\n\n return (\n <Wrapper {...boxProps} image={image} tag={tag} onClick={handleClick}>\n {tag && <StyledTag>{tag}</StyledTag>}\n <Title>{title}</Title>\n {description && <Desc maxWidth={descriptionWidth}>{description}</Desc>}\n <Flex columnGap={5}>{cta}</Flex>\n {onClose && (\n <StyleProvider selectedPalette=\"dark\">\n <CloseButton data-testid=\"portfolio-card-close-button\" onClick={handleClose} />\n </StyleProvider>\n )}\n </Wrapper>\n );\n}\n\nconst StyledTag = styled(Tag).attrs({ size: \"medium\", type: \"plain\", active: true })`\n font-size: 11px;\n background-color: ${p => p.theme.colors.primary.c80};\n`;\n\nconst Title = styled(Text).attrs({ variant: \"h4Inter\" })`\n font-family: Inter;\n font-size: 24px;\n font-weight: 600;\n`;\n\nconst Desc = styled(Text).attrs({ variant: \"small\", color: \"neutral.c70\" })`\n font-family: Inter;\n font-size: 13px;\n font-style: normal;\n font-weight: 500;\n padding-bottom: 8px;\n`;\n\nconst Wrapper = styled(Flex)<Pick<Props, \"image\" | \"tag\">>`\n background-color: ${p => p.theme.colors.background.card};\n background-image: ${p => (p.image ? `url(\"${p.image}\")` : \"none\")};\n background-position: right center;\n background-repeat: no-repeat;\n background-size: 50% auto;\n\n cursor: pointer;\n padding: 16px;\n padding-top: ${p => (p.tag ? \"16px\" : \"24px\")};\n padding-right: 50%;\n\n position: relative;\n flex-direction: column;\n justify-content: flex-end;\n align-items: flex-start;\n gap: 4px;\n`;\n\nconst CloseButton = styled(Button).attrs({\n Icon: <Icons.Close size=\"XS\" />,\n iconButton: true,\n outline: true,\n})`\n background-color: ${p => p.theme.colors.neutral.c30};\n position: absolute;\n top: 10px;\n right: 10px;\n width: 24px;\n height: 24px;\n svg {\n width: 12px;\n height: 12px;\n }\n`;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8D;AAC9D,+BAAmB;AAEnB,oBAA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OAAO,WAAW,IAAI;AAAA,sBACnC,OAAM,EAAE,QAAQ,QAAQ,EAAE,KAAK,OAAO,MAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAOlD,OAAM,EAAE,MAAM,SAAS,MAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU/C,MAAM,kBAAc,yBAAAA,SAAO,iBAAM,EAAE,MAAM;AAAA,EACvC,MAAM,6BAAAD,QAAA,cAAC,oBAAM,OAAN,EAAY,MAAK,MAAK;AAAA,EAC7B,YAAY;AAAA,EACZ,SAAS;AACX,CAAC;AAAA,sBACqB,OAAK,EAAE,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": ["React", "styled", "Tag", "Text"]
|
|
7
7
|
}
|
|
@@ -33,9 +33,11 @@ __export(NotificationCard_stories_exports, {
|
|
|
33
33
|
default: () => NotificationCard_stories_default
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(NotificationCard_stories_exports);
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
36
37
|
var import_assets = require("../../../../assets");
|
|
38
|
+
var import_cta = require("../../../cta");
|
|
37
39
|
var import__ = __toESM(require("."));
|
|
38
|
-
|
|
40
|
+
const meta = {
|
|
39
41
|
title: "Layout/Banner/NotificationCard",
|
|
40
42
|
component: import__.default,
|
|
41
43
|
argTypes: {
|
|
@@ -43,7 +45,7 @@ var NotificationCard_stories_default = {
|
|
|
43
45
|
description: "Title of the card."
|
|
44
46
|
},
|
|
45
47
|
cta: {
|
|
46
|
-
description: "Call to action
|
|
48
|
+
description: "Call to action element."
|
|
47
49
|
},
|
|
48
50
|
description: {
|
|
49
51
|
description: "Description of the card."
|
|
@@ -62,17 +64,18 @@ var NotificationCard_stories_default = {
|
|
|
62
64
|
args: {
|
|
63
65
|
title: "Ledger Recover",
|
|
64
66
|
description: "Get peace of mind and start your free trial.",
|
|
65
|
-
cta: "Start my free trial",
|
|
67
|
+
cta: /* @__PURE__ */ import_react.default.createElement(import_cta.Link, { alignSelf: "start" }, "Start my free trial"),
|
|
66
68
|
icon: "Warning",
|
|
67
69
|
isHighlighted: false
|
|
68
70
|
}
|
|
69
71
|
};
|
|
72
|
+
var NotificationCard_stories_default = meta;
|
|
70
73
|
const Default = {};
|
|
71
74
|
const LNSNotificationCard = {
|
|
72
75
|
args: {
|
|
73
|
-
title:
|
|
74
|
-
description: "
|
|
75
|
-
cta: "
|
|
76
|
+
title: "",
|
|
77
|
+
description: "Upgrade your Nano S to a newer Ledger \u2014 like the Ledger Flex \u2014 for more memory, the latest security enhancements, fresh features, and an exclusive 20% off. ",
|
|
78
|
+
cta: /* @__PURE__ */ import_react.default.createElement(import_cta.Link, { alignSelf: "start", color: "primary.c80" }, "Upgrade my Ledger", /* @__PURE__ */ import_react.default.createElement(import_assets.Icons.ExternalLink, { size: "S", style: { marginLeft: "8px", verticalAlign: "middle" } })),
|
|
76
79
|
icon: "SparksFill",
|
|
77
80
|
isHighlighted: true
|
|
78
81
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/components/layout/Banner/NotificationCard/NotificationCard.stories.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { Meta, StoryObj } from \"@storybook/react\";\n\nimport { Icons } from \"../../../../assets\";\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
6
|
-
"names": ["NotificationCard"]
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from \"@storybook/react\";\nimport React from \"react\";\n\nimport { Icons } from \"../../../../assets\";\nimport { Link } from \"../../../cta\";\nimport NotificationCard from \".\";\n\nconst meta: Meta<typeof NotificationCard> = {\n title: \"Layout/Banner/NotificationCard\",\n component: NotificationCard,\n argTypes: {\n title: {\n description: \"Title of the card.\",\n },\n cta: {\n description: \"Call to action element.\",\n },\n description: {\n description: \"Description of the card.\",\n },\n icon: {\n description: \"Icon to be displayed on the left of the notification card.\",\n options: Object.keys(Icons),\n control: {\n type: \"select\",\n },\n },\n onClick: {\n description: \"Function to be called when the card is clicked.\",\n },\n },\n args: {\n title: \"Ledger Recover\",\n description: \"Get peace of mind and start your free trial.\",\n cta: <Link alignSelf=\"start\">Start my free trial</Link>,\n icon: \"Warning\",\n isHighlighted: false,\n },\n};\nexport default meta;\n\ntype Story = StoryObj<typeof NotificationCard>;\n\nexport const Default: Story = {};\n\nexport const LNSNotificationCard: Story = {\n args: {\n title: \"\",\n description:\n \"Upgrade your Nano S to a newer Ledger \u2014 like the Ledger Flex \u2014 for more memory, the latest security enhancements, fresh features, and an exclusive 20% off. \",\n cta: (\n <Link alignSelf=\"start\" color=\"primary.c80\">\n Upgrade my Ledger\n <Icons.ExternalLink size=\"S\" style={{ marginLeft: \"8px\", verticalAlign: \"middle\" }} />\n </Link>\n ),\n icon: \"SparksFill\",\n isHighlighted: true,\n },\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAElB,oBAAsB;AACtB,iBAAqB;AACrB,eAA6B;AAE7B,MAAM,OAAsC;AAAA,EAC1C,OAAO;AAAA,EACP,WAAW,SAAAA;AAAA,EACX,UAAU;AAAA,IACR,OAAO;AAAA,MACL,aAAa;AAAA,IACf;AAAA,IACA,KAAK;AAAA,MACH,aAAa;AAAA,IACf;AAAA,IACA,aAAa;AAAA,MACX,aAAa;AAAA,IACf;AAAA,IACA,MAAM;AAAA,MACJ,aAAa;AAAA,MACb,SAAS,OAAO,KAAK,mBAAK;AAAA,MAC1B,SAAS;AAAA,QACP,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,KAAK,6BAAAC,QAAA,cAAC,mBAAK,WAAU,WAAQ,qBAAmB;AAAA,IAChD,MAAM;AAAA,IACN,eAAe;AAAA,EACjB;AACF;AACA,IAAO,mCAAQ;AAIR,MAAM,UAAiB,CAAC;AAExB,MAAM,sBAA6B;AAAA,EACxC,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,aACE;AAAA,IACF,KACE,6BAAAA,QAAA,cAAC,mBAAK,WAAU,SAAQ,OAAM,iBAAc,qBAE1C,6BAAAA,QAAA,cAAC,oBAAM,cAAN,EAAmB,MAAK,KAAI,OAAO,EAAE,YAAY,OAAO,eAAe,SAAS,GAAG,CACtF;AAAA,IAEF,MAAM;AAAA,IACN,eAAe;AAAA,EACjB;AACF;",
|
|
6
|
+
"names": ["NotificationCard", "React"]
|
|
7
7
|
}
|
|
@@ -33,17 +33,9 @@ __export(NotificationCard_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(NotificationCard_exports);
|
|
34
34
|
var import_react = __toESM(require("react"));
|
|
35
35
|
var import_styled_components = __toESM(require("styled-components"));
|
|
36
|
-
var import_assets = require("../../../../assets");
|
|
37
36
|
var import_asorted = require("../../../asorted");
|
|
38
|
-
var
|
|
37
|
+
var import_Text = __toESM(require("../../../asorted/Text"));
|
|
39
38
|
var import__ = require("../..");
|
|
40
|
-
const colorsByIcon = {
|
|
41
|
-
Warning: {
|
|
42
|
-
icon: "warning.c80",
|
|
43
|
-
iconBg: "warning.c30",
|
|
44
|
-
cta: "warning.c80"
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
39
|
function NotificationCard({
|
|
48
40
|
title,
|
|
49
41
|
cta,
|
|
@@ -57,49 +49,20 @@ function NotificationCard({
|
|
|
57
49
|
event.stopPropagation();
|
|
58
50
|
onClick(event);
|
|
59
51
|
};
|
|
60
|
-
|
|
61
|
-
const Icon = import_assets.Icons[safeIcon];
|
|
62
|
-
const colors = colorsByIcon[safeIcon];
|
|
63
|
-
const ctaColor = isHighlighted ? (colors == null ? void 0 : colors.cta) ?? "primary.c80" : "neutral.c100";
|
|
64
|
-
const iconColor = (colors == null ? void 0 : colors.icon) ?? "primary.c80";
|
|
65
|
-
const iconBgColor = (colors == null ? void 0 : colors.iconBg) ?? "opacityPurple.c10";
|
|
66
|
-
return /* @__PURE__ */ import_react.default.createElement(Wrapper, { ...boxProps, isHighlighted, onClick: handleCTAClick }, /* @__PURE__ */ import_react.default.createElement(IconWrapper, { backgroundColor: iconBgColor, isHighlighted }, /* @__PURE__ */ import_react.default.createElement(Icon, { color: iconColor })), /* @__PURE__ */ import_react.default.createElement(import__.Flex, { flexDirection: "column", rowGap: isHighlighted ? "4px" : "8px" }, title && /* @__PURE__ */ import_react.default.createElement(import_asorted.Text, { variant: "h4Inter", fontSize: 16 }, title), description && /* @__PURE__ */ import_react.default.createElement(Desc, { color: isHighlighted ? "neutral.c100" : "neutral.c80" }, description), cta && /* @__PURE__ */ import_react.default.createElement(Cta, { color: ctaColor, onClick: handleCTAClick }, cta)));
|
|
52
|
+
return /* @__PURE__ */ import_react.default.createElement(Wrapper, { ...boxProps, isHighlighted, onClick: handleCTAClick }, /* @__PURE__ */ import_react.default.createElement(import_asorted.NotificationIcon, { icon, variant: isHighlighted ? "square" : "round" }), /* @__PURE__ */ import_react.default.createElement(import__.Flex, { flexDirection: "column", rowGap: isHighlighted ? "4px" : "8px" }, title && /* @__PURE__ */ import_react.default.createElement(import_Text.default, { variant: "h4Inter", fontSize: 16 }, title), description && /* @__PURE__ */ import_react.default.createElement(Desc, { color: isHighlighted ? "neutral.c100" : "neutral.c80" }, description), cta));
|
|
67
53
|
}
|
|
68
|
-
const Desc = (0, import_styled_components.default)(
|
|
54
|
+
const Desc = (0, import_styled_components.default)(import_Text.default).attrs({ variant: "small" })`
|
|
69
55
|
font-family: Inter;
|
|
70
56
|
font-size: 13px;
|
|
71
57
|
font-style: normal;
|
|
72
58
|
font-weight: 500;
|
|
73
59
|
`;
|
|
74
|
-
const Cta = (0, import_styled_components.default)(import_cta.Link).attrs({ alignSelf: "start" })`
|
|
75
|
-
font-size: 13px;
|
|
76
|
-
`;
|
|
77
|
-
const IconWrapper = (0, import_styled_components.default)(import__.Flex)`
|
|
78
|
-
border-radius: ${(p) => p.isHighlighted ? "13.5px" : "50%"};
|
|
79
|
-
padding: 8px;
|
|
80
|
-
${(p) => p.isHighlighted && import_styled_components.css`
|
|
81
|
-
background-clip: padding-box;
|
|
82
|
-
border-width: 7px;
|
|
83
|
-
border-style: solid;
|
|
84
|
-
border-color: transparent;
|
|
85
|
-
position: relative;
|
|
86
|
-
&::before {
|
|
87
|
-
content: "";
|
|
88
|
-
position: absolute;
|
|
89
|
-
inset: -7px;
|
|
90
|
-
border-radius: 13.5px;
|
|
91
|
-
background: linear-gradient(
|
|
92
|
-
180deg,
|
|
93
|
-
${p.theme.colors.opacityDefault.c05} 0%,
|
|
94
|
-
rgba(29, 28, 31, 0) 100%
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
`}
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
`;
|
|
101
60
|
const Wrapper = (0, import_styled_components.default)(import__.Grid)`
|
|
102
|
-
background-color: ${(
|
|
61
|
+
background-color: ${({ isHighlighted, theme: { colors } }) => {
|
|
62
|
+
if (!isHighlighted)
|
|
63
|
+
return "transparent";
|
|
64
|
+
return colors.type === "dark" ? colors.opacityDefault.c05 : colors.neutral.c00;
|
|
65
|
+
}};
|
|
103
66
|
|
|
104
67
|
cursor: pointer;
|
|
105
68
|
padding: 12px;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/components/layout/Banner/NotificationCard/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { type ReactEventHandler, type ReactNode } from \"react\";\nimport styled
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8D;AAC9D,+
|
|
6
|
-
"names": ["React", "styled"]
|
|
4
|
+
"sourcesContent": ["import React, { type ReactEventHandler, type ReactNode } from \"react\";\nimport styled from \"styled-components\";\n\nimport * as Icons from \"@ledgerhq/icons-ui/react\";\nimport { NotificationIcon } from \"../../../asorted\";\nimport Text from \"../../../asorted/Text\";\nimport type { Props as GridBoxProps } from \"../../Grid\";\nimport { Grid, Flex } from \"../..\";\n\ntype IconKey = keyof typeof Icons;\n\ntype Props = GridBoxProps & {\n title?: string;\n cta?: ReactNode;\n description?: ReactNode;\n icon: IconKey;\n isHighlighted?: boolean;\n\n onClick: ReactEventHandler;\n};\n\nexport default function NotificationCard({\n title,\n cta,\n icon,\n description,\n isHighlighted,\n onClick,\n ...boxProps\n}: Props) {\n const handleCTAClick: ReactEventHandler = event => {\n event.stopPropagation();\n onClick(event);\n };\n\n return (\n <Wrapper {...boxProps} isHighlighted={isHighlighted} onClick={handleCTAClick}>\n <NotificationIcon icon={icon} variant={isHighlighted ? \"square\" : \"round\"} />\n <Flex flexDirection=\"column\" rowGap={isHighlighted ? \"4px\" : \"8px\"}>\n {title && (\n <Text variant=\"h4Inter\" fontSize={16}>\n {title}\n </Text>\n )}\n {description && (\n <Desc color={isHighlighted ? \"neutral.c100\" : \"neutral.c80\"}>{description}</Desc>\n )}\n {cta}\n </Flex>\n </Wrapper>\n );\n}\n\nconst Desc = styled(Text).attrs({ variant: \"small\" })`\n font-family: Inter;\n font-size: 13px;\n font-style: normal;\n font-weight: 500;\n`;\n\nconst Wrapper = styled(Grid)<Pick<Props, \"isHighlighted\">>`\n background-color: ${({ isHighlighted, theme: { colors } }) => {\n if (!isHighlighted) return \"transparent\";\n return colors.type === \"dark\" ? colors.opacityDefault.c05 : colors.neutral.c00;\n }};\n\n cursor: pointer;\n padding: 12px;\n grid-template-columns: auto 1fr;\n gap: ${p => (p.isHighlighted ? \"12px\" : \"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styled"]
|
|
7
7
|
}
|
|
@@ -32,6 +32,7 @@ __export(PortfolioContentCard_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(PortfolioContentCard_exports);
|
|
34
34
|
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_cta = require("../../../cta");
|
|
35
36
|
var import_BannerCard = __toESM(require("../../Banner/BannerCard"));
|
|
36
37
|
function PortfolioContentCard({
|
|
37
38
|
title,
|
|
@@ -46,7 +47,7 @@ function PortfolioContentCard({
|
|
|
46
47
|
import_BannerCard.default,
|
|
47
48
|
{
|
|
48
49
|
title,
|
|
49
|
-
cta,
|
|
50
|
+
cta: cta && /* @__PURE__ */ import_react.default.createElement(import_cta.Button, { variant: "main", outline: false }, cta),
|
|
50
51
|
description,
|
|
51
52
|
tag,
|
|
52
53
|
image,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/components/layout/ContentCard/PortfolioContentCard/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { type ReactEventHandler } from \"react\";\n\nimport BannerCard from \"../../Banner/BannerCard\";\n\nexport type PortfolioContentCardProps = {\n title: string;\n cta?: string;\n description?: string;\n tag?: string;\n image?: string;\n\n onClick: ReactEventHandler;\n onClose: ReactEventHandler;\n};\n\nexport default function PortfolioContentCard({\n title,\n cta,\n description,\n tag,\n image,\n onClick,\n onClose,\n}: PortfolioContentCardProps) {\n return (\n <BannerCard\n title={title}\n cta={cta}\n description={description}\n tag={tag}\n image={image}\n onClick={onClick}\n onClose={onClose}\n />\n );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8C;AAE9C,wBAAuB;AAaR,SAAR,qBAAsC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA8B;AAC5B,SACE,6BAAAA,QAAA;AAAA,IAAC,kBAAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,
|
|
4
|
+
"sourcesContent": ["import React, { type ReactEventHandler } from \"react\";\n\nimport { Button } from \"../../../cta\";\nimport BannerCard from \"../../Banner/BannerCard\";\n\nexport type PortfolioContentCardProps = {\n title: string;\n cta?: string;\n description?: string;\n tag?: string;\n image?: string;\n\n onClick: ReactEventHandler;\n onClose: ReactEventHandler;\n};\n\nexport default function PortfolioContentCard({\n title,\n cta,\n description,\n tag,\n image,\n onClick,\n onClose,\n}: PortfolioContentCardProps) {\n return (\n <BannerCard\n title={title}\n cta={\n cta && (\n <Button variant=\"main\" outline={false}>\n {cta}\n </Button>\n )\n }\n description={description}\n tag={tag}\n image={image}\n onClick={onClick}\n onClose={onClose}\n />\n );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8C;AAE9C,iBAAuB;AACvB,wBAAuB;AAaR,SAAR,qBAAsC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA8B;AAC5B,SACE,6BAAAA,QAAA;AAAA,IAAC,kBAAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,KACE,OACE,6BAAAD,QAAA,cAAC,qBAAO,SAAQ,QAAO,SAAS,SAC7B,GACH;AAAA,MAGJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;",
|
|
6
6
|
"names": ["React", "BannerCard"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as Icons from "@ledgerhq/icons-ui/react";
|
|
3
|
+
type IconKey = keyof typeof Icons;
|
|
4
|
+
type WrapperType = "round" | "square";
|
|
5
|
+
type Props = Readonly<{
|
|
6
|
+
icon: IconKey;
|
|
7
|
+
variant: WrapperType;
|
|
8
|
+
}>;
|
|
9
|
+
export default function NotificationIcon({ icon, variant }: Props): React.JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=NotificationIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/asorted/Icon/NotificationIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAIlD,KAAK,OAAO,GAAG,MAAM,OAAO,KAAK,CAAC;AAClC,KAAK,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAwBtC,KAAK,KAAK,GAAG,QAAQ,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,IAAI,EAAE,OAAiB,EAAE,EAAE,KAAK,qBAa1E"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styled, { css, useTheme } from "styled-components";
|
|
3
|
+
import * as Icons from "@ledgerhq/icons-ui/react";
|
|
4
|
+
import { Box } from "../../layout";
|
|
5
|
+
import { rgba } from "../../../styles";
|
|
6
|
+
function getColorsByIcon(colors) {
|
|
7
|
+
const { warning } = colors;
|
|
8
|
+
return {
|
|
9
|
+
Warning: {
|
|
10
|
+
round: { fg: warning.c80, bg: warning.c30 },
|
|
11
|
+
square: { fg: warning.c80, bg: warning.c30 },
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function getDefaultDefaultColors({ primary }) {
|
|
16
|
+
return {
|
|
17
|
+
round: { fg: primary.c90, bg: primary.c30 },
|
|
18
|
+
square: { fg: primary.c80, bg: rgba(primary.c80, 0.08) },
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export default function NotificationIcon({ icon, variant = "round" }) {
|
|
22
|
+
const { colors } = useTheme();
|
|
23
|
+
const defaultColors = getDefaultDefaultColors(colors)[variant];
|
|
24
|
+
const safeIcon = icon in Icons ? icon : "Information";
|
|
25
|
+
const Icon = Icons[safeIcon];
|
|
26
|
+
const { fg: iconColor = defaultColors.fg, bg: iconBgColor = defaultColors.bg } = getColorsByIcon(colors)[safeIcon]?.[variant] ?? {};
|
|
27
|
+
return (React.createElement(Wrapper, { backgroundColor: iconBgColor, variant: variant },
|
|
28
|
+
React.createElement(Icon, { color: iconColor })));
|
|
29
|
+
}
|
|
30
|
+
const Wrapper = styled(Box) `
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
padding: 8px;
|
|
33
|
+
${p => (p.variant === "square" ? squareWrapper : roundWrapper)}
|
|
34
|
+
`;
|
|
35
|
+
const roundWrapper = css `
|
|
36
|
+
border-radius: 50%;
|
|
37
|
+
`;
|
|
38
|
+
const squareWrapper = css `
|
|
39
|
+
border-radius: 13.5px;
|
|
40
|
+
background-clip: padding-box;
|
|
41
|
+
border-width: 7px;
|
|
42
|
+
border-style: solid;
|
|
43
|
+
border-color: transparent;
|
|
44
|
+
position: relative;
|
|
45
|
+
|
|
46
|
+
${p => css `
|
|
47
|
+
&::before,
|
|
48
|
+
&::after {
|
|
49
|
+
content: "";
|
|
50
|
+
position: absolute;
|
|
51
|
+
inset: -7px;
|
|
52
|
+
border-radius: 13.5px;
|
|
53
|
+
rotate: ${p.theme.colors.type === "dark" ? "0deg" : "180deg"};
|
|
54
|
+
}
|
|
55
|
+
&::before {
|
|
56
|
+
background: linear-gradient(
|
|
57
|
+
${p.theme.colors.type === "dark" ? "rgba(255, 255, 255, 0.05)" : "rgba(29, 28, 31, 0.05)"}
|
|
58
|
+
0%,
|
|
59
|
+
rgba(29, 28, 31, 0) 100%
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
&::after {
|
|
63
|
+
content: ${p.theme.colors.type};
|
|
64
|
+
border: solid 0.5px ${p.theme.colors.type === "dark" ? "#fff" : "rgba(0, 0, 0, 0.5)"};
|
|
65
|
+
mask-image: linear-gradient(
|
|
66
|
+
rgba(255, 255, 255, 0.15) 0%,
|
|
67
|
+
rgba(255, 255, 255, 0.01) 60%,
|
|
68
|
+
rgba(255, 255, 255, 0) 100%
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
`};
|
|
72
|
+
`;
|
|
73
|
+
//# sourceMappingURL=NotificationIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationIcon.js","sourceRoot":"","sources":["../../../../src/components/asorted/Icon/NotificationIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAqB,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAO1D,SAAS,eAAe,CACtB,MAAoB;IAEpB,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAE3B,OAAO;QACL,OAAO,EAAE;YACP,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,OAAO,CAAC,GAAG,EAAE;YAC3C,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,OAAO,CAAC,GAAG,EAAE;SAC7C;KACF,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,EAAE,OAAO,EAAgB;IACxD,OAAO;QACL,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,OAAO,CAAC,GAAG,EAAE;QAC3C,MAAM,EAAE,EAAE,EAAE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M,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ;;;;UAIxD,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,wBAAwB;;;;;;iBAMhF,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI;4BACR,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,oBAAoB;;;;;;;GAOvF;CACF,CAAC"}
|
|
@@ -3,4 +3,5 @@ import BoxedIcon, { IconBox } from "./BoxedIcon";
|
|
|
3
3
|
export { BoxedIcon, IconBox };
|
|
4
4
|
export type { Props } from "./Icon";
|
|
5
5
|
export { default as CryptoIcon } from "./CryptoIcon";
|
|
6
|
+
export { default as NotificationIcon } from "./NotificationIcon";
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/asorted/Icon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AAC9B,YAAY,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/asorted/Icon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AAC9B,YAAY,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -2,4 +2,5 @@ export { default, iconNames } from "./Icon";
|
|
|
2
2
|
import BoxedIcon, { IconBox } from "./BoxedIcon";
|
|
3
3
|
export { BoxedIcon, IconBox };
|
|
4
4
|
export { default as CryptoIcon } from "./CryptoIcon";
|
|
5
|
+
export { default as NotificationIcon } from "./NotificationIcon";
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/asorted/Icon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AAE9B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/asorted/Icon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AAE9B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as Divider } from "./Divider";
|
|
2
|
-
export { default as Icon, IconBox, BoxedIcon, CryptoIcon } from "./Icon";
|
|
2
|
+
export { default as Icon, IconBox, BoxedIcon, CryptoIcon, NotificationIcon } from "./Icon";
|
|
3
3
|
export { default as Text } from "./Text";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/asorted/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/asorted/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as Divider } from "./Divider";
|
|
2
|
-
export { default as Icon, IconBox, BoxedIcon, CryptoIcon } from "./Icon";
|
|
2
|
+
export { default as Icon, IconBox, BoxedIcon, CryptoIcon, NotificationIcon } from "./Icon";
|
|
3
3
|
export { default as Text } from "./Text";
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/asorted/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/asorted/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import React, { type ReactEventHandler, type ReactNode } from "react";
|
|
2
2
|
import type { FlexBoxProps } from "../../Flex";
|
|
3
|
-
|
|
3
|
+
type Props = FlexBoxProps & {
|
|
4
4
|
title: string;
|
|
5
|
-
cta?:
|
|
6
|
-
linkText?: string;
|
|
5
|
+
cta?: ReactNode;
|
|
7
6
|
description?: ReactNode;
|
|
8
7
|
descriptionWidth?: number;
|
|
9
8
|
tag?: string;
|
|
10
9
|
image?: string;
|
|
11
10
|
onClick: ReactEventHandler;
|
|
12
|
-
onLinkClick?: ReactEventHandler;
|
|
13
11
|
onClose?: ReactEventHandler;
|
|
14
12
|
};
|
|
15
|
-
export default function BannerCard({ title, cta,
|
|
13
|
+
export default function BannerCard({ title, cta, description, descriptionWidth, tag, image, onClick, onClose, ...boxProps }: Props): React.JSX.Element;
|
|
14
|
+
export {};
|
|
16
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/Banner/BannerCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/Banner/BannerCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,KAAK,KAAK,GAAG,YAAY,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,KAAK,EACL,GAAG,EACH,WAAW,EACX,gBAAgB,EAChB,GAAG,EACH,KAAK,EACL,OAAO,EACP,OAAO,EACP,GAAG,QAAQ,EACZ,EAAE,KAAK,qBAuBP"}
|
|
@@ -2,31 +2,24 @@ import React from "react";
|
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { StyleProvider } from "../../../../styles";
|
|
4
4
|
import { Icons } from "../../../../assets";
|
|
5
|
-
import
|
|
6
|
-
import { Button
|
|
5
|
+
import Text from "../../../asorted/Text";
|
|
6
|
+
import { Button } from "../../../cta";
|
|
7
7
|
import Tag from "../../../Tag";
|
|
8
8
|
import { Flex } from "../..";
|
|
9
|
-
export default function BannerCard({ title, cta,
|
|
9
|
+
export default function BannerCard({ title, cta, description, descriptionWidth, tag, image, onClick, onClose, ...boxProps }) {
|
|
10
10
|
const handleClose = event => {
|
|
11
11
|
event.stopPropagation();
|
|
12
12
|
onClose?.(event);
|
|
13
13
|
};
|
|
14
|
-
const
|
|
14
|
+
const handleClick = event => {
|
|
15
15
|
event.stopPropagation();
|
|
16
16
|
onClick(event);
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
event.stopPropagation();
|
|
20
|
-
onLinkClick?.(event);
|
|
21
|
-
};
|
|
22
|
-
return (React.createElement(Wrapper, { ...boxProps, image: image, tag: tag, onClick: handleCTAClick },
|
|
18
|
+
return (React.createElement(Wrapper, { ...boxProps, image: image, tag: tag, onClick: handleClick },
|
|
23
19
|
tag && React.createElement(StyledTag, null, tag),
|
|
24
20
|
React.createElement(Title, null, title),
|
|
25
21
|
description && React.createElement(Desc, { maxWidth: descriptionWidth }, description),
|
|
26
|
-
React.createElement(Flex, { columnGap: 5 },
|
|
27
|
-
cta && (React.createElement(Button, { variant: "main", outline: false, onClick: handleCTAClick }, cta)),
|
|
28
|
-
linkText && (React.createElement(Link, { onClick: handleLinkClick },
|
|
29
|
-
React.createElement(Text, { variant: "body", fontSize: 14, flexShrink: 1 }, linkText)))),
|
|
22
|
+
React.createElement(Flex, { columnGap: 5 }, cta),
|
|
30
23
|
onClose && (React.createElement(StyleProvider, { selectedPalette: "dark" },
|
|
31
24
|
React.createElement(CloseButton, { "data-testid": "portfolio-card-close-button", onClick: handleClose })))));
|
|
32
25
|
}
|
|
@@ -57,7 +50,6 @@ const Wrapper = styled(Flex) `
|
|
|
57
50
|
padding: 16px;
|
|
58
51
|
padding-top: ${p => (p.tag ? "16px" : "24px")};
|
|
59
52
|
padding-right: 50%;
|
|
60
|
-
flex-basis: 100%;
|
|
61
53
|
|
|
62
54
|
position: relative;
|
|
63
55
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/layout/Banner/BannerCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/layout/Banner/BannerCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,IAAI,MAAM,uBAAuB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,GAAG,MAAM,cAAc,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAc7B,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,KAAK,EACL,GAAG,EACH,WAAW,EACX,gBAAgB,EAChB,GAAG,EACH,KAAK,EACL,OAAO,EACP,OAAO,EACP,GAAG,QAAQ,EACL;IACN,MAAM,WAAW,GAAsB,KAAK,CAAC,EAAE;QAC7C,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,CAAC;IACF,MAAM,WAAW,GAAsB,KAAK,CAAC,EAAE;QAC7C,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,OAAO,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,OAAO,OAAK,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,WAAW;QAChE,GAAG,IAAI,oBAAC,SAAS,QAAE,GAAG,CAAa;QACpC,oBAAC,KAAK,QAAE,KAAK,CAAS;QACrB,WAAW,IAAI,oBAAC,IAAI,IAAC,QAAQ,EAAE,gBAAgB,IAAG,WAAW,CAAQ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,KAAK,CAAC;IACvC,IAAI,EAAE,oBAAC,KAAK,CAAC,KAAK,IAAC,IAAI,EAAC,IAAI,GAAG;IAC/B,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,IAAI;CACd,CAAC,CAAA;sBACoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG;;;;;;;;;;CAUpD,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { type ReactEventHandler, type ReactNode } from "react";
|
|
2
|
-
import
|
|
2
|
+
import * as Icons from "@ledgerhq/icons-ui/react";
|
|
3
3
|
import type { Props as GridBoxProps } from "../../Grid";
|
|
4
4
|
type IconKey = keyof typeof Icons;
|
|
5
|
-
|
|
5
|
+
type Props = GridBoxProps & {
|
|
6
6
|
title?: string;
|
|
7
|
-
cta?:
|
|
7
|
+
cta?: ReactNode;
|
|
8
8
|
description?: ReactNode;
|
|
9
9
|
icon: IconKey;
|
|
10
10
|
isHighlighted?: boolean;
|
|
11
11
|
onClick: ReactEventHandler;
|
|
12
12
|
};
|
|
13
|
-
export default function NotificationCard({ title, cta, icon, description, isHighlighted, onClick, ...boxProps }:
|
|
13
|
+
export default function NotificationCard({ title, cta, icon, description, isHighlighted, onClick, ...boxProps }: Props): React.JSX.Element;
|
|
14
14
|
export {};
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/Banner/NotificationCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/Banner/NotificationCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAGlD,OAAO,KAAK,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,YAAY,CAAC;AAGxD,KAAK,OAAO,GAAG,MAAM,OAAO,KAAK,CAAC;AAElC,KAAK,KAAK,GAAG,YAAY,GAAG;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,OAAO,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,KAAK,EACL,GAAG,EACH,IAAI,EACJ,WAAW,EACX,aAAa,EACb,OAAO,EACP,GAAG,QAAQ,EACZ,EAAE,KAAK,qBAsBP"}
|
|
@@ -1,34 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import styled
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { Link } from "../../../cta";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { NotificationIcon } from "../../../asorted";
|
|
4
|
+
import Text from "../../../asorted/Text";
|
|
6
5
|
import { Grid, Flex } from "../..";
|
|
7
|
-
const colorsByIcon = {
|
|
8
|
-
Warning: {
|
|
9
|
-
icon: "warning.c80",
|
|
10
|
-
iconBg: "warning.c30",
|
|
11
|
-
cta: "warning.c80",
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
6
|
export default function NotificationCard({ title, cta, icon, description, isHighlighted, onClick, ...boxProps }) {
|
|
15
7
|
const handleCTAClick = event => {
|
|
16
8
|
event.stopPropagation();
|
|
17
9
|
onClick(event);
|
|
18
10
|
};
|
|
19
|
-
const safeIcon = icon in Icons ? icon : "Information";
|
|
20
|
-
const Icon = Icons[safeIcon];
|
|
21
|
-
const colors = colorsByIcon[safeIcon];
|
|
22
|
-
const ctaColor = isHighlighted ? colors?.cta ?? "primary.c80" : "neutral.c100";
|
|
23
|
-
const iconColor = colors?.icon ?? "primary.c80";
|
|
24
|
-
const iconBgColor = colors?.iconBg ?? "opacityPurple.c10";
|
|
25
11
|
return (React.createElement(Wrapper, { ...boxProps, isHighlighted: isHighlighted, onClick: handleCTAClick },
|
|
26
|
-
React.createElement(
|
|
27
|
-
React.createElement(Icon, { color: iconColor })),
|
|
12
|
+
React.createElement(NotificationIcon, { icon: icon, variant: isHighlighted ? "square" : "round" }),
|
|
28
13
|
React.createElement(Flex, { flexDirection: "column", rowGap: isHighlighted ? "4px" : "8px" },
|
|
29
14
|
title && (React.createElement(Text, { variant: "h4Inter", fontSize: 16 }, title)),
|
|
30
15
|
description && (React.createElement(Desc, { color: isHighlighted ? "neutral.c100" : "neutral.c80" }, description)),
|
|
31
|
-
cta
|
|
16
|
+
cta)));
|
|
32
17
|
}
|
|
33
18
|
const Desc = styled(Text).attrs({ variant: "small" }) `
|
|
34
19
|
font-family: Inter;
|
|
@@ -36,36 +21,12 @@ const Desc = styled(Text).attrs({ variant: "small" }) `
|
|
|
36
21
|
font-style: normal;
|
|
37
22
|
font-weight: 500;
|
|
38
23
|
`;
|
|
39
|
-
const Cta = styled(Link).attrs({ alignSelf: "start" }) `
|
|
40
|
-
font-size: 13px;
|
|
41
|
-
`;
|
|
42
|
-
const IconWrapper = styled(Flex) `
|
|
43
|
-
border-radius: ${p => (p.isHighlighted ? "13.5px" : "50%")};
|
|
44
|
-
padding: 8px;
|
|
45
|
-
${p => p.isHighlighted &&
|
|
46
|
-
css `
|
|
47
|
-
background-clip: padding-box;
|
|
48
|
-
border-width: 7px;
|
|
49
|
-
border-style: solid;
|
|
50
|
-
border-color: transparent;
|
|
51
|
-
position: relative;
|
|
52
|
-
&::before {
|
|
53
|
-
content: "";
|
|
54
|
-
position: absolute;
|
|
55
|
-
inset: -7px;
|
|
56
|
-
border-radius: 13.5px;
|
|
57
|
-
background: linear-gradient(
|
|
58
|
-
180deg,
|
|
59
|
-
${p.theme.colors.opacityDefault.c05} 0%,
|
|
60
|
-
rgba(29, 28, 31, 0) 100%
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
`}
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
`;
|
|
67
24
|
const Wrapper = styled(Grid) `
|
|
68
|
-
background-color: ${
|
|
25
|
+
background-color: ${({ isHighlighted, theme: { colors } }) => {
|
|
26
|
+
if (!isHighlighted)
|
|
27
|
+
return "transparent";
|
|
28
|
+
return colors.type === "dark" ? colors.opacityDefault.c05 : colors.neutral.c00;
|
|
29
|
+
}};
|
|
69
30
|
|
|
70
31
|
cursor: pointer;
|
|
71
32
|
padding: 12px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/layout/Banner/NotificationCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/layout/Banner/NotificationCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,uBAAuB,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAcnC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,KAAK,EACL,GAAG,EACH,IAAI,EACJ,WAAW,EACX,aAAa,EACb,OAAO,EACP,GAAG,QAAQ,EACL;IACN,MAAM,cAAc,GAAsB,KAAK,CAAC,EAAE;QAChD,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,OAAO,CAAC,K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;;;;;CAKhD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/ContentCard/PortfolioContentCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/ContentCard/PortfolioContentCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKtD,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,KAAK,EACL,GAAG,EACH,WAAW,EACX,GAAG,EACH,KAAK,EACL,OAAO,EACP,OAAO,GACR,EAAE,yBAAyB,qBAkB3B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { Button } from "../../../cta";
|
|
2
3
|
import BannerCard from "../../Banner/BannerCard";
|
|
3
4
|
export default function PortfolioContentCard({ title, cta, description, tag, image, onClick, onClose, }) {
|
|
4
|
-
return (React.createElement(BannerCard, { title: title, cta: cta, description: description, tag: tag, image: image, onClick: onClick, onClose: onClose }));
|
|
5
|
+
return (React.createElement(BannerCard, { title: title, cta: cta && (React.createElement(Button, { variant: "main", outline: false }, cta)), description: description, tag: tag, image: image, onClick: onClick, onClose: onClose }));
|
|
5
6
|
}
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/layout/ContentCard/PortfolioContentCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAEtD,OAAO,UAAU,MAAM,yBAAyB,CAAC;AAajD,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,KAAK,EACL,GAAG,EACH,WAAW,EACX,GAAG,EACH,KAAK,EACL,OAAO,EACP,OAAO,GACmB;IAC1B,OAAO,CACL,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/layout/ContentCard/PortfolioContentCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,UAAU,MAAM,yBAAyB,CAAC;AAajD,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,KAAK,EACL,GAAG,EACH,WAAW,EACX,GAAG,EACH,KAAK,EACL,OAAO,EACP,OAAO,GACmB;IAC1B,OAAO,CACL,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,GAAG,EACD,GAAG,IAAI,CACL,oBAAC,MAAM,IAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,KAAK,IAClC,GAAG,CACG,CACV,EAEH,WAAW,EAAE,WAAW,EACxB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,GAChB,CACH,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/react-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0-next.0",
|
|
4
4
|
"description": "Ledger Live - Desktop UI",
|
|
5
5
|
"author": "Ledger Live Team <team-live@ledger.fr>",
|
|
6
6
|
"repository": {
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
"react-transition-group": "^4.4.2",
|
|
70
70
|
"react-window": "^1.8.6",
|
|
71
71
|
"styled-system": "^5.1.5",
|
|
72
|
+
"@ledgerhq/crypto-icons-ui": "^1.10.0-next.0",
|
|
72
73
|
"@ledgerhq/icons-ui": "^0.8.1",
|
|
73
|
-
"@ledgerhq/ui-shared": "^0.3.0"
|
|
74
|
-
"@ledgerhq/crypto-icons-ui": "^1.9.0"
|
|
74
|
+
"@ledgerhq/ui-shared": "^0.3.0"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
77
|
"react": ">=17.0.2",
|