@star-insure/sdk 1.1.38 → 1.1.40
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/PolicyEnhancement.d.ts +1 -0
- package/dist/types/models/quotes/QuoteRequestPurchaseOption.d.ts +1 -0
- package/dist/types/models/quotes/QuoteRequestVehicleDriver.d.ts +1 -0
- package/package.json +2 -1
- package/src/components/forms/RegistrationSearchField.tsx +22 -15
- package/src/types/models/quotes/PolicyEnhancement.ts +1 -0
- package/src/types/models/quotes/QuoteRequestPurchaseOption.ts +2 -0
- package/src/types/models/quotes/QuoteRequestVehicleDriver.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,11 @@ 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,
|
|
51
62
|
}: Props) {
|
|
52
63
|
const [rego, setRego] = React.useState<string>(initialRegistrationValue);
|
|
53
64
|
const [odo, setOdo] = React.useState<string>('');
|
|
@@ -154,7 +165,7 @@ export default function RegistrationSearchField({
|
|
|
154
165
|
|
|
155
166
|
return (
|
|
156
167
|
<div className="w-full flex flex-col">
|
|
157
|
-
<div className="w-full flex flex-wrap gap-3 bg-gray-100 rounded-md p-3">
|
|
168
|
+
<div className={cn(outerClassName, "w-full flex flex-wrap gap-3 bg-gray-100 rounded-md p-3")}>
|
|
158
169
|
{showOdometerReadingField ||
|
|
159
170
|
(showConditionField && (
|
|
160
171
|
<div className="w-full grid grid-cols-2 gap-3">
|
|
@@ -168,11 +179,9 @@ export default function RegistrationSearchField({
|
|
|
168
179
|
id="odo_search"
|
|
169
180
|
value={odo}
|
|
170
181
|
onChange={handleChange}
|
|
171
|
-
className={
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
: ''
|
|
175
|
-
}`}
|
|
182
|
+
className={cn(odoInputClassName, "transition-all", {
|
|
183
|
+
'pointer-events-none opacity-50': status === 'processing',
|
|
184
|
+
})}
|
|
176
185
|
disabled={status === 'processing'}
|
|
177
186
|
/>
|
|
178
187
|
</label>
|
|
@@ -186,11 +195,9 @@ export default function RegistrationSearchField({
|
|
|
186
195
|
id="condition_search"
|
|
187
196
|
value={condition}
|
|
188
197
|
onChange={handleChange}
|
|
189
|
-
className={
|
|
190
|
-
status === 'processing'
|
|
191
|
-
|
|
192
|
-
: ''
|
|
193
|
-
}`}
|
|
198
|
+
className={cn(conditionSelectClassName, "transition-all", {
|
|
199
|
+
'pointer-events-none opacity-50': status === 'processing',
|
|
200
|
+
})}
|
|
194
201
|
disabled={status === 'processing'}
|
|
195
202
|
>
|
|
196
203
|
{conditionOptions.map(conditionOption => (
|
|
@@ -210,9 +217,9 @@ export default function RegistrationSearchField({
|
|
|
210
217
|
id={name}
|
|
211
218
|
value={rego}
|
|
212
219
|
onChange={handleChange}
|
|
213
|
-
className={
|
|
214
|
-
|
|
215
|
-
}
|
|
220
|
+
className={cn(regoInputClassName, "flex-grow transition-all", {
|
|
221
|
+
'pointer-events-none opacity-50': status === 'processing',
|
|
222
|
+
})}
|
|
216
223
|
disabled={status === 'processing'}
|
|
217
224
|
/>
|
|
218
225
|
|
|
@@ -221,7 +228,7 @@ export default function RegistrationSearchField({
|
|
|
221
228
|
type="button"
|
|
222
229
|
onClick={handleSearch}
|
|
223
230
|
disabled={status === 'processing'}
|
|
224
|
-
className={
|
|
231
|
+
className={cn(searchBtnClassName, "bg-teal px-4 py-3 rounded-md transition-all")}
|
|
225
232
|
>
|
|
226
233
|
<span className="sr-only">Search</span>
|
|
227
234
|
<svg
|