groundfloor-react-ui 1.2.4 → 1.2.6

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.
@@ -312,22 +312,15 @@ export const MultiColumnDiv = styled.div`
312
312
 
313
313
  `;
314
314
 
315
-
316
-
317
-
318
- export const FormWrapper = ({ customStyles }) => {
319
-
320
- const Wrapper = styled.form`
315
+ const Wrapper = styled.form`
321
316
  width: 40vw;
322
317
  display: flex;
323
318
  justify-content: center;
324
319
  flex-direction: column;
325
320
  gap: 20px;
326
321
  ${({ customStyles }) => customStyles}
327
- `;
328
- return (
329
- <Wrapper customStyles={customStyles}>
330
- </Wrapper>
331
- );
332
- };
322
+ `;
333
323
 
324
+ export const FormWrapper = ({ customStyles, children }) => {
325
+ return <Wrapper customStyles={customStyles}>{children}</Wrapper>;
326
+ };
@@ -3,7 +3,9 @@ import { PrimaryButton, SecondaryButton, TinyButton } from '../Button';
3
3
  import defaultThemeColor from '../constants/defaultThemeColor';
4
4
  import {
5
5
  FormContainer,
6
- FormWrapper, MultiColumnDiv, MultiColumnWrapper
6
+ FormWrapper,
7
+ MultiColumnDiv,
8
+ MultiColumnWrapper
7
9
  } from '../DesignComponent';
8
10
  import { Header } from '../Header';
9
11
  import {
@@ -25,7 +27,8 @@ import { Rating } from '../Rating';
25
27
  import { Table } from '../Tables';
26
28
  import { HeaderComponent } from './HeaderComponent';
27
29
 
28
- export const FormComponent = ({ formData, ...props }) => {
30
+
31
+ export const FormComponent = ({ formData, customStyles, ...props }) => {
29
32
  const header = (item) => {
30
33
  return (
31
34
  <Fragment>
@@ -99,11 +102,15 @@ export const FormComponent = ({ formData, ...props }) => {
99
102
  };
100
103
 
101
104
  const AsyncMultiDropdownInput = (item) => {
102
- return <DropdownSelect dropdownType={'asyncMultiSelect'} {...item} {...props} />;
105
+ return (
106
+ <DropdownSelect dropdownType={'asyncMultiSelect'} {...item} {...props} />
107
+ );
103
108
  };
104
109
 
105
110
  const AsyncSingleDropdownInput = (item) => {
106
- return <DropdownSelect dropdownType={'asyncSingleSelect'} {...item} {...props} />;
111
+ return (
112
+ <DropdownSelect dropdownType={'asyncSingleSelect'} {...item} {...props} />
113
+ );
107
114
  };
108
115
 
109
116
  const signatureInput = (item) => {
@@ -211,8 +218,8 @@ export const FormComponent = ({ formData, ...props }) => {
211
218
 
212
219
  return (
213
220
  <Fragment>
214
- <FormContainer defaultThemeColor={defaultThemeColor} >
215
- <FormWrapper onSubmit={handleSubmit} >
221
+ <FormContainer defaultThemeColor={defaultThemeColor}>
222
+ <FormWrapper onSubmit={handleSubmit} customStyles={customStyles}>
216
223
  {formData.map((row, i) => {
217
224
  if (row.length > 1) {
218
225
  return (
@@ -2,3 +2,4 @@ export * from './FormComponent';
2
2
  export * from './HeaderComponent';
3
3
  export * from './SubmitComponent';
4
4
 
5
+
@@ -118,11 +118,18 @@ const Wrapper = styled.div`
118
118
  color:${({ theme }) => theme.textColor} !important;
119
119
  margin-right: 0px;
120
120
  }
121
+ .text-main-alt-value {
122
+ color:${({ theme }) => theme.textColor} !important;
123
+ white-space: nowrap;
124
+ overflow: hidden;
125
+ text-overflow: ellipsis;
126
+
127
+ }
121
128
  .text-more-alt{
122
129
  font-size:12px;
123
130
  color: ${({ theme }) => theme.neutral['neutral-2']};
124
131
  padding-right: 0px;
125
- margin-right: 0px;
132
+
126
133
 
127
134
  }
128
135
  .css-mohuvp-dummyInput-DummyInput{
@@ -252,20 +259,12 @@ export const DropdownSelect = ({
252
259
  )}
253
260
 
254
261
  {children}
255
- {len > 1 && <div className={`text-more-alt`}>&amp; {len - 1} more</div>}
262
+ {len > 1 && <span className={`text-more-alt`}>&amp; {len - 1} more</span>}
256
263
  </components.ValueContainer>
257
264
  );
258
265
  };
259
266
 
260
- const ValueContainer = ({ getValue, children, ...props }) => {
261
- const len = getValue().length;
262
- return (
263
- <components.ValueContainer {...props}>
264
- {children}
265
- {len > 1 && <div className={`text-more-alt`}>&amp; {len - 1} more</div>}
266
- </components.ValueContainer>
267
- );
268
- };
267
+
269
268
 
270
269
  const Option = (p) => {
271
270
  const checkboxStyle = {
@@ -312,7 +311,7 @@ export const DropdownSelect = ({
312
311
 
313
312
  const MultiValue = ({ index, ...p }) => {
314
313
  const firstSelected = p?.data?.label || 'Select';
315
- return !index && <div className='text-main-alt'>{firstSelected}</div>;
314
+ return !index && <span className='text-main-alt-value'>{firstSelected}</span>;
316
315
  };
317
316
 
318
317
  const stylesComp = {
@@ -321,7 +320,7 @@ export const DropdownSelect = ({
321
320
  border: !isValid
322
321
  ? '1px solid ' + activeTheme.ui['error']
323
322
  : '1px solid ' + activeTheme.border,
324
- minWidth: '215px',
323
+ minWidth: '226px',
325
324
  height: `${height}px`,
326
325
  minHeight: `${height}px`,
327
326
  boxShadow: (state.isSelected || state.isFocused) && 'none',
@@ -350,6 +349,7 @@ export const DropdownSelect = ({
350
349
  valueContainer: (base) => ({
351
350
  ...base,
352
351
  display: 'flex',
352
+ justifyContent: 'space-between',
353
353
  fontSize: fontSize + 'px',
354
354
  }),
355
355
  indicatorsContainer: (base) => ({
@@ -368,6 +368,7 @@ export const DropdownSelect = ({
368
368
  borderRadius: '4.32px',
369
369
  fontSize: fontSize + 'px',
370
370
  width: '100%',
371
+ minWidth: '226px',
371
372
  }),
372
373
  singleValue: (base) => ({
373
374
  ...base,
@@ -652,6 +653,9 @@ DropdownSelect.propTypes = {
652
653
  * iconSize of the select
653
654
  */
654
655
  leftIconSize: PropTypes.number,
656
+ /**
657
+ * to show or hide indicator
658
+ */
655
659
  showIndicator: PropTypes.bool,
656
660
  };
657
661
 
@@ -679,7 +683,7 @@ DropdownSelect.defaultProps = {
679
683
  iconName: 'triangle-down',
680
684
  iconColor: 'black',
681
685
  iconSize: 8,
682
- leftIcon: 'magnifier-icon',
686
+ leftIcon: '',
683
687
  leftIconColor: 'black',
684
688
  leftIconSize: 10,
685
689
  showIndicator: true,
@@ -31,6 +31,7 @@ TextBox.defaultProps = {
31
31
  };
32
32
 
33
33
  const Input = styled.input`
34
+ width: 85%;
34
35
  border: 0;
35
36
  outline: 0;
36
37
  color: ${({ theme }) => theme.variant['primary-2']};
@@ -43,7 +43,7 @@ TextWrapper.defaultProps = {
43
43
  };
44
44
 
45
45
  const Input = styled.input`
46
- width: auto;
46
+ width: 85%;
47
47
  -webkit-text-security: ${({ showEye }) => showEye ? 'none' : 'disc'} ;
48
48
 
49
49
  //Set the styles from the default styles object
@@ -37,7 +37,7 @@ const TextWrapper = styled.div`
37
37
  `;
38
38
 
39
39
  const Input = styled.input`
40
- width: 98%;
40
+ width: 85%;
41
41
  //Set the styles from the default styles object
42
42
  ${({ inBuiltCss, defaultInputStyle }) => {
43
43
  return getDefaultStyles(inBuiltCss, defaultInputStyle);
@@ -7,26 +7,6 @@ import defaultThemeColor from '../constants/defaultThemeColor';
7
7
  import getDefaultStyles from '../constants/utils';
8
8
  import { Icon } from '../Icon';
9
9
 
10
- const customStyles = {
11
- overlay: {
12
- zIndex: '999999',
13
- backgroundColor: 'rgb(0 0 0 / 30%)'
14
- },
15
- content: {
16
- borderColor: defaultThemeColor.border,
17
- top: '50%',
18
- left: '50%',
19
- right: 'auto',
20
- bottom: 'auto',
21
- marginRight: '-50%',
22
- padding: '0px',
23
- transform: 'translate(-50%, -50%)',
24
- minWidth: '40vw',
25
- maxHeight: '85vh',
26
- overflow: 'hidden',
27
- },
28
- };
29
-
30
10
  const ModalClose = styled.button`
31
11
  //Set the styles from the default styles object
32
12
  ${({ theme, type }) => {
@@ -35,29 +15,19 @@ const ModalClose = styled.button`
35
15
  // custom styles
36
16
  ${({ customModalCloseStyle }) => customModalCloseStyle}
37
17
  //Set the styles from the default styles object
38
- &:focus{
39
- outline: none;
40
- border: none;
41
- }
18
+ &:focus {
19
+ outline: none;
20
+ border: none;
21
+ }
42
22
  `;
43
23
 
44
24
  const ModalHeader = styled.div`
45
- .header-title {
46
- display: flex;
47
- gap: 10px;
48
- align-items: center;
49
- }
50
- .header-description {
51
- margin-top: 5px;
52
- }
53
- h4 {
54
- margin-bottom: 0;
55
- }
25
+ margin-top: 10px;
26
+
56
27
  // custom styles
57
28
  ${({ customModalHeaderStyle }) => customModalHeaderStyle}
58
29
  `;
59
30
  const ModalBody = styled.div`
60
-
61
31
  //Set the styles from the default styles object
62
32
  ${({ theme, type }) => {
63
33
  return getDefaultStyles(theme, type);
@@ -69,7 +39,7 @@ const ModalBody = styled.div`
69
39
  const ContentWrapper = styled.div`
70
40
  max-height: 60vh;
71
41
  overflow-y: auto;
72
- `
42
+ `;
73
43
 
74
44
  const ModalFooter = styled.div`
75
45
  //Set the styles from the default styles object
@@ -81,27 +51,23 @@ const ModalFooter = styled.div`
81
51
  `;
82
52
 
83
53
  const CommonDiv = styled.div`
84
- padding: .5rem 3rem 0rem 3rem;
54
+ padding: 0.5rem 3rem 0rem 3rem;
85
55
  `;
86
56
 
87
57
  const HeaderWrapper = styled.div`
88
58
  position: sticky;
89
- background-color: ${({ theme }) => theme.bgColor};
90
- width: 100%;
59
+ background-color: ${({ theme }) => theme.bgColor};
60
+ width: 100%;
91
61
  top: 0px;
92
- border-bottom: 1px solid ${({ theme }) => theme.border}
93
-
94
- `
95
-
62
+ border-bottom: 1px solid ${({ theme }) => theme.border};
63
+ `;
96
64
 
97
65
  try {
98
- Modal.setAppElement('#root')
99
-
66
+ Modal.setAppElement('#root');
100
67
  } catch (error) {
101
- Modal.setAppElement('#__next')
68
+ Modal.setAppElement('#__next');
102
69
  }
103
70
 
104
-
105
71
  export const ModalComp = ({
106
72
  modalIsOpen,
107
73
  toggleModal,
@@ -113,10 +79,35 @@ export const ModalComp = ({
113
79
  customModalHeaderStyle,
114
80
  customModalBodyStyle,
115
81
  customModalFooterStyle,
82
+ customWidth,
83
+ customMinWidth,
84
+ customMaxWidth,
116
85
  ...props
117
86
  }) => {
118
87
  const activeTheme = useTheme() || defaultThemeColor;
119
88
 
89
+ const customStyles = {
90
+ overlay: {
91
+ zIndex: '999999',
92
+ backgroundColor: 'rgb(0 0 0 / 30%)',
93
+ },
94
+ content: {
95
+ borderColor: defaultThemeColor.border,
96
+ top: '50%',
97
+ left: '50%',
98
+ right: 'auto',
99
+ bottom: 'auto',
100
+ marginRight: '-50%',
101
+ padding: '0px',
102
+ transform: 'translate(-50%, -50%)',
103
+ minWidth: customMinWidth,
104
+ maxHeight: '85vh',
105
+ overflow: 'hidden',
106
+ width: customWidth && customWidth,
107
+ maxWidth: customMaxWidth && customMaxWidth,
108
+ },
109
+ };
110
+
120
111
  return (
121
112
  <Modal
122
113
  isOpen={modalIsOpen}
@@ -149,8 +140,7 @@ export const ModalComp = ({
149
140
  type={'modalComp-modal-body'}
150
141
  style={customModalBodyStyle}
151
142
  >
152
- <CommonDiv> {bodyContent}
153
- </CommonDiv>
143
+ <CommonDiv> {bodyContent}</CommonDiv>
154
144
  </ModalBody>
155
145
 
156
146
  <ModalFooter
@@ -206,6 +196,7 @@ ModalComp.propTypes = {
206
196
  * Modal Footer custom styles
207
197
  */
208
198
  customModalFooterStyle: PropTypes.object,
199
+ customMinWidth: PropTypes.string,
209
200
  };
210
201
 
211
202
  ModalComp.defaultProps = {
@@ -219,4 +210,7 @@ ModalComp.defaultProps = {
219
210
  customModalHeaderStyle: {},
220
211
  customModalBodyStyle: {},
221
212
  customModalFooterStyle: {},
213
+ customMinWidth: '40vw',
214
+ customWidth: '',
215
+ customMaxWidth: '',
222
216
  };