carbon-react
Version:
A library of reusable React components for easily building user interfaces.
2 lines (1 loc) • 1.83 kB
JavaScript
import{jsx as t}from"react/jsx-runtime";import"react";import e from"./tile-content.style.js";import{useTileContext as r}from"../__internal__/tile.context.js";import n from"../../../__internal__/utils/helpers/tags/tags.js";import o from"../../../style/utils/filter-styled-system-padding-props.js";import i from"../../../style/utils/filter-styled-system-margin-props.js";function l(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){l(t,e,r[e])}))}return t}const s=l=>{var{children:s,width:p,height:f}=l,u=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(l,["children","width","height"]);const{isHorizontal:a,paddingPropsFromTile:y}=r();if(!s)return null;const O=c({},o(u),i(u));return t(e,(b=c({width:p,height:f,isHorizontal:a},y,O,n("tile-content",u)),m=null!=(m={children:s})?m:{},Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(m)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e.push.apply(e,r)}return e}(Object(m)).forEach((function(t){Object.defineProperty(b,t,Object.getOwnPropertyDescriptor(m,t))})),b));var b,m};export{s as default};