@bikdotai/bik-component-library 0.0.28 → 0.0.29

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.
@@ -7,6 +7,6 @@ export interface AnalyticsChipInterface {
7
7
  titleColor?: string;
8
8
  width?: number | string;
9
9
  extraJSX?: JSX.Element;
10
- tooltipContent: string;
10
+ tooltipContent?: string;
11
11
  }
12
12
  export declare const AnalyticsChip: React.FC<AnalyticsChipInterface>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/info.svg.js"),r=require("../tooltips/Tooltip.js"),t=require("../../constants/Theme.js"),i=require("../TypographyStyle.js"),o=require("./CommonStyles.js");exports.AnalyticsChip=l=>{const{title:a,primaryValue:n,titleColor:c,captionColor:j=t.BASE_COLORS.grayscale[700],backgroundColor:d=t.BASE_COLORS.grayscale[50],width:u=224.67,extraJSX:h,tooltipContent:y}=l;return e.jsxs(o.AnalyticsChipContainer,Object.assign({backgroundColor:d,width:u},{children:[e.jsxs("div",Object.assign({className:"sub--container"},{children:[e.jsx(i.BodyCaption,Object.assign({style:{color:j}},{children:a})),y&&e.jsx(r.Tooltip,Object.assign({body:y},{children:e.jsx("div",{children:e.jsx(s.default,{height:14.67,width:14.67,color:t.BASE_COLORS.grayscale[500]})})}))]})),e.jsx(i.TitleLarge,Object.assign({style:{color:c}},{children:n})),h]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/info.svg.js"),r=require("../tooltips/Tooltip.js"),t=require("../../constants/Theme.js"),i=require("../TypographyStyle.js"),o=require("./CommonStyles.js");exports.AnalyticsChip=l=>{const{title:a,primaryValue:n,titleColor:c,captionColor:j=t.BASE_COLORS.grayscale[700],backgroundColor:d=t.BASE_COLORS.grayscale[50],width:u="224.67px",extraJSX:h,tooltipContent:p}=l;return e.jsxs(o.AnalyticsChipContainer,Object.assign({backgroundColor:d,width:u},{children:[e.jsxs("div",Object.assign({className:"sub--container"},{children:[e.jsx(i.BodyCaption,Object.assign({style:{color:j}},{children:a})),p&&e.jsx(r.Tooltip,Object.assign({body:p},{children:e.jsx("div",{children:e.jsx(s.default,{height:14.67,width:14.67,color:t.BASE_COLORS.grayscale[500]})})}))]})),e.jsx(i.TitleLarge,Object.assign({style:{color:c}},{children:n})),h]}))};
