@bikdotai/bik-component-library 0.0.18 → 0.0.20-beta.0
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/errorInfo.svg.js +1 -1
- 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/input/Input.d.ts +2 -0
- package/dist/cjs/components/input/Input.js +1 -1
- package/dist/cjs/components/input/Input.styled.js +1 -1
- package/dist/cjs/components/modals/styledModal.js +1 -1
- package/dist/cjs/components/stepper/WorkingStepper.d.ts +0 -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 +5 -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/errorInfo.svg.js +1 -1
- 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/input/Input.d.ts +2 -0
- package/dist/esm/components/input/Input.js +1 -1
- package/dist/esm/components/input/Input.styled.js +1 -1
- package/dist/esm/components/modals/styledModal.js +1 -1
- package/dist/esm/components/stepper/WorkingStepper.d.ts +0 -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 +5 -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
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../constants/regexPatterns.js");exports.TemplateHelperUtils=class{fillVariablesValInBodyText(l,a){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=l.match(e.templateVariablePattern),i=l.split(e.templateVariablePattern);if(l&&(null==r?void 0:r.length)){return i.map(((e,l)=>{var n,o,v,d,u;const p=null===(n=null==r?void 0:r[l])||void 0===n?void 0:n.replace("{{","").replace("}}","");return i.length-1===l?e:(null===(v=null===(o=null==a?void 0:a[l])||void 0===o?void 0:o.variableName)||void 0===v?void 0:v.trim())===p.trim()||(null===(u=null===(d=null==a?void 0:a[l])||void 0===d?void 0:d.variableVal)||void 0===u?void 0:u.trim())===p.trim()?a[l].editable?`${e}${t?"{{":""}${a[l].variableVal}${t?"}}":""}`:`${e}${t?"{{":""}${a[l].variableName}${t?"}}":""}`:e})).join("")}return l}getTemplateVariablesFromState(l){var a;return null===(a=l.match(e.globalVariablePattern))||void 0===a?void 0:a.map((e=>e.replace("{{","").replace("}}","")))}whatsappOnlyFillVariablesValueInBodyText(l,a){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=l.match(e.templateVariablePattern),i=l.split(e.templateVariablePattern);if(l&&(null==r?void 0:r.length)){return i.map(((e,l)=>{var n;const o=null===(n=null==r?void 0:r[l])||void 0===n?void 0:n.replace("{{","").replace("}}","");if(i.length-1===l)return e;const v=a.findIndex((e=>e.variableName===o));if(v>-1){let l=a[v].variableVal;return t||(l=!a[v].variableVal&&a[v].variableName.startsWith("editableVariable")?a[v].variableName:null==l?void 0:l.replace("[[","").replace("]]","")),a[v].editable?`${e}${t?"{{":""}${l}${t?"}}":""}`:`${e}${t?"{{":""}${o}${t?"}}":""}`}return e})).join("")}return l}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.getPreviewPropLen=e=>Object.keys(e).filter((r=>{const t=e[r];return t&&Array.isArray(t)?!!t.length:!!t})).length;
|
|
@@ -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
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});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};exports.BASE_COLORS=e,exports.COLORS=t,exports.DEFAULT_THEME=n,exports.FONTS=i;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});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};exports.BASE_COLORS=e,exports.COLORS=t,exports.DEFAULT_THEME=n,exports.FONTS=i;
|
package/dist/cjs/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,5 @@ 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';
|
|
24
|
+
export * from './components/input';
|
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./constants/Theme.js"),o=require("./components/checkBox/CheckBox.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./utils/StringUtils.js"),t=require("./constants/Theme.js"),o=require("./components/checkBox/CheckBox.js"),r=require("./components/list-item/ListItem.js"),n=require("./components/pagination/Pagination.js"),s=require("./components/radioButton/RadioButton.js"),p=require("./components/toaster/Toaster.js"),i=require("./components/tooltips/Tooltip.js"),a=require("./components/tooltips/CustomisedTooltip.js"),u=require("./components/spinner/Spinner.js"),l=require("./components/stepper/Stepper.js"),m=require("./components/tag/Tag.js"),c=require("./components/icon-button/IconButton.js"),x=require("./components/template-preview/constants/regexPatterns.js"),d=require("./components/template-preview/TemplatePreview.js"),g=require("./components/template-preview/WhatsApp/WhatsAppLikePreview.js"),B=require("./components/template-preview/helpers/SmsTemplateHelper.js"),T=require("./components/template-preview/helpers/WhatsAppFormatToHTML.js"),y=require("./components/fab-menu/FABMenu.js"),S=require("./components/floating-action-button/FloatingActionButton.js"),P=require("./components/floating-action-button/FloatingActionButton.styles.js"),j=require("./components/image-compress/ImageCompress.js"),q=require("./components/TypographyStyle.js"),C=require("./components/button/Button.js"),L=require("./components/progress-bar/ProgressBarComponent.js"),O=require("./components/modals/styledModal.js");require("react/jsx-runtime"),require("react");var A=require("./components/input/Input.js");require("./components/dropdown/UnChildDropdown/UnChildDropdown.js"),exports.StringUtils=e.default,exports.BASE_COLORS=t.BASE_COLORS,exports.COLORS=t.COLORS,exports.DEFAULT_THEME=t.DEFAULT_THEME,exports.FONTS=t.FONTS,exports.CheckBox=o.CheckBox,exports.ListItem=r.ListItem,exports.Pagination=n.Pagination,exports.RadioButton=s.RadioButton,exports.Toaster=p.Toaster,exports.Tooltip=i.Tooltip,exports.CustomisedTooltip=a.CustomisedTooltip,Object.defineProperty(exports,"TooltipPlacement",{enumerable:!0,get:function(){return a.TooltipPlacement}}),exports.Spinner=u.Spinner,exports.Stepper=l.Stepper,exports.Tag=m.Tag,exports.IconButton=c.IconButton,exports.regexPatterns=x,exports.TemplatePreview=d.TemplatePreview,exports.WhatsappLikePreview=g.WhatsappLikePreview,exports.renderVariableUIForPreview=B.renderVariableUIForPreview,exports.WhatsAppFormatToHTML=T.WhatsAppFormatToHTML,exports.FABMenu=y.FABMenu,exports.FloatingActionButton=S.FloatingActionButton,Object.defineProperty(exports,"DROP_POSITION",{enumerable:!0,get:function(){return P.DROP_POSITION}}),exports.DropdownToggleContainer=P.DropdownToggleContainer,Object.defineProperty(exports,"FAB_POSITION",{enumerable:!0,get:function(){return P.FAB_POSITION}}),exports.FloatingActionButtonContainer=P.FloatingActionButtonContainer,exports.FloatingActionButtonOuterContainer=P.FloatingActionButtonOuterContainer,Object.defineProperty(exports,"MENU_ALIGNMENT",{enumerable:!0,get:function(){return P.MENU_ALIGNMENT}}),exports.StyledDropdown=P.StyledDropdown,exports.ImageService=j.ImageService,exports.BodyCaption=q.BodyCaption,exports.BodyLarge=q.BodyLarge,exports.BodyPrimary=q.BodyPrimary,exports.BodyPrimaryLink=q.BodyPrimaryLink,exports.BodyRegular=q.BodyRegular,exports.BodySecondary=q.BodySecondary,exports.BodySecondaryLink=q.BodySecondaryLink,exports.BodyTiny=q.BodyTiny,exports.ButtonLarge=q.ButtonLarge,exports.ButtonRegular=q.ButtonRegular,exports.Caption=q.Caption,exports.Display=q.Display,exports.SubHeading=q.SubHeading,exports.TitleLarge=q.TitleLarge,exports.TitleMedium=q.TitleMedium,exports.TitleRegular=q.TitleRegular,exports.TitleSmall=q.TitleSmall,exports.Button=C.Button,exports.ProgressBarComponent=L.ProgressBarComponent,exports.ProgressCompletedBar=L.ProgressCompletedBar,exports.StyledModal=O.StyledModal,exports.Input=A.Input;
|
|
@@ -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
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});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)}}),exports.default=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as r from"react";var t,e;function a(){return a=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=e[a])}return r},a.apply(this,arguments)}var n=n=>r.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},n),t||(t=r.createElement("path",{fill:"currentColor",d:"M3.333 5.333a2 2 0 0 1 2-2h1.334a.667.667 0 1 0 0-1.333H5.333A3.333 3.333 0 0 0 2 5.333v5.334A3.333 3.333 0 0 0 5.333 14h5.334A3.333 3.333 0 0 0 14 10.667V9.333a.667.667 0 0 0-1.333 0v1.334a2 2 0 0 1-2 2H5.333a2 2 0 0 1-2-2V5.333Z"})),e||(e=r.createElement("path",{fill:"currentColor",d:"M10 2a.667.667 0 0 0 0 1.333h1.724L7.529 7.53a.667.667 0 1 0 .942.942l4.196-4.195V6A.667.667 0 1 0 14 6V2.667A.667.667 0 0 0 13.333 2H10Z"})));export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var r;function t(){return t=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},t.apply(this,arguments)}var a=a=>e.createElement("svg",t({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},a),r||(r=e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.707 4.293a1 1 0 0 1 0 1.414L7.414 11H19a1 1 0 1 1 0 2H7.414l5.293 5.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0Z",clipRule:"evenodd"})));export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";var
|
|
1
|
+
import*as e from"react";var r,t;function a(){return a=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},a.apply(this,arguments)}var l=l=>e.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},l),r||(r=e.createElement("path",{fill:"currentColor",d:"M8 7.333c.368 0 .667.299.667.667v2.667a.667.667 0 1 1-1.334 0V8c0-.368.299-.667.667-.667ZM8 6a.667.667 0 1 0 0-1.333A.667.667 0 0 0 8 6Z"})),t||(t=e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M.667 8a7.333 7.333 0 1 1 14.666 0A7.333 7.333 0 0 1 .667 8ZM8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2Z",clipRule:"evenodd"})));export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var a,c,r;function t(){return t=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var c=arguments[a];for(var r in c)Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r])}return e},t.apply(this,arguments)}var l=l=>e.createElement("svg",t({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 30 38"},l),a||(a=e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.632 28.834c0 .092.075.166.167.166h1.204a.167.167 0 0 0 .167-.166v-2.025c0-.092.075-.167.167-.167h1.126c1.672 0 2.645-.997 2.645-2.45 0-1.445-.955-2.464-2.606-2.464H5.799a.167.167 0 0 0-.167.166v6.94Zm1.705-3.424a.167.167 0 0 1-.167-.167v-2.092c0-.092.075-.166.167-.166h.87c.888 0 1.317.483 1.317 1.207 0 .72-.43 1.218-1.31 1.218h-.877ZM14.685 29c2.216 0 3.558-1.37 3.558-3.643 0-2.266-1.342-3.63-3.537-3.63h-2.432a.167.167 0 0 0-.167.167v6.94c0 .092.075.166.167.166h2.411Zm-.874-1.317a.167.167 0 0 1-.166-.167v-4.304c0-.092.074-.167.166-.167h.814c1.363 0 2.084.696 2.084 2.312 0 1.623-.72 2.326-2.088 2.326h-.81Z",clipRule:"evenodd"})),c||(c=e.createElement("path",{fill:"currentColor",d:"M19.549 29a.167.167 0 0 1-.167-.166v-6.94c0-.092.075-.166.167-.166h4.482c.092 0 .167.074.167.166v.935a.167.167 0 0 1-.167.166h-2.944a.167.167 0 0 0-.167.167v1.4c0 .092.075.166.167.166h2.624c.092 0 .167.075.167.167v.934a.167.167 0 0 1-.167.167h-2.624a.167.167 0 0 0-.167.167v2.67a.167.167 0 0 1-.167.167H19.55Z"})),r||(r=e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M5 .667a5 5 0 0 0-5 5v26.667a5 5 0 0 0 5 5h20a5 5 0 0 0 5-5V13.31L17.357.667H5Zm-1.667 5C3.333 4.747 4.08 4 5 4h10v6.667a5 5 0 0 0 5 5h6.667v16.667c0 .92-.747 1.666-1.667 1.666H5c-.92 0-1.667-.746-1.667-1.666V5.667Zm20.977 6.667-5.977-5.977v4.31c0 .92.747 1.667 1.667 1.667h4.31Z",clipRule:"evenodd"})));export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as r from"react";var t;function e(){return e=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r},e.apply(this,arguments)}var n=n=>r.createElement("svg",e({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 8 8"},n),t||(t=r.createElement("path",{fill:"currentColor",d:"M8 0H0l8 8V0Z"})));export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var l,r;function t(){return t=Object.assign?Object.assign.bind():function(e){for(var l=1;l<arguments.length;l++){var r=arguments[l];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},t.apply(this,arguments)}var a=a=>e.createElement("svg",t({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 32"},a),l||(l=e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.333 8a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667Zm-.666 3.333a.667.667 0 1 1 1.333 0 .667.667 0 0 1-1.333 0Z",clipRule:"evenodd"})),r||(r=e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M29.333 25.333a4 4 0 0 1-4 4H6.665a4 4 0 0 1-3.998-4V6.667a4 4 0 0 1 4-4h18.666a4 4 0 0 1 4 4v18.666Zm-22.666-20c-.737 0-1.334.597-1.334 1.334v18.666c0 .572.36 1.06.866 1.25L20.39 12.39c.521-.521 1.365-.521 1.886 0l4.39 4.39V6.667c0-.737-.596-1.334-1.333-1.334H6.667Zm20 20v-4.78l-5.334-5.334L9.886 26.667h15.447c.737 0 1.334-.597 1.334-1.334Z",clipRule:"evenodd"})));export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as r from"react";var t;function e(){return e=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=e[a])}return r},e.apply(this,arguments)}var a=a=>r.createElement("svg",e({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},a),t||(t=r.createElement("path",{fill:"currentColor",d:"M14 5a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM14 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM12 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"})));export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as a from"react";var e;function l(){return l=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var l=arguments[e];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(a[r]=l[r])}return a},l.apply(this,arguments)}var r=r=>a.createElement("svg",l({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},r),e||(e=a.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M2.743.667h1.994a2 2 0 0 1 1.997 1.72v.006c.078.59.222 1.169.43 1.727a2 2 0 0 1-.45 2.109l-.002.002-.479.478a10 10 0 0 0 3.058 3.058l.478-.478.002-.003a2 2 0 0 1 2.11-.45 7.892 7.892 0 0 0 1.726.43h.006a2 2 0 0 1 1.72 2.021v1.99a2 2 0 0 1-2.192 2 13.861 13.861 0 0 1-6.041-2.15 13.667 13.667 0 0 1-4.201-4.2 13.86 13.86 0 0 1-2.15-6.098A2 2 0 0 1 2.742.667ZM4.747 2a.667.667 0 0 1 .666.57c.091.69.26 1.366.503 2.016v.002a.667.667 0 0 1-.149.702l-.845.845a.667.667 0 0 0-.108.801 11.334 11.334 0 0 0 4.25 4.25c.26.149.589.104.8-.108l.846-.845a.665.665 0 0 1 .702-.149h.002a9.23 9.23 0 0 0 2.015.503.666.666 0 0 1 .571.677v2.029a.666.666 0 0 1-.722.657 12.525 12.525 0 0 1-5.455-1.943l-.005-.003a12.334 12.334 0 0 1-3.795-3.795l-.003-.005a12.527 12.527 0 0 1-1.942-5.477A.667.667 0 0 1 2.739 2h2.008Z",clipRule:"evenodd"})));export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var r;function t(){return t=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},t.apply(this,arguments)}var n=n=>e.createElement("svg",t({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 29"},n),r||(r=e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.037 16.474C4.265 23.459.954 27.035 0 27.707c3.45 1.03 6.389-.426 8.456-2.297A11.927 11.927 0 0 0 17 29V.555H5.037v15.919Z",clipRule:"evenodd"})));export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var r;function t(){return t=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},t.apply(this,arguments)}var a=a=>e.createElement("svg",t({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 14 15"},a),r||(r=e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 7.697a3.5 3.5 0 0 0 3.5-3.5A3.5 3.5 0 0 0 7 .697a3.499 3.499 0 0 0-3.5 3.5c0 1.934 1.566 3.5 3.5 3.5Zm0 1.75c-2.336 0-7 1.173-7 3.5v.875c0 .481.394.875.875.875h12.25a.878.878 0 0 0 .875-.875v-.875c0-2.327-4.664-3.5-7-3.5Z",clipRule:"evenodd"})));export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as r from"react";var t;function e(){return e=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=e[a])}return r},e.apply(this,arguments)}var a=a=>r.createElement("svg",e({xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},a),t||(t=r.createElement("path",{d:"M4 2a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM4 9a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM2 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"})));export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var r;function t(){return t=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},t.apply(this,arguments)}var a=a=>e.createElement("svg",t({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 40 28"},a),r||(r=e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M28.333 10.761V5.667a5 5 0 0 0-5-5H5a5 5 0 0 0-5 5v16.666a5 5 0 0 0 5 5h18.333a5 5 0 0 0 5-5v-5.095l9.032 6.451A1.667 1.667 0 0 0 40 22.333V5.667a1.667 1.667 0 0 0-2.635-1.357l-9.032 6.451Zm-25-5.094C3.333 4.745 4.08 4 5 4h18.333C24.253 4 25 4.746 25 5.667v16.666c0 .92-.746 1.667-1.667 1.667H5c-.92 0-1.667-.746-1.667-1.667V5.667Zm33.334 13.428L29.534 14l7.133-5.095v10.19Z",clipRule:"evenodd"})));export{a as default};
|
|
@@ -13,3 +13,5 @@ export declare const BodyTiny: import("styled-components").StyledComponent<"div"
|
|
|
13
13
|
export declare const ButtonLarge: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
14
14
|
export declare const ButtonRegular: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
15
|
export declare const SubHeading: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
16
|
+
export declare const BodyRegular: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
17
|
+
export declare const Caption: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,88 +1,100 @@
|
|
|
1
1
|
import t from"styled-components";import{COLORS as e,FONTS as i}from"../constants/Theme.js";const o=t=>t+"px",n=t.div`
|
|
2
2
|
font-family: Inter;
|
|
3
3
|
color: ${t=>t.color||e.text.primary};
|
|
4
|
-
font-weight: ${
|
|
5
|
-
font-size: ${
|
|
6
|
-
line-height: ${
|
|
4
|
+
font-weight: ${i.titleLarge.fontWeight};
|
|
5
|
+
font-size: ${o(i.titleLarge.fontSize)};
|
|
6
|
+
line-height: ${o(i.titleLarge.lineHeight)};
|
|
7
7
|
`,r=t.div`
|
|
8
8
|
font-family: Inter;
|
|
9
9
|
color: ${t=>t.color||e.text.primary};
|
|
10
|
-
font-weight: ${
|
|
11
|
-
font-size: ${
|
|
12
|
-
line-height: ${
|
|
10
|
+
font-weight: ${i.titleMedium.fontWeight};
|
|
11
|
+
font-size: ${o(i.titleMedium.fontSize)};
|
|
12
|
+
line-height: ${o(i.titleMedium.lineHeight)};
|
|
13
13
|
`,l=t.div`
|
|
14
14
|
font-family: Inter;
|
|
15
15
|
color: ${t=>t.color||e.text.primary};
|
|
16
|
-
font-weight: ${
|
|
17
|
-
font-size: ${
|
|
18
|
-
line-height: ${
|
|
16
|
+
font-weight: ${i.titleRegular.fontWeight};
|
|
17
|
+
font-size: ${o(i.titleRegular.fontSize)};
|
|
18
|
+
line-height: ${o(i.titleRegular.lineHeight)};
|
|
19
19
|
`,f=t.div`
|
|
20
20
|
font-family: Inter;
|
|
21
21
|
color: ${t=>t.color||e.text.primary};
|
|
22
|
-
font-weight: ${
|
|
23
|
-
font-size: ${
|
|
24
|
-
line-height: ${
|
|
22
|
+
font-weight: ${i.titleSmall.fontWeight};
|
|
23
|
+
font-size: ${o(i.titleSmall.fontSize)};
|
|
24
|
+
line-height: ${o(i.titleSmall.lineHeight)};
|
|
25
25
|
`,g=t.div`
|
|
26
26
|
font-family: Inter;
|
|
27
27
|
color: ${t=>t.color||e.text.primary};
|
|
28
|
-
font-weight: ${
|
|
29
|
-
font-size: ${
|
|
30
|
-
line-height: ${
|
|
28
|
+
font-weight: ${i.display.fontWeight};
|
|
29
|
+
font-size: ${o(i.display.fontSize)};
|
|
30
|
+
line-height: ${o(i.display.lineHeight)};
|
|
31
31
|
`,a=t.div`
|
|
32
32
|
font-family: Inter;
|
|
33
33
|
color: ${t=>t.color||e.text.primary};
|
|
34
|
-
font-weight: ${
|
|
35
|
-
font-size: ${
|
|
36
|
-
line-height: ${
|
|
34
|
+
font-weight: ${i.bodyPrimary.fontWeight};
|
|
35
|
+
font-size: ${o(i.bodyLarge.fontSize)};
|
|
36
|
+
line-height: ${o(i.bodyLarge.lineHeight)};
|
|
37
37
|
`,h=t.div`
|
|
38
38
|
font-family: Inter;
|
|
39
39
|
color: ${t=>t.color||e.text.primary};
|
|
40
|
-
font-weight: ${
|
|
41
|
-
font-size: ${
|
|
42
|
-
line-height: ${
|
|
40
|
+
font-weight: ${i.bodyPrimary.fontWeight};
|
|
41
|
+
font-size: ${o(i.bodyPrimary.fontSize)};
|
|
42
|
+
line-height: ${o(i.bodyPrimary.lineHeight)};
|
|
43
43
|
`,$=t.div`
|
|
44
44
|
font-family: Inter;
|
|
45
|
-
color: ${
|
|
46
|
-
font-weight: ${
|
|
47
|
-
font-size: ${
|
|
48
|
-
line-height: ${
|
|
45
|
+
color: ${e.content.primary};
|
|
46
|
+
font-weight: ${i.bodySecondary.fontWeight};
|
|
47
|
+
font-size: ${o(i.bodySecondary.fontSize)};
|
|
48
|
+
line-height: ${o(i.bodySecondary.lineHeight)};
|
|
49
49
|
`,c=t(h)`
|
|
50
50
|
text-decoration: underline;
|
|
51
|
-
color: ${
|
|
52
|
-
text-decoration-color: ${
|
|
51
|
+
color: ${e.content.brand};
|
|
52
|
+
text-decoration-color: ${e.content.brand};
|
|
53
53
|
cursor: pointer;
|
|
54
54
|
`,y=t($)`
|
|
55
55
|
text-decoration: underline;
|
|
56
|
-
color: ${
|
|
57
|
-
text-decoration-color: ${
|
|
56
|
+
color: ${e.content.brand};
|
|
57
|
+
text-decoration-color: ${e.content.brand};
|
|
58
58
|
cursor: pointer;
|
|
59
59
|
`,d=t.div`
|
|
60
60
|
font-family: Inter;
|
|
61
61
|
color: ${t=>t.color||e.text.primary};
|
|
62
|
-
font-weight: ${
|
|
63
|
-
font-size: ${
|
|
64
|
-
line-height: ${
|
|
62
|
+
font-weight: ${i.caption.fontWeight};
|
|
63
|
+
font-size: ${o(i.caption.fontSize)};
|
|
64
|
+
line-height: ${o(i.caption.lineHeight)};
|
|
65
65
|
`,m=t.div`
|
|
66
66
|
color: ${t=>t.color||e.text.primary};
|
|
67
|
-
font-weight: ${
|
|
68
|
-
font-size: ${
|
|
69
|
-
line-height: ${
|
|
70
|
-
`,s=t.div`
|
|
71
|
-
font-family: Inter;
|
|
72
|
-
color: ${t=>t.color||e.text.primary};
|
|
73
|
-
font-weight: ${t=>i.buttonLarge.fontWeight};
|
|
74
|
-
font-size: ${t=>o(i.buttonLarge.fontSize)};
|
|
75
|
-
line-height: ${t=>o(i.buttonLarge.lineHeight)};
|
|
67
|
+
font-weight: ${i.tiny.fontWeight};
|
|
68
|
+
font-size: ${o(i.tiny.fontSize)};
|
|
69
|
+
line-height: ${o(i.tiny.lineHeight)};
|
|
76
70
|
`,p=t.div`
|
|
77
71
|
font-family: Inter;
|
|
78
72
|
color: ${t=>t.color||e.text.primary};
|
|
79
|
-
font-weight: ${
|
|
80
|
-
font-size: ${
|
|
81
|
-
line-height: ${
|
|
73
|
+
font-weight: ${i.buttonLarge.fontWeight};
|
|
74
|
+
font-size: ${o(i.buttonLarge.fontSize)};
|
|
75
|
+
line-height: ${o(i.buttonLarge.lineHeight)};
|
|
82
76
|
`,z=t.div`
|
|
83
77
|
font-family: Inter;
|
|
84
78
|
color: ${t=>t.color||e.text.primary};
|
|
85
|
-
font-weight: ${
|
|
86
|
-
font-size: ${
|
|
87
|
-
line-height: ${
|
|
88
|
-
|
|
79
|
+
font-weight: ${i.buttonRegular.fontWeight};
|
|
80
|
+
font-size: ${o(i.buttonRegular.fontSize)};
|
|
81
|
+
line-height: ${o(i.buttonRegular.lineHeight)};
|
|
82
|
+
`,s=t.div`
|
|
83
|
+
font-family: Inter;
|
|
84
|
+
color: ${t=>t.color||e.text.primary};
|
|
85
|
+
font-weight: ${i.subHeading.fontWeight};
|
|
86
|
+
font-size: ${o(i.subHeading.fontSize)};
|
|
87
|
+
line-height: ${o(i.subHeading.lineHeight)};
|
|
88
|
+
`,b=t.div`
|
|
89
|
+
font-family: Inter;
|
|
90
|
+
color: ${t=>t.color||e.text.primary};
|
|
91
|
+
font-weight: ${i.bodyRegular.fontWeight};
|
|
92
|
+
font-size: ${o(i.bodyRegular.fontSize)};
|
|
93
|
+
line-height: ${o(i.bodyRegular.lineHeight)};
|
|
94
|
+
`,u=t.div`
|
|
95
|
+
font-family: Inter;
|
|
96
|
+
color: ${e.text.primary};
|
|
97
|
+
font-weight: ${i.caption.fontWeight};
|
|
98
|
+
font-size: ${o(i.caption.fontSize)};
|
|
99
|
+
line-height: ${o(i.caption.lineHeight)};
|
|
100
|
+
`;export{d as BodyCaption,a as BodyLarge,h as BodyPrimary,c as BodyPrimaryLink,b as BodyRegular,$ as BodySecondary,y as BodySecondaryLink,m as BodyTiny,p as ButtonLarge,z as ButtonRegular,u as Caption,g as Display,s as SubHeading,n as TitleLarge,r as TitleMedium,l as TitleRegular,f as TitleSmall};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import o from"styled-components";const t=o.div`
|
|
2
|
+
position: absolute;
|
|
3
|
+
left: 0px;
|
|
4
|
+
top: 0px;
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 100%;
|
|
7
|
+
z-index: 2;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
`,i=o.div`
|
|
10
|
+
margin-top: 8px;
|
|
11
|
+
margin-bottom: 8px;
|
|
12
|
+
`;export{i as OpenDropdownContainer,t as OverLapAbs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest as o}from"../../../_virtual/_tslib.js";import{jsxs as e,Fragment as n,jsx as r}from"react/jsx-runtime";import t,{useState as l,useImperativeHandle as i,useEffect as p}from"react";import{usePopper as s}from"react-popper";import{OverLapAbs as c,OpenDropdownContainer as d}from"../Common.styled.js";import{OpennedDropdown as a}from"../opennedDropdown/components/OpennedDropdown.js";const m=t.forwardRef(((t,m)=>{var{children:u}=t,f=o(t,["children"]);const v=m,[j,b]=l(!1),[h,w]=l(null),[D,O]=l(null),{styles:g,attributes:y}=s(h,D,{});return i(v,(()=>({openDropdown:j})),[]),p((()=>{(null==v?void 0:v.current)&&(v.current.openDropdown=j)}),[j]),e(n,{children:[e("div",Object.assign({style:{position:"relative"},ref:w},{children:[r(c,{onClick:o=>{j?o.preventDefault():b(!0)}}),u]})),j&&r(d,Object.assign({ref:O,style:Object.assign(Object.assign({},g.popper),{zIndex:3})},y.popper,{children:r(a,Object.assign({},f,{onSelect:o=>{var e;null===(e=f.onSelect)||void 0===e||e.call(f,o),b(!1)},onClose:function(){var o;b(!1),null===(o=null==f?void 0:f.onClose)||void 0===o||o.call(f)}}))}))]})}));m.displayName="UnChildDropdown";export{m as UnChildDropdown};
|
|
@@ -34,5 +34,7 @@ export interface InputProps {
|
|
|
34
34
|
suffixText?: string;
|
|
35
35
|
prefixText?: string;
|
|
36
36
|
value?: string;
|
|
37
|
+
onBlur?: () => void;
|
|
38
|
+
onFocus?: () => void;
|
|
37
39
|
}
|
|
38
40
|
export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{forwardRef as i,useState as l,useContext as r,useEffect as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{forwardRef as i,useState as l,useContext as r,useEffect as o}from"react";import{Button as a}from"../button/Button.js";import{BodySecondary as s}from"../TypographyStyle.js";import c from"../../assets/icons/errorInfo.svg.js";import{InputStyleContext as d}from"./context/InputStyleProvider.js";import{RootContainer as u,InputFooter as h,InputWrapper as v,IconHolder as p,PrefixHolder as f,InputContainer as g,InputContainerSmall as m,SuffixHolder as x,InputHeader as y,MaxCharStyle as b}from"./Input.styled.js";const j=e=>e&&"function"==typeof e,C=i(((i,C)=>{var I,O,w;const{placeholder:T,leftIcon:k,rightIcon:B,labelText:L,maxCharLimit:S,isRequired:D,hintText:F,type:z,state:A,validate:E,variant:K,button:M,suffixText:R,prefixText:q,onChangeText:H,value:N}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},i),P=null==k?void 0:k.icon,W=null==B?void 0:B.icon,[G,J]=l(""),[Q,U]=l(!1),[V,X]=l(!1),[Y,Z]=l(),$="small"===K?"18px":"22px",_=r(d);o((()=>{Z(i.errorMessage)}),[i.errorMessage]),o((()=>{U(!1),("invalid"===i.state||Y)&&U(!0)}),[i.state,Y]),o((()=>{U(!!Y)}),[Y]),o((()=>{if(H(G),!E||!j(E))return;const[e,t]=E(G);U(!e),Z(t)}),[G]);const ee=function(e){if(j(e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];e(...n)}},te=e=>{![8].includes(e.which)&&S>0&&e.target.value.length===S&&e.preventDefault()},ne=e=>{J(e.target.value)},ie=()=>{var l;return e(n,{children:["multiline"!==z&&t("input",{style:null!==(l=null==_?void 0:_.input)&&void 0!==l?l:{},ref:C,type:z,value:N,onFocus:()=>(X(!0),void ee(i.onFocus)),onBlur:()=>(X(!1),void ee(i.onBlur)),placeholder:T||"Enter here",onChange:ne,onKeyDown:e=>te(e)}),"multiline"===z&&t("textarea",{value:N,ref:C,onFocus:()=>X(!0),onBlur:()=>X(!1),placeholder:T||"Enter here",onChange:ne,onKeyDown:e=>te(e)})]})};return e(u,Object.assign({width:i.width,height:i.height,state:A,type:z,style:null!==(I=null==_?void 0:_.RootContainer)&&void 0!==I?I:{}},{children:[(!!F||!!Y)&&e(h,Object.assign({invalid:!!Y},{children:[!!Y&&t(c,{}),Y||F]})),e(v,Object.assign({variant:K,state:A,width:i.width,isActive:"active"===A||V,isInvalid:Q,style:null!==(O=null==_?void 0:_.InputWrapper)&&void 0!==O?O:{}},{children:[!!P&&t(p,Object.assign({variant:K,iconSize:$,onClick:()=>ee(null==k?void 0:k.callback),isLeft:!0,style:null!==(w=null==_?void 0:_.IconHolder)&&void 0!==w?w:{}},{children:t(P,{})})),!!q&&t(f,Object.assign({variant:K},{children:q})),"default"===K&&t(g,{children:ie()}),"small"===K&&t(m,{children:ie()}),!!W&&t(p,Object.assign({variant:K,iconSize:$,onClick:()=>ee(null==k?void 0:k.callback),isLeft:!1},{children:t(W,{})})),!!R&&t(x,Object.assign({variant:K},{children:R})),M&&M.text&&t(a,{buttonText:M.text,onClick:()=>ee(null==M?void 0:M.onClick)})]})),(!!L||!!S)&&"default"===K&&e(y,Object.assign({invalid:Q},{children:[e(s,{children:[L,D?t("span",{children:"*"}):""]}),S>0&&e(b,{children:[G.length,"/",S]})]}))]}))}));C.displayName="Input";export{C as Input};
|