@radix-ui/react-aspect-ratio 1.0.3 → 1.1.0-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 CHANGED
@@ -1,11 +1,12 @@
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 {
1
+ import * as React from 'react';
2
+ import * as Radix from '@radix-ui/react-primitive';
3
+ import { Primitive } from '@radix-ui/react-primitive';
4
+
5
+ declare type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
6
+ interface AspectRatioProps extends PrimitiveDivProps {
6
7
  ratio?: number;
7
8
  }
8
- export const AspectRatio: React.ForwardRefExoticComponent<AspectRatioProps & React.RefAttributes<HTMLDivElement>>;
9
- export const Root: React.ForwardRefExoticComponent<AspectRatioProps & React.RefAttributes<HTMLDivElement>>;
9
+ declare const AspectRatio: React.ForwardRefExoticComponent<AspectRatioProps & React.RefAttributes<HTMLDivElement>>;
10
+ declare const Root: React.ForwardRefExoticComponent<AspectRatioProps & React.RefAttributes<HTMLDivElement>>;
10
11
 
11
- //# sourceMappingURL=index.d.ts.map
12
+ export { AspectRatio, type AspectRatioProps, Root };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,12 @@
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 {
1
+ import * as React from 'react';
2
+ import * as Radix from '@radix-ui/react-primitive';
3
+ import { Primitive } from '@radix-ui/react-primitive';
4
+
5
+ declare type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
6
+ interface AspectRatioProps extends PrimitiveDivProps {
6
7
  ratio?: number;
7
8
  }
8
- export const AspectRatio: React.ForwardRefExoticComponent<AspectRatioProps & React.RefAttributes<HTMLDivElement>>;
9
- export const Root: React.ForwardRefExoticComponent<AspectRatioProps & React.RefAttributes<HTMLDivElement>>;
9
+ declare const AspectRatio: React.ForwardRefExoticComponent<AspectRatioProps & React.RefAttributes<HTMLDivElement>>;
10
+ declare const Root: React.ForwardRefExoticComponent<AspectRatioProps & React.RefAttributes<HTMLDivElement>>;
10
11
 
11
- //# sourceMappingURL=index.d.ts.map
12
+ export { AspectRatio, type AspectRatioProps, Root };
package/dist/index.js CHANGED
@@ -1,52 +1,74 @@
1
- var $frJTO$babelruntimehelpersextends = require("@babel/runtime/helpers/extends");
2
- var $frJTO$react = require("react");
3
- var $frJTO$radixuireactprimitive = require("@radix-ui/react-primitive");
1
+ "use strict";
2
+ (() => {
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
+ }) : x)(function(x) {
12
+ if (typeof require !== "undefined") return require.apply(this, arguments);
13
+ throw Error('Dynamic require of "' + x + '" is not supported');
14
+ });
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from))
18
+ if (!__hasOwnProp.call(to, key) && key !== except)
19
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
+ ));
4
31
 
