@bikdotai/bik-component-library 0.0.660-beta.0 → 0.0.661

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.
Files changed (39) hide show
  1. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  2. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  3. package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  4. package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  5. package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  6. package/dist/cjs/components/QueryBuilder/components/QueryBuilderNodes.js +1 -1
  7. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +2 -0
  8. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
  9. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js +1 -1
  10. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.d.ts +2 -0
  11. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.d.ts +1 -0
  12. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.js +6 -2
  13. package/dist/cjs/components/avatar/Avatar.d.ts +1 -3
  14. package/dist/cjs/components/avatar/Avatar.js +1 -1
  15. package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
  16. package/dist/cjs/components/plans/NewSubscriptionPlan.js +1 -1
  17. package/dist/cjs/components/plans/SubscriptionPlan.d.ts +1 -0
  18. package/dist/cjs/components/plans/SubscriptionPlan.js +1 -1
  19. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  20. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  21. package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  22. package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  23. package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  24. package/dist/esm/components/QueryBuilder/components/QueryBuilderNodes.js +1 -1
  25. package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +2 -0
  26. package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
  27. package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js +1 -1
  28. package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.d.ts +2 -0
  29. package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.d.ts +1 -0
  30. package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.js +5 -1
  31. package/dist/esm/components/avatar/Avatar.d.ts +1 -3
  32. package/dist/esm/components/avatar/Avatar.js +1 -1
  33. package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
  34. package/dist/esm/components/plans/NewSubscriptionPlan.js +1 -1
  35. package/dist/esm/components/plans/SubscriptionPlan.d.ts +1 -0
  36. package/dist/esm/components/plans/SubscriptionPlan.js +1 -1
  37. package/package.json +1 -1
  38. package/dist/cjs/assets/icons/bik_livechat.svg.js +0 -1
  39. package/dist/esm/assets/icons/bik_livechat.svg.js +0 -1
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
3
3
  declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default EventsTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
3
+ import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
4
+ import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
5
5
  declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
6
6
  cacheKey: string;
7
7
  propertyAddBtnText: string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("react-redux"),s=require("../../button/Button.js"),i=require("../../dropdown/Dropdown.js"),l=require("../constants/operators.js"),d=require("../hooks/useQueryBuilder.js"),o=require("./AddNodeButton.js"),n=require("./DeleteButton.js"),a=require("./QueryBuilderNode/QueryBuilderNode.js"),u=require("./QueryBuilderNodes.styled.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const j=c(t).default.forwardRef(((c,j)=>{let{infinite:p,addNodeBtnText:x,allowedNodes:y,typesAPIHandlers:f,onStateChange:g,mode:v,selectorKey:b}=c;var O;const m=r.useSelector((e=>null==e?void 0:e[b])),{deleteNode:w,clearAll:h,selectJoinOperator:N,fillState:q}=d.useQueryBuilder(b);t.useEffect((()=>{null==g||g(Object.assign({},m))}),[m]);const B=l.JOIN_OPERATOR_OPTIONS.map((e=>(null==m?void 0:m.operator)&&e.value===m.operator?Object.assign(Object.assign({},e),{selected:!0}):e));return t.useImperativeHandle(j,(()=>({getState:()=>Object.assign({},m),fillState(e){q(Object.assign({},e))},clearAll:h}))),e.jsxs(e.Fragment,{children:[null===(O=null==m?void 0:m.nodes)||void 0===O?void 0:O.map(((t,r)=>e.jsxs(e.Fragment,{children:[0!==r&&e.jsx("div",Object.assign({style:{width:80,position:"relative"}},{children:e.jsx(i.Dropdown,{disabled:"view"===v,onSelect:e=>{N(e.value)},options:B,width:"80px",height:96,size:"small"})})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:12}},{children:[e.jsx(u.LinedContainer,Object.assign({style:{paddingTop:0===r?0:24,maxWidth:"calc(100% - 24px)"}},{children:e.jsx(a.default,{selectorKey:b,mode:null!=v?v:"create",allowedNodes:y,node:t,apiHandler:f[t.type]})})),"view"!==v?e.jsx(e.Fragment,{children:0!==r&&e.jsx(n.default,{onClick:()=>w(t._id)})}):e.jsx(e.Fragment,{})]}),t._id)]}))),p&&"view"!==v&&e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[e.jsx(o.default,{buttonText:x,allowedNodes:y,selectorKey:b}),e.jsx(s.Button,{buttonText:"Clear filters",size:"medium",buttonType:"tertiaryGray",onClick:()=>h(y[0])})]}))]})}));j.displayName="QueryBuilderNodes",exports.default=j;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("react-redux"),s=require("../../button/Button.js"),i=require("../../dropdown/Dropdown.js"),l=require("../constants/operators.js"),o=require("../hooks/useQueryBuilder.js"),d=require("./AddNodeButton.js"),n=require("./DeleteButton.js"),a=require("./QueryBuilderNode/QueryBuilderNode.js"),u=require("./QueryBuilderNodes.styled.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const j=c(t).default.forwardRef(((c,j)=>{let{infinite:p,addNodeBtnText:x,allowedNodes:y,typesAPIHandlers:f,onStateChange:g,mode:v,selectorKey:b}=c;var O;const m=r.useSelector((e=>null==e?void 0:e[b])),{deleteNode:w,clearAll:h,selectJoinOperator:N,fillState:q}=o.useQueryBuilder(b);t.useEffect((()=>{null==g||g(Object.assign({},m))}),[m]);const B=l.JOIN_OPERATOR_OPTIONS.map((e=>(null==m?void 0:m.operator)&&e.value===m.operator?Object.assign(Object.assign({},e),{selected:!0}):e));return t.useImperativeHandle(j,(()=>({getState:()=>Object.assign({},m),fillState(e){q(Object.assign({},e))},clearAll:h}))),e.jsxs(e.Fragment,{children:[null===(O=null==m?void 0:m.nodes)||void 0===O?void 0:O.map(((t,r)=>e.jsxs(e.Fragment,{children:[0!==r&&e.jsx("div",Object.assign({style:{width:80,position:"relative"}},{children:e.jsx(i.Dropdown,{disabled:"view"===v,onSelect:e=>{N(e.value)},options:B,width:"80px",height:96,size:"small",skipSorting:!0})})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:12}},{children:[e.jsx(u.LinedContainer,Object.assign({style:{paddingTop:0===r?0:24,maxWidth:"calc(100% - 24px)"}},{children:e.jsx(a.default,{selectorKey:b,mode:null!=v?v:"create",allowedNodes:y,node:t,apiHandler:f[t.type]})})),"view"!==v?e.jsx(e.Fragment,{children:0!==r&&e.jsx(n.default,{onClick:()=>w(t._id)})}):e.jsx(e.Fragment,{})]}),t._id)]}))),p&&"view"!==v&&e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[e.jsx(d.default,{buttonText:x,allowedNodes:y,selectorKey:b}),e.jsx(s.Button,{buttonText:"Clear filters",size:"medium",buttonType:"tertiaryGray",onClick:()=>h(y[0])})]}))]})}));j.displayName="QueryBuilderNodes",exports.default=j;
@@ -37,5 +37,7 @@ export type LineChartProps = {
37
37
  titleTooltipCallback?: (context: any) => void;
38
38
  isInternationalStore?: boolean;
39
39
  customYHeaders?: any;
40
+ legendsAndIconDirection?: 'row-reverse' | 'row';
41
+ headerIcons?: React.ReactNode[];
40
42
  };
