groundfloor-react-ui 1.0.2 → 1.0.5

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.
@@ -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: flex-start;
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
- // padding-bottom: 10px;
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
- // margin-bottom: 25px;
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
- // padding-bottom: 10px;
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: 100%;
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: center;
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
- {/*align-items: center;*/}
309
+ align-items: flex-start;
317
310
  gap: 20px;
318
311
  `;
319
312
 
320
313
  export const MultiColumnDiv = styled.div`
321
- width:50%;
322
- width: ${({ cols }) => { Math.floor(100 / cols) + '%' }};
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';
@@ -15,6 +15,7 @@ const StyledOutsideContainer = styled.div`
15
15
  padding:28px 30.5px 28px 30.5px;
16
16
  font-family: 'Averta', sans-serif;
17
17
  cursor: default;
18
+ width:inherit;
18
19
  ${({ footerWidth }) => {
19
20
  if (footerWidth < 650) {
20
21
  return css`
@@ -1,11 +1,11 @@
1
1
  import React, { Fragment } from 'react'
2
- import { FormContainer, FormWrapper, MultiColumnWrapper, MultiColumnDiv } from './StyledComponent';
3
2
  import defaultThemeColor from '../constants/defaultThemeColor'
4
3
  import { Header } from '../Header';
5
4
  import { Label } from '../Label';
6
5
  import { CheckBoxInput, DateSelect, DropdownSelect, DropzoneInput, NumericInput, RadioInput, SearchInput, SignatureInput, TextArea, TextInput, ToggleSwitch } from '../Inputs';
7
6
  import { Rating } from '../Rating';
8
7
  import { PrimaryButton, SecondaryButton, TinyButton } from '../Button';
8
+ import { FormContainer, FormWrapper, MultiColumnDiv, MultiColumnWrapper } from '../DesignComponent';
9
9
 
10
10
 
11
11
 
