shekel-fe-shared-lib 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +135 -133
- package/dist/index.mjs.map +1 -1
- package/dist/shekel-fe-shared-lib.css +1 -0
- package/dist/types/components/Button/Button.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Z2=Object.defineProperty;var F2=(s,e,n)=>e in s?Z2(s,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[e]=n;var D=(s,e,n)=>F2(s,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),B=require("antd"),M=require("react");function z2(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>s[n]})}}return e.default=s,Object.freeze(e)}const T=z2(M),_2=({variant:s="primary",size:e="large",className:n="",children:r,...o})=>{const i=()=>{switch(e){case"small":return"40px";case"medium":return"
|
|
1
|
+
"use strict";var Z2=Object.defineProperty;var F2=(s,e,n)=>e in s?Z2(s,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[e]=n;var D=(s,e,n)=>F2(s,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),B=require("antd"),M=require("react");function z2(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>s[n]})}}return e.default=s,Object.freeze(e)}const T=z2(M),_2=({variant:s="primary",size:e="large",className:n="",children:r,...o})=>{const i=()=>{switch(e){case"xsmall":return"32px";case"small":return"40px";case"medium":return"48px";case"large":return"52px";default:return"52px"}},c=()=>{const a=i();switch(s){case"primary":return{backgroundColor:"#EC615B",borderColor:"#EC615B",color:"#FFFFFF",height:a,borderRadius:"8px"};case"secondary":return{backgroundColor:"#6B7280",borderColor:"#6B7280",color:"#FFFFFF",height:a,borderRadius:"8px"};case"outline":return{backgroundColor:"transparent",borderColor:"#EC615B",color:"#EC615B",height:a,borderRadius:"8px"};case"ghost":return{backgroundColor:"#EFF2F3",borderColor:"#EFF2F3",color:"#181918",height:a,borderRadius:"8px"};default:return{}}};return t.jsx(B.Button,{className:n,...o,style:{...c(),...o.style},onMouseEnter:a=>{var C;s==="primary"?a.target.style.backgroundColor="#D8524D":s==="secondary"?a.target.style.backgroundColor="#4B5563":s==="outline"?a.target.style.backgroundColor="#F3F4F6":s==="ghost"&&(a.target.style.backgroundColor="#E1E4E6"),(C=o.onMouseEnter)==null||C.call(o,a)},onMouseLeave:a=>{var d;const C=c();a.target.style.backgroundColor=C.backgroundColor||"",(d=o.onMouseLeave)==null||d.call(o,a)},children:r})},B2=({label:s,value:e,icon:n,iconBackgroundColor:r="#E8F4FD",iconColor:o="#4A9FD8",valuePrefix:i="₦",progressText:c,badge:a,width:C=347,className:d=""})=>{const l=t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[t.jsx("rect",{x:"3",y:"6",width:"18",height:"12",rx:"2",stroke:"currentColor",strokeWidth:"2"}),t.jsx("path",{d:"M3 10h18M7 14h4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]});return t.jsxs("div",{className:`bg-white border border-[#E6E6E6] rounded-2xl p-4 flex flex-col justify-between transition-all duration-300 ease-in-out hover:border-gray-300 hover:-translate-y-1 cursor-pointer ${d}`,style:{width:typeof C=="number"?`${C}px`:C,boxShadow:"0 0 0 0 rgba(0, 0, 0, 0)",transition:"all 0.3s ease-in-out"},onMouseEnter:p=>{p.currentTarget.style.boxShadow="0 0 20px 0 rgba(0, 0, 0, 0.1)"},onMouseLeave:p=>{p.currentTarget.style.boxShadow="0 0 0 0 rgba(0, 0, 0, 0)"},children:[t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-6",children:[t.jsx("div",{className:"w-9 h-9 rounded-full flex items-center justify-center shrink-0 [&>svg]:w-5 [&>svg]:h-5 transition-transform duration-300 ease-in-out group-hover:scale-110",style:{backgroundColor:r,color:o},children:n||l}),a&&t.jsx("div",{className:"bg-[#EBEBEB] text-[#181918] text-[11px] font-medium px-2 py-1 rounded-full border border-[#D1D1D1] transition-colors duration-200",children:a})]}),t.jsx("div",{className:"text-sm text-[#181918] font-light transition-colors duration-200",children:s}),t.jsxs("div",{className:"text-[20px] font-bold text-[#181918] transition-all duration-200",children:[i," ",e]})]}),c&&t.jsx("div",{className:"text-xs text-gray-400 font-normal mt-4 transition-colors duration-200",children:c})]})},D2=({icon:s,iconPosition:e="left",size:n="md",fullWidth:r=!1,className:o="",onIconClick:i,bgColor:c,borderColor:a,focusBorderColor:C,iconColor:d,textColor:l,placeholderColor:p,rounded:g="md",style:v,...h})=>{process.env.NODE_ENV!=="production"&&console.warn("[Shekel Shared Lib] SearchInput is deprecated as of v1.0.11. Please use the new Input component instead for better functionality and consistent styling.");const b="relative inline-flex items-center",x="border focus:outline-none focus:ring-1 transition-all duration-200 ease-in-out",w={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base",lg:"px-5 py-3 text-lg",responsive:"px-3 sm:px-4 md:px-5 py-1.5 sm:py-2 md:py-3 text-sm sm:text-base md:text-lg"},m={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",responsive:"w-4 sm:w-5 md:w-6 h-4 sm:h-5 md:h-6"},y={none:"rounded-none",sm:"rounded-sm",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},f=e==="left"?n==="sm"?"pl-9":n==="md"?"pl-10":n==="lg"?"pl-12":"pl-9 sm:pl-10 md:pl-12":n==="sm"?"pr-9":n==="md"?"pr-10":n==="lg"?"pr-12":"pr-9 sm:pr-10 md:pr-12",u=r?"w-full":"",V={backgroundColor:c,borderColor:a||"#D1D5DB",color:l,...v},H=p?"":"placeholder:text-gray-400",E=a?"":"border-gray-300",F=l?"":"text-gray-900",Z=C?"":"focus:ring-[#EC615B] focus:border-[#EC615B]",S=`${x} ${!o.includes("px-")&&!o.includes("py-")?w[n]:""} ${s?f:""} ${u} ${o.includes("rounded")?"":y[g]} ${o.includes("border-")?"":E} ${F} ${Z} ${H} ${o}`,k=e==="left"?"left-3":"right-3",z=d||"text-gray-400",L=d?"":"hover:text-gray-600",$=t.jsx("svg",{className:`${m[n]} ${z}`,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})});return t.jsxs("div",{className:`${b} ${u}`,children:[s&&t.jsx("div",{className:`absolute ${k} ${z} ${i?"cursor-pointer":""} ${L}`,onClick:i,children:s===!0?$:s}),t.jsx("input",{type:"text",className:S,style:{...V,...C&&{"--focus-border-color":C},...p&&{"--placeholder-color":p}},...h})]})},R2=({shadow:s="md",className:e="",children:n,...r})=>{const i=`${{sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl"}[s]} rounded-lg ${e}`;return t.jsx(B.Card,{className:i,...r,children:n})},P2=({items:s,trigger:e="click",placement:n="bottomLeft",children:r,className:o="",overlayClassName:i="",disabled:c=!1,size:a="md",menuBgColor:C,menuItemHoverColor:d,dangerColor:l,borderColor:p,style:g})=>{const[v,h]=M.useState(!1),b=M.useRef(null);M.useEffect(()=>{const N=R=>{b.current&&!b.current.contains(R.target)&&h(!1)};return v&&document.addEventListener("mousedown",N),()=>{document.removeEventListener("mousedown",N)}},[v]);const x=()=>{!c&&e==="click"&&h(!v)},w=()=>{!c&&e==="hover"&&h(!0)},m=()=>{!c&&e==="hover"&&h(!1)},y=N=>{!N.disabled&&N.onClick&&N.onClick(),h(!1)},f={bottomLeft:"top-full left-0 mt-1",bottomRight:"top-full right-0 mt-1",topLeft:"bottom-full left-0 mb-1",topRight:"bottom-full right-0 mb-1"},u=n.startsWith("bottom")?"dropdown-slide-down":"dropdown-slide-up",V={sm:"min-w-[120px] text-xs",md:"min-w-[160px] text-sm",lg:"min-w-[220px] text-base",responsive:"min-w-[120px] sm:min-w-[160px] md:min-w-[200px] lg:min-w-[240px] text-xs sm:text-sm md:text-base"},H={sm:"px-3 py-1.5 text-xs gap-1.5",md:"px-4 py-2 text-sm gap-2",lg:"px-5 py-3 text-base gap-2.5",responsive:"px-3 sm:px-4 md:px-5 py-1.5 sm:py-2 md:py-3 text-xs sm:text-sm md:text-base gap-1.5 sm:gap-2 md:gap-2.5"},E="hover:bg-gray-50",F="border-gray-200",Z="text-red-600",S=d?{backgroundColor:d}:{},k=d?"":E,z=l?{color:l}:{},L=l?{backgroundColor:l+"15"}:{},$=p||F;return t.jsxs("div",{ref:b,className:`relative inline-block ${o}`,onMouseEnter:w,onMouseLeave:m,style:g,children:[t.jsx("div",{onClick:x,className:`inline-flex ${c?"cursor-not-allowed opacity-50":"cursor-pointer"}`,children:r}),v&&!c&&t.jsx("div",{className:`absolute ${f[n]} ${u} z-50 ${V[a]} ${i}`,children:t.jsx("div",{className:`dropdown-menu rounded-lg shadow-lg border py-1 overflow-hidden ${$}`,style:{backgroundColor:C||"#ffffff"},children:s.map(N=>{let R={};return N.disabled||(N.danger?R={...z,...L}:d&&(R=S)),t.jsxs("div",{onClick:()=>y(N),className:`
|
|
2
2
|
dropdown-menu-item
|
|
3
3
|
flex items-center cursor-pointer transition-all duration-200 ease-out
|
|
4
4
|
${!i.includes("px-")&&!i.includes("py-")?H[a]:""}
|