UNPKG

carbon-react

Version:

A library of reusable React components for easily building user interfaces.

2 lines (1 loc) 2.18 kB
import{jsx as t}from"react/jsx-runtime";import"react";import r from"./tile.style.js";import{TileProvider as e}from"./__internal__/tile.context.js";import n from"../../style/utils/filter-styled-system-padding-props.js";import i from"../../style/utils/filter-styled-system-margin-props.js";import o from"./__internal__/compute-content-padding.js";import l from"../../__internal__/utils/helpers/tags/tags.js";function a(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function s(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),n.forEach((function(r){a(t,r,e[r])}))}return t}const c=a=>{var{variant:c="tile",p=3,children:u,orientation:f="horizontal",width:b="100%",roundness:d="default",height:h,borderWidth:y,borderVariant:m,highlightVariant:O}=a,g=function(t,r){if(null==t)return{};var e,n,i=function(t,r){if(null==t)return{};var e,n,i={},o=Object.keys(t);for(n=0;n<o.length;n++)e=o[n],r.indexOf(e)>=0||(i[e]=t[e]);return i}(t,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)e=o[n],r.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(i[e]=t[e])}return i}(a,["variant","p","children","orientation","width","roundness","height","borderWidth","borderVariant","highlightVariant"]);const j="horizontal"===f,v=n(s({p},g)),w=i(g),P=o(v,j);return t(r,(_=s({variant:c,width:b,height:h,isHorizontal:j,p,roundness:d,highlightVariant:O,borderWidth:y,borderVariant:m},v,w,l("tile",g)),S=null!=(S={children:t(e,{value:{isHorizontal:j,paddingPropsFromTile:P},children:u})})?S:{},Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(S)):function(t){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);r.push.apply(r,e)}return r}(Object(S)).forEach((function(t){Object.defineProperty(_,t,Object.getOwnPropertyDescriptor(S,t))})),_));var _,S};export{c as Tile,c as default};