ivt
Version:
Ivt Components Library
1 lines • 2.71 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../../node_modules/@radix-ui/react-aspect-ratio/dist/index.mjs","../../src/components/ui/aspect-ratio/aspect-ratio.tsx"],"sourcesContent":["// src/aspect-ratio.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NAME = \"AspectRatio\";\nvar AspectRatio = React.forwardRef(\n (props, forwardedRef) => {\n const { ratio = 1 / 1, style, ...aspectRatioProps } = props;\n return /* @__PURE__ */ jsx(\n \"div\",\n {\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 children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\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 )\n }\n );\n }\n);\nAspectRatio.displayName = NAME;\nvar Root = AspectRatio;\nexport {\n AspectRatio,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\nimport * as AspectRatioPrimitive from \"@radix-ui/react-aspect-ratio\";\nimport * as React from \"react\";\n\nfunction AspectRatio({ ...props }: React.ComponentProps<typeof AspectRatioPrimitive.Root>) {\n\treturn <AspectRatioPrimitive.Root data-slot=\"aspect-ratio\" {...props} />;\n}\n\nexport { AspectRatio };\n"],"names":["AspectRatio","props","AspectRatioPrimitive","data-slot"],"mappings":";;;;;;;AAOA,IAAM,IAAA,GAAO,aAAA;AAQb,IAAMA,gBAAoB,KAAA,CAAA,UAAA,CACxB,CAAC,OAAO,YAAA,GAAA;IACN,MAAM,EAAE,KAAA,GAAQ,CAAA,GAAI,CAAA,EAAG,KAAA,EAAO,GAAG,gBAAA,EAAiB,GAAI,KAAA;IACtD,uBACE,GAAA,CAAC,KAAA,EAAA;QACC,KAAA,EAAO;;YAEL,QAAA,EAAU,UAAA;;YAEV,KAAA,EAAO,MAAA;AACP,YAAA,aAAA,EAAe,CAAA,EAAG,GAAA,GAAM,KAAK,CAAA,CAAA;AAC/B,SAAA;QACA,iCAAA,EAAgC,EAAA;AAEhC,QAAA,QAAA,kBAAA,GAAA,CAAC,SAAA,CAAU,GAAA,EAAV;AACE,YAAA,GAAG,gBAAA;YACJ,GAAA,EAAK,YAAA;YACL,KAAA,EAAO;AACL,gBAAA,GAAG,KAAA;;gBAEH,QAAA,EAAU,UAAA;gBACV,GAAA,EAAK,CAAA;gBACL,KAAA,EAAO,CAAA;gBACP,MAAA,EAAQ,CAAA;gBACR,IAAA,EAAM;AACR;AAAA,SAAA;AACF,KAAA,CAAA;AAGN,CAAA,CAAA;AAGFA,aAAA,CAAY,WAAA,GAAc,IAAA;AAI1B,IAAM,IAAA,GAAOA,aAAA;;AC9Cb,SAASA,WAAAA,CAAY,EAAE,GAAGC,KAAAA,EAA+D,EAAA;IACxF,qBAAO,KAAA,CAAA,aAAA,CAACC,IAAyB,EAAA;QAACC,WAAAA,EAAU,cAAA;AAAgB,QAAA,GAAGF;;AAChE;;;;","x_google_ignoreList":[0]}