@ledgerhq/react-ui 0.18.2 → 0.19.0-nightly.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assets/index.d.ts +6 -3
- package/lib/assets/index.d.ts.map +1 -1
- package/lib/assets/index.js +7 -8
- package/lib/assets/index.js.map +1 -1
- package/lib/cjs/assets/index.js.map +2 -2
- package/lib/cjs/components/form/Switch/index.js.map +1 -1
- package/lib/cjs/components/layout/Banner/BannerCard/BannerCard.stories.js +92 -0
- package/lib/cjs/components/layout/Banner/BannerCard/BannerCard.stories.js.map +7 -0
- package/lib/cjs/components/layout/Banner/BannerCard/index.js +120 -0
- package/lib/cjs/components/layout/Banner/BannerCard/index.js.map +7 -0
- package/lib/cjs/components/layout/Banner/NotificationCard/NotificationCard.stories.js +80 -0
- package/lib/cjs/components/layout/Banner/NotificationCard/NotificationCard.stories.js.map +7 -0
- package/lib/cjs/components/layout/Banner/NotificationCard/index.js +113 -0
- package/lib/cjs/components/layout/Banner/NotificationCard/index.js.map +7 -0
- package/lib/cjs/components/layout/ContentCard/PortfolioContentCard/index.js +13 -63
- package/lib/cjs/components/layout/ContentCard/PortfolioContentCard/index.js.map +3 -3
- package/lib/cjs/components/layout/index.js +4 -0
- package/lib/cjs/components/layout/index.js.map +2 -2
- package/lib/components/Table/Columns.js +4 -15
- package/lib/components/Table/Columns.js.map +1 -1
- package/lib/components/Table/index.js +2 -14
- package/lib/components/Table/index.js.map +1 -1
- package/lib/components/Tag/index.js +4 -16
- package/lib/components/Tag/index.js.map +1 -1
- package/lib/components/asorted/Divider/index.js +2 -2
- package/lib/components/asorted/Divider/index.js.map +1 -1
- package/lib/components/asorted/Icon/BoxedIcon.js +2 -14
- package/lib/components/asorted/Icon/BoxedIcon.js.map +1 -1
- package/lib/components/asorted/Text/index.js +1 -1
- package/lib/components/asorted/Text/index.js.map +1 -1
- package/lib/components/asorted/Text/styles.js +1 -2
- package/lib/components/asorted/Text/styles.js.map +1 -1
- package/lib/components/cta/Button/index.js +11 -29
- package/lib/components/cta/Button/index.js.map +1 -1
- package/lib/components/cta/Link/index.js +3 -3
- package/lib/components/cta/Link/index.js.map +1 -1
- package/lib/components/cta/Toggle/index.js +2 -14
- package/lib/components/cta/Toggle/index.js.map +1 -1
- package/lib/components/form/BaseInput/index.js +4 -15
- package/lib/components/form/BaseInput/index.js.map +1 -1
- package/lib/components/form/Dropdown/index.js +27 -17
- package/lib/components/form/Dropdown/index.js.map +1 -1
- package/lib/components/form/DropdownGeneric/index.js +2 -2
- package/lib/components/form/DropdownGeneric/index.js.map +1 -1
- package/lib/components/form/LegendInput/index.js +3 -15
- package/lib/components/form/LegendInput/index.js.map +1 -1
- package/lib/components/form/NumberInput/index.js +3 -15
- package/lib/components/form/NumberInput/index.js.map +1 -1
- package/lib/components/form/QrCodeInput/index.js +3 -15
- package/lib/components/form/QrCodeInput/index.js.map +1 -1
- package/lib/components/form/QuantityInput/index.js +3 -15
- package/lib/components/form/QuantityInput/index.js.map +1 -1
- package/lib/components/form/Radio/RadioElement.js +3 -15
- package/lib/components/form/Radio/RadioElement.js.map +1 -1
- package/lib/components/form/Radio/RadioListElement.js +3 -15
- package/lib/components/form/Radio/RadioListElement.js.map +1 -1
- package/lib/components/form/Radio/index.js +1 -1
- package/lib/components/form/Radio/index.js.map +1 -1
- package/lib/components/form/SearchInput/index.js +2 -2
- package/lib/components/form/SearchInput/index.js.map +1 -1
- package/lib/components/form/SelectInput/Control.js +12 -2
- package/lib/components/form/SelectInput/Control.js.map +1 -1
- package/lib/components/form/SelectInput/DropdownIndicator.js +5 -2
- package/lib/components/form/SelectInput/DropdownIndicator.js.map +1 -1
- package/lib/components/form/SelectInput/IndicatorsContainer.js +1 -1
- package/lib/components/form/SelectInput/IndicatorsContainer.js.map +1 -1
- package/lib/components/form/SelectInput/MenuList.js +13 -2
- package/lib/components/form/SelectInput/MenuList.js.map +1 -1
- package/lib/components/form/SelectInput/Option.js +14 -14
- package/lib/components/form/SelectInput/Option.js.map +1 -1
- package/lib/components/form/SelectInput/ValueContainer.js +5 -2
- package/lib/components/form/SelectInput/ValueContainer.js.map +1 -1
- package/lib/components/form/SelectInput/VirtualMenuList.js +3 -4
- package/lib/components/form/SelectInput/VirtualMenuList.js.map +1 -1
- package/lib/components/form/SelectInput/index.js +48 -23
- package/lib/components/form/SelectInput/index.js.map +1 -1
- package/lib/components/form/SplitInput/index.js +5 -7
- package/lib/components/form/SplitInput/index.js.map +1 -1
- package/lib/components/form/Switch/index.d.ts +1 -0
- package/lib/components/form/Switch/index.d.ts.map +1 -1
- package/lib/components/layout/Banner/BannerCard/index.d.ts +16 -0
- package/lib/components/layout/Banner/BannerCard/index.d.ts.map +1 -0
- package/lib/components/layout/Banner/BannerCard/index.js +84 -0
- package/lib/components/layout/Banner/BannerCard/index.js.map +1 -0
- package/lib/components/layout/Banner/NotificationCard/index.d.ts +15 -0
- package/lib/components/layout/Banner/NotificationCard/index.d.ts.map +1 -0
- package/lib/components/layout/Banner/NotificationCard/index.js +79 -0
- package/lib/components/layout/Banner/NotificationCard/index.js.map +1 -0
- package/lib/components/layout/Carousel/ChevronArrow.js +1 -1
- package/lib/components/layout/Carousel/ChevronArrow.js.map +1 -1
- package/lib/components/layout/Carousel/Footer/Pagination/bullets.js +22 -4
- package/lib/components/layout/Carousel/Footer/Pagination/bullets.js.map +1 -1
- package/lib/components/layout/Carousel/Footer/index.js +1 -1
- package/lib/components/layout/Carousel/Footer/index.js.map +1 -1
- package/lib/components/layout/Carousel/Footer/variantContentCard.js +2 -2
- package/lib/components/layout/Carousel/Footer/variantContentCard.js.map +1 -1
- package/lib/components/layout/Carousel/Footer/variantDefault.js +1 -1
- package/lib/components/layout/Carousel/Footer/variantDefault.js.map +1 -1
- package/lib/components/layout/Carousel/index.js +9 -9
- package/lib/components/layout/Carousel/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 -69
- package/lib/components/layout/ContentCard/PortfolioContentCard/index.js.map +1 -1
- package/lib/components/layout/Drawer/index.js +8 -20
- package/lib/components/layout/Drawer/index.js.map +1 -1
- package/lib/components/layout/List/NumberedList/index.js +4 -4
- package/lib/components/layout/List/NumberedList/index.js.map +1 -1
- package/lib/components/layout/List/VerticalTimeline/TimelineIndicator.js +2 -14
- package/lib/components/layout/List/VerticalTimeline/TimelineIndicator.js.map +1 -1
- package/lib/components/layout/List/VerticalTimeline/TimelineItem.js +2 -2
- package/lib/components/layout/List/VerticalTimeline/TimelineItem.js.map +1 -1
- package/lib/components/layout/List/VerticalTimeline/index.js +4 -16
- package/lib/components/layout/List/VerticalTimeline/index.js.map +1 -1
- package/lib/components/layout/Popin/index.js +13 -31
- package/lib/components/layout/Popin/index.js.map +1 -1
- package/lib/components/layout/Side/Provider.js +1 -1
- package/lib/components/layout/Side/Provider.js.map +1 -1
- package/lib/components/layout/Side/index.js +5 -7
- package/lib/components/layout/Side/index.js.map +1 -1
- package/lib/components/layout/index.d.ts +2 -0
- package/lib/components/layout/index.d.ts.map +1 -1
- package/lib/components/layout/index.js +2 -0
- package/lib/components/layout/index.js.map +1 -1
- package/lib/components/loaders/InfiniteLoader/index.js +2 -14
- package/lib/components/loaders/InfiniteLoader/index.js.map +1 -1
- package/lib/components/message/Alert/index.js +2 -2
- package/lib/components/message/Alert/index.js.map +1 -1
- package/lib/components/message/Log/index.js +3 -15
- package/lib/components/message/Log/index.js.map +1 -1
- package/lib/components/message/Notification/Badge.js +2 -14
- package/lib/components/message/Notification/Badge.js.map +1 -1
- package/lib/components/message/Notification/index.js +2 -14
- package/lib/components/message/Notification/index.js.map +1 -1
- package/lib/components/message/StatusNotification/index.js +2 -14
- package/lib/components/message/StatusNotification/index.js.map +1 -1
- package/lib/components/message/Tooltip/index.js +2 -13
- package/lib/components/message/Tooltip/index.js.map +1 -1
- package/lib/components/navigation/Aside/index.js +4 -15
- package/lib/components/navigation/Aside/index.js.map +1 -1
- package/lib/components/navigation/Breadcrumb/index.js +16 -3
- package/lib/components/navigation/Breadcrumb/index.js.map +1 -1
- package/lib/components/navigation/FlowStepper/index.js +10 -22
- package/lib/components/navigation/FlowStepper/index.js.map +1 -1
- package/lib/components/navigation/Header/index.js +2 -14
- package/lib/components/navigation/Header/index.js.map +1 -1
- package/lib/components/navigation/progress/Stepper/index.js +3 -15
- package/lib/components/navigation/progress/Stepper/index.js.map +1 -1
- package/lib/components/navigation/sideBar/Item/Item.js +1 -1
- package/lib/components/navigation/sideBar/Item/Item.js.map +1 -1
- package/lib/components/tabs/Tabs/index.js +2 -3
- package/lib/components/tabs/Tabs/index.js.map +1 -1
- package/lib/components/transitions/TransitionInOut.js +2 -16
- package/lib/components/transitions/TransitionInOut.js.map +1 -1
- package/lib/components/transitions/TransitionScale.js +2 -16
- package/lib/components/transitions/TransitionScale.js.map +1 -1
- package/lib/components/transitions/TransitionSlide.js +2 -16
- package/lib/components/transitions/TransitionSlide.js.map +1 -1
- package/lib/styles/InvertTheme.js +15 -2
- package/lib/styles/InvertTheme.js.map +1 -1
- package/lib/styles/StyleProvider.js +9 -1
- package/lib/styles/StyleProvider.js.map +1 -1
- package/lib/styles/helpers.js +1 -2
- package/lib/styles/helpers.js.map +1 -1
- package/lib/styles/theme.js +4 -1
- package/lib/styles/theme.js.map +1 -1
- package/package.json +3 -3
- package/lib/assets/icons.d.ts +0 -2
- package/lib/assets/icons.d.ts.map +0 -1
- package/lib/assets/icons.js +0 -2
- package/lib/assets/icons.js.map +0 -1
- package/lib/cjs/assets/icons.js +0 -19
- package/lib/cjs/assets/icons.js.map +0 -7
package/lib/assets/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
1
|
+
import * as IconsLegacy from "@ledgerhq/icons-ui/reactLegacy";
|
|
2
|
+
export { IconsLegacy };
|
|
3
|
+
import * as Icons from "@ledgerhq/icons-ui/react";
|
|
4
|
+
export { Icons };
|
|
5
|
+
import * as CryptoIcons from "@ledgerhq/crypto-icons-ui/react";
|
|
6
|
+
export { CryptoIcons };
|
|
4
7
|
export * as Logos from "./logos";
|
|
5
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;AAC/D,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,gCAAgC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
|
package/lib/assets/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
export {
|
|
3
|
-
import * as
|
|
4
|
-
export {
|
|
5
|
-
import * as
|
|
6
|
-
export {
|
|
7
|
-
|
|
8
|
-
export { Logos_1 as Logos };
|
|
1
|
+
import * as IconsLegacy from "@ledgerhq/icons-ui/reactLegacy";
|
|
2
|
+
export { IconsLegacy };
|
|
3
|
+
import * as Icons from "@ledgerhq/icons-ui/react";
|
|
4
|
+
export { Icons };
|
|
5
|
+
import * as CryptoIcons from "@ledgerhq/crypto-icons-ui/react";
|
|
6
|
+
export { CryptoIcons };
|
|
7
|
+
export * as Logos from "./logos";
|
|
9
8
|
//# sourceMappingURL=index.js.map
|
package/lib/assets/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/assets/index.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA6B;
|
|
4
|
+
"sourcesContent": ["import * as IconsLegacy from \"@ledgerhq/icons-ui/reactLegacy\";\nexport { IconsLegacy };\nimport * as Icons from \"@ledgerhq/icons-ui/react\";\nexport { Icons };\nimport * as CryptoIcons from \"@ledgerhq/crypto-icons-ui/react\";\nexport { CryptoIcons };\nexport * as Logos from \"./logos\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA6B;AAE7B,YAAuB;AAEvB,kBAA6B;AAE7B,YAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/form/Switch/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { default } from \"./Switch\";\n"],
|
|
4
|
+
"sourcesContent": ["export { default } from \"./Switch\";\nexport type { SwitchProps } from \"./Switch\";\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAwB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,92 @@
|
|
|
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 BannerCard_stories_exports = {};
|
|
30
|
+
__export(BannerCard_stories_exports, {
|
|
31
|
+
Default: () => Default,
|
|
32
|
+
LNSCardBanner: () => LNSCardBanner,
|
|
33
|
+
default: () => BannerCard_stories_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(BannerCard_stories_exports);
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_asorted = require("../../../asorted");
|
|
38
|
+
var import__ = __toESM(require("."));
|
|
39
|
+
var BannerCard_stories_default = {
|
|
40
|
+
title: "Layout/Banner/BannerCard",
|
|
41
|
+
component: import__.default,
|
|
42
|
+
argTypes: {
|
|
43
|
+
title: {
|
|
44
|
+
description: "Title of the card."
|
|
45
|
+
},
|
|
46
|
+
cta: {
|
|
47
|
+
description: "Call to action text."
|
|
48
|
+
},
|
|
49
|
+
linkText: {
|
|
50
|
+
description: "Link text."
|
|
51
|
+
},
|
|
52
|
+
description: {
|
|
53
|
+
description: "Description of the card."
|
|
54
|
+
},
|
|
55
|
+
tag: {
|
|
56
|
+
description: "Tag to be displayed on top of the card."
|
|
57
|
+
},
|
|
58
|
+
image: {
|
|
59
|
+
description: "Image to be displayed on the right of the card."
|
|
60
|
+
},
|
|
61
|
+
onClick: {
|
|
62
|
+
description: "Function to be called when the card is clicked."
|
|
63
|
+
},
|
|
64
|
+
onLinkClick: {
|
|
65
|
+
description: "Function to be called when the link is clicked."
|
|
66
|
+
},
|
|
67
|
+
onClose: {
|
|
68
|
+
description: "Function to be called when the close button is clicked."
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
args: {
|
|
72
|
+
title: "Ledger Recover",
|
|
73
|
+
description: "Get peace of mind and start your free trial.",
|
|
74
|
+
cta: "Start my free trial",
|
|
75
|
+
linkText: "Learn more",
|
|
76
|
+
tag: "New",
|
|
77
|
+
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
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const Default = {};
|
|
81
|
+
const LNSCardBanner = {
|
|
82
|
+
args: {
|
|
83
|
+
title: "It's time to upgrade",
|
|
84
|
+
description: /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, "Upgrade to our latest devices with ", /* @__PURE__ */ import_react.default.createElement(import_asorted.Text, { color: "constant.purple" }, "20% discount"), " for an enhanced security and a seamless experience."),
|
|
85
|
+
descriptionWidth: 320,
|
|
86
|
+
cta: "Level up my wallet",
|
|
87
|
+
tag: void 0,
|
|
88
|
+
onClose: void 0,
|
|
89
|
+
borderRadius: "5px"
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=BannerCard.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 BannerCard, { BannerCardProps } from \".\";\n\nexport default {\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 text.\",\n },\n linkText: {\n description: \"Link text.\",\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 onLinkClick: {\n description: \"Function to be called when the link 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: \"Start my free trial\",\n linkText: \"Learn more\",\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} satisfies Meta<BannerCardProps>;\n\nexport const Default: StoryObj<BannerCardProps> = {};\n\nexport const LNSCardBanner: StoryObj<BannerCardProps> = {\n args: {\n title: \"It's time to upgrade\",\n description: (\n <>\n Upgrade to our latest devices with <Text color=\"constant.purple\">20% discount</Text> for an\n enhanced security and a seamless experience.\n </>\n ),\n descriptionWidth: 320,\n cta: \"Level up my wallet\",\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,eAA4C;AAE5C,IAAO,6BAAQ;AAAA,EACb,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,UAAU;AAAA,MACR,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,aAAa;AAAA,MACX,aAAa;AAAA,IACf;AAAA,IACA,SAAS;AAAA,MACP,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,KAAK;AAAA,IACL,UAAU;AAAA,IACV,KAAK;AAAA,IACL,OACE;AAAA,EACJ;AACF;AAEO,MAAM,UAAqC,CAAC;AAE5C,MAAM,gBAA2C;AAAA,EACtD,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,aACE,6BAAAC,QAAA,2BAAAA,QAAA,gBAAE,uCACmC,6BAAAA,QAAA,cAAC,uBAAK,OAAM,qBAAkB,cAAY,GAAO,sDAEtF;AAAA,IAEF,kBAAkB;AAAA,IAClB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,SAAS;AAAA,IACT,cAAc;AAAA,EAChB;AACF;",
|
|
6
|
+
"names": ["BannerCard", "React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
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 BannerCard_exports = {};
|
|
30
|
+
__export(BannerCard_exports, {
|
|
31
|
+
default: () => BannerCard
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(BannerCard_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
36
|
+
var import_styles = require("../../../../styles");
|
|
37
|
+
var import_assets = require("../../../../assets");
|
|
38
|
+
var import_asorted = require("../../../asorted");
|
|
39
|
+
var import_cta = require("../../../cta");
|
|
40
|
+
var import_Tag = __toESM(require("../../../Tag"));
|
|
41
|
+
var import__ = require("../..");
|
|
42
|
+
function BannerCard({
|
|
43
|
+
title,
|
|
44
|
+
cta,
|
|
45
|
+
linkText,
|
|
46
|
+
description,
|
|
47
|
+
descriptionWidth,
|
|
48
|
+
tag,
|
|
49
|
+
image,
|
|
50
|
+
onClick,
|
|
51
|
+
onLinkClick,
|
|
52
|
+
onClose,
|
|
53
|
+
...boxProps
|
|
54
|
+
}) {
|
|
55
|
+
const handleClose = (event) => {
|
|
56
|
+
event.stopPropagation();
|
|
57
|
+
onClose == null ? void 0 : onClose(event);
|
|
58
|
+
};
|
|
59
|
+
const handleCTAClick = (event) => {
|
|
60
|
+
event.stopPropagation();
|
|
61
|
+
onClick(event);
|
|
62
|
+
};
|
|
63
|
+
const handleLinkClick = (event) => {
|
|
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 })));
|
|
68
|
+
}
|
|
69
|
+
const StyledTag = (0, import_styled_components.default)(import_Tag.default).attrs({ size: "medium", type: "plain", active: true })`
|
|
70
|
+
font-size: 11px;
|
|
71
|
+
background-color: ${(p) => p.theme.colors.primary.c80};
|
|
72
|
+
`;
|
|
73
|
+
const Title = (0, import_styled_components.default)(import_asorted.Text).attrs({ variant: "h4Inter" })`
|
|
74
|
+
font-family: Inter;
|
|
75
|
+
font-size: 24px;
|
|
76
|
+
font-weight: 600;
|
|
77
|
+
`;
|
|
78
|
+
const Desc = (0, import_styled_components.default)(import_asorted.Text).attrs({ variant: "small", color: "neutral.c70" })`
|
|
79
|
+
font-family: Inter;
|
|
80
|
+
font-size: 13px;
|
|
81
|
+
font-style: normal;
|
|
82
|
+
font-weight: 500;
|
|
83
|
+
padding-bottom: 8px;
|
|
84
|
+
`;
|
|
85
|
+
const Wrapper = (0, import_styled_components.default)(import__.Flex)`
|
|
86
|
+
background-color: ${(p) => p.theme.colors.background.card};
|
|
87
|
+
background-image: ${(p) => p.image ? `url("${p.image}")` : "none"};
|
|
88
|
+
background-position: right center;
|
|
89
|
+
background-repeat: no-repeat;
|
|
90
|
+
background-size: 50% auto;
|
|
91
|
+
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
padding: 16px;
|
|
94
|
+
padding-top: ${(p) => p.tag ? "16px" : "24px"};
|
|
95
|
+
padding-right: 50%;
|
|
96
|
+
flex-basis: 100%;
|
|
97
|
+
|
|
98
|
+
position: relative;
|
|
99
|
+
flex-direction: column;
|
|
100
|
+
justify-content: flex-end;
|
|
101
|
+
align-items: flex-start;
|
|
102
|
+
gap: 4px;
|
|
103
|
+
`;
|
|
104
|
+
const CloseButton = (0, import_styled_components.default)(import_cta.Button).attrs({
|
|
105
|
+
Icon: /* @__PURE__ */ import_react.default.createElement(import_assets.Icons.Close, { size: "XS" }),
|
|
106
|
+
iconButton: true,
|
|
107
|
+
outline: true
|
|
108
|
+
})`
|
|
109
|
+
background-color: ${(p) => p.theme.colors.neutral.c30};
|
|
110
|
+
position: absolute;
|
|
111
|
+
top: 10px;
|
|
112
|
+
right: 10px;
|
|
113
|
+
width: 24px;
|
|
114
|
+
height: 24px;
|
|
115
|
+
svg {
|
|
116
|
+
width: 12px;
|
|
117
|
+
height: 12px;
|
|
118
|
+
}
|
|
119
|
+
`;
|
|
120
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 { Text } from \"../../../asorted\";\nimport { Button, Link } from \"../../../cta\";\nimport Tag from \"../../../Tag\";\nimport type { FlexBoxProps } from \"../../Flex\";\nimport { Flex } from \"../..\";\n\nexport type BannerCardProps = FlexBoxProps & {\n title: string;\n cta?: string;\n linkText?: string;\n description?: ReactNode;\n descriptionWidth?: number;\n tag?: string;\n image?: string;\n\n onClick: ReactEventHandler;\n onLinkClick?: ReactEventHandler;\n onClose?: ReactEventHandler;\n};\n\nexport default function BannerCard({\n title,\n cta,\n linkText,\n description,\n descriptionWidth,\n tag,\n image,\n onClick,\n onLinkClick,\n onClose,\n ...boxProps\n}: BannerCardProps) {\n const handleClose: ReactEventHandler = event => {\n event.stopPropagation();\n onClose?.(event);\n };\n const handleCTAClick: ReactEventHandler = event => {\n event.stopPropagation();\n onClick(event);\n };\n const handleLinkClick: ReactEventHandler = event => {\n event.stopPropagation();\n onLinkClick?.(event);\n };\n\n return (\n <Wrapper {...boxProps} image={image} tag={tag} onClick={handleCTAClick}>\n {tag && <StyledTag>{tag}</StyledTag>}\n <Title>{title}</Title>\n {description && <Desc maxWidth={descriptionWidth}>{description}</Desc>}\n <Flex columnGap={5}>\n {cta && (\n <Button variant=\"main\" outline={false} onClick={handleCTAClick}>\n {cta}\n </Button>\n )}\n {linkText && (\n <Link onClick={handleLinkClick}>\n <Text variant=\"body\" fontSize={14} flexShrink={1}>\n {linkText}\n </Text>\n </Link>\n )}\n </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<BannerCardProps, \"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 flex-basis: 100%;\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,oBAA8B;AAC9B,oBAAsB;AACtB,qBAAqB;AACrB,iBAA6B;AAC7B,iBAAgB;AAEhB,eAAqB;AAgBN,SAAR,WAA4B;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAoB;AAClB,QAAM,cAAiC,WAAS;AAC9C,UAAM,gBAAgB;AACtB,uCAAU;AAAA,EACZ;AACA,QAAM,iBAAoC,WAAS;AACjD,UAAM,gBAAgB;AACtB,YAAQ,KAAK;AAAA,EACf;AACA,QAAM,kBAAqC,WAAS;AAClD,UAAM,gBAAgB;AACtB,+CAAc;AAAA,EAChB;AAEA,SACE,6BAAAA,QAAA,cAAC,WAAS,GAAG,UAAU,OAAc,KAAU,SAAS,kBACrD,OAAO,6BAAAA,QAAA,cAAC,iBAAW,GAAI,GACxB,6BAAAA,QAAA,cAAC,aAAO,KAAM,GACb,eAAe,6BAAAA,QAAA,cAAC,QAAK,UAAU,oBAAmB,WAAY,GAC/D,6BAAAA,QAAA,cAAC,iBAAK,WAAW,KACd,OACC,6BAAAA,QAAA,cAAC,qBAAO,SAAQ,QAAO,SAAS,OAAO,SAAS,kBAC7C,GACH,GAED,YACC,6BAAAA,QAAA,cAAC,mBAAK,SAAS,mBACb,6BAAAA,QAAA,cAAC,uBAAK,SAAQ,QAAO,UAAU,IAAI,YAAY,KAC5C,QACH,CACF,CAEJ,GACC,WACC,6BAAAA,QAAA,cAAC,+BAAc,iBAAgB,UAC7B,6BAAAA,QAAA,cAAC,eAAY,eAAY,+BAA8B,SAAS,aAAa,CAC/E,CAEJ;AAEJ;AAEA,MAAM,gBAAY,yBAAAC,SAAO,WAAAC,OAAG,EAAE,MAAM,EAAE,MAAM,UAAU,MAAM,SAAS,QAAQ,KAAK,CAAC;AAAA;AAAA,sBAE7D,OAAK,EAAE,MAAM,OAAO,QAAQ,GAAG;AAAA;AAGrD,MAAM,YAAQ,yBAAAD,SAAO,mBAAI,EAAE,MAAM,EAAE,SAAS,UAAU,CAAC;AAAA;AAAA;AAAA;AAAA;AAMvD,MAAM,WAAO,yBAAAA,SAAO,mBAAI,EAAE,MAAM,EAAE,SAAS,SAAS,OAAO,cAAc,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ1E,MAAM,cAAU,yBAAAA,SAAO,aAAI;AAAA,sBACL,OAAK,EAAE,MAAM,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;AAAA;AAW/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"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
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 NotificationCard_stories_exports = {};
|
|
30
|
+
__export(NotificationCard_stories_exports, {
|
|
31
|
+
Default: () => Default,
|
|
32
|
+
LNSNotificationCard: () => LNSNotificationCard,
|
|
33
|
+
default: () => NotificationCard_stories_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(NotificationCard_stories_exports);
|
|
36
|
+
var import_assets = require("../../../../assets");
|
|
37
|
+
var import__ = __toESM(require("."));
|
|
38
|
+
var NotificationCard_stories_default = {
|
|
39
|
+
title: "Layout/Banner/NotificationCard",
|
|
40
|
+
component: import__.default,
|
|
41
|
+
argTypes: {
|
|
42
|
+
title: {
|
|
43
|
+
description: "Title of the card."
|
|
44
|
+
},
|
|
45
|
+
cta: {
|
|
46
|
+
description: "Call to action text."
|
|
47
|
+
},
|
|
48
|
+
description: {
|
|
49
|
+
description: "Description of the card."
|
|
50
|
+
},
|
|
51
|
+
icon: {
|
|
52
|
+
description: "Icon to be displayed on the left of the notification card.",
|
|
53
|
+
options: Object.keys(import_assets.Icons),
|
|
54
|
+
control: {
|
|
55
|
+
type: "select"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
onClick: {
|
|
59
|
+
description: "Function to be called when the card is clicked."
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
args: {
|
|
63
|
+
title: "Ledger Recover",
|
|
64
|
+
description: "Get peace of mind and start your free trial.",
|
|
65
|
+
cta: "Start my free trial",
|
|
66
|
+
icon: "Warning",
|
|
67
|
+
isHighlighted: false
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const Default = {};
|
|
71
|
+
const LNSNotificationCard = {
|
|
72
|
+
args: {
|
|
73
|
+
title: void 0,
|
|
74
|
+
description: "Updates are ending soon. Upgrade now with 20% off for a seamless experience.",
|
|
75
|
+
cta: "Level up my wallet",
|
|
76
|
+
icon: "SparksFill",
|
|
77
|
+
isHighlighted: true
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=NotificationCard.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 NotificationCard, { NotificationCardProps } from \".\";\n\nexport default {\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 text.\",\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: \"Start my free trial\",\n icon: \"Warning\",\n isHighlighted: false,\n },\n} satisfies Meta<NotificationCardProps>;\n\nexport const Default: StoryObj<NotificationCardProps> = {};\n\nexport const LNSNotificationCard: StoryObj<NotificationCardProps> = {\n args: {\n title: undefined,\n description: \"Updates are ending soon. Upgrade now with 20% off for a seamless experience.\",\n cta: \"Level up my wallet\",\n icon: \"SparksFill\",\n isHighlighted: true,\n },\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAAsB;AACtB,eAAwD;AAExD,IAAO,mCAAQ;AAAA,EACb,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;AAAA,IACL,MAAM;AAAA,IACN,eAAe;AAAA,EACjB;AACF;AAEO,MAAM,UAA2C,CAAC;AAElD,MAAM,sBAAuD;AAAA,EAClE,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,KAAK;AAAA,IACL,MAAM;AAAA,IACN,eAAe;AAAA,EACjB;AACF;",
|
|
6
|
+
"names": ["NotificationCard"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
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 NotificationCard_exports = {};
|
|
30
|
+
__export(NotificationCard_exports, {
|
|
31
|
+
default: () => NotificationCard
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(NotificationCard_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
36
|
+
var import_assets = require("../../../../assets");
|
|
37
|
+
var import_asorted = require("../../../asorted");
|
|
38
|
+
var import_cta = require("../../../cta");
|
|
39
|
+
var import__ = require("../..");
|
|
40
|
+
const colorsByIcon = {
|
|
41
|
+
Warning: {
|
|
42
|
+
icon: "warning.c80",
|
|
43
|
+
iconBg: "warning.c30",
|
|
44
|
+
cta: "warning.c80"
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
function NotificationCard({
|
|
48
|
+
title,
|
|
49
|
+
cta,
|
|
50
|
+
icon,
|
|
51
|
+
description,
|
|
52
|
+
isHighlighted,
|
|
53
|
+
onClick,
|
|
54
|
+
...boxProps
|
|
55
|
+
}) {
|
|
56
|
+
const handleCTAClick = (event) => {
|
|
57
|
+
event.stopPropagation();
|
|
58
|
+
onClick(event);
|
|
59
|
+
};
|
|
60
|
+
const safeIcon = icon in import_assets.Icons ? icon : "Information";
|
|
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)));
|
|
67
|
+
}
|
|
68
|
+
const Desc = (0, import_styled_components.default)(import_asorted.Text).attrs({ variant: "small" })`
|
|
69
|
+
font-family: Inter;
|
|
70
|
+
font-size: 13px;
|
|
71
|
+
font-style: normal;
|
|
72
|
+
font-weight: 500;
|
|
73
|
+
`;
|
|
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
|
+
const Wrapper = (0, import_styled_components.default)(import__.Grid)`
|
|
102
|
+
background-color: ${(p) => p.isHighlighted ? p.theme.colors.opacityDefault.c05 : "transparent"};
|
|
103
|
+
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
padding: 12px;
|
|
106
|
+
grid-template-columns: auto 1fr;
|
|
107
|
+
gap: ${(p) => p.isHighlighted ? "12px" : "24px"};
|
|
108
|
+
border-radius: 12px;
|
|
109
|
+
|
|
110
|
+
align-items: center;
|
|
111
|
+
justify-content: start;
|
|
112
|
+
`;
|
|
113
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/layout/Banner/NotificationCard/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import React, { type ReactEventHandler, type ReactNode } from \"react\";\nimport styled, { css } from \"styled-components\";\n\nimport { Icons } from \"../../../../assets\";\nimport { Text } from \"../../../asorted\";\nimport { Link } from \"../../../cta\";\nimport type { Props as GridBoxProps } from \"../../Grid\";\nimport { Grid, Flex } from \"../..\";\n\ntype IconKey = keyof typeof Icons;\n\nexport type NotificationCardProps = GridBoxProps & {\n title?: string;\n cta?: string;\n description?: ReactNode;\n icon: IconKey;\n isHighlighted?: boolean;\n\n onClick: ReactEventHandler;\n};\n\nconst colorsByIcon: Partial<\n Record<IconKey, Partial<{ icon: string; iconBg: string; cta: string }>>\n> = {\n Warning: {\n icon: \"warning.c80\",\n iconBg: \"warning.c30\",\n cta: \"warning.c80\",\n },\n};\n\nexport default function NotificationCard({\n title,\n cta,\n icon,\n description,\n isHighlighted,\n onClick,\n ...boxProps\n}: NotificationCardProps) {\n const handleCTAClick: ReactEventHandler = event => {\n event.stopPropagation();\n onClick(event);\n };\n\n const safeIcon: IconKey = icon in Icons ? icon : \"Information\";\n const Icon = Icons[safeIcon];\n const colors = colorsByIcon[safeIcon];\n const ctaColor = isHighlighted ? colors?.cta ?? \"primary.c80\" : \"neutral.c100\";\n const iconColor = colors?.icon ?? \"primary.c80\";\n const iconBgColor = colors?.iconBg ?? \"opacityPurple.c10\";\n\n return (\n <Wrapper {...boxProps} isHighlighted={isHighlighted} onClick={handleCTAClick}>\n <IconWrapper backgroundColor={iconBgColor} isHighlighted={isHighlighted}>\n <Icon color={iconColor} />\n </IconWrapper>\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 <Cta color={ctaColor} onClick={handleCTAClick}>\n {cta}\n </Cta>\n )}\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 Cta = styled(Link).attrs({ alignSelf: \"start\" })`\n font-size: 13px;\n`;\n\nconst IconWrapper = styled(Flex)<Pick<NotificationCardProps, \"isHighlighted\">>`\n border-radius: ${p => (p.isHighlighted ? \"13.5px\" : \"50%\")};\n padding: 8px;\n ${p =>\n p.isHighlighted &&\n css`\n background-clip: padding-box;\n border-width: 7px;\n border-style: solid;\n border-color: transparent;\n position: relative;\n &::before {\n content: \"\";\n position: absolute;\n inset: -7px;\n border-radius: 13.5px;\n background: linear-gradient(\n 180deg,\n ${p.theme.colors.opacityDefault.c05} 0%,\n rgba(29, 28, 31, 0) 100%\n );\n }\n `}\n \n }\n`;\n\nconst Wrapper = styled(Grid)<Pick<NotificationCardProps, \"isHighlighted\">>`\n background-color: ${p => (p.isHighlighted ? p.theme.colors.opacityDefault.c05 : \"transparent\")};\n\n cursor: pointer;\n padding: 12px;\n grid-template-columns: auto 1fr;\n gap: ${p => (p.isHighlighted ? \"12px\" : \"24px\")};\n border-radius: 12px;\n\n align-items: center;\n justify-content: start;\n`;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8D;AAC9D,+BAA4B;AAE5B,oBAAsB;AACtB,qBAAqB;AACrB,iBAAqB;AAErB,eAA2B;AAc3B,MAAM,eAEF;AAAA,EACF,SAAS;AAAA,IACP,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,KAAK;AAAA,EACP;AACF;AAEe,SAAR,iBAAkC;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA0B;AACxB,QAAM,iBAAoC,WAAS;AACjD,UAAM,gBAAgB;AACtB,YAAQ,KAAK;AAAA,EACf;AAEA,QAAM,WAAoB,QAAQ,sBAAQ,OAAO;AACjD,QAAM,OAAO,oBAAM,QAAQ;AAC3B,QAAM,SAAS,aAAa,QAAQ;AACpC,QAAM,WAAW,iBAAgB,iCAAQ,QAAO,gBAAgB;AAChE,QAAM,aAAY,iCAAQ,SAAQ;AAClC,QAAM,eAAc,iCAAQ,WAAU;AAEtC,SACE,6BAAAA,QAAA,cAAC,WAAS,GAAG,UAAU,eAA8B,SAAS,kBAC5D,6BAAAA,QAAA,cAAC,eAAY,iBAAiB,aAAa,iBACzC,6BAAAA,QAAA,cAAC,QAAK,OAAO,WAAW,CAC1B,GACA,6BAAAA,QAAA,cAAC,iBAAK,eAAc,UAAS,QAAQ,gBAAgB,QAAQ,SAC1D,SACC,6BAAAA,QAAA,cAAC,uBAAK,SAAQ,WAAU,UAAU,MAC/B,KACH,GAED,eACC,6BAAAA,QAAA,cAAC,QAAK,OAAO,gBAAgB,iBAAiB,iBAAgB,WAAY,GAE3E,OACC,6BAAAA,QAAA,cAAC,OAAI,OAAO,UAAU,SAAS,kBAC5B,GACH,CAEJ,CACF;AAEJ;AAEA,MAAM,WAAO,yBAAAC,SAAO,mBAAI,EAAE,MAAM,EAAE,SAAS,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAOpD,MAAM,UAAM,yBAAAA,SAAO,eAAI,EAAE,MAAM,EAAE,WAAW,QAAQ,CAAC;AAAA;AAAA;AAIrD,MAAM,kBAAc,yBAAAA,SAAO,aAAI;AAAA,mBACZ,OAAM,EAAE,gBAAgB,WAAW,KAAM;AAAA;AAAA,IAExD,OACA,EAAE,iBACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAaQ,EAAE,MAAM,OAAO,eAAe,GAAG;AAAA;AAAA;AAAA;AAAA,KAIxC;AAAA;AAAA;AAAA;AAKL,MAAM,cAAU,yBAAAA,SAAO,aAAI;AAAA,sBACL,OAAM,EAAE,gBAAgB,EAAE,MAAM,OAAO,eAAe,MAAM,aAAc;AAAA;AAAA;AAAA;AAAA;AAAA,SAKvF,OAAM,EAAE,gBAAgB,SAAS,MAAO;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": ["React", "styled"]
|
|
7
|
+
}
|
|
@@ -32,12 +32,7 @@ __export(PortfolioContentCard_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(PortfolioContentCard_exports);
|
|
34
34
|
var import_react = __toESM(require("react"));
|
|
35
|
-
var
|
|
36
|
-
var import_styles = require("../../../../styles");
|
|
37
|
-
var import_assets = require("../../../../assets");
|
|
38
|
-
var import_asorted = require("../../../asorted");
|
|
39
|
-
var import_cta = require("../../../cta");
|
|
40
|
-
var import_Tag = __toESM(require("../../../Tag"));
|
|
35
|
+
var import_BannerCard = __toESM(require("../../Banner/BannerCard"));
|
|
41
36
|
function PortfolioContentCard({
|
|
42
37
|
title,
|
|
43
38
|
cta,
|
|
@@ -47,62 +42,17 @@ function PortfolioContentCard({
|
|
|
47
42
|
onClick,
|
|
48
43
|
onClose
|
|
49
44
|
}) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
46
|
+
import_BannerCard.default,
|
|
47
|
+
{
|
|
48
|
+
title,
|
|
49
|
+
cta,
|
|
50
|
+
description,
|
|
51
|
+
tag,
|
|
52
|
+
image,
|
|
53
|
+
onClick,
|
|
54
|
+
onClose
|
|
55
|
+
}
|
|
56
|
+
);
|
|
55
57
|
}
|
|
56
|
-
const StyledTag = (0, import_styled_components.default)(import_Tag.default).attrs({ size: "medium", type: "plain", active: true })`
|
|
57
|
-
font-size: 11px;
|
|
58
|
-
background-color: ${(p) => p.theme.colors.primary.c80};
|
|
59
|
-
`;
|
|
60
|
-
const Title = (0, import_styled_components.default)(import_asorted.Text).attrs({ variant: "h4Inter" })`
|
|
61
|
-
font-family: Inter;
|
|
62
|
-
font-size: 24px;
|
|
63
|
-
font-weight: 600;
|
|
64
|
-
`;
|
|
65
|
-
const Desc = (0, import_styled_components.default)(import_asorted.Text).attrs({ variant: "small", color: "neutral.c70" })`
|
|
66
|
-
font-family: Inter;
|
|
67
|
-
font-size: 13px;
|
|
68
|
-
font-style: normal;
|
|
69
|
-
font-weight: 500;
|
|
70
|
-
padding-bottom: 8px;
|
|
71
|
-
`;
|
|
72
|
-
const Wrapper = import_styled_components.default.div`
|
|
73
|
-
background-color: ${(p) => p.theme.colors.background.card};
|
|
74
|
-
background-image: ${(p) => p.image ? `url("${p.image}")` : "none"};
|
|
75
|
-
background-position: right center;
|
|
76
|
-
background-repeat: no-repeat;
|
|
77
|
-
background-size: 50% auto;
|
|
78
|
-
|
|
79
|
-
cursor: pointer;
|
|
80
|
-
padding: 16px;
|
|
81
|
-
padding-top: ${(p) => p.tag ? "16px" : "24px"};
|
|
82
|
-
padding-right: 50%;
|
|
83
|
-
flex-basis: 100%;
|
|
84
|
-
|
|
85
|
-
position: relative;
|
|
86
|
-
display: flex;
|
|
87
|
-
flex-direction: column;
|
|
88
|
-
justify-content: flex-end;
|
|
89
|
-
align-items: flex-start;
|
|
90
|
-
gap: 4px;
|
|
91
|
-
`;
|
|
92
|
-
const CloseButton = (0, import_styled_components.default)(import_cta.Button).attrs({
|
|
93
|
-
Icon: /* @__PURE__ */ import_react.default.createElement(import_assets.Icons.Close, { size: "XS" }),
|
|
94
|
-
iconButton: true,
|
|
95
|
-
outline: true
|
|
96
|
-
})`
|
|
97
|
-
background-color: ${(p) => p.theme.colors.neutral.c30};
|
|
98
|
-
position: absolute;
|
|
99
|
-
top: 10px;
|
|
100
|
-
right: 10px;
|
|
101
|
-
width: 24px;
|
|
102
|
-
height: 24px;
|
|
103
|
-
svg {
|
|
104
|
-
width: 12px;
|
|
105
|
-
height: 12px;
|
|
106
|
-
}
|
|
107
|
-
`;
|
|
108
58
|
//# sourceMappingURL=index.js.map
|