@bikdotai/bik-component-library 0.0.711-beta.3 → 0.0.711-beta.4
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/assets/icons/phone_round.svg.js +1 -0
- package/dist/cjs/components/QueryBuilder/helpers/MetaCustomProcessor.d.ts +1 -1
- package/dist/cjs/components/accordion/Accordion.d.ts +1 -0
- package/dist/cjs/components/accordion/Accordion.js +1 -1
- package/dist/cjs/components/banner/Banner.d.ts +4 -0
- package/dist/cjs/components/banner/Banner.js +1 -0
- package/dist/cjs/components/banner/Banner.stories.d.ts +9 -0
- package/dist/cjs/components/banner/Banner.styled.d.ts +87 -0
- package/dist/cjs/components/banner/Banner.styled.js +1 -0
- package/dist/cjs/components/banner/BannerInline.d.ts +6 -0
- package/dist/cjs/components/banner/BannerInline.js +1 -0
- package/dist/cjs/components/banner/BannerWithImage.d.ts +6 -0
- package/dist/cjs/components/banner/BannerWithImage.js +1 -0
- package/dist/cjs/components/banner/CardBanner.d.ts +6 -0
- package/dist/cjs/components/banner/CardBanner.js +1 -0
- package/dist/cjs/components/banner/CardBannerWithImage.d.ts +6 -0
- package/dist/cjs/components/banner/CardBannerWithImage.js +1 -0
- package/dist/cjs/components/banner/index.d.ts +2 -0
- package/dist/cjs/components/banner/model.d.ts +77 -0
- package/dist/cjs/components/banner/model.js +1 -0
- package/dist/cjs/components/bik-layout/BikSidebar.js +1 -1
- package/dist/cjs/components/tag/Tag.d.ts +1 -1
- package/dist/cjs/components/tag/Tag.js +1 -1
- package/dist/cjs/components/tag/Tag.stories.d.ts +5 -5
- package/dist/cjs/components/tag/model.d.ts +1 -0
- package/dist/cjs/components/template-preview/WhatsApp/ChatBtn.d.ts +1 -0
- package/dist/cjs/components/template-preview/WhatsApp/ChatBtn.js +1 -1
- package/dist/cjs/components/template-preview/WhatsApp/ChatUiV2.d.ts +1 -0
- package/dist/cjs/components/template-preview/WhatsApp/ChatUiV2.js +5 -5
- package/dist/cjs/components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js +15 -5
- package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.js +1 -1
- package/dist/cjs/components/template-preview/helpers/TemplateCreatorHelper.d.ts +1 -0
- package/dist/cjs/components/template-preview/helpers/TemplateCreatorHelper.js +1 -1
- package/dist/cjs/components/template-preview/models/WhatsAppTemplate.d.ts +13 -3
- package/dist/cjs/components/template-preview/models/WhatsAppTemplate.js +1 -1
- package/dist/cjs/components/template-preview/models/WhatsappCarouselTemplate.d.ts +3 -3
- package/dist/cjs/index.d.ts +1 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/utils/validator.js +1 -1
- package/dist/esm/assets/icons/phone_round.svg.js +1 -0
- package/dist/esm/components/QueryBuilder/helpers/MetaCustomProcessor.d.ts +1 -1
- package/dist/esm/components/accordion/Accordion.d.ts +1 -0
- package/dist/esm/components/accordion/Accordion.js +1 -1
- package/dist/esm/components/banner/Banner.d.ts +4 -0
- package/dist/esm/components/banner/Banner.js +1 -0
- package/dist/esm/components/banner/Banner.stories.d.ts +9 -0
- package/dist/esm/components/banner/Banner.styled.d.ts +87 -0
- package/dist/esm/components/banner/Banner.styled.js +1 -0
- package/dist/esm/components/banner/BannerInline.d.ts +6 -0
- package/dist/esm/components/banner/BannerInline.js +1 -0
- package/dist/esm/components/banner/BannerWithImage.d.ts +6 -0
- package/dist/esm/components/banner/BannerWithImage.js +1 -0
- package/dist/esm/components/banner/CardBanner.d.ts +6 -0
- package/dist/esm/components/banner/CardBanner.js +1 -0
- package/dist/esm/components/banner/CardBannerWithImage.d.ts +6 -0
- package/dist/esm/components/banner/CardBannerWithImage.js +1 -0
- package/dist/esm/components/banner/index.d.ts +2 -0
- package/dist/esm/components/banner/model.d.ts +77 -0
- package/dist/esm/components/banner/model.js +1 -0
- package/dist/esm/components/bik-layout/BikSidebar.js +1 -1
- package/dist/esm/components/tag/Tag.d.ts +1 -1
- package/dist/esm/components/tag/Tag.js +1 -1
- package/dist/esm/components/tag/Tag.stories.d.ts +5 -5
- package/dist/esm/components/tag/model.d.ts +1 -0
- package/dist/esm/components/template-preview/WhatsApp/ChatBtn.d.ts +1 -0
- package/dist/esm/components/template-preview/WhatsApp/ChatBtn.js +1 -1
- package/dist/esm/components/template-preview/WhatsApp/ChatUiV2.d.ts +1 -0
- package/dist/esm/components/template-preview/WhatsApp/ChatUiV2.js +5 -5
- package/dist/esm/components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js +15 -5
- package/dist/esm/components/template-preview/WhatsAppTemplatePreview.js +1 -1
- package/dist/esm/components/template-preview/helpers/TemplateCreatorHelper.d.ts +1 -0
- package/dist/esm/components/template-preview/helpers/TemplateCreatorHelper.js +1 -1
- package/dist/esm/components/template-preview/models/WhatsAppTemplate.d.ts +13 -3
- package/dist/esm/components/template-preview/models/WhatsAppTemplate.js +1 -1
- package/dist/esm/components/template-preview/models/WhatsappCarouselTemplate.d.ts +3 -3
- package/dist/esm/index.d.ts +1 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/utils/validator.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/feature-announcements/FeatureAnnouncement.types.d.ts +0 -27
- package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.d.ts +0 -14
- package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js +0 -1
- package/dist/cjs/components/feature-announcements/MajorUpdatePopup.d.ts +0 -13
- package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js +0 -1
- package/dist/cjs/components/feature-announcements/MinorUpdatePopup.d.ts +0 -13
- package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js +0 -1
- package/dist/cjs/components/feature-announcements/VideoModal.d.ts +0 -8
- package/dist/cjs/components/feature-announcements/VideoModal.js +0 -1
- package/dist/cjs/components/feature-announcements/index.d.ts +0 -6
- package/dist/cjs/components/feature-announcements/useFeatureAnnouncements.d.ts +0 -24
- package/dist/cjs/components/feature-announcements/useFeatureAnnouncements.js +0 -1
- package/dist/cjs/components/whats-new/WhatsNew.d.ts +0 -23
- package/dist/cjs/components/whats-new/WhatsNew.js +0 -1
- package/dist/cjs/components/whats-new/WhatsNew.styles.d.ts +0 -11
- package/dist/cjs/components/whats-new/WhatsNew.styles.js +0 -185
- package/dist/cjs/components/whats-new/WhatsNew.types.d.ts +0 -58
- package/dist/cjs/components/whats-new/WhatsNewButton.d.ts +0 -3
- package/dist/cjs/components/whats-new/WhatsNewButton.js +0 -1
- package/dist/cjs/components/whats-new/WhatsNewPanel.d.ts +0 -3
- package/dist/cjs/components/whats-new/WhatsNewPanel.js +0 -1
- package/dist/cjs/components/whats-new/WhatsNewProvider.d.ts +0 -4
- package/dist/cjs/components/whats-new/WhatsNewProvider.js +0 -1
- package/dist/cjs/components/whats-new/index.d.ts +0 -7
- package/dist/cjs/components/whats-new/useWhatsNew.d.ts +0 -9
- package/dist/cjs/components/whats-new/useWhatsNew.js +0 -1
- package/dist/esm/components/feature-announcements/FeatureAnnouncement.types.d.ts +0 -27
- package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.d.ts +0 -14
- package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js +0 -1
- package/dist/esm/components/feature-announcements/MajorUpdatePopup.d.ts +0 -13
- package/dist/esm/components/feature-announcements/MajorUpdatePopup.js +0 -1
- package/dist/esm/components/feature-announcements/MinorUpdatePopup.d.ts +0 -13
- package/dist/esm/components/feature-announcements/MinorUpdatePopup.js +0 -1
- package/dist/esm/components/feature-announcements/VideoModal.d.ts +0 -8
- package/dist/esm/components/feature-announcements/VideoModal.js +0 -1
- package/dist/esm/components/feature-announcements/index.d.ts +0 -6
- package/dist/esm/components/feature-announcements/useFeatureAnnouncements.d.ts +0 -24
- package/dist/esm/components/feature-announcements/useFeatureAnnouncements.js +0 -1
- package/dist/esm/components/whats-new/WhatsNew.d.ts +0 -23
- package/dist/esm/components/whats-new/WhatsNew.js +0 -1
- package/dist/esm/components/whats-new/WhatsNew.styles.d.ts +0 -11
- package/dist/esm/components/whats-new/WhatsNew.styles.js +0 -185
- package/dist/esm/components/whats-new/WhatsNew.types.d.ts +0 -58
- package/dist/esm/components/whats-new/WhatsNewButton.d.ts +0 -3
- package/dist/esm/components/whats-new/WhatsNewButton.js +0 -1
- package/dist/esm/components/whats-new/WhatsNewPanel.d.ts +0 -3
- package/dist/esm/components/whats-new/WhatsNewPanel.js +0 -1
- package/dist/esm/components/whats-new/WhatsNewProvider.d.ts +0 -4
- package/dist/esm/components/whats-new/WhatsNewProvider.js +0 -1
- package/dist/esm/components/whats-new/index.d.ts +0 -7
- package/dist/esm/components/whats-new/useWhatsNew.d.ts +0 -9
- package/dist/esm/components/whats-new/useWhatsNew.js +0 -1
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { WhatsNewContent } from './WhatsNew.types';
|
|
3
|
-
interface WhatsNewProps {
|
|
4
|
-
title?: string;
|
|
5
|
-
tooltip?: string;
|
|
6
|
-
searchPlaceholder?: string;
|
|
7
|
-
emptyStateTitle?: string;
|
|
8
|
-
emptyStateDescription?: string;
|
|
9
|
-
noResultsText?: string;
|
|
10
|
-
width?: string;
|
|
11
|
-
onContentClick?: (content: WhatsNewContent) => void;
|
|
12
|
-
renderCustomContent?: (content: WhatsNewContent) => React.ReactNode;
|
|
13
|
-
buttonTestId?: string;
|
|
14
|
-
iconWidth?: number;
|
|
15
|
-
iconHeight?: number;
|
|
16
|
-
customIcon?: React.ComponentType<{
|
|
17
|
-
width?: number;
|
|
18
|
-
height?: number;
|
|
19
|
-
color?: string;
|
|
20
|
-
}>;
|
|
21
|
-
}
|
|
22
|
-
export declare const WhatsNew: React.FC<WhatsNewProps>;
|
|
23
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
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,11 +0,0 @@
|
|
|
1
|
-
export declare const WhatsNewIconContainer: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
-
count?: number | undefined;
|
|
3
|
-
}, never>;
|
|
4
|
-
export declare const WhatsNewWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
-
export declare const MainContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
-
export declare const MainCardContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
-
export declare const BackgroundImageContainer: import("styled-components").StyledComponent<"div", any, {
|
|
8
|
-
imageUrl: string;
|
|
9
|
-
height?: string | undefined;
|
|
10
|
-
width?: string | undefined;
|
|
11
|
-
}, never>;
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import e from"styled-components";import{COLORS as t}from"../../constants/Theme.js";const i=e.div`
|
|
2
|
-
cursor: pointer;
|
|
3
|
-
position: relative;
|
|
4
|
-
|
|
5
|
-
.main-icon-class {
|
|
6
|
-
padding: 6px;
|
|
7
|
-
border-radius: 32px;
|
|
8
|
-
display: flex;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
align-items: center;
|
|
11
|
-
transition: background-color 0.2s ease;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.icon-active {
|
|
15
|
-
background: ${t.background.brandLight};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.main-icon-class:hover {
|
|
19
|
-
background: ${t.background.base};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.notification--count {
|
|
23
|
-
box-sizing: border-box;
|
|
24
|
-
position: absolute;
|
|
25
|
-
right: 6px;
|
|
26
|
-
top: 4px;
|
|
27
|
-
border-radius: 50%;
|
|
28
|
-
width: 14px;
|
|
29
|
-
height: 14px;
|
|
30
|
-
background: ${t.background.negative.vibrant};
|
|
31
|
-
border: 1.25px solid ${t.surface.standard};
|
|
32
|
-
display: flex;
|
|
33
|
-
justify-content: center;
|
|
34
|
-
align-items: center;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.count--text {
|
|
38
|
-
font-size: 8px;
|
|
39
|
-
line-height: 7.2px;
|
|
40
|
-
font-weight: 400;
|
|
41
|
-
color: ${t.surface.standard};
|
|
42
|
-
}
|
|
43
|
-
`,n=e.div`
|
|
44
|
-
overflow-y: auto;
|
|
45
|
-
display: flex;
|
|
46
|
-
flex-direction: column;
|
|
47
|
-
height: 100%;
|
|
48
|
-
max-height: calc(100vh - 60px);
|
|
49
|
-
|
|
50
|
-
&::-webkit-scrollbar {
|
|
51
|
-
display: block;
|
|
52
|
-
width: 6px;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
::-webkit-scrollbar-thumb {
|
|
56
|
-
background: ${t.content.inactive};
|
|
57
|
-
border-radius: 3px;
|
|
58
|
-
min-height: 30px;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.icon--wrapper {
|
|
62
|
-
display: flex;
|
|
63
|
-
justify-content: center;
|
|
64
|
-
align-items: center;
|
|
65
|
-
width: 64px;
|
|
66
|
-
height: 64px;
|
|
67
|
-
border-radius: 50%;
|
|
68
|
-
background: ${t.background.base};
|
|
69
|
-
margin-bottom: 16px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.no--data--found {
|
|
73
|
-
display: flex;
|
|
74
|
-
flex-direction: column;
|
|
75
|
-
justify-content: center;
|
|
76
|
-
align-items: center;
|
|
77
|
-
height: 300px;
|
|
78
|
-
text-align: center;
|
|
79
|
-
padding: 24px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.text--align {
|
|
83
|
-
text-align: center;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.scroller {
|
|
87
|
-
display: flex;
|
|
88
|
-
flex-direction: column;
|
|
89
|
-
gap: 16px;
|
|
90
|
-
padding: 16px 0;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.full--width {
|
|
94
|
-
width: 100%;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.flex {
|
|
98
|
-
display: flex;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.flex--row {
|
|
102
|
-
flex-direction: row;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.flex--column {
|
|
106
|
-
flex-direction: column;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.mt-8 {
|
|
110
|
-
margin-top: 8px;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.mt-20 {
|
|
114
|
-
margin-top: 20px;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.mt--8 {
|
|
118
|
-
margin-top: 8px;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.mt--12 {
|
|
122
|
-
margin-top: 12px;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.mb-mt-8 {
|
|
126
|
-
margin-bottom: 8px;
|
|
127
|
-
margin-top: 8px;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.padding--16 {
|
|
131
|
-
padding: 16px;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.card--desc {
|
|
135
|
-
max-height: 200px;
|
|
136
|
-
overflow-y: auto;
|
|
137
|
-
font-size: 12px;
|
|
138
|
-
color: ${t.content.secondary};
|
|
139
|
-
|
|
140
|
-
p {
|
|
141
|
-
margin-bottom: 0px;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.created--at {
|
|
146
|
-
align-items: center;
|
|
147
|
-
gap: 4px;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.new--content--tag {
|
|
151
|
-
padding: 2px 6px;
|
|
152
|
-
gap: 4px;
|
|
153
|
-
border-radius: 14px;
|
|
154
|
-
background: ${t.background.warning.vibrant};
|
|
155
|
-
display: flex;
|
|
156
|
-
justify-content: center;
|
|
157
|
-
align-items: center;
|
|
158
|
-
margin-right: 8px;
|
|
159
|
-
}
|
|
160
|
-
`,r=e.div`
|
|
161
|
-
display: flex;
|
|
162
|
-
flex-direction: column;
|
|
163
|
-
height: 100%;
|
|
164
|
-
`,o=e.div`
|
|
165
|
-
background: ${t.surface.standard};
|
|
166
|
-
border-radius: 8px;
|
|
167
|
-
border: 1px solid ${t.stroke.primary};
|
|
168
|
-
padding: 16px;
|
|
169
|
-
display: flex;
|
|
170
|
-
flex-direction: column;
|
|
171
|
-
gap: 8px;
|
|
172
|
-
transition: all 0.2s ease;
|
|
173
|
-
|
|
174
|
-
&:hover {
|
|
175
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
176
|
-
}
|
|
177
|
-
`,a=e.div`
|
|
178
|
-
background-image: url(${e=>e.imageUrl});
|
|
179
|
-
background-size: cover;
|
|
180
|
-
background-position: center;
|
|
181
|
-
background-repeat: no-repeat;
|
|
182
|
-
height: ${e=>e.height||"200px"};
|
|
183
|
-
width: ${e=>e.width||"100%"};
|
|
184
|
-
border-radius: 4px;
|
|
185
|
-
`;export{a as BackgroundImageContainer,o as MainCardContainer,r as MainContainer,i as WhatsNewIconContainer,n as WhatsNewWrapper};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface WhatsNewContent {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
body: string;
|
|
6
|
-
content: string;
|
|
7
|
-
image: string;
|
|
8
|
-
buttonText: string;
|
|
9
|
-
redirectUrl: string;
|
|
10
|
-
productVideo?: string;
|
|
11
|
-
docId?: string;
|
|
12
|
-
createdAt: any;
|
|
13
|
-
module: string[];
|
|
14
|
-
visibility: boolean;
|
|
15
|
-
}
|
|
16
|
-
export interface WhatsNewProviderProps {
|
|
17
|
-
children: React.ReactNode;
|
|
18
|
-
fetchWhatsNewContent: () => Promise<[Error | null, WhatsNewContent[] | null]>;
|
|
19
|
-
markContentAsViewed?: (contentId: string) => Promise<void>;
|
|
20
|
-
module?: string;
|
|
21
|
-
isLoading?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export interface WhatsNewButtonProps {
|
|
24
|
-
onClick?: () => void;
|
|
25
|
-
newContentCount?: number;
|
|
26
|
-
isOpen?: boolean;
|
|
27
|
-
isLoading?: boolean;
|
|
28
|
-
tooltip?: string;
|
|
29
|
-
testId?: string;
|
|
30
|
-
iconWidth?: number;
|
|
31
|
-
iconHeight?: number;
|
|
32
|
-
customIcon?: React.ComponentType<{
|
|
33
|
-
width?: number;
|
|
34
|
-
height?: number;
|
|
35
|
-
color?: string;
|
|
36
|
-
}>;
|
|
37
|
-
}
|
|
38
|
-
export interface WhatsNewPanelProps {
|
|
39
|
-
isOpen: boolean;
|
|
40
|
-
onClose: () => void;
|
|
41
|
-
content: WhatsNewContent[];
|
|
42
|
-
isLoading?: boolean;
|
|
43
|
-
title?: string;
|
|
44
|
-
searchPlaceholder?: string;
|
|
45
|
-
emptyStateTitle?: string;
|
|
46
|
-
emptyStateDescription?: string;
|
|
47
|
-
noResultsText?: string;
|
|
48
|
-
width?: string;
|
|
49
|
-
onContentClick?: (content: WhatsNewContent) => void;
|
|
50
|
-
renderCustomContent?: (content: WhatsNewContent) => React.ReactNode;
|
|
51
|
-
}
|
|
52
|
-
export interface WhatsNewHookReturn {
|
|
53
|
-
whatsNewContent: WhatsNewContent[];
|
|
54
|
-
isLoading: boolean;
|
|
55
|
-
newContentCount: number;
|
|
56
|
-
markAsViewed: (contentId: string) => Promise<void>;
|
|
57
|
-
refreshContent: () => Promise<void>;
|
|
58
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
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}=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},{children:t.jsxs("div",Object.assign({className:"main-icon-class "+(d?"icon-active":""),style:{color:d?s.content.brand:s.content.secondary},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.secondary}):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 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{useContext as t,createContext as r}from"react";import{useWhatsNew as o}from"./useWhatsNew.js";const n=r(null),s=t=>{let{children:r,fetchWhatsNewContent:s,markContentAsViewed:i,module:a}=t;const m=o({fetchWhatsNewContent:s,markContentAsViewed:i,module:a});return e.jsx(n.Provider,Object.assign({value:m},{children:r}))},i=()=>{const e=t(n);if(!e)throw new Error("useWhatsNewContext must be used within a WhatsNewProvider");return e};export{s as WhatsNewProvider,i as useWhatsNewContext};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { WhatsNewContent, WhatsNewHookReturn } from './WhatsNew.types';
|
|
2
|
-
interface UseWhatsNewProps {
|
|
3
|
-
fetchWhatsNewContent: () => Promise<[Error | null, WhatsNewContent[] | null]>;
|
|
4
|
-
markContentAsViewed?: (contentId: string) => Promise<void>;
|
|
5
|
-
module?: string;
|
|
6
|
-
newContentThresholdDays?: number;
|
|
7
|
-
}
|
|
8
|
-
export declare const useWhatsNew: ({ fetchWhatsNewContent, markContentAsViewed, module, newContentThresholdDays, }: UseWhatsNewProps) => WhatsNewHookReturn;
|
|
9
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../_virtual/_tslib.js";import{differenceInBusinessDays as t}from"date-fns";import{useState as o,useCallback as n,useEffect as r}from"react";const a=a=>{let{fetchWhatsNewContent:i,markContentAsViewed:d,module:c,newContentThresholdDays:l=7}=a;const[s,f]=o([]),[u,w]=o(!0),v=n((()=>e(void 0,void 0,void 0,(function*(){w(!0);try{const[e,t]=yield i();if(e)console.error("Failed to fetch what's new content:",e),f([]);else if(t){let e=t;c&&(e=t.filter((e=>Array.isArray(e.module)?e.module.includes(c):e.module===c))),e.sort(((e,t)=>{var o,n;const r=(null===(o=e.createdAt)||void 0===o?void 0:o.toDate)?e.createdAt.toDate():new Date(e.createdAt);return((null===(n=t.createdAt)||void 0===n?void 0:n.toDate)?t.createdAt.toDate():new Date(t.createdAt)).getTime()-r.getTime()})),f(e)}else f([])}catch(e){console.error("Failed to fetch what's new content:",e),f([])}finally{w(!1)}}))),[i,c]);r((()=>{v()}),[v]);const m=n((e=>{if(!e.createdAt)return!1;const o=e.createdAt.toDate?e.createdAt.toDate():new Date(e.createdAt);return t(new Date,o)<l}),[l]),A=s.reduce(((e,t)=>m(t)?e+1:e),0);return{whatsNewContent:s,isLoading:u,newContentCount:A,markAsViewed:n((t=>e(void 0,void 0,void 0,(function*(){if(d)try{yield d(t)}catch(e){console.warn("Failed to mark content as viewed:",e)}}))),[d]),refreshContent:n((()=>e(void 0,void 0,void 0,(function*(){yield v()}))),[v])}};export{a as useWhatsNew};
|