@lax-wp/design-system 0.9.2 → 0.9.4

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
@@ -17,7 +17,7 @@
17
17
  -webkit-text-fill-color: white !important;
18
18
  -webkit-box-shadow: 0 0 0px 1000px var(--input-bg-color) inset !important;
19
19
  }
20
- `}),d?l.jsx("label",{htmlFor:w,className:"mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",children:l.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:l.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:l.jsx(Lt,{label:d||"",required:c||!1})})})}):null,l.jsxs("div",{className:"relative input-field",children:[l.jsx("input",{...v,ref:S,id:w,type:f,value:e,defaultValue:s,placeholder:h,required:c,disabled:o,max:A,min:u,onKeyDown:n,style:D(),className:B("border border-solid h-8 rounded-md block w-full pl-3","text-sm font-medium text-neutral-900 dark:text-black-100","bg-white dark:bg-black-600","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-2",k(),o&&"opacity-70 cursor-not-allowed bg-neutral-50 dark:bg-black-700",y),onChange:N=>r(N.target.value),onClick:N=>N.stopPropagation()}),p&&l.jsx("div",{ref:E,className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:p})]}),l.jsx(Ye.AnimatePresence,{children:a&&l.jsx(Ye.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:l.jsx(ee,{className:B("mt-1",C()),appearance:"custom",size:"extra-small",variant:"medium",children:a})})})]})});Lu.displayName="InputField";const vr=({size:t=16,className:e="",...r})=>l.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`text-neutral-500 hover:text-neutral-700 ${e}`,...r,children:[l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),l.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),Xb=T.forwardRef(({size:t=24,fill:e="currentColor",className:r,...n},a)=>l.jsx("svg",{ref:a,className:B(r),width:t,height:t,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",...n,children:l.jsx("path",{d:"M10.0002 11.1666L5.91683 15.2499C5.76405 15.4027 5.56961 15.4791 5.3335 15.4791C5.09739 15.4791 4.90294 15.4027 4.75016 15.2499C4.59738 15.0971 4.521 14.9027 4.521 14.6666C4.521 14.4305 4.59738 14.236 4.75016 14.0833L8.8335 9.99992L4.75016 5.91659C4.59738 5.76381 4.521 5.56936 4.521 5.33325C4.521 5.09714 4.59738 4.9027 4.75016 4.74992C4.90294 4.59714 5.09739 4.52075 5.3335 4.52075C5.56961 4.52075 5.76405 4.59714 5.91683 4.74992L10.0002 8.83325L14.0835 4.74992C14.2363 4.59714 14.4307 4.52075 14.6668 4.52075C14.9029 4.52075 15.0974 4.59714 15.2502 4.74992C15.4029 4.9027 15.4793 5.09714 15.4793 5.33325C15.4793 5.56936 15.4029 5.76381 15.2502 5.91659L11.1668 9.99992L15.2502 14.0833C15.4029 14.236 15.4793 14.4305 15.4793 14.6666C15.4793 14.9027 15.4029 15.0971 15.2502 15.2499C15.0974 15.4027 14.9029 15.4791 14.6668 15.4791C14.4307 15.4791 14.2363 15.4027 14.0835 15.2499L10.0002 11.1666Z",fill:"currentColor"})}));Xb.displayName="CloseIcon";const Qn={primary:{50:"#E6F1FC",100:"#C6E1F9",200:"#8AC0F2",300:"#54A4EC",400:"#3392E9",500:"#0077E3",600:"#016DCF",700:"#0054A1",800:"#00417D",900:"#00325F",950:"#001c35",975:"#00111f"},black:{50:"#f0f0f0",100:"#d9d9d9",200:"#bfbfbf",300:"#8c8c8c",400:"#595959",500:"#454545",600:"#262626",700:"#1f1f1f",800:"#141414",900:"#000000",950:"#0a0a0a",975:"#050505"},blue:{50:"#E6F1FC",100:"#C6E1F9",200:"#8AC0F2",300:"#54A4EC",400:"#3392E9",500:"#0077E3",600:"#016DCF",700:"#0054A1",800:"#00417D",900:"#00325F",950:"#002547",975:"#001529"},success:{50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31",950:"#033625",975:"#022419"},neutral:{50:"#F9FAFB",100:"#F2F4F7",200:"#EAECF0",300:"#D0D5DD",400:"#98A2B3",500:"#667085",600:"#475467",700:"#344054",800:"#1D2939",900:"#101828",950:"#0c1219",975:"#080a0f"},error:{50:"#FEF3F2",100:"#FEE4E2",200:"#FECDCA",300:"#FDA29B",400:"#F97066",500:"#F04438",600:"#D92D20",700:"#B42318",800:"#912018",900:"#7A271A",950:"#3d1008",975:"#2a0b05"},warning:{50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E",950:"#662505",975:"#451803"},teal:{50:"#ebf5f5",100:"#c2e0df",200:"#a4d1d0",300:"#7abcba",400:"#61afad",500:"#399b98",600:"#348d8a",700:"#286e6c",800:"#1f5554",900:"#184140",950:"#133534",975:"#0c2222"},green:{50:"#f2f7f2",100:"#d5e5d5",200:"#c1d9c1",300:"#a5c7a5",400:"#94bd93",500:"#79ac78",600:"#6e9d6d",700:"#567a55",800:"#435f42",900:"#334832",950:"#001e00",975:"#182818"},yellow:{50:"#fffaed",100:"#fff0c7",200:"#ffe8ac",300:"#ffde86",400:"#ffd76f",500:"#ffcd4b",600:"#e8bb44",700:"#b59235",800:"#8c7129",900:"#6b5620",950:"#524314",975:"#382e0e"},orange:{50:"#fef4e8",100:"#fddeb7",200:"#fcce94",300:"#fbb764",400:"#faa945",500:"#f99417",600:"#e38715",700:"#b16910",800:"#89510d",900:"#693e0a",950:"#4d2d07",975:"#331e05"},peach:{50:"#fceef3",100:"#f5cad9",200:"#f0b0c6",300:"#ea8cad",400:"#e5759d",500:"#df5384",600:"#cb4c78",700:"#9e3b5e",800:"#7b2e49",900:"#5e2337",950:"#451a2b",975:"#2e111d"},red:{50:"#fceaeb",100:"#f6bec0",200:"#f29ea2",300:"#ec7278",400:"#e9575d",500:"#e32d35",600:"#cf2930",700:"#a12026",800:"#7d191d",900:"#5f1316",950:"#470c0f",975:"#2f080a"},purple:{50:"#f5e7ff",100:"#dfb4ff",200:"#d090ff",300:"#bb5dff",400:"#ad3dff",500:"#990dff",600:"#8b0ce8",700:"#6d09b5",800:"#54078c",900:"#40056b",950:"#300450",975:"#200336"},navy:{50:"#eaebf6",100:"#bebfe2",200:"#9ea1d3",300:"#7276bf",400:"#575bb3",500:"#2d32a0",600:"#292e92",700:"#202472",800:"#191c58",900:"#131543",950:"#0d0e2f",975:"#090a20"},grey:{50:"#f2f2f2",100:"#d5d5d5",200:"#c1c1c1",300:"#a5a5a5",400:"#939393",500:"#787878",600:"#6d6d6d",700:"#555555",800:"#424242",900:"#323232",950:"#252525",975:"#191919"}},vw=t=>{let e=0;for(let a=0;a<t.length;a++)e=t.charCodeAt(a)+((e<<5)-e);const r=(e&16777215).toString(16).toUpperCase();return`#${"00000".substring(0,6-r.length)+r}`},Iu=(t,e=80)=>{let r=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),a=parseInt(t.slice(5,7),16);return r=Math.min(255,r+(255-r)*(e/100)),n=Math.min(255,n+(255-n)*(e/100)),a=Math.min(255,a+(255-a)*(e/100)),`#${Math.round(r).toString(16).padStart(2,"0")}${Math.round(n).toString(16).padStart(2,"0")}${Math.round(a).toString(16).padStart(2,"0")}`},Qb=(t,e=30)=>{let r=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),a=parseInt(t.slice(5,7),16);return r=Math.max(0,r*(1-e/100)),n=Math.max(0,n*(1-e/100)),a=Math.max(0,a*(1-e/100)),`#${Math.round(r).toString(16).padStart(2,"0")}${Math.round(n).toString(16).padStart(2,"0")}${Math.round(a).toString(16).padStart(2,"0")}`},Sw=(t,e)=>({background:e?Qn[t]?.[975]:Qn[t]?.[50],borderColor:e?Qn[t]?.[900]:Qn[t]?.[100],color:e?Qn[t]?.[500]:Qn[t]?.[600]}),Ew=(t,e)=>{const r=t.startsWith("#")?t:vw(t);return{background:e?Qb(r,80):Iu(r,90),borderColor:e?Qb(r,40):Iu(r,50),color:e?Iu(r,40):r}},Tw=t=>({background:t?"#2D3748":"#F7FAFC",borderColor:t?"#4A5568":"#E2E8F0",color:t?"#A0AEC0":"#4A5568"}),xw=t=>{switch(t){case"xs":return"text-xs px-1 py-0.5";case"lg":return"text-sm px-2.5 py-1.5";case"md":return"text-sm px-2 py-1";default:return"text-xs px-1.5 py-0.5"}},Ow=(t,e,r,n)=>t?r?e.color:Qn[t]?.[500]||e.color:n?"#A0AEC0":"#4A5568",Kt=T.forwardRef(({label:t,color:e,size:r="sm",className:n,onClick:a,onMouseDown:i,truncate:s,isHashColor:o=!1,icon:A,removable:u=!1,onRemove:c,onUpload:d,acceptsUpload:f=!1,"aria-label":h},p)=>{const y=T.useMemo(()=>typeof window>"u"?"light":localStorage.getItem("vite-ui-theme")||"light",[])==="dark",b=()=>e?e in Qn?Sw(e,y):Ew(e,y):Tw(y),v=x=>{const O=x.target.files?.[0];O&&d&&d(O),x.target.value=""},S=b(),E=Ow(e,S,o,y);return l.jsx("div",{ref:p,className:B("inline-flex items-center border rounded-md transition-colors bg-primary-50 border-primary-100 text-primary-600 dark:bg-primary-900 dark:border-primary-800 dark:text-primary-400",xw(r),(a||f)&&"cursor-pointer hover:opacity-80",n),style:{maxWidth:"100%"},onMouseDown:i,onClick:a,"aria-label":h||`Tag: ${t}`,role:"button",tabIndex:a||f?0:void 0,children:l.jsxs("div",{className:"flex items-center gap-0.5 min-w-0 overflow-hidden",style:{maxWidth:"100%"},children:[A,s?l.jsx("p",{title:t,className:`text-${r} ${a||f?"cursor-pointer":""} overflow-hidden whitespace-nowrap text-ellipsis`,style:{maxWidth:"100%"},children:t.length>s?`${t.slice(0,s)}...`:t}):l.jsx("p",{className:`text-${r} overflow-hidden whitespace-nowrap text-ellipsis`,style:{maxWidth:"100%"},children:t}),f&&l.jsx("input",{type:"file",onChange:v,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer","aria-label":`Upload file for ${t}`}),u&&c&&l.jsx("button",{onClick:c,className:"ml-1 flex-shrink-0","aria-label":`Remove ${t}`,type:"button",children:l.jsx(Xb,{size:12,fill:E,className:"cursor-pointer text-primary-600 dark:text-primary-400"})})]})})});Kt.displayName="Tag";const Sr=({labels:t=[]})=>{const e=[],r=[];return t.forEach(n=>{typeof n=="string"&&!e.includes(n)?e.push(n):typeof n!="string"&&!r.some(a=>a.label===n.label)&&r.push(n)}),l.jsxs(l.Fragment,{children:[e?.map(n=>l.jsx(Kt,{size:"xs",label:n,color:"primary"},n)),r?.map((n,a)=>l.jsx(Kt,{size:"xs",label:n?.label,color:n?.color},n?.id||a))]})},Xi=()=>{if(typeof window>"u"||typeof navigator>"u")return"other";const t=navigator.platform?.toLowerCase()||"",e=navigator.userAgent?.toLowerCase()||"";return t.includes("mac")||e.includes("mac")?"macos":t.includes("win")||e.includes("win")?"windows":t.includes("linux")||e.includes("linux")?"linux":"other"},Qi=()=>T.useMemo(()=>Xi(),[]),Cw=()=>Xi()==="macos",_o={Meta:{macos:"⌘",other:"Ctrl"},Alt:{macos:"⌥",other:"Alt"},Shift:{macos:"⇧",other:"Shift"},Control:{macos:"⌃",other:"Ctrl"},Enter:{macos:"↵",other:"Enter"},Delete:{macos:"⌫",other:"Delete"}},jb=(t,e)=>{const r=e??Xi(),n=_o[t];return n?r==="macos"?n.macos:n.other:t},_u=(t,e)=>{const r=e??Xi();return t.map(n=>jb(n,r))},kw=t=>{const e=Qi();return T.useMemo(()=>_u(t,e),[t,e])},ww={auto:"top","auto-start":"topLeft","auto-end":"topRight",top:"top","top-start":"topLeft","top-end":"topRight",bottom:"bottom","bottom-start":"bottomLeft","bottom-end":"bottomRight",right:"right","right-start":"rightTop","right-end":"rightBottom",left:"left","left-start":"leftTop","left-end":"leftBottom"},Le=({children:t,title:e,hideTooltip:r=!1,delayShow:n=!1,whiteSpace:a="initial",placement:i="top",className:s,shortcuts:o,open:A,onOpenChange:u})=>{const c=Qi(),d=T.useMemo(()=>o?_u(o,c):void 0,[o,c]),f=ww[i],h=T.useMemo(()=>{if(!d)return[];const y={};return d.map(b=>(y[b]=(y[b]??0)+1,{id:`${b}-${y[b]}`,label:b}))},[d]),p=l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"flex-1",children:e}),h.length>0&&l.jsx("span",{className:"flex items-center gap-0.5 flex-shrink-0",children:h.map(y=>l.jsx("kbd",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1 rounded text-[11px] font-medium leading-none",style:{backgroundColor:"rgba(255, 255, 255, 0.1)",border:"1px solid rgba(255, 255, 255, 0.2)",color:"rgba(255, 255, 255, 0.8)"},children:y.label},y.id))})]}),g=l.jsx("span",{className:s,children:t});return r?g:l.jsx(Re.Tooltip,{title:e?p:null,placement:f,trigger:["hover"],mouseEnterDelay:n?1:0,mouseLeaveDelay:0,color:"#101828",open:A,onOpenChange:u,styles:{body:{borderRadius:8,border:"1px solid #252525",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.18)",color:"#fff",maxWidth:"40ch",fontSize:12,fontWeight:500,whiteSpace:a,overflowWrap:"break-word",wordWrap:"break-word",padding:"4px 8px"}},children:g})},Nw=({size:t=24,fill:e="currentColor",fillSecondary:r="white"})=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:[l.jsx("path",{d:"M17.5128 13.6276L13.7184 11.9717C12.8016 11.5708 12.0696 10.8389 11.6688 9.92205L10.0128 6.12765C9.88322 5.83245 9.46802 5.83245 9.33842 6.12765L7.68242 9.92205C7.28162 10.8389 6.54962 11.5708 5.63282 11.9717L1.83122 13.63C1.53842 13.7572 1.53602 14.1748 1.83122 14.3044L5.69762 16.0132C6.61202 16.4188 7.34162 17.1532 7.73762 18.0724L9.34082 21.7948C9.46802 22.09 9.88802 22.0924 10.0152 21.7948L11.6688 18.0052C12.0696 17.0884 12.8016 16.3565 13.7184 15.9557L17.5128 14.2997C17.808 14.17 17.808 13.7548 17.5128 13.6252V13.6276Z",fill:e}),l.jsx("path",{d:"M22.2624 6.43876L20.0688 5.48116C19.5384 5.25076 19.116 4.82596 18.8856 4.29796L17.928 2.10436C17.8536 1.93396 17.6136 1.93396 17.5392 2.10436L16.5816 4.29796C16.3512 4.82836 15.9264 5.25076 15.3984 5.48116L13.2024 6.43876C13.032 6.51316 13.032 6.75316 13.2024 6.82756L15.4368 7.81636C15.9648 8.04916 16.3872 8.47636 16.6152 9.00676L17.5416 11.1572C17.616 11.3276 17.8584 11.3276 17.9328 11.1572L18.888 8.96836C19.1184 8.43796 19.5432 8.01556 20.0712 7.78516L22.2648 6.82756C22.4352 6.75316 22.4352 6.51316 22.2648 6.43876H22.2624Z",fill:e})]}),Vr=({position:t="top",title:e="AI Extracted Field"})=>l.jsx(Le,{placement:t,title:e,children:l.jsx("div",{className:"cursor-pointer",children:l.jsx(Nw,{size:12,fill:"#016DCF",fillSecondary:"#54A4EC"})})}),Dw=({className:t,size:e=16})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[l.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),l.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),Pw=({className:t,size:e=16})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[l.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),l.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}),Lw=({className:t,size:e=16})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Iw=({className:t,size:e=16})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[l.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),l.jsx("path",{d:"M3 3v5h5"})]}),jn=T.forwardRef(({id:t,label:e,onChange:r,errorMessage:n,successMessage:a,required:i,isRequiredConditional:s=!1,bg:o,tags:A,color:u,className:c,isPasswordField:d,setIsPasswordVisible:f,inputRef:h,tooltip:p,suffixIcon:g,revertBackValue:y,originalCase:b=!1,textSize:v,isAiExtracted:S=!1,isGTN:E=!1,gtnName:x=null,inputClassName:O="",inputStyle:k={},labelClassName:C,onBlur:w,isLiveField:D=!1,isClearable:N=!1,riskDetails:P,isRiskAnalysisOpen:L=!1,RiskDetailsCard:H,onAddGTNToDocument:U,...q},F)=>{const{t:M}=wt.useTranslation(),[W,V]=T.useState(!1),[X,$]=T.useState(!1),G=K=>{U&&U({key:x,value:K})};return l.jsxs("div",{className:B("flex gap-0.5 relative",X&&E?"border rounded-lg border-primary-100 bg-primary-50 p-1 focus:ring-primary-500 focus:border-primary-500 dark:focus:ring-neutral-50 dark:focus:border-neutral-50":""),onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),children:[E&&!X?l.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,l.jsxs("div",{className:B("flex flex-col w-full",c),children:[l.jsx("style",{children:`
20
+ `}),d?l.jsx("label",{htmlFor:w,className:"mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",children:l.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:l.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:l.jsx(Lt,{label:d||"",required:c||!1})})})}):null,l.jsxs("div",{className:"relative input-field",children:[l.jsx("input",{...v,ref:S,id:w,type:f,value:e,defaultValue:s,placeholder:h,required:c,disabled:o,max:A,min:u,onKeyDown:n,style:D(),className:B("border border-solid h-8 rounded-md block w-full pl-3","text-sm font-medium text-neutral-900 dark:text-black-100","bg-white dark:bg-black-600","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-2",k(),o&&"opacity-70 cursor-not-allowed bg-neutral-50 dark:bg-black-700",y),onChange:N=>r(N.target.value),onClick:N=>N.stopPropagation()}),p&&l.jsx("div",{ref:E,className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:p})]}),l.jsx(Ye.AnimatePresence,{children:a&&l.jsx(Ye.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:l.jsx(ee,{className:B("mt-1",C()),appearance:"custom",size:"extra-small",variant:"medium",children:a})})})]})});Lu.displayName="InputField";const vr=({size:t=16,className:e="",...r})=>l.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`text-neutral-500 hover:text-neutral-700 ${e}`,...r,children:[l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),l.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),Xb=T.forwardRef(({size:t=24,fill:e="currentColor",className:r,...n},a)=>l.jsx("svg",{ref:a,className:B(r),width:t,height:t,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",...n,children:l.jsx("path",{d:"M10.0002 11.1666L5.91683 15.2499C5.76405 15.4027 5.56961 15.4791 5.3335 15.4791C5.09739 15.4791 4.90294 15.4027 4.75016 15.2499C4.59738 15.0971 4.521 14.9027 4.521 14.6666C4.521 14.4305 4.59738 14.236 4.75016 14.0833L8.8335 9.99992L4.75016 5.91659C4.59738 5.76381 4.521 5.56936 4.521 5.33325C4.521 5.09714 4.59738 4.9027 4.75016 4.74992C4.90294 4.59714 5.09739 4.52075 5.3335 4.52075C5.56961 4.52075 5.76405 4.59714 5.91683 4.74992L10.0002 8.83325L14.0835 4.74992C14.2363 4.59714 14.4307 4.52075 14.6668 4.52075C14.9029 4.52075 15.0974 4.59714 15.2502 4.74992C15.4029 4.9027 15.4793 5.09714 15.4793 5.33325C15.4793 5.56936 15.4029 5.76381 15.2502 5.91659L11.1668 9.99992L15.2502 14.0833C15.4029 14.236 15.4793 14.4305 15.4793 14.6666C15.4793 14.9027 15.4029 15.0971 15.2502 15.2499C15.0974 15.4027 14.9029 15.4791 14.6668 15.4791C14.4307 15.4791 14.2363 15.4027 14.0835 15.2499L10.0002 11.1666Z",fill:"currentColor"})}));Xb.displayName="CloseIcon";const Qn={primary:{50:"#E6F1FC",100:"#C6E1F9",200:"#8AC0F2",300:"#54A4EC",400:"#3392E9",500:"#0077E3",600:"#016DCF",700:"#0054A1",800:"#00417D",900:"#00325F",950:"#001c35",975:"#00111f"},black:{50:"#f0f0f0",100:"#d9d9d9",200:"#bfbfbf",300:"#8c8c8c",400:"#595959",500:"#454545",600:"#262626",700:"#1f1f1f",800:"#141414",900:"#000000",950:"#0a0a0a",975:"#050505"},blue:{50:"#E6F1FC",100:"#C6E1F9",200:"#8AC0F2",300:"#54A4EC",400:"#3392E9",500:"#0077E3",600:"#016DCF",700:"#0054A1",800:"#00417D",900:"#00325F",950:"#002547",975:"#001529"},success:{50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31",950:"#033625",975:"#022419"},neutral:{50:"#F9FAFB",100:"#F2F4F7",200:"#EAECF0",300:"#D0D5DD",400:"#98A2B3",500:"#667085",600:"#475467",700:"#344054",800:"#1D2939",900:"#101828",950:"#0c1219",975:"#080a0f"},error:{50:"#FEF3F2",100:"#FEE4E2",200:"#FECDCA",300:"#FDA29B",400:"#F97066",500:"#F04438",600:"#D92D20",700:"#B42318",800:"#912018",900:"#7A271A",950:"#3d1008",975:"#2a0b05"},warning:{50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E",950:"#662505",975:"#451803"},teal:{50:"#ebf5f5",100:"#c2e0df",200:"#a4d1d0",300:"#7abcba",400:"#61afad",500:"#399b98",600:"#348d8a",700:"#286e6c",800:"#1f5554",900:"#184140",950:"#133534",975:"#0c2222"},green:{50:"#f2f7f2",100:"#d5e5d5",200:"#c1d9c1",300:"#a5c7a5",400:"#94bd93",500:"#79ac78",600:"#6e9d6d",700:"#567a55",800:"#435f42",900:"#334832",950:"#001e00",975:"#182818"},yellow:{50:"#fffaed",100:"#fff0c7",200:"#ffe8ac",300:"#ffde86",400:"#ffd76f",500:"#ffcd4b",600:"#e8bb44",700:"#b59235",800:"#8c7129",900:"#6b5620",950:"#524314",975:"#382e0e"},orange:{50:"#fef4e8",100:"#fddeb7",200:"#fcce94",300:"#fbb764",400:"#faa945",500:"#f99417",600:"#e38715",700:"#b16910",800:"#89510d",900:"#693e0a",950:"#4d2d07",975:"#331e05"},peach:{50:"#fceef3",100:"#f5cad9",200:"#f0b0c6",300:"#ea8cad",400:"#e5759d",500:"#df5384",600:"#cb4c78",700:"#9e3b5e",800:"#7b2e49",900:"#5e2337",950:"#451a2b",975:"#2e111d"},red:{50:"#fceaeb",100:"#f6bec0",200:"#f29ea2",300:"#ec7278",400:"#e9575d",500:"#e32d35",600:"#cf2930",700:"#a12026",800:"#7d191d",900:"#5f1316",950:"#470c0f",975:"#2f080a"},purple:{50:"#f5e7ff",100:"#dfb4ff",200:"#d090ff",300:"#bb5dff",400:"#ad3dff",500:"#990dff",600:"#8b0ce8",700:"#6d09b5",800:"#54078c",900:"#40056b",950:"#300450",975:"#200336"},navy:{50:"#eaebf6",100:"#bebfe2",200:"#9ea1d3",300:"#7276bf",400:"#575bb3",500:"#2d32a0",600:"#292e92",700:"#202472",800:"#191c58",900:"#131543",950:"#0d0e2f",975:"#090a20"},grey:{50:"#f2f2f2",100:"#d5d5d5",200:"#c1c1c1",300:"#a5a5a5",400:"#939393",500:"#787878",600:"#6d6d6d",700:"#555555",800:"#424242",900:"#323232",950:"#252525",975:"#191919"}},vw=t=>{let e=0;for(let a=0;a<t.length;a++)e=t.charCodeAt(a)+((e<<5)-e);const r=(e&16777215).toString(16).toUpperCase();return`#${"00000".substring(0,6-r.length)+r}`},Iu=(t,e=80)=>{let r=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),a=parseInt(t.slice(5,7),16);return r=Math.min(255,r+(255-r)*(e/100)),n=Math.min(255,n+(255-n)*(e/100)),a=Math.min(255,a+(255-a)*(e/100)),`#${Math.round(r).toString(16).padStart(2,"0")}${Math.round(n).toString(16).padStart(2,"0")}${Math.round(a).toString(16).padStart(2,"0")}`},Qb=(t,e=30)=>{let r=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),a=parseInt(t.slice(5,7),16);return r=Math.max(0,r*(1-e/100)),n=Math.max(0,n*(1-e/100)),a=Math.max(0,a*(1-e/100)),`#${Math.round(r).toString(16).padStart(2,"0")}${Math.round(n).toString(16).padStart(2,"0")}${Math.round(a).toString(16).padStart(2,"0")}`},Sw=(t,e)=>({background:e?Qn[t]?.[975]:Qn[t]?.[50],borderColor:e?Qn[t]?.[900]:Qn[t]?.[100],color:e?Qn[t]?.[500]:Qn[t]?.[600]}),Ew=(t,e)=>{const r=t.startsWith("#")?t:vw(t);return{background:e?Qb(r,80):Iu(r,90),borderColor:e?Qb(r,40):Iu(r,50),color:e?Iu(r,40):r}},Tw=t=>({background:t?"#2D3748":"#F7FAFC",borderColor:t?"#4A5568":"#E2E8F0",color:t?"#A0AEC0":"#4A5568"}),xw=t=>{switch(t){case"xs":return"text-xs px-1 py-0.5";case"lg":return"text-sm px-2.5 py-1.5";case"md":return"text-sm px-2 py-1";default:return"text-xs px-1.5 py-0.5"}},Ow=(t,e,r,n)=>t?r?e.color:Qn[t]?.[500]||e.color:n?"#A0AEC0":"#4A5568",Kt=T.forwardRef(({label:t,color:e,size:r="sm",className:n,onClick:a,onMouseDown:i,truncate:s,isHashColor:o=!1,icon:A,removable:u=!1,onRemove:c,onUpload:d,acceptsUpload:f=!1,"aria-label":h},p)=>{const y=T.useMemo(()=>typeof window>"u"?"light":localStorage.getItem("vite-ui-theme")||"light",[])==="dark",b=()=>e?e in Qn?Sw(e,y):Ew(e,y):Tw(y),v=x=>{const O=x.target.files?.[0];O&&d&&d(O),x.target.value=""},S=b(),E=Ow(e,S,o,y);return l.jsx("div",{ref:p,className:B("inline-flex items-center border rounded-md transition-colors bg-primary-50 border-primary-100 text-primary-600 dark:bg-primary-900 dark:border-primary-800 dark:text-primary-400",xw(r),(a||f)&&"cursor-pointer hover:opacity-80",n),style:{maxWidth:"100%"},onMouseDown:i,onClick:a,"aria-label":h||`Tag: ${t}`,role:"button",tabIndex:a||f?0:void 0,children:l.jsxs("div",{className:"flex items-center gap-0.5 min-w-0 overflow-hidden",style:{maxWidth:"100%"},children:[A,s?l.jsx("p",{title:t,className:`text-${r} ${a||f?"cursor-pointer":""} overflow-hidden whitespace-nowrap text-ellipsis`,style:{maxWidth:"100%"},children:t.length>s?`${t.slice(0,s)}...`:t}):l.jsx("p",{className:`text-${r} overflow-hidden whitespace-nowrap text-ellipsis`,style:{maxWidth:"100%"},children:t}),f&&l.jsx("input",{type:"file",onChange:v,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer","aria-label":`Upload file for ${t}`}),u&&c&&l.jsx("button",{onClick:c,className:"ml-1 flex-shrink-0","aria-label":`Remove ${t}`,type:"button",children:l.jsx(Xb,{size:12,fill:E,className:"cursor-pointer text-primary-600 dark:text-primary-400"})})]})})});Kt.displayName="Tag";const Sr=({labels:t=[]})=>{const e=[],r=[];return t.forEach(n=>{typeof n=="string"&&!e.includes(n)?e.push(n):typeof n!="string"&&!r.some(a=>a.label===n.label)&&r.push(n)}),l.jsxs(l.Fragment,{children:[e?.map(n=>l.jsx(Kt,{size:"xs",label:n,color:"primary"},n)),r?.map((n,a)=>l.jsx(Kt,{size:"xs",label:n?.label,color:n?.color},n?.id||a))]})},Xi=()=>{if(typeof window>"u"||typeof navigator>"u")return"other";const t=navigator.platform?.toLowerCase()||"",e=navigator.userAgent?.toLowerCase()||"";return t.includes("mac")||e.includes("mac")?"macos":t.includes("win")||e.includes("win")?"windows":t.includes("linux")||e.includes("linux")?"linux":"other"},Qi=()=>T.useMemo(()=>Xi(),[]),Cw=()=>Xi()==="macos",_o={Meta:{macos:"⌘",other:"Ctrl"},Alt:{macos:"⌥",other:"Alt"},Shift:{macos:"⇧",other:"Shift"},Control:{macos:"⌃",other:"Ctrl"},Enter:{macos:"↵",other:"Enter"},Delete:{macos:"⌫",other:"Delete"}},jb=(t,e)=>{const r=e??Xi(),n=_o[t];return n?r==="macos"?n.macos:n.other:t},_u=(t,e)=>{const r=e??Xi();return t.map(n=>jb(n,r))},kw=t=>{const e=Qi();return T.useMemo(()=>_u(t,e),[t,e])},ww={auto:"top","auto-start":"topLeft","auto-end":"topRight",top:"top","top-start":"topLeft","top-end":"topRight",bottom:"bottom","bottom-start":"bottomLeft","bottom-end":"bottomRight",right:"right","right-start":"rightTop","right-end":"rightBottom",left:"left","left-start":"leftTop","left-end":"leftBottom"},Le=({children:t,title:e,hideTooltip:r=!1,delayShow:n=!1,whiteSpace:a="initial",placement:i="top",className:s,shortcuts:o,open:A,onOpenChange:u})=>{const c=Qi(),d=T.useMemo(()=>o?_u(o,c):void 0,[o,c]),f=ww[i],h=T.useMemo(()=>{if(!d)return[];const y={};return d.map(b=>(y[b]=(y[b]??0)+1,{id:`${b}-${y[b]}`,label:b}))},[d]),p=l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"flex-1",children:e}),h.length>0&&l.jsx("span",{className:"flex items-center gap-0.5 flex-shrink-0",children:h.map(y=>l.jsx("kbd",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1 rounded text-[11px] font-medium leading-none",style:{backgroundColor:"rgba(255, 255, 255, 0.1)",border:"1px solid rgba(255, 255, 255, 0.2)",color:"rgba(255, 255, 255, 0.8)"},children:y.label},y.id))})]}),g=l.jsx("span",{className:s,children:t});return r?g:l.jsx(Re.Tooltip,{title:e?p:null,placement:f,trigger:["hover"],mouseEnterDelay:n?1:0,mouseLeaveDelay:0,color:"#101828",open:A,onOpenChange:u,classNames:{body:"lax-tooltip-body-important-whitespace"},styles:{body:{"--lax-tooltip-white-space":a,borderRadius:8,border:"1px solid #252525",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.18)",color:"#fff",maxWidth:"40ch",fontSize:12,fontWeight:500,wordWrap:"break-word",padding:"4px 8px"}},children:g})},Nw=({size:t=24,fill:e="currentColor",fillSecondary:r="white"})=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:[l.jsx("path",{d:"M17.5128 13.6276L13.7184 11.9717C12.8016 11.5708 12.0696 10.8389 11.6688 9.92205L10.0128 6.12765C9.88322 5.83245 9.46802 5.83245 9.33842 6.12765L7.68242 9.92205C7.28162 10.8389 6.54962 11.5708 5.63282 11.9717L1.83122 13.63C1.53842 13.7572 1.53602 14.1748 1.83122 14.3044L5.69762 16.0132C6.61202 16.4188 7.34162 17.1532 7.73762 18.0724L9.34082 21.7948C9.46802 22.09 9.88802 22.0924 10.0152 21.7948L11.6688 18.0052C12.0696 17.0884 12.8016 16.3565 13.7184 15.9557L17.5128 14.2997C17.808 14.17 17.808 13.7548 17.5128 13.6252V13.6276Z",fill:e}),l.jsx("path",{d:"M22.2624 6.43876L20.0688 5.48116C19.5384 5.25076 19.116 4.82596 18.8856 4.29796L17.928 2.10436C17.8536 1.93396 17.6136 1.93396 17.5392 2.10436L16.5816 4.29796C16.3512 4.82836 15.9264 5.25076 15.3984 5.48116L13.2024 6.43876C13.032 6.51316 13.032 6.75316 13.2024 6.82756L15.4368 7.81636C15.9648 8.04916 16.3872 8.47636 16.6152 9.00676L17.5416 11.1572C17.616 11.3276 17.8584 11.3276 17.9328 11.1572L18.888 8.96836C19.1184 8.43796 19.5432 8.01556 20.0712 7.78516L22.2648 6.82756C22.4352 6.75316 22.4352 6.51316 22.2648 6.43876H22.2624Z",fill:e})]}),Vr=({position:t="top",title:e="AI Extracted Field"})=>l.jsx(Le,{placement:t,title:e,children:l.jsx("div",{className:"cursor-pointer",children:l.jsx(Nw,{size:12,fill:"#016DCF",fillSecondary:"#54A4EC"})})}),Dw=({className:t,size:e=16})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[l.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),l.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),Pw=({className:t,size:e=16})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[l.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),l.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}),Lw=({className:t,size:e=16})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Iw=({className:t,size:e=16})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[l.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),l.jsx("path",{d:"M3 3v5h5"})]}),jn=T.forwardRef(({id:t,label:e,onChange:r,errorMessage:n,successMessage:a,required:i,isRequiredConditional:s=!1,bg:o,tags:A,color:u,className:c,isPasswordField:d,setIsPasswordVisible:f,inputRef:h,tooltip:p,suffixIcon:g,revertBackValue:y,originalCase:b=!1,textSize:v,isAiExtracted:S=!1,isGTN:E=!1,gtnName:x=null,inputClassName:O="",inputStyle:k={},labelClassName:C,onBlur:w,isLiveField:D=!1,isClearable:N=!1,riskDetails:P,isRiskAnalysisOpen:L=!1,RiskDetailsCard:H,onAddGTNToDocument:U,...q},F)=>{const{t:M}=wt.useTranslation(),[W,V]=T.useState(!1),[X,$]=T.useState(!1),G=K=>{U&&U({key:x,value:K})};return l.jsxs("div",{className:B("flex gap-0.5 relative",X&&E?"border rounded-lg border-primary-100 bg-primary-50 p-1 focus:ring-primary-500 focus:border-primary-500 dark:focus:ring-neutral-50 dark:focus:border-neutral-50":""),onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),children:[E&&!X?l.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,l.jsxs("div",{className:B("flex flex-col w-full",c),children:[l.jsx("style",{children:`
21
21
  .dark input:-webkit-autofill,
22
22
  .dark input:-webkit-autofill:hover,
23
23
  .dark input:-webkit-autofill:focus {