@bikdotai/bik-component-library 0.0.176 → 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 +7 -0
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +3 -3
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
ADDED
|
@@ -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,
|
|
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,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("styled-components"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("styled-components"),n=require("../../../../checkBox/CheckBox.js"),s=require("../../../../list-item/ListItem.js"),r=require("../../../../TypographyStyle.js"),i=require("../../../../../constants/Theme.js"),o=require("./FreeFormMenu.styled.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const c=l(t).default(s.ListItem)`
|
|
2
2
|
padding: 14px 16px !important;
|
|
3
|
-
cursor:
|
|
4
|
-
`;exports.MenuItem=t=>{let{option:
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
`;exports.MenuItem=t=>{let{option:s,isMultiSelect:l,showDescription:a,onSelect:u,last:d}=t;var m;function p(e){s.disabled||u(Object.assign(Object.assign({},s),{selected:e}))}return e.jsx(c,{style:d?{borderBottom:0}:{},onClick:e=>{e.preventDefault(),p(!s.selected)},onMouseOver:function(){s.description?a(s.label,s.description):a()},listItem:{value:s.value,label:s.label},subText:s.subText,leadingIcon:l?e.jsx(n.CheckBox,{isDisabled:null!==(m=s.disabled)&&void 0!==m&&m,isChecked:!!s.selected,onValueChange:p}):e.jsx(e.Fragment,{}),customComponent:s.customComponent,trailingIcon:s.isFreeForm?e.jsx(o.FreeFormContainer,{children:e.jsx(r.BodyCaption,Object.assign({style:{color:i.COLORS.content.secondary}},{children:"Freeform"}))}):s.trailingIcon?e.jsx(e.Fragment,{children:s.trailingIcon}):e.jsx(e.Fragment,{}),variant:s.disabled?"inactive":s.selected?"selected":"default"})};
|
|
@@ -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
|
|
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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{jsx as e,Fragment as t}from"react/jsx-runtime";import o from"styled-components";import{CheckBox as i}from"../../../../checkBox/CheckBox.js";import{ListItem as n}from"../../../../list-item/ListItem.js";import{BodyCaption as s}from"../../../../TypographyStyle.js";import{COLORS as r}from"../../../../../constants/Theme.js";import{FreeFormContainer as l}from"./FreeFormMenu.styled.js";const c=o(n)`
|
|
2
2
|
padding: 14px 16px !important;
|
|
3
|
-
cursor:
|
|
3
|
+
cursor: pointer;
|
|
4
4
|
`,a=o=>{let{option:n,isMultiSelect:a,showDescription:m,onSelect:d,last:p}=o;var u;function b(e){n.disabled||d(Object.assign(Object.assign({},n),{selected:e}))}return e(c,{style:p?{borderBottom:0}:{},onClick:e=>{e.preventDefault(),b(!n.selected)},onMouseOver:function(){n.description?m(n.label,n.description):m()},listItem:{value:n.value,label:n.label},subText:n.subText,leadingIcon:a?e(i,{isDisabled:null!==(u=n.disabled)&&void 0!==u&&u,isChecked:!!n.selected,onValueChange:b}):e(t,{}),customComponent:n.customComponent,trailingIcon:n.isFreeForm?e(l,{children:e(s,Object.assign({style:{color:r.content.secondary}},{children:"Freeform"}))}):n.trailingIcon?e(t,{children:n.trailingIcon}):e(t,{}),variant:n.disabled?"inactive":n.selected?"selected":"default"})};export{a as MenuItem};
|