lawgic-dev-kit 0.22.12 → 0.22.13
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.
|
@@ -7,6 +7,7 @@ interface TooltipProps {
|
|
|
7
7
|
icon?: IconDefinition;
|
|
8
8
|
location?: TooltipLocation;
|
|
9
9
|
childClassName?: string;
|
|
10
|
+
forceShow?: boolean;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* Smart Tooltip Component
|
|
@@ -16,5 +17,5 @@ interface TooltipProps {
|
|
|
16
17
|
* By default, it truncates based on the parent's width. To truncate earlier,
|
|
17
18
|
* pass a specific width class to `childClassName` (e.g., `max-w-[200px]`).
|
|
18
19
|
*/
|
|
19
|
-
declare const Tooltip: ({ text, children, icon, location, childClassName }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare const Tooltip: ({ text, children, icon, location, childClassName, forceShow }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
export default Tooltip;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { j as r } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { FontAwesomeIcon as
|
|
4
|
-
const
|
|
5
|
-
const [
|
|
2
|
+
import { useState as m, useRef as u, useLayoutEffect as h } from "react";
|
|
3
|
+
import { FontAwesomeIcon as w } from "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
|
|
4
|
+
const j = ({ text: s, children: a, icon: e, location: l = "top", childClassName: d = "", forceShow: p }) => {
|
|
5
|
+
const [x, i] = m(!1), n = u(null), b = {
|
|
6
6
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2 flex-col",
|
|
7
7
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2 flex-col-reverse",
|
|
8
8
|
left: "right-full top-1/2 -translate-y-1/2 mr-2 flex-row",
|
|
9
9
|
right: "left-full top-1/2 -translate-y-1/2 ml-2 flex-row-reverse"
|
|
10
|
-
},
|
|
10
|
+
}, c = {
|
|
11
11
|
top: "border-l-[8px] border-l-transparent border-r-[8px] border-r-transparent border-t-[8px] border-t-gray-700",
|
|
12
12
|
bottom: "border-l-[8px] border-l-transparent border-r-[8px] border-r-transparent border-b-[8px] border-b-gray-700",
|
|
13
13
|
left: "border-t-[8px] border-t-transparent border-b-[8px] border-b-transparent border-l-[8px] border-l-gray-700",
|
|
@@ -15,16 +15,16 @@ const y = ({ text: s, children: a, icon: e, location: l = "top", childClassName:
|
|
|
15
15
|
}, t = () => {
|
|
16
16
|
const o = n.current;
|
|
17
17
|
if (o) {
|
|
18
|
-
const
|
|
19
|
-
|
|
18
|
+
const f = o.scrollWidth > o.offsetWidth;
|
|
19
|
+
i(f);
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
return
|
|
22
|
+
return h(() => (t(), window.addEventListener("resize", t), () => window.removeEventListener("resize", t)), [s, a]), /* @__PURE__ */ r.jsxs("div", { className: "group relative grid min-w-0 w-full", children: [
|
|
23
23
|
/* @__PURE__ */ r.jsx("div", { ref: n, className: `truncate ${d}`, children: a }),
|
|
24
|
-
p && /* @__PURE__ */ r.jsxs("div", { className: `pointer-events-none absolute flex items-center opacity-0 transition-opacity group-hover:opacity-100 z-50 ${
|
|
24
|
+
x || p && /* @__PURE__ */ r.jsxs("div", { className: `pointer-events-none absolute flex items-center opacity-0 transition-opacity group-hover:opacity-100 z-50 ${b[l]}`, children: [
|
|
25
25
|
/* @__PURE__ */ r.jsx("div", { className: "bg-gray-700 p-12 rounded-[8px] shadow-xl max-w-[320px] w-max border border-gray-700/50", children: /* @__PURE__ */ r.jsxs("div", { className: `flex items-start ${e ? "gap-8" : "justify-center"}`, children: [
|
|
26
26
|
e && /* @__PURE__ */ r.jsx("div", { className: "flex items-center h-[16px] flex-shrink-0", children: /* @__PURE__ */ r.jsx(
|
|
27
|
-
|
|
27
|
+
w,
|
|
28
28
|
{
|
|
29
29
|
icon: e,
|
|
30
30
|
className: "text-[16px] text-gray-100"
|
|
@@ -32,10 +32,10 @@ const y = ({ text: s, children: a, icon: e, location: l = "top", childClassName:
|
|
|
32
32
|
) }),
|
|
33
33
|
/* @__PURE__ */ r.jsx("p", { className: "text-[12px] text-blue-50 leading-[16px] font-normal text-left", children: s })
|
|
34
34
|
] }) }),
|
|
35
|
-
/* @__PURE__ */ r.jsx("div", { className: `w-0 h-0 ${
|
|
35
|
+
/* @__PURE__ */ r.jsx("div", { className: `w-0 h-0 ${c[l]}` })
|
|
36
36
|
] })
|
|
37
37
|
] });
|
|
38
38
|
};
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
j as default
|
|
41
41
|
};
|
|
@@ -721,7 +721,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
721
721
|
${v.container}
|
|
722
722
|
${c?"bg-gray-50 border-gray-200 cursor-not-allowed":"bg-blue-50 cursor-pointer"}
|
|
723
723
|
${!c&&(h?"border-blue-500":"border-blue-100 hover:border-blue-300")}
|
|
724
|
-
`,...ue,children:[ge?g.jsxs("div",{className:`flex items-center gap-[6px] overflow-hidden ${((Y=ge.colors)==null?void 0:Y.bgColor)||""} ${((z=ge.colors)==null?void 0:z.textColor)||""} ${ge.colors?"rounded-[8px] py-4 px-8":""}`,children:[((K=ge.colors)==null?void 0:K.dotColor)&&g.jsx("span",{className:"size-6 rounded-full flex-shrink-0",style:{background:ge.colors.dotColor}}),g.jsx("span",{className:`${v.text} font-semibold truncate`,children:ge.label})]}):g.jsx("span",{className:`flex-grow text-left truncate font-600 ${v.text} ${c?"text-gray-300":"text-gray-500"}`,children:s}),g.jsx("svg",{className:`${v.icon} transition-transform ${h?"rotate-180":""} ${c?"text-gray-300":"text-gray-500"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),ee&&!c&&g.jsxs("div",{ref:P.setFloating,style:{position:I,top:C??0,left:A??0,...ae,width:($=P.reference.current)==null?void 0:$.clientWidth,zIndex:50},className:"bg-white border border-blue-400 rounded-3xl shadow-lg overflow-hidden",...Q(),children:[o&&g.jsx("div",{className:"sticky top-0 bg-white p-8 border-b border-gray-100 z-20",children:g.jsxs("div",{className:"relative",children:[g.jsx("div",{className:"absolute inset-y-0 left-0 pl-12 flex items-center pointer-events-none",children:g.jsx("svg",{className:`${v.searchIcon} text-gray-400`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),g.jsx("input",{ref:S,type:"text",className:`w-full py-6 pl-36 pr-12 rounded-full focus:outline-none bg-gray-50 ${v.searchText}`,placeholder:"Buscar...",value:m,onChange:k=>x(k.target.value),onClick:k=>k.stopPropagation(),autoFocus:!0}),m&&g.jsx("button",{className:"absolute inset-y-0 right-0 pr-12 flex items-center",onClick:k=>{k.stopPropagation(),x("")},children:g.jsx("svg",{className:"h-16 w-16 text-gray-400 hover:text-gray-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]})}),g.jsx("div",{className:"max-h-[450px] overflow-y-auto",children:le.length>0?g.jsx("div",{className:"py-4",children:le.map(k=>{var U,re,B;const X=n===k.value;return g.jsxs(O.Fragment,{children:[k.dividerBefore&&g.jsx("div",{className:"px-16 py-8",children:g.jsx("hr",{className:"border-t border-gray-200"})}),g.jsxs("div",{className:"flex items-center px-16 py-10 transition-all duration-200 hover:bg-blue-50 cursor-pointer gap-12",onClick:()=>de(k.value),children:[d&&g.jsx(Kd,{active:X,size:v.checkboxSize,variant:"rounded",className:"flex-shrink-0"}),g.jsxs("div",{className:`flex items-center rounded-[8px] py-4 px-8 gap-[6px] overflow-hidden ${((U=k.colors)==null?void 0:U.bgColor)||""} ${((re=k.colors)==null?void 0:re.textColor)||""}`,children:[((B=k.colors)==null?void 0:B.dotColor)&&g.jsx("span",{className:"size-6 rounded-full flex-shrink-0",style:{background:k.colors.dotColor}}),g.jsx("span",{className:`${v.text} font-semibold truncate`,children:k.label})]})]})]},k.value)})}):g.jsxs("div",{className:"px-16 py-16 text-center text-gray-500",children:[g.jsx("svg",{className:"mx-auto h-24 w-24 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),g.jsxs("p",{className:"mt-8 text-body-s",children:["No se encontraron resultados para “",m,"”"]})]})})]})]})},DN=({image:e,title:t,subtitle:n,className:r=""})=>g.jsxs("div",{className:`flex flex-col items-center justify-center gap-24 p-8 text-center w-full h-full min-h-[300px] ${r}`,children:[e&&g.jsx("img",{src:e,alt:t,draggable:!1,className:"select-none"}),g.jsxs("div",{className:"space-y-16 max-w-[300px] select-none",children:[g.jsx("h3",{className:"text-[20px] font-bold text-blue-900 tracking-wide leading-[100%]",children:t}),g.jsx("p",{className:"text-base text-gray-500 max-w-sm leading-[150%]",children:n})]})]}),NN=({text:e,children:t,icon:n,location:r="top",childClassName:s=""})=>{const[o,a]=O.useState(!1),c=O.useRef(null),u={top:"bottom-full left-1/2 -translate-x-1/2 mb-2 flex-col",bottom:"top-full left-1/2 -translate-x-1/2 mt-2 flex-col-reverse",left:"right-full top-1/2 -translate-y-1/2 mr-2 flex-row",right:"left-full top-1/2 -translate-y-1/2 ml-2 flex-row-reverse"},d={top:"border-l-[8px] border-l-transparent border-r-[8px] border-r-transparent border-t-[8px] border-t-gray-700",bottom:"border-l-[8px] border-l-transparent border-r-[8px] border-r-transparent border-b-[8px] border-b-gray-700",left:"border-t-[8px] border-t-transparent border-b-[8px] border-b-transparent border-l-[8px] border-l-gray-700",right:"border-t-[8px] border-t-transparent border-b-[8px] border-b-transparent border-r-[8px] border-r-gray-700"},h=()=>{const p=c.current;if(p){const m=p.scrollWidth>p.offsetWidth;a(m)}};return O.useLayoutEffect(()=>(h(),window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)),[e,t]),g.jsxs("div",{className:"group relative grid min-w-0 w-full",children:[g.jsx("div",{ref:c,className:`truncate ${s}`,children:t}),o&&g.jsxs("div",{className:`pointer-events-none absolute flex items-center opacity-0 transition-opacity group-hover:opacity-100 z-50 ${u[r]}`,children:[g.jsx("div",{className:"bg-gray-700 p-12 rounded-[8px] shadow-xl max-w-[320px] w-max border border-gray-700/50",children:g.jsxs("div",{className:`flex items-start ${n?"gap-8":"justify-center"}`,children:[n&&g.jsx("div",{className:"flex items-center h-[16px] flex-shrink-0",children:g.jsx(Pe,{icon:n,className:"text-[16px] text-gray-100"})}),g.jsx("p",{className:"text-[12px] text-blue-50 leading-[16px] font-normal text-left",children:e})]})}),g.jsx("div",{className:`w-0 h-0 ${d[r]}`})]})]})},kN=()=>{const[e,t]=O.useState([]),n=O.useRef([]),r=O.useCallback(a=>{const c={...a,id:(a==null?void 0:a.id)||hf.uniqueId(),open:!0,type:(a==null?void 0:a.type)||"center",props:{...a.props,open:!0,onClose:()=>o(a.id||hf.uniqueId())}};n.current=[...n.current,c],t(n.current)},[]),s=O.useCallback(a=>{const c=hf.uniqueId(),u={id:c,open:!0,onClose:()=>{o(c)},type:"custom",component:a};n.current=[...n.current,u],t(n.current)},[]),o=O.useCallback(a=>{n.current=n.current.map(c=>c.id===a?{...c,open:!1}:c),t(n.current),setTimeout(()=>{n.current=n.current.filter(c=>c.id!==a),t(n.current)},150)},[]);return O.useEffect(()=>{window.openModal=r,window.closeModal=o,window.openCustomModal=s},[r,o,s]),g.jsx(g.Fragment,{children:e.map(a=>{if(a.type==="custom"&&(a!=null&&a.component)){const{open:u,onClose:d,component:h}=a;return h(u,d)}if(a.type==="dialog"){const{props:u}=a;return g.jsx(Qb,{...u,open:a.open,onClose:()=>o(a.id)},a.id)}if(a.type==="alert"){const{props:u}=a;return g.jsx(bb,{...u,open:a.open,onClose:()=>o(a.id)},a.id)}const{props:c}=a;return g.jsx(d2,{...c,open:a.open,onClose:()=>o(a.id),children:typeof c.children=="function"?c.children(()=>o(a.id)):c.children},a.id)})})};function jN(e){var t;(t=window==null?void 0:window.openModal)==null||t.call(window,e)}function LN(e){var t;(t=window==null?void 0:window.openCustomModal)==null||t.call(window,e)}function RN(e){var t;(t=window==null?void 0:window.closeModal)==null||t.call(window,e)}function FN(e,t,n){const r=t[e];if(O.isValidElement(r)&&typeof r.type!="string")return O.cloneElement(r,n);if(typeof r=="function"){const s=r;return g.jsx(s,{...n})}return r??g.jsx("div",{children:"no content"})}const Hd=[];function l2(e="bottom-center"){var t;if(!Hd.find(n=>n.id===e)){const n=document.createElement("div");switch(n.classList.add("fixed","z-[99999]","flex","flex-col","items-center","w-fit","min-w-[18rem]"),n.style.setProperty("z-index","99999"),e){case"top-left":n.classList.add("top-8","left-8");break;case"top-right":n.classList.add("top-8","right-8");break;case"bottom-left":n.classList.add("bottom-8","left-8");break;case"bottom-right":n.classList.add("bottom-8","right-8");break;case"top-center":n.classList.add("top-8","left-1/2","-translate-x-1/2");break;case"bottom-center":default:n.classList.add("bottom-8","left-1/2","-translate-x-1/2")}Hd.push({id:e,element:n}),document.body.appendChild(n)}return(t=Hd.find(n=>n.id===e))==null?void 0:t.element}function cl(e,t="success",{position:n="top-right",duration:r=3e3}={}){import("react-dom/client").then(({createRoot:s})=>{const o=l2(n);if(!o)return;const a=document.createElement("div"),c=s(a),u=()=>{c.unmount(),o.removeChild(a)};c.render(g.jsx(ff,{content:e,type:t,duration:r,onClose:u})),o.prepend(a),setTimeout(()=>{a.classList.add("mt-[0.5rem]")},10)})}const qd=(e,t,n={})=>{import("react-dom/client").then(({createRoot:r})=>{const s=l2(n.position);if(!s)return;const o=document.createElement("div"),a=r(o),c=()=>{a.unmount(),s.removeChild(o)};a.render(g.jsx(tx,{promise:e,messages:t,options:n,onClose:c})),s.prepend(o),setTimeout(()=>{o.classList.add("mt-[0.5rem]")},10)})},c2=(e,t={})=>{let n=()=>{},r=()=>{};const s=new Promise((o,a)=>{n=o,r=a});return qd(s,e,t),{resolve:o=>{typeof o=="string"&&(e.success={title:"Success",description:o}),n(o)},reject:o=>{typeof o=="string"&&(e.error={title:"Error",description:o}),r(o)}}},VN={success:(e,t={})=>cl(e,"success",t),error:(e,t={})=>cl(e,"error",t),warning:(e,t={})=>cl(e,"warning",t),notification:(e,t={})=>cl(e,"notification",t),async:(e,t,n={})=>qd(e,t,n),loading:(e,t={})=>c2(e,t)},u2=({containerProps:e={},imageProps:t={},src:n="",alt:r="",size:s=30,user:o=null})=>{const{className:a=" ",...c}=e,{className:u=" ",...d}=t,h=s+"px",p=s*.5+"px",m=s*.4+"px",[x,S]=O.useState(!1),b=()=>r?df(r):o?df(o!=null&&o.first_name||o!=null&&o.last_name?((o==null?void 0:o.first_name)||"")+" "+((o==null?void 0:o.last_name)||""):o==null?void 0:o.email):"#9CA1B6",T=P=>{try{return P?(new URL(P),!0):!1}catch(D){return console.log(D),!1}},v=()=>T(n)?n:o!=null&&o.image&&T(o.image)?o.image:o!=null&&o.image?Sx(o.image):"",A=()=>r?g.jsx("h4",{className:"text-white uppercase font-600 text-nowrap",style:{fontSize:m},children:r}):o?g.jsx("h4",{className:"text-white uppercase font-600 text-nowrap",style:{fontSize:m},children:o!=null&&o.first_name||o!=null&&o.last_name?((o==null?void 0:o.first_name)||" ")[0]+((o==null?void 0:o.last_name)||" ")[0]:((o==null?void 0:o.email)||" ")[0]}):g.jsx(Pe,{style:{maxWidth:p,maxHeight:p,minWidth:p,minHeight:p},icon:m4,className:"w-full text-white"}),C=()=>{S(!0)},I=v();return g.jsxs("div",{className:"flex items-center justify-center rounded-full overflow-hidden h-full relative "+a,style:{maxWidth:h,maxHeight:h,minWidth:h,minHeight:h,backgroundColor:b()},...c,children:[I&&!x&&g.jsx("img",{src:I,alt:r,className:`
|
|
724
|
+
`,...ue,children:[ge?g.jsxs("div",{className:`flex items-center gap-[6px] overflow-hidden ${((Y=ge.colors)==null?void 0:Y.bgColor)||""} ${((z=ge.colors)==null?void 0:z.textColor)||""} ${ge.colors?"rounded-[8px] py-4 px-8":""}`,children:[((K=ge.colors)==null?void 0:K.dotColor)&&g.jsx("span",{className:"size-6 rounded-full flex-shrink-0",style:{background:ge.colors.dotColor}}),g.jsx("span",{className:`${v.text} font-semibold truncate`,children:ge.label})]}):g.jsx("span",{className:`flex-grow text-left truncate font-600 ${v.text} ${c?"text-gray-300":"text-gray-500"}`,children:s}),g.jsx("svg",{className:`${v.icon} transition-transform ${h?"rotate-180":""} ${c?"text-gray-300":"text-gray-500"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),ee&&!c&&g.jsxs("div",{ref:P.setFloating,style:{position:I,top:C??0,left:A??0,...ae,width:($=P.reference.current)==null?void 0:$.clientWidth,zIndex:50},className:"bg-white border border-blue-400 rounded-3xl shadow-lg overflow-hidden",...Q(),children:[o&&g.jsx("div",{className:"sticky top-0 bg-white p-8 border-b border-gray-100 z-20",children:g.jsxs("div",{className:"relative",children:[g.jsx("div",{className:"absolute inset-y-0 left-0 pl-12 flex items-center pointer-events-none",children:g.jsx("svg",{className:`${v.searchIcon} text-gray-400`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),g.jsx("input",{ref:S,type:"text",className:`w-full py-6 pl-36 pr-12 rounded-full focus:outline-none bg-gray-50 ${v.searchText}`,placeholder:"Buscar...",value:m,onChange:k=>x(k.target.value),onClick:k=>k.stopPropagation(),autoFocus:!0}),m&&g.jsx("button",{className:"absolute inset-y-0 right-0 pr-12 flex items-center",onClick:k=>{k.stopPropagation(),x("")},children:g.jsx("svg",{className:"h-16 w-16 text-gray-400 hover:text-gray-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]})}),g.jsx("div",{className:"max-h-[450px] overflow-y-auto",children:le.length>0?g.jsx("div",{className:"py-4",children:le.map(k=>{var U,re,B;const X=n===k.value;return g.jsxs(O.Fragment,{children:[k.dividerBefore&&g.jsx("div",{className:"px-16 py-8",children:g.jsx("hr",{className:"border-t border-gray-200"})}),g.jsxs("div",{className:"flex items-center px-16 py-10 transition-all duration-200 hover:bg-blue-50 cursor-pointer gap-12",onClick:()=>de(k.value),children:[d&&g.jsx(Kd,{active:X,size:v.checkboxSize,variant:"rounded",className:"flex-shrink-0"}),g.jsxs("div",{className:`flex items-center rounded-[8px] py-4 px-8 gap-[6px] overflow-hidden ${((U=k.colors)==null?void 0:U.bgColor)||""} ${((re=k.colors)==null?void 0:re.textColor)||""}`,children:[((B=k.colors)==null?void 0:B.dotColor)&&g.jsx("span",{className:"size-6 rounded-full flex-shrink-0",style:{background:k.colors.dotColor}}),g.jsx("span",{className:`${v.text} font-semibold truncate`,children:k.label})]})]})]},k.value)})}):g.jsxs("div",{className:"px-16 py-16 text-center text-gray-500",children:[g.jsx("svg",{className:"mx-auto h-24 w-24 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),g.jsxs("p",{className:"mt-8 text-body-s",children:["No se encontraron resultados para “",m,"”"]})]})})]})]})},DN=({image:e,title:t,subtitle:n,className:r=""})=>g.jsxs("div",{className:`flex flex-col items-center justify-center gap-24 p-8 text-center w-full h-full min-h-[300px] ${r}`,children:[e&&g.jsx("img",{src:e,alt:t,draggable:!1,className:"select-none"}),g.jsxs("div",{className:"space-y-16 max-w-[300px] select-none",children:[g.jsx("h3",{className:"text-[20px] font-bold text-blue-900 tracking-wide leading-[100%]",children:t}),g.jsx("p",{className:"text-base text-gray-500 max-w-sm leading-[150%]",children:n})]})]}),NN=({text:e,children:t,icon:n,location:r="top",childClassName:s="",forceShow:o})=>{const[a,c]=O.useState(!1),u=O.useRef(null),d={top:"bottom-full left-1/2 -translate-x-1/2 mb-2 flex-col",bottom:"top-full left-1/2 -translate-x-1/2 mt-2 flex-col-reverse",left:"right-full top-1/2 -translate-y-1/2 mr-2 flex-row",right:"left-full top-1/2 -translate-y-1/2 ml-2 flex-row-reverse"},h={top:"border-l-[8px] border-l-transparent border-r-[8px] border-r-transparent border-t-[8px] border-t-gray-700",bottom:"border-l-[8px] border-l-transparent border-r-[8px] border-r-transparent border-b-[8px] border-b-gray-700",left:"border-t-[8px] border-t-transparent border-b-[8px] border-b-transparent border-l-[8px] border-l-gray-700",right:"border-t-[8px] border-t-transparent border-b-[8px] border-b-transparent border-r-[8px] border-r-gray-700"},p=()=>{const m=u.current;if(m){const x=m.scrollWidth>m.offsetWidth;c(x)}};return O.useLayoutEffect(()=>(p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)),[e,t]),g.jsxs("div",{className:"group relative grid min-w-0 w-full",children:[g.jsx("div",{ref:u,className:`truncate ${s}`,children:t}),a||o&&g.jsxs("div",{className:`pointer-events-none absolute flex items-center opacity-0 transition-opacity group-hover:opacity-100 z-50 ${d[r]}`,children:[g.jsx("div",{className:"bg-gray-700 p-12 rounded-[8px] shadow-xl max-w-[320px] w-max border border-gray-700/50",children:g.jsxs("div",{className:`flex items-start ${n?"gap-8":"justify-center"}`,children:[n&&g.jsx("div",{className:"flex items-center h-[16px] flex-shrink-0",children:g.jsx(Pe,{icon:n,className:"text-[16px] text-gray-100"})}),g.jsx("p",{className:"text-[12px] text-blue-50 leading-[16px] font-normal text-left",children:e})]})}),g.jsx("div",{className:`w-0 h-0 ${h[r]}`})]})]})},kN=()=>{const[e,t]=O.useState([]),n=O.useRef([]),r=O.useCallback(a=>{const c={...a,id:(a==null?void 0:a.id)||hf.uniqueId(),open:!0,type:(a==null?void 0:a.type)||"center",props:{...a.props,open:!0,onClose:()=>o(a.id||hf.uniqueId())}};n.current=[...n.current,c],t(n.current)},[]),s=O.useCallback(a=>{const c=hf.uniqueId(),u={id:c,open:!0,onClose:()=>{o(c)},type:"custom",component:a};n.current=[...n.current,u],t(n.current)},[]),o=O.useCallback(a=>{n.current=n.current.map(c=>c.id===a?{...c,open:!1}:c),t(n.current),setTimeout(()=>{n.current=n.current.filter(c=>c.id!==a),t(n.current)},150)},[]);return O.useEffect(()=>{window.openModal=r,window.closeModal=o,window.openCustomModal=s},[r,o,s]),g.jsx(g.Fragment,{children:e.map(a=>{if(a.type==="custom"&&(a!=null&&a.component)){const{open:u,onClose:d,component:h}=a;return h(u,d)}if(a.type==="dialog"){const{props:u}=a;return g.jsx(Qb,{...u,open:a.open,onClose:()=>o(a.id)},a.id)}if(a.type==="alert"){const{props:u}=a;return g.jsx(bb,{...u,open:a.open,onClose:()=>o(a.id)},a.id)}const{props:c}=a;return g.jsx(d2,{...c,open:a.open,onClose:()=>o(a.id),children:typeof c.children=="function"?c.children(()=>o(a.id)):c.children},a.id)})})};function jN(e){var t;(t=window==null?void 0:window.openModal)==null||t.call(window,e)}function LN(e){var t;(t=window==null?void 0:window.openCustomModal)==null||t.call(window,e)}function RN(e){var t;(t=window==null?void 0:window.closeModal)==null||t.call(window,e)}function FN(e,t,n){const r=t[e];if(O.isValidElement(r)&&typeof r.type!="string")return O.cloneElement(r,n);if(typeof r=="function"){const s=r;return g.jsx(s,{...n})}return r??g.jsx("div",{children:"no content"})}const Hd=[];function l2(e="bottom-center"){var t;if(!Hd.find(n=>n.id===e)){const n=document.createElement("div");switch(n.classList.add("fixed","z-[99999]","flex","flex-col","items-center","w-fit","min-w-[18rem]"),n.style.setProperty("z-index","99999"),e){case"top-left":n.classList.add("top-8","left-8");break;case"top-right":n.classList.add("top-8","right-8");break;case"bottom-left":n.classList.add("bottom-8","left-8");break;case"bottom-right":n.classList.add("bottom-8","right-8");break;case"top-center":n.classList.add("top-8","left-1/2","-translate-x-1/2");break;case"bottom-center":default:n.classList.add("bottom-8","left-1/2","-translate-x-1/2")}Hd.push({id:e,element:n}),document.body.appendChild(n)}return(t=Hd.find(n=>n.id===e))==null?void 0:t.element}function cl(e,t="success",{position:n="top-right",duration:r=3e3}={}){import("react-dom/client").then(({createRoot:s})=>{const o=l2(n);if(!o)return;const a=document.createElement("div"),c=s(a),u=()=>{c.unmount(),o.removeChild(a)};c.render(g.jsx(ff,{content:e,type:t,duration:r,onClose:u})),o.prepend(a),setTimeout(()=>{a.classList.add("mt-[0.5rem]")},10)})}const qd=(e,t,n={})=>{import("react-dom/client").then(({createRoot:r})=>{const s=l2(n.position);if(!s)return;const o=document.createElement("div"),a=r(o),c=()=>{a.unmount(),s.removeChild(o)};a.render(g.jsx(tx,{promise:e,messages:t,options:n,onClose:c})),s.prepend(o),setTimeout(()=>{o.classList.add("mt-[0.5rem]")},10)})},c2=(e,t={})=>{let n=()=>{},r=()=>{};const s=new Promise((o,a)=>{n=o,r=a});return qd(s,e,t),{resolve:o=>{typeof o=="string"&&(e.success={title:"Success",description:o}),n(o)},reject:o=>{typeof o=="string"&&(e.error={title:"Error",description:o}),r(o)}}},VN={success:(e,t={})=>cl(e,"success",t),error:(e,t={})=>cl(e,"error",t),warning:(e,t={})=>cl(e,"warning",t),notification:(e,t={})=>cl(e,"notification",t),async:(e,t,n={})=>qd(e,t,n),loading:(e,t={})=>c2(e,t)},u2=({containerProps:e={},imageProps:t={},src:n="",alt:r="",size:s=30,user:o=null})=>{const{className:a=" ",...c}=e,{className:u=" ",...d}=t,h=s+"px",p=s*.5+"px",m=s*.4+"px",[x,S]=O.useState(!1),b=()=>r?df(r):o?df(o!=null&&o.first_name||o!=null&&o.last_name?((o==null?void 0:o.first_name)||"")+" "+((o==null?void 0:o.last_name)||""):o==null?void 0:o.email):"#9CA1B6",T=P=>{try{return P?(new URL(P),!0):!1}catch(D){return console.log(D),!1}},v=()=>T(n)?n:o!=null&&o.image&&T(o.image)?o.image:o!=null&&o.image?Sx(o.image):"",A=()=>r?g.jsx("h4",{className:"text-white uppercase font-600 text-nowrap",style:{fontSize:m},children:r}):o?g.jsx("h4",{className:"text-white uppercase font-600 text-nowrap",style:{fontSize:m},children:o!=null&&o.first_name||o!=null&&o.last_name?((o==null?void 0:o.first_name)||" ")[0]+((o==null?void 0:o.last_name)||" ")[0]:((o==null?void 0:o.email)||" ")[0]}):g.jsx(Pe,{style:{maxWidth:p,maxHeight:p,minWidth:p,minHeight:p},icon:m4,className:"w-full text-white"}),C=()=>{S(!0)},I=v();return g.jsxs("div",{className:"flex items-center justify-center rounded-full overflow-hidden h-full relative "+a,style:{maxWidth:h,maxHeight:h,minWidth:h,minHeight:h,backgroundColor:b()},...c,children:[I&&!x&&g.jsx("img",{src:I,alt:r,className:`
|
|
725
725
|
object-cover w-full h-full text-center indent-[10000px] absolute
|
|
726
726
|
z-10
|
|
727
727
|
${u}
|
|
@@ -7,6 +7,7 @@ interface TooltipProps {
|
|
|
7
7
|
icon?: IconDefinition;
|
|
8
8
|
location?: TooltipLocation;
|
|
9
9
|
childClassName?: string;
|
|
10
|
+
forceShow?: boolean;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* Smart Tooltip Component
|
|
@@ -16,5 +17,5 @@ interface TooltipProps {
|
|
|
16
17
|
* By default, it truncates based on the parent's width. To truncate earlier,
|
|
17
18
|
* pass a specific width class to `childClassName` (e.g., `max-w-[200px]`).
|
|
18
19
|
*/
|
|
19
|
-
declare const Tooltip: ({ text, children, icon, location, childClassName }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare const Tooltip: ({ text, children, icon, location, childClassName, forceShow }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
export default Tooltip;
|