@temboplus/frontend-react-core 0.1.2 → 0.1.3-beta.1

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 (62) hide show
  1. package/dist/InfoCircleOutlined-B7d2aRfV.js +7 -0
  2. package/dist/InfoCircleOutlined-B7d2aRfV.js.map +1 -0
  3. package/dist/InfoCircleOutlined-DYs90hdV.js +7 -0
  4. package/dist/InfoCircleOutlined-DYs90hdV.js.map +1 -0
  5. package/dist/ZoomOutOutlined-BL6A5RSq.js +2 -0
  6. package/dist/ZoomOutOutlined-BL6A5RSq.js.map +1 -0
  7. package/dist/ZoomOutOutlined-BY_CCwq7.js +2 -0
  8. package/dist/ZoomOutOutlined-BY_CCwq7.js.map +1 -0
  9. package/dist/alerts/index.cjs.js +2 -0
  10. package/dist/alerts/index.cjs.js.map +1 -0
  11. package/dist/alerts/index.js +2 -0
  12. package/dist/alerts/index.js.map +1 -0
  13. package/dist/dialogs/index.cjs.js +2 -0
  14. package/dist/dialogs/index.cjs.js.map +1 -0
  15. package/dist/dialogs/index.js +2 -0
  16. package/dist/dialogs/index.js.map +1 -0
  17. package/dist/features/alerts/alert.d.ts +12 -0
  18. package/dist/features/alerts/index.d.ts +1 -0
  19. package/dist/features/dialogs/index.d.ts +1 -0
  20. package/dist/features/dialogs/modal-provider.d.ts +3 -0
  21. package/dist/features/dialogs/tembo-confirm.d.ts +63 -0
  22. package/dist/features/input-validation/account-name-validator.d.ts +13 -0
  23. package/dist/features/input-validation/account-number-validator.d.ts +13 -0
  24. package/dist/{antd-validators.d.ts → features/input-validation/amount-validator.d.ts} +1 -62
  25. package/dist/features/input-validation/index.d.ts +5 -0
  26. package/dist/features/input-validation/phone-number-validator.d.ts +25 -0
  27. package/dist/features/input-validation/swift-code-validator.d.ts +13 -0
  28. package/dist/features/notifications/index.d.ts +3 -0
  29. package/dist/features/notifications/tembo-notify.d.ts +124 -0
  30. package/dist/features/notifications/toast-config.d.ts +15 -0
  31. package/dist/features/notifications/toast-container.d.ts +9 -0
  32. package/dist/index.cjs.js +1 -1
  33. package/dist/index.cjs.js.map +1 -1
  34. package/dist/index.d.ts +1 -1
  35. package/dist/index.esm.js +1 -1
  36. package/dist/index.esm.js.map +1 -1
  37. package/dist/notifications/index.cjs.js +2 -0
  38. package/dist/notifications/index.cjs.js.map +1 -0
  39. package/dist/notifications/index.js +2 -0
  40. package/dist/notifications/index.js.map +1 -0
  41. package/dist/providers.d.ts +37 -0
  42. package/dist/tembo-notify-C-QGduBt.js +2 -0
  43. package/dist/tembo-notify-C-QGduBt.js.map +1 -0
  44. package/dist/tembo-notify-D-uOV3t0.js +2 -0
  45. package/dist/tembo-notify-D-uOV3t0.js.map +1 -0
  46. package/dist/theme/colors.d.ts +246 -0
  47. package/dist/theme/constants.d.ts +143 -0
  48. package/dist/theme/index.cjs.js +2 -0
  49. package/dist/theme/index.cjs.js.map +1 -0
  50. package/dist/theme/index.d.ts +3 -0
  51. package/dist/theme/index.js +2 -0
  52. package/dist/theme/index.js.map +1 -0
  53. package/dist/theme/theme-provider.d.ts +87 -0
  54. package/dist/theme-provider-D_oV1J_K.js +11 -0
  55. package/dist/theme-provider-D_oV1J_K.js.map +1 -0
  56. package/dist/theme-provider-Dqvy24OD.js +11 -0
  57. package/dist/theme-provider-Dqvy24OD.js.map +1 -0
  58. package/dist/validation/index.cjs.js +2 -0
  59. package/dist/validation/index.cjs.js.map +1 -0
  60. package/dist/validation/index.js +2 -0
  61. package/dist/validation/index.js.map +1 -0
  62. package/package.json +28 -5
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("../theme-provider-Dqvy24OD.js"),r=require("antd");require("lodash");var o=require("../InfoCircleOutlined-B7d2aRfV.js");require("react");const{Text:t}=r.Typography;exports.TemboAlert=({type:n="info",message:s,description:i,icon:c,showIcon:x=!0,style:l})=>{const{colors:a,constants:d}=e.useTemboTheme(),u=(e=>{switch(e){case"success":return{background:a.success.bg,border:a.success.main,iconColor:a.success.main,textColor:a.success.text};case"warning":return{background:a.warning.bg,border:a.warning.main,iconColor:a.warning.main,textColor:a.warning.text};case"error":return{background:a.error.bg,border:a.error.main,iconColor:a.error.main,textColor:a.error.text};default:return{background:a.info.bg,border:a.info.main,iconColor:a.info.main,textColor:a.info.text}}})(n),g=c||(r=>{switch(r){case"success":return e.jsxRuntimeExports.jsx(o.RefIcon$2,{});case"warning":return e.jsxRuntimeExports.jsx(o.RefIcon,{});case"error":return e.jsxRuntimeExports.jsx(o.RefIcon$3,{});default:return e.jsxRuntimeExports.jsx(o.RefIcon$1,{})}})(n),p=x?22:0;return e.jsxRuntimeExports.jsx("div",{style:Object.assign({width:"100%",padding:"12px 16px",backgroundColor:u.background,borderRadius:d.radius.sm,borderLeft:`3px solid ${u.border}`},l),children:e.jsxRuntimeExports.jsxs(r.Space,{direction:"vertical",size:s?6:0,style:{width:"100%"},children:[s&&e.jsxRuntimeExports.jsxs(r.Flex,{gap:8,align:"center",children:[x&&e.jsxRuntimeExports.jsx("div",{style:{color:u.iconColor,fontSize:14,lineHeight:1},children:g}),"string"==typeof s?e.jsxRuntimeExports.jsx(t,{strong:!0,style:{fontSize:13,color:u.textColor,lineHeight:1.4},children:s}):s]}),i&&e.jsxRuntimeExports.jsxs(r.Flex,{gap:8,align:"flex-start",children:[!s&&x&&e.jsxRuntimeExports.jsx("div",{style:{color:u.iconColor,fontSize:14,lineHeight:1,marginTop:1},children:g}),"string"==typeof i?e.jsxRuntimeExports.jsx(t,{style:{fontSize:12,color:a.text.secondary,lineHeight:1.5,paddingLeft:s&&x?p:0},children:i}):e.jsxRuntimeExports.jsx("div",{style:{fontSize:12,color:a.text.secondary,lineHeight:1.5,paddingLeft:s&&x?p:0},children:i})]})]})})};
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":["../../src/features/alerts/alert.tsx"],"sourcesContent":[null],"names":["Text","Typography","type","message","title","description","icon","showIcon","style","colors","constants","useTemboTheme","alertColors","alertType","background","success","bg","border","main","iconColor","textColor","text","warning","error","info","getAlertColors","alertIcon","_jsx","CheckCircleOutlined","ExclamationCircleOutlined","CloseCircleOutlined","InfoCircleOutlined","getDefaultIcon","iconWidth","Object","assign","width","padding","backgroundColor","borderRadius","radius","sm","borderLeft","_jsxs","Space","direction","size","children","Flex","gap","align","color","fontSize","lineHeight","strong","marginTop","secondary","paddingLeft"],"mappings":"oKAUA,MAAMA,KAAEA,GAASC,EAAAA,8BAaoC,EACjDC,OAAO,OACPC,QAASC,EACTC,cACAC,OACAC,YAAW,EACXC,YAEA,MAAMC,OAAEA,EAAMC,UAAEA,GAAcC,kBAkDxBC,EAhDiB,CAACC,IACpB,OAAQA,GACJ,IAAK,UACD,MAAO,CACHC,WAAYL,EAAOM,QAAQC,GAC3BC,OAAQR,EAAOM,QAAQG,KACvBC,UAAWV,EAAOM,QAAQG,KAC1BE,UAAWX,EAAOM,QAAQM,MAElC,IAAK,UACD,MAAO,CACHP,WAAYL,EAAOa,QAAQN,GAC3BC,OAAQR,EAAOa,QAAQJ,KACvBC,UAAWV,EAAOa,QAAQJ,KAC1BE,UAAWX,EAAOa,QAAQD,MAElC,IAAK,QACD,MAAO,CACHP,WAAYL,EAAOc,MAAMP,GACzBC,OAAQR,EAAOc,MAAML,KACrBC,UAAWV,EAAOc,MAAML,KACxBE,UAAWX,EAAOc,MAAMF,MAGhC,QACI,MAAO,CACHP,WAAYL,EAAOe,KAAKR,GACxBC,OAAQR,EAAOe,KAAKN,KACpBC,UAAWV,EAAOe,KAAKN,KACvBE,UAAWX,EAAOe,KAAKH,QAmBnBI,CAAevB,GAC7BwB,EAAYpB,GAfK,CAACO,IACpB,OAAQA,GACJ,IAAK,UACD,OAAOc,EAAAA,kBAAAA,IAACC,EAAAA,UAAmB,IAC/B,IAAK,UACD,OAAOD,EAAAA,kBAAAA,IAACE,EAAAA,QAAyB,IACrC,IAAK,QACD,OAAOF,EAAAA,kBAAAA,IAACG,EAAAA,UA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OY,KAAKmC,UACnBH,WAAY,IACZI,YAAarD,GAASG,EAAW0B,EAAY,GAChDc,SAEA1C"}
@@ -0,0 +1,2 @@
1
+ import{u as r,j as e}from"../theme-provider-D_oV1J_K.js";import{Typography as o,Space as n,Flex as t}from"antd";import"lodash";import{a as i,c as s,R as c,b as a}from"../InfoCircleOutlined-DYs90hdV.js";import"react";const{Text:l}=o,d=({type:o="info",message:d,description:g,icon:x,showIcon:u=!0,style:f})=>{const{colors:h,constants:m}=r(),p=(r=>{switch(r){case"success":return{background:h.success.bg,border:h.success.main,iconColor:h.success.main,textColor:h.success.text};case"warning":return{background:h.warning.bg,border:h.warning.main,iconColor:h.warning.main,textColor:h.warning.text};case"error":return{background:h.error.bg,border:h.error.main,iconColor:h.error.main,textColor:h.error.text};default:return{background:h.info.bg,border:h.info.main,iconColor:h.info.main,textColor:h.info.text}}})(o),b=x||(r=>{switch(r){case"success":return e.jsx(a,{});case"warning":return e.jsx(c,{});case"error":return e.jsx(s,{});default:return e.jsx(i,{})}})(o),j=u?22:0;return e.jsx("div",{style:Object.assign({width:"100%",padding:"12px 16px",backgroundColor:p.background,borderRadius:m.radius.sm,borderLeft:`3px solid ${p.border}`},f),children:e.jsxs(n,{direction:"vertical",size:d?6:0,style:{width:"100%"},children:[d&&e.jsxs(t,{gap:8,align:"center",children:[u&&e.jsx("div",{style:{color:p.iconColor,fontSize:14,lineHeight:1},children:b}),"string"==typeof d?e.jsx(l,{strong:!0,style:{fontSize:13,color:p.textColor,lineHeight:1.4},children:d}):d]}),g&&e.jsxs(t,{gap:8,align:"flex-start",children:[!d&&u&&e.jsx("div",{style:{color:p.iconColor,fontSize:14,lineHeight:1,marginTop:1},children:b}),"string"==typeof g?e.jsx(l,{style:{fontSize:12,color:h.text.secondary,lineHeight:1.5,paddingLeft:d&&u?j:0},children:g}):e.jsx("div",{style:{fontSize:12,color:h.text.secondary,lineHeight:1.5,paddingLeft:d&&u?j:0},children:g})]})]})})};export{d as TemboAlert};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/features/alerts/alert.tsx"],"sourcesContent":[null],"names":["Text","Typography","TemboAlert","type","message","title","description","icon","showIcon","style","colors","constants","useTemboTheme","alertColors","alertType","background","success","bg","border","main","iconColor","textColor","text","warning","error","info","getAlertColors","alertIcon","_jsx","CheckCircleOutlined","ExclamationCircleOutlined","CloseCircleOutlined","InfoCircleOutlined","getDefaultIcon","iconWidth","Object","assign","width","padding","backgroundColor","borderRadius","radius","sm","borderLeft","_jsxs","Space","direction","size","children","Flex","gap","align","color","fontSize","lineHeight","strong","marginTop","secondary","paddingLeft"],"mappings":"wNAUA,MAAMA,KAAEA,GAASC,EAaJC,EAAwC,EACjDC,OAAO,OACPC,QAASC,EACTC,cACAC,OACAC,YAAW,EACXC,YAEA,MAAMC,OAAEA,EAAMC,UAAEA,GAAcC,IAkDxBC,EAhDiB,CAACC,IACpB,OAAQA,GACJ,IAAK,UACD,MAAO,CACHC,WAAYL,EAAOM,QAAQC,GAC3BC,OAAQR,EAAOM,QAAQG,KACvBC,UAAWV,EAAOM,QAAQG,KAC1BE,UAAWX,EAAOM,QAAQM,MAElC,IAAK,UACD,MAAO,CACHP,WAAYL,EAAOa,QAAQN,GAC3BC,OAAQR,EAAOa,QAAQJ,KACvBC,UAAWV,EAAOa,QAAQJ,KAC1BE,UAAWX,EAAOa,QAAQD,MAElC,IAAK,QACD,MAAO,CACHP,WAAYL,EAAOc,MAAMP,GACzBC,OAAQR,EAAOc,MAAML,KACrBC,UAAWV,EAAOc,MAAML,KACxBE,UAAWX,EAAOc,MAAMF,MAGhC,QACI,MAAO,CACHP,WAAYL,EAAOe,KAAKR,GACxBC,OAAQR,EAAOe,KAAKN,KACpBC,UAAWV,EAAOe,KAAKN,KACvBE,UAAWX,EAAOe,KAAKH,QAmBnBI,CAAevB,GAC7BwB,EAAYpB,GAfK,CAACO,IACpB,OAAQA,GACJ,IAAK,UACD,OAAOc,EAA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AAOY,KAAKmC,UACnBH,WAAY,IACZI,YAAarD,GAASG,EAAW0B,EAAY,GAChDc,SAEA1C"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("../theme-provider-Dqvy24OD.js"),s=require("antd"),t=require("@ebay/nice-modal-react");require("lodash");var n=require("../InfoCircleOutlined-B7d2aRfV.js"),o=require("../ZoomOutOutlined-BY_CCwq7.js");function r(e){return e&&e.__esModule?e:{default:e}}require("react");var i=r(t);const c=i.default.create(n=>{var o,r,i;const c=t.useModal();return e.jsxRuntimeExports.jsx(s.Modal,{open:c.visible,title:n.title,onOk:async()=>{n.onOk&&await n.onOk(),c.resolve(!0),c.remove()},onCancel:()=>{n.onCancel&&n.onCancel(),c.resolve(!1),c.remove()},okText:null!==(o=n.okText)&&void 0!==o?o:"OK",cancelText:null!==(r=n.cancelText)&&void 0!==r?r:"Cancel",okButtonProps:{danger:n.okDanger,type:null!==(i=n.okType)&&void 0!==i?i:"primary"},centered:!0,destroyOnClose:!0,children:e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:12,alignItems:"flex-start"},children:[n.icon&&e.jsxRuntimeExports.jsx("div",{style:{fontSize:22,marginTop:2},children:n.icon}),e.jsxRuntimeExports.jsx("div",{style:{flex:1},children:n.content})]})})});const a=()=>{const{colors:s}=e.useTemboTheme();return e.jsxRuntimeExports.jsx(n.RefIcon,{style:{color:s.error.main}})},l=()=>{const{colors:s}=e.useTemboTheme();return e.jsxRuntimeExports.jsx(o.RefIcon,{style:{color:s.warning.main}})},u=()=>{const{colors:s}=e.useTemboTheme();return e.jsxRuntimeExports.jsx(n.RefIcon$1,{style:{color:s.info.main}})},x=()=>{const{colors:s}=e.useTemboTheme();return e.jsxRuntimeExports.jsx(n.RefIcon$2,{style:{color:s.success.main}})},m=()=>{const{colors:s}=e.useTemboTheme();return e.jsxRuntimeExports.jsx(o.RefIcon$1,{style:{color:s.primary.main}})};exports.ConfirmDialog=c,exports.TemboConfirm=class{static async danger(s){return i.default.show(c,Object.assign(Object.assign({},s),{icon:e.jsxRuntimeExports.jsx(a,{}),okDanger:!0,okType:"primary"}))}static async warning(s){return i.default.show(c,Object.assign(Object.assign({},s),{icon:e.jsxRuntimeExports.jsx(l,{})}))}static async info(s){return i.default.show(c,Object.assign(Object.assign({},s),{icon:e.jsxRuntimeExports.jsx(u,{})}))}static async success(s){return i.default.show(c,Object.assign(Object.assign({},s),{icon:e.jsxRuntimeExports.jsx(x,{})}))}static async confirm(s){return i.default.show(c,Object.assign(Object.assign({},s),{icon:e.jsxRuntimeExports.jsx(m,{})}))}};
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":["../../src/features/dialogs/tembo-confirm.tsx"],"sourcesContent":[null],"names":["ConfirmDialog","NiceModal","create","props","modal","useModal","_jsx","Modal","open","visible","title","onOk","async","resolve","remove","onCancel","okText","_a","cancelText","_b","okButtonProps","danger","okDanger","type","_c","okType","centered","destroyOnClose","children","_jsxs","style","display","gap","alignItems","icon","fontSize","marginTop","flex","content","DangerIcon","colors","useTemboTheme","ExclamationCircleOutlined","color","error","main","WarningIcon","WarningOutlined","warning","InfoIcon","InfoCircleOutlined","info","SuccessIcon","CheckCircleOutlined","success","QuestionIcon","QuestionCircleOutlined","primary","show","Object","assign","confirm"],"mappings":"kTA0BO,MAAMA,EAAgBC,EAAAA,QAAUC,OAA4BC,cAC/D,MAAMC,EAAQC,EAAAA,WAkBd,OACIC,EAAAA,kBAAAA,IAACC,EAAAA,OACGC,KAAMJ,EAAMK,QACZC,MAAOP,EAAMO,MACbC,KApBSC,UACTT,EAAMQ,YACAR,EAAMQ,OAEhBP,EAAMS,SAAQ,GACdT,EAAMU,UAgBFC,SAba,KACbZ,EAAMY,UACNZ,EAAMY,WAEVX,EAAMS,SAAQ,GACdT,EAAMU,UASFE,eAAQC,EAAAd,EAAMa,sBAAU,KACxBE,mBAAYC,EAAAhB,EAAMe,0BAAc,SAChCE,cAAe,CACXC,O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EAAU,IACjBjB,UAAU,EACVG,OAAQ,aAOhB,oBAAauB,CAAQ7C,GACjB,OAAOF,EAAAA,QAAUyD,KAAK1D,EAAa2D,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EAC5BzD,GAAK,CACR+B,KAAM5B,EAAAA,kBAAAA,IAACwC,EAAW,CAAA,MAO1B,iBAAaK,CAAKhD,GACd,OAAOF,EAAAA,QAAUyD,KAAK1D,EAAa2D,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EAC5BzD,GAAK,CACR+B,KAAM5B,EAAAA,kBAAAA,IAAC2C,EAAQ,CAAA,MAOvB,oBAAaK,CAAQnD,GACjB,OAAOF,EAAAA,QAAUyD,KAAK1D,EAAa2D,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EAC5BzD,GAAK,CACR+B,KAAM5B,EAAAA,kBAAAA,IAAC8C,EAAW,CAAA,MAO1B,oBAAaS,CAAQ1D,GACjB,OAAOF,EAAAA,QAAUyD,KAAK1D,EAAa2D,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EAC5BzD,GAAK,CACR+B,KAAM5B,EAAAA,kBAAAA,IAACiD,EAAY,CAAA"}
@@ -0,0 +1,2 @@
1
+ import{j as s,u as n}from"../theme-provider-D_oV1J_K.js";import{Modal as o}from"antd";import e,{useModal as t}from"@ebay/nice-modal-react";import"lodash";import{R as r,a as c,b as a}from"../InfoCircleOutlined-DYs90hdV.js";import{R as i,a as l}from"../ZoomOutOutlined-BL6A5RSq.js";import"react";const j=e.create(n=>{var e,r,c;const a=t();return s.jsx(o,{open:a.visible,title:n.title,onOk:async()=>{n.onOk&&await n.onOk(),a.resolve(!0),a.remove()},onCancel:()=>{n.onCancel&&n.onCancel(),a.resolve(!1),a.remove()},okText:null!==(e=n.okText)&&void 0!==e?e:"OK",cancelText:null!==(r=n.cancelText)&&void 0!==r?r:"Cancel",okButtonProps:{danger:n.okDanger,type:null!==(c=n.okType)&&void 0!==c?c:"primary"},centered:!0,destroyOnClose:!0,children:s.jsxs("div",{style:{display:"flex",gap:12,alignItems:"flex-start"},children:[n.icon&&s.jsx("div",{style:{fontSize:22,marginTop:2},children:n.icon}),s.jsx("div",{style:{flex:1},children:n.content})]})})});class m{static async danger(n){return e.show(j,Object.assign(Object.assign({},n),{icon:s.jsx(y,{}),okDanger:!0,okType:"primary"}))}static async warning(n){return e.show(j,Object.assign(Object.assign({},n),{icon:s.jsx(x,{})}))}static async info(n){return e.show(j,Object.assign(Object.assign({},n),{icon:s.jsx(d,{})}))}static async success(n){return e.show(j,Object.assign(Object.assign({},n),{icon:s.jsx(u,{})}))}static async confirm(n){return e.show(j,Object.assign(Object.assign({},n),{icon:s.jsx(p,{})}))}}const y=()=>{const{colors:o}=n();return s.jsx(r,{style:{color:o.error.main}})},x=()=>{const{colors:o}=n();return s.jsx(i,{style:{color:o.warning.main}})},d=()=>{const{colors:o}=n();return s.jsx(c,{style:{color:o.info.main}})},u=()=>{const{colors:o}=n();return s.jsx(a,{style:{color:o.success.main}})},p=()=>{const{colors:o}=n();return s.jsx(l,{style:{color:o.primary.main}})};export{j as ConfirmDialog,m as TemboConfirm};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/features/dialogs/tembo-confirm.tsx"],"sourcesContent":[null],"names":["ConfirmDialog","NiceModal","create","props","modal","useModal","_jsx","Modal","open","visible","title","onOk","async","resolve","remove","onCancel","okText","_a","cancelText","_b","okButtonProps","danger","okDanger","type","_c","okType","centered","destroyOnClose","children","_jsxs","style","display","gap","alignItems","icon","fontSize","marginTop","flex","content","TemboConfirm","show","Object","assign","DangerIcon","warning","WarningIcon","info","InfoIcon","success","SuccessIcon","confirm","QuestionIcon","colors","useTemboTheme","ExclamationCircleOutlined","color","error","main","WarningOutlined","InfoCircleOutlined","CheckCircleOutlined","QuestionCircleOutlined","primary"],"mappings":"sSA0BO,MAAMA,EAAgBC,EAAUC,OAA4BC,cAC/D,MAAMC,EAAQC,IAkBd,OAC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AAC,OAAAD,OAAAC,OAAA,CAAA,EAC5BvC,GAAK,CACR+B,KAAM5B,EAAAA,IAAC2C,EAAW,CAAA,MAO1B,oBAAaC,CAAQ/C,GACjB,OAAOF,EAAUuC,KAAKxC,EAAayC,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EAC5BvC,GAAK,CACR+B,KAAM5B,EAAAA,IAAC6C,EAAY,CAAA,OAM/B,MAAMR,EAAuB,KACzB,MAAMS,OAAEA,GAAWC,IACnB,OAAO/C,EAAAA,IAACgD,EAAyB,CAACxB,MAAO,CAAEyB,MAAOH,EAAOI,MAAMC,SAG7DZ,EAAwB,KAC1B,MAAMO,OAAEA,GAAWC,IACnB,OAAO/C,EAAAA,IAACoD,EAAe,CAAC5B,MAAO,CAAEyB,MAAOH,EAAOR,QAAQa,SAGrDV,EAAqB,KACvB,MAAMK,OAAEA,GAAWC,IACnB,OAAO/C,EAAAA,IAACqD,EAAkB,CAAC7B,MAAO,CAAEyB,MAAOH,EAAON,KAAKW,SAGrDR,EAAwB,KAC1B,MAAMG,OAAEA,GAAWC,IACnB,OAAO/C,EAAAA,IAACsD,EAAmB,CAAC9B,MAAO,CAAEyB,MAAOH,EAAOJ,QAAQS,SAGzDN,EAAyB,KAC3B,MAAMC,OAAEA,GAAWC,IACnB,OAAO/C,EAAAA,IAACuD,EAAsB,CAAC/B,MAAO,CAAEyB,MAAOH,EAAOU,QAAQL"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ type TemboAlertType = 'info' | 'success' | 'warning' | 'error';
3
+ interface TemboAlertProps {
4
+ type?: TemboAlertType;
5
+ message: string | React.ReactNode;
6
+ description?: string | React.ReactNode;
7
+ icon?: React.ReactNode;
8
+ showIcon?: boolean;
9
+ style?: React.CSSProperties;
10
+ }
11
+ export declare const TemboAlert: React.FC<TemboAlertProps>;
12
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./alert.js";
@@ -0,0 +1 @@
1
+ export * from "./tembo-confirm.js";
@@ -0,0 +1,3 @@
1
+ import { PropsWithChildren } from "react";
2
+ declare const TemboModalProvider: React.FC<PropsWithChildren>;
3
+ export default TemboModalProvider;
@@ -0,0 +1,63 @@
1
+ export interface ConfirmDialogProps {
2
+ title: string;
3
+ content: React.ReactNode;
4
+ okText?: string;
5
+ cancelText?: string;
6
+ okType?: 'default' | 'primary' | 'dashed' | 'link' | 'text';
7
+ okDanger?: boolean;
8
+ icon?: React.ReactNode;
9
+ onOk?: () => void | Promise<void>;
10
+ onCancel?: () => void;
11
+ }
12
+ /**
13
+ * Base confirmation dialog using NiceModal
14
+ */
15
+ export declare const ConfirmDialog: import("react").FC<ConfirmDialogProps & import("@ebay/nice-modal-react").NiceModalHocProps>;
16
+ /**
17
+ * TemboConfirm - Unified confirmation dialog system
18
+ *
19
+ * Provides consistent, theme-aligned confirmation dialogs using NiceModal.
20
+ * Uses theme colors at invocation time to ensure proper theming.
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * // Danger confirmation
25
+ * const confirmed = await TemboConfirm.danger({
26
+ * title: 'Delete Payment',
27
+ * content: 'This action cannot be undone.',
28
+ * okText: 'Yes, Delete',
29
+ * });
30
+ *
31
+ * if (confirmed) {
32
+ * // proceed with deletion
33
+ * }
34
+ *
35
+ * // Warning confirmation
36
+ * await TemboConfirm.warning({
37
+ * title: 'Unsaved Changes',
38
+ * content: 'You have unsaved changes. Continue?',
39
+ * });
40
+ * ```
41
+ */
42
+ export declare class TemboConfirm {
43
+ /**
44
+ * Show a danger/destructive confirmation dialog (red OK button)
45
+ */
46
+ static danger(props: Omit<ConfirmDialogProps, 'icon' | 'okDanger'>): Promise<boolean>;
47
+ /**
48
+ * Show a warning confirmation dialog (orange icon)
49
+ */
50
+ static warning(props: Omit<ConfirmDialogProps, 'icon'>): Promise<boolean>;
51
+ /**
52
+ * Show an info confirmation dialog (blue icon)
53
+ */
54
+ static info(props: Omit<ConfirmDialogProps, 'icon'>): Promise<boolean>;
55
+ /**
56
+ * Show a success confirmation dialog (green icon)
57
+ */
58
+ static success(props: Omit<ConfirmDialogProps, 'icon'>): Promise<boolean>;
59
+ /**
60
+ * Show a generic question dialog
61
+ */
62
+ static confirm(props: Omit<ConfirmDialogProps, 'icon'>): Promise<boolean>;
63
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Validator for account name field using existing BankValidation.
3
+ * Ensures the account name meets the criteria defined in your validation utils.
4
+ *
5
+ * @param rule - The rule object for validation
6
+ * @param value - The value to validate
7
+ * @returns Promise resolving to trimmed account name or rejecting with error
8
+ *
9
+ * @example
10
+ * // In form rules
11
+ * rules: [{ required: true, validator: ACCOUNT_NAME_VALIDATOR }]
12
+ */
13
+ export declare const ACCOUNT_NAME_VALIDATOR: (rule: any, value: string | null | undefined) => Promise<string | undefined>;
@@ -0,0 +1,13 @@
1
+ import { ISO2CountryCode } from "@temboplus/frontend-core";
2
+ /**
3
+ * Creates a validator for bank account numbers specific to a country.
4
+ * Uses BankValidation.validateAccountNumber() for validation.
5
+ *
6
+ * @param countryCode - The ISO2 country code for validation context
7
+ * @returns Validator function for AntD form rules
8
+ *
9
+ * @example
10
+ * // In form rules
11
+ * rules: [{ required: true, validator: ACCOUNT_NUMBER_VALIDATOR('KE') }]
12
+ */
13
+ export declare const ACCOUNT_NUMBER_VALIDATOR: (countryCode?: ISO2CountryCode) => (rule: any, value: string | null | undefined) => Promise<string | undefined>;
@@ -1,65 +1,4 @@
1
- import type { CurrencyCode, ISO2CountryCode } from "@temboplus/frontend-core";
2
- /**
3
- * Creates a validator for general phone numbers that validates format and country.
4
- * Uses PhoneNumberFactory.canCreate() for validation.
5
- *
6
- * @param countryCode - The ISO2 country code for validation context
7
- * @returns Validator function for AntD form rules
8
- *
9
- * @example
10
- * // In form rules
11
- * rules: [{ required: true, validator: PHONE_NUMBER_VALIDATOR('TZ') }]
12
- */
13
- export declare const PHONE_NUMBER_VALIDATOR: (countryCode?: ISO2CountryCode) => (rule: any, value: string | null | undefined) => Promise<string | undefined>;
14
- /**
15
- * Creates a validator for mobile phone numbers eligible for payout operations.
16
- * Uses PhoneNumberFactory.checkPayoutEligibility() for validation.
17
- *
18
- * @param countryCode - The ISO2 country code for validation context
19
- * @returns Validator function for AntD form rules
20
- *
21
- * @example
22
- * // In form rules
23
- * rules: [{ required: true, validator: MOBILE_PHONE_VALIDATOR('TZ') }]
24
- */
25
- export declare const MOBILE_PHONE_VALIDATOR: (countryCode?: ISO2CountryCode) => (rule: any, value: string | null | undefined) => Promise<string | undefined>;
26
- /**
27
- * Validator for account name field using existing BankValidation.
28
- * Ensures the account name meets the criteria defined in your validation utils.
29
- *
30
- * @param rule - The rule object for validation
31
- * @param value - The value to validate
32
- * @returns Promise resolving to trimmed account name or rejecting with error
33
- *
34
- * @example
35
- * // In form rules
36
- * rules: [{ required: true, validator: ACCOUNT_NAME_VALIDATOR }]
37
- */
38
- export declare const ACCOUNT_NAME_VALIDATOR: (rule: any, value: string | null | undefined) => Promise<string | undefined>;
39
- /**
40
- * Creates a validator for SWIFT/BIC codes specific to a country.
41
- * Uses BankValidation.validateSwiftCode() for validation.
42
- *
43
- * @param countryCode - The ISO2 country code for validation context
44
- * @returns Validator function for AntD form rules
45
- *
46
- * @example
47
- * // In form rules
48
- * rules: [{ required: true, validator: SWIFT_CODE_VALIDATOR('TZ') }]
49
- */
50
- export declare const SWIFT_CODE_VALIDATOR: (countryCode?: ISO2CountryCode) => (rule: any, value: string | null | undefined) => Promise<string | undefined>;
51
- /**
52
- * Creates a validator for bank account numbers specific to a country.
53
- * Uses BankValidation.validateAccountNumber() for validation.
54
- *
55
- * @param countryCode - The ISO2 country code for validation context
56
- * @returns Validator function for AntD form rules
57
- *
58
- * @example
59
- * // In form rules
60
- * rules: [{ required: true, validator: ACCOUNT_NUMBER_VALIDATOR('KE') }]
61
- */
62
- export declare const ACCOUNT_NUMBER_VALIDATOR: (countryCode?: ISO2CountryCode) => (rule: any, value: string | null | undefined) => Promise<string | undefined>;
1
+ import { CurrencyCode } from "@temboplus/frontend-core";
63
2
  /**
64
3
  * Configuration options for amount validation
65
4
  */
@@ -0,0 +1,5 @@
1
+ export * from "./account-name-validator.js";
2
+ export * from "./account-number-validator.js";
3
+ export * from "./amount-validator.js";
4
+ export * from "./phone-number-validator.js";
5
+ export * from "./swift-code-validator.js";
@@ -0,0 +1,25 @@
1
+ import { ISO2CountryCode } from "@temboplus/frontend-core";
2
+ /**
3
+ * Creates a validator for general phone numbers that validates format and country.
4
+ * Uses PhoneNumberFactory.canCreate() for validation.
5
+ *
6
+ * @param countryCode - The ISO2 country code for validation context
7
+ * @returns Validator function for AntD form rules
8
+ *
9
+ * @example
10
+ * // In form rules
11
+ * rules: [{ required: true, validator: PHONE_NUMBER_VALIDATOR('TZ') }]
12
+ */
13
+ export declare const PHONE_NUMBER_VALIDATOR: (countryCode?: ISO2CountryCode) => (rule: any, value: string | null | undefined) => Promise<string | undefined>;
14
+ /**
15
+ * Creates a validator for mobile phone numbers eligible for payout operations.
16
+ * Uses PhoneNumberFactory.checkPayoutEligibility() for validation.
17
+ *
18
+ * @param countryCode - The ISO2 country code for validation context
19
+ * @returns Validator function for AntD form rules
20
+ *
21
+ * @example
22
+ * // In form rules
23
+ * rules: [{ required: true, validator: MOBILE_PHONE_VALIDATOR('TZ') }]
24
+ */
25
+ export declare const MOBILE_PHONE_VALIDATOR: (countryCode?: ISO2CountryCode) => (rule: any, value: string | null | undefined) => Promise<string | undefined>;
@@ -0,0 +1,13 @@
1
+ import { ISO2CountryCode } from "@temboplus/frontend-core";
2
+ /**
3
+ * Creates a validator for SWIFT/BIC codes specific to a country.
4
+ * Uses BankValidation.validateSwiftCode() for validation.
5
+ *
6
+ * @param countryCode - The ISO2 country code for validation context
7
+ * @returns Validator function for AntD form rules
8
+ *
9
+ * @example
10
+ * // In form rules
11
+ * rules: [{ required: true, validator: SWIFT_CODE_VALIDATOR('TZ') }]
12
+ */
13
+ export declare const SWIFT_CODE_VALIDATOR: (countryCode?: ISO2CountryCode) => (rule: any, value: string | null | undefined) => Promise<string | undefined>;
@@ -0,0 +1,3 @@
1
+ export * from "./tembo-notify.js";
2
+ export * from "./toast-config.js";
3
+ export * from "./toast-container.js";
@@ -0,0 +1,124 @@
1
+ import { ToastOptions, ToastContent, Id } from 'react-toastify';
2
+ import { TemboColorPalette, TemboUIConstants } from '../../theme/index.js';
3
+ export interface NotifyOptions {
4
+ /**
5
+ * Duration in milliseconds before auto-closing (default: 4000 for most, 6000 for errors)
6
+ * Set to false to prevent auto-close
7
+ */
8
+ duration?: number | false;
9
+ /**
10
+ * Custom position for the notification
11
+ */
12
+ position?: ToastOptions['position'];
13
+ /**
14
+ * Callback when notification is clicked
15
+ */
16
+ onClick?: () => void;
17
+ /**
18
+ * Callback when notification is closed
19
+ */
20
+ onClose?: () => void;
21
+ }
22
+ /**
23
+ * TemboNotify - Unified notification system
24
+ *
25
+ * Wraps react-toastify with consistent styling and behavior
26
+ * aligned with Tembo's design system.
27
+ *
28
+ * Note: This class needs to be initialized with theme tokens before use.
29
+ * Call TemboNotify.init(colors, constants) in your app setup.
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * // In your app setup (e.g., App.tsx)
34
+ * const { colors, constants } = useTemboTheme();
35
+ * useEffect(() => {
36
+ * TemboNotify.init(colors, constants);
37
+ * }, [colors, constants]);
38
+ *
39
+ * // Then use anywhere in your app
40
+ * TemboNotify.success('Payment sent successfully!');
41
+ *
42
+ * // With options
43
+ * TemboNotify.error('Payment failed', {
44
+ * duration: 8000,
45
+ * onClick: () => console.log('Error clicked')
46
+ * });
47
+ *
48
+ * // Loading with promise
49
+ * const loadingId = TemboNotify.loading('Processing payment...');
50
+ * await processPayment();
51
+ * TemboNotify.success('Payment complete!', { id: loadingId });
52
+ *
53
+ * // Promise-based
54
+ * TemboNotify.promise(
55
+ * apiCall(),
56
+ * {
57
+ * pending: 'Processing...',
58
+ * success: 'Done!',
59
+ * error: 'Failed!'
60
+ * }
61
+ * );
62
+ * ```
63
+ */
64
+ export declare class TemboNotify {
65
+ private static configs;
66
+ /**
67
+ * Initialize TemboNotify with theme tokens
68
+ * Must be called before using any notification methods
69
+ */
70
+ static init(colors: TemboColorPalette, constants: TemboUIConstants): void;
71
+ /**
72
+ * Get current toast configs, throws if not initialized
73
+ */
74
+ private static getConfigs;
75
+ /**
76
+ * Display a success notification
77
+ */
78
+ static success(message: ToastContent, options?: NotifyOptions): Id;
79
+ /**
80
+ * Display an error notification
81
+ */
82
+ static error(message: ToastContent, options?: NotifyOptions): Id;
83
+ /**
84
+ * Display a warning notification
85
+ */
86
+ static warning(message: ToastContent, options?: NotifyOptions): Id;
87
+ /**
88
+ * Display an info notification
89
+ */
90
+ static info(message: ToastContent, options?: NotifyOptions): Id;
91
+ /**
92
+ * Display a loading notification
93
+ * Returns an ID that can be used to update/dismiss it
94
+ */
95
+ static loading(message: ToastContent, options?: Omit<NotifyOptions, 'duration'>): Id;
96
+ /**
97
+ * Update an existing notification
98
+ */
99
+ static update(id: Id, options: {
100
+ type?: 'success' | 'error' | 'warning' | 'info';
101
+ message?: ToastContent;
102
+ autoClose?: number | false;
103
+ }): void;
104
+ /**
105
+ * Dismiss a specific notification by ID
106
+ */
107
+ static dismiss(id: Id): void;
108
+ /**
109
+ * Dismiss all notifications
110
+ */
111
+ static dismissAll(): void;
112
+ /**
113
+ * Check if a notification is active
114
+ */
115
+ static isActive(id: Id): boolean;
116
+ /**
117
+ * Handle promise-based operations with notifications
118
+ */
119
+ static promise<T>(promise: Promise<T>, messages: {
120
+ pending: ToastContent;
121
+ success: ToastContent<T>;
122
+ error: ToastContent | ((error: any) => ToastContent);
123
+ }, options?: NotifyOptions): Promise<T>;
124
+ }
@@ -0,0 +1,15 @@
1
+ import { ToastOptions } from 'react-toastify';
2
+ import { TemboColorPalette, TemboUIConstants } from '../../theme/index.js';
3
+ /**
4
+ * Build toast configurations from theme tokens
5
+ * This function is called with theme values to generate toast configs
6
+ */
7
+ export declare const buildToastConfigs: (colors: TemboColorPalette, constants: TemboUIConstants) => {
8
+ loadingConfig: ToastOptions<unknown>;
9
+ infoConfig: ToastOptions<unknown>;
10
+ warningConfig: ToastOptions<unknown>;
11
+ errorConfig: ToastOptions<unknown>;
12
+ successConfig: ToastOptions<unknown>;
13
+ baseConfig: ToastOptions<unknown>;
14
+ };
15
+ export type ToastConfigs = ReturnType<typeof buildToastConfigs>;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { ToastContainerProps as RTToastContainerProps } from 'react-toastify';
3
+ export type TemboToastContainerProps = RTToastContainerProps;
4
+ /**
5
+ * Toast container that automatically initializes TemboNotify with current theme
6
+ * Reinitializes when theme changes to respect color/constant overrides
7
+ */
8
+ declare const TemboToastContainer: React.FC<TemboToastContainerProps>;
9
+ export default TemboToastContainer;
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("@temboplus/frontend-core");exports.ACCOUNT_NAME_VALIDATOR=(r,o)=>{const n=null==o?void 0:o.toString().trim();if(!n)return r.required?Promise.reject(new Error("Account name is required.")):Promise.resolve(void 0);return e.BankValidation.validateAccountName(n)?Promise.resolve(n):Promise.reject(new Error("Invalid account name. Please enter a valid full name with at least two words (e.g., 'John Smith', 'Anna-Marie Johnson')."))},exports.ACCOUNT_NUMBER_VALIDATOR=r=>(o,n)=>{var t;const i=null==n?void 0:n.toString().trim();if(!i)return o.required?Promise.reject(new Error("Account number is required.")):Promise.resolve(void 0);const a=i.replace(/\s+/g,"");if(r){if(e.BankValidation.validateAccountNumber(a,r))return Promise.resolve(a);const o=null===(t=e.Country.from(r))||void 0===t?void 0:t.name,n=function(e){return{TZ:"Account number should be 9-19 characters long.",KE:"Account number should be 10, 12, or 15 alphanumeric characters."}[e]||"Please enter a valid account number."}(r);return Promise.reject(new Error(`Invalid ${o} account number format. ${n}`))}return e.BankValidation.validateAccountNumberForAnyCountry(a)?Promise.resolve(a):Promise.reject(new Error("Invalid account number format"))},exports.AMOUNT_VALIDATOR=(r={})=>{const{currencyCode:o="TZS",invalidFormatMessage:n,minMessage:t,maxMessage:i}=r,{defaultMin:a,defaultMax:u}=(e=>{switch(e){case"TZS":return{defaultMin:1e3,defaultMax:1e6};case"KES":return{defaultMin:40,defaultMax:4e7};default:return{defaultMin:1,defaultMax:1e6}}})(o),s=void 0!==r.min?r.min:a,l=void 0!==r.max?r.max:u;return(r,a)=>{const u=null==a?void 0:a.toString().trim();if(!u)return r.required?Promise.reject(new Error("Amount is required.")):Promise.resolve(void 0);const m=e.Amount.from(u,o);if(!m)return Promise.reject(new Error(n||'Invalid amount format. Please enter a valid monetary amount (e.g., "1000", "1,234.56").'));const d=m.numericValue;if(m.isNegative())return Promise.reject(new Error("Negative amounts are not allowed. Please enter a positive amount."));if(null!==s&&d<s){const r=e.Amount.from(s,o);return Promise.reject(new Error(t||`Amount must be at least ${(null==r?void 0:r.label)||s}. Please enter a higher amount.`))}if(null!==l&&d>l){const r=e.Amount.from(l,o);return Promise.reject(new Error(i||`Amount must not exceed ${(null==r?void 0:r.label)||l}. Please enter a lower amount.`))}return Promise.resolve(m.formattedNumericValue)}},exports.MOBILE_PHONE_VALIDATOR=r=>(o,n)=>{var t;const i=null==n?void 0:n.toString().trim();if(!i)return o.required?Promise.reject(new Error("Mobile phone number is required.")):Promise.resolve(void 0);const a=e.PhoneNumberFactory.create(i,{defaultCountry:r});if(!a)return Promise.reject(new Error("This phone number is invalid."));if(e.PhoneNumberFactory.checkPayoutEligibility(a))return Promise.resolve((null==a?void 0:a.e164Format)||i);if(r){const o=null===(t=e.Country.from(r))||void 0===t?void 0:t.name;return Promise.reject(new Error(`Invalid ${o} phone number format. Please enter a valid ${o} phone number.`))}return Promise.reject(new Error("This phone number is invalid."))},exports.PHONE_NUMBER_VALIDATOR=r=>(o,n)=>{var t;const i=null==n?void 0:n.toString().trim();if(!i)return o.required?Promise.reject(new Error("Phone number is required.")):Promise.resolve(void 0);if(e.PhoneNumberFactory.canCreate(i,{defaultCountry:r})){const o=e.PhoneNumberFactory.create(i,{defaultCountry:r});return Promise.resolve((null==o?void 0:o.e164Format)||i)}if(r){const o=null===(t=e.Country.from(r))||void 0===t?void 0:t.name;return Promise.reject(new Error(`Invalid ${o} phone number format. Please enter a valid ${o} phone number.`))}return Promise.reject(new Error("This phone number is invalid."))},exports.SWIFT_CODE_VALIDATOR=r=>(o,n)=>{var t;const i=null==n?void 0:n.toString().trim().toUpperCase();if(!i)return o.required?Promise.reject(new Error("SWIFT code is required.")):Promise.resolve(void 0);if(r){if(e.BankValidation.validateSwiftCode(i,r))return Promise.resolve(i);const o=null===(t=e.Country.from(r))||void 0===t?void 0:t.name;return Promise.reject(new Error(`Invalid ${o} SWIFT code. Please enter a valid ${o} bank SWIFT/BIC code.`))}return e.BankValidation.validateSwiftCodeForAnyCountry(i)?Promise.resolve(i):Promise.reject(new Error("Invalid SWIFT code. Please enter a valid supported bank SWIFT/BIC code."))};
1
+ "use strict";var e=require("./theme-provider-Dqvy24OD.js"),r=require("@ebay/nice-modal-react"),t=require("react"),s=require("react-toastify");require("lodash");var i=require("./tembo-notify-D-uOV3t0.js");function o(e){return e&&e.__esModule?e:{default:e}}require("antd"),require("./InfoCircleOutlined-B7d2aRfV.js"),require("./ZoomOutOutlined-BY_CCwq7.js");var n=o(r);const u=r=>e.jsxRuntimeExports.jsx(n.default.Provider,{children:r.children}),c=r=>{const{colors:o,constants:n}=e.useTemboTheme();return t.useEffect(()=>{i.TemboNotify.init(o,n)},[o,n]),e.jsxRuntimeExports.jsx(s.ToastContainer,Object.assign({},r))};exports.TemboUIProviders=({children:r,colors:t,constants:s,themeOverrides:i})=>e.jsxRuntimeExports.jsx(e.TemboThemeProvider,{colors:t,constants:s,themeOverrides:i,children:e.jsxRuntimeExports.jsxs(u,{children:[r,e.jsxRuntimeExports.jsx(c,{})]})});
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/antd-validators.ts"],"sourcesContent":[null],"names":["rule","value","accountNameString","toString","trim","required","Promise","reject","Error","resolve","undefined","BankValidation","validateAccountName","countryCode","accountNumberString","normalizedAccountNumber","replace","validateAccountNumber","countryName","_a","Country","from","name","formatHint","TZ","KE","getAccountNumberFormatHint","validateAccountNumberForAnyCountry","options","currencyCode","invalidFormatMessage","minMessage","maxMessage","defaultMin","defaultMax","currency","getDefaultConstraints","min","max","amountString","amountInstance","Amount","numericValue","isNegative","minAmount","label","maxAmount","formattedNumericValue","phoneString","phoneInstance","PhoneNumberFactory","create","defaultCountry","checkPayoutEligibility","e164Format","canCreate","swiftCodeString","toUpperCase","validateSwiftCode","validateSwiftCodeForAnyCountry"],"mappings":"sFAiIsC,CACpCA,EACAC,KAEA,MAAMC,EAAoBD,aAAK,EAALA,EAAOE,WAAWC,OAG5C,IAAKF,EACH,OAAIF,EAAKK,SACAC,QAAQC,OAAO,IAAIC,MAAM,8BAE3BF,QAAQG,aAAQC,GAKzB,OAFgBC,EAAAA,eAAeC,oBAAoBV,GAG1CI,QAAQG,QAAQP,GAGlBI,QAAQC,OACb,IAAIC,MACF,+JA+EmCK,GAChC,CACLb,EACAC,WAEA,MAAMa,EAAsBb,aAAK,EAALA,EAAOE,WAAWC,OAG9C,IAAKU,EACH,OAAId,EAAKK,SACAC,QAAQC,OAAO,IAAIC,MAAM,gCAE3BF,QAAQG,aAAQC,GAIzB,MAAMK,EAAuCD,EAwNlCE,QAAQ,OAAQ,IAtN3B,GAAIH,EAAa,CAMf,GALgBF,EAAAA,eAAeM,sBAC7BF,EACAF,GAIA,OAAOP,QAAQG,QAAQM,GAGzB,MAAMG,EAAuC,QAAzBC,EAAAC,EAAAA,QAAQC,KAAKR,UAAY,IAAAM,OAAA,EAAAA,EAAEG,KACzCC,EAoNZ,SAAoCV,GAOlC,MAN4C,CAC1CW,GAAI,iDACJC,GAAI,mEAIaZ,IAAgB,sCACrC,CA5NyBa,CAA2Bb,GAE9C,OAAOP,QAAQC,OACb,IAAIC,MAAM,WAAWU,4BAAsCK,MAQ/D,OAJgBZ,EAAAA,eAAegB,mCAC7BZ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,WAEA,MAAMuD,EAAkBvD,aAAK,EAALA,EAAOE,WAAWC,OAAOqD,cAGjD,IAAKD,EACH,OAAIxD,EAAKK,SACAC,QAAQC,OAAO,IAAIC,MAAM,4BAE3BF,QAAQG,aAAQC,GAGzB,GAAIG,EAAa,CAMf,GALgBF,EAAAA,eAAe+C,kBAC7BF,EACA3C,GAIA,OAAOP,QAAQG,QAAQ+C,GAGzB,MAAMtC,EAAuC,QAAzBC,EAAAC,EAAAA,QAAQC,KAAKR,UAAY,IAAAM,OAAA,EAAAA,EAAEG,KAC/C,OAAOhB,QAAQC,OACb,IAAIC,MACF,WAAWU,sCAAgDA,2BAQjE,OAFEP,EAAAA,eAAegD,+BAA+BH,GAGvClD,QAAQG,QAAQ+C,GAGlBlD,QAAQC,OACb,IAAIC,MACF"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/features/dialogs/modal-provider.tsx","../src/features/notifications/toast-container.tsx","../src/providers.tsx"],"sourcesContent":[null,null,null],"names":["TemboModalProvider","props","_jsx","NiceModal","Provider","children","TemboToastContainer","colors","constants","useTemboTheme","useEffect","TemboNotify","init","ToastContainer","Object","assign","themeOverrides","TemboThemeProvider","_jsxs"],"mappings":"+WAGA,MAAMA,EAAmDC,GAC9CC,EAAAA,kBAAAA,IAACC,EAAAA,QAAUC,mBAAUH,EAAMI,WCOhCC,EAA2DL,IAC7D,MAAMM,OAAEA,EAAMC,UAAEA,GAAcC,kBAO9B,OAJAC,EAAAA,UAAU,KACNC,cAAYC,KAAKL,EAAQC,IAC1B,CAACD,EAAQC,IAELN,EAAAA,kBAAAA,IAACW,EAAAA,eAAcC,OAAAC,OAAA,CAAA,EAAKd,8BCwBkC,EAC7DI,WACAE,SACAC,YACAQ,oBAGId,EAAAA,kBAAAA,IAACe,qBAAkB,CACfV,OAAQA,EACRC,UAAWA,EACXQ,eAAgBA,EAAcX,SAE9Ba,EAAAA,kBAAAA,KAAClB,EAAkB,CAAAK,SAAA,CACdA,EACDH,EAAAA,kBAAAA,IAACI,EAAmB,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./antd-validators";
1
+ export * from "./providers.js";
package/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- import{PhoneNumberFactory as e,Country as r,BankValidation as o,Amount as n}from"@temboplus/frontend-core";const t=o=>(n,t)=>{var i;const a=null==t?void 0:t.toString().trim();if(!a)return n.required?Promise.reject(new Error("Phone number is required.")):Promise.resolve(void 0);if(e.canCreate(a,{defaultCountry:o})){const r=e.create(a,{defaultCountry:o});return Promise.resolve((null==r?void 0:r.e164Format)||a)}if(o){const e=null===(i=r.from(o))||void 0===i?void 0:i.name;return Promise.reject(new Error(`Invalid ${e} phone number format. Please enter a valid ${e} phone number.`))}return Promise.reject(new Error("This phone number is invalid."))},i=o=>(n,t)=>{var i;const a=null==t?void 0:t.toString().trim();if(!a)return n.required?Promise.reject(new Error("Mobile phone number is required.")):Promise.resolve(void 0);const u=e.create(a,{defaultCountry:o});if(!u)return Promise.reject(new Error("This phone number is invalid."));if(e.checkPayoutEligibility(u))return Promise.resolve((null==u?void 0:u.e164Format)||a);if(o){const e=null===(i=r.from(o))||void 0===i?void 0:i.name;return Promise.reject(new Error(`Invalid ${e} phone number format. Please enter a valid ${e} phone number.`))}return Promise.reject(new Error("This phone number is invalid."))},a=(e,r)=>{const n=null==r?void 0:r.toString().trim();if(!n)return e.required?Promise.reject(new Error("Account name is required.")):Promise.resolve(void 0);return o.validateAccountName(n)?Promise.resolve(n):Promise.reject(new Error("Invalid account name. Please enter a valid full name with at least two words (e.g., 'John Smith', 'Anna-Marie Johnson')."))},u=e=>(n,t)=>{var i;const a=null==t?void 0:t.toString().trim().toUpperCase();if(!a)return n.required?Promise.reject(new Error("SWIFT code is required.")):Promise.resolve(void 0);if(e){if(o.validateSwiftCode(a,e))return Promise.resolve(a);const n=null===(i=r.from(e))||void 0===i?void 0:i.name;return Promise.reject(new Error(`Invalid ${n} SWIFT code. Please enter a valid ${n} bank SWIFT/BIC code.`))}return o.validateSwiftCodeForAnyCountry(a)?Promise.resolve(a):Promise.reject(new Error("Invalid SWIFT code. Please enter a valid supported bank SWIFT/BIC code."))},s=e=>(n,t)=>{var i;const a=null==t?void 0:t.toString().trim();if(!a)return n.required?Promise.reject(new Error("Account number is required.")):Promise.resolve(void 0);const u=a.replace(/\s+/g,"");if(e){if(o.validateAccountNumber(u,e))return Promise.resolve(u);const n=null===(i=r.from(e))||void 0===i?void 0:i.name,t=function(e){return{TZ:"Account number should be 9-19 characters long.",KE:"Account number should be 10, 12, or 15 alphanumeric characters."}[e]||"Please enter a valid account number."}(e);return Promise.reject(new Error(`Invalid ${n} account number format. ${t}`))}return o.validateAccountNumberForAnyCountry(u)?Promise.resolve(u):Promise.reject(new Error("Invalid account number format"))},l=(e={})=>{const{currencyCode:r="TZS",invalidFormatMessage:o,minMessage:t,maxMessage:i}=e,{defaultMin:a,defaultMax:u}=(e=>{switch(e){case"TZS":return{defaultMin:1e3,defaultMax:1e6};case"KES":return{defaultMin:40,defaultMax:4e7};default:return{defaultMin:1,defaultMax:1e6}}})(r),s=void 0!==e.min?e.min:a,l=void 0!==e.max?e.max:u;return(e,a)=>{const u=null==a?void 0:a.toString().trim();if(!u)return e.required?Promise.reject(new Error("Amount is required.")):Promise.resolve(void 0);const m=n.from(u,r);if(!m)return Promise.reject(new Error(o||'Invalid amount format. Please enter a valid monetary amount (e.g., "1000", "1,234.56").'));const d=m.numericValue;if(m.isNegative())return Promise.reject(new Error("Negative amounts are not allowed. Please enter a positive amount."));if(null!==s&&d<s){const e=n.from(s,r);return Promise.reject(new Error(t||`Amount must be at least ${(null==e?void 0:e.label)||s}. Please enter a higher amount.`))}if(null!==l&&d>l){const e=n.from(l,r);return Promise.reject(new Error(i||`Amount must not exceed ${(null==e?void 0:e.label)||l}. Please enter a lower amount.`))}return Promise.resolve(m.formattedNumericValue)}};export{a as ACCOUNT_NAME_VALIDATOR,s as ACCOUNT_NUMBER_VALIDATOR,l as AMOUNT_VALIDATOR,i as MOBILE_PHONE_VALIDATOR,t as PHONE_NUMBER_VALIDATOR,u as SWIFT_CODE_VALIDATOR};
1
+ import{j as r,u as o,T as t}from"./theme-provider-D_oV1J_K.js";import s from"@ebay/nice-modal-react";import{useEffect as e}from"react";import{ToastContainer as i}from"react-toastify";import"lodash";import{T as n}from"./tembo-notify-C-QGduBt.js";import"antd";import"./InfoCircleOutlined-DYs90hdV.js";import"./ZoomOutOutlined-BL6A5RSq.js";const m=o=>r.jsx(s.Provider,{children:o.children}),c=t=>{const{colors:s,constants:m}=o();return e(()=>{n.init(s,m)},[s,m]),r.jsx(i,Object.assign({},t))},a=({children:o,colors:s,constants:e,themeOverrides:i})=>r.jsx(t,{colors:s,constants:e,themeOverrides:i,children:r.jsxs(m,{children:[o,r.jsx(c,{})]})});export{a as TemboUIProviders};
2
2
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/antd-validators.ts"],"sourcesContent":[null],"names":["PHONE_NUMBER_VALIDATOR","countryCode","rule","value","phoneString","toString","trim","required","Promise","reject","Error","resolve","undefined","PhoneNumberFactory","canCreate","defaultCountry","phoneInstance","create","e164Format","countryName","_a","Country","from","name","MOBILE_PHONE_VALIDATOR","checkPayoutEligibility","ACCOUNT_NAME_VALIDATOR","accountNameString","BankValidation","validateAccountName","SWIFT_CODE_VALIDATOR","swiftCodeString","toUpperCase","validateSwiftCode","validateSwiftCodeForAnyCountry","ACCOUNT_NUMBER_VALIDATOR","accountNumberString","normalizedAccountNumber","replace","validateAccountNumber","formatHint","TZ","KE","getAccountNumberFormatHint","validateAccountNumberForAnyCountry","AMOUNT_VALIDATOR","options","currencyCode","invalidFormatMessage","minMessage","maxMessage","defaultMin","defaultMax","currency","getDefaultConstraints","min","max","amountString","amountInstance","Amount","numericValue","isNegative","minAmount","label","maxAmount","formattedNumericValue"],"mappings":"2GAqBO,MAAMA,EAA0BC,GAC9B,CACLC,EACAC,WAEA,M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hD,QAAQG,QAAQ+C,EAAeO"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/features/dialogs/modal-provider.tsx","../src/features/notifications/toast-container.tsx","../src/providers.tsx"],"sourcesContent":[null,null,null],"names":["TemboModalProvider","props","_jsx","NiceModal","Provider","children","TemboToastContainer","colors","constants","useTemboTheme","useEffect","TemboNotify","init","ToastContainer","Object","assign","TemboUIProviders","themeOverrides","TemboThemeProvider","_jsxs"],"mappings":"iVAGA,MAAMA,EAAmDC,GAC9CC,EAAAA,IAACC,EAAUC,mBAAUH,EAAMI,WCOhCC,EAA2DL,IAC7D,MAAMM,OAAEA,EAAMC,UAAEA,GAAcC,IAO9B,OAJAC,EAAU,KACNC,EAAYC,KAAKL,EAAQC,IAC1B,CAACD,EAAQC,IAELN,EAAAA,IAACW,EAAcC,OAAAC,OAAA,CAAA,EAAKd,KCwBlBe,EAAoD,EAC7DX,WACAE,SACAC,YACAS,oBAGIf,EAAAA,IAACgB,EAAkB,CACfX,OAAQA,EACRC,UAAWA,EACXS,eAAgBA,EAAcZ,SAE9Bc,EAAAA,KAACnB,EAAkB,CAAAK,SAAA,CACdA,EACDH,EAAAA,IAACI,EAAmB,CAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("../tembo-notify-D-uOV3t0.js");require("../theme-provider-Dqvy24OD.js"),require("react"),require("react-toastify"),require("lodash"),require("../InfoCircleOutlined-B7d2aRfV.js"),require("../ZoomOutOutlined-BY_CCwq7.js"),require("antd"),exports.TemboNotify=e.TemboNotify,exports.buildToastConfigs=e.buildToastConfigs;
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export{T as TemboNotify,b as buildToastConfigs}from"../tembo-notify-C-QGduBt.js";import"../theme-provider-D_oV1J_K.js";import"react";import"react-toastify";import"lodash";import"../InfoCircleOutlined-DYs90hdV.js";import"../ZoomOutOutlined-BL6A5RSq.js";import"antd";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { TemboThemeProviderProps } from './theme/index.js';
3
+ export interface TemboUIProvidersProps {
4
+ children: React.ReactNode;
5
+ /** Color palette overrides */
6
+ colors?: TemboThemeProviderProps['colors'];
7
+ /** UI constants overrides */
8
+ constants?: TemboThemeProviderProps['constants'];
9
+ /** Raw Ant Design theme overrides */
10
+ themeOverrides?: TemboThemeProviderProps['themeOverrides'];
11
+ }
12
+ /**
13
+ * Top-level provider that wires up theme, modal and notifications
14
+ * for all Tembo UI components.
15
+ *
16
+ * Supports theme customization through colors and constants props.
17
+ * TemboToastContainer automatically syncs with theme changes.
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * // Basic usage
22
+ * <TemboUIProviders>
23
+ * <App />
24
+ * </TemboUIProviders>
25
+ *
26
+ * // With custom colors
27
+ * <TemboUIProviders
28
+ * colors={{
29
+ * primary: { main: '#007bff' },
30
+ * action: { main: '#28a745' }
31
+ * }}
32
+ * >
33
+ * <App />
34
+ * </TemboUIProviders>
35
+ * ```
36
+ */
37
+ export declare const TemboUIProviders: React.FC<TemboUIProvidersProps>;
@@ -0,0 +1,2 @@
1
+ import{toast as o}from"react-toastify";import{j as s}from"./theme-provider-D_oV1J_K.js";import{b as i,c as n,R as t,a as e}from"./InfoCircleOutlined-DYs90hdV.js";import"./ZoomOutOutlined-BL6A5RSq.js";const l=(o,l)=>{const r={position:"top-right",autoClose:4e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,style:{fontFamily:l.typography.fontFamily,fontSize:l.typography.fontSize.base,borderRadius:l.radius.base}},a=Object.assign(Object.assign({},r),{icon:s.jsx(i,{style:{fontSize:20,color:o.success.main}}),style:Object.assign(Object.assign({},r.style),{border:`1px solid ${o.success.border}`})}),c=Object.assign(Object.assign({},r),{icon:s.jsx(n,{style:{fontSize:20,color:o.error.main}}),style:Object.assign(Object.assign({},r.style),{border:`1px solid ${o.error.border}`}),autoClose:6e3}),g=Object.assign(Object.assign({},r),{icon:s.jsx(t,{style:{fontSize:20,color:o.warning.main}}),style:Object.assign(Object.assign({},r.style),{border:`1px solid ${o.warning.border}`})}),u=Object.assign(Object.assign({},r),{icon:s.jsx(e,{style:{fontSize:20,color:o.info.main}}),style:Object.assign(Object.assign({},r.style),{border:`1px solid ${o.info.border}`})});return{loadingConfig:Object.assign(Object.assign({},r),{autoClose:!1,closeButton:!1}),infoConfig:u,warningConfig:g,errorConfig:c,successConfig:a,baseConfig:r}};class r{static init(o,s){this.configs=l(o,s)}static getConfigs(){if(!this.configs)throw new Error("TemboNotify not initialized. Call TemboNotify.init(colors, constants) before using notifications.");return this.configs}static success(s,i){var n;const t=this.getConfigs();return o.success(s,Object.assign(Object.assign({},t.successConfig),{autoClose:null!==(n=null==i?void 0:i.duration)&&void 0!==n?n:t.successConfig.autoClose,position:null==i?void 0:i.position,onClick:null==i?void 0:i.onClick,onClose:null==i?void 0:i.onClose}))}static error(s,i){var n;const t=this.getConfigs();return o.error(s,Object.assign(Object.assign({},t.errorConfig),{autoClose:null!==(n=null==i?void 0:i.duration)&&void 0!==n?n:t.errorConfig.autoClose,position:null==i?void 0:i.position,onClick:null==i?void 0:i.onClick,onClose:null==i?void 0:i.onClose}))}static warning(s,i){var n;const t=this.getConfigs();return o.warning(s,Object.assign(Object.assign({},t.warningConfig),{autoClose:null!==(n=null==i?void 0:i.duration)&&void 0!==n?n:t.warningConfig.autoClose,position:null==i?void 0:i.position,onClick:null==i?void 0:i.onClick,onClose:null==i?void 0:i.onClose}))}static info(s,i){var n;const t=this.getConfigs();return o.info(s,Object.assign(Object.assign({},t.infoConfig),{autoClose:null!==(n=null==i?void 0:i.duration)&&void 0!==n?n:t.infoConfig.autoClose,position:null==i?void 0:i.position,onClick:null==i?void 0:i.onClick,onClose:null==i?void 0:i.onClose}))}static loading(s,i){const n=this.getConfigs();return o.loading(s,Object.assign(Object.assign({},n.loadingConfig),{position:null==i?void 0:i.position,onClick:null==i?void 0:i.onClick,onClose:null==i?void 0:i.onClose}))}static update(s,i){var n;const t=this.getConfigs(),e=i.type?{success:t.successConfig,error:t.errorConfig,warning:t.warningConfig,info:t.infoConfig}[i.type]:void 0;o.update(s,Object.assign({render:i.message,type:i.type,isLoading:!1,autoClose:null!==(n=i.autoClose)&&void 0!==n?n:null==e?void 0:e.autoClose},e))}static dismiss(s){o.dismiss(s)}static dismissAll(){o.dismiss()}static isActive(s){return o.isActive(s)}static promise(s,i,n){var t,e;const l=this.getConfigs();return o.promise(s,{pending:Object.assign({render:i.pending},l.loadingConfig),success:Object.assign(Object.assign({render:i.success},l.successConfig),{autoClose:null!==(t=null==n?void 0:n.duration)&&void 0!==t?t:l.successConfig.autoClose}),error:Object.assign(Object.assign({render:i.error},l.errorConfig),{autoClose:null!==(e=null==n?void 0:n.duration)&&void 0!==e?e:l.errorConfig.autoClose})},{position:null==n?void 0:n.position})}}r.configs=null;export{r as T,l as b};
2
+ //# sourceMappingURL=tembo-notify-C-QGduBt.js.map