groundfloor-react-ui 1.0.4 → 1.0.7
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/assets/icons/file-icon.svg +1 -0
- package/components/{Form → DesignComponent/StyledComponent}/StyledComponent.js +12 -17
- package/components/DesignComponent/StyledComponent/index.js +1 -0
- package/components/DesignComponent/index.js +1 -0
- package/components/Form/FormComponent.js +119 -187
- package/components/Form/SubmitComponent.js +1 -1
- package/components/Form/index.js +0 -1
- package/components/Icon/Icon.js +4 -1
- package/components/Inputs/CheckBoxInput.js +17 -8
- package/components/Inputs/DropdownSelect.js +160 -159
- package/components/Inputs/DropzoneInput.js +27 -22
- package/components/Inputs/NumericInput.js +76 -71
- package/components/Inputs/PasswordInput.js +1 -0
- package/components/Inputs/RadioInput.js +124 -83
- package/components/Inputs/TextArea.js +122 -94
- package/components/Inputs/TextInput.js +87 -67
- package/components/Inputs/TimeInput.js +87 -72
- package/components/Modal/ModalComp.js +2 -1
- package/components/constants/defaultStyle.js +184 -184
- package/dist/index.es.js +709 -708
- package/dist/index.js +707 -706
- package/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg id="b2bc64ed-393d-4e15-8787-df9ec8050d97" data-name="ae65933b-c6e6-4b40-868c-58201eab117d" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 21.4 24"><defs><style>.bb405ea1-9d39-4705-a069-9048c97b4cda{fill:#2e56f4;}.accb9cd8-805e-4c9f-9b46-25d8ccc4d9c0{isolation:isolate;font-size:9.07px;fill:#fff;font-family:AvertaCY-Extrabold, Averta CY;font-weight:800;letter-spacing:0.04em;}</style></defs><path class="bb405ea1-9d39-4705-a069-9048c97b4cda" d="M20.1,8.5h-.6V5.6h0c0-.2-.1-.3-.1-.4L14.6,0H2.8a.9.9,0,0,0-.9.9h0V8.5H1.3A1.3,1.3,0,0,0,0,9.8H0v7a1.3,1.3,0,0,0,1.2,1.4h.7v4.9a.9.9,0,0,0,.9.9H18.5a1,1,0,0,0,1-.8h0v-5h.6a1.3,1.3,0,0,0,1.3-1.3h0v-7a1.3,1.3,0,0,0-1.3-1.3ZM18.5,22.8H2.8V18.2H18.5Zm0-14.3H2.8V.7h11V5.6c.1.3.3.5.5.4h4.2Z"/><text class="accb9cd8-805e-4c9f-9b46-25d8ccc4d9c0" transform="translate(0.8 16.6)">FILE</text></svg>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-unused-expressions */
|
|
2
1
|
import styled from "styled-components";
|
|
3
2
|
|
|
4
3
|
export const PageContent = styled.div`
|
|
@@ -21,7 +20,7 @@ export const StyledRowSearch = styled.div`
|
|
|
21
20
|
width: 100%;
|
|
22
21
|
padding: 25px;
|
|
23
22
|
column-gap: 18px;
|
|
24
|
-
align-items:
|
|
23
|
+
align-items: center;
|
|
25
24
|
box-sizing: border-box;
|
|
26
25
|
background: linear-gradient(
|
|
27
26
|
0deg,
|
|
@@ -61,7 +60,7 @@ export const StyledRowSearch = styled.div`
|
|
|
61
60
|
|
|
62
61
|
& label {
|
|
63
62
|
font-size: 14px;
|
|
64
|
-
|
|
63
|
+
padding-bottom: 10px;
|
|
65
64
|
margin-bottom: 0;
|
|
66
65
|
}
|
|
67
66
|
|
|
@@ -118,7 +117,7 @@ export const StyledClearSearch = styled.span`
|
|
|
118
117
|
export const StyledCentralBar = styled.div`
|
|
119
118
|
display: flex;
|
|
120
119
|
flex-direction: column;
|
|
121
|
-
flex-grow: 1;
|
|
120
|
+
${'' /* flex-grow: 1; */}
|
|
122
121
|
max-width: 1340px;
|
|
123
122
|
width: 100%;
|
|
124
123
|
align-items: center;
|
|
@@ -204,8 +203,6 @@ export const ActionItem = styled.div`
|
|
|
204
203
|
|
|
205
204
|
export const FormContainer = styled.div`
|
|
206
205
|
position: relative;
|
|
207
|
-
padding: 25px;
|
|
208
|
-
z-index: 2;
|
|
209
206
|
display: flex;
|
|
210
207
|
width: 100%;
|
|
211
208
|
column-gap: 18px;
|
|
@@ -217,8 +214,7 @@ export const FormContainer = styled.div`
|
|
|
217
214
|
hsla(0, 0%, 100%, 0.5) 100%
|
|
218
215
|
);
|
|
219
216
|
border-radius: 6px;
|
|
220
|
-
|
|
221
|
-
|
|
217
|
+
|
|
222
218
|
@media (max-width: 900px) {
|
|
223
219
|
flex-wrap: wrap;
|
|
224
220
|
height: fit-content;
|
|
@@ -251,7 +247,7 @@ export const FormContainer = styled.div`
|
|
|
251
247
|
|
|
252
248
|
& label {
|
|
253
249
|
font-size: 14px;
|
|
254
|
-
|
|
250
|
+
padding-bottom: 10px;
|
|
255
251
|
margin-bottom: 0;
|
|
256
252
|
}
|
|
257
253
|
|
|
@@ -294,7 +290,7 @@ export const FormContainer = styled.div`
|
|
|
294
290
|
`;
|
|
295
291
|
|
|
296
292
|
export const FormWrapper = styled.form`
|
|
297
|
-
width:
|
|
293
|
+
width: 40vw;
|
|
298
294
|
display: flex;
|
|
299
295
|
justify-content: center;
|
|
300
296
|
flex-direction: column;
|
|
@@ -303,21 +299,20 @@ export const FormWrapper = styled.form`
|
|
|
303
299
|
|
|
304
300
|
export const SubmitButtonContainer = styled.div`
|
|
305
301
|
display: flex;
|
|
306
|
-
justify-content:
|
|
307
|
-
|
|
308
|
-
// custom styles
|
|
309
|
-
${({ style }) => style}
|
|
302
|
+
justify-content: end;
|
|
310
303
|
`;
|
|
311
304
|
|
|
312
305
|
export const MultiColumnWrapper = styled.div`
|
|
313
306
|
display: flex;
|
|
314
307
|
justify-content: center;
|
|
315
308
|
flex-direction: row;
|
|
316
|
-
|
|
309
|
+
align-items: flex-start;
|
|
317
310
|
gap: 20px;
|
|
318
311
|
`;
|
|
319
312
|
|
|
320
313
|
export const MultiColumnDiv = styled.div`
|
|
321
|
-
width:
|
|
322
|
-
|
|
314
|
+
width: 48;
|
|
315
|
+
max-width: 48%;
|
|
316
|
+
min-width: 48%;
|
|
317
|
+
|
|
323
318
|
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './StyledComponent';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './StyledComponent';
|
|
@@ -1,18 +1,31 @@
|
|
|
1
|
-
import React, { Fragment } from 'react'
|
|
2
|
-
import
|
|
3
|
-
import defaultThemeColor from '../constants/defaultThemeColor'
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
4
3
|
import { Header } from '../Header';
|
|
5
4
|
import { Label } from '../Label';
|
|
6
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
CheckBoxInput,
|
|
7
|
+
DateSelect,
|
|
8
|
+
DropdownSelect,
|
|
9
|
+
DropzoneInput,
|
|
10
|
+
NumericInput,
|
|
11
|
+
RadioInput,
|
|
12
|
+
SearchInput,
|
|
13
|
+
SignatureInput,
|
|
14
|
+
TextArea,
|
|
15
|
+
TextInput,
|
|
16
|
+
ToggleSwitch,
|
|
17
|
+
} from '../Inputs';
|
|
7
18
|
import { Rating } from '../Rating';
|
|
8
19
|
import { PrimaryButton, SecondaryButton, TinyButton } from '../Button';
|
|
9
|
-
|
|
10
|
-
|
|
20
|
+
import {
|
|
21
|
+
FormContainer,
|
|
22
|
+
FormWrapper,
|
|
23
|
+
MultiColumnWrapper,
|
|
24
|
+
MultiColumnDiv,
|
|
25
|
+
} from '../DesignComponent';
|
|
11
26
|
|
|
12
27
|
export const FormComponent = ({ formData, ...props }) => {
|
|
13
|
-
|
|
14
28
|
const header = (item) => {
|
|
15
|
-
|
|
16
29
|
return (
|
|
17
30
|
<Fragment>
|
|
18
31
|
<Header {...item} {...props}>
|
|
@@ -20,9 +33,8 @@ export const FormComponent = ({ formData, ...props }) => {
|
|
|
20
33
|
</Header>
|
|
21
34
|
{item}
|
|
22
35
|
</Fragment>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
26
38
|
|
|
27
39
|
const labelWithJSon = (item) => {
|
|
28
40
|
return (
|
|
@@ -33,222 +45,140 @@ export const FormComponent = ({ formData, ...props }) => {
|
|
|
33
45
|
customStyles={item.customStyles}
|
|
34
46
|
text={item.text}
|
|
35
47
|
{...props}
|
|
36
|
-
style={{
|
|
37
|
-
|
|
48
|
+
style={{
|
|
49
|
+
marginBottom: '7px',
|
|
50
|
+
paddingBottom: '0',
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
38
53
|
</MultiColumnDiv>
|
|
39
54
|
<MultiColumnDiv>
|
|
40
|
-
<pre>
|
|
41
|
-
{JSON.stringify(item, null, 4)}
|
|
42
|
-
</pre>
|
|
55
|
+
<pre>{JSON.stringify(item, null, 4)}</pre>
|
|
43
56
|
</MultiColumnDiv>
|
|
44
57
|
</MultiColumnWrapper>
|
|
45
58
|
</Fragment>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
59
|
+
);
|
|
60
|
+
};
|
|
48
61
|
const label = (item) => {
|
|
49
62
|
return (
|
|
50
63
|
<Label
|
|
51
|
-
|
|
64
|
+
style={{ marginBottom: '7px', paddingBottom: '0' }}
|
|
52
65
|
{...item}
|
|
53
66
|
{...props}
|
|
54
67
|
/>
|
|
55
|
-
)
|
|
56
|
-
}
|
|
68
|
+
);
|
|
69
|
+
};
|
|
57
70
|
const textInput = (item) => {
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
{...item}
|
|
61
|
-
{...props}
|
|
62
|
-
/>
|
|
63
|
-
)
|
|
64
|
-
}
|
|
71
|
+
return <TextInput {...item} {...props} />;
|
|
72
|
+
};
|
|
65
73
|
|
|
66
74
|
const textAreaInput = (item) => {
|
|
67
|
-
return
|
|
68
|
-
|
|
69
|
-
{...item}
|
|
70
|
-
{...props}
|
|
71
|
-
/>
|
|
72
|
-
)
|
|
73
|
-
}
|
|
75
|
+
return <TextArea {...item} {...props} />;
|
|
76
|
+
};
|
|
74
77
|
|
|
75
78
|
const NumberInput = (item) => {
|
|
76
|
-
return
|
|
77
|
-
|
|
78
|
-
{...item}
|
|
79
|
-
{...props}
|
|
80
|
-
/>
|
|
81
|
-
)
|
|
82
|
-
}
|
|
79
|
+
return <NumericInput {...item} {...props} />;
|
|
80
|
+
};
|
|
83
81
|
|
|
84
82
|
const radioInput = (item) => {
|
|
85
|
-
return (
|
|
86
|
-
|
|
87
|
-
key={Math.random() * 101 | 0}
|
|
88
|
-
{...item}
|
|
89
|
-
{...props}
|
|
90
|
-
/>
|
|
91
|
-
)
|
|
92
|
-
}
|
|
83
|
+
return <RadioInput key={(Math.random() * 101) | 0} {...item} {...props} />;
|
|
84
|
+
};
|
|
93
85
|
|
|
94
86
|
const checkBoxInput = (item) => {
|
|
95
|
-
return
|
|
96
|
-
|
|
97
|
-
{...item}
|
|
98
|
-
{...props}
|
|
99
|
-
/>
|
|
100
|
-
)
|
|
101
|
-
}
|
|
87
|
+
return <CheckBoxInput {...item} {...props} />;
|
|
88
|
+
};
|
|
102
89
|
|
|
103
90
|
const SingleDropdownInput = (item) => {
|
|
104
91
|
return (
|
|
105
|
-
<DropdownSelect
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
{...props}
|
|
109
|
-
/>
|
|
110
|
-
)
|
|
111
|
-
}
|
|
92
|
+
<DropdownSelect dropdownType={'singleSelect'} {...item} {...props} />
|
|
93
|
+
);
|
|
94
|
+
};
|
|
112
95
|
|
|
113
96
|
const MultiDropdownInput = (item) => {
|
|
114
|
-
return
|
|
115
|
-
|
|
116
|
-
{...item}
|
|
117
|
-
{...props}
|
|
118
|
-
/>
|
|
119
|
-
)
|
|
120
|
-
}
|
|
97
|
+
return <DropdownSelect {...item} {...props} />;
|
|
98
|
+
};
|
|
121
99
|
|
|
122
100
|
const signatureInput = (item) => {
|
|
123
|
-
return
|
|
124
|
-
|
|
125
|
-
{...item}
|
|
126
|
-
{...props}
|
|
127
|
-
/>
|
|
128
|
-
)
|
|
129
|
-
}
|
|
101
|
+
return <SignatureInput {...item} {...props} />;
|
|
102
|
+
};
|
|
130
103
|
|
|
131
104
|
const fileUploadInput = (item) => {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
<DropzoneInput
|
|
135
|
-
{...item}
|
|
136
|
-
{...props} />
|
|
137
|
-
)
|
|
138
|
-
}
|
|
105
|
+
return <DropzoneInput {...item} {...props} />;
|
|
106
|
+
};
|
|
139
107
|
|
|
140
108
|
const dateInput = (item) => {
|
|
141
|
-
return
|
|
142
|
-
|
|
143
|
-
{...item}
|
|
144
|
-
{...props} />
|
|
145
|
-
)
|
|
146
|
-
}
|
|
109
|
+
return <DateSelect {...item} {...props} />;
|
|
110
|
+
};
|
|
147
111
|
|
|
148
112
|
const toggleSwitch = (item) => {
|
|
149
|
-
return
|
|
150
|
-
|
|
151
|
-
{...item}
|
|
152
|
-
{...props}
|
|
153
|
-
/>
|
|
154
|
-
)
|
|
155
|
-
}
|
|
113
|
+
return <ToggleSwitch {...item} {...props} />;
|
|
114
|
+
};
|
|
156
115
|
|
|
157
116
|
const ratingInput = (item) => {
|
|
158
|
-
return
|
|
159
|
-
|
|
160
|
-
{...item}
|
|
161
|
-
{...props}
|
|
162
|
-
/>
|
|
163
|
-
)
|
|
164
|
-
}
|
|
117
|
+
return <Rating {...item} {...props} />;
|
|
118
|
+
};
|
|
165
119
|
|
|
166
120
|
const primaryButton = (item) => {
|
|
167
|
-
return
|
|
168
|
-
|
|
169
|
-
{...item}
|
|
170
|
-
{...props}
|
|
171
|
-
/>
|
|
172
|
-
)
|
|
173
|
-
}
|
|
121
|
+
return <PrimaryButton {...item} {...props} />;
|
|
122
|
+
};
|
|
174
123
|
|
|
175
124
|
const secondaryButton = (item) => {
|
|
176
|
-
return
|
|
177
|
-
|
|
178
|
-
{...item}
|
|
179
|
-
{...props}
|
|
180
|
-
/>
|
|
181
|
-
)
|
|
182
|
-
}
|
|
125
|
+
return <SecondaryButton {...item} {...props} />;
|
|
126
|
+
};
|
|
183
127
|
|
|
184
128
|
const tinyButton = (item) => {
|
|
185
|
-
return
|
|
186
|
-
|
|
187
|
-
{...item}
|
|
188
|
-
{...props}
|
|
189
|
-
/>
|
|
190
|
-
)
|
|
191
|
-
}
|
|
129
|
+
return <TinyButton {...item} {...props} />;
|
|
130
|
+
};
|
|
192
131
|
|
|
193
132
|
const searchInput = (item) => {
|
|
194
|
-
return
|
|
195
|
-
|
|
196
|
-
{...item}
|
|
197
|
-
{...props}
|
|
198
|
-
/>
|
|
199
|
-
)
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
|
|
133
|
+
return <SearchInput {...item} {...props} />;
|
|
134
|
+
};
|
|
203
135
|
|
|
204
136
|
const handleSubmit = () => {
|
|
205
|
-
console.log(
|
|
206
|
-
}
|
|
137
|
+
console.log('form submit');
|
|
138
|
+
};
|
|
207
139
|
|
|
208
140
|
const returnComponent = (item) => {
|
|
209
141
|
switch (item.type) {
|
|
210
|
-
case
|
|
211
|
-
return header(item)
|
|
212
|
-
case
|
|
213
|
-
return label(item)
|
|
214
|
-
case
|
|
215
|
-
return textInput(item)
|
|
216
|
-
case
|
|
217
|
-
return textAreaInput(item)
|
|
218
|
-
case
|
|
219
|
-
return NumberInput(item)
|
|
220
|
-
case
|
|
221
|
-
return radioInput(item)
|
|
222
|
-
case
|
|
223
|
-
return checkBoxInput(item)
|
|
224
|
-
case
|
|
225
|
-
return SingleDropdownInput(item)
|
|
226
|
-
case
|
|
227
|
-
return MultiDropdownInput(item)
|
|
228
|
-
case
|
|
229
|
-
return signatureInput(item)
|
|
230
|
-
case
|
|
231
|
-
return fileUploadInput(item)
|
|
232
|
-
case
|
|
233
|
-
return dateInput(item)
|
|
234
|
-
case
|
|
235
|
-
return toggleSwitch(item)
|
|
236
|
-
case
|
|
237
|
-
return ratingInput(item)
|
|
238
|
-
case
|
|
239
|
-
return primaryButton(item)
|
|
240
|
-
case
|
|
241
|
-
return secondaryButton(item)
|
|
242
|
-
case
|
|
243
|
-
return tinyButton(item)
|
|
244
|
-
case
|
|
245
|
-
return searchInput(item)
|
|
142
|
+
case 'header':
|
|
143
|
+
return header(item);
|
|
144
|
+
case 'label':
|
|
145
|
+
return label(item);
|
|
146
|
+
case 'text':
|
|
147
|
+
return textInput(item);
|
|
148
|
+
case 'textArea':
|
|
149
|
+
return textAreaInput(item);
|
|
150
|
+
case 'number':
|
|
151
|
+
return NumberInput(item);
|
|
152
|
+
case 'radio':
|
|
153
|
+
return radioInput(item);
|
|
154
|
+
case 'checkBox':
|
|
155
|
+
return checkBoxInput(item);
|
|
156
|
+
case 'singleSelect':
|
|
157
|
+
return SingleDropdownInput(item);
|
|
158
|
+
case 'multiSelect':
|
|
159
|
+
return MultiDropdownInput(item);
|
|
160
|
+
case 'signature':
|
|
161
|
+
return signatureInput(item);
|
|
162
|
+
case 'fileUpload':
|
|
163
|
+
return fileUploadInput(item);
|
|
164
|
+
case 'date':
|
|
165
|
+
return dateInput(item);
|
|
166
|
+
case 'toggle':
|
|
167
|
+
return toggleSwitch(item);
|
|
168
|
+
case 'rating':
|
|
169
|
+
return ratingInput(item);
|
|
170
|
+
case 'buttonPrimary':
|
|
171
|
+
return primaryButton(item);
|
|
172
|
+
case 'buttonSecondary':
|
|
173
|
+
return secondaryButton(item);
|
|
174
|
+
case 'buttonTiny':
|
|
175
|
+
return tinyButton(item);
|
|
176
|
+
case 'search':
|
|
177
|
+
return searchInput(item);
|
|
246
178
|
default:
|
|
247
179
|
break;
|
|
248
180
|
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
|
|
181
|
+
};
|
|
252
182
|
|
|
253
183
|
return (
|
|
254
184
|
<Fragment>
|
|
@@ -256,21 +186,23 @@ export const FormComponent = ({ formData, ...props }) => {
|
|
|
256
186
|
<FormWrapper onSubmit={handleSubmit}>
|
|
257
187
|
{formData.map((row, i) => {
|
|
258
188
|
if (row.length > 1) {
|
|
259
|
-
return
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
189
|
+
return (
|
|
190
|
+
<MultiColumnWrapper>
|
|
191
|
+
{row.map((item, j) => {
|
|
192
|
+
return (
|
|
193
|
+
<MultiColumnDiv cols={row.length}>
|
|
194
|
+
{returnComponent(item)}
|
|
195
|
+
</MultiColumnDiv>
|
|
196
|
+
);
|
|
197
|
+
})}
|
|
198
|
+
</MultiColumnWrapper>
|
|
199
|
+
);
|
|
266
200
|
} else {
|
|
267
201
|
return returnComponent(row[0]);
|
|
268
202
|
}
|
|
269
203
|
})}
|
|
270
|
-
|
|
271
204
|
</FormWrapper>
|
|
272
205
|
</FormContainer>
|
|
273
206
|
</Fragment>
|
|
274
|
-
)
|
|
275
|
-
}
|
|
276
|
-
|
|
207
|
+
);
|
|
208
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Fragment, useState } from 'react'
|
|
2
2
|
import { PrimaryButton, SecondaryButton } from '../Button';
|
|
3
|
-
import { SubmitButtonContainer } from '
|
|
3
|
+
import { SubmitButtonContainer } from '../DesignComponent';
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
export const SubmitComponent = ({ formData, onSubmit, onReset, style, ...props }) => {
|
package/components/Form/index.js
CHANGED
package/components/Icon/Icon.js
CHANGED
|
@@ -48,6 +48,7 @@ import watcher from '../../assets/icons/watcher.svg'
|
|
|
48
48
|
import fileUpload from '../../assets/icons/file-upload.svg'
|
|
49
49
|
import eyeHide from '../../assets/icons/eye-hide.svg'
|
|
50
50
|
import eyeView from '../../assets/icons/eye-hide-view.svg'
|
|
51
|
+
import fileIcon from '../../assets/icons/file-icon.svg'
|
|
51
52
|
|
|
52
53
|
|
|
53
54
|
/** icon name should be kebab-case, e.g "plus-outline" */
|
|
@@ -94,7 +95,8 @@ const iconObj = {
|
|
|
94
95
|
'user-icon': user,
|
|
95
96
|
'file-upload': fileUpload,
|
|
96
97
|
'eye-hide': eyeHide,
|
|
97
|
-
'eye-show': eyeView
|
|
98
|
+
'eye-show': eyeView,
|
|
99
|
+
'file-icon': fileIcon,
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
const StyledSVGIcon = styled(ReactSVG)`
|
|
@@ -135,6 +137,7 @@ const StyledSVGIcon = styled(ReactSVG)`
|
|
|
135
137
|
outline: none;
|
|
136
138
|
border:none;
|
|
137
139
|
}
|
|
140
|
+
vertical-align: initial;
|
|
138
141
|
}
|
|
139
142
|
`;
|
|
140
143
|
|
|
@@ -5,10 +5,13 @@ import defaultThemeColor from '../constants/defaultThemeColor';
|
|
|
5
5
|
import defaultStyles from '../constants/defaultStyle';
|
|
6
6
|
import getDefaultStyles from '../constants/utils';
|
|
7
7
|
import { Label } from '../Label';
|
|
8
|
-
import tick from '../../assets/icons/checkmark.svg';
|
|
9
|
-
|
|
8
|
+
// import tick from '../../assets/icons/checkmark.svg';
|
|
9
|
+
import { Icon } from '../Icon'
|
|
10
10
|
|
|
11
11
|
const CheckBoxOuter = styled.div`
|
|
12
|
+
|
|
13
|
+
box-sizing:initial;
|
|
14
|
+
|
|
12
15
|
//Set the styles from the default styles object
|
|
13
16
|
${({ theme, defaultCheckBoxOuterStyle }) => {
|
|
14
17
|
return getDefaultStyles(theme, defaultCheckBoxOuterStyle);
|
|
@@ -21,22 +24,27 @@ const CheckBoxOuter = styled.div`
|
|
|
21
24
|
`;
|
|
22
25
|
|
|
23
26
|
const CheckBoxInner = styled.div`
|
|
27
|
+
|
|
28
|
+
box-sizing:initial;
|
|
29
|
+
|
|
24
30
|
//Set the styles from the default styles object
|
|
25
31
|
${({ theme, defaultCheckBoxInnerStyle }) => {
|
|
26
32
|
return getDefaultStyles(theme, defaultCheckBoxInnerStyle);
|
|
27
33
|
}}
|
|
28
34
|
|
|
29
|
-
background-image: url(${({ signCheck }) => signCheck});
|
|
35
|
+
// background-image: url(${({ signCheck }) => signCheck});
|
|
30
36
|
background-color: ${({ checked, checkedCheckBoxColor }) => checked ? checkedCheckBoxColor : defaultThemeColor.bgColor};
|
|
31
37
|
border: 2px solid ${({ checkedCheckBoxColor, defaultBorderColor, checked }) => checked ? checkedCheckBoxColor : defaultBorderColor};
|
|
32
|
-
|
|
38
|
+
display: flex;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
align-items: center;
|
|
33
41
|
// custom styles
|
|
34
42
|
${({ checkBoxInnerStyle }) => checkBoxInnerStyle}
|
|
35
43
|
|
|
36
44
|
`;
|
|
37
45
|
CheckBoxInner.defaultProps = {
|
|
38
46
|
themeColor: defaultThemeColor,
|
|
39
|
-
signCheck: `${tick}`
|
|
47
|
+
// signCheck: `${tick}`
|
|
40
48
|
}
|
|
41
49
|
|
|
42
50
|
const OptionText = styled.span`
|
|
@@ -104,7 +112,9 @@ export const CheckBoxInput = ({ checkBoxOuterStyle, checkBoxInnerStyle, optionTe
|
|
|
104
112
|
checkBoxInnerStyle={{ ...checkBoxInnerStyle, cursor: item?.disabled ? 'not-allowed ' : ' pointer', borderColor: item?.disabled && item?.disabledColor }}
|
|
105
113
|
defaultBorderColor={defaultBorderColor}
|
|
106
114
|
checkedCheckBoxColor={checkedCheckBoxColor}
|
|
107
|
-
checked={!item?.disabled && item.checked} {...props}
|
|
115
|
+
checked={!item?.disabled && item.checked} {...props} >
|
|
116
|
+
<Icon icon='check-icon' size={18} color='white' />
|
|
117
|
+
</CheckBoxInner>
|
|
108
118
|
: <CheckBoxOuter
|
|
109
119
|
theme={defaultStyles}
|
|
110
120
|
defaultCheckBoxOuterStyle={'checkBox-outer'}
|
|
@@ -191,5 +201,4 @@ CheckBoxInput.defaultProps = {
|
|
|
191
201
|
checkedTextColor: `${defaultThemeColor.neutral['neutral-1']}`,
|
|
192
202
|
defaultBorderColor: '#D4D7E3',
|
|
193
203
|
checkedCheckBoxColor: `${defaultThemeColor.primary['primary-1']}`,
|
|
194
|
-
}
|
|
195
|
-
|
|
204
|
+
}
|