@temboplus/frontend-react-core 0.1.3-beta.0 → 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.
- package/dist/InfoCircleOutlined-B7d2aRfV.js +7 -0
- package/dist/InfoCircleOutlined-B7d2aRfV.js.map +1 -0
- package/dist/InfoCircleOutlined-DYs90hdV.js +7 -0
- package/dist/InfoCircleOutlined-DYs90hdV.js.map +1 -0
- package/dist/ZoomOutOutlined-BL6A5RSq.js +2 -0
- package/dist/ZoomOutOutlined-BL6A5RSq.js.map +1 -0
- package/dist/ZoomOutOutlined-BY_CCwq7.js +2 -0
- package/dist/ZoomOutOutlined-BY_CCwq7.js.map +1 -0
- package/dist/alerts/index.cjs.js +2 -0
- package/dist/alerts/index.cjs.js.map +1 -0
- package/dist/alerts/index.js +2 -0
- package/dist/alerts/index.js.map +1 -0
- package/dist/dialogs/index.cjs.js +2 -0
- package/dist/dialogs/index.cjs.js.map +1 -0
- package/dist/dialogs/index.js +2 -0
- package/dist/dialogs/index.js.map +1 -0
- package/dist/features/alerts/alert.d.ts +12 -0
- package/dist/features/alerts/index.d.ts +1 -0
- package/dist/features/dialogs/index.d.ts +1 -0
- package/dist/features/dialogs/modal-provider.d.ts +3 -0
- package/dist/features/dialogs/tembo-confirm.d.ts +63 -0
- package/dist/features/input-validation/account-name-validator.d.ts +13 -0
- package/dist/features/input-validation/account-number-validator.d.ts +13 -0
- package/dist/{antd-validators.d.ts → features/input-validation/amount-validator.d.ts} +1 -62
- package/dist/features/input-validation/index.d.ts +5 -0
- package/dist/features/input-validation/phone-number-validator.d.ts +25 -0
- package/dist/features/input-validation/swift-code-validator.d.ts +13 -0
- package/dist/features/notifications/index.d.ts +3 -0
- package/dist/features/notifications/tembo-notify.d.ts +124 -0
- package/dist/features/notifications/toast-config.d.ts +15 -0
- package/dist/features/notifications/toast-container.d.ts +9 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/notifications/index.cjs.js +2 -0
- package/dist/notifications/index.cjs.js.map +1 -0
- package/dist/notifications/index.js +2 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/providers.d.ts +37 -0
- package/dist/tembo-notify-C-QGduBt.js +2 -0
- package/dist/tembo-notify-C-QGduBt.js.map +1 -0
- package/dist/tembo-notify-D-uOV3t0.js +2 -0
- package/dist/tembo-notify-D-uOV3t0.js.map +1 -0
- package/dist/theme/colors.d.ts +246 -0
- package/dist/theme/constants.d.ts +143 -0
- package/dist/theme/index.cjs.js +2 -0
- package/dist/theme/index.cjs.js.map +1 -0
- package/dist/theme/index.d.ts +3 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/theme-provider.d.ts +87 -0
- package/dist/theme-provider-D_oV1J_K.js +11 -0
- package/dist/theme-provider-D_oV1J_K.js.map +1 -0
- package/dist/theme-provider-Dqvy24OD.js +11 -0
- package/dist/theme-provider-Dqvy24OD.js.map +1 -0
- package/dist/validation/index.cjs.js +2 -0
- package/dist/validation/index.cjs.js.map +1 -0
- package/dist/validation/index.js +2 -0
- package/dist/validation/index.js.map +1 -0
- package/package.json +28 -7
|
@@ -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,UAAmB,IAE/B,QACI,OAAOH,EAAAA,kBAAAA,IAACI,EAAAA,UAAkB,MAKZC,CAAe9B,GAGnC+B,EAAY1B,EAAW,GAAS,EAmDtC,OACIoB,w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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,EAAAA,IAACC,EAAmB,IAC/B,IAAK,UACD,OAAOD,EAAAA,IAACE,EAAyB,IACrC,IAAK,QACD,OAAOF,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 -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,OAAQlB,EAAMmB,SACdC,aAAMC,EAAArB,EAAMsB,sBAAU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AAQ7C,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,OACIC,EAAAA,IAAC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AAC,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,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
|
|
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,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,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("
|
|
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
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/
|
|
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 "./
|
|
1
|
+
export * from "./providers.js";
|
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
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
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/
|
|
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
|