@growth-angels/ds-core 1.17.0 → 1.18.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/dist/layout/Container/Container.js +4 -3
- package/dist/layout/Container/Container.types.d.ts +2 -0
- package/dist/layout/Grid/Grid.js +3 -3
- package/dist/layout/Grid/Grid.types.d.ts +2 -0
- package/dist/lib/hydrate-carousel.d.ts +2 -0
- package/dist/lib/hydrate-carousel.js +8 -1
- package/dist/organisms/Carousel/CarouselSwiper.js +39 -25
- package/package.json +1 -1
- package/src/layout/Container/Container.tsx +4 -3
- package/src/layout/Container/Container.types.ts +2 -0
- package/src/layout/Grid/Grid.tsx +3 -3
- package/src/layout/Grid/Grid.types.ts +2 -0
- package/src/lib/hydrate-carousel.tsx +8 -1
- package/src/organisms/Carousel/Carousel.scss +4 -3
- package/src/organisms/Carousel/CarouselSwiper.tsx +46 -32
- package/src/utils/_spacings.scss +14 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
export const Container = (props) => {
|
|
3
|
-
const { size, children, style, padding, margin, stretch, id } = props;
|
|
3
|
+
const { size, children, style, padding, margin, stretch, id, paddingPosition, marginPosition } = props;
|
|
4
|
+
console.log("Container props", props);
|
|
4
5
|
const classes = [
|
|
5
6
|
"ga-ds-container",
|
|
6
7
|
`ga-ds-container--${size}`,
|
|
7
|
-
...(padding ? [`ga-ds-util-padding--${padding}`] : []),
|
|
8
|
-
...(margin ? [`ga-ds-util-margin--${margin}`] : []),
|
|
8
|
+
...(padding ? [`ga-ds-util-padding${paddingPosition ? `-${paddingPosition}` : ""}--${padding}`] : []),
|
|
9
|
+
...(margin ? [`ga-ds-util-margin${marginPosition ? `-${marginPosition}` : ""}--${margin}`] : []),
|
|
9
10
|
...(stretch ? [`ga-ds-container-stretch--${stretch}`] : []),
|
|
10
11
|
...(props.extraClassNames || []),
|
|
11
12
|
];
|
package/dist/layout/Grid/Grid.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
export const Grid = (props) => {
|
|
3
|
-
const { children, alignItems, justifyContent, extraClassNames, padding, margin } = props;
|
|
3
|
+
const { children, alignItems, justifyContent, extraClassNames, padding, margin, paddingPosition, marginPosition } = props;
|
|
4
4
|
const classNames = [
|
|
5
5
|
"ga-ds-grid",
|
|
6
|
-
...(padding ? [`ga-ds-util-padding--${padding}`] : []),
|
|
7
|
-
...(margin ? [`ga-ds-util-margin--${margin}`] : []),
|
|
6
|
+
...(padding ? [`ga-ds-util-padding${paddingPosition ? `-${paddingPosition}` : ""}--${padding}`] : []),
|
|
7
|
+
...(margin ? [`ga-ds-util-margin${marginPosition ? `-${marginPosition}` : ""}--${margin}`] : []),
|
|
8
8
|
...(extraClassNames || []),
|
|
9
9
|
];
|
|
10
10
|
return (_jsx("div", { className: classNames.join(" "), style: { ...(alignItems !== "none" && { alignItems }), ...(justifyContent !== "none" && { justifyContent }) }, children: children }));
|
|
@@ -2,6 +2,8 @@ import { WordpressDefault } from "../../global.types";
|
|
|
2
2
|
export interface GridAttributes {
|
|
3
3
|
alignItems: 'flex-start' | 'center' | 'flex-end' | 'none';
|
|
4
4
|
justifyContent: 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'none';
|
|
5
|
+
paddingPosition?: 'top' | 'bottom';
|
|
6
|
+
marginPosition?: 'top' | 'bottom';
|
|
5
7
|
}
|
|
6
8
|
export interface GridProps extends WordpressDefault, GridAttributes {
|
|
7
9
|
children: React.ReactNode | React.ReactNode[];
|
|
@@ -2,9 +2,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { CarouselSwiper } from "../organisms/Carousel/CarouselSwiper";
|
|
3
3
|
import { useReactAdapter } from "../hooks/useReactAdaptater";
|
|
4
4
|
import { NativeChildWrapper } from "./utils/native-child-wrapper";
|
|
5
|
+
import Swiper from "swiper";
|
|
6
|
+
import * as modules from "swiper/modules";
|
|
7
|
+
window.Swiper = {
|
|
8
|
+
instance: Swiper,
|
|
9
|
+
modules,
|
|
10
|
+
};
|
|
11
|
+
import "swiper/css";
|
|
12
|
+
import "swiper/css/autoplay";
|
|
5
13
|
const { createElement, createRoot } = useReactAdapter();
|
|
6
14
|
export function HydrateCarousel(islands) {
|
|
7
|
-
console.log("HydrateCarousel called with islands:", islands);
|
|
8
15
|
islands?.forEach((carousel) => {
|
|
9
16
|
const Component = CarouselSwiper;
|
|
10
17
|
if (!Component)
|
|
@@ -1,36 +1,61 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useReactAdapter } from "../../hooks/useReactAdaptater";
|
|
3
|
-
import { useBreakpointObserver } from "../../hooks/useBreakPointObserver";
|
|
4
3
|
import { Button } from "../../atoms/atoms";
|
|
4
|
+
import Swiper from "swiper";
|
|
5
|
+
import { Autoplay, Navigation, Pagination } from "swiper/modules";
|
|
5
6
|
export const CarouselSwiper = (props) => {
|
|
6
|
-
const { children, slidesPerView: slidesPerViewDefault, spaceBetween =
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
const { children, slidesPerView: slidesPerViewDefault, spaceBetween = 48, navigation, pagination, hasPagination, hasNavigation, loop = false, } = props;
|
|
8
|
+
const classes = ["ga-ds-carousel"];
|
|
9
|
+
if (props.extraClassNames) {
|
|
10
|
+
if (typeof props.extraClassNames === "string") {
|
|
11
|
+
classes.push(props.extraClassNames);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
classes.push(...props.extraClassNames);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
9
17
|
if (Swiper) {
|
|
10
18
|
const slidesPerView = { xs: 1, ...slidesPerViewDefault };
|
|
11
19
|
const { useEffect, useState, useRef, Children } = useReactAdapter();
|
|
12
20
|
const trackRef = useRef(null);
|
|
21
|
+
const containerRef = useRef(null);
|
|
13
22
|
const slides = Children.toArray(children);
|
|
14
|
-
const breakpoint = useBreakpointObserver({ xs: 375, sm: 576, md: 768, lg: 992, xl: 1200, xxl: 1440 });
|
|
15
23
|
const [swiperInstance, setSwiperInstance] = useState(null);
|
|
16
24
|
useEffect(() => {
|
|
17
|
-
if (trackRef.current && !swiperInstance) {
|
|
18
|
-
const
|
|
19
|
-
(typeof slidesPerView === "number" ? slidesPerView : slidesPerView.xl ?? 1);
|
|
25
|
+
if (trackRef.current && containerRef.current && !swiperInstance) {
|
|
26
|
+
const { current } = containerRef;
|
|
20
27
|
const swiper = new Swiper(trackRef.current, {
|
|
21
28
|
modules: [Autoplay, Navigation, Pagination],
|
|
22
|
-
slidesPerView:
|
|
29
|
+
slidesPerView: 1,
|
|
30
|
+
breakpoints: {
|
|
31
|
+
375: {
|
|
32
|
+
slidesPerView: slidesPerView.xs ?? 1,
|
|
33
|
+
},
|
|
34
|
+
576: {
|
|
35
|
+
slidesPerView: slidesPerView.sm ?? 1,
|
|
36
|
+
},
|
|
37
|
+
768: {
|
|
38
|
+
slidesPerView: slidesPerView.md ?? 1,
|
|
39
|
+
},
|
|
40
|
+
992: {
|
|
41
|
+
slidesPerView: slidesPerView.lg ?? 1,
|
|
42
|
+
},
|
|
43
|
+
1200: {
|
|
44
|
+
slidesPerView: slidesPerView.xl ?? 1,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
23
47
|
spaceBetween,
|
|
24
48
|
loop,
|
|
49
|
+
mousewheel: true,
|
|
25
50
|
navigation: hasNavigation
|
|
26
51
|
? {
|
|
27
|
-
nextEl: ".ga-ds-carousel__button--next",
|
|
28
|
-
prevEl: ".ga-ds-carousel__button--prev",
|
|
52
|
+
nextEl: current.querySelector(".ga-ds-carousel__button--next"),
|
|
53
|
+
prevEl: current.querySelector(".ga-ds-carousel__button--prev"),
|
|
29
54
|
}
|
|
30
55
|
: false,
|
|
31
56
|
pagination: hasPagination
|
|
32
57
|
? {
|
|
33
|
-
el: ".ga-ds-carousel__dots",
|
|
58
|
+
el: current.querySelector(".ga-ds-carousel__dots"),
|
|
34
59
|
clickable: pagination ? pagination.clickable : false,
|
|
35
60
|
bulletClass: "ga-ds-carousel__dot",
|
|
36
61
|
bulletActiveClass: "ga-ds-carousel__dot--active",
|
|
@@ -39,19 +64,8 @@ export const CarouselSwiper = (props) => {
|
|
|
39
64
|
});
|
|
40
65
|
setSwiperInstance(swiper);
|
|
41
66
|
}
|
|
42
|
-
}, [
|
|
43
|
-
|
|
44
|
-
slidesPerView,
|
|
45
|
-
spaceBetween,
|
|
46
|
-
navigation,
|
|
47
|
-
pagination,
|
|
48
|
-
hasNavigation,
|
|
49
|
-
hasPagination,
|
|
50
|
-
loop,
|
|
51
|
-
trackRef,
|
|
52
|
-
swiperInstance,
|
|
53
|
-
]);
|
|
54
|
-
return (_jsxs("div", { className: "ga-carousel-swiper", children: [_jsx("div", { className: "swiper", ref: trackRef, children: _jsx("div", { className: "swiper-wrapper", children: slides.map((slide, index) => (_jsx("div", { className: "swiper-slide", children: slide }, index))) }) }), _jsxs("div", { className: "ga-ds-carousel__navigation", children: [_jsx("div", { className: "ga-ds-carousel__dots" }), _jsx(CarouselNavigation, {})] })] }));
|
|
67
|
+
}, [slidesPerView, spaceBetween, navigation, pagination, hasNavigation, hasPagination, loop, trackRef, swiperInstance]);
|
|
68
|
+
return (_jsxs("div", { className: `ga-carousel-swiper ${classes.join(" ")}`, ref: containerRef, children: [_jsx("div", { className: "swiper", ref: trackRef, children: _jsx("div", { className: "swiper-wrapper", children: slides.map((slide, index) => (_jsx("div", { className: "swiper-slide", children: slide }, index))) }) }), hasNavigation || hasPagination ? (_jsxs("div", { className: "ga-ds-carousel__navigation", children: [hasPagination && _jsx("div", { className: "ga-ds-carousel__dots" }), hasNavigation && _jsx(CarouselNavigation, {})] })) : null] }));
|
|
55
69
|
}
|
|
56
70
|
return _jsx("div", { children: "Swiper library is not loaded." });
|
|
57
71
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { ContainerProps } from "./Container.types"
|
|
2
2
|
|
|
3
3
|
export const Container = (props: ContainerProps) => {
|
|
4
|
-
const { size, children, style, padding, margin, stretch, id } = props
|
|
4
|
+
const { size, children, style, padding, margin, stretch, id, paddingPosition, marginPosition } = props
|
|
5
|
+
console.log("Container props", props)
|
|
5
6
|
const classes = [
|
|
6
7
|
"ga-ds-container",
|
|
7
8
|
`ga-ds-container--${size}`,
|
|
8
|
-
...(padding ? [`ga-ds-util-padding--${padding}`] : []),
|
|
9
|
-
...(margin ? [`ga-ds-util-margin--${margin}`] : []),
|
|
9
|
+
...(padding ? [`ga-ds-util-padding${paddingPosition ? `-${paddingPosition}` : ""}--${padding}`] : []),
|
|
10
|
+
...(margin ? [`ga-ds-util-margin${marginPosition ? `-${marginPosition}` : ""}--${margin}`] : []),
|
|
10
11
|
...(stretch ? [`ga-ds-container-stretch--${stretch}`] : []),
|
|
11
12
|
...(props.extraClassNames || []),
|
|
12
13
|
]
|
|
@@ -8,4 +8,6 @@ export interface ContainerProps extends WordpressDefault, React.HTMLAttributes<H
|
|
|
8
8
|
stretch?:ContainerStretch
|
|
9
9
|
children: React.ReactNode | React.ReactNode[];
|
|
10
10
|
style?: React.CSSProperties;
|
|
11
|
+
paddingPosition?: "top" | "bottom";
|
|
12
|
+
marginPosition?: "top" | "bottom";
|
|
11
13
|
}
|
package/src/layout/Grid/Grid.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { GridProps } from "./Grid.types"
|
|
2
2
|
export const Grid = (props: GridProps): JSX.Element => {
|
|
3
|
-
const { children, alignItems, justifyContent, extraClassNames, padding, margin } = props
|
|
3
|
+
const { children, alignItems, justifyContent, extraClassNames, padding, margin, paddingPosition, marginPosition } = props
|
|
4
4
|
const classNames = [
|
|
5
5
|
"ga-ds-grid",
|
|
6
|
-
...(padding ? [`ga-ds-util-padding--${padding}`] : []),
|
|
7
|
-
...(margin ? [`ga-ds-util-margin--${margin}`] : []),
|
|
6
|
+
...(padding ? [`ga-ds-util-padding${paddingPosition ? `-${paddingPosition}` : ""}--${padding}`] : []),
|
|
7
|
+
...(margin ? [`ga-ds-util-margin${marginPosition ? `-${marginPosition}` : ""}--${margin}`] : []),
|
|
8
8
|
...(extraClassNames || []),
|
|
9
9
|
]
|
|
10
10
|
|
|
@@ -3,6 +3,8 @@ import { WordpressDefault } from "../../global.types";
|
|
|
3
3
|
export interface GridAttributes {
|
|
4
4
|
alignItems: 'flex-start' | 'center' | 'flex-end' | 'none'
|
|
5
5
|
justifyContent: 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'none'
|
|
6
|
+
paddingPosition?: 'top' | 'bottom'
|
|
7
|
+
marginPosition?: 'top' | 'bottom'
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
export interface GridProps extends WordpressDefault, GridAttributes {
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { CarouselSwiper } from "../organisms/Carousel/CarouselSwiper"
|
|
2
2
|
import { useReactAdapter } from "../hooks/useReactAdaptater"
|
|
3
3
|
import { NativeChildWrapper } from "./utils/native-child-wrapper"
|
|
4
|
+
import Swiper from "swiper"
|
|
5
|
+
import * as modules from "swiper/modules"
|
|
6
|
+
;(window as any).Swiper = {
|
|
7
|
+
instance: Swiper,
|
|
8
|
+
modules,
|
|
9
|
+
}
|
|
10
|
+
import "swiper/css"
|
|
11
|
+
import "swiper/css/autoplay"
|
|
4
12
|
const { createElement, createRoot } = useReactAdapter()
|
|
5
13
|
|
|
6
14
|
export function HydrateCarousel(islands: NodeListOf<Element> | null) {
|
|
7
|
-
console.log("HydrateCarousel called with islands:", islands)
|
|
8
15
|
islands?.forEach((carousel) => {
|
|
9
16
|
const Component = CarouselSwiper
|
|
10
17
|
if (!Component) return
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
&__track {
|
|
12
12
|
--ga-ds-slides-per-view: 1;
|
|
13
13
|
display: grid;
|
|
14
|
-
grid-auto-flow: column;
|
|
14
|
+
grid-auto-flow: column;
|
|
15
15
|
grid-auto-columns: calc(
|
|
16
16
|
(100% - (var(--ga-ds-space-between, 1rem) * (var(--ga-ds-slides-per-view, 3) - 1))) / var(--ga-ds-slides-per-view, 3)
|
|
17
17
|
);
|
|
@@ -72,13 +72,14 @@
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
&__dots {
|
|
75
|
+
--dot-size: 1rem;
|
|
75
76
|
display: flex;
|
|
76
77
|
gap: var(--ga-ds-gap, 1rem);
|
|
77
78
|
|
|
78
79
|
.ga-ds-carousel__dot {
|
|
79
80
|
display: block;
|
|
80
|
-
width:
|
|
81
|
-
height:
|
|
81
|
+
width: var(--dot-size);
|
|
82
|
+
height: var(--dot-size);
|
|
82
83
|
border-radius: 50%;
|
|
83
84
|
background-color: #e2e2e2;
|
|
84
85
|
|
|
@@ -1,51 +1,74 @@
|
|
|
1
1
|
import { useReactAdapter } from "../../hooks/useReactAdaptater"
|
|
2
|
-
import { useBreakpointObserver } from "../../hooks/useBreakPointObserver"
|
|
3
2
|
import { CarouselProps } from "./Carousel.types"
|
|
4
3
|
import { Button } from "../../atoms/atoms"
|
|
4
|
+
import Swiper from "swiper"
|
|
5
|
+
import { Autoplay, Navigation, Pagination } from "swiper/modules"
|
|
5
6
|
|
|
6
7
|
export const CarouselSwiper = (props: CarouselProps) => {
|
|
7
8
|
const {
|
|
8
9
|
children,
|
|
9
10
|
slidesPerView: slidesPerViewDefault,
|
|
10
|
-
spaceBetween =
|
|
11
|
+
spaceBetween = 48,
|
|
11
12
|
navigation,
|
|
12
13
|
pagination,
|
|
13
|
-
context,
|
|
14
14
|
hasPagination,
|
|
15
15
|
hasNavigation,
|
|
16
16
|
loop = false,
|
|
17
17
|
} = props
|
|
18
|
-
|
|
19
|
-
const
|
|
18
|
+
|
|
19
|
+
const classes = ["ga-ds-carousel"]
|
|
20
|
+
|
|
21
|
+
if (props.extraClassNames) {
|
|
22
|
+
if (typeof props.extraClassNames === "string") {
|
|
23
|
+
classes.push(props.extraClassNames)
|
|
24
|
+
} else {
|
|
25
|
+
classes.push(...props.extraClassNames)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
20
28
|
if (Swiper) {
|
|
21
29
|
const slidesPerView = { xs: 1, ...slidesPerViewDefault }
|
|
22
30
|
const { useEffect, useState, useRef, Children } = useReactAdapter()
|
|
23
31
|
const trackRef = useRef<HTMLDivElement>(null)
|
|
32
|
+
const containerRef = useRef<HTMLDivElement>(null)
|
|
24
33
|
const slides = Children.toArray(children)
|
|
25
34
|
|
|
26
|
-
const breakpoint = useBreakpointObserver({ xs: 375, sm: 576, md: 768, lg: 992, xl: 1200, xxl: 1440 })
|
|
27
35
|
const [swiperInstance, setSwiperInstance] = useState<any>(null)
|
|
28
36
|
|
|
29
37
|
useEffect(() => {
|
|
30
|
-
if (trackRef.current && !swiperInstance) {
|
|
31
|
-
const
|
|
32
|
-
(slidesPerView as Record<string, number>)[breakpoint] ??
|
|
33
|
-
(typeof slidesPerView === "number" ? slidesPerView : (slidesPerView as any).xl ?? 1)
|
|
34
|
-
|
|
38
|
+
if (trackRef.current && containerRef.current && !swiperInstance) {
|
|
39
|
+
const { current } = containerRef
|
|
35
40
|
const swiper = new Swiper(trackRef.current, {
|
|
36
41
|
modules: [Autoplay, Navigation, Pagination],
|
|
37
|
-
slidesPerView:
|
|
42
|
+
slidesPerView: 1,
|
|
43
|
+
breakpoints: {
|
|
44
|
+
375: {
|
|
45
|
+
slidesPerView: (slidesPerView as Record<string, number>).xs ?? 1,
|
|
46
|
+
},
|
|
47
|
+
576: {
|
|
48
|
+
slidesPerView: (slidesPerView as Record<string, number>).sm ?? 1,
|
|
49
|
+
},
|
|
50
|
+
768: {
|
|
51
|
+
slidesPerView: (slidesPerView as Record<string, number>).md ?? 1,
|
|
52
|
+
},
|
|
53
|
+
992: {
|
|
54
|
+
slidesPerView: (slidesPerView as Record<string, number>).lg ?? 1,
|
|
55
|
+
},
|
|
56
|
+
1200: {
|
|
57
|
+
slidesPerView: (slidesPerView as Record<string, number>).xl ?? 1,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
38
60
|
spaceBetween,
|
|
39
61
|
loop,
|
|
62
|
+
mousewheel: true,
|
|
40
63
|
navigation: hasNavigation
|
|
41
64
|
? {
|
|
42
|
-
nextEl: ".ga-ds-carousel__button--next",
|
|
43
|
-
prevEl: ".ga-ds-carousel__button--prev",
|
|
65
|
+
nextEl: current.querySelector(".ga-ds-carousel__button--next") as HTMLElement,
|
|
66
|
+
prevEl: current.querySelector(".ga-ds-carousel__button--prev") as HTMLElement,
|
|
44
67
|
}
|
|
45
68
|
: false,
|
|
46
69
|
pagination: hasPagination
|
|
47
70
|
? {
|
|
48
|
-
el: ".ga-ds-carousel__dots",
|
|
71
|
+
el: current.querySelector(".ga-ds-carousel__dots") as HTMLElement,
|
|
49
72
|
clickable: pagination ? pagination.clickable : false,
|
|
50
73
|
bulletClass: "ga-ds-carousel__dot",
|
|
51
74
|
bulletActiveClass: "ga-ds-carousel__dot--active",
|
|
@@ -55,21 +78,10 @@ export const CarouselSwiper = (props: CarouselProps) => {
|
|
|
55
78
|
|
|
56
79
|
setSwiperInstance(swiper)
|
|
57
80
|
}
|
|
58
|
-
}, [
|
|
59
|
-
breakpoint,
|
|
60
|
-
slidesPerView,
|
|
61
|
-
spaceBetween,
|
|
62
|
-
navigation,
|
|
63
|
-
pagination,
|
|
64
|
-
hasNavigation,
|
|
65
|
-
hasPagination,
|
|
66
|
-
loop,
|
|
67
|
-
trackRef,
|
|
68
|
-
swiperInstance,
|
|
69
|
-
])
|
|
81
|
+
}, [slidesPerView, spaceBetween, navigation, pagination, hasNavigation, hasPagination, loop, trackRef, swiperInstance])
|
|
70
82
|
|
|
71
83
|
return (
|
|
72
|
-
<div className=
|
|
84
|
+
<div className={`ga-carousel-swiper ${classes.join(" ")}`} ref={containerRef}>
|
|
73
85
|
<div className="swiper" ref={trackRef}>
|
|
74
86
|
<div className="swiper-wrapper">
|
|
75
87
|
{slides.map((slide, index) => (
|
|
@@ -79,10 +91,12 @@ export const CarouselSwiper = (props: CarouselProps) => {
|
|
|
79
91
|
))}
|
|
80
92
|
</div>
|
|
81
93
|
</div>
|
|
82
|
-
|
|
83
|
-
<div className="ga-ds-
|
|
84
|
-
|
|
85
|
-
|
|
94
|
+
{hasNavigation || hasPagination ? (
|
|
95
|
+
<div className="ga-ds-carousel__navigation">
|
|
96
|
+
{hasPagination && <div className="ga-ds-carousel__dots"></div>}
|
|
97
|
+
{hasNavigation && <CarouselNavigation />}
|
|
98
|
+
</div>
|
|
99
|
+
) : null}
|
|
86
100
|
</div>
|
|
87
101
|
)
|
|
88
102
|
}
|
package/src/utils/_spacings.scss
CHANGED
|
@@ -5,6 +5,14 @@ $spacingsMap: ("xsmall", "small", "medium", "large", "xlarge");
|
|
|
5
5
|
padding-top: var(--ga-spacings-padding-#{$value});
|
|
6
6
|
padding-bottom: var(--ga-spacings-padding-#{$value});
|
|
7
7
|
}
|
|
8
|
+
|
|
9
|
+
.ga-ds-util-padding-top--#{$value} {
|
|
10
|
+
padding-top: var(--ga-spacings-padding-#{$value});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ga-ds-util-padding-bottom--#{$value} {
|
|
14
|
+
padding-bottom: var(--ga-spacings-padding-#{$value});
|
|
15
|
+
}
|
|
8
16
|
}
|
|
9
17
|
|
|
10
18
|
$marginsMap: ("small", "medium", "large");
|
|
@@ -14,4 +22,10 @@ $marginsMap: ("small", "medium", "large");
|
|
|
14
22
|
margin-top: var(--ga-spacings-margin-#{$value});
|
|
15
23
|
margin-bottom: var(--ga-spacings-margin-#{$value});
|
|
16
24
|
}
|
|
25
|
+
.ga-ds-util-margin-top--#{$value} {
|
|
26
|
+
margin-top: var(--ga-spacings-margin-#{$value});
|
|
27
|
+
}
|
|
28
|
+
.ga-ds-util-margin-bottom--#{$value} {
|
|
29
|
+
margin-bottom: var(--ga-spacings-margin-#{$value});
|
|
30
|
+
}
|
|
17
31
|
}
|