@gympass/yoga 7.127.1 → 7.127.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.
@@ -66,6 +66,7 @@ var import_prop_types = require("prop-types");
66
66
  var import_styled_components = __toESM(require("styled-components"));
67
67
  var import_yoga_common = require("@gympass/yoga-common");
68
68
  var import_yoga_icons = require("@gympass/yoga-icons");
69
+ var import_hooks = require("../../hooks");
69
70
  var import_shared = require("../../shared");
70
71
  const CheckboxWrapper = import_styled_components.default.div`
71
72
  display: inline-block;
@@ -310,7 +311,7 @@ const Checkbox = (_a) => {
310
311
  "theme"
311
312
  ]);
312
313
  const inputRef = (0, import_react.useRef)(null);
313
- const id = (0, import_react.useId)();
314
+ const id = (0, import_hooks.useId)();
314
315
  const checkboxLabelId = `checkbox-label-${id}`;
315
316
  const _a2 = rest, { onChange, onClick } = _a2, restWithoutEvents = __objRest(_a2, ["onChange", "onClick"]);
316
317
  (0, import_react.useEffect)(() => {
@@ -43,6 +43,9 @@ var import_react = __toESM(require("react"));
43
43
  var import_react2 = require("@testing-library/react");
44
44
  var import__ = __toESM(require(".."));
45
45
  var import_Theme = __toESM(require("../../Theme"));
46
+ jest.mock("../../hooks/useId", () => ({
47
+ useId: () => "jest-id"
48
+ }));
46
49
  const data = {
47
50
  label: "Checkbox Component",
48
51
  helper: "Helper Text"
@@ -18,9 +18,11 @@ module.exports = __toCommonJS(hooks_exports);
18
18
  __reExport(hooks_exports, require("./usePortal"), module.exports);
19
19
  __reExport(hooks_exports, require("./useKeyPress"), module.exports);
20
20
  __reExport(hooks_exports, require("./useCombinedRefs"), module.exports);
21
+ __reExport(hooks_exports, require("./useId"), module.exports);
21
22
  // Annotate the CommonJS export names for ESM import in node:
22
23
  0 && (module.exports = {
23
24
  ...require("./usePortal"),
24
25
  ...require("./useKeyPress"),
25
- ...require("./useCombinedRefs")
26
+ ...require("./useCombinedRefs"),
27
+ ...require("./useId")
26
28
  });
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var useId_exports = {};
20
+ __export(useId_exports, {
21
+ useId: () => useId
22
+ });
23
+ module.exports = __toCommonJS(useId_exports);
24
+ var import_react = require("react");
25
+ const useId = () => {
26
+ return (0, import_react.useRef)(Math.random().toString(36).substr(2, 9)).current;
27
+ };
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ useId
31
+ });
@@ -30,11 +30,12 @@ var __objRest = (source, exclude) => {
30
30
  return target;
31
31
  };
32
32
  import { jsx, jsxs } from "react/jsx-runtime";
33
- import React, { useEffect, useRef, useId } from "react";
33
+ import React, { useEffect, useRef } from "react";
34
34
  import { bool, string, shape, oneOfType, node } from "prop-types";
35
35
  import styled, { withTheme } from "styled-components";
36
36
  import { hexToRgb } from "@gympass/yoga-common";
37
37
  import { Check, Rectangle } from "@gympass/yoga-icons";
38
+ import { useId } from "../../hooks";
38
39
  import { HiddenInput } from "../../shared";
39
40
  const CheckboxWrapper = styled.div`
40
41
  display: inline-block;
@@ -22,6 +22,9 @@ import React from "react";
22
22
  import { render, fireEvent } from "@testing-library/react";
23
23
  import Checkbox from "..";
24
24
  import ThemeProvider from "../../Theme";
25
+ jest.mock("../../hooks/useId", () => ({
26
+ useId: () => "jest-id"
27
+ }));
25
28
  const data = {
26
29
  label: "Checkbox Component",
27
30
  helper: "Helper Text"
@@ -1,3 +1,4 @@
1
1
  export * from "./usePortal";
2
2
  export * from "./useKeyPress";
3
3
  export * from "./useCombinedRefs";
4
+ export * from "./useId";
@@ -0,0 +1,7 @@
1
+ import { useRef } from "react";
2
+ const useId = () => {
3
+ return useRef(Math.random().toString(36).substr(2, 9)).current;
4
+ };
5
+ export {
6
+ useId
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gympass/yoga",
3
- "version": "7.127.1",
3
+ "version": "7.127.2",
4
4
  "description": "Gympass component library",
5
5
  "main": "./cjs",
6
6
  "types": "./typings/index.d.ts",
@@ -58,7 +58,7 @@
58
58
  "react-native": "0.72.3",
59
59
  "styled-components": "^4.4.0"
60
60
  },
61
- "gitHead": "b439914bbb4d61946a25af1aefdf94b7cf5b778d",
61
+ "gitHead": "2e4809db9f5acbef05714caacb7dc30c23a3ae19",
62
62
  "module": "./esm",
63
63
  "private": false,
64
64
  "react-native": "./cjs/index.native.js"