@burdenoff/microfe-coolandlovely 2026.820.2 → 2026.820.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/dist/coolandlovely/hooks/index.d.ts +2 -2
- package/dist/coolandlovely/hooks/index.d.ts.map +1 -1
- package/dist/coolandlovely/hooks/useCoolAndLovelyApi.d.ts +11 -1
- package/dist/coolandlovely/hooks/useCoolAndLovelyApi.d.ts.map +1 -1
- package/dist/coolandlovely/hooks/useCoolAndLovelyApi.js +43 -1
- package/dist/coolandlovely/hooks/useCoolAndLovelyApi.js.map +1 -1
- package/dist/coolandlovely/pages/discover/DiscoverPage.d.ts +7 -6
- package/dist/coolandlovely/pages/discover/DiscoverPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/discover/DiscoverPage.js +480 -165
- package/dist/coolandlovely/pages/discover/DiscoverPage.js.map +1 -1
- package/dist/coolandlovely/types/index.d.ts +17 -0
- package/dist/coolandlovely/types/index.d.ts.map +1 -1
- package/dist/stories/DiscoverPage.stories.d.ts +11 -0
- package/dist/stories/DiscoverPage.stories.d.ts.map +1 -0
- package/dist/stories/__fixtures__/coolandlovely.d.ts +3 -1
- package/dist/stories/__fixtures__/coolandlovely.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,224 +1,539 @@
|
|
|
1
1
|
import { useCoolAndLovely as e } from "../../context/CoolAndLovelyContext.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { cn as t } from "../../utils/cn.js";
|
|
3
|
+
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
+
import { StatusBadge as r } from "../../components/StatusBadge.js";
|
|
5
|
+
import { ErrorView as i, LoadingView as a } from "../../components/StateViews.js";
|
|
6
|
+
import { Thumbnail as o } from "../../components/Thumbnail.js";
|
|
7
|
+
import { useLooks as s, useMyFollowing as c, useMyStyleProfile as l, useSearchLooks as u, useSearchStyleItems as d, useStyleItems as f } from "../../hooks/useCoolAndLovelyApi.js";
|
|
8
|
+
import { formatPrice as ee, titleCase as p } from "../../utils/formatters.js";
|
|
9
|
+
import { LookCard as te } from "../../components/LookCard.js";
|
|
7
10
|
import "../../hooks/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
11
|
+
import { STYLE_CATEGORIES as ne, categoryIcon as m } from "../../utils/icons.js";
|
|
12
|
+
import { EmptyState as h } from "../../components/EmptyState.js";
|
|
13
|
+
import { ColourSwatchRow as g } from "../../components/ColourSwatchRow.js";
|
|
14
|
+
import { useMemo as re, useState as _ } from "react";
|
|
15
|
+
import { ChevronLeft as v, ChevronRight as y, Compass as b, Heart as ie, Search as ae, Shirt as oe, ShoppingBag as x, Sparkles as S, UserCheck as se, Users as ce, X as C } from "lucide-react";
|
|
16
|
+
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
17
|
+
import { EmphasisPanel as le, PagePurpose as ue } from "@burdenoff/fe-libs/ui";
|
|
14
18
|
//#region src/coolandlovely/pages/discover/DiscoverPage.tsx
|
|
15
|
-
function
|
|
19
|
+
function D(e) {
|
|
16
20
|
return new Set(e.map((e) => e.trim().toLowerCase()).filter(Boolean));
|
|
17
21
|
}
|
|
18
|
-
function
|
|
22
|
+
function O(e, t) {
|
|
19
23
|
let n = 0;
|
|
20
24
|
for (let r of e) t.has(r.trim().toLowerCase()) && (n += 1);
|
|
21
25
|
return n;
|
|
22
26
|
}
|
|
23
|
-
var
|
|
27
|
+
var k = ({ title: e, icon: t, sublabel: n, children: r }) => /* @__PURE__ */ E("section", {
|
|
24
28
|
className: "mt-8",
|
|
25
|
-
children: [/* @__PURE__ */
|
|
29
|
+
children: [/* @__PURE__ */ E("div", {
|
|
26
30
|
className: "mb-3",
|
|
27
|
-
children: [/* @__PURE__ */
|
|
31
|
+
children: [/* @__PURE__ */ E("h2", {
|
|
28
32
|
className: "flex items-center gap-2 text-lg font-semibold text-text-primary",
|
|
29
33
|
children: [
|
|
30
34
|
t,
|
|
31
35
|
" ",
|
|
32
36
|
e
|
|
33
37
|
]
|
|
34
|
-
}), n ? /* @__PURE__ */
|
|
38
|
+
}), n ? /* @__PURE__ */ T("p", {
|
|
35
39
|
className: "mt-0.5 text-sm text-text-secondary",
|
|
36
40
|
children: n
|
|
37
41
|
}) : null]
|
|
38
42
|
}), r]
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
}), de = [
|
|
44
|
+
{
|
|
45
|
+
value: "for-you",
|
|
46
|
+
label: "For you",
|
|
47
|
+
icon: /* @__PURE__ */ T(b, { className: "h-4 w-4" })
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: "items",
|
|
51
|
+
label: "Items",
|
|
52
|
+
icon: /* @__PURE__ */ T(x, { className: "h-4 w-4" })
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
value: "looks",
|
|
56
|
+
label: "Looks",
|
|
57
|
+
icon: /* @__PURE__ */ T(S, { className: "h-4 w-4" })
|
|
58
|
+
}
|
|
59
|
+
], A = [
|
|
60
|
+
{
|
|
61
|
+
value: "ALL",
|
|
62
|
+
label: "All"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
value: "ACTIVE",
|
|
66
|
+
label: "Active"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
value: "DRAFT",
|
|
70
|
+
label: "Draft"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
value: "OUT_OF_STOCK",
|
|
74
|
+
label: "Out of stock"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
value: "RETIRED",
|
|
78
|
+
label: "Retired"
|
|
79
|
+
}
|
|
80
|
+
], j = [
|
|
81
|
+
{
|
|
82
|
+
value: "ALL",
|
|
83
|
+
label: "All"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
value: "EVERYDAY",
|
|
87
|
+
label: "Everyday"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
value: "WORK",
|
|
91
|
+
label: "Work"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
value: "EVENING",
|
|
95
|
+
label: "Evening"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
value: "WEDDING_GUEST",
|
|
99
|
+
label: "Wedding guest"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
value: "VACATION",
|
|
103
|
+
label: "Vacation"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
value: "PARTY",
|
|
107
|
+
label: "Party"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
value: "ACTIVE",
|
|
111
|
+
label: "Active"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
value: "OTHER",
|
|
115
|
+
label: "Other"
|
|
116
|
+
}
|
|
117
|
+
], M = 24;
|
|
118
|
+
function N() {
|
|
119
|
+
let { navigateTo: N } = e(), P = l(), F = s({ pagination: {
|
|
42
120
|
limit: 100,
|
|
43
121
|
offset: 0
|
|
44
|
-
} }),
|
|
122
|
+
} }), I = f({ pagination: {
|
|
45
123
|
limit: 100,
|
|
46
124
|
offset: 0
|
|
47
|
-
} }),
|
|
48
|
-
|
|
125
|
+
} }), L = c(), [R, fe] = _("for-you"), [z, B] = _(""), [V, H] = _(0), [U, W] = _(0), [G, K] = _([]), [q, J] = _("ALL"), [Y, X] = _("ALL"), Z = d({
|
|
126
|
+
input: {
|
|
127
|
+
query: z.trim() || void 0,
|
|
128
|
+
categories: G.length > 0 ? G : void 0,
|
|
129
|
+
status: q === "ALL" ? void 0 : q
|
|
130
|
+
},
|
|
131
|
+
pagination: {
|
|
132
|
+
limit: M,
|
|
133
|
+
offset: V
|
|
134
|
+
}
|
|
135
|
+
}), Q = u({
|
|
136
|
+
input: {
|
|
137
|
+
query: z.trim() || void 0,
|
|
138
|
+
occasion: Y === "ALL" ? void 0 : Y
|
|
139
|
+
},
|
|
140
|
+
pagination: {
|
|
141
|
+
limit: M,
|
|
142
|
+
offset: U
|
|
143
|
+
}
|
|
144
|
+
}), pe = P.isLoading || F.isLoading || I.isLoading, me = F.isError && I.isError, $ = re(() => {
|
|
145
|
+
let e = P.data, t = F.data?.items ?? [], n = I.data?.items ?? [], r = new Set((L.data ?? []).map((e) => e.ownerId)), i = D([
|
|
49
146
|
...e?.stylePreferences ?? [],
|
|
50
147
|
...e?.palette ?? [],
|
|
51
148
|
...e?.favouriteBrands ?? []
|
|
52
|
-
]), a =
|
|
149
|
+
]), a = D(e?.palette ?? []), o = D(e?.favouriteBrands ?? []), s = (e) => O(e.tags, i) * 2 + +!!i.has(e.occasion.toLowerCase()) + e.likeCount * .05 + e.saveCount * .05, c = (e) => O(e.tags, i) * 2 + O(e.colours, a) * 2 + +!!i.has(e.category.toLowerCase()) + (o.size && e.tags.some((e) => o.has(e.toLowerCase())) ? 1 : 0), l = i.size > 0, u = [...t].sort((e, t) => l ? s(t) - s(e) : t.likeCount + t.saveCount - (e.likeCount + e.saveCount)).slice(0, 8), d = [...n].filter((e) => l ? c(e) > 0 : !0).sort((e, t) => c(t) - c(e)).slice(0, 8), f = t.filter((e) => r.has(e.authorId)).sort((e, t) => t.likeCount + t.saveCount - (e.likeCount + e.saveCount)).slice(0, 8);
|
|
53
150
|
return {
|
|
54
151
|
hasProfile: !!e,
|
|
55
152
|
hasTaste: l,
|
|
56
153
|
madeForYou: u,
|
|
57
154
|
inYourPalette: d,
|
|
58
155
|
fromFollowing: f,
|
|
59
|
-
followingProfiles:
|
|
156
|
+
followingProfiles: L.data ?? []
|
|
60
157
|
};
|
|
61
158
|
}, [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
])
|
|
67
|
-
|
|
159
|
+
P.data,
|
|
160
|
+
F.data,
|
|
161
|
+
I.data,
|
|
162
|
+
L.data
|
|
163
|
+
]), he = (e) => {
|
|
164
|
+
K((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]), H(0);
|
|
165
|
+
};
|
|
166
|
+
return /* @__PURE__ */ E(n, {
|
|
68
167
|
title: "Discover",
|
|
69
|
-
|
|
70
|
-
}) : M ? /* @__PURE__ */ y(t, {
|
|
71
|
-
title: "Discover",
|
|
72
|
-
children: /* @__PURE__ */ y(n, { onRetry: () => {
|
|
73
|
-
O.refetch(), k.refetch();
|
|
74
|
-
} })
|
|
75
|
-
}) : /* @__PURE__ */ b(t, {
|
|
76
|
-
title: "Discover",
|
|
77
|
-
description: "Looks and pieces tuned to your taste",
|
|
168
|
+
description: "Find looks and pieces tuned to your taste",
|
|
78
169
|
hero: !0,
|
|
79
170
|
children: [
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
className: "mb-
|
|
82
|
-
children: "Your personalised feed, computed live from your style profile
|
|
171
|
+
/* @__PURE__ */ T(ue, {
|
|
172
|
+
className: "mb-4",
|
|
173
|
+
children: "Your personalised feed, computed live from your style profile, plus search across every piece and look on the platform."
|
|
83
174
|
}),
|
|
84
|
-
|
|
85
|
-
className: "mb-
|
|
86
|
-
children: /* @__PURE__ */
|
|
87
|
-
className: "
|
|
88
|
-
children: [
|
|
89
|
-
className: "
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
175
|
+
/* @__PURE__ */ T("div", {
|
|
176
|
+
className: "mb-4 flex items-center gap-2",
|
|
177
|
+
children: /* @__PURE__ */ E("div", {
|
|
178
|
+
className: "relative flex-1",
|
|
179
|
+
children: [
|
|
180
|
+
/* @__PURE__ */ T(ae, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }),
|
|
181
|
+
/* @__PURE__ */ T("input", {
|
|
182
|
+
type: "text",
|
|
183
|
+
value: z,
|
|
184
|
+
onChange: (e) => {
|
|
185
|
+
B(e.target.value), H(0), W(0);
|
|
186
|
+
},
|
|
187
|
+
placeholder: "Search style items and looks…",
|
|
188
|
+
className: "w-full rounded-lg border border-border-seam bg-bg-surface py-2.5 pl-9 pr-9 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
189
|
+
}),
|
|
190
|
+
z && /* @__PURE__ */ T("button", {
|
|
191
|
+
type: "button",
|
|
192
|
+
onClick: () => B(""),
|
|
193
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2 rounded p-1 text-text-secondary hover:text-text-primary",
|
|
194
|
+
children: /* @__PURE__ */ T(C, { className: "h-4 w-4" })
|
|
195
|
+
})
|
|
196
|
+
]
|
|
100
197
|
})
|
|
101
198
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
199
|
+
/* @__PURE__ */ E("div", {
|
|
200
|
+
className: "mb-6 flex items-center gap-1 border-b border-border-seam",
|
|
201
|
+
children: [de.map((e) => /* @__PURE__ */ E("button", {
|
|
202
|
+
type: "button",
|
|
203
|
+
onClick: () => fe(e.value),
|
|
204
|
+
className: t("inline-flex items-center gap-1.5 border-b-2 px-3 py-2.5 text-sm font-medium transition-colors", R === e.value ? "border-action-primary-bg text-text-primary" : "border-transparent text-text-secondary hover:text-text-primary"),
|
|
205
|
+
children: [
|
|
206
|
+
e.icon,
|
|
207
|
+
" ",
|
|
208
|
+
e.label
|
|
209
|
+
]
|
|
210
|
+
}, e.value)), (z || G.length > 0 || q !== "ALL" || Y !== "ALL") && /* @__PURE__ */ E("button", {
|
|
211
|
+
type: "button",
|
|
212
|
+
onClick: () => {
|
|
213
|
+
B(""), K([]), J("ALL"), X("ALL"), H(0), W(0);
|
|
214
|
+
},
|
|
215
|
+
className: "ml-auto inline-flex items-center gap-1 rounded-full px-3 py-1.5 text-xs font-medium text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
|
|
216
|
+
children: [/* @__PURE__ */ T(C, { className: "h-3.5 w-3.5" }), " Clear"]
|
|
217
|
+
})]
|
|
218
|
+
}),
|
|
219
|
+
R === "for-you" && (pe ? /* @__PURE__ */ T(a, { label: "Curating your feed…" }) : me ? /* @__PURE__ */ T(i, { onRetry: () => {
|
|
220
|
+
F.refetch(), I.refetch();
|
|
221
|
+
} }) : /* @__PURE__ */ E(w, { children: [
|
|
222
|
+
$.hasProfile ? null : /* @__PURE__ */ T(le, {
|
|
223
|
+
className: "mb-8",
|
|
224
|
+
children: /* @__PURE__ */ E("div", {
|
|
225
|
+
className: "flex flex-col items-start gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
226
|
+
children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h2", {
|
|
227
|
+
className: "text-lg font-semibold text-text-primary",
|
|
228
|
+
children: "Build your style profile"
|
|
229
|
+
}), /* @__PURE__ */ T("p", {
|
|
230
|
+
className: "mt-1 text-sm text-text-secondary",
|
|
231
|
+
children: "Tell us your aesthetics, palette and favourite brands and this feed tunes itself to you."
|
|
232
|
+
})] }), /* @__PURE__ */ E("button", {
|
|
233
|
+
type: "button",
|
|
234
|
+
onClick: () => N("/profile"),
|
|
235
|
+
className: "inline-flex shrink-0 items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-opacity hover:opacity-90",
|
|
236
|
+
children: [/* @__PURE__ */ T(S, { className: "h-4 w-4" }), " Create profile"]
|
|
237
|
+
})]
|
|
238
|
+
})
|
|
239
|
+
}),
|
|
240
|
+
/* @__PURE__ */ T(k, {
|
|
241
|
+
title: "Made for you",
|
|
242
|
+
icon: /* @__PURE__ */ T(b, { className: "h-5 w-5" }),
|
|
243
|
+
sublabel: $.hasTaste ? "Ranked to match your style profile" : "Most-loved looks on the platform",
|
|
244
|
+
children: $.madeForYou.length === 0 ? /* @__PURE__ */ T(h, {
|
|
245
|
+
title: "No looks yet",
|
|
246
|
+
description: "Once looks are published they will appear here, tuned to your taste."
|
|
247
|
+
}) : /* @__PURE__ */ T("div", {
|
|
248
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
249
|
+
children: $.madeForYou.map((e) => /* @__PURE__ */ E("button", {
|
|
250
|
+
type: "button",
|
|
251
|
+
onClick: () => N(`/looks/${e.id}`),
|
|
252
|
+
className: "group flex flex-col overflow-hidden rounded-lg border border-border-seam bg-bg-surface text-left transition-colors hover:border-accent-foreground/20 hover:shadow-md",
|
|
253
|
+
children: [/* @__PURE__ */ T(o, {
|
|
254
|
+
icon: /* @__PURE__ */ T(S, { className: "h-6 w-6" }),
|
|
255
|
+
seed: e.id,
|
|
256
|
+
fileId: e.image?.id,
|
|
257
|
+
alt: e.title,
|
|
258
|
+
className: "aspect-[4/5] w-full rounded-none"
|
|
259
|
+
}), /* @__PURE__ */ E("div", {
|
|
260
|
+
className: "min-w-0 p-3",
|
|
261
|
+
children: [
|
|
262
|
+
/* @__PURE__ */ T("p", {
|
|
263
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
264
|
+
children: e.title
|
|
265
|
+
}),
|
|
266
|
+
/* @__PURE__ */ T("p", {
|
|
267
|
+
className: "mt-0.5 text-xs text-text-secondary",
|
|
268
|
+
children: p(e.occasion)
|
|
269
|
+
}),
|
|
270
|
+
/* @__PURE__ */ E("span", {
|
|
271
|
+
className: "mt-2 inline-flex items-center gap-1 text-xs text-text-secondary",
|
|
272
|
+
children: [
|
|
273
|
+
/* @__PURE__ */ T(ie, { className: "h-3.5 w-3.5" }),
|
|
274
|
+
" ",
|
|
275
|
+
e.likeCount
|
|
276
|
+
]
|
|
277
|
+
})
|
|
278
|
+
]
|
|
279
|
+
})]
|
|
280
|
+
}, e.id))
|
|
281
|
+
})
|
|
282
|
+
}),
|
|
283
|
+
$.inYourPalette.length > 0 ? /* @__PURE__ */ T(k, {
|
|
284
|
+
title: "In your palette",
|
|
285
|
+
icon: /* @__PURE__ */ T(x, { className: "h-5 w-5" }),
|
|
286
|
+
sublabel: "Pieces that match your colours, categories and tags",
|
|
287
|
+
children: /* @__PURE__ */ T("div", {
|
|
288
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
289
|
+
children: $.inYourPalette.map((e) => /* @__PURE__ */ E("button", {
|
|
290
|
+
type: "button",
|
|
291
|
+
onClick: () => N(`/items/${e.id}`),
|
|
292
|
+
className: "group flex flex-col overflow-hidden rounded-lg border border-border-seam bg-bg-surface text-left transition-colors hover:border-accent-foreground/20 hover:shadow-md",
|
|
293
|
+
children: [/* @__PURE__ */ T(o, {
|
|
294
|
+
icon: /* @__PURE__ */ T(x, { className: "h-6 w-6" }),
|
|
295
|
+
seed: e.id,
|
|
296
|
+
fileId: e.image?.id,
|
|
297
|
+
alt: e.name,
|
|
298
|
+
className: "aspect-[4/5] w-full rounded-none"
|
|
299
|
+
}), /* @__PURE__ */ E("div", {
|
|
300
|
+
className: "min-w-0 p-3",
|
|
301
|
+
children: [
|
|
302
|
+
/* @__PURE__ */ T("p", {
|
|
303
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
304
|
+
children: e.name
|
|
305
|
+
}),
|
|
306
|
+
/* @__PURE__ */ T("p", {
|
|
307
|
+
className: "mt-0.5 text-xs text-text-secondary",
|
|
308
|
+
children: p(e.category)
|
|
309
|
+
}),
|
|
310
|
+
/* @__PURE__ */ T(g, {
|
|
311
|
+
colours: e.colours,
|
|
312
|
+
max: 5,
|
|
313
|
+
className: "mt-2"
|
|
314
|
+
})
|
|
315
|
+
]
|
|
316
|
+
})]
|
|
317
|
+
}, e.id))
|
|
318
|
+
})
|
|
319
|
+
}) : null,
|
|
320
|
+
/* @__PURE__ */ T(k, {
|
|
321
|
+
title: "From people you follow",
|
|
322
|
+
icon: /* @__PURE__ */ T(se, { className: "h-5 w-5" }),
|
|
323
|
+
sublabel: $.followingProfiles.length === 0 ? "Follow creators and shoppers to see their looks here" : `You follow ${$.followingProfiles.length} ${$.followingProfiles.length === 1 ? "person" : "people"}`,
|
|
324
|
+
children: $.followingProfiles.length === 0 ? /* @__PURE__ */ T(h, {
|
|
325
|
+
title: "You are not following anyone yet",
|
|
326
|
+
description: "Open a look or a style profile and tap Follow to build a feed from people whose taste you love.",
|
|
327
|
+
icon: /* @__PURE__ */ T(ce, { className: "h-8 w-8" })
|
|
328
|
+
}) : $.fromFollowing.length === 0 ? /* @__PURE__ */ T("div", {
|
|
329
|
+
className: "rounded-lg border border-border-seam bg-bg-surface p-4 text-sm text-text-secondary",
|
|
330
|
+
children: "The people you follow have not published looks visible to you yet."
|
|
331
|
+
}) : /* @__PURE__ */ T("div", {
|
|
332
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
333
|
+
children: $.fromFollowing.map((e) => /* @__PURE__ */ E("button", {
|
|
334
|
+
type: "button",
|
|
335
|
+
onClick: () => N(`/looks/${e.id}`),
|
|
336
|
+
className: "group flex flex-col overflow-hidden rounded-lg border border-border-seam bg-bg-surface text-left transition-colors hover:border-accent-foreground/20 hover:shadow-md",
|
|
337
|
+
children: [/* @__PURE__ */ T(o, {
|
|
338
|
+
icon: /* @__PURE__ */ T(S, { className: "h-6 w-6" }),
|
|
339
|
+
seed: e.id,
|
|
340
|
+
fileId: e.image?.id,
|
|
341
|
+
alt: e.title,
|
|
342
|
+
className: "aspect-[4/5] w-full rounded-none"
|
|
343
|
+
}), /* @__PURE__ */ E("div", {
|
|
344
|
+
className: "min-w-0 p-3",
|
|
345
|
+
children: [/* @__PURE__ */ T("p", {
|
|
125
346
|
className: "truncate text-sm font-medium text-text-primary",
|
|
126
347
|
children: e.title
|
|
127
|
-
}),
|
|
128
|
-
/* @__PURE__ */ y("p", {
|
|
348
|
+
}), /* @__PURE__ */ T("p", {
|
|
129
349
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
130
|
-
children:
|
|
131
|
-
})
|
|
132
|
-
|
|
133
|
-
|
|
350
|
+
children: p(e.occasion)
|
|
351
|
+
})]
|
|
352
|
+
})]
|
|
353
|
+
}, e.id))
|
|
354
|
+
})
|
|
355
|
+
})
|
|
356
|
+
] })),
|
|
357
|
+
R === "items" && (() => {
|
|
358
|
+
let e = Z.data, n = e?.items ?? [], s = e?.pageInfo.hasMore ?? !1;
|
|
359
|
+
return /* @__PURE__ */ E("div", {
|
|
360
|
+
className: "space-y-4",
|
|
361
|
+
children: [
|
|
362
|
+
/* @__PURE__ */ T("div", {
|
|
363
|
+
className: "flex flex-wrap items-center gap-2",
|
|
364
|
+
children: ne.map((e) => /* @__PURE__ */ E("button", {
|
|
365
|
+
type: "button",
|
|
366
|
+
onClick: () => he(e),
|
|
367
|
+
className: t("inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 text-xs font-medium transition-colors", G.includes(e) ? "bg-accent-purple-subtle text-text-primary" : "bg-bg-sunken text-text-secondary hover:text-text-primary"),
|
|
368
|
+
children: [
|
|
369
|
+
m(e, 14),
|
|
370
|
+
" ",
|
|
371
|
+
p(e)
|
|
372
|
+
]
|
|
373
|
+
}, e))
|
|
374
|
+
}),
|
|
375
|
+
/* @__PURE__ */ T("div", {
|
|
376
|
+
className: "flex flex-wrap items-center gap-2",
|
|
377
|
+
children: A.map((e) => /* @__PURE__ */ T("button", {
|
|
378
|
+
type: "button",
|
|
379
|
+
onClick: () => {
|
|
380
|
+
J(e.value), H(0);
|
|
381
|
+
},
|
|
382
|
+
className: t("rounded-full px-3 py-1.5 text-sm font-medium transition-colors", q === e.value ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary hover:text-text-primary"),
|
|
383
|
+
children: e.label
|
|
384
|
+
}, e.value))
|
|
385
|
+
}),
|
|
386
|
+
Z.isLoading ? /* @__PURE__ */ T(a, { label: "Searching items…" }) : Z.isError ? /* @__PURE__ */ T(i, { onRetry: () => void Z.refetch() }) : n.length === 0 ? /* @__PURE__ */ T(h, {
|
|
387
|
+
illustration: "empty-data",
|
|
388
|
+
icon: /* @__PURE__ */ T(oe, { className: "h-10 w-10" }),
|
|
389
|
+
title: "No items found",
|
|
390
|
+
description: "Try a different query or filters."
|
|
391
|
+
}) : /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T("div", {
|
|
392
|
+
className: "grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",
|
|
393
|
+
children: n.map((e) => /* @__PURE__ */ E("button", {
|
|
394
|
+
type: "button",
|
|
395
|
+
onClick: () => N(`/items/${e.id}`),
|
|
396
|
+
className: "group overflow-hidden rounded-lg border border-border-seam bg-bg-surface text-left shadow-sm transition-all hover:border-accent-foreground/20 hover:shadow-md",
|
|
397
|
+
children: [/* @__PURE__ */ E("div", {
|
|
398
|
+
className: "relative",
|
|
399
|
+
children: [/* @__PURE__ */ T(o, {
|
|
400
|
+
icon: m(e.category, 32),
|
|
401
|
+
seed: e.id,
|
|
402
|
+
fileId: e.image?.id,
|
|
403
|
+
alt: e.name,
|
|
404
|
+
className: "aspect-[3/4] w-full"
|
|
405
|
+
}), /* @__PURE__ */ T("div", {
|
|
406
|
+
className: "absolute right-2 top-2",
|
|
407
|
+
children: /* @__PURE__ */ T(r, {
|
|
408
|
+
status: e.status,
|
|
409
|
+
className: "shadow-sm"
|
|
410
|
+
})
|
|
411
|
+
})]
|
|
412
|
+
}), /* @__PURE__ */ E("div", {
|
|
413
|
+
className: "p-3",
|
|
134
414
|
children: [
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
|
|
137
|
-
|
|
415
|
+
/* @__PURE__ */ T("p", {
|
|
416
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
417
|
+
children: e.name
|
|
418
|
+
}),
|
|
419
|
+
e.brand?.name && /* @__PURE__ */ T("p", {
|
|
420
|
+
className: "truncate text-xs text-text-secondary",
|
|
421
|
+
children: e.brand.name
|
|
422
|
+
}),
|
|
423
|
+
/* @__PURE__ */ E("div", {
|
|
424
|
+
className: "mt-1.5 flex items-center justify-between gap-2",
|
|
425
|
+
children: [/* @__PURE__ */ T("span", {
|
|
426
|
+
className: "text-sm font-semibold text-text-primary tabular-nums",
|
|
427
|
+
children: ee(e.price, e.currency)
|
|
428
|
+
}), /* @__PURE__ */ T("span", {
|
|
429
|
+
className: "text-xs text-text-secondary",
|
|
430
|
+
children: p(e.category)
|
|
431
|
+
})]
|
|
432
|
+
}),
|
|
433
|
+
e.colours.length > 0 && /* @__PURE__ */ T(g, {
|
|
434
|
+
colours: e.colours,
|
|
435
|
+
max: 5,
|
|
436
|
+
className: "mt-2"
|
|
437
|
+
})
|
|
138
438
|
]
|
|
139
|
-
})
|
|
140
|
-
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
})
|
|
144
|
-
}),
|
|
145
|
-
N.inYourPalette.length > 0 ? /* @__PURE__ */ y(T, {
|
|
146
|
-
title: "In your palette",
|
|
147
|
-
icon: /* @__PURE__ */ y(h, { className: "h-5 w-5" }),
|
|
148
|
-
sublabel: "Pieces that match your colours, categories and tags",
|
|
149
|
-
children: /* @__PURE__ */ y("div", {
|
|
150
|
-
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
151
|
-
children: N.inYourPalette.map((e) => /* @__PURE__ */ b("button", {
|
|
152
|
-
type: "button",
|
|
153
|
-
onClick: () => E(`/items/${e.id}`),
|
|
154
|
-
className: "group flex flex-col overflow-hidden rounded-lg border border-border-seam bg-bg-surface text-left transition-colors hover:border-accent-foreground/20 hover:shadow-md",
|
|
155
|
-
children: [/* @__PURE__ */ y(i, {
|
|
156
|
-
icon: /* @__PURE__ */ y(h, { className: "h-6 w-6" }),
|
|
157
|
-
seed: e.id,
|
|
158
|
-
fileId: e.image?.id,
|
|
159
|
-
alt: e.name,
|
|
160
|
-
className: "aspect-[4/5] w-full rounded-none"
|
|
161
|
-
}), /* @__PURE__ */ b("div", {
|
|
162
|
-
className: "min-w-0 p-3",
|
|
439
|
+
})]
|
|
440
|
+
}, e.id))
|
|
441
|
+
}), (V > 0 || s) && /* @__PURE__ */ E("div", {
|
|
442
|
+
className: "mt-6 flex items-center justify-center gap-2",
|
|
163
443
|
children: [
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
|
|
166
|
-
|
|
444
|
+
/* @__PURE__ */ E("button", {
|
|
445
|
+
type: "button",
|
|
446
|
+
disabled: V === 0,
|
|
447
|
+
onClick: () => H((e) => Math.max(0, e - M)),
|
|
448
|
+
className: "inline-flex items-center gap-1 rounded-lg border border-border-seam px-3 py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-40",
|
|
449
|
+
children: [/* @__PURE__ */ T(v, { className: "h-4 w-4" }), " Previous"]
|
|
167
450
|
}),
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
className: "
|
|
170
|
-
children:
|
|
451
|
+
/* @__PURE__ */ E("span", {
|
|
452
|
+
className: "text-sm text-text-secondary",
|
|
453
|
+
children: ["Page ", V / M + 1]
|
|
171
454
|
}),
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
455
|
+
/* @__PURE__ */ E("button", {
|
|
456
|
+
type: "button",
|
|
457
|
+
disabled: !s,
|
|
458
|
+
onClick: () => H((e) => e + M),
|
|
459
|
+
className: "inline-flex items-center gap-1 rounded-lg border border-border-seam px-3 py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-40",
|
|
460
|
+
children: ["Next ", /* @__PURE__ */ T(y, { className: "h-4 w-4" })]
|
|
176
461
|
})
|
|
177
462
|
]
|
|
178
|
-
})]
|
|
179
|
-
|
|
180
|
-
})
|
|
181
|
-
})
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
className: "
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
463
|
+
})] })
|
|
464
|
+
]
|
|
465
|
+
});
|
|
466
|
+
})(),
|
|
467
|
+
R === "looks" && (() => {
|
|
468
|
+
let e = Q.data, n = e?.items ?? [], r = e?.pageInfo.hasMore ?? !1;
|
|
469
|
+
return /* @__PURE__ */ E("div", {
|
|
470
|
+
className: "space-y-4",
|
|
471
|
+
children: [/* @__PURE__ */ T("div", {
|
|
472
|
+
className: "flex flex-wrap items-center gap-2",
|
|
473
|
+
children: j.map((e) => /* @__PURE__ */ T("button", {
|
|
474
|
+
type: "button",
|
|
475
|
+
onClick: () => {
|
|
476
|
+
X(e.value), W(0);
|
|
477
|
+
},
|
|
478
|
+
className: t("rounded-full px-3 py-1.5 text-sm font-medium transition-colors", Y === e.value ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary hover:text-text-primary"),
|
|
479
|
+
children: e.label
|
|
480
|
+
}, e.value))
|
|
481
|
+
}), Q.isLoading ? /* @__PURE__ */ T(a, { label: "Searching looks…" }) : Q.isError ? /* @__PURE__ */ T(i, { onRetry: () => void Q.refetch() }) : n.length === 0 ? /* @__PURE__ */ T(h, {
|
|
482
|
+
illustration: "empty-data",
|
|
483
|
+
icon: /* @__PURE__ */ T(S, { className: "h-10 w-10" }),
|
|
484
|
+
title: "No looks found",
|
|
485
|
+
description: "Try a different query or occasion."
|
|
486
|
+
}) : /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T("div", {
|
|
487
|
+
className: "grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",
|
|
488
|
+
children: n.map((e) => /* @__PURE__ */ E("div", {
|
|
489
|
+
className: "relative",
|
|
490
|
+
children: [/* @__PURE__ */ T(te, {
|
|
491
|
+
id: e.id,
|
|
492
|
+
title: e.title,
|
|
493
|
+
occasion: e.occasion,
|
|
494
|
+
imageFileId: e.image?.id,
|
|
495
|
+
likeCount: e.likeCount,
|
|
496
|
+
isLikedByMe: e.isLikedByMe,
|
|
497
|
+
isSavedByMe: e.isSavedByMe,
|
|
498
|
+
onOpen: () => N(`/looks/${e.id}`),
|
|
499
|
+
showActions: !0
|
|
500
|
+
}), e.isFeatured && /* @__PURE__ */ T("div", {
|
|
501
|
+
className: "pointer-events-none absolute left-2 top-2 z-10",
|
|
502
|
+
children: /* @__PURE__ */ E("span", {
|
|
503
|
+
className: "inline-flex items-center gap-1 rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-xs font-medium text-status-warning-text shadow-sm backdrop-blur",
|
|
504
|
+
children: [/* @__PURE__ */ T(S, { className: "h-3 w-3" }), " Featured"]
|
|
505
|
+
})
|
|
213
506
|
})]
|
|
214
|
-
})
|
|
215
|
-
},
|
|
216
|
-
|
|
217
|
-
|
|
507
|
+
}, e.id))
|
|
508
|
+
}), (U > 0 || r) && /* @__PURE__ */ E("div", {
|
|
509
|
+
className: "mt-6 flex items-center justify-center gap-2",
|
|
510
|
+
children: [
|
|
511
|
+
/* @__PURE__ */ E("button", {
|
|
512
|
+
type: "button",
|
|
513
|
+
disabled: U === 0,
|
|
514
|
+
onClick: () => W((e) => Math.max(0, e - M)),
|
|
515
|
+
className: "inline-flex items-center gap-1 rounded-lg border border-border-seam px-3 py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-40",
|
|
516
|
+
children: [/* @__PURE__ */ T(v, { className: "h-4 w-4" }), " Previous"]
|
|
517
|
+
}),
|
|
518
|
+
/* @__PURE__ */ E("span", {
|
|
519
|
+
className: "text-sm text-text-secondary",
|
|
520
|
+
children: ["Page ", U / M + 1]
|
|
521
|
+
}),
|
|
522
|
+
/* @__PURE__ */ E("button", {
|
|
523
|
+
type: "button",
|
|
524
|
+
disabled: !r,
|
|
525
|
+
onClick: () => W((e) => e + M),
|
|
526
|
+
className: "inline-flex items-center gap-1 rounded-lg border border-border-seam px-3 py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-40",
|
|
527
|
+
children: ["Next ", /* @__PURE__ */ T(y, { className: "h-4 w-4" })]
|
|
528
|
+
})
|
|
529
|
+
]
|
|
530
|
+
})] })]
|
|
531
|
+
});
|
|
532
|
+
})()
|
|
218
533
|
]
|
|
219
534
|
});
|
|
220
535
|
}
|
|
221
536
|
//#endregion
|
|
222
|
-
export {
|
|
537
|
+
export { N as DiscoverPage };
|
|
223
538
|
|
|
224
539
|
//# sourceMappingURL=DiscoverPage.js.map
|