@bikdotai/bik-component-library 0.0.721-beta.38 → 0.0.721-beta.40

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 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react"),n=require("./WhatsNewButton.js"),o=require("./WhatsNewPanel.js"),s=require("./WhatsNewProvider.js");exports.WhatsNew=r=>{let{title:i="What's new",tooltip:a="What's new",searchPlaceholder:u="Search posts",emptyStateTitle:c="Nothing new!",emptyStateDescription:h="There are no new updates or features at the moment. Check back soon!",noResultsText:l="Sorry, no results found.",width:d="480px",onContentClick:p,renderCustomContent:w,buttonTestId:x="whats-new-button",iconWidth:m=32,iconHeight:C=32,customIcon:j}=r;const[W,N]=t.useState(!1),[S,g]=t.useState(!1),{whatsNewContent:y,isLoading:P,newContentCount:R}=s.useWhatsNewContext();t.useEffect((()=>{R>0&&!W&&g(!0)}),[R,W]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(n.WhatsNewButton,{onClick:()=>{N(!0),g(!1)},newContentCount:R,isOpen:W,isLoading:P,tooltip:a,testId:x,iconWidth:m,iconHeight:C,customIcon:j,shouldBounce:S}),e.jsxRuntimeExports.jsx(o.WhatsNewPanel,{isOpen:W,onClose:()=>N(!1),content:y,isLoading:P,title:i,searchPlaceholder:u,emptyStateTitle:c,emptyStateDescription:h,noResultsText:l,width:d,onContentClick:e=>{p&&p(e)},renderCustomContent:w})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../node_modules/react/jsx-runtime.js"),e=require("react"),n=require("./WhatsNewButton.js"),o=require("./WhatsNewPanel.js"),s=require("./WhatsNewProvider.js");exports.WhatsNew=r=>{let{title:i="What's new",tooltip:a="What's new",searchPlaceholder:u="Search posts",emptyStateTitle:c="Nothing new!",emptyStateDescription:h="There are no new updates or features at the moment. Check back soon!",noResultsText:l="Sorry, no results found.",width:d="480px",onContentClick:p,renderCustomContent:w,buttonTestId:x="whats-new-button",iconWidth:m=32,iconHeight:C=32,customIcon:j}=r;const[W,N]=e.useState(!1),{whatsNewContent:g,isLoading:S,newContentCount:y}=s.useWhatsNewContext();return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(n.WhatsNewButton,{onClick:()=>N(!0),newContentCount:y,isOpen:W,isLoading:S,tooltip:a,testId:x,iconWidth:m,iconHeight:C,customIcon:j}),t.jsxRuntimeExports.jsx(o.WhatsNewPanel,{isOpen:W,onClose:()=>N(!1),content:g,isLoading:S,title:i,searchPlaceholder:u,emptyStateTitle:c,emptyStateDescription:h,noResultsText:l,width:d,onContentClick:t=>{p&&p(t)},renderCustomContent:w})]})};
@@ -1,6 +1,5 @@
1
1
  export declare const WhatsNewIconContainer: import("styled-components").StyledComponent<"div", any, {
2
2
  count?: number | undefined;
3
- shouldBounce?: boolean | undefined;
4
3
  }, never>;
5
4
  export declare const WhatsNewWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
