@bikdotai/bik-component-library 0.0.725-beta.5 → 0.0.725-beta.7

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 t=require("../../node_modules/react/jsx-runtime.js"),s=require("../../assets/icons/whatsNew.svg.js"),e=require("../../constants/Theme.js"),n=require("../tooltips/Tooltip.js"),i=require("./WhatsNew.styles.js");exports.WhatsNewButton=o=>{let{onClick:r,newContentCount:a=0,isOpen:c=!1,isLoading:x=!1,tooltip:d="What's new",testId:j="whats-new-button",iconWidth:l=32,iconHeight:u=32,customIcon:p}=o;return x?t.jsxRuntimeExports.jsxs("div",Object.assign({style:{margin:"0px 8px"}},{children:[t.jsxRuntimeExports.jsx("div",{style:{width:16,height:16,border:"2px solid #f3f3f3",borderTop:"2px solid #731DCF",borderRadius:"50%",animation:"spin 1s linear infinite"}}),t.jsxRuntimeExports.jsx("style",{children:"\n\t\t\t\t\t\t@keyframes spin {\n\t\t\t\t\t\t\t0% { transform: rotate(0deg); }\n\t\t\t\t\t\t\t100% { transform: rotate(360deg); }\n\t\t\t\t\t\t}\n\t\t\t\t\t"})]})):t.jsxRuntimeExports.jsx(i.WhatsNewIconContainer,Object.assign({count:a},{children:t.jsxRuntimeExports.jsxs("div",Object.assign({className:"main-icon-class "+(c?"icon-active":""),style:{color:c?e.COLORS.content.brand:e.COLORS.content.primary},onClick:r,"data-testid":j},{children:[t.jsxRuntimeExports.jsx(n.Tooltip,Object.assign({body:d},{children:t.jsxRuntimeExports.jsx("div",{children:p?t.jsxRuntimeExports.jsx(p,{width:l,height:u,color:c?e.COLORS.content.brand:e.COLORS.content.primary}):t.jsxRuntimeExports.jsx(s.default,{})})})),a>0&&t.jsxRuntimeExports.jsx("div",Object.assign({className:"notification--count"},{children:t.jsxRuntimeExports.jsx("div",Object.assign({className:"count--text"},{children:a}))}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../node_modules/react/jsx-runtime.js"),s=require("../../assets/icons/whatsNew.svg.js"),e=require("../../constants/Theme.js"),n=require("../tooltips/Tooltip.js"),i=require("./WhatsNew.styles.js");exports.WhatsNewButton=o=>{let{onClick:r,newContentCount:a=0,isOpen:c=!1,isLoading:x=!1,tooltip:d="What's new",testId:j="whats-new-button",iconWidth:l=32,iconHeight:u=32,customIcon:p}=o;return x?t.jsxRuntimeExports.jsxs("div",Object.assign({style:{margin:"0px 8px"}},{children:[t.jsxRuntimeExports.jsx("div",{style:{width:16,height:16,border:"2px solid #f3f3f3",borderTop:"2px solid #731DCF",borderRadius:"50%",animation:"spin 1s linear infinite"}}),t.jsxRuntimeExports.jsx("style",{children:"\n\t\t\t\t\t\t@keyframes spin {\n\t\t\t\t\t\t\t0% { transform: rotate(0deg); }\n\t\t\t\t\t\t\t100% { transform: rotate(360deg); }\n\t\t\t\t\t\t}\n\t\t\t\t\t"})]})):t.jsxRuntimeExports.jsx(i.WhatsNewIconContainer,Object.assign({count:a},{children:t.jsxRuntimeExports.jsxs("div",Object.assign({className:"main-icon-class "+(c?"icon-active":""),style:{color:c?e.COLORS.content.brand:e.COLORS.content.primary},onClick:r,"data-testid":j},{children:[t.jsxRuntimeExports.jsx(n.Tooltip,Object.assign({body:d},{children:t.jsxRuntimeExports.jsx("div",{children:p?t.jsxRuntimeExports.jsx(p,{width:l,height:u,color:c?e.COLORS.content.brand:e.COLORS.content.primary}):t.jsxRuntimeExports.jsx(s.default,{width:l,height:u})})})),a>0&&t.jsxRuntimeExports.jsx("div",Object.assign({className:"notification--count"},{children:t.jsxRuntimeExports.jsx("div",Object.assign({className:"count--text"},{children:a}))}))]}))}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("date-fns"),s=require("react"),r=require("../../assets/icons/searchIconWhatsNew.svg.js"),n=require("../../assets/icons/whatsNew.svg.js"),i=require("../../constants/Theme.js"),a=require("../button/Button.js"),o=require("../feature-announcements/VideoModal.js"),c=require("../searchBar/searchBar.js"),d=require("../side-modal/SideModal.js"),x=require("../TypographyStyle.js"),l=require("./WhatsNew.styles.js");exports.WhatsNewPanel=u=>{let{isOpen:j,onClose:m,content:h,isLoading:p=!1,title:g="What's new on BIK",searchPlaceholder:R="Search posts",emptyStateTitle:E="Nothing new!",emptyStateDescription:w="There are no new updates or features at the moment. Check back soon!",noResultsText:b="Sorry, no results found.",width:C="480px",onContentClick:O,renderCustomContent:y}=u;const[f,N]=s.useState(""),[S,v]=s.useState(!1),[M,q]=s.useState(""),L=e=>{if(!e.createdAt)return!1;const s=e.createdAt.toDate?e.createdAt.toDate():new Date(e.createdAt);return t.differenceInBusinessDays(new Date,s)<7},T=s.useMemo((()=>{if(!f.trim())return h;const e=f.toLowerCase();return h.filter((t=>t.title.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||t.content&&t.content.toLowerCase().includes(e)))}),[h,f]),k=0===h.length,B=0===T.length;return j?e.jsxRuntimeExports.jsxs(d.SideModal,Object.assign({width:C,onClose:m,header:"",headerCustomComponent:e.jsxRuntimeExports.jsx(x.TitleMedium,Object.assign({color:i.COLORS.background.inverse},{children:g})),headerStyle:{background:i.COLORS.background.brandLight},hideFooter:!0},{children:[e.jsxRuntimeExports.jsxs(l.MainContainer,{children:[e.jsxRuntimeExports.jsx("div",Object.assign({className:"mt-8"},{children:e.jsxRuntimeExports.jsx(c.SearchBar,{width:"100%",isEnabled:!k,onChange:e=>{N(e)},onEnter:e=>{N(e)},placeholder:R,variant:"default",searchValue:f,onClickCross:()=>{N("")}})})),e.jsxRuntimeExports.jsx(l.WhatsNewWrapper,{children:k||B?e.jsxRuntimeExports.jsxs("div",Object.assign({className:"no--data--found"},{children:[e.jsxRuntimeExports.jsx("div",Object.assign({className:"icon--wrapper"},{children:k?e.jsxRuntimeExports.jsx(n.default,{}):e.jsxRuntimeExports.jsx(r.default,{})})),k?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(x.TitleRegular,{children:E}),e.jsxRuntimeExports.jsx(x.BodyPrimary,Object.assign({color:i.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:w}))]}):B?e.jsxRuntimeExports.jsx(x.BodyPrimary,Object.assign({color:i.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:b})):null]})):e.jsxRuntimeExports.jsx("div",Object.assign({className:"scroller"},{children:T.map(((s,r)=>y?y(s):e.jsxRuntimeExports.jsxs(l.MainCardContainer,Object.assign({className:"padding--16 mb-mt-8"},{children:[e.jsxRuntimeExports.jsx(l.BackgroundImageContainer,{imageUrl:s.image,height:"209px",width:"100%",style:{borderRadius:"4px"}}),e.jsxRuntimeExports.jsx("div",Object.assign({className:"mt-20 full--width"},{children:e.jsxRuntimeExports.jsxs("div",Object.assign({className:"created--at flex flex--row"},{children:[L(s)?e.jsxRuntimeExports.jsx("div",Object.assign({className:"new--content--tag"},{children:e.jsxRuntimeExports.jsx(x.Caption,{children:"New"})})):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}),e.jsxRuntimeExports.jsx(x.Caption,Object.assign({style:{color:i.COLORS.content.placeholder}},{children:s.createdAt?t.format(s.createdAt.toDate?s.createdAt.toDate():new Date(s.createdAt),"dd MMMM yyyy"):""}))]}))})),e.jsxRuntimeExports.jsx("div",Object.assign({className:"mt--8"},{children:e.jsxRuntimeExports.jsx(x.TitleSmall,{children:s.title})})),e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:s.body},className:"card--desc mt--12"}),e.jsxRuntimeExports.jsx("div",Object.assign({className:"flex flex--row mt-20 full--width"},{children:e.jsxRuntimeExports.jsx(a.Button,{buttonText:s.buttonText||"Explore the feature",onClick:()=>(e=>{e.productVideo?(q(e.productVideo),v(!0)):e.redirectUrl&&window.open(e.redirectUrl,"_blank"),O&&O(e)})(s),matchParentWidth:!0,size:"medium"})}))]}),`whats-new-${r}`)))}))})]}),e.jsxRuntimeExports.jsx(o.VideoModal,{isOpen:S,videoUrl:M,onClose:()=>{v(!1)}})]})):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("date-fns"),s=require("react"),r=require("../../assets/icons/searchIconWhatsNew.svg.js"),n=require("../../assets/icons/whatsNew.svg.js"),i=require("../../constants/Theme.js"),a=require("../button/Button.js"),o=require("../feature-announcements/VideoModal.js"),d=require("../searchBar/searchBar.js"),c=require("../side-modal/SideModal.js"),x=require("../TypographyStyle.js"),l=require("./WhatsNew.styles.js");exports.WhatsNewPanel=u=>{let{isOpen:j,onClose:m,content:h,isLoading:p=!1,title:g="What's new on BIK",searchPlaceholder:R="Search posts",emptyStateTitle:E="Nothing new!",emptyStateDescription:w="There are no new updates or features at the moment. Check back soon!",noResultsText:b="Sorry, no results found.",width:C="480px",onContentClick:O,renderCustomContent:y}=u;const[f,N]=s.useState(""),[S,v]=s.useState(!1),[M,q]=s.useState(""),L=e=>{if(!e.createdAt)return!1;const s=e.createdAt.toDate?e.createdAt.toDate():new Date(e.createdAt);return t.differenceInBusinessDays(new Date,s)<7},T=s.useMemo((()=>{if(!f.trim())return h;const e=f.toLowerCase();return h.filter((t=>t.title.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||t.content&&t.content.toLowerCase().includes(e)))}),[h,f]),k=0===h.length,B=0===T.length;return j?e.jsxRuntimeExports.jsxs(c.SideModal,Object.assign({width:C,onClose:m,header:"",headerCustomComponent:e.jsxRuntimeExports.jsx(x.TitleMedium,Object.assign({color:i.COLORS.background.inverse},{children:g})),headerStyle:{background:i.COLORS.background.brandLight},hideFooter:!0},{children:[e.jsxRuntimeExports.jsxs(l.MainContainer,{children:[e.jsxRuntimeExports.jsx("div",Object.assign({className:"mt-8"},{children:e.jsxRuntimeExports.jsx(d.SearchBar,{width:"100%",isEnabled:!k,onChange:e=>{N(e)},onEnter:e=>{N(e)},placeholder:R,variant:"default",searchValue:f,onClickCross:()=>{N("")}})})),e.jsxRuntimeExports.jsx(l.WhatsNewWrapper,{children:k||B?e.jsxRuntimeExports.jsxs("div",Object.assign({className:"no--data--found"},{children:[e.jsxRuntimeExports.jsx("div",Object.assign({className:"icon--wrapper"},{children:k?e.jsxRuntimeExports.jsx(n.default,{width:32,height:32}):e.jsxRuntimeExports.jsx(r.default,{width:32,height:32})})),k?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(x.TitleRegular,{children:E}),e.jsxRuntimeExports.jsx(x.BodyPrimary,Object.assign({color:i.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:w}))]}):B?e.jsxRuntimeExports.jsx(x.BodyPrimary,Object.assign({color:i.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:b})):null]})):e.jsxRuntimeExports.jsx("div",Object.assign({className:"scroller"},{children:T.map(((s,r)=>y?y(s):e.jsxRuntimeExports.jsxs(l.MainCardContainer,Object.assign({className:"padding--16 mb-mt-8"},{children:[e.jsxRuntimeExports.jsx(l.BackgroundImageContainer,{imageUrl:s.image,height:"209px",width:"100%",style:{borderRadius:"4px"}}),e.jsxRuntimeExports.jsx("div",Object.assign({className:"mt-20 full--width"},{children:e.jsxRuntimeExports.jsxs("div",Object.assign({className:"created--at flex flex--row"},{children:[L(s)?e.jsxRuntimeExports.jsx("div",Object.assign({className:"new--content--tag"},{children:e.jsxRuntimeExports.jsx(x.Caption,{children:"New"})})):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}),e.jsxRuntimeExports.jsx(x.Caption,Object.assign({style:{color:i.COLORS.content.placeholder}},{children:s.createdAt?t.format(s.createdAt.toDate?s.createdAt.toDate():new Date(s.createdAt),"dd MMMM yyyy"):""}))]}))})),e.jsxRuntimeExports.jsx("div",Object.assign({className:"mt--8"},{children:e.jsxRuntimeExports.jsx(x.TitleSmall,{children:s.title})})),e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:s.body},className:"card--desc mt--12"}),e.jsxRuntimeExports.jsx("div",Object.assign({className:"flex flex--row mt-20 full--width"},{children:e.jsxRuntimeExports.jsx(a.Button,{buttonText:s.buttonText||"Explore the feature",onClick:()=>(e=>{e.productVideo?(q(e.productVideo),v(!0)):e.redirectUrl&&window.open(e.redirectUrl,"_blank"),O&&O(e)})(s),matchParentWidth:!0,size:"medium"})}))]}),`whats-new-${r}`)))}))})]}),e.jsxRuntimeExports.jsx(o.VideoModal,{isOpen:S,videoUrl:M,onClose:()=>{v(!1)}})]})):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})};
@@ -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{j as t}from"../../node_modules/react/jsx-runtime.js";import s from"../../assets/icons/whatsNew.svg.js";import{COLORS as n}from"../../constants/Theme.js";import{Tooltip as i}from"../tooltips/Tooltip.js";import{WhatsNewIconContainer as e}from"./WhatsNew.styles.js";const o=o=>{let{onClick:r,newContentCount:a=0,isOpen:c=!1,isLoading:d=!1,tooltip:l="What's new",testId:m="whats-new-button",iconWidth:j=32,iconHeight:h=32,customIcon:p}=o;return d?t.jsxs("div",Object.assign({style:{margin:"0px 8px"}},{children:[t.jsx("div",{style:{width:16,height:16,border:"2px solid #f3f3f3",borderTop:"2px solid #731DCF",borderRadius:"50%",animation:"spin 1s linear infinite"}}),t.jsx("style",{children:"\n\t\t\t\t\t\t@keyframes spin {\n\t\t\t\t\t\t\t0% { transform: rotate(0deg); }\n\t\t\t\t\t\t\t100% { transform: rotate(360deg); }\n\t\t\t\t\t\t}\n\t\t\t\t\t"})]})):t.jsx(e,Object.assign({count:a},{children:t.jsxs("div",Object.assign({className:"main-icon-class "+(c?"icon-active":""),style:{color:c?n.content.brand:n.content.primary},onClick:r,"data-testid":m},{children:[t.jsx(i,Object.assign({body:l},{children:t.jsx("div",{children:p?t.jsx(p,{width:j,height:h,color:c?n.content.brand:n.content.primary}):t.jsx(s,{})})})),a>0&&t.jsx("div",Object.assign({className:"notification--count"},{children:t.jsx("div",Object.assign({className:"count--text"},{children:a}))}))]}))}))};export{o as WhatsNewButton};
1
+ import{j as t}from"../../node_modules/react/jsx-runtime.js";import s from"../../assets/icons/whatsNew.svg.js";import{COLORS as n}from"../../constants/Theme.js";import{Tooltip as i}from"../tooltips/Tooltip.js";import{WhatsNewIconContainer as e}from"./WhatsNew.styles.js";const o=o=>{let{onClick:r,newContentCount:a=0,isOpen:c=!1,isLoading:d=!1,tooltip:l="What's new",testId:m="whats-new-button",iconWidth:h=32,iconHeight:j=32,customIcon:p}=o;return d?t.jsxs("div",Object.assign({style:{margin:"0px 8px"}},{children:[t.jsx("div",{style:{width:16,height:16,border:"2px solid #f3f3f3",borderTop:"2px solid #731DCF",borderRadius:"50%",animation:"spin 1s linear infinite"}}),t.jsx("style",{children:"\n\t\t\t\t\t\t@keyframes spin {\n\t\t\t\t\t\t\t0% { transform: rotate(0deg); }\n\t\t\t\t\t\t\t100% { transform: rotate(360deg); }\n\t\t\t\t\t\t}\n\t\t\t\t\t"})]})):t.jsx(e,Object.assign({count:a},{children:t.jsxs("div",Object.assign({className:"main-icon-class "+(c?"icon-active":""),style:{color:c?n.content.brand:n.content.primary},onClick:r,"data-testid":m},{children:[t.jsx(i,Object.assign({body:l},{children:t.jsx("div",{children:p?t.jsx(p,{width:h,height:j,color:c?n.content.brand:n.content.primary}):t.jsx(s,{width:h,height:j})})})),a>0&&t.jsx("div",Object.assign({className:"notification--count"},{children:t.jsx("div",Object.assign({className:"count--text"},{children:a}))}))]}))}))};export{o as WhatsNewButton};
@@ -1 +1 @@
1
- import{j as e}from"../../node_modules/react/jsx-runtime.js";import{format as t,differenceInBusinessDays as s}from"date-fns";import{useState as n,useMemo as r}from"react";import a from"../../assets/icons/searchIconWhatsNew.svg.js";import o from"../../assets/icons/whatsNew.svg.js";import{COLORS as i}from"../../constants/Theme.js";import{Button as c}from"../button/Button.js";import{VideoModal as d}from"../feature-announcements/VideoModal.js";import{SearchBar as l}from"../searchBar/searchBar.js";import{SideModal as m}from"../side-modal/SideModal.js";import{TitleMedium as h,TitleRegular as j,BodyPrimary as x,Caption as g,TitleSmall as u}from"../TypographyStyle.js";import{MainContainer as p,WhatsNewWrapper as b,MainCardContainer as w,BackgroundImageContainer as f}from"./WhatsNew.styles.js";const y=y=>{let{isOpen:C,onClose:N,content:O,isLoading:v=!1,title:k="What's new on BIK",searchPlaceholder:A="Search posts",emptyStateTitle:D="Nothing new!",emptyStateDescription:S="There are no new updates or features at the moment. Check back soon!",noResultsText:T="Sorry, no results found.",width:L="480px",onContentClick:M,renderCustomContent:W}=y;const[B,F]=n(""),[U,V]=n(!1),[_,E]=n(""),I=e=>{if(!e.createdAt)return!1;const t=e.createdAt.toDate?e.createdAt.toDate():new Date(e.createdAt);return s(new Date,t)<7},P=r((()=>{if(!B.trim())return O;const e=B.toLowerCase();return O.filter((t=>t.title.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||t.content&&t.content.toLowerCase().includes(e)))}),[O,B]),R=0===O.length,z=0===P.length;return C?e.jsxs(m,Object.assign({width:L,onClose:N,header:"",headerCustomComponent:e.jsx(h,Object.assign({color:i.background.inverse},{children:k})),headerStyle:{background:i.background.brandLight},hideFooter:!0},{children:[e.jsxs(p,{children:[e.jsx("div",Object.assign({className:"mt-8"},{children:e.jsx(l,{width:"100%",isEnabled:!R,onChange:e=>{F(e)},onEnter:e=>{F(e)},placeholder:A,variant:"default",searchValue:B,onClickCross:()=>{F("")}})})),e.jsx(b,{children:R||z?e.jsxs("div",Object.assign({className:"no--data--found"},{children:[e.jsx("div",Object.assign({className:"icon--wrapper"},{children:R?e.jsx(o,{}):e.jsx(a,{})})),R?e.jsxs(e.Fragment,{children:[e.jsx(j,{children:D}),e.jsx(x,Object.assign({color:i.content.secondary,className:"text--align",style:{maxWidth:300}},{children:S}))]}):z?e.jsx(x,Object.assign({color:i.content.secondary,className:"text--align",style:{maxWidth:300}},{children:T})):null]})):e.jsx("div",Object.assign({className:"scroller"},{children:P.map(((s,n)=>W?W(s):e.jsxs(w,Object.assign({className:"padding--16 mb-mt-8"},{children:[e.jsx(f,{imageUrl:s.image,height:"209px",width:"100%",style:{borderRadius:"4px"}}),e.jsx("div",Object.assign({className:"mt-20 full--width"},{children:e.jsxs("div",Object.assign({className:"created--at flex flex--row"},{children:[I(s)?e.jsx("div",Object.assign({className:"new--content--tag"},{children:e.jsx(g,{children:"New"})})):e.jsx(e.Fragment,{}),e.jsx(g,Object.assign({style:{color:i.content.placeholder}},{children:s.createdAt?t(s.createdAt.toDate?s.createdAt.toDate():new Date(s.createdAt),"dd MMMM yyyy"):""}))]}))})),e.jsx("div",Object.assign({className:"mt--8"},{children:e.jsx(u,{children:s.title})})),e.jsx("div",{dangerouslySetInnerHTML:{__html:s.body},className:"card--desc mt--12"}),e.jsx("div",Object.assign({className:"flex flex--row mt-20 full--width"},{children:e.jsx(c,{buttonText:s.buttonText||"Explore the feature",onClick:()=>(e=>{e.productVideo?(E(e.productVideo),V(!0)):e.redirectUrl&&window.open(e.redirectUrl,"_blank"),M&&M(e)})(s),matchParentWidth:!0,size:"medium"})}))]}),`whats-new-${n}`)))}))})]}),e.jsx(d,{isOpen:U,videoUrl:_,onClose:()=>{V(!1)}})]})):e.jsx(e.Fragment,{})};export{y as WhatsNewPanel};
1
+ import{j as e}from"../../node_modules/react/jsx-runtime.js";import{format as t,differenceInBusinessDays as s}from"date-fns";import{useState as n,useMemo as r}from"react";import a from"../../assets/icons/searchIconWhatsNew.svg.js";import o from"../../assets/icons/whatsNew.svg.js";import{COLORS as i}from"../../constants/Theme.js";import{Button as c}from"../button/Button.js";import{VideoModal as d}from"../feature-announcements/VideoModal.js";import{SearchBar as l}from"../searchBar/searchBar.js";import{SideModal as h}from"../side-modal/SideModal.js";import{TitleMedium as m,TitleRegular as j,BodyPrimary as x,Caption as g,TitleSmall as u}from"../TypographyStyle.js";import{MainContainer as p,WhatsNewWrapper as w,MainCardContainer as b,BackgroundImageContainer as f}from"./WhatsNew.styles.js";const y=y=>{let{isOpen:C,onClose:N,content:O,isLoading:v=!1,title:k="What's new on BIK",searchPlaceholder:A="Search posts",emptyStateTitle:D="Nothing new!",emptyStateDescription:S="There are no new updates or features at the moment. Check back soon!",noResultsText:T="Sorry, no results found.",width:L="480px",onContentClick:M,renderCustomContent:W}=y;const[B,F]=n(""),[U,V]=n(!1),[_,E]=n(""),I=e=>{if(!e.createdAt)return!1;const t=e.createdAt.toDate?e.createdAt.toDate():new Date(e.createdAt);return s(new Date,t)<7},P=r((()=>{if(!B.trim())return O;const e=B.toLowerCase();return O.filter((t=>t.title.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||t.content&&t.content.toLowerCase().includes(e)))}),[O,B]),R=0===O.length,z=0===P.length;return C?e.jsxs(h,Object.assign({width:L,onClose:N,header:"",headerCustomComponent:e.jsx(m,Object.assign({color:i.background.inverse},{children:k})),headerStyle:{background:i.background.brandLight},hideFooter:!0},{children:[e.jsxs(p,{children:[e.jsx("div",Object.assign({className:"mt-8"},{children:e.jsx(l,{width:"100%",isEnabled:!R,onChange:e=>{F(e)},onEnter:e=>{F(e)},placeholder:A,variant:"default",searchValue:B,onClickCross:()=>{F("")}})})),e.jsx(w,{children:R||z?e.jsxs("div",Object.assign({className:"no--data--found"},{children:[e.jsx("div",Object.assign({className:"icon--wrapper"},{children:R?e.jsx(o,{width:32,height:32}):e.jsx(a,{width:32,height:32})})),R?e.jsxs(e.Fragment,{children:[e.jsx(j,{children:D}),e.jsx(x,Object.assign({color:i.content.secondary,className:"text--align",style:{maxWidth:300}},{children:S}))]}):z?e.jsx(x,Object.assign({color:i.content.secondary,className:"text--align",style:{maxWidth:300}},{children:T})):null]})):e.jsx("div",Object.assign({className:"scroller"},{children:P.map(((s,n)=>W?W(s):e.jsxs(b,Object.assign({className:"padding--16 mb-mt-8"},{children:[e.jsx(f,{imageUrl:s.image,height:"209px",width:"100%",style:{borderRadius:"4px"}}),e.jsx("div",Object.assign({className:"mt-20 full--width"},{children:e.jsxs("div",Object.assign({className:"created--at flex flex--row"},{children:[I(s)?e.jsx("div",Object.assign({className:"new--content--tag"},{children:e.jsx(g,{children:"New"})})):e.jsx(e.Fragment,{}),e.jsx(g,Object.assign({style:{color:i.content.placeholder}},{children:s.createdAt?t(s.createdAt.toDate?s.createdAt.toDate():new Date(s.createdAt),"dd MMMM yyyy"):""}))]}))})),e.jsx("div",Object.assign({className:"mt--8"},{children:e.jsx(u,{children:s.title})})),e.jsx("div",{dangerouslySetInnerHTML:{__html:s.body},className:"card--desc mt--12"}),e.jsx("div",Object.assign({className:"flex flex--row mt-20 full--width"},{children:e.jsx(c,{buttonText:s.buttonText||"Explore the feature",onClick:()=>(e=>{e.productVideo?(E(e.productVideo),V(!0)):e.redirectUrl&&window.open(e.redirectUrl,"_blank"),M&&M(e)})(s),matchParentWidth:!0,size:"medium"})}))]}),`whats-new-${n}`)))}))})]}),e.jsx(d,{isOpen:U,videoUrl:_,onClose:()=>{V(!1)}})]})):e.jsx(e.Fragment,{})};export{y as WhatsNewPanel};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.725-beta.5",
3
+ "version": "0.0.725-beta.7",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",