@radix-ui/react-aspect-ratio 1.2.0 → 1.2.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/README.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # `react-aspect-ratio`
2
2
 
3
- View docs [here](https://radix-ui.com/primitives/docs/utilities/aspect-ratio).
3
+ View docs [here](https://radix-ui.com/primitives/docs/components/aspect-ratio).
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/aspect-ratio.tsx"],
4
- "sourcesContent": ["'use client';\nexport {\n AspectRatio,\n //\n Root,\n} from './aspect-ratio';\nexport type { AspectRatioProps } from './aspect-ratio';\n", "import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * AspectRatio\n * -----------------------------------------------------------------------------------------------*/\n\ntype AspectRatioElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface AspectRatioProps extends PrimitiveDivProps {\n ratio?: number | undefined;\n}\n\nconst AspectRatio = /* @__PURE__ */ React.forwardRef<AspectRatioElement, AspectRatioProps>(\n function AspectRatio(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\n/* -----------------------------------------------------------------------------------------------*/\n\nexport {\n AspectRatio,\n //\n AspectRatio as Root,\n};\nexport type { AspectRatioProps };\n"],
4
+ "sourcesContent": ["'use client';\nexport {\n AspectRatio,\n //\n Root,\n} from './aspect-ratio.js';\nexport type { AspectRatioProps } from './aspect-ratio.js';\n", "import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * AspectRatio\n * -----------------------------------------------------------------------------------------------*/\n\ntype AspectRatioElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface AspectRatioProps extends PrimitiveDivProps {\n ratio?: number | undefined;\n}\n\nconst AspectRatio = /* @__PURE__ */ React.forwardRef<AspectRatioElement, AspectRatioProps>(\n function AspectRatio(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\n/* -----------------------------------------------------------------------------------------------*/\n\nexport {\n AspectRatio,\n //\n AspectRatio as Root,\n};\nexport type { AspectRatioProps };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,6BAA0B;AA0BlB;AAdR,IAAM,cAA8B,gBAAM;AAAA,EACxC,gCAASA,aAAY,OAAO,cAAc;AACxC,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,iCAAU;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,GA5BA;AA6BF;",
6
6
  "names": ["AspectRatio"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ui/react-aspect-ratio",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "license": "MIT",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./dist/index.js",
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "sideEffects": false,
13
13
  "dependencies": {
14
- "@radix-ui/react-primitive": "2.2.0"
14
+ "@radix-ui/react-primitive": "2.2.1"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/react": "^19.3.0",
@@ -49,7 +49,8 @@
49
49
  "lint": "oxlint --max-warnings 0 src",
50
50
  "clean": "rm -rf dist",
51
51
  "reset": "rm -rf dist node_modules",
52
- "typecheck": "tsc --noEmit",
52
+ "types:check:pkg": "tsc --noEmit -p tsconfig.lib.json",
53
+ "types:check:test": "tsc --noEmit -p tsconfig.test.json",
53
54
  "build": "radix-build"
54
55
  },
55
56
  "types": "./dist/index.d.ts",