@gympass/yoga 7.128.0 → 7.129.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.
@@ -85,7 +85,8 @@ const Button = (0, import_react.forwardRef)(
85
85
  small = false,
86
86
  secondary = false,
87
87
  icon: Icon,
88
- isLoading = false
88
+ isLoading = false,
89
+ "aria-label": ariaLabel
89
90
  } = _b, props = __objRest(_b, [
90
91
  "children",
91
92
  "onClick",
@@ -95,7 +96,8 @@ const Button = (0, import_react.forwardRef)(
95
96
  "small",
96
97
  "secondary",
97
98
  "icon",
98
- "isLoading"
99
+ "isLoading",
100
+ "aria-label"
99
101
  ]);
100
102
  const finalProps = __spreadValues({}, props);
101
103
  if (props.href) {
@@ -112,7 +114,8 @@ const Button = (0, import_react.forwardRef)(
112
114
  onClick,
113
115
  small,
114
116
  secondary,
115
- isLoading
117
+ isLoading,
118
+ "aria-label": ariaLabel
116
119
  }, finalProps), {
117
120
  children: [
118
121
  Icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { role: "img" }),
@@ -124,7 +127,6 @@ const Button = (0, import_react.forwardRef)(
124
127
  }
125
128
  );
126
129
  Button.propTypes = {
127
- ariaLabel: import_prop_types.string,
128
130
  children: import_prop_types.node,
129
131
  disabled: import_prop_types.bool,
130
132
  full: import_prop_types.bool,
@@ -135,7 +137,8 @@ Button.propTypes = {
135
137
  secondary: import_prop_types.bool,
136
138
  /** an Icon from yoga-icons package */
137
139
  icon: (0, import_prop_types.oneOfType)([import_prop_types.node, import_prop_types.func]),
138
- href: import_prop_types.string
140
+ href: import_prop_types.string,
141
+ "aria-label": import_prop_types.string
139
142
  };
140
143
  Button.displayName = "Button";
141
144
  var Button_default = Button;
@@ -73,6 +73,23 @@ describe("<Heading />", () => {
73
73
  );
74
74
  expect(container).toMatchSnapshot();
75
75
  });
76
+ it("should have aria-label", () => {
77
+ const { getByLabelText } = (0, import_react2.render)(
78
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__.Heading, { noPadding: true, children: [
79
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Title.default, { children: "Gympass" }),
80
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_BackButton.default, { onClick }),
81
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
82
+ import_RightButton.default,
83
+ {
84
+ icon: import_src.Upload2,
85
+ onClick,
86
+ "aria-label": "labelAriaText"
87
+ }
88
+ )
89
+ ] }) })
90
+ );
91
+ expect(getByLabelText("labelAriaText")).toBeTruthy();
92
+ });
76
93
  it("should override the background color", () => {
77
94
  const { container } = (0, import_react2.render)(
78
95
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Heading, { bg: "yoga", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Title.default, { children: "Gympass" }) }) })
@@ -118,24 +118,35 @@ const ButtonIcon = (0, import_styled_components.default)(import_Button.default)`
118
118
  }};
119
119
  `;
120
120
  const RightButton = (_a) => {
121
- var _b = _a, { onClick, icon } = _b, props = __objRest(_b, ["onClick", "icon"]);
122
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ButtonIcon, __spreadProps(__spreadValues({ onClick, secondary: true, padding: "xxxsmall" }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
123
- import_Box.default,
124
- {
125
- flex: 1,
126
- display: "flex",
127
- justifyContent: "center",
128
- alignItems: "center",
129
- borderRadius: "50%",
130
- width: "xxlarge",
131
- height: "xxlarge",
132
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Icon.default, { as: icon, role: "img" })
133
- }
134
- ) }));
121
+ var _b = _a, { onClick, icon, "aria-label": ariaLabel } = _b, props = __objRest(_b, ["onClick", "icon", "aria-label"]);
122
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
123
+ ButtonIcon,
124
+ __spreadProps(__spreadValues({
125
+ onClick,
126
+ secondary: true,
127
+ padding: "xxxsmall",
128
+ "aria-label": ariaLabel
129
+ }, props), {
130
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
131
+ import_Box.default,
132
+ {
133
+ flex: 1,
134
+ display: "flex",
135
+ justifyContent: "center",
136
+ alignItems: "center",
137
+ borderRadius: "50%",
138
+ width: "xxlarge",
139
+ height: "xxlarge",
140
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Icon.default, { as: icon, role: "img" })
141
+ }
142
+ )
143
+ })
144
+ );
135
145
  };
