homeflowjs 1.0.49 → 1.0.51
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.
- package/package.json +1 -1
- package/search/address-lookup-input/address-lookup-input.component.jsx +5 -1
- package/search/address-lookup-input/clear-button.component.jsx +9 -4
- package/search/address-lookup-input/input.jsx +4 -1
- package/shared/close-icon.component.jsx +12 -3
- package/shared/loading-icon.component.jsx +13 -3
package/package.json
CHANGED
@@ -17,6 +17,7 @@ const AddressLookupInput = ({
|
|
17
17
|
name,
|
18
18
|
required,
|
19
19
|
setSelectedAddress,
|
20
|
+
iconStokeInherit,
|
20
21
|
}) => {
|
21
22
|
const [locationQuery, setLocationQuery] = useState('');
|
22
23
|
const [suggestions, setSuggestions] = useState([]);
|
@@ -138,7 +139,7 @@ const AddressLookupInput = ({
|
|
138
139
|
}, [inputRef, clickedOutSide]);
|
139
140
|
|
140
141
|
return (
|
141
|
-
<div className="address-lookup-input" ref={inputRef}>
|
142
|
+
<div className="hf-address-lookup-input address-lookup-input" ref={inputRef}>
|
142
143
|
<Input
|
143
144
|
id="address-lookup-input"
|
144
145
|
name={name}
|
@@ -156,6 +157,7 @@ const AddressLookupInput = ({
|
|
156
157
|
className={className}
|
157
158
|
// autoComplete false won't in chrome but if we set it to some random value it will work
|
158
159
|
autoComplete="nope"
|
160
|
+
iconStokeInherit={iconStokeInherit}
|
159
161
|
/>
|
160
162
|
{/* Render the search results */}
|
161
163
|
{suggestions.length > 0 && (
|
@@ -191,6 +193,7 @@ AddressLookupInput.propTypes = {
|
|
191
193
|
required: PropTypes.bool,
|
192
194
|
className: PropTypes.string,
|
193
195
|
setSelectedAddress: PropTypes.func,
|
196
|
+
iconStokeInherit: PropTypes.bool,
|
194
197
|
};
|
195
198
|
|
196
199
|
AddressLookupInput.defaultProps = {
|
@@ -200,6 +203,7 @@ AddressLookupInput.defaultProps = {
|
|
200
203
|
required: false,
|
201
204
|
className: '',
|
202
205
|
setSelectedAddress: null,
|
206
|
+
iconStokeInherit: true,
|
203
207
|
};
|
204
208
|
|
205
209
|
export default AddressLookupInput;
|
@@ -4,7 +4,7 @@ import SearchIcon from '../../shared/search-icon.component';
|
|
4
4
|
import CloseIcon from '../../shared/close-icon.component';
|
5
5
|
import LoadingIcon from '../../shared/loading-icon.component';
|
6
6
|
|
7
|
-
const ClearButton = ({ address, loading, onClear }) => (
|
7
|
+
const ClearButton = ({ address, loading, onClear, iconStokeInherit }) => (
|
8
8
|
<button
|
9
9
|
type="button"
|
10
10
|
className="address-lookup-input__btn btn-unstyled"
|
@@ -13,13 +13,13 @@ const ClearButton = ({ address, loading, onClear }) => (
|
|
13
13
|
disabled={Object.keys(address.value).length === 0}
|
14
14
|
>
|
15
15
|
{Object.keys(address.value).length === 0 && !loading && (
|
16
|
-
<SearchIcon />
|
16
|
+
<SearchIcon inherit={iconStokeInherit} />
|
17
17
|
)}
|
18
18
|
{Object.keys(address.value).length !== 0 && !loading && (
|
19
|
-
|
19
|
+
<CloseIcon inherit={iconStokeInherit} />
|
20
20
|
)}
|
21
21
|
{loading && (
|
22
|
-
|
22
|
+
<LoadingIcon inherit={iconStokeInherit} />
|
23
23
|
)}
|
24
24
|
</button>
|
25
25
|
);
|
@@ -28,6 +28,11 @@ ClearButton.propTypes = {
|
|
28
28
|
address: PropTypes.object.isRequired,
|
29
29
|
loading: PropTypes.bool.isRequired,
|
30
30
|
onClear: PropTypes.func.isRequired,
|
31
|
+
iconStokeInherit: PropTypes.bool,
|
31
32
|
};
|
32
33
|
|
34
|
+
ClearButton.defaultProps = {
|
35
|
+
iconStokeInherit: true,
|
36
|
+
}
|
37
|
+
|
33
38
|
export default ClearButton;
|
@@ -21,6 +21,7 @@ const Input = ({
|
|
21
21
|
className,
|
22
22
|
required,
|
23
23
|
loading,
|
24
|
+
iconStokeInherit,
|
24
25
|
...other
|
25
26
|
}) => (
|
26
27
|
<div className={`input ${address?.error ? 'input--error' : ''} ${fullWidth ? 'input--full-width' : ''} ${onDark ? 'input--on-dark' : ''}`}>
|
@@ -41,7 +42,7 @@ const Input = ({
|
|
41
42
|
required={required}
|
42
43
|
{...other}
|
43
44
|
/>
|
44
|
-
<ClearButton address={address} loading={loading} onClear={onClear} />
|
45
|
+
<ClearButton address={address} loading={loading} onClear={onClear} iconStokeInherit={iconStokeInherit} />
|
45
46
|
</div>
|
46
47
|
{address?.error && typeof (address.error) === 'string' && (
|
47
48
|
<span className="input__error">{address.error}</span>
|
@@ -70,6 +71,7 @@ Input.propTypes = {
|
|
70
71
|
]),
|
71
72
|
className: PropTypes.string,
|
72
73
|
required: PropTypes.bool,
|
74
|
+
iconStokeInherit: PropTypes.bool,
|
73
75
|
};
|
74
76
|
|
75
77
|
Input.defaultProps = {
|
@@ -83,6 +85,7 @@ Input.defaultProps = {
|
|
83
85
|
disabled: false,
|
84
86
|
className: '',
|
85
87
|
required: false,
|
88
|
+
iconStokeInherit: true,
|
86
89
|
};
|
87
90
|
|
88
91
|
export default Input;
|
@@ -1,13 +1,22 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
2
3
|
|
3
|
-
const CloseIcon = () => (
|
4
|
+
const CloseIcon = ({inherit}) => (
|
4
5
|
<svg role="img" xmlns="http://www.w3.org/2000/svg" width="20.52" height="20.52" viewBox="0 0 20.52 20.52">
|
5
6
|
<title>Close Icon</title>
|
6
7
|
<g transform="translate(-336.011 -145.97)">
|
7
|
-
<line x2="19.459" y2="19.459" transform="translate(336.541 146.5)" fill="none" stroke=
|
8
|
-
<line x1="19.459" y2="19.459" transform="translate(336.541 146.5)" fill="none" stroke=
|
8
|
+
<line x2="19.459" y2="19.459" transform="translate(336.541 146.5)" fill="none" stroke={`${inherit ? 'inherit' : '#fff'}`} strokeWidth="1.5" />
|
9
|
+
<line x1="19.459" y2="19.459" transform="translate(336.541 146.5)" fill="none" stroke={`${inherit ? 'inherit' : '#fff'}`} strokeWidth="1.5" />
|
9
10
|
</g>
|
10
11
|
</svg>
|
11
12
|
);
|
12
13
|
|
14
|
+
CloseIcon.propTypes = {
|
15
|
+
inherit: PropTypes.bool,
|
16
|
+
};
|
17
|
+
|
18
|
+
CloseIcon.defaultProps = {
|
19
|
+
inherit: false,
|
20
|
+
};
|
21
|
+
|
13
22
|
export default CloseIcon;
|
@@ -1,11 +1,21 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
2
3
|
|
3
|
-
const LoadingIcon = () => (
|
4
|
+
const LoadingIcon = ({inherit}) => (
|
4
5
|
<svg role="img" className="loading-icon" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
5
6
|
<title>Loading Icon</title>
|
6
|
-
<path d="M23 4V10H17" stroke=
|
7
|
-
<path d="M20.49 15C19.84 16.8399 18.6096 18.4187 16.9842 19.4985C15.3588 20.5783 13.4265 21.1006 11.4784 20.9866C9.53038 20.8726 7.67216 20.1286 6.18376 18.8667C4.69536 17.6047 3.65743 15.8932 3.22637 13.9901C2.79531 12.0869 2.99448 10.0952 3.79386 8.31508C4.59325 6.53496 5.94954 5.06288 7.65836 4.12065C9.36717 3.17843 11.3359 2.81711 13.268 3.09116C15.2 3.3652 16.9906 4.25975 18.37 5.64001L23 10" stroke=
|
7
|
+
<path d="M23 4V10H17" stroke={`${inherit ? 'inherit' : '#fff'}`} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
|
8
|
+
<path d="M20.49 15C19.84 16.8399 18.6096 18.4187 16.9842 19.4985C15.3588 20.5783 13.4265 21.1006 11.4784 20.9866C9.53038 20.8726 7.67216 20.1286 6.18376 18.8667C4.69536 17.6047 3.65743 15.8932 3.22637 13.9901C2.79531 12.0869 2.99448 10.0952 3.79386 8.31508C4.59325 6.53496 5.94954 5.06288 7.65836 4.12065C9.36717 3.17843 11.3359 2.81711 13.268 3.09116C15.2 3.3652 16.9906 4.25975 18.37 5.64001L23 10" stroke={`${inherit ? 'inherit' : '#fff'}`} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
|
8
9
|
</svg>
|
9
10
|
);
|
10
11
|
|
12
|
+
LoadingIcon.propTypes = {
|
13
|
+
inherit: PropTypes.bool,
|
14
|
+
};
|
15
|
+
|
16
|
+
LoadingIcon.defaultProps = {
|
17
|
+
inherit: false,
|
18
|
+
};
|
19
|
+
|
20
|
+
|
11
21
|
export default LoadingIcon;
|