@betterstore/react 0.5.11 → 0.5.13

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/compounds/form/address-input/index.tsx"],"names":[],"mappings":"AA2BA,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,wBAAgB,YAAY,CAAC,EAC3B,SAAc,EACd,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,wBAAwB,GACzB,EAAE,iBAAiB,2CAyMnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/compounds/form/address-input/index.tsx"],"names":[],"mappings":"AA+BA,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,wBAAgB,YAAY,CAAC,EAC3B,SAAc,EACd,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,wBAAwB,GACzB,EAAE,iBAAiB,2CAmOnB"}
package/dist/index.cjs.js CHANGED
@@ -7395,7 +7395,9 @@ var Client = class {
7395
7395
  */
7396
7396
  async getExchangeRate(clientSecret, baseCurrency, targetCurrency) {
7397
7397
  const apiClient = createApiClient(clientSecret, this.proxy);
7398
- const { data } = await apiClient.get(`/helpers/rates/${baseCurrency}`);
7398
+ const data = await apiClient.get(
7399
+ `/helpers/rates/${baseCurrency}`
7400
+ );
7399
7401
  const rate = data.rates[targetCurrency];
7400
7402
  if (!rate) {
7401
7403
  throw new Error("Could not get exchange rate for target currency");
@@ -7413,12 +7415,17 @@ var Client = class {
7413
7415
  return data;
7414
7416
  }
7415
7417
  /**
7416
- * Get lookup address results
7418
+ * Get geocode address results
7417
7419
  */
7418
- async getLookupAddressResults(clientSecret, params) {
7420
+ async getGeocodeAddressResults(clientSecret, params) {
7419
7421
  const apiClient = createApiClient(clientSecret, this.proxy);
7420
- const { data } = await apiClient.get("/helpers/lookup-address", {
7421
- params
7422
+ const { position, ...rest } = params;
7423
+ const { data } = await apiClient.get("/helpers/geocode-address", {
7424
+ params: {
7425
+ ...rest,
7426
+ lat: position.lat,
7427
+ lng: position.lng
7428
+ }
7422
7429
  });
7423
7430
  return data;
7424
7431
  }
@@ -23575,8 +23582,19 @@ const createLucideIcon = (iconName, iconNode) => {
23575
23582
  */
23576
23583
 
23577
23584
 
23578
- const __iconNode$7 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
23579
- const Check = createLucideIcon("Check", __iconNode$7);
23585
+ const __iconNode$8 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
23586
+ const Check = createLucideIcon("Check", __iconNode$8);
23587
+
23588
+ /**
23589
+ * @license lucide-react v0.479.0 - ISC
23590
+ *
23591
+ * This source code is licensed under the ISC license.
23592
+ * See the LICENSE file in the root directory of this source tree.
23593
+ */
23594
+
23595
+
23596
+ const __iconNode$7 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
23597
+ const ChevronDown = createLucideIcon("ChevronDown", __iconNode$7);
23580
23598
 
23581
23599
  /**
23582
23600
  * @license lucide-react v0.479.0 - ISC
@@ -23586,8 +23604,8 @@ const Check = createLucideIcon("Check", __iconNode$7);
23586
23604
  */
23587
23605
 
23588
23606
 
23589
- const __iconNode$6 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
23590
- const ChevronDown = createLucideIcon("ChevronDown", __iconNode$6);
23607
+ const __iconNode$6 = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
23608
+ const ChevronLeft = createLucideIcon("ChevronLeft", __iconNode$6);
23591
23609
 
23592
23610
  /**
23593
23611
  * @license lucide-react v0.479.0 - ISC
@@ -23597,8 +23615,8 @@ const ChevronDown = createLucideIcon("ChevronDown", __iconNode$6);
23597
23615
  */
23598
23616
 
23599
23617
 
23600
- const __iconNode$5 = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
23601
- const ChevronLeft = createLucideIcon("ChevronLeft", __iconNode$5);
23618
+ const __iconNode$5 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
23619
+ const ChevronRight = createLucideIcon("ChevronRight", __iconNode$5);
23602
23620
 
23603
23621
  /**
23604
23622
  * @license lucide-react v0.479.0 - ISC
@@ -34403,8 +34421,8 @@ function AddressInput({ className = "", proxy, clientSecret, latitude, longitude
34403
34421
  countryCode,
34404
34422
  });
34405
34423
  console.log(results);
34406
- setShowSuggestions(results.length > 0);
34407
34424
  setSuggestions(results);
34425
+ setShowSuggestions(true);
34408
34426
  }
34409
34427
  catch (error) {
34410
34428
  console.error("Error fetching address suggestions:", error);
@@ -34426,16 +34444,26 @@ function AddressInput({ className = "", proxy, clientSecret, latitude, longitude
34426
34444
  }, [showAllInputs, addressInput]);
34427
34445
  const handleSelectAddress = (address) => {
34428
34446
  console.log(address);
34429
- // Set all address fields from the selected address
34430
- // form.setValue("address.line1", address.line1);
34431
- // form.setValue("address.line2", address.line2);
34432
- // form.setValue("address.city", address.city);
34433
- // form.setValue("address.country", address.country);
34434
- // form.setValue("address.countryCode", address.countryCode);
34435
- // form.setValue("address.province", address.province);
34436
- // form.setValue("address.provinceCode", address.provinceCode);
34437
- // form.setValue("address.zipCode", address.zipCode);
34447
+ const isLookup = "line1" in address;
34448
+ if (!isLookup) {
34449
+ setIsLoading(true);
34450
+ storeClient
34451
+ .getGeocodeAddressResults(clientSecret, address)
34452
+ .then((results) => {
34453
+ console.log(results);
34454
+ });
34455
+ return;
34456
+ }
34457
+ const geocodeAddress = address;
34458
+ form.setValue("address.line1", geocodeAddress.line1);
34459
+ form.setValue("address.line2", geocodeAddress.line2);
34460
+ form.setValue("address.city", geocodeAddress.city);
34461
+ form.setValue("address.province", geocodeAddress.province);
34462
+ form.setValue("address.provinceCode", geocodeAddress.provinceCode);
34463
+ form.setValue("address.zipCode", geocodeAddress.zipCode);
34438
34464
  setShowSuggestions(false);
34465
+ setShowAllInputs(true);
34466
+ setSuggestions([]);
34439
34467
  };
34440
34468
  const handleManualEntry = () => {
34441
34469
  setShowAllInputs(true);
@@ -34443,7 +34471,10 @@ function AddressInput({ className = "", proxy, clientSecret, latitude, longitude
34443
34471
  React.useEffect(() => {
34444
34472
  setShowAllInputs((cityInput === null || cityInput === void 0 ? void 0 : cityInput.length) > 0);
34445
34473
  }, [cityInput]);
34446
- return (jsxRuntime.jsxs("div", { className: cn("space-y-5", className), children: [jsxRuntime.jsx(CountryInput, { prefix: "address", label: "Country", form: form }), jsxRuntime.jsxs("div", { className: "relative", children: [jsxRuntime.jsx(InputGroup, { name: "address.line1", label: showAllInputs ? "Address" : "Start typing address", required: showAllInputs, icon: jsxRuntime.jsx(Search, { className: "h-4 w-4" }), showIcon: !showAllInputs }), !showAllInputs && (showSuggestions || isLoading) && (jsxRuntime.jsx("div", { className: "bg-background border-border absolute left-0 right-0 top-full z-50 mt-1 rounded-md border shadow-lg", children: isLoading ? (jsxRuntime.jsx("div", { className: "text-muted-foreground border-border border-b p-3 text-sm", children: "Searching for addresses..." })) : suggestions.length > 0 ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "text-muted-foreground border-border border-b p-3 text-sm", children: "Keep typing address to display results" }), jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto", children: suggestions.map((address, index) => (jsxRuntime.jsx("button", { onClick: () => handleSelectAddress(address), className: "hover:bg-accent border-border flex w-full items-center border-b px-3 py-3 text-left transition-colors last:border-b-0", children: jsxRuntime.jsx("div", { className: "text-foreground text-sm", children: address.title }) }, index))) })] })) : (jsxRuntime.jsx("div", { className: "text-muted-foreground border-border border-b p-3 text-sm", children: "No addresses found" })) }))] }), jsxRuntime.jsx("div", { className: cn(!showAllInputs ? "-mt-2 mb-4 block" : "hidden"), children: jsxRuntime.jsx("button", { type: "button", onClick: handleManualEntry, className: "text-foreground hover:text-muted-foreground cursor-pointer text-[13px] underline", children: "Enter address manually" }) }), jsxRuntime.jsxs("div", { className: cn("space-y-4", !showAllInputs && "-mt-4 h-0 max-h-0 w-0 max-w-0 opacity-0"), children: [jsxRuntime.jsx("div", { className: cn(!showApartmentField ? "block" : "hidden"), children: jsxRuntime.jsxs("button", { type: "button", onClick: () => {
34474
+ return (jsxRuntime.jsxs("div", { className: cn("space-y-5", className), children: [jsxRuntime.jsx(CountryInput, { prefix: "address", label: "Country", form: form }), jsxRuntime.jsxs("div", { className: "relative", children: [jsxRuntime.jsx(InputGroup, { name: "address.line1", label: showAllInputs ? "Address" : "Start typing address", required: showAllInputs, icon: jsxRuntime.jsx(Search, { className: "h-4 w-4" }), showIcon: !showAllInputs, onFocus: () => setShowSuggestions(true), onBlur: () => setShowSuggestions(false) }), !showAllInputs && (showSuggestions || isLoading) && (jsxRuntime.jsx("div", { className: "bg-background border-border absolute left-0 right-0 top-full z-50 mt-1 rounded-md border shadow-lg", "data-dropdown": "suggestions", children: isLoading ? (jsxRuntime.jsx("div", { className: "text-muted-foreground border-border border-b p-3 text-sm", children: "Searching for addresses..." })) : suggestions.length > 0 ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "text-muted-foreground border-border border-b p-3 text-sm", children: "Keep typing address to display results" }), jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto", children: suggestions.map((address, index) => {
34475
+ const isLookup = "line1" in address;
34476
+ return (jsxRuntime.jsxs("button", { type: "button", onClick: () => handleSelectAddress(address), className: "hover:bg-accent border-border flex w-full cursor-pointer items-center border-b px-3 py-3 text-left transition-colors last:border-b-0", children: [jsxRuntime.jsx("div", { className: "text-foreground text-sm", children: address.title }), !isLookup && (jsxRuntime.jsx(ChevronRight, { className: "text-muted-foreground ml-auto size-4" }))] }, index));
34477
+ }) })] })) : (jsxRuntime.jsx("div", { className: "text-muted-foreground border-border border-b p-3 text-sm", children: "No addresses found" })) }))] }), jsxRuntime.jsx("div", { className: cn(!showAllInputs ? "-mt-2 mb-4 block" : "hidden"), children: jsxRuntime.jsx("button", { type: "button", onClick: handleManualEntry, className: "text-foreground hover:text-muted-foreground cursor-pointer text-[13px] underline", children: "Enter address manually" }) }), jsxRuntime.jsxs("div", { className: cn("space-y-4", !showAllInputs && "-mt-4 h-0 max-h-0 w-0 max-w-0 opacity-0"), children: [jsxRuntime.jsx("div", { className: cn(!showApartmentField ? "block" : "hidden"), children: jsxRuntime.jsxs("button", { type: "button", onClick: () => {
34447
34478
  setShowApartmentField(true);
34448
34479
  form.setFocus("address.line2");
34449
34480
  }, className: "text-muted-foreground hover:text-foreground flex cursor-pointer items-center gap-2 text-sm transition-colors", children: [jsxRuntime.jsx(Plus, { className: "h-4 w-4" }), "Add Company, C/O, Apt, Suite, Unit"] }) }), jsxRuntime.jsx("div", { className: cn(!showApartmentField && "-mt-4 h-0 max-h-0 w-0 max-w-0 opacity-0"), children: jsxRuntime.jsx(InputGroup, { name: "address.line2", label: "Company, C/O, Apt, Suite, Unit" }) }), jsxRuntime.jsxs("div", { className: "grid grid-cols-3 gap-4", children: [jsxRuntime.jsx(InputGroup, { name: "address.city", label: "City", required: true }), jsxRuntime.jsx(SelectGroup, { name: "address.province", label: "State", options: stateOptions, required: true }), jsxRuntime.jsx(InputGroup, { name: "address.zipCode", label: "Postal Code", required: true })] })] })] }));
package/dist/index.mjs CHANGED
@@ -7375,7 +7375,9 @@ var Client = class {
7375
7375
  */
7376
7376
  async getExchangeRate(clientSecret, baseCurrency, targetCurrency) {
7377
7377
  const apiClient = createApiClient(clientSecret, this.proxy);
7378
- const { data } = await apiClient.get(`/helpers/rates/${baseCurrency}`);
7378
+ const data = await apiClient.get(
7379
+ `/helpers/rates/${baseCurrency}`
7380
+ );
7379
7381
  const rate = data.rates[targetCurrency];
7380
7382
  if (!rate) {
7381
7383
  throw new Error("Could not get exchange rate for target currency");
@@ -7393,12 +7395,17 @@ var Client = class {
7393
7395
  return data;
7394
7396
  }
7395
7397
  /**
7396
- * Get lookup address results
7398
+ * Get geocode address results
7397
7399
  */
7398
- async getLookupAddressResults(clientSecret, params) {
7400
+ async getGeocodeAddressResults(clientSecret, params) {
7399
7401
  const apiClient = createApiClient(clientSecret, this.proxy);
7400
- const { data } = await apiClient.get("/helpers/lookup-address", {
7401
- params
7402
+ const { position, ...rest } = params;
7403
+ const { data } = await apiClient.get("/helpers/geocode-address", {
7404
+ params: {
7405
+ ...rest,
7406
+ lat: position.lat,
7407
+ lng: position.lng
7408
+ }
7402
7409
  });
7403
7410
  return data;
7404
7411
  }
@@ -23555,8 +23562,19 @@ const createLucideIcon = (iconName, iconNode) => {
23555
23562
  */
23556
23563
 
23557
23564
 
23558
- const __iconNode$7 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
23559
- const Check = createLucideIcon("Check", __iconNode$7);
23565
+ const __iconNode$8 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
23566
+ const Check = createLucideIcon("Check", __iconNode$8);
23567
+
23568
+ /**
23569
+ * @license lucide-react v0.479.0 - ISC
23570
+ *
23571
+ * This source code is licensed under the ISC license.
23572
+ * See the LICENSE file in the root directory of this source tree.
23573
+ */
23574
+
23575
+
23576
+ const __iconNode$7 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
23577
+ const ChevronDown = createLucideIcon("ChevronDown", __iconNode$7);
23560
23578
 
23561
23579
  /**
23562
23580
  * @license lucide-react v0.479.0 - ISC
@@ -23566,8 +23584,8 @@ const Check = createLucideIcon("Check", __iconNode$7);
23566
23584
  */
23567
23585
 
23568
23586
 
23569
- const __iconNode$6 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
23570
- const ChevronDown = createLucideIcon("ChevronDown", __iconNode$6);
23587
+ const __iconNode$6 = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
23588
+ const ChevronLeft = createLucideIcon("ChevronLeft", __iconNode$6);
23571
23589
 
23572
23590
  /**
23573
23591
  * @license lucide-react v0.479.0 - ISC
@@ -23577,8 +23595,8 @@ const ChevronDown = createLucideIcon("ChevronDown", __iconNode$6);
23577
23595
  */
23578
23596
 
23579
23597
 
23580
- const __iconNode$5 = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
23581
- const ChevronLeft = createLucideIcon("ChevronLeft", __iconNode$5);
23598
+ const __iconNode$5 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
23599
+ const ChevronRight = createLucideIcon("ChevronRight", __iconNode$5);
23582
23600
 
23583
23601
  /**
23584
23602
  * @license lucide-react v0.479.0 - ISC
@@ -34383,8 +34401,8 @@ function AddressInput({ className = "", proxy, clientSecret, latitude, longitude
34383
34401
  countryCode,
34384
34402
  });
34385
34403
  console.log(results);
34386
- setShowSuggestions(results.length > 0);
34387
34404
  setSuggestions(results);
34405
+ setShowSuggestions(true);
34388
34406
  }
34389
34407
  catch (error) {
34390
34408
  console.error("Error fetching address suggestions:", error);
@@ -34406,16 +34424,26 @@ function AddressInput({ className = "", proxy, clientSecret, latitude, longitude
34406
34424
  }, [showAllInputs, addressInput]);
34407
34425
  const handleSelectAddress = (address) => {
34408
34426
  console.log(address);
34409
- // Set all address fields from the selected address
34410
- // form.setValue("address.line1", address.line1);
34411
- // form.setValue("address.line2", address.line2);
34412
- // form.setValue("address.city", address.city);
34413
- // form.setValue("address.country", address.country);
34414
- // form.setValue("address.countryCode", address.countryCode);
34415
- // form.setValue("address.province", address.province);
34416
- // form.setValue("address.provinceCode", address.provinceCode);
34417
- // form.setValue("address.zipCode", address.zipCode);
34427
+ const isLookup = "line1" in address;
34428
+ if (!isLookup) {
34429
+ setIsLoading(true);
34430
+ storeClient
34431
+ .getGeocodeAddressResults(clientSecret, address)
34432
+ .then((results) => {
34433
+ console.log(results);
34434
+ });
34435
+ return;
34436
+ }
34437
+ const geocodeAddress = address;
34438
+ form.setValue("address.line1", geocodeAddress.line1);
34439
+ form.setValue("address.line2", geocodeAddress.line2);
34440
+ form.setValue("address.city", geocodeAddress.city);
34441
+ form.setValue("address.province", geocodeAddress.province);
34442
+ form.setValue("address.provinceCode", geocodeAddress.provinceCode);
34443
+ form.setValue("address.zipCode", geocodeAddress.zipCode);
34418
34444
  setShowSuggestions(false);
34445
+ setShowAllInputs(true);
34446
+ setSuggestions([]);
34419
34447
  };
34420
34448
  const handleManualEntry = () => {
34421
34449
  setShowAllInputs(true);
@@ -34423,7 +34451,10 @@ function AddressInput({ className = "", proxy, clientSecret, latitude, longitude
34423
34451
  useEffect(() => {
34424
34452
  setShowAllInputs((cityInput === null || cityInput === void 0 ? void 0 : cityInput.length) > 0);
34425
34453
  }, [cityInput]);
34426
- return (jsxs("div", { className: cn("space-y-5", className), children: [jsx(CountryInput, { prefix: "address", label: "Country", form: form }), jsxs("div", { className: "relative", children: [jsx(InputGroup, { name: "address.line1", label: showAllInputs ? "Address" : "Start typing address", required: showAllInputs, icon: jsx(Search, { className: "h-4 w-4" }), showIcon: !showAllInputs }), !showAllInputs && (showSuggestions || isLoading) && (jsx("div", { className: "bg-background border-border absolute left-0 right-0 top-full z-50 mt-1 rounded-md border shadow-lg", children: isLoading ? (jsx("div", { className: "text-muted-foreground border-border border-b p-3 text-sm", children: "Searching for addresses..." })) : suggestions.length > 0 ? (jsxs(Fragment, { children: [jsx("div", { className: "text-muted-foreground border-border border-b p-3 text-sm", children: "Keep typing address to display results" }), jsx("div", { className: "max-h-60 overflow-y-auto", children: suggestions.map((address, index) => (jsx("button", { onClick: () => handleSelectAddress(address), className: "hover:bg-accent border-border flex w-full items-center border-b px-3 py-3 text-left transition-colors last:border-b-0", children: jsx("div", { className: "text-foreground text-sm", children: address.title }) }, index))) })] })) : (jsx("div", { className: "text-muted-foreground border-border border-b p-3 text-sm", children: "No addresses found" })) }))] }), jsx("div", { className: cn(!showAllInputs ? "-mt-2 mb-4 block" : "hidden"), children: jsx("button", { type: "button", onClick: handleManualEntry, className: "text-foreground hover:text-muted-foreground cursor-pointer text-[13px] underline", children: "Enter address manually" }) }), jsxs("div", { className: cn("space-y-4", !showAllInputs && "-mt-4 h-0 max-h-0 w-0 max-w-0 opacity-0"), children: [jsx("div", { className: cn(!showApartmentField ? "block" : "hidden"), children: jsxs("button", { type: "button", onClick: () => {
34454
+ return (jsxs("div", { className: cn("space-y-5", className), children: [jsx(CountryInput, { prefix: "address", label: "Country", form: form }), jsxs("div", { className: "relative", children: [jsx(InputGroup, { name: "address.line1", label: showAllInputs ? "Address" : "Start typing address", required: showAllInputs, icon: jsx(Search, { className: "h-4 w-4" }), showIcon: !showAllInputs, onFocus: () => setShowSuggestions(true), onBlur: () => setShowSuggestions(false) }), !showAllInputs && (showSuggestions || isLoading) && (jsx("div", { className: "bg-background border-border absolute left-0 right-0 top-full z-50 mt-1 rounded-md border shadow-lg", "data-dropdown": "suggestions", children: isLoading ? (jsx("div", { className: "text-muted-foreground border-border border-b p-3 text-sm", children: "Searching for addresses..." })) : suggestions.length > 0 ? (jsxs(Fragment, { children: [jsx("div", { className: "text-muted-foreground border-border border-b p-3 text-sm", children: "Keep typing address to display results" }), jsx("div", { className: "max-h-60 overflow-y-auto", children: suggestions.map((address, index) => {
34455
+ const isLookup = "line1" in address;
34456
+ return (jsxs("button", { type: "button", onClick: () => handleSelectAddress(address), className: "hover:bg-accent border-border flex w-full cursor-pointer items-center border-b px-3 py-3 text-left transition-colors last:border-b-0", children: [jsx("div", { className: "text-foreground text-sm", children: address.title }), !isLookup && (jsx(ChevronRight, { className: "text-muted-foreground ml-auto size-4" }))] }, index));
34457
+ }) })] })) : (jsx("div", { className: "text-muted-foreground border-border border-b p-3 text-sm", children: "No addresses found" })) }))] }), jsx("div", { className: cn(!showAllInputs ? "-mt-2 mb-4 block" : "hidden"), children: jsx("button", { type: "button", onClick: handleManualEntry, className: "text-foreground hover:text-muted-foreground cursor-pointer text-[13px] underline", children: "Enter address manually" }) }), jsxs("div", { className: cn("space-y-4", !showAllInputs && "-mt-4 h-0 max-h-0 w-0 max-w-0 opacity-0"), children: [jsx("div", { className: cn(!showApartmentField ? "block" : "hidden"), children: jsxs("button", { type: "button", onClick: () => {
34427
34458
  setShowApartmentField(true);
34428
34459
  form.setFocus("address.line2");
34429
34460
  }, className: "text-muted-foreground hover:text-foreground flex cursor-pointer items-center gap-2 text-sm transition-colors", children: [jsx(Plus, { className: "h-4 w-4" }), "Add Company, C/O, Apt, Suite, Unit"] }) }), jsx("div", { className: cn(!showApartmentField && "-mt-4 h-0 max-h-0 w-0 max-w-0 opacity-0"), children: jsx(InputGroup, { name: "address.line2", label: "Company, C/O, Apt, Suite, Unit" }) }), jsxs("div", { className: "grid grid-cols-3 gap-4", children: [jsx(InputGroup, { name: "address.city", label: "City", required: true }), jsx(SelectGroup, { name: "address.province", label: "State", options: stateOptions, required: true }), jsx(InputGroup, { name: "address.zipCode", label: "Postal Code", required: true })] })] })] }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/react",
3
- "version": "0.5.11",
3
+ "version": "0.5.13",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -27,8 +27,8 @@
27
27
  "tailwindcss": "^4.1.11",
28
28
  "typescript": "5.8.2",
29
29
  "vite": "^6.3.5",
30
- "@betterstore/typescript-config": "0.0.0",
31
- "@betterstore/eslint-config": "0.0.0"
30
+ "@betterstore/eslint-config": "0.0.0",
31
+ "@betterstore/typescript-config": "0.0.0"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": "^18.0.0 || ^19.0.0",
@@ -77,7 +77,7 @@
77
77
  "tailwindcss-animate": "^1.0.7",
78
78
  "zod": "^3.25.30",
79
79
  "zustand": "^5.0.5",
80
- "@betterstore/sdk": "0.5.11"
80
+ "@betterstore/sdk": "0.5.13"
81
81
  },
82
82
  "publishConfig": {
83
83
  "access": "public"