alope-ui 1.2.16 → 1.2.17

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/main.cjs CHANGED
@@ -35,7 +35,7 @@ return g?e.jsxs("div",{id:"alopeAlert",className:a.cn("flex gap-2 p-4 rounded-md
35
35
  return e.jsxs("div",{className:a.cn("flex items-center",n),children:[l.map((r,t)=>e.jsx("div",{className:a.cn(0!==t&&o),children:e.jsx(u,{...r,size:s})},t)),d>0&&e.jsxs("div",{className:a.cn("flex items-center justify-center bg-secondary dark:bg-secondary-dark font-medium",o,"sm"===s&&"w-8 h-8 text-xs rounded-full","md"===s&&"w-12 h-12 text-sm rounded-full","lg"===s&&"w-16 h-16 text-base rounded-full"),children:["+",d]})]})},exports.Badge=({children:r,variant:t="default",position:s="top-right",isAbsolute:o=!1,className:n,icon:l})=>{const d=p[t],i=o?x[s]:""
36
36
  return e.jsxs("span",{className:a.cn("inline-flex items-center px-3 py-1 rounded-full text-sm font-semibold",d,i,n),children:[l&&e.jsx("span",{className:"mr-1",children:l}),r]})},exports.BottomNavbar=({children:a,className:t,value:s,onChangeValue:o})=>e.jsx("div",{className:`fixed bottom-0 left-0 z-50 w-full bg-white border-t border-secondary dark:bg-gray-800 dark:border-secondary-dark-700 ${t??""}`,children:e.jsx("div",{className:"flex items-center justify-center h-full max-w-lg md:max-w-md mx-auto font-medium",children:r.Children.map(a,e=>r.isValidElement(e)&&e.type===b?r.cloneElement(e,{selectedValue:s,onChangeValue:o}):(process.env.NODE_ENV,null))})}),exports.BottomNavbarAction=b,exports.Breadcrumb=({data:r,labelClassName:s,currentLinkClassName:o,linkClassName:n,separatorClassName:l,separator:d=">"})=>e.jsx("nav",{"aria-label":"breadcrumb",children:e.jsx("ol",{className:"flex flex-wrap gap-2 text-gray-600",children:r.map((i,c)=>{const m=null===i.path||c===r.length-1
37
37
  return e.jsxs("li",{className:"flex items-center",children:[!m&&i.path?e.jsxs(t.Link,{to:i.path,className:a.cn("hover:underline text-primary dark:text-primary-dark-30 flex items-center text-sm",s,n),children:[i.icon&&e.jsx("span",{className:"mr-1",children:i.icon}),i.label]}):e.jsxs("span",{className:a.cn("font-semibold dark:text-white flex items-center text-sm",s,o),children:[i.icon&&e.jsx("span",{className:"mr-1",children:i.icon}),i.label]}),!m&&e.jsx("span",{className:a.cn("mx-2 font-semibold dark:text-white",l),children:d})]},c)})})}),exports.Button=({children:r,onClick:s,size:o="md",to:n,type:l="button",disabled:d=!1,variant:i="solid",variantType:c="primary",borderType:m="regular",fullWidth:u=!1,prefixIcon:p,suffixIcon:x,className:b})=>{const k=h[m],y=f(i,c),w=g[o]||"",v=d?"opacity-50 cursor-not-allowed":"cursor-pointer",N=u?"w-full":""
38
- return n?e.jsxs(t.Link,{to:n,className:a.cn("inline-flex items-center justify-center transition-all duration-[170ms] hover:scale-[98%]",y,w,v,N,k,b),children:[p&&e.jsx("span",{className:"mr-2",children:p}),r,x&&e.jsx("span",{className:"ml-2",children:x})]}):e.jsxs("button",{disabled:d,type:l,onClick:s,className:a.cn("inline-flex items-center justify-center transition-all duration-[170ms] hover:scale-[98%]",y,w,v,N,k,b),children:[p&&e.jsx("span",{className:"mr-2",children:p}),r,x&&e.jsx("span",{className:"ml-2",children:x})]})},exports.ButtonVariantsMap=k,exports.Card=({title:r,description:t,image:s,onClick:o,footer:n,horizontal:l=!1,size:d="md",containerClassName:i,descriptionClassName:c,imageClassName:m,titleClassName:u,ribbonClassName:p,ribbon:x,children:b})=>e.jsx("div",{onClick:o,className:a.cn("relative bg-white rounded-xl shadow-lg hover:shadow-xl transition-shadow duration-300 cursor-pointer overflow-hidden dark:border dark:bg-gray-800 dark:border-gray-700",l?"flex flex-col md:flex-row":"flex flex-col",{sm:"max-w-xs",md:"max-w-sm",lg:"max-w-md",full:"w-full"}[d]||d,i),children:b??e.jsxs(e.Fragment,{children:[s?"string"==typeof s?e.jsx("img",{src:s,alt:r,className:a.cn("object-cover w-full h-48 md:h-full",l?"md:w-[40%]":"w-full",m)}):e.jsx("div",{className:a.cn("w-full h-48 md:h-full",l?"md:w-[40%]":"w-full",m),children:s}):null,e.jsxs("div",{className:"p-4 flex flex-col justify-between flex-1",children:[x&&e.jsx("span",{className:a.cn("bg-red-500 text-white py-1 absolute text-[10px] md:text-xs w-[150px] text-center z-10",l?"top-3 -left-[50px] -rotate-45":"top-3 -right-[50px] rotate-45",p),children:x}),e.jsxs("div",{children:[r&&e.jsx("h3",{className:a.cn("text-lg font-semibold text-gray-800 line-clamp-1 dark:text-white",u),children:r}),t&&e.jsx("p",{className:a.cn("mt-2 text-secondary-700 font-medium text-sm mb-2 line-clamp-3 dark:text-secondary-dark",c),children:t})]}),n&&e.jsx("div",{className:"mt-2",children:n})]})]})}),exports.CheckboxInput=y,exports.CodeInput=({id:t,label:s,length:o,value:n,disabled:l,labelClassName:d,name:i,onCodeChange:c,inputSize:m="md",...u})=>{const p=r.useRef([]),x=N[m],b=e=>{const r=p.current.map(e=>e?.value||"").join("")
38
+ return n?e.jsxs(t.Link,{to:n,className:a.cn("inline-flex items-center justify-center transition-all duration-[170ms] hover:scale-[98%]",y,w,v,N,k,b),children:[p&&e.jsx("span",{className:"mr-2",children:p}),r,x&&e.jsx("span",{className:"ml-2",children:x})]}):e.jsxs("button",{disabled:d,type:l,onClick:s,className:a.cn("inline-flex items-center justify-center transition-all duration-[170ms] hover:scale-[98%]",y,w,v,N,k,b),children:[p&&e.jsx("span",{className:"mr-2",children:p}),r,x&&e.jsx("span",{className:"ml-2",children:x})]})},exports.ButtonVariantsMap=k,exports.Card=({title:r,description:t,image:s,onClick:o,footer:n,horizontal:l=!1,size:d="md",containerClassName:i,descriptionClassName:c,imageClassName:m,titleClassName:u,ribbonClassName:p,ribbon:x,children:b})=>e.jsx("div",{onClick:o,className:a.cn("relative bg-white rounded-xl shadow-lg hover:shadow-xl transition-shadow duration-300 cursor-pointer overflow-hidden dark:border dark:bg-gray-800 dark:border-gray-700",l?"flex flex-col md:flex-row":"flex flex-col",{sm:"max-w-xs",md:"max-w-sm",lg:"max-w-md",full:"w-full"}[d]||d,i),children:b??e.jsxs(e.Fragment,{children:[s?"string"==typeof s?e.jsx("img",{src:s,alt:r,className:a.cn("object-cover w-full h-48 md:h-full",l?"md:w-[40%]":"w-full",m)}):e.jsx("div",{className:a.cn("w-full h-48 md:h-full",l?"md:w-[40%]":"w-full",m),children:s}):null,e.jsxs("div",{className:"p-4 flex flex-col justify-between flex-1",children:[x&&e.jsx("span",{className:a.cn("bg-red-500 text-white py-1 absolute text-[10px] md:text-xs w-[150px] text-center z-10",l?"top-3 -left-[50px] -rotate-45":"top-3 -right-[50px] rotate-45",p),children:x}),e.jsxs("div",{children:[r&&e.jsx("h3",{className:a.cn("text-lg font-semibold text-gray-800 line-clamp-1 dark:text-white",u),children:r}),t&&e.jsx("p",{className:a.cn("mt-2 text-secondary-700 text-sm mb-2 line-clamp-3 dark:text-secondary-dark",c),children:t})]}),n&&e.jsx("div",{className:"mt-2",children:n})]})]})}),exports.CheckboxInput=y,exports.CodeInput=({id:t,label:s,length:o,value:n,disabled:l,labelClassName:d,name:i,onCodeChange:c,inputSize:m="md",...u})=>{const p=r.useRef([]),x=N[m],b=e=>{const r=p.current.map(e=>e?.value||"").join("")
39
39
  c&&c(r),p.current[e]?.value&&e<o-1&&p.current[e+1]?.focus()}
40
40
  return e.jsxs("div",{className:"flex flex-col gap-2",children:[s&&e.jsx("label",{htmlFor:t||i,className:a.cn("block text-sm font-medium mb-1 dark:text-white",d),children:s}),e.jsx("div",{className:"flex gap-2",onPaste:e=>{e.preventDefault(),e.clipboardData.getData("text").slice(0,o).split("").forEach((e,r)=>{p.current[r]&&(p.current[r].value=e,b(r))})},children:Array.from({length:o},(r,t)=>e.jsx("input",{ref:e=>{p.current[t]=e},type:"text",disabled:l,value:n?.[t],maxLength:1,onChange:()=>b(t),onKeyDown:e=>((e,r)=>{"Backspace"===e.key&&!p.current[r]?.value&&r>0&&p.current[r-1]?.focus()})(e,t),onFocus:()=>(e=>{const r=(()=>{for(let e=0;e<o;e++)if(!p.current[e]?.value)return e
41
41
  return-1})();-1!==r&&r<e&&p.current[r]?.focus()})(t),className:a.cn("text-center border rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary border-secondary dark:text-white dark:placeholder:text-white",x,{"bg-secondary/40 cursor-not-allowed ":l}),...u},t))})]})},exports.Collection=function({data:r,title:t,className:s,wrapperClassName:o,children:n,suffixIcon:l,activeItem:d,onChangeActive:i}){return e.jsxs("div",{className:a.cn("p-3 border border-secondary-700 inline-block dark:border-secondary-dark-700 rounded-md dark:text-white",s),children:[t&&e.jsx("h2",{className:"text-lg font-semibold mb-4",children:t}),r.length>0?e.jsx("ul",{className:a.cn("space-y-3",o),children:r.map((r,t)=>{const s=r.id===d
package/dist/main.js CHANGED
@@ -543,7 +543,7 @@ const Card = ({
543
543
  "p",
544
544
  {
545
545
  className: cn(
546
- "mt-2 text-secondary-700 font-medium text-sm mb-2 line-clamp-3 dark:text-secondary-dark",
546
+ "mt-2 text-secondary-700 text-sm mb-2 line-clamp-3 dark:text-secondary-dark",
547
547
  descriptionClassName
548
548
  ),
549
549
  children: description
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Alope-Community/alope-ui.git"
7
7
  },
8
- "version": "1.2.16",
8
+ "version": "1.2.17",
9
9
  "type": "module",
10
10
  "files": [
11
11
  "dist"