alope-ui 1.2.23 → 1.2.24

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
@@ -33,8 +33,8 @@ return e.jsxs("div",{className:a.cn("border border-gray-300 dark:border-white/20
33
33
  p?n?.(o?a[0]??null:a):b(a)})(t),className:"w-full flex justify-between items-center p-4 text-left dark:text-white",children:[e.jsx("span",{className:a.cn("font-semibold",i),children:r.label}),"function"==typeof l?l(s):l??e.jsx("svg",{className:a.cn("w-5 h-5 transition-transform",s&&"rotate-180"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{d:"M19 9l-7 7-7-7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsx("div",{className:a.cn("overflow-hidden bg-gray-50 px-4 transition-all dark:bg-gray-700 dark:text-white",s?"max-h-40 py-4":"max-h-0",m),children:r.description})]},t)})})},exports.Alert=({title:t,description:s,icon:d,titleClassName:i,descriptionClassName:c,action:m,withClose:u=!1,iconColor:p="secondary",type:x="secondary",variant:b="outline"})=>{const[g,h]=r.useState(!0)
34
34
  return g?e.jsxs("div",{id:"alopeAlert",className:a.cn("flex gap-2 p-4 rounded-md w-full",l[x],o[b]),children:[d??e.jsx("svg",{viewBox:"0 0 24 24",className:a.cn("w-6 h-6",n[p]),children:e.jsx("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z"})}),e.jsxs("div",{className:"flex md:flex-row flex-col justify-between md:items-center w-full",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("p",{className:a.cn("font-medium",i),children:t}),s&&e.jsx("p",{className:a.cn("text-sm",c),children:s}),u&&("function"==typeof m?e.jsx("div",{className:"mt-2",children:m()}):e.jsx("div",{className:"mt-2",children:m}))]}),e.jsx("div",{children:!u&&("function"==typeof m?e.jsx("div",{className:"mt-2",children:m()}):e.jsx("div",{className:"mt-2",children:m}))})]}),u&&e.jsx("svg",{onClick:()=>h(!1),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",className:"w-7 h-7 hover:cursor-pointer",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})]}):null},exports.Avatar=u,exports.AvatarGroup=({avatars:r,maxVisible:t=3,size:s="md",overlap:o="-ml-3",className:n})=>{const l=r.slice(0,t),d=r.length-t
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
- 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,variant:s="primary",separator:o="/"})=>e.jsx("nav",{"aria-label":"breadcrumb mb-5",children:e.jsx("ol",{className:"flex flex-wrap gap-2 text-gray-600",children:r.map((n,l)=>{const d=null===n.path||l===r.length-1,i=a.cn("flex items-center text-sm",g[s])
37
- return e.jsxs("li",{className:"flex items-center",children:[!d&&n.path?e.jsxs(t.Link,{to:n.path,className:a.cn(i,"hover:underline"),children:[n.icon&&e.jsx("span",{className:"mr-1",children:n.icon}),n.label]}):e.jsxs("span",{"aria-current":d?"page":void 0,className:a.cn(i,d&&"font-semibold"),children:[n.icon&&e.jsx("span",{className:"mr-1",children:n.icon}),n.label]}),!d&&e.jsx("span",{"aria-hidden":"true",className:"mx-2 select-none text-black/70 dark:text-white/70",children:o})]},l)})})}),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 g=k[m],f=y(i,c),w=h[o]||"",v=d?"opacity-50 cursor-not-allowed":"cursor-pointer",N=u?"w-full":""
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,variant:s="primary",separator:o="/"})=>e.jsx("nav",{"aria-label":"breadcrumb",children:e.jsx("ol",{className:"flex flex-wrap items-center gap-2 text-sm",children:r.map((n,l)=>{const d=null===n.path||l===r.length-1
37
+ return e.jsxs("li",{className:"flex items-center",children:[d?e.jsxs("span",{"aria-current":"page",className:a.cn("flex items-center font-medium",g[s]),children:[n.icon&&e.jsx("span",{className:"mr-1.5",children:n.icon}),n.label]}):n.path?e.jsxs(t.Link,{to:n.path,className:"flex items-center text-zinc-400 transition-colors hover:text-zinc-700 dark:text-zinc-500 dark:hover:text-zinc-300",children:[n.icon&&e.jsx("span",{className:"mr-1.5",children:n.icon}),n.label]}):e.jsxs("span",{className:"flex items-center text-zinc-400 dark:text-zinc-500",children:[n.icon&&e.jsx("span",{className:"mr-1.5",children:n.icon}),n.label]}),!d&&e.jsx("span",{"aria-hidden":"true",className:"ml-2 select-none text-zinc-300 dark:text-zinc-700",children:o})]},l)})})}),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 g=k[m],f=y(i,c),w=h[o]||"",v=d?"opacity-50 cursor-not-allowed":"cursor-pointer",N=u?"w-full":""
38
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%]",f,w,v,N,g,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%]",f,w,v,N,g,b),children:[p&&e.jsx("span",{className:"mr-2",children:p}),r,x&&e.jsx("span",{className:"ml-2",children:x})]})},exports.ButtonVariantsMap=f,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=w,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=j[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
package/dist/main.js CHANGED
@@ -349,39 +349,41 @@ const Breadcrumb = ({
349
349
  variant = "primary",
350
350
  separator = "/"
351
351
  }) => {
352
- return /* @__PURE__ */ jsx("nav", { "aria-label": "breadcrumb mb-5", children: /* @__PURE__ */ jsx("ol", { className: "flex flex-wrap gap-2 text-gray-600", children: data.map((item, index) => {
352
+ return /* @__PURE__ */ jsx("nav", { "aria-label": "breadcrumb", children: /* @__PURE__ */ jsx("ol", { className: "flex flex-wrap items-center gap-2 text-sm", children: data.map((item, index) => {
353
353
  const isLast = item.path === null || index === data.length - 1;
354
- const itemClasses = cn(
355
- "flex items-center text-sm",
356
- variantStyles[variant]
357
- );
358
354
  return /* @__PURE__ */ jsxs("li", { className: "flex items-center", children: [
359
- !isLast && item.path ? /* @__PURE__ */ jsxs(
360
- Link,
355
+ isLast ? /* @__PURE__ */ jsxs(
356
+ "span",
361
357
  {
362
- to: item.path,
363
- className: cn(itemClasses, "hover:underline"),
358
+ "aria-current": "page",
359
+ className: cn(
360
+ "flex items-center font-medium",
361
+ variantStyles[variant]
362
+ ),
364
363
  children: [
365
- item.icon && /* @__PURE__ */ jsx("span", { className: "mr-1", children: item.icon }),
364
+ item.icon && /* @__PURE__ */ jsx("span", { className: "mr-1.5", children: item.icon }),
366
365
  item.label
367
366
  ]
368
367
  }
369
- ) : /* @__PURE__ */ jsxs(
370
- "span",
368
+ ) : item.path ? /* @__PURE__ */ jsxs(
369
+ Link,
371
370
  {
372
- "aria-current": isLast ? "page" : void 0,
373
- className: cn(itemClasses, isLast && "font-semibold"),
371
+ to: item.path,
372
+ className: "flex items-center text-zinc-400 transition-colors hover:text-zinc-700 dark:text-zinc-500 dark:hover:text-zinc-300",
374
373
  children: [
375
- item.icon && /* @__PURE__ */ jsx("span", { className: "mr-1", children: item.icon }),
374
+ item.icon && /* @__PURE__ */ jsx("span", { className: "mr-1.5", children: item.icon }),
376
375
  item.label
377
376
  ]
378
377
  }
379
- ),
378
+ ) : /* @__PURE__ */ jsxs("span", { className: "flex items-center text-zinc-400 dark:text-zinc-500", children: [
379
+ item.icon && /* @__PURE__ */ jsx("span", { className: "mr-1.5", children: item.icon }),
380
+ item.label
381
+ ] }),
380
382
  !isLast && /* @__PURE__ */ jsx(
381
383
  "span",
382
384
  {
383
385
  "aria-hidden": "true",
384
- className: "mx-2 select-none text-black/70 dark:text-white/70",
386
+ className: "ml-2 select-none text-zinc-300 dark:text-zinc-700",
385
387
  children: separator
386
388
  }
387
389
  )
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.23",
8
+ "version": "1.2.24",
9
9
  "type": "module",
10
10
  "files": [
11
11
  "dist"