@aurora-studio/starter-core 0.1.0 → 0.1.2
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.
|
@@ -84,5 +84,5 @@ export function CatalogueFilters({ categories, currentCategory, currentSort, onS
|
|
|
84
84
|
if (variant === "drawer") {
|
|
85
85
|
return (_jsx("div", { className: "bg-aurora-surface border-t border-aurora-border p-6", children: content }));
|
|
86
86
|
}
|
|
87
|
-
return (_jsx("aside", { className: "w-56 shrink-0 hidden
|
|
87
|
+
return (_jsx("aside", { className: "w-56 shrink-0 hidden md:block", children: _jsx("div", { className: "pattern-well sticky top-24 space-y-6 rounded-component border border-aurora-border p-4", children: content }) }));
|
|
88
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchDropdown.d.ts","sourceRoot":"","sources":["../../src/components/SearchDropdown.tsx"],"names":[],"mappings":"AA4BA,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,WAA4C,EAC5C,SAAS,EACT,cAAmB,EACnB,mBAAmB,GACpB,EAAE;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,yFAAyF;IACzF,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACxD,
|
|
1
|
+
{"version":3,"file":"SearchDropdown.d.ts","sourceRoot":"","sources":["../../src/components/SearchDropdown.tsx"],"names":[],"mappings":"AA4BA,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,WAA4C,EAC5C,SAAS,EACT,cAAmB,EACnB,mBAAmB,GACpB,EAAE;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,yFAAyF;IACzF,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACxD,2CA4RA"}
|
|
@@ -122,7 +122,7 @@ export function SearchDropdown({ vendorId, placeholder = "Search milk, bananas,
|
|
|
122
122
|
const showRecent = open && query.trim() && !loading && hits.length === 0 && recentSearches.length > 0;
|
|
123
123
|
const recipeSuggestion = getRecipeSuggestion?.(query) ?? null;
|
|
124
124
|
const showRecipeSuggestion = open && query.trim().length >= 2 && recipeSuggestion && !loading;
|
|
125
|
-
return (_jsxs("div", { ref: containerRef, className: `relative w-full ${fullWidth ? "" : "max-w-[280px]"}`, children: [_jsxs("div", { className: "relative", children: [_jsx(
|
|
125
|
+
return (_jsxs("div", { ref: containerRef, className: `relative w-full ${fullWidth ? "" : "max-w-[280px]"}`, children: [_jsxs("div", { className: "relative flex items-center", children: [_jsx("span", { className: "absolute left-0 flex items-center justify-center w-9 h-9 pointer-events-none text-aurora-muted", children: _jsx(Search, { className: "w-4 h-4" }) }), _jsx("input", { type: "search", value: query, onChange: (e) => setQuery(e.target.value), onFocus: () => (query.trim() || recentSearches.length) && setOpen(true), placeholder: placeholder, className: "w-full pl-9 pr-3 py-2 h-9 text-sm rounded-lg bg-aurora-surface border border-aurora-border text-aurora-text placeholder:text-aurora-muted focus:outline-none focus:ring-1 focus:ring-aurora-primary/50 focus:border-aurora-primary/70", "aria-label": "Search products" })] }), open && (query.trim() || showRecent) && (_jsx("div", { className: "absolute top-full left-0 right-0 mt-1 rounded-component bg-aurora-surface border border-aurora-border shadow-xl z-[9999] max-h-96 overflow-y-auto", children: loading ? (_jsx("div", { className: "p-4 text-aurora-muted text-sm", children: "Searching\u2026" })) : hits.length === 0 && !showRecent && !showRecipeSuggestion ? (_jsx("div", { className: "p-4 text-aurora-muted text-sm", children: "No results" })) : (_jsxs("div", { className: "py-2", children: [showRecipeSuggestion && (_jsx("div", { className: "px-3 py-1.5 text-xs font-semibold uppercase tracking-wider text-aurora-muted border-b border-aurora-border", children: "Suggestions" })), showRecipeSuggestion && (_jsxs(Link, { href: `/catalogue?q=${encodeURIComponent(recipeSuggestion.replace("?", "").split(" ")[0].toLowerCase())}`, onClick: () => {
|
|
126
126
|
addToRecent(recipeSuggestion);
|
|
127
127
|
setOpen(false);
|
|
128
128
|
}, className: "flex items-center gap-3 px-4 py-2 hover:bg-aurora-surface-hover transition-colors border-b border-aurora-border", children: [_jsx(Search, { className: "w-4 h-4 text-aurora-muted shrink-0" }), _jsx("span", { className: "font-medium truncate", children: recipeSuggestion })] })), hits.length > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "px-3 py-1.5 text-xs font-semibold uppercase tracking-wider text-aurora-muted border-b border-aurora-border", children: "Products" }), _jsx("ul", { children: hits.slice(0, 6).map((hit) => (_jsx("li", { className: "group/item", children: _jsxs("div", { className: "flex items-center gap-3 px-4 py-2 hover:bg-aurora-surface-hover transition-colors", children: [_jsxs(Link, { href: `/catalogue/${hit.recordId}`, onClick: () => {
|
|
@@ -15,5 +15,5 @@ export function SmartCartPanel() {
|
|
|
15
15
|
const toFreeDelivery = Math.max(0, FREE_DELIVERY_THRESHOLD_CENTS - total);
|
|
16
16
|
if (count === 0)
|
|
17
17
|
return null;
|
|
18
|
-
return (_jsx("div", { className: "sticky bottom-0 z-40 mt-10
|
|
18
|
+
return (_jsx("div", { className: "sticky bottom-0 z-40 mt-10 px-6 py-4 rounded-2xl bg-aurora-surface border border-aurora-border shadow-xl shadow-aurora-primary/5", children: _jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center sm:justify-between sm:gap-6 gap-3 max-w-4xl mx-auto", children: [_jsxs("div", { className: "flex items-center gap-4 min-w-0", children: [_jsx("span", { className: "flex items-center justify-center w-11 h-11 shrink-0 rounded-xl bg-aurora-primary/15 text-aurora-primary", children: _jsx(ShoppingBag, { className: "w-5 h-5" }) }), _jsxs("div", { className: "min-w-0", children: [_jsxs("p", { className: "font-semibold text-aurora-text text-base", children: [count, " ", count === 1 ? "item" : "items", " \u00B7 ", formatPrice(grandTotal)] }), toFreeDelivery > 0 && (_jsxs("p", { className: "text-sm text-aurora-primary font-medium mt-0.5", children: ["Add ", formatPrice(toFreeDelivery), " more for free delivery"] })), toFreeDelivery <= 0 && total > 0 && (_jsx("p", { className: "text-sm text-aurora-primary font-medium mt-0.5", children: "You've unlocked free delivery" }))] })] }), _jsx(Link, { href: "/cart", className: "inline-flex items-center justify-center px-6 py-2.5 rounded-xl bg-aurora-primary text-white font-semibold text-sm hover:bg-aurora-primary-dark transition-colors shrink-0 shadow-lg shadow-aurora-primary/25", children: "View cart \u00B7 Checkout" })] }) }));
|
|
19
19
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aurora-studio/starter-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "tsc -p tsconfig.build.json",
|
|
6
6
|
"prepare": "tsc -p tsconfig.build.json",
|
|
@@ -53,4 +53,4 @@
|
|
|
53
53
|
"url": "https://github.com/Purple-Napkin/aurora-starter-core/issues"
|
|
54
54
|
},
|
|
55
55
|
"homepage": "https://github.com/Purple-Napkin/aurora-starter-core#readme"
|
|
56
|
-
}
|
|
56
|
+
}
|