@betterstore/react 0.5.13 → 0.5.14
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":"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,
|
|
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,2CAqOnB"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -34443,7 +34443,6 @@ function AddressInput({ className = "", proxy, clientSecret, latitude, longitude
|
|
|
34443
34443
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34444
34444
|
}, [showAllInputs, addressInput]);
|
|
34445
34445
|
const handleSelectAddress = (address) => {
|
|
34446
|
-
console.log(address);
|
|
34447
34446
|
const isLookup = "line1" in address;
|
|
34448
34447
|
if (!isLookup) {
|
|
34449
34448
|
setIsLoading(true);
|
|
@@ -34451,6 +34450,9 @@ function AddressInput({ className = "", proxy, clientSecret, latitude, longitude
|
|
|
34451
34450
|
.getGeocodeAddressResults(clientSecret, address)
|
|
34452
34451
|
.then((results) => {
|
|
34453
34452
|
console.log(results);
|
|
34453
|
+
setIsLoading(false);
|
|
34454
|
+
setShowSuggestions(false);
|
|
34455
|
+
setSuggestions(results);
|
|
34454
34456
|
});
|
|
34455
34457
|
return;
|
|
34456
34458
|
}
|
|
@@ -34471,7 +34473,7 @@ function AddressInput({ className = "", proxy, clientSecret, latitude, longitude
|
|
|
34471
34473
|
React.useEffect(() => {
|
|
34472
34474
|
setShowAllInputs((cityInput === null || cityInput === void 0 ? void 0 : cityInput.length) > 0);
|
|
34473
34475
|
}, [cityInput]);
|
|
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) => {
|
|
34476
|
+
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: () => setTimeout(() => setShowSuggestions(false), 100) }), !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
34477
|
const isLookup = "line1" in address;
|
|
34476
34478
|
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
34479
|
}) })] })) : (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: () => {
|
package/dist/index.mjs
CHANGED
|
@@ -34423,7 +34423,6 @@ function AddressInput({ className = "", proxy, clientSecret, latitude, longitude
|
|
|
34423
34423
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34424
34424
|
}, [showAllInputs, addressInput]);
|
|
34425
34425
|
const handleSelectAddress = (address) => {
|
|
34426
|
-
console.log(address);
|
|
34427
34426
|
const isLookup = "line1" in address;
|
|
34428
34427
|
if (!isLookup) {
|
|
34429
34428
|
setIsLoading(true);
|
|
@@ -34431,6 +34430,9 @@ function AddressInput({ className = "", proxy, clientSecret, latitude, longitude
|
|
|
34431
34430
|
.getGeocodeAddressResults(clientSecret, address)
|
|
34432
34431
|
.then((results) => {
|
|
34433
34432
|
console.log(results);
|
|
34433
|
+
setIsLoading(false);
|
|
34434
|
+
setShowSuggestions(false);
|
|
34435
|
+
setSuggestions(results);
|
|
34434
34436
|
});
|
|
34435
34437
|
return;
|
|
34436
34438
|
}
|
|
@@ -34451,7 +34453,7 @@ function AddressInput({ className = "", proxy, clientSecret, latitude, longitude
|
|
|
34451
34453
|
useEffect(() => {
|
|
34452
34454
|
setShowAllInputs((cityInput === null || cityInput === void 0 ? void 0 : cityInput.length) > 0);
|
|
34453
34455
|
}, [cityInput]);
|
|
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) => {
|
|
34456
|
+
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: () => setTimeout(() => setShowSuggestions(false), 100) }), !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
34457
|
const isLookup = "line1" in address;
|
|
34456
34458
|
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
34459
|
}) })] })) : (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: () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@betterstore/react",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.14",
|
|
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/
|
|
31
|
-
"@betterstore/
|
|
30
|
+
"@betterstore/typescript-config": "0.0.0",
|
|
31
|
+
"@betterstore/eslint-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.
|
|
80
|
+
"@betterstore/sdk": "0.5.14"
|
|
81
81
|
},
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|