@growth-angels/ds-core 2.0.3 → 2.1.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.
@@ -1,6 +1,7 @@
1
1
  import type { WordpressDefault } from "../../global.types";
2
2
  export type CarouselAttributes = {
3
3
  context?: 'wp-editor';
4
+ initialSlidePerView?: number;
4
5
  slidesPerView?: {
5
6
  xs?: number;
6
7
  sm: number;
@@ -4,7 +4,7 @@ import { Button } from "../../atoms/atoms";
4
4
  import Swiper from "swiper";
5
5
  import { Autoplay, Navigation, Pagination } from "swiper/modules";
6
6
  export const CarouselSwiper = (props) => {
7
- const { children, slidesPerView: slidesPerViewDefault, spaceBetween = 48, navigation, pagination, hasPagination, hasNavigation, loop = false, autoplay, speed, loopOnMobile = false, } = props;
7
+ const { children, initialSlidePerView = 1, slidesPerView: slidesPerViewDefault, spaceBetween = 48, navigation, pagination, hasPagination, hasNavigation, loop = false, autoplay, speed, loopOnMobile = false, } = props;
8
8
  const classes = ["ga-ds-carousel"];
9
9
  if (props.extraClassNames) {
10
10
  if (typeof props.extraClassNames === "string") {
@@ -38,7 +38,7 @@ export const CarouselSwiper = (props) => {
38
38
  }
39
39
  : {
40
40
  modules: [Autoplay, Navigation, Pagination],
41
- slidesPerView: 1,
41
+ slidesPerView: initialSlidePerView,
42
42
  breakpoints: {
43
43
  375: {
44
44
  slidesPerView: slidesPerView.xs ?? 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@growth-angels/ds-core",
3
- "version": "2.0.3",
3
+ "version": "2.1.0",
4
4
  "description": "Design system by Growth Angels",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -2,6 +2,7 @@ import type { WordpressDefault } from "../../global.types"
2
2
 
3
3
  export type CarouselAttributes = {
4
4
  context?: 'wp-editor'
5
+ initialSlidePerView?: number
5
6
  slidesPerView?: {
6
7
  xs?: number
7
8
  sm: number
@@ -7,6 +7,7 @@ import { Autoplay, Navigation, Pagination } from "swiper/modules"
7
7
  export const CarouselSwiper = (props: CarouselProps) => {
8
8
  const {
9
9
  children,
10
+ initialSlidePerView = 1,
10
11
  slidesPerView: slidesPerViewDefault,
11
12
  spaceBetween = 48,
12
13
  navigation,
@@ -56,7 +57,7 @@ export const CarouselSwiper = (props: CarouselProps) => {
56
57
  }
57
58
  : {
58
59
  modules: [Autoplay, Navigation, Pagination],
59
- slidesPerView: 1,
60
+ slidesPerView: initialSlidePerView,
60
61
  breakpoints: {
61
62
  375: {
62
63
  slidesPerView: (slidesPerView as Record<string, number>).xs ?? 1,