41
43
  export declare const LineChart: React.FC<LineChartProps>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("chart.js"),l=require("react"),r=require("react-chartjs-2"),n=require("../../../TypographyStyle.js"),i=require("../../../../constants/Theme.js"),o=require("../utils/calcPercentage.js"),a=require("./LineChart.styled.js");t.Chart.register(t.CategoryScale,t.LinearScale,t.PointElement,t.BarElement,t.LineElement,t.ArcElement,t.Filler,t.Title,t.Tooltip,t.Legend);exports.LineChart=t=>{let{scaleText:s,labels:d,canvasHeight:c,datas:u,maintainAspectRatio:g=!1,stepSize:p,min:y,max:b,isZeroState:v,tension:C,isNewStyles:O,prefixCurrencyInYAxis:h,pointRadius:x,useKFormat:S,lineThickness:j,ticksLabelCallback:m,labelCallback:L,afterBodyCallBack:k,titleTooltipCallback:f,isInternationalStore:R,customYHeaders:q}=t;var B,w,F;const[T,E]=l.useState(null),z=l.useRef();l.useEffect((()=>{var e,t,l,r;if(null===(r=null===(l=null===(t=null===(e=z.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===l?void 0:l.ticks)||void 0===r?void 0:r.length){const e=38*z.current.scales.y.ticks.length;E(e)}}),[z]);const I=u.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?i.COLORS.content.placeholder:i.COLORS.background.brand,square:e.squareLegends}))),$={labels:d,datasets:u.map(((e,t)=>{var l,r,n;return Object.assign(Object.assign({tension:null!=C?C:.4,fill:e.gradient?"start":0},((e,t)=>{const l={borderColor:e||(t?i.COLORS.content.placeholder:i.COLORS.background.brand)};return O?Object.assign({pointStyle:"circle",pointRadius:x||(d&&d.length>10?2.5:4),pointBorderColor:"transparent",pointBackgroundColor:e||(t?i.COLORS.content.placeholder:i.COLORS.background.brand)},l):Object.assign({pointRadius:null!=x?x:1},l)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:null!==(r=null!==(l=e.lineWidth)&&void 0!==l?l:j)&&void 0!==r?r:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,T?T-75:150);return t.addColorStop(0,"#F1EEFB"),t.addColorStop(1,"rgba(127, 86, 217, 0)"),t}:null!==(n=e.backgroundColor)&&void 0!==n?n:"transparent",legend:e.legend})}))},A={maintainAspectRatio:g,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:null!=O&&O,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>i.COLORS.content.primaryInverse,backgroundColor:i.COLORS.content.primary,callbacks:{labelTextColor:()=>i.COLORS.content.primaryInverse,title:f,label:L,afterBody:k},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{beginAtZero:!0,min:v?0:y,max:v?10:b,ticks:{color:i.COLORS.content.secondary,callback:e=>{var t,l;return S?`${null!==(t=null==s?void 0:s.yPrefix)&&void 0!==t?t:""}${R?o.truncateValueForInternationalStore(e):o.truncateValueForIndianStore(e)}${null!=h?h:""}`:q&&Object.keys(q).length>0?q[e]:`${null!==(l=null==s?void 0:s.yPrefix)&&void 0!==l?l:""}${e}${null!=h?h:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:v?1:p,padding:O?24:0},title:{display:!!(null==s?void 0:s.y),text:null==s?void 0:s.y},grid:{color:i.COLORS.background.base,drawBorder:null===(B=null==s?void 0:s.yDrawBorder)||void 0===B||B}},x:{ticks:{callback:m,color:i.COLORS.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==s?void 0:s.x),text:null==s?void 0:s.x},grid:{display:!1,drawBorder:null!==(w=null==s?void 0:s.xDrawBorder)&&void 0!==w&&w}}}};return e.jsxs("div",Object.assign({style:Object.assign(Object.assign({},g?{}:{height:null!==(F=null!=c?c:T)&&void 0!==F?F:204}),{display:"flex",flexDirection:"column",gap:2,width:"100%"})},{children:[e.jsx(a.LegendWrapper,{children:I.map(((t,l)=>{let{text:r,color:i,square:o}=t;return r?e.jsxs(a.LegendContainer,{children:[e.jsx(a.LegendColor,{color:i,square:o,newStyle:O}),e.jsx(n.BodyTiny,Object.assign({color:"#667085"},{children:r}))]},l):e.jsx(e.Fragment,{})}))}),e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(r.Line,{ref:z,options:A,data:$})}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("chart.js"),n=require("react"),l=require("react-chartjs-2"),r=require("../../../TypographyStyle.js"),i=require("../../../../constants/Theme.js"),o=require("../utils/calcPercentage.js"),a=require("./LineChart.styled.js");t.Chart.register(t.CategoryScale,t.LinearScale,t.PointElement,t.BarElement,t.LineElement,t.ArcElement,t.Filler,t.Title,t.Tooltip,t.Legend);exports.LineChart=t=>{let{scaleText:s,labels:d,canvasHeight:c,datas:u,maintainAspectRatio:g=!1,stepSize:p,min:y,max:b,isZeroState:C,tension:v,isNewStyles:h,prefixCurrencyInYAxis:x,pointRadius:O,useKFormat:j,lineThickness:m,ticksLabelCallback:S,labelCallback:L,afterBodyCallBack:f,titleTooltipCallback:k,isInternationalStore:R,customYHeaders:w,headerIcons:q=[],legendsAndIconDirection:B="row"}=t;var F,T,I;const[E,z]=n.useState(null),A=n.useRef();n.useEffect((()=>{var e,t,n,l;if(null===(l=null===(n=null===(t=null===(e=A.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===n?void 0:n.ticks)||void 0===l?void 0:l.length){const e=38*A.current.scales.y.ticks.length;z(e)}}),[A]);const D=u.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?i.COLORS.content.placeholder:i.COLORS.background.brand,square:e.squareLegends}))),$={labels:d,datasets:u.map(((e,t)=>{var n,l,r;return Object.assign(Object.assign({tension:null!=v?v:.4,fill:e.gradient?"start":0},((e,t)=>{const n={borderColor:e||(t?i.COLORS.content.placeholder:i.COLORS.background.brand)};return h?Object.assign({pointStyle:"circle",pointRadius:O||(d&&d.length>10?2.5:4),pointBorderColor:"transparent",pointBackgroundColor:e||(t?i.COLORS.content.placeholder:i.COLORS.background.brand)},n):Object.assign({pointRadius:null!=O?O:1},n)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:null!==(l=null!==(n=e.lineWidth)&&void 0!==n?n:m)&&void 0!==l?l:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,E?E-75:150);return t.addColorStop(0,"#F1EEFB"),t.addColorStop(1,"rgba(127, 86, 217, 0)"),t}:null!==(r=e.backgroundColor)&&void 0!==r?r:"transparent",legend:e.legend})}))},P={maintainAspectRatio:g,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:null!=h&&h,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>i.COLORS.content.primaryInverse,backgroundColor:i.COLORS.content.primary,callbacks:{labelTextColor:()=>i.COLORS.content.primaryInverse,title:k,label:L,afterBody:f},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{beginAtZero:!0,min:C?0:y,max:C?10:b,ticks:{color:i.COLORS.content.secondary,callback:e=>{var t,n;return j?`${null!==(t=null==s?void 0:s.yPrefix)&&void 0!==t?t:""}${R?o.truncateValueForInternationalStore(e):o.truncateValueForIndianStore(e)}${null!=x?x:""}`:w&&Object.keys(w).length>0?w[e]:`${null!==(n=null==s?void 0:s.yPrefix)&&void 0!==n?n:""}${e}${null!=x?x:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:C?1:p,padding:h?24:0},title:{display:!!(null==s?void 0:s.y),text:null==s?void 0:s.y},grid:{color:i.COLORS.background.base,drawBorder:null===(F=null==s?void 0:s.yDrawBorder)||void 0===F||F}},x:{ticks:{callback:S,color:i.COLORS.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==s?void 0:s.x),text:null==s?void 0:s.x},grid:{display:!1,drawBorder:null!==(T=null==s?void 0:s.xDrawBorder)&&void 0!==T&&T}}}};return e.jsxs("div",Object.assign({style:Object.assign(Object.assign({},g?{}:{height:null!==(I=null!=c?c:E)&&void 0!==I?I:204}),{display:"flex",flexDirection:"column",gap:2,width:"100%"})},{children:[e.jsxs("div",Object.assign({style:{display:"flex",justifyContent:"space-between",width:"100%",flexDirection:B}},{children:[e.jsx(a.LegendWrapper,{children:q.map(((t,n)=>e.jsx(a.LegendContainer,{children:t},n)))}),e.jsx(a.LegendWrapper,{children:D.map(((t,n)=>{let{text:l,color:i,square:o}=t;return l?e.jsxs(a.LegendContainer,{children:[e.jsx(a.LegendColor,{color:i,square:o,newStyle:h}),e.jsx(r.BodyTiny,Object.assign({color:"#667085"},{children:l}))]},n):e.jsx(e.Fragment,{})}))})]})),e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(l.Line,{ref:A,options:P,data:$})}))]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../../assets/icons/maximize.svg.js"),i=require("chart.js"),o=require("chartjs-plugin-datalabels"),a=require("react"),l=require("react-chartjs-2"),n=require("../../../icon-button/IconButton.js"),d=require("../../../modals/styledModal.js"),r=require("../../../TypographyStyle.js"),s=require("../../../../constants/Theme.js"),c=require("../utils/calcPercentage.js"),u=require("./StackedBarChart.model.js"),v=require("./StackedBarChart.styles.js");function O(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=O(o);i.Chart.register(i.CategoryScale,i.LinearScale,i.BarElement,i.Tooltip,i.Legend,g.default);exports.StackedBarChart=i=>{var o,O,g,p,x,b,A,h,y,R,C,T,I,f,j,N,S,m,L,k,H,E,F,P,G,_,B,w,D,q,Z,z,M,W,V,Y,J,K,Q,U,X,$;const[ee,te]=a.useState(!1),ie=[250,1e3,800,1500,300,600],oe=0===i.yAxis.data.length,ae=void 0===i.customColourScaleBrand&&void 0===i.customColourScalePastel?i.colorSchema===u.COLOR_SCHEMA.PASTEL?["#E6C7FF","#FEC6C6","#FEDEF3","#DEEFFF","#FFD8B1","#C7E5FF","#FFD3E6","#C9FFE5","#FFE3C7","#D9D9FF"]:["#5E07BB","#9E77ED","#D2AEFF","#F7D7FF","#CDE1FF","#92AFFA","#3935E1"]:i.colorSchema===u.COLOR_SCHEMA.PASTEL?i.customColourScalePastel:i.customColourScaleBrand,le=i.customHoverColour,ne=a.useMemo((()=>{var e,t,o;return Object.assign(Object.assign({barPercentage:(null==i?void 0:i.barPercentage)||.4,categoryPercentage:1,pointStyle:"circle",barWidth:i.barWidth,borderRadius:(null==i?void 0:i.borderRadius)||void 0},"object"==typeof(null==i?void 0:i.borderRadius)?{borderSkipped:!1}:{}),(null===(e=null==i?void 0:i.addBarGap)||void 0===e?void 0:e.flag)?{borderWidth:{top:(null===(t=null==i?void 0:i.addBarGap)||void 0===t?void 0:t.value)||2,bottom:(null===(o=null==i?void 0:i.addBarGap)||void 0===o?void 0:o.value)||2,right:0,left:0},borderColor:"transparent"}:{})}),[i.barWidth,null==i?void 0:i.borderRadius,null==i?void 0:i.barPercentage,null==i?void 0:i.addBarGap]),de={};i.yAxis.data.map((e=>{e.map((e=>{de[e.name]?de[e.name].push(e.value):de[e.name]=[e.value]}))}));const re=Object.keys(de).map(((e,t)=>Object.assign({label:e,data:de[e],backgroundColor:null==ae?void 0:ae[t],hoverBackgroundColor:void 0===le?void 0:le[t]},ne)));let se=i.xAxis.data.map((e=>"string"==typeof e?e:e.name)),ce=re;if(i.truncateBars){const e=((e,t,i)=>{if(t.length<=i)return{truncatedData:e,truncatedLabels:t,originalData:e,originalLabels:t};const o=e.map((e=>e.slice(0,i))),a=e.map((e=>e.slice(i).reduce(((e,t)=>e+t),0)));o.forEach(((e,t)=>e.push(a[t])));const l=t.slice(0,i);return l.push("Others"),{truncatedData:o,truncatedLabels:l,originalData:e,originalLabels:t}})(re.map((e=>e.data)),se,i.truncateBars);re.forEach(((t,i)=>t.data=e.truncatedData[i])),se=e.truncatedLabels,ce=e.originalData.map(((e,t)=>Object.assign(Object.assign({},re[t]),{data:e})))}const ue={plugins:{legend:{display:!oe&&!i.customLegend,labels:{usePointStyle:!0,fontSize:2}},tooltip:{enabled:!oe,callbacks:{label:null===(o=i.tooltipConfig)||void 0===o?void 0:o.labelCallback,title:null===(O=i.tooltipConfig)||void 0===O?void 0:O.titleCallback,footer:null===(g=i.tooltipConfig)||void 0===g?void 0:g.footerCallback},footerFont:null===(x=null===(p=i.tooltipConfig)||void 0===p?void 0:p.footerStyles)||void 0===x?void 0:x.footerFont},datalabels:{display:null!==(b=i.showTotal)&&void 0!==b&&b,anchor:"end",align:"end",clamp:!0,formatter:(e,t)=>{var i;const o=t.datasetIndex,a=t.chart.data.datasets;if(o!==a.length-1)return"";const l=t.dataIndex;let n=0;for(let e=0;e<a.length;e++)n+=null!==(i=a[e].data[l])&&void 0!==i?i:0;return n?n<1e3?n:(n/1e3).toString().substring(0,4)+"k":""},color:s.COLORS.content.secondary}},layout:{padding:{right:i.showTotal&&i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?50:0,top:i.showTotal&&i.orientation!=u.GRAPH_ORIENTATION.HORIZONTAL?50:0}},responsive:!0,maintainAspectRatio:!1,legend:{display:!i.customLegend,labels:{usePointStyle:!0}},indexAxis:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"y":"x",scales:{x:{title:{display:!!(i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(A=i.yAxis)||void 0===A?void 0:A.title:null===(h=i.xAxis)||void 0===h?void 0:h.title),text:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(y=i.yAxis)||void 0===y?void 0:y.title:null===(R=i.xAxis)||void 0===R?void 0:R.title,color:null!==(I=i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(C=i.yAxis)||void 0===C?void 0:C.titleColor:null===(T=i.xAxis)||void 0===T?void 0:T.titleColor)&&void 0!==I?I:s.COLORS.content.secondary,font:{size:s.FONTS.caption.fontSize}},grid:{display:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL&&(void 0===(null===(f=null==i?void 0:i.showGridLines)||void 0===f?void 0:f.x)||(null===(j=null==i?void 0:i.showGridLines)||void 0===j?void 0:j.x)),color:s.COLORS.background.base},ticks:{fontSize:s.FONTS.caption.fontSize,color:null!==(N=i.yAxis.labelColor)&&void 0!==N?N:s.COLORS.content.secondary,callback:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?i.isInternationalStore?c.truncateValueForInternationalStore:c.truncateValueForIndianStore:void 0},stacked:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"boolean"!=typeof(null===(S=i.yAxis)||void 0===S?void 0:S.stacked)||(null===(m=i.yAxis)||void 0===m?void 0:m.stacked):"boolean"!=typeof(null===(L=i.xAxis)||void 0===L?void 0:L.stacked)||(null===(k=i.xAxis)||void 0===k?void 0:k.stacked)},y:Object.assign(Object.assign({},(null===(H=null==i?void 0:i.equalHeight)||void 0===H?void 0:H.flag)?{suggestedMin:-(null==i?void 0:i.equalHeight.max),suggestedMax:null==i?void 0:i.equalHeight.max}:{}),{title:{display:!!(i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(E=i.xAxis)||void 0===E?void 0:E.title:null===(F=i.yAxis)||void 0===F?void 0:F.title),text:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(P=i.xAxis)||void 0===P?void 0:P.title:null===(G=i.yAxis)||void 0===G?void 0:G.title,color:null!==(w=i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(_=i.xAxis)||void 0===_?void 0:_.titleColor:null===(B=i.yAxis)||void 0===B?void 0:B.titleColor)&&void 0!==w?w:s.COLORS.content.secondary,font:{size:s.FONTS.caption.fontSize}},grid:{display:i.orientation!==u.GRAPH_ORIENTATION.HORIZONTAL&&(void 0===(null===(D=null==i?void 0:i.showGridLines)||void 0===D?void 0:D.y)||(null===(q=null==i?void 0:i.showGridLines)||void 0===q?void 0:q.y)),color:s.COLORS.background.base},ticks:Object.assign(Object.assign({stepSize:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(Z=i.xAxis)||void 0===Z?void 0:Z.stepSize:null===(z=i.yAxis)||void 0===z?void 0:z.stepSize,fontSize:s.FONTS.caption.fontSize,color:null!==(M=i.xAxis.labelColor)&&void 0!==M?M:s.COLORS.content.secondary},oe?{min:0,max:2e3,stepSize:200}:{}),{callback:(null==i?void 0:i.ticksCallback)?null==i?void 0:i.ticksCallback:i.orientation!==u.GRAPH_ORIENTATION.VERTICAL?i.isInternationalStore?c.truncateValueForInternationalStore:c.truncateValueForIndianStore:void 0}),stacked:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"boolean"!=typeof(null===(W=i.xAxis)||void 0===W?void 0:W.stacked)||(null===(V=i.xAxis)||void 0===V?void 0:V.stacked):"boolean"!=typeof(null===(Y=i.yAxis)||void 0===Y?void 0:Y.stacked)||(null===(J=i.yAxis)||void 0===J?void 0:J.stacked)})},onClick:(e,t)=>{if(!i.onBarClick)return;const o=t[0].datasetIndex,a=t[0].index,l=e.chart.data.datasets[o].label,n=e.chart.data.labels[a];i.onBarClick(n,l)},onHover:(e,t)=>{i.onBarClick&&t.length&&(e.native.target.style.cursor="pointer")}};i.orientation&&i.orientation!==u.GRAPH_ORIENTATION.VERTICAL?delete ue.scales.y.ticks.callback:delete ue.scales.x.ticks.callback;const ve={labels:se,datasets:oe?[{data:ie,backgroundColor:"rgba(0,0,0,0)"}]:re},Oe={labels:i.xAxis.data.map((e=>"string"==typeof e?e:e.name)),datasets:oe?[{data:ie,backgroundColor:"rgba(0,0,0,0)"}]:ce},ge=function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e.jsx("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"row",gap:"10px",padding:"0px 24px 12px 24px",justifyContent:i.allowChartPopup&&!t?"flex-start":"flex-end",flexWrap:"wrap"}},{children:re.map((t=>e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"}},{children:[e.jsx("div",{style:{backgroundColor:t.backgroundColor,width:"16px",height:"16px",borderRadius:"2px"}}),e.jsx(r.BodyTiny,Object.assign({color:s.COLORS.content.secondary},{children:t.label}))]}),t.label.replace(" ","_"))))}))};return e.jsxs(v.GraphContainerWrapper,Object.assign({style:null!==(K=i.wrapperStyle)&&void 0!==K?K:{},padding:i.outerPadding,customLegend:i.customLegend},{children:[i.chartHeading&&e.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:i.hideHeading?"flex-end":"space-between"}},{children:[!0!==i.hideHeading&&e.jsx(r.TitleRegular,Object.assign({color:null!==(Q=i.chartHeading.color)&&void 0!==Q?Q:s.COLORS.content.secondary},{children:i.chartHeading.heading})),i.allowChartPopup&&e.jsx("div",Object.assign({style:{display:"flex",justifyContent:"flex-end"}},{children:e.jsx("div",{children:e.jsx(n.IconButton,{Icon:t.default,onClick:()=>{te(!0)}})})}))]})),i.customLegend&&ge(),e.jsx("div",Object.assign({className:"graph__wrapper"},{children:e.jsx("div",Object.assign({style:{height:null!==(U=i.graphCanvasHeight)&&void 0!==U?U:500,width:null!==(X=i.graphCanvasWidth)&&void 0!==X?X:"auto"}},{children:e.jsx(l.Bar,{options:ue,data:ve})}))})),ee&&e.jsx(d.StyledModal,Object.assign({open:ee,onClose:()=>te(!1),closeOnOutsideClick:!0,headingTitle:null===($=i.chartHeading)||void 0===$?void 0:$.heading,width:"85%"},{children:e.jsxs("div",Object.assign({className:"graph__wrapper",style:{padding:"8px"}},{children:[i.customLegend&&ge(!0),e.jsx("div",Object.assign({style:{height:"70vh",width:"100%",padding:"16px",borderRadius:"8px"}},{children:e.jsx(l.Bar,{options:ue,data:Oe})}))]}))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../../assets/icons/maximize.svg.js"),i=require("chart.js"),o=require("chartjs-plugin-datalabels"),a=require("react"),l=require("react-chartjs-2"),n=require("../../../icon-button/IconButton.js"),d=require("../../../modals/styledModal.js"),r=require("../../../TypographyStyle.js"),s=require("../../../../constants/Theme.js"),c=require("../utils/calcPercentage.js"),u=require("./StackedBarChart.model.js"),v=require("./StackedBarChart.styles.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=g(o);i.Chart.register(i.CategoryScale,i.LinearScale,i.BarElement,i.Tooltip,i.Legend,p.default);exports.StackedBarChart=i=>{var o,g,p,O,x,b,h,A,y,C,R,I,T,j,f,N,S,m,H,L,k,E,F,P,G,_,B,w,D,q,Z,z,M,W,V,Y,J,K,Q,U,X,$;const{headerIcons:ee=[],legendsAndIconDirection:te="row"}=i,[ie,oe]=a.useState(!1),ae=[250,1e3,800,1500,300,600],le=0===i.yAxis.data.length,ne=void 0===i.customColourScaleBrand&&void 0===i.customColourScalePastel?i.colorSchema===u.COLOR_SCHEMA.PASTEL?["#E6C7FF","#FEC6C6","#FEDEF3","#DEEFFF","#FFD8B1","#C7E5FF","#FFD3E6","#C9FFE5","#FFE3C7","#D9D9FF"]:["#5E07BB","#9E77ED","#D2AEFF","#F7D7FF","#CDE1FF","#92AFFA","#3935E1"]:i.colorSchema===u.COLOR_SCHEMA.PASTEL?i.customColourScalePastel:i.customColourScaleBrand,de=i.customHoverColour,re=a.useMemo((()=>{var e,t,o;return Object.assign(Object.assign({barPercentage:(null==i?void 0:i.barPercentage)||.4,categoryPercentage:1,pointStyle:"circle",barWidth:i.barWidth,borderRadius:(null==i?void 0:i.borderRadius)||void 0},"object"==typeof(null==i?void 0:i.borderRadius)?{borderSkipped:!1}:{}),(null===(e=null==i?void 0:i.addBarGap)||void 0===e?void 0:e.flag)?{borderWidth:{top:(null===(t=null==i?void 0:i.addBarGap)||void 0===t?void 0:t.value)||2,bottom:(null===(o=null==i?void 0:i.addBarGap)||void 0===o?void 0:o.value)||2,right:0,left:0},borderColor:"transparent"}:{})}),[i.barWidth,null==i?void 0:i.borderRadius,null==i?void 0:i.barPercentage,null==i?void 0:i.addBarGap]),se={};i.yAxis.data.map((e=>{e.map((e=>{se[e.name]?se[e.name].push(e.value):se[e.name]=[e.value]}))}));const ce=Object.keys(se).map(((e,t)=>Object.assign({label:e,data:se[e],backgroundColor:null==ne?void 0:ne[t],hoverBackgroundColor:void 0===de?void 0:de[t]},re)));let ue=i.xAxis.data.map((e=>"string"==typeof e?e:e.name)),ve=ce;if(i.truncateBars){const e=((e,t,i)=>{if(t.length<=i)return{truncatedData:e,truncatedLabels:t,originalData:e,originalLabels:t};const o=e.map((e=>e.slice(0,i))),a=e.map((e=>e.slice(i).reduce(((e,t)=>e+t),0)));o.forEach(((e,t)=>e.push(a[t])));const l=t.slice(0,i);return l.push("Others"),{truncatedData:o,truncatedLabels:l,originalData:e,originalLabels:t}})(ce.map((e=>e.data)),ue,i.truncateBars);ce.forEach(((t,i)=>t.data=e.truncatedData[i])),ue=e.truncatedLabels,ve=e.originalData.map(((e,t)=>Object.assign(Object.assign({},ce[t]),{data:e})))}const ge={plugins:{legend:{display:!le&&!i.customLegend,labels:{usePointStyle:!0,fontSize:2}},tooltip:{enabled:!le,callbacks:{label:null===(o=i.tooltipConfig)||void 0===o?void 0:o.labelCallback,title:null===(g=i.tooltipConfig)||void 0===g?void 0:g.titleCallback,footer:null===(p=i.tooltipConfig)||void 0===p?void 0:p.footerCallback},footerFont:null===(x=null===(O=i.tooltipConfig)||void 0===O?void 0:O.footerStyles)||void 0===x?void 0:x.footerFont},datalabels:{display:null!==(b=i.showTotal)&&void 0!==b&&b,anchor:"end",align:"end",clamp:!0,formatter:(e,t)=>{var i;const o=t.datasetIndex,a=t.chart.data.datasets;if(o!==a.length-1)return"";const l=t.dataIndex;let n=0;for(let e=0;e<a.length;e++)n+=null!==(i=a[e].data[l])&&void 0!==i?i:0;return n?n<1e3?n:(n/1e3).toString().substring(0,4)+"k":""},color:s.COLORS.content.secondary}},layout:{padding:{right:i.showTotal&&i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?50:0,top:i.showTotal&&i.orientation!=u.GRAPH_ORIENTATION.HORIZONTAL?50:0}},responsive:!0,maintainAspectRatio:!1,legend:{display:!i.customLegend,labels:{usePointStyle:!0}},indexAxis:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"y":"x",scales:{x:{title:{display:!!(i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(h=i.yAxis)||void 0===h?void 0:h.title:null===(A=i.xAxis)||void 0===A?void 0:A.title),text:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(y=i.yAxis)||void 0===y?void 0:y.title:null===(C=i.xAxis)||void 0===C?void 0:C.title,color:null!==(T=i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(R=i.yAxis)||void 0===R?void 0:R.titleColor:null===(I=i.xAxis)||void 0===I?void 0:I.titleColor)&&void 0!==T?T:s.COLORS.content.secondary,font:{size:s.FONTS.caption.fontSize}},grid:{display:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL&&(void 0===(null===(j=null==i?void 0:i.showGridLines)||void 0===j?void 0:j.x)||(null===(f=null==i?void 0:i.showGridLines)||void 0===f?void 0:f.x)),color:s.COLORS.background.base},ticks:{fontSize:s.FONTS.caption.fontSize,color:null!==(N=i.yAxis.labelColor)&&void 0!==N?N:s.COLORS.content.secondary,callback:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?i.isInternationalStore?c.truncateValueForInternationalStore:c.truncateValueForIndianStore:void 0},stacked:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"boolean"!=typeof(null===(S=i.yAxis)||void 0===S?void 0:S.stacked)||(null===(m=i.yAxis)||void 0===m?void 0:m.stacked):"boolean"!=typeof(null===(H=i.xAxis)||void 0===H?void 0:H.stacked)||(null===(L=i.xAxis)||void 0===L?void 0:L.stacked)},y:Object.assign(Object.assign({},(null===(k=null==i?void 0:i.equalHeight)||void 0===k?void 0:k.flag)?{suggestedMin:-(null==i?void 0:i.equalHeight.max),suggestedMax:null==i?void 0:i.equalHeight.max}:{}),{title:{display:!!(i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(E=i.xAxis)||void 0===E?void 0:E.title:null===(F=i.yAxis)||void 0===F?void 0:F.title),text:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(P=i.xAxis)||void 0===P?void 0:P.title:null===(G=i.yAxis)||void 0===G?void 0:G.title,color:null!==(w=i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(_=i.xAxis)||void 0===_?void 0:_.titleColor:null===(B=i.yAxis)||void 0===B?void 0:B.titleColor)&&void 0!==w?w:s.COLORS.content.secondary,font:{size:s.FONTS.caption.fontSize}},grid:{display:i.orientation!==u.GRAPH_ORIENTATION.HORIZONTAL&&(void 0===(null===(D=null==i?void 0:i.showGridLines)||void 0===D?void 0:D.y)||(null===(q=null==i?void 0:i.showGridLines)||void 0===q?void 0:q.y)),color:s.COLORS.background.base},ticks:Object.assign(Object.assign({stepSize:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(Z=i.xAxis)||void 0===Z?void 0:Z.stepSize:null===(z=i.yAxis)||void 0===z?void 0:z.stepSize,fontSize:s.FONTS.caption.fontSize,color:null!==(M=i.xAxis.labelColor)&&void 0!==M?M:s.COLORS.content.secondary},le?{min:0,max:2e3,stepSize:200}:{}),{callback:(null==i?void 0:i.ticksCallback)?null==i?void 0:i.ticksCallback:i.orientation!==u.GRAPH_ORIENTATION.VERTICAL?i.isInternationalStore?c.truncateValueForInternationalStore:c.truncateValueForIndianStore:void 0}),stacked:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"boolean"!=typeof(null===(W=i.xAxis)||void 0===W?void 0:W.stacked)||(null===(V=i.xAxis)||void 0===V?void 0:V.stacked):"boolean"!=typeof(null===(Y=i.yAxis)||void 0===Y?void 0:Y.stacked)||(null===(J=i.yAxis)||void 0===J?void 0:J.stacked)})},onClick:(e,t)=>{if(!i.onBarClick)return;const o=t[0].datasetIndex,a=t[0].index,l=e.chart.data.datasets[o].label,n=e.chart.data.labels[a];i.onBarClick(n,l)},onHover:(e,t)=>{i.onBarClick&&t.length&&(e.native.target.style.cursor="pointer")}};i.orientation&&i.orientation!==u.GRAPH_ORIENTATION.VERTICAL?delete ge.scales.y.ticks.callback:delete ge.scales.x.ticks.callback;const pe={labels:ue,datasets:le?[{data:ae,backgroundColor:"rgba(0,0,0,0)"}]:ce},Oe={labels:i.xAxis.data.map((e=>"string"==typeof e?e:e.name)),datasets:le?[{data:ae,backgroundColor:"rgba(0,0,0,0)"}]:ve},xe=function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e.jsx("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"row",gap:"10px",padding:"0px 24px 12px 24px",justifyContent:i.allowChartPopup&&!t?"flex-start":"flex-end",flexWrap:"wrap"}},{children:ce.map((t=>e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"}},{children:[e.jsx("div",{style:{backgroundColor:t.backgroundColor,width:"16px",height:"16px",borderRadius:"2px"}}),e.jsx(r.BodyTiny,Object.assign({color:s.COLORS.content.secondary},{children:t.label}))]}),t.label.replace(" ","_"))))}))};return e.jsxs(v.GraphContainerWrapper,Object.assign({style:null!==(K=i.wrapperStyle)&&void 0!==K?K:{},padding:i.outerPadding,customLegend:i.customLegend},{children:[i.chartHeading&&e.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:i.hideHeading?"flex-end":"space-between"}},{children:[!0!==i.hideHeading&&e.jsx(r.TitleRegular,Object.assign({color:null!==(Q=i.chartHeading.color)&&void 0!==Q?Q:s.COLORS.content.secondary},{children:i.chartHeading.heading})),i.allowChartPopup&&e.jsx("div",Object.assign({style:{display:"flex",justifyContent:"flex-end"}},{children:e.jsx("div",{children:e.jsx(n.IconButton,{Icon:t.default,onClick:()=>{oe(!0)}})})}))]})),i.customLegend&&e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:te,justifyContent:"space-between"}},{children:[e.jsx(v.HeaderIconWrapper,{children:ee.map(((t,i)=>e.jsx("div",{children:e.jsx("div",{children:t})},i)))}),xe()]})),e.jsx("div",Object.assign({className:"graph__wrapper"},{children:e.jsx("div",Object.assign({style:{height:null!==(U=i.graphCanvasHeight)&&void 0!==U?U:500,width:null!==(X=i.graphCanvasWidth)&&void 0!==X?X:"auto"}},{children:e.jsx(l.Bar,{options:ge,data:pe})}))})),ie&&e.jsx(d.StyledModal,Object.assign({open:ie,onClose:()=>oe(!1),closeOnOutsideClick:!0,headingTitle:null===($=i.chartHeading)||void 0===$?void 0:$.heading,width:"85%"},{children:e.jsxs("div",Object.assign({className:"graph__wrapper",style:{padding:"8px"}},{children:[i.customLegend&&xe(!0),e.jsx("div",Object.assign({style:{height:"70vh",width:"100%",padding:"16px",borderRadius:"8px"}},{children:e.jsx(l.Bar,{options:ge,data:Oe})}))]}))}))]}))};
