@bikdotai/bik-component-library 0.0.224 → 0.0.225

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.
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("./PostPicker.styled.js"),s=require("../tag/Tag.js"),r=require("../TypographyStyle.js"),i=require("../../utils/unCamelCase.js"),n=require("../../constants/colors.js"),o=require("../../constants/Theme.js"),l=require("../../assets/icons/instagram.svg.js"),d=require("../../assets/icons/warning.svg.js"),c=require("../modals/styledModal.js"),p=require("../shimmer/ShimmerComponent/BikShimmer.js"),h=require("../shimmer-image/ShimmerImage.js"),y=require("../states/StateComponent.js");require("@tippyjs/react"),require("../tooltips/TooltipInternal.js"),require("../analytics-chips-and-dropdowns/CommonStyles.js");var u=require("../analytics-chips-and-dropdowns/AnalyticsDropdown.js");require("../analytics-chips-and-dropdowns/AnalyticsMetric.js"),require("../analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),require("react-bootstrap"),require("../analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.styled.js"),require("../analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),require("../analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),require("../analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),require("../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),require("../analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),require("../analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),require("../analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js");var m,g,j=require("../../assets/icons/searchIcon.js");exports.MEDIA_TYPES=void 0,(m=exports.MEDIA_TYPES||(exports.MEDIA_TYPES={})).STORY="story",m.POST="post",m.REEL="reel",exports.DateKeys=void 0,(g=exports.DateKeys||(exports.DateKeys={})).Today="Today",g["7_Days"]="7",g["30_Days"]="30",g.custom="custom",g.Yesterday="Yesterday";const x=[{label:"Today",value:"today",key:exports.DateKeys.Today,typeValue:[new Date,new Date]},{label:"Last 7 days",value:"7 days",key:exports.DateKeys["7_Days"],typeValue:[new Date((new Date).setDate((new Date).getDate()-6)),new Date]},{label:"Last 30 days",value:"30 days",key:exports.DateKeys["30_Days"],typeValue:[new Date((new Date).setDate((new Date).getDate()-29)),new Date]},{label:"Custom range",value:"calender",key:exports.DateKeys.custom,isCustom:!0,dateRangeSelectionOptions:{selectRange:!0,maxDate:new Date((new Date).setMonth((new Date).getMonth()+3))}}];exports.PostPicker=m=>{var g,D;const[S,v]=t.useState(null!==(g=m.previouslySelected)&&void 0!==g?g:[]),[w,C]=t.useState(""),[T,b]=t.useState(!1),[O,f]=t.useState(m.media),[q,P]=t.useState(!1),[I,E]=t.useState(!1);t.useEffect((()=>{m.media.length||(b(!0),setTimeout((()=>{b(!1)}),2e3)),v(m.selected||[])}),[]),t.useEffect((()=>{m.media.length>0&&b(!1)}),[null===(D=null==m?void 0:m.media)||void 0===D?void 0:D.length]),t.useEffect((()=>{S.length>0&&C("")}),[S.length]),t.useEffect((()=>{q&&(f(m.media),E(!1))}),[q]);return e.jsx(e.Fragment,{children:e.jsxs(c.StyledModal,Object.assign({zIndex:201,open:m.showModal,headingTitle:m.title,onClose:m.onClose,centralContainerStyles:{width:1071,height:m.showFilter?612:564},primaryButton:{disabled:!O.length,buttonType:"primary",buttonText:`Select ${i.unCamelCase(m.mediaType)}`,onClick:()=>{S.length?m.onSelect(S):C(`Please select a ${m.mediaType} to proceed`)}},secondaryButton:{buttonType:"secondary",buttonText:"Back",onClick:()=>m.onClose()},footerLeftCustomElement:w?e.jsx(s.Tag,{tagText:w,type:"negative",LeadingIcon:d.default}):S.length?e.jsxs(r.BodySecondary,{children:[S.length," selected"]}):null},{children:[m.showFilter&&e.jsxs("div",Object.assign({style:{marginTop:24,marginBottom:24,padding:"0 24px",display:"flex",flexDirection:"row",gap:8,alignItems:"center"}},{children:[e.jsx(u.AnalyticsDropdown,{options:x,placeholder:"posted on",resetDropdown:q,onOptionSelected:e=>{var t,a;let s=null,r=null;"Custom range"===e.label?(s=(null===(t=null==e?void 0:e.selectedRange)||void 0===t?void 0:t[0])||new Date,r=(null===(a=null==e?void 0:e.selectedRange)||void 0===a?void 0:a[1])||new Date):(s=e.typeValue[0],r=e.typeValue[1]);const i=m.media.filter((e=>function(e,t,a){const s=new Date(e),r=new Date(t),i=new Date(a);return s>=r&&s<=i}(e.timestamp,s,r)));f(i),E(!0),P(!1)}}),I&&e.jsx(r.ButtonRegular,Object.assign({color:o.COLORS.content.secondary,onClick:()=>P(!0)},{children:"Clear"}))]})),T?e.jsx("div",Object.assign({style:{padding:"0 24px"}},{children:e.jsx(p.BikShimmer,{boxes:[{width:(m.mediaType==exports.MEDIA_TYPES.POST?148:104)+"px",height:(m.mediaType==exports.MEDIA_TYPES.POST?148:172)+"px"}]})})):e.jsx(e.Fragment,{children:O&&O.length?e.jsx(a.StyledProductGrid,Object.assign({mediaType:m.mediaType},{children:O.map((t=>{return e.jsxs(a.StyledProduct,Object.assign({mediaType:m.mediaType,className:""+(s=t,i=S,i.some((e=>e.id===s.id))?"selected":""),onClick:()=>{return e=t,void v((()=>S.find((t=>t.id===e.id))?S.filter((t=>t.id!==e.id)):!m.limit||S.length<m.limit?[...S,e]:(C(`Only ${m.limit} ${m.mediaType}s can be selected`),S)));var e}},{children:[e.jsx(h.ShimmerImage,{imageUrl:t.imageUrl,width:m.mediaType==exports.MEDIA_TYPES.POST?148:104,height:m.mediaType==exports.MEDIA_TYPES.POST?148:172,alt:t.overlayCaption}),e.jsxs("div",Object.assign({className:"overlay"},{children:[e.jsx("a",Object.assign({target:"_blank",rel:"noreferrer",href:t.redirectionUrl},{children:e.jsxs("div",Object.assign({className:"overlay__redirection"},{children:[e.jsx(l.default,{height:22,width:22}),e.jsx(r.BodyPrimary,Object.assign({color:n.PRIMARY,style:{fontWeight:500}},{children:"View"}))]}))})),e.jsx("div",Object.assign({className:"overlay__caption"},{children:e.jsx(r.BodyCaption,Object.assign({color:o.COLORS.content.placeholder},{children:t.overlayCaption}))}))]}))]}),t.id);var s,i}))})):e.jsx("div",Object.assign({style:{justifyContent:"center",alignItems:"center",display:"flex",height:422}},{children:m.media.length?O.length?e.jsx(e.Fragment,{}):e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"}},{children:[e.jsx("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"48px",height:"48px",backgroundColor:`${o.COLORS.background.inverse}`,borderRadius:"50%"}},{children:e.jsx(j.SearchIcon,{color:o.COLORS.content.primaryInverse})})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},{children:[e.jsx(r.TitleMedium,{children:"No results found"}),e.jsx(r.BodyPrimary,{children:"Sorry we could not find any results for the selected filter"})]})),e.jsx("div",Object.assign({onClick:()=>{P(!0)}},{children:e.jsx(r.ButtonLarge,Object.assign({color:`${o.COLORS.content.brand}`},{children:"Clear Filter"}))}))]})):e.jsx(y.StateComponent,{states:y.StateInterface.WARNING,heading:`No ${m.mediaType}s on your account`,subline:`There seems to be no ${m.mediaType}s on your account`,isButtonEnabled:!1,width:400})}))})]}))})},exports.dateOptions=x;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("./PostPicker.styled.js"),s=require("../tag/Tag.js"),r=require("../TypographyStyle.js"),i=require("../../utils/unCamelCase.js"),n=require("../../constants/colors.js"),o=require("../../constants/Theme.js"),l=require("../../assets/icons/instagram.svg.js"),d=require("../../assets/icons/warning.svg.js"),c=require("../modals/styledModal.js"),p=require("../shimmer/ShimmerComponent/BikShimmer.js"),h=require("../shimmer-image/ShimmerImage.js"),y=require("../states/StateComponent.js");require("@tippyjs/react"),require("../tooltips/TooltipInternal.js"),require("../analytics-chips-and-dropdowns/CommonStyles.js");var u=require("../analytics-chips-and-dropdowns/AnalyticsDropdown.js");require("../analytics-chips-and-dropdowns/AnalyticsMetric.js"),require("../analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),require("react-bootstrap"),require("../analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.styled.js"),require("../analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),require("../analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),require("../analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),require("../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),require("../analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),require("../analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),require("../analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js");var m,g,j=require("../../assets/icons/searchIcon.js");exports.MEDIA_TYPES=void 0,(m=exports.MEDIA_TYPES||(exports.MEDIA_TYPES={})).STORY="story",m.POST="post",m.REEL="reel",exports.DateKeys=void 0,(g=exports.DateKeys||(exports.DateKeys={})).Today="Today",g["7_Days"]="7",g["30_Days"]="30",g.custom="custom",g.Yesterday="Yesterday";const x=[{label:"Today",value:"today",key:exports.DateKeys.Today,typeValue:[new Date,new Date]},{label:"Last 7 days",value:"7 days",key:exports.DateKeys["7_Days"],typeValue:[new Date((new Date).setDate((new Date).getDate()-6)),new Date]},{label:"Last 30 days",value:"30 days",key:exports.DateKeys["30_Days"],typeValue:[new Date((new Date).setDate((new Date).getDate()-29)),new Date]},{label:"Custom range",value:"calender",key:exports.DateKeys.custom,isCustom:!0,dateRangeSelectionOptions:{selectRange:!0,maxDate:new Date((new Date).setMonth((new Date).getMonth()+3))}}];exports.PostPicker=m=>{var g,D;const[S,v]=t.useState(null!==(g=m.previouslySelected)&&void 0!==g?g:[]),[w,C]=t.useState(""),[T,b]=t.useState(!1),[O,f]=t.useState(m.media),[q,P]=t.useState(!1),[I,E]=t.useState(!1);t.useEffect((()=>{m.media.length||(b(!0),setTimeout((()=>{f(m.media),b(!1)}),2e3)),v(m.selected||[])}),[]),t.useEffect((()=>{m.media.length>0&&(f(m.media),b(!1))}),[null===(D=null==m?void 0:m.media)||void 0===D?void 0:D.length]),t.useEffect((()=>{S.length>0&&C("")}),[S.length]),t.useEffect((()=>{q&&(f(m.media),E(!1))}),[q]);return e.jsx(e.Fragment,{children:e.jsxs(c.StyledModal,Object.assign({zIndex:201,open:m.showModal,headingTitle:m.title,onClose:m.onClose,centralContainerStyles:{width:1071,height:m.showFilter?612:564},primaryButton:{disabled:!O.length,buttonType:"primary",buttonText:`Select ${i.unCamelCase(m.mediaType)}`,onClick:()=>{S.length?m.onSelect(S):C(`Please select a ${m.mediaType} to proceed`)}},secondaryButton:{buttonType:"secondary",buttonText:"Back",onClick:()=>m.onClose()},footerLeftCustomElement:w?e.jsx(s.Tag,{tagText:w,type:"negative",LeadingIcon:d.default}):S.length?e.jsxs(r.BodySecondary,{children:[S.length," selected"]}):null},{children:[m.showFilter&&e.jsxs("div",Object.assign({style:{marginTop:24,marginBottom:24,padding:"0 24px",display:"flex",flexDirection:"row",gap:8,alignItems:"center"}},{children:[e.jsx(u.AnalyticsDropdown,{options:x,placeholder:"posted on",resetDropdown:q,onOptionSelected:e=>{var t,a;let s=null,r=null;"Custom range"===e.label?(s=(null===(t=null==e?void 0:e.selectedRange)||void 0===t?void 0:t[0])||new Date,r=(null===(a=null==e?void 0:e.selectedRange)||void 0===a?void 0:a[1])||new Date):(s=e.typeValue[0],r=e.typeValue[1]);const i=m.media.filter((e=>function(e,t,a){const s=new Date(e),r=new Date(t),i=new Date(a);return s>=r&&s<=i}(e.timestamp,s,r)));f(i),E(!0),P(!1)}}),I&&e.jsx(r.ButtonRegular,Object.assign({color:o.COLORS.content.secondary,onClick:()=>P(!0)},{children:"Clear"}))]})),T?e.jsx("div",Object.assign({style:{padding:"0 24px"}},{children:e.jsx(p.BikShimmer,{boxes:[{width:(m.mediaType==exports.MEDIA_TYPES.POST?148:104)+"px",height:(m.mediaType==exports.MEDIA_TYPES.POST?148:172)+"px"}]})})):e.jsx(e.Fragment,{children:O&&O.length?e.jsx(a.StyledProductGrid,Object.assign({mediaType:m.mediaType},{children:O.map((t=>{return e.jsxs(a.StyledProduct,Object.assign({mediaType:m.mediaType,className:""+(s=t,i=S,i.some((e=>e.id===s.id))?"selected":""),onClick:()=>{return e=t,void v((()=>S.find((t=>t.id===e.id))?S.filter((t=>t.id!==e.id)):!m.limit||S.length<m.limit?[...S,e]:(C(`Only ${m.limit} ${m.mediaType}s can be selected`),S)));var e}},{children:[e.jsx(h.ShimmerImage,{imageUrl:t.imageUrl,width:m.mediaType==exports.MEDIA_TYPES.POST?148:104,height:m.mediaType==exports.MEDIA_TYPES.POST?148:172,alt:t.overlayCaption}),e.jsxs("div",Object.assign({className:"overlay"},{children:[e.jsx("a",Object.assign({target:"_blank",rel:"noreferrer",href:t.redirectionUrl},{children:e.jsxs("div",Object.assign({className:"overlay__redirection"},{children:[e.jsx(l.default,{height:22,width:22}),e.jsx(r.BodyPrimary,Object.assign({color:n.PRIMARY,style:{fontWeight:500}},{children:"View"}))]}))})),e.jsx("div",Object.assign({className:"overlay__caption"},{children:e.jsx(r.BodyCaption,Object.assign({color:o.COLORS.content.placeholder},{children:t.overlayCaption}))}))]}))]}),t.id);var s,i}))})):e.jsx("div",Object.assign({style:{justifyContent:"center",alignItems:"center",display:"flex",height:422}},{children:m.media.length?O.length?e.jsx(e.Fragment,{}):e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"}},{children:[e.jsx("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"48px",height:"48px",backgroundColor:`${o.COLORS.background.inverse}`,borderRadius:"50%"}},{children:e.jsx(j.SearchIcon,{color:o.COLORS.content.primaryInverse})})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},{children:[e.jsx(r.TitleMedium,{children:"No results found"}),e.jsx(r.BodyPrimary,{children:"Sorry we could not find any results for the selected filter"})]})),e.jsx("div",Object.assign({onClick:()=>{P(!0)}},{children:e.jsx(r.ButtonLarge,Object.assign({color:`${o.COLORS.content.brand}`},{children:"Clear Filter"}))}))]})):e.jsx(y.StateComponent,{states:y.StateInterface.WARNING,heading:`No ${m.mediaType}s on your account`,subline:`There seems to be no ${m.mediaType}s on your account`,isButtonEnabled:!1,width:400})}))})]}))})},exports.dateOptions=x;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const WorkingStepper: () => JSX.Element;
2
3
  export declare enum STEPENUM {
3
4
  STEP1 = "STEP1",
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -1 +1 @@
1
- import{jsx as e,Fragment as t,jsxs as a}from"react/jsx-runtime";import{useState as n,useEffect as i}from"react";import{StyledProductGrid as o,StyledProduct as r}from"./PostPicker.styled.js";import{Tag as s}from"../tag/Tag.js";import{ButtonRegular as l,BodyPrimary as d,BodyCaption as c,TitleMedium as p,ButtonLarge as m,BodySecondary as h}from"../TypographyStyle.js";import{unCamelCase as y}from"../../utils/unCamelCase.js";import{PRIMARY as g}from"../../constants/colors.js";import{COLORS as u}from"../../constants/Theme.js";import j from"../../assets/icons/instagram.svg.js";import w from"../../assets/icons/warning.svg.js";import{StyledModal as f}from"../modals/styledModal.js";import{BikShimmer as v}from"../shimmer/ShimmerComponent/BikShimmer.js";import{ShimmerImage as b}from"../shimmer-image/ShimmerImage.js";import{StateComponent as C,StateInterface as T}from"../states/StateComponent.js";import"@tippyjs/react";import"../tooltips/TooltipInternal.js";import"../analytics-chips-and-dropdowns/CommonStyles.js";import{AnalyticsDropdown as D}from"../analytics-chips-and-dropdowns/AnalyticsDropdown.js";import"../analytics-chips-and-dropdowns/AnalyticsMetric.js";import"../analytics-chips-and-dropdowns/chart/LineChart/LineChart.js";import"react-bootstrap";import"../analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.styled.js";import"../analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js";import"../analytics-chips-and-dropdowns/chart/Pie/PieChart.js";import"../analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js";import"../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js";import"../analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js";import"../analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js";import"../analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js";import{SearchIcon as O}from"../../assets/icons/searchIcon.js";var x,S;!function(e){e.STORY="story",e.POST="post",e.REEL="reel"}(x||(x={})),function(e){e.Today="Today",e["7_Days"]="7",e["30_Days"]="30",e.custom="custom",e.Yesterday="Yesterday"}(S||(S={}));const k=[{label:"Today",value:"today",key:S.Today,typeValue:[new Date,new Date]},{label:"Last 7 days",value:"7 days",key:S["7_Days"],typeValue:[new Date((new Date).setDate((new Date).getDate()-6)),new Date]},{label:"Last 30 days",value:"30 days",key:S["30_Days"],typeValue:[new Date((new Date).setDate((new Date).getDate()-29)),new Date]},{label:"Custom range",value:"calender",key:S.custom,isCustom:!0,dateRangeSelectionOptions:{selectRange:!0,maxDate:new Date((new Date).setMonth((new Date).getMonth()+3))}}],B=S=>{var B,I;const[P,L]=n(null!==(B=S.previouslySelected)&&void 0!==B?B:[]),[V,G]=n(""),[_,N]=n(!1),[R,$]=n(S.media),[A,M]=n(!1),[E,z]=n(!1);i((()=>{S.media.length||(N(!0),setTimeout((()=>{N(!1)}),2e3)),L(S.selected||[])}),[]),i((()=>{S.media.length>0&&N(!1)}),[null===(I=null==S?void 0:S.media)||void 0===I?void 0:I.length]),i((()=>{P.length>0&&G("")}),[P.length]),i((()=>{A&&($(S.media),z(!1))}),[A]);return e(t,{children:a(f,Object.assign({zIndex:201,open:S.showModal,headingTitle:S.title,onClose:S.onClose,centralContainerStyles:{width:1071,height:S.showFilter?612:564},primaryButton:{disabled:!R.length,buttonType:"primary",buttonText:`Select ${y(S.mediaType)}`,onClick:()=>{P.length?S.onSelect(P):G(`Please select a ${S.mediaType} to proceed`)}},secondaryButton:{buttonType:"secondary",buttonText:"Back",onClick:()=>S.onClose()},footerLeftCustomElement:V?e(s,{tagText:V,type:"negative",LeadingIcon:w}):P.length?a(h,{children:[P.length," selected"]}):null},{children:[S.showFilter&&a("div",Object.assign({style:{marginTop:24,marginBottom:24,padding:"0 24px",display:"flex",flexDirection:"row",gap:8,alignItems:"center"}},{children:[e(D,{options:k,placeholder:"posted on",resetDropdown:A,onOptionSelected:e=>{var t,a;let n=null,i=null;"Custom range"===e.label?(n=(null===(t=null==e?void 0:e.selectedRange)||void 0===t?void 0:t[0])||new Date,i=(null===(a=null==e?void 0:e.selectedRange)||void 0===a?void 0:a[1])||new Date):(n=e.typeValue[0],i=e.typeValue[1]);const o=S.media.filter((e=>function(e,t,a){const n=new Date(e),i=new Date(t),o=new Date(a);return n>=i&&n<=o}(e.timestamp,n,i)));$(o),z(!0),M(!1)}}),E&&e(l,Object.assign({color:u.content.secondary,onClick:()=>M(!0)},{children:"Clear"}))]})),_?e("div",Object.assign({style:{padding:"0 24px"}},{children:e(v,{boxes:[{width:(S.mediaType==x.POST?148:104)+"px",height:(S.mediaType==x.POST?148:172)+"px"}]})})):e(t,{children:R&&R.length?e(o,Object.assign({mediaType:S.mediaType},{children:R.map((t=>{return a(r,Object.assign({mediaType:S.mediaType,className:""+(n=t,i=P,i.some((e=>e.id===n.id))?"selected":""),onClick:()=>{return e=t,void L((()=>P.find((t=>t.id===e.id))?P.filter((t=>t.id!==e.id)):!S.limit||P.length<S.limit?[...P,e]:(G(`Only ${S.limit} ${S.mediaType}s can be selected`),P)));var e}},{children:[e(b,{imageUrl:t.imageUrl,width:S.mediaType==x.POST?148:104,height:S.mediaType==x.POST?148:172,alt:t.overlayCaption}),a("div",Object.assign({className:"overlay"},{children:[e("a",Object.assign({target:"_blank",rel:"noreferrer",href:t.redirectionUrl},{children:a("div",Object.assign({className:"overlay__redirection"},{children:[e(j,{height:22,width:22}),e(d,Object.assign({color:g,style:{fontWeight:500}},{children:"View"}))]}))})),e("div",Object.assign({className:"overlay__caption"},{children:e(c,Object.assign({color:u.content.placeholder},{children:t.overlayCaption}))}))]}))]}),t.id);var n,i}))})):e("div",Object.assign({style:{justifyContent:"center",alignItems:"center",display:"flex",height:422}},{children:S.media.length?R.length?e(t,{}):a("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"}},{children:[e("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"48px",height:"48px",backgroundColor:`${u.background.inverse}`,borderRadius:"50%"}},{children:e(O,{color:u.content.primaryInverse})})),a("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},{children:[e(p,{children:"No results found"}),e(d,{children:"Sorry we could not find any results for the selected filter"})]})),e("div",Object.assign({onClick:()=>{M(!0)}},{children:e(m,Object.assign({color:`${u.content.brand}`},{children:"Clear Filter"}))}))]})):e(C,{states:T.WARNING,heading:`No ${S.mediaType}s on your account`,subline:`There seems to be no ${S.mediaType}s on your account`,isButtonEnabled:!1,width:400})}))})]}))})};export{S as DateKeys,x as MEDIA_TYPES,B as PostPicker,k as dateOptions};
1
+ import{jsx as e,Fragment as t,jsxs as a}from"react/jsx-runtime";import{useState as i,useEffect as n}from"react";import{StyledProductGrid as o,StyledProduct as r}from"./PostPicker.styled.js";import{Tag as s}from"../tag/Tag.js";import{ButtonRegular as l,BodyPrimary as d,BodyCaption as c,TitleMedium as p,ButtonLarge as m,BodySecondary as h}from"../TypographyStyle.js";import{unCamelCase as y}from"../../utils/unCamelCase.js";import{PRIMARY as g}from"../../constants/colors.js";import{COLORS as u}from"../../constants/Theme.js";import j from"../../assets/icons/instagram.svg.js";import w from"../../assets/icons/warning.svg.js";import{StyledModal as f}from"../modals/styledModal.js";import{BikShimmer as v}from"../shimmer/ShimmerComponent/BikShimmer.js";import{ShimmerImage as b}from"../shimmer-image/ShimmerImage.js";import{StateComponent as C,StateInterface as T}from"../states/StateComponent.js";import"@tippyjs/react";import"../tooltips/TooltipInternal.js";import"../analytics-chips-and-dropdowns/CommonStyles.js";import{AnalyticsDropdown as D}from"../analytics-chips-and-dropdowns/AnalyticsDropdown.js";import"../analytics-chips-and-dropdowns/AnalyticsMetric.js";import"../analytics-chips-and-dropdowns/chart/LineChart/LineChart.js";import"react-bootstrap";import"../analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.styled.js";import"../analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js";import"../analytics-chips-and-dropdowns/chart/Pie/PieChart.js";import"../analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js";import"../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js";import"../analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js";import"../analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js";import"../analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js";import{SearchIcon as O}from"../../assets/icons/searchIcon.js";var x,S;!function(e){e.STORY="story",e.POST="post",e.REEL="reel"}(x||(x={})),function(e){e.Today="Today",e["7_Days"]="7",e["30_Days"]="30",e.custom="custom",e.Yesterday="Yesterday"}(S||(S={}));const k=[{label:"Today",value:"today",key:S.Today,typeValue:[new Date,new Date]},{label:"Last 7 days",value:"7 days",key:S["7_Days"],typeValue:[new Date((new Date).setDate((new Date).getDate()-6)),new Date]},{label:"Last 30 days",value:"30 days",key:S["30_Days"],typeValue:[new Date((new Date).setDate((new Date).getDate()-29)),new Date]},{label:"Custom range",value:"calender",key:S.custom,isCustom:!0,dateRangeSelectionOptions:{selectRange:!0,maxDate:new Date((new Date).setMonth((new Date).getMonth()+3))}}],B=S=>{var B,I;const[P,L]=i(null!==(B=S.previouslySelected)&&void 0!==B?B:[]),[V,G]=i(""),[_,N]=i(!1),[R,$]=i(S.media),[A,M]=i(!1),[E,z]=i(!1);n((()=>{S.media.length||(N(!0),setTimeout((()=>{$(S.media),N(!1)}),2e3)),L(S.selected||[])}),[]),n((()=>{S.media.length>0&&($(S.media),N(!1))}),[null===(I=null==S?void 0:S.media)||void 0===I?void 0:I.length]),n((()=>{P.length>0&&G("")}),[P.length]),n((()=>{A&&($(S.media),z(!1))}),[A]);return e(t,{children:a(f,Object.assign({zIndex:201,open:S.showModal,headingTitle:S.title,onClose:S.onClose,centralContainerStyles:{width:1071,height:S.showFilter?612:564},primaryButton:{disabled:!R.length,buttonType:"primary",buttonText:`Select ${y(S.mediaType)}`,onClick:()=>{P.length?S.onSelect(P):G(`Please select a ${S.mediaType} to proceed`)}},secondaryButton:{buttonType:"secondary",buttonText:"Back",onClick:()=>S.onClose()},footerLeftCustomElement:V?e(s,{tagText:V,type:"negative",LeadingIcon:w}):P.length?a(h,{children:[P.length," selected"]}):null},{children:[S.showFilter&&a("div",Object.assign({style:{marginTop:24,marginBottom:24,padding:"0 24px",display:"flex",flexDirection:"row",gap:8,alignItems:"center"}},{children:[e(D,{options:k,placeholder:"posted on",resetDropdown:A,onOptionSelected:e=>{var t,a;let i=null,n=null;"Custom range"===e.label?(i=(null===(t=null==e?void 0:e.selectedRange)||void 0===t?void 0:t[0])||new Date,n=(null===(a=null==e?void 0:e.selectedRange)||void 0===a?void 0:a[1])||new Date):(i=e.typeValue[0],n=e.typeValue[1]);const o=S.media.filter((e=>function(e,t,a){const i=new Date(e),n=new Date(t),o=new Date(a);return i>=n&&i<=o}(e.timestamp,i,n)));$(o),z(!0),M(!1)}}),E&&e(l,Object.assign({color:u.content.secondary,onClick:()=>M(!0)},{children:"Clear"}))]})),_?e("div",Object.assign({style:{padding:"0 24px"}},{children:e(v,{boxes:[{width:(S.mediaType==x.POST?148:104)+"px",height:(S.mediaType==x.POST?148:172)+"px"}]})})):e(t,{children:R&&R.length?e(o,Object.assign({mediaType:S.mediaType},{children:R.map((t=>{return a(r,Object.assign({mediaType:S.mediaType,className:""+(i=t,n=P,n.some((e=>e.id===i.id))?"selected":""),onClick:()=>{return e=t,void L((()=>P.find((t=>t.id===e.id))?P.filter((t=>t.id!==e.id)):!S.limit||P.length<S.limit?[...P,e]:(G(`Only ${S.limit} ${S.mediaType}s can be selected`),P)));var e}},{children:[e(b,{imageUrl:t.imageUrl,width:S.mediaType==x.POST?148:104,height:S.mediaType==x.POST?148:172,alt:t.overlayCaption}),a("div",Object.assign({className:"overlay"},{children:[e("a",Object.assign({target:"_blank",rel:"noreferrer",href:t.redirectionUrl},{children:a("div",Object.assign({className:"overlay__redirection"},{children:[e(j,{height:22,width:22}),e(d,Object.assign({color:g,style:{fontWeight:500}},{children:"View"}))]}))})),e("div",Object.assign({className:"overlay__caption"},{children:e(c,Object.assign({color:u.content.placeholder},{children:t.overlayCaption}))}))]}))]}),t.id);var i,n}))})):e("div",Object.assign({style:{justifyContent:"center",alignItems:"center",display:"flex",height:422}},{children:S.media.length?R.length?e(t,{}):a("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"}},{children:[e("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"48px",height:"48px",backgroundColor:`${u.background.inverse}`,borderRadius:"50%"}},{children:e(O,{color:u.content.primaryInverse})})),a("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},{children:[e(p,{children:"No results found"}),e(d,{children:"Sorry we could not find any results for the selected filter"})]})),e("div",Object.assign({onClick:()=>{M(!0)}},{children:e(m,Object.assign({color:`${u.content.brand}`},{children:"Clear Filter"}))}))]})):e(C,{states:T.WARNING,heading:`No ${S.mediaType}s on your account`,subline:`There seems to be no ${S.mediaType}s on your account`,isButtonEnabled:!1,width:400})}))})]}))})};export{S as DateKeys,x as MEDIA_TYPES,B as PostPicker,k as dateOptions};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const WorkingStepper: () => JSX.Element;
2
3
  export declare enum STEPENUM {
3
4
  STEP1 = "STEP1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.224",
3
+ "version": "0.0.225",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",