@bikdotai/bik-component-library 0.0.543 → 0.0.545

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.
@@ -9,5 +9,6 @@ export interface FunnelBarChartI {
9
9
  maintainAspectRatio?: boolean;
10
10
  canvasHeight?: number;
11
11
  barColors?: string[];
12
+ titleToolTipCallback?: (tooltipItems: any) => string;
12
13
  }
13
14
  export declare const FunnelVerticalBarGraph: React.FC<FunnelBarChartI>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("chart.js"),t=require("react-chartjs-2"),a=require("../../../TypographyStyle.js"),l=require("../LineChart/LineChart.styled.js");r.Chart.register(r.CategoryScale,r.LinearScale,r.BarElement,r.Tooltip);const s=["#DEEFFF","#FEDEF3","#FEC6C6","#DBAFFF","#FEDEBC"];exports.FunnelVerticalBarGraph=r=>{let{data:n=[],maintainAspectRatio:i=!1,canvasHeight:o=300,barColors:c=s}=r;0===n.length&&(n=[{label:"",current:0,previousLabel:""}]);const d=n.map((e=>e.label)),p=n.map((e=>e.current||0)),g=n.map((e=>e.previous?Math.max((e.previous||0)-e.current,0):0)),u=n.map((e=>e.previousLabel||"")),h=c,b=n.map((e=>({text:e.label,color:h[n.indexOf(e)]}))),x=[{label:"Current Value",data:p,backgroundColor:h.slice(0,n.length),borderColor:"white",borderWidth:1,stack:"combined"},{label:"Previous Value",data:g.map((e=>e||0)),backgroundColor:h.slice(0,n.length).map((e=>((e,r)=>{let t=0,a=0,l=0;return 4===e.length?(t=parseInt(e[1]+e[1],16),a=parseInt(e[2]+e[2],16),l=parseInt(e[3]+e[3],16)):7===e.length&&(t=parseInt(e[1]+e[2],16),a=parseInt(e[3]+e[4],16),l=parseInt(e[5]+e[6],16)),`rgba(${t}, ${a}, ${l}, ${r})`})(e,.3))),borderColor:"white",borderWidth:1,stack:"combined"}],m={labels:d,datasets:x},j={maintainAspectRatio:i,responsive:!0,scales:{x:{stacked:!0,grid:{display:!1},ticks:{display:n.length>0}},y:{stacked:!0,barPercentage:.6,categoryPercentage:.7,ticks:{display:n.length>0},grid:{drawBorder:n.length>0}}},plugins:{legend:{display:!1},tooltip:{callbacks:{title:e=>{const r=e[0].datasetIndex,t=e[0].dataIndex;if(1===r){return`${u[t]} not ${d[t]}`}return e[0].label},label:e=>` ${e.raw}`}}}};return e.jsxs("div",Object.assign({style:{height:i?void 0:o,display:"flex",flexDirection:"column",gap:5,width:"100%"}},{children:[e.jsx(l.LegendWrapper,{children:b.map(((r,t)=>{let{text:s,color:n}=r;return s?e.jsxs(l.LegendContainer,{children:[e.jsx(l.LegendColor,{color:n,newStyle:!0}),e.jsx(a.SmallRegular,Object.assign({color:"#667085"},{children:s}))]},t):e.jsx(e.Fragment,{})}))}),e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(t.Bar,{data:m,options:j})}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("chart.js"),t=require("react-chartjs-2"),a=require("../../../TypographyStyle.js"),l=require("../LineChart/LineChart.styled.js");r.Chart.register(r.CategoryScale,r.LinearScale,r.BarElement,r.Tooltip);const s=["#DEEFFF","#FEDEF3","#FEC6C6","#DBAFFF","#FEDEBC"];exports.FunnelVerticalBarGraph=r=>{let{data:n=[],maintainAspectRatio:i=!1,canvasHeight:o=300,barColors:c=s,titleToolTipCallback:d}=r;0===n.length&&(n=[{label:"",current:0,previousLabel:""}]);const p=n.map((e=>e.label)),g=n.map((e=>e.current||0)),u=n.map((e=>e.previous?Math.max((e.previous||0)-e.current,0):0)),h=n.map((e=>e.previousLabel||"")),b=c,x=n.map((e=>({text:e.label,color:b[n.indexOf(e)]}))),m=[{label:"Current Value",data:g,backgroundColor:b.slice(0,n.length),borderColor:"white",borderWidth:1,stack:"combined"},{label:"Previous Value",data:u.map((e=>e||0)),backgroundColor:b.slice(0,n.length).map((e=>((e,r)=>{let t=0,a=0,l=0;return 4===e.length?(t=parseInt(e[1]+e[1],16),a=parseInt(e[2]+e[2],16),l=parseInt(e[3]+e[3],16)):7===e.length&&(t=parseInt(e[1]+e[2],16),a=parseInt(e[3]+e[4],16),l=parseInt(e[5]+e[6],16)),`rgba(${t}, ${a}, ${l}, ${r})`})(e,.3))),borderColor:"white",borderWidth:1,stack:"combined"}],j={labels:p,datasets:m},y={maintainAspectRatio:i,responsive:!0,scales:{x:{stacked:!0,grid:{display:!1},ticks:{display:n.length>0}},y:{stacked:!0,barPercentage:.6,categoryPercentage:.7,ticks:{display:n.length>0},grid:{drawBorder:n.length>0}}},plugins:{legend:{display:!1},tooltip:{callbacks:{title:d||(e=>{const r=e[0].datasetIndex,t=e[0].dataIndex;if(1===r){return`${h[t]} but not ${p[t]}`}return e[0].label}),label:e=>` ${e.raw}`}}}};return e.jsxs("div",Object.assign({style:{height:i?void 0:o,display:"flex",flexDirection:"column",gap:5,width:"100%"}},{children:[e.jsx(l.LegendWrapper,{children:x.map(((r,t)=>{let{text:s,color:n}=r;return s?e.jsxs(l.LegendContainer,{children:[e.jsx(l.LegendColor,{color:n,newStyle:!0}),e.jsx(a.SmallRegular,Object.assign({color:"#667085"},{children:s}))]},t):e.jsx(e.Fragment,{})}))}),e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(t.Bar,{data:j,options:y})}))]}))};
@@ -20,5 +20,6 @@ export interface BikLayoutProps {
20
20
  featureImage?: string;
21
21
  };
22
22
  useFeautureModalV2?: boolean;
23
+ backgroundColor?: string;
23
24
  }
