@bikdotai/bik-component-library 0.0.16 → 0.0.19
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/RedirectToNew.svg.js +1 -0
- package/dist/cjs/assets/icons/arrow_left.svg.js +1 -0
- package/dist/cjs/assets/icons/filePdf.svg.js +1 -0
- package/dist/cjs/assets/icons/halfRectangle.svg.js +1 -0
- package/dist/cjs/assets/icons/image.svg.js +1 -0
- package/dist/cjs/assets/icons/more_vertical.svg.js +1 -0
- package/dist/cjs/assets/icons/phone.svg.js +1 -0
- package/dist/cjs/assets/icons/union.svg.js +1 -0
- package/dist/cjs/assets/icons/user_icon.svg.js +1 -0
- package/dist/cjs/assets/icons/vertical_dots.svg.js +1 -0
- package/dist/cjs/assets/icons/videoRecorder.svg.js +1 -0
- package/dist/cjs/components/TypographyStyle.d.ts +2 -0
- package/dist/cjs/components/TypographyStyle.js +62 -50
- package/dist/cjs/components/dropdown/Common.styled.js +12 -0
- package/dist/cjs/components/dropdown/UnChildDropdown/UnChildDropdown.js +1 -0
- package/dist/cjs/components/modals/styledModal.js +1 -1
- package/dist/cjs/components/template-preview/EmailTemplatePreview.styled.d.ts +8 -0
- package/dist/cjs/components/template-preview/EmailTemplatePreview.styled.js +29 -0
- package/dist/cjs/components/template-preview/EmailTemplateThumbnailPreview.d.ts +13 -0
- package/dist/cjs/components/template-preview/EmailTemplateThumbnailPreview.js +1 -0
- package/dist/cjs/components/template-preview/SMS/SMSBubble.d.ts +9 -0
- package/dist/cjs/components/template-preview/SMS/SMSBubble.js +12 -0
- package/dist/cjs/components/template-preview/SmsTemplatePreview.d.ts +12 -0
- package/dist/cjs/components/template-preview/SmsTemplatePreview.js +1 -0
- package/dist/cjs/components/template-preview/SmsTemplatePreview.styled.d.ts +13 -0
- package/dist/cjs/components/template-preview/SmsTemplatePreview.styled.js +46 -0
- package/dist/cjs/components/template-preview/TemplatePreview.d.ts +18 -0
- package/dist/cjs/components/template-preview/TemplatePreview.js +1 -0
- package/dist/cjs/components/template-preview/WhatsApp/ChatBtn.d.ts +9 -0
- package/dist/cjs/components/template-preview/WhatsApp/ChatBtn.js +1 -0
- package/dist/cjs/components/template-preview/WhatsApp/ChatHeader.d.ts +3 -0
- package/dist/cjs/components/template-preview/WhatsApp/ChatHeader.js +1 -0
- package/dist/cjs/components/template-preview/WhatsApp/ChatHeader.style.d.ts +5 -0
- package/dist/cjs/components/template-preview/WhatsApp/ChatHeader.style.js +37 -0
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.d.ts +4 -0
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.js +7 -0
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.style.d.ts +7 -0
- package/dist/cjs/components/template-preview/WhatsApp/ChatUI.style.js +52 -0
- package/dist/cjs/components/template-preview/WhatsApp/MediaCard.d.ts +14 -0
- package/dist/cjs/components/template-preview/WhatsApp/MediaCard.js +1 -0
- package/dist/cjs/components/template-preview/WhatsApp/RenderTemplateWithVariable.d.ts +7 -0
- package/dist/cjs/components/template-preview/WhatsApp/RenderTemplateWithVariable.js +4 -0
- package/dist/cjs/components/template-preview/WhatsApp/WhatsAppLikePreview.d.ts +3 -0
- package/dist/cjs/components/template-preview/WhatsApp/WhatsAppLikePreview.js +12 -0
- package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.d.ts +13 -0
- package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.js +1 -0
- package/dist/cjs/components/template-preview/constants/TemplateConstants.d.ts +23 -0
- package/dist/cjs/components/template-preview/constants/TemplateConstants.js +1 -0
- package/dist/cjs/components/template-preview/constants/regexPatterns.d.ts +11 -0
- package/dist/cjs/components/template-preview/constants/regexPatterns.js +1 -0
- package/dist/cjs/components/template-preview/helpers/SmsTemplateHelper.d.ts +2 -0
- package/dist/cjs/components/template-preview/helpers/SmsTemplateHelper.js +1 -0
- package/dist/cjs/components/template-preview/helpers/TemplateCreatorHelper.d.ts +16 -0
- package/dist/cjs/components/template-preview/helpers/TemplateCreatorHelper.js +1 -0
- package/dist/cjs/components/template-preview/helpers/WhatsAppFormatToHTML.d.ts +8 -0
- package/dist/cjs/components/template-preview/helpers/WhatsAppFormatToHTML.js +1 -0
- package/dist/cjs/components/template-preview/index.d.ts +6 -0
- package/dist/cjs/components/template-preview/models/Channels.d.ts +8 -0
- package/dist/cjs/components/template-preview/models/Channels.js +1 -0
- package/dist/cjs/components/template-preview/models/EmailTemplate.d.ts +38 -0
- package/dist/cjs/components/template-preview/models/SmsTemplate.d.ts +35 -0
- package/dist/cjs/components/template-preview/models/TemplateMeta.d.ts +42 -0
- package/dist/cjs/components/template-preview/models/TemplateMeta.js +1 -0
- package/dist/cjs/components/template-preview/models/WhatsAppTemplate.d.ts +180 -0
- package/dist/cjs/components/template-preview/utils/TemplateHelperUtils.d.ts +6 -0
- package/dist/cjs/components/template-preview/utils/TemplateHelperUtils.js +1 -0
- package/dist/cjs/components/template-preview/utils/getPreviewPropLen.d.ts +2 -0
- package/dist/cjs/components/template-preview/utils/getPreviewPropLen.js +1 -0
- package/dist/cjs/constants/Theme.d.ts +6 -0
- package/dist/cjs/constants/Theme.js +1 -1
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/utils/StringUtils.d.ts +10 -0
- package/dist/cjs/utils/StringUtils.js +1 -0
- package/dist/esm/assets/icons/RedirectToNew.svg.js +1 -0
- package/dist/esm/assets/icons/arrow_left.svg.js +1 -0
- package/dist/esm/assets/icons/filePdf.svg.js +1 -0
- package/dist/esm/assets/icons/halfRectangle.svg.js +1 -0
- package/dist/esm/assets/icons/image.svg.js +1 -0
- package/dist/esm/assets/icons/more_vertical.svg.js +1 -0
- package/dist/esm/assets/icons/phone.svg.js +1 -0
- package/dist/esm/assets/icons/union.svg.js +1 -0
- package/dist/esm/assets/icons/user_icon.svg.js +1 -0
- package/dist/esm/assets/icons/vertical_dots.svg.js +1 -0
- package/dist/esm/assets/icons/videoRecorder.svg.js +1 -0
- package/dist/esm/components/TypographyStyle.d.ts +2 -0
- package/dist/esm/components/TypographyStyle.js +60 -48
- package/dist/esm/components/dropdown/Common.styled.js +12 -0
- package/dist/esm/components/dropdown/UnChildDropdown/UnChildDropdown.js +1 -0
- package/dist/esm/components/modals/styledModal.js +1 -1
- package/dist/esm/components/template-preview/EmailTemplatePreview.styled.d.ts +8 -0
- package/dist/esm/components/template-preview/EmailTemplatePreview.styled.js +29 -0
- package/dist/esm/components/template-preview/EmailTemplateThumbnailPreview.d.ts +13 -0
- package/dist/esm/components/template-preview/EmailTemplateThumbnailPreview.js +1 -0
- package/dist/esm/components/template-preview/SMS/SMSBubble.d.ts +9 -0
- package/dist/esm/components/template-preview/SMS/SMSBubble.js +12 -0
- package/dist/esm/components/template-preview/SmsTemplatePreview.d.ts +12 -0
- package/dist/esm/components/template-preview/SmsTemplatePreview.js +1 -0
- package/dist/esm/components/template-preview/SmsTemplatePreview.styled.d.ts +13 -0
- package/dist/esm/components/template-preview/SmsTemplatePreview.styled.js +46 -0
- package/dist/esm/components/template-preview/TemplatePreview.d.ts +18 -0
- package/dist/esm/components/template-preview/TemplatePreview.js +1 -0
- package/dist/esm/components/template-preview/WhatsApp/ChatBtn.d.ts +9 -0
- package/dist/esm/components/template-preview/WhatsApp/ChatBtn.js +1 -0
- package/dist/esm/components/template-preview/WhatsApp/ChatHeader.d.ts +3 -0
- package/dist/esm/components/template-preview/WhatsApp/ChatHeader.js +1 -0
- package/dist/esm/components/template-preview/WhatsApp/ChatHeader.style.d.ts +5 -0
- package/dist/esm/components/template-preview/WhatsApp/ChatHeader.style.js +37 -0
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.d.ts +4 -0
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.js +7 -0
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.d.ts +7 -0
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.js +52 -0
- package/dist/esm/components/template-preview/WhatsApp/MediaCard.d.ts +14 -0
- package/dist/esm/components/template-preview/WhatsApp/MediaCard.js +1 -0
- package/dist/esm/components/template-preview/WhatsApp/RenderTemplateWithVariable.d.ts +7 -0
- package/dist/esm/components/template-preview/WhatsApp/RenderTemplateWithVariable.js +4 -0
- package/dist/esm/components/template-preview/WhatsApp/WhatsAppLikePreview.d.ts +3 -0
- package/dist/esm/components/template-preview/WhatsApp/WhatsAppLikePreview.js +12 -0
- package/dist/esm/components/template-preview/WhatsAppTemplatePreview.d.ts +13 -0
- package/dist/esm/components/template-preview/WhatsAppTemplatePreview.js +1 -0
- package/dist/esm/components/template-preview/constants/TemplateConstants.d.ts +23 -0
- package/dist/esm/components/template-preview/constants/TemplateConstants.js +1 -0
- package/dist/esm/components/template-preview/constants/regexPatterns.d.ts +11 -0
- package/dist/esm/components/template-preview/constants/regexPatterns.js +1 -0
- package/dist/esm/components/template-preview/helpers/SmsTemplateHelper.d.ts +2 -0
- package/dist/esm/components/template-preview/helpers/SmsTemplateHelper.js +1 -0
- package/dist/esm/components/template-preview/helpers/TemplateCreatorHelper.d.ts +16 -0
- package/dist/esm/components/template-preview/helpers/TemplateCreatorHelper.js +1 -0
- package/dist/esm/components/template-preview/helpers/WhatsAppFormatToHTML.d.ts +8 -0
- package/dist/esm/components/template-preview/helpers/WhatsAppFormatToHTML.js +1 -0
- package/dist/esm/components/template-preview/index.d.ts +6 -0
- package/dist/esm/components/template-preview/models/Channels.d.ts +8 -0
- package/dist/esm/components/template-preview/models/Channels.js +1 -0
- package/dist/esm/components/template-preview/models/EmailTemplate.d.ts +38 -0
- package/dist/esm/components/template-preview/models/SmsTemplate.d.ts +35 -0
- package/dist/esm/components/template-preview/models/TemplateMeta.d.ts +42 -0
- package/dist/esm/components/template-preview/models/TemplateMeta.js +1 -0
- package/dist/esm/components/template-preview/models/WhatsAppTemplate.d.ts +180 -0
- package/dist/esm/components/template-preview/utils/TemplateHelperUtils.d.ts +6 -0
- package/dist/esm/components/template-preview/utils/TemplateHelperUtils.js +1 -0
- package/dist/esm/components/template-preview/utils/getPreviewPropLen.d.ts +2 -0
- package/dist/esm/components/template-preview/utils/getPreviewPropLen.js +1 -0
- package/dist/esm/constants/Theme.d.ts +6 -0
- package/dist/esm/constants/Theme.js +1 -1
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/utils/StringUtils.d.ts +10 -0
- package/dist/esm/utils/StringUtils.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import { CHANNEL_TYPE } from './Channels';
|
|
3
|
+
import { ACTIONS_TYPES, HEADER_TYPES, QUICK_REPLY_BUTTON, TEMPLATE_STATUS } from './TemplateMeta';
|
|
4
|
+
export type WhatsAppTemplate = {
|
|
5
|
+
name: string;
|
|
6
|
+
label: string;
|
|
7
|
+
recommended?: boolean;
|
|
8
|
+
templateId?: string;
|
|
9
|
+
channel: CHANNEL_TYPE;
|
|
10
|
+
templateCategory: string;
|
|
11
|
+
type?: 'email' | 'whatsapp';
|
|
12
|
+
components: {
|
|
13
|
+
type: 'HEADER' | 'BODY' | 'BUTTONS' | 'FOOTER';
|
|
14
|
+
format?: 'TEXT' | 'IMAGE' | 'VIDEO' | 'DOCUMENT' | 'NONE';
|
|
15
|
+
text?: string;
|
|
16
|
+
buttons?: {
|
|
17
|
+
type: 'QUICK_REPLY' | 'URL' | 'PHONE_NUMBER';
|
|
18
|
+
text?: string;
|
|
19
|
+
url?: string;
|
|
20
|
+
example?: string[];
|
|
21
|
+
linkMode?: 'custom' | 'home';
|
|
22
|
+
phone_number?: string;
|
|
23
|
+
flowName?: string;
|
|
24
|
+
flowId?: string;
|
|
25
|
+
}[];
|
|
26
|
+
example?: {
|
|
27
|
+
header_handle?: Array<string>;
|
|
28
|
+
body_text?: Array<string[]>;
|
|
29
|
+
header_text?: Array<string>;
|
|
30
|
+
};
|
|
31
|
+
}[];
|
|
32
|
+
mapping: {
|
|
33
|
+
header?: string[];
|
|
34
|
+
body?: string[];
|
|
35
|
+
buttons?: string[];
|
|
36
|
+
};
|
|
37
|
+
htmlContentUrl?: string;
|
|
38
|
+
language: 'en_US';
|
|
39
|
+
status: TEMPLATE_STATUS;
|
|
40
|
+
category: string;
|
|
41
|
+
thumbnailImageUrl?: string;
|
|
42
|
+
FB_blob_key?: string;
|
|
43
|
+
reason?: string;
|
|
44
|
+
createdAt: number;
|
|
45
|
+
updatedAt: number;
|
|
46
|
+
isDraft?: boolean;
|
|
47
|
+
};
|
|
48
|
+
export type CreateTemplateType = {
|
|
49
|
+
/** Data */
|
|
50
|
+
headerType: HEADER_TYPES;
|
|
51
|
+
headerAssetLink?: string | null;
|
|
52
|
+
headerAssetName?: string | null;
|
|
53
|
+
headerText?: string;
|
|
54
|
+
headerVariables: templateVariable[];
|
|
55
|
+
bodyVariables: templateVariable[];
|
|
56
|
+
bodyText?: string;
|
|
57
|
+
bodyTextRaw?: string;
|
|
58
|
+
footerText?: string;
|
|
59
|
+
actionsType: ACTIONS_TYPES;
|
|
60
|
+
quickReply: Array<QUICK_REPLY_BUTTON>;
|
|
61
|
+
ctaBtn: {
|
|
62
|
+
phoneNumber?: {
|
|
63
|
+
isChecked?: boolean;
|
|
64
|
+
btnText?: string;
|
|
65
|
+
phoneNumber?: string;
|
|
66
|
+
};
|
|
67
|
+
websiteLinkBtn?: {
|
|
68
|
+
isChecked?: boolean;
|
|
69
|
+
btnText?: string;
|
|
70
|
+
linkOpens?: string;
|
|
71
|
+
placeholder?: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
meta: {
|
|
75
|
+
name: string;
|
|
76
|
+
category?: string;
|
|
77
|
+
subCategory?: string;
|
|
78
|
+
language?: string;
|
|
79
|
+
templateId?: string;
|
|
80
|
+
};
|
|
81
|
+
mode: 'edit' | 'create';
|
|
82
|
+
alreadyAsADraft?: boolean;
|
|
83
|
+
/** UI */
|
|
84
|
+
initialLoading: boolean;
|
|
85
|
+
error: {
|
|
86
|
+
modalError?: string;
|
|
87
|
+
header?: string;
|
|
88
|
+
body?: string;
|
|
89
|
+
footer?: string;
|
|
90
|
+
quickReply?: Array<string | null>;
|
|
91
|
+
meta?: {
|
|
92
|
+
name?: string;
|
|
93
|
+
};
|
|
94
|
+
ctaBtn?: {
|
|
95
|
+
phoneNumber: {
|
|
96
|
+
btnText: string;
|
|
97
|
+
link: string;
|
|
98
|
+
};
|
|
99
|
+
websiteLink: {
|
|
100
|
+
btnText: string;
|
|
101
|
+
link: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
/** DATA DUMP */
|
|
106
|
+
buttonPlaceholders?: templatePlaceHolder[];
|
|
107
|
+
};
|
|
108
|
+
export type templatePlaceHolder = {
|
|
109
|
+
default_value: string;
|
|
110
|
+
placeHolder: string;
|
|
111
|
+
title: string;
|
|
112
|
+
};
|
|
113
|
+
export type templateVariable = {
|
|
114
|
+
editable: boolean;
|
|
115
|
+
variableName: string;
|
|
116
|
+
variableVal?: string;
|
|
117
|
+
editableDefaultValues?: string | null;
|
|
118
|
+
idx: number;
|
|
119
|
+
};
|
|
120
|
+
export type getTemplateByIdResponse = {
|
|
121
|
+
components: WhatsAppTemplate['components'];
|
|
122
|
+
language: string;
|
|
123
|
+
label: string;
|
|
124
|
+
createdAt: any;
|
|
125
|
+
templateId: string;
|
|
126
|
+
name: string;
|
|
127
|
+
createdBy: string;
|
|
128
|
+
channel: string;
|
|
129
|
+
isDraft?: boolean;
|
|
130
|
+
mapping: TemplateVariableMapping;
|
|
131
|
+
isArchive?: boolean;
|
|
132
|
+
storeId: string;
|
|
133
|
+
channelTemplateId: string;
|
|
134
|
+
status: TEMPLATE_STATUS;
|
|
135
|
+
category: string;
|
|
136
|
+
templateCategory: string;
|
|
137
|
+
syncOnboarding?: boolean;
|
|
138
|
+
recomendedForCohorts?: string[];
|
|
139
|
+
htmlContentUrl?: string;
|
|
140
|
+
};
|
|
141
|
+
export type TemplateVariableMapping = {
|
|
142
|
+
body: string[];
|
|
143
|
+
buttons: string[];
|
|
144
|
+
header: string[];
|
|
145
|
+
footer: string[];
|
|
146
|
+
};
|
|
147
|
+
export type WhatsappLikePreviewTypes = {
|
|
148
|
+
bodyText?: string;
|
|
149
|
+
footerText?: string;
|
|
150
|
+
headerMediaType: HEADER_TYPES;
|
|
151
|
+
headerText?: string;
|
|
152
|
+
headerAssetLink?: string;
|
|
153
|
+
headerAssetName?: string;
|
|
154
|
+
quickReplybtn?: QUICK_REPLY_BUTTON[];
|
|
155
|
+
ctaBtn?: {
|
|
156
|
+
type: 'phoneNumber' | 'website';
|
|
157
|
+
text: string;
|
|
158
|
+
extra?: string;
|
|
159
|
+
placeholder?: string;
|
|
160
|
+
}[];
|
|
161
|
+
actionTypes?: ACTIONS_TYPES;
|
|
162
|
+
textType: 'html' | 'markdown';
|
|
163
|
+
hidePreviewText?: boolean;
|
|
164
|
+
extras?: boolean;
|
|
165
|
+
containerStyle?: React.CSSProperties;
|
|
166
|
+
showHeader?: boolean;
|
|
167
|
+
containerPadding?: string;
|
|
168
|
+
imagePreviewStyles?: React.CSSProperties;
|
|
169
|
+
size?: 'small' | 'large';
|
|
170
|
+
zeroStateComponent: ReactElement<any, any>;
|
|
171
|
+
};
|
|
172
|
+
export type WhatsappMeta = {
|
|
173
|
+
containerStyle?: React.CSSProperties | undefined;
|
|
174
|
+
templateContainerStyles?: React.CSSProperties | undefined;
|
|
175
|
+
size?: 'small' | 'large';
|
|
176
|
+
showWhatsAppHeader?: boolean;
|
|
177
|
+
whatsAppExtras?: boolean;
|
|
178
|
+
zeroStateComponent?: ReactElement;
|
|
179
|
+
usePlaceHolderName?: boolean;
|
|
180
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { templateVariable } from '../models/WhatsAppTemplate';
|
|
2
|
+
export declare class TemplateHelperUtils {
|
|
3
|
+
fillVariablesValInBodyText(text: string, variableStore: templateVariable[], usePlaceholderName?: boolean): string;
|
|
4
|
+
getTemplateVariablesFromState(text: string): string[] | undefined;
|
|
5
|
+
whatsappOnlyFillVariablesValueInBodyText(text: string, variableStore: templateVariable[], usePlaceholderName?: boolean): string;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{templateVariablePattern as l,globalVariablePattern as e}from"../constants/regexPatterns.js";class a{fillVariablesValInBodyText(e,a){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=e.match(l),t=e.split(l);if(e&&(null==r?void 0:r.length)){return t.map(((l,e)=>{var n,o,v,d,u;const m=null===(n=null==r?void 0:r[e])||void 0===n?void 0:n.replace("{{","").replace("}}","");return t.length-1===e?l:(null===(v=null===(o=null==a?void 0:a[e])||void 0===o?void 0:o.variableName)||void 0===v?void 0:v.trim())===m.trim()||(null===(u=null===(d=null==a?void 0:a[e])||void 0===d?void 0:d.variableVal)||void 0===u?void 0:u.trim())===m.trim()?a[e].editable?`${l}${i?"{{":""}${a[e].variableVal}${i?"}}":""}`:`${l}${i?"{{":""}${a[e].variableName}${i?"}}":""}`:l})).join("")}return e}getTemplateVariablesFromState(l){var a;return null===(a=l.match(e))||void 0===a?void 0:a.map((l=>l.replace("{{","").replace("}}","")))}whatsappOnlyFillVariablesValueInBodyText(e,a){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=e.match(l),t=e.split(l);if(e&&(null==r?void 0:r.length)){return t.map(((l,e)=>{var n;const o=null===(n=null==r?void 0:r[e])||void 0===n?void 0:n.replace("{{","").replace("}}","");if(t.length-1===e)return l;const v=a.findIndex((l=>l.variableName===o));if(v>-1){let e=a[v].variableVal;return i||(e=!a[v].variableVal&&a[v].variableName.startsWith("editableVariable")?a[v].variableName:null==e?void 0:e.replace("[[","").replace("]]","")),a[v].editable?`${l}${i?"{{":""}${e}${i?"}}":""}`:`${l}${i?"{{":""}${o}${i?"}}":""}`}return l})).join("")}return e}}export{a as TemplateHelperUtils};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=r=>Object.keys(r).filter((t=>{const e=r[t];return e&&Array.isArray(e)?!!e.length:!!e})).length;export{r as getPreviewPropLen};
|
|
@@ -59,6 +59,9 @@ export declare const COLORS: {
|
|
|
59
59
|
light: string;
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
+
icon: {
|
|
63
|
+
placeholder: string;
|
|
64
|
+
};
|
|
62
65
|
scrim: {
|
|
63
66
|
standard: string;
|
|
64
67
|
};
|
|
@@ -334,6 +337,9 @@ export declare const DEFAULT_THEME: {
|
|
|
334
337
|
light: string;
|
|
335
338
|
};
|
|
336
339
|
};
|
|
340
|
+
icon: {
|
|
341
|
+
placeholder: string;
|
|
342
|
+
};
|
|
337
343
|
scrim: {
|
|
338
344
|
standard: string;
|
|
339
345
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={brand:{900:"#28034E",800:"#4B1583",500:"#731DCF",50:"#EFE6F9"},grayscale:{900:"#212121",700:"#616161",500:"#9E9E9E",400:"#BDBDBD",200:"#E0E0E0",100:"#F0F0F0",50:"#FAFAFA",white:"#FFFFFF",alpha:"#00000088"},negative:{900:"#B92321",700:"#D53434",100:"#FFCED4",50:"#FFEBEF"},warning:{900:"#99631B",500:"#FEC02D",100:"#FFEABE",50:"#FFF7E5"},positive:{900:"#00580E",700:"#1A872C",100:"#C3E4C4",50:"#E6F4E7"}},t={background:{inactive:e.grayscale[200],base:e.grayscale[100],inverse:e.brand[900],inverseLight:e.brand[800],brand:e.brand[500],brandLight:e.brand[50],negative:{vibrant:e.negative[700],light:e.negative[50]},warning:{vibrant:e.warning[500],light:e.warning[50]},positive:{vibrant:e.positive[700],light:e.positive[50]},blue:{light:"#E5F2FF"}},scrim:{standard:"#00000099"},surface:{standard:e.grayscale.white,subdued:e.grayscale[50],hovered:e.grayscale[100]},content:{primary:e.grayscale[900],secondary:e.grayscale[700],placeholder:e.grayscale[500],inactive:e.grayscale[400],brand:e.brand[500],primaryInverse:e.grayscale.white,secondaryInverse:"#ffffffcc",negative:e.negative[900],warning:e.warning[900],positive:e.positive[900],blue:"#28458F"},stroke:{primary:e.grayscale[200],brand:e.brand[500],negative:{lightAlt:e.negative[100],vibrant:e.negative[700]},warning:{lightAlt:e.warning[100]},positive:{lightAlt:e.positive[100]},brandLightAlt:"#DDCCF0",blue:{lightAlt:"#C3D5E5"}},special:{whatsapp:{brand:"#25D366",gradient:"linear-gradient(360deg, #20B038 0%, #60D66A 100%)",dark:"#455A64",gradientArr:["#20B038","#60D66A"]},brand:{google:"#DD4B39",facebook:"#1877F2"}},text:{primary:e.grayscale[900],secondary:e.grayscale[700],placeholder:e.grayscale[500],disabled:e.grayscale[400],white:e.grayscale.white,brand:e.brand[500],altPrimary:e.brand[900],altSecondary:e.brand[800]}},i={display:{fontWeight:"400",fontSize:32,lineHeight:40,letterSpacing:0},titleXLarge:{fontWeight:"600",fontSize:32,lineHeight:40,letterSpacing:0},titleLarge:{fontWeight:"600",fontSize:28,lineHeight:32,letterSpacing:0},titleMedium:{fontWeight:"600",fontSize:20,lineHeight:28,letterSpacing:0},titleRegular:{fontWeight:"600",fontSize:16,lineHeight:24,letterSpacing:0},titleSmall:{fontWeight:"600",fontSize:14,lineHeight:20,letterSpacing:0},bodyPrimary:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},bodyLarge:{fontWeight:"400",fontSize:20,lineHeight:28,letterSpacing:0},bodySecondary:{fontWeight:"400",fontSize:14,lineHeight:20,letterSpacing:0},caption:{fontWeight:"400",fontSize:12,lineHeight:16,letterSpacing:0},tiny:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0},subHeading:{fontWeight:"600",fontSize:10,lineHeight:12,letterSpacing:0},title1:{fontWeight:"600",fontSize:24,lineHeight:32,letterSpacing:0},title1Mobile:{fontWeight:"600",fontSize:20,lineHeight:30,letterSpacing:0},title2:{fontWeight:"600",fontSize:20,lineHeight:28,letterSpacing:0},title2Mobile:{fontWeight:"600",fontSize:18,lineHeight:24,letterSpacing:0},title3:{fontWeight:"600",fontSize:16,lineHeight:24,letterSpacing:0},title3Mobile:{fontWeight:"500",fontSize:14,lineHeight:20,letterSpacing:0},title4:{fontWeight:"400",fontSize:14,lineHeight:20,letterSpacing:0},textPlaceholder:{fontWeight:"400",fontSize:12,lineHeight:16,letterSpacing:0},title4Mobile:{fontWeight:"400",fontSize:10,lineHeight:16,letterSpacing:0},bodyRegularMobile:{fontWeight:"400",fontSize:14,lineHeight:18,letterSpacing:0},bodyRegular:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},bodySmall:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0},buttonLarge:{fontWeight:"600",fontSize:16,lineHeight:20,letterSpacing:0},buttonRegular:{fontWeight:"600",fontSize:14,lineHeight:20,letterSpacing:0},captionMobile:{fontWeight:"500",fontSize:10,lineHeight:12,letterSpacing:0},captionBold:{fontWeight:"700",fontSize:12,lineHeight:16,letterSpacing:0},text1Bold:{fontWeight:"700",fontSize:10,lineHeight:14,letterSpacing:0},toast:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},toastMobile:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0}},n={colorsV2:t,fonts:i};export{e as BASE_COLORS,t as COLORS,n as DEFAULT_THEME,i as FONTS};
|
|
1
|
+
const e={brand:{900:"#28034E",800:"#4B1583",500:"#731DCF",50:"#EFE6F9"},grayscale:{900:"#212121",700:"#616161",500:"#9E9E9E",400:"#BDBDBD",200:"#E0E0E0",100:"#F0F0F0",50:"#FAFAFA",white:"#FFFFFF",alpha:"#00000088"},negative:{900:"#B92321",700:"#D53434",100:"#FFCED4",50:"#FFEBEF"},warning:{900:"#99631B",500:"#FEC02D",100:"#FFEABE",50:"#FFF7E5"},positive:{900:"#00580E",700:"#1A872C",100:"#C3E4C4",50:"#E6F4E7"}},t={background:{inactive:e.grayscale[200],base:e.grayscale[100],inverse:e.brand[900],inverseLight:e.brand[800],brand:e.brand[500],brandLight:e.brand[50],negative:{vibrant:e.negative[700],light:e.negative[50]},warning:{vibrant:e.warning[500],light:e.warning[50]},positive:{vibrant:e.positive[700],light:e.positive[50]},blue:{light:"#E5F2FF"}},icon:{placeholder:"#9E9E9E"},scrim:{standard:"#00000099"},surface:{standard:e.grayscale.white,subdued:e.grayscale[50],hovered:e.grayscale[100]},content:{primary:e.grayscale[900],secondary:e.grayscale[700],placeholder:e.grayscale[500],inactive:e.grayscale[400],brand:e.brand[500],primaryInverse:e.grayscale.white,secondaryInverse:"#ffffffcc",negative:e.negative[900],warning:e.warning[900],positive:e.positive[900],blue:"#28458F"},stroke:{primary:e.grayscale[200],brand:e.brand[500],negative:{lightAlt:e.negative[100],vibrant:e.negative[700]},warning:{lightAlt:e.warning[100]},positive:{lightAlt:e.positive[100]},brandLightAlt:"#DDCCF0",blue:{lightAlt:"#C3D5E5"}},special:{whatsapp:{brand:"#25D366",gradient:"linear-gradient(360deg, #20B038 0%, #60D66A 100%)",dark:"#455A64",gradientArr:["#20B038","#60D66A"]},brand:{google:"#DD4B39",facebook:"#1877F2"}},text:{primary:e.grayscale[900],secondary:e.grayscale[700],placeholder:e.grayscale[500],disabled:e.grayscale[400],white:e.grayscale.white,brand:e.brand[500],altPrimary:e.brand[900],altSecondary:e.brand[800]}},i={display:{fontWeight:"400",fontSize:32,lineHeight:40,letterSpacing:0},titleXLarge:{fontWeight:"600",fontSize:32,lineHeight:40,letterSpacing:0},titleLarge:{fontWeight:"600",fontSize:28,lineHeight:32,letterSpacing:0},titleMedium:{fontWeight:"600",fontSize:20,lineHeight:28,letterSpacing:0},titleRegular:{fontWeight:"600",fontSize:16,lineHeight:24,letterSpacing:0},titleSmall:{fontWeight:"600",fontSize:14,lineHeight:20,letterSpacing:0},bodyPrimary:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},bodyLarge:{fontWeight:"400",fontSize:20,lineHeight:28,letterSpacing:0},bodySecondary:{fontWeight:"400",fontSize:14,lineHeight:20,letterSpacing:0},caption:{fontWeight:"400",fontSize:12,lineHeight:16,letterSpacing:0},tiny:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0},subHeading:{fontWeight:"600",fontSize:10,lineHeight:12,letterSpacing:0},title1:{fontWeight:"600",fontSize:24,lineHeight:32,letterSpacing:0},title1Mobile:{fontWeight:"600",fontSize:20,lineHeight:30,letterSpacing:0},title2:{fontWeight:"600",fontSize:20,lineHeight:28,letterSpacing:0},title2Mobile:{fontWeight:"600",fontSize:18,lineHeight:24,letterSpacing:0},title3:{fontWeight:"600",fontSize:16,lineHeight:24,letterSpacing:0},title3Mobile:{fontWeight:"500",fontSize:14,lineHeight:20,letterSpacing:0},title4:{fontWeight:"400",fontSize:14,lineHeight:20,letterSpacing:0},textPlaceholder:{fontWeight:"400",fontSize:12,lineHeight:16,letterSpacing:0},title4Mobile:{fontWeight:"400",fontSize:10,lineHeight:16,letterSpacing:0},bodyRegularMobile:{fontWeight:"400",fontSize:14,lineHeight:18,letterSpacing:0},bodyRegular:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},bodySmall:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0},buttonLarge:{fontWeight:"600",fontSize:16,lineHeight:20,letterSpacing:0},buttonRegular:{fontWeight:"600",fontSize:14,lineHeight:20,letterSpacing:0},captionMobile:{fontWeight:"500",fontSize:10,lineHeight:12,letterSpacing:0},captionBold:{fontWeight:"700",fontSize:12,lineHeight:16,letterSpacing:0},text1Bold:{fontWeight:"700",fontSize:10,lineHeight:14,letterSpacing:0},toast:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},toastMobile:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0}},n={colorsV2:t,fonts:i};export{e as BASE_COLORS,t as COLORS,n as DEFAULT_THEME,i as FONTS};
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import StringUtils from './utils/StringUtils';
|
|
2
|
+
export { StringUtils };
|
|
1
3
|
export * from './constants/Theme';
|
|
2
4
|
export * from './components/checkBox';
|
|
3
5
|
export * from './components/list-item';
|
|
@@ -10,6 +12,7 @@ export * from './components/stepper';
|
|
|
10
12
|
export * from './components/tag';
|
|
11
13
|
export * from './components/pagination';
|
|
12
14
|
export * from './components/icon-button';
|
|
15
|
+
export * from './components/template-preview';
|
|
13
16
|
export * from './components/fab-menu';
|
|
14
17
|
export * from './components/floating-action-button';
|
|
15
18
|
export * from './components/image-compress';
|
|
@@ -17,3 +20,4 @@ export * from './components/TypographyStyle';
|
|
|
17
20
|
export * from './components/button';
|
|
18
21
|
export * from './components/progress-bar';
|
|
19
22
|
export * from './components/modals';
|
|
23
|
+
export * from './components/dropdown';
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{BASE_COLORS,COLORS,DEFAULT_THEME,FONTS}from"./constants/Theme.js";export{CheckBox}from"./components/checkBox/CheckBox.js";export{ListItem}from"./components/list-item/ListItem.js";export{Pagination}from"./components/pagination/Pagination.js";export{RadioButton}from"./components/radioButton/RadioButton.js";export{Toaster}from"./components/toaster/Toaster.js";export{Tooltip}from"./components/tooltips/Tooltip.js";export{CustomisedTooltip,TooltipPlacement}from"./components/tooltips/CustomisedTooltip.js";export{Spinner}from"./components/spinner/Spinner.js";export{Stepper}from"./components/stepper/Stepper.js";export{Tag}from"./components/tag/Tag.js";export{IconButton}from"./components/icon-button/IconButton.js";export{FABMenu}from"./components/fab-menu/FABMenu.js";export{FloatingActionButton}from"./components/floating-action-button/FloatingActionButton.js";export{DROP_POSITION,DropdownToggleContainer,FAB_POSITION,FloatingActionButtonContainer,FloatingActionButtonOuterContainer,MENU_ALIGNMENT,StyledDropdown}from"./components/floating-action-button/FloatingActionButton.styles.js";export{ImageService}from"./components/image-compress/ImageCompress.js";export{BodyCaption,BodyLarge,BodyPrimary,BodyPrimaryLink,BodySecondary,BodySecondaryLink,BodyTiny,ButtonLarge,ButtonRegular,Display,SubHeading,TitleLarge,TitleMedium,TitleRegular,TitleSmall}from"./components/TypographyStyle.js";export{Button}from"./components/button/Button.js";export{ProgressBarComponent,ProgressCompletedBar}from"./components/progress-bar/ProgressBarComponent.js";export{StyledModal}from"./components/modals/styledModal.js";
|
|
1
|
+
export{default as StringUtils}from"./utils/StringUtils.js";export{BASE_COLORS,COLORS,DEFAULT_THEME,FONTS}from"./constants/Theme.js";export{CheckBox}from"./components/checkBox/CheckBox.js";export{ListItem}from"./components/list-item/ListItem.js";export{Pagination}from"./components/pagination/Pagination.js";export{RadioButton}from"./components/radioButton/RadioButton.js";export{Toaster}from"./components/toaster/Toaster.js";export{Tooltip}from"./components/tooltips/Tooltip.js";export{CustomisedTooltip,TooltipPlacement}from"./components/tooltips/CustomisedTooltip.js";export{Spinner}from"./components/spinner/Spinner.js";export{Stepper}from"./components/stepper/Stepper.js";export{Tag}from"./components/tag/Tag.js";export{IconButton}from"./components/icon-button/IconButton.js";import*as o from"./components/template-preview/constants/regexPatterns.js";export{o as regexPatterns};export{TemplatePreview}from"./components/template-preview/TemplatePreview.js";export{WhatsappLikePreview}from"./components/template-preview/WhatsApp/WhatsAppLikePreview.js";export{renderVariableUIForPreview}from"./components/template-preview/helpers/SmsTemplateHelper.js";export{WhatsAppFormatToHTML}from"./components/template-preview/helpers/WhatsAppFormatToHTML.js";export{FABMenu}from"./components/fab-menu/FABMenu.js";export{FloatingActionButton}from"./components/floating-action-button/FloatingActionButton.js";export{DROP_POSITION,DropdownToggleContainer,FAB_POSITION,FloatingActionButtonContainer,FloatingActionButtonOuterContainer,MENU_ALIGNMENT,StyledDropdown}from"./components/floating-action-button/FloatingActionButton.styles.js";export{ImageService}from"./components/image-compress/ImageCompress.js";export{BodyCaption,BodyLarge,BodyPrimary,BodyPrimaryLink,BodyRegular,BodySecondary,BodySecondaryLink,BodyTiny,ButtonLarge,ButtonRegular,Caption,Display,SubHeading,TitleLarge,TitleMedium,TitleRegular,TitleSmall}from"./components/TypographyStyle.js";export{Button}from"./components/button/Button.js";export{ProgressBarComponent,ProgressCompletedBar}from"./components/progress-bar/ProgressBarComponent.js";export{StyledModal}from"./components/modals/styledModal.js";import"react/jsx-runtime";import"react";import"./components/input/Input.js";import"./components/dropdown/UnChildDropdown/UnChildDropdown.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default class StringUtils {
|
|
2
|
+
static normalizeName: (name: string, delimiter: string) => string;
|
|
3
|
+
static convertToTitleCase(text: string): string;
|
|
4
|
+
static capitalize: (string: string) => string;
|
|
5
|
+
static pluralize: (string: string, Number: number) => string;
|
|
6
|
+
static getFullPhoneNumber: (phoneNumber?: string) => string;
|
|
7
|
+
static detectUrl: (str: string) => RegExpMatchArray | null;
|
|
8
|
+
static getAvatarText(name: string): string;
|
|
9
|
+
static firstLetters: (string: string) => string;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class e{static convertToTitleCase(e){const t=(e=e.toLowerCase()).split(" ");for(let e=0;e<t.length;e++)t[e]=t[e].charAt(0).toUpperCase()+t[e].slice(1);return t.join(" ")}static getAvatarText(e){if(e){const t=e.match(/\b(\w)/g),r=null==t?void 0:t.join("");return r?r.substring(0,2).toUpperCase():"C"}return""}}Object.defineProperty(e,"normalizeName",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>{const r=e.split(t).join(" ");return r[0].toUpperCase()+r.slice(1)}}),Object.defineProperty(e,"capitalize",{enumerable:!0,configurable:!0,writable:!0,value:e=>{var t;return e.charAt(0).toUpperCase()+(null===(t=e.slice(1))||void 0===t?void 0:t.toLowerCase())}}),Object.defineProperty(e,"pluralize",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>0===t||t>1?e+"s":e}),Object.defineProperty(e,"getFullPhoneNumber",{enumerable:!0,configurable:!0,writable:!0,value:e=>e?"+91"+e.slice(e.length-10):""}),Object.defineProperty(e,"detectUrl",{enumerable:!0,configurable:!0,writable:!0,value:e=>e.match(/(((https?:\/\/)|(www\.))[^\s]+)/g)}),Object.defineProperty(e,"firstLetters",{enumerable:!0,configurable:!0,writable:!0,value:e=>{let t="";return e.split(" ").forEach((e=>{e.length&&(t+=e[0])})),t.substr(0,2)}});export{e as default};
|