@ledgerhq/react-ui 0.14.14 → 0.14.15-nightly.1
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/index.js +0 -1
- package/lib/cjs/components/index.js.map +2 -2
- package/lib/cjs/components/layout/Carousel/Carousel.stories.js +78 -0
- package/lib/cjs/components/layout/Carousel/Carousel.stories.js.map +7 -0
- package/lib/cjs/components/layout/Carousel/Footer/Pagination/bullets.js +76 -0
- package/lib/cjs/components/layout/Carousel/Footer/Pagination/bullets.js.map +7 -0
- package/lib/cjs/components/{cards/Carousel/Slide.js → layout/Carousel/Footer/Pagination/index.js} +13 -20
- package/lib/cjs/components/layout/Carousel/Footer/Pagination/index.js.map +7 -0
- package/lib/cjs/components/layout/Carousel/Footer/Pagination/types.js +31 -0
- package/lib/cjs/components/layout/Carousel/Footer/Pagination/types.js.map +7 -0
- package/lib/cjs/components/layout/Carousel/Footer/Pagination/utils.js +38 -0
- package/lib/cjs/components/layout/Carousel/Footer/Pagination/utils.js.map +7 -0
- package/lib/cjs/components/{cards → layout/Carousel/Footer}/index.js +16 -5
- package/lib/cjs/components/layout/Carousel/Footer/index.js.map +7 -0
- package/lib/cjs/components/layout/Carousel/Footer/variantContentCard.js +67 -0
- package/lib/cjs/components/layout/Carousel/Footer/variantContentCard.js.map +7 -0
- package/lib/cjs/components/layout/Carousel/Footer/variantDefault.js +47 -0
- package/lib/cjs/components/layout/Carousel/Footer/variantDefault.js.map +7 -0
- package/lib/cjs/components/layout/Carousel/index.js +76 -0
- package/lib/cjs/components/layout/Carousel/index.js.map +7 -0
- package/lib/cjs/components/layout/Carousel/types.js +17 -0
- package/lib/cjs/components/layout/Carousel/types.js.map +7 -0
- package/lib/cjs/components/layout/index.js +2 -0
- package/lib/cjs/components/layout/index.js.map +2 -2
- package/lib/components/index.d.ts +0 -1
- package/lib/components/index.js +0 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/layout/Carousel/Footer/Pagination/bullets.d.ts +6 -0
- package/lib/components/layout/Carousel/Footer/Pagination/bullets.js +25 -0
- package/lib/components/layout/Carousel/Footer/Pagination/bullets.js.map +1 -0
- package/lib/components/layout/Carousel/Footer/Pagination/index.d.ts +4 -0
- package/lib/components/layout/Carousel/Footer/Pagination/index.js +13 -0
- package/lib/components/layout/Carousel/Footer/Pagination/index.js.map +1 -0
- package/lib/components/layout/Carousel/Footer/Pagination/types.d.ts +6 -0
- package/lib/components/layout/Carousel/Footer/Pagination/types.js +8 -0
- package/lib/components/layout/Carousel/Footer/Pagination/types.js.map +1 -0
- package/lib/components/layout/Carousel/Footer/Pagination/utils.d.ts +5 -0
- package/lib/components/layout/Carousel/Footer/Pagination/utils.js +18 -0
- package/lib/components/layout/Carousel/Footer/Pagination/utils.js.map +1 -0
- package/lib/components/layout/Carousel/Footer/index.d.ts +4 -0
- package/lib/components/layout/Carousel/Footer/index.js +13 -0
- package/lib/components/layout/Carousel/Footer/index.js.map +1 -0
- package/lib/components/layout/Carousel/Footer/variantContentCard.d.ts +4 -0
- package/lib/components/layout/Carousel/Footer/variantContentCard.js +32 -0
- package/lib/components/layout/Carousel/Footer/variantContentCard.js.map +1 -0
- package/lib/components/layout/Carousel/Footer/variantDefault.d.ts +4 -0
- package/lib/components/layout/Carousel/Footer/variantDefault.js +15 -0
- package/lib/components/layout/Carousel/Footer/variantDefault.js.map +1 -0
- package/lib/components/layout/Carousel/index.d.ts +7 -0
- package/lib/components/layout/Carousel/index.js +44 -0
- package/lib/components/layout/Carousel/index.js.map +1 -0
- package/lib/components/layout/Carousel/types.d.ts +14 -0
- package/lib/components/layout/Carousel/types.js +2 -0
- package/lib/components/layout/Carousel/types.js.map +1 -0
- package/lib/components/layout/index.d.ts +1 -0
- package/lib/components/layout/index.js +1 -0
- package/lib/components/layout/index.js.map +1 -1
- package/package.json +5 -2
- package/lib/cjs/components/cards/Carousel/Carousel.stories.js +0 -106
- package/lib/cjs/components/cards/Carousel/Carousel.stories.js.map +0 -7
- package/lib/cjs/components/cards/Carousel/Slide.js.map +0 -7
- package/lib/cjs/components/cards/Carousel/index.js +0 -187
- package/lib/cjs/components/cards/Carousel/index.js.map +0 -7
- package/lib/cjs/components/cards/index.js.map +0 -7
- package/lib/components/cards/Carousel/Slide.d.ts +0 -9
- package/lib/components/cards/Carousel/Slide.js +0 -22
- package/lib/components/cards/Carousel/Slide.js.map +0 -1
- package/lib/components/cards/Carousel/index.d.ts +0 -13
- package/lib/components/cards/Carousel/index.js +0 -144
- package/lib/components/cards/Carousel/index.js.map +0 -1
- package/lib/components/cards/index.d.ts +0 -1
- package/lib/components/cards/index.js +0 -2
- package/lib/components/cards/index.js.map +0 -1
|
@@ -35,7 +35,6 @@ __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);
|
|
39
38
|
var import_Chart = __toESM(require("./Chart"));
|
|
40
39
|
__reExport(components_exports, require("./cta"), module.exports);
|
|
41
40
|
__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
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAc,sBAAd;AACA
|
|
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,kBAFd;AAGA,+BAAc,mBAHd;AAIA,+BAAc,qBAJd;AAKA,+BAAc,sBALd;AAMA,+BAAc,sBANd;AAOA,+BAAc,yBAPd;AAQA,mBAAiC;AACjC,+BAAc,mBATd;AAUA,iBAA+B;AAC/B,+BAAc,0BAXd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
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__ = __toESM(require("./"));
|
|
37
|
+
const CarouselStory = (args) => {
|
|
38
|
+
const slides = [...Array(5)].map((_, index) => /* @__PURE__ */ import_react.default.createElement(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
key: index,
|
|
42
|
+
style: {
|
|
43
|
+
backgroundColor: "hsl(" + Math.random() * 360 + ", 100%, 75%)",
|
|
44
|
+
padding: "15px",
|
|
45
|
+
borderRadius: "5px"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"Slide ",
|
|
49
|
+
index
|
|
50
|
+
));
|
|
51
|
+
return /* @__PURE__ */ import_react.default.createElement(import__.default, { variant: args.variant, children: slides });
|
|
52
|
+
};
|
|
53
|
+
var Carousel_stories_default = {
|
|
54
|
+
title: "Layout/Carousel",
|
|
55
|
+
argTypes: {
|
|
56
|
+
children: {
|
|
57
|
+
description: "The elements to be displayed."
|
|
58
|
+
},
|
|
59
|
+
variant: {
|
|
60
|
+
description: "Variant for the carousel.",
|
|
61
|
+
options: ["default", "content-card"],
|
|
62
|
+
defaultValue: "default",
|
|
63
|
+
control: { type: "select" }
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
args: {
|
|
67
|
+
variant: "default"
|
|
68
|
+
},
|
|
69
|
+
parameters: {
|
|
70
|
+
docs: {
|
|
71
|
+
description: {
|
|
72
|
+
component: "A simple Carousel component."
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const Default = CarouselStory.bind({});
|
|
78
|
+
//# sourceMappingURL=Carousel.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/layout/Carousel/Carousel.stories.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from \"react\";\nimport Carousel from \"./\";\nimport { Props } from \"./types\";\n\nconst CarouselStory = (args: Props) => {\n const slides = [...Array(5)].map((_, index) => (\n <div\n key={index}\n style={{\n backgroundColor: \"hsl(\" + Math.random() * 360 + \", 100%, 75%)\",\n padding: \"15px\",\n borderRadius: \"5px\",\n }}\n >\n Slide {index}\n </div>\n ));\n\n return <Carousel variant={args.variant} children={slides} />;\n};\n\nexport default {\n title: \"Layout/Carousel\",\n argTypes: {\n children: {\n description: \"The elements to be displayed.\",\n },\n variant: {\n description: \"Variant for the carousel.\",\n options: [\"default\", \"content-card\"],\n defaultValue: \"default\",\n control: { type: \"select\" },\n },\n },\n args: {\n variant: \"default\",\n },\n parameters: {\n docs: {\n description: {\n component: \"A simple Carousel component.\",\n },\n },\n },\n};\n\nexport const Default = CarouselStory.bind({});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,eAAqB;AAGrB,MAAM,gBAAgB,CAAC,SAAgB;AACrC,QAAM,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,UACnC,6BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,OAAO;AAAA,QACL,iBAAiB,SAAS,KAAK,OAAO,IAAI,MAAM;AAAA,QAChD,SAAS;AAAA,QACT,cAAc;AAAA,MAChB;AAAA;AAAA,IACD;AAAA,IACQ;AAAA,EACT,CACD;AAED,SAAO,6BAAAA,QAAA,cAAC,SAAAC,SAAA,EAAS,SAAS,KAAK,SAAS,UAAU,QAAQ;AAC5D;AAEA,IAAO,2BAAQ;AAAA,EACb,OAAO;AAAA,EACP,UAAU;AAAA,IACR,UAAU;AAAA,MACR,aAAa;AAAA,IACf;AAAA,IACA,SAAS;AAAA,MACP,aAAa;AAAA,MACb,SAAS,CAAC,WAAW,cAAc;AAAA,MACnC,cAAc;AAAA,MACd,SAAS,EAAE,MAAM,SAAS;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,EACX;AAAA,EACA,YAAY;AAAA,IACV,MAAM;AAAA,MACJ,aAAa;AAAA,QACX,WAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF;AACF;AAEO,MAAM,UAAU,cAAc,KAAK,CAAC,CAAC;",
|
|
6
|
+
"names": ["React", "Carousel"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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 bullets_exports = {};
|
|
30
|
+
__export(bullets_exports, {
|
|
31
|
+
default: () => bullets_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(bullets_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_react_spring = require("react-spring");
|
|
36
|
+
var import_styled_components = require("styled-components");
|
|
37
|
+
var import_types = require("./types");
|
|
38
|
+
const defaultBulletStyle = {
|
|
39
|
+
height: "6px",
|
|
40
|
+
borderRadius: "1000px",
|
|
41
|
+
marginRight: "4px",
|
|
42
|
+
opacity: 1
|
|
43
|
+
};
|
|
44
|
+
const useBulletStyles = () => {
|
|
45
|
+
const { colors } = (0, import_styled_components.useTheme)();
|
|
46
|
+
const BulletStyle = {
|
|
47
|
+
[import_types.ItemStatus.active]: {
|
|
48
|
+
...defaultBulletStyle,
|
|
49
|
+
width: "16px",
|
|
50
|
+
backgroundColor: colors.opacityDefault.c80
|
|
51
|
+
},
|
|
52
|
+
[import_types.ItemStatus.nearby]: {
|
|
53
|
+
...defaultBulletStyle,
|
|
54
|
+
width: "8px",
|
|
55
|
+
backgroundColor: colors.opacityDefault.c30
|
|
56
|
+
},
|
|
57
|
+
[import_types.ItemStatus.far]: {
|
|
58
|
+
...defaultBulletStyle,
|
|
59
|
+
width: "4px",
|
|
60
|
+
backgroundColor: colors.opacityDefault.c10
|
|
61
|
+
},
|
|
62
|
+
[import_types.ItemStatus.none]: {
|
|
63
|
+
...defaultBulletStyle,
|
|
64
|
+
width: "0px",
|
|
65
|
+
opacity: 0,
|
|
66
|
+
backgroundColor: colors.opacityDefault.c10,
|
|
67
|
+
marginRight: "0px"
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
return BulletStyle;
|
|
71
|
+
};
|
|
72
|
+
const Bullet = ({ type }) => {
|
|
73
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react_spring.animated.div, { style: (0, import_react_spring.useSpring)(useBulletStyles()[type]) });
|
|
74
|
+
};
|
|
75
|
+
var bullets_default = Bullet;
|
|
76
|
+
//# sourceMappingURL=bullets.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/components/layout/Carousel/Footer/Pagination/bullets.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from \"react\";\nimport { animated, useSpring } from \"react-spring\";\nimport { useTheme } from \"styled-components\";\nimport { ItemStatus } from \"./types\";\n\nconst defaultBulletStyle = {\n height: \"6px\",\n borderRadius: \"1000px\",\n marginRight: \"4px\",\n opacity: 1,\n};\n\nconst useBulletStyles = () => {\n const { colors } = useTheme();\n\n const BulletStyle: {\n [key in ItemStatus]: {\n width: string;\n height: string;\n backgroundColor: string;\n borderRadius: string;\n opacity?: number;\n marginRight: string;\n };\n } = {\n [ItemStatus.active]: {\n ...defaultBulletStyle,\n width: \"16px\",\n backgroundColor: colors.opacityDefault.c80,\n },\n [ItemStatus.nearby]: {\n ...defaultBulletStyle,\n width: \"8px\",\n backgroundColor: colors.opacityDefault.c30,\n },\n [ItemStatus.far]: {\n ...defaultBulletStyle,\n width: \"4px\",\n backgroundColor: colors.opacityDefault.c10,\n },\n [ItemStatus.none]: {\n ...defaultBulletStyle,\n width: \"0px\",\n opacity: 0,\n backgroundColor: colors.opacityDefault.c10,\n marginRight: \"0px\",\n },\n };\n\n return BulletStyle;\n};\n\nconst Bullet = ({ type }: { type: ItemStatus }) => {\n return <animated.div style={useSpring(useBulletStyles()[type])} />;\n};\n\nexport default Bullet;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,0BAAoC;AACpC,+BAAyB;AACzB,mBAA2B;AAE3B,MAAM,qBAAqB;AAAA,EACzB,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,aAAa;AAAA,EACb,SAAS;AACX;AAEA,MAAM,kBAAkB,MAAM;AAC5B,QAAM,EAAE,OAAO,QAAI,mCAAS;AAE5B,QAAM,cASF;AAAA,IACF,CAAC,wBAAW,MAAM,GAAG;AAAA,MACnB,GAAG;AAAA,MACH,OAAO;AAAA,MACP,iBAAiB,OAAO,eAAe;AAAA,IACzC;AAAA,IACA,CAAC,wBAAW,MAAM,GAAG;AAAA,MACnB,GAAG;AAAA,MACH,OAAO;AAAA,MACP,iBAAiB,OAAO,eAAe;AAAA,IACzC;AAAA,IACA,CAAC,wBAAW,GAAG,GAAG;AAAA,MAChB,GAAG;AAAA,MACH,OAAO;AAAA,MACP,iBAAiB,OAAO,eAAe;AAAA,IACzC;AAAA,IACA,CAAC,wBAAW,IAAI,GAAG;AAAA,MACjB,GAAG;AAAA,MACH,OAAO;AAAA,MACP,SAAS;AAAA,MACT,iBAAiB,OAAO,eAAe;AAAA,MACvC,aAAa;AAAA,IACf;AAAA,EACF;AAEA,SAAO;AACT;AAEA,MAAM,SAAS,CAAC,EAAE,KAAK,MAA4B;AACjD,SAAO,6BAAAA,QAAA,cAAC,6BAAS,KAAT,EAAa,WAAO,+BAAU,gBAAgB,EAAE,IAAI,CAAC,GAAG;AAClE;AAEA,IAAO,kBAAQ;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
package/lib/cjs/components/{cards/Carousel/Slide.js → layout/Carousel/Footer/Pagination/index.js}
RENAMED
|
@@ -26,28 +26,21 @@ 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 Pagination_exports = {};
|
|
30
|
+
__export(Pagination_exports, {
|
|
31
|
+
default: () => Pagination_default
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(Pagination_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
|
-
|
|
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;
|
|
36
|
+
var import_bullets = __toESM(require("./bullets"));
|
|
37
|
+
var import_utils = require("./utils");
|
|
38
|
+
const FooterCarouselBullets = import_styled_components.default.div`
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
48
41
|
`;
|
|
49
|
-
const
|
|
50
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
42
|
+
const Pagination = ({ children, currentIndex }) => {
|
|
43
|
+
return /* @__PURE__ */ import_react.default.createElement(FooterCarouselBullets, null, children.map((child, index) => /* @__PURE__ */ import_react.default.createElement(import_bullets.default, { key: child.key, type: (0, import_utils.getItemStatus)(index, currentIndex) })));
|
|
51
44
|
};
|
|
52
|
-
var
|
|
53
|
-
//# sourceMappingURL=
|
|
45
|
+
var Pagination_default = Pagination;
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/components/layout/Carousel/Footer/Pagination/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from \"react\";\nimport styled from \"styled-components\";\nimport { SubProps } from \"../../types\";\nimport Bullet from \"./bullets\";\nimport { getItemStatus } from \"./utils\";\n\nconst FooterCarouselBullets = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst Pagination = ({ children, currentIndex }: SubProps) => {\n return (\n <FooterCarouselBullets>\n {children.map((child, index) => (\n <Bullet key={child.key} type={getItemStatus(index, currentIndex)} />\n ))}\n </FooterCarouselBullets>\n );\n};\n\nexport default Pagination;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,+BAAmB;AAEnB,qBAAmB;AACnB,mBAA8B;AAE9B,MAAM,wBAAwB,yBAAAA,QAAO;AAAA;AAAA;AAAA;AAKrC,MAAM,aAAa,CAAC,EAAE,UAAU,aAAa,MAAgB;AAC3D,SACE,6BAAAC,QAAA,cAAC,6BACE,SAAS,IAAI,CAAC,OAAO,UACpB,6BAAAA,QAAA,cAAC,eAAAC,SAAA,EAAO,KAAK,MAAM,KAAK,UAAM,4BAAc,OAAO,YAAY,GAAG,CACnE,CACH;AAEJ;AAEA,IAAO,qBAAQ;",
|
|
6
|
+
"names": ["styled", "React", "Bullet"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var types_exports = {};
|
|
20
|
+
__export(types_exports, {
|
|
21
|
+
ItemStatus: () => ItemStatus
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(types_exports);
|
|
24
|
+
var ItemStatus = /* @__PURE__ */ ((ItemStatus2) => {
|
|
25
|
+
ItemStatus2[ItemStatus2["active"] = 0] = "active";
|
|
26
|
+
ItemStatus2[ItemStatus2["nearby"] = 1] = "nearby";
|
|
27
|
+
ItemStatus2[ItemStatus2["far"] = 2] = "far";
|
|
28
|
+
ItemStatus2[ItemStatus2["none"] = 3] = "none";
|
|
29
|
+
return ItemStatus2;
|
|
30
|
+
})(ItemStatus || {});
|
|
31
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/components/layout/Carousel/Footer/Pagination/types.ts"],
|
|
4
|
+
"sourcesContent": ["export enum ItemStatus {\n \"active\",\n \"nearby\",\n \"far\",\n \"none\",\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAK,aAAL,kBAAKA,gBAAL;AACL,EAAAA,wBAAA;AACA,EAAAA,wBAAA;AACA,EAAAA,wBAAA;AACA,EAAAA,wBAAA;AAJU,SAAAA;AAAA,GAAA;",
|
|
6
|
+
"names": ["ItemStatus"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var utils_exports = {};
|
|
20
|
+
__export(utils_exports, {
|
|
21
|
+
getItemStatus: () => getItemStatus
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(utils_exports);
|
|
24
|
+
var import_types = require("./types");
|
|
25
|
+
const getItemStatus = (itemIndex, activeIndex) => {
|
|
26
|
+
const itemDistanceFromActiveIndex = Math.abs(itemIndex - activeIndex);
|
|
27
|
+
switch (itemDistanceFromActiveIndex) {
|
|
28
|
+
case 0:
|
|
29
|
+
return import_types.ItemStatus.active;
|
|
30
|
+
case 1:
|
|
31
|
+
return import_types.ItemStatus.nearby;
|
|
32
|
+
case 2:
|
|
33
|
+
return import_types.ItemStatus.far;
|
|
34
|
+
default:
|
|
35
|
+
return import_types.ItemStatus.none;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/components/layout/Carousel/Footer/Pagination/utils.ts"],
|
|
4
|
+
"sourcesContent": ["import { ItemStatus } from \"./types\";\n\n/**\n * Returns the status of an indexed item from the carousel index.\n */\nexport const getItemStatus = (itemIndex: number, activeIndex: number) => {\n const itemDistanceFromActiveIndex = Math.abs(itemIndex - activeIndex);\n\n switch (itemDistanceFromActiveIndex) {\n case 0:\n return ItemStatus.active;\n case 1:\n return ItemStatus.nearby;\n case 2:\n return ItemStatus.far;\n default:\n return ItemStatus.none;\n }\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2B;AAKpB,MAAM,gBAAgB,CAAC,WAAmB,gBAAwB;AACvE,QAAM,8BAA8B,KAAK,IAAI,YAAY,WAAW;AAEpE,UAAQ,6BAA6B;AAAA,IACnC,KAAK;AACH,aAAO,wBAAW;AAAA,IACpB,KAAK;AACH,aAAO,wBAAW;AAAA,IACpB,KAAK;AACH,aAAO,wBAAW;AAAA,IACpB;AACE,aAAO,wBAAW;AAAA,EACtB;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -26,10 +26,21 @@ 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 Footer_exports = {};
|
|
30
|
+
__export(Footer_exports, {
|
|
31
|
+
default: () => Footer_default
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(Footer_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
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;
|
|
35
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/layout/Carousel/Footer/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import React, { FC } from \"react\";\nimport { SubProps, Variant } from \"../types\";\nimport FooterContentCard from \"./variantContentCard\";\nimport FooterDefault from \"./variantDefault\";\n\nconst Footers: { [key in Variant]: FC<SubProps> } = {\n \"content-card\": FooterContentCard,\n default: FooterDefault,\n};\n\nconst Footer = (props: SubProps) => {\n const Component = Footers[props.variant];\n return <Component {...props} />;\n};\n\nexport default Footer;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B;AAE1B,gCAA8B;AAC9B,4BAA0B;AAE1B,MAAM,UAA8C;AAAA,EAClD,gBAAgB,0BAAAA;AAAA,EAChB,SAAS,sBAAAC;AACX;AAEA,MAAM,SAAS,CAAC,UAAoB;AAClC,QAAM,YAAY,QAAQ,MAAM,OAAO;AACvC,SAAO,6BAAAC,QAAA,cAAC,aAAW,GAAG,OAAO;AAC/B;AAEA,IAAO,iBAAQ;",
|
|
6
|
+
"names": ["FooterContentCard", "FooterDefault", "React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 variantContentCard_exports = {};
|
|
30
|
+
__export(variantContentCard_exports, {
|
|
31
|
+
default: () => variantContentCard_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(variantContentCard_exports);
|
|
34
|
+
var import_react = require("@ledgerhq/icons-ui/react");
|
|
35
|
+
var import_react2 = __toESM(require("react"));
|
|
36
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
37
|
+
var import_Pagination = __toESM(require("./Pagination"));
|
|
38
|
+
const FooterContainer = import_styled_components.default.div`
|
|
39
|
+
height: 32px;
|
|
40
|
+
border-top: 1px solid ${(p) => p.theme.colors.opacityDefault.c10};
|
|
41
|
+
display: flex;
|
|
42
|
+
justify-content: space-between;
|
|
43
|
+
padding: 6px 16px 6px 16px;
|
|
44
|
+
`;
|
|
45
|
+
const FooterArrowsContainer = import_styled_components.default.div`
|
|
46
|
+
display: flex;
|
|
47
|
+
gap: 8px;
|
|
48
|
+
align-items: center;
|
|
49
|
+
`;
|
|
50
|
+
const FooterArrowContainer = import_styled_components.default.div`
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
`;
|
|
55
|
+
const FooterContentCard = ({ children, emblaApi, currentIndex, variant }) => {
|
|
56
|
+
return /* @__PURE__ */ import_react2.default.createElement(FooterContainer, null, /* @__PURE__ */ import_react2.default.createElement(
|
|
57
|
+
import_Pagination.default,
|
|
58
|
+
{
|
|
59
|
+
variant,
|
|
60
|
+
children,
|
|
61
|
+
emblaApi,
|
|
62
|
+
currentIndex
|
|
63
|
+
}
|
|
64
|
+
), /* @__PURE__ */ import_react2.default.createElement(FooterArrowsContainer, null, /* @__PURE__ */ import_react2.default.createElement(FooterArrowContainer, { onClick: () => emblaApi == null ? void 0 : emblaApi.scrollPrev() }, /* @__PURE__ */ import_react2.default.createElement(import_react.ArrowLeft, { size: "S" })), /* @__PURE__ */ import_react2.default.createElement(FooterArrowContainer, { onClick: () => emblaApi == null ? void 0 : emblaApi.scrollNext() }, /* @__PURE__ */ import_react2.default.createElement(import_react.ArrowRight, { size: "S" }))));
|
|
65
|
+
};
|
|
66
|
+
var variantContentCard_default = FooterContentCard;
|
|
67
|
+
//# sourceMappingURL=variantContentCard.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/layout/Carousel/Footer/variantContentCard.tsx"],
|
|
4
|
+
"sourcesContent": ["import { ArrowLeft, ArrowRight } from \"@ledgerhq/icons-ui/react\";\nimport React from \"react\";\nimport styled from \"styled-components\";\nimport Pagination from \"./Pagination\";\nimport { SubProps } from \"../types\";\n\nconst FooterContainer = styled.div`\n height: 32px;\n border-top: 1px solid ${p => p.theme.colors.opacityDefault.c10};\n display: flex;\n justify-content: space-between;\n padding: 6px 16px 6px 16px;\n`;\n\nconst FooterArrowsContainer = styled.div`\n display: flex;\n gap: 8px;\n align-items: center;\n`;\n\nconst FooterArrowContainer = styled.div`\n display: flex;\n align-items: center;\n cursor: pointer;\n`;\n\nconst FooterContentCard = ({ children, emblaApi, currentIndex, variant }: SubProps) => {\n return (\n <FooterContainer>\n <Pagination\n variant={variant}\n children={children}\n emblaApi={emblaApi}\n currentIndex={currentIndex}\n />\n\n <FooterArrowsContainer>\n <FooterArrowContainer onClick={() => emblaApi?.scrollPrev()}>\n <ArrowLeft size=\"S\" />\n </FooterArrowContainer>\n <FooterArrowContainer onClick={() => emblaApi?.scrollNext()}>\n <ArrowRight size=\"S\" />\n </FooterArrowContainer>\n </FooterArrowsContainer>\n </FooterContainer>\n );\n};\n\nexport default FooterContentCard;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsC;AACtC,IAAAA,gBAAkB;AAClB,+BAAmB;AACnB,wBAAuB;AAGvB,MAAM,kBAAkB,yBAAAC,QAAO;AAAA;AAAA,0BAEL,OAAK,EAAE,MAAM,OAAO,eAAe,GAAG;AAAA;AAAA;AAAA;AAAA;AAMhE,MAAM,wBAAwB,yBAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAMrC,MAAM,uBAAuB,yBAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAMpC,MAAM,oBAAoB,CAAC,EAAE,UAAU,UAAU,cAAc,QAAQ,MAAgB;AACrF,SACE,8BAAAC,QAAA,cAAC,uBACC,8BAAAA,QAAA;AAAA,IAAC,kBAAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF,GAEA,8BAAAD,QAAA,cAAC,6BACC,8BAAAA,QAAA,cAAC,wBAAqB,SAAS,MAAM,qCAAU,gBAC7C,8BAAAA,QAAA,cAAC,0BAAU,MAAK,KAAI,CACtB,GACA,8BAAAA,QAAA,cAAC,wBAAqB,SAAS,MAAM,qCAAU,gBAC7C,8BAAAA,QAAA,cAAC,2BAAW,MAAK,KAAI,CACvB,CACF,CACF;AAEJ;AAEA,IAAO,6BAAQ;",
|
|
6
|
+
"names": ["import_react", "styled", "React", "Pagination"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 variantDefault_exports = {};
|
|
30
|
+
__export(variantDefault_exports, {
|
|
31
|
+
default: () => variantDefault_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(variantDefault_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
36
|
+
var import_Pagination = __toESM(require("./Pagination"));
|
|
37
|
+
const FooterContainer = import_styled_components.default.div`
|
|
38
|
+
height: 32px;
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
align-items: center;
|
|
42
|
+
`;
|
|
43
|
+
const FooterDefault = (props) => {
|
|
44
|
+
return /* @__PURE__ */ import_react.default.createElement(FooterContainer, null, /* @__PURE__ */ import_react.default.createElement(import_Pagination.default, { ...props }));
|
|
45
|
+
};
|
|
46
|
+
var variantDefault_default = FooterDefault;
|
|
47
|
+
//# sourceMappingURL=variantDefault.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/layout/Carousel/Footer/variantDefault.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from \"react\";\nimport styled from \"styled-components\";\nimport Pagination from \"./Pagination\";\nimport { SubProps } from \"../types\";\n\nconst FooterContainer = styled.div`\n height: 32px;\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nconst FooterDefault = (props: SubProps) => {\n return (\n <FooterContainer>\n <Pagination {...props} />\n </FooterContainer>\n );\n};\n\nexport default FooterDefault;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,+BAAmB;AACnB,wBAAuB;AAGvB,MAAM,kBAAkB,yBAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAO/B,MAAM,gBAAgB,CAAC,UAAoB;AACzC,SACE,6BAAAC,QAAA,cAAC,uBACC,6BAAAA,QAAA,cAAC,kBAAAC,SAAA,EAAY,GAAG,OAAO,CACzB;AAEJ;AAEA,IAAO,yBAAQ;",
|
|
6
|
+
"names": ["styled", "React", "Pagination"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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_embla_carousel_react = __toESM(require("embla-carousel-react"));
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
37
|
+
var import_Footer = __toESM(require("./Footer"));
|
|
38
|
+
const Embla = import_styled_components.default.div`
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
`;
|
|
41
|
+
const EmblaContainer = import_styled_components.default.div`
|
|
42
|
+
display: flex;
|
|
43
|
+
`;
|
|
44
|
+
const EmblaSlide = import_styled_components.default.div`
|
|
45
|
+
flex: 0 0 100%;
|
|
46
|
+
min-width: 0;
|
|
47
|
+
`;
|
|
48
|
+
const Carousel = ({ children, variant = "default" }) => {
|
|
49
|
+
const [currentIndex, setCurrentIndex] = (0, import_react.useState)(0);
|
|
50
|
+
const [emblaRef, emblaApi] = (0, import_embla_carousel_react.default)({ loop: true });
|
|
51
|
+
const updateIndex = (0, import_react.useCallback)(() => {
|
|
52
|
+
if (!emblaApi)
|
|
53
|
+
return;
|
|
54
|
+
const newIndex = emblaApi.selectedScrollSnap();
|
|
55
|
+
setCurrentIndex(newIndex);
|
|
56
|
+
emblaApi.scrollTo(newIndex);
|
|
57
|
+
}, [emblaApi]);
|
|
58
|
+
(0, import_react.useEffect)(() => {
|
|
59
|
+
if (!emblaApi)
|
|
60
|
+
return;
|
|
61
|
+
updateIndex();
|
|
62
|
+
emblaApi.on("select", updateIndex);
|
|
63
|
+
emblaApi.on("reInit", updateIndex);
|
|
64
|
+
}, [emblaApi, updateIndex]);
|
|
65
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(Embla, { ref: emblaRef }, /* @__PURE__ */ import_react.default.createElement(EmblaContainer, null, children.map((child) => /* @__PURE__ */ import_react.default.createElement(EmblaSlide, { key: child.key }, child)))), /* @__PURE__ */ import_react.default.createElement(
|
|
66
|
+
import_Footer.default,
|
|
67
|
+
{
|
|
68
|
+
children,
|
|
69
|
+
variant,
|
|
70
|
+
emblaApi,
|
|
71
|
+
currentIndex
|
|
72
|
+
}
|
|
73
|
+
));
|
|
74
|
+
};
|
|
75
|
+
var Carousel_default = Carousel;
|
|
76
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/layout/Carousel/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import useEmblaCarousel from \"embla-carousel-react\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport styled from \"styled-components\";\nimport Footer from \"./Footer\";\nimport { Props } from \"./types\";\n\nconst Embla = styled.div`\n overflow: hidden;\n`;\n\nconst EmblaContainer = styled.div`\n display: flex;\n`;\n\nconst EmblaSlide = styled.div`\n flex: 0 0 100%;\n min-width: 0;\n`;\n\n/**\n * This component uses the https://github.com/davidjerleke/embla-carousel library.\n */\nconst Carousel = ({ children, variant = \"default\" }: Props) => {\n const [currentIndex, setCurrentIndex] = useState(0);\n const [emblaRef, emblaApi] = useEmblaCarousel({ loop: true });\n\n const updateIndex = useCallback(() => {\n if (!emblaApi) return;\n\n const newIndex = emblaApi.selectedScrollSnap();\n setCurrentIndex(newIndex);\n emblaApi.scrollTo(newIndex);\n }, [emblaApi]);\n\n useEffect(() => {\n if (!emblaApi) return;\n\n // Initial call to update carousel index\n updateIndex();\n\n // When the selected scroll snap changes\n emblaApi.on(\"select\", updateIndex);\n\n // When `reInit` is called or when window is resized\n emblaApi.on(\"reInit\", updateIndex);\n }, [emblaApi, updateIndex]);\n\n return (\n <div>\n <Embla ref={emblaRef}>\n <EmblaContainer>\n {children.map(child => (\n <EmblaSlide key={child.key}>{child}</EmblaSlide>\n ))}\n </EmblaContainer>\n </Embla>\n\n <Footer\n children={children}\n variant={variant}\n emblaApi={emblaApi}\n currentIndex={currentIndex}\n />\n </div>\n );\n};\nexport default Carousel;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kCAA6B;AAC7B,mBAAwD;AACxD,+BAAmB;AACnB,oBAAmB;AAGnB,MAAM,QAAQ,yBAAAA,QAAO;AAAA;AAAA;AAIrB,MAAM,iBAAiB,yBAAAA,QAAO;AAAA;AAAA;AAI9B,MAAM,aAAa,yBAAAA,QAAO;AAAA;AAAA;AAAA;AAQ1B,MAAM,WAAW,CAAC,EAAE,UAAU,UAAU,UAAU,MAAa;AAC7D,QAAM,CAAC,cAAc,eAAe,QAAI,uBAAS,CAAC;AAClD,QAAM,CAAC,UAAU,QAAQ,QAAI,4BAAAC,SAAiB,EAAE,MAAM,KAAK,CAAC;AAE5D,QAAM,kBAAc,0BAAY,MAAM;AACpC,QAAI,CAAC;AAAU;AAEf,UAAM,WAAW,SAAS,mBAAmB;AAC7C,oBAAgB,QAAQ;AACxB,aAAS,SAAS,QAAQ;AAAA,EAC5B,GAAG,CAAC,QAAQ,CAAC;AAEb,8BAAU,MAAM;AACd,QAAI,CAAC;AAAU;AAGf,gBAAY;AAGZ,aAAS,GAAG,UAAU,WAAW;AAGjC,aAAS,GAAG,UAAU,WAAW;AAAA,EACnC,GAAG,CAAC,UAAU,WAAW,CAAC;AAE1B,SACE,6BAAAC,QAAA,cAAC,aACC,6BAAAA,QAAA,cAAC,SAAM,KAAK,YACV,6BAAAA,QAAA,cAAC,sBACE,SAAS,IAAI,WACZ,6BAAAA,QAAA,cAAC,cAAW,KAAK,MAAM,OAAM,KAAM,CACpC,CACH,CACF,GAEA,6BAAAA,QAAA;AAAA,IAAC,cAAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF,CACF;AAEJ;AACA,IAAO,mBAAQ;",
|
|
6
|
+
"names": ["styled", "useEmblaCarousel", "React", "Footer"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
|
17
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/layout/Carousel/types.tsx"],
|
|
4
|
+
"sourcesContent": ["import { ReactElement } from \"react\";\nimport { UseEmblaCarouselType } from \"embla-carousel-react\";\n\nexport type Variant = \"content-card\" | \"default\";\n\nexport type Props = {\n children: ReactElement[];\n variant?: Variant;\n};\n\n/**\n * Carousel's sub props to be passed to any component used by the carousel..\n */\nexport type SubProps = Required<Props> & {\n emblaApi: UseEmblaCarouselType[1];\n currentIndex: number;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|