UNPKG

carbon-react

Version:

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

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