@zonos/amino 5.1.29 → 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.gray400,geography:e,stroke:n?l.theme.blue300:l.theme.gray500,strokeWidth:1},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
+ "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})]})]})})};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zonos/amino",
3
- "version": "5.1.29",
3
+ "version": "5.1.30",
4
4
  "description": "Core UI components for Amino",
5
5
  "repository": "git@github.com:Zonos/amino.git",
6
6
  "license": "MIT",