@growth-angels/ds-core 1.25.0 → 1.25.2

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.
@@ -16,6 +16,7 @@ export const Button = (props) => {
16
16
  };
17
17
  return React.createElement(as || "button", {
18
18
  ...restProps,
19
+ "aria-label": props.ariaLabel,
19
20
  className: classNames.join(" "),
20
21
  onClick: handleClick,
21
22
  }, _jsxs(_Fragment, { children: [icon && _jsx(Icon, { name: icon, size: "sm" }), children && children] }));
@@ -8,6 +8,7 @@ export type ButtonProps<T extends ElementType = "button"> = {
8
8
  icon?: string;
9
9
  preventDefault?: boolean;
10
10
  children?: ReactNode;
11
+ ariaLabel?: string;
11
12
  } & WordpressDefault & Omit<ComponentPropsWithoutRef<T>, "as" | "className" | "onClick"> & {
12
13
  onClick?: MouseEventHandler<ElementRef<T>>;
13
14
  };
@@ -74,5 +74,5 @@ export const CarouselSwiper = (props) => {
74
74
  return _jsx("div", { children: "Swiper library is not loaded." });
75
75
  };
76
76
  const CarouselNavigation = () => {
77
- return (_jsxs("div", { className: `ga-ds-carousel__arrows`, children: [_jsx(Button, { extraClassNames: ["ga-ds-carousel__button", "ga-ds-carousel__button--prev"], icon: "chevron-left" }), _jsx(Button, { extraClassNames: ["ga-ds-carousel__button", "ga-ds-carousel__button--next"], icon: "chevron-right" })] }));
77
+ return (_jsxs("div", { className: `ga-ds-carousel__arrows`, children: [_jsx(Button, { extraClassNames: ["ga-ds-carousel__button", "ga-ds-carousel__button--prev"], icon: "chevron-left", "aria-label": "Slide pr\u00E9c\u00E9dente" }), _jsx(Button, { extraClassNames: ["ga-ds-carousel__button", "ga-ds-carousel__button--next"], icon: "chevron-right", "aria-label": "Slide suivante" })] }));
78
78
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@growth-angels/ds-core",
3
- "version": "1.25.0",
3
+ "version": "1.25.2",
4
4
  "description": "Design system by Growth Angels",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -18,12 +18,13 @@ export const Button = <T extends React.ElementType = "button">(props: ButtonProp
18
18
  as || "button",
19
19
  {
20
20
  ...restProps,
21
+ "aria-label": props.ariaLabel,
21
22
  className: classNames.join(" "),
22
23
  onClick: handleClick,
23
24
  },
24
25
  <>
25
26
  {icon && <Icon name={icon} size="sm" />}
26
27
  {children && children}
27
- </>
28
+ </>,
28
29
  )
29
30
  }
@@ -10,6 +10,7 @@ export type ButtonProps<T extends ElementType = "button"> = {
10
10
  icon?: string
11
11
  preventDefault?: boolean
12
12
  children?: ReactNode
13
+ ariaLabel?: string
13
14
  } & WordpressDefault &
14
15
  Omit<ComponentPropsWithoutRef<T>, "as" | "className" | "onClick"> & {
15
16
  onClick?: MouseEventHandler<ElementRef<T>>
@@ -112,8 +112,16 @@ export const CarouselSwiper = (props: CarouselProps) => {
112
112
  const CarouselNavigation = () => {
113
113
  return (
114
114
  <div className={`ga-ds-carousel__arrows`}>
115
- <Button extraClassNames={["ga-ds-carousel__button", "ga-ds-carousel__button--prev"]} icon="chevron-left" />
116
- <Button extraClassNames={["ga-ds-carousel__button", "ga-ds-carousel__button--next"]} icon="chevron-right" />
115
+ <Button
116
+ extraClassNames={["ga-ds-carousel__button", "ga-ds-carousel__button--prev"]}
117
+ icon="chevron-left"
118
+ aria-label="Slide précédente"
119
+ />
120
+ <Button
121
+ extraClassNames={["ga-ds-carousel__button", "ga-ds-carousel__button--next"]}
122
+ icon="chevron-right"
123
+ aria-label="Slide suivante"
124
+ />
117
125
  </div>
118
126
  )
119
127
  }