136
146
  RightButton.propTypes = {
137
147
  onClick: import_prop_types.default.func.isRequired,
138
- icon: import_prop_types.default.elementType.isRequired
148
+ icon: import_prop_types.default.elementType.isRequired,
149
+ "aria-label": import_prop_types.default.string
139
150
  };
140
151
  RightButton.displayName = "Heading.RightButton";
141
152
  var RightButton_default = RightButton;
@@ -54,7 +54,8 @@ const Button = forwardRef(
54
54
  small = false,
55
55
  secondary = false,
56
56
  icon: Icon,
57
- isLoading = false
57
+ isLoading = false,
58
+ "aria-label": ariaLabel
58
59
  } = _b, props = __objRest(_b, [
59
60
  "children",
60
61
  "onClick",
@@ -64,7 +65,8 @@ const Button = forwardRef(
64
65
  "small",
65
66
  "secondary",
66
67
  "icon",
67
- "isLoading"
68
+ "isLoading",
69
+ "aria-label"
68
70
  ]);
69
71
  const finalProps = __spreadValues({}, props);
70
72
  if (props.href) {
@@ -81,7 +83,8 @@ const Button = forwardRef(
81
83
  onClick,
82
84
  small,
83
85
  secondary,
84
- isLoading
86
+ isLoading,
87
+ "aria-label": ariaLabel
85
88
  }, finalProps), {
86
89
  children: [
87
90
  Icon && /* @__PURE__ */ jsx(Icon, { role: "img" }),
@@ -93,7 +96,6 @@ const Button = forwardRef(
93
96
  }
94
97
  );
95
98
  Button.propTypes = {
96
- ariaLabel: string,
97
99
  children: node,
98
100
  disabled: bool,
99
101
  full: bool,
@@ -104,7 +106,8 @@ Button.propTypes = {
104
106
  secondary: bool,
105
107
  /** an Icon from yoga-icons package */
106
108
  icon: oneOfType([node, func]),
107
- href: string
109
+ href: string,
110
+ "aria-label": string
108
111
  };
109
112
  Button.displayName = "Button";
110
113
  var Button_default = Button;
@@ -50,6 +50,23 @@ describe("<Heading />", () => {
50
50
  );
51
51
  expect(container).toMatchSnapshot();
52
52
  });
53
+ it("should have aria-label", () => {
54
+ const { getByLabelText } = render(
55
+ /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsxs(Heading, { noPadding: true, children: [
56
+ /* @__PURE__ */ jsx(Title, { children: "Gympass" }),
57
+ /* @__PURE__ */ jsx(BackButton, { onClick }),
58
+ /* @__PURE__ */ jsx(
59
+ RightButton,
60
+ {
61
+ icon: Upload2,
62
+ onClick,
63
+ "aria-label": "labelAriaText"
64
+ }
65
+ )
66
+ ] }) })
67
+ );
68
+ expect(getByLabelText("labelAriaText")).toBeTruthy();
69
+ });
53
70
  it("should override the background color", () => {
54
71
  const { container } = render(
55
72
  /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Heading, { bg: "yoga", children: /* @__PURE__ */ jsx(Title, { children: "Gympass" }) }) })
@@ -87,24 +87,35 @@ const ButtonIcon = styled(Button)`
87
87
  }};
88
88
  `;
