alope-ui 1.2.44 → 1.2.46
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/Avatar/Avatar.d.ts +13 -20
- package/dist/components/Spinner/Spinner.d.ts +14 -16
- package/dist/main.cjs +69 -65
- package/dist/main.js +71 -63
- package/package.json +1 -1
|
@@ -1,38 +1,31 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
declare const AvatarSize: {
|
|
3
|
-
sm:
|
|
4
|
-
md:
|
|
5
|
-
lg:
|
|
6
|
-
};
|
|
7
|
-
declare const AvatarVariant: {
|
|
8
|
-
solid: string;
|
|
9
|
-
outline: string;
|
|
3
|
+
readonly sm: "w-8 h-8 text-xs";
|
|
4
|
+
readonly md: "w-12 h-12 text-sm";
|
|
5
|
+
readonly lg: "w-16 h-16 text-base";
|
|
10
6
|
};
|
|
11
7
|
declare const AvatarShape: {
|
|
12
|
-
sharp:
|
|
13
|
-
cornered:
|
|
14
|
-
rounded:
|
|
8
|
+
readonly sharp: "rounded-none";
|
|
9
|
+
readonly cornered: "rounded-md";
|
|
10
|
+
readonly rounded: "rounded-full";
|
|
15
11
|
};
|
|
16
12
|
declare const AvatarFallbackColor: {
|
|
17
|
-
primary:
|
|
18
|
-
error:
|
|
19
|
-
warning:
|
|
20
|
-
success:
|
|
21
|
-
info:
|
|
22
|
-
secondary:
|
|
13
|
+
readonly primary: "bg-primary dark:bg-primary-dark text-white";
|
|
14
|
+
readonly error: "bg-error dark:bg-error-dark text-white";
|
|
15
|
+
readonly warning: "bg-warning dark:bg-warning-dark text-white";
|
|
16
|
+
readonly success: "bg-success dark:bg-success-dark text-white";
|
|
17
|
+
readonly info: "bg-info dark:bg-info-dark text-white";
|
|
18
|
+
readonly secondary: "bg-secondary dark:bg-secondary-dark text-secondary-foreground dark:text-neutral-900";
|
|
23
19
|
};
|
|
24
20
|
export type AvatarProps = {
|
|
25
21
|
imageSrc?: string;
|
|
26
22
|
shape?: keyof typeof AvatarShape;
|
|
27
|
-
variant?: keyof typeof AvatarVariant;
|
|
28
23
|
size?: keyof typeof AvatarSize;
|
|
29
24
|
ring?: boolean;
|
|
30
|
-
ringClassName?: string;
|
|
31
25
|
fallbackName?: string;
|
|
32
26
|
fallbackColor?: keyof typeof AvatarFallbackColor;
|
|
33
27
|
alt?: string;
|
|
34
|
-
status?:
|
|
35
|
-
className?: string;
|
|
28
|
+
status?: "online" | "offline";
|
|
36
29
|
};
|
|
37
30
|
export declare const Avatar: React.FC<AvatarProps>;
|
|
38
31
|
export {};
|
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
declare const SpinnerSize: {
|
|
3
|
-
sm:
|
|
4
|
-
md:
|
|
5
|
-
lg:
|
|
3
|
+
readonly sm: "h-4 w-4 border-2";
|
|
4
|
+
readonly md: "h-6 w-6 border-3";
|
|
5
|
+
readonly lg: "h-8 w-8 border-4";
|
|
6
6
|
};
|
|
7
7
|
declare const SpinnerColor: {
|
|
8
|
-
primary:
|
|
9
|
-
error:
|
|
10
|
-
warning:
|
|
11
|
-
success:
|
|
12
|
-
info:
|
|
13
|
-
secondary:
|
|
8
|
+
readonly primary: "border-primary dark:border-primary-dark";
|
|
9
|
+
readonly error: "border-error dark:border-error-dark";
|
|
10
|
+
readonly warning: "border-warning dark:border-warning-dark";
|
|
11
|
+
readonly success: "border-success dark:border-success-dark";
|
|
12
|
+
readonly info: "border-info dark:border-info-dark";
|
|
13
|
+
readonly secondary: "border-secondary dark:border-secondary-dark";
|
|
14
14
|
};
|
|
15
15
|
declare const LabelPosition: {
|
|
16
|
-
right:
|
|
17
|
-
left:
|
|
18
|
-
bottom:
|
|
19
|
-
top:
|
|
16
|
+
readonly right: "flex-row";
|
|
17
|
+
readonly left: "flex-row-reverse";
|
|
18
|
+
readonly bottom: "flex-col";
|
|
19
|
+
readonly top: "flex-col-reverse";
|
|
20
20
|
};
|
|
21
21
|
export type SpinnerProps = {
|
|
22
22
|
size?: keyof typeof SpinnerSize;
|
|
23
23
|
color?: keyof typeof SpinnerColor;
|
|
24
|
-
className?: string;
|
|
25
|
-
labelClassName?: string;
|
|
26
24
|
duration?: number;
|
|
27
|
-
thickness?: number
|
|
25
|
+
thickness?: number;
|
|
28
26
|
label?: React.ReactNode;
|
|
29
27
|
labelPosition?: keyof typeof LabelPosition;
|
|
30
28
|
};
|
package/dist/main.cjs
CHANGED
|
@@ -1,68 +1,72 @@
|
|
|
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={
|
|
4
|
-
|
|
5
|
-
|
|
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={sharp:"rounded-none",cornered:"rounded-md",rounded:"rounded-full"},c={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-secondary-foreground dark:text-neutral-900"},m={primary:"ring-primary dark:ring-primary-dark",error:"ring-error dark:ring-error-dark",warning:"ring-warning dark:ring-warning-dark",success:"ring-success dark:ring-success-dark",info:"ring-info dark:ring-info-dark",secondary:"ring-secondary dark:ring-secondary-dark"},u={sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5"},x=({imageSrc:t,fallbackName:s,ring:o=!1,shape:n="rounded",fallbackColor:l="primary",size:x="md",alt:p="avatar",status:b})=>{const[g,h]=r.useState(!1)
|
|
4
|
+
r.useEffect(()=>{h(!1)},[t])
|
|
5
|
+
const k=d[x],f=i[n],y=c[l],w=o?a.cn("ring-2 ring-offset-2 ring-offset-white dark:ring-offset-neutral-900",m[l]):"",v=(e=>{if(!e?.trim())return"?"
|
|
6
|
+
const r=e.trim().split(/\s+/)
|
|
7
|
+
return 1===r.length?r[0].slice(0,2).toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()})(s),j=g||!t
|
|
8
|
+
return e.jsxs("div",{className:"relative inline-flex shrink-0",children:[j?e.jsx("div",{role:"img","aria-label":s||p,className:a.cn("flex items-center justify-center font-semibold select-none transition-colors",y,k,f,w),children:v}):e.jsx("img",{src:t,alt:p,onError:()=>h(!0),className:a.cn("object-cover",k,f,w)}),b&&e.jsx("span",{"aria-label":`Status: ${b}`,className:a.cn("absolute bottom-0 right-0 rounded-full border-2 border-white dark:border-neutral-900",u[x],"online"===b?"bg-success dark:bg-success-dark":"bg-secondary-700 dark:bg-secondary-dark-700")})]})},p={default:"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"},b={"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"},g=({label:r,icon:t,value:s,selectedValue:o,onChangeValue:n,labelClassName:l,className:d})=>{const i=s===o
|
|
9
|
+
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})]})},h={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"},k={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"},f={regular:"rounded-md",pill:"rounded-full"},y={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: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"}},w=(e,r)=>y[r][e]||"",v=r.forwardRef(({label:t,description:s,className:o="",indeterminate:n=!1,descriptionClassName:l,checkboxClassName:d,labelClassName:i,disabled:c,readOnly:m,children:u,checked:x,defaultChecked:p,onChange:b,...g},h)=>{const k=r.useRef(null)
|
|
6
10
|
r.useImperativeHandle(h,()=>k.current)
|
|
7
|
-
const[f,y]=r.useState(
|
|
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})]})]})}),
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
function
|
|
12
|
-
function
|
|
11
|
+
const[f,y]=r.useState(p??!1),w=void 0!==x,v=w?x:f
|
|
12
|
+
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})]})]})}),j={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"}},N={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"}},C={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"},z=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})]}))
|
|
13
|
+
z.displayName="TextInput"
|
|
14
|
+
const S={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:""}},L={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"},D={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"}},M={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"}}
|
|
15
|
+
function T(e){return"number"==typeof e?{base:e}:e}const $={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"}},E={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"}},R={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"}}
|
|
16
|
+
function F(e){return"number"==typeof e?{base:e}:e}const I=r.forwardRef(({children:r,className:t,cols:s,gap:o=4,...n},l)=>{const d=(i=F(s))?Object.entries(i).map(([e,r])=>E[e]?.[r]??""):[]
|
|
13
17
|
var i
|
|
14
|
-
const c=function(e){return e?Object.entries(e).map(([e,r])=>
|
|
15
|
-
return e.jsx("div",{ref:l,className:a.cn("grid-mason",d,c,t),...n,children:r})}),
|
|
16
|
-
r.useEffect(()=>{const e=setTimeout(()=>
|
|
18
|
+
const c=function(e){return e?Object.entries(e).map(([e,r])=>R[e]?.[r]??""):[]}(F(o))
|
|
19
|
+
return e.jsx("div",{ref:l,className:a.cn("grid-mason",d,c,t),...n,children:r})}),B={outline:"border border-current",solid:""},V={"top-left":"top-5 left-5","bottom-left":"bottom-5 left-5","top-right":"top-5 right-5","bottom-right":"bottom-5 right-5"},A={success:"bg-success-30 border-success-700 text-success-700",info:"bg-info-30 border-info-700 text-info-700",warning:"bg-warning-30 border-warning-700 text-warning-700",error:"bg-error-30 border-error-700 text-error-700"},O={"top-right":"translate-x-0","bottom-right":"translate-x-0","top-left":"-translate-x-0","bottom-left":"-translate-x-0"},P={"top-right":"translate-x-40","bottom-right":"translate-x-40","top-left":"-translate-x-40","bottom-left":"-translate-x-40"},W={"top-right":"translate-x-10","bottom-right":"translate-x-10","top-left":"-translate-x-10","bottom-left":"-translate-x-10"},H=({title:t,message:s,type:o,icon:n,position:l="bottom-right",variant:d="solid",withClose:i=!0,withLoading:c=!1,onClose:m})=>{const[u,x]=r.useState(!1),[p,b]=r.useState(!1),[g,h]=r.useState(!1),k=r.useRef(null)
|
|
20
|
+
r.useEffect(()=>{const e=setTimeout(()=>x(!0),50)
|
|
17
21
|
return k.current=setTimeout(()=>{f()},3500),()=>{clearTimeout(e),k.current&&clearTimeout(k.current)}},[])
|
|
18
22
|
const f=()=>{b(!0),setTimeout(()=>{m&&m()},500)}
|
|
19
|
-
return e.jsxs("div",{onMouseEnter:()=>{h(!0),k.current&&(clearTimeout(k.current),k.current=null)},onMouseLeave:()=>{h(!1),k.current=setTimeout(()=>{f()},3500)},className:a.cn("relative overflow-hidden flex max-w-sm items-start gap-3 p-4 mb-3 rounded-lg shadow-lg transition-all duration-500 transform",
|
|
23
|
+
return e.jsxs("div",{onMouseEnter:()=>{h(!0),k.current&&(clearTimeout(k.current),k.current=null)},onMouseLeave:()=>{h(!1),k.current=setTimeout(()=>{f()},3500)},className:a.cn("relative overflow-hidden flex max-w-sm items-start gap-3 p-4 mb-3 rounded-lg shadow-lg transition-all duration-500 transform",A[o],B[d],p?`opacity-0 ${P[l]}`:u?`opacity-100 ${O[l]}`:`opacity-0 ${W[l]}`),children:[n&&e.jsx("div",{className:"text-2xl mt-1",children:n}),e.jsxs("div",{className:"flex-1",children:[t&&e.jsx("p",{className:"font-semibold text-base mb-1",children:t}),e.jsx("p",{className:"text-sm leading-snug",children:s})]}),i&&e.jsx("button",{onClick:f,className:"ml-2 text-lg leading-none hover:text-red-500 focus:outline-none cursor-pointer","aria-label":"Close",children:"×"}),c&&e.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-1 bg-current/20",children:e.jsx("div",{style:{width:u&&!g?"0%":"100%",transition:g?"none":"width 3500ms linear"},className:"h-full bg-current"})})]})},Y=r.createContext(void 0),X={sm:"max-w-sm",md:"max-w-md",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-6xl"},q={default:"w-3/4 md:w-1/2",sm:"w-3/4 md:w-60",md:"w-3/4 md:w-80",lg:"w-3/4 md:w-[40rem]"},G={sm:"px-3 py-2 text-sm font-medium rounded-lg",md:"px-4 py-2 text-base font-medium rounded-lg",lg:"px-6 py-3 text-lg font-medium rounded-lg"},U={sm:{container:"text-sm",radio:"w-4 h-4",label:"pl-2"},md:{container:"text-base",radio:"w-5 h-5",label:"pl-2"},lg:{container:"text-lg",radio:"w-6 h-6",label:"pl-3"}},Z={solid:{label:"border-transparent bg-primary dark:bg-primary-dark text-white dark:hover:bg-primary-dark-700 hover:bg-primary-700",checked:"bg-primary-700 dark:bg-primary-dark-700",radio:"",checkedRadio:"border-white bg-primary dark:bg-primary"},subtle:{label:"border-none bg-secondary/30 dark:text-white hover:text-primary-700 hover:dark:text-primary-30 dark:text-white dark:bg-primary-dark/50 hover:bg-primary/30",checked:"bg-primary/30 text-primary-700 dark:bg-primary/30 dark:text-white hover:dark:text-white",radio:"dark:bg-primary",checkedRadio:"bg-primary dark:bg-primary-500 border-none"},outline:{label:"border-secondary-700 hover:bg-primary/30 hover:text-primary-700 hover:border-primary-700 dark:hover:bg-primary/20 bg-transparent 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",radio:" dark:border-secondary-dark hover:border-primary",checkedRadio:"bg-primary-700 dark:border-primary-700 dark:border-primary dark:bg-primary"}},K=({children:t,text:s,showArrow:o=!0,placement:n="top",offset:l=8,bgColor:d="bg-gray-800 dark:bg-gray-600",isOpen:i,onOpenChange:c,disabled:m=!1,animationDuration:u=300,delay:x=700})=>{const[p,b]=r.useState(!1),g=i??p,h={...(()=>{switch(n){case"top":default:return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:`${l}px`}
|
|
20
24
|
case"bottom":return{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:`${l}px`}
|
|
21
25
|
case"left":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:`${l}px`}
|
|
22
|
-
case"right":return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:`${l}px`}}})(),transitionDelay:g&&!i?`${
|
|
26
|
+
case"right":return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:`${l}px`}}})(),transitionDelay:g&&!i?`${x}ms`:"0ms",transitionDuration:`${u}ms`}
|
|
23
27
|
return m?e.jsx(e.Fragment,{children:t}):e.jsxs("div",{className:"relative inline-block group",onMouseEnter:()=>b(!0),onMouseLeave:()=>{void 0!==i&&c?.(!1),b(!1)},children:[t,e.jsxs("div",{className:a.cn(`absolute text-white text-[.70rem] font-medium tracking-tight rounded py-1 px-2 z-10 transition-all ${d}`,g?"opacity-100 visible":"opacity-0 invisible"),style:h,children:[s,o&&e.jsx("div",{className:`absolute w-2 h-2 ${d}`,style:(()=>{switch(n){case"top":default:return{bottom:"-4px",left:"50%",transform:"translateX(-50%) rotate(45deg)"}
|
|
24
28
|
case"bottom":return{top:"-4px",left:"50%",transform:"translateX(-50%) rotate(225deg)"}
|
|
25
29
|
case"left":return{right:"-4px",top:"50%",transform:"translateY(-50%) rotate(135deg)"}
|
|
26
|
-
case"right":return{left:"-4px",top:"50%",transform:"translateY(-50%) rotate(-45deg)"}}})()})]})]})},
|
|
30
|
+
case"right":return{left:"-4px",top:"50%",transform:"translateY(-50%) rotate(-45deg)"}}})()})]})]})},_={primary:"bg-primary-30 dark:bg-primary-dark-30 hover:[&::-webkit-slider-thumb]:transition-all hover:[&::-webkit-slider-thumb]:duration-300 [&::-webkit-slider-thumb]:outline-5 hover:[&::-webkit-slider-thumb]:outline-10 [&::-webkit-slider-thumb]:outline-primary-30 [&::-webkit-slider-thumb]:bg-primary dark:[&::-webkit-slider-thumb]:bg-primary-dark [&::-webkit-slider-thumb]:outline-primary-30 dark:[&::-webkit-slider-thumb]:outline-primary-dark-30",error:"bg-error-30 dark:bg-error-dark-30 [&::-webkit-slider-thumb]:outline-5 [&::-webkit-slider-thumb]:outline-error-30 [&::-webkit-slider-thumb]:bg-error dark:[&::-webkit-slider-thumb]:bg-error-dark dark:[&::-webkit-slider-thumb]:outline-5 dark:[&::-webkit-slider-thumb]:outline-error-dark-30",warning:"bg-warning-30 dark:bg-warning-dark-30 [&::-webkit-slider-thumb]:outline-5 [&::-webkit-slider-thumb]:outline-warning-30 [&::-webkit-slider-thumb]:bg-warning dark:[&::-webkit-slider-thumb]:bg-warning-dark dark:[&::-webkit-slider-thumb]:outline-5 dark:[&::-webkit-slider-thumb]:outline-warning-dark-30",success:"bg-success-30 dark:bg-success-dark-30 [&::-webkit-slider-thumb]:outline-5 [&::-webkit-slider-thumb]:outline-success-30 [&::-webkit-slider-thumb]:bg-success dark:[&::-webkit-slider-thumb]:bg-success-dark dark:[&::-webkit-slider-thumb]:outline-5 dark:[&::-webkit-slider-thumb]:outline-success-dark-30",info:"bg-info-30 dark:bg-info-dark-30 [&::-webkit-slider-thumb]:outline-5 [&::-webkit-slider-thumb]:outline-info-30 [&::-webkit-slider-thumb]:bg-info dark:[&::-webkit-slider-thumb]:bg-info-dark dark:[&::-webkit-slider-thumb]:outline-5 dark:[&::-webkit-slider-thumb]:outline-info-dark-30",secondary:"bg-secondary dark:bg-secondary-dark [&::-webkit-slider-thumb]:outline-5 [&::-webkit-slider-thumb]:outline-secondary [&::-webkit-slider-thumb]:bg-secondary-700 dark:[&::-webkit-slider-thumb]:bg-secondary-dark-700 dark:[&::-webkit-slider-thumb]:outline-5 dark:[&::-webkit-slider-thumb]:outline-secondary-dark"},J={sm:"h-1 [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3 [&::-moz-range-thumb]:w-3 [&::-moz-range-thumb]:h-3",md:"h-2 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:h-4",lg:"h-3 [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:h-5 [&::-moz-range-thumb]:w-5 [&::-moz-range-thumb]:h-5",xl:"h-4 [&::-webkit-slider-thumb]:w-6 [&::-webkit-slider-thumb]:h-6 [&::-moz-range-thumb]:w-6 [&::-moz-range-thumb]:h-6"},Q={sm:"h-4 w-4 border-2",md:"h-6 w-6 border-3",lg:"h-8 w-8 border-4"},ee={primary:"border-primary dark:border-primary-dark",error:"border-error dark:border-error-dark",warning:"border-warning dark:border-warning-dark",success:"border-success dark:border-success-dark",info:"border-info dark:border-info-dark",secondary:"border-secondary dark:border-secondary-dark"},re={sm:"text-xs",md:"text-sm",lg:"text-base"},ae={right:"flex-row",left:"flex-row-reverse",bottom:"flex-col",top:"flex-col-reverse"},te={sm:"text-sm py-[5px] px-2",md:"text-base py-2 px-4",lg:"text-lg py-3 px-6"},se={line:{wrapper:"border-b border-secondary dark:border-secondary-dark",button:"whitespace-nowrap py-4 px-1 font-medium text-sm",active:"border-primary text-primary dark:text-primary-30 transition-all duration-300 ease-in-out",inactive:"border-transparent text-gray-500 hover:text-secondary-700 dark:text-white dark:hover:text-secondary-dark-700"},solid:{wrapper:"rounded-md p-1",button:"whitespace-nowrap py-2 px-4 font-medium text-sm rounded-md",active:"bg-indigo-100 dark:bg-indigo-200 text-primary dark:text-primary-dark transition-all duration-300 ease-in-out",inactive:"text-gray-500 hover:text-secondary-700 dark:text-white dark:hover:text-secondary-dark-700"},subtle:{wrapper:"rounded-md bg-transparent p-1",button:"whitespace-nowrap py-2 px-4 font-medium text-sm",active:"text-white transition-all duration-300 ease-in-out z-10",inactive:"bg-transparent text-primary dark:text-primary-30 hover:text-primary-700"},inline:{wrapper:"border border-primary rounded-t-md border-b dark:border-primary-dark-30",button:"whitespace-nowrap py-2 px-4 font-medium text-sm z-10",active:"text-white transition-all duration-300 ease-in-out",inactive:"text-gray-500 hover:text-secondary-700 dark:text-white dark:hover:text-secondary-dark"},outline:{wrapper:"border border-primary dark:border-primary-dark-30 rounded-md p-1",button:"whitespace-nowrap py-2 px-4 font-medium text-sm rounded-md",active:"bg-indigo-100 dark:bg-indigo-200 text-primary dark:text-primary-dark transition-all duration-300 ease-in-out",inactive:"text-gray-500 hover:text-secondary-700 dark:text-white dark:hover:text-secondary-dark"},plain:{wrapper:"",button:"whitespace-nowrap py-2 px-4 font-medium text-sm",active:"text-primary dark:text-primary-30 transition-all duration-300 ease-in-out",inactive:"text-gray-500 hover:text-secondary-700 dark:text-white dark:hover:text-secondary"}},oe={line:"absolute bottom-0 h-1 bg-primary dark:bg-primary-30 transition-all duration-300 ease-in-out",solid:"absolute bottom-0 h-1 bg-primary transition-all duration-300 ease-in-out",subtle:"absolute bottom-0 h-full bg-primary rounded-md transition-all duration-300 ease-in-out",inline:"absolute bottom-0 h-full bg-primary border-t border-r border-l border-primary-700 rounded-tl-md rounded-tr-md transition-all duration-300 ease-in-out",outline:"absolute bottom-0 h-1 bg-primary transition-all duration-300 ease-in-out",plain:""},ne={success:"bg-success dark:bg-success-dark",info:"bg-info dark:bg-info-dark",error:"bg-error dark:bg-error-dark",warning:"bg-warning dark:bg-warning-dark",primary:"bg-primary dark:bg-primary-dark",default:"bg-secondary-700 dark:bg-secondary-dark"},le={success:"border-success dark:border-success-dark md:before:border-success md:before:dark:border-success-dark",info:"border-info dark:border-info-dark md:before:border-info md:before:dark:border-info-dark",error:"border-error dark:border-error-dark md:before:border-error md:before:dark:border-error-dark",warning:"border-warning dark:border-warning-dark md:before:border-warning md:before:dark:border-warning-dark",primary:"border-primary dark:border-primary-dark md:before:border-primary md:before:dark:border-primary-dark",default:"border-secondary-700 dark:border-secondary-dark md:before:border-secondary md:before:dark:border-secondary-dark"},de=({position:t="left",lineColor:s="default",children:o})=>{const n=r.Children.map(o,e=>r.isValidElement(e)?r.cloneElement(e,{position:t}):e),l=le[s]
|
|
27
31
|
return e.jsx("ol",{className:a.cn("relative",{"border-s-2":"left"===t,"border-e-2":"right"===t,"border-s-2 md:border-s-0 md:before:content-[''] md:before:absolute md:before:top-0 md:before:left-1/2 md:before:h-full md:before:border-s-2 md:before:border-secondary md:before:dark:border-secondary-dark":"split"===t},l),children:n})}
|
|
28
|
-
|
|
32
|
+
de.Item=({title:r,time:t,children:s,dotColor:o="default",icon:n,position:l})=>{const d=ne[o]
|
|
29
33
|
return e.jsxs("li",{className:a.cn("mb-5",{"ms-8":"left"===l,"me-8 text-end":"right"===l,"ms-4 md:w-1/2 ps-4 md:odd:pe-8 md:odd:ms-0 md:odd:text-end md:even:ps-8 md:even:ms-auto":"split"===l}),children:[n?e.jsx("div",{className:a.cn("flex items-center justify-center absolute w-10 h-10 rounded-full mt-1.5 outline outline-white dark:outline-secondary",d,{"-start-[20px]":"left"===l||"split"===l&&"md:hidden","-end-[21px]":"right"===l,"-start-[21px] md:start-1/2 md:-ms-[19px]":"split"===l}),children:n}):e.jsx("div",{className:a.cn("absolute w-3 h-3 rounded-full mt-1.5 outline outline-white dark:outline-secondary",d,{"-start-[7px]":"left"===l||"split"===l&&"md:hidden","-end-[7px]":"right"===l,"-start-[7.1px] md:start-1/2 md:-ms-[4.7px]":"split"===l})}),e.jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-400 dark:text-secondary-dark",children:t}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:r}),e.jsx("p",{className:"mb-4 text-base font-normal text-secondary-foreground dark:text-secondary-foreground-dark",children:s})]})}
|
|
30
|
-
const
|
|
34
|
+
const ie={primary:"peer-checked:bg-primary dark:peer-checked:bg-primary-dark",error:"peer-checked:bg-error dark:peer-checked:bg-error-dark",warning:"peer-checked:bg-warning dark:peer-checked:bg-warning-dark",success:"peer-checked:bg-success dark:peer-checked:bg-success-dark",info:"peer-checked:bg-info dark:peer-checked:bg-info-dark",secondary:"peer-checked:bg-secondary dark:peer-checked:bg-secondary-dark"},ce={stadium:"rounded-full after:rounded-full",rounded:"rounded-md after:rounded-sm"},me={sm:"w-9 h-5 after:h-4 after:w-4 after:start-[2px] after:top-[2px] peer-checked:after:translate-x-[16px]",md:"w-11 h-6 after:h-5 after:w-5 after:start-[2px] after:top-[2px] peer-checked:after:translate-x-[20px]",lg:"w-14 h-7 after:h-6 after:w-6 after:start-[2px] after:top-[2px] peer-checked:after:translate-x-[28px]"}
|
|
31
35
|
exports.Accordion=({data:t,openIndex:s,single:o=!0,onToggleItem:n,icon:l,...d})=>{const i=void 0!==s&&void 0!==n,[c,m]=r.useState([]),u=i?Array.isArray(s)?s:null!=s?[s]:[]:c
|
|
32
36
|
return e.jsx("div",{className:"space-y-2",...d,children:t.map((r,t)=>{const s=u.includes(t)
|
|
33
37
|
return e.jsxs("div",{className:"border border-gray-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg overflow-hidden transition-colors",children:[e.jsxs("button",{type:"button","aria-expanded":s,onClick:()=>(e=>{const r=u.includes(e),a=o?r?[]:[e]:r?u.filter(r=>r!==e):[...u,e]
|
|
34
|
-
i?n?.(o?a[0]??null:a):m(a)})(t),className:"w-full flex justify-between items-center p-4 text-left text-gray-900 dark:text-neutral-100 hover:bg-gray-50 dark:hover:bg-neutral-800/70 transition-colors cursor-pointer",children:[e.jsx("span",{className:"font-semibold",children:r.label}),"function"==typeof l?l(s):l??e.jsx("svg",{className:a.cn("w-5 h-5 shrink-0 text-gray-500 dark:text-neutral-400 transition-transform duration-200",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/80 dark:bg-neutral-800/50 px-4 text-sm text-gray-600 dark:text-neutral-300 transition-all duration-200",s?"max-h-96 py-4 border-t border-gray-200 dark:border-neutral-800":"max-h-0"),children:r.description})]},t)})})},exports.Alert=({title:t,description:s,icon:d,action:i,withClose:c=!1,type:m="default",variant:u="outline"})=>{const[p
|
|
35
|
-
if(!
|
|
38
|
+
i?n?.(o?a[0]??null:a):m(a)})(t),className:"w-full flex justify-between items-center p-4 text-left text-gray-900 dark:text-neutral-100 hover:bg-gray-50 dark:hover:bg-neutral-800/70 transition-colors cursor-pointer",children:[e.jsx("span",{className:"font-semibold",children:r.label}),"function"==typeof l?l(s):l??e.jsx("svg",{className:a.cn("w-5 h-5 shrink-0 text-gray-500 dark:text-neutral-400 transition-transform duration-200",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/80 dark:bg-neutral-800/50 px-4 text-sm text-gray-600 dark:text-neutral-300 transition-all duration-200",s?"max-h-96 py-4 border-t border-gray-200 dark:border-neutral-800":"max-h-0"),children:r.description})]},t)})})},exports.Alert=({title:t,description:s,icon:d,action:i,withClose:c=!1,type:m="default",variant:u="outline"})=>{const[x,p]=r.useState(!0)
|
|
39
|
+
if(!x)return null
|
|
36
40
|
const b=i?e.jsx("div",{className:"mt-2",children:"function"==typeof i?i():i}):null
|
|
37
|
-
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:()=>
|
|
38
|
-
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(
|
|
39
|
-
return e.jsxs("span",{...l,className:a.cn("inline-flex items-center gap-1 px-3 py-1 rounded-full text-sm font-semibold",d,i),children:[o&&e.jsx("span",{className:"inline-flex shrink-0",children:o}),r,n&&e.jsx("span",{className:"inline-flex shrink-0",children:n})]})},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===
|
|
40
|
-
return e.jsxs("li",{className:"flex items-center",children:[d?e.jsxs("span",{"aria-current":"page",className:a.cn("flex items-center font-medium",
|
|
41
|
-
return n?e.jsxs(t.Link,{to:n,className:j,children:[
|
|
42
|
-
c&&c(r),
|
|
43
|
-
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)=>{
|
|
44
|
-
return-1})();-1!==r&&r<e&&
|
|
45
|
-
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,
|
|
41
|
+
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:()=>p(!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=x,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
|
|
42
|
+
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(x,{...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,prefixIcon:o,suffixIcon:n,...l})=>{const d=p[t],i=s?b[s]:""
|
|
43
|
+
return e.jsxs("span",{...l,className:a.cn("inline-flex items-center gap-1 px-3 py-1 rounded-full text-sm font-semibold",d,i),children:[o&&e.jsx("span",{className:"inline-flex shrink-0",children:o}),r,n&&e.jsx("span",{className:"inline-flex shrink-0",children:n})]})},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===g?r.cloneElement(e,{selectedValue:s,onChangeValue:o}):(process.env.NODE_ENV,null))})}),exports.BottomNavbarAction=g,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
|
|
44
|
+
return e.jsxs("li",{className:"flex items-center",children:[d?e.jsxs("span",{"aria-current":"page",className:a.cn("flex items-center font-medium",h[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:x,suffixIcon:p})=>{const b=f[m],g=w(i,c),h=k[o]||"",y=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,h,y,v,b)
|
|
45
|
+
return n?e.jsxs(t.Link,{to:n,className:j,children:[x&&e.jsx("span",{className:"mr-2",children:x}),r,p&&e.jsx("span",{className:"ml-2",children:p})]}):e.jsxs("button",{disabled:d,type:l,onClick:s,className:j,children:[x&&e.jsx("span",{className:"mr-2",children:x}),r,p&&e.jsx("span",{className:"ml-2",children:p})]})},exports.ButtonVariantsMap=y,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:x,ribbon:p,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:[p&&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",x),children:p}),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=v,exports.CodeInput=({id:t,label:s,length:o,value:n,disabled:l,labelClassName:d,name:i,onCodeChange:c,inputSize:m="md",...u})=>{const x=r.useRef([]),p=C[m],b=e=>{const r=x.current.map(e=>e?.value||"").join("")
|
|
46
|
+
c&&c(r),x.current[e]?.value&&e<o-1&&x.current[e+1]?.focus()}
|
|
47
|
+
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)=>{x.current[r]&&(x.current[r].value=e,b(r))})},children:Array.from({length:o},(r,t)=>e.jsx("input",{ref:e=>{x.current[t]=e},type:"text",disabled:l,value:n?.[t],maxLength:1,onChange:()=>b(t),onKeyDown:e=>((e,r)=>{"Backspace"===e.key&&!x.current[r]?.value&&r>0&&x.current[r-1]?.focus()})(e,t),onFocus:()=>(e=>{const r=(()=>{for(let e=0;e<o;e++)if(!x.current[e]?.value)return e
|
|
48
|
+
return-1})();-1!==r&&r<e&&x.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",p,{"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
|
|
49
|
+
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,x]=r.useState(!1),[p,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=S[n].input,j=S[n].day,N=S[n].header,C=S[n].icon,L=S[n].outline
|
|
46
50
|
r.useLayoutEffect(()=>{if(u&&w.current){const e=w.current.getBoundingClientRect(),r=window.innerHeight-e.bottom
|
|
47
|
-
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)&&
|
|
48
|
-
const D=e=>{m(e),i&&i(e),
|
|
49
|
-
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(
|
|
51
|
+
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)&&x(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[y])
|
|
52
|
+
const D=e=>{m(e),i&&i(e),x(!1)}
|
|
53
|
+
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(z,{type:"text",readOnly:!0,ref:w,value:c?c.toLocaleDateString():"",onClick:()=>x(!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===p?(b(11),h(g-1)):b(p-1)},className:a.cn("px-2 py-1 rounded-md hover:bg-primary-700 dark:hover:bg-primary-dark-700 hover:cursor-pointer",C),children:"<"}),e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx("div",{className:"font-semibold",children:new Date(g,p).toLocaleString("default",{month:"long"})}),e.jsx("div",{className:"w-20",children:e.jsx(z,{type:"number",value:g,onChange:e=>h(Number(e.target.value))})})]}),e.jsx("button",{onClick:()=>{11===p?(b(0),h(g+1)):b(p+1)},className:a.cn("px-2 py-1 rounded-md hover:bg-primary-700 dark:hover:bg-primary-dark-700 hover:cursor-pointer",C),children:">"})]}),(()=>{const r=[],t=new Date(g,p+1,0).getDate(),s=new Date(g,p,1).getDay()
|
|
50
54
|
for(let a=0;a<s;a++)r.push(e.jsx("div",{className:"w-8 h-8"},`empty-${a}`))
|
|
51
|
-
for(let o=1;o<=t;o++){const t=new Date(g,
|
|
52
|
-
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
|
|
53
|
-
r.useEffect(()=>{if(d)u(!0),
|
|
54
|
-
else if(m){
|
|
55
|
-
const e=setTimeout(()=>{u(!1),
|
|
55
|
+
for(let o=1;o<=t;o++){const t=new Date(g,p,o),s=c&&t.getDate()===c.getDate()&&t.getMonth()===c.getMonth()&&t.getFullYear()===c.getFullYear()
|
|
56
|
+
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),[x,p]=r.useState(!1)
|
|
57
|
+
r.useEffect(()=>{if(d)u(!0),p(!1)
|
|
58
|
+
else if(m){p(!0)
|
|
59
|
+
const e=setTimeout(()=>{u(!1),p(!1)},300)
|
|
56
60
|
return()=>clearTimeout(e)}},[d,m])
|
|
57
|
-
const b=
|
|
61
|
+
const b=L[o],g=w(n,l),h=r.Children.toArray(t).map((t,s,o)=>{if(!r.isValidElement(t))return t
|
|
58
62
|
const n=o.length-1-s
|
|
59
|
-
return e.jsx("div",{style:{animationDelay:(
|
|
60
|
-
return e.jsx("div",{className:"fixed bottom-8 right-8 flex flex-col items-end z-50",children:e.jsxs("div",{className:"vertical"===s?"block":"flex",children:[e.jsx("div",{className:a.cn("flex items-center transition-all duration-300 ease-in-out",{vertical:"flex-col-reverse space-y-2 space-y-reverse mb-2",horizontal:"flex-row-reverse space-x-2 space-x-reverse mr-2"}[s]),children:m&&h}),e.jsx("button",{onClick:i,className:a.cn("shadow-lg flex w-full items-center justify-center hover:cursor-pointer",b,g),"aria-expanded":d,"aria-haspopup":"true",children:e.jsx("span",{className:"transform transition-transform duration-300 "+(d?"rotate-45":"rotate-0"),children:c})})]})})},exports.FileUpload=({acceptedFiles:t="image/*",maxFiles:s=1,inputLabel:o,maxKiloByte:n=2048,helperText:l,mediaCapture:d,mode:i="dropzone",clearable:c=!0,onFilesChange:m})=>{const[u,
|
|
63
|
+
return e.jsx("div",{style:{animationDelay:(x?100*n:100*s)+"ms"},className:a.cn(!x&&"opacity-0",x?"animate-pop-out":"animate-pop"),children:t},s)})
|
|
64
|
+
return e.jsx("div",{className:"fixed bottom-8 right-8 flex flex-col items-end z-50",children:e.jsxs("div",{className:"vertical"===s?"block":"flex",children:[e.jsx("div",{className:a.cn("flex items-center transition-all duration-300 ease-in-out",{vertical:"flex-col-reverse space-y-2 space-y-reverse mb-2",horizontal:"flex-row-reverse space-x-2 space-x-reverse mr-2"}[s]),children:m&&h}),e.jsx("button",{onClick:i,className:a.cn("shadow-lg flex w-full items-center justify-center hover:cursor-pointer",b,g),"aria-expanded":d,"aria-haspopup":"true",children:e.jsx("span",{className:"transform transition-transform duration-300 "+(d?"rotate-45":"rotate-0"),children:c})})]})})},exports.FileUpload=({acceptedFiles:t="image/*",maxFiles:s=1,inputLabel:o,maxKiloByte:n=2048,helperText:l,mediaCapture:d,mode:i="dropzone",clearable:c=!0,onFilesChange:m})=>{const[u,x]=r.useState([]),[p,b]=r.useState(""),[g,h]=r.useState(!1),k=r.useRef(null),f=e=>{const r=e.target.files?Array.from(e.target.files):[]
|
|
61
65
|
if(0===r.length)return
|
|
62
66
|
const a=v(r)
|
|
63
67
|
if(!a.length)return
|
|
64
68
|
const t=1===s?a.slice(0,1):[...u,...a].slice(0,s)
|
|
65
|
-
|
|
69
|
+
x(t),m(t),b(""),k.current.value=""},y=e=>{e.preventDefault(),h(!0)},w=()=>{k.current&&k.current.click()},v=e=>{const r=1024*n,a=e.find(e=>e.size>r)
|
|
66
70
|
if(a)return b(`File "${a.name}" exceeds size limit of ${(n/1024).toFixed(2)} MB.`),k.current.value="",[]
|
|
67
71
|
const o=e.find(e=>{return r=e,!t.split(",").map(e=>e.trim()).some(e=>{if(""===e)return!1
|
|
68
72
|
if(e===r.type)return!0
|
|
@@ -71,25 +75,25 @@ return r.type.startsWith(a+"/")}return!!e.startsWith(".")&&r.name.toLowerCase().
|
|
|
71
75
|
var r})
|
|
72
76
|
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()
|
|
73
77
|
const a=u.filter((e,a)=>a!==r)
|
|
74
|
-
|
|
78
|
+
x(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))
|
|
75
79
|
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)
|
|
76
80
|
const r=Array.from(e.dataTransfer.files),a=v(r)
|
|
77
81
|
if(!a.length)return
|
|
78
82
|
const t=1===s?a.slice(0,1):[...u,...a].slice(0,s)
|
|
79
|
-
|
|
83
|
+
x(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"})]}),p?e.jsx("p",{className:"text-error text-sm mt-2",children:p}):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()}),p?e.jsx("p",{className:"text-error text-sm mt-2",children:p}):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=T(t))?Object.entries(i).map(([e,r])=>D[e]?.[r]??""):[]
|
|
80
84
|
var i
|
|
81
|
-
const c=function(e){return e?Object.entries(e).map(([e,r])=>
|
|
82
|
-
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])
|
|
85
|
+
const c=function(e){return e?Object.entries(e).map(([e,r])=>M[e]?.[r]??""):[]}(T(s))
|
|
86
|
+
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])=>$[e]?.[r]??""):[]
|
|
83
87
|
var l,d
|
|
84
|
-
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,...
|
|
88
|
+
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,...x})=>{const p=j[m],b=N[c]
|
|
85
89
|
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
|
|
86
|
-
return e.jsxs("label",{className:a.cn("relative flex items-center rounded-md cursor-pointer transition-all duration-200 border px-3 py-2",
|
|
87
|
-
o(e)},disabled:u,className:a.cn("absolute opacity-0 w-full h-full cursor-pointer",{"cursor-not-allowed":u}),...
|
|
90
|
+
return e.jsxs("label",{className:a.cn("relative flex items-center rounded-md cursor-pointer transition-all duration-200 border px-3 py-2",p.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]
|
|
91
|
+
o(e)},disabled:u,className:a.cn("absolute opacity-0 w-full h-full cursor-pointer",{"cursor-not-allowed":u}),...x}),e.jsx("span",{className:a.cn("flex items-center justify-center rounded-md border transition-all duration-200",p.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",p.label,d?.(t,c)),children:t.label})]},n)})})},exports.Masonry=I,exports.Modal=({isOpen:t,overlayClose:s=!0,onClose:o,title:n,children:l,showCloseButton:d=!0,size:i="md"})=>{const[c,m]=r.useState(t),[u,x]=r.useState(!1),p=r.useId()
|
|
88
92
|
return r.useEffect(()=>{let e,r
|
|
89
|
-
return t?(m(!0),e=setTimeout(()=>
|
|
93
|
+
return t?(m(!0),e=setTimeout(()=>x(!0),15)):(x(!1),r=setTimeout(()=>m(!1),200)),()=>{clearTimeout(e),clearTimeout(r)}},[t]),r.useEffect(()=>{if(!t)return
|
|
90
94
|
const e=e=>{"Escape"===e.key&&o()},r=document.body.style.overflow
|
|
91
|
-
return document.body.style.overflow="hidden",document.addEventListener("keydown",e),()=>{document.body.style.overflow=r,document.removeEventListener("keydown",e)}},[t,o]),c?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6",role:"dialog","aria-modal":"true","aria-labelledby":n?
|
|
92
|
-
return e.jsxs(e.Fragment,{children:[r&&e.jsx("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:t}),e.jsxs("div",{className:
|
|
95
|
+
return document.body.style.overflow="hidden",document.addEventListener("keydown",e),()=>{document.body.style.overflow=r,document.removeEventListener("keydown",e)}},[t,o]),c?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6",role:"dialog","aria-modal":"true","aria-labelledby":n?p:void 0,children:[e.jsx("div",{className:a.cn("fixed inset-0 bg-black/50 backdrop-blur-xs transition-opacity duration-200",u?"opacity-100":"opacity-0"),onClick:s?o:void 0}),e.jsxs("div",{className:a.cn("relative z-10 flex flex-col w-full max-h-[90vh] rounded-xl border border-gray-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 shadow-2xl transition-all duration-200 ease-out",X[i],u?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 translate-y-2"),onClick:e=>e.stopPropagation(),children:[(n||d)&&e.jsxs("div",{className:"flex items-center justify-between gap-4 shrink-0 px-5 py-4 border-b border-gray-200 dark:border-neutral-800",children:[n&&e.jsx("h2",{id:p,className:"text-lg font-semibold text-gray-900 dark:text-neutral-100 leading-snug",children:n}),d&&e.jsx("button",{type:"button",onClick:o,className:"ml-auto -mr-1.5 p-1.5 rounded-lg text-gray-500 hover:text-gray-800 hover:bg-gray-100 dark:text-neutral-400 dark:hover:text-neutral-100 dark:hover:bg-neutral-800 transition-colors cursor-pointer","aria-label":"Close modal",children:e.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{d:"M6 18L18 6M6 6l12 12",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsx("div",{className:"p-5 overflow-y-auto text-gray-700 dark:text-neutral-300",children:l})]})]}):null},exports.Offcanvas=({isOpen:r,onClose:t,title:s,children:o,position:n="right",width:l="default",titleClassName:d,closeButtonClassName:i,className:c})=>{const m="right"===n?"right-0":"left-0",u=r?"translate-x-0":"right"===n?"translate-x-full":"-translate-x-full",x=a.cn("fixed top-0 h-full bg-white dark:bg-gray-700 z-50 shadow-xl transform transition-transform duration-300 ease-in-out",q[l],m,u,c)
|
|
96
|
+
return e.jsxs(e.Fragment,{children:[r&&e.jsx("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:t}),e.jsxs("div",{className:x,children:[e.jsxs("div",{className:"flex justify-between items-center p-4 border-b border-secondary dark:border-secondary-dark",children:[e.jsx("h5",{className:a.cn("text-lg font-semibold dark:text-white",d),children:s}),e.jsx("button",{type:"button",onClick:t,className:a.cn("text-secondary-700 hover:text-secondary dark:hover:text-secondary-dark text-2xl dark:text-white hover:cursor-pointer",i),"aria-label":"Close",children:"×"})]}),e.jsx("div",{className:"p-4 overflow-y-auto",children:o})]})]})},exports.Pagination=({currentPage:r,simplified:t=!1,format:s="none",count:o,pageSize:n,asLink:l=!1,getPageHref:d,totalPages:i,onPageChange:c,siblingCount:m=1,prevIcon:u,nextIcon:x,size:p="sm"})=>{"production"!==process.env.NODE_ENV&&o&&n&&i&&Math.ceil(o/n)
|
|
93
97
|
const b=o&&n&&1===m?Math.ceil(o/n):i??1
|
|
94
98
|
if(b<=1)return null
|
|
95
99
|
const g="...",h=e=>{const a=Math.max(1,Math.min(e,b))
|
|
@@ -98,33 +102,33 @@ const e=Math.max(r-m,1),a=Math.min(r+m,b),t=e>2,s=a<b-1,o=b
|
|
|
98
102
|
if(!t&&s){const e=3+2*m
|
|
99
103
|
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)
|
|
100
104
|
return[1,g,...r]}if(t&&s){const r=Array.from({length:a-e+1},(r,a)=>e+a)
|
|
101
|
-
return[1,g,...r,g,o]}return Array.from({length:b},(e,r)=>r+1)})(),f=
|
|
105
|
+
return[1,g,...r,g,o]}return Array.from({length:b},(e,r)=>r+1)})(),f=G[p]||"",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:x??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:x??e.jsx("span",{children:">"})})
|
|
102
106
|
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)
|
|
103
107
|
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)
|
|
104
108
|
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")
|
|
105
|
-
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,...
|
|
109
|
+
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,...x})=>{const p=U[m],b=Z[c]
|
|
106
110
|
return e.jsx("div",{className:a.cn("flex flex-wrap gap-3",n),children:t.map((t,n)=>{const c=s?.value===t.value
|
|
107
|
-
return e.jsxs("label",{className:a.cn("relative flex items-center rounded-md cursor-pointer transition-all duration-200 border px-3 py-2",
|
|
111
|
+
return e.jsxs("label",{className:a.cn("relative flex items-center rounded-md cursor-pointer transition-all duration-200 border px-3 py-2",p.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}),...x}),e.jsx("span",{className:a.cn("flex items-center justify-center rounded-full border transition-all duration-200",p.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",p.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"}
|
|
108
112
|
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
113
|
const d={width:a??"fit-content",height:t??(l?"auto":"1rem")}
|
|
110
|
-
return l?e.jsx(e.Fragment,{children:r.Children.map(l,(r,a)=>e.jsx("div",{className:`${n} ${s?"rounded-full":"rounded-sm"} mb-1`,style:d,children:e.jsx("span",{className:"invisible",children:r})},a))}):e.jsx("div",{className:`${n} ${s?"rounded-full":"rounded-sm"}`,style:d})},exports.Slider=({id:t,name:s,label:o,min:n=0,disabled:l,max:d=100,step:i=1,value:c,showTooltip:m=!0,showMarks:u=!0,onChange:
|
|
114
|
+
return l?e.jsx(e.Fragment,{children:r.Children.map(l,(r,a)=>e.jsx("div",{className:`${n} ${s?"rounded-full":"rounded-sm"} mb-1`,style:d,children:e.jsx("span",{className:"invisible",children:r})},a))}):e.jsx("div",{className:`${n} ${s?"rounded-full":"rounded-sm"}`,style:d})},exports.Slider=({id:t,name:s,label:o,min:n=0,disabled:l,max:d=100,step:i=1,value:c,showTooltip:m=!0,showMarks:u=!0,onChange:x,color:p="primary",prefixIcon:b,suffixIcon:g,sliderSize:h="md"})=>{const[k,f]=r.useState(!1),y=_[p],w=J[h],v={sm:12,md:16,lg:20,xl:24}[h]
|
|
111
115
|
return e.jsxs("div",{className:"w-full p-4 relative overflow-x-clip",children:[o&&e.jsx("label",{htmlFor:t||s,className:"block text-sm font-medium mb-1 dark:text-white",children:o}),e.jsxs("div",{className:"flex gap-3 items-center relative",children:[b,e.jsxs("div",{className:"relative w-full flex items-center",onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:[m&&e.jsx("div",{className:"absolute z-10 -top-7 transition-opacity duration-300",style:(()=>{const e=Number(d)-Number(n),r=0===e?0:(Number(c)-Number(n))/e
|
|
112
|
-
return{left:`calc(${100*r}% + ${r*-v+v/2}px)`,opacity:k?1:0,pointerEvents:"none"}})(),children:e.jsx(
|
|
116
|
+
return{left:`calc(${100*r}% + ${r*-v+v/2}px)`,opacity:k?1:0,pointerEvents:"none"}})(),children:e.jsx(K,{text:String(c),isOpen:k,placement:"top",children:e.jsx("div",{})})}),e.jsx("input",{disabled:l,type:"range",id:t||"slider-range",min:n,max:d,step:i,value:c,onChange:x,onMouseDown:()=>f(!0),className:a.cn("w-full rounded-full appearance-none cursor-pointer dark:bg-gray-700","transition-all duration-300 ease-in-out",w,"[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:appearance-none","[&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:appearance-none",y,{[_.secondary]:l,"bg-secondary opacity-50":l})}),(()=>{if(!u||Number(i)<=1)return null
|
|
113
117
|
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
|
|
114
118
|
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)})
|
|
115
|
-
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(
|
|
116
|
-
return
|
|
117
|
-
return e.jsxs("div",{className:a.cn("overflow-x-auto w-full",h&&"max-h-[400px] overflow-y-auto",
|
|
118
|
-
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,
|
|
119
|
-
return r.useEffect(()=>{!
|
|
119
|
+
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(z,{min:n,max:d,step:i,type:Number(c)<=0?"text":"number",value:Number(c)<=0?"":c,onChange:x})})]})]})},exports.Spinner=({color:r="primary",size:t="md",duration:s=1e3,thickness:o,label:n,labelPosition:l="right"})=>{const d=ee[r],i=Q[t],c=re[t],m=ae[l],u=`${s}ms`,x=o?`${o}px`:void 0,p=e.jsx("span",{"aria-hidden":Boolean(n),role:n?void 0:"status","aria-label":n?void 0:"Loading",className:a.cn(i,d,"inline-block shrink-0 rounded-full animate-spin border-t-transparent dark:border-t-transparent"),style:{animationDuration:u,borderWidth:x}})
|
|
120
|
+
return n?e.jsxs("div",{role:"status",className:a.cn("inline-flex items-center justify-center gap-2",m),children:[p,e.jsx("span",{className:a.cn(c,"text-gray-700 dark:text-neutral-200 font-medium select-none"),children:n})]}):p},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:x,size:p="md",caption:b,captionPosition:g="bottom",stickyHeader:h=!1,selectable:k=!1,onSelectionChange:f,selectedRows:y=[]}){const w=te[p],j=t.length>0&&y.length===t.length,N=y.length>0&&y.length<t.length
|
|
121
|
+
return e.jsxs("div",{className:a.cn("overflow-x-auto w-full",h&&"max-h-[400px] overflow-y-auto",x),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",w,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",w,h&&"sticky top-0 bg-secondary dark:bg-gray-700 z-10",l),children:e.jsx(v,{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",w,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,w),children:e.jsx(v,{checked:y.some(e=>e.id===t.id),onChange:()=>(e=>{const r=y.some(r=>r.id===e.id)
|
|
122
|
+
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,w),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",w),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,x]=r.useState(0),p=void 0!==c&&void 0!==m,b=p?c:u,g=se[o],h=oe[o],k=r.useRef([]),f=r.useRef(null)
|
|
123
|
+
return r.useEffect(()=>{!p&&b>=t.length&&x(Math.max(0,t.length-1))},[t,b,p]),r.useEffect(()=>{const e=k.current[b],r=f.current
|
|
120
124
|
if(e&&r){const a=e.offsetLeft,t=e.offsetWidth
|
|
121
125
|
r.style.transform=`translateX(${a}px)`,r.style.width=`${t}px`,e.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})}},[b,t]),e.jsxs("div",{children:[e.jsx("div",{className:a.cn("relative",g.wrapper,n),children:e.jsxs("nav",{className:"relative -mb-px flex space-x-2 overflow-x-auto scroll-smooth","aria-label":"Tabs",children:[t.map((r,t)=>{const o=a.cn("hover:cursor-pointer",s&&"flex-1",g.button,l,b===t?a.cn(g.active,d):a.cn(g.inactive,i),r.disabled&&"hover:cursor-not-allowed cursor-not-allowed opacity-50")
|
|
122
|
-
return r.link?e.jsx("a",{href:r.disabled?void 0:r.link,ref:e=>{k.current[t]=e},className:o,"aria-disabled":r.disabled,onClick:e=>r.disabled&&e.preventDefault(),children:r.label},r.label):e.jsx("button",{ref:e=>{k.current[t]=e},onClick:()=>(e=>{
|
|
126
|
+
return r.link?e.jsx("a",{href:r.disabled?void 0:r.link,ref:e=>{k.current[t]=e},className:o,"aria-disabled":r.disabled,onClick:e=>r.disabled&&e.preventDefault(),children:r.label},r.label):e.jsx("button",{ref:e=>{k.current[t]=e},onClick:()=>(e=>{p?m(e):x(e)})(t),disabled:r.disabled,className:o,children:r.label},r.label)}),e.jsx("div",{ref:f,className:a.cn(h),style:{width:0,transform:"translateX(0px)"}})]})}),e.jsx("div",{className:"mt-4",children:t[b]?.content})]})},exports.TextInput=z,exports.Textarea=({label:t,id:s,name:o,error:n,autoResize:l=!1,customClassName:d,...i})=>{const c=r.useRef(null),m=()=>{const e=c.current
|
|
123
127
|
e&&(e.style.height="auto",e.style.height=`${e.scrollHeight}px`)}
|
|
124
|
-
return r.useEffect(()=>{l&&m()},[]),e.jsxs("div",{children:[t&&e.jsx("label",{htmlFor:s||o,className:"inline-block text-sm font-medium mb-1 dark:text-white",children:t}),e.jsx("textarea",{id:s||o,name:o,rows:l?1:5,ref:c,onInput:m,className:a.cn("overflow-hidden bg-gray-50 w-full block px-3 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary sm:text-sm border-secondary min-h-[58px] max-h-[10rem]","dark:bg-gray-800 dark:border-secondary-dark dark:text-white dark:placeholder:text-gray-400",l?"resize-none":"resize",n&&"border-error dark:border-error-dark",i.disabled&&"bg-secondary/40 cursor-not-allowed",d),...i}),n&&e.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-500",children:n})]})},exports.Timeline=
|
|
125
|
-
return e.jsxs(
|
|
126
|
-
s(s=>[...s,{title:e,id:c,message:r,type:a,variant:t,icon:o,withClose:n,withLoading:l,onClose:d,position:i}])}},children:[a,o.map(r=>e.jsx("div",{className:`fixed z-50 ${V[r]}`,children:t.filter(e=>e.position===r).map(r=>e.jsx(
|
|
128
|
+
return r.useEffect(()=>{l&&m()},[]),e.jsxs("div",{children:[t&&e.jsx("label",{htmlFor:s||o,className:"inline-block text-sm font-medium mb-1 dark:text-white",children:t}),e.jsx("textarea",{id:s||o,name:o,rows:l?1:5,ref:c,onInput:m,className:a.cn("overflow-hidden bg-gray-50 w-full block px-3 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary sm:text-sm border-secondary min-h-[58px] max-h-[10rem]","dark:bg-gray-800 dark:border-secondary-dark dark:text-white dark:placeholder:text-gray-400",l?"resize-none":"resize",n&&"border-error dark:border-error-dark",i.disabled&&"bg-secondary/40 cursor-not-allowed",d),...i}),n&&e.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-500",children:n})]})},exports.Timeline=de,exports.ToastProvider=({children:a})=>{const[t,s]=r.useState([]),o=Object.keys(V)
|
|
129
|
+
return e.jsxs(Y.Provider,{value:{addToast:({title:e,message:r,type:a,variant:t,icon:o,withClose:n=!0,withLoading:l=!1,onClose:d,position:i="bottom-right"})=>{const c=Date.now()+Math.random()
|
|
130
|
+
s(s=>[...s,{title:e,id:c,message:r,type:a,variant:t,icon:o,withClose:n,withLoading:l,onClose:d,position:i}])}},children:[a,o.map(r=>e.jsx("div",{className:`fixed z-50 ${V[r]}`,children:t.filter(e=>e.position===r).map(r=>e.jsx(H,{title:r.title,message:r.message,type:r.type,variant:r.variant,icon:r.icon,withClose:r.withClose,withLoading:r.withLoading,position:r.position,onClose:()=>{var e
|
|
127
131
|
r.onClose?.(),e=r.id,s(r=>r.filter(r=>r.id!==e))}},r.id))},r))]})},exports.Toggle=({variant:r="primary",customSize:t="md",thumbShape:s="stadium",label:o,wrapperClassName:n,labelClassName:l,...d})=>{const i=["relative","bg-secondary-700 dark:bg-secondary-dark-700","peer-checked:after:translate-x-full","rtl:peer-checked:after:-translate-x-full","peer-checked:after:border-white","after:absolute","after:bg-white","after:transition-colors","after:transition-transform","duration-500"].filter(Boolean).join(" "),c=["inline-flex items-center cursor-pointer"].filter(Boolean).join(" ")
|
|
128
|
-
return e.jsxs("label",{className:a.cn(c,n,d.disabled&&"cursor-not-allowed"),children:[e.jsx("input",{type:"checkbox",value:"",className:"sr-only peer",...d}),e.jsx("div",{className:a.cn(i,
|
|
132
|
+
return e.jsxs("label",{className:a.cn(c,n,d.disabled&&"cursor-not-allowed"),children:[e.jsx("input",{type:"checkbox",value:"",className:"sr-only peer",...d}),e.jsx("div",{className:a.cn(i,me[t],ie[r],ce[s],d.disabled&&"opacity-50 cursor-not-allowed")}),o&&e.jsx("span",{className:a.cn("ms-3 text-sm font-medium dark:text-white",l),children:o})]})},exports.Tooltip=K,exports.getVariantClasses=w,exports.useToast=()=>{const e=r.useContext(Y)
|
|
129
133
|
if(!e)throw new Error("useToast must be used within a ToastProvider")
|
|
130
134
|
return e}
|
package/dist/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import React, { useState, isValidElement, cloneElement, useRef, useLayoutEffect,
|
|
2
|
+
import React, { useState, useEffect, isValidElement, cloneElement, useRef, useLayoutEffect, Children, createContext, useContext, useId } from "react";
|
|
3
3
|
import { cn } from "clsx-for-tailwind";
|
|
4
4
|
import { Link } from "react-router-dom";
|
|
5
5
|
import Select from "react-select";
|
|
@@ -161,10 +161,6 @@ const AvatarSize = {
|
|
|
161
161
|
md: "w-12 h-12 text-sm",
|
|
162
162
|
lg: "w-16 h-16 text-base"
|
|
163
163
|
};
|
|
164
|
-
const AvatarVariant = {
|
|
165
|
-
solid: "bg-opacity-100",
|
|
166
|
-
outline: "bg-transparent border-2"
|
|
167
|
-
};
|
|
168
164
|
const AvatarShape = {
|
|
169
165
|
sharp: "rounded-none",
|
|
170
166
|
cornered: "rounded-md",
|
|
@@ -176,67 +172,82 @@ const AvatarFallbackColor = {
|
|
|
176
172
|
warning: "bg-warning dark:bg-warning-dark text-white",
|
|
177
173
|
success: "bg-success dark:bg-success-dark text-white",
|
|
178
174
|
info: "bg-info dark:bg-info-dark text-white",
|
|
179
|
-
secondary: "bg-secondary dark:bg-secondary-dark text-
|
|
175
|
+
secondary: "bg-secondary dark:bg-secondary-dark text-secondary-foreground dark:text-neutral-900"
|
|
176
|
+
};
|
|
177
|
+
const AvatarRingColor = {
|
|
178
|
+
primary: "ring-primary dark:ring-primary-dark",
|
|
179
|
+
error: "ring-error dark:ring-error-dark",
|
|
180
|
+
warning: "ring-warning dark:ring-warning-dark",
|
|
181
|
+
success: "ring-success dark:ring-success-dark",
|
|
182
|
+
info: "ring-info dark:ring-info-dark",
|
|
183
|
+
secondary: "ring-secondary dark:ring-secondary-dark"
|
|
184
|
+
};
|
|
185
|
+
const StatusSize = {
|
|
186
|
+
sm: "w-2.5 h-2.5",
|
|
187
|
+
md: "w-3 h-3",
|
|
188
|
+
lg: "w-3.5 h-3.5"
|
|
180
189
|
};
|
|
181
190
|
const Avatar = ({
|
|
182
191
|
imageSrc,
|
|
183
192
|
fallbackName,
|
|
184
193
|
ring = false,
|
|
185
|
-
ringClassName,
|
|
186
194
|
shape = "rounded",
|
|
187
|
-
variant = "solid",
|
|
188
195
|
fallbackColor = "primary",
|
|
189
196
|
size = "md",
|
|
190
197
|
alt = "avatar",
|
|
191
|
-
status
|
|
192
|
-
className
|
|
198
|
+
status
|
|
193
199
|
}) => {
|
|
194
200
|
const [imageError, setImageError] = useState(false);
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
const
|
|
200
|
-
const
|
|
201
|
-
const
|
|
202
|
-
"
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
201
|
+
useEffect(() => {
|
|
202
|
+
setImageError(false);
|
|
203
|
+
}, [imageSrc]);
|
|
204
|
+
const sizeClass = AvatarSize[size];
|
|
205
|
+
const shapeClass = AvatarShape[shape];
|
|
206
|
+
const fallbackColorClass = AvatarFallbackColor[fallbackColor];
|
|
207
|
+
const ringClass = ring ? cn(
|
|
208
|
+
"ring-2 ring-offset-2 ring-offset-white dark:ring-offset-neutral-900",
|
|
209
|
+
AvatarRingColor[fallbackColor]
|
|
210
|
+
) : "";
|
|
211
|
+
const getInitials = (name) => {
|
|
212
|
+
if (!name?.trim()) return "?";
|
|
213
|
+
const parts = name.trim().split(/\s+/);
|
|
214
|
+
if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
|
|
215
|
+
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
216
|
+
};
|
|
217
|
+
const initials = getInitials(fallbackName);
|
|
218
|
+
const showFallback = imageError || !imageSrc;
|
|
219
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative inline-flex shrink-0", children: [
|
|
220
|
+
showFallback ? /* @__PURE__ */ jsx(
|
|
221
|
+
"div",
|
|
222
|
+
{
|
|
223
|
+
role: "img",
|
|
224
|
+
"aria-label": fallbackName || alt,
|
|
225
|
+
className: cn(
|
|
226
|
+
"flex items-center justify-center font-semibold select-none transition-colors",
|
|
227
|
+
fallbackColorClass,
|
|
228
|
+
sizeClass,
|
|
229
|
+
shapeClass,
|
|
230
|
+
ringClass
|
|
231
|
+
),
|
|
232
|
+
children: initials
|
|
233
|
+
}
|
|
234
|
+
) : /* @__PURE__ */ jsx(
|
|
235
|
+
"img",
|
|
236
|
+
{
|
|
237
|
+
src: imageSrc,
|
|
238
|
+
alt,
|
|
239
|
+
onError: () => setImageError(true),
|
|
240
|
+
className: cn("object-cover", sizeClass, shapeClass, ringClass)
|
|
241
|
+
}
|
|
242
|
+
),
|
|
233
243
|
status && /* @__PURE__ */ jsx(
|
|
234
244
|
"span",
|
|
235
245
|
{
|
|
246
|
+
"aria-label": `Status: ${status}`,
|
|
236
247
|
className: cn(
|
|
237
|
-
"absolute bottom-0 right-0
|
|
238
|
-
|
|
239
|
-
"
|
|
248
|
+
"absolute bottom-0 right-0 rounded-full border-2 border-white dark:border-neutral-900",
|
|
249
|
+
StatusSize[size],
|
|
250
|
+
status === "online" ? "bg-success dark:bg-success-dark" : "bg-secondary-700 dark:bg-secondary-dark-700"
|
|
240
251
|
)
|
|
241
252
|
}
|
|
242
253
|
)
|
|
@@ -2881,8 +2892,6 @@ const LabelPosition = {
|
|
|
2881
2892
|
const Spinner = ({
|
|
2882
2893
|
color = "primary",
|
|
2883
2894
|
size = "md",
|
|
2884
|
-
className: customClassName,
|
|
2885
|
-
labelClassName,
|
|
2886
2895
|
duration = 1e3,
|
|
2887
2896
|
thickness,
|
|
2888
2897
|
label,
|
|
@@ -2894,40 +2903,39 @@ const Spinner = ({
|
|
|
2894
2903
|
const positionClass = LabelPosition[labelPosition];
|
|
2895
2904
|
const animationDuration = `${duration}ms`;
|
|
2896
2905
|
const borderWidth = thickness ? `${thickness}px` : void 0;
|
|
2897
|
-
const
|
|
2906
|
+
const spinnerCircle = /* @__PURE__ */ jsx(
|
|
2898
2907
|
"span",
|
|
2899
2908
|
{
|
|
2900
|
-
|
|
2901
|
-
|
|
2909
|
+
"aria-hidden": Boolean(label),
|
|
2910
|
+
role: label ? void 0 : "status",
|
|
2911
|
+
"aria-label": label ? void 0 : "Loading",
|
|
2902
2912
|
className: cn(
|
|
2903
2913
|
spinnerSize,
|
|
2904
2914
|
spinnerColor,
|
|
2905
|
-
"inline-block shrink-0 rounded-full animate-spin"
|
|
2906
|
-
customClassName,
|
|
2907
|
-
"border-t-transparent dark:border-t-transparent"
|
|
2915
|
+
"inline-block shrink-0 rounded-full animate-spin border-t-transparent dark:border-t-transparent"
|
|
2908
2916
|
),
|
|
2909
2917
|
style: { animationDuration, borderWidth }
|
|
2910
2918
|
}
|
|
2911
2919
|
);
|
|
2912
2920
|
if (!label) {
|
|
2913
|
-
return
|
|
2921
|
+
return spinnerCircle;
|
|
2914
2922
|
}
|
|
2915
2923
|
return /* @__PURE__ */ jsxs(
|
|
2916
2924
|
"div",
|
|
2917
2925
|
{
|
|
2926
|
+
role: "status",
|
|
2918
2927
|
className: cn(
|
|
2919
2928
|
"inline-flex items-center justify-center gap-2",
|
|
2920
2929
|
positionClass
|
|
2921
2930
|
),
|
|
2922
2931
|
children: [
|
|
2923
|
-
|
|
2932
|
+
spinnerCircle,
|
|
2924
2933
|
/* @__PURE__ */ jsx(
|
|
2925
2934
|
"span",
|
|
2926
2935
|
{
|
|
2927
2936
|
className: cn(
|
|
2928
2937
|
spinnerTextSize,
|
|
2929
|
-
"text-gray-700 dark:text-
|
|
2930
|
-
labelClassName
|
|
2938
|
+
"text-gray-700 dark:text-neutral-200 font-medium select-none"
|
|
2931
2939
|
),
|
|
2932
2940
|
children: label
|
|
2933
2941
|
}
|