groundfloor-react-ui 1.0.0 → 1.0.3

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.
Files changed (34) hide show
  1. package/README.md +9 -2
  2. package/assets/icons/eye-hide.svg +1 -1
  3. package/assets/icons/file-upload.svg +3 -0
  4. package/components/Accordion/Accordion.js +2 -2
  5. package/components/Button/PrimaryButton.js +4 -7
  6. package/components/Button/SecondaryButton.js +7 -8
  7. package/components/Footer/{FooterContentLev3.js → FooterContent.js} +6 -2
  8. package/components/Footer/index.js +1 -1
  9. package/components/Form/FormComponent.js +5 -2
  10. package/components/Form/HeaderComponent.js +1 -6
  11. package/components/Icon/Icon.js +16 -6
  12. package/components/Inputs/CheckBoxInput.js +1 -1
  13. package/components/Inputs/DateSelect.js +3 -4
  14. package/components/Inputs/DropdownSelect.js +292 -289
  15. package/components/Inputs/DropzoneInput.js +225 -137
  16. package/components/Inputs/NumericInput.js +6 -11
  17. package/components/Inputs/PasswordInput.js +192 -0
  18. package/components/Inputs/Signature.js +142 -109
  19. package/components/Inputs/TextArea.js +3 -4
  20. package/components/Inputs/TextInput.js +6 -7
  21. package/components/Inputs/TimeInput.js +5 -6
  22. package/components/Inputs/index.js +1 -0
  23. package/components/Modal/ModalComp.js +80 -46
  24. package/components/Modal/index.js +0 -1
  25. package/components/constants/defaultStyle.js +28 -33
  26. package/components/constants/defaultThemeColor.js +2 -1
  27. package/dist/index.es.js +538 -493
  28. package/dist/index.js +388 -343
  29. package/package.json +1 -1
  30. package/components/Inputs/CheckBoxEditableInput.js +0 -352
  31. package/components/Inputs/CheckBoxInputMS.js +0 -160
  32. package/components/Inputs/TextInputClicable.js +0 -198
  33. package/components/Inputs/TextInputClicableMS.js +0 -255
  34. package/components/Modal/Modal.js +0 -116
