@bikdotai/bik-component-library 0.0.455-beta.12 → 0.0.455-beta.13
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("react/jsx-runtime"),t=require("react"),i=require("../../constants/Theme.js"),n=require("../../assets/icons/arrow_down.svg.js"),s=require("../../assets/icons/arrow_up.svg.js"),o=require("../../assets/icons/info.svg.js"),r=require("../tag/Tag.js"),l=require("../tooltips/Tooltip.js"),a=require("../TypographyStyle.js"),c=require("./CommonStyles.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=d(t);const u=o=>{let{percent:r,direction:l,timeline:c,customRange:d}=o;const g="negative"===l?n.default:s.default,u="negative"===l?i.COLORS.background.negative.vibrant:"positive"===l?i.COLORS.background.positive.vibrant:i.COLORS.content.placeholder,y=t.useCallback((()=>{if(console.log("storybook: getCustomDateRangeTimeLineText called"),!(null==d?void 0:d[0])
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("../../constants/Theme.js"),n=require("../../assets/icons/arrow_down.svg.js"),s=require("../../assets/icons/arrow_up.svg.js"),o=require("../../assets/icons/info.svg.js"),r=require("../tag/Tag.js"),l=require("../tooltips/Tooltip.js"),a=require("../TypographyStyle.js"),c=require("./CommonStyles.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=d(t);const u=o=>{let{percent:r,direction:l,timeline:c,customRange:d}=o;const g="negative"===l?n.default:s.default,u="negative"===l?i.COLORS.background.negative.vibrant:"positive"===l?i.COLORS.background.positive.vibrant:i.COLORS.content.placeholder,y=t.useCallback((()=>{if(console.log("storybook: getCustomDateRangeTimeLineText called"),!(null==d?void 0:d[0])||!(null==d?void 0:d[1]))return"";const e=new Date("string"==typeof d[0]?new Date(d[0]).getTime():d[0].getTime()),t=new Date("string"==typeof d[1]?new Date(d[1]).getTime():d[1].getTime());console.log("storybook: start - ",e),console.log("storybook: end - ",t);const i=864e5,n=Math.floor((t.getTime()-e.getTime())/i),s=new Date(e.getTime()-864e5),o=`${s.toLocaleString("default",{month:"short"})} ${s.getDate()}`,r=new Date(s.getTime()-n*i);return`vs ${`${r.toLocaleString("default",{month:"short"})} ${r.getDate()}`} - ${o}`}),[null==d?void 0:d[0],null==d?void 0:d[1]]),h="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&&d?`${y()}`:"";return e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row"}},{children:["number"==typeof r&&e.jsx(g,{color:u,height:20,width:20,style:{marginRight:2}}),"number"==typeof r&&l&&e.jsxs(a.TitleSmall,Object.assign({style:{color:u}},{children:["neutral"===l?0:r,"%"]})),c&&e.jsx(a.Caption,Object.assign({style:{marginLeft:4,color:i.COLORS.content.placeholder}},{children:h}))]}))};exports.AnalyticsTrend=t=>{let{title:n,value:s,trendPercent:d,type:y="horizontal",timeline:h,customRange:m,tooltip:p,card:j=!0,rightSeparator:b=!1,size:v="big",share:f=!1,formatVal:x,prefixSymbol:O,trailingIcon:T,onTrailIconClick:w,iconTooltipBody:C}=t;const R="big"===v?a.TitleLarge:a.TitleMedium,S=void 0!==d?d<0?"negative":0===d?"neutral":"positive":void 0,L=void 0!==d?f?Math.round(d):Math.abs(Math.round(d)):void 0;return e.jsx(c.AnalyticsTrendContainer,Object.assign({card:j},{children:e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,borderRightWidth:b?1:0,borderRightColor:i.COLORS.stroke.primary,borderRightStyle:"solid",paddingLeft:j?0:24,paddingRight:j?0:24,height:"100%",justifyContent:"space-between",alignItems:"center"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:4,height:"100%"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsx(a.BodySecondary,Object.assign({style:{color:i.COLORS.content.secondary}},{children:n})),p&&e.jsx(l.Tooltip,Object.assign({body:p,placement:"right",width:300},{children:e.jsx("div",Object.assign({style:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:e.jsx(o.default,{color:i.COLORS.content.inactive,height:16,width:16})}))}))]})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},f?{justifyContent:"space-between"}:{})},{children:[e.jsx(R,Object.assign({style:{color:i.COLORS.content.primary}},{children:void 0===s?"--":"number"==typeof s&&x?`${null!=O?O:""}${new Intl.NumberFormat("en-IN",{}).format(s)}`:`${null!=O?O:""}${s}`})),"horizontal"===y&&!f&&e.jsx(u,{timeline:h,customRange:m,percent:L,direction:S}),f&&void 0!==L&&e.jsx(r.Tag,{tagText:`${L} %`,theme:"light",type:"neutral"})]})),"vertical"===y&&!f&&e.jsx("div",Object.assign({style:{marginTop:12}},{children:e.jsx(u,{timeline:h,customRange:m,percent:L,direction:S})}))]})),C&&e.jsx(l.Tooltip,Object.assign({body:C,placement:"right"},{children:T&&e.jsx("div",Object.assign({className:"icon--holder",onClick:w},{children:g.default.createElement(T,{height:20,width:20,color:i.COLORS.content.secondary})}))}))]}))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import i,{useCallback as o}from"react";import{COLORS as n}from"../../constants/Theme.js";import r from"../../assets/icons/arrow_down.svg.js";import s from"../../assets/icons/arrow_up.svg.js";import l from"../../assets/icons/info.svg.js";import{Tag as a}from"../tag/Tag.js";import{Tooltip as c}from"../tooltips/Tooltip.js";import{BodySecondary as d,TitleSmall as g,Caption as m,TitleLarge as h,TitleMedium as p}from"../TypographyStyle.js";import{AnalyticsTrendContainer as y}from"./CommonStyles.js";const b=o=>{let{title:r,value:s,trendPercent:g,type:m="horizontal",timeline:b,customRange:v,tooltip:u,card:j=!0,rightSeparator:w=!1,size:T="big",share:x=!1,formatVal:O,prefixSymbol:D,trailingIcon:$,onTrailIconClick:R,iconTooltipBody:I}=o;const k="big"===T?h:p,C=void 0!==g?g<0?"negative":0===g?"neutral":"positive":void 0,S=void 0!==g?x?Math.round(g):Math.abs(Math.round(g)):void 0;return e(y,Object.assign({card:j},{children:t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,borderRightWidth:w?1:0,borderRightColor:n.stroke.primary,borderRightStyle:"solid",paddingLeft:j?0:24,paddingRight:j?0:24,height:"100%",justifyContent:"space-between",alignItems:"center"}},{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:4,height:"100%"}},{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e(d,Object.assign({style:{color:n.content.secondary}},{children:r})),u&&e(c,Object.assign({body:u,placement:"right",width:300},{children:e("div",Object.assign({style:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:e(l,{color:n.content.inactive,height:16,width:16})}))}))]})),t("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},x?{justifyContent:"space-between"}:{})},{children:[e(k,Object.assign({style:{color:n.content.primary}},{children:void 0===s?"--":"number"==typeof s&&O?`${null!=D?D:""}${new Intl.NumberFormat("en-IN",{}).format(s)}`:`${null!=D?D:""}${s}`})),"horizontal"===m&&!x&&e(f,{timeline:b,customRange:v,percent:S,direction:C}),x&&void 0!==S&&e(a,{tagText:`${S} %`,theme:"light",type:"neutral"})]})),"vertical"===m&&!x&&e("div",Object.assign({style:{marginTop:12}},{children:e(f,{timeline:b,customRange:v,percent:S,direction:C})}))]})),I&&e(c,Object.assign({body:I,placement:"right"},{children:$&&e("div",Object.assign({className:"icon--holder",onClick:R},{children:i.createElement($,{height:20,width:20,color:n.content.secondary})}))}))]}))}))},f=i=>{let{percent:l,direction:a,timeline:c,customRange:d}=i;const h="negative"===a?r:s,p="negative"===a?n.background.negative.vibrant:"positive"===a?n.background.positive.vibrant:n.content.placeholder,y=o((()=>{if(console.log("storybook: getCustomDateRangeTimeLineText called"),!(null==d?void 0:d[0])
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import i,{useCallback as o}from"react";import{COLORS as n}from"../../constants/Theme.js";import r from"../../assets/icons/arrow_down.svg.js";import s from"../../assets/icons/arrow_up.svg.js";import l from"../../assets/icons/info.svg.js";import{Tag as a}from"../tag/Tag.js";import{Tooltip as c}from"../tooltips/Tooltip.js";import{BodySecondary as d,TitleSmall as g,Caption as m,TitleLarge as h,TitleMedium as p}from"../TypographyStyle.js";import{AnalyticsTrendContainer as y}from"./CommonStyles.js";const b=o=>{let{title:r,value:s,trendPercent:g,type:m="horizontal",timeline:b,customRange:v,tooltip:u,card:j=!0,rightSeparator:w=!1,size:T="big",share:x=!1,formatVal:O,prefixSymbol:D,trailingIcon:$,onTrailIconClick:R,iconTooltipBody:I}=o;const k="big"===T?h:p,C=void 0!==g?g<0?"negative":0===g?"neutral":"positive":void 0,S=void 0!==g?x?Math.round(g):Math.abs(Math.round(g)):void 0;return e(y,Object.assign({card:j},{children:t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,borderRightWidth:w?1:0,borderRightColor:n.stroke.primary,borderRightStyle:"solid",paddingLeft:j?0:24,paddingRight:j?0:24,height:"100%",justifyContent:"space-between",alignItems:"center"}},{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:4,height:"100%"}},{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e(d,Object.assign({style:{color:n.content.secondary}},{children:r})),u&&e(c,Object.assign({body:u,placement:"right",width:300},{children:e("div",Object.assign({style:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:e(l,{color:n.content.inactive,height:16,width:16})}))}))]})),t("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},x?{justifyContent:"space-between"}:{})},{children:[e(k,Object.assign({style:{color:n.content.primary}},{children:void 0===s?"--":"number"==typeof s&&O?`${null!=D?D:""}${new Intl.NumberFormat("en-IN",{}).format(s)}`:`${null!=D?D:""}${s}`})),"horizontal"===m&&!x&&e(f,{timeline:b,customRange:v,percent:S,direction:C}),x&&void 0!==S&&e(a,{tagText:`${S} %`,theme:"light",type:"neutral"})]})),"vertical"===m&&!x&&e("div",Object.assign({style:{marginTop:12}},{children:e(f,{timeline:b,customRange:v,percent:S,direction:C})}))]})),I&&e(c,Object.assign({body:I,placement:"right"},{children:$&&e("div",Object.assign({className:"icon--holder",onClick:R},{children:i.createElement($,{height:20,width:20,color:n.content.secondary})}))}))]}))}))},f=i=>{let{percent:l,direction:a,timeline:c,customRange:d}=i;const h="negative"===a?r:s,p="negative"===a?n.background.negative.vibrant:"positive"===a?n.background.positive.vibrant:n.content.placeholder,y=o((()=>{if(console.log("storybook: getCustomDateRangeTimeLineText called"),!(null==d?void 0:d[0])||!(null==d?void 0:d[1]))return"";const e=new Date("string"==typeof d[0]?new Date(d[0]).getTime():d[0].getTime()),t=new Date("string"==typeof d[1]?new Date(d[1]).getTime():d[1].getTime());console.log("storybook: start - ",e),console.log("storybook: end - ",t);const i=864e5,o=Math.floor((t.getTime()-e.getTime())/i),n=new Date(e.getTime()-864e5),r=`${n.toLocaleString("default",{month:"short"})} ${n.getDate()}`,s=new Date(n.getTime()-o*i);return`vs ${`${s.toLocaleString("default",{month:"short"})} ${s.getDate()}`} - ${r}`}),[null==d?void 0:d[0],null==d?void 0:d[1]]),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&&d?`${y()}`:"";return t("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row"}},{children:["number"==typeof l&&e(h,{color:p,height:20,width:20,style:{marginRight:2}}),"number"==typeof l&&a&&t(g,Object.assign({style:{color:p}},{children:["neutral"===a?0:l,"%"]})),c&&e(m,Object.assign({style:{marginLeft:4,color:n.content.placeholder}},{children:b}))]}))};export{b as AnalyticsTrend};
|