groundfloor-react-ui 1.0.16 → 1.0.19

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.
@@ -8,7 +8,7 @@ const TextBox = styled.div`
8
8
  font-size: 21px;
9
9
  border: 1px solid
10
10
  ${({ theme, isValid }) =>
11
- isValid ? defaultThemeColor.border : theme.variant['error']};
11
+ isValid ? defaultThemeColor.border : theme.variant['error']};
12
12
  border-radius: 4px;
13
13
  padding: 5px;
14
14
  display: inline-block;
@@ -21,7 +21,7 @@ const TextBox = styled.div`
21
21
  `;
22
22
 
23
23
  TextBox.defaultProps = {
24
- theme: defaultThemeColor,
24
+ theme: defaultThemeColor,
25
25
  };
26
26
 
27
27
  const Input = styled.input`
@@ -32,11 +32,12 @@ const Input = styled.input`
32
32
  padding: 0;
33
33
  font-size: 21px;
34
34
  width: 24px;
35
+ text-align:center;
35
36
  background-color: ${({ theme }) => theme.bgColor};
36
37
  `;
37
38
 
38
39
  Input.defaultProps = {
39
- theme: defaultThemeColor,
40
+ theme: defaultThemeColor,
40
41
  };
41
42
 
42
43
  const requiredAsterisk = css`
@@ -49,7 +50,7 @@ const requiredAsterisk = css`
49
50
  const Label = styled.label`
50
51
  display: block;
51
52
  margin-bottom: ${({ labelInline, errMsg }) =>
52
- labelInline && errMsg ? '18px' : '7px'};
53
+ labelInline && errMsg ? '18px' : '7px'};
53
54
  margin-right: ${({ labelInline }) => (labelInline ? '7px' : '')};
54
55
  color: ${({ theme }) => theme.variant['neutral-2']};
55
56
  ${({ required }) => (required ? requiredAsterisk : null)}
@@ -57,7 +58,7 @@ const Label = styled.label`
57
58
  `;
58
59
 
59
60
  Label.defaultProps = {
60
- theme: defaultThemeColor,
61
+ theme: defaultThemeColor,
61
62
  };
62
63
 
63
64
  const inline = css`
@@ -79,7 +80,7 @@ const Form = styled.div`
79
80
  `;
80
81
 
81
82
  Form.defaultProps = {
82
- theme: defaultThemeColor,
83
+ theme: defaultThemeColor,
83
84
  };
84
85
 