@@ -82,4 +82,6 @@ export interface StackedBarGraphI {
82
82
  value: number;
83
83
  };
84
84
  ticksCallback?: (value: number) => string;
85
+ legendsAndIconDirection?: 'row-reverse' | 'row';
86
+ headerIcons?: React.ReactNode[];
85
87
  }
@@ -4,3 +4,4 @@ export declare const GraphContainerWrapper: import("styled-components").StyledCo
4
4
  isFunnel?: boolean | undefined;
5
5
  customLegend?: boolean | undefined;
6
6
  }, never>;
7
+ export declare const HeaderIconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("../../../../constants/Theme.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const n=t(e).default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("../../../../constants/Theme.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(e);const n=a.default.div`
2
2
  background-color: ${r.COLORS.surface.standard};
3
3
  padding: ${e=>{var r;return null!==(r=e.padding)&&void 0!==r?r:"24px"}};
4
4
  border: none;
@@ -28,4 +28,8 @@
28
28
  .legend__set {
29
29
  margin-top: 16px;
30
30
  }
31
- `;exports.GraphContainerWrapper=n;
31
+ `,p=a.default.div`
32
+ display: flex;
33
+ align-items: center;
34
+ gap: 8px;
35
+ `;exports.GraphContainerWrapper=n,exports.HeaderIconWrapper=p;
@@ -28,7 +28,6 @@ export type AvatarProps = {
28
28
  isSelected: boolean;
29
29
  isComments: boolean;
30
30
  };
31
- status?: 'ONLINE' | 'OFFLINE' | 'AWAY';
32
31
  };
33
32
  export declare const enum MESSAGE_CHANNELS {
34
33
  INSTAGRAM = "instagram",
@@ -42,7 +41,6 @@ export declare const enum MESSAGE_CHANNELS {
42
41
  EMAIL = "email",
43
42
  SMTP = "smtp",
44
43
  FACEBOOK_CATALOG = "facebook-catalog",
45
- TASKS = "tasks",
46
- BIK_LIVECHAT = "livechat"
44
+ TASKS = "tasks"
47
45
  }
48
46
  export declare const Avatar: React.FC<AvatarProps>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("./Avatar.styled.js"),i=require("./AvatarHelper.js"),r=require("../TypographyStyle.js"),a=require("../../constants/Theme.js"),o=require("../../assets/icons/bik_livechat.svg.js"),n=require("../../assets/icons/CheckSquareOffset.svg.js"),A=require("../../assets/icons/email-channel.svg.js"),S=require("../../assets/icons/facebook_channel.svg.js"),c=require("../../assets/icons/gmail.svg.js"),l=require("../../assets/icons/instagram-channel.svg.js"),E=require("../../assets/icons/whatsapp_color.svg.js");const d={[i.SIZE.SMALL]:16,[i.SIZE.MEDIUM]:20,[i.SIZE.INBOX]:24,[i.SIZE.LARGE]:32},u={[i.AVATAR_BACKGROUND.LIGHT]:a.COLORS.content.secondary,[i.AVATAR_BACKGROUND.DARK]:a.COLORS.surface.standard};var h;exports.MESSAGE_CHANNELS=void 0,(h=exports.MESSAGE_CHANNELS||(exports.MESSAGE_CHANNELS={})).INSTAGRAM="instagram",h.MESSENGER="messenger",h.WHATSAPP="whatsapp",h.GMAIL="gmail",h.LIVECHAT="livechat",h.GOOGLE_BUSINESS_CHAT="gbm",h.SHOPIFY="shopify",h.FACEBOOK="facebook",h.EMAIL="email",h.SMTP="smtp",h.FACEBOOK_CATALOG="facebook-catalog",h.TASKS="tasks",h.BIK_LIVECHAT="livechat";exports.AVATAR_SIZE_VS_ICON_SIZE_MAP=d,exports.Avatar=h=>{const[p,g]=s.useState(!1),x=()=>{const s=(h.name||"").split(".").join(" ").split(" ").map((e=>e.charAt(0).toUpperCase())).slice(0,2).join("");return h.size===i.SIZE.SMALL?e.jsx(r.BodyTiny,Object.assign({style:{color:u[h.background]}},{children:s})):h.size===i.SIZE.MEDIUM||h.size===i.SIZE.INBOX?e.jsx(r.TitleSmall,Object.assign({style:{color:u[h.background]}},{children:s})):h.size===i.SIZE.LARGE?e.jsx(r.TitleMedium,Object.assign({style:{color:u[h.background]}},{children:s})):void 0};return e.jsxs("div",Object.assign({style:{position:"relative"}},{children:[e.jsxs(t.AvatarStyle,Object.assign({type:h.type===i.AVATAR_TYPES.IMAGE&&p&&h.useNameFallback&&h.name?i.AVATAR_TYPES.INITIALS:h.type,size:h.size,background:h.background},{children:[h.type===i.AVATAR_TYPES.IMAGE&&(h.useNameFallback&&!p?e.jsx("img",{alt:"",width:i.AVATAR_SIZE_MAP[h.size],height:i.AVATAR_SIZE_MAP[h.size],style:{borderRadius:(null==h?void 0:h.borderRadius)||"50%",objectFit:"contain"},src:h.photoUrl,onError:()=>{g(!0)}}):h.useNameFallback&&p&&h.name?e.jsx("div",{children:x()}):e.jsx("img",{alt:"",width:i.AVATAR_SIZE_MAP[h.size],height:i.AVATAR_SIZE_MAP[h.size],style:{borderRadius:(null==h?void 0:h.borderRadius)||"50%",objectFit:"contain"},src:h.photoUrl})),h.type===i.AVATAR_TYPES.INITIALS&&e.jsx("div",{children:x()}),h.type===i.AVATAR_TYPES.ICON&&h.icon&&e.jsx(h.icon,{width:d[h.size],height:d[h.size],color:u[h.background]})]})),h.inboxSettings&&e.jsx("div",Object.assign({style:{position:"absolute",left:d[h.size]+"px",top:d[h.size]+"px",width:14,height:14,borderRadius:(null==h?void 0:h.borderRadius)||"50%",display:"flex",justifyContent:"center",backgroundColor:h.inboxSettings.isSelected?h.inboxSettings.isComments?a.COLORS.content.primary:a.COLORS.background.brandLight:h.inboxSettings.isComments?a.COLORS.content.primary:a.COLORS.surface.standard,alignItems:"center"}},{children:(()=>{switch(h.channelName){case exports.MESSAGE_CHANNELS.EMAIL:case exports.MESSAGE_CHANNELS.SMTP:return e.jsx(A.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.FACEBOOK:case exports.MESSAGE_CHANNELS.FACEBOOK_CATALOG:case exports.MESSAGE_CHANNELS.MESSENGER:return e.jsx(S.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.INSTAGRAM:return e.jsx(l.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.WHATSAPP:return e.jsx(E.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.GMAIL:return e.jsx(c.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.TASKS:return e.jsx(n.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.BIK_LIVECHAT:return e.jsx(o.default,{width:11,height:11})}})()})),h.status&&e.jsx("div",Object.assign({style:{position:"absolute",left:d[h.size]+"px",top:d[h.size]+"px",width:11,height:11,borderRadius:"50%",display:"flex",justifyContent:"center",backgroundColor:a.COLORS.surface.standard,alignItems:"center"}},{children:(console.log("props.status",h.status),h.status?e.jsx("div",{style:{backgroundColor:"ONLINE"===h.status?a.COLORS.special.whatsapp.brand:a.COLORS.content.inactive,width:"8px",height:"8px",borderRadius:"50%"}}):null)}))]}))},exports.BACKGROUND_VS_TEXT_COLOR_MAP=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("./Avatar.styled.js"),i=require("./AvatarHelper.js"),r=require("../TypographyStyle.js"),a=require("../../constants/Theme.js"),A=require("../../assets/icons/CheckSquareOffset.svg.js"),o=require("../../assets/icons/email-channel.svg.js"),n=require("../../assets/icons/facebook_channel.svg.js"),S=require("../../assets/icons/gmail.svg.js"),c=require("../../assets/icons/instagram-channel.svg.js"),E=require("../../assets/icons/whatsapp_color.svg.js");const l={[i.SIZE.SMALL]:16,[i.SIZE.MEDIUM]:20,[i.SIZE.INBOX]:24,[i.SIZE.LARGE]:32},d={[i.AVATAR_BACKGROUND.LIGHT]:a.COLORS.content.secondary,[i.AVATAR_BACKGROUND.DARK]:a.COLORS.surface.standard};var u;exports.MESSAGE_CHANNELS=void 0,(u=exports.MESSAGE_CHANNELS||(exports.MESSAGE_CHANNELS={})).INSTAGRAM="instagram",u.MESSENGER="messenger",u.WHATSAPP="whatsapp",u.GMAIL="gmail",u.LIVECHAT="livechat",u.GOOGLE_BUSINESS_CHAT="gbm",u.SHOPIFY="shopify",u.FACEBOOK="facebook",u.EMAIL="email",u.SMTP="smtp",u.FACEBOOK_CATALOG="facebook-catalog",u.TASKS="tasks";exports.AVATAR_SIZE_VS_ICON_SIZE_MAP=l,exports.Avatar=u=>{const[h,p]=s.useState(!1),g=()=>{const s=(u.name||"").split(".").join(" ").split(" ").map((e=>e.charAt(0).toUpperCase())).slice(0,2).join("");return u.size===i.SIZE.SMALL?e.jsx(r.BodyTiny,Object.assign({style:{color:d[u.background]}},{children:s})):u.size===i.SIZE.MEDIUM||u.size===i.SIZE.INBOX?e.jsx(r.TitleSmall,Object.assign({style:{color:d[u.background]}},{children:s})):u.size===i.SIZE.LARGE?e.jsx(r.TitleMedium,Object.assign({style:{color:d[u.background]}},{children:s})):void 0};return e.jsxs("div",Object.assign({style:{position:"relative"}},{children:[e.jsxs(t.AvatarStyle,Object.assign({type:u.type===i.AVATAR_TYPES.IMAGE&&h&&u.useNameFallback&&u.name?i.AVATAR_TYPES.INITIALS:u.type,size:u.size,background:u.background},{children:[u.type===i.AVATAR_TYPES.IMAGE&&(u.useNameFallback&&!h?e.jsx("img",{alt:"",width:i.AVATAR_SIZE_MAP[u.size],height:i.AVATAR_SIZE_MAP[u.size],style:{borderRadius:(null==u?void 0:u.borderRadius)||"50%",objectFit:"contain"},src:u.photoUrl,onError:()=>{p(!0)}}):u.useNameFallback&&h&&u.name?e.jsx("div",{children:g()}):e.jsx("img",{alt:"",width:i.AVATAR_SIZE_MAP[u.size],height:i.AVATAR_SIZE_MAP[u.size],style:{borderRadius:(null==u?void 0:u.borderRadius)||"50%",objectFit:"contain"},src:u.photoUrl})),u.type===i.AVATAR_TYPES.INITIALS&&e.jsx("div",{children:g()}),u.type===i.AVATAR_TYPES.ICON&&u.icon&&e.jsx(u.icon,{width:l[u.size],height:l[u.size],color:d[u.background]})]})),u.inboxSettings&&e.jsx("div",Object.assign({style:{position:"absolute",left:"20px",top:"20px",width:14,height:14,borderRadius:(null==u?void 0:u.borderRadius)||"50%",display:"flex",justifyContent:"center",backgroundColor:u.inboxSettings.isSelected?u.inboxSettings.isComments?a.COLORS.content.primary:a.COLORS.background.brandLight:u.inboxSettings.isComments?a.COLORS.content.primary:a.COLORS.surface.standard,alignItems:"center"}},{children:(()=>{switch(u.channelName){case exports.MESSAGE_CHANNELS.EMAIL:case exports.MESSAGE_CHANNELS.SMTP:return e.jsx(o.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.FACEBOOK:case exports.MESSAGE_CHANNELS.FACEBOOK_CATALOG:case exports.MESSAGE_CHANNELS.MESSENGER:return e.jsx(n.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.INSTAGRAM:return e.jsx(c.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.WHATSAPP:return e.jsx(E.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.GMAIL:return e.jsx(S.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.TASKS:return e.jsx(A.default,{width:11,height:11})}})()}))]}))},exports.BACKGROUND_VS_TEXT_COLOR_MAP=d;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Menus: ({
3
2
  displayName: string;
4
3
  key: number;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/check.svg.js"),t=require("../../assets/icons/checkCircle.svg.js"),i=require("../../assets/icons/quotes.svg.js"),a=require("../../assets/icons/WhiteStarFilled.svg.js"),n=require("../button/Button.js"),o=require("./SubscriptionPlanStyled.js"),r=require("../TypographyStyle.js"),l=require("../../hooks/useCurreny.js"),c=require("../../constants/Theme.js"),d=require("../tag/Tag.js"),h=require("../tooltips/Tooltip.js");exports.NewSubscriptionPlan=u=>{var p;const{formatCurrency:j}=l.useCurrency(),g=u.showMonthlyOptions?u.features:u.annualFeatures||[],m=u.showMonthlyOptions?u.monthlyPlan:u.yearlyPlan,x=!u.isDisabled&&u.isMostPopular,b=u.showMonthlyOptions?u.code:null!==(p=u.yearlyCode)&&void 0!==p?p:u.code,{planName:y,isSelected:O=!1,isDisabled:C=!1,onPlanSelect:v,oldPrice:T,hideMonthYearTag:S,planDescription:N,planDescriptionDiscount:f,showTrialOptions:L,freeTrialMessages:P,extraBlockMessage:w,isLoading:M,buttonText:k,bottomDescription:q,showMonthlyOptions:B,popularTestimony:R,skipRadioSelection:D=!1,includeText:F,height:$,showFeaturesButton:_,businessDescription:z,isPlanSelected:H=!1,onClickShowAllFeatures:W,showSelectedPlanChip:I=!1,perMonthForYearly:U=!1,minHeightOfFeatures:Y,hoverTooltip:A}=u,E=e=>U&&!B?0==e?"$0":j(Math.round(e/12),"USD"):0==e?"$0":j(e,"USD");return e.jsx(h.Tooltip,Object.assign({body:A},{children:e.jsxs(o.NewSubscriptionStyled,Object.assign({height:$,showMostPopularChip:x||!1,onClick:()=>v(b)},{children:[x&&e.jsxs("div",Object.assign({className:"most-popular-chip"},{children:[e.jsx(r.Caption,Object.assign({className:"popular-text"},{children:"Most popular "})),e.jsx(a.default,{height:12,width:12})]})),e.jsxs("div",Object.assign({className:`box ${C?"disabled":""} \n\t\t\t\t`},{children:[e.jsxs("div",Object.assign({className:"radio-flex"},{children:[!D&&e.jsx("input",{type:"radio",id:"html",name:"fav_language",value:"HTML",disabled:null!=C&&C,onChange:()=>v(b),className:"radio-button",checked:H}),e.jsx(r.TitleRegular,Object.assign({style:{color:c.COLORS.content.secondary,marginBottom:4}},{children:y})),I&&e.jsx("div",Object.assign({style:{marginLeft:"auto"}},{children:e.jsx(d.Tag,{tagText:"Current plan",type:"positive",theme:"dark"})}))]})),e.jsxs("div",Object.assign({className:"price-block"},{children:[T?e.jsx(r.BodyCaption,Object.assign({className:"old--price"},{children:E(m.price)})):e.jsx(e.Fragment,{}),e.jsx(r.TitleLarge,Object.assign({style:{color:c.COLORS.content.primary}},{children:E(T||m.price)})),e.jsx(r.Caption,Object.assign({style:{color:c.COLORS.content.secondary,marginLeft:4}},{children:S?"":"/ "+(B?"month":U?"month billed annually":"year")}))]})),N&&e.jsxs("div",Object.assign({className:"per-message-price"},{children:[e.jsx(r.BodyCaption,Object.assign({style:{color:c.COLORS.content.secondary}},{children:N})),f&&e.jsx(r.BodyCaption,Object.assign({style:{color:c.COLORS.background.positive.vibrant,marginLeft:4}},{children:f}))]})),z&&z.length&&e.jsx("div",Object.assign({style:{marginTop:4}},{children:z.map(((s,t)=>e.jsx(r.BodyCaption,{style:{color:c.COLORS.content.secondary},dangerouslySetInnerHTML:{__html:s}},t)))})),L&&e.jsxs(r.Caption,Object.assign({className:"trial "+(O?"selected":"")},{children:["7 day free trial with ",P," messages"]})),w&&e.jsx(r.Caption,Object.assign({className:"trial "+(O?"selected":"")},{children:w})),e.jsx(r.TitleSmall,Object.assign({className:"extra-include-margin",style:{height:F?"":"20px"}},{children:F||""})),e.jsx("div",Object.assign({className:"features",style:{minHeight:Y}},{children:g.map(((s,i)=>e.jsxs("div",Object.assign({className:"feature"},{children:[e.jsx("div",{children:e.jsx(t.default,{height:20,width:20,color:c.COLORS.content.primary})}),e.jsx(r.BodyCaption,Object.assign({className:"feature-text"},{children:s.detail}),i)]}),s.detail)))})),_&&e.jsx(n.Button,{isLoading:!1,buttonType:"tertiary",buttonText:"See all features",size:"small",onClick:e=>{e.stopPropagation(),W&&W()}}),D&&e.jsx("div",Object.assign({className:"button-box"},{children:M?e.jsx(n.Button,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):e.jsxs(e.Fragment,{children:[O&&e.jsx(n.Button,{disabled:C,LeadingIcon:s.default,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:k||"Selected Plan"}),!O&&!C&&e.jsx(n.Button,{buttonType:"primary",size:"medium",onClick:e=>{e.stopPropagation(),v(b)},matchParentWidth:!0,buttonText:k||"Choose plan"})]})})),R&&e.jsxs("div",Object.assign({className:"popular-testimony"},{children:[e.jsx(i.default,{height:26,width:70}),e.jsx("div",Object.assign({className:"testimony-text"},{children:e.jsx("i",{children:R})}))]}))]})),q&&e.jsx("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${C?"disabled":""}\n\t\t\t\t\t${O?"selected":""}\n\t\t\t\t`},{children:e.jsx(r.Caption,Object.assign({className:"text",style:{color:c.COLORS.background.inverse}},{children:q}))}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/check.svg.js"),t=require("../../assets/icons/checkCircle.svg.js"),i=require("../../assets/icons/quotes.svg.js"),a=require("../../assets/icons/WhiteStarFilled.svg.js"),n=require("../button/Button.js"),o=require("./SubscriptionPlanStyled.js"),r=require("../TypographyStyle.js"),l=require("../../hooks/useCurreny.js"),c=require("../../constants/Theme.js"),d=require("../tag/Tag.js"),h=require("../tooltips/Tooltip.js");exports.NewSubscriptionPlan=u=>{var j;const{formatCurrency:p}=l.useCurrency(),g=u.showMonthlyOptions?u.features:u.annualFeatures||[],m=u.showMonthlyOptions?u.monthlyPlan:u.yearlyPlan,x=!u.isDisabled&&u.isMostPopular,b=u.showMonthlyOptions?u.code:null!==(j=u.yearlyCode)&&void 0!==j?j:u.code,{planName:y,isSelected:O=!1,isDisabled:C=!1,onPlanSelect:v,oldPrice:T,hideMonthYearTag:S,planDescription:N,planDescriptionDiscount:f,showTrialOptions:L,freeTrialMessages:P,extraBlockMessage:k,isLoading:w,buttonText:M,bottomDescription:B,showMonthlyOptions:q,popularTestimony:R,skipRadioSelection:D=!1,includeText:F,height:$,showFeaturesButton:_,businessDescription:z,isPlanSelected:H=!1,onClickShowAllFeatures:W,showSelectedPlanChip:I=!1,perMonthForYearly:U=!1,minHeightOfFeatures:Y,hoverTooltip:A,hidePriceBlock:E=!1}=u,G=e=>U&&!q?0==e?"$0":p(Math.round(e/12),"USD"):0==e?"$0":p(e,"USD");return e.jsx(h.Tooltip,Object.assign({body:A},{children:e.jsxs(o.NewSubscriptionStyled,Object.assign({height:$,showMostPopularChip:x||!1,onClick:()=>v(b)},{children:[x&&e.jsxs("div",Object.assign({className:"most-popular-chip"},{children:[e.jsx(r.Caption,Object.assign({className:"popular-text"},{children:"Most popular "})),e.jsx(a.default,{height:12,width:12})]})),e.jsxs("div",Object.assign({className:`box ${C?"disabled":""} \n\t\t\t\t`},{children:[e.jsxs("div",Object.assign({className:"radio-flex"},{children:[!D&&e.jsx("input",{type:"radio",id:"html",name:"fav_language",value:"HTML",disabled:null!=C&&C,onChange:()=>v(b),className:"radio-button",checked:H}),e.jsx(r.TitleRegular,Object.assign({style:{color:c.COLORS.content.secondary,marginBottom:4}},{children:y})),I&&e.jsx("div",Object.assign({style:{marginLeft:"auto"}},{children:e.jsx(d.Tag,{tagText:"Current plan",type:"positive",theme:"dark"})}))]})),E?e.jsx(e.Fragment,{}):e.jsxs("div",Object.assign({className:"price-block"},{children:[T?e.jsx(r.BodyCaption,Object.assign({className:"old--price"},{children:G(m.price)})):e.jsx(e.Fragment,{}),e.jsx(r.TitleLarge,Object.assign({style:{color:c.COLORS.content.primary}},{children:G(T||m.price)})),e.jsx(r.Caption,Object.assign({style:{color:c.COLORS.content.secondary,marginLeft:4}},{children:S?"":"/ "+(q?"month":U?"month billed annually":"year")}))]})),N&&e.jsxs("div",Object.assign({className:"per-message-price"},{children:[e.jsx(r.BodyCaption,Object.assign({style:{color:c.COLORS.content.secondary}},{children:N})),f&&e.jsx(r.BodyCaption,Object.assign({style:{color:c.COLORS.background.positive.vibrant,marginLeft:4}},{children:f}))]})),z&&z.length&&e.jsx("div",Object.assign({style:{marginTop:4}},{children:z.map(((s,t)=>e.jsx(r.BodyCaption,{style:{color:c.COLORS.content.secondary},dangerouslySetInnerHTML:{__html:s}},t)))})),L&&e.jsxs(r.Caption,Object.assign({className:"trial "+(O?"selected":"")},{children:["7 day free trial with ",P," messages"]})),k&&e.jsx(r.Caption,Object.assign({className:"trial "+(O?"selected":"")},{children:k})),e.jsx(r.TitleSmall,Object.assign({className:"extra-include-margin",style:{height:F?"":"20px"}},{children:F||""})),e.jsx("div",Object.assign({className:"features",style:{minHeight:Y}},{children:g.map(((s,i)=>e.jsxs("div",Object.assign({className:"feature"},{children:[e.jsx("div",{children:e.jsx(t.default,{height:20,width:20,color:c.COLORS.content.primary})}),e.jsx(r.BodyCaption,Object.assign({className:"feature-text"},{children:s.detail}),i)]}),s.detail)))})),_&&e.jsx(n.Button,{isLoading:!1,buttonType:"tertiary",buttonText:"See all features",size:"small",onClick:e=>{e.stopPropagation(),W&&W()}}),D&&e.jsx("div",Object.assign({className:"button-box"},{children:w?e.jsx(n.Button,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):e.jsxs(e.Fragment,{children:[O&&e.jsx(n.Button,{disabled:C,LeadingIcon:s.default,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:M||"Selected Plan"}),!O&&!C&&e.jsx(n.Button,{buttonType:"primary",size:"medium",onClick:e=>{e.stopPropagation(),v(b)},matchParentWidth:!0,buttonText:M||"Choose plan"})]})})),R&&e.jsxs("div",Object.assign({className:"popular-testimony"},{children:[e.jsx(i.default,{height:26,width:70}),e.jsx("div",Object.assign({className:"testimony-text"},{children:e.jsx("i",{children:R})}))]}))]})),B&&e.jsx("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${C?"disabled":""}\n\t\t\t\t\t${O?"selected":""}\n\t\t\t\t`},{children:e.jsx(r.Caption,Object.assign({className:"text",style:{color:c.COLORS.background.inverse}},{children:B}))}))]}))}))};
@@ -31,6 +31,7 @@ export interface SubscriptionPlanProps {
31
31
  hideMonthYearTag?: boolean;
32
32
  buttonText?: string;
33
33
  hoverTooltip?: string;
34
+ hidePriceBlock?: boolean;
34
35
  }
35
36
  type Props = SubscriptionPlanProps;
36
37
  export declare const SubscriptionPlan: FunctionComponent<Props>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/check.svg.js"),t=require("../button/Button.js"),i=require("./SubscriptionPlanStyled.js"),n=require("../TypographyStyle.js"),a=require("../../hooks/useCurreny.js"),r=require("../../constants/Theme.js");exports.SubscriptionPlan=c=>{const{formatCurrency:o}=a.useCurrency(),l=c.showMonthlyOptions?c.features:c.annualFeatures||[],d=c.showMonthlyOptions?c.monthlyPlan:c.yearlyPlan,j=!c.isDisabled&&c.isMostPopular,p=e=>0==e?"$0":o(e,"USD");return e.jsxs(i.SubscriptionPlanStyled,Object.assign({isManifestPlan:!0,isSelected:c.isSelected||!1,style:{marginTop:j?0:24}},{children:[j&&e.jsx("div",Object.assign({className:"most-popular"},{children:e.jsx(n.Caption,Object.assign({className:"text"},{children:"Most popular ⭐️"}))})),e.jsxs("div",Object.assign({className:`box ${c.isSelected?"selected":""} ${c.isDisabled?"disabled":""} ${j?"":"rounded-corners"}\n\t\t\t\t`},{children:[e.jsxs("div",{children:[e.jsx(n.TitleRegular,Object.assign({style:{color:r.COLORS.content.secondary,marginBottom:4}},{children:c.planName})),e.jsxs("div",Object.assign({className:"price-block"},{children:[c.oldPrice?e.jsx(n.BodyCaption,Object.assign({className:"old--price"},{children:p(d.price)})):e.jsx(e.Fragment,{}),e.jsx(n.TitleMedium,Object.assign({style:{color:r.COLORS.content.primary}},{children:c.oldPrice?p(c.oldPrice):p(d.price)})),e.jsx(n.BodyPrimary,Object.assign({style:{color:r.COLORS.content.secondary,marginLeft:4}},{children:c.hideMonthYearTag?"":"/ "+(c.showMonthlyOptions?"month":"year")}))]})),e.jsxs("div",Object.assign({className:"per-message-price"},{children:[c.planDescription&&e.jsx(n.BodyCaption,Object.assign({style:{color:r.COLORS.content.secondary}},{children:c.planDescription})),c.planDescriptionDiscount&&e.jsx(n.BodyCaption,Object.assign({style:{color:r.COLORS.background.positive.vibrant,marginLeft:4}},{children:c.planDescriptionDiscount}))]})),c.showTrialOptions&&e.jsxs(n.Caption,Object.assign({className:"trial "+(c.isSelected?"selected":"")},{children:["7 day free trial with ",c.freeTrialMessages," messages"]})),c.extraBlockMessage&&e.jsx(n.Caption,Object.assign({className:"trial "+(c.isSelected?"selected":"")},{children:c.extraBlockMessage})),e.jsx("div",Object.assign({className:"features"},{children:l.map(((t,i)=>e.jsxs("div",Object.assign({className:"feature"},{children:[e.jsx("div",{children:e.jsx(s.default,{height:12,width:12,color:r.COLORS.content.primary})}),e.jsx(n.BodyCaption,Object.assign({className:"feature-text"},{children:t.detail}),i)]}),t.detail)))}))]}),e.jsx("div",Object.assign({className:"button-box"},{children:c.isLoading?e.jsx(t.Button,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):e.jsxs(e.Fragment,{children:[c.isSelected&&e.jsx(t.Button,{disabled:c.isDisabled,LeadingIcon:s.default,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:c.buttonText||"Selected Plan"}),!c.isSelected&&!c.isDisabled&&e.jsx(t.Button,{buttonType:"primary",size:"medium",onClick:()=>c.onPlanSelect(c.code),matchParentWidth:!0,buttonText:c.buttonText||"Choose plan"})]})}))]})),c.bottomDescription&&e.jsx("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${c.isDisabled?"disabled":""}\n\t\t\t\t\t${c.isSelected?"selected":""}\n\t\t\t\t`},{children:e.jsx(n.Caption,Object.assign({className:"text",style:{color:r.COLORS.background.inverse}},{children:c.bottomDescription}))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/check.svg.js"),t=require("../button/Button.js"),i=require("./SubscriptionPlanStyled.js"),n=require("../TypographyStyle.js"),a=require("../../hooks/useCurreny.js"),r=require("../../constants/Theme.js");exports.SubscriptionPlan=c=>{const{formatCurrency:o}=a.useCurrency(),l=c.showMonthlyOptions?c.features:c.annualFeatures||[],d=c.showMonthlyOptions?c.monthlyPlan:c.yearlyPlan,j=!c.isDisabled&&c.isMostPopular,u=e=>0==e?"$0":o(e,"USD");return e.jsxs(i.SubscriptionPlanStyled,Object.assign({isManifestPlan:!0,isSelected:c.isSelected||!1,style:{marginTop:j?0:24}},{children:[j&&e.jsx("div",Object.assign({className:"most-popular"},{children:e.jsx(n.Caption,Object.assign({className:"text"},{children:"Most popular ⭐️"}))})),e.jsxs("div",Object.assign({className:`box ${c.isSelected?"selected":""} ${c.isDisabled?"disabled":""} ${j?"":"rounded-corners"}\n\t\t\t\t`},{children:[e.jsxs("div",{children:[e.jsx(n.TitleRegular,Object.assign({style:{color:r.COLORS.content.secondary,marginBottom:4}},{children:c.planName})),(null==c?void 0:c.hidePriceBlock)?e.jsx(e.Fragment,{}):e.jsxs("div",Object.assign({className:"price-block"},{children:[c.oldPrice?e.jsx(n.BodyCaption,Object.assign({className:"old--price"},{children:u(d.price)})):e.jsx(e.Fragment,{}),e.jsx(n.TitleMedium,Object.assign({style:{color:r.COLORS.content.primary}},{children:c.oldPrice?u(c.oldPrice):u(d.price)})),e.jsx(n.BodyPrimary,Object.assign({style:{color:r.COLORS.content.secondary,marginLeft:4}},{children:c.hideMonthYearTag?"":"/ "+(c.showMonthlyOptions?"month":"year")}))]})),e.jsxs("div",Object.assign({className:"per-message-price"},{children:[c.planDescription&&e.jsx(n.BodyCaption,Object.assign({style:{color:r.COLORS.content.secondary}},{children:c.planDescription})),c.planDescriptionDiscount&&e.jsx(n.BodyCaption,Object.assign({style:{color:r.COLORS.background.positive.vibrant,marginLeft:4}},{children:c.planDescriptionDiscount}))]})),c.showTrialOptions&&e.jsxs(n.Caption,Object.assign({className:"trial "+(c.isSelected?"selected":"")},{children:["7 day free trial with ",c.freeTrialMessages," messages"]})),c.extraBlockMessage&&e.jsx(n.Caption,Object.assign({className:"trial "+(c.isSelected?"selected":"")},{children:c.extraBlockMessage})),e.jsx("div",Object.assign({className:"features"},{children:l.map(((t,i)=>e.jsxs("div",Object.assign({className:"feature"},{children:[e.jsx("div",{children:e.jsx(s.default,{height:12,width:12,color:r.COLORS.content.primary})}),e.jsx(n.BodyCaption,Object.assign({className:"feature-text"},{children:t.detail}),i)]}),t.detail)))}))]}),e.jsx("div",Object.assign({className:"button-box"},{children:c.isLoading?e.jsx(t.Button,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):e.jsxs(e.Fragment,{children:[c.isSelected&&e.jsx(t.Button,{disabled:c.isDisabled,LeadingIcon:s.default,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:c.buttonText||"Selected Plan"}),!c.isSelected&&!c.isDisabled&&e.jsx(t.Button,{buttonType:"primary",size:"medium",onClick:()=>c.onPlanSelect(c.code),matchParentWidth:!0,buttonText:c.buttonText||"Choose plan"})]})}))]})),c.bottomDescription&&e.jsx("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${c.isDisabled?"disabled":""}\n\t\t\t\t\t${c.isSelected?"selected":""}\n\t\t\t\t`},{children:e.jsx(n.Caption,Object.assign({className:"text",style:{color:r.COLORS.background.inverse}},{children:c.bottomDescription}))}))]}))};
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
3
3
  declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default EventsTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
3
+ import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
4
+ import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
5
5
  declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
6
6
  cacheKey: string;
7
7
  propertyAddBtnText: string;
@@ -1 +1 @@
1
- import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import i,{useEffect as r,useImperativeHandle as l}from"react";import{useSelector as s}from"react-redux";import{Button as d}from"../../button/Button.js";import{Dropdown as n}from"../../dropdown/Dropdown.js";import{JOIN_OPERATOR_OPTIONS as a}from"../constants/operators.js";import{useQueryBuilder as c}from"../hooks/useQueryBuilder.js";import p from"./AddNodeButton.js";import m from"./DeleteButton.js";import u from"./QueryBuilderNode/QueryBuilderNode.js";import{LinedContainer as f}from"./QueryBuilderNodes.styled.js";const y=i.forwardRef(((i,y)=>{let{infinite:j,addNodeBtnText:b,allowedNodes:v,typesAPIHandlers:g,onStateChange:h,mode:w,selectorKey:x}=i;var N;const O=s((e=>null==e?void 0:e[x])),{deleteNode:B,clearAll:C,selectJoinOperator:Q,fillState:S}=c(x);r((()=>{null==h||h(Object.assign({},O))}),[O]);const T=a.map((e=>(null==O?void 0:O.operator)&&e.value===O.operator?Object.assign(Object.assign({},e),{selected:!0}):e));return l(y,(()=>({getState:()=>Object.assign({},O),fillState(e){S(Object.assign({},e))},clearAll:C}))),e(t,{children:[null===(N=null==O?void 0:O.nodes)||void 0===N?void 0:N.map(((i,r)=>e(t,{children:[0!==r&&o("div",Object.assign({style:{width:80,position:"relative"}},{children:o(n,{disabled:"view"===w,onSelect:e=>{Q(e.value)},options:T,width:"80px",height:96,size:"small"})})),e("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:12}},{children:[o(f,Object.assign({style:{paddingTop:0===r?0:24,maxWidth:"calc(100% - 24px)"}},{children:o(u,{selectorKey:x,mode:null!=w?w:"create",allowedNodes:v,node:i,apiHandler:g[i.type]})})),o(t,"view"!==w?{children:0!==r&&o(m,{onClick:()=>B(i._id)})}:{})]}),i._id)]}))),j&&"view"!==w&&e("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[o(p,{buttonText:b,allowedNodes:v,selectorKey:x}),o(d,{buttonText:"Clear filters",size:"medium",buttonType:"tertiaryGray",onClick:()=>C(v[0])})]}))]})}));y.displayName="QueryBuilderNodes";export{y as default};
1
+ import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import i,{useEffect as r,useImperativeHandle as l}from"react";import{useSelector as s}from"react-redux";import{Button as d}from"../../button/Button.js";import{Dropdown as n}from"../../dropdown/Dropdown.js";import{JOIN_OPERATOR_OPTIONS as a}from"../constants/operators.js";import{useQueryBuilder as c}from"../hooks/useQueryBuilder.js";import p from"./AddNodeButton.js";import m from"./DeleteButton.js";import u from"./QueryBuilderNode/QueryBuilderNode.js";import{LinedContainer as f}from"./QueryBuilderNodes.styled.js";const y=i.forwardRef(((i,y)=>{let{infinite:j,addNodeBtnText:b,allowedNodes:g,typesAPIHandlers:v,onStateChange:h,mode:w,selectorKey:x}=i;var N;const O=s((e=>null==e?void 0:e[x])),{deleteNode:B,clearAll:S,selectJoinOperator:C,fillState:Q}=c(x);r((()=>{null==h||h(Object.assign({},O))}),[O]);const T=a.map((e=>(null==O?void 0:O.operator)&&e.value===O.operator?Object.assign(Object.assign({},e),{selected:!0}):e));return l(y,(()=>({getState:()=>Object.assign({},O),fillState(e){Q(Object.assign({},e))},clearAll:S}))),e(t,{children:[null===(N=null==O?void 0:O.nodes)||void 0===N?void 0:N.map(((i,r)=>e(t,{children:[0!==r&&o("div",Object.assign({style:{width:80,position:"relative"}},{children:o(n,{disabled:"view"===w,onSelect:e=>{C(e.value)},options:T,width:"80px",height:96,size:"small",skipSorting:!0})})),e("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:12}},{children:[o(f,Object.assign({style:{paddingTop:0===r?0:24,maxWidth:"calc(100% - 24px)"}},{children:o(u,{selectorKey:x,mode:null!=w?w:"create",allowedNodes:g,node:i,apiHandler:v[i.type]})})),o(t,"view"!==w?{children:0!==r&&o(m,{onClick:()=>B(i._id)})}:{})]}),i._id)]}))),j&&"view"!==w&&e("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[o(p,{buttonText:b,allowedNodes:g,selectorKey:x}),o(d,{buttonText:"Clear filters",size:"medium",buttonType:"tertiaryGray",onClick:()=>S(g[0])})]}))]})}));y.displayName="QueryBuilderNodes";export{y as default};
@@ -37,5 +37,7 @@ export type LineChartProps = {
37
37
  titleTooltipCallback?: (context: any) => void;
38
38
  isInternationalStore?: boolean;
39
39
  customYHeaders?: any;
40
+ legendsAndIconDirection?: 'row-reverse' | 'row';
41
+ headerIcons?: React.ReactNode[];
40
42
  };
41
43
  export declare const LineChart: React.FC<LineChartProps>;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{Chart as o,CategoryScale as r,LinearScale as n,PointElement as i,BarElement as a,LineElement as s,ArcElement as d,Filler as c,Title as u,Tooltip as p,Legend as g}from"chart.js";import{useState as b,useRef as y,useEffect as m}from"react";import{Line as v}from"react-chartjs-2";import{BodyTiny as h}from"../../../TypographyStyle.js";import{COLORS as f}from"../../../../constants/Theme.js";import{truncateValueForInternationalStore as k,truncateValueForIndianStore as x}from"../utils/calcPercentage.js";import{LegendWrapper as C,LegendContainer as j,LegendColor as w}from"./LineChart.styled.js";o.register(r,n,i,a,s,d,c,u,p,g);const B=o=>{let{scaleText:r,labels:n,canvasHeight:i,datas:a,maintainAspectRatio:s=!1,stepSize:d,min:c,max:u,isZeroState:p,tension:g,isNewStyles:B,prefixCurrencyInYAxis:O,pointRadius:S,useKFormat:z,lineThickness:T,ticksLabelCallback:$,labelCallback:F,afterBodyCallBack:R,titleTooltipCallback:q,isInternationalStore:A,customYHeaders:D}=o;var I,L,P;const[E,H]=b(null),W=y();m((()=>{var e,t,l,o;if(null===(o=null===(l=null===(t=null===(e=W.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===l?void 0:l.ticks)||void 0===o?void 0:o.length){const e=38*W.current.scales.y.ticks.length;H(e)}}),[W]);const Y=a.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?f.content.placeholder:f.background.brand,square:e.squareLegends}))),Z={labels:n,datasets:a.map(((e,t)=>{var l,o,r;return Object.assign(Object.assign({tension:null!=g?g:.4,fill:e.gradient?"start":0},((e,t)=>{const l={borderColor:e||(t?f.content.placeholder:f.background.brand)};return B?Object.assign({pointStyle:"circle",pointRadius:S||(n&&n.length>10?2.5:4),pointBorderColor:"transparent",pointBackgroundColor:e||(t?f.content.placeholder:f.background.brand)},l):Object.assign({pointRadius:null!=S?S:1},l)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:null!==(o=null!==(l=e.lineWidth)&&void 0!==l?l:T)&&void 0!==o?o:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,E?E-75:150);return t.addColorStop(0,"#F1EEFB"),t.addColorStop(1,"rgba(127, 86, 217, 0)"),t}:null!==(r=e.backgroundColor)&&void 0!==r?r:"transparent",legend:e.legend})}))},G={maintainAspectRatio:s,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:null!=B&&B,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>f.content.primaryInverse,backgroundColor:f.content.primary,callbacks:{labelTextColor:()=>f.content.primaryInverse,title:q,label:F,afterBody:R},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{beginAtZero:!0,min:p?0:c,max:p?10:u,ticks:{color:f.content.secondary,callback:e=>{var t,l;return z?`${null!==(t=null==r?void 0:r.yPrefix)&&void 0!==t?t:""}${A?k(e):x(e)}${null!=O?O:""}`:D&&Object.keys(D).length>0?D[e]:`${null!==(l=null==r?void 0:r.yPrefix)&&void 0!==l?l:""}${e}${null!=O?O:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:p?1:d,padding:B?24:0},title:{display:!!(null==r?void 0:r.y),text:null==r?void 0:r.y},grid:{color:f.background.base,drawBorder:null===(I=null==r?void 0:r.yDrawBorder)||void 0===I||I}},x:{ticks:{callback:$,color:f.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==r?void 0:r.x),text:null==r?void 0:r.x},grid:{display:!1,drawBorder:null!==(L=null==r?void 0:r.xDrawBorder)&&void 0!==L&&L}}}};return e("div",Object.assign({style:Object.assign(Object.assign({},s?{}:{height:null!==(P=null!=i?i:E)&&void 0!==P?P:204}),{display:"flex",flexDirection:"column",gap:2,width:"100%"})},{children:[t(C,{children:Y.map(((o,r)=>{let{text:n,color:i,square:a}=o;return n?e(j,{children:[t(w,{color:i,square:a,newStyle:B}),t(h,Object.assign({color:"#667085"},{children:n}))]},r):t(l,{})}))}),t("div",Object.assign({style:{flex:1}},{children:t(v,{ref:W,options:G,data:Z})}))]}))};export{B as LineChart};
