@lax-wp/design-system 0.14.35 → 0.14.37

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.
Files changed (37) hide show
  1. package/dist/components/data-display/infinite-table/CellContextMenuPortal.cjs.js +2 -0
  2. package/dist/components/data-display/infinite-table/CellContextMenuPortal.cjs.js.map +1 -0
  3. package/dist/components/data-display/infinite-table/CellContextMenuPortal.d.ts +28 -0
  4. package/dist/components/data-display/infinite-table/CellContextMenuPortal.es.js +226 -0
  5. package/dist/components/data-display/infinite-table/CellContextMenuPortal.es.js.map +1 -0
  6. package/dist/components/data-display/infinite-table/body/cell/DataCell.cjs.js +1 -1
  7. package/dist/components/data-display/infinite-table/body/cell/DataCell.cjs.js.map +1 -1
  8. package/dist/components/data-display/infinite-table/body/cell/DataCell.es.js +169 -151
  9. package/dist/components/data-display/infinite-table/body/cell/DataCell.es.js.map +1 -1
  10. package/dist/components/data-display/infinite-table/constants.cjs.js +1 -1
  11. package/dist/components/data-display/infinite-table/constants.cjs.js.map +1 -1
  12. package/dist/components/data-display/infinite-table/constants.d.ts +8 -0
  13. package/dist/components/data-display/infinite-table/constants.es.js +24 -20
  14. package/dist/components/data-display/infinite-table/constants.es.js.map +1 -1
  15. package/dist/components/data-display/infinite-table/context.cjs.js +1 -1
  16. package/dist/components/data-display/infinite-table/context.cjs.js.map +1 -1
  17. package/dist/components/data-display/infinite-table/context.d.ts +5 -1
  18. package/dist/components/data-display/infinite-table/context.es.js +5 -2
  19. package/dist/components/data-display/infinite-table/context.es.js.map +1 -1
  20. package/dist/components/data-display/infinite-table/copy-text.cjs.js +3 -0
  21. package/dist/components/data-display/infinite-table/copy-text.cjs.js.map +1 -0
  22. package/dist/components/data-display/infinite-table/copy-text.d.ts +13 -0
  23. package/dist/components/data-display/infinite-table/copy-text.es.js +19 -0
  24. package/dist/components/data-display/infinite-table/copy-text.es.js.map +1 -0
  25. package/dist/components/data-display/infinite-table/index.cjs.js +1 -1
  26. package/dist/components/data-display/infinite-table/index.cjs.js.map +1 -1
  27. package/dist/components/data-display/infinite-table/index.d.ts +1 -1
  28. package/dist/components/data-display/infinite-table/index.es.js +518 -497
  29. package/dist/components/data-display/infinite-table/index.es.js.map +1 -1
  30. package/dist/components/data-display/infinite-table/types.d.ts +69 -0
  31. package/dist/components/forms/currency-input/CurrencyInputField.cjs.js +1 -1
  32. package/dist/components/forms/currency-input/CurrencyInputField.cjs.js.map +1 -1
  33. package/dist/components/forms/currency-input/CurrencyInputField.es.js +24 -24
  34. package/dist/components/forms/currency-input/CurrencyInputField.es.js.map +1 -1
  35. package/dist/index.d.ts +1 -1
  36. package/dist/providers/design-system-provider/types.d.ts +1 -0
  37. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("../../../_virtual/index.cjs.js"),n=require("react"),M=require("antd"),ke=require("react-i18next"),Se=require("../../data-display/typography/Typography.cjs.js"),je=require("../../data-display/label/Label.cjs.js"),Q=require("./currency.constant.cjs.js"),X=require("@mui/icons-material"),Ee=require("../../icons/AIExtractedIndicator.cjs.js"),Ce=require("../../icons/AIStarIcon.cjs.js"),we=require("../../icons/HelpIcon.cjs.js"),Z=require("../../tooltip/Tooltip.cjs.js"),x=require("../../../utils/confidenceScoreUtils.cjs.js"),Ne=require("../search-bar/SearchBar.cjs.js"),_e=require("../../buttons/option-button/OptionButton.cjs.js"),T=require("../../../utils/countryFlags.cjs.js"),Ie=require("../shared/InputLabel.cjs.js"),Be=require("../../../utils/formatters.cjs.js"),V=n.forwardRef(({id:c,label:F,value:a,onChange:B,errorMessage:i,defaultValue:m,required:k=!1,isRequiredConditional:G=!1,tags:ee,className:re,originalCase:q=!1,tooltip:A,simpleMode:te=!1,inputFieldClassName:d="",isAiExtracted:oe=!1,confidenceScore:S,confidenceType:f="high",confidenceTooltip:j,sourceMeta:ae=[],onConfidenceScoreClick:le,isGTN:E=!1,gtnName:ne=null,allowMultiCurrency:$=!1,placeholder:se,disabled:ce=!1,currencyCode:u="USD",inputStyle:de,labelClassName:z,isLiveField:ie=!1,onBlur:ue,autoFocus:D=!1,isRecording:L=!1,isPlaying:O=!1,onAddGTNToDocument:C,riskDetails:s,isRiskAnalysisOpen:p=!1,RiskDetailsCard:U,labelExtra:be,inputEmphasis:w="default",...W},H)=>{const{t:xe}=ke.useTranslation(),me=w==="modified"&&!i&&!(p&&s?.color),fe=w==="deleted"&&!i&&!(p&&s?.color),pe=w==="success"&&!i&&!(p&&s?.color),[b,R]=n.useState(!1),[ge,he]=n.useState([]),[N,K]=n.useState(""),[o,P]=n.useState(u||"USD"),[v,_]=n.useState(!1),ve=r=>{if(C){const t={key:ne,value:Be.formatCurrency(r,o)};C(t)}},g=r=>{if(r==null)return"";const t=Number(r);return isNaN(t)?r:t?.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},I=r=>{const t=r.target.value,h=t===""||t===null||t===void 0?0:Number(t);B(h,o);const y=document.getElementById(c);if(y&&y.setAttribute("data-selected-value",JSON.stringify({value:h,currency_code:o})),y&&(L||O)){const Fe=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${c}`,value:{value:h,currency_code:o},type:"change"}});y.dispatchEvent(Fe)}},J=()=>{R(!0)},Y=()=>{R(!1),(a==null||a==="")&&I({target:{value:"0.00"}}),ue?.()},ye=()=>{const r="pl-11 border h-8 text-sm block w-full p-2.5 font-inter font-medium focus:outline-none focus:ring-0";return i?l(r,"rounded-md border-red-300 bg-white dark:bg-black-600",d):p&&s?.color?l(r,`rounded-md border-${s.color}-300 bg-${s.color}-50`,"text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800",d):fe?l(r,"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]",d):me?l(r,"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]",d):pe?l(r,"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]",d):l(r,"rounded-lg border-gray-300 dark:border-black-600 bg-white dark:bg-black-600 text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400 focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]",d)};return n.useEffect(()=>{u&&P(u)},[u]),n.useEffect(()=>{if(o){const r=a===""||a===null||a===void 0?0:Number(a);u!==o&&B(r,o);const t=document.getElementById(c);if(t&&(t.setAttribute("data-selected-value",JSON.stringify({value:r,currency_code:o})),L||O)){const h=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${c}`,value:{value:r,currency_code:o},type:"change"}});t.dispatchEvent(h)}}},[o]),n.useEffect(()=>{const r=Q.CURRENCIES.filter(t=>(t.value+" - "+t.label).toLowerCase().includes(N.toLowerCase())).map(t=>({label:e.jsx(_e.OptionButton,{text:`${t.value} - ${t.label}`,icon:T.getFlagComponent(t.value),showTick:o===t.value,onClick:()=>P(t.value),className:"text-black-900 dark:text-white"}),key:t.value}));he(r)},[N,o]),n.useEffect(()=>{K("")},[o]),te?e.jsxs("label",{id:c,className:`mb-1 text-xs font-medium text-gray-600 h-full inline-flex items-center gap-1 ${q?"":"capitalize"} ${z||""}`,children:[e.jsx("span",{className:"absolute inset-y-0 left-1 top-0.5 z-10 flex items-center pl-3 cursor-text select-all",children:"$"}),e.jsx("input",{...W,ref:H,type:b?"number":"text",required:k,className:l(d,"pl-8 h-8"),onChange:I,min:0,onFocus:J,onBlur:Y,value:b?a:g(a),...m&&!a?{defaultValue:b?m:g(m)}:{},id:c||F,autoFocus:D})]}):e.jsxs("div",{className:l("flex gap-0.5 relative",v&&E?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:[E&&!v?e.jsx("div",{className:"size-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,e.jsxs("div",{className:l("w-full flex flex-col",re),children:[e.jsx("label",{htmlFor:"text",className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${q?"":"uppercase"} ${z||""}`,children:e.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[e.jsxs("div",{className:"inline-flex min-w-0 items-center gap-1 flex-wrap",children:[e.jsx(Ie.InputLabel,{label:F||"",required:k||!1,isRequiredConditional:G||!1}),ie&&e.jsx(X.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),oe&&!x.shouldShowConfidenceScore(S)&&e.jsx(Ee.AIExtractedIndicator,{}),e.jsx(je.Label,{labels:ee}),A&&e.jsx(Z,{placement:"top",title:A,children:e.jsx("div",{className:"cursor-pointer",children:e.jsx(we.HelpIcon,{className:"w-icon-sm h-icon-sm"})})}),be]}),e.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[x.shouldShowConfidenceScore(S)&&f?e.jsx(Z,{placement:"top-end",title:j??"",hideTooltip:j==null,className:"cursor-pointer",children:e.jsxs("div",{className:l("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",x.getConfidenceScoreBadgeClass(f)),onClick:()=>le?.(ae),children:[e.jsx(Ce.AIStarIcon,{size:12,fill:x.getConfidenceScoreBadgeColor(f),fillSecondary:x.getConfidenceScoreBadgeFill(f)}),e.jsxs("span",{className:l("text-xs font-medium leading-4",x.getConfidenceScoreBadgeTextColor(f)),children:[S,"%"]})]})}):null,E&&v&&C?e.jsx("button",{id:"btn-currency-input-add-to-document",className:"cursor-pointer",onClick:()=>ve(g(a)),type:"button",children:e.jsx(M.Tooltip,{placement:"top",title:xe("Add to document"),children:e.jsx(X.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})]})}),e.jsxs("label",{className:"relative block",children:[e.jsx("span",{className:"absolute inset-y-0 left-1 z-1 flex items-center pl-3 text-neutral-900 dark:text-white cursor-text select-all",children:Q.CURRENCY_SYMBOLS[o]}),e.jsx("input",{...W,ref:H,placeholder:se,type:b?"number":"text",required:k,disabled:ce,className:ye(),onChange:I,min:0,onFocus:J,onBlur:Y,value:b?a:g(a),defaultValue:b?m:g(m),id:c||F,style:de,autoComplete:"off",autoFocus:D}),e.jsx("span",{className:`absolute inset-y-0 right-2 flex items-center h-full cursor-pointer dark:text-black-200 ${$?"cursor-pointer":""}`,children:$?e.jsx(M.Dropdown,{menu:{items:[...ge]},trigger:["click"],overlayClassName:"row-option-cell",placement:"bottomRight",overlayStyle:{zIndex:999},getPopupContainer:()=>document.body,popupRender:r=>e.jsxs("div",{className:"[&>*:nth-child(2)]:!shadow-none [&>*:nth-child(2)>*]:!px-2 flex flex-col gap-2 p-2 bg-white dark:bg-black-700 border border-solid border-neutral-200 dark:border-black-600 max-h-[200px] w-[330px] text-ellipsis overflow-y-auto z-[999] rounded-md",children:[e.jsx(Ne.SearchBar,{id:"search-bar-currency-input",value:N,onChange:t=>K(t),className:"mb-2"}),r]}),children:e.jsxs("div",{className:"pl-4 pr-2 py-1.5 text-sm text-gray-700 dark:text-black-200 flex items-center gap-1",children:[T.getFlagComponent(o)," ",o]})}):o})]}),i&&e.jsx(Se.Typography,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:i})]}),v&&s&&p&&U&&e.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:r=>r.stopPropagation(),onMouseDown:r=>r.preventDefault(),onKeyDown:r=>{r.key==="Escape"&&_(!1)},children:e.jsx(U,{riskDetails:s})})]})});V.displayName="CurrencyInputField";exports.CurrencyInputField=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("../../../_virtual/index.cjs.js"),n=require("react"),M=require("antd"),Fe=require("react-i18next"),Se=require("../../data-display/typography/Typography.cjs.js"),je=require("../../data-display/label/Label.cjs.js"),Q=require("./currency.constant.cjs.js"),X=require("@mui/icons-material"),Ee=require("../../icons/AIExtractedIndicator.cjs.js"),Ce=require("../../icons/AIStarIcon.cjs.js"),we=require("../../icons/HelpIcon.cjs.js"),Z=require("../../tooltip/Tooltip.cjs.js"),x=require("../../../utils/confidenceScoreUtils.cjs.js"),Ne=require("../search-bar/SearchBar.cjs.js"),_e=require("../../buttons/option-button/OptionButton.cjs.js"),T=require("../../../utils/countryFlags.cjs.js"),Ie=require("../shared/InputLabel.cjs.js"),Be=require("../../../utils/formatters.cjs.js"),V=n.forwardRef(({id:c,label:k,value:l,onChange:B,errorMessage:i,defaultValue:m,required:F=!1,isRequiredConditional:G=!1,tags:ee,className:re,originalCase:q=!1,tooltip:A,simpleMode:te=!1,inputFieldClassName:d="",isAiExtracted:ae=!1,confidenceScore:S,confidenceType:f="high",confidenceTooltip:j,sourceMeta:le=[],onConfidenceScoreClick:oe,isGTN:E=!1,gtnName:ne=null,allowMultiCurrency:$=!1,placeholder:se,disabled:ce=!1,currencyCode:u="USD",inputStyle:de,labelClassName:z,isLiveField:ie=!1,onBlur:ue,autoFocus:D=!1,isRecording:L=!1,isPlaying:O=!1,onAddGTNToDocument:C,riskDetails:s,isRiskAnalysisOpen:p=!1,RiskDetailsCard:U,labelExtra:be,inputEmphasis:w="default",...W},H)=>{const{t:xe}=Fe.useTranslation(),me=w==="modified"&&!i&&!(p&&s?.color),fe=w==="deleted"&&!i&&!(p&&s?.color),pe=w==="success"&&!i&&!(p&&s?.color),[b,R]=n.useState(!1),[ge,he]=n.useState([]),[N,K]=n.useState(""),[a,P]=n.useState(u||"USD"),[v,_]=n.useState(!1),ve=r=>{if(C){const t={key:ne,value:Be.formatCurrency(r,a)};C(t)}},g=r=>{if(r==null)return"";const t=Number(r);return isNaN(t)?r:t?.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},I=r=>{const t=r.target.value,h=t===""||t===null||t===void 0?0:Number(t);B(h,a);const y=document.getElementById(c);if(y&&y.setAttribute("data-selected-value",JSON.stringify({value:h,currency_code:a})),y&&(L||O)){const ke=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${c}`,value:{value:h,currency_code:a},type:"change"}});y.dispatchEvent(ke)}},J=()=>{R(!0)},Y=()=>{R(!1),(l==null||l==="")&&I({target:{value:"0.00"}}),ue?.()},ye=()=>{const r="pl-11 border h-8 text-sm block w-full p-2.5 font-inter font-medium focus:outline-none focus:ring-0";return i?o(r,"rounded-md border-red-300 bg-white dark:bg-black-600 disabled:!text-neutral-400 dark:disabled:!text-neutral-500",d):p&&s?.color?o(r,`rounded-md border-${s.color}-300 bg-${s.color}-50`,"text-neutral-900 dark:text-black-200 disabled:!text-neutral-400 dark:disabled:!text-neutral-500 disabled:bg-neutral-50 dark:disabled:!bg-black-800",d):fe?o(r,"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]",d):me?o(r,"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]",d):pe?o(r,"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]",d):o(r,"rounded-lg border-gray-300 dark:border-black-600 bg-white dark:bg-black-600 text-neutral-900 dark:text-black-200 disabled:!text-neutral-400 dark:disabled:!text-neutral-500 disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400 focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]",d)};return n.useEffect(()=>{u&&P(u)},[u]),n.useEffect(()=>{if(a){const r=l===""||l===null||l===void 0?0:Number(l);u!==a&&B(r,a);const t=document.getElementById(c);if(t&&(t.setAttribute("data-selected-value",JSON.stringify({value:r,currency_code:a})),L||O)){const h=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${c}`,value:{value:r,currency_code:a},type:"change"}});t.dispatchEvent(h)}}},[a]),n.useEffect(()=>{const r=Q.CURRENCIES.filter(t=>(t.value+" - "+t.label).toLowerCase().includes(N.toLowerCase())).map(t=>({label:e.jsx(_e.OptionButton,{text:`${t.value} - ${t.label}`,icon:T.getFlagComponent(t.value),showTick:a===t.value,onClick:()=>P(t.value),className:"text-black-900 dark:text-white"}),key:t.value}));he(r)},[N,a]),n.useEffect(()=>{K("")},[a]),te?e.jsxs("label",{id:c,className:`mb-1 text-xs font-medium text-gray-600 h-full inline-flex items-center gap-1 ${q?"":"capitalize"} ${z||""}`,children:[e.jsx("span",{className:"absolute inset-y-0 left-1 top-0.5 z-10 flex items-center pl-3 cursor-text select-all",children:"$"}),e.jsx("input",{...W,ref:H,type:b?"number":"text",required:F,className:o(d,"pl-8 h-8"),onChange:I,min:0,onFocus:J,onBlur:Y,value:b?l:g(l),...m&&!l?{defaultValue:b?m:g(m)}:{},id:c||k,autoFocus:D})]}):e.jsxs("div",{className:o("flex gap-0.5 relative",v&&E?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:[E&&!v?e.jsx("div",{className:"size-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,e.jsxs("div",{className:o("w-full flex flex-col",re),children:[e.jsx("label",{htmlFor:"text",className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${q?"":"uppercase"} ${z||""}`,children:e.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[e.jsxs("div",{className:"inline-flex min-w-0 items-center gap-1 flex-wrap",children:[e.jsx(Ie.InputLabel,{label:k||"",required:F||!1,isRequiredConditional:G||!1}),ie&&e.jsx(X.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),ae&&!x.shouldShowConfidenceScore(S)&&e.jsx(Ee.AIExtractedIndicator,{}),e.jsx(je.Label,{labels:ee}),A&&e.jsx(Z,{placement:"top",title:A,children:e.jsx("div",{className:"cursor-pointer",children:e.jsx(we.HelpIcon,{className:"w-icon-sm h-icon-sm"})})}),be]}),e.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[x.shouldShowConfidenceScore(S)&&f?e.jsx(Z,{placement:"top-end",title:j??"",hideTooltip:j==null,className:"cursor-pointer",children:e.jsxs("div",{className:o("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",x.getConfidenceScoreBadgeClass(f)),onClick:()=>oe?.(le),children:[e.jsx(Ce.AIStarIcon,{size:12,fill:x.getConfidenceScoreBadgeColor(f),fillSecondary:x.getConfidenceScoreBadgeFill(f)}),e.jsxs("span",{className:o("text-xs font-medium leading-4",x.getConfidenceScoreBadgeTextColor(f)),children:[S,"%"]})]})}):null,E&&v&&C?e.jsx("button",{id:"btn-currency-input-add-to-document",className:"cursor-pointer",onClick:()=>ve(g(l)),type:"button",children:e.jsx(M.Tooltip,{placement:"top",title:xe("Add to document"),children:e.jsx(X.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})]})}),e.jsxs("label",{className:"relative block",children:[e.jsx("span",{className:"absolute inset-y-0 left-1 z-1 flex items-center pl-3 text-neutral-900 dark:text-white cursor-text select-all",children:Q.CURRENCY_SYMBOLS[a]}),e.jsx("input",{...W,ref:H,placeholder:se,type:b?"number":"text",required:F,disabled:ce,className:ye(),onChange:I,min:0,onFocus:J,onBlur:Y,value:b?l:g(l),defaultValue:b?m:g(m),id:c||k,style:de,autoComplete:"off",autoFocus:D}),e.jsx("span",{className:`absolute inset-y-0 right-2 flex items-center h-full cursor-pointer dark:text-black-200 ${$?"cursor-pointer":""}`,children:$?e.jsx(M.Dropdown,{menu:{items:[...ge]},trigger:["click"],overlayClassName:"row-option-cell",placement:"bottomRight",overlayStyle:{zIndex:999},getPopupContainer:()=>document.body,popupRender:r=>e.jsxs("div",{className:"[&>*:nth-child(2)]:!shadow-none [&>*:nth-child(2)>*]:!px-2 flex flex-col gap-2 p-2 bg-white dark:bg-black-700 border border-solid border-neutral-200 dark:border-black-600 max-h-[200px] w-[330px] text-ellipsis overflow-y-auto z-[999] rounded-md",children:[e.jsx(Ne.SearchBar,{id:"search-bar-currency-input",value:N,onChange:t=>K(t),className:"mb-2"}),r]}),children:e.jsxs("div",{className:"pl-4 pr-2 py-1.5 text-sm text-gray-700 dark:text-black-200 flex items-center gap-1",children:[T.getFlagComponent(a)," ",a]})}):a})]}),i&&e.jsx(Se.Typography,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:i})]}),v&&s&&p&&U&&e.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:r=>r.stopPropagation(),onMouseDown:r=>r.preventDefault(),onKeyDown:r=>{r.key==="Escape"&&_(!1)},children:e.jsx(U,{riskDetails:s})})]})});V.displayName="CurrencyInputField";exports.CurrencyInputField=V;
2
2
  //# sourceMappingURL=CurrencyInputField.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyInputField.cjs.js","sources":["../../../../src/components/forms/currency-input/CurrencyInputField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport { forwardRef, useEffect, useState } from \"react\";\nimport { Dropdown, Tooltip as AntTooltip } from \"antd\";\nimport { useTranslation } from 'react-i18next';\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { Label } from \"../../data-display/label/Label\";\nimport type { LabelType } from \"../../data-display/label/Label\";\nimport { CURRENCIES, CURRENCY_SYMBOLS } from \"./currency.constant\";\nimport { NoteAddOutlined, BoltOutlined } from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\nimport { SearchBar } from \"../search-bar/SearchBar\";\nimport { OptionButton } from \"../../buttons/option-button/OptionButton\";\nimport { getFlagComponent } from \"../../../utils/countryFlags\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport { formatCurrency as formatCurrencyUtils } from \"../../../utils/formatters\";\n\n/**\n * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\nexport type SourceMetaItem = {\n bbox: SourceMetaBBox;\n confidence_score?: number;\n is_primary?: boolean;\n match_score?: number;\n match_type?: string;\n page_height: number;\n page_width: number;\n source_page: number;\n source_text?: string;\n};\n\n/**\n * Risk details interface for risk analysis integration\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n hexBgColor?: string;\n hexBorderColor?: string;\n [key: string]: any;\n}\n\n/**\n * Risk details card component props - generic to allow consumer-specific risk types\n */\nexport interface RiskDetailsCardProps<T = any> {\n riskDetails: T;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/**\n * Props for the CurrencyInputField component\n */\nexport interface CurrencyInputFieldProps {\n /** Unique identifier for the currency input */\n id: string;\n /** Label text to display above the input */\n label?: string;\n /** Current value of the input (string for compatibility) */\n value: string;\n /** Callback function called when value changes */\n onChange: (data: any, currencyCode?: string) => void;\n /** Error message to display below the input */\n errorMessage?: string;\n /** Default value for the input */\n defaultValue?: string;\n /** Whether the field is required */\n required?: boolean;\n /** Whether the required indicator shows as conditional (yellow instead of red) */\n isRequiredConditional?: boolean;\n /** Tags/labels to display next to the label */\n tags?: (string | LabelType)[];\n /** Additional CSS classes for the wrapper */\n className?: string;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Whether to use simple mode (inline label style) */\n simpleMode?: boolean;\n /** Additional CSS classes for the input field */\n inputFieldClassName?: string;\n /** Whether the value was AI extracted */\n isAiExtracted?: boolean;\n /** Confidence percentage shown as a badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence badge */\n confidenceTooltip?: React.ReactNode;\n /** Source meta for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler fired when confidence score badge is clicked */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Whether this is a GTN (Global Term Name) field */\n isGTN?: boolean;\n /** GTN field name for document integration */\n gtnName?: any;\n /** Whether to allow multi-currency selection with dropdown */\n allowMultiCurrency?: boolean;\n /** Placeholder text for the input */\n placeholder?: string;\n /** Whether the input is disabled */\n disabled?: boolean;\n /** Current currency code */\n currencyCode?: string;\n /** Inline styles for the input element */\n inputStyle?: React.CSSProperties;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Callback function called when input loses focus */\n onBlur?: () => void;\n /** Whether the input should auto-focus */\n autoFocus?: boolean;\n /** Whether recording is active (for pilot context) */\n isRecording?: boolean;\n /** Whether playback is active (for pilot context) */\n isPlaying?: boolean;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Risk details data */\n riskDetails?: RiskDetails;\n /** Whether risk analysis is open */\n isRiskAnalysisOpen?: boolean;\n /** Custom risk details card component */\n RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Input surface style: `'modified'` — Warning colors; `'deleted'` — Error colors, text #475467; `'success'` — Success colors, text #101828. */\n inputEmphasis?: \"default\" | \"modified\" | \"deleted\" | \"success\";\n}\n\n/**\n * A highly customizable currency input component with label, validation, and styling support.\n * Features currency selection, formatting, validation, GTN integration, risk analysis support,\n * and comprehensive prop support for various use cases.\n *\n * @example\n * ```tsx\n * <CurrencyInputField\n * id=\"price\"\n * label=\"Price\"\n * value={price}\n * onChange={(value, currency) => setPrice(value)}\n * currencyCode=\"USD\"\n * allowMultiCurrency\n * required\n * />\n * ```\n */\nexport const CurrencyInputField = forwardRef<\n HTMLInputElement,\n CurrencyInputFieldProps\n>(\n (\n {\n id,\n label,\n value,\n onChange,\n errorMessage,\n defaultValue,\n required = false,\n isRequiredConditional = false,\n tags,\n className,\n originalCase = false,\n tooltip,\n simpleMode = false,\n inputFieldClassName = \"\",\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n isGTN = false,\n gtnName = null,\n allowMultiCurrency = false,\n placeholder,\n disabled = false,\n currencyCode = \"USD\",\n inputStyle,\n labelClassName,\n isLiveField = false,\n onBlur: onBlurProp,\n autoFocus = false,\n isRecording = false,\n isPlaying = false,\n onAddGTNToDocument,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n labelExtra,\n inputEmphasis = \"default\",\n ...props\n },\n ref\n ) => {\n const { t } = useTranslation();\n const emphasisModifiedSkin = inputEmphasis === \"modified\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisDeletedSkin = inputEmphasis === \"deleted\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisSuccessSkin = inputEmphasis === \"success\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const [isFocused, setIsFocused] = useState(false);\n const [filteredCurrencyOptions, setFilteredCurrencyOptions] = useState<\n { label: React.ReactNode; key: string }[]\n >([]);\n const [searchKeyForCurrency, setSearchKeyForCurrency] = useState(\"\");\n const [selectedCurrency, setSelectedCurrency] = useState<string>(\n currencyCode ? currencyCode : \"USD\"\n );\n const [isHovered, setIsHovered] = useState(false);\n\n const handleAddGTNToDocument = (_value: string) => {\n if (onAddGTNToDocument) {\n const keyValuePair = {\n key: gtnName,\n value: formatCurrencyUtils(_value, selectedCurrency),\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n const formatCurrency = (targetValue: any): string => {\n if (targetValue === null || targetValue === undefined) return \"\";\n\n const number = Number(targetValue);\n if (isNaN(number)) return targetValue;\n\n return number?.toLocaleString(\"en-US\", {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n });\n };\n\n const handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const _value = e.target.value;\n const numericValue =\n _value === \"\" || _value === null || _value === undefined\n ? 0\n : Number(_value);\n onChange(numericValue, selectedCurrency);\n const element = document.getElementById(id);\n if (element) {\n element.setAttribute(\n \"data-selected-value\",\n JSON.stringify({\n value: numericValue,\n currency_code: selectedCurrency,\n })\n );\n }\n if (element && (isRecording || isPlaying)) {\n const pilotEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${id}`,\n value: {\n value: numericValue,\n currency_code: selectedCurrency,\n },\n type: \"change\",\n },\n });\n element.dispatchEvent(pilotEvent);\n }\n };\n\n const onFocus = () => {\n setIsFocused(true);\n };\n\n const onBlur = () => {\n setIsFocused(false);\n if (value === null || value === undefined || value === \"\") {\n handleOnChange({\n target: { value: \"0.00\" },\n } as React.ChangeEvent<HTMLInputElement>);\n }\n onBlurProp?.();\n };\n\n const getClassName = (): string => {\n const baseClasses =\n \"pl-11 border h-8 text-sm block w-full p-2.5 font-inter font-medium focus:outline-none focus:ring-0\";\n\n if (errorMessage) {\n return cn(baseClasses, \"rounded-md border-red-300 bg-white dark:bg-black-600\", inputFieldClassName);\n }\n if (isRiskAnalysisOpen && riskDetails?.color) {\n return cn(baseClasses, `rounded-md border-${riskDetails.color}-300 bg-${riskDetails.color}-50`, \"text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800\", inputFieldClassName);\n }\n if (emphasisDeletedSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]\", inputFieldClassName);\n }\n if (emphasisModifiedSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]\", inputFieldClassName);\n }\n if (emphasisSuccessSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]\", inputFieldClassName);\n }\n return cn(baseClasses, \"rounded-lg border-gray-300 dark:border-black-600 bg-white dark:bg-black-600 text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400 focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]\", inputFieldClassName);\n };\n\n useEffect(() => {\n if (currencyCode) {\n setSelectedCurrency(currencyCode);\n }\n }, [currencyCode]);\n\n useEffect(() => {\n if (selectedCurrency) {\n const numericValue =\n value === \"\" || value === null || value === undefined\n ? 0\n : Number(value);\n if (currencyCode !== selectedCurrency) {\n onChange(numericValue, selectedCurrency);\n }\n const element = document.getElementById(id);\n if (element) {\n element.setAttribute(\n \"data-selected-value\",\n JSON.stringify({\n value: numericValue,\n currency_code: selectedCurrency,\n })\n );\n if (isRecording || isPlaying) {\n const pilotEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${id}`,\n value: {\n value: numericValue,\n currency_code: selectedCurrency,\n },\n type: \"change\",\n },\n });\n element.dispatchEvent(pilotEvent);\n }\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedCurrency]);\n\n useEffect(() => {\n const currencyOptions = CURRENCIES.filter((item) =>\n (item.value + \" - \" + item.label)\n .toLowerCase()\n .includes(searchKeyForCurrency.toLowerCase())\n ).map((item) => ({\n label: (\n <OptionButton\n text={`${item.value} - ${item.label}`}\n icon={getFlagComponent(item.value)}\n showTick={selectedCurrency === item.value}\n onClick={() => setSelectedCurrency(item.value)}\n className=\"text-black-900 dark:text-white\"\n />\n ),\n key: item.value,\n }));\n\n setFilteredCurrencyOptions(currencyOptions);\n }, [searchKeyForCurrency, selectedCurrency]);\n\n useEffect(() => {\n setSearchKeyForCurrency(\"\");\n }, [selectedCurrency]);\n\n // Simple mode rendering\n if (simpleMode) {\n return (\n <label\n id={id}\n className={`mb-1 text-xs font-medium text-gray-600 h-full inline-flex items-center gap-1 ${\n !originalCase ? \"capitalize\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <span className=\"absolute inset-y-0 left-1 top-0.5 z-10 flex items-center pl-3 cursor-text select-all\">\n {\"$\"}\n </span>\n <input\n {...props}\n ref={ref}\n type={isFocused ? \"number\" : \"text\"}\n required={required}\n className={cn(inputFieldClassName, \"pl-8 h-8\")}\n onChange={handleOnChange}\n min={0}\n onFocus={onFocus}\n onBlur={onBlur}\n value={!isFocused ? formatCurrency(value) : value}\n {...(defaultValue && !value\n ? {\n defaultValue: !isFocused\n ? formatCurrency(defaultValue)\n : defaultValue,\n }\n : {})}\n id={id || label}\n autoFocus={autoFocus}\n />\n </label>\n );\n }\n\n // Full mode rendering\n return (\n <div\n className={cn(\n \"flex gap-0.5 relative\",\n isHovered && isGTN\n ? \"border rounded-lg border-primary-100 bg-primary-50 p-1\"\n : \"\"\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {isGTN && !isHovered ? (\n <div className=\"size-1 bg-primary-600 rounded-full animate-blink mt-1.5\" />\n ) : null}\n <div className={cn(\"w-full flex flex-col\", className)}>\n <label\n htmlFor=\"text\"\n className={`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${\n !originalCase ? \"uppercase\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1\">\n <div className=\"inline-flex min-w-0 items-center gap-1 flex-wrap\">\n <InputLabel label={label || \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n {isLiveField && (\n <BoltOutlined\n sx={{\n fontSize: 16,\n color: \"var(--color-primary-600)\",\n rotate: \"15deg\",\n }}\n />\n )}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags} />\n {tooltip && (\n <Tooltip placement=\"top\" title={tooltip}>\n <div className=\"cursor-pointer\">\n <HelpIcon className=\"w-icon-sm h-icon-sm\" />\n </div>\n </Tooltip>\n )}\n {labelExtra}\n </div>\n <div className=\"flex items-center gap-1 justify-self-end\">\n {(shouldShowConfidenceScore(confidenceScore) && confidenceType) ? (\n <Tooltip\n placement=\"top-end\"\n title={confidenceTooltip ?? \"\"}\n hideTooltip={confidenceTooltip === undefined || confidenceTooltip === null}\n className=\"cursor-pointer\"\n >\n <div\n className={cn(\n \"inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5\",\n getConfidenceScoreBadgeClass(confidenceType)\n )}\n onClick={() => onConfidenceScoreClick?.(sourceMeta)}\n >\n <AIStarIcon\n size={12}\n fill={getConfidenceScoreBadgeColor(confidenceType)}\n fillSecondary={getConfidenceScoreBadgeFill(confidenceType)}\n />\n <span className={cn(\"text-xs font-medium leading-4\", getConfidenceScoreBadgeTextColor(confidenceType))}>\n {confidenceScore}%\n </span>\n </div>\n </Tooltip>\n ) : null}\n {isGTN && isHovered && onAddGTNToDocument ? (\n <button\n id=\"btn-currency-input-add-to-document\"\n className=\"cursor-pointer\"\n onClick={() => handleAddGTNToDocument(formatCurrency(value))}\n type=\"button\"\n >\n <AntTooltip placement=\"top\" title={t(\"Add to document\")}>\n <NoteAddOutlined\n className=\"text-primary-600\"\n sx={{\n fontSize: 16\n }}\n />\n </AntTooltip>\n </button>\n ) : null}\n </div>\n </div>\n </label>\n <label className=\"relative block\">\n <span className=\"absolute inset-y-0 left-1 z-1 flex items-center pl-3 text-neutral-900 dark:text-white cursor-text select-all\">\n {CURRENCY_SYMBOLS[selectedCurrency]}\n </span>\n\n <input\n {...props}\n ref={ref}\n placeholder={placeholder}\n type={isFocused ? \"number\" : \"text\"}\n required={required}\n disabled={disabled}\n className={getClassName()}\n onChange={handleOnChange}\n min={0}\n onFocus={onFocus}\n onBlur={onBlur}\n value={!isFocused ? formatCurrency(value) : value}\n defaultValue={\n !isFocused ? formatCurrency(defaultValue) : defaultValue\n }\n id={id || label}\n style={inputStyle}\n autoComplete=\"off\"\n autoFocus={autoFocus}\n />\n <span\n className={`absolute inset-y-0 right-2 flex items-center h-full cursor-pointer dark:text-black-200 ${\n allowMultiCurrency ? \"cursor-pointer\" : \"\"\n }`}\n >\n {allowMultiCurrency ? (\n <Dropdown\n menu={{\n items: [\n ...filteredCurrencyOptions,\n ],\n }}\n trigger={[\"click\"]}\n overlayClassName=\"row-option-cell\"\n placement=\"bottomRight\"\n overlayStyle={{ zIndex: 999 }}\n getPopupContainer={() => document.body}\n popupRender={(menu) => (\n <div\n className=\"[&>*:nth-child(2)]:!shadow-none [&>*:nth-child(2)>*]:!px-2 flex flex-col gap-2 p-2 bg-white dark:bg-black-700 border border-solid border-neutral-200 dark:border-black-600 max-h-[200px] w-[330px] text-ellipsis overflow-y-auto z-[999] rounded-md\"\n >\n <SearchBar\n id={`search-bar-currency-input`}\n value={searchKeyForCurrency}\n onChange={(_value) =>\n setSearchKeyForCurrency(_value)\n }\n className=\"mb-2\"\n />\n {menu}\n </div>\n )}\n >\n <div className=\"pl-4 pr-2 py-1.5 text-sm text-gray-700 dark:text-black-200 flex items-center gap-1\">\n {getFlagComponent(selectedCurrency)} {selectedCurrency}\n </div>\n </Dropdown>\n ) : (\n selectedCurrency\n )}\n </span>\n </label>\n {errorMessage && (\n <Typography\n className=\"text-error-500 mt-1\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {errorMessage}\n </Typography>\n )}\n </div>\n {isHovered &&\n riskDetails &&\n isRiskAnalysisOpen &&\n RiskDetailsCard && (\n <div\n role=\"tooltip\"\n tabIndex={0}\n className=\"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl\"\n onClick={(e) => e.stopPropagation()}\n onMouseDown={(e) => e.preventDefault()}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n setIsHovered(false);\n }\n }}\n >\n <RiskDetailsCard riskDetails={riskDetails} />\n </div>\n )}\n </div>\n );\n }\n);\n\nCurrencyInputField.displayName = \"CurrencyInputField\";\n"],"names":["CurrencyInputField","forwardRef","id","label","value","onChange","errorMessage","defaultValue","required","isRequiredConditional","tags","className","originalCase","tooltip","simpleMode","inputFieldClassName","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","isGTN","gtnName","allowMultiCurrency","placeholder","disabled","currencyCode","inputStyle","labelClassName","isLiveField","onBlurProp","autoFocus","isRecording","isPlaying","onAddGTNToDocument","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","labelExtra","inputEmphasis","props","ref","t","useTranslation","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","isFocused","setIsFocused","useState","filteredCurrencyOptions","setFilteredCurrencyOptions","searchKeyForCurrency","setSearchKeyForCurrency","selectedCurrency","setSelectedCurrency","isHovered","setIsHovered","handleAddGTNToDocument","_value","keyValuePair","formatCurrencyUtils","formatCurrency","targetValue","number","handleOnChange","e","numericValue","element","pilotEvent","onFocus","onBlur","getClassName","baseClasses","cn","useEffect","currencyOptions","CURRENCIES","item","jsx","OptionButton","getFlagComponent","jsxs","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","Tooltip","HelpIcon","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","AntTooltip","NoteAddOutlined","CURRENCY_SYMBOLS","Dropdown","menu","SearchBar","Typography"],"mappings":"+3BA6KaA,EAAqBC,EAAAA,WAIhC,CACE,CACE,GAAAC,EACA,MAAAC,EACA,MAAAC,EACA,SAAAC,EACA,aAAAC,EACA,aAAAC,EACA,SAAAC,EAAW,GACX,sBAAAC,EAAwB,GACxB,KAAAC,GACA,UAAAC,GACA,aAAAC,EAAe,GACf,QAAAC,EACA,WAAAC,GAAa,GACb,oBAAAC,EAAsB,GACtB,cAAAC,GAAgB,GAChB,gBAAAC,EACA,eAAAC,EAAiB,OACjB,kBAAAC,EACA,WAAAC,GAAa,CAAA,EACb,uBAAAC,GACA,MAAAC,EAAQ,GACR,QAAAC,GAAU,KACV,mBAAAC,EAAqB,GACrB,YAAAC,GACA,SAAAC,GAAW,GACX,aAAAC,EAAe,MACf,WAAAC,GACA,eAAAC,EACA,YAAAC,GAAc,GACd,OAAQC,GACR,UAAAC,EAAY,GACZ,YAAAC,EAAc,GACd,UAAAC,EAAY,GACZ,mBAAAC,EACA,YAAAC,EACA,mBAAAC,EAAqB,GACrB,gBAAAC,EACA,WAAAC,GACA,cAAAC,EAAgB,UAChB,GAAGC,CAAA,EAELC,IACG,CACH,K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InputField.cjs.js","sources":["../../../../src/components/forms/currency-input/CurrencyInputField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport { forwardRef, useEffect, useState } from \"react\";\nimport { Dropdown, Tooltip as AntTooltip } from \"antd\";\nimport { useTranslation } from 'react-i18next';\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { Label } from \"../../data-display/label/Label\";\nimport type { LabelType } from \"../../data-display/label/Label\";\nimport { CURRENCIES, CURRENCY_SYMBOLS } from \"./currency.constant\";\nimport { NoteAddOutlined, BoltOutlined } from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\nimport { SearchBar } from \"../search-bar/SearchBar\";\nimport { OptionButton } from \"../../buttons/option-button/OptionButton\";\nimport { getFlagComponent } from \"../../../utils/countryFlags\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport { formatCurrency as formatCurrencyUtils } from \"../../../utils/formatters\";\n\n/**\n * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\nexport type SourceMetaItem = {\n bbox: SourceMetaBBox;\n confidence_score?: number;\n is_primary?: boolean;\n match_score?: number;\n match_type?: string;\n page_height: number;\n page_width: number;\n source_page: number;\n source_text?: string;\n};\n\n/**\n * Risk details interface for risk analysis integration\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n hexBgColor?: string;\n hexBorderColor?: string;\n [key: string]: any;\n}\n\n/**\n * Risk details card component props - generic to allow consumer-specific risk types\n */\nexport interface RiskDetailsCardProps<T = any> {\n riskDetails: T;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/**\n * Props for the CurrencyInputField component\n */\nexport interface CurrencyInputFieldProps {\n /** Unique identifier for the currency input */\n id: string;\n /** Label text to display above the input */\n label?: string;\n /** Current value of the input (string for compatibility) */\n value: string;\n /** Callback function called when value changes */\n onChange: (data: any, currencyCode?: string) => void;\n /** Error message to display below the input */\n errorMessage?: string;\n /** Default value for the input */\n defaultValue?: string;\n /** Whether the field is required */\n required?: boolean;\n /** Whether the required indicator shows as conditional (yellow instead of red) */\n isRequiredConditional?: boolean;\n /** Tags/labels to display next to the label */\n tags?: (string | LabelType)[];\n /** Additional CSS classes for the wrapper */\n className?: string;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Whether to use simple mode (inline label style) */\n simpleMode?: boolean;\n /** Additional CSS classes for the input field */\n inputFieldClassName?: string;\n /** Whether the value was AI extracted */\n isAiExtracted?: boolean;\n /** Confidence percentage shown as a badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence badge */\n confidenceTooltip?: React.ReactNode;\n /** Source meta for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler fired when confidence score badge is clicked */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Whether this is a GTN (Global Term Name) field */\n isGTN?: boolean;\n /** GTN field name for document integration */\n gtnName?: any;\n /** Whether to allow multi-currency selection with dropdown */\n allowMultiCurrency?: boolean;\n /** Placeholder text for the input */\n placeholder?: string;\n /** Whether the input is disabled */\n disabled?: boolean;\n /** Current currency code */\n currencyCode?: string;\n /** Inline styles for the input element */\n inputStyle?: React.CSSProperties;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Callback function called when input loses focus */\n onBlur?: () => void;\n /** Whether the input should auto-focus */\n autoFocus?: boolean;\n /** Whether recording is active (for pilot context) */\n isRecording?: boolean;\n /** Whether playback is active (for pilot context) */\n isPlaying?: boolean;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Risk details data */\n riskDetails?: RiskDetails;\n /** Whether risk analysis is open */\n isRiskAnalysisOpen?: boolean;\n /** Custom risk details card component */\n RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Input surface style: `'modified'` — Warning colors; `'deleted'` — Error colors, text #475467; `'success'` — Success colors, text #101828. */\n inputEmphasis?: \"default\" | \"modified\" | \"deleted\" | \"success\";\n}\n\n/**\n * A highly customizable currency input component with label, validation, and styling support.\n * Features currency selection, formatting, validation, GTN integration, risk analysis support,\n * and comprehensive prop support for various use cases.\n *\n * @example\n * ```tsx\n * <CurrencyInputField\n * id=\"price\"\n * label=\"Price\"\n * value={price}\n * onChange={(value, currency) => setPrice(value)}\n * currencyCode=\"USD\"\n * allowMultiCurrency\n * required\n * />\n * ```\n */\nexport const CurrencyInputField = forwardRef<\n HTMLInputElement,\n CurrencyInputFieldProps\n>(\n (\n {\n id,\n label,\n value,\n onChange,\n errorMessage,\n defaultValue,\n required = false,\n isRequiredConditional = false,\n tags,\n className,\n originalCase = false,\n tooltip,\n simpleMode = false,\n inputFieldClassName = \"\",\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n isGTN = false,\n gtnName = null,\n allowMultiCurrency = false,\n placeholder,\n disabled = false,\n currencyCode = \"USD\",\n inputStyle,\n labelClassName,\n isLiveField = false,\n onBlur: onBlurProp,\n autoFocus = false,\n isRecording = false,\n isPlaying = false,\n onAddGTNToDocument,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n labelExtra,\n inputEmphasis = \"default\",\n ...props\n },\n ref\n ) => {\n const { t } = useTranslation();\n const emphasisModifiedSkin = inputEmphasis === \"modified\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisDeletedSkin = inputEmphasis === \"deleted\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisSuccessSkin = inputEmphasis === \"success\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const [isFocused, setIsFocused] = useState(false);\n const [filteredCurrencyOptions, setFilteredCurrencyOptions] = useState<\n { label: React.ReactNode; key: string }[]\n >([]);\n const [searchKeyForCurrency, setSearchKeyForCurrency] = useState(\"\");\n const [selectedCurrency, setSelectedCurrency] = useState<string>(\n currencyCode ? currencyCode : \"USD\"\n );\n const [isHovered, setIsHovered] = useState(false);\n\n const handleAddGTNToDocument = (_value: string) => {\n if (onAddGTNToDocument) {\n const keyValuePair = {\n key: gtnName,\n value: formatCurrencyUtils(_value, selectedCurrency),\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n const formatCurrency = (targetValue: any): string => {\n if (targetValue === null || targetValue === undefined) return \"\";\n\n const number = Number(targetValue);\n if (isNaN(number)) return targetValue;\n\n return number?.toLocaleString(\"en-US\", {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n });\n };\n\n const handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const _value = e.target.value;\n const numericValue =\n _value === \"\" || _value === null || _value === undefined\n ? 0\n : Number(_value);\n onChange(numericValue, selectedCurrency);\n const element = document.getElementById(id);\n if (element) {\n element.setAttribute(\n \"data-selected-value\",\n JSON.stringify({\n value: numericValue,\n currency_code: selectedCurrency,\n })\n );\n }\n if (element && (isRecording || isPlaying)) {\n const pilotEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${id}`,\n value: {\n value: numericValue,\n currency_code: selectedCurrency,\n },\n type: \"change\",\n },\n });\n element.dispatchEvent(pilotEvent);\n }\n };\n\n const onFocus = () => {\n setIsFocused(true);\n };\n\n const onBlur = () => {\n setIsFocused(false);\n if (value === null || value === undefined || value === \"\") {\n handleOnChange({\n target: { value: \"0.00\" },\n } as React.ChangeEvent<HTMLInputElement>);\n }\n onBlurProp?.();\n };\n\n const getClassName = (): string => {\n const baseClasses =\n \"pl-11 border h-8 text-sm block w-full p-2.5 font-inter font-medium focus:outline-none focus:ring-0\";\n\n if (errorMessage) {\n return cn(baseClasses, \"rounded-md border-red-300 bg-white dark:bg-black-600 disabled:!text-neutral-400 dark:disabled:!text-neutral-500\", inputFieldClassName);\n }\n if (isRiskAnalysisOpen && riskDetails?.color) {\n return cn(baseClasses, `rounded-md border-${riskDetails.color}-300 bg-${riskDetails.color}-50`, \"text-neutral-900 dark:text-black-200 disabled:!text-neutral-400 dark:disabled:!text-neutral-500 disabled:bg-neutral-50 dark:disabled:!bg-black-800\", inputFieldClassName);\n }\n if (emphasisDeletedSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]\", inputFieldClassName);\n }\n if (emphasisModifiedSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]\", inputFieldClassName);\n }\n if (emphasisSuccessSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]\", inputFieldClassName);\n }\n return cn(baseClasses, \"rounded-lg border-gray-300 dark:border-black-600 bg-white dark:bg-black-600 text-neutral-900 dark:text-black-200 disabled:!text-neutral-400 dark:disabled:!text-neutral-500 disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400 focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]\", inputFieldClassName);\n };\n\n useEffect(() => {\n if (currencyCode) {\n setSelectedCurrency(currencyCode);\n }\n }, [currencyCode]);\n\n useEffect(() => {\n if (selectedCurrency) {\n const numericValue =\n value === \"\" || value === null || value === undefined\n ? 0\n : Number(value);\n if (currencyCode !== selectedCurrency) {\n onChange(numericValue, selectedCurrency);\n }\n const element = document.getElementById(id);\n if (element) {\n element.setAttribute(\n \"data-selected-value\",\n JSON.stringify({\n value: numericValue,\n currency_code: selectedCurrency,\n })\n );\n if (isRecording || isPlaying) {\n const pilotEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${id}`,\n value: {\n value: numericValue,\n currency_code: selectedCurrency,\n },\n type: \"change\",\n },\n });\n element.dispatchEvent(pilotEvent);\n }\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedCurrency]);\n\n useEffect(() => {\n const currencyOptions = CURRENCIES.filter((item) =>\n (item.value + \" - \" + item.label)\n .toLowerCase()\n .includes(searchKeyForCurrency.toLowerCase())\n ).map((item) => ({\n label: (\n <OptionButton\n text={`${item.value} - ${item.label}`}\n icon={getFlagComponent(item.value)}\n showTick={selectedCurrency === item.value}\n onClick={() => setSelectedCurrency(item.value)}\n className=\"text-black-900 dark:text-white\"\n />\n ),\n key: item.value,\n }));\n\n setFilteredCurrencyOptions(currencyOptions);\n }, [searchKeyForCurrency, selectedCurrency]);\n\n useEffect(() => {\n setSearchKeyForCurrency(\"\");\n }, [selectedCurrency]);\n\n // Simple mode rendering\n if (simpleMode) {\n return (\n <label\n id={id}\n className={`mb-1 text-xs font-medium text-gray-600 h-full inline-flex items-center gap-1 ${\n !originalCase ? \"capitalize\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <span className=\"absolute inset-y-0 left-1 top-0.5 z-10 flex items-center pl-3 cursor-text select-all\">\n {\"$\"}\n </span>\n <input\n {...props}\n ref={ref}\n type={isFocused ? \"number\" : \"text\"}\n required={required}\n className={cn(inputFieldClassName, \"pl-8 h-8\")}\n onChange={handleOnChange}\n min={0}\n onFocus={onFocus}\n onBlur={onBlur}\n value={!isFocused ? formatCurrency(value) : value}\n {...(defaultValue && !value\n ? {\n defaultValue: !isFocused\n ? formatCurrency(defaultValue)\n : defaultValue,\n }\n : {})}\n id={id || label}\n autoFocus={autoFocus}\n />\n </label>\n );\n }\n\n // Full mode rendering\n return (\n <div\n className={cn(\n \"flex gap-0.5 relative\",\n isHovered && isGTN\n ? \"border rounded-lg border-primary-100 bg-primary-50 p-1\"\n : \"\"\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {isGTN && !isHovered ? (\n <div className=\"size-1 bg-primary-600 rounded-full animate-blink mt-1.5\" />\n ) : null}\n <div className={cn(\"w-full flex flex-col\", className)}>\n <label\n htmlFor=\"text\"\n className={`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${\n !originalCase ? \"uppercase\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1\">\n <div className=\"inline-flex min-w-0 items-center gap-1 flex-wrap\">\n <InputLabel label={label || \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n {isLiveField && (\n <BoltOutlined\n sx={{\n fontSize: 16,\n color: \"var(--color-primary-600)\",\n rotate: \"15deg\",\n }}\n />\n )}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags} />\n {tooltip && (\n <Tooltip placement=\"top\" title={tooltip}>\n <div className=\"cursor-pointer\">\n <HelpIcon className=\"w-icon-sm h-icon-sm\" />\n </div>\n </Tooltip>\n )}\n {labelExtra}\n </div>\n <div className=\"flex items-center gap-1 justify-self-end\">\n {(shouldShowConfidenceScore(confidenceScore) && confidenceType) ? (\n <Tooltip\n placement=\"top-end\"\n title={confidenceTooltip ?? \"\"}\n hideTooltip={confidenceTooltip === undefined || confidenceTooltip === null}\n className=\"cursor-pointer\"\n >\n <div\n className={cn(\n \"inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5\",\n getConfidenceScoreBadgeClass(confidenceType)\n )}\n onClick={() => onConfidenceScoreClick?.(sourceMeta)}\n >\n <AIStarIcon\n size={12}\n fill={getConfidenceScoreBadgeColor(confidenceType)}\n fillSecondary={getConfidenceScoreBadgeFill(confidenceType)}\n />\n <span className={cn(\"text-xs font-medium leading-4\", getConfidenceScoreBadgeTextColor(confidenceType))}>\n {confidenceScore}%\n </span>\n </div>\n </Tooltip>\n ) : null}\n {isGTN && isHovered && onAddGTNToDocument ? (\n <button\n id=\"btn-currency-input-add-to-document\"\n className=\"cursor-pointer\"\n onClick={() => handleAddGTNToDocument(formatCurrency(value))}\n type=\"button\"\n >\n <AntTooltip placement=\"top\" title={t(\"Add to document\")}>\n <NoteAddOutlined\n className=\"text-primary-600\"\n sx={{\n fontSize: 16\n }}\n />\n </AntTooltip>\n </button>\n ) : null}\n </div>\n </div>\n </label>\n <label className=\"relative block\">\n <span className=\"absolute inset-y-0 left-1 z-1 flex items-center pl-3 text-neutral-900 dark:text-white cursor-text select-all\">\n {CURRENCY_SYMBOLS[selectedCurrency]}\n </span>\n\n <input\n {...props}\n ref={ref}\n placeholder={placeholder}\n type={isFocused ? \"number\" : \"text\"}\n required={required}\n disabled={disabled}\n className={getClassName()}\n onChange={handleOnChange}\n min={0}\n onFocus={onFocus}\n onBlur={onBlur}\n value={!isFocused ? formatCurrency(value) : value}\n defaultValue={\n !isFocused ? formatCurrency(defaultValue) : defaultValue\n }\n id={id || label}\n style={inputStyle}\n autoComplete=\"off\"\n autoFocus={autoFocus}\n />\n <span\n className={`absolute inset-y-0 right-2 flex items-center h-full cursor-pointer dark:text-black-200 ${\n allowMultiCurrency ? \"cursor-pointer\" : \"\"\n }`}\n >\n {allowMultiCurrency ? (\n <Dropdown\n menu={{\n items: [\n ...filteredCurrencyOptions,\n ],\n }}\n trigger={[\"click\"]}\n overlayClassName=\"row-option-cell\"\n placement=\"bottomRight\"\n overlayStyle={{ zIndex: 999 }}\n getPopupContainer={() => document.body}\n popupRender={(menu) => (\n <div\n className=\"[&>*:nth-child(2)]:!shadow-none [&>*:nth-child(2)>*]:!px-2 flex flex-col gap-2 p-2 bg-white dark:bg-black-700 border border-solid border-neutral-200 dark:border-black-600 max-h-[200px] w-[330px] text-ellipsis overflow-y-auto z-[999] rounded-md\"\n >\n <SearchBar\n id={`search-bar-currency-input`}\n value={searchKeyForCurrency}\n onChange={(_value) =>\n setSearchKeyForCurrency(_value)\n }\n className=\"mb-2\"\n />\n {menu}\n </div>\n )}\n >\n <div className=\"pl-4 pr-2 py-1.5 text-sm text-gray-700 dark:text-black-200 flex items-center gap-1\">\n {getFlagComponent(selectedCurrency)} {selectedCurrency}\n </div>\n </Dropdown>\n ) : (\n selectedCurrency\n )}\n </span>\n </label>\n {errorMessage && (\n <Typography\n className=\"text-error-500 mt-1\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {errorMessage}\n </Typography>\n )}\n </div>\n {isHovered &&\n riskDetails &&\n isRiskAnalysisOpen &&\n RiskDetailsCard && (\n <div\n role=\"tooltip\"\n tabIndex={0}\n className=\"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl\"\n onClick={(e) => e.stopPropagation()}\n onMouseDown={(e) => e.preventDefault()}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n setIsHovered(false);\n }\n }}\n >\n <RiskDetailsCard riskDetails={riskDetails} />\n </div>\n )}\n </div>\n );\n }\n);\n\nCurrencyInputField.displayName = \"CurrencyInputField\";\n"],"names":["CurrencyInputField","forwardRef","id","label","value","onChange","errorMessage","defaultValue","required","isRequiredConditional","tags","className","originalCase","tooltip","simpleMode","inputFieldClassName","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","isGTN","gtnName","allowMultiCurrency","placeholder","disabled","currencyCode","inputStyle","labelClassName","isLiveField","onBlurProp","autoFocus","isRecording","isPlaying","onAddGTNToDocument","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","labelExtra","inputEmphasis","props","ref","t","useTranslation","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","isFocused","setIsFocused","useState","filteredCurrencyOptions","setFilteredCurrencyOptions","searchKeyForCurrency","setSearchKeyForCurrency","selectedCurrency","setSelectedCurrency","isHovered","setIsHovered","handleAddGTNToDocument","_value","keyValuePair","formatCurrencyUtils","formatCurrency","targetValue","number","handleOnChange","e","numericValue","element","pilotEvent","onFocus","onBlur","getClassName","baseClasses","cn","useEffect","currencyOptions","CURRENCIES","item","jsx","OptionButton","getFlagComponent","jsxs","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","Tooltip","HelpIcon","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","AntTooltip","NoteAddOutlined","CURRENCY_SYMBOLS","Dropdown","menu","SearchBar","Typography"],"mappings":"+3BA6KaA,EAAqBC,EAAAA,WAIhC,CACE,C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,EAIL,SAAAjB,EAAAA,KAAC,MAAA,CAAI,UAAU,qFACZ,SAAA,CAAAD,EAAAA,iBAAiB3B,CAAgB,EAAE,IAAEA,CAAA,CAAA,CACxC,CAAA,CAAA,EAGFA,CAAA,CAAA,CAEJ,EACF,EACCjD,GACC0E,EAAAA,IAACsB,GAAAA,WAAA,CACC,UAAU,sBACV,WAAW,SACX,KAAK,cACL,QAAQ,SAEP,SAAAhG,CAAA,CAAA,CACH,EAEJ,EACCmD,GACCrB,GACAC,GACAC,GACE0C,EAAAA,IAAC,MAAA,CACC,KAAK,UACL,SAAU,EACV,UAAU,oFACV,QAAUb,GAAMA,EAAE,gBAAA,EAClB,YAAcA,GAAMA,EAAE,eAAA,EACtB,UAAYA,GAAM,CACZA,EAAE,MAAQ,UACZT,EAAa,EAAK,CAEtB,EAEA,SAAAsB,EAAAA,IAAC1C,GAAgB,YAAAF,CAAA,CAA0B,CAAA,CAAA,CAC7C,CAAA,CAAA,CAIV,CACF,EAEApC,EAAmB,YAAc"}
@@ -44,7 +44,7 @@ const Ke = ye(
44
44
  allowMultiCurrency: L = !1,
45
45
  placeholder: le,
46
46
  disabled: ne = !1,
47
- currencyCode: m = "USD",
47
+ currencyCode: u = "USD",
48
48
  inputStyle: ce,
49
49
  labelClassName: O,
50
50
  isLiveField: de = !1,
@@ -60,9 +60,9 @@ const Ke = ye(
60
60
  inputEmphasis: _ = "default",
61
61
  ...K
62
62
  }, J) => {
63
- const { t: me } = Se(), ue = _ === "modified" && !i && !(p && c?.color), be = _ === "deleted" && !i && !(p && c?.color), fe = _ === "success" && !i && !(p && c?.color), [u, P] = h(!1), [pe, ge] = h([]), [B, R] = h(""), [o, Y] = h(
64
- m || "USD"
65
- ), [v, I] = h(!1), xe = (e) => {
63
+ const { t: ue } = Se(), me = _ === "modified" && !i && !(p && c?.color), be = _ === "deleted" && !i && !(p && c?.color), fe = _ === "success" && !i && !(p && c?.color), [m, P] = h(!1), [pe, xe] = h([]), [B, R] = h(""), [o, Y] = h(
64
+ u || "USD"
65
+ ), [v, I] = h(!1), ge = (e) => {
66
66
  if (N) {
67
67
  const r = {
68
68
  key: ae,
@@ -70,7 +70,7 @@ const Ke = ye(
70
70
  };
71
71
  N(r);
72
72
  }
73
- }, g = (e) => {
73
+ }, x = (e) => {
74
74
  if (e == null) return "";
75
75
  const r = Number(e);
76
76
  return isNaN(r) ? e : r?.toLocaleString("en-US", {
@@ -78,13 +78,13 @@ const Ke = ye(
78
78
  maximumFractionDigits: 2
79
79
  });
80
80
  }, $ = (e) => {
81
- const r = e.target.value, x = r === "" || r === null || r === void 0 ? 0 : Number(r);
82
- z(x, o);
81
+ const r = e.target.value, g = r === "" || r === null || r === void 0 ? 0 : Number(r);
82
+ z(g, o);
83
83
  const y = document.getElementById(d);
84
84
  if (y && y.setAttribute(
85
85
  "data-selected-value",
86
86
  JSON.stringify({
87
- value: x,
87
+ value: g,
88
88
  currency_code: o
89
89
  })
90
90
  ), y && (U || j)) {
@@ -93,7 +93,7 @@ const Ke = ye(
93
93
  detail: {
94
94
  selector: `#${d}`,
95
95
  value: {
96
- value: x,
96
+ value: g,
97
97
  currency_code: o
98
98
  },
99
99
  type: "change"
@@ -109,14 +109,14 @@ const Ke = ye(
109
109
  }), se?.();
110
110
  }, he = () => {
111
111
  const e = "pl-11 border h-8 text-sm block w-full p-2.5 font-inter font-medium focus:outline-none focus:ring-0";
112
- return i ? n(e, "rounded-md border-red-300 bg-white dark:bg-black-600", s) : p && c?.color ? n(e, `rounded-md border-${c.color}-300 bg-${c.color}-50`, "text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800", s) : be ? n(e, "rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]", s) : ue ? n(e, "rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]", s) : fe ? n(e, "rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]", s) : n(e, "rounded-lg border-gray-300 dark:border-black-600 bg-white dark:bg-black-600 text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400 focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]", s);
112
+ return i ? n(e, "rounded-md border-red-300 bg-white dark:bg-black-600 disabled:!text-neutral-400 dark:disabled:!text-neutral-500", s) : p && c?.color ? n(e, `rounded-md border-${c.color}-300 bg-${c.color}-50`, "text-neutral-900 dark:text-black-200 disabled:!text-neutral-400 dark:disabled:!text-neutral-500 disabled:bg-neutral-50 dark:disabled:!bg-black-800", s) : be ? n(e, "rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]", s) : me ? n(e, "rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]", s) : fe ? n(e, "rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]", s) : n(e, "rounded-lg border-gray-300 dark:border-black-600 bg-white dark:bg-black-600 text-neutral-900 dark:text-black-200 disabled:!text-neutral-400 dark:disabled:!text-neutral-500 disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400 focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]", s);
113
113
  };
114
114
  return k(() => {
115
- m && Y(m);
116
- }, [m]), k(() => {
115
+ u && Y(u);
116
+ }, [u]), k(() => {
117
117
  if (o) {
118
118
  const e = a === "" || a === null || a === void 0 ? 0 : Number(a);
119
- m !== o && z(e, o);
119
+ u !== o && z(e, o);
120
120
  const r = document.getElementById(d);
121
121
  if (r && (r.setAttribute(
122
122
  "data-selected-value",
@@ -125,7 +125,7 @@ const Ke = ye(
125
125
  currency_code: o
126
126
  })
127
127
  ), U || j)) {
128
- const x = new CustomEvent("pilot-change", {
128
+ const g = new CustomEvent("pilot-change", {
129
129
  bubbles: !0,
130
130
  detail: {
131
131
  selector: `#${d}`,
@@ -136,7 +136,7 @@ const Ke = ye(
136
136
  type: "change"
137
137
  }
138
138
  });
139
- r.dispatchEvent(x);
139
+ r.dispatchEvent(g);
140
140
  }
141
141
  }
142
142
  }, [o]), k(() => {
@@ -155,7 +155,7 @@ const Ke = ye(
155
155
  ),
156
156
  key: r.value
157
157
  }));
158
- ge(e);
158
+ xe(e);
159
159
  }, [B, o]), k(() => {
160
160
  R("");
161
161
  }, [o]), ee ? /* @__PURE__ */ l(
@@ -170,16 +170,16 @@ const Ke = ye(
170
170
  {
171
171
  ...K,
172
172
  ref: J,
173
- type: u ? "number" : "text",
173
+ type: m ? "number" : "text",
174
174
  required: S,
175
175
  className: n(s, "pl-8 h-8"),
176
176
  onChange: $,
177
177
  min: 0,
178
178
  onFocus: q,
179
179
  onBlur: Q,
180
- value: u ? a : g(a),
180
+ value: m ? a : x(a),
181
181
  ...b && !a ? {
182
- defaultValue: u ? b : g(b)
182
+ defaultValue: m ? b : x(b)
183
183
  } : {},
184
184
  id: d || F,
185
185
  autoFocus: W
@@ -261,9 +261,9 @@ const Ke = ye(
261
261
  {
262
262
  id: "btn-currency-input-add-to-document",
263
263
  className: "cursor-pointer",
264
- onClick: () => xe(g(a)),
264
+ onClick: () => ge(x(a)),
265
265
  type: "button",
266
- children: /* @__PURE__ */ t(ke, { placement: "top", title: me("Add to document"), children: /* @__PURE__ */ t(
266
+ children: /* @__PURE__ */ t(ke, { placement: "top", title: ue("Add to document"), children: /* @__PURE__ */ t(
267
267
  Be,
268
268
  {
269
269
  className: "text-primary-600",
@@ -286,7 +286,7 @@ const Ke = ye(
286
286
  ...K,
287
287
  ref: J,
288
288
  placeholder: le,
289
- type: u ? "number" : "text",
289
+ type: m ? "number" : "text",
290
290
  required: S,
291
291
  disabled: ne,
292
292
  className: he(),
@@ -294,8 +294,8 @@ const Ke = ye(
294
294
  min: 0,
295
295
  onFocus: q,
296
296
  onBlur: Q,
297
- value: u ? a : g(a),
298
- defaultValue: u ? b : g(b),
297
+ value: m ? a : x(a),
298
+ defaultValue: m ? b : x(b),
299
299
  id: d || F,
300
300
  style: ce,
301
301
  autoComplete: "off",
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyInputField.es.js","sources":["../../../../src/components/forms/currency-input/CurrencyInputField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport { forwardRef, useEffect, useState } from \"react\";\nimport { Dropdown, Tooltip as AntTooltip } from \"antd\";\nimport { useTranslation } from 'react-i18next';\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { Label } from \"../../data-display/label/Label\";\nimport type { LabelType } from \"../../data-display/label/Label\";\nimport { CURRENCIES, CURRENCY_SYMBOLS } from \"./currency.constant\";\nimport { NoteAddOutlined, BoltOutlined } from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\nimport { SearchBar } from \"../search-bar/SearchBar\";\nimport { OptionButton } from \"../../buttons/option-button/OptionButton\";\nimport { getFlagComponent } from \"../../../utils/countryFlags\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport { formatCurrency as formatCurrencyUtils } from \"../../../utils/formatters\";\n\n/**\n * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\nexport type SourceMetaItem = {\n bbox: SourceMetaBBox;\n confidence_score?: number;\n is_primary?: boolean;\n match_score?: number;\n match_type?: string;\n page_height: number;\n page_width: number;\n source_page: number;\n source_text?: string;\n};\n\n/**\n * Risk details interface for risk analysis integration\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n hexBgColor?: string;\n hexBorderColor?: string;\n [key: string]: any;\n}\n\n/**\n * Risk details card component props - generic to allow consumer-specific risk types\n */\nexport interface RiskDetailsCardProps<T = any> {\n riskDetails: T;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/**\n * Props for the CurrencyInputField component\n */\nexport interface CurrencyInputFieldProps {\n /** Unique identifier for the currency input */\n id: string;\n /** Label text to display above the input */\n label?: string;\n /** Current value of the input (string for compatibility) */\n value: string;\n /** Callback function called when value changes */\n onChange: (data: any, currencyCode?: string) => void;\n /** Error message to display below the input */\n errorMessage?: string;\n /** Default value for the input */\n defaultValue?: string;\n /** Whether the field is required */\n required?: boolean;\n /** Whether the required indicator shows as conditional (yellow instead of red) */\n isRequiredConditional?: boolean;\n /** Tags/labels to display next to the label */\n tags?: (string | LabelType)[];\n /** Additional CSS classes for the wrapper */\n className?: string;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Whether to use simple mode (inline label style) */\n simpleMode?: boolean;\n /** Additional CSS classes for the input field */\n inputFieldClassName?: string;\n /** Whether the value was AI extracted */\n isAiExtracted?: boolean;\n /** Confidence percentage shown as a badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence badge */\n confidenceTooltip?: React.ReactNode;\n /** Source meta for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler fired when confidence score badge is clicked */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Whether this is a GTN (Global Term Name) field */\n isGTN?: boolean;\n /** GTN field name for document integration */\n gtnName?: any;\n /** Whether to allow multi-currency selection with dropdown */\n allowMultiCurrency?: boolean;\n /** Placeholder text for the input */\n placeholder?: string;\n /** Whether the input is disabled */\n disabled?: boolean;\n /** Current currency code */\n currencyCode?: string;\n /** Inline styles for the input element */\n inputStyle?: React.CSSProperties;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Callback function called when input loses focus */\n onBlur?: () => void;\n /** Whether the input should auto-focus */\n autoFocus?: boolean;\n /** Whether recording is active (for pilot context) */\n isRecording?: boolean;\n /** Whether playback is active (for pilot context) */\n isPlaying?: boolean;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Risk details data */\n riskDetails?: RiskDetails;\n /** Whether risk analysis is open */\n isRiskAnalysisOpen?: boolean;\n /** Custom risk details card component */\n RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Input surface style: `'modified'` — Warning colors; `'deleted'` — Error colors, text #475467; `'success'` — Success colors, text #101828. */\n inputEmphasis?: \"default\" | \"modified\" | \"deleted\" | \"success\";\n}\n\n/**\n * A highly customizable currency input component with label, validation, and styling support.\n * Features currency selection, formatting, validation, GTN integration, risk analysis support,\n * and comprehensive prop support for various use cases.\n *\n * @example\n * ```tsx\n * <CurrencyInputField\n * id=\"price\"\n * label=\"Price\"\n * value={price}\n * onChange={(value, currency) => setPrice(value)}\n * currencyCode=\"USD\"\n * allowMultiCurrency\n * required\n * />\n * ```\n */\nexport const CurrencyInputField = forwardRef<\n HTMLInputElement,\n CurrencyInputFieldProps\n>(\n (\n {\n id,\n label,\n value,\n onChange,\n errorMessage,\n defaultValue,\n required = false,\n isRequiredConditional = false,\n tags,\n className,\n originalCase = false,\n tooltip,\n simpleMode = false,\n inputFieldClassName = \"\",\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n isGTN = false,\n gtnName = null,\n allowMultiCurrency = false,\n placeholder,\n disabled = false,\n currencyCode = \"USD\",\n inputStyle,\n labelClassName,\n isLiveField = false,\n onBlur: onBlurProp,\n autoFocus = false,\n isRecording = false,\n isPlaying = false,\n onAddGTNToDocument,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n labelExtra,\n inputEmphasis = \"default\",\n ...props\n },\n ref\n ) => {\n const { t } = useTranslation();\n const emphasisModifiedSkin = inputEmphasis === \"modified\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisDeletedSkin = inputEmphasis === \"deleted\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisSuccessSkin = inputEmphasis === \"success\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const [isFocused, setIsFocused] = useState(false);\n const [filteredCurrencyOptions, setFilteredCurrencyOptions] = useState<\n { label: React.ReactNode; key: string }[]\n >([]);\n const [searchKeyForCurrency, setSearchKeyForCurrency] = useState(\"\");\n const [selectedCurrency, setSelectedCurrency] = useState<string>(\n currencyCode ? currencyCode : \"USD\"\n );\n const [isHovered, setIsHovered] = useState(false);\n\n const handleAddGTNToDocument = (_value: string) => {\n if (onAddGTNToDocument) {\n const keyValuePair = {\n key: gtnName,\n value: formatCurrencyUtils(_value, selectedCurrency),\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n const formatCurrency = (targetValue: any): string => {\n if (targetValue === null || targetValue === undefined) return \"\";\n\n const number = Number(targetValue);\n if (isNaN(number)) return targetValue;\n\n return number?.toLocaleString(\"en-US\", {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n });\n };\n\n const handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const _value = e.target.value;\n const numericValue =\n _value === \"\" || _value === null || _value === undefined\n ? 0\n : Number(_value);\n onChange(numericValue, selectedCurrency);\n const element = document.getElementById(id);\n if (element) {\n element.setAttribute(\n \"data-selected-value\",\n JSON.stringify({\n value: numericValue,\n currency_code: selectedCurrency,\n })\n );\n }\n if (element && (isRecording || isPlaying)) {\n const pilotEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${id}`,\n value: {\n value: numericValue,\n currency_code: selectedCurrency,\n },\n type: \"change\",\n },\n });\n element.dispatchEvent(pilotEvent);\n }\n };\n\n const onFocus = () => {\n setIsFocused(true);\n };\n\n const onBlur = () => {\n setIsFocused(false);\n if (value === null || value === undefined || value === \"\") {\n handleOnChange({\n target: { value: \"0.00\" },\n } as React.ChangeEvent<HTMLInputElement>);\n }\n onBlurProp?.();\n };\n\n const getClassName = (): string => {\n const baseClasses =\n \"pl-11 border h-8 text-sm block w-full p-2.5 font-inter font-medium focus:outline-none focus:ring-0\";\n\n if (errorMessage) {\n return cn(baseClasses, \"rounded-md border-red-300 bg-white dark:bg-black-600\", inputFieldClassName);\n }\n if (isRiskAnalysisOpen && riskDetails?.color) {\n return cn(baseClasses, `rounded-md border-${riskDetails.color}-300 bg-${riskDetails.color}-50`, \"text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800\", inputFieldClassName);\n }\n if (emphasisDeletedSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]\", inputFieldClassName);\n }\n if (emphasisModifiedSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]\", inputFieldClassName);\n }\n if (emphasisSuccessSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]\", inputFieldClassName);\n }\n return cn(baseClasses, \"rounded-lg border-gray-300 dark:border-black-600 bg-white dark:bg-black-600 text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400 focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]\", inputFieldClassName);\n };\n\n useEffect(() => {\n if (currencyCode) {\n setSelectedCurrency(currencyCode);\n }\n }, [currencyCode]);\n\n useEffect(() => {\n if (selectedCurrency) {\n const numericValue =\n value === \"\" || value === null || value === undefined\n ? 0\n : Number(value);\n if (currencyCode !== selectedCurrency) {\n onChange(numericValue, selectedCurrency);\n }\n const element = document.getElementById(id);\n if (element) {\n element.setAttribute(\n \"data-selected-value\",\n JSON.stringify({\n value: numericValue,\n currency_code: selectedCurrency,\n })\n );\n if (isRecording || isPlaying) {\n const pilotEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${id}`,\n value: {\n value: numericValue,\n currency_code: selectedCurrency,\n },\n type: \"change\",\n },\n });\n element.dispatchEvent(pilotEvent);\n }\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedCurrency]);\n\n useEffect(() => {\n const currencyOptions = CURRENCIES.filter((item) =>\n (item.value + \" - \" + item.label)\n .toLowerCase()\n .includes(searchKeyForCurrency.toLowerCase())\n ).map((item) => ({\n label: (\n <OptionButton\n text={`${item.value} - ${item.label}`}\n icon={getFlagComponent(item.value)}\n showTick={selectedCurrency === item.value}\n onClick={() => setSelectedCurrency(item.value)}\n className=\"text-black-900 dark:text-white\"\n />\n ),\n key: item.value,\n }));\n\n setFilteredCurrencyOptions(currencyOptions);\n }, [searchKeyForCurrency, selectedCurrency]);\n\n useEffect(() => {\n setSearchKeyForCurrency(\"\");\n }, [selectedCurrency]);\n\n // Simple mode rendering\n if (simpleMode) {\n return (\n <label\n id={id}\n className={`mb-1 text-xs font-medium text-gray-600 h-full inline-flex items-center gap-1 ${\n !originalCase ? \"capitalize\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <span className=\"absolute inset-y-0 left-1 top-0.5 z-10 flex items-center pl-3 cursor-text select-all\">\n {\"$\"}\n </span>\n <input\n {...props}\n ref={ref}\n type={isFocused ? \"number\" : \"text\"}\n required={required}\n className={cn(inputFieldClassName, \"pl-8 h-8\")}\n onChange={handleOnChange}\n min={0}\n onFocus={onFocus}\n onBlur={onBlur}\n value={!isFocused ? formatCurrency(value) : value}\n {...(defaultValue && !value\n ? {\n defaultValue: !isFocused\n ? formatCurrency(defaultValue)\n : defaultValue,\n }\n : {})}\n id={id || label}\n autoFocus={autoFocus}\n />\n </label>\n );\n }\n\n // Full mode rendering\n return (\n <div\n className={cn(\n \"flex gap-0.5 relative\",\n isHovered && isGTN\n ? \"border rounded-lg border-primary-100 bg-primary-50 p-1\"\n : \"\"\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {isGTN && !isHovered ? (\n <div className=\"size-1 bg-primary-600 rounded-full animate-blink mt-1.5\" />\n ) : null}\n <div className={cn(\"w-full flex flex-col\", className)}>\n <label\n htmlFor=\"text\"\n className={`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${\n !originalCase ? \"uppercase\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1\">\n <div className=\"inline-flex min-w-0 items-center gap-1 flex-wrap\">\n <InputLabel label={label || \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n {isLiveField && (\n <BoltOutlined\n sx={{\n fontSize: 16,\n color: \"var(--color-primary-600)\",\n rotate: \"15deg\",\n }}\n />\n )}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags} />\n {tooltip && (\n <Tooltip placement=\"top\" title={tooltip}>\n <div className=\"cursor-pointer\">\n <HelpIcon className=\"w-icon-sm h-icon-sm\" />\n </div>\n </Tooltip>\n )}\n {labelExtra}\n </div>\n <div className=\"flex items-center gap-1 justify-self-end\">\n {(shouldShowConfidenceScore(confidenceScore) && confidenceType) ? (\n <Tooltip\n placement=\"top-end\"\n title={confidenceTooltip ?? \"\"}\n hideTooltip={confidenceTooltip === undefined || confidenceTooltip === null}\n className=\"cursor-pointer\"\n >\n <div\n className={cn(\n \"inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5\",\n getConfidenceScoreBadgeClass(confidenceType)\n )}\n onClick={() => onConfidenceScoreClick?.(sourceMeta)}\n >\n <AIStarIcon\n size={12}\n fill={getConfidenceScoreBadgeColor(confidenceType)}\n fillSecondary={getConfidenceScoreBadgeFill(confidenceType)}\n />\n <span className={cn(\"text-xs font-medium leading-4\", getConfidenceScoreBadgeTextColor(confidenceType))}>\n {confidenceScore}%\n </span>\n </div>\n </Tooltip>\n ) : null}\n {isGTN && isHovered && onAddGTNToDocument ? (\n <button\n id=\"btn-currency-input-add-to-document\"\n className=\"cursor-pointer\"\n onClick={() => handleAddGTNToDocument(formatCurrency(value))}\n type=\"button\"\n >\n <AntTooltip placement=\"top\" title={t(\"Add to document\")}>\n <NoteAddOutlined\n className=\"text-primary-600\"\n sx={{\n fontSize: 16\n }}\n />\n </AntTooltip>\n </button>\n ) : null}\n </div>\n </div>\n </label>\n <label className=\"relative block\">\n <span className=\"absolute inset-y-0 left-1 z-1 flex items-center pl-3 text-neutral-900 dark:text-white cursor-text select-all\">\n {CURRENCY_SYMBOLS[selectedCurrency]}\n </span>\n\n <input\n {...props}\n ref={ref}\n placeholder={placeholder}\n type={isFocused ? \"number\" : \"text\"}\n required={required}\n disabled={disabled}\n className={getClassName()}\n onChange={handleOnChange}\n min={0}\n onFocus={onFocus}\n onBlur={onBlur}\n value={!isFocused ? formatCurrency(value) : value}\n defaultValue={\n !isFocused ? formatCurrency(defaultValue) : defaultValue\n }\n id={id || label}\n style={inputStyle}\n autoComplete=\"off\"\n autoFocus={autoFocus}\n />\n <span\n className={`absolute inset-y-0 right-2 flex items-center h-full cursor-pointer dark:text-black-200 ${\n allowMultiCurrency ? \"cursor-pointer\" : \"\"\n }`}\n >\n {allowMultiCurrency ? (\n <Dropdown\n menu={{\n items: [\n ...filteredCurrencyOptions,\n ],\n }}\n trigger={[\"click\"]}\n overlayClassName=\"row-option-cell\"\n placement=\"bottomRight\"\n overlayStyle={{ zIndex: 999 }}\n getPopupContainer={() => document.body}\n popupRender={(menu) => (\n <div\n className=\"[&>*:nth-child(2)]:!shadow-none [&>*:nth-child(2)>*]:!px-2 flex flex-col gap-2 p-2 bg-white dark:bg-black-700 border border-solid border-neutral-200 dark:border-black-600 max-h-[200px] w-[330px] text-ellipsis overflow-y-auto z-[999] rounded-md\"\n >\n <SearchBar\n id={`search-bar-currency-input`}\n value={searchKeyForCurrency}\n onChange={(_value) =>\n setSearchKeyForCurrency(_value)\n }\n className=\"mb-2\"\n />\n {menu}\n </div>\n )}\n >\n <div className=\"pl-4 pr-2 py-1.5 text-sm text-gray-700 dark:text-black-200 flex items-center gap-1\">\n {getFlagComponent(selectedCurrency)} {selectedCurrency}\n </div>\n </Dropdown>\n ) : (\n selectedCurrency\n )}\n </span>\n </label>\n {errorMessage && (\n <Typography\n className=\"text-error-500 mt-1\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {errorMessage}\n </Typography>\n )}\n </div>\n {isHovered &&\n riskDetails &&\n isRiskAnalysisOpen &&\n RiskDetailsCard && (\n <div\n role=\"tooltip\"\n tabIndex={0}\n className=\"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl\"\n onClick={(e) => e.stopPropagation()}\n onMouseDown={(e) => e.preventDefault()}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n setIsHovered(false);\n }\n }}\n >\n <RiskDetailsCard riskDetails={riskDetails} />\n </div>\n )}\n </div>\n );\n }\n);\n\nCurrencyInputField.displayName = \"CurrencyInputField\";\n"],"names":["CurrencyInputField","forwardRef","id","label","value","onChange","errorMessage","defaultValue","required","isRequiredConditional","tags","className","originalCase","tooltip","simpleMode","inputFieldClassName","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","isGTN","gtnName","allowMultiCurrency","placeholder","disabled","currencyCode","inputStyle","labelClassName","isLiveField","onBlurProp","autoFocus","isRecording","isPlaying","onAddGTNToDocument","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","labelExtra","inputEmphasis","props","ref","t","useTranslation","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","isFocused","setIsFocused","useState","filteredCurrencyOptions","setFilteredCurrencyOptions","searchKeyForCurrency","setSearchKeyForCurrency","selectedCurrency","setSelectedCurrency","isHovered","setIsHovered","handleAddGTNToDocument","_value","keyValuePair","formatCurrencyUtils","formatCurrency","targetValue","number","handleOnChange","numericValue","element","pilotEvent","onFocus","onBlur","getClassName","baseClasses","cn","useEffect","currencyOptions","CURRENCIES","item","jsx","OptionButton","getFlagComponent","jsxs","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","Tooltip","HelpIcon","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","AntTooltip","Note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AAAA,cACV,WAAU;AAAA,cACV,SAAS,CAAC,MAAM,EAAE,gBAAA;AAAA,cAClB,aAAa,CAAC,MAAM,EAAE,eAAA;AAAA,cACtB,WAAW,CAAC,MAAM;AAChB,gBAAI,EAAE,QAAQ,YACZrB,EAAa,EAAK;AAAA,cAEtB;AAAA,cAEA,UAAA,gBAAAqB,EAACzC,KAAgB,aAAAF,EAAA,CAA0B;AAAA,YAAA;AAAA,UAAA;AAAA,QAC7C;AAAA,MAAA;AAAA,IAAA;AAAA,EAIV;AACF;AAEApC,GAAmB,cAAc;"}
1
+ {"version":3,"file":"CurrencyInputField.es.js","sources":["../../../../src/components/forms/currency-input/CurrencyInputField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport { forwardRef, useEffect, useState } from \"react\";\nimport { Dropdown, Tooltip as AntTooltip } from \"antd\";\nimport { useTranslation } from 'react-i18next';\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { Label } from \"../../data-display/label/Label\";\nimport type { LabelType } from \"../../data-display/label/Label\";\nimport { CURRENCIES, CURRENCY_SYMBOLS } from \"./currency.constant\";\nimport { NoteAddOutlined, BoltOutlined } from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\nimport { SearchBar } from \"../search-bar/SearchBar\";\nimport { OptionButton } from \"../../buttons/option-button/OptionButton\";\nimport { getFlagComponent } from \"../../../utils/countryFlags\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport { formatCurrency as formatCurrencyUtils } from \"../../../utils/formatters\";\n\n/**\n * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\nexport type SourceMetaItem = {\n bbox: SourceMetaBBox;\n confidence_score?: number;\n is_primary?: boolean;\n match_score?: number;\n match_type?: string;\n page_height: number;\n page_width: number;\n source_page: number;\n source_text?: string;\n};\n\n/**\n * Risk details interface for risk analysis integration\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n hexBgColor?: string;\n hexBorderColor?: string;\n [key: string]: any;\n}\n\n/**\n * Risk details card component props - generic to allow consumer-specific risk types\n */\nexport interface RiskDetailsCardProps<T = any> {\n riskDetails: T;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/**\n * Props for the CurrencyInputField component\n */\nexport interface CurrencyInputFieldProps {\n /** Unique identifier for the currency input */\n id: string;\n /** Label text to display above the input */\n label?: string;\n /** Current value of the input (string for compatibility) */\n value: string;\n /** Callback function called when value changes */\n onChange: (data: any, currencyCode?: string) => void;\n /** Error message to display below the input */\n errorMessage?: string;\n /** Default value for the input */\n defaultValue?: string;\n /** Whether the field is required */\n required?: boolean;\n /** Whether the required indicator shows as conditional (yellow instead of red) */\n isRequiredConditional?: boolean;\n /** Tags/labels to display next to the label */\n tags?: (string | LabelType)[];\n /** Additional CSS classes for the wrapper */\n className?: string;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Whether to use simple mode (inline label style) */\n simpleMode?: boolean;\n /** Additional CSS classes for the input field */\n inputFieldClassName?: string;\n /** Whether the value was AI extracted */\n isAiExtracted?: boolean;\n /** Confidence percentage shown as a badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence badge */\n confidenceTooltip?: React.ReactNode;\n /** Source meta for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler fired when confidence score badge is clicked */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Whether this is a GTN (Global Term Name) field */\n isGTN?: boolean;\n /** GTN field name for document integration */\n gtnName?: any;\n /** Whether to allow multi-currency selection with dropdown */\n allowMultiCurrency?: boolean;\n /** Placeholder text for the input */\n placeholder?: string;\n /** Whether the input is disabled */\n disabled?: boolean;\n /** Current currency code */\n currencyCode?: string;\n /** Inline styles for the input element */\n inputStyle?: React.CSSProperties;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Callback function called when input loses focus */\n onBlur?: () => void;\n /** Whether the input should auto-focus */\n autoFocus?: boolean;\n /** Whether recording is active (for pilot context) */\n isRecording?: boolean;\n /** Whether playback is active (for pilot context) */\n isPlaying?: boolean;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Risk details data */\n riskDetails?: RiskDetails;\n /** Whether risk analysis is open */\n isRiskAnalysisOpen?: boolean;\n /** Custom risk details card component */\n RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Input surface style: `'modified'` — Warning colors; `'deleted'` — Error colors, text #475467; `'success'` — Success colors, text #101828. */\n inputEmphasis?: \"default\" | \"modified\" | \"deleted\" | \"success\";\n}\n\n/**\n * A highly customizable currency input component with label, validation, and styling support.\n * Features currency selection, formatting, validation, GTN integration, risk analysis support,\n * and comprehensive prop support for various use cases.\n *\n * @example\n * ```tsx\n * <CurrencyInputField\n * id=\"price\"\n * label=\"Price\"\n * value={price}\n * onChange={(value, currency) => setPrice(value)}\n * currencyCode=\"USD\"\n * allowMultiCurrency\n * required\n * />\n * ```\n */\nexport const CurrencyInputField = forwardRef<\n HTMLInputElement,\n CurrencyInputFieldProps\n>(\n (\n {\n id,\n label,\n value,\n onChange,\n errorMessage,\n defaultValue,\n required = false,\n isRequiredConditional = false,\n tags,\n className,\n originalCase = false,\n tooltip,\n simpleMode = false,\n inputFieldClassName = \"\",\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n isGTN = false,\n gtnName = null,\n allowMultiCurrency = false,\n placeholder,\n disabled = false,\n currencyCode = \"USD\",\n inputStyle,\n labelClassName,\n isLiveField = false,\n onBlur: onBlurProp,\n autoFocus = false,\n isRecording = false,\n isPlaying = false,\n onAddGTNToDocument,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n labelExtra,\n inputEmphasis = \"default\",\n ...props\n },\n ref\n ) => {\n const { t } = useTranslation();\n const emphasisModifiedSkin = inputEmphasis === \"modified\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisDeletedSkin = inputEmphasis === \"deleted\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisSuccessSkin = inputEmphasis === \"success\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const [isFocused, setIsFocused] = useState(false);\n const [filteredCurrencyOptions, setFilteredCurrencyOptions] = useState<\n { label: React.ReactNode; key: string }[]\n >([]);\n const [searchKeyForCurrency, setSearchKeyForCurrency] = useState(\"\");\n const [selectedCurrency, setSelectedCurrency] = useState<string>(\n currencyCode ? currencyCode : \"USD\"\n );\n const [isHovered, setIsHovered] = useState(false);\n\n const handleAddGTNToDocument = (_value: string) => {\n if (onAddGTNToDocument) {\n const keyValuePair = {\n key: gtnName,\n value: formatCurrencyUtils(_value, selectedCurrency),\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n const formatCurrency = (targetValue: any): string => {\n if (targetValue === null || targetValue === undefined) return \"\";\n\n const number = Number(targetValue);\n if (isNaN(number)) return targetValue;\n\n return number?.toLocaleString(\"en-US\", {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n });\n };\n\n const handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const _value = e.target.value;\n const numericValue =\n _value === \"\" || _value === null || _value === undefined\n ? 0\n : Number(_value);\n onChange(numericValue, selectedCurrency);\n const element = document.getElementById(id);\n if (element) {\n element.setAttribute(\n \"data-selected-value\",\n JSON.stringify({\n value: numericValue,\n currency_code: selectedCurrency,\n })\n );\n }\n if (element && (isRecording || isPlaying)) {\n const pilotEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${id}`,\n value: {\n value: numericValue,\n currency_code: selectedCurrency,\n },\n type: \"change\",\n },\n });\n element.dispatchEvent(pilotEvent);\n }\n };\n\n const onFocus = () => {\n setIsFocused(true);\n };\n\n const onBlur = () => {\n setIsFocused(false);\n if (value === null || value === undefined || value === \"\") {\n handleOnChange({\n target: { value: \"0.00\" },\n } as React.ChangeEvent<HTMLInputElement>);\n }\n onBlurProp?.();\n };\n\n const getClassName = (): string => {\n const baseClasses =\n \"pl-11 border h-8 text-sm block w-full p-2.5 font-inter font-medium focus:outline-none focus:ring-0\";\n\n if (errorMessage) {\n return cn(baseClasses, \"rounded-md border-red-300 bg-white dark:bg-black-600 disabled:!text-neutral-400 dark:disabled:!text-neutral-500\", inputFieldClassName);\n }\n if (isRiskAnalysisOpen && riskDetails?.color) {\n return cn(baseClasses, `rounded-md border-${riskDetails.color}-300 bg-${riskDetails.color}-50`, \"text-neutral-900 dark:text-black-200 disabled:!text-neutral-400 dark:disabled:!text-neutral-500 disabled:bg-neutral-50 dark:disabled:!bg-black-800\", inputFieldClassName);\n }\n if (emphasisDeletedSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]\", inputFieldClassName);\n }\n if (emphasisModifiedSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]\", inputFieldClassName);\n }\n if (emphasisSuccessSkin) {\n return cn(baseClasses, \"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]\", inputFieldClassName);\n }\n return cn(baseClasses, \"rounded-lg border-gray-300 dark:border-black-600 bg-white dark:bg-black-600 text-neutral-900 dark:text-black-200 disabled:!text-neutral-400 dark:disabled:!text-neutral-500 disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400 focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]\", inputFieldClassName);\n };\n\n useEffect(() => {\n if (currencyCode) {\n setSelectedCurrency(currencyCode);\n }\n }, [currencyCode]);\n\n useEffect(() => {\n if (selectedCurrency) {\n const numericValue =\n value === \"\" || value === null || value === undefined\n ? 0\n : Number(value);\n if (currencyCode !== selectedCurrency) {\n onChange(numericValue, selectedCurrency);\n }\n const element = document.getElementById(id);\n if (element) {\n element.setAttribute(\n \"data-selected-value\",\n JSON.stringify({\n value: numericValue,\n currency_code: selectedCurrency,\n })\n );\n if (isRecording || isPlaying) {\n const pilotEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${id}`,\n value: {\n value: numericValue,\n currency_code: selectedCurrency,\n },\n type: \"change\",\n },\n });\n element.dispatchEvent(pilotEvent);\n }\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedCurrency]);\n\n useEffect(() => {\n const currencyOptions = CURRENCIES.filter((item) =>\n (item.value + \" - \" + item.label)\n .toLowerCase()\n .includes(searchKeyForCurrency.toLowerCase())\n ).map((item) => ({\n label: (\n <OptionButton\n text={`${item.value} - ${item.label}`}\n icon={getFlagComponent(item.value)}\n showTick={selectedCurrency === item.value}\n onClick={() => setSelectedCurrency(item.value)}\n className=\"text-black-900 dark:text-white\"\n />\n ),\n key: item.value,\n }));\n\n setFilteredCurrencyOptions(currencyOptions);\n }, [searchKeyForCurrency, selectedCurrency]);\n\n useEffect(() => {\n setSearchKeyForCurrency(\"\");\n }, [selectedCurrency]);\n\n // Simple mode rendering\n if (simpleMode) {\n return (\n <label\n id={id}\n className={`mb-1 text-xs font-medium text-gray-600 h-full inline-flex items-center gap-1 ${\n !originalCase ? \"capitalize\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <span className=\"absolute inset-y-0 left-1 top-0.5 z-10 flex items-center pl-3 cursor-text select-all\">\n {\"$\"}\n </span>\n <input\n {...props}\n ref={ref}\n type={isFocused ? \"number\" : \"text\"}\n required={required}\n className={cn(inputFieldClassName, \"pl-8 h-8\")}\n onChange={handleOnChange}\n min={0}\n onFocus={onFocus}\n onBlur={onBlur}\n value={!isFocused ? formatCurrency(value) : value}\n {...(defaultValue && !value\n ? {\n defaultValue: !isFocused\n ? formatCurrency(defaultValue)\n : defaultValue,\n }\n : {})}\n id={id || label}\n autoFocus={autoFocus}\n />\n </label>\n );\n }\n\n // Full mode rendering\n return (\n <div\n className={cn(\n \"flex gap-0.5 relative\",\n isHovered && isGTN\n ? \"border rounded-lg border-primary-100 bg-primary-50 p-1\"\n : \"\"\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {isGTN && !isHovered ? (\n <div className=\"size-1 bg-primary-600 rounded-full animate-blink mt-1.5\" />\n ) : null}\n <div className={cn(\"w-full flex flex-col\", className)}>\n <label\n htmlFor=\"text\"\n className={`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${\n !originalCase ? \"uppercase\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1\">\n <div className=\"inline-flex min-w-0 items-center gap-1 flex-wrap\">\n <InputLabel label={label || \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n {isLiveField && (\n <BoltOutlined\n sx={{\n fontSize: 16,\n color: \"var(--color-primary-600)\",\n rotate: \"15deg\",\n }}\n />\n )}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags} />\n {tooltip && (\n <Tooltip placement=\"top\" title={tooltip}>\n <div className=\"cursor-pointer\">\n <HelpIcon className=\"w-icon-sm h-icon-sm\" />\n </div>\n </Tooltip>\n )}\n {labelExtra}\n </div>\n <div className=\"flex items-center gap-1 justify-self-end\">\n {(shouldShowConfidenceScore(confidenceScore) && confidenceType) ? (\n <Tooltip\n placement=\"top-end\"\n title={confidenceTooltip ?? \"\"}\n hideTooltip={confidenceTooltip === undefined || confidenceTooltip === null}\n className=\"cursor-pointer\"\n >\n <div\n className={cn(\n \"inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5\",\n getConfidenceScoreBadgeClass(confidenceType)\n )}\n onClick={() => onConfidenceScoreClick?.(sourceMeta)}\n >\n <AIStarIcon\n size={12}\n fill={getConfidenceScoreBadgeColor(confidenceType)}\n fillSecondary={getConfidenceScoreBadgeFill(confidenceType)}\n />\n <span className={cn(\"text-xs font-medium leading-4\", getConfidenceScoreBadgeTextColor(confidenceType))}>\n {confidenceScore}%\n </span>\n </div>\n </Tooltip>\n ) : null}\n {isGTN && isHovered && onAddGTNToDocument ? (\n <button\n id=\"btn-currency-input-add-to-document\"\n className=\"cursor-pointer\"\n onClick={() => handleAddGTNToDocument(formatCurrency(value))}\n type=\"button\"\n >\n <AntTooltip placement=\"top\" title={t(\"Add to document\")}>\n <NoteAddOutlined\n className=\"text-primary-600\"\n sx={{\n fontSize: 16\n }}\n />\n </AntTooltip>\n </button>\n ) : null}\n </div>\n </div>\n </label>\n <label className=\"relative block\">\n <span className=\"absolute inset-y-0 left-1 z-1 flex items-center pl-3 text-neutral-900 dark:text-white cursor-text select-all\">\n {CURRENCY_SYMBOLS[selectedCurrency]}\n </span>\n\n <input\n {...props}\n ref={ref}\n placeholder={placeholder}\n type={isFocused ? \"number\" : \"text\"}\n required={required}\n disabled={disabled}\n className={getClassName()}\n onChange={handleOnChange}\n min={0}\n onFocus={onFocus}\n onBlur={onBlur}\n value={!isFocused ? formatCurrency(value) : value}\n defaultValue={\n !isFocused ? formatCurrency(defaultValue) : defaultValue\n }\n id={id || label}\n style={inputStyle}\n autoComplete=\"off\"\n autoFocus={autoFocus}\n />\n <span\n className={`absolute inset-y-0 right-2 flex items-center h-full cursor-pointer dark:text-black-200 ${\n allowMultiCurrency ? \"cursor-pointer\" : \"\"\n }`}\n >\n {allowMultiCurrency ? (\n <Dropdown\n menu={{\n items: [\n ...filteredCurrencyOptions,\n ],\n }}\n trigger={[\"click\"]}\n overlayClassName=\"row-option-cell\"\n placement=\"bottomRight\"\n overlayStyle={{ zIndex: 999 }}\n getPopupContainer={() => document.body}\n popupRender={(menu) => (\n <div\n className=\"[&>*:nth-child(2)]:!shadow-none [&>*:nth-child(2)>*]:!px-2 flex flex-col gap-2 p-2 bg-white dark:bg-black-700 border border-solid border-neutral-200 dark:border-black-600 max-h-[200px] w-[330px] text-ellipsis overflow-y-auto z-[999] rounded-md\"\n >\n <SearchBar\n id={`search-bar-currency-input`}\n value={searchKeyForCurrency}\n onChange={(_value) =>\n setSearchKeyForCurrency(_value)\n }\n className=\"mb-2\"\n />\n {menu}\n </div>\n )}\n >\n <div className=\"pl-4 pr-2 py-1.5 text-sm text-gray-700 dark:text-black-200 flex items-center gap-1\">\n {getFlagComponent(selectedCurrency)} {selectedCurrency}\n </div>\n </Dropdown>\n ) : (\n selectedCurrency\n )}\n </span>\n </label>\n {errorMessage && (\n <Typography\n className=\"text-error-500 mt-1\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {errorMessage}\n </Typography>\n )}\n </div>\n {isHovered &&\n riskDetails &&\n isRiskAnalysisOpen &&\n RiskDetailsCard && (\n <div\n role=\"tooltip\"\n tabIndex={0}\n className=\"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl\"\n onClick={(e) => e.stopPropagation()}\n onMouseDown={(e) => e.preventDefault()}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n setIsHovered(false);\n }\n }}\n >\n <RiskDetailsCard riskDetails={riskDetails} />\n </div>\n )}\n </div>\n );\n }\n);\n\nCurrencyInputField.displayName = \"CurrencyInputField\";\n"],"names":["CurrencyInputField","forwardRef","id","label","value","onChange","errorMessage","defaultValue","required","isRequiredConditional","tags","className","originalCase","tooltip","simpleMode","inputFieldClassName","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","isGTN","gtnName","allowMultiCurrency","placeholder","disabled","currencyCode","inputStyle","labelClassName","isLiveField","onBlurProp","autoFocus","isRecording","isPlaying","onAddGTNToDocument","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","labelExtra","inputEmphasis","props","ref","t","useTranslation","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","isFocused","setIsFocused","useState","filteredCurrencyOptions","setFilteredCurrencyOptions","searchKeyForCurrency","setSearchKeyForCurrency","selectedCurrency","setSelectedCurrency","isHovered","setIsHovered","handleAddGTNToDocument","_value","keyValuePair","formatCurrencyUtils","formatCurrency","targetValue","number","handleOnChange","numericValue","element","pilotEvent","onFocus","onBlur","getClassName","baseClasses","cn","useEffect","currencyOptions","CURRENCIES","item","jsx","OptionButton","getFlagComponent","jsxs","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","Tooltip","HelpIcon","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","AntTooltip","NoteAddOutlined","CURRENCY_SYMBOLS","Dropdown","menu","SearchBar","Typography"],"mappings":";;;;;;;;;;;;;;;;;;;AA6KO,MAAMA,KAAqBC;AAAA,EAIhC,CACE;AAAA,IACE,IAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,uBAAAC,IAAwB;AAAA,IACxB,MAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,SAAAC;AAAA,IACA,YAAAC,KAAa;AAAA,IACb,qBAAAC,IAAsB;AAAA,IACtB,eAAAC,KAAgB;AAAA,IAChB,iBAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,mBAAAC;AAAA,IACA,YAAAC,KAAa,CAAA;AAAA,IACb,wBAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,SAAAC,KAAU;AAAA,IACV,oBAAAC,IAAqB;AAAA,IACrB,aAAAC;AAAA,IACA,UAAAC,KAAW;AAAA,IACX,cAAAC,IAAe;AAAA,IACf,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,aAAAC,KAAc;AAAA,IACd,QAAQC;AAAA,IACR,WAAAC,IAAY;AAAA,IACZ,aAAAC,IAAc;AAAA,IACd,WAAAC,IAAY;AAAA,IACZ,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,oBAAAC,IAAqB;AAAA,IACrB,iBAAAC;AAAA,IACA,YAAAC;AAAA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BAAAyE;AAAA,cAACsB;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,YAAW;AAAA,gBACX,MAAK;AAAA,gBACL,SAAQ;AAAA,gBAEP,UAAA/F;AAAA,cAAA;AAAA,YAAA;AAAA,UACH,GAEJ;AAAA,UACCmD,KACCrB,KACAC,KACAC,KACE,gBAAAyC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAU;AAAA,cACV,WAAU;AAAA,cACV,SAAS,CAAC,MAAM,EAAE,gBAAA;AAAA,cAClB,aAAa,CAAC,MAAM,EAAE,eAAA;AAAA,cACtB,WAAW,CAAC,MAAM;AAChB,gBAAI,EAAE,QAAQ,YACZrB,EAAa,EAAK;AAAA,cAEtB;AAAA,cAEA,UAAA,gBAAAqB,EAACzC,KAAgB,aAAAF,EAAA,CAA0B;AAAA,YAAA;AAAA,UAAA;AAAA,QAC7C;AAAA,MAAA;AAAA,IAAA;AAAA,EAIV;AACF;AAEApC,GAAmB,cAAc;"}
package/dist/index.d.ts CHANGED
@@ -259,7 +259,7 @@ export type { DesignSystemConfig, TabConfig, TableConfig, TableViewApi, MasterDa
259
259
  export { InfiniteTable } from "./components/data-display/infinite-table";
260
260
  export { TableContext } from "./components/data-display/infinite-table/context";
261
261
  export type { ITableContext } from "./components/data-display/infinite-table/context";
262
- export type { ITableProps, ICell, IColumn, ITableView, IMultiSelectConfig, TTableKey, TTableRow, TCheckboxUtilities, IMasterDataModalConfig, ICurrencyDropdownConfig, IPendingEdit, PendingEditsMap, ValidateAndSaveResult, THeaderInlineAction, } from "./components/data-display/infinite-table/types";
262
+ export type { ITableProps, ICell, IColumn, ITableView, IMultiSelectConfig, TTableKey, TTableRow, TCheckboxUtilities, IMasterDataModalConfig, ICurrencyDropdownConfig, ICellContextMenuConfig, ICellContextMenuItem, ICellContextMenuContext, ICellContextMenuTarget, ICellContextMenuState, IPendingEdit, PendingEditsMap, ValidateAndSaveResult, THeaderInlineAction, } from "./components/data-display/infinite-table/types";
263
263
  export { useCheckbox } from "./hooks/useCheckbox";
264
264
  export { default as UserCell } from "./components/data-display/infinite-table/body/cell/UserCell";
265
265
  export { Dropdown } from "./components/dropdown/Dropdown";
@@ -104,6 +104,7 @@ export type TableConfig = {
104
104
  renderColumnOptions?: (props: Record<string, unknown>) => ReactNode;
105
105
  renderCurrencyDropdown?: (props: Record<string, unknown>) => ReactNode;
106
106
  renderColumnContextOptions?: (props: Record<string, unknown>) => ReactNode;
107
+ renderCellContextMenu?: (props: Record<string, unknown>) => ReactNode;
107
108
  renderSapLabel?: () => ReactNode;
108
109
  renderKeyIcons?: (type: 'primary' | 'composite', color?: string) => ReactNode;
109
110
  getRowOptionsDropdownProps?: () => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lax-wp/design-system",
3
3
  "private": false,
4
- "version": "0.14.35",
4
+ "version": "0.14.37",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.es.js",