@fox-dls/carousels 1.1.8 → 1.1.9
Sign up to get free protection for your applications and to get access to all the features.
- package/.ultra.cache.json +1 -1
- package/package.json +1 -1
- package/src/lib/card/index.tsx +2 -10
- package/src/lib/free/index.tsx +5 -19
- package/src/lib/free/styles/index.tsx +6 -0
- package/src/lib/pagination/index.tsx +12 -63
- package/src/lib/pagination/styles/index.tsx +24 -0
- package/src/lib/pills/index.tsx +25 -93
- package/src/lib/pills/styles/index.tsx +59 -1
package/.ultra.cache.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"files":{"dist":"
|
1
|
+
{"files":{"dist":"1638924930456.3694","node_modules":"1638922874290.3389",".babelrc":"f03d0ca709d39fade7fd0a5ff24f9384b515b5b6",".eslintrc.json":"6a0edde9387ee5887d1e599f7a99f09362754acd","CHANGELOG.md":"938ca134a8f27f19d16eafbc8064d38ea166b934","README.md":"87a167329bff7478ccaa650e3d382475d8115cb1","package.json":"8512485560e1085b1d0365303d0dfa2ffc86681a.1638924872688.9985","src/index.ts":"1666f11be8aaf18be8a632f73ad0e73d407aae26.1638924862097.1138","src/lib/card/index.tsx":"52c971cf55cfeb66bdb2f5be883f9a3a2fb62a37","src/lib/card/styles/index.tsx":"0e2c3284b69f0e5c3eabfcbaac81864ff10e5969","src/lib/free/index.tsx":"31d5d59052261c935edb986a1817ee7f273bbbd4","src/lib/free/styles/index.tsx":"5265cb7c9d6bf16b5b09c82bbac9d6aa8d32d798","src/lib/pagination/index.tsx":"561112dbc7d2eeb6e18037ca090a81a6dbe7ac07","src/lib/pagination/styles/index.tsx":"457b030d259318e0431b4d585406078e7ee4faab","src/lib/pills/index.tsx":"c472c9de1791a116bd7e5c1dbe650c3256f6128a","src/lib/pills/styles/index.tsx":"5b249d5b210dd9e81edff8a3412d4b7b9e2ad9a2","src/lib/styles/index.tsx":"276419cd5a78d7b7e027c6f2dc459ea3e81bb85d","tsconfig.build.json":"269572b997c81ac83266026b6b5a2c8699709823.1638923968110.791","tsconfig.json":"af31a7a31827eeec44ed853b8c3000c67f639047.del"},"deps":{"@fox-dls/layout":1638924264191.6038}}
|
package/package.json
CHANGED
package/src/lib/card/index.tsx
CHANGED
@@ -52,11 +52,7 @@ export const CardCarousel: React.FC<any> = ({
|
|
52
52
|
aria-label="Previous"
|
53
53
|
type="button"
|
54
54
|
>
|
55
|
-
<span
|
56
|
-
css={`
|
57
|
-
position: relative;
|
58
|
-
`}
|
59
|
-
>
|
55
|
+
<span style={{ position: 'relative' }}>
|
60
56
|
<ArrowsIconClip />
|
61
57
|
<ArrowsSvg
|
62
58
|
viewBox="0 0 32 32"
|
@@ -73,11 +69,7 @@ export const CardCarousel: React.FC<any> = ({
|
|
73
69
|
</ArrowsButton>
|
74
70
|
<ArrowsDivider />
|
75
71
|
<ArrowsButton aria-label="Next" type="button" ref={nextRef}>
|
76
|
-
<span
|
77
|
-
css={`
|
78
|
-
position: relative;
|
79
|
-
`}
|
80
|
-
>
|
72
|
+
<span style={{ position: 'relative' }}>
|
81
73
|
<ArrowsIconClip />
|
82
74
|
<ArrowsSvg
|
83
75
|
viewBox="0 0 32 32"
|
package/src/lib/free/index.tsx
CHANGED
@@ -20,7 +20,7 @@ import {
|
|
20
20
|
ArrowsIconClip,
|
21
21
|
ArrowsSvg
|
22
22
|
} from '../styles';
|
23
|
-
import { CarouselSwiper } from './styles';
|
23
|
+
import { CarouselSwiper, CarouselMedia } from './styles';
|
24
24
|
|
25
25
|
SwiperCore.use([Navigation]);
|
26
26
|
|
@@ -37,13 +37,7 @@ export const FreeCarousel: React.FC<any> = ({
|
|
37
37
|
const nextRef = useRef<HTMLDivElement>(null);
|
38
38
|
return (
|
39
39
|
<CarouselContainer>
|
40
|
-
<
|
41
|
-
css={`
|
42
|
-
@media (max-width: 744px) {
|
43
|
-
display: none !important;
|
44
|
-
}
|
45
|
-
`}
|
46
|
-
>
|
40
|
+
<CarouselMedia>
|
47
41
|
<Container>
|
48
42
|
{navigation && (
|
49
43
|
<CarouselNavbar>
|
@@ -63,11 +57,7 @@ export const FreeCarousel: React.FC<any> = ({
|
|
63
57
|
aria-label="Previous"
|
64
58
|
type="button"
|
65
59
|
>
|
66
|
-
<span
|
67
|
-
css={`
|
68
|
-
position: relative;
|
69
|
-
`}
|
70
|
-
>
|
60
|
+
<span style={{ position: 'relative' }}>
|
71
61
|
<ArrowsIconClip />
|
72
62
|
<ArrowsSvg
|
73
63
|
viewBox="0 0 32 32"
|
@@ -88,11 +78,7 @@ export const FreeCarousel: React.FC<any> = ({
|
|
88
78
|
type="button"
|
89
79
|
ref={nextRef}
|
90
80
|
>
|
91
|
-
<span
|
92
|
-
css={`
|
93
|
-
position: relative;
|
94
|
-
`}
|
95
|
-
>
|
81
|
+
<span style={{ position: 'relative' }}>
|
96
82
|
<ArrowsIconClip />
|
97
83
|
<ArrowsSvg
|
98
84
|
viewBox="0 0 32 32"
|
@@ -114,7 +100,7 @@ export const FreeCarousel: React.FC<any> = ({
|
|
114
100
|
</CarouselNavbar>
|
115
101
|
)}
|
116
102
|
</Container>
|
117
|
-
</
|
103
|
+
</CarouselMedia>
|
118
104
|
<CarouselSwiper
|
119
105
|
{...props}
|
120
106
|
cssMode
|
@@ -5,7 +5,12 @@ import SwiperCore, { Navigation, Pagination } from 'swiper';
|
|
5
5
|
// eslint-disable-next-line import/extensions
|
6
6
|
import { SwiperSlide } from 'swiper/react';
|
7
7
|
|
8
|
-
import {
|
8
|
+
import {
|
9
|
+
CarouselSwiper,
|
10
|
+
CarouselPillSvg,
|
11
|
+
CarouselPill,
|
12
|
+
CarouselPillAnimatedContainer
|
13
|
+
} from './styles';
|
9
14
|
|
10
15
|
SwiperCore.use([Navigation, Pagination]);
|
11
16
|
|
@@ -20,37 +25,9 @@ export const PaginationCarousel: React.FC<any> = ({
|
|
20
25
|
const nextRef = useRef<HTMLDivElement>(null);
|
21
26
|
return (
|
22
27
|
<>
|
23
|
-
<
|
24
|
-
css={`
|
25
|
-
@keyframes fadein {
|
26
|
-
0% {
|
27
|
-
opacity: 0;
|
28
|
-
}
|
29
|
-
|
30
|
-
100% {
|
31
|
-
opacity: 1;
|
32
|
-
}
|
33
|
-
}
|
34
|
-
position: absolute !important;
|
35
|
-
top: 50% !important;
|
36
|
-
pointer-events: auto !important;
|
37
|
-
transform: translateY(-50%) !important;
|
38
|
-
left: 8px !important;
|
39
|
-
animation-duration: 0.3s !important;
|
40
|
-
animation-name: fadein !important;
|
41
|
-
z-index: 180 !important;
|
42
|
-
opacity: 0 !important;
|
43
|
-
:hover {
|
44
|
-
opacity: 1 !important;
|
45
|
-
}
|
46
|
-
`}
|
47
|
-
>
|
28
|
+
<CarouselPillAnimatedContainer>
|
48
29
|
<CarouselPill ref={prevRef}>
|
49
|
-
<span
|
50
|
-
css={`
|
51
|
-
position: relative !important;
|
52
|
-
`}
|
53
|
-
>
|
30
|
+
<span style={{ position: 'relative' }}>
|
54
31
|
<CarouselPillSvg
|
55
32
|
viewBox="0 0 16 16"
|
56
33
|
role="presentation"
|
@@ -61,38 +38,10 @@ export const PaginationCarousel: React.FC<any> = ({
|
|
61
38
|
</CarouselPillSvg>
|
62
39
|
</span>
|
63
40
|
</CarouselPill>
|
64
|
-
</
|
65
|
-
<
|
66
|
-
css={`
|
67
|
-
@keyframes fadein {
|
68
|
-
0% {
|
69
|
-
opacity: 0;
|
70
|
-
}
|
71
|
-
|
72
|
-
100% {
|
73
|
-
opacity: 1;
|
74
|
-
}
|
75
|
-
}
|
76
|
-
position: absolute !important;
|
77
|
-
top: 50% !important;
|
78
|
-
pointer-events: auto !important;
|
79
|
-
transform: translateY(-50%) !important;
|
80
|
-
right: 8px !important;
|
81
|
-
animation-duration: 0.3s !important;
|
82
|
-
animation-name: fadein !important;
|
83
|
-
z-index: 180 !important;
|
84
|
-
opacity: 0 !important;
|
85
|
-
:hover {
|
86
|
-
opacity: 1 !important;
|
87
|
-
}
|
88
|
-
`}
|
89
|
-
>
|
41
|
+
</CarouselPillAnimatedContainer>
|
42
|
+
<CarouselPillAnimatedContainer>
|
90
43
|
<CarouselPill ref={nextRef}>
|
91
|
-
<span
|
92
|
-
css={`
|
93
|
-
position: relative !important;
|
94
|
-
`}
|
95
|
-
>
|
44
|
+
<span style={{ position: 'relative' }}>
|
96
45
|
<CarouselPillSvg
|
97
46
|
viewBox="0 0 16 16"
|
98
47
|
role="presentation"
|
@@ -103,7 +52,7 @@ export const PaginationCarousel: React.FC<any> = ({
|
|
103
52
|
</CarouselPillSvg>
|
104
53
|
</span>
|
105
54
|
</CarouselPill>
|
106
|
-
</
|
55
|
+
</CarouselPillAnimatedContainer>
|
107
56
|
<CarouselSwiper
|
108
57
|
{...props}
|
109
58
|
pagination={{
|
@@ -78,3 +78,27 @@ export const CarouselPillSvg = styled.svg`
|
|
78
78
|
display: block;
|
79
79
|
fill: currentcolor;
|
80
80
|
`;
|
81
|
+
|
82
|
+
export const CarouselPillAnimatedContainer = styled.div`
|
83
|
+
@keyframes fadein {
|
84
|
+
0% {
|
85
|
+
opacity: 0;
|
86
|
+
}
|
87
|
+
|
88
|
+
100% {
|
89
|
+
opacity: 1;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
position: absolute !important;
|
93
|
+
top: 50% !important;
|
94
|
+
pointer-events: auto !important;
|
95
|
+
transform: translateY(-50%) !important;
|
96
|
+
left: 8px !important;
|
97
|
+
animation-duration: 0.3s !important;
|
98
|
+
animation-name: fadein !important;
|
99
|
+
z-index: 180 !important;
|
100
|
+
opacity: 0 !important;
|
101
|
+
:hover {
|
102
|
+
opacity: 1 !important;
|
103
|
+
}
|
104
|
+
`;
|
package/src/lib/pills/index.tsx
CHANGED
@@ -2,12 +2,20 @@
|
|
2
2
|
/* eslint-disable unused-imports/no-unused-vars */
|
3
3
|
import React, { useRef, useState } from 'react';
|
4
4
|
|
5
|
-
import { css } from 'styled-components';
|
5
|
+
import { css } from 'styled-components/macro';
|
6
6
|
import SwiperCore, { Navigation } from 'swiper';
|
7
7
|
// eslint-disable-next-line import/extensions
|
8
8
|
import { SwiperSlide } from 'swiper/react';
|
9
9
|
|
10
|
-
import {
|
10
|
+
import {
|
11
|
+
CarouselSwiper,
|
12
|
+
CarouselPillContainer,
|
13
|
+
CarouselPill,
|
14
|
+
CarouselPillFlex,
|
15
|
+
CarouselPillArrowContainer,
|
16
|
+
CarouselPillInlineChild,
|
17
|
+
CarouselPillArrowSVG
|
18
|
+
} from './styles';
|
11
19
|
|
12
20
|
SwiperCore.use([Navigation]);
|
13
21
|
|
@@ -28,30 +36,10 @@ export const PillsCarousel: React.FC<any> = ({
|
|
28
36
|
});
|
29
37
|
const [swiper, setSwiper] = useState<any>(null);
|
30
38
|
return (
|
31
|
-
<
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
min-width: 0px !important;
|
36
|
-
`}
|
37
|
-
>
|
38
|
-
<div
|
39
|
-
css={`
|
40
|
-
position: absolute !important;
|
41
|
-
left: 0px !important;
|
42
|
-
z-index: 3 !important;
|
43
|
-
width: 65px !important;
|
44
|
-
background: linear-gradient(
|
45
|
-
to right,
|
46
|
-
rgb(255, 255, 255) 56.77%,
|
47
|
-
rgba(255, 255, 255, 0) 94.47%
|
48
|
-
) !important;
|
49
|
-
${swiperSlides.isBeginning &&
|
50
|
-
css`
|
51
|
-
display: none !important;
|
52
|
-
visibility: hidden !important;
|
53
|
-
`}
|
54
|
-
`}
|
39
|
+
<CarouselPillFlex>
|
40
|
+
<CarouselPillArrowContainer
|
41
|
+
start={true}
|
42
|
+
hidden={swiperSlides.isBeginning}
|
55
43
|
>
|
56
44
|
{arrows && (
|
57
45
|
<CarouselPillContainer>
|
@@ -62,36 +50,23 @@ export const PillsCarousel: React.FC<any> = ({
|
|
62
50
|
type="button"
|
63
51
|
onClick={() => swiper.slidePrev()}
|
64
52
|
>
|
65
|
-
<span
|
66
|
-
|
67
|
-
position: relative !important;
|
68
|
-
`}
|
69
|
-
>
|
70
|
-
<svg
|
53
|
+
<span style={{ position: 'relative' }}>
|
54
|
+
<CarouselPillArrowSVG
|
71
55
|
viewBox="0 0 32 32"
|
72
56
|
xmlns="http://www.w3.org/2000/svg"
|
73
57
|
aria-hidden="true"
|
74
58
|
role="presentation"
|
75
59
|
focusable="false"
|
76
|
-
css={`
|
77
|
-
display: block;
|
78
|
-
fill: none;
|
79
|
-
height: 12px;
|
80
|
-
width: 12px;
|
81
|
-
stroke: currentcolor;
|
82
|
-
stroke-width: 5.33333;
|
83
|
-
overflow: visible;
|
84
|
-
`}
|
85
60
|
>
|
86
61
|
<g fill="none">
|
87
62
|
<path d="m20 28-11.29289322-11.2928932c-.39052429-.3905243-.39052429-1.0236893 0-1.4142136l11.29289322-11.2928932" />
|
88
63
|
</g>
|
89
|
-
</
|
64
|
+
</CarouselPillArrowSVG>
|
90
65
|
</span>
|
91
66
|
</CarouselPill>
|
92
67
|
</CarouselPillContainer>
|
93
68
|
)}
|
94
|
-
</
|
69
|
+
</CarouselPillArrowContainer>
|
95
70
|
|
96
71
|
<CarouselSwiper
|
97
72
|
{...props}
|
@@ -128,42 +103,12 @@ export const PillsCarousel: React.FC<any> = ({
|
|
128
103
|
>
|
129
104
|
{React.Children.map(children, child => (
|
130
105
|
<SwiperSlide>
|
131
|
-
<
|
132
|
-
css={`
|
133
|
-
display: inline-block !important;
|
134
|
-
white-space: nowrap !important;
|
135
|
-
padding-right: 8px !important;
|
136
|
-
padding-top: 4px !important;
|
137
|
-
padding-bottom: 4px !important;
|
138
|
-
`}
|
139
|
-
>
|
140
|
-
{child}
|
141
|
-
</div>
|
106
|
+
<CarouselPillInlineChild>{child}</CarouselPillInlineChild>
|
142
107
|
</SwiperSlide>
|
143
108
|
))}
|
144
109
|
</CarouselSwiper>
|
145
110
|
|
146
|
-
<
|
147
|
-
css={`
|
148
|
-
-webkit-box-pack: end !important;
|
149
|
-
position: absolute !important;
|
150
|
-
right: 0px !important;
|
151
|
-
z-index: 3 !important;
|
152
|
-
width: 75px !important;
|
153
|
-
display: flex !important;
|
154
|
-
justify-content: flex-end !important;
|
155
|
-
background: linear-gradient(
|
156
|
-
to left,
|
157
|
-
rgb(255, 255, 255) 56.77%,
|
158
|
-
rgba(255, 255, 255, 0) 94.47%
|
159
|
-
) !important;
|
160
|
-
${swiperSlides.isEnd &&
|
161
|
-
css`
|
162
|
-
display: none !important;
|
163
|
-
visibility: hidden !important;
|
164
|
-
`}
|
165
|
-
`}
|
166
|
-
>
|
111
|
+
<CarouselPillArrowContainer hidden={swiperSlides.isEnd} end={true}>
|
167
112
|
{arrows && (
|
168
113
|
<CarouselPillContainer>
|
169
114
|
<CarouselPill
|
@@ -173,36 +118,23 @@ export const PillsCarousel: React.FC<any> = ({
|
|
173
118
|
ref={nextRef}
|
174
119
|
onClick={() => swiper.slideNext()}
|
175
120
|
>
|
176
|
-
<span
|
177
|
-
|
178
|
-
position: relative !important;
|
179
|
-
`}
|
180
|
-
>
|
181
|
-
<svg
|
121
|
+
<span style={{ position: 'relative' }}>
|
122
|
+
<CarouselPillArrowSVG
|
182
123
|
viewBox="0 0 32 32"
|
183
124
|
xmlns="http://www.w3.org/2000/svg"
|
184
125
|
aria-hidden="true"
|
185
126
|
role="presentation"
|
186
127
|
focusable="false"
|
187
|
-
css={`
|
188
|
-
display: block;
|
189
|
-
fill: none;
|
190
|
-
height: 12px;
|
191
|
-
width: 12px;
|
192
|
-
stroke: currentcolor;
|
193
|
-
stroke-width: 5.33333;
|
194
|
-
overflow: visible;
|
195
|
-
`}
|
196
128
|
>
|
197
129
|
<g fill="none">
|
198
130
|
<path d="m12 4 11.2928932 11.2928932c.3905243.3905243.3905243 1.0236893 0 1.4142136l-11.2928932 11.2928932" />
|
199
131
|
</g>
|
200
|
-
</
|
132
|
+
</CarouselPillArrowSVG>
|
201
133
|
</span>
|
202
134
|
</CarouselPill>
|
203
135
|
</CarouselPillContainer>
|
204
136
|
)}
|
205
|
-
</
|
206
|
-
</
|
137
|
+
</CarouselPillArrowContainer>
|
138
|
+
</CarouselPillFlex>
|
207
139
|
);
|
208
140
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import ButtonUnstyled from '@mui/core/ButtonUnstyled';
|
2
|
-
import styled from 'styled-components';
|
2
|
+
import styled, { css } from 'styled-components';
|
3
3
|
// eslint-disable-next-line import/extensions
|
4
4
|
import { Swiper } from 'swiper/react';
|
5
5
|
|
@@ -56,3 +56,61 @@ export const CarouselPill = styled(ButtonUnstyled)<any>`
|
|
56
56
|
border: 1px solid rgb(221, 221, 221) !important;
|
57
57
|
}
|
58
58
|
`;
|
59
|
+
|
60
|
+
export const CarouselPillFlex = styled.div`
|
61
|
+
display: flex !important;
|
62
|
+
position: relative !important;
|
63
|
+
min-width: 0px !important;
|
64
|
+
`;
|
65
|
+
|
66
|
+
export const CarouselPillArrowContainer = styled.div<any>`
|
67
|
+
position: absolute !important;
|
68
|
+
background: linear-gradient(
|
69
|
+
to left,
|
70
|
+
rgb(255, 255, 255) 56.77%,
|
71
|
+
rgba(255, 255, 255, 0) 94.47%
|
72
|
+
) !important;
|
73
|
+
z-index: 3 !important;
|
74
|
+
|
75
|
+
${props =>
|
76
|
+
props.start &&
|
77
|
+
css`
|
78
|
+
left: 0px !important;
|
79
|
+
width: 65px !important;
|
80
|
+
`}
|
81
|
+
|
82
|
+
${props =>
|
83
|
+
props.end &&
|
84
|
+
css`
|
85
|
+
-webkit-box-pack: end !important;
|
86
|
+
right: 0px !important;
|
87
|
+
width: 75px !important;
|
88
|
+
display: flex !important;
|
89
|
+
justify-content: flex-end !important;
|
90
|
+
`}
|
91
|
+
|
92
|
+
${props =>
|
93
|
+
props.hidden &&
|
94
|
+
css`
|
95
|
+
display: none !important;
|
96
|
+
visibility: hidden !important;
|
97
|
+
`}
|
98
|
+
`;
|
99
|
+
|
100
|
+
export const CarouselPillInlineChild = styled.div`
|
101
|
+
display: inline-block !important;
|
102
|
+
white-space: nowrap !important;
|
103
|
+
padding-right: 8px !important;
|
104
|
+
padding-top: 4px !important;
|
105
|
+
padding-bottom: 4px !important;
|
106
|
+
`;
|
107
|
+
|
108
|
+
export const CarouselPillArrowSVG = styled.svg`
|
109
|
+
display: block;
|
110
|
+
fill: none;
|
111
|
+
height: 12px;
|
112
|
+
width: 12px;
|
113
|
+
stroke: currentcolor;
|
114
|
+
stroke-width: 5.33333;
|
115
|
+
overflow: visible;
|
116
|
+
`;
|