@riosst100/pwa-marketplace 1.6.9 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/componentOverrideMapping.js +4 -0
- package/src/components/CollectibleGameSets/collectibleGameSets.js +0 -4
- package/src/components/FilterTop/filterTop.js +0 -2
- package/src/components/FilterTopBackup/CustomFilters/customFilters.js +0 -1
- package/src/components/ProductLabel/index.js +47 -0
- package/src/components/ProductListTab/productListTab.js +51 -5
- package/src/components/ProductListTab/productListTab.module.css +1 -1
- package/src/components/RelatedProduct/relatedProduct.js +1 -1
- package/src/components/ShopBy/shopBy copy.js +172 -0
- package/src/components/ShopBy/shopBy.js +0 -1
- package/src/components/ShopBySets/shopBySets.js +0 -3
- package/src/components/SportCardsSets/index.js +2 -0
- package/src/components/SportCardsSets/sportCardsSets.js +372 -0
- package/src/components/SportCardsSets/sportCardsSets.module.css +76 -0
- package/src/components/SportCardsSets/sportCardsSets.shimmer.js +50 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/__fixtures__/apolloMocks.js +33 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/carousel.gql.ce.js +16 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/carousel.gql.ee.js +17 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/carousel.js +38 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/index.js +1 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/Carousel/useCarousel.js +25 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/configAggregator.js +26 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/index.js +1 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/products.js +369 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Products/products.module.css +0 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/banner.module.css +103 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/configAggregator.js +17 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/index.js +2 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.js +221 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.module.css +231 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.shimmer.js +126 -0
- package/src/overwrites/pagebuilder/lib/ContentTypes/Slider/slider.shimmer.module.css +5 -0
- package/src/overwrites/pagebuilder/lib/utils.js +224 -0
- package/src/overwrites/peregrine/lib/talons/FilterSidebar/useFilterSidebar.js +60 -0
- package/src/overwrites/peregrine/lib/talons/ProductFullDetail/useProductFullDetail.js +4 -1
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryFragments.gql.js +8 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Product/productDetailFragment.gql.js +44 -0
- package/src/overwrites/venia-ui/lib/RootComponents/CMS/cms.js +73 -0
- package/src/overwrites/venia-ui/lib/RootComponents/CMS/cms.module.css +25 -0
- package/src/overwrites/venia-ui/lib/RootComponents/CMS/cms.shimmer.js +18 -0
- package/src/overwrites/venia-ui/lib/RootComponents/CMS/index.js +7 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/category.js +12 -1
- package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +3 -3
- package/src/overwrites/venia-ui/lib/components/App/app.js +131 -0
- package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.module.css +1 -0
- package/src/overwrites/venia-ui/lib/components/FilterModal/CurrentFilters/currentFilters.js +1 -1
- package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +4 -1
- package/src/overwrites/venia-ui/lib/components/Gallery/item.js +13 -3
- package/src/overwrites/venia-ui/lib/components/Gallery/item.module.css +1 -1
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/auctionDetail.js +176 -138
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/preOrderDetail.js +19 -10
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +5 -26
- package/src/overwrites/venia-ui/lib/components/RichContent/richContent.module.css +3 -3
- package/src/overwrites/venia-ui/lib/components/SearchBar/searchBar.js +0 -1
- package/src/overwrites/venia-ui/lib/index.module.css +137 -0
- package/src/overwrites/venia-ui/lib/tokens.module.css +167 -0
- package/src/talons/CollectibleGameSets/collectibleGameSets.gql.js +15 -1
- package/src/talons/CollectibleGameSets/useCollectibleGameSets.js +0 -11
- package/src/talons/FilterTop/useFilterTop.js +0 -2
- package/src/talons/ShopBy/useShopBy.js +0 -22
- package/src/talons/SportCardsSets/sportCardsSets.gql.js +46 -0
- package/src/talons/SportCardsSets/useSportCardsSets.js +170 -0
- package/src/talons/SubCategoryPage/useSubCategoryPage.js +0 -3
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import React, { Children } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
arrayOf,
|
|
4
|
+
bool,
|
|
5
|
+
number,
|
|
6
|
+
oneOf,
|
|
7
|
+
shape,
|
|
8
|
+
string,
|
|
9
|
+
object
|
|
10
|
+
} from 'prop-types';
|
|
11
|
+
import SlickSlider from 'react-slick';
|
|
12
|
+
import defaultClasses from './slider.module.css';
|
|
13
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
14
|
+
import { useMediaQuery } from '@magento/peregrine/lib/hooks/useMediaQuery';
|
|
15
|
+
import { jarallax } from 'jarallax';
|
|
16
|
+
import cn from 'classnames';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Page Builder Slider component.
|
|
20
|
+
*
|
|
21
|
+
* This component is part of the Page Builder / PWA integration. It can be consumed without Page Builder.
|
|
22
|
+
*
|
|
23
|
+
* @typedef Slider
|
|
24
|
+
* @kind functional component
|
|
25
|
+
*
|
|
26
|
+
* @param {props} props React component props
|
|
27
|
+
*
|
|
28
|
+
* @returns {React.Element} A React component that displays a Slider which contains slides.
|
|
29
|
+
*/
|
|
30
|
+
const Slider = props => {
|
|
31
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
32
|
+
|
|
33
|
+
const {
|
|
34
|
+
minHeight,
|
|
35
|
+
autoplay,
|
|
36
|
+
autoplaySpeed,
|
|
37
|
+
fade,
|
|
38
|
+
infinite,
|
|
39
|
+
showArrows,
|
|
40
|
+
showDots,
|
|
41
|
+
textAlign,
|
|
42
|
+
border,
|
|
43
|
+
borderColor,
|
|
44
|
+
borderWidth,
|
|
45
|
+
borderRadius,
|
|
46
|
+
marginTop,
|
|
47
|
+
marginRight,
|
|
48
|
+
marginBottom,
|
|
49
|
+
marginLeft,
|
|
50
|
+
mediaQueries,
|
|
51
|
+
paddingTop,
|
|
52
|
+
paddingRight,
|
|
53
|
+
paddingBottom,
|
|
54
|
+
paddingLeft,
|
|
55
|
+
cssClasses = [],
|
|
56
|
+
children
|
|
57
|
+
} = props;
|
|
58
|
+
|
|
59
|
+
const { styles: mediaQueryStyles } = useMediaQuery({ mediaQueries });
|
|
60
|
+
|
|
61
|
+
const dynamicStyles = {
|
|
62
|
+
minHeight,
|
|
63
|
+
textAlign,
|
|
64
|
+
border,
|
|
65
|
+
borderColor,
|
|
66
|
+
borderWidth,
|
|
67
|
+
borderRadius,
|
|
68
|
+
marginTop,
|
|
69
|
+
marginRight,
|
|
70
|
+
marginBottom,
|
|
71
|
+
marginLeft,
|
|
72
|
+
paddingTop,
|
|
73
|
+
paddingRight,
|
|
74
|
+
paddingBottom,
|
|
75
|
+
paddingLeft
|
|
76
|
+
};
|
|
77
|
+
const jarallaxInstances = {};
|
|
78
|
+
|
|
79
|
+
const sliderSettings = {
|
|
80
|
+
dots: showDots,
|
|
81
|
+
arrows: showArrows,
|
|
82
|
+
lazyLoad: 'ondemand',
|
|
83
|
+
afterChange: () => {
|
|
84
|
+
Object.keys(jarallaxInstances).map(key => {
|
|
85
|
+
jarallax(jarallaxInstances[key].element, 'onScroll');
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
infinite,
|
|
89
|
+
autoplay,
|
|
90
|
+
autoplaySpeed,
|
|
91
|
+
fade
|
|
92
|
+
};
|
|
93
|
+
// Override classes on banner to ensure min height is respected
|
|
94
|
+
Children.map(children, (child, index) => {
|
|
95
|
+
if (child.props && child.props.data) {
|
|
96
|
+
child.props.data.classes = {
|
|
97
|
+
root: classes.bannerRoot,
|
|
98
|
+
link: classes.bannerLink,
|
|
99
|
+
wrapper: classes.bannerWrapper,
|
|
100
|
+
posterOverlay: classes.bannerPosterOverlay
|
|
101
|
+
};
|
|
102
|
+
child.props.data.getParallax = (element, options) => {
|
|
103
|
+
jarallaxInstances[index] = {
|
|
104
|
+
element,
|
|
105
|
+
options
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
return child;
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<div
|
|
114
|
+
aria-live="polite"
|
|
115
|
+
aria-busy="false"
|
|
116
|
+
className={cn([classes.root, ...cssClasses].join(' '))}
|
|
117
|
+
style={{ ...dynamicStyles, ...mediaQueryStyles }}
|
|
118
|
+
>
|
|
119
|
+
<SlickSlider className='component_slider' {...sliderSettings}>{children}</SlickSlider>
|
|
120
|
+
<style>
|
|
121
|
+
{`
|
|
122
|
+
.component_slider .slick-dots li button {
|
|
123
|
+
background-color: #fcfcfcbf;
|
|
124
|
+
width: 8px;
|
|
125
|
+
height: 8px;
|
|
126
|
+
box-shadow: 0px 0px 7px 2px rgba(205,205,205,0.25);
|
|
127
|
+
}
|
|
128
|
+
.component_slider .slick-dots li {
|
|
129
|
+
margin: 0;
|
|
130
|
+
}
|
|
131
|
+
.component_slider .slick-dots li.slick-active button {
|
|
132
|
+
background-color: #FFFFFF;
|
|
133
|
+
}
|
|
134
|
+
.component_slider .slick-dots {
|
|
135
|
+
bottom: 0;
|
|
136
|
+
padding: 0;
|
|
137
|
+
margin-left: 15px;
|
|
138
|
+
text-align: left;
|
|
139
|
+
}
|
|
140
|
+
.component_slider div[class*="slider-bannerWrapper"] {
|
|
141
|
+
border-radius: 10px;
|
|
142
|
+
}
|
|
143
|
+
`}
|
|
144
|
+
</style>
|
|
145
|
+
</div>
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Props for {@link Slider}
|
|
151
|
+
*
|
|
152
|
+
* @typedef props
|
|
153
|
+
*
|
|
154
|
+
* @property {Object} classes An object containing the class names for the Slider
|
|
155
|
+
* @property {String} classes.root CSS class for the slider root element
|
|
156
|
+
* @property {String} classes.bannerRoot CSS class for the child banner item
|
|
157
|
+
* @property {String} classes.bannerLink CSS class for the child banner item
|
|
158
|
+
* @property {String} classes.bannerWrapper CSS class for the child banner item
|
|
159
|
+
* @property {String} classes.bannerPosterOverlay CSS class for the child banner item
|
|
160
|
+
* @property {String} minHeight CSS minimum height property
|
|
161
|
+
* @property {String} autoplay Whether the slider should autoplay
|
|
162
|
+
* @property {String} autoplaySpeed The speed at which the autoplay should move the slide on
|
|
163
|
+
* @property {String} fade Fade between slides
|
|
164
|
+
* @property {String} infinite Whether to infinitely scroll the slider
|
|
165
|
+
* @property {String} showArrows Whether to show arrows on the slide for navigation
|
|
166
|
+
* @property {String} showDots Whether to show navigation dots at the bottom of the slider
|
|
167
|
+
* @property {String} textAlign Alignment of content within the slider
|
|
168
|
+
* @property {String} border CSS border property
|
|
169
|
+
* @property {String} borderColor CSS border color property
|
|
170
|
+
* @property {String} borderWidth CSS border width property
|
|
171
|
+
* @property {String} borderRadius CSS border radius property
|
|
172
|
+
* @property {String} marginTop CSS margin top property
|
|
173
|
+
* @property {String} marginRight CSS margin right property
|
|
174
|
+
* @property {String} marginBottom CSS margin bottom property
|
|
175
|
+
* @property {String} marginLeft CSS margin left property
|
|
176
|
+
* @property {Array} mediaQueries List of media query rules to be applied to the component
|
|
177
|
+
* @property {String} paddingTop CSS padding top property
|
|
178
|
+
* @property {String} paddingRight CSS padding right property
|
|
179
|
+
* @property {String} paddingBottom CSS padding bottom property
|
|
180
|
+
* @property {String} paddingLeft CSS padding left property
|
|
181
|
+
* @property {Array} cssClasses List of CSS classes to be applied to the component
|
|
182
|
+
*/
|
|
183
|
+
Slider.propTypes = {
|
|
184
|
+
classes: shape({
|
|
185
|
+
root: string,
|
|
186
|
+
bannerRoot: string,
|
|
187
|
+
bannerLink: string,
|
|
188
|
+
bannerWrapper: string,
|
|
189
|
+
bannerPosterOverlay: string
|
|
190
|
+
}),
|
|
191
|
+
appearance: oneOf(['default']),
|
|
192
|
+
minHeight: string,
|
|
193
|
+
autoplay: bool,
|
|
194
|
+
autoplaySpeed: number,
|
|
195
|
+
fade: bool,
|
|
196
|
+
infinite: bool,
|
|
197
|
+
showArrows: bool,
|
|
198
|
+
showDots: bool,
|
|
199
|
+
textAlign: string,
|
|
200
|
+
border: string,
|
|
201
|
+
borderColor: string,
|
|
202
|
+
borderWidth: string,
|
|
203
|
+
borderRadius: string,
|
|
204
|
+
marginTop: string,
|
|
205
|
+
marginRight: string,
|
|
206
|
+
marginBottom: string,
|
|
207
|
+
marginLeft: string,
|
|
208
|
+
mediaQueries: arrayOf(
|
|
209
|
+
shape({
|
|
210
|
+
media: string,
|
|
211
|
+
style: object
|
|
212
|
+
})
|
|
213
|
+
),
|
|
214
|
+
paddingTop: string,
|
|
215
|
+
paddingRight: string,
|
|
216
|
+
paddingBottom: string,
|
|
217
|
+
paddingLeft: string,
|
|
218
|
+
cssClasses: arrayOf(string)
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export default Slider;
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
display: block;
|
|
3
|
+
position: relative;
|
|
4
|
+
touch-action: pan-y;
|
|
5
|
+
user-select: none;
|
|
6
|
+
--leftViewportElement: -99999px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.root :global .slick-current {
|
|
10
|
+
--leftViewportElement: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.bannerRoot {
|
|
14
|
+
composes: root from './banner.module.css';
|
|
15
|
+
min-height: inherit;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.bannerLink {
|
|
19
|
+
composes: link from './banner.module.css';
|
|
20
|
+
min-height: inherit;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.bannerWrapper {
|
|
24
|
+
composes: wrapper from './banner.module.css';
|
|
25
|
+
min-height: inherit;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.bannerPosterOverlay {
|
|
29
|
+
composes: posterOverlay from './banner.module.css';
|
|
30
|
+
min-height: inherit;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.root :global .slick-slider {
|
|
34
|
+
min-height: inherit;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.root :global .slick-list {
|
|
38
|
+
display: block;
|
|
39
|
+
margin: 0;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
padding: 0;
|
|
42
|
+
position: relative;
|
|
43
|
+
min-height: inherit;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.root :global .slick-list:focus {
|
|
47
|
+
outline: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.root :global .slick-list.dragging {
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.root :global .slick-track {
|
|
55
|
+
display: block;
|
|
56
|
+
left: 0;
|
|
57
|
+
margin-left: auto;
|
|
58
|
+
margin-right: auto;
|
|
59
|
+
position: relative;
|
|
60
|
+
top: 0;
|
|
61
|
+
min-height: inherit;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.root :global .slick-track .slick-slide>div {
|
|
65
|
+
min-height: inherit;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.root :global .slick-track:before,
|
|
69
|
+
.root :global .slick-track:after {
|
|
70
|
+
content: '';
|
|
71
|
+
display: table;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.root :global .slick-track:after {
|
|
75
|
+
clear: both;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:global .slick-loading .slick-track {
|
|
79
|
+
visibility: hidden;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.root :global .slick-slide {
|
|
83
|
+
display: none;
|
|
84
|
+
float: left;
|
|
85
|
+
height: 100%;
|
|
86
|
+
min-height: inherit;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
[dir='rtl'] .root :global .slick-slide {
|
|
90
|
+
float: right;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.root :global .slick-slide img {
|
|
94
|
+
display: block;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.root :global .slick-slide.slick-loading img {
|
|
98
|
+
display: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.root :global .slick-slide.dragging img {
|
|
102
|
+
pointer-events: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:global .slick-initialized .slick-slide {
|
|
106
|
+
display: block;
|
|
107
|
+
visibility: hidden;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:global .slick-initialized .slick-slide.slick-active {
|
|
111
|
+
visibility: visible;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
:global .slick-loading .slick-slide {
|
|
115
|
+
visibility: hidden;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.root :global .slick-vertical .slick-loading {
|
|
119
|
+
border: 1px solid transparent;
|
|
120
|
+
display: block;
|
|
121
|
+
height: auto;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.root :global .slick-slider .slick-track,
|
|
125
|
+
.root :global .slick-slider .slick-list {
|
|
126
|
+
transform: translate3d(0, 0, 0);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.root :global .slick-arrow.slick-hidden {
|
|
130
|
+
display: none;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.root :global .slick-prev {
|
|
134
|
+
left: 1.6rem;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.root :global .slick-prev:before {
|
|
138
|
+
content: url("data:image/svg+xml;charset=UTF-8, <svg xmlns='http://www.w3.org/2000/svg' width='32px' height='32px' viewBox='0 0 24 24' fill='none' stroke='black' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round'><line x1='19' y1='12' x2='5' y2='12' /><polyline points='12 19 5 12 12 5' /></svg>");
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.root :global .slick-next {
|
|
142
|
+
right: 1.6rem;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.root :global .slick-next:before {
|
|
146
|
+
content: url("data:image/svg+xml;charset=UTF-8, <svg xmlns='http://www.w3.org/2000/svg' width='32px' height='32px' viewBox='0 0 24 24' fill='none' stroke='black' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round'><line x1='5' y1='12' x2='19' y2='12' /><polyline points='12 5 19 12 12 19' /></svg>");
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.root :global .slick-prev,
|
|
150
|
+
.root :global .slick-next {
|
|
151
|
+
background: rgba(252, 252, 252, 0.75);
|
|
152
|
+
border: none;
|
|
153
|
+
border-radius: 50px;
|
|
154
|
+
color: transparent;
|
|
155
|
+
cursor: pointer;
|
|
156
|
+
display: block;
|
|
157
|
+
font-size: 0;
|
|
158
|
+
height: 40px;
|
|
159
|
+
line-height: 0;
|
|
160
|
+
opacity: 1;
|
|
161
|
+
outline: none;
|
|
162
|
+
padding: 0;
|
|
163
|
+
position: absolute;
|
|
164
|
+
top: 50%;
|
|
165
|
+
transform: translate(0, -50%);
|
|
166
|
+
width: 40px;
|
|
167
|
+
z-index: 101;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.root :global .slick-prev:focus-visible,
|
|
171
|
+
.root :global .slick-next:focus-visible {
|
|
172
|
+
outline: auto;
|
|
173
|
+
outline: -webkit-focus-ring-color auto 1px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.root :global .slick-dots {
|
|
177
|
+
display: block;
|
|
178
|
+
list-style: none;
|
|
179
|
+
margin: 0;
|
|
180
|
+
padding: 20px 0 18px 0;
|
|
181
|
+
text-align: center;
|
|
182
|
+
width: 100%;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.root :global .slick-dots li {
|
|
186
|
+
cursor: pointer;
|
|
187
|
+
display: inline-block;
|
|
188
|
+
height: 15px;
|
|
189
|
+
margin: 0 6px;
|
|
190
|
+
padding: 0;
|
|
191
|
+
position: relative;
|
|
192
|
+
vertical-align: middle;
|
|
193
|
+
width: 15px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.root :global .slick-dots li button {
|
|
197
|
+
outline: none;
|
|
198
|
+
background: rgb(var(--venia-global-color-gray-dark));
|
|
199
|
+
filter: brightness(100%);
|
|
200
|
+
border-radius: 10px;
|
|
201
|
+
box-shadow: none;
|
|
202
|
+
cursor: pointer;
|
|
203
|
+
display: block;
|
|
204
|
+
height: 15px;
|
|
205
|
+
padding: 0;
|
|
206
|
+
text-indent: -99999px;
|
|
207
|
+
transition: 0.5s;
|
|
208
|
+
width: 15px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.root :global .slick-dots li button:hover {
|
|
212
|
+
filter: brightness(80%);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.root :global .slick-dots li button:focus {
|
|
216
|
+
outline: 1px solid;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.root :global .slick-dots li button:active,
|
|
220
|
+
.root :global .slick-dots li button:focus,
|
|
221
|
+
.root :global .slick-dots li button:not(.primary) {
|
|
222
|
+
box-shadow: none;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.root :global .slick-dots li.slick-active button {
|
|
226
|
+
background: #1c1918;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.root :global .slick-current {
|
|
230
|
+
z-index: 1;
|
|
231
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { arrayOf, bool, shape, string, object } from 'prop-types';
|
|
3
|
+
import defaultClasses from './slider.shimmer.module.css';
|
|
4
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
5
|
+
import Shimmer from '@magento/venia-ui/lib/components/Shimmer';
|
|
6
|
+
import { useMediaQuery } from '@magento/peregrine/lib/hooks/useMediaQuery';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Page Builder Slider Shimmer component.
|
|
10
|
+
*
|
|
11
|
+
* @typedef SliderShimmer
|
|
12
|
+
* @kind functional component
|
|
13
|
+
*
|
|
14
|
+
* @param {props} props React component props
|
|
15
|
+
*
|
|
16
|
+
* @returns {React.Element} A React component that displays a Slider Shimmer.
|
|
17
|
+
*/
|
|
18
|
+
const SliderShimmer = props => {
|
|
19
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
20
|
+
const {
|
|
21
|
+
minHeight,
|
|
22
|
+
showDots,
|
|
23
|
+
border,
|
|
24
|
+
borderWidth,
|
|
25
|
+
marginTop = 0,
|
|
26
|
+
marginRight = 0,
|
|
27
|
+
marginBottom = 0,
|
|
28
|
+
marginLeft = 0,
|
|
29
|
+
mediaQueries,
|
|
30
|
+
paddingTop,
|
|
31
|
+
paddingRight,
|
|
32
|
+
paddingBottom,
|
|
33
|
+
paddingLeft,
|
|
34
|
+
cssClasses = []
|
|
35
|
+
} = props;
|
|
36
|
+
|
|
37
|
+
const { styles: mediaQueryStyles } = useMediaQuery({ mediaQueries });
|
|
38
|
+
|
|
39
|
+
const dynamicStyles = {
|
|
40
|
+
minHeight: mediaQueryStyles?.minHeight || minHeight,
|
|
41
|
+
border,
|
|
42
|
+
borderWidth,
|
|
43
|
+
marginTop,
|
|
44
|
+
marginRight,
|
|
45
|
+
marginBottom,
|
|
46
|
+
marginLeft,
|
|
47
|
+
paddingTop,
|
|
48
|
+
paddingRight,
|
|
49
|
+
paddingBottom,
|
|
50
|
+
paddingLeft
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const dotsContainer = showDots ? <div className="slick-dots" /> : null;
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Shimmer
|
|
57
|
+
aria-live="polite"
|
|
58
|
+
aria-busy="true"
|
|
59
|
+
classes={{
|
|
60
|
+
root_rectangle: [
|
|
61
|
+
classes.root,
|
|
62
|
+
classes.shimmerRoot,
|
|
63
|
+
...cssClasses
|
|
64
|
+
].join(' ')
|
|
65
|
+
}}
|
|
66
|
+
style={dynamicStyles}
|
|
67
|
+
>
|
|
68
|
+
<div className="slick-slider">
|
|
69
|
+
<div className="slick-list" />
|
|
70
|
+
{dotsContainer}
|
|
71
|
+
</div>
|
|
72
|
+
</Shimmer>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Props for {@link SliderShimmer}
|
|
78
|
+
*
|
|
79
|
+
* @typedef props
|
|
80
|
+
*
|
|
81
|
+
* @property {Object} classes An object containing the class names for the Slider
|
|
82
|
+
* @property {String} classes.root CSS class for the slider root element
|
|
83
|
+
* @property {String} classes.shimmerRoot CSS class for the slider shimmer
|
|
84
|
+
* root_rectangle element
|
|
85
|
+
* @property {String} minHeight CSS minimum height property
|
|
86
|
+
* @property {String} showDots Whether to show navigation dots at the bottom of the slider
|
|
87
|
+
* @property {String} border CSS border property
|
|
88
|
+
* @property {String} borderWidth CSS border width property
|
|
89
|
+
* @property {String} marginTop CSS margin top property
|
|
90
|
+
* @property {String} marginRight CSS margin right property
|
|
91
|
+
* @property {String} marginBottom CSS margin bottom property
|
|
92
|
+
* @property {String} marginLeft CSS margin left property
|
|
93
|
+
* @property {Array} mediaQueries List of media query rules to be applied to the component
|
|
94
|
+
* @property {String} paddingTop CSS padding top property
|
|
95
|
+
* @property {String} paddingRight CSS padding right property
|
|
96
|
+
* @property {String} paddingBottom CSS padding bottom property
|
|
97
|
+
* @property {String} paddingLeft CSS padding left property
|
|
98
|
+
* @property {Array} cssClasses List of CSS classes to be applied to the component
|
|
99
|
+
*/
|
|
100
|
+
SliderShimmer.propTypes = {
|
|
101
|
+
classes: shape({
|
|
102
|
+
root: string,
|
|
103
|
+
shimmerRoot: string
|
|
104
|
+
}),
|
|
105
|
+
minHeight: string,
|
|
106
|
+
showDots: bool,
|
|
107
|
+
border: string,
|
|
108
|
+
borderWidth: string,
|
|
109
|
+
marginTop: string,
|
|
110
|
+
marginRight: string,
|
|
111
|
+
marginBottom: string,
|
|
112
|
+
marginLeft: string,
|
|
113
|
+
mediaQueries: arrayOf(
|
|
114
|
+
shape({
|
|
115
|
+
media: string,
|
|
116
|
+
style: object
|
|
117
|
+
})
|
|
118
|
+
),
|
|
119
|
+
paddingTop: string,
|
|
120
|
+
paddingRight: string,
|
|
121
|
+
paddingBottom: string,
|
|
122
|
+
paddingLeft: string,
|
|
123
|
+
cssClasses: arrayOf(string)
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export default SliderShimmer;
|