@openlettermarketing/olc-react-sdk 2.1.4 → 2.1.5-beta.2
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/.eslintignore +1 -0
- package/.eslintrc.cjs +18 -0
- package/.eslintrc.yml +47 -0
- package/.github/workflows/publish-beta.yml +154 -0
- package/.github/workflows/publish-production.yml +143 -0
- package/.prettierignore +3 -0
- package/.prettierrc.yml +5 -0
- package/CHANGELOG.md +4 -0
- package/babel.config.json +10 -0
- package/build/index.js +82 -82
- package/build/index.js.map +1 -1
- package/build/types/version.d.ts +1 -1
- package/examples/.eslintrc.yml +4 -0
- package/index.html +18 -0
- package/package.json +1 -1
- package/public/vite.svg +1 -0
- package/src/App.tsx +209 -0
- package/src/assets/Fonts/Lexi-Regular.ttf +0 -0
- package/src/assets/images/create-template/prebuilt.svg +13 -0
- package/src/assets/images/create-template/scratch.svg +4 -0
- package/src/assets/images/input/cancel.tsx +20 -0
- package/src/assets/images/input/search.tsx +20 -0
- package/src/assets/images/input/select-cancel.tsx +17 -0
- package/src/assets/images/modal-icons/add.tsx +36 -0
- package/src/assets/images/modal-icons/cancel-file.tsx +12 -0
- package/src/assets/images/modal-icons/cancel-input.tsx +13 -0
- package/src/assets/images/modal-icons/cancel.tsx +35 -0
- package/src/assets/images/modal-icons/close-new.svg +3 -0
- package/src/assets/images/modal-icons/confirm-close-icon.tsx +14 -0
- package/src/assets/images/modal-icons/confirm-new.tsx +22 -0
- package/src/assets/images/modal-icons/confirm.svg +12 -0
- package/src/assets/images/modal-icons/cross.tsx +23 -0
- package/src/assets/images/modal-icons/del.tsx +19 -0
- package/src/assets/images/modal-icons/design-icon.tsx +22 -0
- package/src/assets/images/modal-icons/doc.tsx +43 -0
- package/src/assets/images/modal-icons/docx.tsx +43 -0
- package/src/assets/images/modal-icons/envelope-icon.tsx +26 -0
- package/src/assets/images/modal-icons/info.tsx +19 -0
- package/src/assets/images/modal-icons/jpeg.tsx +43 -0
- package/src/assets/images/modal-icons/jpg.tsx +43 -0
- package/src/assets/images/modal-icons/modal-cros.svg +4 -0
- package/src/assets/images/modal-icons/modal-cross.tsx +37 -0
- package/src/assets/images/modal-icons/new-cancel.tsx +11 -0
- package/src/assets/images/modal-icons/order-download.tsx +42 -0
- package/src/assets/images/modal-icons/pdf.tsx +51 -0
- package/src/assets/images/modal-icons/png.tsx +43 -0
- package/src/assets/images/modal-icons/save.tsx +23 -0
- package/src/assets/images/modal-icons/template-copy.tsx +25 -0
- package/src/assets/images/modal-icons/tool-cancel.tsx +25 -0
- package/src/assets/images/products/bi-new.svg +23 -0
- package/src/assets/images/products/left-arrow.svg +17 -0
- package/src/assets/images/products/personal-new.tsx +31 -0
- package/src/assets/images/products/postcard-new.tsx +27 -0
- package/src/assets/images/products/professional-new.tsx +24 -0
- package/src/assets/images/products/real-new.tsx +30 -0
- package/src/assets/images/products/right-arrow.svg +17 -0
- package/src/assets/images/products/snap-new.svg +31 -0
- package/src/assets/images/templates/actions.svg +3 -0
- package/src/assets/images/templates/address-block-icon.tsx +62 -0
- package/src/assets/images/templates/archive.svg +3 -0
- package/src/assets/images/templates/arrow-down.tsx +27 -0
- package/src/assets/images/templates/back-arrow.tsx +19 -0
- package/src/assets/images/templates/bi-fold-self-mailers.tsx +28 -0
- package/src/assets/images/templates/check.svg +3 -0
- package/src/assets/images/templates/code.svg +10 -0
- package/src/assets/images/templates/content-copy-icon.tsx +24 -0
- package/src/assets/images/templates/custom-add-on-icon.tsx +18 -0
- package/src/assets/images/templates/custom-qr-section-icon.tsx +9 -0
- package/src/assets/images/templates/custom-template.tsx +23 -0
- package/src/assets/images/templates/designer.tsx +43 -0
- package/src/assets/images/templates/dot.tsx +22 -0
- package/src/assets/images/templates/download-v2.svg +4 -0
- package/src/assets/images/templates/download.svg +4 -0
- package/src/assets/images/templates/dummy-template.tsx +76 -0
- package/src/assets/images/templates/dynamic-field.tsx +119 -0
- package/src/assets/images/templates/edit-pencil-icon.tsx +21 -0
- package/src/assets/images/templates/edit.svg +3 -0
- package/src/assets/images/templates/epo-icon.tsx +16 -0
- package/src/assets/images/templates/field.tsx +29 -0
- package/src/assets/images/templates/gsv-icon.tsx +31 -0
- package/src/assets/images/templates/info-icon.tsx +37 -0
- package/src/assets/images/templates/left-arrow.svg +17 -0
- package/src/assets/images/templates/pencil.svg +3 -0
- package/src/assets/images/templates/personal-letter.tsx +53 -0
- package/src/assets/images/templates/postcard.tsx +32 -0
- package/src/assets/images/templates/professional-letter.tsx +53 -0
- package/src/assets/images/templates/qr-code.tsx +13 -0
- package/src/assets/images/templates/real-penned-letters.tsx +57 -0
- package/src/assets/images/templates/right-arrow.svg +17 -0
- package/src/assets/images/templates/size-image-lg.tsx +20 -0
- package/src/assets/images/templates/size-image-mid.tsx +20 -0
- package/src/assets/images/templates/size-image-xl.tsx +20 -0
- package/src/assets/images/templates/size-image.tsx +20 -0
- package/src/assets/images/templates/snap-pack.tsx +67 -0
- package/src/assets/images/templates/template-default-design.tsx +21 -0
- package/src/assets/images/templates/trash-upload.svg +3 -0
- package/src/assets/images/templates/trash.svg +3 -0
- package/src/assets/images/templates/tri-fold-self-mailers.tsx +93 -0
- package/src/assets/images/templates/upload-image.svg +10 -0
- package/src/assets/images/templates/x.svg +3 -0
- package/src/assets/images/thumbnails/one.svg +9 -0
- package/src/assets/images/tooltip/tool-arrow.tsx +25 -0
- package/src/components/CreateTemplate/V2/index.tsx +525 -0
- package/src/components/CreateTemplate/V2/styles.scss +372 -0
- package/src/components/CreateTemplate/index.tsx +508 -0
- package/src/components/CreateTemplate/styles.scss +404 -0
- package/src/components/GenericUIBlocks/Button/index.tsx +54 -0
- package/src/components/GenericUIBlocks/Button/styles.scss +43 -0
- package/src/components/GenericUIBlocks/CircularProgress/index.tsx +18 -0
- package/src/components/GenericUIBlocks/CircularProgress/styles.scss +93 -0
- package/src/components/GenericUIBlocks/CustomTooltip/index.tsx +88 -0
- package/src/components/GenericUIBlocks/CustomTooltip/styles.scss +19 -0
- package/src/components/GenericUIBlocks/Dialog/V2/index.tsx +227 -0
- package/src/components/GenericUIBlocks/Dialog/V2/styles.scss +289 -0
- package/src/components/GenericUIBlocks/Dialog/index.tsx +185 -0
- package/src/components/GenericUIBlocks/Dialog/styles.scss +227 -0
- package/src/components/GenericUIBlocks/Divider/index.tsx +12 -0
- package/src/components/GenericUIBlocks/Divider/styles.scss +7 -0
- package/src/components/GenericUIBlocks/GeneralSelect/index.tsx +114 -0
- package/src/components/GenericUIBlocks/GeneralSelect/styles.scss +406 -0
- package/src/components/GenericUIBlocks/GeneralTooltip/index.tsx +25 -0
- package/src/components/GenericUIBlocks/GeneralTooltip/styles.scss +20 -0
- package/src/components/GenericUIBlocks/GenericSnackbar/Toast/index.tsx +91 -0
- package/src/components/GenericUIBlocks/GenericSnackbar/Toast/styles.scss +92 -0
- package/src/components/GenericUIBlocks/Grid/index.tsx +82 -0
- package/src/components/GenericUIBlocks/Input/index.tsx +269 -0
- package/src/components/GenericUIBlocks/Input/styles.scss +332 -0
- package/src/components/GenericUIBlocks/Tabs/index.tsx +71 -0
- package/src/components/GenericUIBlocks/Tabs/styles.scss +42 -0
- package/src/components/GenericUIBlocks/Typography/index.tsx +18 -0
- package/src/components/GenericUIBlocks/Typography/styles.scss +27 -0
- package/src/components/SidePanel/CustomAddOns/index.tsx +342 -0
- package/src/components/SidePanel/CustomAddOns/styles.scss +86 -0
- package/src/components/SidePanel/CustomBlockColors/index.tsx +211 -0
- package/src/components/SidePanel/CustomBlockColors/styles.scss +80 -0
- package/src/components/SidePanel/CustomFields/customFieldSection.tsx +547 -0
- package/src/components/SidePanel/CustomFields/styles.scss +64 -0
- package/src/components/SidePanel/CustomQRCode/V2/QRCodeModal/index.tsx +172 -0
- package/src/components/SidePanel/CustomQRCode/V2/QRCodeModal/styles.scss +46 -0
- package/src/components/SidePanel/CustomQRCode/index.tsx +1070 -0
- package/src/components/SidePanel/CustomQRCode/styles.scss +149 -0
- package/src/components/SidePanel/CustomUploads/V2/index.tsx +542 -0
- package/src/components/SidePanel/CustomUploads/V2/styles.scss +267 -0
- package/src/components/SidePanel/CustomUploads/index.tsx +301 -0
- package/src/components/SidePanel/Templates/ModalGallery/HireDesigner/index.tsx +424 -0
- package/src/components/SidePanel/Templates/ModalGallery/HireDesigner/styles.scss +180 -0
- package/src/components/SidePanel/Templates/ModalGallery/V2/index.tsx +235 -0
- package/src/components/SidePanel/Templates/ModalGallery/V2/styles.scss +244 -0
- package/src/components/SidePanel/Templates/ModalGallery/index.tsx +231 -0
- package/src/components/SidePanel/Templates/SideBarGallery/index.tsx +233 -0
- package/src/components/SidePanel/Templates/SideBarGallery/styles.scss +152 -0
- package/src/components/SidePanel/Templates/TemplatesCard/V2/index.tsx +149 -0
- package/src/components/SidePanel/Templates/TemplatesCard/V2/styles.scss +156 -0
- package/src/components/SidePanel/Templates/TemplatesCard/index.tsx +160 -0
- package/src/components/SidePanel/Templates/TemplatesCard/styles.scss +98 -0
- package/src/components/SidePanel/Templates/customTemplateSection.tsx +793 -0
- package/src/components/SidePanel/Templates/styles.scss +244 -0
- package/src/components/SidePanel/index.tsx +160 -0
- package/src/components/TemplateBuilder/index.tsx +585 -0
- package/src/components/TemplateBuilder/styles.scss +100 -0
- package/src/components/TemplateTypes/index.tsx +96 -0
- package/src/components/TemplateTypes/styles.scss +91 -0
- package/src/components/TopNavigation/ConfirmNavigateDialog/index.tsx +81 -0
- package/src/components/TopNavigation/ConfirmNavigateDialog/styles.scss +123 -0
- package/src/components/TopNavigation/DuplicateTemplateModal.tsx +103 -0
- package/src/components/TopNavigation/EditTemplateNameModel/index.tsx +71 -0
- package/src/components/TopNavigation/EditTemplateNameModel/styles.scss +88 -0
- package/src/components/TopNavigation/SaveTemplateModel/index.tsx +201 -0
- package/src/components/TopNavigation/SaveTemplateModel/styles.scss +128 -0
- package/src/components/TopNavigation/index.tsx +938 -0
- package/src/components/TopNavigation/styles.scss +303 -0
- package/src/importMeta.d.ts +31 -0
- package/src/index.scss +131 -0
- package/src/index.tsx +238 -0
- package/src/libs/test.ts +7 -0
- package/src/redux/actions/action-types.ts +52 -0
- package/src/redux/actions/customQRCodeActions.ts +54 -0
- package/src/redux/actions/snackbarActions.ts +16 -0
- package/src/redux/actions/templateActions.ts +236 -0
- package/src/redux/reducers/customFieldReducer.ts +99 -0
- package/src/redux/reducers/customQRCodeReducer.ts +58 -0
- package/src/redux/reducers/index.ts +15 -0
- package/src/redux/reducers/snackbarReducer.ts +40 -0
- package/src/redux/reducers/templateReducer.ts +485 -0
- package/src/redux/store.ts +18 -0
- package/src/styles/colors.scss +61 -0
- package/src/test/mocks.js +89 -0
- package/src/test/setupJest.js +1 -0
- package/src/utils/api.ts +36 -0
- package/src/utils/constants.ts +182 -0
- package/src/utils/customStyles.ts +45 -0
- package/src/utils/fetchWrapper.ts +73 -0
- package/src/utils/fonts.json +1597 -0
- package/src/utils/helper.ts +205 -0
- package/src/utils/local-storage.ts +15 -0
- package/src/utils/message.ts +162 -0
- package/src/utils/products.ts +186 -0
- package/src/utils/template-builder.ts +328 -0
- package/src/utils/templateIdentifierArea/biFold.ts +107 -0
- package/src/utils/templateIdentifierArea/index.ts +35 -0
- package/src/utils/templateIdentifierArea/personal.ts +107 -0
- package/src/utils/templateIdentifierArea/postCards.ts +163 -0
- package/src/utils/templateIdentifierArea/professional.ts +125 -0
- package/src/utils/templateIdentifierArea/snapPack.ts +107 -0
- package/src/utils/templateIdentifierArea/triFold.ts +107 -0
- package/src/utils/templateRestrictedArea/biFold.ts +329 -0
- package/src/utils/templateRestrictedArea/nonWindowProfessional.ts +90 -0
- package/src/utils/templateRestrictedArea/personal.ts +90 -0
- package/src/utils/templateRestrictedArea/postCard.ts +334 -0
- package/src/utils/templateRestrictedArea/postCardJumbo.tsx +408 -0
- package/src/utils/templateRestrictedArea/professional.ts +318 -0
- package/src/utils/templateRestrictedArea/realPenned.ts +233 -0
- package/src/utils/templateRestrictedArea/snapPack.ts +1009 -0
- package/src/utils/templateRestrictedArea/triFold.ts +330 -0
- package/src/utils/templateSafetyBorders/biFold.ts +91 -0
- package/src/utils/templateSafetyBorders/index.ts +43 -0
- package/src/utils/templateSafetyBorders/personal.ts +41 -0
- package/src/utils/templateSafetyBorders/postCards.ts +259 -0
- package/src/utils/templateSafetyBorders/professional.ts +78 -0
- package/src/utils/templateSafetyBorders/snapPack.ts +165 -0
- package/src/utils/templateSafetyBorders/triFold.ts +114 -0
- package/src/utils/templateSafetyBorders/types.d.ts +68 -0
- package/src/utils/types.ts +12 -0
- package/src/v2Theme.scss +142 -0
- package/tsconfig.json +29 -0
- package/tsconfig.node.json +12 -0
- package/update-version.js +23 -0
- package/version.js +1 -0
- package/vite.config.ts +8 -0
- package/webpack.config.js +80 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import React, {ChangeEvent, FC, useState} from 'react';
|
|
2
|
+
|
|
3
|
+
// components
|
|
4
|
+
import Typography from '../Typography';
|
|
5
|
+
import CustomTooltip from '../CustomTooltip';
|
|
6
|
+
import Button from '../Button';
|
|
7
|
+
|
|
8
|
+
// icon
|
|
9
|
+
import Search from '../../../assets/images/input/search';
|
|
10
|
+
import Cancel from '../../../assets/images/input/cancel';
|
|
11
|
+
import VideoInfo from '../../../assets/images/modal-icons/info';
|
|
12
|
+
import ToolCancel from '../../../assets/images/modal-icons/tool-cancel';
|
|
13
|
+
import CancelInput from '../../../assets/images/modal-icons/cancel-input';
|
|
14
|
+
|
|
15
|
+
// styles
|
|
16
|
+
import './styles.scss';
|
|
17
|
+
|
|
18
|
+
const errorStyles = {
|
|
19
|
+
color: 'var(--error-color)',
|
|
20
|
+
fontWeight: '400',
|
|
21
|
+
fontSize: '14px',
|
|
22
|
+
margin: "0"
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
interface InputProps {
|
|
26
|
+
variant?: keyof JSX.IntrinsicElements;
|
|
27
|
+
type: any;
|
|
28
|
+
value: string,
|
|
29
|
+
onChange: (
|
|
30
|
+
e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement | any>
|
|
31
|
+
) => void;
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
label?: string;
|
|
34
|
+
error?: string;
|
|
35
|
+
inputIcon?: boolean;
|
|
36
|
+
searchApplied?: boolean;
|
|
37
|
+
onClick?: () => void;
|
|
38
|
+
removeSearchInput?: () => void;
|
|
39
|
+
onKeyDown?: () => void;
|
|
40
|
+
builderInput?: boolean;
|
|
41
|
+
gellerySearch?: boolean;
|
|
42
|
+
videoTooltip?: boolean;
|
|
43
|
+
handleFileRemove?: () => void;
|
|
44
|
+
qrField?: boolean;
|
|
45
|
+
onlyNumber?: boolean;
|
|
46
|
+
currentTheme?: string | null | undefined;
|
|
47
|
+
required?: boolean;
|
|
48
|
+
isClearable?: boolean;
|
|
49
|
+
className?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const Input: FC<InputProps> = ({
|
|
53
|
+
variant = 'input',
|
|
54
|
+
type,
|
|
55
|
+
value,
|
|
56
|
+
onChange,
|
|
57
|
+
placeholder,
|
|
58
|
+
label,
|
|
59
|
+
error,
|
|
60
|
+
inputIcon = false,
|
|
61
|
+
onClick,
|
|
62
|
+
searchApplied,
|
|
63
|
+
removeSearchInput,
|
|
64
|
+
onKeyDown,
|
|
65
|
+
builderInput,
|
|
66
|
+
gellerySearch = false,
|
|
67
|
+
videoTooltip = false,
|
|
68
|
+
handleFileRemove,
|
|
69
|
+
qrField = false,
|
|
70
|
+
onlyNumber = false,
|
|
71
|
+
currentTheme = '',
|
|
72
|
+
required = false,
|
|
73
|
+
isClearable = false,
|
|
74
|
+
className = ''
|
|
75
|
+
}) => {
|
|
76
|
+
const InputVariant = variant || 'input';
|
|
77
|
+
|
|
78
|
+
const [showTooltip, setShowTooltip] = useState<boolean>(false);
|
|
79
|
+
|
|
80
|
+
const loomButtonStyles = {
|
|
81
|
+
backgroundColor: 'var(--primary-color)',
|
|
82
|
+
fontSize: '12px',
|
|
83
|
+
padding: '10px 20px',
|
|
84
|
+
borderRadius: '4px',
|
|
85
|
+
maxHeight: '25px',
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const URLTooltip = (
|
|
89
|
+
<div className="videoUrlTooltip">
|
|
90
|
+
<p>
|
|
91
|
+
You can use Loom to create this video. Create your free Loom account
|
|
92
|
+
now.
|
|
93
|
+
</p>
|
|
94
|
+
<Button
|
|
95
|
+
style={loomButtonStyles}
|
|
96
|
+
onClick={(e) => {
|
|
97
|
+
e.stopPropagation();
|
|
98
|
+
window.open('https://www.loom.com/','_blank');
|
|
99
|
+
}}
|
|
100
|
+
>
|
|
101
|
+
Open Loom
|
|
102
|
+
</Button>
|
|
103
|
+
<ToolCancel onClick={()=>setShowTooltip(false)}/>
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
const handleClose = () => {
|
|
108
|
+
setShowTooltip(false);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<>
|
|
113
|
+
{currentTheme === 'v2' ? (
|
|
114
|
+
<div className={`input-layout ${currentTheme === 'v2' && 'new-theme-input-layout'} ${className} ${gellerySearch && 'gallery-input-layout'} ${qrField && 'qr-input-layout'}`}>
|
|
115
|
+
<label className="basic-label" style={{
|
|
116
|
+
marginBottom: label === 'Template Name' ? '4px' : '0',
|
|
117
|
+
}}>
|
|
118
|
+
{label ? <>{label} {required && <span className="required-asterisk">*</span>}</> : ''}
|
|
119
|
+
{videoTooltip && (
|
|
120
|
+
<>
|
|
121
|
+
<span className="urlTooltip"
|
|
122
|
+
onMouseOver={()=>setShowTooltip(true)}
|
|
123
|
+
>
|
|
124
|
+
<VideoInfo />
|
|
125
|
+
</span>
|
|
126
|
+
<CustomTooltip
|
|
127
|
+
children={URLTooltip}
|
|
128
|
+
open={showTooltip}
|
|
129
|
+
handleClose={handleClose}
|
|
130
|
+
place="top"
|
|
131
|
+
/>
|
|
132
|
+
</>
|
|
133
|
+
)}
|
|
134
|
+
</label>
|
|
135
|
+
<div
|
|
136
|
+
className={`input-with-icon ${searchApplied && 'focused'} ${error ? 'errorBorder' : ''} ${gellerySearch && 'galleryInput'} ${qrField && 'qrInputDiv'}`}
|
|
137
|
+
style={{
|
|
138
|
+
paddingRight: isClearable ? '20px' : '16px'
|
|
139
|
+
}}
|
|
140
|
+
>
|
|
141
|
+
{type === 'file' ? (
|
|
142
|
+
<input
|
|
143
|
+
type="file"
|
|
144
|
+
onChange={(e) => onChange(e)}
|
|
145
|
+
accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
|
|
146
|
+
multiple
|
|
147
|
+
className={`basic-input ${builderInput && 'builder-input'}`}
|
|
148
|
+
/>
|
|
149
|
+
) : (
|
|
150
|
+
<InputVariant
|
|
151
|
+
type={type}
|
|
152
|
+
value={value}
|
|
153
|
+
onChange={onChange}
|
|
154
|
+
placeholder={placeholder}
|
|
155
|
+
className={`basic-input ${builderInput && 'builder-input'}`}
|
|
156
|
+
onKeyDown={onlyNumber ? (event) => {
|
|
157
|
+
if (event.key === 'e' || event.key === 'E' || event.key === '-' || event.key === '+') {
|
|
158
|
+
event.preventDefault();
|
|
159
|
+
}
|
|
160
|
+
} : onKeyDown}
|
|
161
|
+
style={{
|
|
162
|
+
fontSize: label === 'Template Name' ? '16px' : 'inherit',
|
|
163
|
+
color: label === 'Template Name' ? '#000000' : 'inherit',
|
|
164
|
+
}}
|
|
165
|
+
/>
|
|
166
|
+
)}
|
|
167
|
+
{inputIcon && (
|
|
168
|
+
<>
|
|
169
|
+
{searchApplied && value?.length > 0 ? (
|
|
170
|
+
<div className="cancel-input-button" onClick={removeSearchInput}>
|
|
171
|
+
<Cancel fill="var(--border-color)" />
|
|
172
|
+
</div>
|
|
173
|
+
) : null}
|
|
174
|
+
<div
|
|
175
|
+
className="search-input-button"
|
|
176
|
+
onClick={value?.length > 0 ? onClick : () => {}}
|
|
177
|
+
>
|
|
178
|
+
<Search fill="var(--primary-color)" />
|
|
179
|
+
</div>
|
|
180
|
+
</>
|
|
181
|
+
)}
|
|
182
|
+
{(isClearable && value?.length > 0) && (
|
|
183
|
+
<div className="clear-search-input" onClick={removeSearchInput}>
|
|
184
|
+
<CancelInput />
|
|
185
|
+
</div>
|
|
186
|
+
)}
|
|
187
|
+
</div>
|
|
188
|
+
{error && (
|
|
189
|
+
<Typography variant="p" style={errorStyles}>
|
|
190
|
+
<sup>*</sup>
|
|
191
|
+
{error}
|
|
192
|
+
</Typography>
|
|
193
|
+
)}
|
|
194
|
+
</div>
|
|
195
|
+
) : (
|
|
196
|
+
<div className={`input-layout ${gellerySearch && 'gallery-input-layout'} ${qrField && 'qr-input-layout'}`}>
|
|
197
|
+
<label className="basic-label">
|
|
198
|
+
{label ? label : ''}
|
|
199
|
+
{videoTooltip && (
|
|
200
|
+
<>
|
|
201
|
+
<span className="urlTooltip"
|
|
202
|
+
onMouseOver={()=>setShowTooltip(true)}
|
|
203
|
+
>
|
|
204
|
+
<VideoInfo />
|
|
205
|
+
</span>
|
|
206
|
+
<CustomTooltip
|
|
207
|
+
children={URLTooltip}
|
|
208
|
+
open={showTooltip}
|
|
209
|
+
handleClose={handleClose}
|
|
210
|
+
place="top"
|
|
211
|
+
/>
|
|
212
|
+
</>
|
|
213
|
+
)}
|
|
214
|
+
</label>
|
|
215
|
+
<div
|
|
216
|
+
className={`input-with-icon ${searchApplied && 'focused'} ${error ? 'errorBorder' : ''} ${gellerySearch && 'galleryInput'} ${qrField && 'qrInputDiv'}`}
|
|
217
|
+
>
|
|
218
|
+
{type === 'file' ? (
|
|
219
|
+
<input
|
|
220
|
+
type="file"
|
|
221
|
+
onChange={(e) => onChange(e)}
|
|
222
|
+
accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
|
|
223
|
+
multiple
|
|
224
|
+
className={`basic-input ${builderInput && 'builder-input'}`}
|
|
225
|
+
/>
|
|
226
|
+
) : (
|
|
227
|
+
<InputVariant
|
|
228
|
+
type={type}
|
|
229
|
+
value={value}
|
|
230
|
+
onChange={onChange}
|
|
231
|
+
placeholder={placeholder}
|
|
232
|
+
className={`basic-input ${builderInput && 'builder-input'}`}
|
|
233
|
+
onKeyDown={onlyNumber ? (event) => {
|
|
234
|
+
if (event.key === 'e' || event.key === 'E' || event.key === '-' || event.key === '+') {
|
|
235
|
+
event.preventDefault();
|
|
236
|
+
}
|
|
237
|
+
} : onKeyDown}
|
|
238
|
+
/>
|
|
239
|
+
)}
|
|
240
|
+
{inputIcon && (
|
|
241
|
+
<>
|
|
242
|
+
{searchApplied && value?.length > 0 ? (
|
|
243
|
+
<div className="cancel-input-button" onClick={removeSearchInput}>
|
|
244
|
+
<Cancel fill="var(--border-color)" />
|
|
245
|
+
</div>
|
|
246
|
+
) : null}
|
|
247
|
+
<div
|
|
248
|
+
className="search-input-button"
|
|
249
|
+
onClick={value?.length > 0 ? onClick : () => {}}
|
|
250
|
+
>
|
|
251
|
+
<Search fill="var(--primary-color)" />
|
|
252
|
+
</div>
|
|
253
|
+
</>
|
|
254
|
+
)}
|
|
255
|
+
</div>
|
|
256
|
+
{error && (
|
|
257
|
+
<Typography variant="p" style={errorStyles}>
|
|
258
|
+
<sup>*</sup>
|
|
259
|
+
{error}
|
|
260
|
+
</Typography>
|
|
261
|
+
)}
|
|
262
|
+
</div>
|
|
263
|
+
)
|
|
264
|
+
}
|
|
265
|
+
</>
|
|
266
|
+
);
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
export default Input;
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
.input-layout {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
align-items: flex-start;
|
|
5
|
+
justify-content: flex-start;
|
|
6
|
+
width: 100%;
|
|
7
|
+
gap: 10px;
|
|
8
|
+
position: relative;
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
.basic-label {
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
font-weight: 400;
|
|
14
|
+
color: var(--text-color);
|
|
15
|
+
}
|
|
16
|
+
.urlTooltip {
|
|
17
|
+
position: absolute;
|
|
18
|
+
left: 80px;
|
|
19
|
+
top: 1px;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
.input-with-icon {
|
|
25
|
+
display: flex;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
align-items: center;
|
|
28
|
+
border: 0.5px solid var(--border-color);
|
|
29
|
+
border-radius: 7px;
|
|
30
|
+
height: 100%;
|
|
31
|
+
min-height: 55px;
|
|
32
|
+
width: 100%;
|
|
33
|
+
background: #fff;
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
.basic-input {
|
|
37
|
+
width: 100%;
|
|
38
|
+
padding: 5px 20px;
|
|
39
|
+
background: transparent;
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
font-family: var(--font-family) !important;
|
|
42
|
+
font-weight: 400;
|
|
43
|
+
line-height: 24px;
|
|
44
|
+
color: var(--text-color);
|
|
45
|
+
border: none;
|
|
46
|
+
border-radius: 7px;
|
|
47
|
+
&:focus {
|
|
48
|
+
outline: none;
|
|
49
|
+
}
|
|
50
|
+
&::placeholder {
|
|
51
|
+
opacity: 50%;
|
|
52
|
+
color: var(--text-color);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
.builder-input {
|
|
56
|
+
color: #000;
|
|
57
|
+
&::placeholder {
|
|
58
|
+
color: #000;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
.search-input-button {
|
|
64
|
+
position: relative;
|
|
65
|
+
display: flex;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
align-items: center;
|
|
68
|
+
&::before {
|
|
69
|
+
content: '';
|
|
70
|
+
position: absolute;
|
|
71
|
+
background-color: #303030;
|
|
72
|
+
height: 100%;
|
|
73
|
+
width: 1px;
|
|
74
|
+
top: 0;
|
|
75
|
+
right: 40px;
|
|
76
|
+
}
|
|
77
|
+
svg {
|
|
78
|
+
margin-right: 10px;
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
.cancel-input-button {
|
|
85
|
+
display: flex;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
align-items: center;
|
|
88
|
+
svg {
|
|
89
|
+
width: 15px !important;
|
|
90
|
+
margin-right: 10px;
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
&.errorBorder {
|
|
97
|
+
border: 1.5px solid var(--error-color);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
.focused {
|
|
103
|
+
background-color: var(--secondary-color);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
.galleryInput {
|
|
108
|
+
min-height: 40px !important;
|
|
109
|
+
border-radius: 3px !important;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
.file-upload-wrapper {
|
|
114
|
+
display: flex;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
align-items: center;
|
|
117
|
+
border: 0.5px solid var(--border-color);
|
|
118
|
+
border-radius: 8px;
|
|
119
|
+
padding: 20px;
|
|
120
|
+
background-color: #fff;
|
|
121
|
+
width: 100%;
|
|
122
|
+
height: 135px;
|
|
123
|
+
position: relative;
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
.file-input {
|
|
127
|
+
position: absolute;
|
|
128
|
+
width: 100%;
|
|
129
|
+
height: 100%;
|
|
130
|
+
opacity: 0;
|
|
131
|
+
cursor: pointer;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
.upload-area {
|
|
136
|
+
text-align: center;
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
.upload-icon {
|
|
140
|
+
font-size: 32px;
|
|
141
|
+
color: #ff6347; /* Customize color */
|
|
142
|
+
margin-bottom: 10px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
.upload-text {
|
|
147
|
+
color: #ff6347; /* Customize color */
|
|
148
|
+
font-weight: 400;
|
|
149
|
+
text-decoration: underline;
|
|
150
|
+
cursor: pointer;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
.upload-info {
|
|
155
|
+
margin-top: 10px;
|
|
156
|
+
color: #545454;
|
|
157
|
+
font-size: 12px;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
.uploaded-files {
|
|
164
|
+
width: 100%;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
h3 {
|
|
169
|
+
font-size: 14px;
|
|
170
|
+
font-weight: 400;
|
|
171
|
+
color: var(--text-color);
|
|
172
|
+
margin-bottom: 10px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
.file-item {
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
border: 1px solid #ddd;
|
|
180
|
+
border-radius: 8px;
|
|
181
|
+
padding: 10px;
|
|
182
|
+
margin-bottom: 10px;
|
|
183
|
+
background-color: #fff;
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
.file-icon {
|
|
187
|
+
display: flex;
|
|
188
|
+
align-items: center;
|
|
189
|
+
justify-content: center;
|
|
190
|
+
padding: 5px;
|
|
191
|
+
border-radius: 4px;
|
|
192
|
+
margin-right: 10px;
|
|
193
|
+
width: 50px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
.file-details {
|
|
198
|
+
flex-grow: 1;
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
.file-name {
|
|
202
|
+
font-size: 14px !important;
|
|
203
|
+
margin: 0;
|
|
204
|
+
font-weight: 500;
|
|
205
|
+
color: #303030 !important;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
.file-size {
|
|
210
|
+
font-size: 12px !important;
|
|
211
|
+
color: #b3b3b3 !important;
|
|
212
|
+
font-weight: 300 !important;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
.file-remove {
|
|
218
|
+
display: flex;
|
|
219
|
+
align-items: center;
|
|
220
|
+
cursor: pointer;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
.videoUrlTooltip {
|
|
227
|
+
display: flex;
|
|
228
|
+
justify-content: flex-start;
|
|
229
|
+
align-items: flex-end;
|
|
230
|
+
flex-direction: column;
|
|
231
|
+
width: 100%;
|
|
232
|
+
max-width: 330px;
|
|
233
|
+
p {
|
|
234
|
+
text-align: left;
|
|
235
|
+
font-size: 12px !important;
|
|
236
|
+
font-weight: 400 !important;
|
|
237
|
+
color: #000 !important;
|
|
238
|
+
}
|
|
239
|
+
svg{
|
|
240
|
+
position: absolute;
|
|
241
|
+
width: 14px;
|
|
242
|
+
height: 14px;
|
|
243
|
+
top: 2px;
|
|
244
|
+
right: 3px;
|
|
245
|
+
cursor: pointer;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
.gallery-input-layout {
|
|
251
|
+
min-width: 320px !important;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.qr-input-layout{
|
|
255
|
+
.qrInputDiv{
|
|
256
|
+
min-height: 35px !important;
|
|
257
|
+
border-radius: 3px !important;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// new theme input layout
|
|
262
|
+
.new-theme-input-layout{
|
|
263
|
+
gap: 8px;
|
|
264
|
+
.basic-label {
|
|
265
|
+
font-size: 16px;
|
|
266
|
+
font-weight: 500;
|
|
267
|
+
line-height: 20px;
|
|
268
|
+
color: #111827;
|
|
269
|
+
position: relative;
|
|
270
|
+
|
|
271
|
+
.required-asterisk{
|
|
272
|
+
color: #E10606;
|
|
273
|
+
position: absolute;
|
|
274
|
+
top: -1px;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
.input-with-icon{
|
|
278
|
+
min-height: 44px !important;
|
|
279
|
+
border-radius: 4px !important;
|
|
280
|
+
border: 1px solid #E5E7EB;
|
|
281
|
+
position: relative;
|
|
282
|
+
|
|
283
|
+
.basic-input{
|
|
284
|
+
padding: 5px 16px;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.clear-search-input{
|
|
288
|
+
position: absolute;
|
|
289
|
+
right: 16px;
|
|
290
|
+
top: 50%;
|
|
291
|
+
transform: translateY(-50%);
|
|
292
|
+
cursor: pointer;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.NewDesignSearch{
|
|
298
|
+
margin-top: 32px;
|
|
299
|
+
max-width: 300px;
|
|
300
|
+
|
|
301
|
+
.basic-label{
|
|
302
|
+
font-size: 16px;
|
|
303
|
+
font-weight: 400;
|
|
304
|
+
color: var(--input-label-color);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.input-with-icon{
|
|
308
|
+
min-height: 42px;
|
|
309
|
+
border: 0.5px solid #B0B0B0;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.searchInput-v2{
|
|
314
|
+
width: auto !important;
|
|
315
|
+
min-height: 42px !important;
|
|
316
|
+
flex-direction: row !important;
|
|
317
|
+
min-width: 258px !important;
|
|
318
|
+
|
|
319
|
+
.input-with-icon{
|
|
320
|
+
padding-right: 0 !important;
|
|
321
|
+
border-radius: 7px !important;
|
|
322
|
+
|
|
323
|
+
.basic-input{
|
|
324
|
+
padding: 5px 16px;
|
|
325
|
+
|
|
326
|
+
&::placeholder{
|
|
327
|
+
color: #00000099 !important;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
2
|
+
import './styles.scss';
|
|
3
|
+
|
|
4
|
+
const Tabs = ({ value, onChange, tabs, className, tabClassName, indicatorClassName }: any) => {
|
|
5
|
+
const [indicatorStyle, setIndicatorStyle] = useState({});
|
|
6
|
+
const tabRefs = useRef<Array<HTMLDivElement | null>>([]);
|
|
7
|
+
|
|
8
|
+
const calculateIndicatorPosition = () => {
|
|
9
|
+
const activeIndex = tabs.findIndex((tab: any) => tab.id === value.id);
|
|
10
|
+
|
|
11
|
+
if (tabRefs.current[activeIndex]) {
|
|
12
|
+
const tabWidth = tabRefs.current[activeIndex]?.offsetWidth || 0;
|
|
13
|
+
const tabLeft = tabRefs.current[activeIndex]?.offsetLeft || 0;
|
|
14
|
+
|
|
15
|
+
let indicatorLeft;
|
|
16
|
+
if (window.innerWidth < 768) {
|
|
17
|
+
const indicatorWidth = tabWidth * 0.5;
|
|
18
|
+
indicatorLeft = tabLeft + (tabWidth - indicatorWidth) / 2;
|
|
19
|
+
setIndicatorStyle({
|
|
20
|
+
width: `${indicatorWidth}px`,
|
|
21
|
+
left: `${indicatorLeft}px`,
|
|
22
|
+
});
|
|
23
|
+
} else {
|
|
24
|
+
const indicatorWidth = 50;
|
|
25
|
+
indicatorLeft = tabLeft + tabWidth / 2 - indicatorWidth / 2;
|
|
26
|
+
setIndicatorStyle({
|
|
27
|
+
width: `${indicatorWidth}px`,
|
|
28
|
+
left: `${indicatorLeft}px`,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
useLayoutEffect(() => {
|
|
35
|
+
calculateIndicatorPosition();
|
|
36
|
+
window.addEventListener('resize', calculateIndicatorPosition);
|
|
37
|
+
|
|
38
|
+
return () => {
|
|
39
|
+
window.removeEventListener('resize', calculateIndicatorPosition);
|
|
40
|
+
};
|
|
41
|
+
}, [value, tabs.length]);
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (tabs.length > 0 && !value.id) {
|
|
45
|
+
onChange(tabs[0]);
|
|
46
|
+
}
|
|
47
|
+
}, [tabs, value, onChange]);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div className={`tabsWrapper ${className}`}>
|
|
51
|
+
<div className="tabsContainer">
|
|
52
|
+
{tabs.map((tab:any, index:any) => (
|
|
53
|
+
<div
|
|
54
|
+
key={index}
|
|
55
|
+
ref={(el) => (tabRefs.current[index] = el)}
|
|
56
|
+
className={`tab ${tabClassName} ${value.id === tab.id ? 'activeTab' : ''}`}
|
|
57
|
+
onClick={() => onChange(tab)}
|
|
58
|
+
>
|
|
59
|
+
{tab.label}
|
|
60
|
+
</div>
|
|
61
|
+
))}
|
|
62
|
+
</div>
|
|
63
|
+
<div
|
|
64
|
+
className={`tabsIndicator ${indicatorClassName}`}
|
|
65
|
+
style={indicatorStyle}
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export default Tabs;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
.tabsWrapper {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: flex;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
align-items: center;
|
|
6
|
+
width: 100%;
|
|
7
|
+
transition: left 0.3s ease-in-out;
|
|
8
|
+
|
|
9
|
+
.tabsContainer {
|
|
10
|
+
display: flex;
|
|
11
|
+
gap: 55px;
|
|
12
|
+
width: 100%;
|
|
13
|
+
|
|
14
|
+
.tab {
|
|
15
|
+
padding: 10px 0;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
text-align: center;
|
|
18
|
+
font-size: 18px;
|
|
19
|
+
flex: 1;
|
|
20
|
+
width: 100%;
|
|
21
|
+
min-width: fit-content;
|
|
22
|
+
transition: left 0.3s ease-in-out;
|
|
23
|
+
|
|
24
|
+
@media (width <= 768px){
|
|
25
|
+
font-size: 15px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&.activeTab {
|
|
29
|
+
font-weight: bold;
|
|
30
|
+
color: var(--primary-color);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.tabsIndicator {
|
|
36
|
+
position: absolute;
|
|
37
|
+
bottom: 3px;
|
|
38
|
+
height: 1.5px;
|
|
39
|
+
background-color: var(--primary-color);
|
|
40
|
+
transition: left 0.3s ease-in-out;
|
|
41
|
+
}
|
|
42
|
+
}
|