6
5
  export declare const MainContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,22 +1,6 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(e);const a=e.keyframes`
2
- 0%, 100% {
3
- transform: translateY(0);
4
- }
5
- 25% {
6
- transform: translateY(-8px);
7
- }
8
- 50% {
9
- transform: translateY(-4px);
10
- }
11
- 75% {
12
- transform: translateY(-2px);
13
- }
14
- `,i=r.default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=i(e);const r=n.default.div`
15
2
  cursor: pointer;
16
3
  position: relative;
17
- ${t=>t.shouldBounce&&e.css`
18
- animation: ${a} 600ms ease-in-out;
19
- `}
20
4
 
21
5
  .main-icon-class {
22
6
  padding: 6px;
@@ -56,7 +40,7 @@
56
40
  font-weight: 400;
57
41
  color: ${t.COLORS.surface.standard};
58
42
  }
59
- `,o=r.default.div`
43
+ `,a=n.default.div`
60
44
  overflow-y: auto;
61
45
  display: flex;
62
46
  flex-direction: column;
@@ -173,11 +157,11 @@
173
157
  align-items: center;
174
158
  margin-right: 8px;
175
159
  }
176
- `,d=r.default.div`
160
+ `,o=n.default.div`
177
161
  display: flex;
178
162
  flex-direction: column;
179
163
  height: 100%;
180
- `,p=r.default.div`
164
+ `,d=n.default.div`
181
165
  background: ${t.COLORS.surface.standard};
182
166
  border-radius: 8px;
183
167
  border: 1px solid ${t.COLORS.stroke.primary};
@@ -190,7 +174,7 @@
190
174
  &:hover {
191
175
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
192
176
  }
193
- `,s=r.default.div`
177
+ `,p=n.default.div`
194
178
  background-image: url(${e=>e.imageUrl});
195
179
  background-size: cover;
196
180
  background-position: center;
@@ -198,4 +182,4 @@
198
182
  height: ${e=>e.height||"200px"};
199
183
  width: ${e=>e.width||"100%"};
200
184
  border-radius: 4px;
201
- `;exports.BackgroundImageContainer=s,exports.MainCardContainer=p,exports.MainContainer=d,exports.WhatsNewIconContainer=i,exports.WhatsNewWrapper=o;
185
+ `;exports.BackgroundImageContainer=p,exports.MainCardContainer=d,exports.MainContainer=o,exports.WhatsNewIconContainer=r,exports.WhatsNewWrapper=a;
@@ -34,7 +34,6 @@ export interface WhatsNewButtonProps {
34
34
  height?: number;
35
35
  color?: string;
36
36
  }>;
37
- shouldBounce?: boolean;
38
37
  }
39
38
  export interface WhatsNewPanelProps {
40
39
  isOpen: boolean;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../node_modules/react/jsx-runtime.js"),s=require("../../constants/Theme.js"),e=require("../tooltips/Tooltip.js"),n=require("./WhatsNew.styles.js");const i=s=>{let{width:e=32,height:n=32}=s;return t.jsxRuntimeExports.jsxs("svg",Object.assign({width:e,height:n,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[t.jsxRuntimeExports.jsxs("g",Object.assign({clipPath:"url(#clip0_4309_13422)"},{children:[t.jsxRuntimeExports.jsx("path",{d:"M22.1797 15.3052L15.4548 24.4022C15.3815 24.5014 15.3339 24.6172 15.316 24.7392C15.2982 24.8613 15.3108 24.9859 15.3526 25.1019L15.7733 26.2675C15.8141 26.3806 15.8815 26.4822 15.9698 26.5638C16.0581 26.6454 16.1647 26.7046 16.2806 26.7364C16.3966 26.7682 16.5185 26.7716 16.636 26.7464C16.7536 26.7212 16.8634 26.6681 16.9561 26.5916L20.7368 23.5654",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsxRuntimeExports.jsx("path",{d:"M6.4457 17.6642C6.36082 17.7791 6.31051 17.9158 6.30068 18.0583C6.29085 18.2008 6.32192 18.3431 6.39022 18.4686C6.45853 18.594 6.56123 18.6973 6.68626 18.7664C6.81128 18.8355 6.95343 18.8674 7.09598 18.8584C13.4962 18.4646 17.7214 21.3363 17.7214 21.3363L20.7369 23.5654C21.5366 24.1567 22.5385 24.406 23.5221 24.2585C24.5056 24.111 25.3903 23.5789 25.9816 22.7791C26.5728 21.9794 26.8221 20.9775 26.6746 19.9939C26.5272 19.0104 25.995 18.1257 25.1952 17.5344L22.1797 15.3053C22.1797 15.3053 18.1953 12.1079 16.6943 5.87443C16.6611 5.7356 16.5889 5.60913 16.4863 5.50988C16.3837 5.41062 16.2549 5.34272 16.1151 5.31413C15.9752 5.28554 15.8301 5.29746 15.6968 5.34849C15.5635 5.39952 15.4475 5.48754 15.3624 5.6022L6.4457 17.6642Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsxRuntimeExports.jsx("path",{d:"M7.69175 12.0819L5.24902 11.3518",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsxRuntimeExports.jsx("path",{d:"M10.9423 8.35748L9.88867 6.03589",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsxRuntimeExports.jsx("path",{d:"M8.91955 9.68574L5.66699 6.87134",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})),t.jsxRuntimeExports.jsx("defs",{children:t.jsxRuntimeExports.jsx("clipPath",Object.assign({id:"clip0_4309_13422"},{children:t.jsxRuntimeExports.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(4 4)"})}))})]}))};exports.WhatsNewButton=r=>{let{onClick:o,newContentCount:x=0,isOpen:c=!1,isLoading:d=!1,tooltip:a="What's new",testId:j="whats-new-button",iconWidth:u=32,iconHeight:l=32,customIcon:h,shouldBounce:p=!1}=r;return d?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(n.WhatsNewIconContainer,Object.assign({count:x,shouldBounce:p},{children:t.jsxRuntimeExports.jsxs("div",Object.assign({className:"main-icon-class "+(c?"icon-active":""),style:{color:c?s.COLORS.content.brand:s.COLORS.content.primary},onClick:o,"data-testid":j},{children:[t.jsxRuntimeExports.jsx(e.Tooltip,Object.assign({body:a},{children:t.jsxRuntimeExports.jsx("div",{children:h?t.jsxRuntimeExports.jsx(h,{width:u,height:l,color:c?s.COLORS.content.brand:s.COLORS.content.primary}):t.jsxRuntimeExports.jsx(i,{width:u,height:l})})})),x>0&&t.jsxRuntimeExports.jsx("div",Object.assign({className:"notification--count"},{children:t.jsxRuntimeExports.jsx("div",Object.assign({className:"count--text"},{children:x}))}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../node_modules/react/jsx-runtime.js"),s=require("../../constants/Theme.js"),e=require("../tooltips/Tooltip.js"),n=require("./WhatsNew.styles.js");const i=s=>{let{width:e=32,height:n=32}=s;return t.jsxRuntimeExports.jsxs("svg",Object.assign({width:e,height:n,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[t.jsxRuntimeExports.jsxs("g",Object.assign({clipPath:"url(#clip0_4309_13422)"},{children:[t.jsxRuntimeExports.jsx("path",{d:"M22.1797 15.3052L15.4548 24.4022C15.3815 24.5014 15.3339 24.6172 15.316 24.7392C15.2982 24.8613 15.3108 24.9859 15.3526 25.1019L15.7733 26.2675C15.8141 26.3806 15.8815 26.4822 15.9698 26.5638C16.0581 26.6454 16.1647 26.7046 16.2806 26.7364C16.3966 26.7682 16.5185 26.7716 16.636 26.7464C16.7536 26.7212 16.8634 26.6681 16.9561 26.5916L20.7368 23.5654",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsxRuntimeExports.jsx("path",{d:"M6.4457 17.6642C6.36082 17.7791 6.31051 17.9158 6.30068 18.0583C6.29085 18.2008 6.32192 18.3431 6.39022 18.4686C6.45853 18.594 6.56123 18.6973 6.68626 18.7664C6.81128 18.8355 6.95343 18.8674 7.09598 18.8584C13.4962 18.4646 17.7214 21.3363 17.7214 21.3363L20.7369 23.5654C21.5366 24.1567 22.5385 24.406 23.5221 24.2585C24.5056 24.111 25.3903 23.5789 25.9816 22.7791C26.5728 21.9794 26.8221 20.9775 26.6746 19.9939C26.5272 19.0104 25.995 18.1257 25.1952 17.5344L22.1797 15.3053C22.1797 15.3053 18.1953 12.1079 16.6943 5.87443C16.6611 5.7356 16.5889 5.60913 16.4863 5.50988C16.3837 5.41062 16.2549 5.34272 16.1151 5.31413C15.9752 5.28554 15.8301 5.29746 15.6968 5.34849C15.5635 5.39952 15.4475 5.48754 15.3624 5.6022L6.4457 17.6642Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsxRuntimeExports.jsx("path",{d:"M7.69175 12.0819L5.24902 11.3518",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsxRuntimeExports.jsx("path",{d:"M10.9423 8.35748L9.88867 6.03589",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsxRuntimeExports.jsx("path",{d:"M8.91955 9.68574L5.66699 6.87134",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})),t.jsxRuntimeExports.jsx("defs",{children:t.jsxRuntimeExports.jsx("clipPath",Object.assign({id:"clip0_4309_13422"},{children:t.jsxRuntimeExports.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(4 4)"})}))})]}))};exports.WhatsNewButton=r=>{let{onClick:o,newContentCount:x=0,isOpen:c=!1,isLoading:d=!1,tooltip:a="What's new",testId:j="whats-new-button",iconWidth:l=32,iconHeight:p=32,customIcon:u}=r;return d?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(n.WhatsNewIconContainer,Object.assign({count:x},{children:t.jsxRuntimeExports.jsxs("div",Object.assign({className:"main-icon-class "+(c?"icon-active":""),style:{color:c?s.COLORS.content.brand:s.COLORS.content.primary},onClick:o,"data-testid":j},{children:[t.jsxRuntimeExports.jsx(e.Tooltip,Object.assign({body:a},{children:t.jsxRuntimeExports.jsx("div",{children:u?t.jsxRuntimeExports.jsx(u,{width:l,height:p,color:c?s.COLORS.content.brand:s.COLORS.content.primary}):t.jsxRuntimeExports.jsx(i,{width:l,height:p})})})),x>0&&t.jsxRuntimeExports.jsx("div",Object.assign({className:"notification--count"},{children:t.jsxRuntimeExports.jsx("div",Object.assign({className:"count--text"},{children:x}))}))]}))}))};
@@ -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"),n=require("../../constants/Theme.js"),r=require("../button/Button.js"),o=require("../feature-announcements/VideoModal.js"),i=require("../searchBar/searchBar.js"),a=require("../side-modal/SideModal.js"),l=require("../TypographyStyle.js"),d=require("./WhatsNew.styles.js");const c=t=>{let{width:s=32,height:n=32}=t;return e.jsxRuntimeExports.jsx("svg",Object.assign({width:s,height:n,viewBox:"0 0 24 24",fill:"none"},{children:e.jsxRuntimeExports.jsx("path",{d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}))},x=t=>{let{width:s=32,height:n=32}=t;return e.jsxRuntimeExports.jsxs("svg",Object.assign({width:s,height:n,viewBox:"0 0 32 32",fill:"none"},{children:[e.jsxRuntimeExports.jsx("path",{d:"M16 2C8.268 2 2 8.268 2 16s6.268 14 14 14 14-6.268 14-14S23.732 2 16 2zm0 25c-6.065 0-11-4.935-11-11S9.935 5 16 5s11 4.935 11 11-4.935 11-11 11z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{d:"M16 10.5c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5zM15 15h2v8h-2v-8z",fill:"currentColor"})]}))};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:C="Nothing new!",emptyStateDescription:E="There are no new updates or features at the moment. Check back soon!",noResultsText:w="Sorry, no results found.",width:b="480px",onContentClick:O,renderCustomContent:y}=u;const[f,v]=s.useState(""),[S,M]=s.useState(!1),[N,k]=s.useState("");console.log("WhatsNewPanel render - isVideoModalOpen:",S,"videoUrl:",N);const 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},B=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]),T=0===h.length,q=0===B.length;return j?e.jsxRuntimeExports.jsxs(a.SideModal,Object.assign({width:b,onClose:m,header:"",headerCustomComponent:e.jsxRuntimeExports.jsx(l.TitleMedium,Object.assign({color:n.COLORS.background.inverse},{children:g})),headerStyle:{background:n.COLORS.background.brandLight},hideFooter:!0},{children:[e.jsxRuntimeExports.jsxs(d.MainContainer,{children:[e.jsxRuntimeExports.jsx("div",Object.assign({className:"mt-8"},{children:e.jsxRuntimeExports.jsx(i.SearchBar,{width:"100%",isEnabled:!T,onChange:e=>{v(e)},onEnter:e=>{v(e)},placeholder:R,variant:"default",searchValue:f,onClickCross:()=>{v("")}})})),e.jsxRuntimeExports.jsx(d.WhatsNewWrapper,{children:T||q?e.jsxRuntimeExports.jsxs("div",Object.assign({className:"no--data--found"},{children:[e.jsxRuntimeExports.jsx("div",Object.assign({className:"icon--wrapper"},{children:T?e.jsxRuntimeExports.jsx(x,{width:32,height:32}):e.jsxRuntimeExports.jsx(c,{width:32,height:32})})),T?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(l.TitleRegular,{children:C}),e.jsxRuntimeExports.jsx(l.BodyPrimary,Object.assign({color:n.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:E}))]}):q?e.jsxRuntimeExports.jsx(l.BodyPrimary,Object.assign({color:n.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:w})):null]})):e.jsxRuntimeExports.jsx("div",Object.assign({className:"scroller"},{children:B.map(((s,o)=>y?y(s):e.jsxRuntimeExports.jsxs(d.MainCardContainer,Object.assign({className:"padding--16 mb-mt-8"},{children:[e.jsxRuntimeExports.jsx(d.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(l.Caption,{children:"New"})})):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}),e.jsxRuntimeExports.jsx(l.Caption,Object.assign({style:{color:n.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(l.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(r.Button,{buttonText:s.buttonText||"Explore the feature",onClick:()=>(e=>{console.log("handleContentClick called with:",e),console.log("productVideo:",e.productVideo),console.log("redirectUrl:",e.redirectUrl),console.log("onContentClick:",O),e.productVideo?(console.log("Setting video URL:",e.productVideo),k(e.productVideo),M(!0),console.log("Video modal state set to true")):e.redirectUrl&&(console.log("Opening redirectUrl:",e.redirectUrl),window.open(e.redirectUrl,"_blank")),O&&(console.log("Calling onContentClick for analytics"),O(e))})(s),matchParentWidth:!0,size:"medium"})}))]}),`whats-new-${o}`)))}))})]}),e.jsxRuntimeExports.jsx(o.VideoModal,{isOpen:S,videoUrl:N,onClose:()=>{console.log("Closing video modal"),M(!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("../../constants/Theme.js"),n=require("../button/Button.js"),i=require("../feature-announcements/VideoModal.js"),o=require("../searchBar/searchBar.js"),a=require("../side-modal/SideModal.js"),x=require("../TypographyStyle.js"),d=require("./WhatsNew.styles.js");const l=t=>{let{width:s=32,height:r=32}=t;return e.jsxRuntimeExports.jsx("svg",Object.assign({width:s,height:r,viewBox:"0 0 24 24",fill:"none"},{children:e.jsxRuntimeExports.jsx("path",{d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}))},c=t=>{let{width:s=32,height:r=32}=t;return e.jsxRuntimeExports.jsxs("svg",Object.assign({width:s,height:r,viewBox:"0 0 32 32",fill:"none"},{children:[e.jsxRuntimeExports.jsx("path",{d:"M16 2C8.268 2 2 8.268 2 16s6.268 14 14 14 14-6.268 14-14S23.732 2 16 2zm0 25c-6.065 0-11-4.935-11-11S9.935 5 16 5s11 4.935 11 11-4.935 11-11 11z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{d:"M16 10.5c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5zM15 15h2v8h-2v-8z",fill:"currentColor"})]}))};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:C="Sorry, no results found.",width:b="480px",onContentClick:O,renderCustomContent:y}=u;const[f,v]=s.useState(""),[S,M]=s.useState(!1),[N,k]=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},B=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]),T=0===h.length,q=0===B.length;return j?e.jsxRuntimeExports.jsxs(a.SideModal,Object.assign({width:b,onClose:m,header:"",headerCustomComponent:e.jsxRuntimeExports.jsx(x.TitleMedium,Object.assign({color:r.COLORS.background.inverse},{children:g})),headerStyle:{background:r.COLORS.background.brandLight},hideFooter:!0},{children:[e.jsxRuntimeExports.jsxs(d.MainContainer,{children:[e.jsxRuntimeExports.jsx("div",Object.assign({className:"mt-8"},{children:e.jsxRuntimeExports.jsx(o.SearchBar,{width:"100%",isEnabled:!T,onChange:e=>{v(e)},onEnter:e=>{v(e)},placeholder:R,variant:"default",searchValue:f,onClickCross:()=>{v("")}})})),e.jsxRuntimeExports.jsx(d.WhatsNewWrapper,{children:T||q?e.jsxRuntimeExports.jsxs("div",Object.assign({className:"no--data--found"},{children:[e.jsxRuntimeExports.jsx("div",Object.assign({className:"icon--wrapper"},{children:T?e.jsxRuntimeExports.jsx(c,{width:32,height:32}):e.jsxRuntimeExports.jsx(l,{width:32,height:32})})),T?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(x.TitleRegular,{children:E}),e.jsxRuntimeExports.jsx(x.BodyPrimary,Object.assign({color:r.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:w}))]}):q?e.jsxRuntimeExports.jsx(x.BodyPrimary,Object.assign({color:r.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:C})):null]})):e.jsxRuntimeExports.jsx("div",Object.assign({className:"scroller"},{children:B.map(((s,i)=>y?y(s):e.jsxRuntimeExports.jsxs(d.MainCardContainer,Object.assign({className:"padding--16 mb-mt-8"},{children:[e.jsxRuntimeExports.jsx(d.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:r.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(n.Button,{buttonText:s.buttonText||"Explore the feature",onClick:()=>(e=>{e.productVideo?(k(e.productVideo),M(!0)):e.redirectUrl&&window.open(e.redirectUrl,"_blank"),O&&O(e)})(s),matchParentWidth:!0,size:"medium"})}))]}),`whats-new-${i}`)))}))})]}),e.jsxRuntimeExports.jsx(i.VideoModal,{isOpen:S,videoUrl:N,onClose:()=>{M(!1)}})]})):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})};
@@ -1 +1 @@
1
- import{j as t}from"../../node_modules/react/jsx-runtime.js";import{useState as e,useEffect as o}from"react";import{WhatsNewButton as n}from"./WhatsNewButton.js";import{WhatsNewPanel as s}from"./WhatsNewPanel.js";import{useWhatsNewContext as i}from"./WhatsNewProvider.js";const r=r=>{let{title:a="What's new",tooltip:c="What's new",searchPlaceholder:h="Search posts",emptyStateTitle:m="Nothing new!",emptyStateDescription:l="There are no new updates or features at the moment. Check back soon!",noResultsText:d="Sorry, no results found.",width:u="480px",onContentClick:p,renderCustomContent:C,buttonTestId:w="whats-new-button",iconWidth:j=32,iconHeight:x=32,customIcon:f}=r;const[g,W]=e(!1),[S,T]=e(!1),{whatsNewContent:k,isLoading:y,newContentCount:N}=i();o((()=>{N>0&&!g&&T(!0)}),[N,g]);return t.jsxs(t.Fragment,{children:[t.jsx(n,{onClick:()=>{W(!0),T(!1)},newContentCount:N,isOpen:g,isLoading:y,tooltip:c,testId:w,iconWidth:j,iconHeight:x,customIcon:f,shouldBounce:S}),t.jsx(s,{isOpen:g,onClose:()=>W(!1),content:k,isLoading:y,title:a,searchPlaceholder:h,emptyStateTitle:m,emptyStateDescription:l,noResultsText:d,width:u,onContentClick:t=>{p&&p(t)},renderCustomContent:C})]})};export{r as WhatsNew};
1
+ import{j as t}from"../../node_modules/react/jsx-runtime.js";import{useState as e}from"react";import{WhatsNewButton as o}from"./WhatsNewButton.js";import{WhatsNewPanel as n}from"./WhatsNewPanel.js";import{useWhatsNewContext as s}from"./WhatsNewProvider.js";const i=i=>{let{title:r="What's new",tooltip:a="What's new",searchPlaceholder:c="Search posts",emptyStateTitle:h="Nothing new!",emptyStateDescription:m="There are no new updates or features at the moment. Check back soon!",noResultsText:l="Sorry, no results found.",width:d="480px",onContentClick:p,renderCustomContent:u,buttonTestId:C="whats-new-button",iconWidth:w=32,iconHeight:j=32,customIcon:x}=i;const[f,g]=e(!1),{whatsNewContent:W,isLoading:S,newContentCount:T}=s();return t.jsxs(t.Fragment,{children:[t.jsx(o,{onClick:()=>g(!0),newContentCount:T,isOpen:f,isLoading:S,tooltip:a,testId:C,iconWidth:w,iconHeight:j,customIcon:x}),t.jsx(n,{isOpen:f,onClose:()=>g(!1),content:W,isLoading:S,title:r,searchPlaceholder:c,emptyStateTitle:h,emptyStateDescription:m,noResultsText:l,width:d,onContentClick:t=>{p&&p(t)},renderCustomContent:u})]})};export{i as WhatsNew};
@@ -1,6 +1,5 @@
1
1
  export declare const WhatsNewIconContainer: import("styled-components").StyledComponent<"div", any, {
2
2
  count?: number | undefined;
3
- shouldBounce?: boolean | undefined;
4
3
  }, never>;
5
4
  export declare const WhatsNewWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
6
5
  export declare const MainContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,22 +1,6 @@
1
- import t,{keyframes as e,css as i}from"styled-components";import{COLORS as n}from"../../constants/Theme.js";const r=e`
2
- 0%, 100% {
3
- transform: translateY(0);
4
- }
5
- 25% {
6
- transform: translateY(-8px);
7
- }
8
- 50% {
9
- transform: translateY(-4px);
10
- }
11
- 75% {
12
- transform: translateY(-2px);
13
- }
14
- `,a=t.div`
1
+ import e from"styled-components";import{COLORS as t}from"../../constants/Theme.js";const i=e.div`
15
2
  cursor: pointer;
16
3
  position: relative;
17
- ${t=>t.shouldBounce&&i`
18
- animation: ${r} 600ms ease-in-out;
19
- `}
20
4
 
21
5
  .main-icon-class {
22
6
  padding: 6px;
@@ -28,11 +12,11 @@ import t,{keyframes as e,css as i}from"styled-components";import{COLORS as n}fro
28
12
  }
29
13
 
30
14
  .icon-active {
31
- background: ${n.background.brandLight};
15
+ background: ${t.background.brandLight};
32
16
  }
33
17
 
34
18
  .main-icon-class:hover {
35
- background: ${n.background.base};
19
+ background: ${t.background.base};
36
20
  }
37
21
 
38
22
  .notification--count {
@@ -43,8 +27,8 @@ import t,{keyframes as e,css as i}from"styled-components";import{COLORS as n}fro
43
27
  border-radius: 50%;
44
28
  width: 14px;
45
29
  height: 14px;
46
- background: ${n.background.negative.vibrant};
47
- border: 1.25px solid ${n.surface.standard};
30
+ background: ${t.background.negative.vibrant};
31
+ border: 1.25px solid ${t.surface.standard};
48
32
  display: flex;
49
33
  justify-content: center;
50
34
  align-items: center;
@@ -54,9 +38,9 @@ import t,{keyframes as e,css as i}from"styled-components";import{COLORS as n}fro
54
38
  font-size: 8px;
55
39
  line-height: 7.2px;
56
40
  font-weight: 400;
57
- color: ${n.surface.standard};
41
+ color: ${t.surface.standard};
58
42
  }
59
- `,o=t.div`
43
+ `,n=e.div`
60
44
  overflow-y: auto;
61
45
  display: flex;
62
46
  flex-direction: column;
@@ -69,7 +53,7 @@ import t,{keyframes as e,css as i}from"styled-components";import{COLORS as n}fro
69
53
  }
70
54
 
71
55
  ::-webkit-scrollbar-thumb {
72
- background: ${n.content.inactive};
56
+ background: ${t.content.inactive};
73
57
  border-radius: 3px;
74
58
  min-height: 30px;
75
59
  }
@@ -81,7 +65,7 @@ import t,{keyframes as e,css as i}from"styled-components";import{COLORS as n}fro
81
65
  width: 64px;
82
66
  height: 64px;
83
67
  border-radius: 50%;
84
- background: ${n.background.base};
68
+ background: ${t.background.base};
85
69
  margin-bottom: 16px;
86
70
  }
87
71
 
@@ -151,7 +135,7 @@ import t,{keyframes as e,css as i}from"styled-components";import{COLORS as n}fro
151
135
  max-height: 200px;
152
136
  overflow-y: auto;
153
137
  font-size: 12px;
154
- color: ${n.content.secondary};
138
+ color: ${t.content.secondary};
155
139
 
156
140
  p {
157
141
  margin-bottom: 0px;
@@ -167,20 +151,20 @@ import t,{keyframes as e,css as i}from"styled-components";import{COLORS as n}fro
167
151
  padding: 2px 6px;
168
152
  gap: 4px;
169
153
  border-radius: 14px;
170
- background: ${n.background.warning.vibrant};
154
+ background: ${t.background.warning.vibrant};
171
155
  display: flex;
172
156
  justify-content: center;
173
157
  align-items: center;
174
158
  margin-right: 8px;
175
159
  }
176
- `,d=t.div`
160
+ `,r=e.div`
177
161
  display: flex;
178
162
  flex-direction: column;
179
163
  height: 100%;
180
- `,p=t.div`
181
- background: ${n.surface.standard};
164
+ `,o=e.div`
165
+ background: ${t.surface.standard};
182
166
  border-radius: 8px;
183
- border: 1px solid ${n.stroke.primary};
167
+ border: 1px solid ${t.stroke.primary};
184
168
  padding: 16px;
185
169
  display: flex;
186
170
  flex-direction: column;
@@ -190,12 +174,12 @@ import t,{keyframes as e,css as i}from"styled-components";import{COLORS as n}fro
190
174
  &:hover {
191
175
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
192
176
  }
193
- `,c=t.div`
194
- background-image: url(${t=>t.imageUrl});
177
+ `,a=e.div`
178
+ background-image: url(${e=>e.imageUrl});
195
179
  background-size: cover;
196
180
  background-position: center;
197
181
  background-repeat: no-repeat;
198
- height: ${t=>t.height||"200px"};
199
- width: ${t=>t.width||"100%"};
182
+ height: ${e=>e.height||"200px"};
183
+ width: ${e=>e.width||"100%"};
200
184
  border-radius: 4px;
201
- `;export{c as BackgroundImageContainer,p as MainCardContainer,d as MainContainer,a as WhatsNewIconContainer,o as WhatsNewWrapper};
185
+ `;export{a as BackgroundImageContainer,o as MainCardContainer,r as MainContainer,i as WhatsNewIconContainer,n as WhatsNewWrapper};
@@ -34,7 +34,6 @@ export interface WhatsNewButtonProps {
34
34
  height?: number;
35
35
  color?: string;
36
36
  }>;
37
- shouldBounce?: boolean;
38
37
  }
39
38
  export interface WhatsNewPanelProps {
40
39
  isOpen: boolean;
@@ -1 +1 @@
1
- import{j as t}from"../../node_modules/react/jsx-runtime.js";import{COLORS as s}from"../../constants/Theme.js";import{Tooltip as e}from"../tooltips/Tooltip.js";import{WhatsNewIconContainer as n}from"./WhatsNew.styles.js";const i=s=>{let{width:e=32,height:n=32}=s;return t.jsxs("svg",Object.assign({width:e,height:n,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[t.jsxs("g",Object.assign({clipPath:"url(#clip0_4309_13422)"},{children:[t.jsx("path",{d:"M22.1797 15.3052L15.4548 24.4022C15.3815 24.5014 15.3339 24.6172 15.316 24.7392C15.2982 24.8613 15.3108 24.9859 15.3526 25.1019L15.7733 26.2675C15.8141 26.3806 15.8815 26.4822 15.9698 26.5638C16.0581 26.6454 16.1647 26.7046 16.2806 26.7364C16.3966 26.7682 16.5185 26.7716 16.636 26.7464C16.7536 26.7212 16.8634 26.6681 16.9561 26.5916L20.7368 23.5654",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M6.4457 17.6642C6.36082 17.7791 6.31051 17.9158 6.30068 18.0583C6.29085 18.2008 6.32192 18.3431 6.39022 18.4686C6.45853 18.594 6.56123 18.6973 6.68626 18.7664C6.81128 18.8355 6.95343 18.8674 7.09598 18.8584C13.4962 18.4646 17.7214 21.3363 17.7214 21.3363L20.7369 23.5654C21.5366 24.1567 22.5385 24.406 23.5221 24.2585C24.5056 24.111 25.3903 23.5789 25.9816 22.7791C26.5728 21.9794 26.8221 20.9775 26.6746 19.9939C26.5272 19.0104 25.995 18.1257 25.1952 17.5344L22.1797 15.3053C22.1797 15.3053 18.1953 12.1079 16.6943 5.87443C16.6611 5.7356 16.5889 5.60913 16.4863 5.50988C16.3837 5.41062 16.2549 5.34272 16.1151 5.31413C15.9752 5.28554 15.8301 5.29746 15.6968 5.34849C15.5635 5.39952 15.4475 5.48754 15.3624 5.6022L6.4457 17.6642Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M7.69175 12.0819L5.24902 11.3518",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M10.9423 8.35748L9.88867 6.03589",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M8.91955 9.68574L5.66699 6.87134",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})),t.jsx("defs",{children:t.jsx("clipPath",Object.assign({id:"clip0_4309_13422"},{children:t.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(4 4)"})}))})]}))},o=o=>{let{onClick:r,newContentCount:c=0,isOpen:d=!1,isLoading:a=!1,tooltip:h="What's new",testId:l="whats-new-button",iconWidth:j=32,iconHeight:p=32,customIcon:x,shouldBounce:C=!1}=o;return a?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(n,Object.assign({count:c,shouldBounce:C},{children:t.jsxs("div",Object.assign({className:"main-icon-class "+(d?"icon-active":""),style:{color:d?s.content.brand:s.content.primary},onClick:r,"data-testid":l},{children:[t.jsx(e,Object.assign({body:h},{children:t.jsx("div",{children:x?t.jsx(x,{width:j,height:p,color:d?s.content.brand:s.content.primary}):t.jsx(i,{width:j,height:p})})})),c>0&&t.jsx("div",Object.assign({className:"notification--count"},{children:t.jsx("div",Object.assign({className:"count--text"},{children:c}))}))]}))}))};export{o as WhatsNewButton};
1
+ import{j as t}from"../../node_modules/react/jsx-runtime.js";import{COLORS as s}from"../../constants/Theme.js";import{Tooltip as e}from"../tooltips/Tooltip.js";import{WhatsNewIconContainer as i}from"./WhatsNew.styles.js";const n=s=>{let{width:e=32,height:i=32}=s;return t.jsxs("svg",Object.assign({width:e,height:i,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[t.jsxs("g",Object.assign({clipPath:"url(#clip0_4309_13422)"},{children:[t.jsx("path",{d:"M22.1797 15.3052L15.4548 24.4022C15.3815 24.5014 15.3339 24.6172 15.316 24.7392C15.2982 24.8613 15.3108 24.9859 15.3526 25.1019L15.7733 26.2675C15.8141 26.3806 15.8815 26.4822 15.9698 26.5638C16.0581 26.6454 16.1647 26.7046 16.2806 26.7364C16.3966 26.7682 16.5185 26.7716 16.636 26.7464C16.7536 26.7212 16.8634 26.6681 16.9561 26.5916L20.7368 23.5654",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M6.4457 17.6642C6.36082 17.7791 6.31051 17.9158 6.30068 18.0583C6.29085 18.2008 6.32192 18.3431 6.39022 18.4686C6.45853 18.594 6.56123 18.6973 6.68626 18.7664C6.81128 18.8355 6.95343 18.8674 7.09598 18.8584C13.4962 18.4646 17.7214 21.3363 17.7214 21.3363L20.7369 23.5654C21.5366 24.1567 22.5385 24.406 23.5221 24.2585C24.5056 24.111 25.3903 23.5789 25.9816 22.7791C26.5728 21.9794 26.8221 20.9775 26.6746 19.9939C26.5272 19.0104 25.995 18.1257 25.1952 17.5344L22.1797 15.3053C22.1797 15.3053 18.1953 12.1079 16.6943 5.87443C16.6611 5.7356 16.5889 5.60913 16.4863 5.50988C16.3837 5.41062 16.2549 5.34272 16.1151 5.31413C15.9752 5.28554 15.8301 5.29746 15.6968 5.34849C15.5635 5.39952 15.4475 5.48754 15.3624 5.6022L6.4457 17.6642Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M7.69175 12.0819L5.24902 11.3518",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M10.9423 8.35748L9.88867 6.03589",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M8.91955 9.68574L5.66699 6.87134",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})),t.jsx("defs",{children:t.jsx("clipPath",Object.assign({id:"clip0_4309_13422"},{children:t.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(4 4)"})}))})]}))},o=o=>{let{onClick:r,newContentCount:c=0,isOpen:d=!1,isLoading:a=!1,tooltip:h="What's new",testId:l="whats-new-button",iconWidth:j=32,iconHeight:p=32,customIcon:x}=o;return a?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(i,Object.assign({count:c},{children:t.jsxs("div",Object.assign({className:"main-icon-class "+(d?"icon-active":""),style:{color:d?s.content.brand:s.content.primary},onClick:r,"data-testid":l},{children:[t.jsx(e,Object.assign({body:h},{children:t.jsx("div",{children:x?t.jsx(x,{width:j,height:p,color:d?s.content.brand:s.content.primary}):t.jsx(n,{width:j,height:p})})})),c>0&&t.jsx("div",Object.assign({className:"notification--count"},{children:t.jsx("div",Object.assign({className:"count--text"},{children:c}))}))]}))}))};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 o,useMemo as n}from"react";import{COLORS as r}from"../../constants/Theme.js";import{Button as i}from"../button/Button.js";import{VideoModal as l}from"../feature-announcements/VideoModal.js";import{SearchBar as a}from"../searchBar/searchBar.js";import{SideModal as c}from"../side-modal/SideModal.js";import{TitleMedium as d,TitleRegular as h,BodyPrimary as m,Caption as j,TitleSmall as g}from"../TypographyStyle.js";import{MainContainer as x,WhatsNewWrapper as u,MainCardContainer as p,BackgroundImageContainer as w}from"./WhatsNew.styles.js";const b=t=>{let{width:s=32,height:o=32}=t;return e.jsx("svg",Object.assign({width:s,height:o,viewBox:"0 0 24 24",fill:"none"},{children:e.jsx("path",{d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}))},f=t=>{let{width:s=32,height:o=32}=t;return e.jsxs("svg",Object.assign({width:s,height:o,viewBox:"0 0 32 32",fill:"none"},{children:[e.jsx("path",{d:"M16 2C8.268 2 2 8.268 2 16s6.268 14 14 14 14-6.268 14-14S23.732 2 16 2zm0 25c-6.065 0-11-4.935-11-11S9.935 5 16 5s11 4.935 11 11-4.935 11-11 11z",fill:"currentColor"}),e.jsx("path",{d:"M16 10.5c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5zM15 15h2v8h-2v-8z",fill:"currentColor"})]}))},C=C=>{let{isOpen:v,onClose:y,content:O,isLoading:N=!1,title:k="What's new on BIK",searchPlaceholder:M="Search posts",emptyStateTitle:S="Nothing new!",emptyStateDescription:L="There are no new updates or features at the moment. Check back soon!",noResultsText:U="Sorry, no results found.",width:V="480px",onContentClick:A,renderCustomContent:D}=C;const[T,W]=o(""),[z,B]=o(!1),[F,_]=o("");console.log("WhatsNewPanel render - isVideoModalOpen:",z,"videoUrl:",F);const E=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=n((()=>{if(!T.trim())return O;const e=T.toLowerCase();return O.filter((t=>t.title.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||t.content&&t.content.toLowerCase().includes(e)))}),[O,T]),R=0===O.length,I=0===P.length;return v?e.jsxs(c,Object.assign({width:V,onClose:y,header:"",headerCustomComponent:e.jsx(d,Object.assign({color:r.background.inverse},{children:k})),headerStyle:{background:r.background.brandLight},hideFooter:!0},{children:[e.jsxs(x,{children:[e.jsx("div",Object.assign({className:"mt-8"},{children:e.jsx(a,{width:"100%",isEnabled:!R,onChange:e=>{W(e)},onEnter:e=>{W(e)},placeholder:M,variant:"default",searchValue:T,onClickCross:()=>{W("")}})})),e.jsx(u,{children:R||I?e.jsxs("div",Object.assign({className:"no--data--found"},{children:[e.jsx("div",Object.assign({className:"icon--wrapper"},{children:R?e.jsx(f,{width:32,height:32}):e.jsx(b,{width:32,height:32})})),R?e.jsxs(e.Fragment,{children:[e.jsx(h,{children:S}),e.jsx(m,Object.assign({color:r.content.secondary,className:"text--align",style:{maxWidth:300}},{children:L}))]}):I?e.jsx(m,Object.assign({color:r.content.secondary,className:"text--align",style:{maxWidth:300}},{children:U})):null]})):e.jsx("div",Object.assign({className:"scroller"},{children:P.map(((s,o)=>D?D(s):e.jsxs(p,Object.assign({className:"padding--16 mb-mt-8"},{children:[e.jsx(w,{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:[E(s)?e.jsx("div",Object.assign({className:"new--content--tag"},{children:e.jsx(j,{children:"New"})})):e.jsx(e.Fragment,{}),e.jsx(j,Object.assign({style:{color:r.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(g,{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(i,{buttonText:s.buttonText||"Explore the feature",onClick:()=>(e=>{console.log("handleContentClick called with:",e),console.log("productVideo:",e.productVideo),console.log("redirectUrl:",e.redirectUrl),console.log("onContentClick:",A),e.productVideo?(console.log("Setting video URL:",e.productVideo),_(e.productVideo),B(!0),console.log("Video modal state set to true")):e.redirectUrl&&(console.log("Opening redirectUrl:",e.redirectUrl),window.open(e.redirectUrl,"_blank")),A&&(console.log("Calling onContentClick for analytics"),A(e))})(s),matchParentWidth:!0,size:"medium"})}))]}),`whats-new-${o}`)))}))})]}),e.jsx(l,{isOpen:z,videoUrl:F,onClose:()=>{console.log("Closing video modal"),B(!1)}})]})):e.jsx(e.Fragment,{})};export{C 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{COLORS as o}from"../../constants/Theme.js";import{Button as a}from"../button/Button.js";import{VideoModal as i}from"../feature-announcements/VideoModal.js";import{SearchBar as c}from"../searchBar/searchBar.js";import{SideModal as d}from"../side-modal/SideModal.js";import{TitleMedium as l,TitleRegular as h,BodyPrimary as m,Caption as j,TitleSmall as x}from"../TypographyStyle.js";import{MainContainer as g,WhatsNewWrapper as u,MainCardContainer as p,BackgroundImageContainer as w}from"./WhatsNew.styles.js";const b=t=>{let{width:s=32,height:n=32}=t;return e.jsx("svg",Object.assign({width:s,height:n,viewBox:"0 0 24 24",fill:"none"},{children:e.jsx("path",{d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}))},f=t=>{let{width:s=32,height:n=32}=t;return e.jsxs("svg",Object.assign({width:s,height:n,viewBox:"0 0 32 32",fill:"none"},{children:[e.jsx("path",{d:"M16 2C8.268 2 2 8.268 2 16s6.268 14 14 14 14-6.268 14-14S23.732 2 16 2zm0 25c-6.065 0-11-4.935-11-11S9.935 5 16 5s11 4.935 11 11-4.935 11-11 11z",fill:"currentColor"}),e.jsx("path",{d:"M16 10.5c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5zM15 15h2v8h-2v-8z",fill:"currentColor"})]}))},C=C=>{let{isOpen:y,onClose:v,content:O,isLoading:N=!1,title:k="What's new on BIK",searchPlaceholder:M="Search posts",emptyStateTitle:S="Nothing new!",emptyStateDescription:L="There are no new updates or features at the moment. Check back soon!",noResultsText:A="Sorry, no results found.",width:D="480px",onContentClick:T,renderCustomContent:z}=C;const[B,W]=n(""),[F,U]=n(!1),[V,_]=n(""),E=e=>{if(!e.createdAt)return!1;const t=e.createdAt.toDate?e.createdAt.toDate():new Date(e.createdAt);return s(new Date,t)<7},I=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]),P=0===O.length,R=0===I.length;return y?e.jsxs(d,Object.assign({width:D,onClose:v,header:"",headerCustomComponent:e.jsx(l,Object.assign({color:o.background.inverse},{children:k})),headerStyle:{background:o.background.brandLight},hideFooter:!0},{children:[e.jsxs(g,{children:[e.jsx("div",Object.assign({className:"mt-8"},{children:e.jsx(c,{width:"100%",isEnabled:!P,onChange:e=>{W(e)},onEnter:e=>{W(e)},placeholder:M,variant:"default",searchValue:B,onClickCross:()=>{W("")}})})),e.jsx(u,{children:P||R?e.jsxs("div",Object.assign({className:"no--data--found"},{children:[e.jsx("div",Object.assign({className:"icon--wrapper"},{children:P?e.jsx(f,{width:32,height:32}):e.jsx(b,{width:32,height:32})})),P?e.jsxs(e.Fragment,{children:[e.jsx(h,{children:S}),e.jsx(m,Object.assign({color:o.content.secondary,className:"text--align",style:{maxWidth:300}},{children:L}))]}):R?e.jsx(m,Object.assign({color:o.content.secondary,className:"text--align",style:{maxWidth:300}},{children:A})):null]})):e.jsx("div",Object.assign({className:"scroller"},{children:I.map(((s,n)=>z?z(s):e.jsxs(p,Object.assign({className:"padding--16 mb-mt-8"},{children:[e.jsx(w,{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:[E(s)?e.jsx("div",Object.assign({className:"new--content--tag"},{children:e.jsx(j,{children:"New"})})):e.jsx(e.Fragment,{}),e.jsx(j,Object.assign({style:{color:o.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(x,{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(a,{buttonText:s.buttonText||"Explore the feature",onClick:()=>(e=>{e.productVideo?(_(e.productVideo),U(!0)):e.redirectUrl&&window.open(e.redirectUrl,"_blank"),T&&T(e)})(s),matchParentWidth:!0,size:"medium"})}))]}),`whats-new-${n}`)))}))})]}),e.jsx(i,{isOpen:F,videoUrl:V,onClose:()=>{U(!1)}})]})):e.jsx(e.Fragment,{})};export{C as WhatsNewPanel};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.721-beta.38",
3
+ "version": "0.0.721-beta.40",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",