@radix-ui/react-id 1.0.0-rc.1 → 1.0.1-rc.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.
package/dist/index.d.mts
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;ACAA;;AAIA,MAAMG,gCAAU,GAAIF,YAAD,CAAe,OAAA,CAAQG,QAAR,EAAf,CAAA,IAAuC,CAAA,IAAMC,SAA7C;AAAA,CAAA,AAAnB,AAAA;AACA,IAAIC,2BAAK,GAAG,CAAZ,AAAA;AAEA,SAASN,yCAAT,CAAeO,eAAf,EAAiD;IAC/C,MAAM,CAACC,EAAD,EAAKC,KAAL,CAAA,GAAcR,YAAK,CAACS,QAAN,CAAmCP,gCAAU,EAA7C,CAApB,AAD+C,EAE/C,+DADA;IAEAD,sBAAe,CAAC,IAAM;QACpB,IAAI,CAACK,eAAL,EAAsBE,KAAK,CAAEE,CAAAA,OAAD,GAAaA,OAAb,KAAA,IAAA,IAAaA,OAAb,KAAA,KAAA,CAAA,GAAaA,OAAb,GAAwBC,MAAM,CAACN,2BAAK,EAAN,CAA/B;QAAA,CAAL,CAAtB;KADa,EAEZ;QAACC,eAAD;KAFY,CAAf,CAEC;IACD,OAAOA,eAAe,IAAKC,CAAAA,EAAE,GAAI,CAAA,MAAA,EAAQA,EAAG,CAAA,CAAf,GAAmB,EAA1B,CAAA,AAAtB,CAAA;CACD;;ADdD","sources":["packages/react/id/src/index.ts","packages/react/id/src/id.tsx"],"sourcesContent":["export { useId } from './id';\n","import * as React from 'react';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n// We `toString()` to prevent bundlers from trying to `import { useId } from 'react';`\nconst useReactId = (React as any)['useId'.toString()] || (() => undefined);\nlet count = 0;\n\nfunction useId(deterministicId?: string): string {\n const [id, setId] = React.useState<string | undefined>(useReactId());\n // React versions older than 18 will have client-side ids only.\n useLayoutEffect(() => {\n if (!deterministicId) setId((reactId) => reactId ?? String(count++));\n }, [deterministicId]);\n return deterministicId || (id ? `radix-${id}` : '');\n}\n\nexport { useId };\n"],"names":["useId","React","useLayoutEffect","useReactId","toString","undefined","count","deterministicId","id","setId","useState","reactId","String"],"version":3,"file":"index.
|
|
1
|
+
{"mappings":";;;ACAA;;AAIA,MAAMG,gCAAU,GAAIF,YAAD,CAAe,OAAA,CAAQG,QAAR,EAAf,CAAA,IAAuC,CAAA,IAAMC,SAA7C;AAAA,CAAA,AAAnB,AAAA;AACA,IAAIC,2BAAK,GAAG,CAAZ,AAAA;AAEA,SAASN,yCAAT,CAAeO,eAAf,EAAiD;IAC/C,MAAM,CAACC,EAAD,EAAKC,KAAL,CAAA,GAAcR,YAAK,CAACS,QAAN,CAAmCP,gCAAU,EAA7C,CAApB,AAD+C,EAE/C,+DADA;IAEAD,sBAAe,CAAC,IAAM;QACpB,IAAI,CAACK,eAAL,EAAsBE,KAAK,CAAEE,CAAAA,OAAD,GAAaA,OAAb,KAAA,IAAA,IAAaA,OAAb,KAAA,KAAA,CAAA,GAAaA,OAAb,GAAwBC,MAAM,CAACN,2BAAK,EAAN,CAA/B;QAAA,CAAL,CAAtB;KADa,EAEZ;QAACC,eAAD;KAFY,CAAf,CAEC;IACD,OAAOA,eAAe,IAAKC,CAAAA,EAAE,GAAI,CAAA,MAAA,EAAQA,EAAG,CAAA,CAAf,GAAmB,EAA1B,CAAA,AAAtB,CAAA;CACD;;ADdD","sources":["packages/react/id/src/index.ts","packages/react/id/src/id.tsx"],"sourcesContent":["export { useId } from './id';\n","import * as React from 'react';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n// We `toString()` to prevent bundlers from trying to `import { useId } from 'react';`\nconst useReactId = (React as any)['useId'.toString()] || (() => undefined);\nlet count = 0;\n\nfunction useId(deterministicId?: string): string {\n const [id, setId] = React.useState<string | undefined>(useReactId());\n // React versions older than 18 will have client-side ids only.\n useLayoutEffect(() => {\n if (!deterministicId) setId((reactId) => reactId ?? String(count++));\n }, [deterministicId]);\n return deterministicId || (id ? `radix-${id}` : '');\n}\n\nexport { useId };\n"],"names":["useId","React","useLayoutEffect","useReactId","toString","undefined","count","deterministicId","id","setId","useState","reactId","String"],"version":3,"file":"index.mjs.map"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-id",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1-rc.1",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"import": {
|
|
8
|
+
"types": "./dist/index.d.mts",
|
|
9
|
+
"default": "./dist/index.mjs"
|
|
10
|
+
},
|
|
11
|
+
"require": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"source": "./src/index.ts",
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"module": "./dist/index.mjs",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
9
21
|
"files": [
|
|
10
22
|
"dist",
|
|
11
23
|
"README.md"
|
|
@@ -28,7 +40,7 @@
|
|
|
28
40
|
},
|
|
29
41
|
"dependencies": {
|
|
30
42
|
"@babel/runtime": "^7.13.10",
|
|
31
|
-
"@radix-ui/react-use-layout-effect": "1.0.
|
|
43
|
+
"@radix-ui/react-use-layout-effect": "1.0.1-rc.1"
|
|
32
44
|
},
|
|
33
|
-
"stableVersion": "0.
|
|
45
|
+
"stableVersion": "1.0.0"
|
|
34
46
|
}
|