@@ -34,7 +34,7 @@ export const FormComponent = ({ formData, ...props }) => {
34
34
  text={item.text}
35
35
  {...props}
36
36
  style={{ marginBottom: '7px' }}
37
- />
37
+ />
38
38
  </MultiColumnDiv>
39
39
  <MultiColumnDiv>
40
40
  <pre>
@@ -48,7 +48,7 @@ export const FormComponent = ({ formData, ...props }) => {
48
48
  const label = (item) => {
49
49
  return (
50
50
  <Label
51
- style={{ marginBottom: '7px' }}
51
+ style={{ marginBottom: '7px' }}
52
52
  {...item}
53
53
  {...props}
54
54
  />
@@ -1,6 +1,6 @@
1
1
  import React, { Fragment, useState } from 'react'
2
2
  import { PrimaryButton, SecondaryButton } from '../Button';
3
- import { SubmitButtonContainer } from './StyledComponent';
3
+ import { SubmitButtonContainer } from '../DesignComponent';
4
4
 
5
5
 
6
6
  export const SubmitComponent = ({ formData, onSubmit, onReset, style, ...props }) => {
@@ -1,4 +1,3 @@
1
1
  export * from './FormComponent';
2
2
  export * from './HeaderComponent';
3
3
  export * from './SubmitComponent';
4
- export * from './StyledComponent';
@@ -1,20 +1,16 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import Select, { components } from 'react-select';
4
+ import Select, { components } from "react-select";
5
5
  import defaultThemeColor from '../constants/defaultThemeColor';
6
6
  import defaultStyles from '../constants/defaultStyle';
7
7
  import getDefaultStyles from '../constants/utils';
8
8
  import { Label } from '../Label';
9
- import { Icon } from '../Icon';
9
+ import { Icon } from "../Icon";
10
+ // import { LoadingIndicatorProps } from 'react-select';
10
11
 
11
12
  const Wrapper = styled.div`
12
13
 
13
-
14
-
15
-
16
-
17
-
18
14
  .master-dropdown,
19
15
  .new-select {
20
16
  .master-dropdown__menu,
@@ -60,10 +56,8 @@ const Wrapper = styled.div`
60
56
 
61
57
  .master-dropdown__control,
62
58
  .new-select__control {
63
- border:${({ isValid }) =>
64
- !isValid
65
- ? '0.5px solid ' + defaultThemeColor.ui['error']
66
- : '0.5px solid ' + defaultThemeColor.neutral['neutral-4']};
59
+ border:${({ isValid, }) => !isValid ? '0.5px solid ' + defaultThemeColor.ui['error'] :
60
+ '0.5px solid ' + defaultThemeColor.neutral['neutral-4']};
67
61
  }
68
62
 
69
63
  .master-dropdown__option,
@@ -89,10 +83,7 @@ const Wrapper = styled.div`
89
83
 
90
84
  .new-select__control:hover,
91
85
  .new-select__control--is-focused {
92
- border: ${({ isValid }) =>
93
- !isValid
94
- ? '0.5px solid ' + defaultThemeColor.ui['error']
95
- : '0.5px solid ' + defaultThemeColor.primary['primary-1']};
86
+ border: ${({ isValid, }) => !isValid ? '0.5px solid ' + defaultThemeColor.ui['error'] : '0.5px solid ' + defaultThemeColor.primary['primary-1']};
96
87
  box-shadow: none;
97
88
  }
98
89
 
@@ -155,70 +146,71 @@ const Wrapper = styled.div`
155
146
  .new-select__menu {
156
147
  z-Index: 2;
157
148
  }
158
- .css-1n10ic4-Input {
159
- margin: 0px;
160
- padding:0px
149
+
150
+ .new-select__input-container{
151
+ margin:0px;
152
+ padding:0px;
161
153
  }
162
-
163
- `;
154
+ .new-select__input{
155
+ margin:0px;
156
+ padding:0px;
157
+ }
158
+ .css-eehvce-Input{
159
+ margin:0px;
160
+ padding:0px;
161
+ line-height:1.3;
162
+ }
163
+ `
164
+
164
165
 
165
166
  const LabelWrapper = styled.div`
166
- // Default style
167
- display: flex;
167
+
168
+ // Default style
169
+ display: flex;
170
+
168
171
 
169
172
  //Set the styles from the default styles object
170
- ${({ theme, labelWrapperStyle }) => {
173
+ ${({ theme, labelWrapperStyle }) => {
171
174
  return getDefaultStyles(theme, labelWrapperStyle);
172
175
  }}
173
- // custom styles
176
+ // custom styles
174
177
  ${({ customLabelStyles }) => customLabelStyles}
175
- `;
178
+ `
176
179
  const IconDiv = styled.div`
177
- margin-left: 6px;
178
- margin-top: -14px;
179
- cursor: pointer;
180
+ margin-left: 6px;
181
+ margin-top:-14px;
182
+ cursor:pointer;
180
183
  `;
181
184
 
182
- export const DropdownSelect = ({
183
- customWrapperStyles,
184
- customLabelStyles,
185
- labelStyle,
186
- label,
187
- isRequired,
188
- optionArr,
189
- selectedValue,
190
- setSelectedValue,
191
- placeHolder,
192
- dropdownType,
193
- isDisabled,
194
- isValid,
195
- clearSelected,
196
- isClearSelected,
197
- isLoading,
198
- height,
199
- placeholderSize,
200
- ...props
201
- }) => {
202
- const DropdownIndicator = (p) => {
185
+ 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 => {
203
187
  return (
204
188
  <components.DropdownIndicator {...p}>
205
- {isClearSelected == true ? (
206
- <IconDiv
207
- onClick={() => {
208
- clearSelected();
209
- }}
210
- >
211
- <Icon icon='cross-icon' color={'black'} size={8} />
189
+ {isClearSelected == true ?
190
+ <IconDiv onClick={() => { clearSelected() }}>
191
+ <Icon icon='cross-icon'
192
+ color={'black'}
193
+ size={8} />
212
194
  </IconDiv>
213
- ) : null}
195
+ : null}
214
196
  <IconDiv>
215
- <Icon icon='triangle-down' color={'black'} size={8} />
197
+ <Icon icon='triangle-down'
198
+ color={'black'}
199
+ size={8} />
216
200
  </IconDiv>
217
201
  </components.DropdownIndicator>
218
202
  );
219
203
  };
220
204
 
221
- const Option = (p) => {
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 => {
222
214
  const checkboxStyle = {
223
215
  width: '15px',
224
216
  height: '15px',
@@ -228,28 +220,16 @@ export const DropdownSelect = ({
228
220
  lineHeight: '10px',
229
221
  };
230
222
  const checked = (
231
- <div
232
- style={{
233
- ...checkboxStyle,
234
- backgroundColor: p?.data?.color ?? '#2E56F4',
235
- }}
236
- >
223
+ <div style={{ ...checkboxStyle, backgroundColor: p?.data?.color ?? '#2E56F4' }}>
237
224
  <Icon icon='check-icon' color='white' />
238
225
  </div>
239
- );
226
+ )
240
227
  const unchecked = (
241
- <div style={{ ...checkboxStyle, backgroundColor: '#e0e7ff' }}></div>
242
- );
228
+ <div style={{ ...checkboxStyle, backgroundColor: '#e0e7ff' }} ></div>
229
+ )
243
230
  return (
244
231
  <components.Option {...p}>
245
- <div
246
- style={{
247
- display: 'flex',
248
- justifyContent: 'start',
249
- alignItems: 'center',
250
- width: '100%',
251
- }}
252
- >
232
+ <div style={{ display: 'flex', justifyContent: 'start', alignItems: 'center', width: '100%' }}>
253
233
  {p.isSelected ? checked : unchecked}
254
234
  <div className='text-main-alt' style={{ marginLeft: '10px' }}>
255
235
  {p.label}
@@ -259,52 +239,81 @@ export const DropdownSelect = ({
259
239
  );
260
240
  };
261
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
+
262
268
  const MultiValue = ({ getValue, index, ...p }) => {
263
269
  const firstSelected = p?.data?.label || 'Select';
264
- const len = getValue().length;
265
- return (
266
- !index && (
267
- <div className='multiValue-wrapper'>
268
- <div className='text-main-alt'>{firstSelected}</div>
269
- {len > 1 && (
270
- <div className={`text-more-alt`}>&amp; {len - 1} more</div>
271
- )}
270
+ const len = getValue().length
271
+ return !index && (
272
+ <div className='multiValue-wrapper'>
273
+ <div className='text-main-alt'>
274
+ {firstSelected}
272
275
  </div>
273
- )
274
- );
275
- };
276
+ {len > 1 && <div className={`text-more-alt`}>
277
+ &amp; {len - 1} more
278
+ </div>}
279
+ </div>
280
+ )
281
+ }
282
+
283
+
276
284
 
277
285
  const stylesComp = {
278
- control: (base) => ({
286
+
287
+ control: base => ({
279
288
  ...base,
280
289
  border: '1px solid #d4d7e3',
281
290
  height: `${height}px`,
282
291
  minHeight: `${height}px`,
283
292
  minWidth: '226px',
284
293
  }),
285
- placeholder: (base) => ({
294
+ placeholder: base => ({
286
295
  ...base,
287
296
  fontSize: placeholderSize + 'px',
288
- marginLeft: '0px',
297
+ marginLeft: '0px'
289
298
  }),
290
- dropdownIndicator: (base) => ({
299
+ dropdownIndicator: base => ({
291
300
  ...base,
292
301
  height: `${height}px`,
293
302
  display: 'flex',
294
303
  justifyContent: 'center',
295
304
  alignItems: 'center',
296
305
  }),
297
- valueContainer: (base) => ({
306
+ valueContainer: base => ({
298
307
  ...base,
299
308
  height: `${height}px`,
300
- padding: '7px 8px',
309
+ padding: '7px 8px'
301
310
  }),
302
- indicatorsContainer: (base) => ({
311
+ indicatorsContainer: base => ({
303
312
  ...base,
304
313
  padding: 0,
305
314
  height: `${height}px`,
306
315
  }),
307
- menu: (base) => ({
316
+ menu: base => ({
308
317
  ...base,
309
318
  border: 'none',
310
319
  marginTop: '1px',
@@ -313,92 +322,59 @@ export const DropdownSelect = ({
313
322
  outline: 'none',
314
323
  boxShadow: '0px 6px 20px rgba(56, 66, 100, 0.15)',
315
324
  borderRadius: '4.32px',
316
- fontSize: '14px',
325
+ fontSize: '14px'
326
+
317
327
  }),
318
- singleValue: (base) => ({
328
+ singleValue: base => ({
319
329
  ...base,
320
330
  fontSize: '14px',
321
- marginLeft: '0px',
331
+ marginLeft: '0px'
322
332
  }),
323
- input: (base) => ({
333
+ input: base => ({
324
334
  ...base,
325
335
  fontSize: '14px',
326
336
  }),
327
337
  option: (provided, state) => ({
328
338
  ...provided,
329
- backgroundColor:
330
- state.isSelected || state.isFocused ? '#F0F3F8' : 'white',
339
+ backgroundColor: state.isSelected || state.isFocused ? '#F0F3F8' : 'white',
331
340
  padding: '10px',
332
341
  cursor: 'pointer',
333
- color: '#081348',
342
+ color: '#081348'
334
343
  }),
335
344
  ...props.styles,
336
- };
345
+ }
337
346
  return (
338
- <Wrapper
339
- style={customWrapperStyles}
340
- isValid={isValid}
341
- placeholderSize={placeholderSize}
347
+ <Wrapper style={customWrapperStyles} isValid={isValid} placeholderSize={placeholderSize}
342
348
  >
343
- {label && (
344
- <LabelWrapper
345
- theme={defaultStyles}
346
- labelWrapperStyle={'selectComp-label-wrapper'}
347
- style={customLabelStyles}
348
- >
349
- <Label
350
- themeColor={defaultThemeColor}
351
- customStyles={labelStyle}
352
- type={'label-text'}
353
- text={label}
354
- style={{ marginBottom: '7px' }}
355
- />
356
- {isRequired && (
357
- <div
358
- style={{
359
- marginLeft: '4px',
360
- color: `${defaultThemeColor.ui['error']}`,
361
- }}
362
- >
363
- *
364
- </div>
365
- )}
366
- </LabelWrapper>
367
- )}
368
- {dropdownType === 'singleSelect' ? (
369
- <Select
370
- components={{
371
- DropdownIndicator,
372
- IndicatorSeparator: () => null,
373
- ClearIndicator: () => null,
374
- }}
375
- className='select-manage-page'
376
- classNamePrefix='new-select'
377
- name={'select-dropdown mb-1'}
378
- options={optionArr}
379
- placeholder={placeHolder}
380
- isDisabled={isDisabled}
381
- value={{
382
- value: selectedValue ? selectedValue.value : '',
383
- label: selectedValue ? selectedValue.label : '',
384
- }}
385
- styles={stylesComp}
386
- onChange={setSelectedValue}
387
- isLoading={isLoading}
388
- {...props}
349
+
350
+ {label && <LabelWrapper theme={defaultStyles}
351
+ labelWrapperStyle={'selectComp-label-wrapper'} style={customLabelStyles}>
352
+ <Label
353
+ themeColor={defaultThemeColor}
354
+ customStyles={labelStyle}
355
+ type={'label-text'}
356
+ text={label}
357
+ style={{ marginBottom: '7px' }}
389
358
  />
390
- ) : (
359
+ {isRequired && <div style={{
360
+ marginLeft: '4px',
361
+ color: `${defaultThemeColor.ui['error']}`
362
+ }} >*</div>}
363
+ </LabelWrapper>}
364
+ {dropdownType === 'multiSelect' ?
365
+
391
366
  <Select
392
367
  components={{
393
368
  DropdownIndicator,
394
369
  MultiValue,
395
370
  Option,
371
+ // LoadingIndicator: () => null,
396
372
  IndicatorSeparator: () => null,
397
- ClearIndicator: () => null,
373
+ ClearIndicator: () => null
398
374
  }}
399
- className='select-manage-page'
400
- classNamePrefix='new-select'
401
- name={'select-dropdown mb-1'}
375
+ className="select-manage-page"
376
+ classNamePrefix="new-select"
377
+ name={"select-dropdown mb-1"}
402
378
  onChange={setSelectedValue}
403
379
  placeholder={placeHolder}
404
380
  value={selectedValue}
@@ -412,12 +388,38 @@ export const DropdownSelect = ({
412
388
  onMenuClose={props.onMenuClose}
413
389
  isSearchable={false}
414
390
  isLoading={isLoading}
391
+
392
+ {...props}
393
+ /> :
394
+ <Select
395
+ components={{
396
+ DropdownIndicator,
397
+ // LoadingIndicator,
398
+ IndicatorSeparator: () => null,
399
+ ClearIndicator: () => null
400
+ }}
401
+ className="select-manage-page"
402
+ // className="new-select"
403
+ classNamePrefix="new-select"
404
+ name={"select-dropdown"}
405
+ options={optionArr}
406
+ placeholder={placeHolder}
407
+ isDisabled={isDisabled}
408
+ value={{
409
+ value: selectedValue ? selectedValue.value : '',
410
+ label: selectedValue ? selectedValue.label : ''
411
+ }}
412
+ styles={stylesComp}
413
+ onChange={setSelectedValue}
414
+ isLoading={isLoading}
415
415
  {...props}
416
416
  />
417
- )}
417
+
418
+
419
+ }
418
420
  </Wrapper>
419
- );
420
- };
421
+ )
422
+ }
421
423
 
422
424
  DropdownSelect.propTypes = {
423
425
  /**
@@ -433,12 +435,12 @@ DropdownSelect.propTypes = {
433
435
  */
434
436
  optionArr: PropTypes.array,
435
437
  /**
436
- * SelectBox Selected value. This is a array of object must be with this format:
437
- [{
438
- label:string,
439
- value:string
440
- }]
441
- */
438
+ * SelectBox Selected value. This is a array of object must be with this format:
439
+ [{
440
+ label:string,
441
+ value:string
442
+ }]
443
+ */
442
444
  selectedValue: PropTypes.object,
443
445
  /**
444
446
  * Function to set selected value
@@ -449,14 +451,14 @@ DropdownSelect.propTypes = {
449
451
  */
450
452
  placeHolder: PropTypes.string,
451
453
  /**
452
- * SelectBox Placeholder's font size
453
- */
454
+ * SelectBox Placeholder's font size
455
+ */
454
456
  placeholderSize: PropTypes.number,
455
457
  /**
456
- * This Function will be called if cross button pressed
457
- */
458
+ * This Function will be called if cross button pressed
459
+ */
458
460
  clearSelected: PropTypes.func,
459
- };
461
+ }
460
462
 
461
463
  DropdownSelect.defaultProps = {
462
464
  label: '',
@@ -468,5 +470,5 @@ DropdownSelect.defaultProps = {
468
470
  isValid: true,
469
471
  isClearSelected: false,
470
472
  height: 31,
471
- placeholderSize: 14,
472
- };
473
+ placeholderSize: 14
474
+ }
@@ -101,10 +101,8 @@ color: #494949;
101
101
  display: flex;
102
102
  justify-content: center;
103
103
  align-items: center;
104
- max-width: 514px;
105
104
  margin:20px 0px;
106
105
  font-size: 14px;
107
-
108
106
  `
109
107
 
110
108
  export const DropzoneInput = ({
@@ -306,8 +304,8 @@ export const DropzoneInput = ({
306
304
  )}
307
305
  </TextDiv>
308
306
  </ParentDiv>
309
- <AdditionalText>{additionalText}</AdditionalText>
310
- {fileArr?.map((item, i) => {
307
+ {additionalText.length > 0 && <AdditionalText>{additionalText}</AdditionalText>
308
+ } {fileArr?.map((item, i) => {
311
309
  return (
312
310
  <FileDiv
313
311
  theme={defaultStyles}