@ledgerhq/react-ui 0.14.15-nightly.1 → 0.14.15-start-exchange.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/cards/Carousel/Carousel.stories.js +106 -0
- package/lib/cjs/components/cards/Carousel/Carousel.stories.js.map +7 -0
- package/lib/cjs/components/{layout/Carousel/Footer/Pagination/index.js → cards/Carousel/Slide.js} +20 -13
- package/lib/cjs/components/cards/Carousel/Slide.js.map +7 -0
- package/lib/cjs/components/cards/Carousel/index.js +187 -0
- package/lib/cjs/components/cards/Carousel/index.js.map +7 -0
- package/lib/cjs/components/{layout/Carousel/Footer → cards}/index.js +5 -16
- package/lib/cjs/components/cards/index.js.map +7 -0
- package/lib/cjs/components/index.js +1 -0
- package/lib/cjs/components/index.js.map +2 -2
- package/lib/cjs/components/layout/index.js +0 -2
- package/lib/cjs/components/layout/index.js.map +2 -2
- package/lib/components/cards/Carousel/Slide.d.ts +9 -0
- package/lib/components/cards/Carousel/Slide.js +22 -0
- package/lib/components/cards/Carousel/Slide.js.map +1 -0
- package/lib/components/cards/Carousel/index.d.ts +13 -0
- package/lib/components/cards/Carousel/index.js +144 -0
- package/lib/components/cards/Carousel/index.js.map +1 -0
- package/lib/components/cards/index.d.ts +1 -0
- package/lib/components/cards/index.js +2 -0
- package/lib/components/cards/index.js.map +1 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/layout/index.d.ts +0 -1
- package/lib/components/layout/index.js +0 -1
- package/lib/components/layout/index.js.map +1 -1
- package/package.json +2 -5
- package/lib/cjs/components/layout/Carousel/Carousel.stories.js +0 -78
- package/lib/cjs/components/layout/Carousel/Carousel.stories.js.map +0 -7
- package/lib/cjs/components/layout/Carousel/Footer/Pagination/bullets.js +0 -76
- package/lib/cjs/components/layout/Carousel/Footer/Pagination/bullets.js.map +0 -7
- package/lib/cjs/components/layout/Carousel/Footer/Pagination/index.js.map +0 -7
- package/lib/cjs/components/layout/Carousel/Footer/Pagination/types.js +0 -31
- package/lib/cjs/components/layout/Carousel/Footer/Pagination/types.js.map +0 -7
- package/lib/cjs/components/layout/Carousel/Footer/Pagination/utils.js +0 -38
- package/lib/cjs/components/layout/Carousel/Footer/Pagination/utils.js.map +0 -7
- package/lib/cjs/components/layout/Carousel/Footer/index.js.map +0 -7
- package/lib/cjs/components/layout/Carousel/Footer/variantContentCard.js +0 -67
- package/lib/cjs/components/layout/Carousel/Footer/variantContentCard.js.map +0 -7
- package/lib/cjs/components/layout/Carousel/Footer/variantDefault.js +0 -47
- package/lib/cjs/components/layout/Carousel/Footer/variantDefault.js.map +0 -7
- package/lib/cjs/components/layout/Carousel/index.js +0 -76
- package/lib/cjs/components/layout/Carousel/index.js.map +0 -7
- package/lib/cjs/components/layout/Carousel/types.js +0 -17
- package/lib/cjs/components/layout/Carousel/types.js.map +0 -7
- package/lib/components/layout/Carousel/Footer/Pagination/bullets.d.ts +0 -6
- package/lib/components/layout/Carousel/Footer/Pagination/bullets.js +0 -25
- package/lib/components/layout/Carousel/Footer/Pagination/bullets.js.map +0 -1
- package/lib/components/layout/Carousel/Footer/Pagination/index.d.ts +0 -4
- package/lib/components/layout/Carousel/Footer/Pagination/index.js +0 -13
- package/lib/components/layout/Carousel/Footer/Pagination/index.js.map +0 -1
- package/lib/components/layout/Carousel/Footer/Pagination/types.d.ts +0 -6
- package/lib/components/layout/Carousel/Footer/Pagination/types.js +0 -8
- package/lib/components/layout/Carousel/Footer/Pagination/types.js.map +0 -1
- package/lib/components/layout/Carousel/Footer/Pagination/utils.d.ts +0 -5
- package/lib/components/layout/Carousel/Footer/Pagination/utils.js +0 -18
- package/lib/components/layout/Carousel/Footer/Pagination/utils.js.map +0 -1
- package/lib/components/layout/Carousel/Footer/index.d.ts +0 -4
- package/lib/components/layout/Carousel/Footer/index.js +0 -13
- package/lib/components/layout/Carousel/Footer/index.js.map +0 -1
- package/lib/components/layout/Carousel/Footer/variantContentCard.d.ts +0 -4
- package/lib/components/layout/Carousel/Footer/variantContentCard.js +0 -32
- package/lib/components/layout/Carousel/Footer/variantContentCard.js.map +0 -1
- package/lib/components/layout/Carousel/Footer/variantDefault.d.ts +0 -4
- package/lib/components/layout/Carousel/Footer/variantDefault.js +0 -15
- package/lib/components/layout/Carousel/Footer/variantDefault.js.map +0 -1
- package/lib/components/layout/Carousel/index.d.ts +0 -7
- package/lib/components/layout/Carousel/index.js +0 -44
- package/lib/components/layout/Carousel/index.js.map +0 -1
- package/lib/components/layout/Carousel/types.d.ts +0 -14
- package/lib/components/layout/Carousel/types.js +0 -2
- package/lib/components/layout/Carousel/types.js.map +0 -1
|
@@ -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 Carousel_stories_exports = {};
|
|
30
|
+
__export(Carousel_stories_exports, {
|
|
31
|
+
Default: () => Default,
|
|
32
|
+
default: () => Carousel_stories_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Carousel_stories_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_client_api = require("@storybook/client-api");
|
|
37
|
+
var import_sampleSlide = __toESM(require("../../../assets/images/sampleSlide.png"));
|
|
38
|
+
var import__ = __toESM(require("."));
|
|
39
|
+
var Carousel_stories_default = {
|
|
40
|
+
title: "Cards/Portfolio/Carousel",
|
|
41
|
+
argTypes: {
|
|
42
|
+
isDismissed: {
|
|
43
|
+
description: "App level setting to determine visibility of the component",
|
|
44
|
+
control: {
|
|
45
|
+
type: "boolean",
|
|
46
|
+
defaultValue: { summary: false }
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
timeout: {
|
|
50
|
+
description: "Timeout for auto-slide in ms",
|
|
51
|
+
control: {
|
|
52
|
+
type: "number",
|
|
53
|
+
min: 1e3,
|
|
54
|
+
max: 2e4,
|
|
55
|
+
defaultValue: { summary: 7e3 }
|
|
56
|
+
},
|
|
57
|
+
table: {
|
|
58
|
+
type: { summary: "number" },
|
|
59
|
+
defaultValue: { summary: 7e3 }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
parameters: {
|
|
64
|
+
docs: {
|
|
65
|
+
description: {
|
|
66
|
+
component: `The carousel is used to showcase products and features to our users. It's a dismissable component that should be re-enabled from the settings of the app. By default, it auto loops through a series of slides but this is paused when the mouse enters the bounds of the slide.<br/>
|
|
67
|
+
The current version is missing the updated color palette and translatable strings.`
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const Template = (args) => {
|
|
73
|
+
const queue = [
|
|
74
|
+
{
|
|
75
|
+
title: "NEW PRODUCT 1",
|
|
76
|
+
description: "Enhance your security with the new ledger nano x available now!",
|
|
77
|
+
image: import_sampleSlide.default,
|
|
78
|
+
onClick: () => alert("Clicked on banner 1")
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
title: "NEW PRODUCT 2",
|
|
82
|
+
description: "Enhance your security with the new ledger nano x available now!",
|
|
83
|
+
image: import_sampleSlide.default,
|
|
84
|
+
onClick: () => alert("Clicked on banner 2")
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
title: "NEW PRODUCT 3",
|
|
88
|
+
description: "Enhance your security with the new ledger nano x available now!",
|
|
89
|
+
image: import_sampleSlide.default,
|
|
90
|
+
onClick: () => alert("Clicked on banner 3")
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
title: "NEW PRODUCT 4",
|
|
94
|
+
description: "Enhance your security with the new ledger nano x available now!",
|
|
95
|
+
image: import_sampleSlide.default,
|
|
96
|
+
onClick: () => alert("Clicked on banner 4")
|
|
97
|
+
}
|
|
98
|
+
];
|
|
99
|
+
const [, updateArgs] = (0, import_client_api.useArgs)();
|
|
100
|
+
const onDismiss = () => updateArgs({
|
|
101
|
+
isDismissed: true
|
|
102
|
+
});
|
|
103
|
+
return /* @__PURE__ */ import_react.default.createElement(import__.default, { ...args, queue, onDismiss });
|
|
104
|
+
};
|
|
105
|
+
const Default = Template.bind({});
|
|
106
|
+
//# sourceMappingURL=Carousel.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/cards/Carousel/Carousel.stories.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from \"react\";\n// @ts-expect-error Typings\u2026\nimport { useArgs } from \"@storybook/client-api\";\n\nimport image from \"../../../assets/images/sampleSlide.png\";\nimport Carousel, { Props as CarouselProps } from \".\";\n\nexport default {\n title: \"Cards/Portfolio/Carousel\",\n argTypes: {\n isDismissed: {\n description: \"App level setting to determine visibility of the component\",\n control: {\n type: \"boolean\",\n defaultValue: { summary: false },\n },\n },\n timeout: {\n description: \"Timeout for auto-slide in ms\",\n control: {\n type: \"number\",\n min: 1000,\n max: 20000,\n defaultValue: { summary: 7000 },\n },\n table: {\n type: { summary: \"number\" },\n defaultValue: { summary: 7000 },\n },\n },\n },\n parameters: {\n docs: {\n description: {\n component: `The carousel is used to showcase products and features to our users. It's a dismissable component that should be re-enabled from the settings of the app. By default, it auto loops through a series of slides but this is paused when the mouse enters the bounds of the slide.<br/>\n The current version is missing the updated color palette and translatable strings.`,\n },\n },\n },\n};\n\nconst Template = (args: CarouselProps) => {\n const queue = [\n {\n title: \"NEW PRODUCT 1\",\n description: \"Enhance your security with the new ledger nano x available now!\",\n image,\n onClick: () => alert(\"Clicked on banner 1\"),\n },\n {\n title: \"NEW PRODUCT 2\",\n description: \"Enhance your security with the new ledger nano x available now!\",\n image,\n onClick: () => alert(\"Clicked on banner 2\"),\n },\n {\n title: \"NEW PRODUCT 3\",\n description: \"Enhance your security with the new ledger nano x available now!\",\n image,\n onClick: () => alert(\"Clicked on banner 3\"),\n },\n {\n title: \"NEW PRODUCT 4\",\n description: \"Enhance your security with the new ledger nano x available now!\",\n image,\n onClick: () => alert(\"Clicked on banner 4\"),\n },\n ];\n\n const [, updateArgs] = useArgs();\n\n const onDismiss = () =>\n updateArgs({\n isDismissed: true,\n });\n\n return <Carousel {...args} queue={queue} onDismiss={onDismiss} />;\n};\n\nexport const Default = Template.bind({});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AAa;AAAA,EACf,CAAC;AAEH,SAAO,6BAAAC,QAAA,cAAC,SAAAC,SAAA,EAAU,GAAG,MAAM,OAAc,WAAsB;AACjE;AAEO,MAAM,UAAU,SAAS,KAAK,CAAC,CAAC;",
|
|
6
|
+
"names": ["image", "React", "Carousel"]
|
|
7
|
+
}
|
package/lib/cjs/components/{layout/Carousel/Footer/Pagination/index.js → cards/Carousel/Slide.js}
RENAMED
|
@@ -26,21 +26,28 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
31
|
-
default: () =>
|
|
29
|
+
var Slide_exports = {};
|
|
30
|
+
__export(Slide_exports, {
|
|
31
|
+
default: () => Slide_default
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(Slide_exports);
|
|
34
34
|
var import_react = __toESM(require("react"));
|
|
35
35
|
var import_styled_components = __toESM(require("styled-components"));
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
var import_Text = __toESM(require("../../asorted/Text"));
|
|
37
|
+
var import_Flex = __toESM(require("../../layout/Flex"));
|
|
38
|
+
const Wrapper = (0, import_styled_components.default)(import_Flex.default)`
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
padding: ${(p) => p.theme.space[8]}px ${(p) => p.theme.space[10]}px;
|
|
43
|
+
padding-right: 280px; /* Nb gives air to not overlap the illustration */
|
|
44
|
+
z-index: ${(p) => p.theme.zIndexes[8]};
|
|
45
|
+
background: url(${(p) => p.image}) no-repeat ${(p) => p.theme.colors.neutral.c100};
|
|
46
|
+
background-size: contain;
|
|
47
|
+
background-position: right 60px bottom;
|
|
41
48
|
`;
|
|
42
|
-
const
|
|
43
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
49
|
+
const Slide = ({ title, description, image, onClick }) => {
|
|
50
|
+
return /* @__PURE__ */ import_react.default.createElement(Wrapper, { key: "key", image, onClick }, /* @__PURE__ */ import_react.default.createElement(import_Text.default, { variant: "tiny", color: "neutral.c00", fontWeight: "regular" }, title), /* @__PURE__ */ import_react.default.createElement(import_Text.default, { variant: "h5", color: "neutral.c00", textTransform: "uppercase" }, description));
|
|
44
51
|
};
|
|
45
|
-
var
|
|
46
|
-
//# sourceMappingURL=
|
|
52
|
+
var Slide_default = Slide;
|
|
53
|
+
//# sourceMappingURL=Slide.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/cards/Carousel/Slide.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from \"react\";\nimport styled from \"styled-components\";\nimport Text from \"../../asorted/Text\";\nimport Flex from \"../../layout/Flex\";\n\nconst Wrapper = styled(Flex)<{ image?: string }>`\n width: 100%;\n height: 100%;\n flex-direction: column;\n padding: ${p => p.theme.space[8]}px ${p => p.theme.space[10]}px;\n padding-right: 280px; /* Nb gives air to not overlap the illustration */\n z-index: ${p => p.theme.zIndexes[8]};\n background: url(${p => p.image}) no-repeat ${p => p.theme.colors.neutral.c100};\n background-size: contain;\n background-position: right 60px bottom;\n`;\n\nexport type Props = {\n onClick: () => void;\n title: string;\n description: string;\n image?: string;\n};\n\nconst Slide = ({ title, description, image, onClick }: Props): React.ReactElement => {\n return (\n <Wrapper key={\"key\"} image={image} onClick={onClick}>\n <Text variant={\"tiny\"} color=\"neutral.c00\" fontWeight=\"regular\">\n {title}\n </Text>\n <Text variant={\"h5\"} color=\"neutral.c00\" textTransform=\"uppercase\">\n {description}\n </Text>\n </Wrapper>\n );\n};\n\nexport default Slide;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,+BAAmB;AACnB,kBAAiB;AACjB,kBAAiB;AAEjB,MAAM,cAAU,yBAAAA,SAAO,YAAAC,OAAI;AAAA;AAAA;AAAA;AAAA,aAId,OAAK,EAAE,MAAM,MAAM,CAAC,CAAC,MAAM,OAAK,EAAE,MAAM,MAAM,EAAE,CAAC;AAAA;AAAA,aAEjD,OAAK,EAAE,MAAM,SAAS,CAAC,CAAC;AAAA,oBACjB,OAAK,EAAE,KAAK,eAAe,OAAK,EAAE,MAAM,OAAO,QAAQ,IAAI;AAAA;AAAA;AAAA;AAY/E,MAAM,QAAQ,CAAC,EAAE,OAAO,aAAa,OAAO,QAAQ,MAAiC;AACnF,SACE,6BAAAC,QAAA,cAAC,WAAQ,KAAK,OAAO,OAAc,WACjC,6BAAAA,QAAA,cAAC,YAAAC,SAAA,EAAK,SAAS,QAAQ,OAAM,eAAc,YAAW,aACnD,KACH,GACA,6BAAAD,QAAA,cAAC,YAAAC,SAAA,EAAK,SAAS,MAAM,OAAM,eAAc,eAAc,eACpD,WACH,CACF;AAEJ;AAEA,IAAO,gBAAQ;",
|
|
6
|
+
"names": ["styled", "Flex", "React", "Text"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
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 Carousel_exports = {};
|
|
30
|
+
__export(Carousel_exports, {
|
|
31
|
+
default: () => Carousel_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(Carousel_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
36
|
+
var import_react_transition_group = require("react-transition-group");
|
|
37
|
+
var import_TransitionSlide = __toESM(require("../../transitions/TransitionSlide"));
|
|
38
|
+
var import_Button = __toESM(require("../../cta/Button"));
|
|
39
|
+
var import_Text = __toESM(require("../../asorted/Text"));
|
|
40
|
+
var import_Flex = __toESM(require("../../layout/Flex"));
|
|
41
|
+
var import_Slide = __toESM(require("./Slide"));
|
|
42
|
+
var import_ArrowLeftMedium = __toESM(require("@ledgerhq/icons-ui/reactLegacy/ArrowLeftMedium"));
|
|
43
|
+
var import_ArrowRightMedium = __toESM(require("@ledgerhq/icons-ui/reactLegacy/ArrowRightMedium"));
|
|
44
|
+
var import_CloseMedium = __toESM(require("@ledgerhq/icons-ui/reactLegacy/CloseMedium"));
|
|
45
|
+
const CarouselWrapper = import_styled_components.default.div`
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 180px;
|
|
48
|
+
border-radius: 8px;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
position: relative;
|
|
52
|
+
flex: 1;
|
|
53
|
+
background: ${(p) => p.theme.colors.neutral.c100};
|
|
54
|
+
`;
|
|
55
|
+
const Controllers = (0, import_styled_components.default)(import_Flex.default)`
|
|
56
|
+
position: absolute;
|
|
57
|
+
flex-direction: row;
|
|
58
|
+
right: ${(p) => p.theme.space[5]}px;
|
|
59
|
+
bottom: ${(p) => p.theme.space[4]}px;
|
|
60
|
+
column-gap: ${(p) => p.theme.space[4]}px;
|
|
61
|
+
color: ${(p) => p.theme.colors.neutral.c00};
|
|
62
|
+
|
|
63
|
+
> div {
|
|
64
|
+
&:hover {
|
|
65
|
+
opacity: 0.5;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
const Bullets = import_styled_components.default.div`
|
|
70
|
+
position: absolute;
|
|
71
|
+
display: flex;
|
|
72
|
+
left: ${(p) => p.theme.space[10]}px;
|
|
73
|
+
bottom: ${(p) => p.theme.space[8]}px;
|
|
74
|
+
column-gap: ${(p) => p.theme.space[2]}px;
|
|
75
|
+
flex-direction: row;
|
|
76
|
+
|
|
77
|
+
> div {
|
|
78
|
+
position: relative;
|
|
79
|
+
height: ${(p) => p.theme.space[1]}px;
|
|
80
|
+
width: ${(p) => p.theme.space[8]}px;
|
|
81
|
+
background: ${(p) => p.theme.colors.neutral.c00};
|
|
82
|
+
opacity: 0.5;
|
|
83
|
+
&:hover {
|
|
84
|
+
opacity: 0.75;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&:nth-child(${(p) => p.active}) {
|
|
88
|
+
opacity: 1;
|
|
89
|
+
&:hover {
|
|
90
|
+
opacity: 0.75;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
::after {
|
|
95
|
+
content: "";
|
|
96
|
+
position: absolute;
|
|
97
|
+
top: -${(p) => p.theme.space[4]}px;
|
|
98
|
+
height: ${(p) => p.theme.space[7]}px;
|
|
99
|
+
width: 100%;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
103
|
+
const Close = import_styled_components.default.div`
|
|
104
|
+
position: absolute;
|
|
105
|
+
top: ${(p) => p.theme.space[7]}px;
|
|
106
|
+
right: ${(p) => p.theme.space[5]}px;
|
|
107
|
+
color: ${(p) => p.theme.colors.neutral.c00};
|
|
108
|
+
&:hover {
|
|
109
|
+
opacity: 0.5;
|
|
110
|
+
}
|
|
111
|
+
`;
|
|
112
|
+
const DismissWrapper = import_styled_components.default.div`
|
|
113
|
+
color: white;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-direction: column;
|
|
118
|
+
padding: ${(p) => p.theme.space[13]}px;
|
|
119
|
+
row-gap: ${(p) => p.theme.space[7]}px;
|
|
120
|
+
`;
|
|
121
|
+
const DEFAULT_TIMEOUT = 7e3;
|
|
122
|
+
const Carousel = ({
|
|
123
|
+
timeout = DEFAULT_TIMEOUT,
|
|
124
|
+
queue,
|
|
125
|
+
isDismissed,
|
|
126
|
+
onDismiss,
|
|
127
|
+
dismissText = "This banner will not show up again until there is a new announcement",
|
|
128
|
+
dismissConfirmText = "Confirm",
|
|
129
|
+
dismissCancelText = "Show again"
|
|
130
|
+
}) => {
|
|
131
|
+
const intervalRef = (0, import_react.useRef)();
|
|
132
|
+
const [direction, setDirection] = (0, import_react.useState)("right");
|
|
133
|
+
const [index, setIndex] = (0, import_react.useState)(0);
|
|
134
|
+
const [wantToDismiss, setWantToDismiss] = (0, import_react.useState)(false);
|
|
135
|
+
const [paused, setPaused] = (0, import_react.useState)(false);
|
|
136
|
+
const childFactory = (0, import_react.useCallback)(
|
|
137
|
+
(child) => import_react.default.cloneElement(child, { direction }),
|
|
138
|
+
[direction]
|
|
139
|
+
);
|
|
140
|
+
const wrappedSetIndex = (0, import_react.useCallback)(
|
|
141
|
+
(newIndex) => {
|
|
142
|
+
setDirection(newIndex > index ? "left" : "right");
|
|
143
|
+
setIndex(newIndex);
|
|
144
|
+
},
|
|
145
|
+
[index]
|
|
146
|
+
);
|
|
147
|
+
const onSlide = (0, import_react.useCallback)(
|
|
148
|
+
(direction2 = "left") => {
|
|
149
|
+
setDirection(direction2);
|
|
150
|
+
const i = index + (direction2 === "right" ? -1 : 1);
|
|
151
|
+
setIndex(i < 0 ? queue.length - 1 : i >= queue.length ? 0 : i);
|
|
152
|
+
},
|
|
153
|
+
[index, queue]
|
|
154
|
+
);
|
|
155
|
+
const onPrevious = (0, import_react.useCallback)(() => onSlide("right"), [onSlide]);
|
|
156
|
+
const onNext = (0, import_react.useCallback)(() => onSlide("left"), [onSlide]);
|
|
157
|
+
const onWantToDismiss = () => setWantToDismiss(true);
|
|
158
|
+
const onCancelDismiss = () => setWantToDismiss(false);
|
|
159
|
+
const onMouseEnter = () => setPaused(true);
|
|
160
|
+
const onMouseLeave = () => setPaused(false);
|
|
161
|
+
(0, import_react.useEffect)(() => {
|
|
162
|
+
const _timeout = timeout < 1e3 ? DEFAULT_TIMEOUT : timeout;
|
|
163
|
+
if (intervalRef.current)
|
|
164
|
+
clearInterval(intervalRef.current);
|
|
165
|
+
if (!paused)
|
|
166
|
+
intervalRef.current = setInterval(onSlide, _timeout);
|
|
167
|
+
}, [onSlide, paused, timeout]);
|
|
168
|
+
(0, import_react.useEffect)(() => {
|
|
169
|
+
if (isDismissed)
|
|
170
|
+
setWantToDismiss(false);
|
|
171
|
+
}, [isDismissed]);
|
|
172
|
+
if (!(queue == null ? void 0 : queue.length) || isDismissed)
|
|
173
|
+
return null;
|
|
174
|
+
return /* @__PURE__ */ import_react.default.createElement(CarouselWrapper, { id: "carousel", onMouseEnter, onMouseLeave }, wantToDismiss ? /* @__PURE__ */ import_react.default.createElement(DismissWrapper, null, /* @__PURE__ */ import_react.default.createElement(import_Text.default, { color: "neutral.c00", fontWeight: "medium", variant: "paragraph" }, dismissText), /* @__PURE__ */ import_react.default.createElement(import_Flex.default, { columnGap: 5 }, /* @__PURE__ */ import_react.default.createElement(import_Button.default, { color: "neutral.c100", backgroundColor: "neutral.c00", onClick: onDismiss }, dismissConfirmText), /* @__PURE__ */ import_react.default.createElement(
|
|
175
|
+
import_Button.default,
|
|
176
|
+
{
|
|
177
|
+
outline: true,
|
|
178
|
+
color: "neutral.c00",
|
|
179
|
+
backgroundColor: "neutral.c100",
|
|
180
|
+
borderColor: "neutral.c00",
|
|
181
|
+
onClick: onCancelDismiss
|
|
182
|
+
},
|
|
183
|
+
dismissCancelText
|
|
184
|
+
))) : /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_react_transition_group.TransitionGroup, { component: null, childFactory }, /* @__PURE__ */ import_react.default.createElement(import_TransitionSlide.default, { key: index, direction }, /* @__PURE__ */ import_react.default.createElement(import_Slide.default, { ...queue[index] }))), /* @__PURE__ */ import_react.default.createElement(Close, { id: "carousel-dismiss", onClick: onWantToDismiss }, /* @__PURE__ */ import_react.default.createElement(import_CloseMedium.default, { size: 18 })), /* @__PURE__ */ import_react.default.createElement(Bullets, { active: index + 1 }, queue.map((_, i) => /* @__PURE__ */ import_react.default.createElement("div", { key: `bullet_${i}`, onClick: () => wrappedSetIndex(i) }))), /* @__PURE__ */ import_react.default.createElement(Controllers, null, /* @__PURE__ */ import_react.default.createElement("div", { onClick: onPrevious }, /* @__PURE__ */ import_react.default.createElement(import_ArrowLeftMedium.default, { size: 20 })), /* @__PURE__ */ import_react.default.createElement("div", { onClick: onNext }, /* @__PURE__ */ import_react.default.createElement(import_ArrowRightMedium.default, { size: 20 })))));
|
|
185
|
+
};
|
|
186
|
+
var Carousel_default = Carousel;
|
|
187
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/cards/Carousel/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import React, { useRef, useCallback, useState, useEffect } from \"react\";\nimport styled from \"styled-components\";\nimport { TransitionGroup } from \"react-transition-group\";\nimport TransitionSlide from \"../../transitions/TransitionSlide\";\n\nimport Button from \"../../cta/Button\";\nimport Text from \"../../asorted/Text\";\nimport Flex from \"../../layout/Flex\";\nimport Slide, { Props as SlideProps } from \"./Slide\";\n\nimport IconLeft from \"@ledgerhq/icons-ui/reactLegacy/ArrowLeftMedium\";\nimport IconRight from \"@ledgerhq/icons-ui/reactLegacy/ArrowRightMedium\";\nimport IconClose from \"@ledgerhq/icons-ui/reactLegacy/CloseMedium\";\n\nconst CarouselWrapper = styled.div`\n width: 100%;\n height: 180px;\n border-radius: 8px;\n overflow: hidden;\n cursor: pointer;\n position: relative;\n flex: 1;\n background: ${p => p.theme.colors.neutral.c100};\n`;\n\nconst Controllers = styled(Flex)`\n position: absolute;\n flex-direction: row;\n right: ${p => p.theme.space[5]}px;\n bottom: ${p => p.theme.space[4]}px;\n column-gap: ${p => p.theme.space[4]}px;\n color: ${p => p.theme.colors.neutral.c00};\n\n > div {\n &:hover {\n opacity: 0.5;\n }\n }\n`;\n\nconst Bullets = styled.div<{ active?: number }>`\n position: absolute;\n display: flex;\n left: ${p => p.theme.space[10]}px;\n bottom: ${p => p.theme.space[8]}px;\n column-gap: ${p => p.theme.space[2]}px;\n flex-direction: row;\n\n > div {\n position: relative;\n height: ${p => p.theme.space[1]}px;\n width: ${p => p.theme.space[8]}px;\n background: ${p => p.theme.colors.neutral.c00};\n opacity: 0.5;\n &:hover {\n opacity: 0.75;\n }\n\n &:nth-child(${p => p.active}) {\n opacity: 1;\n &:hover {\n opacity: 0.75;\n }\n }\n\n ::after {\n content: \"\";\n position: absolute;\n top: -${p => p.theme.space[4]}px;\n height: ${p => p.theme.space[7]}px;\n width: 100%;\n }\n }\n`;\n\nconst Close = styled.div`\n position: absolute;\n top: ${p => p.theme.space[7]}px;\n right: ${p => p.theme.space[5]}px;\n color: ${p => p.theme.colors.neutral.c00};\n &:hover {\n opacity: 0.5;\n }\n`;\n\nconst DismissWrapper = styled.div`\n color: white;\n align-items: center;\n justify-content: center;\n display: flex;\n flex-direction: column;\n padding: ${p => p.theme.space[13]}px;\n row-gap: ${p => p.theme.space[7]}px;\n`;\n\nexport type Props = {\n timeout?: number;\n queue: SlideProps[];\n isDismissed: boolean;\n onDismiss: () => void;\n dismissText?: React.ReactNode;\n dismissConfirmText?: React.ReactNode;\n dismissCancelText?: React.ReactNode;\n};\n\nconst DEFAULT_TIMEOUT = 7000;\nconst Carousel = ({\n timeout = DEFAULT_TIMEOUT,\n queue,\n isDismissed,\n onDismiss,\n dismissText = \"This banner will not show up again until there is a new announcement\",\n dismissConfirmText = \"Confirm\",\n dismissCancelText = \"Show again\",\n}: Props): React.ReactElement | null => {\n const intervalRef = useRef<ReturnType<typeof setInterval>>();\n\n const [direction, setDirection] = useState(\"right\");\n const [index, setIndex] = useState(0);\n const [wantToDismiss, setWantToDismiss] = useState(false);\n const [paused, setPaused] = useState(false);\n const childFactory = useCallback(\n (child: any) => React.cloneElement(child, { direction }),\n [direction],\n );\n\n const wrappedSetIndex = useCallback(\n (newIndex: number) => {\n setDirection(newIndex > index ? \"left\" : \"right\");\n setIndex(newIndex);\n },\n [index],\n );\n\n const onSlide = useCallback(\n (direction = \"left\") => {\n setDirection(direction);\n const i = index + (direction === \"right\" ? -1 : 1);\n setIndex(i < 0 ? queue.length - 1 : i >= queue.length ? 0 : i);\n },\n [index, queue],\n );\n const onPrevious = useCallback(() => onSlide(\"right\"), [onSlide]);\n const onNext = useCallback(() => onSlide(\"left\"), [onSlide]);\n\n const onWantToDismiss = () => setWantToDismiss(true);\n const onCancelDismiss = () => setWantToDismiss(false);\n\n const onMouseEnter = () => setPaused(true);\n const onMouseLeave = () => setPaused(false);\n\n useEffect(() => {\n // Nb we pause automatic transitions when the mouse is within the carousel.\n // Override passed timeout if lower than 1000ms\n const _timeout = timeout < 1000 ? DEFAULT_TIMEOUT : timeout;\n if (intervalRef.current) clearInterval(intervalRef.current);\n if (!paused) intervalRef.current = setInterval(onSlide, _timeout);\n }, [onSlide, paused, timeout]);\n\n useEffect(() => {\n if (isDismissed) setWantToDismiss(false);\n }, [isDismissed]);\n\n if (!queue?.length || isDismissed) return null;\n\n return (\n <CarouselWrapper id={\"carousel\"} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>\n {wantToDismiss ? (\n <DismissWrapper>\n <Text color=\"neutral.c00\" fontWeight=\"medium\" variant={\"paragraph\"}>\n {dismissText}\n </Text>\n <Flex columnGap={5}>\n <Button color=\"neutral.c100\" backgroundColor=\"neutral.c00\" onClick={onDismiss}>\n {dismissConfirmText}\n </Button>\n <Button\n outline\n color=\"neutral.c00\"\n backgroundColor=\"neutral.c100\"\n borderColor=\"neutral.c00\"\n onClick={onCancelDismiss}\n >\n {dismissCancelText}\n </Button>\n </Flex>\n </DismissWrapper>\n ) : (\n <div>\n <TransitionGroup component={null} childFactory={childFactory}>\n <TransitionSlide key={index} direction={direction}>\n <Slide {...queue[index]} />\n </TransitionSlide>\n </TransitionGroup>\n\n <Close id={\"carousel-dismiss\"} onClick={onWantToDismiss}>\n <IconClose size={18} />\n </Close>\n\n <Bullets active={index + 1}>\n {queue.map((_, i) => (\n <div key={`bullet_${i}`} onClick={() => wrappedSetIndex(i)} />\n ))}\n </Bullets>\n\n <Controllers>\n <div onClick={onPrevious}>\n <IconLeft size={20} />\n </div>\n <div onClick={onNext}>\n <IconRight size={20} />\n </div>\n </Controllers>\n </div>\n )}\n </CarouselWrapper>\n );\n};\n\nexport default Carousel;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAgE;AAChE,+BAAmB;AACnB,oC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EAAgB,KAAK,OAAO,aAC3B,6BAAAJ,QAAA,cAAC,aAAAK,SAAA,EAAO,GAAG,MAAM,KAAK,GAAG,CAC3B,CACF,GAEA,6BAAAL,QAAA,cAAC,SAAM,IAAI,oBAAoB,SAAS,mBACtC,6BAAAA,QAAA,cAAC,mBAAAM,SAAA,EAAU,MAAM,IAAI,CACvB,GAEA,6BAAAN,QAAA,cAAC,WAAQ,QAAQ,QAAQ,KACtB,MAAM,IAAI,CAAC,GAAG,MACb,6BAAAA,QAAA,cAAC,SAAI,KAAK,UAAU,CAAC,IAAI,SAAS,MAAM,gBAAgB,CAAC,GAAG,CAC7D,CACH,GAEA,6BAAAA,QAAA,cAAC,mBACC,6BAAAA,QAAA,cAAC,SAAI,SAAS,cACZ,6BAAAA,QAAA,cAAC,uBAAAO,SAAA,EAAS,MAAM,IAAI,CACtB,GACA,6BAAAP,QAAA,cAAC,SAAI,SAAS,UACZ,6BAAAA,QAAA,cAAC,wBAAAQ,SAAA,EAAU,MAAM,IAAI,CACvB,CACF,CACF,CAEJ;AAEJ;AAEA,IAAO,mBAAQ;",
|
|
6
|
+
"names": ["styled", "Flex", "React", "direction", "Text", "Button", "TransitionSlide", "Slide", "IconClose", "IconLeft", "IconRight"]
|
|
7
|
+
}
|
|
@@ -26,21 +26,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
31
|
-
|
|
29
|
+
var cards_exports = {};
|
|
30
|
+
__export(cards_exports, {
|
|
31
|
+
Carousel: () => import_Carousel.default
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
35
|
-
var import_variantContentCard = __toESM(require("./variantContentCard"));
|
|
36
|
-
var import_variantDefault = __toESM(require("./variantDefault"));
|
|
37
|
-
const Footers = {
|
|
38
|
-
"content-card": import_variantContentCard.default,
|
|
39
|
-
default: import_variantDefault.default
|
|
40
|
-
};
|
|
41
|
-
const Footer = (props) => {
|
|
42
|
-
const Component = Footers[props.variant];
|
|
43
|
-
return /* @__PURE__ */ import_react.default.createElement(Component, { ...props });
|
|
44
|
-
};
|
|
45
|
-
var Footer_default = Footer;
|
|
33
|
+
module.exports = __toCommonJS(cards_exports);
|
|
34
|
+
var import_Carousel = __toESM(require("./Carousel"));
|
|
46
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -35,6 +35,7 @@ __export(components_exports, {
|
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(components_exports);
|
|
37
37
|
__reExport(components_exports, require("./asorted"), module.exports);
|
|
38
|
+
__reExport(components_exports, require("./cards"), module.exports);
|
|
38
39
|
var import_Chart = __toESM(require("./Chart"));
|
|
39
40
|
__reExport(components_exports, require("./cta"), module.exports);
|
|
40
41
|
__reExport(components_exports, require("./form"), module.exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from \"./asorted\";\nexport { default as Chart } from \"./Chart\";\nexport * from \"./cta\";\nexport * from \"./form\";\nexport * from \"./layout\";\nexport * from \"./loaders\";\nexport * from \"./message\";\nexport * from \"./navigation\";\nexport { default as Table } from \"./Table\";\nexport * from \"./tabs\";\nexport { default as Tag } from \"./Tag\";\nexport * from \"./transitions\";\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAc,sBAAd;AACA,mBAAiC;AACjC,+BAAc,
|
|
4
|
+
"sourcesContent": ["export * from \"./asorted\";\nexport * from \"./cards\";\nexport { default as Chart } from \"./Chart\";\nexport * from \"./cta\";\nexport * from \"./form\";\nexport * from \"./layout\";\nexport * from \"./loaders\";\nexport * from \"./message\";\nexport * from \"./navigation\";\nexport { default as Table } from \"./Table\";\nexport * from \"./tabs\";\nexport { default as Tag } from \"./Tag\";\nexport * from \"./transitions\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAc,sBAAd;AACA,+BAAc,oBADd;AAEA,mBAAiC;AACjC,+BAAc,kBAHd;AAIA,+BAAc,mBAJd;AAKA,+BAAc,qBALd;AAMA,+BAAc,sBANd;AAOA,+BAAc,sBAPd;AAQA,+BAAc,yBARd;AASA,mBAAiC;AACjC,+BAAc,mBAVd;AAWA,iBAA+B;AAC/B,+BAAc,0BAZd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -29,7 +29,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var layout_exports = {};
|
|
30
30
|
__export(layout_exports, {
|
|
31
31
|
Box: () => import_Box.default,
|
|
32
|
-
Carousel: () => import_Carousel.default,
|
|
33
32
|
Drawer: () => import_Drawer.default,
|
|
34
33
|
Flex: () => import_Flex.default,
|
|
35
34
|
Grid: () => import_Grid.default,
|
|
@@ -44,6 +43,5 @@ var import_Grid = __toESM(require("./Grid"));
|
|
|
44
43
|
var import_Popin = __toESM(require("./Popin"));
|
|
45
44
|
var import_Side = __toESM(require("./Side"));
|
|
46
45
|
var import_Drawer = __toESM(require("./Drawer"));
|
|
47
|
-
var import_Carousel = __toESM(require("./Carousel"));
|
|
48
46
|
var import_VerticalTimeline = __toESM(require("./List/VerticalTimeline"));
|
|
49
47
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/layout/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { default as Flex } from \"./Flex\";\nexport { default as Box } from \"./Box\";\nexport { default as Grid } from \"./Grid\";\nexport { default as Popin } from \"./Popin\";\nexport { default as Side } from \"./Side\";\nexport { default as Drawer } from \"./Drawer\";\nexport { default as
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA
|
|
4
|
+
"sourcesContent": ["export { default as Flex } from \"./Flex\";\nexport { default as Box } from \"./Box\";\nexport { default as Grid } from \"./Grid\";\nexport { default as Popin } from \"./Popin\";\nexport { default as Side } from \"./Side\";\nexport { default as Drawer } from \"./Drawer\";\nexport { default as VerticalTimeline } from \"./List/VerticalTimeline\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAgC;AAChC,iBAA+B;AAC/B,kBAAgC;AAChC,mBAAiC;AACjC,kBAAgC;AAChC,oBAAkC;AAClC,8BAA4C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import Text from "../../asorted/Text";
|
|
4
|
+
import Flex from "../../layout/Flex";
|
|
5
|
+
const Wrapper = styled(Flex) `
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
padding: ${p => p.theme.space[8]}px ${p => p.theme.space[10]}px;
|
|
10
|
+
padding-right: 280px; /* Nb gives air to not overlap the illustration */
|
|
11
|
+
z-index: ${p => p.theme.zIndexes[8]};
|
|
12
|
+
background: url(${p => p.image}) no-repeat ${p => p.theme.colors.neutral.c100};
|
|
13
|
+
background-size: contain;
|
|
14
|
+
background-position: right 60px bottom;
|
|
15
|
+
`;
|
|
16
|
+
const Slide = ({ title, description, image, onClick }) => {
|
|
17
|
+
return (React.createElement(Wrapper, { key: "key", image: image, onClick: onClick },
|
|
18
|
+
React.createElement(Text, { variant: "tiny", color: "neutral.c00", fontWeight: "regular" }, title),
|
|
19
|
+
React.createElement(Text, { variant: "h5", color: "neutral.c00", textTransform: "uppercase" }, description)));
|
|
20
|
+
};
|
|
21
|
+
export default Slide;
|
|
22
|
+
//# sourceMappingURL=Slide.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slide.js","sourceRoot":"","sources":["../../../../src/components/cards/Carousel/Slide.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,IAAI,MAAM,mBAAmB,CAAC;AAErC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAoB;;;;aAInC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;;aAEjD,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;oBACjB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI;;;CAG9E,CAAC;AASF,MAAM,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAS,EAAsB,EAAE;IAClF,OAAO,CACL,oBAAC,OAAO,IAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO;QACjD,oBAAC,IAAI,IAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAC,aAAa,EAAC,UAAU,EAAC,SAAS,IAC5D,KAAK,CACD;QACP,oBAAC,IAAI,IAAC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAC,aAAa,EAAC,aAAa,EAAC,WAAW,IAC/D,WAAW,CACP,CACC,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Props as SlideProps } from "./Slide";
|
|
3
|
+
export type Props = {
|
|
4
|
+
timeout?: number;
|
|
5
|
+
queue: SlideProps[];
|
|
6
|
+
isDismissed: boolean;
|
|
7
|
+
onDismiss: () => void;
|
|
8
|
+
dismissText?: React.ReactNode;
|
|
9
|
+
dismissConfirmText?: React.ReactNode;
|
|
10
|
+
dismissCancelText?: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
declare const Carousel: ({ timeout, queue, isDismissed, onDismiss, dismissText, dismissConfirmText, dismissCancelText, }: Props) => React.ReactElement | null;
|
|
13
|
+
export default Carousel;
|