@khyxer/fastyui 1.0.2 → 1.0.3

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.
package/dist/index.cjs.js CHANGED
@@ -1240,6 +1240,7 @@ function Checkbox({ checked: controlledChecked, defaultChecked = false, onChange
1240
1240
  const checkboxRef = (0, react.useRef)(null);
1241
1241
  const checkmarkRef = (0, react.useRef)(null);
1242
1242
  const pathRef = (0, react.useRef)(null);
1243
+ const reactId = (0, react.useId)();
1243
1244
  const handleChange = () => {
1244
1245
  if (disabled) return;
1245
1246
  const newChecked = !checked;
@@ -1292,7 +1293,7 @@ function Checkbox({ checked: controlledChecked, defaultChecked = false, onChange
1292
1293
  });
1293
1294
  }
1294
1295
  }, [checked]);
1295
- const checkboxId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
1296
+ const checkboxId = id || `checkbox-${reactId}`;
1296
1297
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1297
1298
  className: `${Checkbox_module_default.checkboxWrapper} ${disabled ? Checkbox_module_default.disabled : ""} ${className || ""}`,
1298
1299
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Children, cloneElement, createContext, isValidElement, useContext, useEffect, useRef, useState } from "react";
1
+ import { Children, cloneElement, createContext, isValidElement, useContext, useEffect, useId, useRef, useState } from "react";
2
2
  import gsap$1, { gsap } from "gsap";
3
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
4
  var Button_module_default = {
@@ -1215,6 +1215,7 @@ function Checkbox({ checked: controlledChecked, defaultChecked = false, onChange
1215
1215
  const checkboxRef = useRef(null);
1216
1216
  const checkmarkRef = useRef(null);
1217
1217
  const pathRef = useRef(null);
1218
+ const reactId = useId();
1218
1219
  const handleChange = () => {
1219
1220
  if (disabled) return;
1220
1221
  const newChecked = !checked;
@@ -1267,7 +1268,7 @@ function Checkbox({ checked: controlledChecked, defaultChecked = false, onChange
1267
1268
  });
1268
1269
  }
1269
1270
  }, [checked]);
1270
- const checkboxId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
1271
+ const checkboxId = id || `checkbox-${reactId}`;
1271
1272
  return /* @__PURE__ */ jsxs("div", {
1272
1273
  className: `${Checkbox_module_default.checkboxWrapper} ${disabled ? Checkbox_module_default.disabled : ""} ${className || ""}`,
1273
1274
  children: [/* @__PURE__ */ jsx("input", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khyxer/fastyui",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A React component library for fast development",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.es.js",