@radix-ui/react-aspect-ratio 1.0.3-rc.1 → 1.0.3-rc.11
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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Radix from "@radix-ui/react-primitive";
|
|
3
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
|
+
type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
5
|
+
export interface AspectRatioProps extends PrimitiveDivProps {
|
|
6
|
+
ratio?: number;
|
|
7
|
+
}
|
|
8
|
+
export const AspectRatio: React.ForwardRefExoticComponent<AspectRatioProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export const Root: React.ForwardRefExoticComponent<AspectRatioProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -41,4 +41,4 @@ const $c1b5f66aac50e106$export$e840e8869344ca38 = /*#__PURE__*/ $8D4cD$forwardRe
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
export {$c1b5f66aac50e106$export$e840e8869344ca38 as AspectRatio, $c1b5f66aac50e106$export$be92b6f5f03c0fe9 as Root};
|
|
44
|
-
//# sourceMappingURL=index.
|
|
44
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;A;;;ACKA;;oGAEA,CAEA,MAAMI,0BAAI,GAAG,aAAb,AAAA;AAQA,MAAMJ,yCAAW,GAAA,aAAGE,CAAAA,iBAAA,CAClB,CAACI,KAAD,EAAQC,YAAR,GAAyB;IACvB,MAAM,SAAEC,KAAK,GAAG,CAAV,G,OAAiBC,KAAjB,CAAA,EAAwB,GAAGC,gBAAH,EAAxB,GAAgDJ,KAAtD,AAAM;IACN,OAAA,aACE,CAAA,oBADF,CAAA,KAAA,EAAA;QAEI,KAAK,EAAE;YACL,qCAAA;YACAK,QAAQ,EAAE,UAFL;YAGL,2CAAA;YACAC,KAAK,EAAE,MAJF;YAKLC,aAAa,EAAG,CAAA,EAAE,GAAA,GAAML,KAAM,CAA9BK,CAAAA,CAAAA;SANJ;QAQE,iCAAA,EAAgC,EAAhC;KARF,EAAA,aAUE,CAAA,oBAAA,CAAC,gBAAD,CAAW,GAAX,EAAA,oCAAA,CAAA,EAAA,EACMH,gBADN,EAVF;QAYI,GAAG,EAAEH,YAFP;QAGE,KAAK,EAAE;YACL,GAAGE,KADE;YAEL,mCAAA;YACAE,QAAQ,EAAE,UAHL;YAILG,GAAG,EAAE,CAJA;YAKLC,KAAK,EAAE,CALF;YAMLC,MAAM,EAAE,CANH;YAOLC,IAAI,EAAE,CAANA;SAPK;KAHT,CAAA,CAVF,CADF,CAWI;CAdY,CAApB,AA6BG;AAGH,aAAA,CAAA,MAAA,CAAA,MAAA,CAAA,yCAAA,EAAA;IAAA,WAAA,EAAA,0BAAA;CAAA,CAAA,CAAA;AAEA,oGAAA,CAEA,MAAMhB,yCAAI,GAAGD,yCAAb,AAAA;;ADrDA","sources":["packages/react/aspect-ratio/src/index.ts","packages/react/aspect-ratio/src/AspectRatio.tsx"],"sourcesContent":["export {\n AspectRatio,\n //\n Root,\n} from './AspectRatio';\nexport type { AspectRatioProps } from './AspectRatio';\n","import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type * as Radix from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * AspectRatio\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'AspectRatio';\n\ntype AspectRatioElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface AspectRatioProps extends PrimitiveDivProps {\n ratio?: number;\n}\n\nconst AspectRatio = React.forwardRef<AspectRatioElement, AspectRatioProps>(\n (props, forwardedRef) => {\n const { ratio = 1 / 1, style, ...aspectRatioProps } = props;\n return (\n <div\n style={{\n // ensures inner element is contained\n position: 'relative',\n // ensures padding bottom trick maths works\n width: '100%',\n paddingBottom: `${100 / ratio}%`,\n }}\n data-radix-aspect-ratio-wrapper=\"\"\n >\n <Primitive.div\n {...aspectRatioProps}\n ref={forwardedRef}\n style={{\n ...style,\n // ensures children expand in ratio\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n }}\n />\n </div>\n );\n }\n);\n\nAspectRatio.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = AspectRatio;\n\nexport {\n AspectRatio,\n //\n Root,\n};\nexport type { AspectRatioProps };\n"],"names":["AspectRatio","Root","React","Primitive","NAME","forwardRef","props","forwardedRef","ratio","style","aspectRatioProps","position","width","paddingBottom","top","right","bottom","left"],"version":3,"file":"index.
|
|
1
|
+
{"mappings":";;;;A;;;ACKA;;oGAEA,CAEA,MAAMI,0BAAI,GAAG,aAAb,AAAA;AAQA,MAAMJ,yCAAW,GAAA,aAAGE,CAAAA,iBAAA,CAClB,CAACI,KAAD,EAAQC,YAAR,GAAyB;IACvB,MAAM,SAAEC,KAAK,GAAG,CAAV,G,OAAiBC,KAAjB,CAAA,EAAwB,GAAGC,gBAAH,EAAxB,GAAgDJ,KAAtD,AAAM;IACN,OAAA,aACE,CAAA,oBADF,CAAA,KAAA,EAAA;QAEI,KAAK,EAAE;YACL,qCAAA;YACAK,QAAQ,EAAE,UAFL;YAGL,2CAAA;YACAC,KAAK,EAAE,MAJF;YAKLC,aAAa,EAAG,CAAA,EAAE,GAAA,GAAML,KAAM,CAA9BK,CAAAA,CAAAA;SANJ;QAQE,iCAAA,EAAgC,EAAhC;KARF,EAAA,aAUE,CAAA,oBAAA,CAAC,gBAAD,CAAW,GAAX,EAAA,oCAAA,CAAA,EAAA,EACMH,gBADN,EAVF;QAYI,GAAG,EAAEH,YAFP;QAGE,KAAK,EAAE;YACL,GAAGE,KADE;YAEL,mCAAA;YACAE,QAAQ,EAAE,UAHL;YAILG,GAAG,EAAE,CAJA;YAKLC,KAAK,EAAE,CALF;YAMLC,MAAM,EAAE,CANH;YAOLC,IAAI,EAAE,CAANA;SAPK;KAHT,CAAA,CAVF,CADF,CAWI;CAdY,CAApB,AA6BG;AAGH,aAAA,CAAA,MAAA,CAAA,MAAA,CAAA,yCAAA,EAAA;IAAA,WAAA,EAAA,0BAAA;CAAA,CAAA,CAAA;AAEA,oGAAA,CAEA,MAAMhB,yCAAI,GAAGD,yCAAb,AAAA;;ADrDA","sources":["packages/react/aspect-ratio/src/index.ts","packages/react/aspect-ratio/src/AspectRatio.tsx"],"sourcesContent":["export {\n AspectRatio,\n //\n Root,\n} from './AspectRatio';\nexport type { AspectRatioProps } from './AspectRatio';\n","import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type * as Radix from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * AspectRatio\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'AspectRatio';\n\ntype AspectRatioElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface AspectRatioProps extends PrimitiveDivProps {\n ratio?: number;\n}\n\nconst AspectRatio = React.forwardRef<AspectRatioElement, AspectRatioProps>(\n (props, forwardedRef) => {\n const { ratio = 1 / 1, style, ...aspectRatioProps } = props;\n return (\n <div\n style={{\n // ensures inner element is contained\n position: 'relative',\n // ensures padding bottom trick maths works\n width: '100%',\n paddingBottom: `${100 / ratio}%`,\n }}\n data-radix-aspect-ratio-wrapper=\"\"\n >\n <Primitive.div\n {...aspectRatioProps}\n ref={forwardedRef}\n style={{\n ...style,\n // ensures children expand in ratio\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n }}\n />\n </div>\n );\n }\n);\n\nAspectRatio.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = AspectRatio;\n\nexport {\n AspectRatio,\n //\n Root,\n};\nexport type { AspectRatioProps };\n"],"names":["AspectRatio","Root","React","Primitive","NAME","forwardRef","props","forwardedRef","ratio","style","aspectRatioProps","position","width","paddingBottom","top","right","bottom","left"],"version":3,"file":"index.mjs.map"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-aspect-ratio",
|
|
3
|
-
"version": "1.0.3-rc.
|
|
3
|
+
"version": "1.0.3-rc.11",
|
|
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"
|
|
@@ -17,12 +29,22 @@
|
|
|
17
29
|
},
|
|
18
30
|
"dependencies": {
|
|
19
31
|
"@babel/runtime": "^7.13.10",
|
|
20
|
-
"@radix-ui/react-primitive": "1.0.3-rc.
|
|
32
|
+
"@radix-ui/react-primitive": "1.0.3-rc.11"
|
|
21
33
|
},
|
|
22
34
|
"peerDependencies": {
|
|
35
|
+
"@types/react": "*",
|
|
36
|
+
"@types/react-dom": "*",
|
|
23
37
|
"react": "^16.8 || ^17.0 || ^18.0",
|
|
24
38
|
"react-dom": "^16.8 || ^17.0 || ^18.0"
|
|
25
39
|
},
|
|
40
|
+
"peerDependenciesMeta": {
|
|
41
|
+
"@types/react": {
|
|
42
|
+
"optional": true
|
|
43
|
+
},
|
|
44
|
+
"@types/react-dom": {
|
|
45
|
+
"optional": true
|
|
46
|
+
}
|
|
47
|
+
},
|
|
26
48
|
"homepage": "https://radix-ui.com/primitives",
|
|
27
49
|
"repository": {
|
|
28
50
|
"type": "git",
|