@@ -18,6 +18,7 @@ export interface AnalyticsDropdownInterface {
18
18
  options: DropdownOptions[];
19
19
  selected?: DropdownOptions;
20
20
  placeholder?: string;
21
+ resetDropdown?: boolean;
21
22
  onOptionSelected: (chosen: DropdownOptions & {
22
23
  selectedRange?: [Date, Date];
23
24
  }) => void;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),o=require("react-bootstrap"),t=require("../../constants/Theme.js"),s=require("../datePicker/DatePicker.js"),i=require("../TypographyStyle.js"),a=require("./CommonStyles.js");const l=n=>{let{eachOption:o,selectedOption:s,selectedDate:l,onClickingEachItem:c}=n;return e.jsxs(a.ItemMenuContainer,Object.assign({onClick:()=>c(o),isSelected:o.isCustom?o.key==(null==s?void 0:s.key)&&!!l:o.key==(null==s?void 0:s.key)},{children:[e.jsx(i.BodySecondary,Object.assign({color:o.key==(null==s?void 0:s.key)?t.BASE_COLORS.positive[900]:t.BASE_COLORS.grayscale[900]},{children:o.label})),l&&(null==s?void 0:s.isCustom)&&o.key==(null==s?void 0:s.key)&&e.jsx(i.BodyCaption,{children:`${d(l[0])} to ${d(l[1])}`})]}),o.key)},d=e=>e.toLocaleString("default",{day:"numeric",month:"short",year:"numeric"});exports.AnalyticsDropdown=t=>{let{options:c,placeholder:r="Select an option",selected:u,onOptionSelected:p}=t;var g,j;const[O,h]=n.useState(!1),[m,y]=n.useState(u),[v,x]=n.useState(),[D,S]=n.useState(!1),b=()=>{!O&&S(!D)};return e.jsx(e.Fragment,{children:e.jsxs(a.MainDropdown,Object.assign({drop:"down",show:D,onToggle:b},{children:[e.jsx(o.Dropdown.Toggle,Object.assign({id:"dropdown-autoclose-outside",className:"main--dropdown"},{children:e.jsx(i.BodySecondary,{children:(null==m?void 0:m.isCustom)?v?`${d(v[0])} to ${d(v[1])}`:r:m?null==m?void 0:m.label:r})})),e.jsx(o.Dropdown.Menu,Object.assign({className:"main--dropdown"},{children:e.jsxs(a.MainDropdown,Object.assign({drop:"end",id:"sub--dropdown",show:O,onToggle:e=>{!e&&S(!1),h(!O)}},{children:[c.map((n=>e.jsx("div",{children:(null==n?void 0:n.isCustom)?e.jsx(o.Dropdown.Toggle,Object.assign({className:"sub--dropdown"},{children:e.jsx(l,{eachOption:n,selectedOption:m,selectedDate:v,onClickingEachItem:e=>{y(e),h(!0)}})})):e.jsx(l,{eachOption:n,selectedOption:m,selectedDate:v,onClickingEachItem:e=>{if(y(e),b(),!e.noOfDays)return void p(e);const n=new Date,o=new Date;o.setDate(n.getDate()-e.noOfDays),p(Object.assign(Object.assign({},e),{selectedRange:[o,n]}))}})},null==n?void 0:n.key))),e.jsx(o.Dropdown.Menu,Object.assign({className:"sub--dropdown"},{children:e.jsx(s.DatePicker,{selectRange:(null===(g=null==m?void 0:m.dateRangeSelectionOptions)||void 0===g?void 0:g.selectRange)||!1,maxDate:null===(j=null==m?void 0:m.dateRangeSelectionOptions)||void 0===j?void 0:j.maxDate,selectedDates:v,onSelectRange:(e,n)=>{var o;(null===(o=null==m?void 0:m.dateRangeSelectionOptions)||void 0===o?void 0:o.selectRange)&&p(Object.assign(Object.assign({},m),{selectedRange:[e,n]})),h(!1);x([e,n]),S(!D)}})}))]}))}))]}))})},exports.EachItem=l;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),o=require("react-bootstrap"),t=require("../../constants/Theme.js"),s=require("../datePicker/DatePicker.js"),i=require("../TypographyStyle.js"),a=require("./CommonStyles.js");const l=n=>{let{eachOption:o,selectedOption:s,selectedDate:l,onClickingEachItem:c}=n;return e.jsxs(a.ItemMenuContainer,Object.assign({onClick:()=>c(o),isSelected:o.isCustom?o.key==(null==s?void 0:s.key)&&!!l:o.key==(null==s?void 0:s.key)},{children:[e.jsx(i.BodySecondary,Object.assign({color:o.key==(null==s?void 0:s.key)?t.BASE_COLORS.positive[900]:t.BASE_COLORS.grayscale[900]},{children:o.label})),l&&(null==s?void 0:s.isCustom)&&o.key==(null==s?void 0:s.key)&&e.jsx(i.BodyCaption,{children:`${d(l[0])} to ${d(l[1])}`})]}),o.key)},d=e=>e.toLocaleString("default",{day:"numeric",month:"short",year:"numeric"});exports.AnalyticsDropdown=t=>{let{options:c,placeholder:r="Select an option",selected:u,onOptionSelected:p,resetDropdown:g}=t;var j,O;const[h,m]=n.useState(!1),[v,y]=n.useState(u),[D,x]=n.useState(),[S,b]=n.useState(!1),w=()=>{!h&&b(!S)};return n.useEffect((()=>{g&&y(void 0)}),[g]),e.jsx(e.Fragment,{children:e.jsxs(a.MainDropdown,Object.assign({drop:"down",show:S,onToggle:w},{children:[e.jsx(o.Dropdown.Toggle,Object.assign({id:"dropdown-autoclose-outside",className:"main--dropdown"},{children:e.jsx(i.BodySecondary,{children:(null==v?void 0:v.isCustom)?D?`${d(D[0])} to ${d(D[1])}`:r:v?null==v?void 0:v.label:r})})),e.jsx(o.Dropdown.Menu,Object.assign({className:"main--dropdown"},{children:e.jsxs(a.MainDropdown,Object.assign({drop:"end",id:"sub--dropdown",show:h,onToggle:e=>{!e&&b(!1),m(!h)}},{children:[c.map((n=>e.jsx("div",{children:(null==n?void 0:n.isCustom)?e.jsx(o.Dropdown.Toggle,Object.assign({className:"sub--dropdown"},{children:e.jsx(l,{eachOption:n,selectedOption:v,selectedDate:D,onClickingEachItem:e=>{y(e),m(!0)}})})):e.jsx(l,{eachOption:n,selectedOption:v,selectedDate:D,onClickingEachItem:e=>{if(y(e),w(),!e.noOfDays)return void p(e);const n=new Date,o=new Date;o.setDate(n.getDate()-e.noOfDays),p(Object.assign(Object.assign({},e),{selectedRange:[o,n]}))}})},null==n?void 0:n.key))),e.jsx(o.Dropdown.Menu,Object.assign({className:"sub--dropdown"},{children:e.jsx(s.DatePicker,{selectRange:(null===(j=null==v?void 0:v.dateRangeSelectionOptions)||void 0===j?void 0:j.selectRange)||!1,maxDate:null===(O=null==v?void 0:v.dateRangeSelectionOptions)||void 0===O?void 0:O.maxDate,selectedDates:D,onSelectRange:(e,n)=>{var o;(null===(o=null==v?void 0:v.dateRangeSelectionOptions)||void 0===o?void 0:o.selectRange)&&p(Object.assign(Object.assign({},v),{selectedRange:[e,n]})),m(!1);x([e,n]),b(!S)}})}))]}))}))]}))})},exports.EachItem=l;
