@star-insure/sdk 1.1.37 → 1.1.39
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/dist/components/forms/RegistrationSearchField.d.ts +6 -1
- package/dist/sdk.cjs.development.js +18 -6
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +18 -6
- package/dist/sdk.esm.js.map +1 -1
- package/dist/types/models/quotes/QuoteRequestVehicle.d.ts +1 -0
- package/package.json +2 -1
- package/src/components/forms/RegistrationSearchField.tsx +23 -15
- package/src/types/models/quotes/QuoteRequestVehicle.ts +1 -0
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
VehicleType,
|
|
8
8
|
} from '../../types';
|
|
9
9
|
import { useToast } from '../../lib/toast';
|
|
10
|
+
import cn from 'classnames';
|
|
10
11
|
|
|
11
12
|
export interface VehicleData extends MotorwebVehicleResponse {
|
|
12
13
|
make: string;
|
|
@@ -28,6 +29,11 @@ interface Props {
|
|
|
28
29
|
showOdometerReadingField?: boolean;
|
|
29
30
|
showConditionField?: boolean;
|
|
30
31
|
initialRegistrationValue?: string;
|
|
32
|
+
outerClassName?: string;
|
|
33
|
+
odoInputClassName?: string;
|
|
34
|
+
conditionSelectClassName?: string;
|
|
35
|
+
regoInputClassName?: string;
|
|
36
|
+
searchBtnClassName?: string;
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
export const conditionOptions = [
|
|
@@ -48,6 +54,12 @@ export default function RegistrationSearchField({
|
|
|
48
54
|
showOdometerReadingField = false,
|
|
49
55
|
showConditionField = false,
|
|
50
56
|
onChange,
|
|
57
|
+
outerClassName,
|
|
58
|
+
odoInputClassName,
|
|
59
|
+
conditionSelectClassName,
|
|
60
|
+
regoInputClassName,
|
|
61
|
+
searchBtnClassName,
|
|
62
|
+
|
|
51
63
|
}: Props) {
|
|
52
64
|
const [rego, setRego] = React.useState<string>(initialRegistrationValue);
|
|
53
65
|
const [odo, setOdo] = React.useState<string>('');
|
|
@@ -154,7 +166,7 @@ export default function RegistrationSearchField({
|
|
|
154
166
|
|
|
155
167
|
return (
|
|
156
168
|
<div className="w-full flex flex-col">
|
|
157
|
-
<div className="w-full flex flex-wrap gap-3 bg-gray-100 rounded-md p-3">
|
|
169
|
+
<div className={cn(outerClassName, "w-full flex flex-wrap gap-3 bg-gray-100 rounded-md p-3")}>
|
|
158
170
|
{showOdometerReadingField ||
|
|
159
171
|
(showConditionField && (
|
|
160
172
|
<div className="w-full grid grid-cols-2 gap-3">
|
|
@@ -168,11 +180,9 @@ export default function RegistrationSearchField({
|
|
|
168
180
|
id="odo_search"
|
|
169
181
|
value={odo}
|
|
170
182
|
onChange={handleChange}
|
|
171
|
-
className={
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
: ''
|
|
175
|
-
}`}
|
|
183
|
+
className={cn(odoInputClassName, "transition-all", {
|
|
184
|
+
'pointer-events-none opacity-50': status === 'processing',
|
|
185
|
+
})}
|
|
176
186
|
disabled={status === 'processing'}
|
|
177
187
|
/>
|
|
178
188
|
</label>
|
|
@@ -186,11 +196,9 @@ export default function RegistrationSearchField({
|
|
|
186
196
|
id="condition_search"
|
|
187
197
|
value={condition}
|
|
188
198
|
onChange={handleChange}
|
|
189
|
-
className={
|
|
190
|
-
status === 'processing'
|
|
191
|
-
|
|
192
|
-
: ''
|
|
193
|
-
}`}
|
|
199
|
+
className={cn(conditionSelectClassName, "transition-all", {
|
|
200
|
+
'pointer-events-none opacity-50': status === 'processing',
|
|
201
|
+
})}
|
|
194
202
|
disabled={status === 'processing'}
|
|
195
203
|
>
|
|
196
204
|
{conditionOptions.map(conditionOption => (
|
|
@@ -210,9 +218,9 @@ export default function RegistrationSearchField({
|
|
|
210
218
|
id={name}
|
|
211
219
|
value={rego}
|
|
212
220
|
onChange={handleChange}
|
|
213
|
-
className={
|
|
214
|
-
|
|
215
|
-
}
|
|
221
|
+
className={cn(regoInputClassName, "flex-grow transition-all", {
|
|
222
|
+
'pointer-events-none opacity-50': status === 'processing',
|
|
223
|
+
})}
|
|
216
224
|
disabled={status === 'processing'}
|
|
217
225
|
/>
|
|
218
226
|
|
|
@@ -221,7 +229,7 @@ export default function RegistrationSearchField({
|
|
|
221
229
|
type="button"
|
|
222
230
|
onClick={handleSearch}
|
|
223
231
|
disabled={status === 'processing'}
|
|
224
|
-
className={
|
|
232
|
+
className={cn(searchBtnClassName, "bg-teal px-4 py-3 rounded-md transition-all")}
|
|
225
233
|
>
|
|
226
234
|
<span className="sr-only">Search</span>
|
|
227
235
|
<svg
|