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
@@ -3,12 +3,11 @@ import PropTypes from 'prop-types';
3
3
  import styled, { css, useTheme } from 'styled-components';
4
4
  import defaultThemeColor from '../constants/defaultThemeColor';
5
5
 
6
- const border = `#D4D7E3`;
7
6
 
8
7
  const TextBox = styled.div`
9
8
  color: #A9B1B8;
10
9
  font-size: 21px;
11
- border: 1px solid ${({ theme, isValid }) => isValid ? border : theme.variant['error']};
10
+ border: 1px solid ${({ theme, isValid }) => isValid ? defaultThemeColor.border : theme.variant['error']};
12
11
  border-radius: 4px;
13
12
  padding: 5px;
14
13
  display: inline-block;
@@ -47,8 +46,8 @@ const requiredAsterisk = css`
47
46
 
48
47
  const Label = styled.label`
49
48
  display: block;
50
- margin-bottom: ${({ labelInline, errMsg }) => (labelInline && errMsg) ? '18px' : '8px'};
51
- margin-right: ${({ labelInline }) => labelInline ? '10px' : ''};
49
+ margin-bottom: ${({ labelInline, errMsg }) => (labelInline && errMsg) ? '18px' : '7px'};
50
+ margin-right: ${({ labelInline }) => labelInline ? '7px' : ''};
52
51
  color: ${({ theme }) => theme.variant['neutral-2']};
53
52
  ${({ required }) => required ? requiredAsterisk : null}
54
53
  `;
