@bikdotai/bik-component-library 0.0.177 → 0.0.178

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/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @boilertown/react-ui-boilerplate
2
+
3
+ ## 0.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 93e5422: First release ever!
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../constants/Theme.js"),i=require("../../assets/icons/arrow_down.svg.js"),s=require("../../assets/icons/arrow_up.svg.js"),r=require("../../assets/icons/info.svg.js"),n=require("../tag/Tag.js"),a=require("../template-context-mapper/utils/getFormattedMonthDate.js"),o=require("../tooltips/Tooltip.js"),l=require("../TypographyStyle.js"),c=require("./CommonStyles.js");const d=r=>{let{percent:n,direction:o,timeline:c,customRange:d}=r;const g="negative"===o?i.default:s.default,y="negative"===o?t.COLORS.background.negative.vibrant:"positive"===o?t.COLORS.background.positive.vibrant:t.COLORS.content.placeholder,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?(()=>{if(!d)return"";const e=Math.abs(d[1].getTime()-d[0].getTime()),t=Math.ceil(e/864e5),i=d[0].getTime()-864e5,s=d[0].getTime()-1e3*t*3600*24,r=new Date(s),n=new Date(i);return`vs ${a.getFormattedMonthDate(r)} - ${a.getFormattedMonthDate(n)}`})():"";return e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row"}},{children:["number"==typeof n&&e.jsx(g,{color:y,height:20,width:20,style:{marginRight:2}}),"number"==typeof n&&o&&e.jsxs(l.TitleSmall,Object.assign({style:{color:y}},{children:["neutral"===o?0:n,"%"]})),c&&e.jsx(l.Caption,Object.assign({style:{marginLeft:4,color:t.COLORS.content.placeholder}},{children:h}))]}))};exports.AnalyticsTrend=i=>{let{title:s,value:a,trendPercent:g,type:y="horizontal",timeline:h,customRange:u,tooltip:p,card:m=!0,rightSeparator:j=!1,size:v="big",share:b=!1,formatVal:x,prefixSymbol:O}=i;const f="big"===v?l.TitleLarge:l.TitleMedium,R=void 0!==g?g<0?"negative":0===g?"neutral":"positive":void 0,T=void 0!==g?b?Math.round(g):Math.abs(Math.round(g)):void 0;return e.jsx(c.AnalyticsTrendContainer,Object.assign({card:m},{children:e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:4,borderRightWidth:j?1:0,borderRightColor:t.COLORS.stroke.primary,borderRightStyle:"solid",paddingLeft:m?0:24,paddingRight:m?0:24,height:"100%"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsx(l.BodySecondary,Object.assign({style:{color:t.COLORS.content.secondary}},{children:s})),p&&e.jsx(o.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(r.default,{color:t.COLORS.content.inactive,height:16,width:16})}))}))]})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},b?{justifyContent:"space-between"}:{})},{children:[e.jsx(f,Object.assign({style:{color:t.COLORS.content.primary}},{children:void 0===a?"--":"number"==typeof a&&x?`${null!=O?O:""}${new Intl.NumberFormat("en-IN",{}).format(a)}`:`${null!=O?O:""}${a}`})),"horizontal"===y&&!b&&e.jsx(d,{timeline:h,customRange:u,percent:T,direction:R}),b&&void 0!==T&&e.jsx(n.Tag,{tagText:`${T} %`,theme:"light",type:"neutral"})]})),"vertical"===y&&!b&&e.jsx("div",Object.assign({style:{marginTop:12}},{children:e.jsx(d,{timeline:h,customRange:u,percent:T,direction:R})}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../constants/Theme.js"),i=require("../../assets/icons/arrow_down.svg.js"),s=require("../../assets/icons/arrow_up.svg.js"),r=require("../../assets/icons/info.svg.js"),n=require("../tag/Tag.js"),a=require("../template-context-mapper/utils/getFormattedMonthDate.js"),o=require("../tooltips/Tooltip.js"),l=require("../TypographyStyle.js"),c=require("./CommonStyles.js");const d=r=>{let{percent:n,direction:o,timeline:c,customRange:d}=r;const g="negative"===o?i.default:s.default,y="negative"===o?t.COLORS.background.negative.vibrant:"positive"===o?t.COLORS.background.positive.vibrant:t.COLORS.content.placeholder,p="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?`vs ${a.getFormattedMonthDate(d[0])} - ${a.getFormattedMonthDate(d[1])}`:"";return e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row"}},{children:["number"==typeof n&&e.jsx(g,{color:y,height:20,width:20,style:{marginRight:2}}),"number"==typeof n&&o&&e.jsxs(l.TitleSmall,Object.assign({style:{color:y}},{children:["neutral"===o?0:n,"%"]})),c&&e.jsx(l.Caption,Object.assign({style:{marginLeft:4,color:t.COLORS.content.placeholder}},{children:p}))]}))};exports.AnalyticsTrend=i=>{let{title:s,value:a,trendPercent:g,type:y="horizontal",timeline:p,customRange:h,tooltip:u,card:j=!0,rightSeparator:m=!1,size:v="big",share:b=!1,formatVal:x,prefixSymbol:O}=i;const f="big"===v?l.TitleLarge:l.TitleMedium,R=void 0!==g?g<0?"negative":0===g?"neutral":"positive":void 0,S=void 0!==g?b?Math.round(g):Math.abs(Math.round(g)):void 0;return e.jsx(c.AnalyticsTrendContainer,Object.assign({card:j},{children:e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:4,borderRightWidth:m?1:0,borderRightColor:t.COLORS.stroke.primary,borderRightStyle:"solid",paddingLeft:j?0:24,paddingRight:j?0:24,height:"100%"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsx(l.BodySecondary,Object.assign({style:{color:t.COLORS.content.secondary}},{children:s})),u&&e.jsx(o.Tooltip,Object.assign({body:u,placement:"right",width:300},{children:e.jsx("div",Object.assign({style:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:e.jsx(r.default,{color:t.COLORS.content.inactive,height:16,width:16})}))}))]})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},b?{justifyContent:"space-between"}:{})},{children:[e.jsx(f,Object.assign({style:{color:t.COLORS.content.primary}},{children:void 0===a?"--":"number"==typeof a&&x?`${null!=O?O:""}${new Intl.NumberFormat("en-IN",{}).format(a)}`:`${null!=O?O:""}${a}`})),"horizontal"===y&&!b&&e.jsx(d,{timeline:p,customRange:h,percent:S,direction:R}),b&&void 0!==S&&e.jsx(n.Tag,{tagText:`${S} %`,theme:"light",type:"neutral"})]})),"vertical"===y&&!b&&e.jsx("div",Object.assign({style:{marginTop:12}},{children:e.jsx(d,{timeline:p,customRange:h,percent:S,direction:R})}))]}))}))};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{COLORS as i}from"../../constants/Theme.js";import r from"../../assets/icons/arrow_down.svg.js";import n from"../../assets/icons/arrow_up.svg.js";import o from"../../assets/icons/info.svg.js";import{Tag as s}from"../tag/Tag.js";import{getFormattedMonthDate as a}from"../template-context-mapper/utils/getFormattedMonthDate.js";import{Tooltip as l}from"../tooltips/Tooltip.js";import{BodySecondary as c,TitleSmall as d,Caption as g,TitleLarge as m,TitleMedium as p}from"../TypographyStyle.js";import{AnalyticsTrendContainer as h}from"./CommonStyles.js";const y=r=>{let{title:n,value:a,trendPercent:d,type:g="horizontal",timeline:y,customRange:v,tooltip:f,card:u=!0,rightSeparator:j=!1,size:x="big",share:w=!1,formatVal:O,prefixSymbol:T}=r;const R="big"===x?m:p,D=void 0!==d?d<0?"negative":0===d?"neutral":"positive":void 0,$=void 0!==d?w?Math.round(d):Math.abs(Math.round(d)):void 0;return e(h,Object.assign({card:u},{children:t("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:4,borderRightWidth:j?1:0,borderRightColor:i.stroke.primary,borderRightStyle:"solid",paddingLeft:u?0:24,paddingRight:u?0:24,height:"100%"}},{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e(c,Object.assign({style:{color:i.content.secondary}},{children:n})),f&&e(l,Object.assign({body:f,placement:"right",width:300},{children:e("div",Object.assign({style:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:e(o,{color:i.content.inactive,height:16,width:16})}))}))]})),t("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},w?{justifyContent:"space-between"}:{})},{children:[e(R,Object.assign({style:{color:i.content.primary}},{children:void 0===a?"--":"number"==typeof a&&O?`${null!=T?T:""}${new Intl.NumberFormat("en-IN",{}).format(a)}`:`${null!=T?T:""}${a}`})),"horizontal"===g&&!w&&e(b,{timeline:y,customRange:v,percent:$,direction:D}),w&&void 0!==$&&e(s,{tagText:`${$} %`,theme:"light",type:"neutral"})]})),"vertical"===g&&!w&&e("div",Object.assign({style:{marginTop:12}},{children:e(b,{timeline:y,customRange:v,percent:$,direction:D})}))]}))}))},b=o=>{let{percent:s,direction:l,timeline:c,customRange:m}=o;const p="negative"===l?r:n,h="negative"===l?i.background.negative.vibrant:"positive"===l?i.background.positive.vibrant:i.content.placeholder,y="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&&m?(()=>{if(!m)return"";const e=Math.abs(m[1].getTime()-m[0].getTime()),t=Math.ceil(e/864e5),i=m[0].getTime()-864e5,r=m[0].getTime()-1e3*t*3600*24,n=new Date(r),o=new Date(i);return`vs ${a(n)} - ${a(o)}`})():"";return t("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row"}},{children:["number"==typeof s&&e(p,{color:h,height:20,width:20,style:{marginRight:2}}),"number"==typeof s&&l&&t(d,Object.assign({style:{color:h}},{children:["neutral"===l?0:s,"%"]})),c&&e(g,Object.assign({style:{marginLeft:4,color:i.content.placeholder}},{children:y}))]}))};export{y as AnalyticsTrend};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{COLORS as i}from"../../constants/Theme.js";import r from"../../assets/icons/arrow_down.svg.js";import o from"../../assets/icons/arrow_up.svg.js";import n from"../../assets/icons/info.svg.js";import{Tag as s}from"../tag/Tag.js";import{getFormattedMonthDate as a}from"../template-context-mapper/utils/getFormattedMonthDate.js";import{Tooltip as l}from"../tooltips/Tooltip.js";import{BodySecondary as c,TitleSmall as d,Caption as g,TitleLarge as m,TitleMedium as p}from"../TypographyStyle.js";import{AnalyticsTrendContainer as h}from"./CommonStyles.js";const y=r=>{let{title:o,value:a,trendPercent:d,type:g="horizontal",timeline:y,customRange:b,tooltip:f,card:u=!0,rightSeparator:j=!1,size:x="big",share:O=!1,formatVal:w,prefixSymbol:R}=r;const $="big"===x?m:p,I=void 0!==d?d<0?"negative":0===d?"neutral":"positive":void 0,T=void 0!==d?O?Math.round(d):Math.abs(Math.round(d)):void 0;return e(h,Object.assign({card:u},{children:t("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:4,borderRightWidth:j?1:0,borderRightColor:i.stroke.primary,borderRightStyle:"solid",paddingLeft:u?0:24,paddingRight:u?0:24,height:"100%"}},{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e(c,Object.assign({style:{color:i.content.secondary}},{children:o})),f&&e(l,Object.assign({body:f,placement:"right",width:300},{children:e("div",Object.assign({style:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:e(n,{color:i.content.inactive,height:16,width:16})}))}))]})),t("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},O?{justifyContent:"space-between"}:{})},{children:[e($,Object.assign({style:{color:i.content.primary}},{children:void 0===a?"--":"number"==typeof a&&w?`${null!=R?R:""}${new Intl.NumberFormat("en-IN",{}).format(a)}`:`${null!=R?R:""}${a}`})),"horizontal"===g&&!O&&e(v,{timeline:y,customRange:b,percent:T,direction:I}),O&&void 0!==T&&e(s,{tagText:`${T} %`,theme:"light",type:"neutral"})]})),"vertical"===g&&!O&&e("div",Object.assign({style:{marginTop:12}},{children:e(v,{timeline:y,customRange:b,percent:T,direction:I})}))]}))}))},v=n=>{let{percent:s,direction:l,timeline:c,customRange:m}=n;const p="negative"===l?r:o,h="negative"===l?i.background.negative.vibrant:"positive"===l?i.background.positive.vibrant:i.content.placeholder,y="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&&m?`vs ${a(m[0])} - ${a(m[1])}`:"";return t("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row"}},{children:["number"==typeof s&&e(p,{color:h,height:20,width:20,style:{marginRight:2}}),"number"==typeof s&&l&&t(d,Object.assign({style:{color:h}},{children:["neutral"===l?0:s,"%"]})),c&&e(g,Object.assign({style:{marginLeft:4,color:i.content.placeholder}},{children:y}))]}))};export{y as AnalyticsTrend};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.177",
3
+ "version": "0.0.178",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",