@radix-ui/react-aspect-ratio 0.1.5-rc.2 → 0.1.5-rc.5
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.ts.map +1 -1
- package/dist/index.js +69 -1
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +50 -1
- package/dist/index.module.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;AAYA,yBAAyB,MAAM,wBAAwB,CAAC,OAAO,UAAU,GAAG,CAAC,CAAC;AAC9E,iCAA2B,SAAQ,iBAAiB;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,OAAA,MAAM,oGA8BL,CAAC;AAMF,OAAA,MAAM,6FAAkB,CAAC","sources":["packages/react/aspect-ratio/src/packages/react/aspect-ratio/src/AspectRatio.tsx","packages/react/aspect-ratio/src/packages/react/aspect-ratio/src/index.ts","packages/react/aspect-ratio/src/index.ts"],"sourcesContent":[null,null,"export * from './AspectRatio';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,70 @@
|
|
|
1
|
-
var
|
|
1
|
+
var $frJTO$babelruntimehelpersextends = require("@babel/runtime/helpers/extends");
|
|
2
|
+
var $frJTO$react = require("react");
|
|
3
|
+
var $frJTO$radixuireactprimitive = require("@radix-ui/react-primitive");
|
|
4
|
+
|
|
5
|
+
function $parcel$exportWildcard(dest, source) {
|
|
6
|
+
Object.keys(source).forEach(function(key) {
|
|
7
|
+
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
Object.defineProperty(dest, key, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return source[key];
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
return dest;
|
|
20
|
+
}
|
|
21
|
+
function $parcel$interopDefault(a) {
|
|
22
|
+
return a && a.__esModule ? a.default : a;
|
|
23
|
+
}
|
|
24
|
+
function $parcel$export(e, n, v, s) {
|
|
25
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
26
|
+
}
|
|
27
|
+
var $f950105f8166e93b$exports = {};
|
|
28
|
+
|
|
29
|
+
$parcel$export($f950105f8166e93b$exports, "AspectRatio", () => $f950105f8166e93b$export$e840e8869344ca38);
|
|
30
|
+
$parcel$export($f950105f8166e93b$exports, "Root", () => $f950105f8166e93b$export$be92b6f5f03c0fe9);
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
/* -------------------------------------------------------------------------------------------------
|
|
35
|
+
* AspectRatio
|
|
36
|
+
* -----------------------------------------------------------------------------------------------*/ const $f950105f8166e93b$var$NAME = 'AspectRatio';
|
|
37
|
+
const $f950105f8166e93b$export$e840e8869344ca38 = /*#__PURE__*/ $frJTO$react.forwardRef((props, forwardedRef)=>{
|
|
38
|
+
const { ratio: ratio = 1 , style: style , ...aspectRatioProps } = props;
|
|
39
|
+
return /*#__PURE__*/ $frJTO$react.createElement("div", {
|
|
40
|
+
style: {
|
|
41
|
+
// ensures inner element is contained
|
|
42
|
+
position: 'relative',
|
|
43
|
+
// ensures padding bottom trick maths works
|
|
44
|
+
width: '100%',
|
|
45
|
+
paddingBottom: `${100 / ratio}%`
|
|
46
|
+
},
|
|
47
|
+
"data-radix-aspect-ratio-wrapper": ""
|
|
48
|
+
}, /*#__PURE__*/ $frJTO$react.createElement($frJTO$radixuireactprimitive.Primitive.div, ($parcel$interopDefault($frJTO$babelruntimehelpersextends))({}, aspectRatioProps, {
|
|
49
|
+
ref: forwardedRef,
|
|
50
|
+
style: {
|
|
51
|
+
...style,
|
|
52
|
+
// ensures children expand in ratio
|
|
53
|
+
position: 'absolute',
|
|
54
|
+
top: 0,
|
|
55
|
+
right: 0,
|
|
56
|
+
bottom: 0,
|
|
57
|
+
left: 0
|
|
58
|
+
}
|
|
59
|
+
})));
|
|
60
|
+
});
|
|
61
|
+
/*#__PURE__*/ Object.assign($f950105f8166e93b$export$e840e8869344ca38, {
|
|
62
|
+
displayName: $f950105f8166e93b$var$NAME
|
|
63
|
+
});
|
|
64
|
+
/* -----------------------------------------------------------------------------------------------*/ const $f950105f8166e93b$export$be92b6f5f03c0fe9 = $f950105f8166e93b$export$e840e8869344ca38;
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
$parcel$exportWildcard(module.exports, $f950105f8166e93b$exports);
|
|
68
|
+
|
|
69
|
+
|
|
2
70
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;ACKA;;oGAEA,CAEA,MAAME,0BAAI,GAAG,aAAb,AAAA;AAQA,MAAMC,yCAAW,GAAA,aAAGH,CAAAA,uBAAA,CAClB,CAACK,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,0BADF,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,0BAAA,CAAC,sCAAD,CAAW,GAAX,EAAA,2DAAA,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,MAAMC,yCAAI,GAAGd,yCAAb,AAAA;;ADrDA","sources":["packages/react/aspect-ratio/src/index.ts","packages/react/aspect-ratio/src/AspectRatio.tsx"],"sourcesContent":["export * 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":["React","Primitive","NAME","AspectRatio","forwardRef","props","forwardedRef","ratio","style","aspectRatioProps","position","width","paddingBottom","top","right","bottom","left","Root"],"version":3,"file":"index.js.map"}
|
package/dist/index.module.js
CHANGED
|
@@ -1,2 +1,51 @@
|
|
|
1
|
-
import
|
|
1
|
+
import $8D4cD$babelruntimehelpersesmextends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import {forwardRef as $8D4cD$forwardRef, createElement as $8D4cD$createElement} from "react";
|
|
3
|
+
import {Primitive as $8D4cD$Primitive} from "@radix-ui/react-primitive";
|
|
4
|
+
|
|
5
|
+
function $parcel$export(e, n, v, s) {
|
|
6
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
7
|
+
}
|
|
8
|
+
var $c1b5f66aac50e106$exports = {};
|
|
9
|
+
|
|
10
|
+
$parcel$export($c1b5f66aac50e106$exports, "AspectRatio", () => $c1b5f66aac50e106$export$e840e8869344ca38);
|
|
11
|
+
$parcel$export($c1b5f66aac50e106$exports, "Root", () => $c1b5f66aac50e106$export$be92b6f5f03c0fe9);
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/* -------------------------------------------------------------------------------------------------
|
|
16
|
+
* AspectRatio
|
|
17
|
+
* -----------------------------------------------------------------------------------------------*/ const $c1b5f66aac50e106$var$NAME = 'AspectRatio';
|
|
18
|
+
const $c1b5f66aac50e106$export$e840e8869344ca38 = /*#__PURE__*/ $8D4cD$forwardRef((props, forwardedRef)=>{
|
|
19
|
+
const { ratio: ratio = 1 , style: style , ...aspectRatioProps } = props;
|
|
20
|
+
return /*#__PURE__*/ $8D4cD$createElement("div", {
|
|
21
|
+
style: {
|
|
22
|
+
// ensures inner element is contained
|
|
23
|
+
position: 'relative',
|
|
24
|
+
// ensures padding bottom trick maths works
|
|
25
|
+
width: '100%',
|
|
26
|
+
paddingBottom: `${100 / ratio}%`
|
|
27
|
+
},
|
|
28
|
+
"data-radix-aspect-ratio-wrapper": ""
|
|
29
|
+
}, /*#__PURE__*/ $8D4cD$createElement($8D4cD$Primitive.div, $8D4cD$babelruntimehelpersesmextends({}, aspectRatioProps, {
|
|
30
|
+
ref: forwardedRef,
|
|
31
|
+
style: {
|
|
32
|
+
...style,
|
|
33
|
+
// ensures children expand in ratio
|
|
34
|
+
position: 'absolute',
|
|
35
|
+
top: 0,
|
|
36
|
+
right: 0,
|
|
37
|
+
bottom: 0,
|
|
38
|
+
left: 0
|
|
39
|
+
}
|
|
40
|
+
})));
|
|
41
|
+
});
|
|
42
|
+
/*#__PURE__*/ Object.assign($c1b5f66aac50e106$export$e840e8869344ca38, {
|
|
43
|
+
displayName: $c1b5f66aac50e106$var$NAME
|
|
44
|
+
});
|
|
45
|
+
/* -----------------------------------------------------------------------------------------------*/ const $c1b5f66aac50e106$export$be92b6f5f03c0fe9 = $c1b5f66aac50e106$export$e840e8869344ca38;
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
export {$c1b5f66aac50e106$export$e840e8869344ca38 as AspectRatio, $c1b5f66aac50e106$export$be92b6f5f03c0fe9 as Root};
|
|
2
51
|
//# sourceMappingURL=index.module.js.map
|
package/dist/index.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;A;;;ACKA;;oGAEA,CAEA,MAAME,0BAAI,GAAG,aAAb,AAAA;AAQA,MAAMC,yCAAW,GAAA,aAAGH,CAAAA,iBAAA,CAClB,CAACK,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,MAAMC,yCAAI,GAAGd,yCAAb,AAAA;;ADrDA","sources":["packages/react/aspect-ratio/src/index.ts","packages/react/aspect-ratio/src/AspectRatio.tsx"],"sourcesContent":["export * 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":["React","Primitive","NAME","AspectRatio","forwardRef","props","forwardedRef","ratio","style","aspectRatioProps","position","width","paddingBottom","top","right","bottom","left","Root"],"version":3,"file":"index.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-aspect-ratio",
|
|
3
|
-
"version": "0.1.5-rc.
|
|
3
|
+
"version": "0.1.5-rc.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/runtime": "^7.13.10",
|
|
20
|
-
"@radix-ui/react-primitive": "0.1.5-rc.
|
|
20
|
+
"@radix-ui/react-primitive": "0.1.5-rc.5"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": "^16.8 || ^17.0 || ^18.0"
|