@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.
@@ -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={`transition-all ${
172
- status === 'processing'
173
- ? 'pointer-events-none opacity-50'
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={`transition-all ${
190
- status === 'processing'
191
- ? 'pointer-events-none opacity-50'
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={`flex-grow transition-all ${
214
- status === 'processing' ? 'pointer-events-none opacity-50' : ''
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={`bg-teal px-4 py-3 rounded-md transition-all`}
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
@@ -9,4 +9,5 @@ export interface PolicyEnhancement {
9
9
  auto_select?: boolean;
10
10
  sold_at?: string;
11
11
  purchase_option_id?: QuoteRequestPurchaseOption['id'];
12
+ key?: string;
12
13
  }
@@ -30,6 +30,8 @@ export interface QuoteRequestPurchaseOption {
30
30
  enhancements?: PolicyEnhancement[];
31
31
  benefits?: PolicyBenefit[];
32
32
  benefit_template?: PolicyBenefitTemplate;
33
+
34
+ key?: string;
33
35
  }
34
36
 
35
37
  export type PremiumType = 'annual' | 'total-due';
@@ -7,4 +7,5 @@ export interface QuoteRequestVehicleDriver {
7
7
  licence?: string;
8
8
  licence_other?: string;
9
9
  quote_request_vehicle_id?: number;
10
+ key?: string;
10
11
  }