85
86
  const Button = styled.button`
@@ -94,102 +95,102 @@ const Button = styled.button`
94
95
  `;
95
96
 
96
97
  Button.defaultProps = {
97
- theme: defaultThemeColor,
98
+ theme: defaultThemeColor,
98
99
  };
99
100
 
100
101
  export const TimeInput = ({
101
- label,
102
- errMsg,
103
- hour,
104
- minute,
105
- period,
106
- onChange,
107
- ...props
102
+ label,
103
+ errMsg,
104
+ hour,
105
+ minute,
106
+ period,
107
+ onChange,
108
+ ...props
108
109
  }) => {
109
- const theme = useTheme() || defaultThemeColor;
110
-
111
- function hourChange(evt) {
112
- const num =
113
- evt.currentTarget.value > 12
114
- ? 12
115
- : parseFloat(evt.currentTarget.value) || 0;
116
- onChange({ hour: num, minute, period });
117
- }
118
-
119
- function minuteChange(evt) {
120
- console.log('minute change', evt.currentTarget.value);
121
- const num =
122
- evt.currentTarget.value > 59
123
- ? 59
124
- : parseFloat(evt.currentTarget.value) || 0;
125
- onChange({ hour, minute: num, period });
126
- }
127
-
128
- function periodChange(evt) {
129
- const p = period === 'AM' ? 'PM' : 'AM';
130
- onChange({ hour, minute, period: p });
131
- }
132
-
133
- return (
134
- <Form {...props}>
135
- <Label {...props} errMsg={errMsg}>
136
- {label}
137
- </Label>
138
- <div>
139
- <TextBox {...props}>
140
- <Input value={hour} onChange={hourChange} />
141
- :
142
- <Input value={minute} onChange={minuteChange} />
143
- <Button onClick={periodChange}>{period}</Button>
144
- </TextBox>
145
- <div className='err-text'>{errMsg}</div>
146
- </div>
147
- </Form>
148
- );
110
+ const theme = useTheme() || defaultThemeColor;
111
+
112
+ function hourChange(evt) {
113
+ const num =
114
+ evt.currentTarget.value > 12
115
+ ? 12
116
+ : parseFloat(evt.currentTarget.value) || 0;
117
+ onChange({ hour: num, minute, period });
118
+ }
119
+
120
+ function minuteChange(evt) {
121
+ console.log('minute change', evt.currentTarget.value);
122
+ const num =
123
+ evt.currentTarget.value > 59
124
+ ? 59
125
+ : parseFloat(evt.currentTarget.value) || 0;
126
+ onChange({ hour, minute: num, period });
127
+ }
128
+
129
+ function periodChange(evt) {
130
+ const p = period === 'AM' ? 'PM' : 'AM';
131
+ onChange({ hour, minute, period: p });
132
+ }
133
+
134
+ return (
135
+ <Form {...props}>
136
+ <Label {...props} errMsg={errMsg}>
137
+ {label}
138
+ </Label>
139
+ <div>
140
+ <TextBox {...props}>
141
+ <Input value={hour} onChange={hourChange} />
142
+ :
143
+ <Input value={minute} onChange={minuteChange} />
144
+ <Button onClick={periodChange}>{period}</Button>
145
+ </TextBox>
146
+ <div className='err-text'>{errMsg}</div>
147
+ </div>
148
+ </Form>
149
+ );
149
150
  };
150
151
 
151
152
  TimeInput.propTypes = {
152
- /**
153
- * Label of Input
154
- */
155
- label: PropTypes.string,
156
- /**
157
- * Hour value
158
- */
159
- hour: PropTypes.number.isRequired,
160
- /**
161
- * Minute value
162
- */
163
- minute: PropTypes.number.isRequired,
164
- /**
165
- * AM or PM ?
166
- */
167
- period: PropTypes.string.isRequired,
168
- /**
169
- * Is the input required?
170
- */
171
- required: PropTypes.bool,
172
- /**
173
- * Should label be inline?
174
- */
175
- labelInline: PropTypes.bool,
176
- /**
177
- * Is the input correct?
178
- */
179
- isValid: PropTypes.bool,
180
- /**
181
- * Error Message
182
- */
183
- errMsg: PropTypes.string,
153
+ /**
154
+ * Label of Input
155
+ */
156
+ label: PropTypes.string,
157
+ /**
158
+ * Hour value
159
+ */
160
+ hour: PropTypes.number.isRequired,
161
+ /**
162
+ * Minute value
163
+ */
164
+ minute: PropTypes.number.isRequired,
165
+ /**
166
+ * AM or PM ?
167
+ */
168
+ period: PropTypes.string.isRequired,
169
+ /**
170
+ * Is the input required?
171
+ */
172
+ required: PropTypes.bool,
173
+ /**
174
+ * Should label be inline?
175
+ */
176
+ labelInline: PropTypes.bool,
177
+ /**
178
+ * Is the input correct?
179
+ */
180
+ isValid: PropTypes.bool,
181
+ /**
182
+ * Error Message
183
+ */
184
+ errMsg: PropTypes.string,
184
185
  };
185
186
 
186
187
  TimeInput.defaultProps = {
187
- label: '',
188
- hour: 0,
189
- minute: 0,
190
- period: 'AM',
191
- required: false,
192
- labelInline: false,
193
- isValid: true,
194
- errMsg: '',
188
+ label: '',
189
+ hour: 0,
190
+ minute: 0,
191
+ period: 'AM',
192
+ required: false,
193
+ labelInline: false,
194
+ isValid: true,
195
+ errMsg: '',
195
196
  };
@@ -77,7 +77,12 @@ const CommonDiv = styled.div`
77
77
  padding: 2rem 3rem 0rem 3rem;
78
78
  `;
79
79
 
80
- Modal.setAppElement(window.next?.version ? "#__next" : '#root')
80
+ try {
81
+ Modal.setAppElement('#root')
82
+
83
+ } catch (error) {
84
+ Modal.setAppElement('#__next')
85
+ }
81
86
 
82
87
  export const ModalComp = ({
83
88
  modalIsOpen,
@@ -401,7 +401,6 @@ const defaultStyles = {
401
401
  * Default Style of the dropZone component
402
402
  */
403
403
  'dropzone-parent': {
404
- width: '100%',
405
404
  height: '86px',
406
405
  'padding-left': '8px',
407
406
  'padding-right': '8px',