89
89
  const RightButton = (_a) => {
90
- var _b = _a, { onClick, icon } = _b, props = __objRest(_b, ["onClick", "icon"]);
91
- return /* @__PURE__ */ jsx(ButtonIcon, __spreadProps(__spreadValues({ onClick, secondary: true, padding: "xxxsmall" }, props), { children: /* @__PURE__ */ jsx(
92
- Box,
93
- {
94
- flex: 1,
95
- display: "flex",
96
- justifyContent: "center",
97
- alignItems: "center",
98
- borderRadius: "50%",
99
- width: "xxlarge",
100
- height: "xxlarge",
101
- children: /* @__PURE__ */ jsx(Icon, { as: icon, role: "img" })
102
- }
103
- ) }));
90
+ var _b = _a, { onClick, icon, "aria-label": ariaLabel } = _b, props = __objRest(_b, ["onClick", "icon", "aria-label"]);
91
+ return /* @__PURE__ */ jsx(
92
+ ButtonIcon,
93
+ __spreadProps(__spreadValues({
94
+ onClick,
95
+ secondary: true,
96
+ padding: "xxxsmall",
97
+ "aria-label": ariaLabel
98
+ }, props), {
99
+ children: /* @__PURE__ */ jsx(
100
+ Box,
101
+ {
102
+ flex: 1,
103
+ display: "flex",
104
+ justifyContent: "center",
105
+ alignItems: "center",
106
+ borderRadius: "50%",
107
+ width: "xxlarge",
108
+ height: "xxlarge",
109
+ children: /* @__PURE__ */ jsx(Icon, { as: icon, role: "img" })
110
+ }
111
+ )
112
+ })
113
+ );
104
114
  };
105
115
  RightButton.propTypes = {
106
116
  onClick: PropTypes.func.isRequired,
107
- icon: PropTypes.elementType.isRequired
117
+ icon: PropTypes.elementType.isRequired,
118
+ "aria-label": PropTypes.string
108
119
  };
109
120
  RightButton.displayName = "Heading.RightButton";
110
121
  var RightButton_default = RightButton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gympass/yoga",
3
- "version": "7.128.0",
3
+ "version": "7.129.1",
4
4
  "description": "Gympass component library",
5
5
  "main": "./cjs",
6
6
  "types": "./typings/index.d.ts",
@@ -28,7 +28,6 @@
28
28
  "dependencies": {
29
29
  "@gympass/yoga-common": "^1.4.1",
30
30
  "@gympass/yoga-helpers": "^1.1.1",
31
- "@gympass/yoga-icons": "^1.28.0",
32
31
  "@gympass/yoga-illustrations": "^0.7.1",
33
32
  "@gympass/yoga-system": "^0.25.0",
34
33
  "@gympass/yoga-tokens": "^3.6.4",
@@ -46,6 +45,7 @@
46
45
  "react-phone-input-2": "^2.15.1"
47
46
  },
48
47
  "devDependencies": {
48
+ "@gympass/yoga-icons": "^1.28.0",
49
49
  "@react-native-community/eslint-config": "^3.0.1",
50
50
  "@types/styled-components": "^5.1.34",
51
51
  "babel-plugin-inline-react-svg": "^1.1.1",
@@ -53,12 +53,13 @@
53
53
  "styled-components": "^4.4.0"
54
54
  },
55
55
  "peerDependencies": {
56
+ "@gympass/yoga-icons": "^1.28.0",
56
57
  "@react-native-picker/picker": "^2.4.9",
57
58
  "react": ">=16",
58
59
  "react-native": "0.72.3",
59
60
  "styled-components": "^4.4.0"
60
61
  },
61
- "gitHead": "d3904daa0d594a33c0687a0f6ad8baa3df9d156b",
62
+ "gitHead": "a6ff1cf68245808edee7bbe019c5c1e9c2258cfc",
62
63
  "module": "./esm",
63
64
  "private": false,
64
65
  "react-native": "./cjs/index.native.js"