index.mjs 864 B

123456789101112131415161718192021222324
  1. import * as $2AODx$react from "react";
  2. import {useLayoutEffect as $2AODx$useLayoutEffect} from "@radix-ui/react-use-layout-effect";
  3. const $1746a345f3d73bb7$var$useReactId = $2AODx$react['useId'.toString()] || (()=>undefined
  4. );
  5. let $1746a345f3d73bb7$var$count = 0;
  6. function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
  7. const [id, setId] = $2AODx$react.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
  8. $2AODx$useLayoutEffect(()=>{
  9. if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
  10. );
  11. }, [
  12. deterministicId
  13. ]);
  14. return deterministicId || (id ? `radix-${id}` : '');
  15. }
  16. export {$1746a345f3d73bb7$export$f680877a34711e37 as useId};
  17. //# sourceMappingURL=index.mjs.map