@lax-wp/design-system 0.6.2 → 0.6.3

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/index.umd.js CHANGED
@@ -178,7 +178,7 @@
178
178
  `),eA=eA.split(`
179
179
  `).map(hA=>hA.trimEnd()).join(`
180
180
  `),eA=eA.replace(/\n+$/,"")+`
181
- `),navigator?.clipboard?.writeText(eA).then(()=>{}).catch(hA=>{const dA=hA;UA.toast.error(dA?.message||BA.copyFailure("Python Code"),{toastId:BA.copyFailure("Python Code")})})}catch(eA){const hA=eA;UA.toast.error(hA?.message||BA.copyFailure("Python Code"),{toastId:BA.copyFailure("Python Code")})}else if(l==="json")try{const eA=JSON.parse(A),hA=JSON.stringify(eA,null,4);navigator?.clipboard?.writeText(hA)}catch(eA){const hA=eA;UA.toast.error(hA?.message||BA.copyFailure("JSON Code"),{toastId:BA.copyFailure("JSON Code")})}else navigator?.clipboard?.writeText(A)},iA=eA=>eA==="python"?{type:"text/x-python",extension:"py"}:eA==="json"?{type:"application/json",extension:"json"}:{type:"text/plain",extension:"txt"},lA=(eA,hA)=>eA.replace(/[<>:"/\\|?*\x00-\x1f]/g,"_").replace(/\.{2,}/g,".").replace(/^\.+|\.+$/g,"").trim()||hA,wA=()=>{try{const eA=new Blob([A],{type:iA(l)?.type}),hA=URL.createObjectURL(eA),dA=document.createElement("a");dA.href=hA;const HA=iA(l)?.extension||"txt",KA=lA(HA,"txt");dA.download=lA(`code_${Date.now()}.${KA}`,`code_${Date.now()}.${KA}`),document.body.appendChild(dA),dA.click(),document.body.removeChild(dA),URL.revokeObjectURL(hA)}catch(eA){const hA=eA;UA.toast.error(hA?.message||BA.copyFailure("Code download"),{toastId:BA.copyFailure("Code download")})}};return r.jsx(An.FullScreen,{handle:j,className:"h-full",children:r.jsxs("div",{className:Br("relative border border-neutral-200 dark:border-neutral-700 rounded-lg h-full",y),id:"code-editor-container-with-json-grid",children:[r.jsxs("div",{className:E(`px-3 py-2 flex items-center bg-white rounded-t-lg dark:bg-neutral-800 ${f?"border-none":"border-b border-neutral-200 dark:border-neutral-700"} `,I?"justify-between":"justify-end"),children:[I&&f&&r.jsx(to,{variant:"switch",tabs:yo,activeTab:Q,size:"sm",onTabClick:eA=>Y(eA),tabIcons:V0,height:"h-[20px]"}),r.jsxs("div",{className:"flex items-center gap-0.5",children:[v?.({editor:m.current,value:A,onChange:e,language:l,isEditMode:n,activeTab:Q}),Q==="Grid"&&n&&f&&r.jsx("span",{className:"flex items-center justify-center border-r border-neutral-200 dark:border-neutral-700 mr-1.5 pr-1.5",children:r.jsx(bA,{title:"Add key",children:r.jsx("button",{id:"btn-code-editor-json-grid-up",onClick:()=>_(!0),className:E("p-0.5 rounded-md flex items-center justify-center","hover:bg-blue-100 hover:dark:bg-neutral-800 text-blue-600 dark:text-neutral-100"),children:r.jsx(S0,{fontSize:16})})})}),Q==="Grid"?r.jsxs(r.Fragment,{children:[r.jsx(bA,{title:"Collapse all",children:r.jsx("button",{id:"btn-code-editor-json-grid-up",onClick:()=>P(!1),className:sA,children:r.jsx(O0,{fontSize:16})})}),r.jsx(bA,{title:"Expand all",children:r.jsx("button",{id:"btn-code-editor-json-grid-down",onClick:()=>P(!0),className:sA,children:r.jsx(M0,{fontSize:16})})})]}):null,Q==="JSON"&&f?r.jsx(bA,{title:"Format",children:r.jsx("button",{id:"btn-code-editor-format-code",onClick:AA,className:sA,children:r.jsx(U0,{fontSize:14})})}):null,a&&Q==="JSON"&&f?r.jsx(bA,{title:M==="vs"?"Dark mode":"Light mode",children:r.jsx("button",{id:"btn-code-editor-with-theme",onClick:()=>k(M==="vs"?"vs-dark":"vs"),className:sA,children:M==="vs"?r.jsx(L0,{fontSize:14}):r.jsx(X0,{fontSize:14})})}):null,(l==="python"||l==="json")&&i?r.jsx(bA,{title:"Copy",children:r.jsx("button",{id:"btn-code-editor-copy-code",onClick:DA,className:sA,children:r.jsx(N0,{fontSize:14})})}):null,(l==="python"||l==="json")&&c?r.jsx(bA,{title:"Download",children:r.jsx("button",{id:"btn-code-editor-download-code",onClick:wA,className:sA,children:r.jsx(z0,{fontSize:14})})}):null,t?r.jsx(bA,{title:"Fullscreen",children:r.jsx("button",{onClick:$,id:"btn-code-editor-fullscreen",className:sA,children:r.jsx(T0,{fontSize:14})})}):null]})]}),Q==="Grid"&&l==="json"?r.jsx("div",{children:r.jsx(Zt,{isFullScreen:j?.active,allExpanded:D,toggleAll:()=>P(eA=>!eA),isEditMode:!!n,isDarkMode:C==="dark",style:{height:j?.active?"100vh":o},value:A,onChange:e,setIsAddKeyModalOpen:_,isAddKeyModalOpen:K})}):r.jsx(yi.CodeiumEditor,{height:j?.active?"100vh":o,containerStyle:{height:o},language:l,value:A,onChange:pA,theme:M,onMount:B,options:{fontSize:16,folding:!0,fontFamily:"Menlo, Monaco, 'Courier New', monospace",fontLigatures:!0,readOnly:!n}})]})})},wo=({isVisible:A,onClose:e,onChange:t,defaultValue:a,title:n="Dynamic Data",saveText:o="Save",width:l=1040})=>{const[s,i]=h.useState(a);h.useEffect(()=>{i(a)},[A,a]);const c=()=>{e()},d=()=>{try{const p=JSON.parse(s);t(JSON.stringify(p)),e()}catch(p){const g=p instanceof Error?p.message:"Invalid JSON";UA.toast.error(g,{toastId:"Invalid JSON"})}},f=p=>{i(p)},u=r.jsx("div",{className:"flex justify-end mt-4",children:r.jsx(OA,{id:"btn-dynamic-data-modal-save",status:"primary",onClick:d,type:"submit",children:o})},"submit");return r.jsx(te,{asForm:!0,title:n,open:A,onCancel:c,width:l,className:"no-body-padding-modal",footer:u,children:r.jsx("div",{className:"h-[calc(100vh-400px)] overflow-y-auto bg-neutral-50 dark:bg-black-800 px-6",children:r.jsx("div",{className:"py-5 w-full overflow-x-auto",children:r.jsx("div",{className:"border rounded-lg",children:r.jsx(xo,{height:"420px",value:s,onChange:p=>f(p),isEditMode:!0})})})})})},Rt=({fill:A="currentColor",size:e=20,className:t="",...a})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:A,className:t,...a,children:r.jsx("g",{children:r.jsx("path",{d:"M16.0833 7.43749L12.5417 3.93749L13.7083 2.77082C14.0278 2.45138 14.4201 2.29166 14.8854 2.29166C15.3507 2.29166 15.7431 2.45138 16.0625 2.77082L17.2292 3.93749C17.5486 4.25693 17.7153 4.64235 17.7292 5.09374C17.7431 5.54513 17.5903 5.93055 17.2708 6.24999L16.0833 7.43749ZM3.33333 17.5C3.09722 17.5 2.89931 17.4201 2.73958 17.2604C2.57986 17.1007 2.5 16.9028 2.5 16.6667V14.3125C2.5 14.2014 2.52083 14.0937 2.5625 13.9896C2.60417 13.8854 2.66667 13.7917 2.75 13.7083L11.3333 5.12499L14.875 8.66666L6.29167 17.25C6.20833 17.3333 6.11458 17.3958 6.01042 17.4375C5.90625 17.4792 5.79861 17.5 5.6875 17.5H3.33333Z"})})}),Po=A=>{const{id:e,label:t="",type:a="text",placeholder:n="",value:o,onChange:l,originalCase:s=!1,errorMessage:i="",required:c,bg:d,tags:f,index:u,className:p,tooltip:g="",simpleMode:y,inputFieldClassName:x,isAiExtracted:v=!1,disabled:m=!1,...b}=A,[w,H]=h.useState(null),[N,M]=h.useState(!1),C=h.useRef(null);h.useEffect(()=>{H(null)},[u]),h.useEffect(()=>{w!==null&&l(w)},[w,l]);const k=()=>{M(!N)},D=P=>{H(P),k()};return r.jsxs(r.Fragment,{children:[y?r.jsxs("div",{className:"relative w-full h-full",children:[r.jsx("input",{type:a,placeholder:n,className:x,onChange:P=>{l(P.target.value)},ref:C,value:o?"{DYNAMIC}":"",disabled:!0,...b}),r.jsx("button",{id:"btn-dynamic-data-input-edit",onClick:k,className:E("absolute inset-y-0 right-0 flex items-center px-4 focus:border-transparent border-l",m?"cursor-not-allowed":""),disabled:m,type:"button",children:r.jsx(Rt,{})})]}):r.jsxs("div",{className:E("flex flex-col w-full",p),children:[r.jsxs("label",{htmlFor:"text",className:`mb-1 text-black-300 dark:text-black-300 inline-flex items-center gap-1 flex-wrap ${s?"":"capitalize"}`,children:[r.jsx(LA,{label:t||"",required:c||!1}),v&&r.jsx(ie,{}),r.jsx(ZA,{labels:f}),g&&r.jsx(bA,{placement:"top",title:g,children:r.jsx("div",{className:"cursor-pointer",children:r.jsx(YA,{})})})]}),r.jsxs("label",{className:"relative block",children:[r.jsx("input",{type:a,id:e,required:c,placeholder:n,className:E("border",i?"border-red-300 focus:border-red-300":"border-gray-300 dark:border-black-600 focus:border-blue-500 dark:focus:border-primary-400",d,"text-sm rounded-lg block w-full p-2.5 font-inter font-medium",a==="currency"?"pl-8":"","bg-white dark:bg-black-600 text-gray-900 dark:text-black-200"),onChange:P=>{l(P.target.value)},ref:C,value:o?"{DYNAMIC}":"",disabled:!0,autoComplete:"off",...b}),r.jsx("button",{onClick:k,className:"absolute inset-y-0 right-0 flex items-center px-4 focus:border-transparent border-l",type:"button",children:r.jsx(Rt,{})})]}),i&&r.jsx(G,{className:"text-error-500 mt-1 ",appearance:"custom",size:"extra-small",variant:"medium",children:i})]}),r.jsx(wo,{isVisible:N,onChange:D,onClose:k,defaultValue:o})]})};Po.displayName="DynamicDataInput";const Co=h.forwardRef(({id:A,label:e,value:t,onChange:a,errorMessage:n,defaultValue:o,disabled:l,max:s,min:i,required:c=!1,isRequiredConditional:d=!1,bg:f,tags:u,color:p,className:g,originalCase:y=!1,tooltip:x,simpleMode:v=!1,inputFieldClassName:m="",isAiExtracted:b=!1,isGTN:w=!1,gtnName:H=null,inputStyle:N,withDollarSign:M=!0,labelClassName:C,isLiveField:k=!1,onBlur:D,onAddGTNToDocument:P,riskDetails:L,isRiskAnalysisOpen:T=!1,RiskDetailsCard:U,placeholder:X,...O},V)=>{const{t:z}=MA.useTranslation(),[q,F]=h.useState(!1),W=j=>{P&&P({key:H,value:j})};return v?r.jsxs("label",{id:A,className:`mb-1 text-xs font-medium text-gray-600 dark:text-neutral-200 inline-flex items-center gap-1 ${y?"":"capitalize"} ${C||""}`,children:[M&&r.jsx("span",{className:"absolute inset-y-0 left-1 flex items-center pl-3",children:"$"}),r.jsx("input",{...O,ref:V,onBlur:D,type:"number",required:c,className:E(m,"pl-8 h-[32px]"),onChange:j=>{a(j.target.value)},value:t,...o&&!t?{defaultValue:o}:{},id:A||e,style:N,autoComplete:"off"})]}):r.jsxs("div",{className:E("flex gap-0.5 relative",q&&w?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>F(!0),onMouseLeave:()=>F(!1),children:[w&&!q?r.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,r.jsxs("div",{className:E("w-full flex flex-col",g),children:[r.jsx("label",{htmlFor:"text",className:`mb-1 text-xs font-medium text-gray-600 dark:text-neutral-300 inline-flex items-center gap-1 ${y?"":"uppercase"} ${C||""}`,children:r.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[r.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap dark:text-black-300",children:[r.jsx(LA,{label:e||"",required:c||!1,isRequiredConditional:d||!1}),k&&r.jsx(rA.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),b&&r.jsx(ie,{}),r.jsx(ZA,{labels:u}),x&&r.jsx(bA,{placement:"top",title:x,children:r.jsx("div",{className:"cursor-pointer",children:r.jsx(YA,{})})})]}),w&&q&&P?r.jsx("button",{id:"btn-percentage-input-add-to-document",className:"cursor-pointer",onClick:()=>W(t?.toString()),type:"button",children:r.jsx(vA.Tooltip,{placement:"top",title:z("Add to document"),children:r.jsx(rA.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}),r.jsxs("label",{className:"relative block",children:[r.jsx("input",{...O,ref:V,onBlur:D,type:"number",required:c,disabled:l,min:i,max:s,className:`border ${n?"border-red-300":T&&L?.color?`border-${L.color}-300`:"border-gray-300"} ${f} h-[32px] text-gray-900 dark:bg-black-600 dark:text-neutral-200 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 font-inter font-medium
181
+ `),navigator?.clipboard?.writeText(eA).then(()=>{}).catch(hA=>{const dA=hA;UA.toast.error(dA?.message||BA.copyFailure("Python Code"),{toastId:BA.copyFailure("Python Code")})})}catch(eA){const hA=eA;UA.toast.error(hA?.message||BA.copyFailure("Python Code"),{toastId:BA.copyFailure("Python Code")})}else if(l==="json")try{const eA=JSON.parse(A),hA=JSON.stringify(eA,null,4);navigator?.clipboard?.writeText(hA)}catch(eA){const hA=eA;UA.toast.error(hA?.message||BA.copyFailure("JSON Code"),{toastId:BA.copyFailure("JSON Code")})}else navigator?.clipboard?.writeText(A)},iA=eA=>eA==="python"?{type:"text/x-python",extension:"py"}:eA==="json"?{type:"application/json",extension:"json"}:{type:"text/plain",extension:"txt"},lA=(eA,hA)=>eA.replace(/[<>:"/\\|?*\x00-\x1f]/g,"_").replace(/\.{2,}/g,".").replace(/^\.+|\.+$/g,"").trim()||hA,wA=()=>{try{const eA=new Blob([A],{type:iA(l)?.type}),hA=URL.createObjectURL(eA),dA=document.createElement("a");dA.href=hA;const HA=iA(l)?.extension||"txt",KA=lA(HA,"txt");dA.download=lA(`code_${Date.now()}.${KA}`,`code_${Date.now()}.${KA}`),document.body.appendChild(dA),dA.click(),document.body.removeChild(dA),URL.revokeObjectURL(hA)}catch(eA){const hA=eA;UA.toast.error(hA?.message||BA.copyFailure("Code download"),{toastId:BA.copyFailure("Code download")})}};return r.jsx(An.FullScreen,{handle:j,className:"h-full",children:r.jsxs("div",{className:Br("relative border border-neutral-200 dark:border-neutral-700 rounded-lg h-full overflow-hidden",y),id:"code-editor-container-with-json-grid",children:[r.jsxs("div",{className:E(`px-3 py-2 flex items-center bg-white dark:bg-neutral-800 ${f?"border-none":"border-b border-neutral-200 dark:border-neutral-700"} `,I?"justify-between":"justify-end"),children:[I&&f&&r.jsx(to,{variant:"switch",tabs:yo,activeTab:Q,size:"sm",onTabClick:eA=>Y(eA),tabIcons:V0,height:"h-[20px]"}),r.jsxs("div",{className:"flex items-center gap-0.5",children:[v?.({editor:m.current,value:A,onChange:e,language:l,isEditMode:n,activeTab:Q}),Q==="Grid"&&n&&f&&r.jsx("span",{className:"flex items-center justify-center border-r border-neutral-200 dark:border-neutral-700 mr-1.5 pr-1.5",children:r.jsx(bA,{title:"Add key",children:r.jsx("button",{id:"btn-code-editor-json-grid-up",onClick:()=>_(!0),className:E("p-0.5 rounded-md flex items-center justify-center","hover:bg-blue-100 hover:dark:bg-neutral-800 text-blue-600 dark:text-neutral-100"),children:r.jsx(S0,{fontSize:16})})})}),Q==="Grid"?r.jsxs(r.Fragment,{children:[r.jsx(bA,{title:"Collapse all",children:r.jsx("button",{id:"btn-code-editor-json-grid-up",onClick:()=>P(!1),className:sA,children:r.jsx(O0,{fontSize:16})})}),r.jsx(bA,{title:"Expand all",children:r.jsx("button",{id:"btn-code-editor-json-grid-down",onClick:()=>P(!0),className:sA,children:r.jsx(M0,{fontSize:16})})})]}):null,Q==="JSON"&&f?r.jsx(bA,{title:"Format",children:r.jsx("button",{id:"btn-code-editor-format-code",onClick:AA,className:sA,children:r.jsx(U0,{fontSize:14})})}):null,a&&Q==="JSON"&&f?r.jsx(bA,{title:M==="vs"?"Dark mode":"Light mode",children:r.jsx("button",{id:"btn-code-editor-with-theme",onClick:()=>k(M==="vs"?"vs-dark":"vs"),className:sA,children:M==="vs"?r.jsx(L0,{fontSize:14}):r.jsx(X0,{fontSize:14})})}):null,(l==="python"||l==="json")&&i?r.jsx(bA,{title:"Copy",children:r.jsx("button",{id:"btn-code-editor-copy-code",onClick:DA,className:sA,children:r.jsx(N0,{fontSize:14})})}):null,(l==="python"||l==="json")&&c?r.jsx(bA,{title:"Download",children:r.jsx("button",{id:"btn-code-editor-download-code",onClick:wA,className:sA,children:r.jsx(z0,{fontSize:14})})}):null,t?r.jsx(bA,{title:"Fullscreen",children:r.jsx("button",{onClick:$,id:"btn-code-editor-fullscreen",className:sA,children:r.jsx(T0,{fontSize:14})})}):null]})]}),Q==="Grid"&&l==="json"?r.jsx("div",{children:r.jsx(Zt,{isFullScreen:j?.active,allExpanded:D,toggleAll:()=>P(eA=>!eA),isEditMode:!!n,isDarkMode:C==="dark",style:{height:j?.active?"100vh":o},value:A,onChange:e,setIsAddKeyModalOpen:_,isAddKeyModalOpen:K})}):r.jsx(yi.CodeiumEditor,{height:j?.active?"100vh":o,containerStyle:{height:o},language:l,value:A,onChange:pA,theme:M,onMount:B,options:{fontSize:16,folding:!0,fontFamily:"Menlo, Monaco, 'Courier New', monospace",fontLigatures:!0,readOnly:!n}})]})})},wo=({isVisible:A,onClose:e,onChange:t,defaultValue:a,title:n="Dynamic Data",saveText:o="Save",width:l=1040})=>{const[s,i]=h.useState(a);h.useEffect(()=>{i(a)},[A,a]);const c=()=>{e()},d=()=>{try{const p=JSON.parse(s);t(JSON.stringify(p)),e()}catch(p){const g=p instanceof Error?p.message:"Invalid JSON";UA.toast.error(g,{toastId:"Invalid JSON"})}},f=p=>{i(p)},u=r.jsx("div",{className:"flex justify-end mt-4",children:r.jsx(OA,{id:"btn-dynamic-data-modal-save",status:"primary",onClick:d,type:"submit",children:o})},"submit");return r.jsx(te,{asForm:!0,title:n,open:A,onCancel:c,width:l,className:"no-body-padding-modal",footer:u,children:r.jsx("div",{className:"h-[calc(100vh-400px)] overflow-y-auto bg-neutral-50 dark:bg-black-800 px-6",children:r.jsx("div",{className:"py-5 w-full overflow-x-auto",children:r.jsx("div",{className:"border rounded-lg",children:r.jsx(xo,{height:"420px",value:s,onChange:p=>f(p),isEditMode:!0})})})})})},Rt=({fill:A="currentColor",size:e=20,className:t="",...a})=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:A,className:t,...a,children:r.jsx("g",{children:r.jsx("path",{d:"M16.0833 7.43749L12.5417 3.93749L13.7083 2.77082C14.0278 2.45138 14.4201 2.29166 14.8854 2.29166C15.3507 2.29166 15.7431 2.45138 16.0625 2.77082L17.2292 3.93749C17.5486 4.25693 17.7153 4.64235 17.7292 5.09374C17.7431 5.54513 17.5903 5.93055 17.2708 6.24999L16.0833 7.43749ZM3.33333 17.5C3.09722 17.5 2.89931 17.4201 2.73958 17.2604C2.57986 17.1007 2.5 16.9028 2.5 16.6667V14.3125C2.5 14.2014 2.52083 14.0937 2.5625 13.9896C2.60417 13.8854 2.66667 13.7917 2.75 13.7083L11.3333 5.12499L14.875 8.66666L6.29167 17.25C6.20833 17.3333 6.11458 17.3958 6.01042 17.4375C5.90625 17.4792 5.79861 17.5 5.6875 17.5H3.33333Z"})})}),Po=A=>{const{id:e,label:t="",type:a="text",placeholder:n="",value:o,onChange:l,originalCase:s=!1,errorMessage:i="",required:c,bg:d,tags:f,index:u,className:p,tooltip:g="",simpleMode:y,inputFieldClassName:x,isAiExtracted:v=!1,disabled:m=!1,...b}=A,[w,H]=h.useState(null),[N,M]=h.useState(!1),C=h.useRef(null);h.useEffect(()=>{H(null)},[u]),h.useEffect(()=>{w!==null&&l(w)},[w,l]);const k=()=>{M(!N)},D=P=>{H(P),k()};return r.jsxs(r.Fragment,{children:[y?r.jsxs("div",{className:"relative w-full h-full",children:[r.jsx("input",{type:a,placeholder:n,className:x,onChange:P=>{l(P.target.value)},ref:C,value:o?"{DYNAMIC}":"",disabled:!0,...b}),r.jsx("button",{id:"btn-dynamic-data-input-edit",onClick:k,className:E("absolute inset-y-0 right-0 flex items-center px-4 focus:border-transparent border-l",m?"cursor-not-allowed":""),disabled:m,type:"button",children:r.jsx(Rt,{})})]}):r.jsxs("div",{className:E("flex flex-col w-full",p),children:[r.jsxs("label",{htmlFor:"text",className:`mb-1 text-black-300 dark:text-black-300 inline-flex items-center gap-1 flex-wrap ${s?"":"capitalize"}`,children:[r.jsx(LA,{label:t||"",required:c||!1}),v&&r.jsx(ie,{}),r.jsx(ZA,{labels:f}),g&&r.jsx(bA,{placement:"top",title:g,children:r.jsx("div",{className:"cursor-pointer",children:r.jsx(YA,{})})})]}),r.jsxs("label",{className:"relative block",children:[r.jsx("input",{type:a,id:e,required:c,placeholder:n,className:E("border",i?"border-red-300 focus:border-red-300":"border-gray-300 dark:border-black-600 focus:border-blue-500 dark:focus:border-primary-400",d,"text-sm rounded-lg block w-full p-2.5 font-inter font-medium",a==="currency"?"pl-8":"","bg-white dark:bg-black-600 text-gray-900 dark:text-black-200"),onChange:P=>{l(P.target.value)},ref:C,value:o?"{DYNAMIC}":"",disabled:!0,autoComplete:"off",...b}),r.jsx("button",{onClick:k,className:"absolute inset-y-0 right-0 flex items-center px-4 focus:border-transparent border-l",type:"button",children:r.jsx(Rt,{})})]}),i&&r.jsx(G,{className:"text-error-500 mt-1 ",appearance:"custom",size:"extra-small",variant:"medium",children:i})]}),r.jsx(wo,{isVisible:N,onChange:D,onClose:k,defaultValue:o})]})};Po.displayName="DynamicDataInput";const Co=h.forwardRef(({id:A,label:e,value:t,onChange:a,errorMessage:n,defaultValue:o,disabled:l,max:s,min:i,required:c=!1,isRequiredConditional:d=!1,bg:f,tags:u,color:p,className:g,originalCase:y=!1,tooltip:x,simpleMode:v=!1,inputFieldClassName:m="",isAiExtracted:b=!1,isGTN:w=!1,gtnName:H=null,inputStyle:N,withDollarSign:M=!0,labelClassName:C,isLiveField:k=!1,onBlur:D,onAddGTNToDocument:P,riskDetails:L,isRiskAnalysisOpen:T=!1,RiskDetailsCard:U,placeholder:X,...O},V)=>{const{t:z}=MA.useTranslation(),[q,F]=h.useState(!1),W=j=>{P&&P({key:H,value:j})};return v?r.jsxs("label",{id:A,className:`mb-1 text-xs font-medium text-gray-600 dark:text-neutral-200 inline-flex items-center gap-1 ${y?"":"capitalize"} ${C||""}`,children:[M&&r.jsx("span",{className:"absolute inset-y-0 left-1 flex items-center pl-3",children:"$"}),r.jsx("input",{...O,ref:V,onBlur:D,type:"number",required:c,className:E(m,"pl-8 h-[32px]"),onChange:j=>{a(j.target.value)},value:t,...o&&!t?{defaultValue:o}:{},id:A||e,style:N,autoComplete:"off"})]}):r.jsxs("div",{className:E("flex gap-0.5 relative",q&&w?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>F(!0),onMouseLeave:()=>F(!1),children:[w&&!q?r.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,r.jsxs("div",{className:E("w-full flex flex-col",g),children:[r.jsx("label",{htmlFor:"text",className:`mb-1 text-xs font-medium text-gray-600 dark:text-neutral-300 inline-flex items-center gap-1 ${y?"":"uppercase"} ${C||""}`,children:r.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[r.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap dark:text-black-300",children:[r.jsx(LA,{label:e||"",required:c||!1,isRequiredConditional:d||!1}),k&&r.jsx(rA.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),b&&r.jsx(ie,{}),r.jsx(ZA,{labels:u}),x&&r.jsx(bA,{placement:"top",title:x,children:r.jsx("div",{className:"cursor-pointer",children:r.jsx(YA,{})})})]}),w&&q&&P?r.jsx("button",{id:"btn-percentage-input-add-to-document",className:"cursor-pointer",onClick:()=>W(t?.toString()),type:"button",children:r.jsx(vA.Tooltip,{placement:"top",title:z("Add to document"),children:r.jsx(rA.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}),r.jsxs("label",{className:"relative block",children:[r.jsx("input",{...O,ref:V,onBlur:D,type:"number",required:c,disabled:l,min:i,max:s,className:`border ${n?"border-red-300":T&&L?.color?`border-${L.color}-300`:"border-gray-300"} ${f} h-[32px] text-gray-900 dark:bg-black-600 dark:text-neutral-200 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 font-inter font-medium
182
182
  disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400
183
183
  ${T&&L?.color&&`bg-${L.color}-50`}
184
184
  ${p||""}