@bikdotai/bik-component-library 0.0.703-beta.10 → 0.0.703-beta.11
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/whats-new/WhatsNew.styles.js +2 -13
- package/dist/cjs/components/whats-new/WhatsNew.types.d.ts +0 -2
- package/dist/cjs/components/whats-new/WhatsNewPanel.js +1 -1
- package/dist/esm/components/whats-new/WhatsNew.styles.js +0 -11
- package/dist/esm/components/whats-new/WhatsNew.types.d.ts +0 -2
- 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;
|
|
@@ -40,10 +40,8 @@ export interface WhatsNewPanelProps {
|
|
|
40
40
|
content: WhatsNewContent[];
|
|
41
41
|
isLoading?: boolean;
|
|
42
42
|
title?: string;
|
|
43
|
-
searchPlaceholder?: string;
|
|
44
43
|
emptyStateTitle?: string;
|
|
45
44
|
emptyStateDescription?: string;
|
|
46
|
-
noResultsText?: string;
|
|
47
45
|
width?: string;
|
|
48
46
|
onContentClick?: (content: WhatsNewContent) => void;
|
|
49
47
|
renderCustomContent?: (content: WhatsNewContent) => React.ReactNode;
|
|
@@ -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"),i=require("../
|
|
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"),i=require("../side-modal/SideModal.js"),a=require("../TypographyStyle.js"),o=require("./WhatsNew.styles.js");const 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=d=>{let{isOpen:c,onClose:l,content:j,isLoading:m=!1,title:u="What's new on BIK",emptyStateTitle:h="Nothing new!",emptyStateDescription:p="There are no new updates or features at the moment. Check back soon!",width:g="480px",onContentClick:R,renderCustomContent:E}=d;const b=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},w=s.useMemo((()=>j),[j]),O=0===j.length;return c?e.jsxRuntimeExports.jsx(i.SideModal,Object.assign({width:g,onClose:l,header:"",headerCustomComponent:e.jsxRuntimeExports.jsx(a.TitleMedium,Object.assign({color:n.COLORS.background.inverse},{children:u})),headerStyle:{background:n.COLORS.background.brandLight},hideFooter:!0},{children:e.jsxRuntimeExports.jsxs(o.MainContainer,{children:[e.jsxRuntimeExports.jsx("div",{className:"mt-8"}),e.jsxRuntimeExports.jsx(o.WhatsNewWrapper,{children:O?e.jsxRuntimeExports.jsxs("div",Object.assign({className:"no--data--found"},{children:[e.jsxRuntimeExports.jsx("div",Object.assign({className:"icon--wrapper"},{children:e.jsxRuntimeExports.jsx(x,{width:32,height:32})})),e.jsxRuntimeExports.jsx(a.TitleRegular,{children:h}),e.jsxRuntimeExports.jsx(a.BodyPrimary,Object.assign({color:n.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:p}))]})):e.jsxRuntimeExports.jsx("div",Object.assign({className:"scroller"},{children:w.map(((s,i)=>E?E(s):e.jsxRuntimeExports.jsxs(o.MainCardContainer,Object.assign({className:"padding--16 mb-mt-8"},{children:[e.jsxRuntimeExports.jsx(o.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:[b(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: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(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(r.Button,{buttonText:s.buttonText||"Explore the feature",onClick:()=>(e=>{R?R(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};
|
|
@@ -40,10 +40,8 @@ export interface WhatsNewPanelProps {
|
|
|
40
40
|
content: WhatsNewContent[];
|
|
41
41
|
isLoading?: boolean;
|
|
42
42
|
title?: string;
|
|
43
|
-
searchPlaceholder?: string;
|
|
44
43
|
emptyStateTitle?: string;
|
|
45
44
|
emptyStateDescription?: string;
|
|
46
|
-
noResultsText?: string;
|
|
47
45
|
width?: string;
|
|
48
46
|
onContentClick?: (content: WhatsNewContent) => void;
|
|
49
47
|
renderCustomContent?: (content: WhatsNewContent) => React.ReactNode;
|
|
@@ -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{
|
|
1
|
+
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{format as t,differenceInBusinessDays as s}from"date-fns";import{useMemo as n}from"react";import{COLORS as r}from"../../constants/Theme.js";import{Button as a}from"../button/Button.js";import{SideModal as i}from"../side-modal/SideModal.js";import{TitleMedium as o,TitleRegular as c,BodyPrimary as d,Caption as l,TitleSmall as h}from"../TypographyStyle.js";import{MainContainer as m,WhatsNewWrapper as j,MainCardContainer as x,BackgroundImageContainer as g}from"./WhatsNew.styles.js";const p=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"})]}))},b=b=>{let{isOpen:u,onClose:w,content:f,isLoading:y=!1,title:v="What's new on BIK",emptyStateTitle:N="Nothing new!",emptyStateDescription:O="There are no new updates or features at the moment. Check back soon!",width:C="480px",onContentClick:M,renderCustomContent:k}=b;const A=e=>{if(!e.createdAt)return!1;const t=e.createdAt.toDate?e.createdAt.toDate():new Date(e.createdAt);return s(new Date,t)<7},D=n((()=>f),[f]),S=0===f.length;return u?e.jsx(i,Object.assign({width:C,onClose:w,header:"",headerCustomComponent:e.jsx(o,Object.assign({color:r.background.inverse},{children:v})),headerStyle:{background:r.background.brandLight},hideFooter:!0},{children:e.jsxs(m,{children:[e.jsx("div",{className:"mt-8"}),e.jsx(j,{children:S?e.jsxs("div",Object.assign({className:"no--data--found"},{children:[e.jsx("div",Object.assign({className:"icon--wrapper"},{children:e.jsx(p,{width:32,height:32})})),e.jsx(c,{children:N}),e.jsx(d,Object.assign({color:r.content.secondary,className:"text--align",style:{maxWidth:300}},{children:O}))]})):e.jsx("div",Object.assign({className:"scroller"},{children:D.map(((s,n)=>k?k(s):e.jsxs(x,Object.assign({className:"padding--16 mb-mt-8"},{children:[e.jsx(g,{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:[A(s)?e.jsx("div",Object.assign({className:"new--content--tag"},{children:e.jsx(l,{children:"New"})})):e.jsx(e.Fragment,{}),e.jsx(l,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(h,{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=>{M?M(e):e.redirectUrl&&window.open(e.redirectUrl,"_blank")})(s),matchParentWidth:!0,size:"medium"})}))]}),`whats-new-${n}`)))}))})]})})):e.jsx(e.Fragment,{})};export{b as WhatsNewPanel};
|