24
25
  export declare const BikLayout: React.FC<BikLayoutProps>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("./CommonStyles.js"),a=require("./FeatureModal.js"),s=require("./FeatureModalV2.js"),n=require("./PageLoader.js");exports.BikLayout=t=>{const{isLoading:i,isFeatureModalEnabled:o=!1,isDisabled:d=!1,loadingAnimation:l,hidePadding:u=!1,height:c,children:j,containerStyles:g,onClickingCrossOnFeatureModal:p,onUpgrade:h,extraContentForModal:x,featureModalProps:C,type:F,useFeautureModalV2:M}=t;return i?e.jsx(r.BikLayoutContainer,{children:l||e.jsx(n.PageLoader,{})}):e.jsx(e.Fragment,{children:e.jsxs(r.BikLayoutContainer,Object.assign({type:F},{children:[e.jsx("div",{className:""+(d?"disabled--wrapper":"")}),e.jsx("div",Object.assign({className:""+(u?"inner-wrapper":"inner-wrapper pd-24"),style:Object.assign({height:`${c||""}`},null!=g?g:{})},{children:j})),o&&e.jsx(e.Fragment,{children:M?e.jsx(s.FeatureModalV2,Object.assign({onUpgrade:h},C,{otherContent:x})):e.jsx(a.FeatureModal,Object.assign({showBookADemo:!0,onClickingCross:()=>p?p():"",onUpgrade:h},C,{otherContent:x}))})]}))})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("./CommonStyles.js"),a=require("./FeatureModal.js"),o=require("./FeatureModalV2.js"),n=require("./PageLoader.js");exports.BikLayout=s=>{const{isLoading:t,isFeatureModalEnabled:i=!1,isDisabled:d=!1,loadingAnimation:l,hidePadding:u=!1,height:c,children:g,containerStyles:j,onClickingCrossOnFeatureModal:p,onUpgrade:h,extraContentForModal:b,featureModalProps:x,type:C,useFeautureModalV2:F,backgroundColor:M}=s;return t?e.jsx(r.BikLayoutContainer,Object.assign({backgroundColor:M},{children:l||e.jsx(n.PageLoader,{})})):e.jsx(e.Fragment,{children:e.jsxs(r.BikLayoutContainer,Object.assign({type:C,backgroundColor:M},{children:[e.jsx("div",{className:""+(d?"disabled--wrapper":"")}),e.jsx("div",Object.assign({className:""+(u?"inner-wrapper":"inner-wrapper pd-24"),style:Object.assign({height:`${c||""}`},null!=j?j:{})},{children:g})),i&&e.jsx(e.Fragment,{children:F?e.jsx(o.FeatureModalV2,Object.assign({onUpgrade:h},x,{otherContent:b})):e.jsx(a.FeatureModal,Object.assign({showBookADemo:!0,onClickingCross:()=>p?p():"",onUpgrade:h},x,{otherContent:b}))})]}))})};
@@ -16,6 +16,7 @@ export declare const BikLayoutContainer: import("@emotion/styled").StyledCompone
16
16
  as?: import("react").ElementType<any> | undefined;
17
17
  } & {
18
18
  type?: "overflow-within" | "overflow-body" | undefined;
19
+ backgroundColor?: string | undefined;
19
20
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
20
21
  export declare const BikHeaderWrapper: import("@emotion/styled").StyledComponent<{
21
22
  theme?: import("@emotion/react").Theme | undefined;