alope-ui 1.2.28 → 1.2.29
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/components/Badge/Badge.d.ts +3 -5
- package/dist/main.cjs +17 -17
- package/dist/main.js +11 -12
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
declare const
|
|
2
|
+
declare const BadgeColors: {
|
|
3
3
|
default: string;
|
|
4
4
|
secondary: string;
|
|
5
5
|
success: string;
|
|
@@ -15,11 +15,9 @@ declare const BadgePositions: {
|
|
|
15
15
|
};
|
|
16
16
|
export type BadgeProps = {
|
|
17
17
|
children?: React.ReactNode | string;
|
|
18
|
-
|
|
18
|
+
color?: keyof typeof BadgeColors;
|
|
19
19
|
position?: keyof typeof BadgePositions;
|
|
20
|
-
isAbsolute?: boolean;
|
|
21
|
-
className?: string;
|
|
22
20
|
icon?: React.ReactNode;
|
|
23
|
-
} & React.
|
|
21
|
+
} & Omit<React.HTMLAttributes<HTMLSpanElement>, 'className' | 'color'>;
|
|
24
22
|
export declare const Badge: React.FC<BadgeProps>;
|
|
25
23
|
export {};
|
package/dist/main.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict"
|
|
2
2
|
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})
|
|
3
|
-
const e=require("react/jsx-runtime"),r=require("react"),a=require("clsx-for-tailwind"),t=require("react-router-dom"),s=require("react-select"),o={outline:"outline-1",solid:""},n={success:"fill-success-700 dark:fill-success",info:"fill-info-700 dark:fill-info",error:"fill-error-700 dark:fill-error",warning:"fill-warning-700 dark:fill-warning",default:"fill-secondary-700 dark:fill-secondary"},l={success:"bg-success-30/50 outline-success-700 text-success-700 dark:bg-success-dark-30/20 dark:text-success",info:"bg-info-30/50 outline-info-700 text-info-700 dark:bg-info-dark-30/20 dark:text-info",warning:"bg-warning-30/50 outline-warning-700 text-warning-700 dark:bg-warning-dark-30/20 dark:text-warning",error:"bg-error-30/50 outline-error-700 text-error-700 dark:bg-error-dark-30/20 dark:text-error",default:"bg-secondary-30/50 outline-secondary-700 dark:bg-secondary-dark-30/20 dark:text-secondary"},d={sm:"w-8 h-8 text-xs",md:"w-12 h-12 text-sm",lg:"w-16 h-16 text-base"},i={solid:"bg-opacity-100",outline:"bg-transparent border-2"},c={sharp:"rounded-none",cornered:"rounded-md",rounded:"rounded-full"},m={primary:"bg-primary dark:bg-primary-dark text-white",error:"bg-error dark:bg-error-dark text-white",warning:"bg-warning dark:bg-warning-dark text-white",success:"bg-success dark:bg-success-dark text-white",info:"bg-info dark:bg-info-dark text-white",secondary:"bg-secondary dark:bg-secondary-dark text-white"},u=({imageSrc:t,fallbackName:s,ring:o=!1,ringClassName:n,shape:l="rounded",variant:u="solid",fallbackColor:p="primary",size:x="md",alt:b="avatar",status:g,className:h})=>{const[k,f]=r.useState(!1),y=d[x],w=i[u],v=c[l],
|
|
3
|
+
const e=require("react/jsx-runtime"),r=require("react"),a=require("clsx-for-tailwind"),t=require("react-router-dom"),s=require("react-select"),o={outline:"outline-1",solid:""},n={success:"fill-success-700 dark:fill-success",info:"fill-info-700 dark:fill-info",error:"fill-error-700 dark:fill-error",warning:"fill-warning-700 dark:fill-warning",default:"fill-secondary-700 dark:fill-secondary"},l={success:"bg-success-30/50 outline-success-700 text-success-700 dark:bg-success-dark-30/20 dark:text-success",info:"bg-info-30/50 outline-info-700 text-info-700 dark:bg-info-dark-30/20 dark:text-info",warning:"bg-warning-30/50 outline-warning-700 text-warning-700 dark:bg-warning-dark-30/20 dark:text-warning",error:"bg-error-30/50 outline-error-700 text-error-700 dark:bg-error-dark-30/20 dark:text-error",default:"bg-secondary-30/50 outline-secondary-700 dark:bg-secondary-dark-30/20 dark:text-secondary"},d={sm:"w-8 h-8 text-xs",md:"w-12 h-12 text-sm",lg:"w-16 h-16 text-base"},i={solid:"bg-opacity-100",outline:"bg-transparent border-2"},c={sharp:"rounded-none",cornered:"rounded-md",rounded:"rounded-full"},m={primary:"bg-primary dark:bg-primary-dark text-white",error:"bg-error dark:bg-error-dark text-white",warning:"bg-warning dark:bg-warning-dark text-white",success:"bg-success dark:bg-success-dark text-white",info:"bg-info dark:bg-info-dark text-white",secondary:"bg-secondary dark:bg-secondary-dark text-white"},u=({imageSrc:t,fallbackName:s,ring:o=!1,ringClassName:n,shape:l="rounded",variant:u="solid",fallbackColor:p="primary",size:x="md",alt:b="avatar",status:g,className:h})=>{const[k,f]=r.useState(!1),y=d[x],w=i[u],v=c[l],j=m[p],N=o?a.cn("ring-2 ring-offset-2",n||"ring-primary dark:ring-primary-dark"):"",C=s?s.split(" ").map(e=>e[0]).join("").toUpperCase():"?",z=k||!t?e.jsx("div",{className:a.cn("flex items-center justify-center font-semibold",j,y,v,w,N,h),children:C}):e.jsx("img",{src:t,alt:b,onError:()=>f(!0),className:a.cn("object-cover",y,v,w,N,h)})
|
|
4
4
|
return e.jsxs("div",{className:"relative inline-block",children:[z,g&&e.jsx("span",{className:a.cn("absolute bottom-0 right-0 w-3 h-3 rounded-full border-2","online"===g?"bg-success":"bg-secondary-700 dark:bg-secondary-dark-700","border-white")})]})},p={default:"bg-primary-30 text-primary-700 dark:bg-primary-dark-30",secondary:"bg-secondary-30 text-black dark:bg-secondary-dark-30",success:"bg-success-30 text-green-700 dark:bg-success-dark-30",error:"bg-error-30 text-red-700 dark:bg-error-dark-30",info:"bg-info-30 text-blue-700 dark:bg-info-dark-30",warning:"bg-warning-30 text-amber-700 dark:bg-warning-dark-30"},x={"top-right":"absolute -top-3 -right-3","top-left":"absolute -top-3 -left-3","bottom-right":"absolute -bottom-3 -right-3","bottom-left":"absolute -bottom-3 -left-3"},b=({label:r,icon:t,value:s,selectedValue:o,onChangeValue:n,labelClassName:l,className:d})=>{const i=s===o
|
|
5
5
|
return e.jsxs("button",{onClick:()=>n?.(s),className:a.cn("inline-flex flex-1 flex-col items-center justify-center p-5 group",i?"bg-secondary-30-50 dark:bg-secondary/10":"hover:bg-secondary-30 dark:hover:bg-secondary/30",d),children:[t,e.jsx("span",{className:a.cn("text-sm",i?"text-primary":"text-secondary-dark-700 dark:text-secondary-dark group-hover:text-secondary-700 dark:group-hover:text-white",l),children:r})]})},g={primary:"text-primary dark:text-primary-dark-30",secondary:"text-secondary-foreground dark:text-secondary-foreground-dark",success:"text-success-dark dark:text-success-dark-30",info:"text-info-dark dark:text-info-dark-30",warning:"text-warning-dark dark:text-warning-dark-30",error:"text-error-dark dark:text-error-dark-30"},h={sm:"px-3 py-2 text-sm font-medium",md:"px-4 py-2 text-base font-semibold tracking-[.2px]",lg:"px-6 py-3 text-lg font-semibold"},k={regular:"rounded-md",pill:"rounded-full"},f={primary:{solid:"bg-primary text-white hover:bg-primary-dark dark:bg-primary-dark dark:hover:bg-primary-dark/70",outline:"border border-primary text-primary hover:bg-primary-30 dark:bg-primary-dark/30 dark:border-primary-dark dark:text-white dark:hover:bg-primary-dark/70",ghost:"text-primary hover:bg-primary-30 dark:text-primary-dark dark:hover:bg-primary-dark/70 dark:hover:text-white",plain:"text-primary dark:text-primary-dark"},secondary:{solid:"bg-secondary text-black hover:bg-secondary-dark/80 dark:bg-secondary-dark dark:text-white dark:hover:bg-secondary-dark/70",outline:"border border-secondary text-black hover:bg-secondary-30 dark:bg-secondary-dark/30 dark:border-secondary-dark dark:text-white dark:hover:bg-secondary-dark/70",ghost:"text-black hover:bg-secondary-30 dark:text-white dark:hover:bg-secondary-dark/70",plain:"text-black dark:text-white"},success:{solid:"bg-success text-white hover:bg-success-dark dark:bg-success-dark dark:hover:bg-success-dark/70",outline:"border border-success text-success hover:bg-success-30 dark:bg-success-dark/30 dark:border-success-dark dark:text-white dark:hover:bg-success-dark/70",ghost:"text-success hover:bg-success-30 dark:text-success-dark dark:hover:bg-success-dark/70 dark:hover:text-white",plain:"text-success dark:text-success-dark"},warning:{solid:"bg-warning text-white hover:bg-warning-dark dark:bg-warning-dark dark:hover:bg-warning-dark/70",outline:"border border-warning text-warning hover:bg-warning-30 dark:bg-warning-dark/30 dark:border-warning-dark dark:text-white dark:hover:bg-warning-dark/70",ghost:"text-warning hover:bg-warning-30 dark:text-warning-dark dark:hover:bg-warning-dark/70 dark:hover:text-white",plain:"text-warning dark:text-warning-dark"},error:{solid:"bg-error text-white hover:bg-error-dark dark:bg-error-dark dark:hover:bg-error-dark/70",outline:"border border-error text-error hover:bg-error-30 dark:bg-error-dark/30 dark:border-error-dark dark:text-white dark:hover:bg-error-dark/70",ghost:"text-error hover:bg-error-30 dark:text-error-dark dark:hover:bg-error-dark/70 dark:hover:text-white",plain:"text-error dark:text-error-dark"},info:{solid:"bg-info text-white hover:bg-info-dark dark:bg-info-dark dark:hover:bg-info-dark/70",outline:"border border-info text-info hover:bg-info-30 dark:bg-info-dark/30 dark:border-info-dark dark:text-white dark:hover:bg-info-dark/70",ghost:"text-info hover:bg-info-30 dark:text-info-dark dark:hover:bg-info-dark/70 dark:hover:text-white",plain:"text-info dark:text-info-dark"}},y=(e,r)=>f[r][e]||"",w=r.forwardRef(({label:t,description:s,className:o="",indeterminate:n=!1,descriptionClassName:l,checkboxClassName:d,labelClassName:i,disabled:c,readOnly:m,children:u,checked:p,defaultChecked:x,onChange:b,...g},h)=>{const k=r.useRef(null)
|
|
6
6
|
r.useImperativeHandle(h,()=>k.current)
|
|
7
7
|
const[f,y]=r.useState(x??!1),w=void 0!==p,v=w?p:f
|
|
8
|
-
return r.useEffect(()=>{k.current&&(k.current.indeterminate=n)},[n]),e.jsxs("label",{className:a.cn("inline-flex items-center gap-3 cursor-pointer select-none",c&&"opacity-50 cursor-not-allowed",o),children:[e.jsxs("span",{className:"relative inline-flex items-center justify-center w-5 h-5",children:[e.jsx("input",{...g,ref:k,type:"checkbox",readOnly:m,disabled:c,onChange:e=>{w||y(e.target.checked),b?.(e)},checked:v,"aria-checked":n?"mixed":v?"true":"false",className:"absolute w-full h-full opacity-0 cursor-pointer peer"}),e.jsx("span",{className:a.cn("w-5 h-5 rounded border border-gray-300 dark:border-gray-600 flex items-center justify-center transition-colors duration-200",{"bg-primary border-primary dark:bg-primary-dark dark:border-primary-dark":v||n},d),children:n?e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-3 h-3 text-white",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{d:"M6 10a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1z"})}):v?e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-3 h-3 text-white fill-white",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-7.778 7.778a1 1 0 01-1.414 0L3.293 10.05a1 1 0 111.414-1.414l3.536 3.535 7.071-7.071a1 1 0 011.414 0z",clipRule:"evenodd"})}):null})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[u,t&&e.jsx("span",{className:a.cn("font-medium text-sm dark:text-white",i),children:t}),s&&e.jsx("span",{className:a.cn("text-secondary-700 text-sm dark:text-secondary-dark",l),children:s})]})]})}),v={sm:{container:"text-sm",checkbox:"w-4 h-4",label:"pl-2"},md:{container:"text-base",checkbox:"w-5 h-5",label:"pl-2"},lg:{container:"text-lg",checkbox:"w-6 h-6",label:"pl-3"}},
|
|
8
|
+
return r.useEffect(()=>{k.current&&(k.current.indeterminate=n)},[n]),e.jsxs("label",{className:a.cn("inline-flex items-center gap-3 cursor-pointer select-none",c&&"opacity-50 cursor-not-allowed",o),children:[e.jsxs("span",{className:"relative inline-flex items-center justify-center w-5 h-5",children:[e.jsx("input",{...g,ref:k,type:"checkbox",readOnly:m,disabled:c,onChange:e=>{w||y(e.target.checked),b?.(e)},checked:v,"aria-checked":n?"mixed":v?"true":"false",className:"absolute w-full h-full opacity-0 cursor-pointer peer"}),e.jsx("span",{className:a.cn("w-5 h-5 rounded border border-gray-300 dark:border-gray-600 flex items-center justify-center transition-colors duration-200",{"bg-primary border-primary dark:bg-primary-dark dark:border-primary-dark":v||n},d),children:n?e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-3 h-3 text-white",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{d:"M6 10a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1z"})}):v?e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-3 h-3 text-white fill-white",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-7.778 7.778a1 1 0 01-1.414 0L3.293 10.05a1 1 0 111.414-1.414l3.536 3.535 7.071-7.071a1 1 0 011.414 0z",clipRule:"evenodd"})}):null})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[u,t&&e.jsx("span",{className:a.cn("font-medium text-sm dark:text-white",i),children:t}),s&&e.jsx("span",{className:a.cn("text-secondary-700 text-sm dark:text-secondary-dark",l),children:s})]})]})}),v={sm:{container:"text-sm",checkbox:"w-4 h-4",label:"pl-2"},md:{container:"text-base",checkbox:"w-5 h-5",label:"pl-2"},lg:{container:"text-lg",checkbox:"w-6 h-6",label:"pl-3"}},j={solid:{label:"border-transparent bg-primary/90 text-white hover:bg-primary-700 dark:bg-primary-dark dark:hover:bg-primary-dark-700",checked:"bg-primary-700 hover:bg-primary-700 dark:bg-primary-dark-700",checkbox:"",checkedCheckbox:"border-white bg-primary dark:bg-primary"},subtle:{label:"border-slate-200 border-none bg-secondary/30 hover:bg-primary/30 hover:text-primary-700 dark:text-white dark:bg-primary-dark/50 hover:dark:text-primary-30",checked:"bg-primary/30 text-primary-700 border-primary/30 dark:border-none hover:bg-primary-700/15 dark:bg-primary/30 dark:text-white hover:dark:text-white dark:hover:bg-primary-dark/50",checkbox:"dark:bg-primary dark:border-none",checkedCheckbox:"border-primary-700 bg-primary-700 dark:bg-primary"},outline:{label:"border-secondary-700 bg-transparent hover:bg-primary/30 hover:text-primary-700 dark:hover:text-white hover:border-primary-700 dark:text-white dark:border-secondary-dark dark:hover:bg-primary-dark/20",checked:"border-primary bg-primary/30 text-primary-700 dark:border-primary-700 dark:bg-primary-dark/20",checkbox:"dark:border-secondary-dark",checkedCheckbox:"border-primary bg-primary-700 dark:border-primary-700 dark:border-primary dark:bg-primary"}},N={sm:"w-10 h-10 text-sm",md:"w-12 h-12 text-base",lg:"w-14 h-14 text-lg",xl:"w-16 h-16 text-xl"},C=r.forwardRef(({label:r,id:t,name:s,error:o,labelClassName:n,errorClassName:l,...d},i)=>e.jsxs("div",{className:"w-full",children:[r&&e.jsx("label",{htmlFor:t||s,className:a.cn("block text-sm font-medium mb-1 dark:text-white",n),children:r}),e.jsx("input",{ref:i,id:t||s,name:s,className:`block w-full px-3 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary sm:text-sm dark:text-white dark:placeholder:text-white ${o?"border-error dark:border-error-dark":"border-secondary dark:border-secondary-dark"} ${d.disabled?"bg-secondary/30 cursor-not-allowed":""}`,...d}),o&&e.jsx("p",{className:a.cn("mt-1 text-sm text-error",l),children:o})]}))
|
|
9
9
|
C.displayName="TextInput"
|
|
10
10
|
const z={success:{input:"focus:ring-success focus:border-success",outline:"outline-success dark:outline-success-dark",header:"bg-success dark:bg-success-dark",icon:"hover:bg-success-700 dark:hover:bg-success-dark-700",day:"bg-success dark:bg-success-dark"},info:{input:"focus:ring-info focus:border-info",outline:"outline-info dark:outline-info-dark",header:"bg-info dark:bg-info-dark",icon:"hover:bg-info-700 dark:hover:bg-info-dark-700",day:"bg-info dark:bg-info-dark"},error:{input:"focus:ring-error focus:border-error",outline:"outline-error dark:outline-error-dark",header:"bg-error dark:bg-error-dark",icon:"hover:bg-error-700 dark:hover:bg-error-dark-700",day:"bg-error dark:bg-error-dark"},warning:{input:"focus:ring-warning focus:border-warning",outline:"outline-warning dark:outline-warning-dark",header:"bg-warning dark:bg-warning-dark",icon:"hover:bg-warning-700 dark:hover:bg-warning-dark-700",day:"bg-warning dark:bg-warning-dark"},default:{input:"",outline:"",header:"",icon:"",day:""}},S={sm:"w-11 h-11 font-medium rounded-sm rounded rounded-full",md:"w-14 h-14 font-semibold tracking-[.2px] rounded-md rounded rounded-full",lg:"w-19 h-19 text-lg font-semibold rounded-lg rounded rounded-full"},L={base:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},sm:{1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},md:{1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},lg:{1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},xl:{1:"xl:grid-cols-1",2:"xl:grid-cols-2",3:"xl:grid-cols-3",4:"xl:grid-cols-4",5:"xl:grid-cols-5",6:"xl:grid-cols-6",7:"xl:grid-cols-7",8:"xl:grid-cols-8",9:"xl:grid-cols-9",10:"xl:grid-cols-10",11:"xl:grid-cols-11",12:"xl:grid-cols-12"},"2xl":{1:"2xl:grid-cols-1",2:"2xl:grid-cols-2",3:"2xl:grid-cols-3",4:"2xl:grid-cols-4",5:"2xl:grid-cols-5",6:"2xl:grid-cols-6",7:"2xl:grid-cols-7",8:"2xl:grid-cols-8",9:"2xl:grid-cols-9",10:"2xl:grid-cols-10",11:"2xl:grid-cols-11",12:"2xl:grid-cols-12"}},D={base:{1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6"},sm:{1:"sm:gap-1",2:"sm:gap-2",3:"sm:gap-3",4:"sm:gap-4",5:"sm:gap-5",6:"sm:gap-6"},md:{1:"md:gap-1",2:"md:gap-2",3:"md:gap-3",4:"md:gap-4",5:"md:gap-5",6:"md:gap-6"},lg:{1:"lg:gap-1",2:"lg:gap-2",3:"lg:gap-3",4:"lg:gap-4",5:"lg:gap-5",6:"lg:gap-6"},xl:{1:"xl:gap-1",2:"xl:gap-2",3:"xl:gap-3",4:"xl:gap-4",5:"xl:gap-5",6:"xl:gap-6"},"2xl":{1:"2xl:gap-1",2:"2xl:gap-2",3:"2xl:gap-3",4:"2xl:gap-4",5:"2xl:gap-5",6:"2xl:gap-6"}}
|
|
11
11
|
function M(e){return"number"==typeof e?{base:e}:e}const R={base:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",full:"col-span-full"},sm:{1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",full:"sm:col-span-full"},md:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",full:"md:col-span-full"},lg:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",full:"lg:col-span-full"},xl:{1:"xl:col-span-1",2:"xl:col-span-2",3:"xl:col-span-3",4:"xl:col-span-4",5:"xl:col-span-5",6:"xl:col-span-6",7:"xl:col-span-7",8:"xl:col-span-8",9:"xl:col-span-9",10:"xl:col-span-10",11:"xl:col-span-11",12:"xl:col-span-12",full:"xl:col-span-full"},"2xl":{1:"2xl:col-span-1",2:"2xl:col-span-2",3:"2xl:col-span-3",4:"2xl:col-span-4",5:"2xl:col-span-5",6:"2xl:col-span-6",7:"2xl:col-span-7",8:"2xl:col-span-8",9:"2xl:col-span-9",10:"2xl:col-span-10",11:"2xl:col-span-11",12:"2xl:col-span-12",full:"2xl:col-span-full"}},$={base:{1:"columns-1",2:"columns-2",3:"columns-3",4:"columns-4",5:"columns-5",6:"columns-6",7:"columns-7",8:"columns-8",9:"columns-9",10:"columns-10",11:"columns-11",12:"columns-12"},sm:{1:"sm:columns-1",2:"sm:columns-2",3:"sm:columns-3",4:"sm:columns-4",5:"sm:columns-5",6:"sm:columns-6",7:"sm:columns-7",8:"sm:columns-8",9:"sm:columns-9",10:"sm:columns-10",11:"sm:columns-11",12:"sm:columns-12"},md:{1:"md:columns-1",2:"md:columns-2",3:"md:columns-3",4:"md:columns-4",5:"md:columns-5",6:"md:columns-6",7:"md:columns-7",8:"md:columns-8",9:"md:columns-9",10:"md:columns-10",11:"md:columns-11",12:"md:columns-12"},lg:{1:"lg:columns-1",2:"lg:columns-2",3:"lg:columns-3",4:"lg:columns-4",5:"lg:columns-5",6:"lg:columns-6",7:"lg:columns-7",8:"lg:columns-8",9:"lg:columns-9",10:"lg:columns-10",11:"lg:columns-11",12:"lg:columns-12"},xl:{1:"xl:columns-1",2:"xl:columns-2",3:"xl:columns-3",4:"xl:columns-4",5:"xl:columns-5",6:"xl:columns-6",7:"xl:columns-7",8:"xl:columns-8",9:"xl:columns-9",10:"xl:columns-10",11:"xl:columns-11",12:"xl:columns-12"},"2xl":{1:"2xl:columns-1",2:"2xl:columns-2",3:"2xl:columns-3",4:"2xl:columns-4",5:"2xl:columns-5",6:"2xl:columns-6",7:"2xl:columns-7",8:"2xl:columns-8",9:"2xl:columns-9",10:"2xl:columns-10",11:"2xl:columns-11",12:"2xl:columns-12"}},T={base:{1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6"},sm:{1:"sm:gap-1",2:"sm:gap-2",3:"sm:gap-3",4:"sm:gap-4",5:"sm:gap-5",6:"sm:gap-6"},md:{1:"md:gap-1",2:"md:gap-2",3:"md:gap-3",4:"md:gap-4",5:"md:gap-5",6:"md:gap-6"},lg:{1:"lg:gap-1",2:"lg:gap-2",3:"lg:gap-3",4:"lg:gap-4",5:"lg:gap-5",6:"lg:gap-6"},xl:{1:"xl:gap-1",2:"xl:gap-2",3:"xl:gap-3",4:"xl:gap-4",5:"xl:gap-5",6:"xl:gap-6"},"2xl":{1:"2xl:gap-1",2:"2xl:gap-2",3:"2xl:gap-3",4:"2xl:gap-4",5:"2xl:gap-5",6:"2xl:gap-6"}}
|
|
@@ -34,21 +34,21 @@ p?n?.(o?a[0]??null:a):b(a)})(t),className:"w-full flex justify-between items-cen
|
|
|
34
34
|
if(!p)return null
|
|
35
35
|
const b=i?e.jsx("div",{className:"mt-2",children:"function"==typeof i?i():i}):null
|
|
36
36
|
return e.jsxs("div",{id:"alopeAlert",className:a.cn("flex gap-2 p-4 rounded-md w-full",l[m],o[u]),children:[d??e.jsx("svg",{viewBox:"0 0 24 24",className:a.cn("w-6 h-6 shrink-0",n[m]),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:"font-medium",children:t}),s&&e.jsx("p",{className:"text-sm",children:s}),c&&b]}),!c&&b&&e.jsx("div",{children:b})]}),c&&e.jsx("svg",{onClick:()=>x(!1),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",className:"w-6 h-6 shrink-0 hover:cursor-pointer",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})]})},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
|
|
37
|
-
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,
|
|
38
|
-
return e.jsxs("span",{className:a.cn("inline-flex items-center px-3 py-1 rounded-full text-sm font-semibold",d
|
|
39
|
-
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",color:c="primary",radius:m="regular",fullWidth:u=!1,prefixIcon:p,suffixIcon:x})=>{const b=k[m],g=y(i,c),f=h[o]||"",w=d?"opacity-50 cursor-not-allowed":"cursor-pointer",v=u?"w-full":"",
|
|
40
|
-
return n?e.jsxs(t.Link,{to:n,className:
|
|
37
|
+
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,color:t="default",position:s,icon:o,...n})=>{const l=p[t],d=s?x[s]:""
|
|
38
|
+
return e.jsxs("span",{...n,className:a.cn("inline-flex items-center px-3 py-1 rounded-full text-sm font-semibold",l,d),children:[o&&e.jsx("span",{className:"mr-1",children:o}),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,color:s="primary",separator:o="/"})=>e.jsx("nav",{"aria-label":"breadcrumb",className:"mb-5",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
|
|
39
|
+
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",color:c="primary",radius:m="regular",fullWidth:u=!1,prefixIcon:p,suffixIcon:x})=>{const b=k[m],g=y(i,c),f=h[o]||"",w=d?"opacity-50 cursor-not-allowed":"cursor-pointer",v=u?"w-full":"",j=a.cn("inline-flex items-center justify-center transition-all duration-[170ms] hover:scale-[98%]",g,f,w,v,b)
|
|
40
|
+
return n?e.jsxs(t.Link,{to:n,className:j,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:j,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=N[m],b=e=>{const r=p.current.map(e=>e?.value||"").join("")
|
|
41
41
|
c&&c(r),p.current[e]?.value&&e<o-1&&p.current[e+1]?.focus()}
|
|
42
42
|
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
|
|
43
43
|
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
|
|
44
|
-
return e.jsx("li",{children:n?e.jsx("div",{onClick:()=>i?.(r,t),children:n(r,t,s)}):e.jsxs("div",{onClick:()=>i?.(r,t),className:a.cn("p-3 border border-secondary-700 dark:border-secondary-dark-700 rounded-md flex gap-3 items-center justify-between cursor-pointer",{"bg-primary-100 dark:bg-primary-dark-100":s}),children:[e.jsx("p",{className:"font-bold",children:r.name||`Item ${r.id}`}),l&&e.jsx("span",{children:"function"==typeof l?l(r,t,s):l})]})},r.id)})}):e.jsx("p",{children:"No items to display."})]})},exports.DatePicker=({label:t,id:s,name:o,color:n="default",labelClassName:l,selectedDate:d,onDateChange:i})=>{const[c,m]=r.useState(d||null),[u,p]=r.useState(!1),[x,b]=r.useState(c?c.getMonth():(new Date).getMonth()),[g,h]=r.useState(c?c.getFullYear():(new Date).getFullYear()),[k,f]=r.useState("bottom"),y=r.useRef(null),w=r.useRef(null),v=z[n].input,
|
|
44
|
+
return e.jsx("li",{children:n?e.jsx("div",{onClick:()=>i?.(r,t),children:n(r,t,s)}):e.jsxs("div",{onClick:()=>i?.(r,t),className:a.cn("p-3 border border-secondary-700 dark:border-secondary-dark-700 rounded-md flex gap-3 items-center justify-between cursor-pointer",{"bg-primary-100 dark:bg-primary-dark-100":s}),children:[e.jsx("p",{className:"font-bold",children:r.name||`Item ${r.id}`}),l&&e.jsx("span",{children:"function"==typeof l?l(r,t,s):l})]})},r.id)})}):e.jsx("p",{children:"No items to display."})]})},exports.DatePicker=({label:t,id:s,name:o,color:n="default",labelClassName:l,selectedDate:d,onDateChange:i})=>{const[c,m]=r.useState(d||null),[u,p]=r.useState(!1),[x,b]=r.useState(c?c.getMonth():(new Date).getMonth()),[g,h]=r.useState(c?c.getFullYear():(new Date).getFullYear()),[k,f]=r.useState("bottom"),y=r.useRef(null),w=r.useRef(null),v=z[n].input,j=z[n].day,N=z[n].header,S=z[n].icon,L=z[n].outline
|
|
45
45
|
r.useLayoutEffect(()=>{if(u&&w.current){const e=w.current.getBoundingClientRect(),r=window.innerHeight-e.bottom
|
|
46
46
|
f(r<300?"top":"bottom")}},[u]),r.useEffect(()=>{d&&(m(d),b(d.getMonth()),h(d.getFullYear()))},[d]),r.useEffect(()=>{function e(e){y.current&&!y.current.contains(e.target)&&p(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[y])
|
|
47
47
|
const D=e=>{m(e),i&&i(e),p(!1)}
|
|
48
|
-
return e.jsxs("div",{className:"relative",ref:y,children:[t&&e.jsx("label",{htmlFor:s||o,className:a.cn("block text-sm font-medium mb-1 dark:text-white",l),children:t}),e.jsx(C,{type:"text",readOnly:!0,ref:w,value:c?c.toLocaleDateString():"",onClick:()=>p(!u),placeholder:"Select a date",className:a.cn("w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary sm:text-sm dark:placeholder:text-white dark:text-white",v)}),u&&e.jsxs("div",{className:a.cn("absolute overflow-auto z-10 w-full bg-white outline-3 outline-primary dark:outline-primary-dark rounded-md shadow-lg","top"===k?"bottom-full mb-2":"top-full mt-2",L),children:[e.jsxs("div",{className:a.cn("flex justify-between items-center mb-1 bg-primary dark:bg-primary-dark p-2 text-white",
|
|
48
|
+
return e.jsxs("div",{className:"relative",ref:y,children:[t&&e.jsx("label",{htmlFor:s||o,className:a.cn("block text-sm font-medium mb-1 dark:text-white",l),children:t}),e.jsx(C,{type:"text",readOnly:!0,ref:w,value:c?c.toLocaleDateString():"",onClick:()=>p(!u),placeholder:"Select a date",className:a.cn("w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary sm:text-sm dark:placeholder:text-white dark:text-white",v)}),u&&e.jsxs("div",{className:a.cn("absolute overflow-auto z-10 w-full bg-white outline-3 outline-primary dark:outline-primary-dark rounded-md shadow-lg","top"===k?"bottom-full mb-2":"top-full mt-2",L),children:[e.jsxs("div",{className:a.cn("flex justify-between items-center mb-1 bg-primary dark:bg-primary-dark p-2 text-white",N),children:[e.jsx("button",{onClick:()=>{0===x?(b(11),h(g-1)):b(x-1)},className:a.cn("px-2 py-1 rounded-md hover:bg-primary-700 dark:hover:bg-primary-dark-700 hover:cursor-pointer",S),children:"<"}),e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx("div",{className:"font-semibold",children:new Date(g,x).toLocaleString("default",{month:"long"})}),e.jsx("div",{className:"w-20",children:e.jsx(C,{type:"number",value:g,onChange:e=>h(Number(e.target.value))})})]}),e.jsx("button",{onClick:()=>{11===x?(b(0),h(g+1)):b(x+1)},className:a.cn("px-2 py-1 rounded-md hover:bg-primary-700 dark:hover:bg-primary-dark-700 hover:cursor-pointer",S),children:">"})]}),(()=>{const r=[],t=new Date(g,x+1,0).getDate(),s=new Date(g,x,1).getDay()
|
|
49
49
|
for(let a=0;a<s;a++)r.push(e.jsx("div",{className:"w-8 h-8"},`empty-${a}`))
|
|
50
50
|
for(let o=1;o<=t;o++){const t=new Date(g,x,o),s=c&&t.getDate()===c.getDate()&&t.getMonth()===c.getMonth()&&t.getFullYear()===c.getFullYear()
|
|
51
|
-
r.push(e.jsx("div",{className:a.cn("px-4 py-2 flex items-center justify-center cursor-pointer rounded-md text-sm font-medium hover:bg-secondary dark:hover:bg-secondary-dark",{"bg-primary dark:bg-primary-dark text-white":s,[
|
|
51
|
+
r.push(e.jsx("div",{className:a.cn("px-4 py-2 flex items-center justify-center cursor-pointer rounded-md text-sm font-medium hover:bg-secondary dark:hover:bg-secondary-dark",{"bg-primary dark:bg-primary-dark text-white":s,[j]:s}),onClick:()=>D(t),children:o},o))}return e.jsxs("div",{className:"grid grid-cols-7 gap-1 p-2",children:[["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(r=>e.jsx("div",{className:"w-8 h-8 flex items-center justify-center font-semibold",children:r},r)),r]})})()]})]})},exports.FAB=({children:t,direction:s="vertical",size:o="md",variant:n="solid",variantType:l="primary",isOpen:d,onOpen:i,icon:c="+"})=>{const[m,u]=r.useState(d),[p,x]=r.useState(!1)
|
|
52
52
|
r.useEffect(()=>{if(d)u(!0),x(!1)
|
|
53
53
|
else if(m){x(!0)
|
|
54
54
|
const e=setTimeout(()=>{u(!1),x(!1)},300)
|
|
@@ -68,19 +68,19 @@ if(e===r.type)return!0
|
|
|
68
68
|
if(e.endsWith("/*")){const a=e.split("/")[0]
|
|
69
69
|
return r.type.startsWith(a+"/")}return!!e.startsWith(".")&&r.name.toLowerCase().endsWith(e.toLowerCase())})
|
|
70
70
|
var r})
|
|
71
|
-
return o?(b(`File type "${o.type}" is not accepted.`),k.current.value="",[]):u.length+e.length>s?(b(`You can only upload up to ${s} files.`),k.current.value="",[]):e},
|
|
71
|
+
return o?(b(`File type "${o.type}" is not accepted.`),k.current.value="",[]):u.length+e.length>s?(b(`You can only upload up to ${s} files.`),k.current.value="",[]):e},j=()=>u.map((r,a)=>e.jsxs("div",{onClick:e=>e.stopPropagation(),className:"relative pt-7 pb-3 px-5 border border-secondary dark:border-secondary-dark-700 rounded max-w-sm cursor-default",children:[e.jsx("div",{className:"flex items-center justify-center max-w-full h-56 mb-3",children:r.type.startsWith("image/")?e.jsx("img",{src:URL.createObjectURL(r),alt:r.name,className:"max-w-full h-56 object-cover"}):e.jsx("div",{className:"text-secondary dark:text-secondary-dark text-sm italic",children:"Preview not available"})}),e.jsx("p",{className:"text-xs text-secondary dark:text-secondary-dark text-center",children:r.name}),c&&u.length>0&&e.jsx("div",{className:"absolute top-0 right-0 z-10",children:e.jsx("button",{onClick:e=>((e,r)=>{e.stopPropagation()
|
|
72
72
|
const a=u.filter((e,a)=>a!==r)
|
|
73
73
|
p(a),m(a),0===a.length&&k.current&&(k.current.value="")})(e,a),className:"w-auto h-auto py-2 px-2 bg-error text-white rounded-xs hover:cursor-pointer",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",className:"w-4 h-4 fill-white",children:e.jsx("g",{fill:"currentColor",fillRule:"nonzero",stroke:"none",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",strokeDasharray:"",strokeDashoffset:"0",fontFamily:"none",fontWeight:"none",fontSize:"none",textAnchor:"none",style:{mixBlendMode:"normal"},children:e.jsx("g",{transform:"scale(5.33333,5.33333)",children:e.jsx("path",{d:"M39.48633,6.97852c-0.39614,0.00936 -0.77249,0.17506 -1.04687,0.46094l-14.43945,14.43945l-14.43945,-14.43945c-0.28248,-0.2909 -0.67069,-0.45506 -1.07617,-0.45508c-0.61064,0.00015 -1.16026,0.37042 -1.38978,0.93629c-0.22952,0.56587 -0.09314,1.21439 0.34486,1.63988l14.43945,14.43945l-14.43945,14.43945c-0.39185,0.37623 -0.54969,0.9349 -0.41265,1.46055c0.13704,0.52565 0.54754,0.93616 1.07319,1.07319c0.52565,0.13704 1.08432,-0.02081 1.46055,-0.41265l14.43945,-14.43945l14.43945,14.43945c0.37623,0.39185 0.9349,0.54969 1.46055,0.41265c0.52565,-0.13704 0.93616,-0.54754 1.07319,-1.07319c0.13704,-0.52565 -0.0208,-1.08432 -0.41265,-1.46055l-14.43945,-14.43945l14.43945,-14.43945c0.44646,-0.42851 0.58398,-1.08719 0.34628,-1.65854c-0.2377,-0.57135 -0.80184,-0.93811 -1.4205,-0.92349z"})})})})})})]},a))
|
|
74
74
|
return"dropzone"===i?e.jsxs("div",{className:"",children:[e.jsxs("div",{className:a.cn("flex gap-5 flex-wrap items-center-safe justify-center-safe border-4 border-dashed rounded-lg p-6 text-center cursor-pointer dark:text-white",g?"border-info dark:border-info-dark":"border-secondary dark:border-secondary-dark"),onDragEnter:y,onDragOver:y,onDragLeave:e=>{e.preventDefault(),h(!1)},onDrop:e=>{e.preventDefault(),h(!1)
|
|
75
75
|
const r=Array.from(e.dataTransfer.files),a=v(r)
|
|
76
76
|
if(!a.length)return
|
|
77
77
|
const t=1===s?a.slice(0,1):[...u,...a].slice(0,s)
|
|
78
|
-
p(t),m(t),b(""),k.current.value=""},onClick:w,children:[e.jsx("input",{type:"file",ref:k,className:"hidden",accept:t,multiple:s>1,capture:d,onChange:f}),u.length>0?
|
|
78
|
+
p(t),m(t),b(""),k.current.value=""},onClick:w,children:[e.jsx("input",{type:"file",ref:k,className:"hidden",accept:t,multiple:s>1,capture:d,onChange:f}),u.length>0?j():e.jsx("p",{className:"text-sm md:text-base",children:"Drag & drop files here, or click to select files"})]}),x?e.jsx("p",{className:"text-error text-sm mt-2",children:x}):l&&e.jsx("p",{className:"text-sm text-gray-500 dark:text-secondary-dark mt-2",children:l})]}):e.jsxs("div",{onClick:w,className:"cursor-pointer inline-block",children:[e.jsx("input",{type:"file",ref:k,accept:t,multiple:s>1,capture:d,onChange:f,className:"hidden"}),e.jsx("div",{className:"inline-flex items-center gap-2 px-4 py-2 border border-secondary rounded bg-gray-50 hover:bg-secondary-30 text-sm dark:border-secondary-dark dark:bg-gray-700 dark:hover:bg-secondary-dark-700 dark:text-white",children:e.jsx("span",{className:"font-medium",children:u.length>0?`${u.length} file${u.length>1?"s":""} selected`:o??"Choose file"})}),u.length>0&&e.jsx("div",{className:"flex gap-5 flex-wrap mt-2",children:j()}),x?e.jsx("p",{className:"text-error text-sm mt-2",children:x}):l&&e.jsx("p",{className:"text-sm text-gray-500 dark:text-secondary-dark mt-2",children:l})]})},exports.Grid=({className:r,cols:t,gap:s,children:o,style:n,...l})=>{const d=(i=M(t))?Object.entries(i).map(([e,r])=>L[e]?.[r]??""):[]
|
|
79
79
|
var i
|
|
80
80
|
const c=function(e){return e?Object.entries(e).map(([e,r])=>D[e]?.[r]??""):[]}(M(s))
|
|
81
81
|
return e.jsx("div",{className:a.cn("grid",d,c,r),...l,children:o})},exports.GridItem=({className:r,colSpan:t,children:s,...o})=>{const n=(l="number"==typeof(d=t)?{base:d}:d)?Object.entries(l).map(([e,r])=>R[e]?.[r]??""):[]
|
|
82
82
|
var l,d
|
|
83
|
-
return e.jsx("div",{className:a.cn(...n,r),...o,children:s})},exports.ListCheckboxInput=({name:r,options:t,selectedValues:s,onValueChange:o,containerClassName:n,inputGroupClassName:l,inputLabelClassName:d,inputCheckboxClassName:i,variant:c="subtle",checkboxSize:m="md",disabled:u,...p})=>{const x=v[m],b=
|
|
83
|
+
return e.jsx("div",{className:a.cn(...n,r),...o,children:s})},exports.ListCheckboxInput=({name:r,options:t,selectedValues:s,onValueChange:o,containerClassName:n,inputGroupClassName:l,inputLabelClassName:d,inputCheckboxClassName:i,variant:c="subtle",checkboxSize:m="md",disabled:u,...p})=>{const x=v[m],b=j[c]
|
|
84
84
|
return e.jsx("div",{className:a.cn("flex flex-wrap gap-3",n),children:t.map((t,n)=>{const c=s?.some(e=>e.value===t.value)??!1
|
|
85
85
|
return e.jsxs("label",{className:a.cn("relative flex items-center rounded-md cursor-pointer transition-all duration-200 border px-3 py-2",x.container,b.label,{[b.checked]:c,"opacity-50 cursor-not-allowed":u},l?.(t,c)),children:[e.jsx("input",{type:"checkbox",name:r,value:t.value,checked:c,onChange:()=>{const e=c?s?.filter(e=>e.value!==t.value)||[]:[...s||[],t]
|
|
86
86
|
o(e)},disabled:u,className:a.cn("absolute opacity-0 w-full h-full cursor-pointer",{"cursor-not-allowed":u}),...p}),e.jsx("span",{className:a.cn("flex items-center justify-center rounded-md border transition-all duration-200",x.checkbox,b.checkbox,{[b.checkedCheckbox]:c},i?.(t,c)),children:c&&e.jsx("span",{children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"white",className:"w-3 h-3",children:e.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-7.778 7.778a1 1 0 01-1.414 0L3.293 10.05a1 1 0 111.414-1.414l3.536 3.535 7.071-7.071a1 1 0 011.414 0z",clipRule:"evenodd"})})})}),e.jsx("span",{className:a.cn("ml-2",x.label,d?.(t,c)),children:t.label})]},n)})})},exports.Masonry=F,exports.Modal=({isOpen:t,overlayClose:s=!0,onClose:o,title:n,children:l,showCloseButton:d=!0,size:i="md",className:c})=>(r.useEffect(()=>{const e=e=>{"Escape"===e.key&&o()}
|
|
@@ -94,11 +94,11 @@ const e=Math.max(r-m,1),a=Math.min(r+m,b),t=e>2,s=a<b-1,o=b
|
|
|
94
94
|
if(!t&&s){const e=3+2*m
|
|
95
95
|
return[...Array.from({length:e},(e,r)=>r+1),g,b]}if(t&&!s){const e=3+2*m,r=Array.from({length:e},(r,a)=>b-e+1+a)
|
|
96
96
|
return[1,g,...r]}if(t&&s){const r=Array.from({length:a-e+1},(r,a)=>e+a)
|
|
97
|
-
return[1,g,...r,g,o]}return Array.from({length:b},(e,r)=>r+1)})(),f=q[x]||"",y="opacity-50 pointer-events-none",w=e=>d?.(e)??`?page=${e}`,v=l?e.jsx("a",{className:a.cn("px-3 py-1 rounded-lg border dark:border-gray-600 dark:text-white dark:hover:bg-gray-700",f,1===r?y:"hover:cursor-pointer"),href:r>1?w(r-1):void 0,onClick:e=>{1!==r?(e.preventDefault(),h(r-1)):e.preventDefault()},"aria-disabled":1===r,children:u??e.jsx("span",{children:"<"})}):e.jsx("button",{className:a.cn("px-3 py-1 rounded-lg border dark:border-gray-600 dark:text-white dark:hover:bg-gray-700",f,1===r?y:"hover:cursor-pointer"),onClick:()=>h(r-1),disabled:1===r,children:u??e.jsx("span",{children:"<"})}),
|
|
97
|
+
return[1,g,...r,g,o]}return Array.from({length:b},(e,r)=>r+1)})(),f=q[x]||"",y="opacity-50 pointer-events-none",w=e=>d?.(e)??`?page=${e}`,v=l?e.jsx("a",{className:a.cn("px-3 py-1 rounded-lg border dark:border-gray-600 dark:text-white dark:hover:bg-gray-700",f,1===r?y:"hover:cursor-pointer"),href:r>1?w(r-1):void 0,onClick:e=>{1!==r?(e.preventDefault(),h(r-1)):e.preventDefault()},"aria-disabled":1===r,children:u??e.jsx("span",{children:"<"})}):e.jsx("button",{className:a.cn("px-3 py-1 rounded-lg border dark:border-gray-600 dark:text-white dark:hover:bg-gray-700",f,1===r?y:"hover:cursor-pointer"),onClick:()=>h(r-1),disabled:1===r,children:u??e.jsx("span",{children:"<"})}),j=l?e.jsx("a",{className:a.cn("px-3 py-1 rounded-lg border dark:border-gray-600 dark:text-white dark:hover:bg-gray-700",f,r===b?y:"hover:cursor-pointer"),href:r<b?w(r+1):void 0,onClick:e=>{r!==b?(e.preventDefault(),h(r+1)):e.preventDefault()},"aria-disabled":r===b,children:p??e.jsx("span",{children:">"})}):e.jsx("button",{className:a.cn("px-3 py-1 rounded-lg border dark:border-gray-600 dark:text-white dark:hover:bg-gray-700",f,r===b?y:"hover:cursor-pointer"),onClick:()=>h(r+1),disabled:r===b,children:p??e.jsx("span",{children:">"})})
|
|
98
98
|
return t?e.jsxs("div",{className:"flex items-center gap-3",children:[v,(()=>{if("long"===s&&n&&o){const a=(r-1)*n+1,t=Math.min(r*n,o)
|
|
99
|
-
return e.jsxs("p",{className:"dark:text-white",children:["Showing ",a," - ",t," of ",o]})}return"none"===s?e.jsxs("p",{className:"dark:text-white",children:[r," of ",b]}):null})(),
|
|
99
|
+
return e.jsxs("p",{className:"dark:text-white",children:["Showing ",a," - ",t," of ",o]})}return"none"===s?e.jsxs("p",{className:"dark:text-white",children:[r," of ",b]}):null})(),j]}):e.jsxs("div",{className:"flex items-center gap-3",children:[v,k.map((t,s)=>{if("..."===t)return e.jsx("span",{className:a.cn("px-3 py-1 text-gray-500 dark:text-gray-400",f),children:"..."},s)
|
|
100
100
|
const o=t===r,n=a.cn("px-3 py-1 rounded-lg border",o?"bg-primary text-white dark:bg-primary-dark dark:border-primary-dark":"hover:bg-secondary hover:cursor-pointer dark:border-gray-600 dark:text-white dark:hover:bg-gray-700",f,o&&"pointer-events-none")
|
|
101
|
-
return l?e.jsx("a",{className:n,href:w(Number(t)),onClick:e=>{e.preventDefault(),h(Number(t))},children:t},s):e.jsx("button",{className:n,onClick:()=>h(Number(t)),children:t},s)}),
|
|
101
|
+
return l?e.jsx("a",{className:n,href:w(Number(t)),onClick:e=>{e.preventDefault(),h(Number(t))},children:t},s):e.jsx("button",{className:n,onClick:()=>h(Number(t)),children:t},s)}),j]})},exports.RadioInput=({name:r,options:t,selectedValue:s,onValueChange:o,containerClassName:n,inputGroupClassName:l,inputLabelClassName:d,inputRadioClassName:i,variant:c="subtle",radioSize:m="md",disabled:u,...p})=>{const x=G[m],b=U[c]
|
|
102
102
|
return e.jsx("div",{className:a.cn("flex flex-wrap gap-3",n),children:t.map((t,n)=>{const c=s?.value===t.value
|
|
103
103
|
return e.jsxs("label",{className:a.cn("relative flex items-center rounded-md cursor-pointer transition-all duration-200 border px-3 py-2",x.container,b.label,{[b.checked]:c,"opacity-50 cursor-not-allowed":u},l?.(c,t)),children:[e.jsx("input",{type:"radio",name:r,value:t.value,checked:c,onChange:()=>o(t),disabled:u,className:a.cn("absolute opacity-0 w-full h-full cursor-pointer",{"cursor-not-allowed":u}),...p}),e.jsx("span",{className:a.cn("flex items-center justify-center rounded-full border transition-all duration-200",x.radio,b.radio,{[b.checkedRadio]:c},i?.(c,t)),children:c&&e.jsx("span",{className:a.cn("w-1/2 h-1/2 rounded-full bg-white dark:bg-primary-dark transition-transform duration-200 transform scale-100")})}),e.jsx("span",{className:a.cn("ml-2",x.label,d?.(c,t)),children:t.label})]},n)})})},exports.SelectInput=({label:r,error:t,labelClassName:o,errorClassName:n,customClassNames:l,...d})=>{const i={clearIndicator:()=>a.cn("hover:cursor-pointer hover:!text-error dark:hover:!text-error-dark"),control:({isFocused:e})=>a.cn("!w-full !border !rounded-md !shadow-sm !sm:text-sm !min-h-[38px] !bg-transparent",t?e?"border-primary !ring-1 !ring-primary":"!border-error dark:!border-error-dark":e?"border-primary !ring-1 !ring-primary":"!border-secondary dark:!border-secondary-dark"),option:({isFocused:e,isSelected:r})=>"!px-4 !py-2 !cursor-pointer "+(r?"!bg-primary !text-white":e?"!bg-primary/30 dark:!bg-primary-dark/30":"!bg-white dark:!bg-gray-700"),multiValue:()=>"!bg-primary-30 dark:!bg-primary-dark-30-50 !rounded-md !flex !items-center !mr-1",multiValueLabel:()=>"!text-primary-700 dark:!text-primary-dark-30-20 !text-sm !px-2 !py-0.5",multiValueRemove:()=>"!text-primary-700 !hover:bg-primary/30 !hover:text-primary-700 !rounded-r-md !px-1 !cursor-pointer",menu:()=>"!mt-1 dark:!text-white !border-secondary dark:!border-secondary-dark !bg-white dark:!bg-gray-700 !rounded-md !shadow-lg !z-10",input:()=>"!text-gray-900 dark:!text-white",placeholder:()=>"!text-gray-400",singleValue:()=>"!text-gray-900 dark:!text-white"}
|
|
104
104
|
return e.jsxs("div",{className:"w-full",children:[r&&e.jsx("label",{className:a.cn("block text-sm font-medium dark:text-white mb-1",o),children:r}),e.jsx(s,{classNames:{...i,...l},...d}),t&&e.jsx("p",{className:a.cn("mt-1 text-sm text-error",n),children:t})]})},exports.Skeleton=({width:a,height:t,rounded:s=!1,isLoading:o=!0,animode:n="flash",children:l})=>{if(!o)return e.jsx(e.Fragment,{children:l})
|
|
@@ -109,8 +109,8 @@ return{left:`calc(${100*r}% + ${r*-v+v/2}px)`,opacity:k?1:0,pointerEvents:"none"
|
|
|
109
109
|
const r=Number(d)-Number(n),t=Math.floor(r/Number(i)),s=Array.from({length:t+1},(r,s)=>{const o=s/t*100
|
|
110
110
|
return e.jsx("div",{className:a.cn("absolute top-1/2 -translate-y-1/2 w-[2px] h-2 rounded-full",y),style:{left:`${o}%`}},s)})
|
|
111
111
|
return e.jsx("div",{className:"absolute top-full mt-2 -left-0.5 -right-0.5 h-2 me-[11px] ms-[9px]",children:s})})()]}),g,e.jsx("div",{className:"w-32",children:e.jsx(C,{min:n,max:d,step:i,type:Number(c)<=0?"text":"number",value:Number(c)<=0?"":c,onChange:p})})]})]})},exports.Spinner=({color:r="primary",size:t="md",className:s,labelClassName:o,duration:n=1e3,thickness:l,label:d,labelPosition:i="right"})=>{const c=Q[r],m=J[t],u=ee[t],p=re[i],x=`${n}ms`,b=l?`${l}px`:void 0,g=e.jsx("span",{role:"status","aria-label":"string"==typeof d?d:"Loading",className:a.cn(m,c,"inline-block shrink-0 rounded-full animate-spin",s,"border-t-transparent dark:border-t-transparent"),style:{animationDuration:x,borderWidth:b}})
|
|
112
|
-
return d?e.jsxs("div",{className:a.cn("inline-flex items-center justify-center gap-2",p),children:[g,e.jsx("span",{className:a.cn(u,"text-gray-700 dark:text-gray-200 font-medium",o),children:d})]}):g},exports.Table=function({columns:r,data:t,striped:s=!1,stripeColor:o,hoverable:n=!0,headerClassName:l,dataColumnClassName:d,dataRowClassName:i,customEmptyData:c,tableClassName:m,captionClassName:u,containerClassName:p,size:x="md",caption:b,captionPosition:g="bottom",stickyHeader:h=!1,selectable:k=!1,onSelectionChange:f,selectedRows:y=[]}){const v=ae[x],
|
|
113
|
-
return e.jsxs("div",{className:a.cn("overflow-x-auto w-full",h&&"max-h-[400px] overflow-y-auto",p),children:[b&&"top"===g&&e.jsx("p",{className:a.cn("text-center text-sm font-medium mb-1 dark:text-white",u),children:b}),e.jsxs("table",{className:a.cn("relative min-w-full outline outline-gray-200 dark:outline-gray-600",v,m),children:[e.jsx("thead",{className:a.cn("dark:bg-gray-700 dark:text-white",l),children:e.jsxs("tr",{children:[k&&e.jsx("th",{className:a.cn("px-4 py-2 text-left text-sm border-b dark:border-b-secondary-700",v,h&&"sticky top-0 bg-secondary dark:bg-gray-700 z-10",l),children:e.jsx(w,{checked:
|
|
112
|
+
return d?e.jsxs("div",{className:a.cn("inline-flex items-center justify-center gap-2",p),children:[g,e.jsx("span",{className:a.cn(u,"text-gray-700 dark:text-gray-200 font-medium",o),children:d})]}):g},exports.Table=function({columns:r,data:t,striped:s=!1,stripeColor:o,hoverable:n=!0,headerClassName:l,dataColumnClassName:d,dataRowClassName:i,customEmptyData:c,tableClassName:m,captionClassName:u,containerClassName:p,size:x="md",caption:b,captionPosition:g="bottom",stickyHeader:h=!1,selectable:k=!1,onSelectionChange:f,selectedRows:y=[]}){const v=ae[x],j=t.length>0&&y.length===t.length,N=y.length>0&&y.length<t.length
|
|
113
|
+
return e.jsxs("div",{className:a.cn("overflow-x-auto w-full",h&&"max-h-[400px] overflow-y-auto",p),children:[b&&"top"===g&&e.jsx("p",{className:a.cn("text-center text-sm font-medium mb-1 dark:text-white",u),children:b}),e.jsxs("table",{className:a.cn("relative min-w-full outline outline-gray-200 dark:outline-gray-600",v,m),children:[e.jsx("thead",{className:a.cn("dark:bg-gray-700 dark:text-white",l),children:e.jsxs("tr",{children:[k&&e.jsx("th",{className:a.cn("px-4 py-2 text-left text-sm border-b dark:border-b-secondary-700",v,h&&"sticky top-0 bg-secondary dark:bg-gray-700 z-10",l),children:e.jsx(w,{checked:j,indeterminate:N,onChange:e=>{e.target.checked?f?.(t):f?.([])}})}),r.map((r,t)=>e.jsx("th",{className:a.cn("px-4 py-2 text-left text-sm border-b dark:border-b-secondary-700",v,h&&"sticky top-0 bg-secondary dark:bg-gray-700 z-10",l),children:r.header},t))]})}),e.jsx("tbody",{className:"dark:bg-gray-800 dark:text-white",children:t.length>0?t.map((t,l)=>e.jsxs("tr",{className:a.cn("transition-colors",s&&l%2!=0&&(o??"bg-gray-300 dark:bg-gray-700"),n&&"hover:bg-gray-200 dark:hover:bg-gray-200",i),children:[k&&e.jsx("td",{className:a.cn("px-4 py-2 border-b border-secondary-700 dark:border-secondary-dark-700",(s||o)&&"border-none",d,v),children:e.jsx(w,{checked:y.some(e=>e.id===t.id),onChange:()=>(e=>{const r=y.some(r=>r.id===e.id)
|
|
114
114
|
f?.(r?y.filter(r=>r.id!==e.id):[...y,e])})(t)})}),r.map((r,n)=>e.jsx("td",{className:a.cn("px-4 py-2 border-b border-secondary-700 dark:border-secondary-dark-700",(s||o)&&"border-none",d,v),children:r.render?r.render(t[r.accessor],t):String(t[r.accessor])},n))]},t.id??l)):e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(k?1:0),className:a.cn("px-4 py-6 text-center",v),children:c??"Tidak ada data."})})})]}),b&&"bottom"===g&&e.jsx("p",{className:a.cn("text-center text-sm font-medium mt-1 dark:text-white",u),children:b})]})},exports.Tabs=({tabs:t,fitted:s,variant:o="line",wrapperClassName:n,buttonClassName:l,activeClassName:d,inactiveClassName:i,activeTab:c,onTabChange:m})=>{const[u,p]=r.useState(0),x=void 0!==c&&void 0!==m,b=x?c:u,g=te[o],h=se[o],k=r.useRef([]),f=r.useRef(null)
|
|
115
115
|
return r.useEffect(()=>{!x&&b>=t.length&&p(Math.max(0,t.length-1))},[t,b,x]),r.useEffect(()=>{const e=k.current[b],r=f.current
|
|
116
116
|
if(e&&r){const a=e.offsetLeft,t=e.offsetWidth
|
package/dist/main.js
CHANGED
|
@@ -265,7 +265,7 @@ const AvatarGroup = ({
|
|
|
265
265
|
] })
|
|
266
266
|
] });
|
|
267
267
|
};
|
|
268
|
-
const
|
|
268
|
+
const BadgeColors = {
|
|
269
269
|
default: "bg-primary-30 text-primary-700 dark:bg-primary-dark-30",
|
|
270
270
|
secondary: "bg-secondary-30 text-black dark:bg-secondary-dark-30",
|
|
271
271
|
success: "bg-success-30 text-green-700 dark:bg-success-dark-30",
|
|
@@ -281,22 +281,21 @@ const BadgePositions = {
|
|
|
281
281
|
};
|
|
282
282
|
const Badge = ({
|
|
283
283
|
children,
|
|
284
|
-
|
|
285
|
-
position
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
icon
|
|
284
|
+
color = "default",
|
|
285
|
+
position,
|
|
286
|
+
icon,
|
|
287
|
+
...props
|
|
289
288
|
}) => {
|
|
290
|
-
const
|
|
291
|
-
const positionClass =
|
|
289
|
+
const colorClass = BadgeColors[color];
|
|
290
|
+
const positionClass = position ? BadgePositions[position] : "";
|
|
292
291
|
return /* @__PURE__ */ jsxs(
|
|
293
292
|
"span",
|
|
294
293
|
{
|
|
294
|
+
...props,
|
|
295
295
|
className: cn(
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
positionClass
|
|
299
|
-
className
|
|
296
|
+
"inline-flex items-center px-3 py-1 rounded-full text-sm font-semibold",
|
|
297
|
+
colorClass,
|
|
298
|
+
positionClass
|
|
300
299
|
),
|
|
301
300
|
children: [
|
|
302
301
|
icon && /* @__PURE__ */ jsx("span", { className: "mr-1", children: icon }),
|