@bikdotai/bik-component-library 0.0.703-beta.10 → 0.0.703-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/cjs/components/whats-new/WhatsNew.styles.js +2 -13
- package/dist/cjs/components/whats-new/WhatsNewPanel.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/components/whats-new/WhatsNew.styles.js +0 -11
- package/dist/esm/components/whats-new/WhatsNewPanel.js +1 -1
- package/package.json +1 -1
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
&:hover {
|
|
175
175
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
176
176
|
}
|
|
177
|
-
`,
|
|
177
|
+
`,p=n.default.div`
|
|
178
178
|
background-image: url(${e=>e.imageUrl});
|
|
179
179
|
background-size: cover;
|
|
180
180
|
background-position: center;
|
|
@@ -182,15 +182,4 @@
|
|
|
182
182
|
height: ${e=>e.height||"200px"};
|
|
183
183
|
width: ${e=>e.width||"100%"};
|
|
184
184
|
border-radius: 4px;
|
|
185
|
-
|
|
186
|
-
align-items: center;
|
|
187
|
-
justify-content: center;
|
|
188
|
-
|
|
189
|
-
&:empty::after {
|
|
190
|
-
content: '';
|
|
191
|
-
background: ${t.COLORS.background.base};
|
|
192
|
-
width: 100%;
|
|
193
|
-
height: 100%;
|
|
194
|
-
border-radius: 4px;
|
|
195
|
-
}
|
|
196
|
-
`;exports.BackgroundImageContainer=c,exports.MainCardContainer=d,exports.MainContainer=o,exports.WhatsNewIconContainer=r,exports.WhatsNewWrapper=a;
|
|
185
|
+
`;exports.BackgroundImageContainer=p,exports.MainCardContainer=d,exports.MainContainer=o,exports.WhatsNewIconContainer=r,exports.WhatsNewWrapper=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"),
|
|
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("../searchBar/searchBar.js"),o=require("../side-modal/SideModal.js"),a=require("../TypographyStyle.js"),x=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=d=>{let{isOpen:j,onClose:u,content:m,isLoading:h=!1,title:p="What's new on BIK",searchPlaceholder:g="Search posts",emptyStateTitle:R="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:C,renderCustomContent:O}=d;const[y,f]=s.useState(""),v=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},S=s.useMemo((()=>{if(!y.trim())return m;const e=y.toLowerCase();return m.filter((t=>t.title.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||t.content&&t.content.toLowerCase().includes(e)))}),[m,y]),N=0===m.length,M=0===S.length;return j?e.jsxRuntimeExports.jsx(o.SideModal,Object.assign({width:b,onClose:u,header:"",headerCustomComponent:e.jsxRuntimeExports.jsx(a.TitleMedium,Object.assign({color:r.COLORS.background.inverse},{children:p})),headerStyle:{background:r.COLORS.background.brandLight},hideFooter:!0},{children:e.jsxRuntimeExports.jsxs(x.MainContainer,{children:[e.jsxRuntimeExports.jsx("div",Object.assign({className:"mt-8"},{children:e.jsxRuntimeExports.jsx(i.SearchBar,{width:"100%",isEnabled:!N,onChange:e=>{f(e)},onEnter:e=>{f(e)},placeholder:g,variant:"default",searchValue:y,onClickCross:()=>{f("")}})})),e.jsxRuntimeExports.jsx(x.WhatsNewWrapper,{children:N||M?e.jsxRuntimeExports.jsxs("div",Object.assign({className:"no--data--found"},{children:[e.jsxRuntimeExports.jsx("div",Object.assign({className:"icon--wrapper"},{children:N?e.jsxRuntimeExports.jsx(c,{width:32,height:32}):e.jsxRuntimeExports.jsx(l,{width:32,height:32})})),N?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(a.TitleRegular,{children:R}),e.jsxRuntimeExports.jsx(a.BodyPrimary,Object.assign({color:r.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:E}))]}):M?e.jsxRuntimeExports.jsx(a.BodyPrimary,Object.assign({color:r.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:w})):null]})):e.jsxRuntimeExports.jsx("div",Object.assign({className:"scroller"},{children:S.map(((s,i)=>O?O(s):e.jsxRuntimeExports.jsxs(x.MainCardContainer,Object.assign({className:"padding--16 mb-mt-8"},{children:[e.jsxRuntimeExports.jsx(x.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:[v(s)?e.jsxRuntimeExports.jsx("div",Object.assign({className:"new--content--tag"},{children:e.jsxRuntimeExports.jsx(a.Caption,{children:"New"})})):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}),e.jsxRuntimeExports.jsx(a.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(a.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=>{C?C(e):e.redirectUrl&&window.open(e.redirectUrl,"_blank")})(s),matchParentWidth:!0,size:"medium"})}))]}),`whats-new-${i}`)))}))})]})})):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})};
|
|
@@ -182,15 +182,4 @@ import e from"styled-components";import{COLORS as t}from"../../constants/Theme.j
|
|
|
182
182
|
height: ${e=>e.height||"200px"};
|
|
183
183
|
width: ${e=>e.width||"100%"};
|
|
184
184
|
border-radius: 4px;
|
|
185
|
-
display: flex;
|
|
186
|
-
align-items: center;
|
|
187
|
-
justify-content: center;
|
|
188
|
-
|
|
189
|
-
&:empty::after {
|
|
190
|
-
content: '';
|
|
191
|
-
background: ${t.background.base};
|
|
192
|
-
width: 100%;
|
|
193
|
-
height: 100%;
|
|
194
|
-
border-radius: 4px;
|
|
195
|
-
}
|
|
196
185
|
`;export{a as BackgroundImageContainer,o as MainCardContainer,r as MainContainer,i as WhatsNewIconContainer,n as WhatsNewWrapper};
|
|
@@ -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{COLORS as
|
|
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 a}from"../../constants/Theme.js";import{Button as i}from"../button/Button.js";import{SearchBar as o}from"../searchBar/searchBar.js";import{SideModal as c}from"../side-modal/SideModal.js";import{TitleMedium as l,TitleRegular as d,BodyPrimary as h,Caption as m,TitleSmall as j}from"../TypographyStyle.js";import{MainContainer as x,WhatsNewWrapper as g,MainCardContainer as u,BackgroundImageContainer as p}from"./WhatsNew.styles.js";const w=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"})}))},b=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"})]}))},f=f=>{let{isOpen:y,onClose:C,content:v,isLoading:O=!1,title:N="What's new on BIK",searchPlaceholder:k="Search posts",emptyStateTitle:M="Nothing new!",emptyStateDescription:S="There are no new updates or features at the moment. Check back soon!",noResultsText:L="Sorry, no results found.",width:A="480px",onContentClick:D,renderCustomContent:T}=f;const[z,B]=n(""),W=e=>{if(!e.createdAt)return!1;const t=e.createdAt.toDate?e.createdAt.toDate():new Date(e.createdAt);return s(new Date,t)<7},F=r((()=>{if(!z.trim())return v;const e=z.toLowerCase();return v.filter((t=>t.title.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||t.content&&t.content.toLowerCase().includes(e)))}),[v,z]),_=0===v.length,E=0===F.length;return y?e.jsx(c,Object.assign({width:A,onClose:C,header:"",headerCustomComponent:e.jsx(l,Object.assign({color:a.background.inverse},{children:N})),headerStyle:{background:a.background.brandLight},hideFooter:!0},{children:e.jsxs(x,{children:[e.jsx("div",Object.assign({className:"mt-8"},{children:e.jsx(o,{width:"100%",isEnabled:!_,onChange:e=>{B(e)},onEnter:e=>{B(e)},placeholder:k,variant:"default",searchValue:z,onClickCross:()=>{B("")}})})),e.jsx(g,{children:_||E?e.jsxs("div",Object.assign({className:"no--data--found"},{children:[e.jsx("div",Object.assign({className:"icon--wrapper"},{children:_?e.jsx(b,{width:32,height:32}):e.jsx(w,{width:32,height:32})})),_?e.jsxs(e.Fragment,{children:[e.jsx(d,{children:M}),e.jsx(h,Object.assign({color:a.content.secondary,className:"text--align",style:{maxWidth:300}},{children:S}))]}):E?e.jsx(h,Object.assign({color:a.content.secondary,className:"text--align",style:{maxWidth:300}},{children:L})):null]})):e.jsx("div",Object.assign({className:"scroller"},{children:F.map(((s,n)=>T?T(s):e.jsxs(u,Object.assign({className:"padding--16 mb-mt-8"},{children:[e.jsx(p,{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:[W(s)?e.jsx("div",Object.assign({className:"new--content--tag"},{children:e.jsx(m,{children:"New"})})):e.jsx(e.Fragment,{}),e.jsx(m,Object.assign({style:{color:a.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(j,{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=>{D?D(e):e.redirectUrl&&window.open(e.redirectUrl,"_blank")})(s),matchParentWidth:!0,size:"medium"})}))]}),`whats-new-${n}`)))}))})]})})):e.jsx(e.Fragment,{})};export{f as WhatsNewPanel};
|