@4alldigital/foundation-ui--core 3.6.3 → 3.6.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4alldigital/foundation-ui--core",
3
- "version": "3.6.3",
3
+ "version": "3.6.4",
4
4
  "description": "Foundation UI Core Component Library (source distribution)",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -32,5 +32,5 @@
32
32
  },
33
33
  "author": "Joe Mewes",
34
34
  "license": "MIT",
35
- "gitHead": "5dcdc71b322c80c27ad09a4944de45f387a4d607"
35
+ "gitHead": "3b1ed46039f81fdd9936f576f03e3981156a81c6"
36
36
  }
@@ -7,6 +7,7 @@ import FormSelect from '../FormSelect';
7
7
 
8
8
  // Common countries
9
9
  const COUNTRIES = [
10
+ { value: '', label: 'Select Country', disabled: true },
10
11
  { value: 'GB', label: 'United Kingdom' },
11
12
  { value: 'US', label: 'United States' },
12
13
  { value: 'CA', label: 'Canada' },
@@ -85,7 +86,18 @@ export const AddressForm = React.forwardRef<HTMLDivElement, AddressFormProps>(
85
86
  updated.postal_code &&
86
87
  updated.country
87
88
  ) {
88
- onChange(updated as ShippingAddress);
89
+ // Create a clean object with only the required fields
90
+ const cleanAddress: ShippingAddress = {
91
+ name: updated.name,
92
+ line1: updated.line1,
93
+ line2: updated.line2,
94
+ city: updated.city,
95
+ state: updated.state,
96
+ postal_code: updated.postal_code,
97
+ country: updated.country,
98
+ phone: updated.phone,
99
+ };
100
+ onChange(cleanAddress);
89
101
  }
90
102
  };
91
103
 
@@ -181,7 +193,7 @@ export const AddressForm = React.forwardRef<HTMLDivElement, AddressFormProps>(
181
193
  id="shipping-country"
182
194
  placeholder="Country"
183
195
  value={address.country || ''}
184
- onChange={(value) => handleChange('country', value)}
196
+ onChange={(e) => handleChange('country', e.target.value)}
185
197
  onBlur={() => handleBlur('country')}
186
198
  options={COUNTRIES}
187
199
  disabled={disabled}