UNPKG

@vz_org_test/ui

Version:

Reusable UI components for React apps

3 lines (2 loc) 3.66 kB
import t,{useState as e}from"react";function r(e){return t.createElement(t.Fragment,null,t.createElement("button",{className:`${e.classes} tw:px-5 tw:py-3 tw:text-sm tw:font-medium tw:text-center tw:text-white tw:bg-blue-700 tw:rounded-lg tw:cursor-pointer tw:hover:bg-blue-800 tw:focus:ring-4 tw:focus:ring-blue-300 tw:dark:bg-blue-600 tw:dark:hover:bg-blue-700 tw:dark:focus:ring-blue-800`},e.children))}function n(e){return t.createElement("input",{type:"text",placeholder:e.placeholder,className:"tw:formkit-input tw:bg-gray-50 tw:border tw:border-gray-300 tw:text-gray-900 tw:text-sm tw:rounded-lg tw:focus:ring-blue-500 tw:focus:border-blue-500 tw:block tw:w-full tw:p-2.5 tw:dark:bg-gray-700 tw:dark:border-gray-600 tw:dark:placeholder-gray-400 tw:dark:text-white tw:dark:focus:ring-blue-500 tw:dark:focus:border-blue-500"})}function a(r){const{data:n=[{title:"Lorem Ipsum is simply",content:"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."},{title:"Lorem Ipsum is simply",content:"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."},{title:"Lorem Ipsum is simply",content:"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."}],expandMode:a="single",defaultExpanded:s=[-1]}=r,[l,o]=e(s);return t.createElement("div",{className:"tw:m-4 tw:border tw:border-[#dedede] tw:border-b-0 tw:rounded-[4px]"},n.map((e,r)=>t.createElement("div",{key:r,className:"tw:border-b tw:border-[#dedede] tw:[&:last-of-type]:rounded-b-[4px]"},t.createElement("button",{onClick:()=>(t=>{o("single"===a?l[0]===t?[]:[t]:e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])})(r),className:"tw:w-full tw:text-left tw:px-[16px] tw:py-[13px] tw:min-h-[40px] tw:transition tw:flex tw:justify-between tw:items-center tw:cursor-pointer"},t.createElement("span",{className:"tw:text-[#3a3a3a] tw:text-[14px] tw:font-normal tw:leading-[25px]"},e.title),t.createElement("span",{className:"tw:transform tw:transition-transform "+(l.includes(r)?"tw:tw:rotate-180":"tw:rotate-0")},t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"7",viewBox:"0 0 12 7",fill:"none"},t.createElement("path",{d:"M10.2875 6.29344L6.4075 2.41344L2.5275 6.29344C2.1375 6.68344 1.5075 6.68344 1.1175 6.29344C0.727499 5.90344 0.727499 5.27344 1.1175 4.88344L5.7075 0.293438C6.0975 -0.0965619 6.7275 -0.0965619 7.1175 0.293438L11.7075 4.88344C12.0975 5.27344 12.0975 5.90344 11.7075 6.29344C11.3175 6.67344 10.6775 6.68344 10.2875 6.29344Z",fill:"#808080"})))),l.includes(r)&&t.createElement("div",{className:"tw:px-[16px] tw:py-[13px] tw:text-[#212529] tw:text-[13px] tw:font-normal tw:leading-[20px]"},e.content))))}function s(e){return t.createElement("div",{"data-element":"fields","data-stacked":"false",className:"tw:p-4 tw:flex tw:items-center tw:w-full tw:max-w-md tw:mb-3 tw:seva-fields tw:formkit-fields"},t.createElement("div",{className:"tw:relative tw:w-full tw:mr-3 tw:formkit-field"},t.createElement(n,{placeholder:"Type something..."})),t.createElement(r,{classes:"tw:bg-blue-800 tw:hover:bg-blue-300 tw:cursor-pointer"},"Subscribe"))}export{a as Accordion,r as Button,s as Form,n as Input}; //# sourceMappingURL=index.js.map