1
+ import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{Chart as n,CategoryScale as o,LinearScale as r,PointElement as i,BarElement as a,LineElement as s,ArcElement as d,Filler as c,Title as u,Tooltip as p,Legend as g}from"chart.js";import{useState as b,useRef as y,useEffect as m}from"react";import{Line as v}from"react-chartjs-2";import{BodyTiny as h}from"../../../TypographyStyle.js";import{COLORS as f}from"../../../../constants/Theme.js";import{truncateValueForInternationalStore as x,truncateValueForIndianStore as k}from"../utils/calcPercentage.js";import{LegendWrapper as C,LegendContainer as j,LegendColor as w}from"./LineChart.styled.js";n.register(o,r,i,a,s,d,c,u,p,g);const O=n=>{let{scaleText:o,labels:r,canvasHeight:i,datas:a,maintainAspectRatio:s=!1,stepSize:d,min:c,max:u,isZeroState:p,tension:g,isNewStyles:O,prefixCurrencyInYAxis:B,pointRadius:S,useKFormat:z,lineThickness:D,ticksLabelCallback:I,labelCallback:T,afterBodyCallBack:$,titleTooltipCallback:A,isInternationalStore:F,customYHeaders:R,headerIcons:q=[],legendsAndIconDirection:L="row"}=n;var P,E,H;const[W,Y]=b(null),Z=y();m((()=>{var e,t,l,n;if(null===(n=null===(l=null===(t=null===(e=Z.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===l?void 0:l.ticks)||void 0===n?void 0:n.length){const e=38*Z.current.scales.y.ticks.length;Y(e)}}),[Z]);const G=a.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?f.content.placeholder:f.background.brand,square:e.squareLegends}))),K={labels:r,datasets:a.map(((e,t)=>{var l,n,o;return Object.assign(Object.assign({tension:null!=g?g:.4,fill:e.gradient?"start":0},((e,t)=>{const l={borderColor:e||(t?f.content.placeholder:f.background.brand)};return O?Object.assign({pointStyle:"circle",pointRadius:S||(r&&r.length>10?2.5:4),pointBorderColor:"transparent",pointBackgroundColor:e||(t?f.content.placeholder:f.background.brand)},l):Object.assign({pointRadius:null!=S?S:1},l)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:null!==(n=null!==(l=e.lineWidth)&&void 0!==l?l:D)&&void 0!==n?n:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,W?W-75:150);return t.addColorStop(0,"#F1EEFB"),t.addColorStop(1,"rgba(127, 86, 217, 0)"),t}:null!==(o=e.backgroundColor)&&void 0!==o?o:"transparent",legend:e.legend})}))},N={maintainAspectRatio:s,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:null!=O&&O,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>f.content.primaryInverse,backgroundColor:f.content.primary,callbacks:{labelTextColor:()=>f.content.primaryInverse,title:A,label:T,afterBody:$},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{beginAtZero:!0,min:p?0:c,max:p?10:u,ticks:{color:f.content.secondary,callback:e=>{var t,l;return z?`${null!==(t=null==o?void 0:o.yPrefix)&&void 0!==t?t:""}${F?x(e):k(e)}${null!=B?B:""}`:R&&Object.keys(R).length>0?R[e]:`${null!==(l=null==o?void 0:o.yPrefix)&&void 0!==l?l:""}${e}${null!=B?B:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:p?1:d,padding:O?24:0},title:{display:!!(null==o?void 0:o.y),text:null==o?void 0:o.y},grid:{color:f.background.base,drawBorder:null===(P=null==o?void 0:o.yDrawBorder)||void 0===P||P}},x:{ticks:{callback:I,color:f.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==o?void 0:o.x),text:null==o?void 0:o.x},grid:{display:!1,drawBorder:null!==(E=null==o?void 0:o.xDrawBorder)&&void 0!==E&&E}}}};return e("div",Object.assign({style:Object.assign(Object.assign({},s?{}:{height:null!==(H=null!=i?i:W)&&void 0!==H?H:204}),{display:"flex",flexDirection:"column",gap:2,width:"100%"})},{children:[e("div",Object.assign({style:{display:"flex",justifyContent:"space-between",width:"100%",flexDirection:L}},{children:[t(C,{children:q.map(((e,l)=>t(j,{children:e},l)))}),t(C,{children:G.map(((n,o)=>{let{text:r,color:i,square:a}=n;return r?e(j,{children:[t(w,{color:i,square:a,newStyle:O}),t(h,Object.assign({color:"#667085"},{children:r}))]},o):t(l,{})}))})]})),t("div",Object.assign({style:{flex:1}},{children:t(v,{ref:Z,options:N,data:K})}))]}))};export{O as LineChart};
@@ -1 +1 @@
1
- import{jsxs as o,jsx as i}from"react/jsx-runtime";import t from"../../../../assets/icons/maximize.svg.js";import{Chart as e,CategoryScale as a,LinearScale as l,BarElement as n,Tooltip as d,Legend as s}from"chart.js";import r from"chartjs-plugin-datalabels";import{useState as c,useMemo as u}from"react";import{Bar as v}from"react-chartjs-2";import{IconButton as p}from"../../../icon-button/IconButton.js";import{StyledModal as g}from"../../../modals/styledModal.js";import{TitleRegular as b,BodyTiny as x}from"../../../TypographyStyle.js";import{COLORS as h,FONTS as m}from"../../../../constants/Theme.js";import{truncateValueForInternationalStore as y,truncateValueForIndianStore as f}from"../utils/calcPercentage.js";import{COLOR_SCHEMA as O,GRAPH_ORIENTATION as A}from"./StackedBarChart.model.js";import{GraphContainerWrapper as C}from"./StackedBarChart.styles.js";e.register(a,l,n,d,s,r);const k=e=>{var a,l,n,d,s,r,k,j,L,F,S,H,T,I,R,E,w,B,D,N,Z,z,P,G,W,_,q,M,V,Y,J,K,Q,U,X,$,oo,io,to,eo,ao,lo;const[no,so]=c(!1),ro=[250,1e3,800,1500,300,600],co=0===e.yAxis.data.length,uo=void 0===e.customColourScaleBrand&&void 0===e.customColourScalePastel?e.colorSchema===O.PASTEL?["#E6C7FF","#FEC6C6","#FEDEF3","#DEEFFF","#FFD8B1","#C7E5FF","#FFD3E6","#C9FFE5","#FFE3C7","#D9D9FF"]:["#5E07BB","#9E77ED","#D2AEFF","#F7D7FF","#CDE1FF","#92AFFA","#3935E1"]:e.colorSchema===O.PASTEL?e.customColourScalePastel:e.customColourScaleBrand,vo=e.customHoverColour,po=u((()=>{var o,i,t;return Object.assign(Object.assign({barPercentage:(null==e?void 0:e.barPercentage)||.4,categoryPercentage:1,pointStyle:"circle",barWidth:e.barWidth,borderRadius:(null==e?void 0:e.borderRadius)||void 0},"object"==typeof(null==e?void 0:e.borderRadius)?{borderSkipped:!1}:{}),(null===(o=null==e?void 0:e.addBarGap)||void 0===o?void 0:o.flag)?{borderWidth:{top:(null===(i=null==e?void 0:e.addBarGap)||void 0===i?void 0:i.value)||2,bottom:(null===(t=null==e?void 0:e.addBarGap)||void 0===t?void 0:t.value)||2,right:0,left:0},borderColor:"transparent"}:{})}),[e.barWidth,null==e?void 0:e.borderRadius,null==e?void 0:e.barPercentage,null==e?void 0:e.addBarGap]),go={};e.yAxis.data.map((o=>{o.map((o=>{go[o.name]?go[o.name].push(o.value):go[o.name]=[o.value]}))}));const bo=Object.keys(go).map(((o,i)=>Object.assign({label:o,data:go[o],backgroundColor:null==uo?void 0:uo[i],hoverBackgroundColor:void 0===vo?void 0:vo[i]},po)));let xo=e.xAxis.data.map((o=>"string"==typeof o?o:o.name)),ho=bo;if(e.truncateBars){const o=((o,i,t)=>{if(i.length<=t)return{truncatedData:o,truncatedLabels:i,originalData:o,originalLabels:i};const e=o.map((o=>o.slice(0,t))),a=o.map((o=>o.slice(t).reduce(((o,i)=>o+i),0)));e.forEach(((o,i)=>o.push(a[i])));const l=i.slice(0,t);return l.push("Others"),{truncatedData:e,truncatedLabels:l,originalData:o,originalLabels:i}})(bo.map((o=>o.data)),xo,e.truncateBars);bo.forEach(((i,t)=>i.data=o.truncatedData[t])),xo=o.truncatedLabels,ho=o.originalData.map(((o,i)=>Object.assign(Object.assign({},bo[i]),{data:o})))}const mo={plugins:{legend:{display:!co&&!e.customLegend,labels:{usePointStyle:!0,fontSize:2}},tooltip:{enabled:!co,callbacks:{label:null===(a=e.tooltipConfig)||void 0===a?void 0:a.labelCallback,title:null===(l=e.tooltipConfig)||void 0===l?void 0:l.titleCallback,footer:null===(n=e.tooltipConfig)||void 0===n?void 0:n.footerCallback},footerFont:null===(s=null===(d=e.tooltipConfig)||void 0===d?void 0:d.footerStyles)||void 0===s?void 0:s.footerFont},datalabels:{display:null!==(r=e.showTotal)&&void 0!==r&&r,anchor:"end",align:"end",clamp:!0,formatter:(o,i)=>{var t;const e=i.datasetIndex,a=i.chart.data.datasets;if(e!==a.length-1)return"";const l=i.dataIndex;let n=0;for(let o=0;o<a.length;o++)n+=null!==(t=a[o].data[l])&&void 0!==t?t:0;return n?n<1e3?n:(n/1e3).toString().substring(0,4)+"k":""},color:h.content.secondary}},layout:{padding:{right:e.showTotal&&e.orientation===A.HORIZONTAL?50:0,top:e.showTotal&&e.orientation!=A.HORIZONTAL?50:0}},responsive:!0,maintainAspectRatio:!1,legend:{display:!e.customLegend,labels:{usePointStyle:!0}},indexAxis:e.orientation===A.HORIZONTAL?"y":"x",scales:{x:{title:{display:!!(e.orientation===A.HORIZONTAL?null===(k=e.yAxis)||void 0===k?void 0:k.title:null===(j=e.xAxis)||void 0===j?void 0:j.title),text:e.orientation===A.HORIZONTAL?null===(L=e.yAxis)||void 0===L?void 0:L.title:null===(F=e.xAxis)||void 0===F?void 0:F.title,color:null!==(T=e.orientation===A.HORIZONTAL?null===(S=e.yAxis)||void 0===S?void 0:S.titleColor:null===(H=e.xAxis)||void 0===H?void 0:H.titleColor)&&void 0!==T?T:h.content.secondary,font:{size:m.caption.fontSize}},grid:{display:e.orientation===A.HORIZONTAL&&(void 0===(null===(I=null==e?void 0:e.showGridLines)||void 0===I?void 0:I.x)||(null===(R=null==e?void 0:e.showGridLines)||void 0===R?void 0:R.x)),color:h.background.base},ticks:{fontSize:m.caption.fontSize,color:null!==(E=e.yAxis.labelColor)&&void 0!==E?E:h.content.secondary,callback:e.orientation===A.HORIZONTAL?e.isInternationalStore?y:f:void 0},stacked:e.orientation===A.HORIZONTAL?"boolean"!=typeof(null===(w=e.yAxis)||void 0===w?void 0:w.stacked)||(null===(B=e.yAxis)||void 0===B?void 0:B.stacked):"boolean"!=typeof(null===(D=e.xAxis)||void 0===D?void 0:D.stacked)||(null===(N=e.xAxis)||void 0===N?void 0:N.stacked)},y:Object.assign(Object.assign({},(null===(Z=null==e?void 0:e.equalHeight)||void 0===Z?void 0:Z.flag)?{suggestedMin:-(null==e?void 0:e.equalHeight.max),suggestedMax:null==e?void 0:e.equalHeight.max}:{}),{title:{display:!!(e.orientation===A.HORIZONTAL?null===(z=e.xAxis)||void 0===z?void 0:z.title:null===(P=e.yAxis)||void 0===P?void 0:P.title),text:e.orientation===A.HORIZONTAL?null===(G=e.xAxis)||void 0===G?void 0:G.title:null===(W=e.yAxis)||void 0===W?void 0:W.title,color:null!==(M=e.orientation===A.HORIZONTAL?null===(_=e.xAxis)||void 0===_?void 0:_.titleColor:null===(q=e.yAxis)||void 0===q?void 0:q.titleColor)&&void 0!==M?M:h.content.secondary,font:{size:m.caption.fontSize}},grid:{display:e.orientation!==A.HORIZONTAL&&(void 0===(null===(V=null==e?void 0:e.showGridLines)||void 0===V?void 0:V.y)||(null===(Y=null==e?void 0:e.showGridLines)||void 0===Y?void 0:Y.y)),color:h.background.base},ticks:Object.assign(Object.assign({stepSize:e.orientation===A.HORIZONTAL?null===(J=e.xAxis)||void 0===J?void 0:J.stepSize:null===(K=e.yAxis)||void 0===K?void 0:K.stepSize,fontSize:m.caption.fontSize,color:null!==(Q=e.xAxis.labelColor)&&void 0!==Q?Q:h.content.secondary},co?{min:0,max:2e3,stepSize:200}:{}),{callback:(null==e?void 0:e.ticksCallback)?null==e?void 0:e.ticksCallback:e.orientation!==A.VERTICAL?e.isInternationalStore?y:f:void 0}),stacked:e.orientation===A.HORIZONTAL?"boolean"!=typeof(null===(U=e.xAxis)||void 0===U?void 0:U.stacked)||(null===(X=e.xAxis)||void 0===X?void 0:X.stacked):"boolean"!=typeof(null===($=e.yAxis)||void 0===$?void 0:$.stacked)||(null===(oo=e.yAxis)||void 0===oo?void 0:oo.stacked)})},onClick:(o,i)=>{if(!e.onBarClick)return;const t=i[0].datasetIndex,a=i[0].index,l=o.chart.data.datasets[t].label,n=o.chart.data.labels[a];e.onBarClick(n,l)},onHover:(o,i)=>{e.onBarClick&&i.length&&(o.native.target.style.cursor="pointer")}};e.orientation&&e.orientation!==A.VERTICAL?delete mo.scales.y.ticks.callback:delete mo.scales.x.ticks.callback;const yo={labels:xo,datasets:co?[{data:ro,backgroundColor:"rgba(0,0,0,0)"}]:bo},fo={labels:e.xAxis.data.map((o=>"string"==typeof o?o:o.name)),datasets:co?[{data:ro,backgroundColor:"rgba(0,0,0,0)"}]:ho},Oo=function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return i("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"row",gap:"10px",padding:"0px 24px 12px 24px",justifyContent:e.allowChartPopup&&!t?"flex-start":"flex-end",flexWrap:"wrap"}},{children:bo.map((t=>o("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"}},{children:[i("div",{style:{backgroundColor:t.backgroundColor,width:"16px",height:"16px",borderRadius:"2px"}}),i(x,Object.assign({color:h.content.secondary},{children:t.label}))]}),t.label.replace(" ","_"))))}))};return o(C,Object.assign({style:null!==(io=e.wrapperStyle)&&void 0!==io?io:{},padding:e.outerPadding,customLegend:e.customLegend},{children:[e.chartHeading&&o("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:e.hideHeading?"flex-end":"space-between"}},{children:[!0!==e.hideHeading&&i(b,Object.assign({color:null!==(to=e.chartHeading.color)&&void 0!==to?to:h.content.secondary},{children:e.chartHeading.heading})),e.allowChartPopup&&i("div",Object.assign({style:{display:"flex",justifyContent:"flex-end"}},{children:i("div",{children:i(p,{Icon:t,onClick:()=>{so(!0)}})})}))]})),e.customLegend&&Oo(),i("div",Object.assign({className:"graph__wrapper"},{children:i("div",Object.assign({style:{height:null!==(eo=e.graphCanvasHeight)&&void 0!==eo?eo:500,width:null!==(ao=e.graphCanvasWidth)&&void 0!==ao?ao:"auto"}},{children:i(v,{options:mo,data:yo})}))})),no&&i(g,Object.assign({open:no,onClose:()=>so(!1),closeOnOutsideClick:!0,headingTitle:null===(lo=e.chartHeading)||void 0===lo?void 0:lo.heading,width:"85%"},{children:o("div",Object.assign({className:"graph__wrapper",style:{padding:"8px"}},{children:[e.customLegend&&Oo(!0),i("div",Object.assign({style:{height:"70vh",width:"100%",padding:"16px",borderRadius:"8px"}},{children:i(v,{options:mo,data:fo})}))]}))}))]}))};export{k as StackedBarChart};
1
+ import{jsxs as o,jsx as i}from"react/jsx-runtime";import t from"../../../../assets/icons/maximize.svg.js";import{Chart as e,CategoryScale as a,LinearScale as l,BarElement as n,Tooltip as d,Legend as s}from"chart.js";import r from"chartjs-plugin-datalabels";import{useState as c,useMemo as u}from"react";import{Bar as v}from"react-chartjs-2";import{IconButton as p}from"../../../icon-button/IconButton.js";import{StyledModal as g}from"../../../modals/styledModal.js";import{TitleRegular as b,BodyTiny as h}from"../../../TypographyStyle.js";import{COLORS as x,FONTS as m}from"../../../../constants/Theme.js";import{truncateValueForInternationalStore as y,truncateValueForIndianStore as f}from"../utils/calcPercentage.js";import{COLOR_SCHEMA as O,GRAPH_ORIENTATION as A}from"./StackedBarChart.model.js";import{GraphContainerWrapper as C,HeaderIconWrapper as k}from"./StackedBarChart.styles.js";e.register(a,l,n,d,s,r);const j=e=>{var a,l,n,d,s,r,j,L,F,S,H,I,T,R,w,E,B,D,N,Z,z,P,G,W,_,q,M,V,Y,J,K,Q,U,X,$,oo,io,to,eo,ao,lo,no;const{headerIcons:so=[],legendsAndIconDirection:ro="row"}=e,[co,uo]=c(!1),vo=[250,1e3,800,1500,300,600],po=0===e.yAxis.data.length,go=void 0===e.customColourScaleBrand&&void 0===e.customColourScalePastel?e.colorSchema===O.PASTEL?["#E6C7FF","#FEC6C6","#FEDEF3","#DEEFFF","#FFD8B1","#C7E5FF","#FFD3E6","#C9FFE5","#FFE3C7","#D9D9FF"]:["#5E07BB","#9E77ED","#D2AEFF","#F7D7FF","#CDE1FF","#92AFFA","#3935E1"]:e.colorSchema===O.PASTEL?e.customColourScalePastel:e.customColourScaleBrand,bo=e.customHoverColour,ho=u((()=>{var o,i,t;return Object.assign(Object.assign({barPercentage:(null==e?void 0:e.barPercentage)||.4,categoryPercentage:1,pointStyle:"circle",barWidth:e.barWidth,borderRadius:(null==e?void 0:e.borderRadius)||void 0},"object"==typeof(null==e?void 0:e.borderRadius)?{borderSkipped:!1}:{}),(null===(o=null==e?void 0:e.addBarGap)||void 0===o?void 0:o.flag)?{borderWidth:{top:(null===(i=null==e?void 0:e.addBarGap)||void 0===i?void 0:i.value)||2,bottom:(null===(t=null==e?void 0:e.addBarGap)||void 0===t?void 0:t.value)||2,right:0,left:0},borderColor:"transparent"}:{})}),[e.barWidth,null==e?void 0:e.borderRadius,null==e?void 0:e.barPercentage,null==e?void 0:e.addBarGap]),xo={};e.yAxis.data.map((o=>{o.map((o=>{xo[o.name]?xo[o.name].push(o.value):xo[o.name]=[o.value]}))}));const mo=Object.keys(xo).map(((o,i)=>Object.assign({label:o,data:xo[o],backgroundColor:null==go?void 0:go[i],hoverBackgroundColor:void 0===bo?void 0:bo[i]},ho)));let yo=e.xAxis.data.map((o=>"string"==typeof o?o:o.name)),fo=mo;if(e.truncateBars){const o=((o,i,t)=>{if(i.length<=t)return{truncatedData:o,truncatedLabels:i,originalData:o,originalLabels:i};const e=o.map((o=>o.slice(0,t))),a=o.map((o=>o.slice(t).reduce(((o,i)=>o+i),0)));e.forEach(((o,i)=>o.push(a[i])));const l=i.slice(0,t);return l.push("Others"),{truncatedData:e,truncatedLabels:l,originalData:o,originalLabels:i}})(mo.map((o=>o.data)),yo,e.truncateBars);mo.forEach(((i,t)=>i.data=o.truncatedData[t])),yo=o.truncatedLabels,fo=o.originalData.map(((o,i)=>Object.assign(Object.assign({},mo[i]),{data:o})))}const Oo={plugins:{legend:{display:!po&&!e.customLegend,labels:{usePointStyle:!0,fontSize:2}},tooltip:{enabled:!po,callbacks:{label:null===(a=e.tooltipConfig)||void 0===a?void 0:a.labelCallback,title:null===(l=e.tooltipConfig)||void 0===l?void 0:l.titleCallback,footer:null===(n=e.tooltipConfig)||void 0===n?void 0:n.footerCallback},footerFont:null===(s=null===(d=e.tooltipConfig)||void 0===d?void 0:d.footerStyles)||void 0===s?void 0:s.footerFont},datalabels:{display:null!==(r=e.showTotal)&&void 0!==r&&r,anchor:"end",align:"end",clamp:!0,formatter:(o,i)=>{var t;const e=i.datasetIndex,a=i.chart.data.datasets;if(e!==a.length-1)return"";const l=i.dataIndex;let n=0;for(let o=0;o<a.length;o++)n+=null!==(t=a[o].data[l])&&void 0!==t?t:0;return n?n<1e3?n:(n/1e3).toString().substring(0,4)+"k":""},color:x.content.secondary}},layout:{padding:{right:e.showTotal&&e.orientation===A.HORIZONTAL?50:0,top:e.showTotal&&e.orientation!=A.HORIZONTAL?50:0}},responsive:!0,maintainAspectRatio:!1,legend:{display:!e.customLegend,labels:{usePointStyle:!0}},indexAxis:e.orientation===A.HORIZONTAL?"y":"x",scales:{x:{title:{display:!!(e.orientation===A.HORIZONTAL?null===(j=e.yAxis)||void 0===j?void 0:j.title:null===(L=e.xAxis)||void 0===L?void 0:L.title),text:e.orientation===A.HORIZONTAL?null===(F=e.yAxis)||void 0===F?void 0:F.title:null===(S=e.xAxis)||void 0===S?void 0:S.title,color:null!==(T=e.orientation===A.HORIZONTAL?null===(H=e.yAxis)||void 0===H?void 0:H.titleColor:null===(I=e.xAxis)||void 0===I?void 0:I.titleColor)&&void 0!==T?T:x.content.secondary,font:{size:m.caption.fontSize}},grid:{display:e.orientation===A.HORIZONTAL&&(void 0===(null===(R=null==e?void 0:e.showGridLines)||void 0===R?void 0:R.x)||(null===(w=null==e?void 0:e.showGridLines)||void 0===w?void 0:w.x)),color:x.background.base},ticks:{fontSize:m.caption.fontSize,color:null!==(E=e.yAxis.labelColor)&&void 0!==E?E:x.content.secondary,callback:e.orientation===A.HORIZONTAL?e.isInternationalStore?y:f:void 0},stacked:e.orientation===A.HORIZONTAL?"boolean"!=typeof(null===(B=e.yAxis)||void 0===B?void 0:B.stacked)||(null===(D=e.yAxis)||void 0===D?void 0:D.stacked):"boolean"!=typeof(null===(N=e.xAxis)||void 0===N?void 0:N.stacked)||(null===(Z=e.xAxis)||void 0===Z?void 0:Z.stacked)},y:Object.assign(Object.assign({},(null===(z=null==e?void 0:e.equalHeight)||void 0===z?void 0:z.flag)?{suggestedMin:-(null==e?void 0:e.equalHeight.max),suggestedMax:null==e?void 0:e.equalHeight.max}:{}),{title:{display:!!(e.orientation===A.HORIZONTAL?null===(P=e.xAxis)||void 0===P?void 0:P.title:null===(G=e.yAxis)||void 0===G?void 0:G.title),text:e.orientation===A.HORIZONTAL?null===(W=e.xAxis)||void 0===W?void 0:W.title:null===(_=e.yAxis)||void 0===_?void 0:_.title,color:null!==(V=e.orientation===A.HORIZONTAL?null===(q=e.xAxis)||void 0===q?void 0:q.titleColor:null===(M=e.yAxis)||void 0===M?void 0:M.titleColor)&&void 0!==V?V:x.content.secondary,font:{size:m.caption.fontSize}},grid:{display:e.orientation!==A.HORIZONTAL&&(void 0===(null===(Y=null==e?void 0:e.showGridLines)||void 0===Y?void 0:Y.y)||(null===(J=null==e?void 0:e.showGridLines)||void 0===J?void 0:J.y)),color:x.background.base},ticks:Object.assign(Object.assign({stepSize:e.orientation===A.HORIZONTAL?null===(K=e.xAxis)||void 0===K?void 0:K.stepSize:null===(Q=e.yAxis)||void 0===Q?void 0:Q.stepSize,fontSize:m.caption.fontSize,color:null!==(U=e.xAxis.labelColor)&&void 0!==U?U:x.content.secondary},po?{min:0,max:2e3,stepSize:200}:{}),{callback:(null==e?void 0:e.ticksCallback)?null==e?void 0:e.ticksCallback:e.orientation!==A.VERTICAL?e.isInternationalStore?y:f:void 0}),stacked:e.orientation===A.HORIZONTAL?"boolean"!=typeof(null===(X=e.xAxis)||void 0===X?void 0:X.stacked)||(null===($=e.xAxis)||void 0===$?void 0:$.stacked):"boolean"!=typeof(null===(oo=e.yAxis)||void 0===oo?void 0:oo.stacked)||(null===(io=e.yAxis)||void 0===io?void 0:io.stacked)})},onClick:(o,i)=>{if(!e.onBarClick)return;const t=i[0].datasetIndex,a=i[0].index,l=o.chart.data.datasets[t].label,n=o.chart.data.labels[a];e.onBarClick(n,l)},onHover:(o,i)=>{e.onBarClick&&i.length&&(o.native.target.style.cursor="pointer")}};e.orientation&&e.orientation!==A.VERTICAL?delete Oo.scales.y.ticks.callback:delete Oo.scales.x.ticks.callback;const Ao={labels:yo,datasets:po?[{data:vo,backgroundColor:"rgba(0,0,0,0)"}]:mo},Co={labels:e.xAxis.data.map((o=>"string"==typeof o?o:o.name)),datasets:po?[{data:vo,backgroundColor:"rgba(0,0,0,0)"}]:fo},ko=function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return i("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"row",gap:"10px",padding:"0px 24px 12px 24px",justifyContent:e.allowChartPopup&&!t?"flex-start":"flex-end",flexWrap:"wrap"}},{children:mo.map((t=>o("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"}},{children:[i("div",{style:{backgroundColor:t.backgroundColor,width:"16px",height:"16px",borderRadius:"2px"}}),i(h,Object.assign({color:x.content.secondary},{children:t.label}))]}),t.label.replace(" ","_"))))}))};return o(C,Object.assign({style:null!==(to=e.wrapperStyle)&&void 0!==to?to:{},padding:e.outerPadding,customLegend:e.customLegend},{children:[e.chartHeading&&o("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:e.hideHeading?"flex-end":"space-between"}},{children:[!0!==e.hideHeading&&i(b,Object.assign({color:null!==(eo=e.chartHeading.color)&&void 0!==eo?eo:x.content.secondary},{children:e.chartHeading.heading})),e.allowChartPopup&&i("div",Object.assign({style:{display:"flex",justifyContent:"flex-end"}},{children:i("div",{children:i(p,{Icon:t,onClick:()=>{uo(!0)}})})}))]})),e.customLegend&&o("div",Object.assign({style:{display:"flex",flexDirection:ro,justifyContent:"space-between"}},{children:[i(k,{children:so.map(((o,t)=>i("div",{children:i("div",{children:o})},t)))}),ko()]})),i("div",Object.assign({className:"graph__wrapper"},{children:i("div",Object.assign({style:{height:null!==(ao=e.graphCanvasHeight)&&void 0!==ao?ao:500,width:null!==(lo=e.graphCanvasWidth)&&void 0!==lo?lo:"auto"}},{children:i(v,{options:Oo,data:Ao})}))})),co&&i(g,Object.assign({open:co,onClose:()=>uo(!1),closeOnOutsideClick:!0,headingTitle:null===(no=e.chartHeading)||void 0===no?void 0:no.heading,width:"85%"},{children:o("div",Object.assign({className:"graph__wrapper",style:{padding:"8px"}},{children:[e.customLegend&&ko(!0),i("div",Object.assign({style:{height:"70vh",width:"100%",padding:"16px",borderRadius:"8px"}},{children:i(v,{options:Oo,data:Co})}))]}))}))]}))};export{j as StackedBarChart};
@@ -82,4 +82,6 @@ export interface StackedBarGraphI {
82
82
  value: number;
83
83
  };
84
84
  ticksCallback?: (value: number) => string;
85
+ legendsAndIconDirection?: 'row-reverse' | 'row';
86
+ headerIcons?: React.ReactNode[];
85
87
  }
@@ -4,3 +4,4 @@ export declare const GraphContainerWrapper: import("styled-components").StyledCo
4
4
  isFunnel?: boolean | undefined;
5
5
  customLegend?: boolean | undefined;
6
6
  }, never>;
7
+ export declare const HeaderIconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -28,4 +28,8 @@ import e from"styled-components";import{COLORS as r}from"../../../../constants/T
28
28
  .legend__set {
29
29
  margin-top: 16px;
30
30
  }
31
- `;export{n as GraphContainerWrapper};
31
+ `,p=e.div`
32
+ display: flex;
33
+ align-items: center;
34
+ gap: 8px;
35
+ `;export{n as GraphContainerWrapper,p as HeaderIconWrapper};
@@ -28,7 +28,6 @@ export type AvatarProps = {
28
28
  isSelected: boolean;
29
29
  isComments: boolean;
30
30
  };
31
- status?: 'ONLINE' | 'OFFLINE' | 'AWAY';
32
31
  };
33
32
  export declare const enum MESSAGE_CHANNELS {
34
33
  INSTAGRAM = "instagram",
@@ -42,7 +41,6 @@ export declare const enum MESSAGE_CHANNELS {
42
41
  EMAIL = "email",
43
42
  SMTP = "smtp",
44
43
  FACEBOOK_CATALOG = "facebook-catalog",
45
- TASKS = "tasks",
46
- BIK_LIVECHAT = "livechat"
44
+ TASKS = "tasks"
47
45
  }
48
46
  export declare const Avatar: React.FC<AvatarProps>;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as s}from"react";import{AvatarStyle as i}from"./Avatar.styled.js";import{SIZE as o,AVATAR_BACKGROUND as r,AVATAR_TYPES as a,AVATAR_SIZE_MAP as n}from"./AvatarHelper.js";import{BodyTiny as c,TitleSmall as l,TitleMedium as d}from"../TypographyStyle.js";import{COLORS as h}from"../../constants/Theme.js";import p from"../../assets/icons/bik_livechat.svg.js";import g from"../../assets/icons/CheckSquareOffset.svg.js";import m from"../../assets/icons/email-channel.svg.js";import u from"../../assets/icons/facebook_channel.svg.js";import b from"../../assets/icons/gmail.svg.js";import A from"../../assets/icons/instagram-channel.svg.js";import I from"../../assets/icons/whatsapp_color.svg.js";const f={[o.SMALL]:16,[o.MEDIUM]:20,[o.INBOX]:24,[o.LARGE]:32},S={[r.LIGHT]:h.content.secondary,[r.DARK]:h.surface.standard};var y;!function(e){e.INSTAGRAM="instagram",e.MESSENGER="messenger",e.WHATSAPP="whatsapp",e.GMAIL="gmail",e.LIVECHAT="livechat",e.GOOGLE_BUSINESS_CHAT="gbm",e.SHOPIFY="shopify",e.FACEBOOK="facebook",e.EMAIL="email",e.SMTP="smtp",e.FACEBOOK_CATALOG="facebook-catalog",e.TASKS="tasks",e.BIK_LIVECHAT="livechat"}(y||(y={}));const j=r=>{const[j,v]=s(!1),E=()=>{const e=(r.name||"").split(".").join(" ").split(" ").map((e=>e.charAt(0).toUpperCase())).slice(0,2).join("");return r.size===o.SMALL?t(c,Object.assign({style:{color:S[r.background]}},{children:e})):r.size===o.MEDIUM||r.size===o.INBOX?t(l,Object.assign({style:{color:S[r.background]}},{children:e})):r.size===o.LARGE?t(d,Object.assign({style:{color:S[r.background]}},{children:e})):void 0};return e("div",Object.assign({style:{position:"relative"}},{children:[e(i,Object.assign({type:r.type===a.IMAGE&&j&&r.useNameFallback&&r.name?a.INITIALS:r.type,size:r.size,background:r.background},{children:[r.type===a.IMAGE&&(r.useNameFallback&&!j?t("img",{alt:"",width:n[r.size],height:n[r.size],style:{borderRadius:(null==r?void 0:r.borderRadius)||"50%",objectFit:"contain"},src:r.photoUrl,onError:()=>{v(!0)}}):r.useNameFallback&&j&&r.name?t("div",{children:E()}):t("img",{alt:"",width:n[r.size],height:n[r.size],style:{borderRadius:(null==r?void 0:r.borderRadius)||"50%",objectFit:"contain"},src:r.photoUrl})),r.type===a.INITIALS&&t("div",{children:E()}),r.type===a.ICON&&r.icon&&t(r.icon,{width:f[r.size],height:f[r.size],color:S[r.background]})]})),r.inboxSettings&&t("div",Object.assign({style:{position:"absolute",left:f[r.size]+"px",top:f[r.size]+"px",width:14,height:14,borderRadius:(null==r?void 0:r.borderRadius)||"50%",display:"flex",justifyContent:"center",backgroundColor:r.inboxSettings.isSelected?r.inboxSettings.isComments?h.content.primary:h.background.brandLight:r.inboxSettings.isComments?h.content.primary:h.surface.standard,alignItems:"center"}},{children:(()=>{switch(r.channelName){case y.EMAIL:case y.SMTP:return t(m,{width:11,height:11});case y.FACEBOOK:case y.FACEBOOK_CATALOG:case y.MESSENGER:return t(u,{width:11,height:11});case y.INSTAGRAM:return t(A,{width:11,height:11});case y.WHATSAPP:return t(I,{width:11,height:11});case y.GMAIL:return t(b,{width:11,height:11});case y.TASKS:return t(g,{width:11,height:11});case y.BIK_LIVECHAT:return t(p,{width:11,height:11})}})()})),r.status&&t("div",Object.assign({style:{position:"absolute",left:f[r.size]+"px",top:f[r.size]+"px",width:11,height:11,borderRadius:"50%",display:"flex",justifyContent:"center",backgroundColor:h.surface.standard,alignItems:"center"}},{children:(console.log("props.status",r.status),r.status?t("div",{style:{backgroundColor:"ONLINE"===r.status?h.special.whatsapp.brand:h.content.inactive,width:"8px",height:"8px",borderRadius:"50%"}}):null)}))]}))};export{f as AVATAR_SIZE_VS_ICON_SIZE_MAP,j as Avatar,S as BACKGROUND_VS_TEXT_COLOR_MAP,y as MESSAGE_CHANNELS};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as s}from"react";import{AvatarStyle as i}from"./Avatar.styled.js";import{SIZE as r,AVATAR_BACKGROUND as o,AVATAR_TYPES as a,AVATAR_SIZE_MAP as n}from"./AvatarHelper.js";import{BodyTiny as c,TitleSmall as l,TitleMedium as d}from"../TypographyStyle.js";import{COLORS as h}from"../../constants/Theme.js";import m from"../../assets/icons/CheckSquareOffset.svg.js";import g from"../../assets/icons/email-channel.svg.js";import p from"../../assets/icons/facebook_channel.svg.js";import A from"../../assets/icons/gmail.svg.js";import b from"../../assets/icons/instagram-channel.svg.js";import u from"../../assets/icons/whatsapp_color.svg.js";const S={[r.SMALL]:16,[r.MEDIUM]:20,[r.INBOX]:24,[r.LARGE]:32},f={[o.LIGHT]:h.content.secondary,[o.DARK]:h.surface.standard};var I;!function(e){e.INSTAGRAM="instagram",e.MESSENGER="messenger",e.WHATSAPP="whatsapp",e.GMAIL="gmail",e.LIVECHAT="livechat",e.GOOGLE_BUSINESS_CHAT="gbm",e.SHOPIFY="shopify",e.FACEBOOK="facebook",e.EMAIL="email",e.SMTP="smtp",e.FACEBOOK_CATALOG="facebook-catalog",e.TASKS="tasks"}(I||(I={}));const y=o=>{const[y,O]=s(!1),j=()=>{const e=(o.name||"").split(".").join(" ").split(" ").map((e=>e.charAt(0).toUpperCase())).slice(0,2).join("");return o.size===r.SMALL?t(c,Object.assign({style:{color:f[o.background]}},{children:e})):o.size===r.MEDIUM||o.size===r.INBOX?t(l,Object.assign({style:{color:f[o.background]}},{children:e})):o.size===r.LARGE?t(d,Object.assign({style:{color:f[o.background]}},{children:e})):void 0};return e("div",Object.assign({style:{position:"relative"}},{children:[e(i,Object.assign({type:o.type===a.IMAGE&&y&&o.useNameFallback&&o.name?a.INITIALS:o.type,size:o.size,background:o.background},{children:[o.type===a.IMAGE&&(o.useNameFallback&&!y?t("img",{alt:"",width:n[o.size],height:n[o.size],style:{borderRadius:(null==o?void 0:o.borderRadius)||"50%",objectFit:"contain"},src:o.photoUrl,onError:()=>{O(!0)}}):o.useNameFallback&&y&&o.name?t("div",{children:j()}):t("img",{alt:"",width:n[o.size],height:n[o.size],style:{borderRadius:(null==o?void 0:o.borderRadius)||"50%",objectFit:"contain"},src:o.photoUrl})),o.type===a.INITIALS&&t("div",{children:j()}),o.type===a.ICON&&o.icon&&t(o.icon,{width:S[o.size],height:S[o.size],color:f[o.background]})]})),o.inboxSettings&&t("div",Object.assign({style:{position:"absolute",left:"20px",top:"20px",width:14,height:14,borderRadius:(null==o?void 0:o.borderRadius)||"50%",display:"flex",justifyContent:"center",backgroundColor:o.inboxSettings.isSelected?o.inboxSettings.isComments?h.content.primary:h.background.brandLight:o.inboxSettings.isComments?h.content.primary:h.surface.standard,alignItems:"center"}},{children:(()=>{switch(o.channelName){case I.EMAIL:case I.SMTP:return t(g,{width:11,height:11});case I.FACEBOOK:case I.FACEBOOK_CATALOG:case I.MESSENGER:return t(p,{width:11,height:11});case I.INSTAGRAM:return t(b,{width:11,height:11});case I.WHATSAPP:return t(u,{width:11,height:11});case I.GMAIL:return t(A,{width:11,height:11});case I.TASKS:return t(m,{width:11,height:11})}})()}))]}))};export{S as AVATAR_SIZE_VS_ICON_SIZE_MAP,y as Avatar,f as BACKGROUND_VS_TEXT_COLOR_MAP,I as MESSAGE_CHANNELS};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Menus: ({
3
2
  displayName: string;
4
3
  key: number;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t,Fragment as s}from"react/jsx-runtime";import i from"../../assets/icons/check.svg.js";import a from"../../assets/icons/checkCircle.svg.js";import n from"../../assets/icons/quotes.svg.js";import o from"../../assets/icons/WhiteStarFilled.svg.js";import{Button as r}from"../button/Button.js";import{NewSubscriptionStyled as l}from"./SubscriptionPlanStyled.js";import{Caption as c,TitleRegular as d,BodyCaption as h,TitleLarge as m,TitleSmall as p}from"../TypographyStyle.js";import{useCurrency as g}from"../../hooks/useCurreny.js";import{COLORS as b}from"../../constants/Theme.js";import{Tag as u}from"../tag/Tag.js";import{Tooltip as y}from"../tooltips/Tooltip.js";const j=j=>{var O;const{formatCurrency:f}=g(),v=j.showMonthlyOptions?j.features:j.annualFeatures||[],T=j.showMonthlyOptions?j.monthlyPlan:j.yearlyPlan,N=!j.isDisabled&&j.isMostPopular,x=j.showMonthlyOptions?j.code:null!==(O=j.yearlyCode)&&void 0!==O?O:j.code,{planName:P,isSelected:S=!1,isDisabled:k=!1,onPlanSelect:C,oldPrice:M,hideMonthYearTag:w,planDescription:D,planDescriptionDiscount:L,showTrialOptions:F,freeTrialMessages:$,extraBlockMessage:z,isLoading:B,buttonText:H,bottomDescription:W,showMonthlyOptions:_,popularTestimony:I,skipRadioSelection:U=!1,includeText:Y,height:q,showFeaturesButton:A,businessDescription:R,isPlanSelected:E=!1,onClickShowAllFeatures:G,showSelectedPlanChip:J=!1,perMonthForYearly:K=!1,minHeightOfFeatures:Q,hoverTooltip:V}=j,X=e=>K&&!_?0==e?"$0":f(Math.round(e/12),"USD"):0==e?"$0":f(e,"USD");return e(y,Object.assign({body:V},{children:t(l,Object.assign({height:q,showMostPopularChip:N||!1,onClick:()=>C(x)},{children:[N&&t("div",Object.assign({className:"most-popular-chip"},{children:[e(c,Object.assign({className:"popular-text"},{children:"Most popular "})),e(o,{height:12,width:12})]})),t("div",Object.assign({className:`box ${k?"disabled":""} \n\t\t\t\t`},{children:[t("div",Object.assign({className:"radio-flex"},{children:[!U&&e("input",{type:"radio",id:"html",name:"fav_language",value:"HTML",disabled:null!=k&&k,onChange:()=>C(x),className:"radio-button",checked:E}),e(d,Object.assign({style:{color:b.content.secondary,marginBottom:4}},{children:P})),J&&e("div",Object.assign({style:{marginLeft:"auto"}},{children:e(u,{tagText:"Current plan",type:"positive",theme:"dark"})}))]})),t("div",Object.assign({className:"price-block"},{children:[M?e(h,Object.assign({className:"old--price"},{children:X(T.price)})):e(s,{}),e(m,Object.assign({style:{color:b.content.primary}},{children:X(M||T.price)})),e(c,Object.assign({style:{color:b.content.secondary,marginLeft:4}},{children:w?"":"/ "+(_?"month":K?"month billed annually":"year")}))]})),D&&t("div",Object.assign({className:"per-message-price"},{children:[e(h,Object.assign({style:{color:b.content.secondary}},{children:D})),L&&e(h,Object.assign({style:{color:b.background.positive.vibrant,marginLeft:4}},{children:L}))]})),R&&R.length&&e("div",Object.assign({style:{marginTop:4}},{children:R.map(((t,s)=>e(h,{style:{color:b.content.secondary},dangerouslySetInnerHTML:{__html:t}},s)))})),F&&t(c,Object.assign({className:"trial "+(S?"selected":"")},{children:["7 day free trial with ",$," messages"]})),z&&e(c,Object.assign({className:"trial "+(S?"selected":"")},{children:z})),e(p,Object.assign({className:"extra-include-margin",style:{height:Y?"":"20px"}},{children:Y||""})),e("div",Object.assign({className:"features",style:{minHeight:Q}},{children:v.map(((s,i)=>t("div",Object.assign({className:"feature"},{children:[e("div",{children:e(a,{height:20,width:20,color:b.content.primary})}),e(h,Object.assign({className:"feature-text"},{children:s.detail}),i)]}),s.detail)))})),A&&e(r,{isLoading:!1,buttonType:"tertiary",buttonText:"See all features",size:"small",onClick:e=>{e.stopPropagation(),G&&G()}}),U&&e("div",Object.assign({className:"button-box"},{children:B?e(r,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):t(s,{children:[S&&e(r,{disabled:k,LeadingIcon:i,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:H||"Selected Plan"}),!S&&!k&&e(r,{buttonType:"primary",size:"medium",onClick:e=>{e.stopPropagation(),C(x)},matchParentWidth:!0,buttonText:H||"Choose plan"})]})})),I&&t("div",Object.assign({className:"popular-testimony"},{children:[e(n,{height:26,width:70}),e("div",Object.assign({className:"testimony-text"},{children:e("i",{children:I})}))]}))]})),W&&e("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${k?"disabled":""}\n\t\t\t\t\t${S?"selected":""}\n\t\t\t\t`},{children:e(c,Object.assign({className:"text",style:{color:b.background.inverse}},{children:W}))}))]}))}))};export{j as NewSubscriptionPlan};