@@ -57,7 +57,7 @@ const Wrapper = styled.div`
57
57
  .master-dropdown__control,
58
58
  .new-select__control {
59
59
  border:${({ isValid, }) => !isValid ? '0.5px solid ' + defaultThemeColor.ui['error'] :
60
- '0.5px solid ' + defaultThemeColor.neutral['neutral-4']};
60
+ '0.5px solid ' + defaultThemeColor.neutral['neutral-4']};
61
61
  }
62
62
 
63
63
  .master-dropdown__option,
@@ -102,7 +102,6 @@ const Wrapper = styled.div`
102
102
  .default-select {
103
103
  .default-select__control {
104
104
  height: 39px;
105
- // max-height: 39px;
106
105
  }
107
106
 
108
107
  .default-select__value-container--has-value {
@@ -139,26 +138,23 @@ const Wrapper = styled.div`
139
138
  .css-mohuvp-dummyInput-DummyInput{
140
139
  height:0px;
141
140
  }
142
- .css-14el2xx-placeholder{
143
- font-size: ${({ placeholderSize }) => placeholderSize + 'px'};
144
- }
141
+
145
142
  .css-6j8wv5-Input{
146
143
  margin:0px;
147
144
  padding-top:0px;
148
145
  }
149
- .custom-loader{
150
- animation: loader 3s;
151
-
152
- }
153
- @keyframes loader {
154
- 50% {transform: rotate(0deg);}
155
- 100% {transform: rotate(360deg);}
156
- }
157
-
158
146
  .new-select__menu {
159
147
  z-Index: 2;
160
148
  }
161
-
149
+
150
+ .new-select__input-container{
151
+ margin:0px;
152
+ padding:0px;
153
+ }
154
+ .new-select__input{
155
+ margin:0px;
156
+ padding:0px;
157
+ }
162
158
  `
163
159
 
164
160
 
@@ -170,8 +166,8 @@ const LabelWrapper = styled.div`
170
166
 
171
167
  //Set the styles from the default styles object
172
168
  ${({ theme, labelWrapperStyle }) => {
173
- return getDefaultStyles(theme, labelWrapperStyle);
174
- }}
169
+ return getDefaultStyles(theme, labelWrapperStyle);
170
+ }}
175
171
  // custom styles
176
172
  ${({ customLabelStyles }) => customLabelStyles}
177
173
  `
@@ -181,286 +177,293 @@ const IconDiv = styled.div`
181
177
  cursor:pointer;
182
178
  `;
183
179
 
184
-
185
180
  export const DropdownSelect = ({ customWrapperStyles, customLabelStyles, labelStyle, label, isRequired, optionArr, selectedValue, setSelectedValue, placeHolder, dropdownType, isDisabled, isValid, clearSelected, isClearSelected, isLoading, height, placeholderSize, ...props }) => {
186
- const DropdownIndicator = p => {
187
- return (
188
- <components.DropdownIndicator {...p}>
189
- {isClearSelected == true ?
190
- <IconDiv onClick={() => { clearSelected() }}>
191
- <Icon icon='cross-icon'
192
- color={'black'}
193
- size={8} />
194
- </IconDiv>
195
- : null}
196
- <IconDiv>
197
- <Icon icon='triangle-down'
198
- color={'black'}
199
- size={8} />
200
- </IconDiv>
201
- </components.DropdownIndicator>
202
- );
203
- };
204
-
205
- // const LoadingIndicator = (LoadingIndicatorProps) => {
206
- // return (
207
- // <div className='custom-loader'>
208
- // <Icon icon='arrow-rotate' color='black' />
209
- // </div>
210
- // );
211
- // };
212
-
213
- const Option = p => {
214
- const checkboxStyle = {
215
- width: '15px',
216
- height: '15px',
217
- borderRadius: '2px',
218
- padding: '3px 4px',
219
- fontSize: '8px',
220
- lineHeight: '10px',
221
- };
222
- const checked = (
223
- <div style={{ ...checkboxStyle, backgroundColor: p?.data?.color ?? '#2E56F4' }}>
224
- <Icon icon='check-icon' color='white' />
225
- </div>
226
- )
227
- const unchecked = (
228
- <div style={{ ...checkboxStyle, backgroundColor: '#e0e7ff' }} ></div>
229
- )
230
- return (
231
- <components.Option {...p}>
232
- <div style={{ display: 'flex', justifyContent: 'start', alignItems: 'center', width: '100%' }}>
233
- {p.isSelected ? checked : unchecked}
234
- <div className='text-main-alt' style={{ marginLeft: '10px' }}>
235
- {p.label}
236
- </div>
237
- </div>
238
- </components.Option>
239
- );
181
+ const DropdownIndicator = p => {
182
+ return (
183
+ <components.DropdownIndicator {...p}>
184
+ {isClearSelected == true ?
185
+ <IconDiv onClick={() => { clearSelected() }}>
186
+ <Icon icon='cross-icon'
187
+ color={'black'}
188
+ size={8} />
189
+ </IconDiv>
190
+ : null}
191
+ <IconDiv>
192
+ <Icon icon='triangle-down'
193
+ color={'black'}
194
+ size={8} />
195
+ </IconDiv>
196
+ </components.DropdownIndicator>
197
+ );
198
+ };
199
+
200
+ // const LoadingIndicator = (LoadingIndicatorProps) => {
201
+ // return (
202
+ // <div className='custom-loader'>
203
+ // <Icon icon='arrow-rotate' color='black' />
204
+ // </div>
205
+ // );
206
+ // };
207
+
208
+ const Option = p => {
209
+ const checkboxStyle = {
210
+ width: '15px',
211
+ height: '15px',
212
+ borderRadius: '2px',
213
+ padding: '4px',
214
+ fontSize: '8px',
215
+ lineHeight: '10px',
240
216
  };
241
-
242
- // const ValueContainer = p => {
243
- // if (props.value.length < 1) {
244
- // return (
245
- // <components.ValueContainer {...p}>
246
- // {p.children}
247
- // </components.ValueContainer>
248
- // );
249
- // }
250
- // let firstSelected = props.value[0].label;
251
- // let moreComp = (
252
- // <div className='ml-auto'>
253
- // &amp; {props.value.length - 1} more
254
- // </div>
255
- // )
256
- // return (
257
- // <components.ValueContainer {...p}>
258
- // <div className="d-flex w-100">
259
- // <div>
260
- // {firstSelected}
261
- // </div>
262
- // {props.value.length > 1 && moreComp}
263
- // </div>
264
- // </components.ValueContainer>
265
- // );
266
- // };
267
-
268
- const MultiValue = ({ getValue, index, ...p }) => {
269
- const firstSelected = p?.data?.label || 'Select';
270
- const len = getValue().length
271
- return !index && (
272
- <div className='multiValue-wrapper'>
273
- <div className='text-main-alt'>
274
- {firstSelected}
275
- </div>
276
- {len > 1 && <div className={`text-more-alt`}>
277
- &amp; {len - 1} more
278
- </div>}
279
- </div>
280
- )
281
- }
282
-
283
-
284
-
285
- const stylesComp = {
286
-
287
- control: base => ({
288
- ...base,
289
- border: '1px solid #d4d7e3',
290
- height: `${height}px`,
291
- minHeight: `${height}px`,
292
- minWidth: '226px',
293
- }),
294
- dropdownIndicator: base => ({
295
- ...base,
296
- height: `${height}px`,
297
- display: 'flex',
298
- justifyContent: 'center',
299
- alignItems: 'center',
300
- }),
301
- valueContainer: base => ({
302
- ...base,
303
- height: `${height}px`,
304
- padding: '4px 8px'
305
- }),
306
- indicatorsContainer: base => ({
307
- ...base,
308
- padding: 0,
309
- height: `${height}px`,
310
- }),
311
- menu: base => ({
312
- ...base,
313
- border: 'none',
314
- marginTop: '1px',
315
- borderTopRightRadius: '0px',
316
- borderTopLeftRadius: '0px',
317
- outline: 'none',
318
- boxShadow: '0px 6px 20px rgba(56, 66, 100, 0.15)',
319
- borderRadius: '4.32px',
320
- fontSize: '14px'
321
-
322
- }),
323
- singleValue: base => ({
324
- ...base,
325
- fontSize: '14px',
326
- }),
327
- input: base => ({
328
- ...base,
329
- fontSize: '14px',
330
- }),
331
- option: (provided, state) => ({
332
- ...provided,
333
- backgroundColor: state.isSelected ? '#F0F3F8' : 'white',
334
- padding: '10px',
335
- cursor: 'pointer',
336
- color: '#081348'
337
- }),
338
- ...props.styles,
339
- }
217
+ const checked = (
218
+ <div style={{ ...checkboxStyle, backgroundColor: p?.data?.color ?? '#2E56F4' }}>
219
+ <Icon icon='check-icon' color='white' />
220
+ </div>
221
+ )
222
+ const unchecked = (
223
+ <div style={{ ...checkboxStyle, backgroundColor: '#e0e7ff' }} ></div>
224
+ )
340
225
  return (
341
- <Wrapper style={customWrapperStyles} isValid={isValid} placeholderSize={placeholderSize}
342
- >
343
- {label && <LabelWrapper theme={defaultStyles}
344
- labelWrapperStyle={'selectComp-label-wrapper'} style={customLabelStyles}>
345
- <Label
346
- themeColor={defaultThemeColor}
347
- customStyles={labelStyle}
348
- type={'label-text'}
349
- text={label}
350
- style={{ marginBottom: '10px' }}
351
- />
352
- {isRequired && <div style={{
353
- marginLeft: '4px',
354
- color: `${defaultThemeColor.ui['error']}`
355
- }} >*</div>}
356
- </LabelWrapper>}
357
- {dropdownType === 'singleSelect' ?
358
- <Select
359
- components={{
360
- DropdownIndicator,
361
- // LoadingIndicator,
362
- IndicatorSeparator: () => null,
363
- ClearIndicator: () => null
364
- }}
365
- className="select-manage-page"
366
- // className="new-select"
367
- classNamePrefix="new-select"
368
- name={"select-dropdown mb-1"}
369
- options={optionArr}
370
- placeholder={placeHolder}
371
- isDisabled={isDisabled}
372
- value={{
373
- value: selectedValue ? selectedValue.value : '',
374
- label: selectedValue ? selectedValue.label : ''
375
- }}
376
- styles={stylesComp}
377
- onChange={setSelectedValue}
378
- isLoading={isLoading}
379
- {...props}
380
- />
381
- :
382
- <Select
383
- components={{
384
- DropdownIndicator,
385
- MultiValue,
386
- Option,
387
- // LoadingIndicator: () => null,
388
- IndicatorSeparator: () => null,
389
- ClearIndicator: () => null
390
- }}
391
- className="select-manage-page"
392
- classNamePrefix="new-select"
393
- name={"select-dropdown mb-1"}
394
- onChange={setSelectedValue}
395
- placeholder={placeHolder}
396
- value={selectedValue}
397
- options={optionArr}
398
- styles={stylesComp}
399
- isMulti={true}
400
- isDisabled={isDisabled}
401
- isClearable={props.isClearable}
402
- hideSelectedOptions={false}
403
- closeMenuOnSelect={false}
404
- onMenuClose={props.onMenuClose}
405
- isSearchable={false}
406
- isLoading={isLoading}
407
-
408
- {...props}
409
- />
410
- }
411
- </Wrapper>
226
+ <components.Option {...p}>
227
+ <div style={{ display: 'flex', justifyContent: 'start', alignItems: 'center', width: '100%' }}>
228
+ {p.isSelected ? checked : unchecked}
229
+ <div className='text-main-alt' style={{ marginLeft: '10px' }}>
230
+ {p.label}
231
+ </div>
232
+ </div>
233
+ </components.Option>
234
+ );
235
+ };
236
+
237
+ // const ValueContainer = p => {
238
+ // if (props.value.length < 1) {
239
+ // return (
240
+ // <components.ValueContainer {...p}>
241
+ // {p.children}
242
+ // </components.ValueContainer>
243
+ // );
244
+ // }
245
+ // let firstSelected = props.value[0].label;
246
+ // let moreComp = (
247
+ // <div className='ml-auto'>
248
+ // &amp; {props.value.length - 1} more
249
+ // </div>
250
+ // )
251
+ // return (
252
+ // <components.ValueContainer {...p}>
253
+ // <div className="d-flex w-100">
254
+ // <div>
255
+ // {firstSelected}
256
+ // </div>
257
+ // {props.value.length > 1 && moreComp}
258
+ // </div>
259
+ // </components.ValueContainer>
260
+ // );
261
+ // };
262
+
263
+ const MultiValue = ({ getValue, index, ...p }) => {
264
+ const firstSelected = p?.data?.label || 'Select';
265
+ const len = getValue().length
266
+ return !index && (
267
+ <div className='multiValue-wrapper'>
268
+ <div className='text-main-alt'>
269
+ {firstSelected}
270
+ </div>
271
+ {len > 1 && <div className={`text-more-alt`}>
272
+ &amp; {len - 1} more
273
+ </div>}
274
+ </div>
412
275
  )
276
+ }
277
+
278
+
279
+
280
+ const stylesComp = {
281
+
282
+ control: base => ({
283
+ ...base,
284
+ border: '1px solid #d4d7e3',
285
+ height: `${height}px`,
286
+ minHeight: `${height}px`,
287
+ minWidth: '226px',
288
+ }),
289
+ placeholder: base => ({
290
+ ...base,
291
+ fontSize: placeholderSize + 'px',
292
+ marginLeft: '0px'
293
+ }),
294
+ dropdownIndicator: base => ({
295
+ ...base,
296
+ height: `${height}px`,
297
+ display: 'flex',
298
+ justifyContent: 'center',
299
+ alignItems: 'center',
300
+ }),
301
+ valueContainer: base => ({
302
+ ...base,
303
+ height: `${height}px`,
304
+ padding: '7px 8px'
305
+ }),
306
+ indicatorsContainer: base => ({
307
+ ...base,
308
+ padding: 0,
309
+ height: `${height}px`,
310
+ }),
311
+ menu: base => ({
312
+ ...base,
313
+ border: 'none',
314
+ marginTop: '1px',
315
+ borderTopRightRadius: '0px',
316
+ borderTopLeftRadius: '0px',
317
+ outline: 'none',
318
+ boxShadow: '0px 6px 20px rgba(56, 66, 100, 0.15)',
319
+ borderRadius: '4.32px',
320
+ fontSize: '14px'
321
+
322
+ }),
323
+ singleValue: base => ({
324
+ ...base,
325
+ fontSize: '14px',
326
+ marginLeft: '0px'
327
+ }),
328
+ input: base => ({
329
+ ...base,
330
+ fontSize: '14px',
331
+ }),
332
+ option: (provided, state) => ({
333
+ ...provided,
334
+ backgroundColor: state.isSelected || state.isFocused ? '#F0F3F8' : 'white',
335
+ padding: '10px',
336
+ cursor: 'pointer',
337
+ color: '#081348'
338
+ }),
339
+ ...props.styles,
340
+ }
341
+ return (
342
+ <Wrapper style={customWrapperStyles} isValid={isValid} placeholderSize={placeholderSize}
343
+ >
344
+
345
+ {label && <LabelWrapper theme={defaultStyles}
346
+ labelWrapperStyle={'selectComp-label-wrapper'} style={customLabelStyles}>
347
+ <Label
348
+ themeColor={defaultThemeColor}
349
+ customStyles={labelStyle}
350
+ type={'label-text'}
351
+ text={label}
352
+ style={{ marginBottom: '7px' }}
353
+ />
354
+ {isRequired && <div style={{
355
+ marginLeft: '4px',
356
+ color: `${defaultThemeColor.ui['error']}`
357
+ }} >*</div>}
358
+ </LabelWrapper>}
359
+ {dropdownType === 'multiSelect' ?
360
+
361
+ <Select
362
+ components={{
363
+ DropdownIndicator,
364
+ MultiValue,
365
+ Option,
366
+ // LoadingIndicator: () => null,
367
+ IndicatorSeparator: () => null,
368
+ ClearIndicator: () => null
369
+ }}
370
+ className="select-manage-page"
371
+ classNamePrefix="new-select"
372
+ name={"select-dropdown mb-1"}
373
+ onChange={setSelectedValue}
374
+ placeholder={placeHolder}
375
+ value={selectedValue}
376
+ options={optionArr}
377
+ styles={stylesComp}
378
+ isMulti={true}
379
+ isDisabled={isDisabled}
380
+ isClearable={props.isClearable}
381
+ hideSelectedOptions={false}
382
+ closeMenuOnSelect={false}
383
+ onMenuClose={props.onMenuClose}
384
+ isSearchable={false}
385
+ isLoading={isLoading}
386
+
387
+ {...props}
388
+ /> :
389
+ <Select
390
+ components={{
391
+ DropdownIndicator,
392
+ // LoadingIndicator,
393
+ IndicatorSeparator: () => null,
394
+ ClearIndicator: () => null
395
+ }}
396
+ className="select-manage-page"
397
+ // className="new-select"
398
+ classNamePrefix="new-select"
399
+ name={"select-dropdown"}
400
+ options={optionArr}
401
+ placeholder={placeHolder}
402
+ isDisabled={isDisabled}
403
+ value={{
404
+ value: selectedValue ? selectedValue.value : '',
405
+ label: selectedValue ? selectedValue.label : ''
406
+ }}
407
+ styles={stylesComp}
408
+ onChange={setSelectedValue}
409
+ isLoading={isLoading}
410
+ {...props}
411
+ />
412
+
413
+
414
+ }
415
+ </Wrapper>
416
+ )
413
417
  }
414
418
 
415
419
  DropdownSelect.propTypes = {
416
- /**
417
- * Label of SelectBox
418
- */
419
- label: PropTypes.string,
420
- /**
421
- * Label Style of SelectBox
422
- */
423
- labelStyle: PropTypes.object,
424
- /**
425
- * SelectBox Options
426
- */
427
- optionArr: PropTypes.array,
428
- /**
429
- * SelectBox Selected value. This is a array of object must be with this format:
430
- [{
431
- label:string,
432
- value:string
433
- }]
434
- */
435
- selectedValue: PropTypes.object,
436
- /**
437
- * Function to set selected value
438
- */
439
- setSelectedValue: PropTypes.func,
440
- /**
441
- * SelectBox Placeholder
442
- */
443
- placeHolder: PropTypes.string,
444
- /**
445
- * SelectBox Placeholder's font size
420
+ /**
421
+ * Label of SelectBox
422
+ */
423
+ label: PropTypes.string,
424
+ /**
425
+ * Label Style of SelectBox
426
+ */
427
+ labelStyle: PropTypes.object,
428
+ /**
429
+ * SelectBox Options
430
+ */
431
+ optionArr: PropTypes.array,
432
+ /**
433
+ * SelectBox Selected value. This is a array of object must be with this format:
434
+ [{
435
+ label:string,
436
+ value:string
437
+ }]
438
+ */
439
+ selectedValue: PropTypes.object,
440
+ /**
441
+ * Function to set selected value
442
+ */
443
+ setSelectedValue: PropTypes.func,
444
+ /**
445
+ * SelectBox Placeholder
446
+ */
447
+ placeHolder: PropTypes.string,
448
+ /**
449
+ * SelectBox Placeholder's font size
450
+ */
451
+ placeholderSize: PropTypes.number,
452
+ /**
453
+ * This Function will be called if cross button pressed
446
454
  */
447
- placeholderSize: PropTypes.number,
448
- /**
449
- * This Function will be called if cross button pressed
450
- */
451
- clearSelected: PropTypes.func,
455
+ clearSelected: PropTypes.func,
452
456
  }
453
457
 
454
458
  DropdownSelect.defaultProps = {
455
- label: '',
456
- labelStyle: {},
457
- optionArr: [],
458
- selectedValue: {},
459
- setSelectedValue: undefined,
460
- placeHolder: '',
461
- isValid: true,
462
- isClearSelected: false,
463
- height: 31,
464
- placeholderSize: 14
465
- }
466
-
459
+ label: '',
460
+ labelStyle: {},
461
+ optionArr: [],
462
+ selectedValue: {},
463
+ setSelectedValue: undefined,
464
+ placeHolder: 'Select an option',
465
+ isValid: true,
466
+ isClearSelected: false,
467
+ height: 31,
468
+ placeholderSize: 14
469
+ }