@twilio-paste/aspect-ratio
Advanced tools
Comparing version 7.0.1 to 7.0.2
// src/index.tsx | ||
import * as React from "react"; | ||
import * as PropTypes from "prop-types"; | ||
import "prop-types"; | ||
import { Box } from "@twilio-paste/box"; | ||
@@ -35,12 +35,3 @@ import { styled } from "@twilio-paste/styling-library"; | ||
const aspectPercent = aspectArray[1] / aspectArray[0] * 100; | ||
return /* @__PURE__ */ React.createElement(AspectRatioContainer, { | ||
ref, | ||
style: { paddingBottom: `${aspectPercent}%` } | ||
}, /* @__PURE__ */ React.createElement(Box, { | ||
position: "absolute", | ||
top: 0, | ||
right: 0, | ||
bottom: 0, | ||
left: 0 | ||
}, props.children)); | ||
return /* @__PURE__ */ React.createElement(AspectRatioContainer, { ref, style: { paddingBottom: `${aspectPercent}%` } }, /* @__PURE__ */ React.createElement(Box, { position: "absolute", top: 0, right: 0, bottom: 0, left: 0 }, props.children)); | ||
}); | ||
@@ -47,0 +38,0 @@ AspectRatio.displayName = "AspectRatio"; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var __create = Object.create; | ||
@@ -19,3 +20,6 @@ var __defProp = Object.defineProperty; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
@@ -30,3 +34,3 @@ | ||
var React = __toESM(require("react")); | ||
var PropTypes = __toESM(require("prop-types")); | ||
var import_prop_types = require("prop-types"); | ||
var import_box = require("@twilio-paste/box"); | ||
@@ -63,12 +67,3 @@ var import_styling_library = require("@twilio-paste/styling-library"); | ||
const aspectPercent = aspectArray[1] / aspectArray[0] * 100; | ||
return /* @__PURE__ */ React.createElement(AspectRatioContainer, { | ||
ref, | ||
style: { paddingBottom: `${aspectPercent}%` } | ||
}, /* @__PURE__ */ React.createElement(import_box.Box, { | ||
position: "absolute", | ||
top: 0, | ||
right: 0, | ||
bottom: 0, | ||
left: 0 | ||
}, props.children)); | ||
return /* @__PURE__ */ React.createElement(AspectRatioContainer, { ref, style: { paddingBottom: `${aspectPercent}%` } }, /* @__PURE__ */ React.createElement(import_box.Box, { position: "absolute", top: 0, right: 0, bottom: 0, left: 0 }, props.children)); | ||
}); | ||
@@ -75,0 +70,0 @@ AspectRatio.displayName = "AspectRatio"; |
@@ -1,2 +0,2 @@ | ||
import*as React from"react";import*as PropTypes from"prop-types";import{Box}from"@twilio-paste/box";import{styled}from"@twilio-paste/styling-library";var RATIO_REGEX=/^(\d+:\d*)$/,isCorrectPattern=ratio=>RATIO_REGEX.test(ratio),handlePropValidation=({ratio})=>{if(!(ratio!=null&&ratio!==""))throw new Error("[Paste: AspectRatio] Missing 'ratio' prop.");if(!isCorrectPattern(ratio))throw new Error("[Paste: AspectRatio] 'ratio' is invalid. Use a colon separated number pattern (4:3).")},AspectRatioContainer=styled.div` | ||
import*as React from"react";import"prop-types";import{Box}from"@twilio-paste/box";import{styled}from"@twilio-paste/styling-library";var RATIO_REGEX=/^(\d+:\d*)$/,isCorrectPattern=ratio=>RATIO_REGEX.test(ratio),handlePropValidation=({ratio})=>{if(!(ratio!=null&&ratio!==""))throw new Error("[Paste: AspectRatio] Missing 'ratio' prop.");if(!isCorrectPattern(ratio))throw new Error("[Paste: AspectRatio] 'ratio' is invalid. Use a colon separated number pattern (4:3).")},AspectRatioContainer=styled.div` | ||
position: relative; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{AspectRatio:()=>AspectRatio});module.exports=__toCommonJS(src_exports);var React=__toESM(require("react")),PropTypes=__toESM(require("prop-types")),import_box=require("@twilio-paste/box"),import_styling_library=require("@twilio-paste/styling-library"),RATIO_REGEX=/^(\d+:\d*)$/,isCorrectPattern=ratio=>RATIO_REGEX.test(ratio),handlePropValidation=({ratio})=>{if(!(ratio!=null&&ratio!==""))throw new Error("[Paste: AspectRatio] Missing 'ratio' prop.");if(!isCorrectPattern(ratio))throw new Error("[Paste: AspectRatio] 'ratio' is invalid. Use a colon separated number pattern (4:3).")},AspectRatioContainer=import_styling_library.styled.div` | ||
"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{AspectRatio:()=>AspectRatio});module.exports=__toCommonJS(src_exports);var React=__toESM(require("react")),import_prop_types=require("prop-types"),import_box=require("@twilio-paste/box"),import_styling_library=require("@twilio-paste/styling-library"),RATIO_REGEX=/^(\d+:\d*)$/,isCorrectPattern=ratio=>RATIO_REGEX.test(ratio),handlePropValidation=({ratio})=>{if(!(ratio!=null&&ratio!==""))throw new Error("[Paste: AspectRatio] Missing 'ratio' prop.");if(!isCorrectPattern(ratio))throw new Error("[Paste: AspectRatio] 'ratio' is invalid. Use a colon separated number pattern (4:3).")},AspectRatioContainer=import_styling_library.styled.div` | ||
position: relative; | ||
@@ -3,0 +3,0 @@ |
{ | ||
"name": "@twilio-paste/aspect-ratio", | ||
"version": "7.0.1", | ||
"version": "7.0.2", | ||
"category": "layout", | ||
@@ -39,5 +39,5 @@ "status": "production", | ||
"devDependencies": { | ||
"@twilio-paste/box": "^7.1.1", | ||
"@twilio-paste/design-tokens": "^8.1.2", | ||
"@twilio-paste/style-props": "^6.1.1", | ||
"@twilio-paste/box": "^7.1.2", | ||
"@twilio-paste/design-tokens": "^8.3.0", | ||
"@twilio-paste/style-props": "^6.1.2", | ||
"@twilio-paste/styling-library": "^1.0.3", | ||
@@ -44,0 +44,0 @@ "@twilio-paste/theme": "^8.0.3", |
Sorry, the diff of this file is not supported yet
88070
162