@growth-angels/ds-core 1.23.0 → 1.25.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.
@@ -37,7 +37,7 @@ export const Carousel = (props) => {
37
37
  const breakpoint = useBreakpointObserver({ xs: 375, sm: 576, md: 768, lg: 992, xl: 1200, xxl: 1440 });
38
38
  useEffect(() => {
39
39
  const currentSlidesPerView = slidesPerView[breakpoint] ??
40
- (typeof slidesPerView === "number" ? slidesPerView : slidesPerView.xl ?? 1);
40
+ (typeof slidesPerView === "number" ? slidesPerView : (slidesPerView.xl ?? 1));
41
41
  setTotalPages(calculatePages(currentSlidesPerView));
42
42
  }, [breakpoint, slidesPerView, slides.length]);
43
43
  useEffect(() => {
@@ -167,7 +167,7 @@ export const Carousel = (props) => {
167
167
  }) }), _jsxs("div", { className: "ga-ds-carousel__navigation", children: [pagination && displayPagination && (_jsx(CarouselPagination, { totalPages: totalPages, activeSlideIndex: activeSlideIndex, goTo: goTo, clickable: pagination.clickable })), displayNavigation && navigation?.positionY === "bottom" && (_jsx(CarouselNavigation, { goPrev: goPrev, goNext: goNext, isAtStart: isAtStart, isAtEnd: isAtEnd }))] })] }));
168
168
  };
169
169
  const CarouselNavigation = ({ goPrev, goNext, isAtStart, isAtEnd, }) => {
170
- return (_jsxs("div", { className: `ga-ds-carousel__arrows`, children: [_jsx(Button, { extraClassNames: ["ga-ds-carousel__button", "ga-ds-carousel__button--prev"], icon: "chevron-left", onClick: goPrev, disabled: isAtStart }), _jsx(Button, { extraClassNames: ["ga-ds-carousel__button", "ga-ds-carousel__button--next"], icon: "chevron-right", onClick: goNext, disabled: isAtEnd })] }));
170
+ return (_jsxs("div", { className: `ga-ds-carousel__arrows`, children: [_jsx(Button, { extraClassNames: ["ga-ds-carousel__button", "ga-ds-carousel__button--prev"], icon: "chevron-left", onClick: goPrev, disabled: isAtStart, "aria-label": "Slide pr\u00E9c\u00E9dente" }), _jsx(Button, { extraClassNames: ["ga-ds-carousel__button", "ga-ds-carousel__button--next"], icon: "chevron-right", onClick: goNext, disabled: isAtEnd, "aria-label": "Slide suivante" })] }));
171
171
  };
172
172
  const CarouselPagination = ({ totalPages, activeSlideIndex, goTo, clickable, }) => {
173
173
  return (_jsx("div", { className: "ga-ds-carousel__dots", children: Array.from({ length: totalPages }, (_, index) => index).map((_, index) => (_jsx("span", { className: `ga-ds-carousel__dot ${index === activeSlideIndex ? "ga-ds-carousel__dot--active" : ""}`, onClick: () => clickable && goTo(index), style: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@growth-angels/ds-core",
3
- "version": "1.23.0",
3
+ "version": "1.25.0",
4
4
  "description": "Design system by Growth Angels",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -28,6 +28,9 @@
28
28
  "dist",
29
29
  "src"
30
30
  ],
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
31
34
  "scripts": {
32
35
  "clean": "rm -rf dist",
33
36
  "dev": "concurrently \"tsc --watch --preserveWatchOutput\" \"storybook dev -p 6006\"",
@@ -53,7 +53,7 @@ export const Carousel = (props: CarouselProps) => {
53
53
  useEffect(() => {
54
54
  const currentSlidesPerView =
55
55
  (slidesPerView as Record<string, number>)[breakpoint] ??
56
- (typeof slidesPerView === "number" ? slidesPerView : (slidesPerView as any).xl ?? 1)
56
+ (typeof slidesPerView === "number" ? slidesPerView : ((slidesPerView as any).xl ?? 1))
57
57
 
58
58
  setTotalPages(calculatePages(currentSlidesPerView))
59
59
  }, [breakpoint, slidesPerView, slides.length])
@@ -104,7 +104,7 @@ export const Carousel = (props: CarouselProps) => {
104
104
  }, [slides.length, loop])
105
105
 
106
106
  const style = Object.fromEntries(
107
- Object.entries(slidesPerView).map(([key, value]) => [`--ga-ds-slides-per-view-${key}`, `${value}`])
107
+ Object.entries(slidesPerView).map(([key, value]) => [`--ga-ds-slides-per-view-${key}`, `${value}`]),
108
108
  )
109
109
 
110
110
  const goPrev = () => {
@@ -249,12 +249,14 @@ const CarouselNavigation = ({
249
249
  icon="chevron-left"
250
250
  onClick={goPrev}
251
251
  disabled={isAtStart}
252
+ aria-label="Slide précédente"
252
253
  />
253
254
  <Button
254
255
  extraClassNames={["ga-ds-carousel__button", "ga-ds-carousel__button--next"]}
255
256
  icon="chevron-right"
256
257
  onClick={goNext}
257
258
  disabled={isAtEnd}
259
+ aria-label="Slide suivante"
258
260
  />
259
261
  </div>
260
262
  )