@bikdotai/bik-component-library 0.0.629-beta.23 → 0.0.629-beta.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../shimmer/ShimmerComponent/ShimmerStyled.js"),i=require("../../utils/DateUtils.js"),r=require("../../constants/Theme.js"),s=require("../../assets/icons/arrow_down.svg.js"),l=require("../../assets/icons/arrow_up.svg.js"),a=require("../../assets/icons/info.svg.js"),o=require("../tag/Tag.js"),c=require("../tooltips/Tooltip.js"),d=require("../TypographyStyle.js"),g=require("./chart/utils/calcPercentage.js"),u=require("./CommonStyles.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y=h(t);const m=n=>{let{percent:a,direction:o,timeline:c,customRange:u,trendRaw:h,prefixSymbol:y,trendIconStyle:m,isInternationalStore:p}=n;const j="negative"===o?s.default:l.default,x="negative"===o?r.COLORS.background.negative.vibrant:"positive"===o?r.COLORS.background.positive.vibrant:r.COLORS.content.placeholder,[f,b]=t.useState("");t.useEffect((()=>{b("today"===c?"vs yesterday":"yesterday"===c?"vs 1 day before":"7 days"===c?"vs last 7 days":"30 days"===c?"vs last 30 days":"custom"===c&&u?i.default.getAnalyticsCustomDateTimelineText(u):"")}),[c,u]);const O=t.useRef((()=>{console.log("trendRaw",h);const e=((null!=h?h:0)>0?"+":"")+(null!=y?y:"");return void 0===h?"--":`${null!=e?e:""}${p?g.truncateValueForInternationalStore(h):g.truncateValueForIndianStore(h)}`})());return e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof a&&e.jsx(j,{color:x,height:16,width:16,style:Object.assign({marginRight:2},null!=m?m:{})}),"number"==typeof a&&o&&e.jsxs(d.Caption,Object.assign({style:{color:x}},{children:["neutral"===o?0:a<1e3?a:">999","%"]})),!!h&&e.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:r.COLORS.content.placeholder}},{children:`(${O.current})`})),c&&e.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:r.COLORS.content.placeholder}},{children:f}))]}))};exports.AnalyticsTrend=t=>{let{title:i,value:s,trendPercent:l,type:h="horizontal",timeline:p,customRange:j,tooltip:x,card:f=!0,rightSeparator:b=!1,size:O="big",share:S=!1,formatVal:v,prefixSymbol:C,trailingIcon:T,onTrailIconClick:R,iconTooltipBody:w,funnelPercent:$,isLoading:I,trendRaw:L,suffixText:q,trendStyle:D,trendContainerStyle:F,trendIconStyle:M,containerStyle:k,prevTrendDiff:P,relativePercentageDiff:V,isInternationalStore:z}=t;const _="big"===O?d.TitleLarge:d.TitleMedium,A=void 0!==l?l<0?"negative":0===l?"neutral":"positive":void 0,N=void 0!==l?S?Math.round(l):Math.abs(Math.round(l)):void 0;return e.jsx(u.AnalyticsTrendContainer,Object.assign({card:f,style:Object.assign({},k)},{children:e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:4,borderRightWidth:b?1:0,borderRightColor:r.COLORS.stroke.primary,borderRightStyle:"solid",paddingLeft:f?0:24,paddingRight:f?0:24,height:"100%",justifyContent:"space-between",alignItems:"center"},null!=F?F:{})},{children:[e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=D?D:{})},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsx(d.BodyCaption,Object.assign({style:{color:r.COLORS.content.secondary}},{children:i})),x&&e.jsx(c.Tooltip,Object.assign({body:x,placement:"right",width:300},{children:e.jsx("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e.jsx(a.default,{color:r.COLORS.content.primary,height:16,width:16})}))}))]})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},S?{justifyContent:"space-between"}:{})},{children:[I&&e.jsx(n.ShimmerComponentStyled,{width:108,height:26}),!I&&e.jsx(_,Object.assign({style:{color:r.COLORS.content.primary}},{children:void 0===s?"--":"number"==typeof s&&v?s>999?z?`${null!=C?C:""}${g.truncateValueForInternationalStore(s)} ${null!=q?q:""}`:`${null!=C?C:""}${g.truncateValueForIndianStore(s)} ${null!=q?q:""}`:`${null!=C?C:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(s)} ${null!=q?q:""}`:`${null!=C?C:""}${s} ${null!=q?q:""}`})),"number"==typeof V&&e.jsx(o.Tag,{tagText:`${V}%`,theme:"light",type:"neutral"}),"horizontal"===h&&!I&&!S&&e.jsx(m,{timeline:p,customRange:j,percent:N,direction:A,trendRaw:L,prefixSymbol:C,trendIconStyle:M,isInternationalStore:z}),I&&!S&&"horizontal"===h&&e.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6}),"vertical"===h&&!I&&void 0!==$&&e.jsx(o.Tag,{tagText:`${$} %`,theme:"light",type:"neutral"}),S&&!I&&void 0!==N&&e.jsx(o.Tag,{tagText:`${N} %`,theme:"light",type:"neutral"}),S||I||!P||0==P?e.jsx(e.Fragment,{}):e.jsx(o.Tag,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(P),theme:"light",type:"neutral"})]})),"vertical"===h&&!I&&!S&&e.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsx(m,{timeline:p,customRange:j,percent:N,direction:A,trendRaw:L,prefixSymbol:C,trendIconStyle:M})})),I&&"vertical"===h&&e.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6})]})),w&&!I&&e.jsx(c.Tooltip,Object.assign({body:w,placement:"right"},{children:T&&e.jsx("div",Object.assign({className:"icon--holder",onClick:R},{children:y.default.createElement(T,{height:20,width:20,color:r.COLORS.content.secondary})}))}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../shimmer/ShimmerComponent/ShimmerStyled.js"),i=require("../../utils/DateUtils.js"),r=require("../../constants/Theme.js"),s=require("../../assets/icons/arrow_down.svg.js"),a=require("../../assets/icons/arrow_up.svg.js"),l=require("../../assets/icons/info.svg.js"),o=require("../tag/Tag.js"),c=require("../tooltips/Tooltip.js"),d=require("../TypographyStyle.js"),g=require("./chart/utils/calcPercentage.js"),u=require("./CommonStyles.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y=h(t);const m=n=>{let{percent:l,direction:o,timeline:c,customRange:u,trendRaw:h,prefixSymbol:y,trendIconStyle:m,isInternationalStore:p}=n;const j="negative"===o?s.default:a.default,x="negative"===o?r.COLORS.background.negative.vibrant:"positive"===o?r.COLORS.background.positive.vibrant:r.COLORS.content.placeholder,[b,f]=t.useState("");t.useEffect((()=>{f("today"===c?"vs yesterday":"yesterday"===c?"vs 1 day before":"7 days"===c?"vs last 7 days":"30 days"===c?"vs last 30 days":"custom"===c&&u?i.default.getAnalyticsCustomDateTimelineText(u):"")}),[c,u]);const O=t.useRef((()=>{console.log("trendRaw",h);const e=((null!=h?h:0)>0?"+":"-")+(null!=y?y:""),t=void 0===h?"--":`${null!=e?e:""}${p?g.truncateValueForInternationalStore(Math.abs(h)):g.truncateValueForIndianStore(Math.abs(h))}`;return console.log("trendRawTextInitial",t),t})());return e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof l&&e.jsx(j,{color:x,height:16,width:16,style:Object.assign({marginRight:2},null!=m?m:{})}),"number"==typeof l&&o&&e.jsxs(d.Caption,Object.assign({style:{color:x}},{children:["neutral"===o?0:l<1e3?l:">999","%"]})),!!h&&e.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:r.COLORS.content.placeholder}},{children:`(${O.current})`})),c&&e.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:r.COLORS.content.placeholder}},{children:b}))]}))};exports.AnalyticsTrend=t=>{let{title:i,value:s,trendPercent:a,type:h="horizontal",timeline:p,customRange:j,tooltip:x,card:b=!0,rightSeparator:f=!1,size:O="big",share:S=!1,formatVal:v,prefixSymbol:T,trailingIcon:C,onTrailIconClick:R,iconTooltipBody:w,funnelPercent:I,isLoading:$,trendRaw:L,suffixText:q,trendStyle:D,trendContainerStyle:F,trendIconStyle:M,containerStyle:k,prevTrendDiff:P,relativePercentageDiff:V,isInternationalStore:z}=t;const _="big"===O?d.TitleLarge:d.TitleMedium,A=void 0!==a?a<0?"negative":0===a?"neutral":"positive":void 0,N=void 0!==a?S?Math.round(a):Math.abs(Math.round(a)):void 0;return e.jsx(u.AnalyticsTrendContainer,Object.assign({card:b,style:Object.assign({},k)},{children:e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:4,borderRightWidth:f?1:0,borderRightColor:r.COLORS.stroke.primary,borderRightStyle:"solid",paddingLeft:b?0:24,paddingRight:b?0:24,height:"100%",justifyContent:"space-between",alignItems:"center"},null!=F?F:{})},{children:[e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=D?D:{})},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsx(d.BodyCaption,Object.assign({style:{color:r.COLORS.content.secondary}},{children:i})),x&&e.jsx(c.Tooltip,Object.assign({body:x,placement:"right",width:300},{children:e.jsx("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e.jsx(l.default,{color:r.COLORS.content.primary,height:16,width:16})}))}))]})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},S?{justifyContent:"space-between"}:{})},{children:[$&&e.jsx(n.ShimmerComponentStyled,{width:108,height:26}),!$&&e.jsx(_,Object.assign({style:{color:r.COLORS.content.primary}},{children:void 0===s?"--":"number"==typeof s&&v?s>999?z?`${null!=T?T:""}${g.truncateValueForInternationalStore(s)} ${null!=q?q:""}`:`${null!=T?T:""}${g.truncateValueForIndianStore(s)} ${null!=q?q:""}`:`${null!=T?T:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(s)} ${null!=q?q:""}`:`${null!=T?T:""}${s} ${null!=q?q:""}`})),"number"==typeof V&&e.jsx(o.Tag,{tagText:`${V}%`,theme:"light",type:"neutral"}),"horizontal"===h&&!$&&!S&&e.jsx(m,{timeline:p,customRange:j,percent:N,direction:A,trendRaw:L,prefixSymbol:T,trendIconStyle:M,isInternationalStore:z}),$&&!S&&"horizontal"===h&&e.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6}),"vertical"===h&&!$&&void 0!==I&&e.jsx(o.Tag,{tagText:`${I} %`,theme:"light",type:"neutral"}),S&&!$&&void 0!==N&&e.jsx(o.Tag,{tagText:`${N} %`,theme:"light",type:"neutral"}),S||$||!P||0==P?e.jsx(e.Fragment,{}):e.jsx(o.Tag,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(P),theme:"light",type:"neutral"})]})),"vertical"===h&&!$&&!S&&e.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsx(m,{timeline:p,customRange:j,percent:N,direction:A,trendRaw:L,prefixSymbol:T,trendIconStyle:M})})),$&&"vertical"===h&&e.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6})]})),w&&!$&&e.jsx(c.Tooltip,Object.assign({body:w,placement:"right"},{children:C&&e.jsx("div",Object.assign({className:"icon--holder",onClick:R},{children:y.default.createElement(C,{height:20,width:20,color:r.COLORS.content.secondary})}))}))]}))}))};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import n,{useState as r,useEffect as o,useRef as l}from"react";import{ShimmerComponentStyled as a}from"../shimmer/ShimmerComponent/ShimmerStyled.js";import s from"../../utils/DateUtils.js";import{COLORS as c}from"../../constants/Theme.js";import d from"../../assets/icons/arrow_down.svg.js";import g from"../../assets/icons/arrow_up.svg.js";import m from"../../assets/icons/info.svg.js";import{Tag as h}from"../tag/Tag.js";import{Tooltip as p}from"../tooltips/Tooltip.js";import{BodyCaption as y,Caption as u,TitleLarge as f,TitleMedium as b}from"../TypographyStyle.js";import{truncateValueForInternationalStore as v,truncateValueForIndianStore as j}from"./chart/utils/calcPercentage.js";import{AnalyticsTrendContainer as x}from"./CommonStyles.js";const w=r=>{let{title:o,value:l,trendPercent:s,type:d="horizontal",timeline:g,customRange:u,tooltip:w,card:S=!0,rightSeparator:$=!1,size:T="big",share:I=!1,formatVal:R,prefixSymbol:D,trailingIcon:C,onTrailIconClick:k,iconTooltipBody:z,funnelPercent:L,isLoading:M,trendRaw:P,suffixText:F,trendStyle:N,trendContainerStyle:W,trendIconStyle:_,containerStyle:A,prevTrendDiff:B,relativePercentageDiff:E,isInternationalStore:U}=r;const V="big"===T?f:b,q=void 0!==s?s<0?"negative":0===s?"neutral":"positive":void 0,G=void 0!==s?I?Math.round(s):Math.abs(Math.round(s)):void 0;return e(x,Object.assign({card:S,style:Object.assign({},A)},{children:t("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:4,borderRightWidth:$?1:0,borderRightColor:c.stroke.primary,borderRightStyle:"solid",paddingLeft:S?0:24,paddingRight:S?0:24,height:"100%",justifyContent:"space-between",alignItems:"center"},null!=W?W:{})},{children:[t("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=N?N:{})},{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e(y,Object.assign({style:{color:c.content.secondary}},{children:o})),w&&e(p,Object.assign({body:w,placement:"right",width:300},{children:e("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e(m,{color:c.content.primary,height:16,width:16})}))}))]})),t("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},I?{justifyContent:"space-between"}:{})},{children:[M&&e(a,{width:108,height:26}),!M&&e(V,Object.assign({style:{color:c.content.primary}},{children:void 0===l?"--":"number"==typeof l&&R?l>999?U?`${null!=D?D:""}${v(l)} ${null!=F?F:""}`:`${null!=D?D:""}${j(l)} ${null!=F?F:""}`:`${null!=D?D:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(l)} ${null!=F?F:""}`:`${null!=D?D:""}${l} ${null!=F?F:""}`})),"number"==typeof E&&e(h,{tagText:`${E}%`,theme:"light",type:"neutral"}),"horizontal"===d&&!M&&!I&&e(O,{timeline:g,customRange:u,percent:G,direction:q,trendRaw:P,prefixSymbol:D,trendIconStyle:_,isInternationalStore:U}),M&&!I&&"horizontal"===d&&e(a,{height:20,width:141,marginTop:6}),"vertical"===d&&!M&&void 0!==L&&e(h,{tagText:`${L} %`,theme:"light",type:"neutral"}),I&&!M&&void 0!==G&&e(h,{tagText:`${G} %`,theme:"light",type:"neutral"}),I||M||!B||0==B?e(i,{}):e(h,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(B),theme:"light",type:"neutral"})]})),"vertical"===d&&!M&&!I&&e("div",Object.assign({style:{marginTop:10}},{children:e(O,{timeline:g,customRange:u,percent:G,direction:q,trendRaw:P,prefixSymbol:D,trendIconStyle:_})})),M&&"vertical"===d&&e(a,{height:20,width:141,marginTop:6})]})),z&&!M&&e(p,Object.assign({body:z,placement:"right"},{children:C&&e("div",Object.assign({className:"icon--holder",onClick:k},{children:n.createElement(C,{height:20,width:20,color:c.content.secondary})}))}))]}))}))},O=i=>{let{percent:n,direction:a,timeline:m,customRange:h,trendRaw:p,prefixSymbol:y,trendIconStyle:f,isInternationalStore:b}=i;const x="negative"===a?d:g,w="negative"===a?c.background.negative.vibrant:"positive"===a?c.background.positive.vibrant:c.content.placeholder,[O,S]=r("");o((()=>{S("today"===m?"vs yesterday":"yesterday"===m?"vs 1 day before":"7 days"===m?"vs last 7 days":"30 days"===m?"vs last 30 days":"custom"===m&&h?s.getAnalyticsCustomDateTimelineText(h):"")}),[m,h]);const $=l((()=>{console.log("trendRaw",p);const e=((null!=p?p:0)>0?"+":"")+(null!=y?y:"");return void 0===p?"--":`${null!=e?e:""}${b?v(p):j(p)}`})());return t("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof n&&e(x,{color:w,height:16,width:16,style:Object.assign({marginRight:2},null!=f?f:{})}),"number"==typeof n&&a&&t(u,Object.assign({style:{color:w}},{children:["neutral"===a?0:n<1e3?n:">999","%"]})),!!p&&e(u,Object.assign({style:{marginLeft:4,color:c.content.placeholder}},{children:`(${$.current})`})),m&&e(u,Object.assign({style:{marginLeft:4,color:c.content.placeholder}},{children:O}))]}))};export{w as AnalyticsTrend};
1
+ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import n,{useState as r,useEffect as o,useRef as l}from"react";import{ShimmerComponentStyled as a}from"../shimmer/ShimmerComponent/ShimmerStyled.js";import s from"../../utils/DateUtils.js";import{COLORS as c}from"../../constants/Theme.js";import d from"../../assets/icons/arrow_down.svg.js";import g from"../../assets/icons/arrow_up.svg.js";import m from"../../assets/icons/info.svg.js";import{Tag as h}from"../tag/Tag.js";import{Tooltip as p}from"../tooltips/Tooltip.js";import{BodyCaption as y,Caption as u,TitleLarge as f,TitleMedium as b}from"../TypographyStyle.js";import{truncateValueForInternationalStore as v,truncateValueForIndianStore as j}from"./chart/utils/calcPercentage.js";import{AnalyticsTrendContainer as x}from"./CommonStyles.js";const w=r=>{let{title:o,value:l,trendPercent:s,type:d="horizontal",timeline:g,customRange:u,tooltip:w,card:S=!0,rightSeparator:$=!1,size:T="big",share:I=!1,formatVal:R,prefixSymbol:D,trailingIcon:C,onTrailIconClick:M,iconTooltipBody:k,funnelPercent:z,isLoading:L,trendRaw:P,suffixText:F,trendStyle:N,trendContainerStyle:W,trendIconStyle:_,containerStyle:A,prevTrendDiff:B,relativePercentageDiff:E,isInternationalStore:U}=r;const V="big"===T?f:b,q=void 0!==s?s<0?"negative":0===s?"neutral":"positive":void 0,G=void 0!==s?I?Math.round(s):Math.abs(Math.round(s)):void 0;return e(x,Object.assign({card:S,style:Object.assign({},A)},{children:t("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:4,borderRightWidth:$?1:0,borderRightColor:c.stroke.primary,borderRightStyle:"solid",paddingLeft:S?0:24,paddingRight:S?0:24,height:"100%",justifyContent:"space-between",alignItems:"center"},null!=W?W:{})},{children:[t("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=N?N:{})},{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e(y,Object.assign({style:{color:c.content.secondary}},{children:o})),w&&e(p,Object.assign({body:w,placement:"right",width:300},{children:e("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e(m,{color:c.content.primary,height:16,width:16})}))}))]})),t("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},I?{justifyContent:"space-between"}:{})},{children:[L&&e(a,{width:108,height:26}),!L&&e(V,Object.assign({style:{color:c.content.primary}},{children:void 0===l?"--":"number"==typeof l&&R?l>999?U?`${null!=D?D:""}${v(l)} ${null!=F?F:""}`:`${null!=D?D:""}${j(l)} ${null!=F?F:""}`:`${null!=D?D:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(l)} ${null!=F?F:""}`:`${null!=D?D:""}${l} ${null!=F?F:""}`})),"number"==typeof E&&e(h,{tagText:`${E}%`,theme:"light",type:"neutral"}),"horizontal"===d&&!L&&!I&&e(O,{timeline:g,customRange:u,percent:G,direction:q,trendRaw:P,prefixSymbol:D,trendIconStyle:_,isInternationalStore:U}),L&&!I&&"horizontal"===d&&e(a,{height:20,width:141,marginTop:6}),"vertical"===d&&!L&&void 0!==z&&e(h,{tagText:`${z} %`,theme:"light",type:"neutral"}),I&&!L&&void 0!==G&&e(h,{tagText:`${G} %`,theme:"light",type:"neutral"}),I||L||!B||0==B?e(i,{}):e(h,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(B),theme:"light",type:"neutral"})]})),"vertical"===d&&!L&&!I&&e("div",Object.assign({style:{marginTop:10}},{children:e(O,{timeline:g,customRange:u,percent:G,direction:q,trendRaw:P,prefixSymbol:D,trendIconStyle:_})})),L&&"vertical"===d&&e(a,{height:20,width:141,marginTop:6})]})),k&&!L&&e(p,Object.assign({body:k,placement:"right"},{children:C&&e("div",Object.assign({className:"icon--holder",onClick:M},{children:n.createElement(C,{height:20,width:20,color:c.content.secondary})}))}))]}))}))},O=i=>{let{percent:n,direction:a,timeline:m,customRange:h,trendRaw:p,prefixSymbol:y,trendIconStyle:f,isInternationalStore:b}=i;const x="negative"===a?d:g,w="negative"===a?c.background.negative.vibrant:"positive"===a?c.background.positive.vibrant:c.content.placeholder,[O,S]=r("");o((()=>{S("today"===m?"vs yesterday":"yesterday"===m?"vs 1 day before":"7 days"===m?"vs last 7 days":"30 days"===m?"vs last 30 days":"custom"===m&&h?s.getAnalyticsCustomDateTimelineText(h):"")}),[m,h]);const $=l((()=>{console.log("trendRaw",p);const e=((null!=p?p:0)>0?"+":"-")+(null!=y?y:""),t=void 0===p?"--":`${null!=e?e:""}${b?v(Math.abs(p)):j(Math.abs(p))}`;return console.log("trendRawTextInitial",t),t})());return t("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof n&&e(x,{color:w,height:16,width:16,style:Object.assign({marginRight:2},null!=f?f:{})}),"number"==typeof n&&a&&t(u,Object.assign({style:{color:w}},{children:["neutral"===a?0:n<1e3?n:">999","%"]})),!!p&&e(u,Object.assign({style:{marginLeft:4,color:c.content.placeholder}},{children:`(${$.current})`})),m&&e(u,Object.assign({style:{marginLeft:4,color:c.content.placeholder}},{children:O}))]}))};export{w as AnalyticsTrend};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.629-beta.23",
3
+ "version": "0.0.629-beta.24",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",