1
+ import{jsx as e,jsxs as t,Fragment as s}from"react/jsx-runtime";import i from"../../assets/icons/check.svg.js";import a from"../../assets/icons/checkCircle.svg.js";import n from"../../assets/icons/quotes.svg.js";import o from"../../assets/icons/WhiteStarFilled.svg.js";import{Button as r}from"../button/Button.js";import{NewSubscriptionStyled as l}from"./SubscriptionPlanStyled.js";import{Caption as c,TitleRegular as d,BodyCaption as h,TitleLarge as m,TitleSmall as p}from"../TypographyStyle.js";import{useCurrency as g}from"../../hooks/useCurreny.js";import{COLORS as b}from"../../constants/Theme.js";import{Tag as u}from"../tag/Tag.js";import{Tooltip as y}from"../tooltips/Tooltip.js";const j=j=>{var O;const{formatCurrency:f}=g(),v=j.showMonthlyOptions?j.features:j.annualFeatures||[],T=j.showMonthlyOptions?j.monthlyPlan:j.yearlyPlan,N=!j.isDisabled&&j.isMostPopular,x=j.showMonthlyOptions?j.code:null!==(O=j.yearlyCode)&&void 0!==O?O:j.code,{planName:P,isSelected:k=!1,isDisabled:S=!1,onPlanSelect:C,oldPrice:M,hideMonthYearTag:w,planDescription:D,planDescriptionDiscount:L,showTrialOptions:F,freeTrialMessages:B,extraBlockMessage:$,isLoading:z,buttonText:H,bottomDescription:W,showMonthlyOptions:_,popularTestimony:I,skipRadioSelection:U=!1,includeText:Y,height:q,showFeaturesButton:A,businessDescription:R,isPlanSelected:E=!1,onClickShowAllFeatures:G,showSelectedPlanChip:J=!1,perMonthForYearly:K=!1,minHeightOfFeatures:Q,hoverTooltip:V,hidePriceBlock:X=!1}=j,Z=e=>K&&!_?0==e?"$0":f(Math.round(e/12),"USD"):0==e?"$0":f(e,"USD");return e(y,Object.assign({body:V},{children:t(l,Object.assign({height:q,showMostPopularChip:N||!1,onClick:()=>C(x)},{children:[N&&t("div",Object.assign({className:"most-popular-chip"},{children:[e(c,Object.assign({className:"popular-text"},{children:"Most popular "})),e(o,{height:12,width:12})]})),t("div",Object.assign({className:`box ${S?"disabled":""} \n\t\t\t\t`},{children:[t("div",Object.assign({className:"radio-flex"},{children:[!U&&e("input",{type:"radio",id:"html",name:"fav_language",value:"HTML",disabled:null!=S&&S,onChange:()=>C(x),className:"radio-button",checked:E}),e(d,Object.assign({style:{color:b.content.secondary,marginBottom:4}},{children:P})),J&&e("div",Object.assign({style:{marginLeft:"auto"}},{children:e(u,{tagText:"Current plan",type:"positive",theme:"dark"})}))]})),X?e(s,{}):t("div",Object.assign({className:"price-block"},{children:[M?e(h,Object.assign({className:"old--price"},{children:Z(T.price)})):e(s,{}),e(m,Object.assign({style:{color:b.content.primary}},{children:Z(M||T.price)})),e(c,Object.assign({style:{color:b.content.secondary,marginLeft:4}},{children:w?"":"/ "+(_?"month":K?"month billed annually":"year")}))]})),D&&t("div",Object.assign({className:"per-message-price"},{children:[e(h,Object.assign({style:{color:b.content.secondary}},{children:D})),L&&e(h,Object.assign({style:{color:b.background.positive.vibrant,marginLeft:4}},{children:L}))]})),R&&R.length&&e("div",Object.assign({style:{marginTop:4}},{children:R.map(((t,s)=>e(h,{style:{color:b.content.secondary},dangerouslySetInnerHTML:{__html:t}},s)))})),F&&t(c,Object.assign({className:"trial "+(k?"selected":"")},{children:["7 day free trial with ",B," messages"]})),$&&e(c,Object.assign({className:"trial "+(k?"selected":"")},{children:$})),e(p,Object.assign({className:"extra-include-margin",style:{height:Y?"":"20px"}},{children:Y||""})),e("div",Object.assign({className:"features",style:{minHeight:Q}},{children:v.map(((s,i)=>t("div",Object.assign({className:"feature"},{children:[e("div",{children:e(a,{height:20,width:20,color:b.content.primary})}),e(h,Object.assign({className:"feature-text"},{children:s.detail}),i)]}),s.detail)))})),A&&e(r,{isLoading:!1,buttonType:"tertiary",buttonText:"See all features",size:"small",onClick:e=>{e.stopPropagation(),G&&G()}}),U&&e("div",Object.assign({className:"button-box"},{children:z?e(r,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):t(s,{children:[k&&e(r,{disabled:S,LeadingIcon:i,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:H||"Selected Plan"}),!k&&!S&&e(r,{buttonType:"primary",size:"medium",onClick:e=>{e.stopPropagation(),C(x)},matchParentWidth:!0,buttonText:H||"Choose plan"})]})})),I&&t("div",Object.assign({className:"popular-testimony"},{children:[e(n,{height:26,width:70}),e("div",Object.assign({className:"testimony-text"},{children:e("i",{children:I})}))]}))]})),W&&e("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${S?"disabled":""}\n\t\t\t\t\t${k?"selected":""}\n\t\t\t\t`},{children:e(c,Object.assign({className:"text",style:{color:b.background.inverse}},{children:W}))}))]}))}))};export{j as NewSubscriptionPlan};
@@ -31,6 +31,7 @@ export interface SubscriptionPlanProps {
31
31
  hideMonthYearTag?: boolean;
32
32
  buttonText?: string;
33
33
  hoverTooltip?: string;
34
+ hidePriceBlock?: boolean;
34
35
  }
35
36
  type Props = SubscriptionPlanProps;
36
37
  export declare const SubscriptionPlan: FunctionComponent<Props>;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t,Fragment as s}from"react/jsx-runtime";import i from"../../assets/icons/check.svg.js";import{Button as n}from"../button/Button.js";import{SubscriptionPlanStyled as a}from"./SubscriptionPlanStyled.js";import{Caption as c,TitleRegular as o,BodyCaption as r,TitleMedium as l,BodyPrimary as d}from"../TypographyStyle.js";import{useCurrency as m}from"../../hooks/useCurreny.js";import{COLORS as h}from"../../constants/Theme.js";const p=p=>{const{formatCurrency:b}=m(),g=p.showMonthlyOptions?p.features:p.annualFeatures||[],u=p.showMonthlyOptions?p.monthlyPlan:p.yearlyPlan,y=!p.isDisabled&&p.isMostPopular,j=e=>0==e?"$0":b(e,"USD");return e(a,Object.assign({isManifestPlan:!0,isSelected:p.isSelected||!1,style:{marginTop:y?0:24}},{children:[y&&t("div",Object.assign({className:"most-popular"},{children:t(c,Object.assign({className:"text"},{children:"Most popular ⭐️"}))})),e("div",Object.assign({className:`box ${p.isSelected?"selected":""} ${p.isDisabled?"disabled":""} ${y?"":"rounded-corners"}\n\t\t\t\t`},{children:[e("div",{children:[t(o,Object.assign({style:{color:h.content.secondary,marginBottom:4}},{children:p.planName})),e("div",Object.assign({className:"price-block"},{children:[p.oldPrice?t(r,Object.assign({className:"old--price"},{children:j(u.price)})):t(s,{}),t(l,Object.assign({style:{color:h.content.primary}},{children:p.oldPrice?j(p.oldPrice):j(u.price)})),t(d,Object.assign({style:{color:h.content.secondary,marginLeft:4}},{children:p.hideMonthYearTag?"":"/ "+(p.showMonthlyOptions?"month":"year")}))]})),e("div",Object.assign({className:"per-message-price"},{children:[p.planDescription&&t(r,Object.assign({style:{color:h.content.secondary}},{children:p.planDescription})),p.planDescriptionDiscount&&t(r,Object.assign({style:{color:h.background.positive.vibrant,marginLeft:4}},{children:p.planDescriptionDiscount}))]})),p.showTrialOptions&&e(c,Object.assign({className:"trial "+(p.isSelected?"selected":"")},{children:["7 day free trial with ",p.freeTrialMessages," messages"]})),p.extraBlockMessage&&t(c,Object.assign({className:"trial "+(p.isSelected?"selected":"")},{children:p.extraBlockMessage})),t("div",Object.assign({className:"features"},{children:g.map(((s,n)=>e("div",Object.assign({className:"feature"},{children:[t("div",{children:t(i,{height:12,width:12,color:h.content.primary})}),t(r,Object.assign({className:"feature-text"},{children:s.detail}),n)]}),s.detail)))}))]}),t("div",Object.assign({className:"button-box"},{children:p.isLoading?t(n,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):e(s,{children:[p.isSelected&&t(n,{disabled:p.isDisabled,LeadingIcon:i,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:p.buttonText||"Selected Plan"}),!p.isSelected&&!p.isDisabled&&t(n,{buttonType:"primary",size:"medium",onClick:()=>p.onPlanSelect(p.code),matchParentWidth:!0,buttonText:p.buttonText||"Choose plan"})]})}))]})),p.bottomDescription&&t("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${p.isDisabled?"disabled":""}\n\t\t\t\t\t${p.isSelected?"selected":""}\n\t\t\t\t`},{children:t(c,Object.assign({className:"text",style:{color:h.background.inverse}},{children:p.bottomDescription}))}))]}))};export{p as SubscriptionPlan};
1
+ import{jsxs as e,jsx as t,Fragment as s}from"react/jsx-runtime";import i from"../../assets/icons/check.svg.js";import{Button as n}from"../button/Button.js";import{SubscriptionPlanStyled as a}from"./SubscriptionPlanStyled.js";import{Caption as c,TitleRegular as o,BodyCaption as r,TitleMedium as l,BodyPrimary as d}from"../TypographyStyle.js";import{useCurrency as m}from"../../hooks/useCurreny.js";import{COLORS as h}from"../../constants/Theme.js";const p=p=>{const{formatCurrency:b}=m(),g=p.showMonthlyOptions?p.features:p.annualFeatures||[],u=p.showMonthlyOptions?p.monthlyPlan:p.yearlyPlan,y=!p.isDisabled&&p.isMostPopular,j=e=>0==e?"$0":b(e,"USD");return e(a,Object.assign({isManifestPlan:!0,isSelected:p.isSelected||!1,style:{marginTop:y?0:24}},{children:[y&&t("div",Object.assign({className:"most-popular"},{children:t(c,Object.assign({className:"text"},{children:"Most popular ⭐️"}))})),e("div",Object.assign({className:`box ${p.isSelected?"selected":""} ${p.isDisabled?"disabled":""} ${y?"":"rounded-corners"}\n\t\t\t\t`},{children:[e("div",{children:[t(o,Object.assign({style:{color:h.content.secondary,marginBottom:4}},{children:p.planName})),(null==p?void 0:p.hidePriceBlock)?t(s,{}):e("div",Object.assign({className:"price-block"},{children:[p.oldPrice?t(r,Object.assign({className:"old--price"},{children:j(u.price)})):t(s,{}),t(l,Object.assign({style:{color:h.content.primary}},{children:p.oldPrice?j(p.oldPrice):j(u.price)})),t(d,Object.assign({style:{color:h.content.secondary,marginLeft:4}},{children:p.hideMonthYearTag?"":"/ "+(p.showMonthlyOptions?"month":"year")}))]})),e("div",Object.assign({className:"per-message-price"},{children:[p.planDescription&&t(r,Object.assign({style:{color:h.content.secondary}},{children:p.planDescription})),p.planDescriptionDiscount&&t(r,Object.assign({style:{color:h.background.positive.vibrant,marginLeft:4}},{children:p.planDescriptionDiscount}))]})),p.showTrialOptions&&e(c,Object.assign({className:"trial "+(p.isSelected?"selected":"")},{children:["7 day free trial with ",p.freeTrialMessages," messages"]})),p.extraBlockMessage&&t(c,Object.assign({className:"trial "+(p.isSelected?"selected":"")},{children:p.extraBlockMessage})),t("div",Object.assign({className:"features"},{children:g.map(((s,n)=>e("div",Object.assign({className:"feature"},{children:[t("div",{children:t(i,{height:12,width:12,color:h.content.primary})}),t(r,Object.assign({className:"feature-text"},{children:s.detail}),n)]}),s.detail)))}))]}),t("div",Object.assign({className:"button-box"},{children:p.isLoading?t(n,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):e(s,{children:[p.isSelected&&t(n,{disabled:p.isDisabled,LeadingIcon:i,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:p.buttonText||"Selected Plan"}),!p.isSelected&&!p.isDisabled&&t(n,{buttonType:"primary",size:"medium",onClick:()=>p.onPlanSelect(p.code),matchParentWidth:!0,buttonText:p.buttonText||"Choose plan"})]})}))]})),p.bottomDescription&&t("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${p.isDisabled?"disabled":""}\n\t\t\t\t\t${p.isSelected?"selected":""}\n\t\t\t\t`},{children:t(c,Object.assign({className:"text",style:{color:h.background.inverse}},{children:p.bottomDescription}))}))]}))};export{p as SubscriptionPlan};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.660-beta.0",
3
+ "version": "0.0.661",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +0,0 @@
1
- "use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var c=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,c.get?c:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t,r,c,a=e(require("react"));function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(e[c]=r[c])}return e},n.apply(this,arguments)}var l=e=>a.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 54 54"},e),t||(t=a.createElement("path",{fill:"url(#bik_livechat_svg__a)",d:"M53.368 27a26.368 26.368 0 0 1-39.571 22.827l-10.27 3.425a2.198 2.198 0 0 1-2.78-2.78l3.425-10.27A26.369 26.369 0 1 1 53.368 27Z"})),r||(r=a.createElement("path",{fill:"#fff",d:"M36.983 32.943c-.31 0-.553-.08-.725-.241-.161-.173-.242-.415-.242-.725V21.739c0-.31.08-.546.242-.707.172-.173.414-.26.725-.26h6.301c.242 0 .426.064.552.19.127.116.19.288.19.518 0 .242-.063.426-.19.553-.126.127-.31.19-.552.19h-5.541v3.815h5.161c.253 0 .438.063.553.19.126.127.19.305.19.535 0 .242-.064.426-.19.552-.115.116-.3.173-.553.173h-5.162v4.005h5.542c.242 0 .426.064.552.19.127.127.19.305.19.535 0 .242-.063.426-.19.553-.126.115-.31.172-.552.172h-6.301ZM28.555 33.064c-.253 0-.466-.057-.639-.172a1.37 1.37 0 0 1-.397-.553l-4.644-10.513c-.092-.242-.115-.45-.069-.622a.664.664 0 0 1 .276-.397.917.917 0 0 1 .535-.155c.265 0 .467.057.605.172.138.115.253.288.345.518l4.35 10.082h-.638l4.315-10.099c.104-.219.225-.386.363-.5.15-.116.351-.173.604-.173.207 0 .374.052.5.155a.597.597 0 0 1 .26.397c.034.173 0 .38-.104.622l-4.626 10.513a1.37 1.37 0 0 1-.397.553c-.162.115-.374.172-.64.172ZM20.206 33.064c-.287 0-.512-.08-.673-.242-.15-.16-.224-.385-.224-.673V21.567c0-.3.075-.524.224-.674.161-.16.386-.241.673-.241.288 0 .507.08.657.241.16.15.241.374.241.674v10.582c0 .288-.075.512-.224.673-.15.162-.374.242-.674.242ZM10.699 32.943c-.288 0-.512-.08-.674-.241-.16-.161-.241-.386-.241-.674v-10.41c0-.299.074-.523.224-.673.161-.16.386-.241.673-.241.288 0 .507.08.656.241.162.15.242.374.242.674v9.788h5.352c.253 0 .449.069.587.207.138.127.207.31.207.552 0 .242-.07.432-.207.57-.138.138-.334.207-.587.207h-6.232Z"})),c||(c=a.createElement("defs",null,a.createElement("linearGradient",{id:"bik_livechat_svg__a",x1:27,x2:27,y1:.637,y2:53.371,gradientUnits:"userSpaceOnUse"},a.createElement("stop",{stopColor:"#B143FF"}),a.createElement("stop",{offset:1,stopColor:"#6532FF"})))));exports.default=l;
@@ -1 +0,0 @@
1
- import*as e from"react";var t,a,c;function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(e[c]=a[c])}return e},l.apply(this,arguments)}var r=r=>e.createElement("svg",l({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 54 54"},r),t||(t=e.createElement("path",{fill:"url(#bik_livechat_svg__a)",d:"M53.368 27a26.368 26.368 0 0 1-39.571 22.827l-10.27 3.425a2.198 2.198 0 0 1-2.78-2.78l3.425-10.27A26.369 26.369 0 1 1 53.368 27Z"})),a||(a=e.createElement("path",{fill:"#fff",d:"M36.983 32.943c-.31 0-.553-.08-.725-.241-.161-.173-.242-.415-.242-.725V21.739c0-.31.08-.546.242-.707.172-.173.414-.26.725-.26h6.301c.242 0 .426.064.552.19.127.116.19.288.19.518 0 .242-.063.426-.19.553-.126.127-.31.19-.552.19h-5.541v3.815h5.161c.253 0 .438.063.553.19.126.127.19.305.19.535 0 .242-.064.426-.19.552-.115.116-.3.173-.553.173h-5.162v4.005h5.542c.242 0 .426.064.552.19.127.127.19.305.19.535 0 .242-.063.426-.19.553-.126.115-.31.172-.552.172h-6.301ZM28.555 33.064c-.253 0-.466-.057-.639-.172a1.37 1.37 0 0 1-.397-.553l-4.644-10.513c-.092-.242-.115-.45-.069-.622a.664.664 0 0 1 .276-.397.917.917 0 0 1 .535-.155c.265 0 .467.057.605.172.138.115.253.288.345.518l4.35 10.082h-.638l4.315-10.099c.104-.219.225-.386.363-.5.15-.116.351-.173.604-.173.207 0 .374.052.5.155a.597.597 0 0 1 .26.397c.034.173 0 .38-.104.622l-4.626 10.513a1.37 1.37 0 0 1-.397.553c-.162.115-.374.172-.64.172ZM20.206 33.064c-.287 0-.512-.08-.673-.242-.15-.16-.224-.385-.224-.673V21.567c0-.3.075-.524.224-.674.161-.16.386-.241.673-.241.288 0 .507.08.657.241.16.15.241.374.241.674v10.582c0 .288-.075.512-.224.673-.15.162-.374.242-.674.242ZM10.699 32.943c-.288 0-.512-.08-.674-.241-.16-.161-.241-.386-.241-.674v-10.41c0-.299.074-.523.224-.673.161-.16.386-.241.673-.241.288 0 .507.08.656.241.162.15.242.374.242.674v9.788h5.352c.253 0 .449.069.587.207.138.127.207.31.207.552 0 .242-.07.432-.207.57-.138.138-.334.207-.587.207h-6.232Z"})),c||(c=e.createElement("defs",null,e.createElement("linearGradient",{id:"bik_livechat_svg__a",x1:27,x2:27,y1:.637,y2:53.371,gradientUnits:"userSpaceOnUse"},e.createElement("stop",{stopColor:"#B143FF"}),e.createElement("stop",{offset:1,stopColor:"#6532FF"})))));export{r as default};