@corva/ui 0.26.0-0 → 0.26.0-4

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
- import e from"@babel/runtime/helpers/defineProperty";import{jsxs as r,jsx as i}from"react/jsx-runtime";import{makeStyles as n,TableRow as o,TableCell as l}from"@material-ui/core";import{memo as c}from"react";import{shape as t,number as a,func as m}from"prop-types";import{InfoOutlined as s}from"@material-ui/icons";import d from"../BHAComponentIcon.js";var p,h=n({tableBodyCell:{padding:0,borderBottom:"none",height:49},componentIconCell:{padding:0,borderBottom:"none",height:49,display:"flex",alignItems:"center"},infoIcon:{fontSize:16,color:"#ccc"},iconWrapper:(p={display:"inline-block",width:"40px",height:"48px"},e(p,"display","flex"),e(p,"justifyContent","center"),e(p,"marginRight","4px"),p)}),f=function(e){var n=e.component,c=e.order,t=e.onSelect,a=h(),m=a.tableBodyCell,p=a.componentIconCell,f=a.iconWrapper,u=a.infoIcon;return r(o,{children:[i(l,{className:m,children:c}),r(l,{className:p,children:[i("div",{className:f,children:i(d,{component:n})}),i("div",{children:n.family_name||n.family})]}),i(l,{className:m,children:n.name}),i(l,{className:m,children:n.outer_diameter}),i(l,{className:m,children:n.inner_diameter}),i(l,{className:m,children:n.linear_weight}),i(l,{className:m,children:n.length}),i(l,{className:m,children:n.weight}),i(l,{className:m,children:Number.isFinite(n.c_length)?n.c_length.toFixed(2):""}),i(l,{className:m,children:n.grade}),i(l,{className:m,children:i(s,{className:u,onClick:function(){return t(n)}})})]})};f.propTypes={component:t({}).isRequired,order:a.isRequired,onSelect:m.isRequired};var u=c(f);export default u;
1
+ import{jsxs as e,jsx as n}from"react/jsx-runtime";import{makeStyles as i,TableRow as r,TableCell as o}from"@material-ui/core";import{memo as c}from"react";import{shape as t,number as l,func as a}from"prop-types";import{InfoOutlined as m}from"@material-ui/icons";import s from"../BHAComponentIcon.js";var d=i({tableBodyCell:{padding:0,borderBottom:"none",height:49,fontSize:"13px"},componentIconCell:{padding:0,borderBottom:"none",height:49,display:"flex",alignItems:"center",fontSize:"13px"},infoIcon:{fontSize:16,color:"#ccc"},iconWrapper:{width:"40px",height:"48px",display:"flex",justifyContent:"center",marginRight:"4px"}}),p=function(i){var c=i.component,t=i.order,l=i.onSelect,a=d(),p=a.tableBodyCell,h=a.componentIconCell,f=a.iconWrapper,g=a.infoIcon;return e(r,{children:[n(o,{className:p,children:t}),e(o,{className:h,children:[n("div",{className:f,children:n(s,{component:c})}),n("div",{children:c.family_name||c.family})]}),n(o,{className:p,children:c.name}),n(o,{className:p,children:c.outer_diameter}),n(o,{className:p,children:c.inner_diameter}),n(o,{className:p,children:c.linear_weight}),n(o,{className:p,children:c.length}),n(o,{className:p,children:c.weight}),n(o,{className:p,children:Number.isFinite(c.c_length)?c.c_length.toFixed(2):""}),n(o,{className:p,children:c.grade}),n(o,{className:p,children:n(m,{className:g,onClick:function(){return l(c)}})})]})};p.propTypes={component:t({}).isRequired,order:l.isRequired,onSelect:a.isRequired};var h=c(p);export default h;
@@ -1 +1 @@
1
- import{getUnitDisplay as e}from"../../../utils/index.js";import{jsxs as t,jsx as l}from"react/jsx-runtime";import{makeStyles as r,Table as a,TableHead as s,TableRow as i,TableCell as n,TableBody as o}from"@material-ui/core";import{memo as d}from"react";import c from"prop-types";import h from"./BHAComponent.js";var m=r({tableStyle:{tableLayout:"fixed"},tableHeadCellStyle:{padding:"14px 0px",color:"#9E9E9E",borderTop:"1px solid rgba(81, 81, 81, 1)"}});function p(r){var d=r.components,c=r.onSelectComponent,p=m(),y=p.tableStyle,f=p.tableHeadCellStyle;return t(a,{className:y,children:[l(s,{children:t(i,{children:[l(n,{className:f,style:{width:"2%"},children:"#"}),l(n,{className:f,style:{width:"13%",paddingLeft:44},children:"Category"}),l(n,{className:f,style:{width:"13%"},children:"Name"}),t(n,{className:f,style:{width:"7%"},children:["OD (",e("shortLength"),")"]}),t(n,{className:f,style:{width:"7%"},children:["ID (",e("shortLength"),")"]}),t(n,{className:f,style:{width:"15%"},children:["Linear Weight (",e("massPerLength"),")"]}),t(n,{className:f,style:{width:"10%"},children:["Length (",e("length"),")"]}),t(n,{className:f,style:{width:"10%"},children:["Weight (",e("mass"),")"]}),t(n,{className:f,style:{width:"13%"},children:["Cum.Length (",e("length"),")"]}),l(n,{className:f,style:{width:"7%"},children:"Grade"}),l(n,{className:f,style:{width:"3%"}})]})}),l(o,{children:d.map((function(e,t){return l(h,{component:e,order:t+1,onSelect:c},e.id)}))})]})}p.propTypes={components:c.arrayOf(c.shape({})).isRequired,onSelectComponent:c.func.isRequired};var y=d(p);export default y;
1
+ import{getUnitDisplay as e}from"../../../utils/index.js";import{jsxs as t,jsx as l}from"react/jsx-runtime";import{makeStyles as r,Table as a,TableHead as s,TableRow as i,TableCell as n,TableBody as o}from"@material-ui/core";import{memo as d}from"react";import c from"prop-types";import h from"./BHAComponent.js";var m=r({tableStyle:{tableLayout:"fixed"},tableHeadCellStyle:{height:"38px",padding:"0px",color:"#999999",fontSize:"12px",borderTop:"1px solid rgba(81, 81, 81, 1)"}});function p(r){var d=r.components,c=r.onSelectComponent,p=m(),y=p.tableStyle,f=p.tableHeadCellStyle;return t(a,{className:y,children:[l(s,{children:t(i,{children:[l(n,{className:f,style:{width:"2%"},children:"#"}),l(n,{className:f,style:{width:"13%",paddingLeft:44},children:"Category"}),l(n,{className:f,style:{width:"13%"},children:"Name"}),t(n,{className:f,style:{width:"7%"},children:["OD (",e("shortLength"),")"]}),t(n,{className:f,style:{width:"7%"},children:["ID (",e("shortLength"),")"]}),t(n,{className:f,style:{width:"15%"},children:["Linear Weight (",e("massPerLength"),")"]}),t(n,{className:f,style:{width:"10%"},children:["Length (",e("length"),")"]}),t(n,{className:f,style:{width:"10%"},children:["Weight (",e("mass"),")"]}),t(n,{className:f,style:{width:"13%"},children:["Cum.Length (",e("length"),")"]}),l(n,{className:f,style:{width:"7%"},children:"Grade"}),l(n,{className:f,style:{width:"3%"}})]})}),l(o,{children:d.map((function(e,t){return l(h,{component:e,order:t+1,onSelect:c},e.id)}))})]})}p.propTypes={components:c.arrayOf(c.shape({})).isRequired,onSelectComponent:c.func.isRequired};var y=d(p);export default y;
@@ -1 +1 @@
1
- import{jsxs as e,Fragment as t,jsx as r}from"react/jsx-runtime";import{makeStyles as i,Chip as n,Tooltip as a}from"@material-ui/core";import l from"prop-types";import o from"../TruncatedText/index.js";import m from"@babel/runtime/helpers/toArray";var c=i({assetsCount:{maxWidth:168,whiteSpace:"nowrap"},countChip:{marginLeft:8}}),s=function(i){var l=i.items,s=i.limit,p=c(),h=m(l),u=h[0],d=h.slice(1);return e(t,{children:[r(n,{label:r("div",{className:p.assetsCount,children:r(o,{children:u})})}),l.length>1&&r(a,{title:r("div",{children:d.map((function(t,r){return e("div",{children:[t,"".concat(r<d.length-1?",":"")]},t)}))}),children:r(n,{label:l.length<=s?"+".concat(l.length-1):"".concat(s-1,"+"),className:p.countChip})})]})};s.propTypes={items:l.arrayOf(l.shape({})).isRequired,limit:l.number},s.defaultProps={limit:100};export default s;
1
+ import{isEmpty as e}from"lodash";import{jsxs as t,Fragment as r,jsx as i}from"react/jsx-runtime";import{makeStyles as n,Chip as a,Tooltip as l}from"@material-ui/core";import o from"prop-types";import m from"../TruncatedText/index.js";import c from"@babel/runtime/helpers/toArray";var s=n({assetsCount:{maxWidth:168,whiteSpace:"nowrap"},countChip:{marginLeft:8}}),p=function(n){var o=n.items,p=n.limit,h=s(),u=c(o),d=u[0],f=u.slice(1);return e(o)?null:t(r,{children:[i(a,{label:i("div",{className:h.assetsCount,children:i(m,{children:d})})}),o.length>1&&i(l,{title:i("div",{children:f.map((function(e,r){return t("div",{children:[e,"".concat(r<f.length-1?",":"")]},e)}))}),children:i(a,{label:o.length<=p?"+".concat(o.length-1):"".concat(p-1,"+"),className:h.countChip})})]})};p.propTypes={items:o.arrayOf(o.shape({})).isRequired,limit:o.number},p.defaultProps={limit:100};export default p;
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/defineProperty";import{sumBy as e,upperFirst as i}from"lodash";import r from"@babel/runtime/helpers/slicedToArray";import{jsxs as n,jsx as o,Fragment as a}from"react/jsx-runtime";import{makeStyles as c,Typography as l,Tooltip as s}from"@material-ui/core";import{useRef as d,useState as p,useMemo as u,useEffect as h,createRef as m}from"react";import f from"prop-types";import g from"classnames";import{Regular14 as x}from"../Typography.js";import{drawRadicalGradient as v,drawDonutSlice as b}from"./utils.js";var y=c({root:{width:"228px",height:"228px",borderRadius:"50%",padding:"6px",position:"relative",background:"url(".concat("/static/media/9bda514bfc837939d0b6f7d8dbe94d03.svg",")"),backgroundRepeat:"no-repeat"},backgroundRoot:{width:"100%",height:"100%",borderRadius:"50%",border:"2px solid #616161",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:"url(".concat("/static/media/49092309a3fda5ecf77311bd794ac103.svg",")")},emptyStateBackground:{background:"radial-gradient(50% 50% at 50% 50%, rgba(100, 181, 246, 0) 54.4%, rgba(100, 181, 246, 0.01) 76.49%, rgba(100, 181, 246, 0.06) 100%)"},dropShadowRoot:{width:"100%",height:"100%",borderRadius:"50%",filter:"blur(36px)",border:"2px solid #64B5F6",display:"flex",alignItems:"center",justifyContent:"center"},content:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",left:0,top:0},lastActivityRoot:{width:"90px",height:"90px",background:"#3B3B3B",boxShadow:"0px 2px 2px rgba(0, 0, 0, 0.1), inset 0px 1px 1px rgba(255, 255, 255, 0.05)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"8px 0"},activityDuration:{fontSize:"36px",lineHeight:"24px",fontWeight:300,letterSpacing:"0.4px"},durationUnit:{fontSize:"12px",lineHeight:"24px",fontWeight:500,letterSpacing:"0.4px"},activityTimeRange:{fontSize:"10px",textTransform:"uppercase",color:"#9E9E9E",lineHeight:"24px",fontWeight:500,letterSpacing:"1px"},activityName:{fontSize:"12px",lineHeight:"14px",fontWeight:500},noOperationsRoot:{width:90,height:90},noOperationsText:{marginTop:24,color:"#9E9E9E"},chart:{position:"absolute",left:2,top:2,width:"100%",height:"100%",padding:"12px"},canvas:{width:"100%",height:"100%"},activities:{position:"absolute",left:12,top:12}});function w(c){var f=c.currentActivityName,w=c.activities,N=c.showTooltip,R=y(),S=d(null),T=d([]),k=p(null),E=r(k,2),j=E[0],C=E[1],A=u((function(){return w.filter((function(t){return t.duration}))}),[w]),B=u((function(){return e(w,"duration")}),[w]),I=u((function(){return null===j?w.find((function(t){return t.name===f})):A[j]}),[w,f,A,j]),O=function(t){var e=!1;T.current.forEach((function(i,r){var n=i.current;if(n&&!e){var o=n.getContext("2d");(e=o.isPointInPath(t.offsetX,t.offsetY))&&C(r)}})),e||C(null)};return h((function(){var t=S.current,e=t.getContext("2d");t.width=200,t.height=200,t.style.width="".concat(200,"px"),t.style.height="".concat(200,"px");var i=A.length;T.current.length!==i&&(T.current=Array(i).fill().map((function(t,e){return T.current[e]||m()})));var r=0;A.forEach((function(t,i){var n=r,o=n+t.duration/B*Math.PI*2;(null===j&&t.name===f||i===j)&&v(e,100,100,100,n,o);var a=T.current[i].current;if(a){a.width=200,a.height=200,a.style.width="".concat(200,"px"),a.style.height="".concat(200,"px"),N&&(a.onmousemove=O);var c=a.getContext("2d");b(c,100,100,100,n,o,t.color||"#000000",!0)}else b(e,100,100,100,n,o,t.color||"#000000",!0);r=o}))})),n("div",{className:R.root,children:[o("div",{className:g(R.backgroundRoot,t({},R.emptyStateBackground,!w.length)),children:o("div",{className:R.dropShadowRoot})}),n("div",{className:R.content,children:[o(l,{className:R.activityTimeRange,children:"Last 24hrs"}),w.length?n(a,{children:[o("div",{className:R.lastActivityRoot,children:I&&I.duration?n(l,{className:R.activityDuration,children:[(I.duration/3600).toFixed(1),o("span",{className:R.durationUnit,children:"h"})]}):null}),o(l,{className:R.activityName,children:i((null==I?void 0:I.name)||"")})]}):o("div",{className:R.noOperationsRoot,children:o(x,{className:R.noOperationsText,children:"No operations"})})]}),o(s,{title:null!==j?"".concat(A[j].name,": ").concat((A[j].duration/3600).toFixed(3),"h"):"",placement:"bottom",children:n("div",{className:R.chart,children:[o("canvas",{ref:S,className:R.canvas}),A.map((function(t,e){return o("canvas",{ref:T.current[e],className:R.activities})}))]})})]})}w.propTypes={activities:f.arrayOf(f.shape({name:f.string,day:f.number,night:f.number})).isRequired,currentActivityName:f.string.isRequired,showTooltip:f.bool},w.defaultProps={showTooltip:!1};export default w;
1
+ import t from"@babel/runtime/helpers/defineProperty";import{sumBy as e,upperFirst as i}from"lodash";import n from"@babel/runtime/helpers/slicedToArray";import{jsxs as r,jsx as o,Fragment as a}from"react/jsx-runtime";import{makeStyles as c,Typography as l,Tooltip as s}from"@material-ui/core";import{useRef as d,useState as p,useMemo as u,useEffect as h,createRef as m}from"react";import f from"prop-types";import g from"classnames";import{Regular14 as x}from"../Typography.js";import{drawRadicalGradient as v,drawDonutSlice as b}from"./utils.js";var y=c((function(t){return{root:{width:"228px",height:"228px",borderRadius:"50%",padding:"6px",position:"relative",background:"url(".concat("/static/media/9bda514bfc837939d0b6f7d8dbe94d03.svg",")"),backgroundRepeat:"no-repeat"},backgroundRoot:{width:"100%",height:"100%",borderRadius:"50%",border:"2px solid #616161",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:"url(".concat("/static/media/49092309a3fda5ecf77311bd794ac103.svg",")")},emptyStateBackground:{background:"radial-gradient(50% 50% at 50% 50%, rgba(100, 181, 246, 0) 54.4%, rgba(100, 181, 246, 0.01) 76.49%, rgba(100, 181, 246, 0.06) 100%)"},dropShadowRoot:{width:"100%",height:"100%",borderRadius:"50%",filter:"blur(36px)",border:"2px solid #64B5F6",display:"flex",alignItems:"center",justifyContent:"center"},content:function(t){return{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",flexDirection:"column",left:0,top:t.activitiesLength?40:57}},lastActivityRoot:{width:"90px",height:"90px",background:"#3B3B3B",boxShadow:"0px 2px 2px rgba(0, 0, 0, 0.1), inset 0px 1px 1px rgba(255, 255, 255, 0.05)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"8px 0"},activityDuration:{marginTop:"9px",color:t.palette.primary.text1,fontSize:"36px",lineHeight:"24px",fontWeight:300,letterSpacing:"0.4px"},durationUnit:{fontSize:"12px",lineHeight:"24px",fontWeight:500,letterSpacing:"0.4px"},activityTimeRange:{fontSize:"10px",textTransform:"uppercase",color:"#9E9E9E",lineHeight:"24px",fontWeight:500,letterSpacing:"1px"},activityName:{width:"106px",textAlign:"center",fontSize:"12px",lineHeight:"14px",fontWeight:500,letterSpacing:"0.4px",color:t.palette.primary.text1},noOperationsRoot:{width:90,height:90},noOperationsText:{marginTop:24,color:"#9E9E9E"},chart:{position:"absolute",left:2,top:2,width:"100%",height:"100%",padding:"12px"},canvas:{width:"100%",height:"100%"},activities:{position:"absolute",left:12,top:12}}}));function w(c){var f=c.currentActivityName,w=c.activities,N=c.showTooltip,R=y({activitiesLength:w.length}),S=d(null),T=d([]),k=p(null),E=n(k,2),A=E[0],j=E[1],B=u((function(){return w.filter((function(t){return t.duration}))}),[w]),C=u((function(){return e(w,"duration")}),[w]),I=u((function(){return null===A?w.find((function(t){return t.name===f})):B[A]}),[w,f,B,A]),O=function(t){var e=!1;T.current.forEach((function(i,n){var r=i.current;if(r&&!e){var o=r.getContext("2d");(e=o.isPointInPath(t.offsetX,t.offsetY))&&j(n)}})),e||j(null)},P=function(){j(null)};return h((function(){var t=S.current,e=t.getContext("2d");t.width=200,t.height=200,t.style.width="".concat(200,"px"),t.style.height="".concat(200,"px");var i=B.length;T.current.length!==i&&(T.current=Array(i).fill().map((function(t,e){return T.current[e]||m()})));var n=0;B.forEach((function(t,i){var r=n,o=r+t.duration/C*Math.PI*2;(null===A&&t.name===f||i===A)&&v(e,100,100,100,r,o);var a=T.current[i].current;if(a){a.width=200,a.height=200,a.style.width="".concat(200,"px"),a.style.height="".concat(200,"px"),N&&(a.onmousemove=O,a.onmouseleave=P);var c=a.getContext("2d");b(c,100,100,100,r,o,t.color||"#000000",!0)}else b(e,100,100,100,r,o,t.color||"#000000",!0);n=o}))})),r("div",{className:R.root,children:[o("div",{className:g(R.backgroundRoot,t({},R.emptyStateBackground,!w.length)),children:o("div",{className:R.dropShadowRoot})}),r("div",{className:R.content,children:[o(l,{className:R.activityTimeRange,children:"Last 24hrs"}),w.length?r(a,{children:[o("div",{className:R.lastActivityRoot,children:I&&I.duration?r(l,{className:R.activityDuration,children:[(I.duration/3600).toFixed(1),o("span",{className:R.durationUnit,children:" h"})]}):null}),o(l,{className:R.activityName,children:i((null==I?void 0:I.name)||"")})]}):o("div",{className:R.noOperationsRoot,children:o(x,{className:R.noOperationsText,children:"No operations"})})]}),o(s,{title:null!==A?"".concat(B[A].name,": ").concat((B[A].duration/3600).toFixed(3),"h"):"",placement:"bottom",children:r("div",{className:R.chart,children:[o("canvas",{ref:S,className:R.canvas}),B.map((function(t,e){return o("canvas",{ref:T.current[e],className:R.activities})}))]})})]})}w.propTypes={activities:f.arrayOf(f.shape({name:f.string,day:f.number,night:f.number})).isRequired,currentActivityName:f.string.isRequired,showTooltip:f.bool},w.defaultProps={showTooltip:!1};export default w;
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import{jsxs as i,jsx as t,Fragment as a}from"react/jsx-runtime";import{makeStyles as n,Typography as r}from"@material-ui/core";import{useRef as o,useEffect as l}from"react";import c from"prop-types";import d from"classnames";import{drawDonutSlice as s}from"./utils.js";var m=n((function(e){return{root:{width:"228px",height:"228px",borderRadius:"50%",padding:"6px",position:"relative",background:"url(".concat("/static/media/9bda514bfc837939d0b6f7d8dbe94d03.svg",")"),backgroundRepeat:"no-repeat"},backgroundRoot:{width:"100%",height:"100%",borderRadius:"50%",border:"2px solid #616161",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:"url(".concat("/static/media/49092309a3fda5ecf77311bd794ac103.svg",")")},emptyStateBackground:{background:"radial-gradient(50% 50% at 50% 50%, rgba(100, 181, 246, 0) 54.4%, rgba(100, 181, 246, 0.01) 76.49%, rgba(100, 181, 246, 0.06) 100%)"},dropShadowRoot:{width:"100%",height:"100%",borderRadius:"50%",filter:"blur(36px)",border:"2px solid #64B5F6",display:"flex",alignItems:"center",justifyContent:"center"},content:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",left:0,top:0},timeRange:{fontSize:"10px",textTransform:"uppercase",color:e.palette.primary.text7,lineHeight:"24px",fontWeight:500,letterSpacing:"1px",position:"absolute",top:36},time:{marginTop:42},timing:{fontFamily:"Roboto",fontSize:36,lineHeight:"24px",letterSpacing:.4,fontWeight:300,color:e.palette.background.b9},wirelineText:{color:"#FF9C00"},wirelineDot:{backgroundColor:"#FF9C00"},fracturingText:{color:"#8572FF"},fracturingDot:{backgroundColor:"#8572FF"},legend:{marginTop:24},legendItem:{fontFamily:"Roboto",fontSize:12,lineHeight:"14px",letterSpacing:.4,display:"flex",margin:"2px 0",alignItems:"center"},dot:{width:8,height:8,borderRadius:"100%",marginRight:9},chart:{position:"absolute",left:2,top:2,width:"100%",height:"100%",padding:"12px"},noData:{width:90,height:90},noDataText:{marginTop:24,color:"#9E9E9E",display:"flex",justifyContent:"center"},canvas:{width:"100%",height:"100%"},activities:{position:"absolute",left:12,top:12}}}));function p(e,i,t,a,n,r,o,l){var c=e.current;if(c){c.width=200,c.height=200,c.style.width="".concat(200,"px"),c.style.height="".concat(200,"px");var d=c.getContext("2d");s(d,i,t,a,n,r,o,l)}}function g(n){var c=n.wirelineTime,s=n.fracturingTime,g=m(),h=o(null),u=o(null),f=o(null);return l((function(){var e=h.current;e.width=200,e.height=200,e.style.width="".concat(200,"px"),e.style.height="".concat(200,"px");var i=60*c/86400*Math.PI*2,t=i+60*s/86400*Math.PI*2;p(u,100,100,100,0,i,"#FF9C00",!0),p(f,100,100,100,i,t,"#8572FF",!0)})),i("div",{className:g.root,children:[t("div",{className:d(g.backgroundRoot,e({},g.emptyStateBackground,!c||!s)),children:t("div",{className:g.dropShadowRoot})}),i("div",{className:g.content,children:[t(r,{className:g.timeRange,children:"Previous 24hrs"}),c&&s?i(a,{children:[i("div",{className:g.time,children:[t(r,{className:d(g.timing,g.wirelineText),display:"inline",children:c/60}),t(r,{className:g.timing,display:"inline",children:"/"}),t(r,{className:d(g.timing,g.fracturingText),display:"inline",children:s/60}),t(r,{display:"inline",children:" h"})]}),i("div",{className:g.legend,children:[i(r,{className:g.legendItem,display:"inline",children:[t("div",{className:d(g.dot,g.wirelineDot)})," Wireline"]}),i(r,{className:g.legendItem,display:"inline",children:[t("div",{className:d(g.dot,g.fracturingDot)}),"Fracturing"]})]})]}):t("div",{className:g.noData,children:t(r,{className:g.noDataText,children:"No Data"})})]}),i("div",{className:g.chart,children:[t("canvas",{ref:h,className:g.canvas}),t("canvas",{ref:u,className:g.activities}),t("canvas",{ref:f,className:g.activities})]})]})}g.propTypes={wirelineTime:c.number,fracturingTime:c.number},g.defaultProps={wirelineTime:void 0,fracturingTime:void 0};export default g;
1
+ import e from"@babel/runtime/helpers/defineProperty";import{jsxs as i,jsx as t,Fragment as a}from"react/jsx-runtime";import{makeStyles as n,Typography as r}from"@material-ui/core";import{useRef as o,useEffect as l}from"react";import c from"prop-types";import d from"classnames";import{drawDonutSlice as s}from"./utils.js";var m=n((function(e){return{root:{width:"228px",height:"228px",borderRadius:"50%",padding:"6px",position:"relative",background:"url(".concat("/static/media/9bda514bfc837939d0b6f7d8dbe94d03.svg",")"),backgroundRepeat:"no-repeat"},backgroundRoot:{width:"100%",height:"100%",borderRadius:"50%",border:"2px solid #616161",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:"url(".concat("/static/media/49092309a3fda5ecf77311bd794ac103.svg",")")},emptyStateBackground:{background:"radial-gradient(50% 50% at 50% 50%, rgba(100, 181, 246, 0) 54.4%, rgba(100, 181, 246, 0.01) 76.49%, rgba(100, 181, 246, 0.06) 100%)"},dropShadowRoot:{width:"100%",height:"100%",borderRadius:"50%",filter:"blur(36px)",border:"2px solid #64B5F6",display:"flex",alignItems:"center",justifyContent:"center"},content:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",left:0,top:0},timeRange:{fontSize:"10px",textTransform:"uppercase",color:e.palette.primary.text7,lineHeight:"24px",fontWeight:500,letterSpacing:"1px",position:"absolute",top:36},time:{marginTop:42},timing:{fontFamily:"Roboto",fontSize:36,lineHeight:"24px",letterSpacing:.4,fontWeight:300,color:e.palette.background.b9},wirelineText:{color:"#FF9C00"},wirelineDot:{backgroundColor:"#FF9C00"},fracturingText:{color:"#8572FF"},fracturingDot:{backgroundColor:"#8572FF"},legend:{marginTop:24},legendItem:{fontFamily:"Roboto",fontSize:12,lineHeight:"14px",letterSpacing:.4,display:"flex",margin:"2px 0",alignItems:"center"},dot:{width:8,height:8,borderRadius:"100%",marginRight:9},chart:{position:"absolute",left:2,top:2,width:"100%",height:"100%",padding:"12px"},noData:{width:90,height:90},noDataText:{marginTop:24,color:"#9E9E9E",display:"flex",justifyContent:"center"},canvas:{width:"100%",height:"100%"},activities:{position:"absolute",left:12,top:12}}}));function p(e,i,t,a,n,r,o,l){var c=e.current;if(c){c.width=200,c.height=200,c.style.width="".concat(200,"px"),c.style.height="".concat(200,"px");var d=c.getContext("2d");s(d,i,t,a,n,r,o,l)}}function g(n){var c=n.wirelineTime,s=n.fracturingTime,g=m(),h=o(null),u=o(null),f=o(null);return l((function(){var e=h.current;e.width=200,e.height=200,e.style.width="".concat(200,"px"),e.style.height="".concat(200,"px");var i=60*c/86400*Math.PI*2,t=i+60*s/86400*Math.PI*2;p(u,100,100,100,0,i,"#FF9C00",!0),p(f,100,100,100,i,t,"#8572FF",!0)})),i("div",{className:g.root,children:[t("div",{className:d(g.backgroundRoot,e({},g.emptyStateBackground,!c||!s)),children:t("div",{className:g.dropShadowRoot})}),i("div",{className:g.content,children:[t(r,{className:g.timeRange,children:"Previous 24hrs"}),c&&s?i(a,{children:[i("div",{className:g.time,children:[t(r,{className:d(g.timing,g.wirelineText),display:"inline",children:(c/60).toFixed(1)}),t(r,{className:g.timing,display:"inline",children:"/"}),t(r,{className:d(g.timing,g.fracturingText),display:"inline",children:(s/60).toFixed(1)}),t(r,{display:"inline",children:" h"})]}),i("div",{className:g.legend,children:[i(r,{className:g.legendItem,display:"inline",children:[t("div",{className:d(g.dot,g.wirelineDot)})," Wireline"]}),i(r,{className:g.legendItem,display:"inline",children:[t("div",{className:d(g.dot,g.fracturingDot)}),"Fracturing"]})]})]}):t("div",{className:g.noData,children:t(r,{className:g.noDataText,children:"No Data"})})]}),i("div",{className:g.chart,children:[t("canvas",{ref:h,className:g.canvas}),t("canvas",{ref:u,className:g.activities}),t("canvas",{ref:f,className:g.activities})]})]})}g.propTypes={wirelineTime:c.number,fracturingTime:c.number},g.defaultProps={wirelineTime:void 0,fracturingTime:void 0};export default g;
@@ -1 +1 @@
1
- function o(o,a,t,l,d,r){o.beginPath(),o.moveTo(a,t),o.arc(a,t,l-8,d,r),o.closePath();var e=o.createRadialGradient(a,t,5,a,t,l);e.addColorStop(0,"#3E4D5A00"),e.addColorStop(.3,"#3E4D5A00"),e.addColorStop(.6,"#3E4D5A4d"),e.addColorStop(.9,"#3E4D5Ab3"),o.fillStyle=e,o.fill()}function a(o,a,t,l,d,r){o.moveTo(a,t),o.arc(a,t,l,d,r)}function t(o,t,l,d,r,e,c,i){var n=e-r>.0833393628,h=n?.0416696814:0,S=n?4:0,p=100-S;(o.beginPath(),o.moveTo(t,l),o.arc(t,l,d,r+h,e-h),i&&n)&&(a(o,100+p*Math.cos(r+h),100+p*Math.sin(r+h),S,0,2*Math.PI),a(o,100+p*Math.cos(e-h),100+p*Math.sin(e-h),S,0,2*Math.PI));o.closePath();var C=o.createRadialGradient(t,l,8,t,l,d);C.addColorStop(0,"".concat(c,"00")),C.addColorStop(.9,"".concat(c,"00")),C.addColorStop(.93,c),C.addColorStop(1,c),o.fillStyle=C,o.fill(),o.beginPath(),o.moveTo(t,l),o.arc(t,l,d,r,e),o.closePath()}export{t as drawDonutSlice,o as drawRadicalGradient};
1
+ function o(o,a,t,l,e,c){o.beginPath(),o.moveTo(a,t),o.arc(a,t,l-8,e,c),o.closePath();var r=o.createRadialGradient(a,t,5,a,t,l);r.addColorStop(0,"#08345A00"),r.addColorStop(.9,"#9FD2FF14"),o.fillStyle=r,o.fill()}function a(o,a,t,l,e,c){o.moveTo(a,t),o.arc(a,t,l,e,c)}function t(o,t,l,e,c,r,d,i){var n=r-c>.0833393628,h=n?.0416696814:0,P=n?4:0,S=100-P;(o.beginPath(),o.moveTo(t,l),o.arc(t,l,e,c+h,r-h),i&&n)&&(a(o,100+S*Math.cos(c+h),100+S*Math.sin(c+h),P,0,2*Math.PI),a(o,100+S*Math.cos(r-h),100+S*Math.sin(r-h),P,0,2*Math.PI));o.closePath();var f=o.createRadialGradient(t,l,8,t,l,e);f.addColorStop(0,"".concat(d,"00")),f.addColorStop(.9,"".concat(d,"00")),f.addColorStop(.93,d),f.addColorStop(1,d),o.fillStyle=f,o.fill(),o.beginPath(),o.moveTo(t,l),o.arc(t,l,e,c,r),o.closePath()}export{t as drawDonutSlice,o as drawRadicalGradient};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.26.0-0",
3
+ "version": "0.26.0-4",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"