@ledgerhq/react-ui 0.14.15-start-exchange.0 → 0.14.15
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 +69 -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 +34 -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
|
@@ -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
|
+
}
|
|
@@ -29,6 +29,7 @@ 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,
|
|
32
33
|
Drawer: () => import_Drawer.default,
|
|
33
34
|
Flex: () => import_Flex.default,
|
|
34
35
|
Grid: () => import_Grid.default,
|
|
@@ -43,5 +44,6 @@ var import_Grid = __toESM(require("./Grid"));
|
|
|
43
44
|
var import_Popin = __toESM(require("./Popin"));
|
|
44
45
|
var import_Side = __toESM(require("./Side"));
|
|
45
46
|
var import_Drawer = __toESM(require("./Drawer"));
|
|
47
|
+
var import_Carousel = __toESM(require("./Carousel"));
|
|
46
48
|
var import_VerticalTimeline = __toESM(require("./List/VerticalTimeline"));
|
|
47
49
|
//# 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 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;",
|
|
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 Carousel } from \"./Carousel\";\nexport { default as VerticalTimeline } from \"./List/VerticalTimeline\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;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,sBAAoC;AACpC,8BAA4C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { animated, useSpring } from "react-spring";
|
|
3
|
+
import { useTheme } from "styled-components";
|
|
4
|
+
import { ItemStatus } from "./types";
|
|
5
|
+
const defaultBulletStyle = {
|
|
6
|
+
height: "6px",
|
|
7
|
+
borderRadius: "1000px",
|
|
8
|
+
marginRight: "4px",
|
|
9
|
+
opacity: 1,
|
|
10
|
+
};
|
|
11
|
+
const useBulletStyles = () => {
|
|
12
|
+
const { colors } = useTheme();
|
|
13
|
+
const BulletStyle = {
|
|
14
|
+
[ItemStatus.active]: Object.assign(Object.assign({}, defaultBulletStyle), { width: "16px", backgroundColor: colors.opacityDefault.c80 }),
|
|
15
|
+
[ItemStatus.nearby]: Object.assign(Object.assign({}, defaultBulletStyle), { width: "8px", backgroundColor: colors.opacityDefault.c30 }),
|
|
16
|
+
[ItemStatus.far]: Object.assign(Object.assign({}, defaultBulletStyle), { width: "4px", backgroundColor: colors.opacityDefault.c10 }),
|
|
17
|
+
[ItemStatus.none]: Object.assign(Object.assign({}, defaultBulletStyle), { width: "0px", opacity: 0, backgroundColor: colors.opacityDefault.c10, marginRight: "0px" }),
|
|
18
|
+
};
|
|
19
|
+
return BulletStyle;
|
|
20
|
+
};
|
|
21
|
+
const Bullet = ({ type }) => {
|
|
22
|
+
return React.createElement(animated.div, { style: useSpring(useBulletStyles()[type]) });
|
|
23
|
+
};
|
|
24
|
+
export default Bullet;
|
|
25
|
+
//# sourceMappingURL=bullets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bullets.js","sourceRoot":"","sources":["../../../../../../src/components/layout/Carousel/Footer/Pagination/bullets.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,kBAAkB,GAAG;IACzB,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,QAAQ;IACtB,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,CAAC;CACX,CAAC;AAEF,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAC;IAE9B,MAAM,WAAW,GASb;QACF,CAAC,UAAU,CAAC,MAAM,CAAC,kCACd,kBAAkB,KACrB,KAAK,EAAE,MAAM,EACb,eAAe,EAAE,MAAM,CAAC,cAAc,CAAC,GAAG,GAC3C;QACD,CAAC,UAAU,CAAC,MAAM,CAAC,kCACd,kBAAkB,KACrB,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,MAAM,CAAC,cAAc,CAAC,GAAG,GAC3C;QACD,CAAC,UAAU,CAAC,GAAG,CAAC,kCACX,kBAAkB,KACrB,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,MAAM,CAAC,cAAc,CAAC,GAAG,GAC3C;QACD,CAAC,UAAU,CAAC,IAAI,CAAC,kCACZ,kBAAkB,KACrB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,CAAC,EACV,eAAe,EAAE,MAAM,CAAC,cAAc,CAAC,GAAG,EAC1C,WAAW,EAAE,KAAK,GACnB;KACF,CAAC;IAEF,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,EAAE,IAAI,EAAwB,EAAE,EAAE;IAChD,OAAO,oBAAC,QAAQ,CAAC,GAAG,IAAC,KAAK,EAAE,SAAS,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,CAAC,GAAI,CAAC;AACrE,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import Bullet from "./bullets";
|
|
4
|
+
import { getItemStatus } from "./utils";
|
|
5
|
+
const FooterCarouselBullets = styled.div `
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
`;
|
|
9
|
+
const Pagination = ({ children, currentIndex }) => {
|
|
10
|
+
return (React.createElement(FooterCarouselBullets, null, children.map((child, index) => (React.createElement(Bullet, { key: child.key, type: getItemStatus(index, currentIndex) })))));
|
|
11
|
+
};
|
|
12
|
+
export default Pagination;
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/layout/Carousel/Footer/Pagination/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGvC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAY,EAAE,EAAE;IAC1D,OAAO,CACL,oBAAC,qBAAqB,QACnB,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC9B,oBAAC,MAAM,IAAC,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,YAAY,CAAC,GAAI,CACrE,CAAC,CACoB,CACzB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export var ItemStatus;
|
|
2
|
+
(function (ItemStatus) {
|
|
3
|
+
ItemStatus[ItemStatus["active"] = 0] = "active";
|
|
4
|
+
ItemStatus[ItemStatus["nearby"] = 1] = "nearby";
|
|
5
|
+
ItemStatus[ItemStatus["far"] = 2] = "far";
|
|
6
|
+
ItemStatus[ItemStatus["none"] = 3] = "none";
|
|
7
|
+
})(ItemStatus || (ItemStatus = {}));
|
|
8
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/components/layout/Carousel/Footer/Pagination/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,+CAAQ,CAAA;IACR,+CAAQ,CAAA;IACR,yCAAK,CAAA;IACL,2CAAM,CAAA;AACR,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ItemStatus } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the status of an indexed item from the carousel index.
|
|
4
|
+
*/
|
|
5
|
+
export const getItemStatus = (itemIndex, activeIndex) => {
|
|
6
|
+
const itemDistanceFromActiveIndex = Math.abs(itemIndex - activeIndex);
|
|
7
|
+
switch (itemDistanceFromActiveIndex) {
|
|
8
|
+
case 0:
|
|
9
|
+
return ItemStatus.active;
|
|
10
|
+
case 1:
|
|
11
|
+
return ItemStatus.nearby;
|
|
12
|
+
case 2:
|
|
13
|
+
return ItemStatus.far;
|
|
14
|
+
default:
|
|
15
|
+
return ItemStatus.none;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../src/components/layout/Carousel/Footer/Pagination/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAiB,EAAE,WAAmB,EAAE,EAAE;IACtE,MAAM,2BAA2B,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,WAAW,CAAC,CAAC;IAEtE,QAAQ,2BAA2B,EAAE;QACnC,KAAK,CAAC;YACJ,OAAO,UAAU,CAAC,MAAM,CAAC;QAC3B,KAAK,CAAC;YACJ,OAAO,UAAU,CAAC,MAAM,CAAC;QAC3B,KAAK,CAAC;YACJ,OAAO,UAAU,CAAC,GAAG,CAAC;QACxB;YACE,OAAO,UAAU,CAAC,IAAI,CAAC;KAC1B;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import FooterContentCard from "./variantContentCard";
|
|
3
|
+
import FooterDefault from "./variantDefault";
|
|
4
|
+
const Footers = {
|
|
5
|
+
"content-card": FooterContentCard,
|
|
6
|
+
default: FooterDefault,
|
|
7
|
+
};
|
|
8
|
+
const Footer = (props) => {
|
|
9
|
+
const Component = Footers[props.variant];
|
|
10
|
+
return React.createElement(Component, Object.assign({}, props));
|
|
11
|
+
};
|
|
12
|
+
export default Footer;
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/layout/Carousel/Footer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAC;AAElC,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,MAAM,OAAO,GAAuC;IAClD,cAAc,EAAE,iBAAiB;IACjC,OAAO,EAAE,aAAa;CACvB,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,KAAe,EAAE,EAAE;IACjC,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzC,OAAO,oBAAC,SAAS,oBAAK,KAAK,EAAI,CAAC;AAClC,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ArrowLeft, ArrowRight } from "@ledgerhq/icons-ui/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import Pagination from "./Pagination";
|
|
5
|
+
const FooterContainer = styled.div `
|
|
6
|
+
height: 32px;
|
|
7
|
+
border-top: 1px solid ${p => p.theme.colors.opacityDefault.c10};
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
padding: 6px 16px 6px 16px;
|
|
11
|
+
`;
|
|
12
|
+
const FooterArrowsContainer = styled.div `
|
|
13
|
+
display: flex;
|
|
14
|
+
gap: 8px;
|
|
15
|
+
align-items: center;
|
|
16
|
+
`;
|
|
17
|
+
const FooterArrowContainer = styled.div `
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
`;
|
|
22
|
+
const FooterContentCard = ({ children, emblaApi, currentIndex, variant }) => {
|
|
23
|
+
if (children.length === 1)
|
|
24
|
+
return null;
|
|
25
|
+
return (React.createElement(FooterContainer, null,
|
|
26
|
+
React.createElement(Pagination, { variant: variant, children: children, emblaApi: emblaApi, currentIndex: currentIndex }),
|
|
27
|
+
React.createElement(FooterArrowsContainer, null,
|
|
28
|
+
React.createElement(FooterArrowContainer, { onClick: () => emblaApi === null || emblaApi === void 0 ? void 0 : emblaApi.scrollPrev() },
|
|
29
|
+
React.createElement(ArrowLeft, { size: "S" })),
|
|
30
|
+
React.createElement(FooterArrowContainer, { onClick: () => emblaApi === null || emblaApi === void 0 ? void 0 : emblaApi.scrollNext() },
|
|
31
|
+
React.createElement(ArrowRight, { size: "S" })))));
|
|
32
|
+
};
|
|
33
|
+
export default FooterContentCard;
|
|
34
|
+
//# sourceMappingURL=variantContentCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variantContentCard.js","sourceRoot":"","sources":["../../../../../src/components/layout/Carousel/Footer/variantContentCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,UAAU,MAAM,cAAc,CAAC;AAGtC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;0BAER,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG;;;;CAI/D,CAAC;AAEF,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIvC,CAAC;AAEF,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAItC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAY,EAAE,EAAE;IACpF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEvC,OAAO,CACL,oBAAC,eAAe;QACd,oBAAC,UAAU,IACT,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,GAC1B;QAEF,oBAAC,qBAAqB;YACpB,oBAAC,oBAAoB,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,EAAE;gBACzD,oBAAC,SAAS,IAAC,IAAI,EAAC,GAAG,GAAG,CACD;YACvB,oBAAC,oBAAoB,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,EAAE;gBACzD,oBAAC,UAAU,IAAC,IAAI,EAAC,GAAG,GAAG,CACF,CACD,CACR,CACnB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import Pagination from "./Pagination";
|
|
4
|
+
const FooterContainer = styled.div `
|
|
5
|
+
height: 32px;
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
`;
|
|
10
|
+
const FooterDefault = (props) => {
|
|
11
|
+
return (React.createElement(FooterContainer, null,
|
|
12
|
+
React.createElement(Pagination, Object.assign({}, props))));
|
|
13
|
+
};
|
|
14
|
+
export default FooterDefault;
|
|
15
|
+
//# sourceMappingURL=variantDefault.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variantDefault.js","sourceRoot":"","sources":["../../../../../src/components/layout/Carousel/Footer/variantDefault.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,UAAU,MAAM,cAAc,CAAC;AAGtC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAKjC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,KAAe,EAAE,EAAE;IACxC,OAAO,CACL,oBAAC,eAAe;QACd,oBAAC,UAAU,oBAAK,KAAK,EAAI,CACT,CACnB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import useEmblaCarousel from "embla-carousel-react";
|
|
2
|
+
import React, { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import Footer from "./Footer";
|
|
5
|
+
const Embla = styled.div `
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
`;
|
|
8
|
+
const EmblaContainer = styled.div `
|
|
9
|
+
display: flex;
|
|
10
|
+
`;
|
|
11
|
+
const EmblaSlide = styled.div `
|
|
12
|
+
flex: 0 0 100%;
|
|
13
|
+
min-width: 0;
|
|
14
|
+
`;
|
|
15
|
+
/**
|
|
16
|
+
* This component uses the https://github.com/davidjerleke/embla-carousel library.
|
|
17
|
+
*/
|
|
18
|
+
const Carousel = ({ children, variant = "default" }) => {
|
|
19
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
20
|
+
const [emblaRef, emblaApi] = useEmblaCarousel({ loop: true });
|
|
21
|
+
const updateIndex = useCallback(() => {
|
|
22
|
+
if (!emblaApi)
|
|
23
|
+
return;
|
|
24
|
+
const newIndex = emblaApi.selectedScrollSnap();
|
|
25
|
+
setCurrentIndex(newIndex);
|
|
26
|
+
emblaApi.scrollTo(newIndex);
|
|
27
|
+
}, [emblaApi]);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!emblaApi)
|
|
30
|
+
return;
|
|
31
|
+
// Initial call to update carousel index
|
|
32
|
+
updateIndex();
|
|
33
|
+
// When the selected scroll snap changes
|
|
34
|
+
emblaApi.on("select", updateIndex);
|
|
35
|
+
// When `reInit` is called or when window is resized
|
|
36
|
+
emblaApi.on("reInit", updateIndex);
|
|
37
|
+
}, [emblaApi, updateIndex]);
|
|
38
|
+
return (React.createElement("div", null,
|
|
39
|
+
React.createElement(Embla, { ref: emblaRef },
|
|
40
|
+
React.createElement(EmblaContainer, null, children.map(child => (React.createElement(EmblaSlide, { key: child.key }, child))))),
|
|
41
|
+
React.createElement(Footer, { children: children, variant: variant, emblaApi: emblaApi, currentIndex: currentIndex })));
|
|
42
|
+
};
|
|
43
|
+
export default Carousel;
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/layout/Carousel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,MAAM,MAAM,UAAU,CAAC;AAG9B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEvB,CAAC;AAEF,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEhC,CAAC;AAEF,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG5B,CAAC;AAEF;;GAEG;AACH,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAS,EAAE,EAAE;IAC5D,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACpD,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,gBAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAE9D,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE;QACnC,IAAI,CAAC,QAAQ;YAAE,OAAO;QAEtB,MAAM,QAAQ,GAAG,QAAQ,CAAC,kBAAkB,EAAE,CAAC;QAC/C,eAAe,CAAC,QAAQ,CAAC,CAAC;QAC1B,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,QAAQ;YAAE,OAAO;QAEtB,wCAAwC;QACxC,WAAW,EAAE,CAAC;QAEd,wCAAwC;QACxC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAEnC,oDAAoD;QACpD,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IACrC,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;IAE5B,OAAO,CACL;QACE,oBAAC,KAAK,IAAC,GAAG,EAAE,QAAQ;YAClB,oBAAC,cAAc,QACZ,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CACrB,oBAAC,UAAU,IAAC,GAAG,EAAE,KAAK,CAAC,GAAG,IAAG,KAAK,CAAc,CACjD,CAAC,CACa,CACX;QAER,oBAAC,MAAM,IACL,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,GAC1B,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { UseEmblaCarouselType } from "embla-carousel-react";
|
|
3
|
+
export type Variant = "content-card" | "default";
|
|
4
|
+
export type Props = {
|
|
5
|
+
children: ReactElement[];
|
|
6
|
+
variant?: Variant;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Carousel's sub props to be passed to any component used by the carousel..
|
|
10
|
+
*/
|
|
11
|
+
export type SubProps = Required<Props> & {
|
|
12
|
+
emblaApi: UseEmblaCarouselType[1];
|
|
13
|
+
currentIndex: number;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/layout/Carousel/types.tsx"],"names":[],"mappings":""}
|
|
@@ -4,4 +4,5 @@ export { default as Grid } from "./Grid";
|
|
|
4
4
|
export { default as Popin } from "./Popin";
|
|
5
5
|
export { default as Side } from "./Side";
|
|
6
6
|
export { default as Drawer } from "./Drawer";
|
|
7
|
+
export { default as Carousel } from "./Carousel";
|
|
7
8
|
export { default as VerticalTimeline } from "./List/VerticalTimeline";
|
|
@@ -4,5 +4,6 @@ export { default as Grid } from "./Grid";
|
|
|
4
4
|
export { default as Popin } from "./Popin";
|
|
5
5
|
export { default as Side } from "./Side";
|
|
6
6
|
export { default as Drawer } from "./Drawer";
|
|
7
|
+
export { default as Carousel } from "./Carousel";
|
|
7
8
|
export { default as VerticalTimeline } from "./List/VerticalTimeline";
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/react-ui",
|
|
3
|
-
"version": "0.14.15
|
|
3
|
+
"version": "0.14.15",
|
|
4
4
|
"description": "Ledger Live - Desktop UI",
|
|
5
5
|
"author": "Ledger Live Team <team-live@ledger.fr>",
|
|
6
6
|
"repository": {
|
|
@@ -61,14 +61,16 @@
|
|
|
61
61
|
"chart.js": "^3.5.1",
|
|
62
62
|
"chartjs-adapter-moment": "^1.0.0",
|
|
63
63
|
"color": "^4.0.0",
|
|
64
|
+
"embla-carousel-react": "8.0.0-rc17",
|
|
64
65
|
"moment": "^2.29.1",
|
|
65
66
|
"react-chartjs-2": "^3.3.0",
|
|
66
67
|
"react-is": "^17.0.2",
|
|
67
68
|
"react-select": "^5.2.1",
|
|
69
|
+
"react-spring": "8.0.27",
|
|
68
70
|
"react-transition-group": "^4.4.2",
|
|
69
71
|
"react-window": "^1.8.6",
|
|
70
72
|
"styled-system": "^5.1.5",
|
|
71
|
-
"@ledgerhq/crypto-icons-ui": "^1.0.2
|
|
73
|
+
"@ledgerhq/crypto-icons-ui": "^1.0.2",
|
|
72
74
|
"@ledgerhq/icons-ui": "^0.6.2",
|
|
73
75
|
"@ledgerhq/ui-shared": "^0.2.1"
|
|
74
76
|
},
|
|
@@ -100,6 +102,7 @@
|
|
|
100
102
|
"@types/styled-system": "^5.1.12",
|
|
101
103
|
"babel-loader": "^8.0.0",
|
|
102
104
|
"csstype": "^3.0.11",
|
|
105
|
+
"embla-carousel": "8.0.0-rc17",
|
|
103
106
|
"esbuild": "^0.19.0",
|
|
104
107
|
"eslint-plugin-react": "^7.33.2",
|
|
105
108
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
@@ -1,106 +0,0 @@
|
|
|
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
|
|
@@ -1,7 +0,0 @@
|
|
|
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;AAAA;AAAA,mBAAkB;AAElB,wBAAwB;AAExB,yBAAkB;AAClB,eAAiD;AAEjD,IAAO,2BAAQ;AAAA,EACb,OAAO;AAAA,EACP,UAAU;AAAA,IACR,aAAa;AAAA,MACX,aAAa;AAAA,MACb,SAAS;AAAA,QACP,MAAM;AAAA,QACN,cAAc,EAAE,SAAS,MAAM;AAAA,MACjC;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,aAAa;AAAA,MACb,SAAS;AAAA,QACP,MAAM;AAAA,QACN,KAAK;AAAA,QACL,KAAK;AAAA,QACL,cAAc,EAAE,SAAS,IAAK;AAAA,MAChC;AAAA,MACA,OAAO;AAAA,QACL,MAAM,EAAE,SAAS,SAAS;AAAA,QAC1B,cAAc,EAAE,SAAS,IAAK;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,MAAM;AAAA,MACJ,aAAa;AAAA,QACX,WAAW;AAAA;AAAA,MAEb;AAAA,IACF;AAAA,EACF;AACF;AAEA,MAAM,WAAW,CAAC,SAAwB;AACxC,QAAM,QAAQ;AAAA,IACZ;AAAA,MACE,OAAO;AAAA,MACP,aAAa;AAAA,MACb,0BAAAA;AAAA,MACA,SAAS,MAAM,MAAM,qBAAqB;AAAA,IAC5C;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,aAAa;AAAA,MACb,0BAAAA;AAAA,MACA,SAAS,MAAM,MAAM,qBAAqB;AAAA,IAC5C;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,aAAa;AAAA,MACb,0BAAAA;AAAA,MACA,SAAS,MAAM,MAAM,qBAAqB;AAAA,IAC5C;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,aAAa;AAAA,MACb,0BAAAA;AAAA,MACA,SAAS,MAAM,MAAM,qBAAqB;AAAA,IAC5C;AAAA,EACF;AAEA,QAAM,CAAC,EAAE,UAAU,QAAI,2BAAQ;AAE/B,QAAM,YAAY,MAChB,WAAW;AAAA,IACT,aAAa;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
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|