@@ -7,6 +7,6 @@ export interface AnalyticsChipInterface {
7
7
  titleColor?: string;
8
8
  width?: number | string;
9
9
  extraJSX?: JSX.Element;
10
- tooltipContent: string;
10
+ tooltipContent?: string;
11
11
  }
12
12
  export declare const AnalyticsChip: React.FC<AnalyticsChipInterface>;
@@ -1 +1 @@
1
- import{jsxs as o,jsx as t}from"react/jsx-runtime";import r from"../../assets/icons/info.svg.js";import{Tooltip as s}from"../tooltips/Tooltip.js";import{BASE_COLORS as i}from"../../constants/Theme.js";import{BodyCaption as e,TitleLarge as c}from"../TypographyStyle.js";import{AnalyticsChipContainer as l}from"./CommonStyles.js";const n=n=>{const{title:a,primaryValue:m,titleColor:d,captionColor:p=i.grayscale[700],backgroundColor:g=i.grayscale[50],width:h=224.67,extraJSX:j,tooltipContent:y}=n;return o(l,Object.assign({backgroundColor:g,width:h},{children:[o("div",Object.assign({className:"sub--container"},{children:[t(e,Object.assign({style:{color:p}},{children:a})),y&&t(s,Object.assign({body:y},{children:t("div",{children:t(r,{height:14.67,width:14.67,color:i.grayscale[500]})})}))]})),t(c,Object.assign({style:{color:d}},{children:m})),j]}))};export{n as AnalyticsChip};
1
+ import{jsxs as o,jsx as t}from"react/jsx-runtime";import r from"../../assets/icons/info.svg.js";import{Tooltip as s}from"../tooltips/Tooltip.js";import{BASE_COLORS as i}from"../../constants/Theme.js";import{BodyCaption as e,TitleLarge as c}from"../TypographyStyle.js";import{AnalyticsChipContainer as l}from"./CommonStyles.js";const n=n=>{const{title:a,primaryValue:m,titleColor:p,captionColor:d=i.grayscale[700],backgroundColor:g=i.grayscale[50],width:h="224.67px",extraJSX:j,tooltipContent:y}=n;return o(l,Object.assign({backgroundColor:g,width:h},{children:[o("div",Object.assign({className:"sub--container"},{children:[t(e,Object.assign({style:{color:d}},{children:a})),y&&t(s,Object.assign({body:y},{children:t("div",{children:t(r,{height:14.67,width:14.67,color:i.grayscale[500]})})}))]})),t(c,Object.assign({style:{color:p}},{children:m})),j]}))};export{n as AnalyticsChip};
@@ -18,6 +18,7 @@ export interface AnalyticsDropdownInterface {
18
18
  options: DropdownOptions[];
19
19
  selected?: DropdownOptions;
20
20
  placeholder?: string;
21
+ resetDropdown?: boolean;
21
22
  onOptionSelected: (chosen: DropdownOptions & {
22
23
  selectedRange?: [Date, Date];
23
24
  }) => void;
@@ -1 +1 @@
1
- import{jsx as e,Fragment as o,jsxs as n}from"react/jsx-runtime";import{useState as t}from"react";import{Dropdown as i}from"react-bootstrap";import{BASE_COLORS as l}from"../../constants/Theme.js";import{DatePicker as s}from"../datePicker/DatePicker.js";import{BodySecondary as a,BodyCaption as c}from"../TypographyStyle.js";import{MainDropdown as d,ItemMenuContainer as r}from"./CommonStyles.js";const m=l=>{let{options:c,placeholder:r="Select an option",selected:m,onOptionSelected:u}=l;var h,O;const[v,y]=t(!1),[b,j]=t(m),[k,D]=t(),[f,w]=t(!1),S=()=>{!v&&w(!f)};return e(o,{children:n(d,Object.assign({drop:"down",show:f,onToggle:S},{children:[e(i.Toggle,Object.assign({id:"dropdown-autoclose-outside",className:"main--dropdown"},{children:e(a,{children:(null==b?void 0:b.isCustom)?k?`${p(k[0])} to ${p(k[1])}`:r:b?null==b?void 0:b.label:r})})),e(i.Menu,Object.assign({className:"main--dropdown"},{children:n(d,Object.assign({drop:"end",id:"sub--dropdown",show:v,onToggle:e=>{!e&&w(!1),y(!v)}},{children:[c.map((o=>e("div",{children:(null==o?void 0:o.isCustom)?e(i.Toggle,Object.assign({className:"sub--dropdown"},{children:e(g,{eachOption:o,selectedOption:b,selectedDate:k,onClickingEachItem:e=>{j(e),y(!0)}})})):e(g,{eachOption:o,selectedOption:b,selectedDate:k,onClickingEachItem:e=>{if(j(e),S(),!e.noOfDays)return void u(e);const o=new Date,n=new Date;n.setDate(o.getDate()-e.noOfDays),u(Object.assign(Object.assign({},e),{selectedRange:[n,o]}))}})},null==o?void 0:o.key))),e(i.Menu,Object.assign({className:"sub--dropdown"},{children:e(s,{selectRange:(null===(h=null==b?void 0:b.dateRangeSelectionOptions)||void 0===h?void 0:h.selectRange)||!1,maxDate:null===(O=null==b?void 0:b.dateRangeSelectionOptions)||void 0===O?void 0:O.maxDate,selectedDates:k,onSelectRange:(e,o)=>{var n;(null===(n=null==b?void 0:b.dateRangeSelectionOptions)||void 0===n?void 0:n.selectRange)&&u(Object.assign(Object.assign({},b),{selectedRange:[e,o]})),y(!1);D([e,o]),w(!f)}})}))]}))}))]}))})},g=o=>{let{eachOption:t,selectedOption:i,selectedDate:s,onClickingEachItem:d}=o;return n(r,Object.assign({onClick:()=>d(t),isSelected:t.isCustom?t.key==(null==i?void 0:i.key)&&!!s:t.key==(null==i?void 0:i.key)},{children:[e(a,Object.assign({color:t.key==(null==i?void 0:i.key)?l.positive[900]:l.grayscale[900]},{children:t.label})),s&&(null==i?void 0:i.isCustom)&&t.key==(null==i?void 0:i.key)&&e(c,{children:`${p(s[0])} to ${p(s[1])}`})]}),t.key)},p=e=>e.toLocaleString("default",{day:"numeric",month:"short",year:"numeric"});export{m as AnalyticsDropdown,g as EachItem};
1
+ import{jsx as e,Fragment as o,jsxs as n}from"react/jsx-runtime";import{useState as t,useEffect as i}from"react";import{Dropdown as l}from"react-bootstrap";import{BASE_COLORS as s}from"../../constants/Theme.js";import{DatePicker as a}from"../datePicker/DatePicker.js";import{BodySecondary as c,BodyCaption as d}from"../TypographyStyle.js";import{MainDropdown as r,ItemMenuContainer as m}from"./CommonStyles.js";const g=s=>{let{options:d,placeholder:m="Select an option",selected:g,onOptionSelected:h,resetDropdown:v}=s;var O,y;const[b,j]=t(!1),[k,D]=t(g),[w,f]=t(),[S,C]=t(!1),R=()=>{!b&&C(!S)};return i((()=>{v&&D(void 0)}),[v]),e(o,{children:n(r,Object.assign({drop:"down",show:S,onToggle:R},{children:[e(l.Toggle,Object.assign({id:"dropdown-autoclose-outside",className:"main--dropdown"},{children:e(c,{children:(null==k?void 0:k.isCustom)?w?`${u(w[0])} to ${u(w[1])}`:m:k?null==k?void 0:k.label:m})})),e(l.Menu,Object.assign({className:"main--dropdown"},{children:n(r,Object.assign({drop:"end",id:"sub--dropdown",show:b,onToggle:e=>{!e&&C(!1),j(!b)}},{children:[d.map((o=>e("div",{children:(null==o?void 0:o.isCustom)?e(l.Toggle,Object.assign({className:"sub--dropdown"},{children:e(p,{eachOption:o,selectedOption:k,selectedDate:w,onClickingEachItem:e=>{D(e),j(!0)}})})):e(p,{eachOption:o,selectedOption:k,selectedDate:w,onClickingEachItem:e=>{if(D(e),R(),!e.noOfDays)return void h(e);const o=new Date,n=new Date;n.setDate(o.getDate()-e.noOfDays),h(Object.assign(Object.assign({},e),{selectedRange:[n,o]}))}})},null==o?void 0:o.key))),e(l.Menu,Object.assign({className:"sub--dropdown"},{children:e(a,{selectRange:(null===(O=null==k?void 0:k.dateRangeSelectionOptions)||void 0===O?void 0:O.selectRange)||!1,maxDate:null===(y=null==k?void 0:k.dateRangeSelectionOptions)||void 0===y?void 0:y.maxDate,selectedDates:w,onSelectRange:(e,o)=>{var n;(null===(n=null==k?void 0:k.dateRangeSelectionOptions)||void 0===n?void 0:n.selectRange)&&h(Object.assign(Object.assign({},k),{selectedRange:[e,o]})),j(!1);f([e,o]),C(!S)}})}))]}))}))]}))})},p=o=>{let{eachOption:t,selectedOption:i,selectedDate:l,onClickingEachItem:a}=o;return n(m,Object.assign({onClick:()=>a(t),isSelected:t.isCustom?t.key==(null==i?void 0:i.key)&&!!l:t.key==(null==i?void 0:i.key)},{children:[e(c,Object.assign({color:t.key==(null==i?void 0:i.key)?s.positive[900]:s.grayscale[900]},{children:t.label})),l&&(null==i?void 0:i.isCustom)&&t.key==(null==i?void 0:i.key)&&e(d,{children:`${u(l[0])} to ${u(l[1])}`})]}),t.key)},u=e=>e.toLocaleString("default",{day:"numeric",month:"short",year:"numeric"});export{g as AnalyticsDropdown,p as EachItem};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",