@radix-ui/react-use-rect 1.0.0 → 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.
@@ -0,0 +1,8 @@
1
+ import { Measurable } from "@radix-ui/rect";
2
+ /**
3
+ * Use this custom hook to get access to an element's rect (getBoundingClientRect)
4
+ * and observe it along time.
5
+ */
6
+ export function useRect(measurable: Measurable | null): ClientRect | undefined;
7
+
8
+ //# sourceMappingURL=index.d.ts.map
@@ -27,4 +27,4 @@ import {observeElementRect as $jNFHB$observeElementRect} from "@radix-ui/rect";
27
27
 
28
28
 
29
29
  export {$ccac1052a272b78b$export$9823a655542017cd as useRect};
30
- //# sourceMappingURL=index.module.js.map
30
+ //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"mappings":";;;ACAA;;AAKA;;;GAGA,CACA,SAASA,yCAAT,CAAiBG,UAAjB,EAAgD;IAC9C,MAAM,CAACC,IAAD,EAAOC,OAAP,CAAA,GAAkBJ,eAAA,EAAxB,AAAA;IACAA,gBAAA,CAAgB,IAAM;QACpB,IAAIE,UAAJ,EAAgB;YACd,MAAMK,SAAS,GAAGN,yBAAkB,CAACC,UAAD,EAAaE,OAAb,CAApC,AAAA;YACA,OAAO,IAAM;gBACXA,OAAO,CAACI,SAAD,CAAP,CAAAJ;gBACAG,SAAS,EAATA,CAAAA;aAFF,CAGC;SACF;QACD,OAAA;KARF,EASG;QAACL,UAAD;KATH,CASC,CAAA;IACD,OAAOC,IAAP,CAAA;CACD;;ADtBD","sources":["packages/react/use-rect/src/index.ts","packages/react/use-rect/src/useRect.tsx"],"sourcesContent":["export { useRect } from './useRect';\n","import * as React from 'react';\nimport { observeElementRect } from '@radix-ui/rect';\n\nimport type { Measurable } from '@radix-ui/rect';\n\n/**\n * Use this custom hook to get access to an element's rect (getBoundingClientRect)\n * and observe it along time.\n */\nfunction useRect(measurable: Measurable | null) {\n const [rect, setRect] = React.useState<ClientRect>();\n React.useEffect(() => {\n if (measurable) {\n const unobserve = observeElementRect(measurable, setRect);\n return () => {\n setRect(undefined);\n unobserve();\n };\n }\n return;\n }, [measurable]);\n return rect;\n}\n\nexport { useRect };\n"],"names":["useRect","React","observeElementRect","measurable","rect","setRect","useState","useEffect","unobserve","undefined"],"version":3,"file":"index.module.js.map"}
1
+ {"mappings":";;;ACAA;;AAKA;;;GAGA,CACA,SAASA,yCAAT,CAAiBG,UAAjB,EAAgD;IAC9C,MAAM,CAACC,IAAD,EAAOC,OAAP,CAAA,GAAkBJ,eAAA,EAAxB,AAAA;IACAA,gBAAA,CAAgB,IAAM;QACpB,IAAIE,UAAJ,EAAgB;YACd,MAAMK,SAAS,GAAGN,yBAAkB,CAACC,UAAD,EAAaE,OAAb,CAApC,AAAA;YACA,OAAO,IAAM;gBACXA,OAAO,CAACI,SAAD,CAAP,CAAAJ;gBACAG,SAAS,EAATA,CAAAA;aAFF,CAGC;SACF;QACD,OAAA;KARF,EASG;QAACL,UAAD;KATH,CASC,CAAA;IACD,OAAOC,IAAP,CAAA;CACD;;ADtBD","sources":["packages/react/use-rect/src/index.ts","packages/react/use-rect/src/useRect.tsx"],"sourcesContent":["export { useRect } from './useRect';\n","import * as React from 'react';\nimport { observeElementRect } from '@radix-ui/rect';\n\nimport type { Measurable } from '@radix-ui/rect';\n\n/**\n * Use this custom hook to get access to an element's rect (getBoundingClientRect)\n * and observe it along time.\n */\nfunction useRect(measurable: Measurable | null) {\n const [rect, setRect] = React.useState<ClientRect>();\n React.useEffect(() => {\n if (measurable) {\n const unobserve = observeElementRect(measurable, setRect);\n return () => {\n setRect(undefined);\n unobserve();\n };\n }\n return;\n }, [measurable]);\n return rect;\n}\n\nexport { useRect };\n"],"names":["useRect","React","observeElementRect","measurable","rect","setRect","useState","useEffect","unobserve","undefined"],"version":3,"file":"index.mjs.map"}
package/package.json CHANGED
@@ -1,11 +1,23 @@
1
1
  {
2
2
  "name": "@radix-ui/react-use-rect",
3
- "version": "1.0.0",
3
+ "version": "1.0.1-rc.1",
4
4
  "license": "MIT",
5
- "source": "src/index.ts",
6
- "main": "dist/index.js",
7
- "module": "dist/index.module.js",
8
- "types": "dist/index.d.ts",
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"
@@ -17,7 +29,7 @@
17
29
  },
18
30
  "dependencies": {
19
31
  "@babel/runtime": "^7.13.10",
20
- "@radix-ui/rect": "1.0.0"
32
+ "@radix-ui/rect": "1.0.1-rc.1"
21
33
  },
22
34
  "peerDependencies": {
23
35
  "react": "^16.8 || ^17.0 || ^18.0"
@@ -29,5 +41,6 @@
29
41
  },
30
42
  "bugs": {
31
43
  "url": "https://github.com/radix-ui/primitives/issues"
32
- }
44
+ },
45
+ "stableVersion": "1.0.0"
33
46
  }