@@ -98,13 +97,13 @@ export const TimeInput = ({ label, errMsg, hour, minute, period, onChange, ...pr
98
97
  const theme = useTheme() || defaultThemeColor;
99
98
 
100
99
  function hourChange(evt) {
101
- const num = evt.currentTarget.value>12? 12: parseFloat(evt.currentTarget.value) || 0;
100
+ const num = evt.currentTarget.value > 12 ? 12 : parseFloat(evt.currentTarget.value) || 0;
102
101
  onChange({ hour: num, minute, period });
103
102
  }
104
103
 
105
104
  function minuteChange(evt) {
106
105
  console.log('minute change', evt.currentTarget.value);
107
- const num = evt.currentTarget.value>59?59: parseFloat(evt.currentTarget.value) || 0;
106
+ const num = evt.currentTarget.value > 59 ? 59 : parseFloat(evt.currentTarget.value) || 0;
108
107
  onChange({ hour, minute: num, period });
109
108
  }
110
109
 
@@ -10,4 +10,5 @@ export * from './TextArea';
10
10
  export * from './NumericInput';
11
11
  export * from './DropdownSelect';
12
12
  export * from './SearchInput';
13
+ export * from './PasswordInput'
13
14
 
@@ -1,104 +1,139 @@
1
- import React, { useState } from 'react'
2
- import Modal from "react-modal";
1
+ import React from 'react';
2
+ import Modal from 'react-modal';
3
3
  import styled from 'styled-components';
4
4
  import defaultStyles from '../constants/defaultStyle';
5
5
  import getDefaultStyles from '../constants/utils';
6
- import PropTypes from "prop-types";
6
+ import PropTypes from 'prop-types';
7
7
  import { Icon } from '../Icon';
8
+ import defaultThemeColor from '../constants/defaultThemeColor';
8
9
 
9
10
  const customStyles = {
10
11
  overlay: {
11
- zIndex: '999'
12
+ zIndex: '999999',
13
+ backgroundColor: 'rgb(0 0 0 / 30%)'
12
14
  },
13
15
  content: {
16
+ borderColor: defaultThemeColor.border,
14
17
  top: '50%',
15
18
  left: '50%',
16
19
  right: 'auto',
17
20
  bottom: 'auto',
18
21
  marginRight: '-50%',
19
- padding: '3rem 3rem 0.8rem 3rem',
22
+ padding: '0px',
20
23
  transform: 'translate(-50%, -50%)',
24
+ maxHeight: '75vh'
21
25
  },
22
26
  };
23
27
 
24
28
  const ModalClose = styled.button`
25
- //Set the styles from the default styles object
26
- ${({ theme, type }) => {
29
+ //Set the styles from the default styles object
30
+ ${({ theme, type }) => {
27
31
  return getDefaultStyles(theme, type);
28
32
  }}
29
- // custom styles
33
+ // custom styles
30
34
  ${({ customModalCloseStyle }) => customModalCloseStyle}
31
- ${'' /* background: transparent; */}
32
- `
35
+ //Set the styles from the default styles object
36
+ &:focus{
37
+ outline: none;
38
+ border: none;
39
+ }
40
+ `;
33
41
 
34
42
  const ModalHeader = styled.div`
35
- .header-title{
43
+ .header-title {
36
44
  display: flex;
37
45
  gap: 10px;
38
46
  align-items: center;
39
47
  }
40
- .header-description{
48
+ .header-description {
41
49
  margin-top: 5px;
42
50
  }
43
51
  h4 {
44
52
  margin-bottom: 0;
45
53
  }
46
54
  // custom styles
47
- ${({ customModalHeaderStyle }) => customModalHeaderStyle}
48
- `
55
+ ${({ customModalHeaderStyle }) => customModalHeaderStyle}
56
+ `;
49
57
  const ModalBody = styled.div`
50
58
  //Set the styles from the default styles object
51
- ${({ theme, type }) => {
59
+ ${({ theme, type }) => {
52
60
  return getDefaultStyles(theme, type);
53
61
  }}
54
- // custom styles
62
+ // custom styles
55
63
  ${({ customModalBodyStyle }) => customModalBodyStyle}
56
- `
64
+ `;
57
65
 
58
66
  const ModalFooter = styled.div`
59
67
  //Set the styles from the default styles object
60
- ${({ theme, type }) => {
68
+ ${({ theme, type }) => {
61
69
  return getDefaultStyles(theme, type);
62
70
  }}
63
- // custom styles
71
+ // custom styles
64
72
  ${({ customModalFooterStyle }) => customModalFooterStyle}
65
- `
66
-
67
- Modal.setAppElement("#root");
73
+ `;
68
74
 
75
+ const CommonDiv = styled.div`
76
+ padding: 2rem 3rem 0rem 3rem;
77
+ `;
69
78
 
70
- export const ModalComp = ({ modalIsOpen, toggleModal, closeOnOutsideClick, headerContent, bodyContent, footerContent, customModalCloseStyle, customModalHeaderStyle, customModalBodyStyle, customModalFooterStyle, ...props }) => {
79
+ Modal.setAppElement('#root');
71
80
 
81
+ export const ModalComp = ({
82
+ modalIsOpen,
83
+ toggleModal,
84
+ closeOnOutsideClick,
85
+ headerContent,
86
+ bodyContent,
87
+ footerContent,
88
+ customModalCloseStyle,
89
+ customModalHeaderStyle,
90
+ customModalBodyStyle,
91
+ customModalFooterStyle,
92
+ ...props
93
+ }) => {
72
94
  return (
73
95
  <Modal
74
96
  isOpen={modalIsOpen}
75
- // onAfterOpen={afterOpenModal}
76
97
  onRequestClose={closeOnOutsideClick ? toggleModal : undefined}
77
98
  style={customStyles}
78
- contentLabel="Example Modal"
99
+ contentLabel='Modal'
79
100
  {...props}
80
101
  >
81
- <ModalClose theme={defaultStyles}
82
- type={'modalComp-modal-close'} style={customModalCloseStyle} onClick={toggleModal}>
83
- <Icon icon='cross-icon' />
102
+ <ModalClose
103
+ theme={defaultStyles}
104
+ type={'modalComp-modal-close'}
105
+ style={customModalCloseStyle}
106
+ onClick={toggleModal}
107
+ >
108
+ <Icon
109
+ icon='cross-icon'
110
+ color={defaultThemeColor.neutral['neutral-2']}
111
+ size={15}
112
+ />
84
113
  </ModalClose>
85
114
 
86
115
  <ModalHeader style={customModalHeaderStyle}>
87
- {headerContent}
116
+ <CommonDiv>{headerContent}</CommonDiv>
88
117
  </ModalHeader>
89
- <ModalBody theme={defaultStyles}
90
- type={'modalComp-modal-body'} style={customModalBodyStyle}>
91
- {bodyContent}
118
+ <ModalBody
119
+ theme={defaultStyles}
120
+ type={'modalComp-modal-body'}
121
+ style={customModalBodyStyle}
122
+ >
123
+ <CommonDiv> {bodyContent}
124
+ </CommonDiv>
92
125
  </ModalBody>
93
126
 
94
- <ModalFooter theme={defaultStyles}
95
- type={'modalComp-modal-footer'} style={customModalFooterStyle}>
96
- {/* <hr /> */}
127
+ <ModalFooter
128
+ theme={defaultStyles}
129
+ type={'modalComp-modal-footer'}
130
+ style={customModalFooterStyle}
131
+ >
97
132
  {footerContent}
98
133
  </ModalFooter>
99
134
  </Modal>
100
135
  );
101
- }
136
+ };
102
137
 
103
138
  ModalComp.propTypes = {
104
139
  /**
@@ -111,7 +146,7 @@ ModalComp.propTypes = {
111
146
  toggleModal: PropTypes.func,
112
147
  /**
113
148
  * Close modal on clicking outside
114
- */
149
+ */
115
150
  closeOnOutsideClick: PropTypes.bool,
116
151
  /**
117
152
  * Modal Header Content
@@ -127,21 +162,21 @@ ModalComp.propTypes = {
127
162
  footerContent: PropTypes.any,
128
163
  /**
129
164
  * Modal Close icon custom styles
130
- */
165
+ */
131
166
  customModalCloseStyle: PropTypes.object,
132
167
  /**
133
168
  * Modal Header custom styles
134
- */
169
+ */
135
170
  customModalHeaderStyle: PropTypes.object,
136
171
  /**
137
172
  * Modal Body custom styles
138
- */
173
+ */
139
174
  customModalBodyStyle: PropTypes.object,
140
175
  /**
141
176
  * Modal Footer custom styles
142
- */
143
- customModalFooterStyle: PropTypes.object
144
- }
177
+ */
178
+ customModalFooterStyle: PropTypes.object,
179
+ };
145
180
 
146
181
  ModalComp.defaultProps = {
147
182
  modalIsOpen: false,
@@ -153,6 +188,5 @@ ModalComp.defaultProps = {
153
188
  customModalCloseStyle: {},
154
189
  customModalHeaderStyle: {},
155
190
  customModalBodyStyle: {},
156
- customModalFooterStyle: {}
157
- }
158
-
191
+ customModalFooterStyle: {},
192
+ };
@@ -1,2 +1 @@
1
- export * from './Modal';
2
1
  export * from './ModalComp';
@@ -1,5 +1,4 @@
1
1
  import defaultThemeColor from './defaultThemeColor';
2
- const border = `#D4D7E3`;
3
2
 
4
3
  const defaultStyles = {
5
4
  /**
@@ -16,13 +15,13 @@ const defaultStyles = {
16
15
  'padding-left': '6px',
17
16
  'font-style': 'normal',
18
17
  'font-weight': 'normal',
19
- 'font-size': '20px',
18
+ 'font-size': '14px',
20
19
  'display': 'flex',
21
20
  'width': 'inherit',
22
21
  'align-items': 'flex-start',
23
- 'color': '#444444',
24
- 'margin-bottom': '0'
25
-
22
+ 'color': `${defaultThemeColor.variant['neutral-2']}`,
23
+ 'margin-bottom': '0',
24
+ 'padding-bottom': '0'
26
25
  },
27
26
  'button': {
28
27
  'color': 'red',
@@ -143,9 +142,9 @@ const defaultStyles = {
143
142
  * Default Style of the textbox wrapper
144
143
  */
145
144
  'textbox-wrapper': {
146
- 'border': `1px solid ${border}`,
145
+ 'border': `1px solid ${defaultThemeColor.border}`,
147
146
  'border-radius': '4px',
148
- 'padding': '5.5px 7px',
147
+ 'padding': '6.5px 7px',
149
148
  'display': 'flex',
150
149
  'align-items': 'center',
151
150
  'line-height': '.5rem',
@@ -186,6 +185,9 @@ const defaultStyles = {
186
185
  'color': `${defaultThemeColor.variant['neutral-2']}`,
187
186
  'display': 'flex',
188
187
  'width': 'max-content',
188
+ 'background-color': 'transparent',
189
+ 'margin-bottom': '0px',
190
+ 'padding-bottom': '0px'
189
191
  },
190
192
  /**
191
193
  * Default Style of the Image
@@ -241,7 +243,7 @@ const defaultStyles = {
241
243
  fontSize: '14px',
242
244
  fontWeight: '600',
243
245
  '&:first-of-type': {
244
- paddingLeft: '0px' //Remove default value since already apply the paddingLeft to the whole table to align the head to the body
246
+ paddingLeft: '0px !important' //Remove default value since already apply the paddingLeft to the whole table to align the head to the body
245
247
  },
246
248
  },
247
249
  },
@@ -320,11 +322,11 @@ const defaultStyles = {
320
322
  },
321
323
  'radio-label': {
322
324
  'display': 'block',
323
- 'margin-bottom': '24.2px',
324
- 'color': '#444444'
325
+ 'margin-bottom': '7px',
326
+ 'color': `${defaultThemeColor.variant['neutral-2']}`
325
327
  },
326
328
  'option-text': {
327
- 'background-color': `${defaultThemeColor.bgColor}`,
329
+ // 'background-color': `${defaultThemeColor.bgColor}`,
328
330
  'color': "#A9B1B8",
329
331
  'font-size': '16px',
330
332
  },
@@ -344,7 +346,7 @@ const defaultStyles = {
344
346
  * Default Style of the checkbox label
345
347
  */
346
348
  'checkBox-outer': {
347
- 'border': `2px solid ${border}`,
349
+ 'border': `2px solid ${defaultThemeColor.border}`,
348
350
  'width': '20px',
349
351
  'height': '20px',
350
352
  'border-radius': '3px',
@@ -363,7 +365,8 @@ const defaultStyles = {
363
365
  },
364
366
  'check-label': {
365
367
  'display': 'block',
366
- 'margin-bottom': '26px',
368
+ 'margin-bottom': '7px',
369
+ 'color': `${defaultThemeColor.variant['neutral-2']}`
367
370
  },
368
371
  'checkbox-option-text': {
369
372
  'font-size': '16px',
@@ -372,8 +375,8 @@ const defaultStyles = {
372
375
  },
373
376
  'toggle-switch-wrapper': {
374
377
  'display': 'flex',
375
- 'align-items': 'flex-start',
376
- 'gap': '40px',
378
+ 'align-items': 'center',
379
+ 'gap': '7px',
377
380
  'width': 'fit-content',
378
381
  },
379
382
  'toggle-switch-checkbox-label': {
@@ -384,7 +387,7 @@ const defaultStyles = {
384
387
  'cursor': 'pointer',
385
388
  },
386
389
  'toggle-switch-option-text': {
387
- 'background-color': `${defaultThemeColor.bgColor}`,
390
+ // 'background-color': `${defaultThemeColor.bgColor}`,
388
391
  'color': `${defaultThemeColor.neutral['neutral-1']}`,
389
392
  'font-size': '16px',
390
393
  'margin-right': '30px',
@@ -393,21 +396,19 @@ const defaultStyles = {
393
396
  * Default Style of the dropZone component
394
397
  */
395
398
  'dropzone-parent': {
396
- 'width': 'inherit',
397
- 'max-width': '514px',
399
+ 'width': '100%',
398
400
  'height': '86px',
399
401
  'padding-left': '8px',
400
402
  'padding-right': '8px',
401
403
  'display': 'flex',
402
404
  'justify-content': 'center',
403
405
  'align-items': 'center',
404
- 'font-size': '17px',
406
+ 'font-size': '16px',
405
407
  'border-radius': '5.5px',
406
408
  'color': ` ${defaultThemeColor.textColor}`,
407
409
  },
408
410
  'dropzone-file-div': {
409
411
  'width': 'inherit',
410
- 'max-width': '532px',
411
412
  'height': '38px',
412
413
  'display': 'flex',
413
414
  'justify-content': 'center',
@@ -451,10 +452,8 @@ const defaultStyles = {
451
452
  'font-size': '17px',
452
453
  'color': `${defaultThemeColor.textColor}`,
453
454
  'background-color': `${defaultThemeColor.bgColor}`,
454
- // 'border': `1px solid ${defaultThemeColor.neutral['neutral-3']} `,
455
455
  },
456
456
  'signature-wrapper-div': {
457
- // 'margin-left': '2px',
458
457
  'display': 'flex',
459
458
  'flex': 'auto',
460
459
  'justify-content': 'center',
@@ -469,8 +468,7 @@ const defaultStyles = {
469
468
  'text-align': 'center',
470
469
  'display': 'block',
471
470
  'height': '48px',
472
- 'width': `calc(100% - 50px)!important`,
473
- // 'max-width': '394px',
471
+ 'width': `calc(100% - 54px)!important`,
474
472
  'background-color': `${defaultThemeColor.bgColor}`,
475
473
  'font-family': "Beauty",
476
474
  'background-clip': 'padding-box',
@@ -478,8 +476,7 @@ const defaultStyles = {
478
476
  'font-style': 'normal',
479
477
  'font-weight': 'normal',
480
478
  'font-size': '47px',
481
- 'padding-left': '10px'
482
-
479
+ 'padding-left': '10px',
483
480
  },
484
481
  /**
485
482
  * Default Style of the modal component
@@ -589,7 +586,6 @@ const defaultStyles = {
589
586
  },
590
587
  'tp-cont-bottom-arrow-before': {
591
588
  'border-color': `transparent transparent ${defaultThemeColor.bgColor} transparent`,
592
- // 'border-width': '0 0.5rem 0.4rem 0.5rem',
593
589
  'border-width': '0 15px 19px 15px',
594
590
  'position': 'absolute',
595
591
  'top': '-1px',
@@ -733,14 +729,13 @@ const defaultStyles = {
733
729
  right: 'auto',
734
730
  bottom: 'auto',
735
731
  marginRight: '-50%',
736
- padding: '3rem 3rem 0.8rem 3rem',
737
732
  transform: 'translate(-50%, -50%)',
738
733
  zIndex: "999",
739
734
  },
740
735
  },
741
736
  'modalComp-modal-close': {
742
737
  position: 'absolute',
743
- top: '5px',
738
+ top: '10px',
744
739
  right: '5px',
745
740
  outline: 'none',
746
741
  border: 'none',
@@ -748,17 +743,17 @@ const defaultStyles = {
748
743
  cursor: 'pointer'
749
744
  },
750
745
  'modalComp-modal-body': {
751
- 'margin-top': '30px',
746
+ 'margin-top': '20px',
752
747
  'margin-bottom': '15px',
753
748
  },
754
749
  'modalComp-modal-footer': {
755
- display: 'flex',
756
- 'justify- content': 'end',
750
+
757
751
  'margin-top': '30px',
758
752
  'margin-bottom': '15px',
753
+ 'border-top': `1px solid ${defaultThemeColor.border}`,
754
+ 'padding': '1rem 3rem 0rem 3rem',
759
755
  '&:before': {
760
756
  content: '',
761
- 'border-top': '1px solid #E5E7F0',
762
757
  position: 'fixed',
763
758
  display: 'inline-block',
764
759
  left: 0,
@@ -9,7 +9,8 @@ const defaultThemeColor = {
9
9
  variant: { ...primaryColor, ...uiColor, ...neutralColor, ...shadeColor, ...graphColor },
10
10
  textColor: primaryColor['primary-2'],
11
11
  bgColor: '#FFFFFF', /**background color */
12
- black: '#000000'
12
+ black: '#000000',
13
+ border: '#D4D7E3'
13
14
  };
14
15
 
15
16
  export default defaultThemeColor;