UNPKG

@start-base/start-ui

Version:

<p align="center"> <a href="https://startbase.dev" target="_blank"> <img src="https://startbase.dev/apple-touch-icon.png" width="60px" style="padding-top: 60px" /> </a> </p>

1 lines 3.31 kB
import*as e from"react";import t,{forwardRef as o,useState as r,useMemo as n}from"react";import a from"clsx";var l=Object.defineProperty,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,m=(e,t,o)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,d=(e,t)=>{for(var o in t||(t={}))s.call(t,o)&&m(e,o,t[o]);if(i)for(var o of i(t))c.call(t,o)&&m(e,o,t[o]);return e},u=(e,t)=>{var o={};for(var r in e)s.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&i)for(var r of i(e))t.indexOf(r)<0&&c.call(e,r)&&(o[r]=e[r]);return o},C="SUI-BentoCard-module-root-TXnYF",v="SUI-BentoCard-module-rootActive-ItrxQ",h="SUI-BentoCard-module-title-BxM7m",f="SUI-BentoCard-module-activeTitle-fQLP9",B="SUI-BentoCard-module-layer-WedZm",w="SUI-BentoCard-module-firstLayer-BHiyj",I="SUI-BentoCard-module-secondLayer-w6AfZ",p="SUI-BentoCard-module-hiddenLayer-FIAUU",N="SUI-BentoCard-module-content-eQ7PZ",b="SUI-BentoCard-module-button--URcO",g="SUI-BentoCard-module-activeButton-xa5iF",S="SUI-BentoCard-module-exitingButton-sgV-Y",U="SUI-BentoCard-module-enteringContent-uQRxD",E="SUI-BentoCard-module-exitingContent-0cGGu",x="SUI-BentoCard-module-plusIcon-Cw3Hc",y=t=>{var o=t,{size:r,width:n,height:a}=o,l=u(o,["size","width","height"]);return e.createElement("svg",d({xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",stroke:"currentColor",strokeWidth:0,viewBox:"0 0 24 24",width:null!=r?r:n,height:null!=r?r:a},l),e.createElement("path",{fill:"none",stroke:"none",d:"M0 0h24v24H0z"}),e.createElement("path",{stroke:"none",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))};function k(t){var o=t,{size:r,width:n,height:a}=o,l=u(o,["size","width","height"]);return e.createElement("svg",d({xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",stroke:"currentColor",strokeWidth:0,viewBox:"0 0 24 24",width:null!=r?r:n,height:null!=r?r:a},l),e.createElement("path",{fill:"none",stroke:"none",d:"M0 0h24v24H0V0z"}),e.createElement("path",{stroke:"none",d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"}))}var O=o(((e,o)=>{const l=e,{rootClassName:i,rootActiveClassName:s,title:c,titleClassName:m,titleActiveClassName:O,firstContent:T,secondContent:z,buttonClassName:A,activeButtonClassName:V,isTitleVisibleInFirst:j=!0,isTitleVisibleInSecond:F=!0,redirectTo:H}=l,L=u(l,["rootClassName","rootActiveClassName","title","titleClassName","titleActiveClassName","firstContent","secondContent","buttonClassName","activeButtonClassName","isTitleVisibleInFirst","isTitleVisibleInSecond","redirectTo"]),[M,P]=r(!1),[Q,W]=r(!1),Z=n((()=>!M&&c&&j||M&&c&&F?c:null),[M,c,j,F]);return t.createElement("div",d({"data-active":M,className:a(C,i,{[s]:M,[v]:M}),ref:o},L),t.createElement("div",{className:a(h,m,{[O]:M,[f]:M})},Z),t.createElement("div",{className:a(B,w,{[E]:Q})},!M&&T),M&&t.createElement("div",{className:a(B,I,{[p]:!M,[E]:Q})},t.createElement("div",{className:a(N,{[E]:Q,[U]:!Q&&M})},z)),!H&&z?t.createElement("button",{className:a(b,A,{[V]:M,[g]:M,[S]:Q}),onClick:()=>{M?(W(!0),setTimeout((()=>{P(!1),W(!1)}),600)):P(!0)}},t.createElement(y,{className:x})):t.createElement("button",{className:a(b,A,{[V]:M,[g]:M,[S]:Q}),onClick:()=>{window.open(H,"_blank")}},t.createElement(k,{className:x})))}));O.displayName="BentoCard";var T=O;export{T as default};