@burdenoff/microfe-coolandlovely 2026.827.1 → 2026.1024.1
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/components/ActivityTrail.js +7 -7
- package/dist/coolandlovely/components/Comments.js +4 -4
- package/dist/coolandlovely/components/FeedbackWidget.d.ts.map +1 -1
- package/dist/coolandlovely/components/FeedbackWidget.js +72 -70
- package/dist/coolandlovely/components/FeedbackWidget.js.map +1 -1
- package/dist/coolandlovely/components/LookCard.js +24 -24
- package/dist/coolandlovely/components/StateViews.d.ts.map +1 -1
- package/dist/coolandlovely/components/StateViews.js +35 -26
- package/dist/coolandlovely/components/StateViews.js.map +1 -1
- package/dist/coolandlovely/components/StatusBadge.d.ts.map +1 -1
- package/dist/coolandlovely/components/StatusBadge.js +45 -15
- package/dist/coolandlovely/components/StatusBadge.js.map +1 -1
- package/dist/coolandlovely/components/VisibilityChip.d.ts.map +1 -1
- package/dist/coolandlovely/components/VisibilityChip.js +22 -17
- package/dist/coolandlovely/components/VisibilityChip.js.map +1 -1
- package/dist/coolandlovely/hooks/index.d.ts +1 -0
- package/dist/coolandlovely/hooks/index.d.ts.map +1 -1
- package/dist/coolandlovely/hooks/index.js +2 -1
- package/dist/coolandlovely/hooks/useTr.d.ts +2 -0
- package/dist/coolandlovely/hooks/useTr.d.ts.map +1 -0
- package/dist/coolandlovely/hooks/useTr.js +14 -0
- package/dist/coolandlovely/hooks/useTr.js.map +1 -0
- package/dist/coolandlovely/pages/HomePage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/HomePage.js +172 -132
- package/dist/coolandlovely/pages/HomePage.js.map +1 -1
- package/dist/coolandlovely/pages/admin/AdminBrandsPage.js +10 -10
- package/dist/coolandlovely/pages/admin/AdminCollaborationsPage.js +16 -16
- package/dist/coolandlovely/pages/admin/AdminFeaturedItemsPage.js +17 -17
- package/dist/coolandlovely/pages/brands/BrandDetailPage.js +22 -22
- package/dist/coolandlovely/pages/brands/BrandFormPage.js +9 -9
- package/dist/coolandlovely/pages/brands/BrandsListPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/brands/BrandsListPage.js +80 -76
- package/dist/coolandlovely/pages/brands/BrandsListPage.js.map +1 -1
- package/dist/coolandlovely/pages/collaborations/CollaborationDetailPage.js +21 -21
- package/dist/coolandlovely/pages/collaborations/CollaborationFormPage.js +7 -7
- package/dist/coolandlovely/pages/collaborations/CollaborationsListPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/collaborations/CollaborationsListPage.js +82 -81
- package/dist/coolandlovely/pages/collaborations/CollaborationsListPage.js.map +1 -1
- package/dist/coolandlovely/pages/collections/CollectionDetailPage.js +19 -19
- package/dist/coolandlovely/pages/collections/CollectionFormPage.js +9 -9
- package/dist/coolandlovely/pages/collections/CollectionsListPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/collections/CollectionsListPage.js +54 -55
- package/dist/coolandlovely/pages/collections/CollectionsListPage.js.map +1 -1
- package/dist/coolandlovely/pages/discover/DiscoverPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/discover/DiscoverPage.js +322 -315
- package/dist/coolandlovely/pages/discover/DiscoverPage.js.map +1 -1
- package/dist/coolandlovely/pages/items/StyleItemDetailPage.js +21 -21
- package/dist/coolandlovely/pages/items/StyleItemFormPage.js +10 -10
- package/dist/coolandlovely/pages/items/StyleItemsListPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/items/StyleItemsListPage.js +105 -95
- package/dist/coolandlovely/pages/items/StyleItemsListPage.js.map +1 -1
- package/dist/coolandlovely/pages/lookbooks/LookbookDetailPage.js +20 -20
- package/dist/coolandlovely/pages/lookbooks/LookbookDetailPage.js.map +1 -1
- package/dist/coolandlovely/pages/lookbooks/LookbooksListPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/lookbooks/LookbooksListPage.js +88 -79
- package/dist/coolandlovely/pages/lookbooks/LookbooksListPage.js.map +1 -1
- package/dist/coolandlovely/pages/looks/LookDetailPage.js +18 -18
- package/dist/coolandlovely/pages/looks/LookFormPage.js +6 -6
- package/dist/coolandlovely/pages/looks/LookFormPage.js.map +1 -1
- package/dist/coolandlovely/pages/looks/LooksListPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/looks/LooksListPage.js +94 -94
- package/dist/coolandlovely/pages/looks/LooksListPage.js.map +1 -1
- package/dist/coolandlovely/pages/profile/StyleProfilePage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/profile/StyleProfilePage.js +226 -199
- package/dist/coolandlovely/pages/profile/StyleProfilePage.js.map +1 -1
- package/dist/coolandlovely/pages/trends/TrendsPage.js +8 -8
- package/dist/coolandlovely/pages/wardrobe/WardrobeFormPage.js +5 -5
- package/dist/coolandlovely/pages/wardrobe/WardrobeListPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/wardrobe/WardrobeListPage.js +71 -69
- package/dist/coolandlovely/pages/wardrobe/WardrobeListPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,139 +1,148 @@
|
|
|
1
1
|
import { useCoolAndLovely as e } from "../../context/CoolAndLovelyContext.js";
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useCreateLookbook as n, useLookbooks as r } from "../../hooks/useCoolAndLovelyApi.js";
|
|
4
4
|
import { COO_FILE_FOLDERS as i } from "../../hooks/useFiles.js";
|
|
5
|
-
import {
|
|
6
|
-
import { parseCsv as s, titleCase as c } from "../../utils/formatters.js";
|
|
5
|
+
import { useTr as a } from "../../hooks/useTr.js";
|
|
7
6
|
import "../../hooks/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
7
|
+
import { ErrorView as o, LoadingView as s } from "../../components/StateViews.js";
|
|
8
|
+
import { parseCsv as c, titleCase as l } from "../../utils/formatters.js";
|
|
9
|
+
import { EmptyState as u } from "../../components/EmptyState.js";
|
|
10
|
+
import { SelectField as d, TextAreaField as f, TextField as p } from "../../components/Field.js";
|
|
11
|
+
import { ImageUploadField as m } from "../../components/ImageUploadField.js";
|
|
12
|
+
import { LookbookCard as h } from "../../components/LookbookCard.js";
|
|
13
|
+
import { useMemo as g, useState as _ } from "react";
|
|
14
|
+
import { BookHeart as v, Loader2 as y, Plus as b, X as x } from "lucide-react";
|
|
15
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
16
|
+
import { GlassCard as w } from "@burdenoff/fe-libs/ui";
|
|
16
17
|
//#region src/coolandlovely/pages/lookbooks/LookbooksListPage.tsx
|
|
17
|
-
var
|
|
18
|
+
var T = [
|
|
18
19
|
"PRIVATE",
|
|
19
20
|
"FOLLOWERS",
|
|
20
21
|
"PUBLIC"
|
|
21
22
|
];
|
|
22
|
-
function
|
|
23
|
-
let { navigateTo:
|
|
23
|
+
function E() {
|
|
24
|
+
let { navigateTo: E } = e(), D = a(), O = r(), k = n(), [A, j] = _(!1), [M, N] = _(""), [P, F] = _(""), [I, L] = _("PRIVATE"), [R, z] = _(""), [B, V] = _(""), [H, U] = _(), W = O.data ?? [], G = g(() => T.map((e) => ({
|
|
24
25
|
value: e,
|
|
25
|
-
label:
|
|
26
|
-
}));
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
title: "Lookbooks",
|
|
29
|
-
description: "Themed boards of saved catalogue pieces and looks",
|
|
30
|
-
actions: /* @__PURE__ */
|
|
26
|
+
label: D(`coolandlovely.visibility.${e.toLowerCase()}`, l(e))
|
|
27
|
+
})), [D]);
|
|
28
|
+
return /* @__PURE__ */ C(t, {
|
|
29
|
+
title: D("coolandlovely.page.lookbooksTitle", "Lookbooks"),
|
|
30
|
+
description: D("coolandlovely.page.lookbooksSubtitle", "Themed boards of saved catalogue pieces and looks"),
|
|
31
|
+
actions: /* @__PURE__ */ C("button", {
|
|
31
32
|
type: "button",
|
|
32
|
-
onClick: () =>
|
|
33
|
+
onClick: () => j((e) => !e),
|
|
33
34
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90",
|
|
34
|
-
children: [
|
|
35
|
+
children: [S(A ? x : b, { className: "h-4 w-4" }), A ? D("coolandlovely.actions.close", "Close") : D("coolandlovely.actions.newLookbook", "New lookbook")]
|
|
35
36
|
}),
|
|
36
|
-
children: [
|
|
37
|
+
children: [A && /* @__PURE__ */ S("form", {
|
|
37
38
|
onSubmit: (e) => {
|
|
38
|
-
if (e.preventDefault(), !
|
|
39
|
-
|
|
39
|
+
if (e.preventDefault(), !M.trim()) {
|
|
40
|
+
U(D("coolandlovely.validation.nameRequired", "Name is required"));
|
|
40
41
|
return;
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
name:
|
|
44
|
-
description:
|
|
45
|
-
visibility:
|
|
46
|
-
tags:
|
|
47
|
-
coverFileId:
|
|
43
|
+
U(void 0), k.mutate({
|
|
44
|
+
name: M.trim(),
|
|
45
|
+
description: P.trim() || void 0,
|
|
46
|
+
visibility: I,
|
|
47
|
+
tags: c(R),
|
|
48
|
+
coverFileId: B || void 0
|
|
48
49
|
}, { onSuccess: (e) => {
|
|
49
|
-
|
|
50
|
+
j(!1), N(""), F(""), z(""), L("PRIVATE"), V(""), E(`/lookbooks/${e.id}`);
|
|
50
51
|
} });
|
|
51
52
|
},
|
|
52
53
|
className: "mb-6",
|
|
53
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ C(w, {
|
|
54
55
|
treatment: "plain",
|
|
55
56
|
className: "p-5",
|
|
56
57
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ C("h2", {
|
|
58
59
|
className: "mb-4 flex items-center gap-2 text-base font-semibold text-text-primary",
|
|
59
|
-
children: [
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ S(v, { className: "h-5 w-5" }),
|
|
62
|
+
" ",
|
|
63
|
+
D("coolandlovely.actions.newLookbook", "New lookbook")
|
|
64
|
+
]
|
|
60
65
|
}),
|
|
61
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ C("div", {
|
|
62
67
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
63
|
-
children: [/* @__PURE__ */
|
|
64
|
-
label: "Name",
|
|
65
|
-
value:
|
|
66
|
-
onChange:
|
|
67
|
-
placeholder: "Summer wedding guest",
|
|
68
|
+
children: [/* @__PURE__ */ S(p, {
|
|
69
|
+
label: D("coolandlovely.field.name", "Name"),
|
|
70
|
+
value: M,
|
|
71
|
+
onChange: N,
|
|
72
|
+
placeholder: D("coolandlovely.placeholder.lookbookName", "Summer wedding guest"),
|
|
68
73
|
required: !0,
|
|
69
|
-
error:
|
|
70
|
-
}), /* @__PURE__ */
|
|
71
|
-
label: "Visibility",
|
|
72
|
-
value:
|
|
73
|
-
onChange: (e) =>
|
|
74
|
-
options:
|
|
74
|
+
error: H
|
|
75
|
+
}), /* @__PURE__ */ S(d, {
|
|
76
|
+
label: D("coolandlovely.field.visibility", "Visibility"),
|
|
77
|
+
value: I,
|
|
78
|
+
onChange: (e) => L(e),
|
|
79
|
+
options: G
|
|
75
80
|
})]
|
|
76
81
|
}),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
label: "Description",
|
|
79
|
-
value:
|
|
80
|
-
onChange:
|
|
81
|
-
placeholder: "What this board is for…",
|
|
82
|
+
/* @__PURE__ */ S(f, {
|
|
83
|
+
label: D("coolandlovely.field.description", "Description"),
|
|
84
|
+
value: P,
|
|
85
|
+
onChange: F,
|
|
86
|
+
placeholder: D("coolandlovely.placeholder.lookbookDescription", "What this board is for…"),
|
|
82
87
|
rows: 2,
|
|
83
88
|
className: "mt-4"
|
|
84
89
|
}),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
label: "Tags",
|
|
87
|
-
value:
|
|
88
|
-
onChange:
|
|
89
|
-
placeholder: "summer, formal",
|
|
90
|
-
hint: "Comma-separated",
|
|
90
|
+
/* @__PURE__ */ S(p, {
|
|
91
|
+
label: D("coolandlovely.field.tags", "Tags"),
|
|
92
|
+
value: R,
|
|
93
|
+
onChange: z,
|
|
94
|
+
placeholder: D("coolandlovely.placeholder.tags", "summer, formal"),
|
|
95
|
+
hint: D("coolandlovely.hint.commaSeparated", "Comma-separated"),
|
|
91
96
|
className: "mt-4"
|
|
92
97
|
}),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
label: "Cover image",
|
|
98
|
+
/* @__PURE__ */ S(m, {
|
|
99
|
+
label: D("coolandlovely.field.coverImage", "Cover image"),
|
|
95
100
|
aspect: "wide",
|
|
96
|
-
value:
|
|
97
|
-
onChange:
|
|
101
|
+
value: B,
|
|
102
|
+
onChange: V,
|
|
98
103
|
folder: i.lookbooks,
|
|
99
104
|
className: "mt-4"
|
|
100
105
|
}),
|
|
101
|
-
|
|
106
|
+
k.isError && /* @__PURE__ */ S("p", {
|
|
102
107
|
className: "mt-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
103
|
-
children:
|
|
108
|
+
children: k.error instanceof Error ? k.error.message : D("coolandlovely.error.generic", "Something went wrong")
|
|
104
109
|
}),
|
|
105
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ S("div", {
|
|
106
111
|
className: "mt-4 flex justify-end",
|
|
107
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ C("button", {
|
|
108
113
|
type: "submit",
|
|
109
|
-
disabled:
|
|
114
|
+
disabled: k.isPending,
|
|
110
115
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-5 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
111
|
-
children: [
|
|
116
|
+
children: [k.isPending ? /* @__PURE__ */ S(y, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ S(b, { className: "h-4 w-4" }), D("coolandlovely.actions.createLookbook", "Create lookbook")]
|
|
112
117
|
})
|
|
113
118
|
})
|
|
114
119
|
]
|
|
115
120
|
})
|
|
116
|
-
}),
|
|
121
|
+
}), O.isLoading ? /* @__PURE__ */ S(s, { label: D("coolandlovely.loading.lookbooks", "Loading lookbooks…") }) : O.isError ? /* @__PURE__ */ S(o, { onRetry: () => void O.refetch() }) : W.length === 0 ? /* @__PURE__ */ S(u, {
|
|
117
122
|
illustration: "empty-data",
|
|
118
|
-
icon: /* @__PURE__ */
|
|
119
|
-
title: "No lookbooks yet",
|
|
120
|
-
description: "Create a themed board to clip catalogue pieces and looks.",
|
|
121
|
-
action: /* @__PURE__ */
|
|
123
|
+
icon: /* @__PURE__ */ S(v, { className: "h-10 w-10" }),
|
|
124
|
+
title: D("coolandlovely.empty.lookbooksTitle", "No lookbooks yet"),
|
|
125
|
+
description: D("coolandlovely.empty.lookbooksDescription", "Create a themed board to clip catalogue pieces and looks."),
|
|
126
|
+
action: /* @__PURE__ */ C("button", {
|
|
122
127
|
type: "button",
|
|
123
|
-
onClick: () =>
|
|
128
|
+
onClick: () => j(!0),
|
|
124
129
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text",
|
|
125
|
-
children: [
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ S(b, { className: "h-4 w-4" }),
|
|
132
|
+
" ",
|
|
133
|
+
D("coolandlovely.actions.newLookbook", "New lookbook")
|
|
134
|
+
]
|
|
126
135
|
})
|
|
127
|
-
}) : /* @__PURE__ */
|
|
136
|
+
}) : /* @__PURE__ */ S("div", {
|
|
128
137
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3",
|
|
129
|
-
children:
|
|
138
|
+
children: W.map((e) => /* @__PURE__ */ S(h, {
|
|
130
139
|
lookbook: e,
|
|
131
|
-
onClick: () =>
|
|
140
|
+
onClick: () => E(`/lookbooks/${e.id}`)
|
|
132
141
|
}, e.id))
|
|
133
142
|
})]
|
|
134
143
|
});
|
|
135
144
|
}
|
|
136
145
|
//#endregion
|
|
137
|
-
export {
|
|
146
|
+
export { E as LookbooksListPage };
|
|
138
147
|
|
|
139
148
|
//# sourceMappingURL=LookbooksListPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LookbooksListPage.js","names":[],"sources":["../../../../src/coolandlovely/pages/lookbooks/LookbooksListPage.tsx"],"sourcesContent":["/**\n * Lookbooks List Page\n * @module coolandlovely/pages/lookbooks\n *\n * Lists themed lookbook boards (`cooListLookbooks`) as mood-board cards — a\n * cover, a visibility chip and (when the list selection carries entries) an\n * item count — and supports creating one inline (`cooCreateLookbook`).\n */\n\nimport { useState } from 'react';\nimport { Plus, BookHeart, Loader2, X } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { LookbookCard } from '../../components/LookbookCard';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView } from '../../components/StateViews';\nimport { TextField, TextAreaField, SelectField } from '../../components/Field';\nimport { ImageUploadField } from '../../components/ImageUploadField';\nimport { useCoolAndLovely } from '../../context/CoolAndLovelyContext';\nimport { useLookbooks, useCreateLookbook } from '../../hooks';\nimport { COO_FILE_FOLDERS } from '../../hooks/useFiles';\nimport { parseCsv, titleCase } from '../../utils/formatters';\nimport type { CooVisibility } from '../../types';\n\nconst VISIBILITIES: CooVisibility[] = ['PRIVATE', 'FOLLOWERS', 'PUBLIC'];\n\nexport function LookbooksListPage() {\n const { navigateTo } = useCoolAndLovely();\n const query = useLookbooks();\n const createLookbook = useCreateLookbook();\n\n const [creating, setCreating] = useState(false);\n const [name, setName] = useState('');\n const [description, setDescription] = useState('');\n const [visibility, setVisibility] = useState<CooVisibility>('PRIVATE');\n const [tags, setTags] = useState('');\n const [coverFileId, setCoverFileId] = useState('');\n const [nameError, setNameError] = useState<string | undefined>();\n\n const lookbooks = query.data ?? [];\n const visibilityOptions = VISIBILITIES.map((v) => ({ value: v, label: titleCase(v) }));\n\n const handleCreate = (e: React.FormEvent) => {\n e.preventDefault();\n if (!name.trim()) {\n setNameError('Name is required');\n return;\n }\n setNameError(undefined);\n createLookbook.mutate(\n {\n name: name.trim(),\n description: description.trim() || undefined,\n visibility,\n tags: parseCsv(tags),\n coverFileId: coverFileId || undefined,\n },\n {\n onSuccess: (lb) => {\n setCreating(false);\n setName('');\n setDescription('');\n setTags('');\n setVisibility('PRIVATE');\n setCoverFileId('');\n navigateTo(`/lookbooks/${lb.id}`);\n },\n }\n );\n };\n\n return (\n <PageLayout\n title=\"Lookbooks\"\n description=\"Themed boards of saved catalogue pieces and looks\"\n actions={\n <button\n type=\"button\"\n onClick={() => setCreating((v) => !v)}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90\"\n >\n {creating ? <X className=\"h-4 w-4\" /> : <Plus className=\"h-4 w-4\" />}\n {creating ? 'Close' : 'New lookbook'}\n </button>\n }\n >\n {creating && (\n <form onSubmit={handleCreate} className=\"mb-6\">\n <GlassCard treatment=\"plain\" className=\"p-5\">\n <h2 className=\"mb-4 flex items-center gap-2 text-base font-semibold text-text-primary\">\n <BookHeart className=\"h-5 w-5\" /> New lookbook\n </h2>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <TextField\n label=\"Name\"\n value={name}\n onChange={setName}\n placeholder=\"Summer wedding guest\"\n required\n error={nameError}\n />\n <SelectField\n label=\"Visibility\"\n value={visibility}\n onChange={(v) => setVisibility(v as CooVisibility)}\n options={visibilityOptions}\n />\n </div>\n <TextAreaField\n label=\"Description\"\n value={description}\n onChange={setDescription}\n placeholder=\"What this board is for…\"\n rows={2}\n className=\"mt-4\"\n />\n <TextField\n label=\"Tags\"\n value={tags}\n onChange={setTags}\n placeholder=\"summer, formal\"\n hint=\"Comma-separated\"\n className=\"mt-4\"\n />\n <ImageUploadField\n label=\"Cover image\"\n aspect=\"wide\"\n value={coverFileId}\n onChange={setCoverFileId}\n folder={COO_FILE_FOLDERS.lookbooks}\n className=\"mt-4\"\n />\n {createLookbook.isError && (\n <p className=\"mt-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text\">\n {createLookbook.error instanceof Error\n ? createLookbook.error.message\n : 'Something went wrong'}\n </p>\n )}\n <div className=\"mt-4 flex justify-end\">\n <button\n type=\"submit\"\n disabled={createLookbook.isPending}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-5 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50\"\n >\n {createLookbook.isPending ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n ) : (\n <Plus className=\"h-4 w-4\" />\n )}\n Create lookbook\n </button>\n </div>\n </GlassCard>\n </form>\n )}\n\n {query.isLoading ? (\n <LoadingView label=\"Loading lookbooks…\" />\n ) : query.isError ? (\n <ErrorView onRetry={() => void query.refetch()} />\n ) : lookbooks.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n icon={<BookHeart className=\"h-10 w-10\" />}\n title=\"No lookbooks yet\"\n description=\"Create a themed board to clip catalogue pieces and looks.\"\n action={\n <button\n type=\"button\"\n onClick={() => setCreating(true)}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text\"\n >\n <Plus className=\"h-4 w-4\" /> New lookbook\n </button>\n }\n />\n ) : (\n <div className=\"grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3\">\n {lookbooks.map((lb) => (\n <LookbookCard\n key={lb.id}\n lookbook={lb}\n onClick={() => navigateTo(`/lookbooks/${lb.id}`)}\n />\n ))}\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,IAAM,IAAgC;CAAC;CAAW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AC,UAAD;IACE,MAAK;IACL,eAAe,EAAY,GAAK;IAChC,WAAU;cAHZ,CAKE,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA,EAAA,gBACrB;;GAEX,CAAA,GAEF,kBAAC,OAAD;GAAK,WAAU;aACZ,EAAU,KAAK,MACd,kBAAC,GAAD;IAEE,UAAU;IACV,eAAe,EAAW,cAAc,EAAG,KAAK;IAChD,EAHK,EAAG,GAGR,CACF;GACE,CAAA,CAEG"}
|
|
1
|
+
{"version":3,"file":"LookbooksListPage.js","names":[],"sources":["../../../../src/coolandlovely/pages/lookbooks/LookbooksListPage.tsx"],"sourcesContent":["/**\n * Lookbooks List Page\n * @module coolandlovely/pages/lookbooks\n *\n * Lists themed lookbook boards (`cooListLookbooks`) as mood-board cards — a\n * cover, a visibility chip and (when the list selection carries entries) an\n * item count — and supports creating one inline (`cooCreateLookbook`).\n */\n\nimport { useMemo, useState } from 'react';\nimport { Plus, BookHeart, Loader2, X } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { LookbookCard } from '../../components/LookbookCard';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView } from '../../components/StateViews';\nimport { TextField, TextAreaField, SelectField } from '../../components/Field';\nimport { ImageUploadField } from '../../components/ImageUploadField';\nimport { useCoolAndLovely } from '../../context/CoolAndLovelyContext';\nimport { useLookbooks, useCreateLookbook, useTr } from '../../hooks';\nimport { COO_FILE_FOLDERS } from '../../hooks/useFiles';\nimport { parseCsv, titleCase } from '../../utils/formatters';\nimport type { CooVisibility } from '../../types';\n\nconst VISIBILITIES: CooVisibility[] = ['PRIVATE', 'FOLLOWERS', 'PUBLIC'];\n\nexport function LookbooksListPage() {\n const { navigateTo } = useCoolAndLovely();\n const tr = useTr();\n const query = useLookbooks();\n const createLookbook = useCreateLookbook();\n\n const [creating, setCreating] = useState(false);\n const [name, setName] = useState('');\n const [description, setDescription] = useState('');\n const [visibility, setVisibility] = useState<CooVisibility>('PRIVATE');\n const [tags, setTags] = useState('');\n const [coverFileId, setCoverFileId] = useState('');\n const [nameError, setNameError] = useState<string | undefined>();\n\n const lookbooks = query.data ?? [];\n const visibilityOptions = useMemo(\n () =>\n VISIBILITIES.map((v) => ({\n value: v,\n label: tr(`coolandlovely.visibility.${v.toLowerCase()}`, titleCase(v)),\n })),\n [tr]\n );\n\n const handleCreate = (e: React.FormEvent) => {\n e.preventDefault();\n if (!name.trim()) {\n setNameError(tr('coolandlovely.validation.nameRequired', 'Name is required'));\n return;\n }\n setNameError(undefined);\n createLookbook.mutate(\n {\n name: name.trim(),\n description: description.trim() || undefined,\n visibility,\n tags: parseCsv(tags),\n coverFileId: coverFileId || undefined,\n },\n {\n onSuccess: (lb) => {\n setCreating(false);\n setName('');\n setDescription('');\n setTags('');\n setVisibility('PRIVATE');\n setCoverFileId('');\n navigateTo(`/lookbooks/${lb.id}`);\n },\n }\n );\n };\n\n return (\n <PageLayout\n title={tr('coolandlovely.page.lookbooksTitle', 'Lookbooks')}\n description={tr(\n 'coolandlovely.page.lookbooksSubtitle',\n 'Themed boards of saved catalogue pieces and looks'\n )}\n actions={\n <button\n type=\"button\"\n onClick={() => setCreating((v) => !v)}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90\"\n >\n {creating ? <X className=\"h-4 w-4\" /> : <Plus className=\"h-4 w-4\" />}\n {creating\n ? tr('coolandlovely.actions.close', 'Close')\n : tr('coolandlovely.actions.newLookbook', 'New lookbook')}\n </button>\n }\n >\n {creating && (\n <form onSubmit={handleCreate} className=\"mb-6\">\n <GlassCard treatment=\"plain\" className=\"p-5\">\n <h2 className=\"mb-4 flex items-center gap-2 text-base font-semibold text-text-primary\">\n <BookHeart className=\"h-5 w-5\" />{' '}\n {tr('coolandlovely.actions.newLookbook', 'New lookbook')}\n </h2>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <TextField\n label={tr('coolandlovely.field.name', 'Name')}\n value={name}\n onChange={setName}\n placeholder={tr('coolandlovely.placeholder.lookbookName', 'Summer wedding guest')}\n required\n error={nameError}\n />\n <SelectField\n label={tr('coolandlovely.field.visibility', 'Visibility')}\n value={visibility}\n onChange={(v) => setVisibility(v as CooVisibility)}\n options={visibilityOptions}\n />\n </div>\n <TextAreaField\n label={tr('coolandlovely.field.description', 'Description')}\n value={description}\n onChange={setDescription}\n placeholder={tr(\n 'coolandlovely.placeholder.lookbookDescription',\n 'What this board is for…'\n )}\n rows={2}\n className=\"mt-4\"\n />\n <TextField\n label={tr('coolandlovely.field.tags', 'Tags')}\n value={tags}\n onChange={setTags}\n placeholder={tr('coolandlovely.placeholder.tags', 'summer, formal')}\n hint={tr('coolandlovely.hint.commaSeparated', 'Comma-separated')}\n className=\"mt-4\"\n />\n <ImageUploadField\n label={tr('coolandlovely.field.coverImage', 'Cover image')}\n aspect=\"wide\"\n value={coverFileId}\n onChange={setCoverFileId}\n folder={COO_FILE_FOLDERS.lookbooks}\n className=\"mt-4\"\n />\n {createLookbook.isError && (\n <p className=\"mt-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text\">\n {createLookbook.error instanceof Error\n ? createLookbook.error.message\n : tr('coolandlovely.error.generic', 'Something went wrong')}\n </p>\n )}\n <div className=\"mt-4 flex justify-end\">\n <button\n type=\"submit\"\n disabled={createLookbook.isPending}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-5 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50\"\n >\n {createLookbook.isPending ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n ) : (\n <Plus className=\"h-4 w-4\" />\n )}\n {tr('coolandlovely.actions.createLookbook', 'Create lookbook')}\n </button>\n </div>\n </GlassCard>\n </form>\n )}\n\n {query.isLoading ? (\n <LoadingView label={tr('coolandlovely.loading.lookbooks', 'Loading lookbooks…')} />\n ) : query.isError ? (\n <ErrorView onRetry={() => void query.refetch()} />\n ) : lookbooks.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n icon={<BookHeart className=\"h-10 w-10\" />}\n title={tr('coolandlovely.empty.lookbooksTitle', 'No lookbooks yet')}\n description={tr(\n 'coolandlovely.empty.lookbooksDescription',\n 'Create a themed board to clip catalogue pieces and looks.'\n )}\n action={\n <button\n type=\"button\"\n onClick={() => setCreating(true)}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text\"\n >\n <Plus className=\"h-4 w-4\" /> {tr('coolandlovely.actions.newLookbook', 'New lookbook')}\n </button>\n }\n />\n ) : (\n <div className=\"grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3\">\n {lookbooks.map((lb) => (\n <LookbookCard\n key={lb.id}\n lookbook={lb}\n onClick={() => navigateTo(`/lookbooks/${lb.id}`)}\n />\n ))}\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,IAAM,IAAgC;CAAC;CAAW;CAAa;CAAS;AAExE,SAAgB,IAAoB;CAClC,IAAM,EAAE,kBAAe,GAAkB,EACnC,IAAK,GAAO,EACZ,IAAQ,GAAc,EACtB,IAAiB,GAAmB,EAEpC,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAM,KAAW,EAAS,GAAG,EAC9B,CAAC,GAAa,KAAkB,EAAS,GAAG,EAC5C,CAAC,GAAY,KAAiB,EAAwB,UAAU,EAChE,CAAC,GAAM,KAAW,EAAS,GAAG,EAC9B,CAAC,GAAa,KAAkB,EAAS,GAAG,EAC5C,CAAC,GAAW,KAAgB,GAA8B,EAE1D,IAAY,EAAM,QAAQ,EAAE,EAC5B,IAAoB,QAEtB,EAAa,KAAK,OAAO;EACvB,OAAO;EACP,OAAO,EAAG,4BAA4B,EAAE,aAAa,IAAI,EAAU,EAAE,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AAD;IACE,MAAK;IACL,eAAe,EAAY,GAAK;IAChC,WAAU;cAHZ;KAKE,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA;;KAAE,EAAG,qCAAqC,eAAe;KAC9E;;GAEX,CAAA,GAEF,kBAAC,OAAD;GAAK,WAAU;aACZ,EAAU,KAAK,MACd,kBAAC,GAAD;IAEE,UAAU;IACV,eAAe,EAAW,cAAc,EAAG,KAAK;IAChD,EAHK,EAAG,GAGR,CACF;GACE,CAAA,CAEG"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useCoolAndLovely as e } from "../../context/CoolAndLovelyContext.js";
|
|
2
2
|
import { cn as t } from "../../utils/cn.js";
|
|
3
3
|
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { Thumbnail as o } from "../../components/Thumbnail.js";
|
|
7
|
-
import { useDeleteLook as s, useLikeLook as c, useLook as l, usePublishLook as u, useSaveLook as d, useUnlikeLook as f, useUnsaveLook as p, useUpdateLook as m } from "../../hooks/useCoolAndLovelyApi.js";
|
|
8
|
-
import { AddToLookbookButton as h } from "../../components/AddToLookbookButton.js";
|
|
9
|
-
import { formatDate as g, titleCase as _ } from "../../utils/formatters.js";
|
|
10
|
-
import { useAssistantEntityName as v } from "../../hooks/useAssistantEntity.js";
|
|
4
|
+
import { useDeleteLook as r, useLikeLook as i, useLook as a, usePublishLook as o, useSaveLook as s, useUnlikeLook as c, useUnsaveLook as l, useUpdateLook as u } from "../../hooks/useCoolAndLovelyApi.js";
|
|
5
|
+
import { useAssistantEntityName as d } from "../../hooks/useAssistantEntity.js";
|
|
11
6
|
import "../../hooks/index.js";
|
|
7
|
+
import { StatusBadge as f } from "../../components/StatusBadge.js";
|
|
8
|
+
import { ErrorView as p, LoadingView as m } from "../../components/StateViews.js";
|
|
9
|
+
import { Thumbnail as h } from "../../components/Thumbnail.js";
|
|
10
|
+
import { AddToLookbookButton as g } from "../../components/AddToLookbookButton.js";
|
|
11
|
+
import { formatDate as _, titleCase as v } from "../../utils/formatters.js";
|
|
12
12
|
import { TagList as y } from "../../components/TagList.js";
|
|
13
13
|
import { Comments as b } from "../../components/Comments.js";
|
|
14
14
|
import { FollowButton as x } from "../../components/FollowButton.js";
|
|
@@ -58,14 +58,14 @@ function z({ authorId: t }) {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
function B() {
|
|
61
|
-
let { lookId: C } = N(), { navigateTo: w, currentUser: L } = e(), R =
|
|
62
|
-
if (
|
|
61
|
+
let { lookId: C } = N(), { navigateTo: w, currentUser: L } = e(), R = a(C), B = i(), V = c(), H = s(), U = l(), W = o(), G = r(), K = u();
|
|
62
|
+
if (d(C, R.data?.title), R.isLoading) return /* @__PURE__ */ P(n, {
|
|
63
63
|
title: "Look",
|
|
64
|
-
children: /* @__PURE__ */ P(
|
|
64
|
+
children: /* @__PURE__ */ P(m, { label: "Loading look…" })
|
|
65
65
|
});
|
|
66
66
|
if (R.isError || !R.data) return /* @__PURE__ */ P(n, {
|
|
67
67
|
title: "Look",
|
|
68
|
-
children: /* @__PURE__ */ P(
|
|
68
|
+
children: /* @__PURE__ */ P(p, {
|
|
69
69
|
title: "Look not found",
|
|
70
70
|
onRetry: () => void R.refetch()
|
|
71
71
|
})
|
|
@@ -73,7 +73,7 @@ function B() {
|
|
|
73
73
|
let q = R.data, J = q.items ?? [], Y = q.publishedAt !== null, X = !!(L?.id && L.id === q.authorId);
|
|
74
74
|
return /* @__PURE__ */ P(n, {
|
|
75
75
|
title: q.title,
|
|
76
|
-
description:
|
|
76
|
+
description: v(q.occasion),
|
|
77
77
|
actions: /* @__PURE__ */ F("div", {
|
|
78
78
|
className: "flex flex-wrap items-center gap-2",
|
|
79
79
|
children: [
|
|
@@ -83,7 +83,7 @@ function B() {
|
|
|
83
83
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
84
84
|
children: [/* @__PURE__ */ P(T, { className: "h-4 w-4" }), " Back"]
|
|
85
85
|
}),
|
|
86
|
-
/* @__PURE__ */ P(
|
|
86
|
+
/* @__PURE__ */ P(g, { lookId: q.id }),
|
|
87
87
|
/* @__PURE__ */ F("button", {
|
|
88
88
|
type: "button",
|
|
89
89
|
disabled: K.isPending,
|
|
@@ -119,7 +119,7 @@ function B() {
|
|
|
119
119
|
/* @__PURE__ */ F(I, {
|
|
120
120
|
treatment: "glass",
|
|
121
121
|
className: "group overflow-hidden p-0",
|
|
122
|
-
children: [/* @__PURE__ */ P(
|
|
122
|
+
children: [/* @__PURE__ */ P(h, {
|
|
123
123
|
icon: /* @__PURE__ */ P(A, { className: "h-14 w-14" }),
|
|
124
124
|
seed: q.id,
|
|
125
125
|
fileId: q.image?.id,
|
|
@@ -136,7 +136,7 @@ function B() {
|
|
|
136
136
|
children: q.title
|
|
137
137
|
}),
|
|
138
138
|
q.isFeatured && /* @__PURE__ */ P(j, { className: "h-4 w-4 fill-status-warning-text text-status-warning-text" }),
|
|
139
|
-
/* @__PURE__ */ P(
|
|
139
|
+
/* @__PURE__ */ P(f, {
|
|
140
140
|
status: Y ? "published" : "draft",
|
|
141
141
|
className: "ml-auto"
|
|
142
142
|
})
|
|
@@ -247,7 +247,7 @@ function B() {
|
|
|
247
247
|
children: "Occasion"
|
|
248
248
|
}), /* @__PURE__ */ P("dd", {
|
|
249
249
|
className: "text-text-primary",
|
|
250
|
-
children:
|
|
250
|
+
children: v(q.occasion)
|
|
251
251
|
})]
|
|
252
252
|
}),
|
|
253
253
|
/* @__PURE__ */ F("div", {
|
|
@@ -257,7 +257,7 @@ function B() {
|
|
|
257
257
|
children: "Visibility"
|
|
258
258
|
}), /* @__PURE__ */ P("dd", {
|
|
259
259
|
className: "text-text-primary",
|
|
260
|
-
children:
|
|
260
|
+
children: v(q.visibility)
|
|
261
261
|
})]
|
|
262
262
|
}),
|
|
263
263
|
/* @__PURE__ */ F("div", {
|
|
@@ -267,7 +267,7 @@ function B() {
|
|
|
267
267
|
children: "Published"
|
|
268
268
|
}), /* @__PURE__ */ P("dd", {
|
|
269
269
|
className: "text-text-primary",
|
|
270
|
-
children: q.publishedAt ?
|
|
270
|
+
children: q.publishedAt ? _(q.publishedAt, {
|
|
271
271
|
hour: void 0,
|
|
272
272
|
minute: void 0
|
|
273
273
|
}) : "—"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useCoolAndLovely as e } from "../../context/CoolAndLovelyContext.js";
|
|
2
2
|
import { cn as t } from "../../utils/cn.js";
|
|
3
3
|
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { formatPrice as o, parseCsv as s, titleCase as c } from "../../utils/formatters.js";
|
|
4
|
+
import { useCollaborations as r, useCreateLook as ee, useStyleItems as i, useUpdateLook as a } from "../../hooks/useCoolAndLovelyApi.js";
|
|
5
|
+
import { COO_FILE_FOLDERS as te } from "../../hooks/useFiles.js";
|
|
7
6
|
import "../../hooks/index.js";
|
|
7
|
+
import { formatPrice as o, parseCsv as s, titleCase as c } from "../../utils/formatters.js";
|
|
8
8
|
import { SelectField as l, TextAreaField as ne, TextField as u, ToggleField as re } from "../../components/Field.js";
|
|
9
9
|
import { ImageUploadField as d } from "../../components/ImageUploadField.js";
|
|
10
10
|
import { useMemo as f, useState as p } from "react";
|
|
@@ -27,10 +27,10 @@ var y = [
|
|
|
27
27
|
"PRIVATE"
|
|
28
28
|
];
|
|
29
29
|
function x() {
|
|
30
|
-
let { navigateTo: x, currentUser: S } = e(), C =
|
|
30
|
+
let { navigateTo: x, currentUser: S } = e(), C = ee(), w = a(), T = i({ pagination: {
|
|
31
31
|
limit: 100,
|
|
32
32
|
offset: 0
|
|
33
|
-
} }), E =
|
|
33
|
+
} }), E = r(S?.id ? { creatorId: S.id } : {}), [D, ce] = p(""), [O, k] = p(""), [A, j] = p("EVERYDAY"), [M, N] = p("PUBLIC"), [P, F] = p(""), [I, L] = p(""), [R, z] = p(""), [B, V] = p(!1), [H, U] = p([]), [W, G] = p(""), [le, K] = p(), q = f(() => (T.data?.items ?? []).filter((e) => e.status !== "RETIRED"), [T.data]), J = f(() => q.map((e) => ({
|
|
34
34
|
value: e.id,
|
|
35
35
|
label: `${e.name}${e.brand?.name ? ` · ${e.brand.name}` : ""} — ${o(e.price, e.currency)}`
|
|
36
36
|
})), [q]), Y = f(() => {
|
|
@@ -132,7 +132,7 @@ function x() {
|
|
|
132
132
|
aspect: "wide",
|
|
133
133
|
value: I,
|
|
134
134
|
onChange: L,
|
|
135
|
-
folder:
|
|
135
|
+
folder: te.looks,
|
|
136
136
|
hint: "The styled outfit shot",
|
|
137
137
|
className: "mt-4"
|
|
138
138
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LookFormPage.js","names":[],"sources":["../../../../src/coolandlovely/pages/looks/LookFormPage.tsx"],"sourcesContent":["/**\n * Look Create Page\n * @module coolandlovely/pages/looks\n *\n * Drives `cooCreateLook`. A look is created with its title/occasion/visibility\n * and an inline list of look items (catalogue pieces + styling notes), matching\n * the `CooCreateLookInput` shape exactly.\n */\n\nimport { useMemo, useState } from 'react';\nimport { ArrowLeft, Loader2, Plus, Save, Sparkles, X } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { TextField, TextAreaField, SelectField, ToggleField } from '../../components/Field';\nimport { ImageUploadField } from '../../components/ImageUploadField';\nimport { useCoolAndLovely } from '../../context/CoolAndLovelyContext';\nimport { useCreateLook, useUpdateLook, useStyleItems, useCollaborations } from '../../hooks';\nimport { COO_FILE_FOLDERS } from '../../hooks/useFiles';\nimport { parseCsv, titleCase, formatPrice } from '../../utils/formatters';\nimport { cn } from '../../utils/cn';\nimport type { CooLookOccasion, CooVisibility, CooLookItemInput } from '../../types';\n\nconst OCCASIONS: CooLookOccasion[] = [\n 'EVERYDAY',\n 'WORK',\n 'EVENING',\n 'WEDDING_GUEST',\n 'VACATION',\n 'PARTY',\n 'ACTIVE',\n 'OTHER',\n];\n\nconst VISIBILITIES: CooVisibility[] = ['PUBLIC', 'FOLLOWERS', 'PRIVATE'];\n\ninterface DraftItem {\n styleItemId: string;\n styling: string;\n}\n\nexport function LookFormPage() {\n const { navigateTo, currentUser } = useCoolAndLovely();\n const createLook = useCreateLook();\n const updateLook = useUpdateLook();\n const styleItems = useStyleItems({ pagination: { limit: 100, offset: 0 } });\n // The caller's own collaborations — a look can be attributed to one.\n const collaborations = useCollaborations(currentUser?.id ? { creatorId: currentUser.id } : {});\n\n const [title, setTitle] = useState('');\n const [caption, setCaption] = useState('');\n const [occasion, setOccasion] = useState<CooLookOccasion>('EVERYDAY');\n const [visibility, setVisibility] = useState<CooVisibility>('PUBLIC');\n const [tags, setTags] = useState('');\n const [imageFileId, setImageFileId] = useState('');\n const [collaborationId, setCollaborationId] = useState('');\n const [isFeatured, setIsFeatured] = useState(false);\n const [draftItems, setDraftItems] = useState<DraftItem[]>([]);\n const [addValue, setAddValue] = useState('');\n const [titleError, setTitleError] = useState<string | undefined>();\n\n const usableItems = useMemo(\n () => (styleItems.data?.items ?? []).filter((i) => i.status !== 'RETIRED'),\n [styleItems.data]\n );\n\n const itemOptions = useMemo(\n () =>\n usableItems.map((i) => ({\n value: i.id,\n label: `${i.name}${i.brand?.name ? ` · ${i.brand.name}` : ''} — ${formatPrice(i.price, i.currency)}`,\n })),\n [usableItems]\n );\n\n // Pieces not yet added — the right-rail \"add\" picker only offers these.\n const availableOptions = useMemo(() => {\n const chosen = new Set(draftItems.map((d) => d.styleItemId));\n return itemOptions.filter((o) => !chosen.has(o.value));\n }, [itemOptions, draftItems]);\n\n const collaborationOptions = useMemo(\n () => (collaborations.data ?? []).map((c) => ({ value: c.id, label: c.title })),\n [collaborations.data]\n );\n\n const occasionOptions = OCCASIONS.map((o) => ({ value: o, label: titleCase(o) }));\n const visibilityOptions = VISIBILITIES.map((v) => ({ value: v, label: titleCase(v) }));\n\n const addDraftItem = (styleItemId: string) => {\n if (!styleItemId) return;\n setDraftItems((d) =>\n d.some((it) => it.styleItemId === styleItemId) ? d : [...d, { styleItemId, styling: '' }]\n );\n };\n const removeDraftItem = (idx: number) => setDraftItems((d) => d.filter((_, i) => i !== idx));\n const setDraftItem = (idx: number, patch: Partial<DraftItem>) =>\n setDraftItems((d) => d.map((it, i) => (i === idx ? { ...it, ...patch } : it)));\n\n const submitting = createLook.isPending || updateLook.isPending;\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n if (!title.trim()) {\n setTitleError('Title is required');\n return;\n }\n setTitleError(undefined);\n\n const items: CooLookItemInput[] = draftItems\n .filter((d) => d.styleItemId)\n .map((d, idx) => ({\n styleItemId: d.styleItemId,\n position: idx,\n styling: d.styling.trim() || undefined,\n }));\n\n createLook.mutate(\n {\n title: title.trim(),\n caption: caption.trim() || undefined,\n occasion,\n visibility,\n collaborationId: collaborationId || undefined,\n imageFileId: imageFileId || undefined,\n tags: parseCsv(tags),\n items: items.length > 0 ? items : undefined,\n },\n {\n onSuccess: (look) => {\n // isFeatured is only settable via update — feature right after create.\n if (isFeatured) {\n updateLook.mutate(\n { id: look.id, input: { isFeatured: true } },\n { onSuccess: () => navigateTo(`/looks/${look.id}`) }\n );\n } else {\n navigateTo(`/looks/${look.id}`);\n }\n },\n }\n );\n };\n\n return (\n <PageLayout\n title=\"New look\"\n description=\"Compose a shop-the-look outfit from catalogue pieces\"\n actions={\n <button\n type=\"button\"\n onClick={() => navigateTo('/looks')}\n className=\"inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken\"\n >\n <ArrowLeft className=\"h-4 w-4\" /> Cancel\n </button>\n }\n >\n <form onSubmit={handleSubmit} className=\"mx-auto max-w-2xl\">\n <GlassCard treatment=\"plain\" className=\"p-6\">\n <div className=\"mb-6 flex items-center gap-3\">\n <div className=\"flex h-11 w-11 items-center justify-center rounded-lg bg-status-success-bg-subtle text-status-success-text\">\n <Sparkles className=\"h-5 w-5\" />\n </div>\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">Look details</h2>\n <p className=\"text-xs text-text-secondary\">\n Created as a draft — publish it from the look page.\n </p>\n </div>\n </div>\n\n <TextField\n id=\"title\"\n label=\"Title\"\n value={title}\n onChange={setTitle}\n placeholder=\"Coastal grandma, refined\"\n required\n error={titleError}\n />\n\n <TextAreaField\n id=\"caption\"\n label=\"Caption\"\n value={caption}\n onChange={setCaption}\n placeholder=\"How to style it…\"\n rows={3}\n className=\"mt-4\"\n />\n\n <ImageUploadField\n label=\"Look photo\"\n aspect=\"wide\"\n value={imageFileId}\n onChange={setImageFileId}\n folder={COO_FILE_FOLDERS.looks}\n hint=\"The styled outfit shot\"\n className=\"mt-4\"\n />\n\n <div className=\"mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <SelectField\n id=\"occasion\"\n label=\"Occasion\"\n value={occasion}\n onChange={(v) => setOccasion(v as CooLookOccasion)}\n options={occasionOptions}\n />\n <SelectField\n id=\"visibility\"\n label=\"Visibility\"\n value={visibility}\n onChange={(v) => setVisibility(v as CooVisibility)}\n options={visibilityOptions}\n />\n </div>\n\n <SelectField\n id=\"collaborationId\"\n label=\"Collaboration (optional)\"\n value={collaborationId}\n onChange={setCollaborationId}\n options={collaborationOptions}\n placeholder={\n collaborations.isLoading\n ? 'Loading collaborations…'\n : collaborationOptions.length === 0\n ? 'No collaborations yet'\n : 'Not part of a collaboration'\n }\n hint=\"Attribute this look to one of your collaborations\"\n className=\"mt-4\"\n />\n\n <TextField\n id=\"tags\"\n label=\"Tags\"\n value={tags}\n onChange={setTags}\n placeholder=\"linen, neutral\"\n hint=\"Comma-separated\"\n className=\"mt-4\"\n />\n\n <ToggleField\n id=\"isFeatured\"\n label=\"Feature this look\"\n checked={isFeatured}\n onChange={setIsFeatured}\n hint=\"Featured looks surface in the Featured filter and carry a star badge.\"\n className=\"mt-4\"\n />\n\n {/* Look items */}\n <div className=\"mt-6\">\n <div className=\"mb-3 flex flex-col gap-3 sm:flex-row sm:items-end\">\n <div className=\"flex-1\">\n <SelectField\n id=\"add-style-item\"\n label=\"Pieces in this look\"\n value={addValue}\n onChange={setAddValue}\n options={availableOptions}\n placeholder={\n styleItems.isLoading\n ? 'Loading catalogue…'\n : availableOptions.length === 0\n ? 'All available pieces are already added'\n : 'Select a catalogue piece'\n }\n />\n </div>\n <button\n type=\"button\"\n disabled={!addValue}\n onClick={() => {\n addDraftItem(addValue);\n setAddValue('');\n }}\n className=\"inline-flex items-center justify-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <Plus className=\"h-4 w-4\" /> Add piece\n </button>\n </div>\n {draftItems.length === 0 ? (\n <p className=\"rounded-lg border border-dashed border-border-seam p-4 text-center text-xs text-text-secondary\">\n No pieces added yet. A look can be published without pieces and styled later.\n </p>\n ) : (\n <div className=\"space-y-3\">\n {draftItems.map((di, idx) => (\n <div key={idx} className=\"rounded-lg border border-border-seam bg-bg-surface p-3\">\n <div className=\"flex items-start gap-2\">\n <div className=\"flex-1 space-y-2\">\n <SelectField\n label={`Piece ${idx + 1}`}\n value={di.styleItemId}\n onChange={(v) => setDraftItem(idx, { styleItemId: v })}\n options={itemOptions}\n placeholder={\n styleItems.isLoading ? 'Loading items…' : 'Select a style item'\n }\n />\n <TextField\n label=\"Styling note\"\n value={di.styling}\n onChange={(v) => setDraftItem(idx, { styling: v })}\n placeholder=\"Cuff the sleeves, tuck the front…\"\n />\n </div>\n <button\n type=\"button\"\n onClick={() => removeDraftItem(idx)}\n aria-label=\"Remove piece\"\n className={cn(\n 'mt-7 inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg',\n 'text-text-secondary transition-colors hover:bg-status-error-bg-subtle hover:text-status-error-text'\n )}\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {createLook.isError && (\n <p className=\"mt-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text\">\n {createLook.error instanceof Error\n ? createLook.error.message\n : 'Something went wrong'}\n </p>\n )}\n\n <div className=\"mt-6 flex justify-end gap-2\">\n <button\n type=\"submit\"\n disabled={submitting}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-5 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50\"\n >\n {submitting ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n ) : (\n <Save className=\"h-4 w-4\" />\n )}\n Create look\n </button>\n </div>\n </GlassCard>\n </form>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAsBA,IAAM,IAA+B;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,EAEK,IAAgC;CAAC;CAAU;CAAa;CAAU;AAOxE,SAAgB,IAAe;CAC7B,IAAM,EAAE,eAAY,mBAAgB,GAAkB,EAChD,IAAa,GAAe,EAC5B,IAAa,IAAe,EAC5B,IAAa,EAAc,EAAE,YAAY;EAAE,OAAO;EAAK,QAAQ;EAAG,EAAE,CAAC,EAErE,IAAiB,GAAkB,GAAa,KAAK,EAAE,WAAW,EAAY,IAAI,GAAG,EAAE,CAAC,EAExF,CAAC,GAAO,MAAY,EAAS,GAAG,EAChC,CAAC,GAAS,KAAc,EAAS,GAAG,EACpC,CAAC,GAAU,KAAe,EAA0B,WAAW,EAC/D,CAAC,GAAY,KAAiB,EAAwB,SAAS,EAC/D,CAAC,GAAM,KAAW,EAAS,GAAG,EAC9B,CAAC,GAAa,KAAkB,EAAS,GAAG,EAC5C,CAAC,GAAiB,KAAsB,EAAS,GAAG,EACpD,CAAC,GAAY,KAAiB,EAAS,GAAM,EAC7C,CAAC,GAAY,KAAiB,EAAsB,EAAE,CAAC,EACvD,CAAC,GAAU,KAAe,EAAS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version":3,"file":"LookFormPage.js","names":[],"sources":["../../../../src/coolandlovely/pages/looks/LookFormPage.tsx"],"sourcesContent":["/**\n * Look Create Page\n * @module coolandlovely/pages/looks\n *\n * Drives `cooCreateLook`. A look is created with its title/occasion/visibility\n * and an inline list of look items (catalogue pieces + styling notes), matching\n * the `CooCreateLookInput` shape exactly.\n */\n\nimport { useMemo, useState } from 'react';\nimport { ArrowLeft, Loader2, Plus, Save, Sparkles, X } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { TextField, TextAreaField, SelectField, ToggleField } from '../../components/Field';\nimport { ImageUploadField } from '../../components/ImageUploadField';\nimport { useCoolAndLovely } from '../../context/CoolAndLovelyContext';\nimport { useCreateLook, useUpdateLook, useStyleItems, useCollaborations } from '../../hooks';\nimport { COO_FILE_FOLDERS } from '../../hooks/useFiles';\nimport { parseCsv, titleCase, formatPrice } from '../../utils/formatters';\nimport { cn } from '../../utils/cn';\nimport type { CooLookOccasion, CooVisibility, CooLookItemInput } from '../../types';\n\nconst OCCASIONS: CooLookOccasion[] = [\n 'EVERYDAY',\n 'WORK',\n 'EVENING',\n 'WEDDING_GUEST',\n 'VACATION',\n 'PARTY',\n 'ACTIVE',\n 'OTHER',\n];\n\nconst VISIBILITIES: CooVisibility[] = ['PUBLIC', 'FOLLOWERS', 'PRIVATE'];\n\ninterface DraftItem {\n styleItemId: string;\n styling: string;\n}\n\nexport function LookFormPage() {\n const { navigateTo, currentUser } = useCoolAndLovely();\n const createLook = useCreateLook();\n const updateLook = useUpdateLook();\n const styleItems = useStyleItems({ pagination: { limit: 100, offset: 0 } });\n // The caller's own collaborations — a look can be attributed to one.\n const collaborations = useCollaborations(currentUser?.id ? { creatorId: currentUser.id } : {});\n\n const [title, setTitle] = useState('');\n const [caption, setCaption] = useState('');\n const [occasion, setOccasion] = useState<CooLookOccasion>('EVERYDAY');\n const [visibility, setVisibility] = useState<CooVisibility>('PUBLIC');\n const [tags, setTags] = useState('');\n const [imageFileId, setImageFileId] = useState('');\n const [collaborationId, setCollaborationId] = useState('');\n const [isFeatured, setIsFeatured] = useState(false);\n const [draftItems, setDraftItems] = useState<DraftItem[]>([]);\n const [addValue, setAddValue] = useState('');\n const [titleError, setTitleError] = useState<string | undefined>();\n\n const usableItems = useMemo(\n () => (styleItems.data?.items ?? []).filter((i) => i.status !== 'RETIRED'),\n [styleItems.data]\n );\n\n const itemOptions = useMemo(\n () =>\n usableItems.map((i) => ({\n value: i.id,\n label: `${i.name}${i.brand?.name ? ` · ${i.brand.name}` : ''} — ${formatPrice(i.price, i.currency)}`,\n })),\n [usableItems]\n );\n\n // Pieces not yet added — the right-rail \"add\" picker only offers these.\n const availableOptions = useMemo(() => {\n const chosen = new Set(draftItems.map((d) => d.styleItemId));\n return itemOptions.filter((o) => !chosen.has(o.value));\n }, [itemOptions, draftItems]);\n\n const collaborationOptions = useMemo(\n () => (collaborations.data ?? []).map((c) => ({ value: c.id, label: c.title })),\n [collaborations.data]\n );\n\n const occasionOptions = OCCASIONS.map((o) => ({ value: o, label: titleCase(o) }));\n const visibilityOptions = VISIBILITIES.map((v) => ({ value: v, label: titleCase(v) }));\n\n const addDraftItem = (styleItemId: string) => {\n if (!styleItemId) return;\n setDraftItems((d) =>\n d.some((it) => it.styleItemId === styleItemId) ? d : [...d, { styleItemId, styling: '' }]\n );\n };\n const removeDraftItem = (idx: number) => setDraftItems((d) => d.filter((_, i) => i !== idx));\n const setDraftItem = (idx: number, patch: Partial<DraftItem>) =>\n setDraftItems((d) => d.map((it, i) => (i === idx ? { ...it, ...patch } : it)));\n\n const submitting = createLook.isPending || updateLook.isPending;\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n if (!title.trim()) {\n setTitleError('Title is required');\n return;\n }\n setTitleError(undefined);\n\n const items: CooLookItemInput[] = draftItems\n .filter((d) => d.styleItemId)\n .map((d, idx) => ({\n styleItemId: d.styleItemId,\n position: idx,\n styling: d.styling.trim() || undefined,\n }));\n\n createLook.mutate(\n {\n title: title.trim(),\n caption: caption.trim() || undefined,\n occasion,\n visibility,\n collaborationId: collaborationId || undefined,\n imageFileId: imageFileId || undefined,\n tags: parseCsv(tags),\n items: items.length > 0 ? items : undefined,\n },\n {\n onSuccess: (look) => {\n // isFeatured is only settable via update — feature right after create.\n if (isFeatured) {\n updateLook.mutate(\n { id: look.id, input: { isFeatured: true } },\n { onSuccess: () => navigateTo(`/looks/${look.id}`) }\n );\n } else {\n navigateTo(`/looks/${look.id}`);\n }\n },\n }\n );\n };\n\n return (\n <PageLayout\n title=\"New look\"\n description=\"Compose a shop-the-look outfit from catalogue pieces\"\n actions={\n <button\n type=\"button\"\n onClick={() => navigateTo('/looks')}\n className=\"inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken\"\n >\n <ArrowLeft className=\"h-4 w-4\" /> Cancel\n </button>\n }\n >\n <form onSubmit={handleSubmit} className=\"mx-auto max-w-2xl\">\n <GlassCard treatment=\"plain\" className=\"p-6\">\n <div className=\"mb-6 flex items-center gap-3\">\n <div className=\"flex h-11 w-11 items-center justify-center rounded-lg bg-status-success-bg-subtle text-status-success-text\">\n <Sparkles className=\"h-5 w-5\" />\n </div>\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">Look details</h2>\n <p className=\"text-xs text-text-secondary\">\n Created as a draft — publish it from the look page.\n </p>\n </div>\n </div>\n\n <TextField\n id=\"title\"\n label=\"Title\"\n value={title}\n onChange={setTitle}\n placeholder=\"Coastal grandma, refined\"\n required\n error={titleError}\n />\n\n <TextAreaField\n id=\"caption\"\n label=\"Caption\"\n value={caption}\n onChange={setCaption}\n placeholder=\"How to style it…\"\n rows={3}\n className=\"mt-4\"\n />\n\n <ImageUploadField\n label=\"Look photo\"\n aspect=\"wide\"\n value={imageFileId}\n onChange={setImageFileId}\n folder={COO_FILE_FOLDERS.looks}\n hint=\"The styled outfit shot\"\n className=\"mt-4\"\n />\n\n <div className=\"mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <SelectField\n id=\"occasion\"\n label=\"Occasion\"\n value={occasion}\n onChange={(v) => setOccasion(v as CooLookOccasion)}\n options={occasionOptions}\n />\n <SelectField\n id=\"visibility\"\n label=\"Visibility\"\n value={visibility}\n onChange={(v) => setVisibility(v as CooVisibility)}\n options={visibilityOptions}\n />\n </div>\n\n <SelectField\n id=\"collaborationId\"\n label=\"Collaboration (optional)\"\n value={collaborationId}\n onChange={setCollaborationId}\n options={collaborationOptions}\n placeholder={\n collaborations.isLoading\n ? 'Loading collaborations…'\n : collaborationOptions.length === 0\n ? 'No collaborations yet'\n : 'Not part of a collaboration'\n }\n hint=\"Attribute this look to one of your collaborations\"\n className=\"mt-4\"\n />\n\n <TextField\n id=\"tags\"\n label=\"Tags\"\n value={tags}\n onChange={setTags}\n placeholder=\"linen, neutral\"\n hint=\"Comma-separated\"\n className=\"mt-4\"\n />\n\n <ToggleField\n id=\"isFeatured\"\n label=\"Feature this look\"\n checked={isFeatured}\n onChange={setIsFeatured}\n hint=\"Featured looks surface in the Featured filter and carry a star badge.\"\n className=\"mt-4\"\n />\n\n {/* Look items */}\n <div className=\"mt-6\">\n <div className=\"mb-3 flex flex-col gap-3 sm:flex-row sm:items-end\">\n <div className=\"flex-1\">\n <SelectField\n id=\"add-style-item\"\n label=\"Pieces in this look\"\n value={addValue}\n onChange={setAddValue}\n options={availableOptions}\n placeholder={\n styleItems.isLoading\n ? 'Loading catalogue…'\n : availableOptions.length === 0\n ? 'All available pieces are already added'\n : 'Select a catalogue piece'\n }\n />\n </div>\n <button\n type=\"button\"\n disabled={!addValue}\n onClick={() => {\n addDraftItem(addValue);\n setAddValue('');\n }}\n className=\"inline-flex items-center justify-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <Plus className=\"h-4 w-4\" /> Add piece\n </button>\n </div>\n {draftItems.length === 0 ? (\n <p className=\"rounded-lg border border-dashed border-border-seam p-4 text-center text-xs text-text-secondary\">\n No pieces added yet. A look can be published without pieces and styled later.\n </p>\n ) : (\n <div className=\"space-y-3\">\n {draftItems.map((di, idx) => (\n <div key={idx} className=\"rounded-lg border border-border-seam bg-bg-surface p-3\">\n <div className=\"flex items-start gap-2\">\n <div className=\"flex-1 space-y-2\">\n <SelectField\n label={`Piece ${idx + 1}`}\n value={di.styleItemId}\n onChange={(v) => setDraftItem(idx, { styleItemId: v })}\n options={itemOptions}\n placeholder={\n styleItems.isLoading ? 'Loading items…' : 'Select a style item'\n }\n />\n <TextField\n label=\"Styling note\"\n value={di.styling}\n onChange={(v) => setDraftItem(idx, { styling: v })}\n placeholder=\"Cuff the sleeves, tuck the front…\"\n />\n </div>\n <button\n type=\"button\"\n onClick={() => removeDraftItem(idx)}\n aria-label=\"Remove piece\"\n className={cn(\n 'mt-7 inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg',\n 'text-text-secondary transition-colors hover:bg-status-error-bg-subtle hover:text-status-error-text'\n )}\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {createLook.isError && (\n <p className=\"mt-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text\">\n {createLook.error instanceof Error\n ? createLook.error.message\n : 'Something went wrong'}\n </p>\n )}\n\n <div className=\"mt-6 flex justify-end gap-2\">\n <button\n type=\"submit\"\n disabled={submitting}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-5 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50\"\n >\n {submitting ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n ) : (\n <Save className=\"h-4 w-4\" />\n )}\n Create look\n </button>\n </div>\n </GlassCard>\n </form>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;A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S;WACT,aACE,EAAW,YAAY,mBAAmB;WAE5C,CAAA,EACF,kBAAC,GAAD;WACE,OAAM;WACN,OAAO,EAAG;WACV,WAAW,MAAM,EAAa,GAAK,EAAE,SAAS,GAAG,CAAC;WAClD,aAAY;WACZ,CAAA,CACE;aACN,kBAAC,UAAD;UACE,MAAK;UACL,eAAe,GAAgB,EAAI;UACnC,cAAW;UACX,WAAW,EACT,4EACA,qGACD;oBAED,kBAAC,IAAD,EAAG,WAAU,WAAY,CAAA;UAClB,CAAA,CACL;;QACF,EA/BI,EA+BJ,CACN;OACE,CAAA,CAEJ;;KAEL,EAAW,WACV,kBAAC,KAAD;MAAG,WAAU;gBACV,EAAW,iBAAiB,QACzB,EAAW,MAAM,UACjB;MACF,CAAA;KAGN,kBAAC,OAAD;MAAK,WAAU;gBACb,kBAAC,UAAD;OACE,MAAK;OACL,UAAU;OACV,WAAU;iBAHZ,CAKG,IACC,kBAAC,IAAD,EAAS,WAAU,wBAAyB,CAAA,GAE5C,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA,EAC5B,cAEK;;MACL,CAAA;KACI;;GACP,CAAA;EACI,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LooksListPage.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/pages/looks/LooksListPage.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"LooksListPage.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/pages/looks/LooksListPage.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA2BH,wBAAgB,aAAa,gCAqK5B"}
|