@zonos/amino 5.1.28 → 5.1.30
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-ccfac372.js"),r=require("react/jsx-runtime"),n=require("react"),t=require("react-simple-maps"),i=require("d3-geo"),o=require("styled-components"),a=require("topojson-client"),s=require("../skeleton/Skeleton.js"),l=require("../../styles/constants/theme.js"),u=require("../../utils/getCountryCodeByName.js");function d(e){return e&&e.__esModule?e:{default:e}}var c,h,m=d(o),f=m.default.div(c||(c=e.__makeTemplateObject(["\n background: ",";\n border-radius: ",";\n overflow: hidden;\n\n * {\n outline: none;\n }\n"],["\n background: ",";\n border-radius: ",";\n overflow: hidden;\n\n * {\n outline: none;\n }\n"])),l.theme.gray50,l.theme.radius12),g=m.default(s.Skeleton)(h||(h=e.__makeTemplateObject(["\n box-sizing: border-box;\n border-radius: ",";\n width: 100%;\n /* 50% padding is 100% of width, ratio is 33%, so half */\n padding: 16.5%;\n margin: 0;\n"],["\n box-sizing: border-box;\n border-radius: ",";\n width: 100%;\n /* 50% padding is 100% of width, ratio is 33%, so half */\n padding: 16.5%;\n margin: 0;\n"])),l.theme.radius12);exports.ConnectionMap=function(o){var s=o.countries,d=o.from,c=o.height,h=void 0===c?400:c,m=o.to,b=o.worldData,j=e.__read(n.useState([0,0]),2),p=j[0],x=j[1],_=e.__read(n.useState(1),2),v=_[0],k=_[1],y=e.__read(n.useState([0,0,0]),2),M=y[0],q=y[1],C=n.useMemo((function(){return b?a.feature(b,b.objects.countries).features:null}),[b]),w=n.useCallback((function(e){var r=null==C?void 0:C.find((function(r){var n;return u.getCountryCodeByName(null===(n=r.properties)||void 0===n?void 0:n.name,s)===e}));return r?i.geoCentroid(r):[0,0]}),[s,C]),S=!(C&&s.length&&d&&m);return n.useEffect((function(){if(!S){var r=e.__read(w(d),2),n=r[0],t=r[1],o=e.__read(w(m),2),a=o[0],s=o[1],l=i.geoDistance([n,t],[a,s]),u=i.geoDistance([n,0],[a,0]),c=i.geoDistance([0,t],[0,s]),h=function(e,r){return-19.46498024*e+-92.29376925*r+284.7+(e+r>4?80*(e+r-4):0)}(u,c);k(h);var f=e.__read([(n+a)/2,(t+s)/2],2),g=f[0],b=f[1];x([0,b]);var j=-g;Math.abs(n-a)>180&&(j+=180);var p=Math.abs(b)>55?l*-(Math.abs(b)-50):0,_=c>1&&u>c&&Math.max(t,s)>50?u/c*-5:0;q([j,p+_,0])}}),[w,m,d,S]),S?r.jsx(g,{height:h}):r.jsx(f,{children:r.jsxs(t.ComposableMap,{height:h,projection:"geoEqualEarth",projectionConfig:{center:p,rotate:M,scale:v},children:[r.jsx(t.Geographies,{geography:C,children:function(e){return e.geographies.map((function(e){var n=[m,d].includes(u.getCountryCodeByName(e.properties.name,s));return r.jsx(t.Geography,{fill:n?l.theme.blue100:l.theme.
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),r=require("react/jsx-runtime"),n=require("react"),t=require("react-simple-maps"),i=require("d3-geo"),o=require("styled-components"),a=require("topojson-client"),s=require("../skeleton/Skeleton.js"),l=require("../../styles/constants/theme.js"),u=require("../../utils/getCountryCodeByName.js");function d(e){return e&&e.__esModule?e:{default:e}}var c,h,m=d(o),f=m.default.div(c||(c=e.__makeTemplateObject(["\n background: ",";\n border-radius: ",";\n overflow: hidden;\n\n * {\n outline: none;\n }\n"],["\n background: ",";\n border-radius: ",";\n overflow: hidden;\n\n * {\n outline: none;\n }\n"])),l.theme.gray50,l.theme.radius12),g=m.default(s.Skeleton)(h||(h=e.__makeTemplateObject(["\n box-sizing: border-box;\n border-radius: ",";\n width: 100%;\n /* 50% padding is 100% of width, ratio is 33%, so half */\n padding: 16.5%;\n margin: 0;\n"],["\n box-sizing: border-box;\n border-radius: ",";\n width: 100%;\n /* 50% padding is 100% of width, ratio is 33%, so half */\n padding: 16.5%;\n margin: 0;\n"])),l.theme.radius12);exports.ConnectionMap=function(o){var s=o.countries,d=o.from,c=o.height,h=void 0===c?400:c,m=o.to,b=o.worldData,j=e.__read(n.useState([0,0]),2),p=j[0],x=j[1],_=e.__read(n.useState(1),2),v=_[0],k=_[1],y=e.__read(n.useState([0,0,0]),2),M=y[0],q=y[1],C=n.useMemo((function(){return b?a.feature(b,b.objects.countries).features:null}),[b]),w=n.useCallback((function(e){var r=null==C?void 0:C.find((function(r){var n;return u.getCountryCodeByName(null===(n=r.properties)||void 0===n?void 0:n.name,s)===e}));return r?i.geoCentroid(r):[0,0]}),[s,C]),S=!(C&&s.length&&d&&m);return n.useEffect((function(){if(!S){var r=e.__read(w(d),2),n=r[0],t=r[1],o=e.__read(w(m),2),a=o[0],s=o[1],l=i.geoDistance([n,t],[a,s]),u=i.geoDistance([n,0],[a,0]),c=i.geoDistance([0,t],[0,s]),h=function(e,r){return-19.46498024*e+-92.29376925*r+284.7+(e+r>4?80*(e+r-4):0)}(u,c);k(h);var f=e.__read([(n+a)/2,(t+s)/2],2),g=f[0],b=f[1];x([0,b]);var j=-g;Math.abs(n-a)>180&&(j+=180);var p=Math.abs(b)>55?l*-(Math.abs(b)-50):0,_=c>1&&u>c&&Math.max(t,s)>50?u/c*-5:0;q([j,p+_,0])}}),[w,m,d,S]),S?r.jsx(g,{height:h}):r.jsx(f,{children:r.jsxs(t.ComposableMap,{height:h,projection:"geoEqualEarth",projectionConfig:{center:p,rotate:M,scale:v},children:[r.jsx(t.Geographies,{geography:C,children:function(e){return e.geographies.map((function(e){var n=[m,d].includes(u.getCountryCodeByName(e.properties.name,s));return r.jsx(t.Geography,{fill:n?l.theme.blue100:l.theme.gray0,geography:e,stroke:n?l.theme.blue400:l.theme.gray200,strokeWidth:2},e.rsmKey)}))}}),r.jsxs(t.Marker,{coordinates:w(d),children:[r.jsx("circle",{fill:l.theme.blue300,r:10}),r.jsx("circle",{fill:l.theme.blue400,r:7})]}),r.jsxs(t.Marker,{coordinates:w(m),children:[r.jsx("circle",{fill:l.theme.blue300,r:10}),r.jsx("circle",{fill:l.theme.blue400,r:7})]}),r.jsx(t.Line,{from:w(d),stroke:l.theme.blue600,strokeWidth:4,to:w(m)}),r.jsxs(t.Marker,{coordinates:w(d),children:[r.jsx("circle",{fill:"white",r:4}),r.jsx("circle",{fill:l.theme.blue600,r:2})]}),r.jsxs(t.Marker,{coordinates:w(m),children:[r.jsx("circle",{fill:"white",r:4}),r.jsx("circle",{fill:l.theme.blue600,r:2})]})]})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var n=require("../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),r=require("framer-motion"),a=require("styled-components"),t=require("../../icons/CheckCircleIcon.js"),g=require("../../icons/InfoIcon.js"),o=require("../../icons/RemoveCircleIcon.js"),i=require("../../icons/WarningIcon.js"),s=require("../../styles/constants/theme.js");function c(n){return n&&n.__esModule?n:{default:n}}require("react"),require("../../icons/icon-base/_IconBase.js");var d,l,b,u,h,m=c(a),y=m.default(r.motion.div)(d||(d=n.__makeTemplateObject(["\n background: linear-gradient(\n 90deg,\n rgba(148, 150, 158, 0.4) 0%,\n rgba(148, 150, 158, 0) 50%\n ),\n ",";\n z-index: 999999;\n border-radius: ",";\n color: ",";\n box-shadow: ",";\n padding: ",";\n display: flex;\n align-items: center;\n gap: ",";\n font-weight: 500;\n user-select: none;\n\n & + & {\n margin-top: ",";\n }\n\n & svg {\n color: ",";\n }\n\n [data-theme='night'] & {\n background: linear-gradient(\n 90deg,\n rgba(148, 150, 158, 0.24) 0%,\n rgba(148, 150, 158, 0) 50%\n ),\n ",";\n color: ",";\n\n & svg {\n color: ",";\n }\n }\n"],["\n background: linear-gradient(\n 90deg,\n rgba(148, 150, 158, 0.4) 0%,\n rgba(148, 150, 158, 0) 50%\n ),\n ",";\n z-index: 999999;\n border-radius: ",";\n color: ",";\n box-shadow: ",";\n padding: ",";\n display: flex;\n align-items: center;\n gap: ",";\n font-weight: 500;\n user-select: none;\n\n & + & {\n margin-top: ",";\n }\n\n & svg {\n color: ",";\n }\n\n [data-theme='night'] & {\n background: linear-gradient(\n 90deg,\n rgba(148, 150, 158, 0.24) 0%,\n rgba(148, 150, 158, 0) 50%\n ),\n ",";\n color: ",";\n\n & svg {\n color: ",";\n }\n }\n"])),s.theme.gray1200,s.theme.radius12,s.theme.gray0,s.theme.v3ShadowLarge,s.theme.space16,s.theme.space12,s.theme.space24,s.theme.gray500,s.theme.gray50,s.theme.gray1200,s.theme.gray600),k=m.default(y)(l||(l=n.__makeTemplateObject(["\n background: linear-gradient(\n 90deg,\n rgba(86, 199, 111, 0.4) 0%,\n rgba(86, 199, 111, 0) 50%\n ),\n ",";\n\n & svg {\n color: ",";\n }\n\n [data-theme='night'] & {\n background: linear-gradient(\n 90deg,\n rgba(86, 199, 111, 0.24) 0%,\n rgba(86, 199, 111, 0) 50%\n ),\n ",";\n\n & svg {\n color: ",";\n }\n }\n"],["\n background: linear-gradient(\n 90deg,\n rgba(86, 199, 111, 0.4) 0%,\n rgba(86, 199, 111, 0) 50%\n ),\n ",";\n\n & svg {\n color: ",";\n }\n\n [data-theme='night'] & {\n background: linear-gradient(\n 90deg,\n rgba(86, 199, 111, 0.24) 0%,\n rgba(86, 199, 111, 0) 50%\n ),\n ",";\n\n & svg {\n color: ",";\n }\n }\n"])),s.theme.gray1200,s.theme.green500,s.theme.gray50,s.theme.green600),v=m.default(y)(b||(b=n.__makeTemplateObject(["\n background: linear-gradient(\n 90deg,\n rgba(249, 92, 103, 0.4) 0%,\n rgba(249, 92, 103, 0) 50%\n ),\n ",";\n\n & svg {\n color: ",";\n }\n\n [data-theme='night'] & {\n background: linear-gradient(\n 90deg,\n rgba(249, 92, 103, 0.24) 0%,\n rgba(249, 92, 103, 0) 50%\n ),\n ",";\n\n & svg {\n color: ",";\n }\n }\n"],["\n background: linear-gradient(\n 90deg,\n rgba(249, 92, 103, 0.4) 0%,\n rgba(249, 92, 103, 0) 50%\n ),\n ",";\n\n & svg {\n color: ",";\n }\n\n [data-theme='night'] & {\n background: linear-gradient(\n 90deg,\n rgba(249, 92, 103, 0.24) 0%,\n rgba(249, 92, 103, 0) 50%\n ),\n ",";\n\n & svg {\n color: ",";\n }\n }\n"])),s.theme.gray1200,s.theme.red500,s.theme.gray50,s.theme.red600),p=m.default(y)(u||(u=n.__makeTemplateObject(["\n background: linear-gradient(\n 90deg,\n rgba(248, 140, 83, 0.4) 0%,\n rgba(248, 140, 83, 0) 50%\n ),\n ",";\n\n & svg {\n color: ",";\n }\n\n [data-theme='night'] & {\n background: linear-gradient(\n 90deg,\n rgba(248, 140, 83, 0.24) 0%,\n rgba(248, 140, 83, 0) 50%\n ),\n ",";\n\n & svg {\n color: ",";\n }\n }\n"],["\n background: linear-gradient(\n 90deg,\n rgba(248, 140, 83, 0.4) 0%,\n rgba(248, 140, 83, 0) 50%\n ),\n ",";\n\n & svg {\n color: ",";\n }\n\n [data-theme='night'] & {\n background: linear-gradient(\n 90deg,\n rgba(248, 140, 83, 0.24) 0%,\n rgba(248, 140, 83, 0) 50%\n ),\n ",";\n\n & svg {\n color: ",";\n }\n }\n"])),s.theme.gray1200,s.theme.orange500,s.theme.gray50,s.theme.orange600),_=m.default(y)(h||(h=n.__makeTemplateObject(["\n background: linear-gradient(\n 90deg,\n rgba(95, 146, 246, 0.4) 0%,\n rgba(95, 146, 246, 0) 50%\n ),\n ",";\n\n & svg {\n color: ",";\n }\n\n [data-theme='night'] & {\n background: linear-gradient(\n 90deg,\n rgba(95, 146, 246, 0.24) 0%,\n rgba(95, 146, 246, 0) 50%\n ),\n ",";\n\n & svg {\n color: ",";\n }\n }\n"],["\n background: linear-gradient(\n 90deg,\n rgba(95, 146, 246, 0.4) 0%,\n rgba(95, 146, 246, 0) 50%\n ),\n ",";\n\n & svg {\n color: ",";\n }\n\n [data-theme='night'] & {\n background: linear-gradient(\n 90deg,\n rgba(95, 146, 246, 0.24) 0%,\n rgba(95, 146, 246, 0) 50%\n ),\n ",";\n\n & svg {\n color: ",";\n }\n }\n"])),s.theme.gray1200,s.theme.blue500,s.theme.gray50,s.theme.blue600);exports.Toast=function(r){var a=r.children,s=r.direction,c=r.intent,d=r.toastKey,l=function(){switch(s){case"top":return{opacity:0,translateX:0,translateY:-10};case"bottom":return{opacity:0,translateX:0,translateY:10};case"left":return{opacity:0,translateX:-10,translateY:0};default:return{opacity:0,translateX:10,translateY:0}}},b={animate:{opacity:1,translateX:0,translateY:0},exit:l(),initial:l(),key:d};switch(c){case"success":return e.jsxs(k,n.__assign({layout:!0},b,{children:[e.jsx(t.CheckCircleIcon,{}),a]}));case"error":return e.jsxs(v,n.__assign({layout:!0},b,{children:[e.jsx(o.RemoveCircleIcon,{}),a]}));case"warning":return e.jsxs(p,n.__assign({layout:!0},b,{children:[e.jsx(i.WarningIcon,{}),a]}));case"info":return e.jsxs(_,n.__assign({layout:!0},b,{children:[e.jsx(g.InfoIcon,{}),a]}));default:return e.jsxs(y,n.__assign({layout:!0},b,{children:[e.jsx(g.InfoIcon,{}),a]}))}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-ccfac372.js"),t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),t=require("react/jsx-runtime"),r=require("react"),n=require("framer-motion"),o=require("styled-components"),i=require("uuid"),s=require("./Toast.js");function a(e){return e&&e.__esModule?e:{default:e}}require("../../icons/CheckCircleIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../styles/constants/theme.js"),require("../../icons/InfoIcon.js"),require("../../icons/RemoveCircleIcon.js"),require("../../icons/WarningIcon.js");var c,u=a(o),l=r.createContext((function(e,t){})),d=u.default.div(c||(c=e.__makeTemplateObject(["\n bottom: ",";\n left: ",";\n"],["\n bottom: ",";\n left: ",";\n"])),(function(e){var t;return(null===(t=e.location)||void 0===t?void 0:t.bottom)||""}),(function(e){var t;return(null===(t=e.location)||void 0===t?void 0:t.left)||""}));exports.ToastContext=l,exports.ToastContextProvider=function(o){var a=o.children,c=e.__read(r.useState([]),2),u=c[0],f=c[1],m=e.__read(r.useState({bottom:"",left:""}),2),v=m[0],j=m[1],_=r.useCallback((function(t,r){f((function(n){return e.__spreadArray(e.__spreadArray([],e.__read(n),!1),[{props:r,toast:t,uuid:i.v4()}],!1)})),setTimeout((function(){return f((function(e){return e.slice(1)}))}),(null==r?void 0:r.duration)||6e3)}),[f]),p=r.useCallback((function(e,t,r){r&&j({bottom:r.bottom||"",left:r.left||""}),_(e,t)}),[_]);return t.jsx(n.AnimatePresence,{children:t.jsxs(l.Provider,{value:p,children:[a,t.jsx("div",{className:"toast-container",children:t.jsx(d,{className:"toasts-wrapper",location:v,children:t.jsx(n.AnimatePresence,{children:u.map((function(e){var r=e.props,n=e.toast,o=e.uuid,i="toast-".concat(n,"-").concat(o);return t.jsx(s.Toast,{direction:null==r?void 0:r.direction,intent:null==r?void 0:r.intent,toastKey:i,children:n},i)}))})})})]})})};
|
package/package.json
CHANGED
package/utils/hooks/useNotify.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react"),
|
|
1
|
+
"use strict";var e=require("react"),r=require("../../components/toast/ToastContext.js");require("../../_tslib-ccfac372.js"),require("react/jsx-runtime"),require("framer-motion"),require("styled-components"),require("uuid"),require("../../components/toast/Toast.js"),require("../../icons/CheckCircleIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../styles/constants/theme.js"),require("../../icons/InfoIcon.js"),require("../../icons/RemoveCircleIcon.js"),require("../../icons/WarningIcon.js");exports.useNotify=function(){return e.useContext(r.ToastContext)};
|