5
- function $parcel$export(e, n, v, s) {
6
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
- }
8
- function $parcel$interopDefault(a) {
9
- return a && a.__esModule ? a.default : a;
10
- }
11
-
12
- $parcel$export(module.exports, "AspectRatio", () => $f950105f8166e93b$export$e840e8869344ca38);
13
- $parcel$export(module.exports, "Root", () => $f950105f8166e93b$export$be92b6f5f03c0fe9);
14
-
15
-
16
-
17
- /* -------------------------------------------------------------------------------------------------
18
- * AspectRatio
19
- * -----------------------------------------------------------------------------------------------*/ const $f950105f8166e93b$var$NAME = 'AspectRatio';
20
- const $f950105f8166e93b$export$e840e8869344ca38 = /*#__PURE__*/ $frJTO$react.forwardRef((props, forwardedRef)=>{
21
- const { ratio: ratio = 1 , style: style , ...aspectRatioProps } = props;
22
- return /*#__PURE__*/ $frJTO$react.createElement("div", {
23
- style: {
32
+ // packages/react/aspect-ratio/src/AspectRatio.tsx
33
+ var React = __toESM(__require("react"));
34
+ var import_react_primitive = __require("@radix-ui/react-primitive");
35
+ var import_jsx_runtime = __require("react/jsx-runtime");
36
+ var NAME = "AspectRatio";
37
+ var AspectRatio = React.forwardRef(
38
+ (props, forwardedRef) => {
39
+ const { ratio = 1 / 1, style, ...aspectRatioProps } = props;
40
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
41
+ "div",
42
+ {
43
+ style: {
24
44
  // ensures inner element is contained
25
- position: 'relative',
45
+ position: "relative",
26
46
  // ensures padding bottom trick maths works
27
- width: '100%',
47
+ width: "100%",
28
48
  paddingBottom: `${100 / ratio}%`
29
- },
30
- "data-radix-aspect-ratio-wrapper": ""
31
- }, /*#__PURE__*/ $frJTO$react.createElement($frJTO$radixuireactprimitive.Primitive.div, ($parcel$interopDefault($frJTO$babelruntimehelpersextends))({}, aspectRatioProps, {
32
- ref: forwardedRef,
33
- style: {
34
- ...style,
35
- // ensures children expand in ratio
36
- position: 'absolute',
37
- top: 0,
38
- right: 0,
39
- bottom: 0,
40
- left: 0
49
+ },
50
+ "data-radix-aspect-ratio-wrapper": "",
51
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
52
+ import_react_primitive.Primitive.div,
53
+ {
54
+ ...aspectRatioProps,
55
+ ref: forwardedRef,
56
+ style: {
57
+ ...style,
58
+ // ensures children expand in ratio
59
+ position: "absolute",
60
+ top: 0,
61
+ right: 0,
62
+ bottom: 0,
63
+ left: 0
64
+ }
65
+ }
66
+ )
41
67
  }
42
- })));
43
- });
44
- /*#__PURE__*/ Object.assign($f950105f8166e93b$export$e840e8869344ca38, {
45
- displayName: $f950105f8166e93b$var$NAME
46
- });
47
- /* -----------------------------------------------------------------------------------------------*/ const $f950105f8166e93b$export$be92b6f5f03c0fe9 = $f950105f8166e93b$export$e840e8869344ca38;
48
-
49
-
50
-
51
-
68
+ );
69
+ }
70
+ );
71
+ AspectRatio.displayName = NAME;
72
+ var Root = AspectRatio;
73
+ })();
52
74
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1,7 @@
1
- {"mappings":";;;;;;;;;;;;;A;;;ACKA;;oGAEA,CAEA,MAAMI,0BAAI,GAAG,aAAb,AAAA;AAQA,MAAMJ,yCAAW,GAAA,aAAGE,CAAAA,uBAAA,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,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,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.js.map"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/AspectRatio.tsx"],
4
+ "sourcesContent": ["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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAuB;AACvB,+BAA0B;AA8BlB;AAtBR,MAAM,OAAO;AAQb,MAAM,cAAoB;AAAA,IACxB,CAAC,OAAO,iBAAiB;AACvB,YAAM,EAAE,QAAQ,IAAI,GAAG,OAAO,GAAG,iBAAiB,IAAI;AACtD,aACE;AAAA,QAAC;AAAA;AAAA,UACC,OAAO;AAAA;AAAA,YAEL,UAAU;AAAA;AAAA,YAEV,OAAO;AAAA,YACP,eAAe,GAAG,MAAM,KAAK;AAAA,UAC/B;AAAA,UACA,mCAAgC;AAAA,UAEhC;AAAA,YAAC,iCAAU;AAAA,YAAV;AAAA,cACE,GAAG;AAAA,cACJ,KAAK;AAAA,cACL,OAAO;AAAA,gBACL,GAAG;AAAA;AAAA,gBAEH,UAAU;AAAA,gBACV,KAAK;AAAA,gBACL,OAAO;AAAA,gBACP,QAAQ;AAAA,gBACR,MAAM;AAAA,cACR;AAAA;AAAA,UACF;AAAA;AAAA,MACF;AAAA,IAEJ;AAAA,EACF;AAEA,cAAY,cAAc;AAI1B,MAAM,OAAO;",
6
+ "names": []
7
+ }
package/dist/index.mjs CHANGED
@@ -1,44 +1,46 @@
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
-
6
-
7
-
8
- /* -------------------------------------------------------------------------------------------------
9
- * AspectRatio
10
- * -----------------------------------------------------------------------------------------------*/ const $c1b5f66aac50e106$var$NAME = 'AspectRatio';
11
- const $c1b5f66aac50e106$export$e840e8869344ca38 = /*#__PURE__*/ $8D4cD$forwardRef((props, forwardedRef)=>{
12
- const { ratio: ratio = 1 , style: style , ...aspectRatioProps } = props;
13
- return /*#__PURE__*/ $8D4cD$createElement("div", {
1
+ // packages/react/aspect-ratio/src/AspectRatio.tsx
2
+ import * as React from "react";
3
+ import { Primitive } from "@radix-ui/react-primitive";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var NAME = "AspectRatio";
6
+ var AspectRatio = React.forwardRef(
7
+ (props, forwardedRef) => {
8
+ const { ratio = 1 / 1, style, ...aspectRatioProps } = props;
9
+ return /* @__PURE__ */ jsx(
10
+ "div",
11
+ {
14
12
  style: {
15
- // ensures inner element is contained
16
- position: 'relative',
17
- // ensures padding bottom trick maths works
18
- width: '100%',
19
- paddingBottom: `${100 / ratio}%`
13
+ // ensures inner element is contained
14
+ position: "relative",
15
+ // ensures padding bottom trick maths works
16
+ width: "100%",
17
+ paddingBottom: `${100 / ratio}%`
20
18
  },
21
- "data-radix-aspect-ratio-wrapper": ""
22
- }, /*#__PURE__*/ $8D4cD$createElement($8D4cD$Primitive.div, $8D4cD$babelruntimehelpersesmextends({}, aspectRatioProps, {
23
- ref: forwardedRef,
24
- style: {
25
- ...style,
26
- // ensures children expand in ratio
27
- position: 'absolute',
28
- top: 0,
29
- right: 0,
30
- bottom: 0,
31
- left: 0
32
- }
33
- })));
34
- });
35
- /*#__PURE__*/ Object.assign($c1b5f66aac50e106$export$e840e8869344ca38, {
36
- displayName: $c1b5f66aac50e106$var$NAME
37
- });
38
- /* -----------------------------------------------------------------------------------------------*/ const $c1b5f66aac50e106$export$be92b6f5f03c0fe9 = $c1b5f66aac50e106$export$e840e8869344ca38;
39
-
40
-
41
-
42
-
43
- export {$c1b5f66aac50e106$export$e840e8869344ca38 as AspectRatio, $c1b5f66aac50e106$export$be92b6f5f03c0fe9 as Root};
19
+ "data-radix-aspect-ratio-wrapper": "",
20
+ children: /* @__PURE__ */ jsx(
21
+ Primitive.div,
22
+ {
23
+ ...aspectRatioProps,
24
+ ref: forwardedRef,
25
+ style: {
26
+ ...style,
27
+ // ensures children expand in ratio
28
+ position: "absolute",
29
+ top: 0,
30
+ right: 0,
31
+ bottom: 0,
32
+ left: 0
33
+ }
34
+ }
35
+ )
36
+ }
37
+ );
38
+ }
39
+ );
40
+ AspectRatio.displayName = NAME;
41
+ var Root = AspectRatio;
42
+ export {
43
+ AspectRatio,
44
+ Root
45
+ };
44
46
  //# sourceMappingURL=index.mjs.map
@@ -1 +1,7 @@
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"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/AspectRatio.tsx"],
4
+ "sourcesContent": ["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"],
5
+ "mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,iBAAiB;AA8BlB;AAtBR,IAAM,OAAO;AAQb,IAAM,cAAoB;AAAA,EACxB,CAAC,OAAO,iBAAiB;AACvB,UAAM,EAAE,QAAQ,IAAI,GAAG,OAAO,GAAG,iBAAiB,IAAI;AACtD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA;AAAA,UAEL,UAAU;AAAA;AAAA,UAEV,OAAO;AAAA,UACP,eAAe,GAAG,MAAM,KAAK;AAAA,QAC/B;AAAA,QACA,mCAAgC;AAAA,QAEhC;AAAA,UAAC,UAAU;AAAA,UAAV;AAAA,YACE,GAAG;AAAA,YACJ,KAAK;AAAA,YACL,OAAO;AAAA,cACL,GAAG;AAAA;AAAA,cAEH,UAAU;AAAA,cACV,KAAK;AAAA,cACL,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,MAAM;AAAA,YACR;AAAA;AAAA,QACF;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;AAI1B,IAAM,OAAO;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ui/react-aspect-ratio",
3
- "version": "1.0.3",
3
+ "version": "1.1.0-rc.1",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {
@@ -28,8 +28,7 @@
28
28
  "version": "yarn version"
29
29
  },
30
30
  "dependencies": {
31
- "@babel/runtime": "^7.13.10",
32
- "@radix-ui/react-primitive": "1.0.3"
31
+ "@radix-ui/react-primitive": "1.1.0-rc.1"
33
32
  },
34
33
  "peerDependencies": {
35
34
  "@types/react": "*",
@@ -52,5 +51,6 @@
52
51
  },
53
52
  "bugs": {
54
53
  "url": "https://github.com/radix-ui/primitives/issues"
55
- }
54
+ },
55
+ "stableVersion": "1.0.3"
56
56
  }
@@ -1 +0,0 @@
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 {\n AspectRatio,\n //\n Root,\n} from './AspectRatio';\nexport type { AspectRatioProps } from './AspectRatio';\n"],"names":[],"version":3,"file":"index.d.ts.map"}