@bikdotai/bik-component-library 0.0.718-beta.5 → 0.0.718-beta.6
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.
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react"),n=require("../shimmer/ShimmerComponent/ShimmerStyled.js"),i=require("../../utils/DateUtils.js"),s=require("../../constants/Theme.js"),r=require("../../assets/icons/arrow_down.svg.js"),o=require("../../assets/icons/arrow_up.svg.js"),a=require("../../assets/icons/info.svg.js"),l=require("../tag/Tag.js"),c=require("../tooltips/Tooltip.js"),d=require("../TypographyStyle.js"),u=require("./chart/utils/calcPercentage.js"),x=require("./CommonStyles.js");function j(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=j(t);const p=n=>{let{percent:a,direction:l,timeline:c,customRange:x,trendRaw:j,trendRawString:m,prefixSymbol:p,trendIconStyle:g,isInternationalStore:h}=n;const y=()=>{const e=((null!=j?j:0)>0?"+":"")+(null!=p?p:"");return void 0===j?"--":`${null!=e?e:""}${(()=>{let e="--";if(j)return e=String(h?u.truncateValueForInternationalStore(Math.abs(j)):u.truncateValueForIndianStore(Math.abs(j))),j<0?"-"+e:e})()}`},[R,b]=t.useState(y()),[f,S]=t.useState("");t.useEffect((()=>{S("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&&x?i.default.getAnalyticsCustomDateTimelineText(x):"")}),[c,x]),t.useEffect((()=>{b(y())}),[j]);const O="negative"===l?r.default:o.default,v="negative"===l?s.COLORS.background.negative.vibrant:"positive"===l?s.COLORS.background.positive.vibrant:s.COLORS.content.placeholder;return e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof a&&e.jsxRuntimeExports.jsx(O,{color:v,height:16,width:16,style:Object.assign({marginRight:2},null!=g?g:{})}),"number"==typeof a&&l&&e.jsxRuntimeExports.jsxs(d.Caption,Object.assign({style:{color:v}},{children:["neutral"===l?0:a<1e3?a:">999","%"]})),!!j&&e.jsxRuntimeExports.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:`(${R})`})),!j&&((null==m?void 0:m.length)||0)>0&&e.jsxRuntimeExports.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react"),n=require("../shimmer/ShimmerComponent/ShimmerStyled.js"),i=require("../../utils/DateUtils.js"),s=require("../../constants/Theme.js"),r=require("../../assets/icons/arrow_down.svg.js"),o=require("../../assets/icons/arrow_up.svg.js"),a=require("../../assets/icons/info.svg.js"),l=require("../tag/Tag.js"),c=require("../tooltips/Tooltip.js"),d=require("../TypographyStyle.js"),u=require("./chart/utils/calcPercentage.js"),x=require("./CommonStyles.js");function j(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=j(t);const p=n=>{let{percent:a,direction:l,timeline:c,customRange:x,trendRaw:j,trendRawString:m,prefixSymbol:p,trendIconStyle:g,isInternationalStore:h}=n;const y=()=>{const e=((null!=j?j:0)>0?"+":"")+(null!=p?p:"");return void 0===j?"--":`${null!=e?e:""}${(()=>{let e="--";if(j)return e=String(h?u.truncateValueForInternationalStore(Math.abs(j)):u.truncateValueForIndianStore(Math.abs(j))),j<0?"-"+e:e})()}`},[R,b]=t.useState(y()),[f,S]=t.useState("");t.useEffect((()=>{S("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&&x?i.default.getAnalyticsCustomDateTimelineText(x):"")}),[c,x]),t.useEffect((()=>{b(y())}),[j]);const O="negative"===l?r.default:o.default,v="negative"===l?s.COLORS.background.negative.vibrant:"positive"===l?s.COLORS.background.positive.vibrant:s.COLORS.content.placeholder;return e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof a&&e.jsxRuntimeExports.jsx(O,{color:v,height:16,width:16,style:Object.assign({marginRight:2},null!=g?g:{})}),"number"==typeof a&&l&&e.jsxRuntimeExports.jsxs(d.Caption,Object.assign({style:{color:v}},{children:["neutral"===l?0:a<1e3?a:">999","%"]})),!!j&&e.jsxRuntimeExports.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:`(${R})`})),!j&&((null==m?void 0:m.length)||0)>0&&e.jsxRuntimeExports.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:`${m}`})),c&&e.jsxRuntimeExports.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:f}))]}))};exports.AnalyticsTrend=t=>{let{title:i,value:r,trendPercent:o,type:j="horizontal",timeline:g,customRange:h,tooltip:y,card:R=!0,rightSeparator:b=!1,size:f="big",share:S=!1,formatVal:O,prefixSymbol:v,trailingIcon:E,onTrailIconClick:C,iconTooltipBody:T,funnelPercent:w,isLoading:I,trendRaw:$,trendRawString:L,suffixText:q,trendStyle:D,trendContainerStyle:F,trendIconStyle:M,containerStyle:k,prevTrendDiff:P,relativePercentageDiff:V,isInternationalStore:_,Icon:z,iconContainerStyle:A}=t;const N="big"===f?d.TitleLarge:d.TitleMedium,B=void 0!==o?o<0?"negative":0===o?"neutral":"positive":void 0,W=void 0!==o?S?Math.round(o):Math.abs(Math.round(o)):void 0;return e.jsxRuntimeExports.jsx(x.AnalyticsTrendContainer,Object.assign({card:R,style:Object.assign({},k)},{children:e.jsxRuntimeExports.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:z?12:4,borderRightWidth:b?1:0,borderRightColor:s.COLORS.stroke.primary,borderRightStyle:"solid",paddingLeft:R?0:24,paddingRight:R?0:24,height:"100%",justifyContent:z?"flex-start":"space-between",alignItems:"center"},null!=F?F:{})},{children:[!!z&&e.jsxRuntimeExports.jsx(x.IconContainer,Object.assign({style:Object.assign({},A)},{children:e.jsxRuntimeExports.jsx(z,{})})),e.jsxRuntimeExports.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=D?D:{})},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsxRuntimeExports.jsx(d.BodyCaption,Object.assign({style:{color:s.COLORS.content.secondary}},{children:i})),y&&e.jsxRuntimeExports.jsx(c.Tooltip,Object.assign({body:y,placement:"right",width:300},{children:e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e.jsxRuntimeExports.jsx(a.default,{color:s.COLORS.content.primary,height:16,width:16})}))}))]})),e.jsxRuntimeExports.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},S?{justifyContent:"space-between"}:{})},{children:[I&&e.jsxRuntimeExports.jsx(n.ShimmerComponentStyled,{width:108,height:26}),!I&&e.jsxRuntimeExports.jsx(N,Object.assign({style:{color:s.COLORS.content.primary}},{children:void 0===r?"--":"number"==typeof r&&O?r>999?_?`${null!=v?v:""}${u.truncateValueForInternationalStore(r)} ${null!=q?q:""}`:`${null!=v?v:""}${u.truncateValueForIndianStore(r)} ${null!=q?q:""}`:`${null!=v?v:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(r)} ${null!=q?q:""}`:`${null!=v?v:""}${r} ${null!=q?q:""}`})),"number"==typeof V&&e.jsxRuntimeExports.jsx(l.Tag,{tagText:`${V}%`,theme:"light",type:"neutral"}),"horizontal"===j&&!I&&!S&&e.jsxRuntimeExports.jsx(p,{timeline:g,customRange:h,percent:W,direction:B,trendRaw:$,trendRawString:L,prefixSymbol:v,trendIconStyle:M,isInternationalStore:_}),I&&!S&&"horizontal"===j&&e.jsxRuntimeExports.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6}),"vertical"===j&&!I&&void 0!==w&&e.jsxRuntimeExports.jsx(l.Tag,{tagText:`${w} %`,theme:"light",type:"neutral"}),S&&!I&&void 0!==W&&e.jsxRuntimeExports.jsx(l.Tag,{tagText:`${W} %`,theme:"light",type:"neutral"}),S||I||!P||0==P?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}):e.jsxRuntimeExports.jsx(l.Tag,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(P),theme:"light",type:"neutral"})]})),"vertical"===j&&!I&&!S&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsxRuntimeExports.jsx(p,{timeline:g,customRange:h,percent:W,direction:B,trendRaw:$,trendRawString:L,prefixSymbol:v,trendIconStyle:M,isInternationalStore:_})})),I&&"vertical"===j&&e.jsxRuntimeExports.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6})]})),T&&!I&&e.jsxRuntimeExports.jsx(c.Tooltip,Object.assign({body:T,placement:"right"},{children:E&&e.jsxRuntimeExports.jsx("div",Object.assign({className:"icon--holder",onClick:C},{children:m.default.createElement(E,{height:20,width:20,color:s.COLORS.content.secondary})}))}))]}))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"../../node_modules/react/jsx-runtime.js";import t,{useState as n,useEffect as i}from"react";import{ShimmerComponentStyled as r}from"../shimmer/ShimmerComponent/ShimmerStyled.js";import s from"../../utils/DateUtils.js";import{COLORS as o}from"../../constants/Theme.js";import l from"../../assets/icons/arrow_down.svg.js";import a from"../../assets/icons/arrow_up.svg.js";import c from"../../assets/icons/info.svg.js";import{Tag as d}from"../tag/Tag.js";import{Tooltip as g}from"../tooltips/Tooltip.js";import{BodyCaption as m,Caption as h,TitleLarge as p,TitleMedium as j}from"../TypographyStyle.js";import{truncateValueForInternationalStore as y,truncateValueForIndianStore as x}from"./chart/utils/calcPercentage.js";import{AnalyticsTrendContainer as u,IconContainer as f}from"./CommonStyles.js";const b=n=>{let{title:i,value:s,trendPercent:l,type:a="horizontal",timeline:h,customRange:b,tooltip:S,card:w=!0,rightSeparator:O=!1,size:$="big",share:I=!1,formatVal:R,prefixSymbol:T,trailingIcon:C,onTrailIconClick:D,iconTooltipBody:M,funnelPercent:k,isLoading:L,trendRaw:z,trendRawString:F,suffixText:P,trendStyle:N,trendContainerStyle:_,trendIconStyle:W,containerStyle:A,prevTrendDiff:B,relativePercentageDiff:E,isInternationalStore:U,Icon:V,iconContainerStyle:q}=n;const G="big"===$?p:j,H=void 0!==l?l<0?"negative":0===l?"neutral":"positive":void 0,J=void 0!==l?I?Math.round(l):Math.abs(Math.round(l)):void 0;return e.jsx(u,Object.assign({card:w,style:Object.assign({},A)},{children:e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:V?12:4,borderRightWidth:O?1:0,borderRightColor:o.stroke.primary,borderRightStyle:"solid",paddingLeft:w?0:24,paddingRight:w?0:24,height:"100%",justifyContent:V?"flex-start":"space-between",alignItems:"center"},null!=_?_:{})},{children:[!!V&&e.jsx(f,Object.assign({style:Object.assign({},q)},{children:e.jsx(V,{})})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=N?N:{})},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsx(m,Object.assign({style:{color:o.content.secondary}},{children:i})),S&&e.jsx(g,Object.assign({body:S,placement:"right",width:300},{children:e.jsx("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e.jsx(c,{color:o.content.primary,height:16,width:16})}))}))]})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},I?{justifyContent:"space-between"}:{})},{children:[L&&e.jsx(r,{width:108,height:26}),!L&&e.jsx(G,Object.assign({style:{color:o.content.primary}},{children:void 0===s?"--":"number"==typeof s&&R?s>999?U?`${null!=T?T:""}${y(s)} ${null!=P?P:""}`:`${null!=T?T:""}${x(s)} ${null!=P?P:""}`:`${null!=T?T:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(s)} ${null!=P?P:""}`:`${null!=T?T:""}${s} ${null!=P?P:""}`})),"number"==typeof E&&e.jsx(d,{tagText:`${E}%`,theme:"light",type:"neutral"}),"horizontal"===a&&!L&&!I&&e.jsx(v,{timeline:h,customRange:b,percent:J,direction:H,trendRaw:z,trendRawString:F,prefixSymbol:T,trendIconStyle:W,isInternationalStore:U}),L&&!I&&"horizontal"===a&&e.jsx(r,{height:20,width:141,marginTop:6}),"vertical"===a&&!L&&void 0!==k&&e.jsx(d,{tagText:`${k} %`,theme:"light",type:"neutral"}),I&&!L&&void 0!==J&&e.jsx(d,{tagText:`${J} %`,theme:"light",type:"neutral"}),I||L||!B||0==B?e.jsx(e.Fragment,{}):e.jsx(d,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(B),theme:"light",type:"neutral"})]})),"vertical"===a&&!L&&!I&&e.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsx(v,{timeline:h,customRange:b,percent:J,direction:H,trendRaw:z,trendRawString:F,prefixSymbol:T,trendIconStyle:W,isInternationalStore:U})})),L&&"vertical"===a&&e.jsx(r,{height:20,width:141,marginTop:6})]})),M&&!L&&e.jsx(g,Object.assign({body:M,placement:"right"},{children:C&&e.jsx("div",Object.assign({className:"icon--holder",onClick:D},{children:t.createElement(C,{height:20,width:20,color:o.content.secondary})}))}))]}))}))},v=t=>{let{percent:r,direction:c,timeline:d,customRange:g,trendRaw:m,trendRawString:p,prefixSymbol:j,trendIconStyle:u,isInternationalStore:f}=t;const b=()=>{const e=((null!=m?m:0)>0?"+":"")+(null!=j?j:"");return void 0===m?"--":`${null!=e?e:""}${(()=>{let e="--";if(m)return e=String(f?y(Math.abs(m)):x(Math.abs(m))),m<0?"-"+e:e})()}`},[v,S]=n(b()),[w,O]=n("");i((()=>{O("today"===d?"vs yesterday":"yesterday"===d?"vs 1 day before":"7 days"===d?"vs last 7 days":"30 days"===d?"vs last 30 days":"custom"===d&&g?s.getAnalyticsCustomDateTimelineText(g):"")}),[d,g]),i((()=>{S(b())}),[m]);const $="negative"===c?l:a,I="negative"===c?o.background.negative.vibrant:"positive"===c?o.background.positive.vibrant:o.content.placeholder;return e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof r&&e.jsx($,{color:I,height:16,width:16,style:Object.assign({marginRight:2},null!=u?u:{})}),"number"==typeof r&&c&&e.jsxs(h,Object.assign({style:{color:I}},{children:["neutral"===c?0:r<1e3?r:">999","%"]})),!!m&&e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:`(${v})`})),!m&&((null==p?void 0:p.length)||0)>0&&e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children
|
|
1
|
+
import{j as e}from"../../node_modules/react/jsx-runtime.js";import t,{useState as n,useEffect as i}from"react";import{ShimmerComponentStyled as r}from"../shimmer/ShimmerComponent/ShimmerStyled.js";import s from"../../utils/DateUtils.js";import{COLORS as o}from"../../constants/Theme.js";import l from"../../assets/icons/arrow_down.svg.js";import a from"../../assets/icons/arrow_up.svg.js";import c from"../../assets/icons/info.svg.js";import{Tag as d}from"../tag/Tag.js";import{Tooltip as g}from"../tooltips/Tooltip.js";import{BodyCaption as m,Caption as h,TitleLarge as p,TitleMedium as j}from"../TypographyStyle.js";import{truncateValueForInternationalStore as y,truncateValueForIndianStore as x}from"./chart/utils/calcPercentage.js";import{AnalyticsTrendContainer as u,IconContainer as f}from"./CommonStyles.js";const b=n=>{let{title:i,value:s,trendPercent:l,type:a="horizontal",timeline:h,customRange:b,tooltip:S,card:w=!0,rightSeparator:O=!1,size:$="big",share:I=!1,formatVal:R,prefixSymbol:T,trailingIcon:C,onTrailIconClick:D,iconTooltipBody:M,funnelPercent:k,isLoading:L,trendRaw:z,trendRawString:F,suffixText:P,trendStyle:N,trendContainerStyle:_,trendIconStyle:W,containerStyle:A,prevTrendDiff:B,relativePercentageDiff:E,isInternationalStore:U,Icon:V,iconContainerStyle:q}=n;const G="big"===$?p:j,H=void 0!==l?l<0?"negative":0===l?"neutral":"positive":void 0,J=void 0!==l?I?Math.round(l):Math.abs(Math.round(l)):void 0;return e.jsx(u,Object.assign({card:w,style:Object.assign({},A)},{children:e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:V?12:4,borderRightWidth:O?1:0,borderRightColor:o.stroke.primary,borderRightStyle:"solid",paddingLeft:w?0:24,paddingRight:w?0:24,height:"100%",justifyContent:V?"flex-start":"space-between",alignItems:"center"},null!=_?_:{})},{children:[!!V&&e.jsx(f,Object.assign({style:Object.assign({},q)},{children:e.jsx(V,{})})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=N?N:{})},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsx(m,Object.assign({style:{color:o.content.secondary}},{children:i})),S&&e.jsx(g,Object.assign({body:S,placement:"right",width:300},{children:e.jsx("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e.jsx(c,{color:o.content.primary,height:16,width:16})}))}))]})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},I?{justifyContent:"space-between"}:{})},{children:[L&&e.jsx(r,{width:108,height:26}),!L&&e.jsx(G,Object.assign({style:{color:o.content.primary}},{children:void 0===s?"--":"number"==typeof s&&R?s>999?U?`${null!=T?T:""}${y(s)} ${null!=P?P:""}`:`${null!=T?T:""}${x(s)} ${null!=P?P:""}`:`${null!=T?T:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(s)} ${null!=P?P:""}`:`${null!=T?T:""}${s} ${null!=P?P:""}`})),"number"==typeof E&&e.jsx(d,{tagText:`${E}%`,theme:"light",type:"neutral"}),"horizontal"===a&&!L&&!I&&e.jsx(v,{timeline:h,customRange:b,percent:J,direction:H,trendRaw:z,trendRawString:F,prefixSymbol:T,trendIconStyle:W,isInternationalStore:U}),L&&!I&&"horizontal"===a&&e.jsx(r,{height:20,width:141,marginTop:6}),"vertical"===a&&!L&&void 0!==k&&e.jsx(d,{tagText:`${k} %`,theme:"light",type:"neutral"}),I&&!L&&void 0!==J&&e.jsx(d,{tagText:`${J} %`,theme:"light",type:"neutral"}),I||L||!B||0==B?e.jsx(e.Fragment,{}):e.jsx(d,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(B),theme:"light",type:"neutral"})]})),"vertical"===a&&!L&&!I&&e.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsx(v,{timeline:h,customRange:b,percent:J,direction:H,trendRaw:z,trendRawString:F,prefixSymbol:T,trendIconStyle:W,isInternationalStore:U})})),L&&"vertical"===a&&e.jsx(r,{height:20,width:141,marginTop:6})]})),M&&!L&&e.jsx(g,Object.assign({body:M,placement:"right"},{children:C&&e.jsx("div",Object.assign({className:"icon--holder",onClick:D},{children:t.createElement(C,{height:20,width:20,color:o.content.secondary})}))}))]}))}))},v=t=>{let{percent:r,direction:c,timeline:d,customRange:g,trendRaw:m,trendRawString:p,prefixSymbol:j,trendIconStyle:u,isInternationalStore:f}=t;const b=()=>{const e=((null!=m?m:0)>0?"+":"")+(null!=j?j:"");return void 0===m?"--":`${null!=e?e:""}${(()=>{let e="--";if(m)return e=String(f?y(Math.abs(m)):x(Math.abs(m))),m<0?"-"+e:e})()}`},[v,S]=n(b()),[w,O]=n("");i((()=>{O("today"===d?"vs yesterday":"yesterday"===d?"vs 1 day before":"7 days"===d?"vs last 7 days":"30 days"===d?"vs last 30 days":"custom"===d&&g?s.getAnalyticsCustomDateTimelineText(g):"")}),[d,g]),i((()=>{S(b())}),[m]);const $="negative"===c?l:a,I="negative"===c?o.background.negative.vibrant:"positive"===c?o.background.positive.vibrant:o.content.placeholder;return e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof r&&e.jsx($,{color:I,height:16,width:16,style:Object.assign({marginRight:2},null!=u?u:{})}),"number"==typeof r&&c&&e.jsxs(h,Object.assign({style:{color:I}},{children:["neutral"===c?0:r<1e3?r:">999","%"]})),!!m&&e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:`(${v})`})),!m&&((null==p?void 0:p.length)||0)>0&&e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:`${p}`})),d&&e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:w}))]}))};export{b as AnalyticsTrend};
|