@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,144 @@
|
|
|
1
|
+
import React, { useRef, useCallback, useState, useEffect } from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { TransitionGroup } from "react-transition-group";
|
|
4
|
+
import TransitionSlide from "../../transitions/TransitionSlide";
|
|
5
|
+
import Button from "../../cta/Button";
|
|
6
|
+
import Text from "../../asorted/Text";
|
|
7
|
+
import Flex from "../../layout/Flex";
|
|
8
|
+
import Slide from "./Slide";
|
|
9
|
+
import IconLeft from "@ledgerhq/icons-ui/reactLegacy/ArrowLeftMedium";
|
|
10
|
+
import IconRight from "@ledgerhq/icons-ui/reactLegacy/ArrowRightMedium";
|
|
11
|
+
import IconClose from "@ledgerhq/icons-ui/reactLegacy/CloseMedium";
|
|
12
|
+
const CarouselWrapper = styled.div `
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 180px;
|
|
15
|
+
border-radius: 8px;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
position: relative;
|
|
19
|
+
flex: 1;
|
|
20
|
+
background: ${p => p.theme.colors.neutral.c100};
|
|
21
|
+
`;
|
|
22
|
+
const Controllers = styled(Flex) `
|
|
23
|
+
position: absolute;
|
|
24
|
+
flex-direction: row;
|
|
25
|
+
right: ${p => p.theme.space[5]}px;
|
|
26
|
+
bottom: ${p => p.theme.space[4]}px;
|
|
27
|
+
column-gap: ${p => p.theme.space[4]}px;
|
|
28
|
+
color: ${p => p.theme.colors.neutral.c00};
|
|
29
|
+
|
|
30
|
+
> div {
|
|
31
|
+
&:hover {
|
|
32
|
+
opacity: 0.5;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
const Bullets = styled.div `
|
|
37
|
+
position: absolute;
|
|
38
|
+
display: flex;
|
|
39
|
+
left: ${p => p.theme.space[10]}px;
|
|
40
|
+
bottom: ${p => p.theme.space[8]}px;
|
|
41
|
+
column-gap: ${p => p.theme.space[2]}px;
|
|
42
|
+
flex-direction: row;
|
|
43
|
+
|
|
44
|
+
> div {
|
|
45
|
+
position: relative;
|
|
46
|
+
height: ${p => p.theme.space[1]}px;
|
|
47
|
+
width: ${p => p.theme.space[8]}px;
|
|
48
|
+
background: ${p => p.theme.colors.neutral.c00};
|
|
49
|
+
opacity: 0.5;
|
|
50
|
+
&:hover {
|
|
51
|
+
opacity: 0.75;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:nth-child(${p => p.active}) {
|
|
55
|
+
opacity: 1;
|
|
56
|
+
&:hover {
|
|
57
|
+
opacity: 0.75;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
::after {
|
|
62
|
+
content: "";
|
|
63
|
+
position: absolute;
|
|
64
|
+
top: -${p => p.theme.space[4]}px;
|
|
65
|
+
height: ${p => p.theme.space[7]}px;
|
|
66
|
+
width: 100%;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
const Close = styled.div `
|
|
71
|
+
position: absolute;
|
|
72
|
+
top: ${p => p.theme.space[7]}px;
|
|
73
|
+
right: ${p => p.theme.space[5]}px;
|
|
74
|
+
color: ${p => p.theme.colors.neutral.c00};
|
|
75
|
+
&:hover {
|
|
76
|
+
opacity: 0.5;
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
const DismissWrapper = styled.div `
|
|
80
|
+
color: white;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
padding: ${p => p.theme.space[13]}px;
|
|
86
|
+
row-gap: ${p => p.theme.space[7]}px;
|
|
87
|
+
`;
|
|
88
|
+
const DEFAULT_TIMEOUT = 7000;
|
|
89
|
+
const Carousel = ({ timeout = DEFAULT_TIMEOUT, queue, isDismissed, onDismiss, dismissText = "This banner will not show up again until there is a new announcement", dismissConfirmText = "Confirm", dismissCancelText = "Show again", }) => {
|
|
90
|
+
const intervalRef = useRef();
|
|
91
|
+
const [direction, setDirection] = useState("right");
|
|
92
|
+
const [index, setIndex] = useState(0);
|
|
93
|
+
const [wantToDismiss, setWantToDismiss] = useState(false);
|
|
94
|
+
const [paused, setPaused] = useState(false);
|
|
95
|
+
const childFactory = useCallback((child) => React.cloneElement(child, { direction }), [direction]);
|
|
96
|
+
const wrappedSetIndex = useCallback((newIndex) => {
|
|
97
|
+
setDirection(newIndex > index ? "left" : "right");
|
|
98
|
+
setIndex(newIndex);
|
|
99
|
+
}, [index]);
|
|
100
|
+
const onSlide = useCallback((direction = "left") => {
|
|
101
|
+
setDirection(direction);
|
|
102
|
+
const i = index + (direction === "right" ? -1 : 1);
|
|
103
|
+
setIndex(i < 0 ? queue.length - 1 : i >= queue.length ? 0 : i);
|
|
104
|
+
}, [index, queue]);
|
|
105
|
+
const onPrevious = useCallback(() => onSlide("right"), [onSlide]);
|
|
106
|
+
const onNext = useCallback(() => onSlide("left"), [onSlide]);
|
|
107
|
+
const onWantToDismiss = () => setWantToDismiss(true);
|
|
108
|
+
const onCancelDismiss = () => setWantToDismiss(false);
|
|
109
|
+
const onMouseEnter = () => setPaused(true);
|
|
110
|
+
const onMouseLeave = () => setPaused(false);
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
// Nb we pause automatic transitions when the mouse is within the carousel.
|
|
113
|
+
// Override passed timeout if lower than 1000ms
|
|
114
|
+
const _timeout = timeout < 1000 ? DEFAULT_TIMEOUT : timeout;
|
|
115
|
+
if (intervalRef.current)
|
|
116
|
+
clearInterval(intervalRef.current);
|
|
117
|
+
if (!paused)
|
|
118
|
+
intervalRef.current = setInterval(onSlide, _timeout);
|
|
119
|
+
}, [onSlide, paused, timeout]);
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
if (isDismissed)
|
|
122
|
+
setWantToDismiss(false);
|
|
123
|
+
}, [isDismissed]);
|
|
124
|
+
if (!(queue === null || queue === void 0 ? void 0 : queue.length) || isDismissed)
|
|
125
|
+
return null;
|
|
126
|
+
return (React.createElement(CarouselWrapper, { id: "carousel", onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }, wantToDismiss ? (React.createElement(DismissWrapper, null,
|
|
127
|
+
React.createElement(Text, { color: "neutral.c00", fontWeight: "medium", variant: "paragraph" }, dismissText),
|
|
128
|
+
React.createElement(Flex, { columnGap: 5 },
|
|
129
|
+
React.createElement(Button, { color: "neutral.c100", backgroundColor: "neutral.c00", onClick: onDismiss }, dismissConfirmText),
|
|
130
|
+
React.createElement(Button, { outline: true, color: "neutral.c00", backgroundColor: "neutral.c100", borderColor: "neutral.c00", onClick: onCancelDismiss }, dismissCancelText)))) : (React.createElement("div", null,
|
|
131
|
+
React.createElement(TransitionGroup, { component: null, childFactory: childFactory },
|
|
132
|
+
React.createElement(TransitionSlide, { key: index, direction: direction },
|
|
133
|
+
React.createElement(Slide, Object.assign({}, queue[index])))),
|
|
134
|
+
React.createElement(Close, { id: "carousel-dismiss", onClick: onWantToDismiss },
|
|
135
|
+
React.createElement(IconClose, { size: 18 })),
|
|
136
|
+
React.createElement(Bullets, { active: index + 1 }, queue.map((_, i) => (React.createElement("div", { key: `bullet_${i}`, onClick: () => wrappedSetIndex(i) })))),
|
|
137
|
+
React.createElement(Controllers, null,
|
|
138
|
+
React.createElement("div", { onClick: onPrevious },
|
|
139
|
+
React.createElement(IconLeft, { size: 20 })),
|
|
140
|
+
React.createElement("div", { onClick: onNext },
|
|
141
|
+
React.createElement(IconRight, { size: 20 })))))));
|
|
142
|
+
};
|
|
143
|
+
export default Carousel;
|
|
144
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/cards/Carousel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,eAAe,MAAM,mCAAmC,CAAC;AAEhE,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,IAAI,MAAM,mBAAmB,CAAC;AACrC,OAAO,KAA8B,MAAM,SAAS,CAAC;AAErD,OAAO,QAAQ,MAAM,gDAAgD,CAAC;AACtE,OAAO,SAAS,MAAM,iDAAiD,CAAC;AACxE,OAAO,SAAS,MAAM,4CAA4C,CAAC;AAEnE,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;gBAQlB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI;CAC/C,CAAC;AAEF,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;WAGrB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;YACpB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;gBACjB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC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BAAkB,EAAE,OAAO,EAAE,eAAe;YACrD,oBAAC,SAAS,IAAC,IAAI,EAAE,EAAE,GAAI,CACjB;QAER,oBAAC,OAAO,IAAC,MAAM,EAAE,KAAK,GAAG,CAAC,IACvB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACnB,6BAAK,GAAG,EAAE,UAAU,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,GAAI,CAC/D,CAAC,CACM;QAEV,oBAAC,WAAW;YACV,6BAAK,OAAO,EAAE,UAAU;gBACtB,oBAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,GAAI,CAClB;YACN,6BAAK,OAAO,EAAE,MAAM;gBAClB,oBAAC,SAAS,IAAC,IAAI,EAAE,EAAE,GAAI,CACnB,CACM,CACV,CACP,CACe,CACnB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Carousel } from "./Carousel";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/cards/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
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,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"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,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"}
|
|
@@ -4,5 +4,4 @@ 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";
|
|
8
7
|
export { default as VerticalTimeline } from "./List/VerticalTimeline";
|
|
@@ -4,6 +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";
|
|
8
7
|
export { default as VerticalTimeline } from "./List/VerticalTimeline";
|
|
9
8
|
//# 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,
|
|
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"}
|
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-start-exchange.0",
|
|
4
4
|
"description": "Ledger Live - Desktop UI",
|
|
5
5
|
"author": "Ledger Live Team <team-live@ledger.fr>",
|
|
6
6
|
"repository": {
|
|
@@ -61,16 +61,14 @@
|
|
|
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",
|
|
65
64
|
"moment": "^2.29.1",
|
|
66
65
|
"react-chartjs-2": "^3.3.0",
|
|
67
66
|
"react-is": "^17.0.2",
|
|
68
67
|
"react-select": "^5.2.1",
|
|
69
|
-
"react-spring": "8.0.27",
|
|
70
68
|
"react-transition-group": "^4.4.2",
|
|
71
69
|
"react-window": "^1.8.6",
|
|
72
70
|
"styled-system": "^5.1.5",
|
|
73
|
-
"@ledgerhq/crypto-icons-ui": "^1.0.2-
|
|
71
|
+
"@ledgerhq/crypto-icons-ui": "^1.0.2-start-exchange.0",
|
|
74
72
|
"@ledgerhq/icons-ui": "^0.6.2",
|
|
75
73
|
"@ledgerhq/ui-shared": "^0.2.1"
|
|
76
74
|
},
|
|
@@ -102,7 +100,6 @@
|
|
|
102
100
|
"@types/styled-system": "^5.1.12",
|
|
103
101
|
"babel-loader": "^8.0.0",
|
|
104
102
|
"csstype": "^3.0.11",
|
|
105
|
-
"embla-carousel": "8.0.0-rc17",
|
|
106
103
|
"esbuild": "^0.19.0",
|
|
107
104
|
"eslint-plugin-react": "^7.33.2",
|
|
108
105
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
@@ -1,78 +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__ = __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
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,76 +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 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
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
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
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,67 +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 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
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|