@gympass/yoga 7.130.0 → 7.131.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.
@@ -157,7 +157,8 @@ const Input = import_react.default.forwardRef(
157
157
  a11yId,
158
158
  closeAriaLabel = "Clear",
159
159
  includeAriaAttributes = true,
160
- leftElement
160
+ leftElement,
161
+ clearButtonAriaLabel = "Clear"
161
162
  } = _b, props = __objRest(_b, [
162
163
  "cleanable",
163
164
  "children",
@@ -178,7 +179,8 @@ const Input = import_react.default.forwardRef(
178
179
  "a11yId",
179
180
  "closeAriaLabel",
180
181
  "includeAriaAttributes",
181
- "leftElement"
182
+ "leftElement",
183
+ "clearButtonAriaLabel"
182
184
  ]);
183
185
  const inputRef = ref || (0, import_react.useRef)(null);
184
186
  const cleanField = (e) => {
@@ -257,6 +259,8 @@ const Input = import_react.default.forwardRef(
257
259
  height: 20,
258
260
  role: "button",
259
261
  hasIconRight: !!rightIcon,
262
+ "aria-label": clearButtonAriaLabel,
263
+ "data-testid": "clearButtonAriaLabel",
260
264
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_yoga_icons.Close, { "aria-label": closeAriaLabel })
261
265
  }
262
266
  ),
@@ -321,6 +325,8 @@ Input.propTypes = {
321
325
  /** this prop will be used in the aria-label of the clear input button. */
322
326
  closeAriaLabel: import_prop_types.string,
323
327
  /** element on the left */
324
- leftElement: import_prop_types.node
328
+ leftElement: import_prop_types.node,
329
+ /** aria label for close button */
330
+ clearButtonAriaLabel: import_prop_types.string
325
331
  };
326
332
  var Input_default = Input;
@@ -187,5 +187,14 @@ describe("<Input />", () => {
187
187
  expect(inputElement).toBeInTheDocument();
188
188
  expect(inputElement).toHaveAttribute("aria-label", value);
189
189
  });
190
+ it("should have close aria label", () => {
191
+ const value = "test label clear";
192
+ const { getByTestId } = (0, import_react2.render)(
193
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Input, { label: "abc123", value: "foo", clearButtonAriaLabel: value }) })
194
+ );
195
+ const inputElement = getByTestId("clearButtonAriaLabel");
196
+ expect(inputElement).toBeInTheDocument();
197
+ expect(inputElement).toHaveAttribute("aria-label", value);
198
+ });
190
199
  });
191
200
  });
@@ -135,7 +135,8 @@ const Input = React.forwardRef(
135
135
  a11yId,
136
136
  closeAriaLabel = "Clear",
137
137
  includeAriaAttributes = true,
138
- leftElement
138
+ leftElement,
139
+ clearButtonAriaLabel = "Clear"
139
140
  } = _b, props = __objRest(_b, [
140
141
  "cleanable",
141
142
  "children",
@@ -156,7 +157,8 @@ const Input = React.forwardRef(
156
157
  "a11yId",
157
158
  "closeAriaLabel",
158
159
  "includeAriaAttributes",
159
- "leftElement"
160
+ "leftElement",
161
+ "clearButtonAriaLabel"
160
162
  ]);
161
163
  const inputRef = ref || useRef(null);
162
164
  const cleanField = (e) => {
@@ -235,6 +237,8 @@ const Input = React.forwardRef(
235
237
  height: 20,
236
238
  role: "button",
237
239
  hasIconRight: !!rightIcon,
240
+ "aria-label": clearButtonAriaLabel,
241
+ "data-testid": "clearButtonAriaLabel",
238
242
  children: /* @__PURE__ */ jsx(Close, { "aria-label": closeAriaLabel })
239
243
  }
240
244
  ),
@@ -299,7 +303,9 @@ Input.propTypes = {
299
303
  /** this prop will be used in the aria-label of the clear input button. */
300
304
  closeAriaLabel: string,
301
305
  /** element on the left */
302
- leftElement: node
306
+ leftElement: node,
307
+ /** aria label for close button */
308
+ clearButtonAriaLabel: string
303
309
  };
304
310
  var Input_default = Input;
305
311
  export {
@@ -164,5 +164,14 @@ describe("<Input />", () => {
164
164
  expect(inputElement).toBeInTheDocument();
165
165
  expect(inputElement).toHaveAttribute("aria-label", value);
166
166
  });
167
+ it("should have close aria label", () => {
168
+ const value = "test label clear";
169
+ const { getByTestId } = render(
170
+ /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Input, { label: "abc123", value: "foo", clearButtonAriaLabel: value }) })
171
+ );
172
+ const inputElement = getByTestId("clearButtonAriaLabel");
173
+ expect(inputElement).toBeInTheDocument();
174
+ expect(inputElement).toHaveAttribute("aria-label", value);
175
+ });
167
176
  });
168
177
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gympass/yoga",
3
- "version": "7.130.0",
3
+ "version": "7.131.0",
4
4
  "description": "Gympass component library",
5
5
  "main": "./cjs",
6
6
  "types": "./typings/index.d.ts",
@@ -59,7 +59,7 @@
59
59
  "react-native": "0.72.3",
60
60
  "styled-components": "^4.4.0"
61
61
  },
62
- "gitHead": "181e38376e72162bd97ae292a93c94caadf5cef2",
62
+ "gitHead": "26df123dcfe659e0e80491e56d38db3ce457296c",
63
63
  "module": "./esm",
64
64
  "private": false,
65
65
  "react-native": "./cjs/index.native.js"