groundfloor-react-ui 1.0.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/README.md +20 -0
- package/assets/fonts/Averta/Averta-Black.woff2 +0 -0
- package/assets/fonts/Averta/Averta-BlackItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Bold.woff2 +0 -0
- package/assets/fonts/Averta/Averta-BoldItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraBold.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraBoldItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraThin.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraThinItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Light.woff2 +0 -0
- package/assets/fonts/Averta/Averta-LightItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Regular.woff2 +0 -0
- package/assets/fonts/Averta/Averta-RegularItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-SemiBold.woff2 +0 -0
- package/assets/fonts/Averta/Averta-SemiBoldItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Thin.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ThinItalic.woff2 +0 -0
- package/assets/fonts/Beauty/BeautyDemo.woff +0 -0
- package/assets/icons/app-logo.svg +3 -0
- package/assets/icons/arrow-down.svg +3 -0
- package/assets/icons/arrow-rotate.svg +1 -0
- package/assets/icons/arrow-up.svg +3 -0
- package/assets/icons/bell.svg +3 -0
- package/assets/icons/check.svg +3 -0
- package/assets/icons/checkmark.svg +3 -0
- package/assets/icons/chevron-down.svg +3 -0
- package/assets/icons/chevron-left.svg +3 -0
- package/assets/icons/chevron-right.svg +3 -0
- package/assets/icons/cloud-icon.svg +3 -0
- package/assets/icons/connection.svg +3 -0
- package/assets/icons/cross-icon.svg +3 -0
- package/assets/icons/door-internal-active.svg +1 -0
- package/assets/icons/edit-icon.svg +3 -0
- package/assets/icons/ellipses-horizontal.svg +3 -0
- package/assets/icons/ellipses.svg +3 -0
- package/assets/icons/email.svg +3 -0
- package/assets/icons/eye-hide-view.svg +1 -0
- package/assets/icons/eye-hide.svg +1 -0
- package/assets/icons/file-attach-white.svg +3 -0
- package/assets/icons/file-attach.svg +3 -0
- package/assets/icons/functional-equation-regular.svg +147 -0
- package/assets/icons/hamburger-menu.svg +3 -0
- package/assets/icons/heart.svg +18 -0
- package/assets/icons/image.svg +3 -0
- package/assets/icons/info.svg +3 -0
- package/assets/icons/jpg-icon.svg +3 -0
- package/assets/icons/magnifier.svg +3 -0
- package/assets/icons/menu-ellipse-two.svg +1 -0
- package/assets/icons/menu-ellipse.svg +53 -0
- package/assets/icons/pause-all.svg +1 -0
- package/assets/icons/pdf-icon.svg +3 -0
- package/assets/icons/pen-icon.svg +3 -0
- package/assets/icons/plus-outlined.svg +3 -0
- package/assets/icons/resume.svg +1 -0
- package/assets/icons/sign-icon.svg +3 -0
- package/assets/icons/star.svg +3 -0
- package/assets/icons/trash-icon.svg +59 -0
- package/assets/icons/triangle-down.svg +3 -0
- package/assets/icons/users.svg +11 -0
- package/assets/icons/view.svg +3 -0
- package/assets/icons/watcher.svg +3 -0
- package/assets/icons/zoom-in-white.svg +1 -0
- package/assets/styles/global.css +0 -0
- package/assets/styles/global.scss +0 -0
- package/components/Accordion/Accordion.js +114 -0
- package/components/Accordion/AccordionSB.js +168 -0
- package/components/Accordion/AccordionSBfooter.js +171 -0
- package/components/Accordion/index.js +4 -0
- package/components/ArrowBar/ArrowBar.js +293 -0
- package/components/ArrowBar/index.js +2 -0
- package/components/Avatar/Avatar.js +167 -0
- package/components/Avatar/AvatarSB.js +226 -0
- package/components/Avatar/AvatarSBfooter.js +226 -0
- package/components/Avatar/index.js +4 -0
- package/components/Banner/Banner.js +65 -0
- package/components/Banner/index.js +2 -0
- package/components/Breadcrumb/Breadcrumb.js +192 -0
- package/components/Breadcrumb/index.js +2 -0
- package/components/Button/PrimaryButton.js +125 -0
- package/components/Button/SecondaryButton.js +114 -0
- package/components/Button/TinyButton.js +94 -0
- package/components/Button/index.js +6 -0
- package/components/Cards/Card.js +48 -0
- package/components/Cards/CardRef.js +64 -0
- package/components/Cards/DocumentCard.js +221 -0
- package/components/Cards/index.js +5 -0
- package/components/Content/Content.js +51 -0
- package/components/Content/index.js +1 -0
- package/components/Divider/Divider.js +63 -0
- package/components/Divider/index.js +2 -0
- package/components/Drawer/Drawer.js +93 -0
- package/components/Drawer/index.js +2 -0
- package/components/ErrorBoundary/ErrorBoundary.js +44 -0
- package/components/ErrorBoundary/index.js +1 -0
- package/components/FilterChip/FilterChip.js +68 -0
- package/components/FilterChip/index.js +1 -0
- package/components/Footer/Footer.js +58 -0
- package/components/Footer/FooterContentLev3.js +96 -0
- package/components/Footer/index.js +2 -0
- package/components/Form/FormComponent.js +273 -0
- package/components/Form/HeaderComponent.js +39 -0
- package/components/Form/StyledComponent.js +323 -0
- package/components/Form/SubmitComponent.js +63 -0
- package/components/Form/index.js +4 -0
- package/components/GroupAvatars/GroupAvatars.js +143 -0
- package/components/GroupAvatars/index.js +1 -0
- package/components/GroupButtons/ButtonPopup.js +192 -0
- package/components/GroupButtons/GroupButtons.js +150 -0
- package/components/GroupButtons/GroupButtonsPopup.js +169 -0
- package/components/GroupButtons/index.js +3 -0
- package/components/GroupStatusCircle/GroupStatusCircle.js +135 -0
- package/components/GroupStatusCircle/index.js +1 -0
- package/components/Header/Header.js +58 -0
- package/components/Header/index.js +1 -0
- package/components/HyperLink/HyperLink.js +114 -0
- package/components/HyperLink/index.js +1 -0
- package/components/Icon/Icon.js +161 -0
- package/components/Icon/index.js +1 -0
- package/components/Images/Image.js +112 -0
- package/components/Images/index.js +2 -0
- package/components/Inputs/CheckBoxEditableInput.js +352 -0
- package/components/Inputs/CheckBoxInput.js +195 -0
- package/components/Inputs/CheckBoxInputMS.js +160 -0
- package/components/Inputs/DateSelect.js +411 -0
- package/components/Inputs/DropdownSelect.js +466 -0
- package/components/Inputs/DropzoneInput.js +335 -0
- package/components/Inputs/NumericInput.js +155 -0
- package/components/Inputs/RadioInput.js +205 -0
- package/components/Inputs/SearchInput.js +18 -0
- package/components/Inputs/Signature.js +278 -0
- package/components/Inputs/TextArea.js +196 -0
- package/components/Inputs/TextInput.js +182 -0
- package/components/Inputs/TextInputClicable.js +198 -0
- package/components/Inputs/TextInputClicableMS.js +255 -0
- package/components/Inputs/TimeInput.js +181 -0
- package/components/Inputs/ToggleSwitch.js +123 -0
- package/components/Inputs/index.js +13 -0
- package/components/Label/Label.js +48 -0
- package/components/Label/index.js +1 -0
- package/components/Loaders/Loader.js +179 -0
- package/components/Loaders/index.js +2 -0
- package/components/Modal/Modal.js +116 -0
- package/components/Modal/ModalComp.js +158 -0
- package/components/Modal/index.js +2 -0
- package/components/Overlay/Overlay.js +159 -0
- package/components/Overlay/index.js +1 -0
- package/components/Pagination/Pagination.js +83 -0
- package/components/Pagination/index.js +1 -0
- package/components/ProgressBar/ProgressBar.js +84 -0
- package/components/ProgressBar/index.js +1 -0
- package/components/ProgressSteps/ProgressSteps.js +121 -0
- package/components/ProgressSteps/index.js +1 -0
- package/components/Rating/Rating.js +264 -0
- package/components/Rating/index.js +1 -0
- package/components/SecondaryLink/DarkSecondaryLink.js +97 -0
- package/components/SecondaryLink/LightSecondaryLink.js +93 -0
- package/components/SecondaryLink/index.js +3 -0
- package/components/Sidebar/Navbar.js +328 -0
- package/components/Sidebar/Sidebar.js +180 -0
- package/components/Sidebar/index.js +3 -0
- package/components/StatusChip/PrimaryStatusChip.js +78 -0
- package/components/StatusChip/SecondaryStatusChip.js +78 -0
- package/components/StatusChip/SlimPrimaryStatusChip.js +92 -0
- package/components/StatusChip/SlimSecondaryStatusChip.js +93 -0
- package/components/StatusChip/index.js +6 -0
- package/components/StatusCircle/StatusCircle.js +64 -0
- package/components/StatusCircle/index.js +1 -0
- package/components/Tables/Table.js +156 -0
- package/components/Tables/index.js +1 -0
- package/components/Tooltip/Tooltip.js +479 -0
- package/components/Tooltip/index.js +1 -0
- package/components/Typography/Typography.js +78 -0
- package/components/Typography/index.js +2 -0
- package/components/constants/colors.js +33 -0
- package/components/constants/defaultStyle.js +781 -0
- package/components/constants/defaultThemeColor.js +15 -0
- package/components/constants/index.js +7 -0
- package/components/constants/utils.js +31 -0
- package/components/global/FontStyle.js +131 -0
- package/components/global/index.js +1 -0
- package/dist/index.es.js +2302 -0
- package/dist/index.js +2302 -0
- package/index.js +40 -0
- package/package.json +67 -0
- package/rollup.config.js +53 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Icon } from '../Icon';
|
|
3
|
+
import { TextInput } from './TextInput';
|
|
4
|
+
|
|
5
|
+
export const SearchInput = ({ label, placeholder, handleSearch, searchInput, customStylesForm, customStyleObject, textBoxStyle, ...props }) => {
|
|
6
|
+
|
|
7
|
+
return <TextInput
|
|
8
|
+
iconAfter={<Icon icon='magnifier-icon' />}
|
|
9
|
+
label={label}
|
|
10
|
+
textBoxStyle={textBoxStyle}
|
|
11
|
+
placeholder={placeholder}
|
|
12
|
+
ref={searchInput}
|
|
13
|
+
onChange={handleSearch}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import React, { useState, useRef, useEffect } from "react";
|
|
2
|
+
import SignaturePad from 'react-signature-pad-wrapper'
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
5
|
+
import defaultStyle from '../constants/defaultStyle';
|
|
6
|
+
import getDefaultStyles from '../constants/utils';
|
|
7
|
+
import PropTypes from "prop-types";
|
|
8
|
+
|
|
9
|
+
import { Icon } from "../Icon";
|
|
10
|
+
|
|
11
|
+
const ParentDiv = styled.div`
|
|
12
|
+
|
|
13
|
+
//Set the styles from the default styles object
|
|
14
|
+
${({ theme, defaultParentDivStyle }) => {
|
|
15
|
+
return getDefaultStyles(theme, defaultParentDivStyle);
|
|
16
|
+
}}
|
|
17
|
+
|
|
18
|
+
border: 1px solid ${({ isMyInputFocused, activeColor, defaultColor }) => isMyInputFocused ? activeColor : defaultColor};
|
|
19
|
+
|
|
20
|
+
&:focus-within{
|
|
21
|
+
border-color: ${({ activeColor }) => activeColor};
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const WrapperDiv = styled.div`
|
|
26
|
+
|
|
27
|
+
//Set the styles from the default styles object
|
|
28
|
+
${({ theme, defaultWrapperDivStyle }) => {
|
|
29
|
+
return getDefaultStyles(theme, defaultWrapperDivStyle);
|
|
30
|
+
}}
|
|
31
|
+
|
|
32
|
+
flex-direction: ${({ signIcon }) => signIcon ? 'column' : 'initial'};
|
|
33
|
+
width: ${({ signIcon }) => signIcon ? 'min-content' : 'calc(100% - 50px) !important'};
|
|
34
|
+
max-width: ${({ signIcon }) => signIcon ? '42px' : '490px'};
|
|
35
|
+
border-right: 1px solid
|
|
36
|
+
${({ activeColor, defaultColor, isMyInputFocused, signIcon }) =>
|
|
37
|
+
signIcon ? isMyInputFocused ? activeColor : defaultColor : 'none'};
|
|
38
|
+
border-left: ${({ signIcon }) => !signIcon ? 'none' : ''};
|
|
39
|
+
margin-left: ${({ signIcon }) => !signIcon ? '42px' : ''};
|
|
40
|
+
position:${({ signIcon }) => !signIcon ? '' : 'absolute'};
|
|
41
|
+
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
const ControllerDiv = styled.div`
|
|
45
|
+
width: 39px;
|
|
46
|
+
height:44px;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: row;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
align-items: center;
|
|
51
|
+
border-bottom: ${({ penIcon, isMyInputFocused, activeColor, defaultColor, }) =>
|
|
52
|
+
penIcon ? isMyInputFocused ? "1px solid " + activeColor : "1px solid " + defaultColor : ''};
|
|
53
|
+
background-color:rgba(255, 255, 255, 0.05);
|
|
54
|
+
cursor:pointer;
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
const InputText = styled.input`
|
|
59
|
+
${({ theme, defaultInputStyle }) => {
|
|
60
|
+
return getDefaultStyles(theme, defaultInputStyle);
|
|
61
|
+
}}
|
|
62
|
+
|
|
63
|
+
border-bottom: ${({ value, defaultColor, }) =>
|
|
64
|
+
value.length > 0 ? 'none' : "1px solid " + defaultColor};
|
|
65
|
+
|
|
66
|
+
&::placeholder{
|
|
67
|
+
font-size: 17px;
|
|
68
|
+
text-align: center;
|
|
69
|
+
color: ${({ placeholderColor }) => placeholderColor};
|
|
70
|
+
font-family: "Averta";
|
|
71
|
+
font-style: normal;
|
|
72
|
+
font-weight: normal;
|
|
73
|
+
line-height: 22px;
|
|
74
|
+
}
|
|
75
|
+
&:focus-within {
|
|
76
|
+
border: none;
|
|
77
|
+
outline: none;
|
|
78
|
+
|
|
79
|
+
::placeholder {
|
|
80
|
+
color: transparent;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// custom styles
|
|
85
|
+
${({ customInputStyle }) => customInputStyle}
|
|
86
|
+
`;
|
|
87
|
+
|
|
88
|
+
const SignaturePadDiv = styled.div`
|
|
89
|
+
position: relative;
|
|
90
|
+
width: inherit;
|
|
91
|
+
display: flex;
|
|
92
|
+
margin: 4px;
|
|
93
|
+
`;
|
|
94
|
+
|
|
95
|
+
const IconDiv = styled.div`
|
|
96
|
+
padding-left: 2px;
|
|
97
|
+
display: flex;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
margin-left: ${({ selected }) => selected === 'sign' ? '' : 'auto'};
|
|
101
|
+
`;
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
export const SignatureInput = ({ onChange, activeColor, defaultColor, placeholderColor, placeholderText, customInputStyle, pointsArray, setPointsArray, value, setValue, valueForSignatureDrawing, setValueForSignatureDrawing, imageURL, setImageURL, ...props }) => {
|
|
105
|
+
const [selected, setSelected] = useState('default');
|
|
106
|
+
const [isMyInputFocused, setIsMyInputFocused] = useState(false);
|
|
107
|
+
const [dirty, setDirty] = useState(false);
|
|
108
|
+
const pad = useRef(null);
|
|
109
|
+
|
|
110
|
+
// const theme = defaultStyle;
|
|
111
|
+
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (dirty) {
|
|
114
|
+
save();
|
|
115
|
+
setValueForSignatureDrawing(pad.current);
|
|
116
|
+
}
|
|
117
|
+
}, [dirty === true])
|
|
118
|
+
|
|
119
|
+
const onClear = () => {
|
|
120
|
+
setValue('');
|
|
121
|
+
setValueForSignatureDrawing(pad.current);
|
|
122
|
+
if (pad.current) {
|
|
123
|
+
pad.current.clear();
|
|
124
|
+
}
|
|
125
|
+
setIsMyInputFocused(false);
|
|
126
|
+
setDirty(false);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const save = () => {
|
|
130
|
+
setPointsArray(pad.current.toData());
|
|
131
|
+
setImageURL(pad.current.toDataURL("image/png"));
|
|
132
|
+
return [imageURL, pointsArray];
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<ParentDiv
|
|
137
|
+
theme={defaultStyle}
|
|
138
|
+
defaultParentDivStyle={'signature-parent-div'}
|
|
139
|
+
isMyInputFocused={isMyInputFocused}
|
|
140
|
+
selected={selected}
|
|
141
|
+
activeColor={activeColor}
|
|
142
|
+
defaultColor={defaultColor}>
|
|
143
|
+
<WrapperDiv
|
|
144
|
+
theme={defaultStyle}
|
|
145
|
+
defaultWrapperDivStyle={'signature-wrapper-div'}
|
|
146
|
+
activeColor={activeColor}
|
|
147
|
+
defaultColor={defaultColor}
|
|
148
|
+
selected={selected}
|
|
149
|
+
isMyInputFocused={isMyInputFocused}
|
|
150
|
+
signIcon={true}>
|
|
151
|
+
<ControllerDiv
|
|
152
|
+
activeColor={activeColor}
|
|
153
|
+
defaultColor={defaultColor}
|
|
154
|
+
isMyInputFocused={isMyInputFocused}
|
|
155
|
+
penIcon={true}
|
|
156
|
+
onClick={() => { setSelected('default') }}>
|
|
157
|
+
<Icon
|
|
158
|
+
icon='pen-icon'
|
|
159
|
+
color={selected === 'default' ?
|
|
160
|
+
activeColor : 'black'} />
|
|
161
|
+
</ControllerDiv>
|
|
162
|
+
<ControllerDiv
|
|
163
|
+
activeColor={activeColor} defaultColor={defaultColor}
|
|
164
|
+
isMyInputFocused={isMyInputFocused}
|
|
165
|
+
penIcon={false}
|
|
166
|
+
onClick={() => { setSelected('sign') }}>
|
|
167
|
+
<Icon
|
|
168
|
+
icon='sign-icon'
|
|
169
|
+
color={selected !== 'default' ?
|
|
170
|
+
activeColor : 'black'} />
|
|
171
|
+
</ControllerDiv>
|
|
172
|
+
</WrapperDiv>
|
|
173
|
+
<WrapperDiv
|
|
174
|
+
theme={defaultStyle}
|
|
175
|
+
defaultWrapperDivStyle={'signature-wrapper-div'}
|
|
176
|
+
activeColor={activeColor}
|
|
177
|
+
defaultColor={defaultColor}
|
|
178
|
+
selected={selected}
|
|
179
|
+
isMyInputFocused={isMyInputFocused}
|
|
180
|
+
signIcon={false}
|
|
181
|
+
onTouchStart={() => { console.log('touchstart') }}>
|
|
182
|
+
{selected === 'default' ?
|
|
183
|
+
<InputText
|
|
184
|
+
theme={defaultStyle} defaultInputStyle={'signature-input-text'}
|
|
185
|
+
placeholder={placeholderText}
|
|
186
|
+
placeholderColor={placeholderColor}
|
|
187
|
+
customInputStyle={customInputStyle}
|
|
188
|
+
onBlur={() => setIsMyInputFocused(false)}
|
|
189
|
+
onFocus={() => setIsMyInputFocused(true)}
|
|
190
|
+
value={value}
|
|
191
|
+
defaultColor={defaultColor}
|
|
192
|
+
onChange={(e) => setValue(e.target.value)} />
|
|
193
|
+
: <SignaturePadDiv
|
|
194
|
+
onMouseEnter={() => setIsMyInputFocused(true)}
|
|
195
|
+
onMouseLeave={() => setIsMyInputFocused(false)}
|
|
196
|
+
onClick={() => { setDirty(true); save(); }}>
|
|
197
|
+
<SignaturePad
|
|
198
|
+
ref={pad}
|
|
199
|
+
redrawOnResize
|
|
200
|
+
height={75}
|
|
201
|
+
options={{ minWidth: 1, maxWidth: 1, penColor: '#444444' }} />
|
|
202
|
+
</SignaturePadDiv>
|
|
203
|
+
}
|
|
204
|
+
{(value || dirty) && <IconDiv selected={selected} onClick={() => onClear()}>
|
|
205
|
+
<Icon
|
|
206
|
+
icon='cross-icon'
|
|
207
|
+
color={defaultColor}
|
|
208
|
+
/>
|
|
209
|
+
</IconDiv>
|
|
210
|
+
}
|
|
211
|
+
</WrapperDiv>
|
|
212
|
+
</ParentDiv>
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
SignatureInput.propTypes = {
|
|
217
|
+
/**
|
|
218
|
+
* Active Color for the signature
|
|
219
|
+
*/
|
|
220
|
+
activeColor: PropTypes.string,
|
|
221
|
+
/**
|
|
222
|
+
* Default Color for the signature
|
|
223
|
+
*/
|
|
224
|
+
defaultColor: PropTypes.string,
|
|
225
|
+
/**
|
|
226
|
+
* PlaceHolder Color for the signature
|
|
227
|
+
*/
|
|
228
|
+
placeholderColor: PropTypes.string,
|
|
229
|
+
/**
|
|
230
|
+
* PlaceHolder text
|
|
231
|
+
*/
|
|
232
|
+
placeholderText: PropTypes.string,
|
|
233
|
+
/**
|
|
234
|
+
* Custom style of the input text
|
|
235
|
+
*/
|
|
236
|
+
customInputStyle: PropTypes.object,
|
|
237
|
+
/**
|
|
238
|
+
* Array of points for the signature
|
|
239
|
+
*/
|
|
240
|
+
pointsArray: PropTypes.any,
|
|
241
|
+
/**
|
|
242
|
+
* Function that sets the Array of points for the signature
|
|
243
|
+
*/
|
|
244
|
+
setPointsArray: PropTypes.func,
|
|
245
|
+
/**
|
|
246
|
+
* Signature Text
|
|
247
|
+
*/
|
|
248
|
+
value: PropTypes.string,
|
|
249
|
+
/**
|
|
250
|
+
* Signature Text Setter
|
|
251
|
+
*/
|
|
252
|
+
setValue: PropTypes.func,
|
|
253
|
+
/**
|
|
254
|
+
* Image url of the Signature drawing
|
|
255
|
+
*/
|
|
256
|
+
imageURL: PropTypes.string,
|
|
257
|
+
/**
|
|
258
|
+
* Function that sets Image url of the Signature drawing
|
|
259
|
+
*/
|
|
260
|
+
setImageURL: PropTypes.func
|
|
261
|
+
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
SignatureInput.defaultProps = {
|
|
265
|
+
activeColor: `${defaultThemeColor.primary['primary-1']}`,
|
|
266
|
+
defaultColor: `${defaultThemeColor.neutral['neutral-3']}`,
|
|
267
|
+
placeholderColor: `${defaultThemeColor.neutral['neutral-3']}`,
|
|
268
|
+
customInputStyle: {},
|
|
269
|
+
placeholderText: 'Type your signature here',
|
|
270
|
+
pointsArray: null,
|
|
271
|
+
setPointsArray: () => { },
|
|
272
|
+
value: "",
|
|
273
|
+
setValue: () => { },
|
|
274
|
+
imageURL: '',
|
|
275
|
+
setImageURL: () => { },
|
|
276
|
+
setValueForSignatureDrawing: () => { },
|
|
277
|
+
}
|
|
278
|
+
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
5
|
+
import defaultStyles from '../constants/defaultStyle';
|
|
6
|
+
import getDefaultStyles from '../constants/utils';
|
|
7
|
+
import { Label } from '../Label';
|
|
8
|
+
|
|
9
|
+
const border = `#D4D7E3`;
|
|
10
|
+
|
|
11
|
+
const TextWrapper = styled.div`
|
|
12
|
+
//Set the styles from the default styles object
|
|
13
|
+
${({ theme, defaultWrapperStyle }) => {
|
|
14
|
+
return getDefaultStyles(theme, defaultWrapperStyle);
|
|
15
|
+
}}
|
|
16
|
+
|
|
17
|
+
border: ${({ isValid, themeColor }) => !isValid ? '1px solid ' + themeColor.variant['error'] :
|
|
18
|
+
'1px solid ' + border};
|
|
19
|
+
|
|
20
|
+
.input-icon svg path {
|
|
21
|
+
fill: ${({ themeColor }) => themeColor.variant['neutral-1']};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:focus-within {
|
|
25
|
+
border: 1px solid ${({ themeColor }) => themeColor.variant['primary-1']};
|
|
26
|
+
outline: none;
|
|
27
|
+
|
|
28
|
+
.input-icon svg path {
|
|
29
|
+
fill: ${({ themeColor }) => themeColor.variant['primary-1']};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// custom styles
|
|
34
|
+
${({ textAreaStyle }) => textAreaStyle}
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
TextWrapper.defaultProps = {
|
|
38
|
+
themeColor: defaultThemeColor,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
const Input = styled.textarea`
|
|
43
|
+
//Set the styles from the default styles object
|
|
44
|
+
${({ theme, defaultInputStyle }) => {
|
|
45
|
+
return getDefaultStyles(theme, defaultInputStyle);
|
|
46
|
+
}}
|
|
47
|
+
margin: 0;
|
|
48
|
+
overflow: auto;
|
|
49
|
+
resize: none
|
|
50
|
+
// custom styles
|
|
51
|
+
${({ inputStyle }) => inputStyle}
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
const inline = css`
|
|
55
|
+
display: flex;
|
|
56
|
+
gap: 10px;
|
|
57
|
+
align-items: center;
|
|
58
|
+
`
|
|
59
|
+
|
|
60
|
+
const Form = styled.div`
|
|
61
|
+
${({ labelInline }) => labelInline ? inline : null}
|
|
62
|
+
${({ customStylesForm }) => {
|
|
63
|
+
if (customStylesForm) {
|
|
64
|
+
return { ...customStylesForm }
|
|
65
|
+
}
|
|
66
|
+
}}
|
|
67
|
+
position: relative;
|
|
68
|
+
.err-text {
|
|
69
|
+
color: ${({ themeColor }) => themeColor.variant['error']};
|
|
70
|
+
margin-top: 5px;
|
|
71
|
+
font-size: 10px;
|
|
72
|
+
}
|
|
73
|
+
`
|
|
74
|
+
|
|
75
|
+
Form.defaultProps = {
|
|
76
|
+
themeColor: defaultThemeColor,
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
export const TextArea = React.forwardRef(({ themeColor, customStylesForm, textAreaStyle, labelStyle, inputStyle, errMsg, required, label, labelInline, iconBefore, iconAfter, isValid, rows, cols, ...props }, ref) => {
|
|
81
|
+
return (
|
|
82
|
+
<Form labelInline={labelInline} customStylesForm={customStylesForm} {...props}>
|
|
83
|
+
<div style={{ display: 'flex' }}>
|
|
84
|
+
<Label
|
|
85
|
+
themeColor={defaultThemeColor}
|
|
86
|
+
customStyles={labelStyle}
|
|
87
|
+
type={'label-text'}
|
|
88
|
+
labelInline={labelInline}
|
|
89
|
+
text={label}
|
|
90
|
+
errMsg={errMsg}
|
|
91
|
+
style={{
|
|
92
|
+
'display': 'flex',
|
|
93
|
+
'paddingBottom': `${!labelInline ? '10px' : ''}`,
|
|
94
|
+
}}
|
|
95
|
+
{...props} />
|
|
96
|
+
{required && <div style={{
|
|
97
|
+
marginLeft: '4px',
|
|
98
|
+
color: `${themeColor.variant['error']}`
|
|
99
|
+
}} >*</div>}
|
|
100
|
+
</div>
|
|
101
|
+
<TextWrapper
|
|
102
|
+
required={required}
|
|
103
|
+
themeColor={defaultThemeColor}
|
|
104
|
+
textAreaStyle={textAreaStyle}
|
|
105
|
+
isValid={isValid}
|
|
106
|
+
theme={defaultStyles}
|
|
107
|
+
defaultWrapperStyle={'textbox-wrapper'} {...props}>
|
|
108
|
+
<div className="input-icon">
|
|
109
|
+
{iconBefore}
|
|
110
|
+
</div>
|
|
111
|
+
<Input
|
|
112
|
+
ref={ref}
|
|
113
|
+
inputStyle={inputStyle}
|
|
114
|
+
defaultInputStyle={'textarea-wrapper'}
|
|
115
|
+
cols={cols}
|
|
116
|
+
rows={rows}
|
|
117
|
+
{...props} size='1' />
|
|
118
|
+
<div className="input-icon">
|
|
119
|
+
{iconAfter}
|
|
120
|
+
</div>
|
|
121
|
+
</TextWrapper>
|
|
122
|
+
<div className='err-text'>
|
|
123
|
+
{errMsg}
|
|
124
|
+
</div>
|
|
125
|
+
</Form>
|
|
126
|
+
)
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
TextArea.propTypes = {
|
|
130
|
+
/**
|
|
131
|
+
* Theme props of default in-built css
|
|
132
|
+
*/
|
|
133
|
+
theme: PropTypes.object,
|
|
134
|
+
/**
|
|
135
|
+
* Color props of default theme
|
|
136
|
+
*/
|
|
137
|
+
themeColor: PropTypes.object,
|
|
138
|
+
/**
|
|
139
|
+
* row number of the text area
|
|
140
|
+
*/
|
|
141
|
+
rows: PropTypes.number,
|
|
142
|
+
/**
|
|
143
|
+
* Label of Input
|
|
144
|
+
*/
|
|
145
|
+
label: PropTypes.string,
|
|
146
|
+
/**
|
|
147
|
+
* Is the input required?
|
|
148
|
+
*/
|
|
149
|
+
required: PropTypes.bool,
|
|
150
|
+
/**
|
|
151
|
+
* Should label be inline with textbox?
|
|
152
|
+
*/
|
|
153
|
+
labelInline: PropTypes.bool,
|
|
154
|
+
/**
|
|
155
|
+
* Error Message
|
|
156
|
+
*/
|
|
157
|
+
errMsg: PropTypes.string,
|
|
158
|
+
/**
|
|
159
|
+
* Icon before input value
|
|
160
|
+
*/
|
|
161
|
+
iconBefore: PropTypes.any,
|
|
162
|
+
/**
|
|
163
|
+
* Icon after input value
|
|
164
|
+
*/
|
|
165
|
+
iconAfter: PropTypes.any,
|
|
166
|
+
/**
|
|
167
|
+
* custom style of textbox Wrapper
|
|
168
|
+
*/
|
|
169
|
+
textAreaStyle: PropTypes.object,
|
|
170
|
+
/**
|
|
171
|
+
* custom style of textbox input
|
|
172
|
+
*/
|
|
173
|
+
labelStyle: PropTypes.object,
|
|
174
|
+
/**
|
|
175
|
+
* custom style of textbox label
|
|
176
|
+
*/
|
|
177
|
+
inputStyle: PropTypes.object,
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
TextArea.defaultProps = {
|
|
181
|
+
themeColor: defaultThemeColor,
|
|
182
|
+
theme: defaultStyles,
|
|
183
|
+
label: '',
|
|
184
|
+
required: false,
|
|
185
|
+
isValid: true,
|
|
186
|
+
labelInline: false,
|
|
187
|
+
errMsg: '',
|
|
188
|
+
iconBefore: null,
|
|
189
|
+
iconAfter: null,
|
|
190
|
+
textAreaStyle: {},
|
|
191
|
+
labelStyle: {},
|
|
192
|
+
inputStyle: {},
|
|
193
|
+
// rows:10,
|
|
194
|
+
// cols:100
|
|
195
|
+
}
|
|
196
|
+
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
5
|
+
import defaultStyles from '../constants/defaultStyle';
|
|
6
|
+
import getDefaultStyles from '../constants/utils';
|
|
7
|
+
import { Label } from '../Label';
|
|
8
|
+
|
|
9
|
+
const border = `#D4D7E3`;
|
|
10
|
+
|
|
11
|
+
const TextWrapper = styled.div`
|
|
12
|
+
//Set the styles from the default styles object
|
|
13
|
+
${({ theme, defaultWrapperStyle }) => {
|
|
14
|
+
return getDefaultStyles(theme, defaultWrapperStyle);
|
|
15
|
+
}}
|
|
16
|
+
|
|
17
|
+
border: ${({ isValid, themeColor }) => !isValid ? '1px solid ' + themeColor.variant['error'] :
|
|
18
|
+
'1px solid ' + border};
|
|
19
|
+
|
|
20
|
+
.input-icon svg path {
|
|
21
|
+
fill: ${({ themeColor }) => themeColor.variant['neutral-1']};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:focus-within {
|
|
25
|
+
border: 1px solid ${({ themeColor }) => themeColor.variant['primary-1']};
|
|
26
|
+
outline: none;
|
|
27
|
+
|
|
28
|
+
.input-icon svg path {
|
|
29
|
+
fill: ${({ themeColor }) => themeColor.variant['primary-1']};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// custom styles
|
|
34
|
+
${({ textBoxStyle }) => textBoxStyle}
|
|
35
|
+
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
const Input = styled.input`
|
|
39
|
+
//Set the styles from the default styles object
|
|
40
|
+
${({ theme, defaultInputStyle }) => {
|
|
41
|
+
return getDefaultStyles(theme, defaultInputStyle);
|
|
42
|
+
}}
|
|
43
|
+
|
|
44
|
+
// custom styles
|
|
45
|
+
${({ inputStyle }) => inputStyle}
|
|
46
|
+
|
|
47
|
+
.sc-furwcr bxRAoq{
|
|
48
|
+
color: ${defaultThemeColor.variant['neutral-3']}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
const inline = css`
|
|
54
|
+
display: flex;
|
|
55
|
+
gap: 10px;
|
|
56
|
+
align-items: center;
|
|
57
|
+
`
|
|
58
|
+
|
|
59
|
+
const Form = styled.div`
|
|
60
|
+
${({ labelInline }) => labelInline ? inline : null}
|
|
61
|
+
.err-text {
|
|
62
|
+
color: ${({ themeColor }) => themeColor.variant['error']};
|
|
63
|
+
margin-top: 5px;
|
|
64
|
+
font-size: 10px;
|
|
65
|
+
}
|
|
66
|
+
`
|
|
67
|
+
|
|
68
|
+
Form.defaultProps = {
|
|
69
|
+
themeColor: defaultThemeColor,
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
export const TextInput = ({ themeColor, textBoxStyle, labelStyle, inputStyle, errMsg, required, label, labelInline, iconBefore, iconAfter, isValid, type, ...props }) => {
|
|
74
|
+
return (
|
|
75
|
+
<Form labelInline={labelInline} {...props}>
|
|
76
|
+
<div style={{ display: 'flex' }}>
|
|
77
|
+
<Label
|
|
78
|
+
themeColor={defaultThemeColor}
|
|
79
|
+
customStyles={labelStyle}
|
|
80
|
+
type={'label-text'}
|
|
81
|
+
labelInline={labelInline}
|
|
82
|
+
text={label}
|
|
83
|
+
errMsg={errMsg}
|
|
84
|
+
style={{
|
|
85
|
+
'display': 'flex',
|
|
86
|
+
'paddingBottom': `${!labelInline ? '10px' : ''}`,
|
|
87
|
+
}}
|
|
88
|
+
{...props} />
|
|
89
|
+
{required && <div style={{
|
|
90
|
+
marginLeft: '4px',
|
|
91
|
+
color: `${themeColor.variant['error']}`
|
|
92
|
+
}} >*</div>}
|
|
93
|
+
</div>
|
|
94
|
+
<TextWrapper
|
|
95
|
+
required={required}
|
|
96
|
+
themeColor={defaultThemeColor}
|
|
97
|
+
textBoxStyle={textBoxStyle}
|
|
98
|
+
isValid={isValid}
|
|
99
|
+
theme={defaultStyles}
|
|
100
|
+
defaultWrapperStyle={'textbox-wrapper'} {...props}>
|
|
101
|
+
<div className="input-icon">
|
|
102
|
+
{iconBefore}
|
|
103
|
+
</div>
|
|
104
|
+
<Input inputStyle={inputStyle} type={type} defaultInputStyle={'input-wrapper'} {...props} />
|
|
105
|
+
<div className="input-icon">
|
|
106
|
+
{iconAfter}
|
|
107
|
+
</div>
|
|
108
|
+
</TextWrapper>
|
|
109
|
+
{errMsg.length > 0 && <div className='err-text'>
|
|
110
|
+
{errMsg}
|
|
111
|
+
</div>}
|
|
112
|
+
</Form>
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
TextInput.propTypes = {
|
|
117
|
+
/**
|
|
118
|
+
* Theme props of default in-built css
|
|
119
|
+
*/
|
|
120
|
+
theme: PropTypes.object,
|
|
121
|
+
/**
|
|
122
|
+
* Color props of default theme
|
|
123
|
+
*/
|
|
124
|
+
themeColor: PropTypes.object,
|
|
125
|
+
/**
|
|
126
|
+
* Label of Input
|
|
127
|
+
*/
|
|
128
|
+
label: PropTypes.string,
|
|
129
|
+
/**
|
|
130
|
+
* Is the input required?
|
|
131
|
+
*/
|
|
132
|
+
required: PropTypes.bool,
|
|
133
|
+
/**
|
|
134
|
+
* Should label be inline with textbox?
|
|
135
|
+
*/
|
|
136
|
+
labelInline: PropTypes.bool,
|
|
137
|
+
/**
|
|
138
|
+
* Error Message
|
|
139
|
+
*/
|
|
140
|
+
errMsg: PropTypes.string,
|
|
141
|
+
/**
|
|
142
|
+
* Icon before input value
|
|
143
|
+
*/
|
|
144
|
+
iconBefore: PropTypes.any,
|
|
145
|
+
/**
|
|
146
|
+
* Icon after input value
|
|
147
|
+
*/
|
|
148
|
+
iconAfter: PropTypes.any,
|
|
149
|
+
/**
|
|
150
|
+
* custom style of textbox Wrapper
|
|
151
|
+
*/
|
|
152
|
+
textBoxStyle: PropTypes.object,
|
|
153
|
+
/**
|
|
154
|
+
* custom style of textbox input
|
|
155
|
+
*/
|
|
156
|
+
labelStyle: PropTypes.object,
|
|
157
|
+
/**
|
|
158
|
+
* custom style of textbox label
|
|
159
|
+
*/
|
|
160
|
+
inputStyle: PropTypes.object,
|
|
161
|
+
/**
|
|
162
|
+
* input type i.e:- text, password
|
|
163
|
+
*/
|
|
164
|
+
type: PropTypes.string,
|
|
165
|
+
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
TextInput.defaultProps = {
|
|
169
|
+
themeColor: defaultThemeColor,
|
|
170
|
+
theme: defaultStyles,
|
|
171
|
+
label: '',
|
|
172
|
+
required: false,
|
|
173
|
+
isValid: true,
|
|
174
|
+
labelInline: false,
|
|
175
|
+
errMsg: '',
|
|
176
|
+
iconBefore: null,
|
|
177
|
+
iconAfter: null,
|
|
178
|
+
textBoxStyle: {},
|
|
179
|
+
labelStyle: {},
|
|
180
|
+
inputStyle: {},
|
|
181
|
+
type: 'text'
|
|
182
|
+
}
|